From f7cd0d9ee525956a6dcad53eeee0900ca0366283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Guill=C3=A9n?= Date: Sat, 5 Feb 2022 20:03:19 +0100 Subject: [PATCH] Updated compiled resources --- CTFd/themes/admin/static/js/components.dev.js | 36 +- CTFd/themes/admin/static/js/components.min.js | 2 +- CTFd/themes/admin/static/js/core.dev.js | 34 +- .../admin/static/js/echarts.bundle.dev.js | 2 +- .../admin/static/js/echarts.bundle.min.js | 11 +- CTFd/themes/admin/static/js/graphs.dev.js | 2 +- CTFd/themes/admin/static/js/helpers.dev.js | 8 +- CTFd/themes/admin/static/js/helpers.min.js | 2 +- .../admin/static/js/pages/challenge.min.js | 2 +- .../admin/static/js/pages/challenges.dev.js | 2 +- .../admin/static/js/pages/challenges.min.js | 2 +- .../admin/static/js/pages/configs.min.js | 2 +- .../admin/static/js/pages/editor.min.js | 2 +- CTFd/themes/admin/static/js/pages/main.min.js | 2 +- .../static/js/pages/notifications.min.js | 2 +- .../themes/admin/static/js/pages/pages.dev.js | 2 +- .../themes/admin/static/js/pages/pages.min.js | 2 +- .../themes/admin/static/js/pages/reset.min.js | 2 +- .../admin/static/js/pages/scoreboard.dev.js | 2 +- .../admin/static/js/pages/scoreboard.min.js | 2 +- .../admin/static/js/pages/statistics.min.js | 2 +- .../admin/static/js/pages/submissions.dev.js | 2 +- .../admin/static/js/pages/submissions.min.js | 2 +- CTFd/themes/admin/static/js/pages/team.dev.js | 2 +- CTFd/themes/admin/static/js/pages/team.min.js | 2 +- .../themes/admin/static/js/pages/teams.dev.js | 2 +- .../themes/admin/static/js/pages/teams.min.js | 2 +- CTFd/themes/admin/static/js/pages/user.dev.js | 2 +- CTFd/themes/admin/static/js/pages/user.min.js | 2 +- .../themes/admin/static/js/pages/users.dev.js | 2 +- .../themes/admin/static/js/pages/users.min.js | 2 +- .../admin/static/js/vendor.bundle.dev.js | 844 +++++------------- .../admin/static/js/vendor.bundle.min.js | 68 +- CTFd/themes/core/static/css/fonts.dev.css | 10 +- CTFd/themes/core/static/css/fonts.min.css | 10 +- CTFd/themes/core/static/css/main.min.css | 2 +- .../core/static/fonts/fa-brands-400.eot | Bin 134622 -> 134294 bytes .../core/static/fonts/fa-brands-400.svg | 220 +++-- .../core/static/fonts/fa-brands-400.ttf | Bin 134316 -> 133988 bytes .../core/static/fonts/fa-brands-400.woff | Bin 90672 -> 89988 bytes .../core/static/fonts/fa-brands-400.woff2 | Bin 77400 -> 76736 bytes .../core/static/fonts/fa-regular-400.eot | Bin 34350 -> 34034 bytes .../core/static/fonts/fa-regular-400.svg | 8 +- .../core/static/fonts/fa-regular-400.ttf | Bin 34052 -> 33736 bytes .../core/static/fonts/fa-regular-400.woff | Bin 16780 -> 16276 bytes .../core/static/fonts/fa-regular-400.woff2 | Bin 13600 -> 13224 bytes .../themes/core/static/fonts/fa-solid-900.eot | Bin 204266 -> 203030 bytes .../themes/core/static/fonts/fa-solid-900.svg | 41 +- .../themes/core/static/fonts/fa-solid-900.ttf | Bin 203980 -> 202744 bytes .../core/static/fonts/fa-solid-900.woff | Bin 104004 -> 101648 bytes .../core/static/fonts/fa-solid-900.woff2 | Bin 80148 -> 78268 bytes CTFd/themes/core/static/js/core.dev.js | 32 +- .../core/static/js/echarts.bundle.dev.js | 2 +- .../core/static/js/echarts.bundle.min.js | 11 +- CTFd/themes/core/static/js/helpers.dev.js | 8 +- CTFd/themes/core/static/js/helpers.min.js | 2 +- .../core/static/js/pages/challenges.dev.js | 2 +- .../core/static/js/pages/challenges.min.js | 2 +- CTFd/themes/core/static/js/pages/main.min.js | 2 +- .../core/static/js/pages/notifications.min.js | 2 +- .../core/static/js/pages/scoreboard.min.js | 2 +- .../core/static/js/pages/settings.min.js | 2 +- CTFd/themes/core/static/js/pages/setup.min.js | 2 +- CTFd/themes/core/static/js/pages/stats.dev.js | 4 +- CTFd/themes/core/static/js/pages/stats.min.js | 2 +- .../core/static/js/pages/teams/private.min.js | 2 +- .../core/static/js/vendor.bundle.dev.js | 642 +++---------- .../core/static/js/vendor.bundle.min.js | 62 +- 68 files changed, 668 insertions(+), 1459 deletions(-) diff --git a/CTFd/themes/admin/static/js/components.dev.js b/CTFd/themes/admin/static/js/components.dev.js index 05242d5a9..1c4104db6 100644 --- a/CTFd/themes/admin/static/js/components.dev.js +++ b/CTFd/themes/admin/static/js/components.dev.js @@ -822,7 +822,7 @@ eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../. /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\"div\", { staticClass: \"row mb-3\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"comment\" }, [\n _c(\"textarea\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.comment,\n expression: \"comment\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control mb-2\",\n attrs: {\n rows: \"2\",\n id: \"comment-input\",\n placeholder: \"Add comment\"\n },\n domProps: { value: _vm.comment },\n on: {\n change: function($event) {\n _vm.comment = $event.target.value\n }\n }\n }),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"btn btn-sm btn-success btn-outlined float-right\",\n attrs: { type: \"submit\" },\n on: {\n click: function($event) {\n return _vm.submitComment()\n }\n }\n },\n [_vm._v(\"\\n Comment\\n \")]\n )\n ])\n ])\n ]),\n _vm._v(\" \"),\n _vm.pages > 1\n ? _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.prev ? false : true },\n on: {\n click: function($event) {\n return _vm.prevPage()\n }\n }\n },\n [_vm._v(\"\\n <<<\\n \")]\n ),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.next ? false : true },\n on: {\n click: function($event) {\n return _vm.nextPage()\n }\n }\n },\n [_vm._v(\"\\n >>>\\n \")]\n )\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\n \"Page \" +\n _vm._s(_vm.page) +\n \" of \" +\n _vm._s(_vm.total) +\n \" comments\"\n )\n ])\n ])\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"comments\" },\n [\n _c(\n \"transition-group\",\n { attrs: { name: \"comment-card\" } },\n _vm._l(_vm.comments, function(comment) {\n return _c(\n \"div\",\n { key: comment.id, staticClass: \"comment-card card mb-2\" },\n [\n _c(\"div\", { staticClass: \"card-body pl-0 pb-0 pt-2 pr-2\" }, [\n _c(\n \"button\",\n {\n staticClass: \"close float-right\",\n attrs: { type: \"button\", \"aria-label\": \"Close\" },\n on: {\n click: function($event) {\n return _vm.deleteComment(comment.id)\n }\n }\n },\n [\n _c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [\n _vm._v(\"×\")\n ])\n ]\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-body\" }, [\n _c(\"div\", {\n staticClass: \"card-text\",\n domProps: { innerHTML: _vm._s(comment.html) }\n }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted float-left\" }, [\n _c(\"span\", [\n _c(\n \"a\",\n {\n attrs: {\n href:\n _vm.urlRoot + \"/admin/users/\" + comment.author_id\n }\n },\n [_vm._v(_vm._s(comment.author.name))]\n )\n ])\n ]),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted float-right\" }, [\n _c(\"span\", { staticClass: \"float-right\" }, [\n _vm._v(_vm._s(_vm.toLocalTime(comment.date)))\n ])\n ])\n ])\n ]\n )\n }),\n 0\n )\n ],\n 1\n ),\n _vm._v(\" \"),\n _vm.pages > 1\n ? _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.prev ? false : true },\n on: {\n click: function($event) {\n return _vm.prevPage()\n }\n }\n },\n [_vm._v(\"\\n <<<\\n \")]\n ),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.next ? false : true },\n on: {\n click: function($event) {\n return _vm.nextPage()\n }\n }\n },\n [_vm._v(\"\\n >>>\\n \")]\n )\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\n \"Page \" +\n _vm._s(_vm.page) +\n \" of \" +\n _vm._s(_vm.total) +\n \" comments\"\n )\n ])\n ])\n ])\n ])\n : _vm._e()\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/comments/CommentBox.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\"div\", { staticClass: \"row mb-3\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"comment\" }, [\n _c(\"textarea\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.comment,\n expression: \"comment\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control mb-2\",\n attrs: {\n rows: \"2\",\n id: \"comment-input\",\n placeholder: \"Add comment\",\n },\n domProps: { value: _vm.comment },\n on: {\n change: function ($event) {\n _vm.comment = $event.target.value\n },\n },\n }),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"btn btn-sm btn-success btn-outlined float-right\",\n attrs: { type: \"submit\" },\n on: {\n click: function ($event) {\n return _vm.submitComment()\n },\n },\n },\n [_vm._v(\"\\n Comment\\n \")]\n ),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _vm.pages > 1\n ? _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.prev ? false : true },\n on: {\n click: function ($event) {\n return _vm.prevPage()\n },\n },\n },\n [_vm._v(\"\\n <<<\\n \")]\n ),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.next ? false : true },\n on: {\n click: function ($event) {\n return _vm.nextPage()\n },\n },\n },\n [_vm._v(\"\\n >>>\\n \")]\n ),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\n \"Page \" +\n _vm._s(_vm.page) +\n \" of \" +\n _vm._s(_vm.total) +\n \" comments\"\n ),\n ]),\n ]),\n ]),\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"comments\" },\n [\n _c(\n \"transition-group\",\n { attrs: { name: \"comment-card\" } },\n _vm._l(_vm.comments, function (comment) {\n return _c(\n \"div\",\n { key: comment.id, staticClass: \"comment-card card mb-2\" },\n [\n _c(\"div\", { staticClass: \"card-body pl-0 pb-0 pt-2 pr-2\" }, [\n _c(\n \"button\",\n {\n staticClass: \"close float-right\",\n attrs: { type: \"button\", \"aria-label\": \"Close\" },\n on: {\n click: function ($event) {\n return _vm.deleteComment(comment.id)\n },\n },\n },\n [\n _c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [\n _vm._v(\"×\"),\n ]),\n ]\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-body\" }, [\n _c(\"div\", {\n staticClass: \"card-text\",\n domProps: { innerHTML: _vm._s(comment.html) },\n }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted float-left\" }, [\n _c(\"span\", [\n _c(\n \"a\",\n {\n attrs: {\n href:\n _vm.urlRoot + \"/admin/users/\" + comment.author_id,\n },\n },\n [_vm._v(_vm._s(comment.author.name))]\n ),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted float-right\" }, [\n _c(\"span\", { staticClass: \"float-right\" }, [\n _vm._v(_vm._s(_vm.toLocalTime(comment.date))),\n ]),\n ]),\n ]),\n ]\n )\n }),\n 0\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _vm.pages > 1\n ? _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.prev ? false : true },\n on: {\n click: function ($event) {\n return _vm.prevPage()\n },\n },\n },\n [_vm._v(\"\\n <<<\\n \")]\n ),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"btn btn-link p-0\",\n attrs: { type: \"button\", disabled: _vm.next ? false : true },\n on: {\n click: function ($event) {\n return _vm.nextPage()\n },\n },\n },\n [_vm._v(\"\\n >>>\\n \")]\n ),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\n \"Page \" +\n _vm._s(_vm.page) +\n \" of \" +\n _vm._s(_vm.total) +\n \" comments\"\n ),\n ]),\n ]),\n ]),\n ])\n : _vm._e(),\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/comments/CommentBox.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -834,7 +834,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"border-bottom\" }, [\n _c(\"div\", [\n _c(\n \"button\",\n {\n staticClass: \"close float-right\",\n attrs: { type: \"button\", \"aria-label\": \"Close\" },\n on: {\n click: function($event) {\n return _vm.deleteField()\n }\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-3\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Field Type\")]),\n _vm._v(\" \"),\n _c(\n \"select\",\n {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.field_type,\n expression: \"field.field_type\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control custom-select\",\n on: {\n change: function($event) {\n var $$selectedVal = Array.prototype.filter\n .call($event.target.options, function(o) {\n return o.selected\n })\n .map(function(o) {\n var val = \"_value\" in o ? o._value : o.value\n return val\n })\n _vm.$set(\n _vm.field,\n \"field_type\",\n $event.target.multiple ? $$selectedVal : $$selectedVal[0]\n )\n }\n }\n },\n [\n _c(\"option\", { attrs: { value: \"text\" } }, [\n _vm._v(\"Text Field\")\n ]),\n _vm._v(\" \"),\n _c(\"option\", { attrs: { value: \"boolean\" } }, [\n _vm._v(\"Checkbox\")\n ])\n ]\n ),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"form-text text-muted\" }, [\n _vm._v(\"Type of field shown to the user\")\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-9\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Field Name\")]),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.name,\n expression: \"field.name\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control\",\n attrs: { type: \"text\" },\n domProps: { value: _vm.field.name },\n on: {\n change: function($event) {\n return _vm.$set(_vm.field, \"name\", $event.target.value)\n }\n }\n }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"form-text text-muted\" }, [\n _vm._v(\"Field name\")\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Field Description\")]),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.description,\n expression: \"field.description\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control\",\n attrs: { type: \"text\" },\n domProps: { value: _vm.field.description },\n on: {\n change: function($event) {\n return _vm.$set(_vm.field, \"description\", $event.target.value)\n }\n }\n }),\n _vm._v(\" \"),\n _c(\n \"small\",\n { staticClass: \"form-text text-muted\", attrs: { id: \"emailHelp\" } },\n [_vm._v(\"Field Description\")]\n )\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-check\" }, [\n _c(\"label\", { staticClass: \"form-check-label\" }, [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.editable,\n expression: \"field.editable\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n checked: Array.isArray(_vm.field.editable)\n ? _vm._i(_vm.field.editable, null) > -1\n : _vm.field.editable\n },\n on: {\n change: function($event) {\n var $$a = _vm.field.editable,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = null,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n _vm.$set(_vm.field, \"editable\", $$a.concat([$$v]))\n } else {\n $$i > -1 &&\n _vm.$set(\n _vm.field,\n \"editable\",\n $$a.slice(0, $$i).concat($$a.slice($$i + 1))\n )\n }\n } else {\n _vm.$set(_vm.field, \"editable\", $$c)\n }\n }\n }\n }),\n _vm._v(\"\\n Editable by user in profile\\n \")\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-check\" }, [\n _c(\"label\", { staticClass: \"form-check-label\" }, [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.required,\n expression: \"field.required\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n checked: Array.isArray(_vm.field.required)\n ? _vm._i(_vm.field.required, null) > -1\n : _vm.field.required\n },\n on: {\n change: function($event) {\n var $$a = _vm.field.required,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = null,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n _vm.$set(_vm.field, \"required\", $$a.concat([$$v]))\n } else {\n $$i > -1 &&\n _vm.$set(\n _vm.field,\n \"required\",\n $$a.slice(0, $$i).concat($$a.slice($$i + 1))\n )\n }\n } else {\n _vm.$set(_vm.field, \"required\", $$c)\n }\n }\n }\n }),\n _vm._v(\"\\n Required on registration\\n \")\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-check\" }, [\n _c(\"label\", { staticClass: \"form-check-label\" }, [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.public,\n expression: \"field.public\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n checked: Array.isArray(_vm.field.public)\n ? _vm._i(_vm.field.public, null) > -1\n : _vm.field.public\n },\n on: {\n change: function($event) {\n var $$a = _vm.field.public,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = null,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n _vm.$set(_vm.field, \"public\", $$a.concat([$$v]))\n } else {\n $$i > -1 &&\n _vm.$set(\n _vm.field,\n \"public\",\n $$a.slice(0, $$i).concat($$a.slice($$i + 1))\n )\n }\n } else {\n _vm.$set(_vm.field, \"public\", $$c)\n }\n }\n }\n }),\n _vm._v(\"\\n Shown on public profile\\n \")\n ])\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"row pb-3\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"d-block\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-sm btn-success btn-outlined float-right\",\n attrs: { type: \"button\" },\n on: {\n click: function($event) {\n return _vm.saveField()\n }\n }\n },\n [_vm._v(\"\\n Save\\n \")]\n )\n ])\n ])\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/configs/fields/Field.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"border-bottom\" }, [\n _c(\"div\", [\n _c(\n \"button\",\n {\n staticClass: \"close float-right\",\n attrs: { type: \"button\", \"aria-label\": \"Close\" },\n on: {\n click: function ($event) {\n return _vm.deleteField()\n },\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-3\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Field Type\")]),\n _vm._v(\" \"),\n _c(\n \"select\",\n {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.field_type,\n expression: \"field.field_type\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control custom-select\",\n on: {\n change: function ($event) {\n var $$selectedVal = Array.prototype.filter\n .call($event.target.options, function (o) {\n return o.selected\n })\n .map(function (o) {\n var val = \"_value\" in o ? o._value : o.value\n return val\n })\n _vm.$set(\n _vm.field,\n \"field_type\",\n $event.target.multiple ? $$selectedVal : $$selectedVal[0]\n )\n },\n },\n },\n [\n _c(\"option\", { attrs: { value: \"text\" } }, [\n _vm._v(\"Text Field\"),\n ]),\n _vm._v(\" \"),\n _c(\"option\", { attrs: { value: \"boolean\" } }, [\n _vm._v(\"Checkbox\"),\n ]),\n ]\n ),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"form-text text-muted\" }, [\n _vm._v(\"Type of field shown to the user\"),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-9\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Field Name\")]),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.name,\n expression: \"field.name\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control\",\n attrs: { type: \"text\" },\n domProps: { value: _vm.field.name },\n on: {\n change: function ($event) {\n return _vm.$set(_vm.field, \"name\", $event.target.value)\n },\n },\n }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"form-text text-muted\" }, [\n _vm._v(\"Field name\"),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Field Description\")]),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.description,\n expression: \"field.description\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control\",\n attrs: { type: \"text\" },\n domProps: { value: _vm.field.description },\n on: {\n change: function ($event) {\n return _vm.$set(_vm.field, \"description\", $event.target.value)\n },\n },\n }),\n _vm._v(\" \"),\n _c(\n \"small\",\n { staticClass: \"form-text text-muted\", attrs: { id: \"emailHelp\" } },\n [_vm._v(\"Field Description\")]\n ),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-check\" }, [\n _c(\"label\", { staticClass: \"form-check-label\" }, [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.editable,\n expression: \"field.editable\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n checked: Array.isArray(_vm.field.editable)\n ? _vm._i(_vm.field.editable, null) > -1\n : _vm.field.editable,\n },\n on: {\n change: function ($event) {\n var $$a = _vm.field.editable,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = null,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n _vm.$set(_vm.field, \"editable\", $$a.concat([$$v]))\n } else {\n $$i > -1 &&\n _vm.$set(\n _vm.field,\n \"editable\",\n $$a.slice(0, $$i).concat($$a.slice($$i + 1))\n )\n }\n } else {\n _vm.$set(_vm.field, \"editable\", $$c)\n }\n },\n },\n }),\n _vm._v(\"\\n Editable by user in profile\\n \"),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-check\" }, [\n _c(\"label\", { staticClass: \"form-check-label\" }, [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.required,\n expression: \"field.required\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n checked: Array.isArray(_vm.field.required)\n ? _vm._i(_vm.field.required, null) > -1\n : _vm.field.required,\n },\n on: {\n change: function ($event) {\n var $$a = _vm.field.required,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = null,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n _vm.$set(_vm.field, \"required\", $$a.concat([$$v]))\n } else {\n $$i > -1 &&\n _vm.$set(\n _vm.field,\n \"required\",\n $$a.slice(0, $$i).concat($$a.slice($$i + 1))\n )\n }\n } else {\n _vm.$set(_vm.field, \"required\", $$c)\n }\n },\n },\n }),\n _vm._v(\"\\n Required on registration\\n \"),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-check\" }, [\n _c(\"label\", { staticClass: \"form-check-label\" }, [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.field.public,\n expression: \"field.public\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n checked: Array.isArray(_vm.field.public)\n ? _vm._i(_vm.field.public, null) > -1\n : _vm.field.public,\n },\n on: {\n change: function ($event) {\n var $$a = _vm.field.public,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = null,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n _vm.$set(_vm.field, \"public\", $$a.concat([$$v]))\n } else {\n $$i > -1 &&\n _vm.$set(\n _vm.field,\n \"public\",\n $$a.slice(0, $$i).concat($$a.slice($$i + 1))\n )\n }\n } else {\n _vm.$set(_vm.field, \"public\", $$c)\n }\n },\n },\n }),\n _vm._v(\"\\n Shown on public profile\\n \"),\n ]),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"row pb-3\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"d-block\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-sm btn-success btn-outlined float-right\",\n attrs: { type: \"button\" },\n on: {\n click: function ($event) {\n return _vm.saveField()\n },\n },\n },\n [_vm._v(\"\\n Save\\n \")]\n ),\n ]),\n ]),\n ]),\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/configs/fields/Field.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -846,7 +846,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n [\n _vm._l(_vm.fields, function(field, index) {\n return _c(\n \"div\",\n { key: field.id, staticClass: \"mb-5\" },\n [\n _c(\"Field\", {\n attrs: { index: index, initialField: _vm.fields[index] },\n on: {\n \"update:initialField\": function($event) {\n return _vm.$set(_vm.fields, index, $event)\n },\n \"update:initial-field\": function($event) {\n return _vm.$set(_vm.fields, index, $event)\n },\n \"remove-field\": _vm.removeField\n }\n })\n ],\n 1\n )\n }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col text-center\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-sm btn-success btn-outlined m-auto\",\n attrs: { type: \"button\" },\n on: {\n click: function($event) {\n return _vm.addField()\n }\n }\n },\n [_vm._v(\"\\n Add New Field\\n \")]\n )\n ])\n ])\n ],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/configs/fields/FieldList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n [\n _vm._l(_vm.fields, function (field, index) {\n return _c(\n \"div\",\n { key: field.id, staticClass: \"mb-5\" },\n [\n _c(\"Field\", {\n attrs: { index: index, initialField: _vm.fields[index] },\n on: {\n \"update:initialField\": function ($event) {\n return _vm.$set(_vm.fields, index, $event)\n },\n \"update:initial-field\": function ($event) {\n return _vm.$set(_vm.fields, index, $event)\n },\n \"remove-field\": _vm.removeField,\n },\n }),\n ],\n 1\n )\n }),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col text-center\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-sm btn-success btn-outlined m-auto\",\n attrs: { type: \"button\" },\n on: {\n click: function ($event) {\n return _vm.addField()\n },\n },\n },\n [_vm._v(\"\\n Add New Field\\n \")]\n ),\n ]),\n ]),\n ],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/configs/fields/FieldList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -858,7 +858,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"table\",\n { staticClass: \"table table-striped\", attrs: { id: \"filesboard\" } },\n [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"tbody\",\n _vm._l(_vm.files, function(file) {\n return _c(\"tr\", { key: file.id }, [\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\n \"a\",\n { attrs: { href: _vm.urlRoot + \"/files/\" + file.location } },\n [_vm._v(_vm._s(file.location.split(\"/\").pop()))]\n )\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-times delete-file\",\n attrs: { role: \"button\" },\n on: {\n click: function($event) {\n return _vm.deleteFile(file.id)\n }\n }\n })\n ])\n ])\n }),\n 0\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12 mt-3\" }, [\n _c(\n \"form\",\n {\n ref: \"FileUploadForm\",\n attrs: { method: \"POST\" },\n on: {\n submit: function($event) {\n $event.preventDefault()\n return _vm.addFiles($event)\n }\n }\n },\n [_vm._m(1), _vm._v(\" \"), _vm._m(2)]\n )\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"thead\", [\n _c(\"tr\", [\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"File\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"b\", [_vm._v(\"Settings\")])\n ])\n ])\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"input\", {\n staticClass: \"form-control-file\",\n attrs: {\n id: \"file\",\n multiple: \"\",\n name: \"file\",\n required: \"\",\n type: \"file\"\n }\n }),\n _vm._v(\" \"),\n _c(\"sub\", { staticClass: \"text-muted\" }, [\n _vm._v(\n \"\\n Attach multiple files using Control+Click or Cmd+Click.\\n \"\n )\n ])\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"input\", {\n staticClass: \"btn btn-success float-right\",\n attrs: {\n id: \"_submit\",\n name: \"_submit\",\n type: \"submit\",\n value: \"Upload\"\n }\n })\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/files/ChallengeFilesList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"table\",\n { staticClass: \"table table-striped\", attrs: { id: \"filesboard\" } },\n [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"tbody\",\n _vm._l(_vm.files, function (file) {\n return _c(\"tr\", { key: file.id }, [\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\n \"a\",\n { attrs: { href: _vm.urlRoot + \"/files/\" + file.location } },\n [_vm._v(_vm._s(file.location.split(\"/\").pop()))]\n ),\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-times delete-file\",\n attrs: { role: \"button\" },\n on: {\n click: function ($event) {\n return _vm.deleteFile(file.id)\n },\n },\n }),\n ]),\n ])\n }),\n 0\n ),\n ]\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12 mt-3\" }, [\n _c(\n \"form\",\n {\n ref: \"FileUploadForm\",\n attrs: { method: \"POST\" },\n on: {\n submit: function ($event) {\n $event.preventDefault()\n return _vm.addFiles.apply(null, arguments)\n },\n },\n },\n [_vm._m(1), _vm._v(\" \"), _vm._m(2)]\n ),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"thead\", [\n _c(\"tr\", [\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"File\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"b\", [_vm._v(\"Settings\")]),\n ]),\n ]),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"input\", {\n staticClass: \"form-control-file\",\n attrs: {\n id: \"file\",\n multiple: \"\",\n name: \"file\",\n required: \"\",\n type: \"file\",\n },\n }),\n _vm._v(\" \"),\n _c(\"sub\", { staticClass: \"text-muted\" }, [\n _vm._v(\n \"\\n Attach multiple files using Control+Click or Cmd+Click.\\n \"\n ),\n ]),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"input\", {\n staticClass: \"btn btn-success float-right\",\n attrs: {\n id: \"_submit\",\n name: \"_submit\",\n type: \"submit\",\n value: \"Upload\",\n },\n }),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/files/ChallengeFilesList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -870,7 +870,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { staticClass: \"modal fade\", attrs: { id: \"media-modal\", tabindex: \"-1\" } },\n [\n _c(\"div\", { staticClass: \"modal-dialog modal-xl\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"modal-header\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row mh-100\" }, [\n _c(\n \"div\",\n {\n staticClass: \"col-md-6\",\n attrs: { id: \"media-library-list\" }\n },\n _vm._l(_vm.files, function(file) {\n return _c(\n \"div\",\n { key: file.id, staticClass: \"media-item-wrapper\" },\n [\n _c(\n \"a\",\n {\n attrs: { href: \"javascript:void(0)\" },\n on: {\n click: function($event) {\n _vm.selectFile(file)\n return false\n }\n }\n },\n [\n _c(\"i\", {\n class: _vm.getIconClass(file.location),\n attrs: { \"aria-hidden\": \"true\" }\n }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"media-item-title\" }, [\n _vm._v(_vm._s(file.location.split(\"/\").pop()))\n ])\n ]\n )\n ]\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n {\n staticClass: \"col-md-6\",\n attrs: { id: \"media-library-details\" }\n },\n [\n _c(\"h4\", { staticClass: \"text-center\" }, [\n _vm._v(\"Media Details\")\n ]),\n _vm._v(\" \"),\n _c(\"div\", { attrs: { id: \"media-item\" } }, [\n _c(\n \"div\",\n {\n staticClass: \"text-center\",\n attrs: { id: \"media-icon\" }\n },\n [\n this.selectedFile\n ? _c(\"div\", [\n _vm.getIconClass(\n this.selectedFile.location\n ) === \"far fa-file-image\"\n ? _c(\"div\", [\n _c(\"img\", {\n staticStyle: {\n \"max-width\": \"100%\",\n \"max-height\": \"100%\",\n \"object-fit\": \"contain\"\n },\n attrs: {\n src: _vm.buildSelectedFileUrl()\n }\n })\n ])\n : _c(\"div\", [\n _c(\"i\", {\n class:\n _vm.getIconClass(\n this.selectedFile.location\n ) + \" fa-4x\",\n attrs: { \"aria-hidden\": \"true\" }\n })\n ])\n ])\n : _vm._e()\n ]\n ),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n this.selectedFile\n ? _c(\n \"div\",\n {\n staticClass: \"text-center\",\n attrs: { id: \"media-filename\" }\n },\n [\n _c(\n \"a\",\n {\n attrs: {\n href: _vm.buildSelectedFileUrl(),\n target: \"_blank\"\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(\n this.selectedFile.location\n .split(\"/\")\n .pop()\n ) +\n \"\\n \"\n )\n ]\n )\n ]\n )\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n this.selectedFile\n ? _c(\"div\", [\n _vm._v(\n \"\\n Link:\\n \"\n ),\n _c(\"input\", {\n staticClass: \"form-control\",\n attrs: {\n type: \"text\",\n id: \"media-link\",\n readonly: \"\"\n },\n domProps: {\n value: _vm.buildSelectedFileUrl()\n }\n })\n ])\n : _c(\"div\", [\n _vm._v(\n \"\\n Link:\\n \"\n ),\n _c(\"input\", {\n staticClass: \"form-control\",\n attrs: {\n type: \"text\",\n id: \"media-link\",\n readonly: \"\"\n }\n })\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group text-center\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-6\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success w-100\",\n attrs: {\n id: \"media-insert\",\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: \"Insert link into editor\"\n },\n on: { click: _vm.insertSelectedFile }\n },\n [\n _vm._v(\n \"\\n Insert\\n \"\n )\n ]\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-3\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-primary w-100\",\n attrs: {\n id: \"media-download\",\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: \"Download file\"\n },\n on: { click: _vm.downloadSelectedFile }\n },\n [_c(\"i\", { staticClass: \"fas fa-download\" })]\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-3\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-danger w-100\",\n attrs: {\n id: \"media-delete\",\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: \"Delete file\"\n },\n on: { click: _vm.deleteSelectedFile }\n },\n [_c(\"i\", { staticClass: \"far fa-trash-alt\" })]\n )\n ])\n ])\n ])\n ])\n ]\n )\n ])\n ])\n ]),\n _vm._v(\" \"),\n _vm._m(1)\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-footer\" }, [\n _c(\"div\", { staticClass: \"float-right\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-primary media-upload-button\",\n attrs: { type: \"submit\" },\n on: { click: _vm.uploadChosenFiles }\n },\n [_vm._v(\"\\n Upload\\n \")]\n )\n ])\n ])\n ])\n ])\n ]\n )\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"h3\", { staticClass: \"text-center\" }, [_vm._v(\"Media Library\")])\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\"\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n )\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"form\",\n { attrs: { id: \"media-library-upload\", enctype: \"multipart/form-data\" } },\n [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", { attrs: { for: \"media-files\" } }, [\n _vm._v(\"\\n Upload Files\\n \")\n ]),\n _vm._v(\" \"),\n _c(\"input\", {\n staticClass: \"form-control-file\",\n attrs: {\n type: \"file\",\n name: \"file\",\n id: \"media-files\",\n multiple: \"\"\n }\n }),\n _vm._v(\" \"),\n _c(\"sub\", { staticClass: \"help-block\" }, [\n _vm._v(\n \"\\n Attach multiple files using Control+Click or Cmd+Click.\\n \"\n )\n ])\n ]),\n _vm._v(\" \"),\n _c(\"input\", { attrs: { type: \"hidden\", value: \"page\", name: \"type\" } })\n ]\n )\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n { staticClass: \"modal fade\", attrs: { id: \"media-modal\", tabindex: \"-1\" } },\n [\n _c(\"div\", { staticClass: \"modal-dialog modal-xl\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"modal-header\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row mh-100\" }, [\n _c(\n \"div\",\n {\n staticClass: \"col-md-6\",\n attrs: { id: \"media-library-list\" },\n },\n _vm._l(_vm.files, function (file) {\n return _c(\n \"div\",\n { key: file.id, staticClass: \"media-item-wrapper\" },\n [\n _c(\n \"a\",\n {\n attrs: { href: \"javascript:void(0)\" },\n on: {\n click: function ($event) {\n _vm.selectFile(file)\n return false\n },\n },\n },\n [\n _c(\"i\", {\n class: _vm.getIconClass(file.location),\n attrs: { \"aria-hidden\": \"true\" },\n }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"media-item-title\" }, [\n _vm._v(_vm._s(file.location.split(\"/\").pop())),\n ]),\n ]\n ),\n ]\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n {\n staticClass: \"col-md-6\",\n attrs: { id: \"media-library-details\" },\n },\n [\n _c(\"h4\", { staticClass: \"text-center\" }, [\n _vm._v(\"Media Details\"),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { attrs: { id: \"media-item\" } }, [\n _c(\n \"div\",\n {\n staticClass: \"text-center\",\n attrs: { id: \"media-icon\" },\n },\n [\n this.selectedFile\n ? _c(\"div\", [\n _vm.getIconClass(\n this.selectedFile.location\n ) === \"far fa-file-image\"\n ? _c(\"div\", [\n _c(\"img\", {\n staticStyle: {\n \"max-width\": \"100%\",\n \"max-height\": \"100%\",\n \"object-fit\": \"contain\",\n },\n attrs: {\n src: _vm.buildSelectedFileUrl(),\n },\n }),\n ])\n : _c(\"div\", [\n _c(\"i\", {\n class:\n _vm.getIconClass(\n this.selectedFile.location\n ) + \" fa-4x\",\n attrs: { \"aria-hidden\": \"true\" },\n }),\n ]),\n ])\n : _vm._e(),\n ]\n ),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n this.selectedFile\n ? _c(\n \"div\",\n {\n staticClass: \"text-center\",\n attrs: { id: \"media-filename\" },\n },\n [\n _c(\n \"a\",\n {\n attrs: {\n href: _vm.buildSelectedFileUrl(),\n target: \"_blank\",\n },\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(\n this.selectedFile.location\n .split(\"/\")\n .pop()\n ) +\n \"\\n \"\n ),\n ]\n ),\n ]\n )\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n this.selectedFile\n ? _c(\"div\", [\n _vm._v(\n \"\\n Link:\\n \"\n ),\n _c(\"input\", {\n staticClass: \"form-control\",\n attrs: {\n type: \"text\",\n id: \"media-link\",\n readonly: \"\",\n },\n domProps: {\n value: _vm.buildSelectedFileUrl(),\n },\n }),\n ])\n : _c(\"div\", [\n _vm._v(\n \"\\n Link:\\n \"\n ),\n _c(\"input\", {\n staticClass: \"form-control\",\n attrs: {\n type: \"text\",\n id: \"media-link\",\n readonly: \"\",\n },\n }),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group text-center\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-6\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success w-100\",\n attrs: {\n id: \"media-insert\",\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: \"Insert link into editor\",\n },\n on: { click: _vm.insertSelectedFile },\n },\n [\n _vm._v(\n \"\\n Insert\\n \"\n ),\n ]\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-3\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-primary w-100\",\n attrs: {\n id: \"media-download\",\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: \"Download file\",\n },\n on: { click: _vm.downloadSelectedFile },\n },\n [_c(\"i\", { staticClass: \"fas fa-download\" })]\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-3\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-danger w-100\",\n attrs: {\n id: \"media-delete\",\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: \"Delete file\",\n },\n on: { click: _vm.deleteSelectedFile },\n },\n [_c(\"i\", { staticClass: \"far fa-trash-alt\" })]\n ),\n ]),\n ]),\n ]),\n ]),\n ]\n ),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _vm._m(1),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-footer\" }, [\n _c(\"div\", { staticClass: \"float-right\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-primary media-upload-button\",\n attrs: { type: \"submit\" },\n on: { click: _vm.uploadChosenFiles },\n },\n [_vm._v(\"\\n Upload\\n \")]\n ),\n ]),\n ]),\n ]),\n ]),\n ]\n )\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"h3\", { staticClass: \"text-center\" }, [_vm._v(\"Media Library\")]),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\",\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"form\",\n { attrs: { id: \"media-library-upload\", enctype: \"multipart/form-data\" } },\n [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", { attrs: { for: \"media-files\" } }, [\n _vm._v(\"\\n Upload Files\\n \"),\n ]),\n _vm._v(\" \"),\n _c(\"input\", {\n staticClass: \"form-control-file\",\n attrs: {\n type: \"file\",\n name: \"file\",\n id: \"media-files\",\n multiple: \"\",\n },\n }),\n _vm._v(\" \"),\n _c(\"sub\", { staticClass: \"help-block\" }, [\n _vm._v(\n \"\\n Attach multiple files using Control+Click or Cmd+Click.\\n \"\n ),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"input\", { attrs: { type: \"hidden\", value: \"page\", name: \"type\" } }),\n ]\n )\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -882,7 +882,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n {\n staticClass: \"modal fade\",\n attrs: { id: \"flag-create-modal\", tabindex: \"-1\" }\n },\n [\n _c(\"div\", { staticClass: \"modal-dialog modal-lg\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"create-keys-select-div\" }, [\n _c(\n \"label\",\n {\n staticClass: \"control-label\",\n attrs: { for: \"create-keys-select\" }\n },\n [_vm._v(\"\\n Choose Flag Type\\n \")]\n ),\n _vm._v(\" \"),\n _c(\n \"select\",\n {\n staticClass: \"form-control custom-select\",\n on: {\n change: function($event) {\n return _vm.selectType($event)\n }\n }\n },\n [\n _c(\"option\", [_vm._v(\" -- \")]),\n _vm._v(\" \"),\n _vm._l(Object.keys(_vm.types), function(type) {\n return _c(\n \"option\",\n { key: type, domProps: { value: type } },\n [_vm._v(_vm._s(type))]\n )\n })\n ],\n 2\n )\n ]),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\n \"form\",\n {\n on: {\n submit: function($event) {\n $event.preventDefault()\n return _vm.submitFlag($event)\n }\n }\n },\n [\n _c(\"div\", {\n attrs: { id: \"create-flag-form\" },\n domProps: { innerHTML: _vm._s(_vm.createForm) }\n }),\n _vm._v(\" \"),\n _vm.createForm\n ? _c(\n \"button\",\n {\n staticClass: \"btn btn-success float-right\",\n attrs: { type: \"submit\" }\n },\n [_vm._v(\"\\n Create Flag\\n \")]\n )\n : _vm._e()\n ]\n )\n ])\n ])\n ])\n ]\n )\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"h3\", [_vm._v(\"Create Flag\")])\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\"\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n )\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/flags/FlagCreationForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n {\n staticClass: \"modal fade\",\n attrs: { id: \"flag-create-modal\", tabindex: \"-1\" },\n },\n [\n _c(\"div\", { staticClass: \"modal-dialog modal-lg\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"create-keys-select-div\" }, [\n _c(\n \"label\",\n {\n staticClass: \"control-label\",\n attrs: { for: \"create-keys-select\" },\n },\n [_vm._v(\"\\n Choose Flag Type\\n \")]\n ),\n _vm._v(\" \"),\n _c(\n \"select\",\n {\n staticClass: \"form-control custom-select\",\n on: {\n change: function ($event) {\n return _vm.selectType($event)\n },\n },\n },\n [\n _c(\"option\", [_vm._v(\" -- \")]),\n _vm._v(\" \"),\n _vm._l(Object.keys(_vm.types), function (type) {\n return _c(\n \"option\",\n { key: type, domProps: { value: type } },\n [_vm._v(_vm._s(type))]\n )\n }),\n ],\n 2\n ),\n ]),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\n \"form\",\n {\n on: {\n submit: function ($event) {\n $event.preventDefault()\n return _vm.submitFlag.apply(null, arguments)\n },\n },\n },\n [\n _c(\"div\", {\n attrs: { id: \"create-flag-form\" },\n domProps: { innerHTML: _vm._s(_vm.createForm) },\n }),\n _vm._v(\" \"),\n _vm.createForm\n ? _c(\n \"button\",\n {\n staticClass: \"btn btn-success float-right\",\n attrs: { type: \"submit\" },\n },\n [_vm._v(\"\\n Create Flag\\n \")]\n )\n : _vm._e(),\n ]\n ),\n ]),\n ]),\n ]),\n ]\n )\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"h3\", [_vm._v(\"Create Flag\")]),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\",\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/flags/FlagCreationForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -894,7 +894,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n {\n staticClass: \"modal fade\",\n attrs: { id: \"flag-edit-modal\", tabindex: \"-1\" }\n },\n [\n _c(\"div\", { staticClass: \"modal-dialog modal-lg\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"form\", {\n attrs: { method: \"POST\" },\n domProps: { innerHTML: _vm._s(_vm.editForm) },\n on: {\n submit: function($event) {\n $event.preventDefault()\n return _vm.updateFlag($event)\n }\n }\n })\n ])\n ])\n ])\n ]\n )\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"h3\", { staticClass: \"text-center\" }, [_vm._v(\"Edit Flag\")])\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\"\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n )\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/flags/FlagEditForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n {\n staticClass: \"modal fade\",\n attrs: { id: \"flag-edit-modal\", tabindex: \"-1\" },\n },\n [\n _c(\"div\", { staticClass: \"modal-dialog modal-lg\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"form\", {\n attrs: { method: \"POST\" },\n domProps: { innerHTML: _vm._s(_vm.editForm) },\n on: {\n submit: function ($event) {\n $event.preventDefault()\n return _vm.updateFlag.apply(null, arguments)\n },\n },\n }),\n ]),\n ]),\n ]),\n ]\n )\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"h3\", { staticClass: \"text-center\" }, [_vm._v(\"Edit Flag\")]),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\",\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/flags/FlagEditForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -906,7 +906,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"div\",\n [\n _c(\"FlagCreationForm\", {\n ref: \"FlagCreationForm\",\n attrs: { challenge_id: _vm.challenge_id },\n on: { refreshFlags: _vm.refreshFlags }\n })\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n [\n _c(\"FlagEditForm\", {\n ref: \"FlagEditForm\",\n attrs: { flag_id: _vm.editing_flag_id },\n on: { refreshFlags: _vm.refreshFlags }\n })\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"table\",\n { staticClass: \"table table-striped\", attrs: { id: \"flagsboard\" } },\n [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"tbody\",\n _vm._l(_vm.flags, function(flag) {\n return _c(\"tr\", { key: flag.id, attrs: { name: flag.id } }, [\n _c(\"td\", { staticClass: \"text-center\" }, [\n _vm._v(_vm._s(flag.type))\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-break\" }, [\n _c(\"pre\", { staticClass: \"flag-content\" }, [\n _vm._v(_vm._s(flag.content))\n ])\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-edit edit-flag\",\n attrs: {\n role: \"button\",\n \"flag-id\": flag.id,\n \"flag-type\": flag.type\n },\n on: {\n click: function($event) {\n return _vm.editFlag(flag.id)\n }\n }\n }),\n _vm._v(\" \"),\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-times delete-flag\",\n attrs: { role: \"button\", \"flag-id\": flag.id },\n on: {\n click: function($event) {\n return _vm.deleteFlag(flag.id)\n }\n }\n })\n ])\n ])\n }),\n 0\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success d-inline-block float-right\",\n attrs: { id: \"flag-add-button\" },\n on: {\n click: function($event) {\n return _vm.addFlag()\n }\n }\n },\n [_vm._v(\"\\n Create Flag\\n \")]\n )\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"thead\", [\n _c(\"tr\", [\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Type\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Flag\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"b\", [_vm._v(\"Settings\")])\n ])\n ])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/flags/FlagList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"div\",\n [\n _c(\"FlagCreationForm\", {\n ref: \"FlagCreationForm\",\n attrs: { challenge_id: _vm.challenge_id },\n on: { refreshFlags: _vm.refreshFlags },\n }),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n [\n _c(\"FlagEditForm\", {\n ref: \"FlagEditForm\",\n attrs: { flag_id: _vm.editing_flag_id },\n on: { refreshFlags: _vm.refreshFlags },\n }),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"table\",\n { staticClass: \"table table-striped\", attrs: { id: \"flagsboard\" } },\n [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"tbody\",\n _vm._l(_vm.flags, function (flag) {\n return _c(\"tr\", { key: flag.id, attrs: { name: flag.id } }, [\n _c(\"td\", { staticClass: \"text-center\" }, [\n _vm._v(_vm._s(flag.type)),\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-break\" }, [\n _c(\"pre\", { staticClass: \"flag-content\" }, [\n _vm._v(_vm._s(flag.content)),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-edit edit-flag\",\n attrs: {\n role: \"button\",\n \"flag-id\": flag.id,\n \"flag-type\": flag.type,\n },\n on: {\n click: function ($event) {\n return _vm.editFlag(flag.id)\n },\n },\n }),\n _vm._v(\" \"),\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-times delete-flag\",\n attrs: { role: \"button\", \"flag-id\": flag.id },\n on: {\n click: function ($event) {\n return _vm.deleteFlag(flag.id)\n },\n },\n }),\n ]),\n ])\n }),\n 0\n ),\n ]\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success d-inline-block float-right\",\n attrs: { id: \"flag-add-button\" },\n on: {\n click: function ($event) {\n return _vm.addFlag()\n },\n },\n },\n [_vm._v(\"\\n Create Flag\\n \")]\n ),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"thead\", [\n _c(\"tr\", [\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Type\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Flag\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"b\", [_vm._v(\"Settings\")]),\n ]),\n ]),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/flags/FlagList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -918,7 +918,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal fade\", attrs: { tabindex: \"-1\" } }, [\n _c(\"div\", { staticClass: \"modal-dialog\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"form\",\n {\n attrs: { method: \"POST\" },\n on: {\n submit: function($event) {\n $event.preventDefault()\n return _vm.submitHint($event)\n }\n }\n },\n [\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(1),\n _vm._v(\" \"),\n _c(\"textarea\", {\n ref: \"content\",\n staticClass: \"form-control markdown\",\n attrs: { type: \"text\", name: \"content\", rows: \"7\" }\n })\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(2),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.cost,\n expression: \"cost\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control\",\n attrs: { type: \"number\", name: \"cost\" },\n domProps: { value: _vm.cost },\n on: {\n change: function($event) {\n _vm.cost = $event.target.value\n }\n }\n })\n ]),\n _vm._v(\" \"),\n _c(\"input\", {\n attrs: {\n type: \"hidden\",\n id: \"hint-id-for-hint\",\n name: \"id\"\n }\n })\n ])\n ])\n ])\n ]),\n _vm._v(\" \"),\n _vm._m(3)\n ]\n )\n ])\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [_c(\"h3\", [_vm._v(\"Hint\")])])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\"\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n )\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", { staticClass: \"text-muted\" }, [\n _vm._v(\"\\n Hint\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"Markdown & HTML are supported\")])\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"\\n Cost\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"How many points it costs to see your hint.\")])\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-footer\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"button\", { staticClass: \"btn btn-primary float-right\" }, [\n _vm._v(\"Submit\")\n ])\n ])\n ])\n ])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/hints/HintCreationForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal fade\", attrs: { tabindex: \"-1\" } }, [\n _c(\"div\", { staticClass: \"modal-dialog\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"form\",\n {\n attrs: { method: \"POST\" },\n on: {\n submit: function ($event) {\n $event.preventDefault()\n return _vm.submitHint.apply(null, arguments)\n },\n },\n },\n [\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(1),\n _vm._v(\" \"),\n _c(\"textarea\", {\n ref: \"content\",\n staticClass: \"form-control markdown\",\n attrs: { type: \"text\", name: \"content\", rows: \"7\" },\n }),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(2),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.cost,\n expression: \"cost\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control\",\n attrs: { type: \"number\", name: \"cost\" },\n domProps: { value: _vm.cost },\n on: {\n change: function ($event) {\n _vm.cost = $event.target.value\n },\n },\n }),\n ]),\n _vm._v(\" \"),\n _c(\"input\", {\n attrs: {\n type: \"hidden\",\n id: \"hint-id-for-hint\",\n name: \"id\",\n },\n }),\n ]),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _vm._m(3),\n ]\n ),\n ]),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [_c(\"h3\", [_vm._v(\"Hint\")])]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\",\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", { staticClass: \"text-muted\" }, [\n _vm._v(\"\\n Hint\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"Markdown & HTML are supported\")]),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"\\n Cost\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"How many points it costs to see your hint.\")]),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-footer\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"button\", { staticClass: \"btn btn-primary float-right\" }, [\n _vm._v(\"Submit\"),\n ]),\n ]),\n ]),\n ]),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/hints/HintCreationForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -930,7 +930,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal fade\", attrs: { tabindex: \"-1\" } }, [\n _c(\"div\", { staticClass: \"modal-dialog\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"form\",\n {\n attrs: { method: \"POST\" },\n on: {\n submit: function($event) {\n $event.preventDefault()\n return _vm.updateHint($event)\n }\n }\n },\n [\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(1),\n _vm._v(\" \"),\n _c(\"textarea\", {\n ref: \"content\",\n staticClass: \"form-control\",\n attrs: { type: \"text\", name: \"content\", rows: \"7\" },\n domProps: { value: this.content }\n })\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(2),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.cost,\n expression: \"cost\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control\",\n attrs: { type: \"number\", name: \"cost\" },\n domProps: { value: _vm.cost },\n on: {\n change: function($event) {\n _vm.cost = $event.target.value\n }\n }\n })\n ])\n ])\n ])\n ])\n ]),\n _vm._v(\" \"),\n _vm._m(3)\n ]\n )\n ])\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [_c(\"h3\", [_vm._v(\"Hint\")])])\n ])\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\"\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n )\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", { staticClass: \"text-muted\" }, [\n _vm._v(\"\\n Hint\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"Markdown & HTML are supported\")])\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"\\n Cost\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"How many points it costs to see your hint.\")])\n ])\n },\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-footer\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"button\", { staticClass: \"btn btn-primary float-right\" }, [\n _vm._v(\"Submit\")\n ])\n ])\n ])\n ])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/hints/HintEditForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal fade\", attrs: { tabindex: \"-1\" } }, [\n _c(\"div\", { staticClass: \"modal-dialog\" }, [\n _c(\"div\", { staticClass: \"modal-content\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"form\",\n {\n attrs: { method: \"POST\" },\n on: {\n submit: function ($event) {\n $event.preventDefault()\n return _vm.updateHint.apply(null, arguments)\n },\n },\n },\n [\n _c(\"div\", { staticClass: \"modal-body\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(1),\n _vm._v(\" \"),\n _c(\"textarea\", {\n ref: \"content\",\n staticClass: \"form-control\",\n attrs: { type: \"text\", name: \"content\", rows: \"7\" },\n domProps: { value: this.content },\n }),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(2),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.cost,\n expression: \"cost\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control\",\n attrs: { type: \"number\", name: \"cost\" },\n domProps: { value: _vm.cost },\n on: {\n change: function ($event) {\n _vm.cost = $event.target.value\n },\n },\n }),\n ]),\n ]),\n ]),\n ]),\n ]),\n _vm._v(\" \"),\n _vm._m(3),\n ]\n ),\n ]),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-header text-center\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [_c(\"h3\", [_vm._v(\"Hint\")])]),\n ]),\n ]),\n _vm._v(\" \"),\n _c(\n \"button\",\n {\n staticClass: \"close\",\n attrs: {\n type: \"button\",\n \"data-dismiss\": \"modal\",\n \"aria-label\": \"Close\",\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", { staticClass: \"text-muted\" }, [\n _vm._v(\"\\n Hint\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"Markdown & HTML are supported\")]),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"\\n Cost\"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", [_vm._v(\"How many points it costs to see your hint.\")]),\n ])\n },\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"modal-footer\" }, [\n _c(\"div\", { staticClass: \"container\" }, [\n _c(\"div\", { staticClass: \"row\" }, [\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\"button\", { staticClass: \"btn btn-primary float-right\" }, [\n _vm._v(\"Submit\"),\n ]),\n ]),\n ]),\n ]),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/hints/HintEditForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -942,7 +942,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"div\",\n [\n _c(\"HintCreationForm\", {\n ref: \"HintCreationForm\",\n attrs: { challenge_id: _vm.challenge_id },\n on: { refreshHints: _vm.refreshHints }\n })\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n [\n _c(\"HintEditForm\", {\n ref: \"HintEditForm\",\n attrs: { hint_id: _vm.editing_hint_id },\n on: { refreshHints: _vm.refreshHints }\n })\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\"table\", { staticClass: \"table table-striped\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"tbody\",\n _vm._l(_vm.hints, function(hint) {\n return _c(\"tr\", { key: hint.id }, [\n _c(\"td\", { staticClass: \"text-center\" }, [\n _vm._v(_vm._s(hint.type))\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-break\" }, [\n _c(\"pre\", [_vm._v(_vm._s(hint.content))])\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _vm._v(_vm._s(hint.cost))\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-edit\",\n attrs: { role: \"button\" },\n on: {\n click: function($event) {\n return _vm.editHint(hint.id)\n }\n }\n }),\n _vm._v(\" \"),\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-times\",\n attrs: { role: \"button\" },\n on: {\n click: function($event) {\n return _vm.deleteHint(hint.id)\n }\n }\n })\n ])\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success float-right\",\n on: { click: _vm.addHint }\n },\n [_vm._v(\"\\n Create Hint\\n \")]\n )\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"thead\", [\n _c(\"tr\", [\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"ID\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Hint\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Cost\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"b\", [_vm._v(\"Settings\")])\n ])\n ])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/hints/HintsList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"div\",\n [\n _c(\"HintCreationForm\", {\n ref: \"HintCreationForm\",\n attrs: { challenge_id: _vm.challenge_id },\n on: { refreshHints: _vm.refreshHints },\n }),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"div\",\n [\n _c(\"HintEditForm\", {\n ref: \"HintEditForm\",\n attrs: { hint_id: _vm.editing_hint_id },\n on: { refreshHints: _vm.refreshHints },\n }),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\"table\", { staticClass: \"table table-striped\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"tbody\",\n _vm._l(_vm.hints, function (hint) {\n return _c(\"tr\", { key: hint.id }, [\n _c(\"td\", { staticClass: \"text-center\" }, [\n _vm._v(_vm._s(hint.type)),\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-break\" }, [\n _c(\"pre\", [_vm._v(_vm._s(hint.content))]),\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _vm._v(_vm._s(hint.cost)),\n ]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-edit\",\n attrs: { role: \"button\" },\n on: {\n click: function ($event) {\n return _vm.editHint(hint.id)\n },\n },\n }),\n _vm._v(\" \"),\n _c(\"i\", {\n staticClass: \"btn-fa fas fa-times\",\n attrs: { role: \"button\" },\n on: {\n click: function ($event) {\n return _vm.deleteHint(hint.id)\n },\n },\n }),\n ]),\n ])\n }),\n 0\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success float-right\",\n on: { click: _vm.addHint },\n },\n [_vm._v(\"\\n Create Hint\\n \")]\n ),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"thead\", [\n _c(\"tr\", [\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"ID\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Hint\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [_c(\"b\", [_vm._v(\"Cost\")])]),\n _vm._v(\" \"),\n _c(\"td\", { staticClass: \"text-center\" }, [\n _c(\"b\", [_vm._v(\"Settings\")]),\n ]),\n ]),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/hints/HintsList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -954,7 +954,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"card bg-light mb-4\" }, [\n _c(\n \"button\",\n {\n staticClass: \"delete-notification close position-absolute p-3\",\n staticStyle: { right: \"0\" },\n attrs: {\n type: \"button\",\n \"data-notif-id\": this.id,\n \"data-dismiss\": \"alert\",\n \"aria-label\": \"Close\"\n },\n on: {\n click: function($event) {\n return _vm.deleteNotification()\n }\n }\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-body\" }, [\n _c(\"h3\", { staticClass: \"card-title\" }, [_vm._v(_vm._s(_vm.title))]),\n _vm._v(\" \"),\n _c(\"blockquote\", { staticClass: \"blockquote mb-0\" }, [\n _c(\"p\", { domProps: { innerHTML: _vm._s(this.html) } }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _c(\"span\", { attrs: { \"data-time\": this.date } }, [\n _vm._v(_vm._s(this.localDate()))\n ])\n ])\n ])\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/notifications/Notification.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"card bg-light mb-4\" }, [\n _c(\n \"button\",\n {\n staticClass: \"delete-notification close position-absolute p-3\",\n staticStyle: { right: \"0\" },\n attrs: {\n type: \"button\",\n \"data-notif-id\": this.id,\n \"data-dismiss\": \"alert\",\n \"aria-label\": \"Close\",\n },\n on: {\n click: function ($event) {\n return _vm.deleteNotification()\n },\n },\n },\n [_c(\"span\", { attrs: { \"aria-hidden\": \"true\" } }, [_vm._v(\"×\")])]\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-body\" }, [\n _c(\"h3\", { staticClass: \"card-title\" }, [_vm._v(_vm._s(_vm.title))]),\n _vm._v(\" \"),\n _c(\"blockquote\", { staticClass: \"blockquote mb-0\" }, [\n _c(\"p\", { domProps: { innerHTML: _vm._s(this.html) } }),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _c(\"span\", { attrs: { \"data-time\": this.date } }, [\n _vm._v(_vm._s(this.localDate())),\n ]),\n ]),\n ]),\n ]),\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/notifications/Notification.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -966,7 +966,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"form\",\n {\n on: {\n submit: function($event) {\n $event.preventDefault()\n return _vm.updateRequirements($event)\n }\n }\n },\n [\n _c(\n \"div\",\n { staticClass: \"form-group scrollbox\" },\n [\n _c(\n \"transition-group\",\n { attrs: { name: \"flip-list\" } },\n [\n _vm._l(_vm.requiredChallenges, function(challenge) {\n return _c(\n \"div\",\n { key: challenge.id, staticClass: \"form-check\" },\n [\n _c(\n \"label\",\n { staticClass: \"form-check-label cursor-pointer\" },\n [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.selectedRequirements,\n expression: \"selectedRequirements\"\n }\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n value: challenge.id,\n checked: Array.isArray(_vm.selectedRequirements)\n ? _vm._i(\n _vm.selectedRequirements,\n challenge.id\n ) > -1\n : _vm.selectedRequirements\n },\n on: {\n change: function($event) {\n var $$a = _vm.selectedRequirements,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = challenge.id,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n (_vm.selectedRequirements = $$a.concat([\n $$v\n ]))\n } else {\n $$i > -1 &&\n (_vm.selectedRequirements = $$a\n .slice(0, $$i)\n .concat($$a.slice($$i + 1)))\n }\n } else {\n _vm.selectedRequirements = $$c\n }\n }\n }\n }),\n _vm._v(\n \"\\n \" +\n _vm._s(challenge.name) +\n \"\\n \"\n )\n ]\n )\n ]\n )\n }),\n _vm._v(\" \"),\n _vm._l(_vm.otherChallenges, function(challenge) {\n return _c(\n \"div\",\n { key: challenge.id, staticClass: \"form-check\" },\n [\n _c(\n \"label\",\n { staticClass: \"form-check-label cursor-pointer\" },\n [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.selectedRequirements,\n expression: \"selectedRequirements\"\n }\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n value: challenge.id,\n checked: Array.isArray(_vm.selectedRequirements)\n ? _vm._i(\n _vm.selectedRequirements,\n challenge.id\n ) > -1\n : _vm.selectedRequirements\n },\n on: {\n change: function($event) {\n var $$a = _vm.selectedRequirements,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = challenge.id,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n (_vm.selectedRequirements = $$a.concat([\n $$v\n ]))\n } else {\n $$i > -1 &&\n (_vm.selectedRequirements = $$a\n .slice(0, $$i)\n .concat($$a.slice($$i + 1)))\n }\n } else {\n _vm.selectedRequirements = $$c\n }\n }\n }\n }),\n _vm._v(\n \"\\n \" +\n _vm._s(challenge.name) +\n \"\\n \"\n )\n ]\n )\n ]\n )\n })\n ],\n 2\n )\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"select\",\n {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.selectedAnonymize,\n expression: \"selectedAnonymize\"\n }\n ],\n staticClass: \"form-control custom-select\",\n attrs: { name: \"anonymize\" },\n on: {\n change: function($event) {\n var $$selectedVal = Array.prototype.filter\n .call($event.target.options, function(o) {\n return o.selected\n })\n .map(function(o) {\n var val = \"_value\" in o ? o._value : o.value\n return val\n })\n _vm.selectedAnonymize = $event.target.multiple\n ? $$selectedVal\n : $$selectedVal[0]\n }\n }\n },\n [\n _c(\"option\", { domProps: { value: false } }, [_vm._v(\"Hidden\")]),\n _vm._v(\" \"),\n _c(\"option\", { domProps: { value: true } }, [\n _vm._v(\"Anonymized\")\n ])\n ]\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success float-right\",\n attrs: { disabled: !_vm.newRequirements }\n },\n [_vm._v(\"\\n Save\\n \")]\n )\n ])\n ]\n )\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [_c(\"b\", [_vm._v(\"Behavior if not unlocked\")])])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/requirements/Requirements.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\n \"form\",\n {\n on: {\n submit: function ($event) {\n $event.preventDefault()\n return _vm.updateRequirements.apply(null, arguments)\n },\n },\n },\n [\n _c(\n \"div\",\n { staticClass: \"form-group scrollbox\" },\n [\n _c(\n \"transition-group\",\n { attrs: { name: \"flip-list\" } },\n [\n _vm._l(_vm.requiredChallenges, function (challenge) {\n return _c(\n \"div\",\n { key: challenge.id, staticClass: \"form-check\" },\n [\n _c(\n \"label\",\n { staticClass: \"form-check-label cursor-pointer\" },\n [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.selectedRequirements,\n expression: \"selectedRequirements\",\n },\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n value: challenge.id,\n checked: Array.isArray(_vm.selectedRequirements)\n ? _vm._i(\n _vm.selectedRequirements,\n challenge.id\n ) > -1\n : _vm.selectedRequirements,\n },\n on: {\n change: function ($event) {\n var $$a = _vm.selectedRequirements,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = challenge.id,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n (_vm.selectedRequirements = $$a.concat([\n $$v,\n ]))\n } else {\n $$i > -1 &&\n (_vm.selectedRequirements = $$a\n .slice(0, $$i)\n .concat($$a.slice($$i + 1)))\n }\n } else {\n _vm.selectedRequirements = $$c\n }\n },\n },\n }),\n _vm._v(\n \"\\n \" +\n _vm._s(challenge.name) +\n \"\\n \"\n ),\n ]\n ),\n ]\n )\n }),\n _vm._v(\" \"),\n _vm._l(_vm.otherChallenges, function (challenge) {\n return _c(\n \"div\",\n { key: challenge.id, staticClass: \"form-check\" },\n [\n _c(\n \"label\",\n { staticClass: \"form-check-label cursor-pointer\" },\n [\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.selectedRequirements,\n expression: \"selectedRequirements\",\n },\n ],\n staticClass: \"form-check-input\",\n attrs: { type: \"checkbox\" },\n domProps: {\n value: challenge.id,\n checked: Array.isArray(_vm.selectedRequirements)\n ? _vm._i(\n _vm.selectedRequirements,\n challenge.id\n ) > -1\n : _vm.selectedRequirements,\n },\n on: {\n change: function ($event) {\n var $$a = _vm.selectedRequirements,\n $$el = $event.target,\n $$c = $$el.checked ? true : false\n if (Array.isArray($$a)) {\n var $$v = challenge.id,\n $$i = _vm._i($$a, $$v)\n if ($$el.checked) {\n $$i < 0 &&\n (_vm.selectedRequirements = $$a.concat([\n $$v,\n ]))\n } else {\n $$i > -1 &&\n (_vm.selectedRequirements = $$a\n .slice(0, $$i)\n .concat($$a.slice($$i + 1)))\n }\n } else {\n _vm.selectedRequirements = $$c\n }\n },\n },\n }),\n _vm._v(\n \"\\n \" +\n _vm._s(challenge.name) +\n \"\\n \"\n ),\n ]\n ),\n ]\n )\n }),\n ],\n 2\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\n \"select\",\n {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.selectedAnonymize,\n expression: \"selectedAnonymize\",\n },\n ],\n staticClass: \"form-control custom-select\",\n attrs: { name: \"anonymize\" },\n on: {\n change: function ($event) {\n var $$selectedVal = Array.prototype.filter\n .call($event.target.options, function (o) {\n return o.selected\n })\n .map(function (o) {\n var val = \"_value\" in o ? o._value : o.value\n return val\n })\n _vm.selectedAnonymize = $event.target.multiple\n ? $$selectedVal\n : $$selectedVal[0]\n },\n },\n },\n [\n _c(\"option\", { domProps: { value: false } }, [_vm._v(\"Hidden\")]),\n _vm._v(\" \"),\n _c(\"option\", { domProps: { value: true } }, [\n _vm._v(\"Anonymized\"),\n ]),\n ]\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success float-right\",\n attrs: { disabled: !_vm.newRequirements },\n },\n [_vm._v(\"\\n Save\\n \")]\n ),\n ]),\n ]\n ),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [_c(\"b\", [_vm._v(\"Behavior if not unlocked\")])])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/requirements/Requirements.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -978,7 +978,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"div\",\n { staticClass: \"my-3\", attrs: { id: \"challenge-tags\" } },\n _vm._l(_vm.tags, function(tag) {\n return _c(\n \"span\",\n {\n key: tag.id,\n staticClass: \"badge badge-primary mx-1 challenge-tag\"\n },\n [\n _c(\"span\", [_vm._v(_vm._s(tag.value))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"btn-fa delete-tag\",\n on: {\n click: function($event) {\n return _vm.deleteTag(tag.id)\n }\n }\n },\n [_vm._v(\" ×\")]\n )\n ]\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.tagValue,\n expression: \"tagValue\",\n modifiers: { lazy: true }\n }\n ],\n staticClass: \"form-control\",\n attrs: { id: \"tags-add-input\", maxlength: \"80\", type: \"text\" },\n domProps: { value: _vm.tagValue },\n on: {\n keyup: function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")\n ) {\n return null\n }\n return _vm.addTag()\n },\n change: function($event) {\n _vm.tagValue = $event.target.value\n }\n }\n })\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"Tag\\n \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\"Type tag and press Enter\")\n ])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/tags/TagsList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"div\",\n { staticClass: \"my-3\", attrs: { id: \"challenge-tags\" } },\n _vm._l(_vm.tags, function (tag) {\n return _c(\n \"span\",\n {\n key: tag.id,\n staticClass: \"badge badge-primary mx-1 challenge-tag\",\n },\n [\n _c(\"span\", [_vm._v(_vm._s(tag.value))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"btn-fa delete-tag\",\n on: {\n click: function ($event) {\n return _vm.deleteTag(tag.id)\n },\n },\n },\n [_vm._v(\" ×\")]\n ),\n ]\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model.lazy\",\n value: _vm.tagValue,\n expression: \"tagValue\",\n modifiers: { lazy: true },\n },\n ],\n staticClass: \"form-control\",\n attrs: { id: \"tags-add-input\", maxlength: \"80\", type: \"text\" },\n domProps: { value: _vm.tagValue },\n on: {\n keyup: function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")\n ) {\n return null\n }\n return _vm.addTag()\n },\n change: function ($event) {\n _vm.tagValue = $event.target.value\n },\n },\n }),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"Tag\\n \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\"Type tag and press Enter\"),\n ]),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/tags/TagsList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -990,7 +990,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Search Users\")]),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.searchedName,\n expression: \"searchedName\"\n }\n ],\n staticClass: \"form-control\",\n attrs: { type: \"text\", placeholder: \"Search for users\" },\n domProps: { value: _vm.searchedName },\n on: {\n keyup: [\n function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"down\", 40, $event.key, [\n \"Down\",\n \"ArrowDown\"\n ])\n ) {\n return null\n }\n return _vm.moveCursor(\"down\")\n },\n function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"up\", 38, $event.key, [\"Up\", \"ArrowUp\"])\n ) {\n return null\n }\n return _vm.moveCursor(\"up\")\n },\n function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")\n ) {\n return null\n }\n return _vm.selectUser()\n }\n ],\n input: function($event) {\n if ($event.target.composing) {\n return\n }\n _vm.searchedName = $event.target.value\n }\n }\n })\n ]),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"form-group\" },\n _vm._l(_vm.selectedUsers, function(user) {\n return _c(\n \"span\",\n { key: user.id, staticClass: \"badge badge-primary mr-1\" },\n [\n _vm._v(\"\\n \" + _vm._s(user.name) + \"\\n \"),\n _c(\n \"a\",\n {\n staticClass: \"btn-fa\",\n on: {\n click: function($event) {\n return _vm.removeSelectedUser(user.id)\n }\n }\n },\n [_vm._v(\" ×\")]\n )\n ]\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm.userResults.length == 0 &&\n this.searchedName != \"\" &&\n _vm.awaitingSearch == false\n ? _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\"span\", { staticClass: \"text-muted\" }, [\n _vm._v(\"\\n No users found\\n \")\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"ul\",\n { staticClass: \"list-group\" },\n _vm._l(_vm.userResults, function(user, idx) {\n return _c(\n \"li\",\n {\n key: user.id,\n class: {\n \"list-group-item\": true,\n active: idx === _vm.selectedResultIdx\n },\n on: {\n click: function($event) {\n return _vm.selectUser(idx)\n }\n }\n },\n [\n _vm._v(\"\\n \" + _vm._s(user.name) + \"\\n \"),\n user.team_id\n ? _c(\n \"small\",\n {\n class: {\n \"float-right\": true,\n \"text-white\": idx === _vm.selectedResultIdx,\n \"text-muted\": idx !== _vm.selectedResultIdx\n }\n },\n [_vm._v(\"\\n already in a team\\n \")]\n )\n : _vm._e()\n ]\n )\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success d-inline-block float-right\",\n on: {\n click: function($event) {\n return _vm.addUsers()\n }\n }\n },\n [_vm._v(\"\\n Add Users\\n \")]\n )\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/teams/UserAddForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", [\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\"label\", [_vm._v(\"Search Users\")]),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.searchedName,\n expression: \"searchedName\",\n },\n ],\n staticClass: \"form-control\",\n attrs: { type: \"text\", placeholder: \"Search for users\" },\n domProps: { value: _vm.searchedName },\n on: {\n keyup: [\n function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"down\", 40, $event.key, [\n \"Down\",\n \"ArrowDown\",\n ])\n ) {\n return null\n }\n return _vm.moveCursor(\"down\")\n },\n function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"up\", 38, $event.key, [\"Up\", \"ArrowUp\"])\n ) {\n return null\n }\n return _vm.moveCursor(\"up\")\n },\n function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")\n ) {\n return null\n }\n return _vm.selectUser()\n },\n ],\n input: function ($event) {\n if ($event.target.composing) {\n return\n }\n _vm.searchedName = $event.target.value\n },\n },\n }),\n ]),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"form-group\" },\n _vm._l(_vm.selectedUsers, function (user) {\n return _c(\n \"span\",\n { key: user.id, staticClass: \"badge badge-primary mr-1\" },\n [\n _vm._v(\"\\n \" + _vm._s(user.name) + \"\\n \"),\n _c(\n \"a\",\n {\n staticClass: \"btn-fa\",\n on: {\n click: function ($event) {\n return _vm.removeSelectedUser(user.id)\n },\n },\n },\n [_vm._v(\" ×\")]\n ),\n ]\n )\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm.userResults.length == 0 &&\n this.searchedName != \"\" &&\n _vm.awaitingSearch == false\n ? _c(\"div\", { staticClass: \"text-center\" }, [\n _c(\"span\", { staticClass: \"text-muted\" }, [\n _vm._v(\"\\n No users found\\n \"),\n ]),\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\n \"ul\",\n { staticClass: \"list-group\" },\n _vm._l(_vm.userResults, function (user, idx) {\n return _c(\n \"li\",\n {\n key: user.id,\n class: {\n \"list-group-item\": true,\n active: idx === _vm.selectedResultIdx,\n },\n on: {\n click: function ($event) {\n return _vm.selectUser(idx)\n },\n },\n },\n [\n _vm._v(\"\\n \" + _vm._s(user.name) + \"\\n \"),\n user.team_id\n ? _c(\n \"small\",\n {\n class: {\n \"float-right\": true,\n \"text-white\": idx === _vm.selectedResultIdx,\n \"text-muted\": idx !== _vm.selectedResultIdx,\n },\n },\n [_vm._v(\"\\n already in a team\\n \")]\n )\n : _vm._e(),\n ]\n )\n }),\n 0\n ),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\n \"button\",\n {\n staticClass: \"btn btn-success d-inline-block float-right\",\n on: {\n click: function ($event) {\n return _vm.addUsers()\n },\n },\n },\n [_vm._v(\"\\n Add Users\\n \")]\n ),\n ]),\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/teams/UserAddForm.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -1002,7 +1002,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { ; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"div\",\n { staticClass: \"my-3\", attrs: { id: \"challenge-topics\" } },\n _vm._l(_vm.topics, function(topic) {\n return _c(\"h5\", { key: topic.id, staticClass: \"challenge-tag\" }, [\n _c(\"span\", { staticClass: \"mr-1\" }, [_vm._v(_vm._s(topic.value))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"btn-fa delete-tag\",\n on: {\n click: function($event) {\n return _vm.deleteTopic(topic.id)\n }\n }\n },\n [_vm._v(\" ×\")]\n )\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.topicValue,\n expression: \"topicValue\"\n }\n ],\n staticClass: \"form-control\",\n attrs: { id: \"tags-add-input\", maxlength: \"255\", type: \"text\" },\n domProps: { value: _vm.topicValue },\n on: {\n keyup: [\n function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"down\", 40, $event.key, [\n \"Down\",\n \"ArrowDown\"\n ])\n ) {\n return null\n }\n return _vm.moveCursor(\"down\")\n },\n function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"up\", 38, $event.key, [\"Up\", \"ArrowUp\"])\n ) {\n return null\n }\n return _vm.moveCursor(\"up\")\n },\n function($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")\n ) {\n return null\n }\n return _vm.addTopic()\n }\n ],\n input: function($event) {\n if ($event.target.composing) {\n return\n }\n _vm.topicValue = $event.target.value\n }\n }\n })\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\n \"ul\",\n { staticClass: \"list-group\" },\n _vm._l(_vm.topicResults, function(topic, idx) {\n return _c(\n \"li\",\n {\n key: topic.id,\n class: {\n \"list-group-item\": true,\n active: idx + 1 === _vm.selectedResultIdx\n },\n on: {\n click: function($event) {\n return _vm.selectTopic(idx)\n }\n }\n },\n [_vm._v(\"\\n \" + _vm._s(topic.value) + \"\\n \")]\n )\n }),\n 0\n )\n ])\n ])\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"\\n Topic\\n \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\"Type topic and press Enter\")\n ])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/topics/TopicsList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"col-md-12\" }, [\n _c(\n \"div\",\n { staticClass: \"my-3\", attrs: { id: \"challenge-topics\" } },\n _vm._l(_vm.topics, function (topic) {\n return _c(\"h5\", { key: topic.id, staticClass: \"challenge-tag\" }, [\n _c(\"span\", { staticClass: \"mr-1\" }, [_vm._v(_vm._s(topic.value))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"btn-fa delete-tag\",\n on: {\n click: function ($event) {\n return _vm.deleteTopic(topic.id)\n },\n },\n },\n [_vm._v(\" ×\")]\n ),\n ])\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _vm._m(0),\n _vm._v(\" \"),\n _c(\"input\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.topicValue,\n expression: \"topicValue\",\n },\n ],\n staticClass: \"form-control\",\n attrs: { id: \"tags-add-input\", maxlength: \"255\", type: \"text\" },\n domProps: { value: _vm.topicValue },\n on: {\n keyup: [\n function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"down\", 40, $event.key, [\n \"Down\",\n \"ArrowDown\",\n ])\n ) {\n return null\n }\n return _vm.moveCursor(\"down\")\n },\n function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"up\", 38, $event.key, [\"Up\", \"ArrowUp\"])\n ) {\n return null\n }\n return _vm.moveCursor(\"up\")\n },\n function ($event) {\n if (\n !$event.type.indexOf(\"key\") &&\n _vm._k($event.keyCode, \"enter\", 13, $event.key, \"Enter\")\n ) {\n return null\n }\n return _vm.addTopic()\n },\n ],\n input: function ($event) {\n if ($event.target.composing) {\n return\n }\n _vm.topicValue = $event.target.value\n },\n },\n }),\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"form-group\" }, [\n _c(\n \"ul\",\n { staticClass: \"list-group\" },\n _vm._l(_vm.topicResults, function (topic, idx) {\n return _c(\n \"li\",\n {\n key: topic.id,\n class: {\n \"list-group-item\": true,\n active: idx + 1 === _vm.selectedResultIdx,\n },\n on: {\n click: function ($event) {\n return _vm.selectTopic(idx)\n },\n },\n },\n [_vm._v(\"\\n \" + _vm._s(topic.value) + \"\\n \")]\n )\n }),\n 0\n ),\n ]),\n ])\n}\nvar staticRenderFns = [\n function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"label\", [\n _vm._v(\"\\n Topic\\n \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\"small\", { staticClass: \"text-muted\" }, [\n _vm._v(\"Type topic and press Enter\"),\n ]),\n ])\n },\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/components/topics/TopicsList.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -1013,7 +1013,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("// style-loader: Adds some css to the DOM by adding a in svg, where nodeName is 'style',\n// CSS classes is defined globally wherever the style tags are declared.\nif(nodeName==='defs'){// define flag\nthis._isDefine=true;}else if(nodeName==='text'){this._isText=true;}var el;if(this._isDefine){var parser=defineParsers[nodeName];if(parser){var def=parser.call(this,xmlNode);var id=xmlNode.getAttribute('id');if(id){this._defs[id]=def;}}}else{var parser=nodeParsers[nodeName];if(parser){el=parser.call(this,xmlNode,parentGroup);parentGroup.add(el);}}var child=xmlNode.firstChild;while(child){if(child.nodeType===1){this._parseNode(child,el);}// Is text\nif(child.nodeType===3&&this._isText){this._parseText(child,el);}child=child.nextSibling;}// Quit define\nif(nodeName==='defs'){this._isDefine=false;}else if(nodeName==='text'){this._isText=false;}};SVGParser.prototype._parseText=function(xmlNode,parentGroup){if(xmlNode.nodeType===1){var dx=xmlNode.getAttribute('dx')||0;var dy=xmlNode.getAttribute('dy')||0;this._textX+=parseFloat(dx);this._textY+=parseFloat(dy);}var text=new Text({style:{text:xmlNode.textContent,transformText:true},position:[this._textX||0,this._textY||0]});inheritStyle(parentGroup,text);parseAttributes(xmlNode,text,this._defs);var fontSize=text.style.fontSize;if(fontSize&&fontSize<9){// PENDING\ntext.style.fontSize=9;text.scale=text.scale||[1,1];text.scale[0]*=fontSize/9;text.scale[1]*=fontSize/9;}var rect=text.getBoundingRect();this._textX+=rect.width;parentGroup.add(text);return text;};var nodeParsers={'g':function g(xmlNode,parentGroup){var g=new Group();inheritStyle(parentGroup,g);parseAttributes(xmlNode,g,this._defs);return g;},'rect':function rect(xmlNode,parentGroup){var rect=new Rect();inheritStyle(parentGroup,rect);parseAttributes(xmlNode,rect,this._defs);rect.setShape({x:parseFloat(xmlNode.getAttribute('x')||0),y:parseFloat(xmlNode.getAttribute('y')||0),width:parseFloat(xmlNode.getAttribute('width')||0),height:parseFloat(xmlNode.getAttribute('height')||0)});// console.log(xmlNode.getAttribute('transform'));\n// console.log(rect.transform);\nreturn rect;},'circle':function circle(xmlNode,parentGroup){var circle=new Circle();inheritStyle(parentGroup,circle);parseAttributes(xmlNode,circle,this._defs);circle.setShape({cx:parseFloat(xmlNode.getAttribute('cx')||0),cy:parseFloat(xmlNode.getAttribute('cy')||0),r:parseFloat(xmlNode.getAttribute('r')||0)});return circle;},'line':function line(xmlNode,parentGroup){var line=new Line();inheritStyle(parentGroup,line);parseAttributes(xmlNode,line,this._defs);line.setShape({x1:parseFloat(xmlNode.getAttribute('x1')||0),y1:parseFloat(xmlNode.getAttribute('y1')||0),x2:parseFloat(xmlNode.getAttribute('x2')||0),y2:parseFloat(xmlNode.getAttribute('y2')||0)});return line;},'ellipse':function ellipse(xmlNode,parentGroup){var ellipse=new Ellipse();inheritStyle(parentGroup,ellipse);parseAttributes(xmlNode,ellipse,this._defs);ellipse.setShape({cx:parseFloat(xmlNode.getAttribute('cx')||0),cy:parseFloat(xmlNode.getAttribute('cy')||0),rx:parseFloat(xmlNode.getAttribute('rx')||0),ry:parseFloat(xmlNode.getAttribute('ry')||0)});return ellipse;},'polygon':function polygon(xmlNode,parentGroup){var points=xmlNode.getAttribute('points');if(points){points=parsePoints(points);}var polygon=new Polygon({shape:{points:points||[]}});inheritStyle(parentGroup,polygon);parseAttributes(xmlNode,polygon,this._defs);return polygon;},'polyline':function polyline(xmlNode,parentGroup){var path=new Path();inheritStyle(parentGroup,path);parseAttributes(xmlNode,path,this._defs);var points=xmlNode.getAttribute('points');if(points){points=parsePoints(points);}var polyline=new Polyline({shape:{points:points||[]}});return polyline;},'image':function image(xmlNode,parentGroup){var img=new ZImage();inheritStyle(parentGroup,img);parseAttributes(xmlNode,img,this._defs);img.setStyle({image:xmlNode.getAttribute('xlink:href'),x:xmlNode.getAttribute('x'),y:xmlNode.getAttribute('y'),width:xmlNode.getAttribute('width'),height:xmlNode.getAttribute('height')});return img;},'text':function text(xmlNode,parentGroup){var x=xmlNode.getAttribute('x')||0;var y=xmlNode.getAttribute('y')||0;var dx=xmlNode.getAttribute('dx')||0;var dy=xmlNode.getAttribute('dy')||0;this._textX=parseFloat(x)+parseFloat(dx);this._textY=parseFloat(y)+parseFloat(dy);var g=new Group();inheritStyle(parentGroup,g);parseAttributes(xmlNode,g,this._defs);return g;},'tspan':function tspan(xmlNode,parentGroup){var x=xmlNode.getAttribute('x');var y=xmlNode.getAttribute('y');if(x!=null){// new offset x\nthis._textX=parseFloat(x);}if(y!=null){// new offset y\nthis._textY=parseFloat(y);}var dx=xmlNode.getAttribute('dx')||0;var dy=xmlNode.getAttribute('dy')||0;var g=new Group();inheritStyle(parentGroup,g);parseAttributes(xmlNode,g,this._defs);this._textX+=dx;this._textY+=dy;return g;},'path':function path(xmlNode,parentGroup){// TODO svg fill rule\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n// path.style.globalCompositeOperation = 'xor';\nvar d=xmlNode.getAttribute('d')||'';// Performance sensitive.\nvar path=createFromString(d);inheritStyle(parentGroup,path);parseAttributes(xmlNode,path,this._defs);return path;}};var defineParsers={'lineargradient':function lineargradient(xmlNode){var x1=parseInt(xmlNode.getAttribute('x1')||0,10);var y1=parseInt(xmlNode.getAttribute('y1')||0,10);var x2=parseInt(xmlNode.getAttribute('x2')||10,10);var y2=parseInt(xmlNode.getAttribute('y2')||0,10);var gradient=new LinearGradient(x1,y1,x2,y2);_parseGradientColorStops(xmlNode,gradient);return gradient;},'radialgradient':function radialgradient(xmlNode){}};function _parseGradientColorStops(xmlNode,gradient){var stop=xmlNode.firstChild;while(stop){if(stop.nodeType===1){var offset=stop.getAttribute('offset');if(offset.indexOf('%')>0){// percentage\noffset=parseInt(offset,10)/100;}else if(offset){// number from 0 to 1\noffset=parseFloat(offset);}else{offset=0;}var stopColor=stop.getAttribute('stop-color')||'#000000';gradient.addColorStop(offset,stopColor);}stop=stop.nextSibling;}}function inheritStyle(parent,child){if(parent&&parent.__inheritedStyle){if(!child.__inheritedStyle){child.__inheritedStyle={};}defaults(child.__inheritedStyle,parent.__inheritedStyle);}}function parsePoints(pointsString){var list=trim(pointsString).split(DILIMITER_REG);var points=[];for(var i=0;i0;i-=2){var value=transformOps[i];var type=transformOps[i-1];m=m||create$1();switch(type){case'translate':value=trim(value).split(DILIMITER_REG);translate(m,m,[parseFloat(value[0]),parseFloat(value[1]||0)]);break;case'scale':value=trim(value).split(DILIMITER_REG);scale$1(m,m,[parseFloat(value[0]),parseFloat(value[1]||value[0])]);break;case'rotate':value=trim(value).split(DILIMITER_REG);rotate(m,m,parseFloat(value[0]));break;case'skew':value=trim(value).split(DILIMITER_REG);console.warn('Skew transform is not supported yet');break;case'matrix':var value=trim(value).split(DILIMITER_REG);m[0]=parseFloat(value[0]);m[1]=parseFloat(value[1]);m[2]=parseFloat(value[2]);m[3]=parseFloat(value[3]);m[4]=parseFloat(value[4]);m[5]=parseFloat(value[5]);break;}}node.setLocalTransform(m);}}// Value may contain space.\nvar styleRegex=/([^\\s:;]+)\\s*:\\s*([^:;]+)/g;function parseStyleAttribute(xmlNode){var style=xmlNode.getAttribute('style');var result={};if(!style){return result;}var styleList={};styleRegex.lastIndex=0;var styleRegResult;while((styleRegResult=styleRegex.exec(style))!=null){styleList[styleRegResult[1]]=styleRegResult[2];}for(var svgAttrName in attributesMap){if(attributesMap.hasOwnProperty(svgAttrName)&&styleList[svgAttrName]!=null){result[attributesMap[svgAttrName]]=styleList[svgAttrName];}}return result;}/**\n * @param {Array.} viewBoxRect\n * @param {number} width\n * @param {number} height\n * @return {Object} {scale, position}\n */function makeViewBoxTransform(viewBoxRect,width,height){var scaleX=width/viewBoxRect.width;var scaleY=height/viewBoxRect.height;var scale=Math.min(scaleX,scaleY);// preserveAspectRatio 'xMidYMid'\nvar viewBoxScale=[scale,scale];var viewBoxPosition=[-(viewBoxRect.x+viewBoxRect.width/2)*scale+width/2,-(viewBoxRect.y+viewBoxRect.height/2)*scale+height/2];return{scale:viewBoxScale,position:viewBoxPosition};}/**\n * @param {string|XMLElement} xml\n * @param {Object} [opt]\n * @param {number} [opt.width] Default width if svg width not specified or is a percent value.\n * @param {number} [opt.height] Default height if svg height not specified or is a percent value.\n * @param {boolean} [opt.ignoreViewBox]\n * @param {boolean} [opt.ignoreRootClip]\n * @return {Object} result:\n * {\n * root: Group, The root of the the result tree of zrender shapes,\n * width: number, the viewport width of the SVG,\n * height: number, the viewport height of the SVG,\n * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists,\n * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists.\n * }\n */ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var storage=createHashMap();// For minimize the code size of common echarts package,\n// do not put too much logic in this module.\nvar mapDataStorage={// The format of record: see `echarts.registerMap`.\n// Compatible with previous `echarts.registerMap`.\nregisterMap:function registerMap(mapName,rawGeoJson,rawSpecialAreas){var records;if(isArray(rawGeoJson)){records=rawGeoJson;}else if(rawGeoJson.svg){records=[{type:'svg',source:rawGeoJson.svg,specialAreas:rawGeoJson.specialAreas}];}else{// Backward compatibility.\nif(rawGeoJson.geoJson&&!rawGeoJson.features){rawSpecialAreas=rawGeoJson.specialAreas;rawGeoJson=rawGeoJson.geoJson;}records=[{type:'geoJSON',source:rawGeoJson,specialAreas:rawSpecialAreas}];}each$1(records,function(record){var type=record.type;type==='geoJson'&&(type=record.type='geoJSON');var parse=parsers[type];if(__DEV__){assert$1(parse,'Illegal map type: '+type);}parse(record);});return storage.set(mapName,records);},retrieveMap:function retrieveMap(mapName){return storage.get(mapName);}};var parsers={geoJSON:function geoJSON(record){var source=record.source;record.geoJSON=!isString(source)?source:typeof JSON!=='undefined'&&JSON.parse?JSON.parse(source):new Function('return ('+source+');')();},// Only perform parse to XML object here, which might be time\n// consiming for large SVG.\n// Although convert XML to zrender element is also time consiming,\n// if we do it here, the clone of zrender elements has to be\n// required. So we do it once for each geo instance, util real\n// performance issues call for optimizing it.\nsvg:function svg(record){record.svgXML=parseXML(record.source);}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var assert=assert$1;var each=each$1;var isFunction=isFunction$1;var isObject=isObject$1;var parseClassType=ComponentModel.parseClassType;var version='4.9.0';var dependencies={zrender:'4.3.2'};var TEST_FRAME_REMAIN_TIME=1;var PRIORITY_PROCESSOR_FILTER=1000;var PRIORITY_PROCESSOR_SERIES_FILTER=800;var PRIORITY_PROCESSOR_DATASTACK=900;var PRIORITY_PROCESSOR_STATISTIC=5000;var PRIORITY_VISUAL_LAYOUT=1000;var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT=1100;var PRIORITY_VISUAL_GLOBAL=2000;var PRIORITY_VISUAL_CHART=3000;var PRIORITY_VISUAL_POST_CHART_LAYOUT=3500;var PRIORITY_VISUAL_COMPONENT=4000;// FIXME\n// necessary?\nvar PRIORITY_VISUAL_BRUSH=5000;var PRIORITY={PROCESSOR:{FILTER:PRIORITY_PROCESSOR_FILTER,SERIES_FILTER:PRIORITY_PROCESSOR_SERIES_FILTER,STATISTIC:PRIORITY_PROCESSOR_STATISTIC},VISUAL:{LAYOUT:PRIORITY_VISUAL_LAYOUT,PROGRESSIVE_LAYOUT:PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,GLOBAL:PRIORITY_VISUAL_GLOBAL,CHART:PRIORITY_VISUAL_CHART,POST_CHART_LAYOUT:PRIORITY_VISUAL_POST_CHART_LAYOUT,COMPONENT:PRIORITY_VISUAL_COMPONENT,BRUSH:PRIORITY_VISUAL_BRUSH}};// Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\nvar IN_MAIN_PROCESS='__flagInMainProcess';var OPTION_UPDATED='__optionUpdated';var ACTION_REG=/^[a-zA-Z0-9_]+$/;function createRegisterEventWithLowercaseName(method,ignoreDisposed){return function(eventName,handler,context){if(!ignoreDisposed&&this._disposed){disposedWarning(this.id);return;}// Event name is all lowercase\neventName=eventName&&eventName.toLowerCase();Eventful.prototype[method].call(this,eventName,handler,context);};}/**\n * @module echarts~MessageCenter\n */function MessageCenter(){Eventful.call(this);}MessageCenter.prototype.on=createRegisterEventWithLowercaseName('on',true);MessageCenter.prototype.off=createRegisterEventWithLowercaseName('off',true);MessageCenter.prototype.one=createRegisterEventWithLowercaseName('one',true);mixin(MessageCenter,Eventful);/**\n * @module echarts~ECharts\n */function ECharts(dom,theme$$1,opts){opts=opts||{};// Get theme by name\nif(typeof theme$$1==='string'){theme$$1=themeStorage[theme$$1];}/**\n * @type {string}\n */this.id;/**\n * Group id\n * @type {string}\n */this.group;/**\n * @type {HTMLElement}\n * @private\n */this._dom=dom;var defaultRenderer='canvas';if(__DEV__){defaultRenderer=(typeof window==='undefined'?global:window).__ECHARTS__DEFAULT__RENDERER__||defaultRenderer;}/**\n * @type {module:zrender/ZRender}\n * @private\n */var zr=this._zr=init$1(dom,{renderer:opts.renderer||defaultRenderer,devicePixelRatio:opts.devicePixelRatio,width:opts.width,height:opts.height});/**\n * Expect 60 fps.\n * @type {Function}\n * @private\n */this._throttledZrFlush=throttle(bind(zr.flush,zr),17);var theme$$1=_clone(theme$$1);theme$$1&&backwardCompat(theme$$1,true);/**\n * @type {Object}\n * @private\n */this._theme=theme$$1;/**\n * @type {Array.}\n * @private\n */this._chartsViews=[];/**\n * @type {Object.}\n * @private\n */this._chartsMap={};/**\n * @type {Array.}\n * @private\n */this._componentsViews=[];/**\n * @type {Object.}\n * @private\n */this._componentsMap={};/**\n * @type {module:echarts/CoordinateSystem}\n * @private\n */this._coordSysMgr=new CoordinateSystemManager();/**\n * @type {module:echarts/ExtensionAPI}\n * @private\n */var api=this._api=createExtensionAPI(this);// Sort on demand\nfunction prioritySortFunc(a,b){return a.__prio-b.__prio;}sort(visualFuncs,prioritySortFunc);sort(dataProcessorFuncs,prioritySortFunc);/**\n * @type {module:echarts/stream/Scheduler}\n */this._scheduler=new Scheduler(this,api,dataProcessorFuncs,visualFuncs);Eventful.call(this,this._ecEventProcessor=new EventProcessor());/**\n * @type {module:echarts~MessageCenter}\n * @private\n */this._messageCenter=new MessageCenter();// Init mouse events\nthis._initEvents();// In case some people write `window.onresize = chart.resize`\nthis.resize=bind(this.resize,this);// Can't dispatch action during rendering procedure\nthis._pendingActions=[];zr.animation.on('frame',this._onframe,this);bindRenderedEvent(zr,this);// ECharts instance can be used as value.\nsetAsPrimitive(this);}var echartsProto=ECharts.prototype;echartsProto._onframe=function(){if(this._disposed){return;}var scheduler=this._scheduler;// Lazy update\nif(this[OPTION_UPDATED]){var silent=this[OPTION_UPDATED].silent;this[IN_MAIN_PROCESS]=true;prepare(this);updateMethods.update.call(this);this[IN_MAIN_PROCESS]=false;this[OPTION_UPDATED]=false;flushPendingActions.call(this,silent);triggerUpdatedEvent.call(this,silent);}// Avoid do both lazy update and progress in one frame.\nelse if(scheduler.unfinished){// Stream progress.\nvar remainTime=TEST_FRAME_REMAIN_TIME;var ecModel=this._model;var api=this._api;scheduler.unfinished=false;do{var startTime=+new Date();scheduler.performSeriesTasks(ecModel);// Currently dataProcessorFuncs do not check threshold.\nscheduler.performDataProcessorTasks(ecModel);updateStreamModes(this,ecModel);// Do not update coordinate system here. Because that coord system update in\n// each frame is not a good user experience. So we follow the rule that\n// the extent of the coordinate system is determin in the first frame (the\n// frame is executed immedietely after task reset.\n// this._coordSysMgr.update(ecModel, api);\n// console.log('--- ec frame visual ---', remainTime);\nscheduler.performVisualTasks(ecModel);renderSeries(this,this._model,api,'remain');remainTime-=+new Date()-startTime;}while(remainTime>0&&scheduler.unfinished);// Call flush explicitly for trigger finished event.\nif(!scheduler.unfinished){this._zr.flush();}// Else, zr flushing be ensue within the same frame,\n// because zr flushing is after onframe event.\n}};/**\n * @return {HTMLElement}\n */echartsProto.getDom=function(){return this._dom;};/**\n * @return {module:zrender~ZRender}\n */echartsProto.getZr=function(){return this._zr;};/**\n * Usage:\n * chart.setOption(option, notMerge, lazyUpdate);\n * chart.setOption(option, {\n * notMerge: ...,\n * lazyUpdate: ...,\n * silent: ...\n * });\n *\n * @param {Object} option\n * @param {Object|boolean} [opts] opts or notMerge.\n * @param {boolean} [opts.notMerge=false]\n * @param {boolean} [opts.lazyUpdate=false] Useful when setOption frequently.\n */echartsProto.setOption=function(option,notMerge,lazyUpdate){if(__DEV__){assert(!this[IN_MAIN_PROCESS],'`setOption` should not be called during main process.');}if(this._disposed){disposedWarning(this.id);return;}var silent;if(isObject(notMerge)){lazyUpdate=notMerge.lazyUpdate;silent=notMerge.silent;notMerge=notMerge.notMerge;}this[IN_MAIN_PROCESS]=true;if(!this._model||notMerge){var optionManager=new OptionManager(this._api);var theme$$1=this._theme;var ecModel=this._model=new GlobalModel();ecModel.scheduler=this._scheduler;ecModel.init(null,null,theme$$1,optionManager);}this._model.setOption(option,optionPreprocessorFuncs);if(lazyUpdate){this[OPTION_UPDATED]={silent:silent};this[IN_MAIN_PROCESS]=false;}else{prepare(this);updateMethods.update.call(this);// Ensure zr refresh sychronously, and then pixel in canvas can be\n// fetched after `setOption`.\nthis._zr.flush();this[OPTION_UPDATED]=false;this[IN_MAIN_PROCESS]=false;flushPendingActions.call(this,silent);triggerUpdatedEvent.call(this,silent);}};/**\n * @DEPRECATED\n */echartsProto.setTheme=function(){console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');};/**\n * @return {module:echarts/model/Global}\n */echartsProto.getModel=function(){return this._model;};/**\n * @return {Object}\n */echartsProto.getOption=function(){return this._model&&this._model.getOption();};/**\n * @return {number}\n */echartsProto.getWidth=function(){return this._zr.getWidth();};/**\n * @return {number}\n */echartsProto.getHeight=function(){return this._zr.getHeight();};/**\n * @return {number}\n */echartsProto.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1;};/**\n * Get canvas which has all thing rendered\n * @param {Object} opts\n * @param {string} [opts.backgroundColor]\n * @return {string}\n */echartsProto.getRenderedCanvas=function(opts){if(!env$1.canvasSupported){return;}opts=opts||{};opts.pixelRatio=opts.pixelRatio||1;opts.backgroundColor=opts.backgroundColor||this._model.get('backgroundColor');var zr=this._zr;// var list = zr.storage.getDisplayList();\n// Stop animations\n// Never works before in init animation, so remove it.\n// zrUtil.each(list, function (el) {\n// el.stopAnimation(true);\n// });\nreturn zr.painter.getRenderedCanvas(opts);};/**\n * Get svg data url\n * @return {string}\n */echartsProto.getSvgDataURL=function(){if(!env$1.svgSupported){return;}var zr=this._zr;var list=zr.storage.getDisplayList();// Stop animations\neach$1(list,function(el){el.stopAnimation(true);});return zr.painter.toDataURL();};/**\n * @return {string}\n * @param {Object} opts\n * @param {string} [opts.type='png']\n * @param {string} [opts.pixelRatio=1]\n * @param {string} [opts.backgroundColor]\n * @param {string} [opts.excludeComponents]\n */echartsProto.getDataURL=function(opts){if(this._disposed){disposedWarning(this.id);return;}opts=opts||{};var excludeComponents=opts.excludeComponents;var ecModel=this._model;var excludesComponentViews=[];var self=this;each(excludeComponents,function(componentType){ecModel.eachComponent({mainType:componentType},function(component){var view=self._componentsMap[component.__viewId];if(!view.group.ignore){excludesComponentViews.push(view);view.group.ignore=true;}});});var url=this._zr.painter.getType()==='svg'?this.getSvgDataURL():this.getRenderedCanvas(opts).toDataURL('image/'+(opts&&opts.type||'png'));each(excludesComponentViews,function(view){view.group.ignore=false;});return url;};/**\n * @return {string}\n * @param {Object} opts\n * @param {string} [opts.type='png']\n * @param {string} [opts.pixelRatio=1]\n * @param {string} [opts.backgroundColor]\n */echartsProto.getConnectedDataURL=function(opts){if(this._disposed){disposedWarning(this.id);return;}if(!env$1.canvasSupported){return;}var isSvg=opts.type==='svg';var groupId=this.group;var mathMin=Math.min;var mathMax=Math.max;var MAX_NUMBER=Infinity;if(connectedGroups[groupId]){var left=MAX_NUMBER;var top=MAX_NUMBER;var right=-MAX_NUMBER;var bottom=-MAX_NUMBER;var canvasList=[];var dpr=opts&&opts.pixelRatio||1;each$1(instances,function(chart,id){if(chart.group===groupId){var canvas=isSvg?chart.getZr().painter.getSvgDom().innerHTML:chart.getRenderedCanvas(_clone(opts));var boundingRect=chart.getDom().getBoundingClientRect();left=mathMin(boundingRect.left,left);top=mathMin(boundingRect.top,top);right=mathMax(boundingRect.right,right);bottom=mathMax(boundingRect.bottom,bottom);canvasList.push({dom:canvas,left:boundingRect.left,top:boundingRect.top});}});left*=dpr;top*=dpr;right*=dpr;bottom*=dpr;var width=right-left;var height=bottom-top;var targetCanvas=createCanvas();var zr=init$1(targetCanvas,{renderer:isSvg?'svg':'canvas'});zr.resize({width:width,height:height});if(isSvg){var content='';each(canvasList,function(item){var x=item.left-left;var y=item.top-top;content+=''+item.dom+'';});zr.painter.getSvgRoot().innerHTML=content;if(opts.connectedBackgroundColor){zr.painter.setBackgroundColor(opts.connectedBackgroundColor);}zr.refreshImmediately();return zr.painter.toDataURL();}else{// Background between the charts\nif(opts.connectedBackgroundColor){zr.add(new Rect({shape:{x:0,y:0,width:width,height:height},style:{fill:opts.connectedBackgroundColor}}));}each(canvasList,function(item){var img=new ZImage({style:{x:item.left*dpr-left,y:item.top*dpr-top,image:item.dom}});zr.add(img);});zr.refreshImmediately();return targetCanvas.toDataURL('image/'+(opts&&opts.type||'png'));}}else{return this.getDataURL(opts);}};/**\n * Convert from logical coordinate system to pixel coordinate system.\n * See CoordinateSystem#convertToPixel.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId, geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName,\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {Array|number} result\n */echartsProto.convertToPixel=curry(doConvertPixel,'convertToPixel');/**\n * Convert from pixel coordinate system to logical coordinate system.\n * See CoordinateSystem#convertFromPixel.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId / geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {Array|number} result\n */echartsProto.convertFromPixel=curry(doConvertPixel,'convertFromPixel');function doConvertPixel(methodName,finder,value){if(this._disposed){disposedWarning(this.id);return;}var ecModel=this._model;var coordSysList=this._coordSysMgr.getCoordinateSystems();var result;finder=parseFinder(ecModel,finder);for(var i=0;i=0&&each$1(models,function(model){var coordSys=model.coordinateSystem;if(coordSys&&coordSys.containPoint){result|=!!coordSys.containPoint(value);}else if(key==='seriesModels'){var view=this._chartsMap[model.__viewId];if(view&&view.containPoint){result|=view.containPoint(value,model);}else{if(__DEV__){console.warn(key+': '+(view?'The found component do not support containPoint.':'No view mapping to the found component.'));}}}else{if(__DEV__){console.warn(key+': containPoint is not supported');}}},this);},this);return!!result;};/**\n * Get visual from series or data.\n * @param {string|Object} finder\n * If string, e.g., 'series', means {seriesIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * dataIndex / dataIndexInside\n * }\n * If dataIndex is not specified, series visual will be fetched,\n * but not data item visual.\n * If all of seriesIndex, seriesId, seriesName are not specified,\n * visual will be fetched from first series.\n * @param {string} visualType 'color', 'symbol', 'symbolSize'\n */echartsProto.getVisual=function(finder,visualType){var ecModel=this._model;finder=parseFinder(ecModel,finder,{defaultMainType:'series'});var seriesModel=finder.seriesModel;if(__DEV__){if(!seriesModel){console.warn('There is no specified seires model');}}var data=seriesModel.getData();var dataIndexInside=finder.hasOwnProperty('dataIndexInside')?finder.dataIndexInside:finder.hasOwnProperty('dataIndex')?data.indexOfRawIndex(finder.dataIndex):null;return dataIndexInside!=null?data.getItemVisual(dataIndexInside,visualType):data.getVisual(visualType);};/**\n * Get view of corresponding component model\n * @param {module:echarts/model/Component} componentModel\n * @return {module:echarts/view/Component}\n */echartsProto.getViewOfComponentModel=function(componentModel){return this._componentsMap[componentModel.__viewId];};/**\n * Get view of corresponding series model\n * @param {module:echarts/model/Series} seriesModel\n * @return {module:echarts/view/Chart}\n */echartsProto.getViewOfSeriesModel=function(seriesModel){return this._chartsMap[seriesModel.__viewId];};var updateMethods={prepareAndUpdate:function prepareAndUpdate(payload){prepare(this);updateMethods.update.call(this,payload);},/**\n * @param {Object} payload\n * @private\n */update:function update(payload){// console.profile && console.profile('update');\nvar ecModel=this._model;var api=this._api;var zr=this._zr;var coordSysMgr=this._coordSysMgr;var scheduler=this._scheduler;// update before setOption\nif(!ecModel){return;}scheduler.restoreData(ecModel,payload);scheduler.performSeriesTasks(ecModel);// TODO\n// Save total ecModel here for undo/redo (after restoring data and before processing data).\n// Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n// Create new coordinate system each update\n// In LineView may save the old coordinate system and use it to get the orignal point\ncoordSysMgr.create(ecModel,api);scheduler.performDataProcessorTasks(ecModel,payload);// Current stream render is not supported in data process. So we can update\n// stream modes after data processing, where the filtered data is used to\n// deteming whether use progressive rendering.\nupdateStreamModes(this,ecModel);// We update stream modes before coordinate system updated, then the modes info\n// can be fetched when coord sys updating (consider the barGrid extent fix). But\n// the drawback is the full coord info can not be fetched. Fortunately this full\n// coord is not requied in stream mode updater currently.\ncoordSysMgr.update(ecModel,api);clearColorPalette(ecModel);scheduler.performVisualTasks(ecModel,payload);render(this,ecModel,api,payload);// Set background\nvar backgroundColor=ecModel.get('backgroundColor')||'transparent';// In IE8\nif(!env$1.canvasSupported){var colorArr=parse(backgroundColor);backgroundColor=stringify(colorArr,'rgb');if(colorArr[3]===0){backgroundColor='transparent';}}else{zr.setBackgroundColor(backgroundColor);}performPostUpdateFuncs(ecModel,api);// console.profile && console.profileEnd('update');\n},/**\n * @param {Object} payload\n * @private\n */updateTransform:function updateTransform(payload){var ecModel=this._model;var ecIns=this;var api=this._api;// update before setOption\nif(!ecModel){return;}// ChartView.markUpdateMethod(payload, 'updateTransform');\nvar componentDirtyList=[];ecModel.eachComponent(function(componentType,componentModel){var componentView=ecIns.getViewOfComponentModel(componentModel);if(componentView&&componentView.__alive){if(componentView.updateTransform){var result=componentView.updateTransform(componentModel,ecModel,api,payload);result&&result.update&&componentDirtyList.push(componentView);}else{componentDirtyList.push(componentView);}}});var seriesDirtyMap=createHashMap();ecModel.eachSeries(function(seriesModel){var chartView=ecIns._chartsMap[seriesModel.__viewId];if(chartView.updateTransform){var result=chartView.updateTransform(seriesModel,ecModel,api,payload);result&&result.update&&seriesDirtyMap.set(seriesModel.uid,1);}else{seriesDirtyMap.set(seriesModel.uid,1);}});clearColorPalette(ecModel);// Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n// this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\nthis._scheduler.performVisualTasks(ecModel,payload,{setDirty:true,dirtyMap:seriesDirtyMap});// Currently, not call render of components. Geo render cost a lot.\n// renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\nrenderSeries(ecIns,ecModel,api,payload,seriesDirtyMap);performPostUpdateFuncs(ecModel,this._api);},/**\n * @param {Object} payload\n * @private\n */updateView:function updateView(payload){var ecModel=this._model;// update before setOption\nif(!ecModel){return;}Chart.markUpdateMethod(payload,'updateView');clearColorPalette(ecModel);// Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\nthis._scheduler.performVisualTasks(ecModel,payload,{setDirty:true});render(this,this._model,this._api,payload);performPostUpdateFuncs(ecModel,this._api);},/**\n * @param {Object} payload\n * @private\n */updateVisual:function updateVisual(payload){updateMethods.update.call(this,payload);// var ecModel = this._model;\n// // update before setOption\n// if (!ecModel) {\n// return;\n// }\n// ChartView.markUpdateMethod(payload, 'updateVisual');\n// clearColorPalette(ecModel);\n// // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n// this._scheduler.performVisualTasks(ecModel, payload, {visualType: 'visual', setDirty: true});\n// render(this, this._model, this._api, payload);\n// performPostUpdateFuncs(ecModel, this._api);\n},/**\n * @param {Object} payload\n * @private\n */updateLayout:function updateLayout(payload){updateMethods.update.call(this,payload);// var ecModel = this._model;\n// // update before setOption\n// if (!ecModel) {\n// return;\n// }\n// ChartView.markUpdateMethod(payload, 'updateLayout');\n// // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n// // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n// this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true});\n// render(this, this._model, this._api, payload);\n// performPostUpdateFuncs(ecModel, this._api);\n}};function prepare(ecIns){var ecModel=ecIns._model;var scheduler=ecIns._scheduler;scheduler.restorePipelines(ecModel);scheduler.prepareStageTasks();prepareView(ecIns,'component',ecModel,scheduler);prepareView(ecIns,'chart',ecModel,scheduler);scheduler.plan();}/**\n * @private\n */function updateDirectly(ecIns,method,payload,mainType,subType){var ecModel=ecIns._model;// broadcast\nif(!mainType){// FIXME\n// Chart will not be update directly here, except set dirty.\n// But there is no such scenario now.\neach(ecIns._componentsViews.concat(ecIns._chartsViews),callView);return;}var query={};query[mainType+'Id']=payload[mainType+'Id'];query[mainType+'Index']=payload[mainType+'Index'];query[mainType+'Name']=payload[mainType+'Name'];var condition={mainType:mainType,query:query};subType&&(condition.subType=subType);// subType may be '' by parseClassType;\nvar excludeSeriesId=payload.excludeSeriesId;if(excludeSeriesId!=null){excludeSeriesId=createHashMap(normalizeToArray(excludeSeriesId));}// If dispatchAction before setOption, do nothing.\necModel&&ecModel.eachComponent(condition,function(model){if(!excludeSeriesId||excludeSeriesId.get(model.id)==null){callView(ecIns[mainType==='series'?'_chartsMap':'_componentsMap'][model.__viewId]);}},ecIns);function callView(view){view&&view.__alive&&view[method]&&view[method](view.__model,ecModel,ecIns._api,payload);}}/**\n * Resize the chart\n * @param {Object} opts\n * @param {number} [opts.width] Can be 'auto' (the same as null/undefined)\n * @param {number} [opts.height] Can be 'auto' (the same as null/undefined)\n * @param {boolean} [opts.silent=false]\n */echartsProto.resize=function(opts){if(__DEV__){assert(!this[IN_MAIN_PROCESS],'`resize` should not be called during main process.');}if(this._disposed){disposedWarning(this.id);return;}this._zr.resize(opts);var ecModel=this._model;// Resize loading effect\nthis._loadingFX&&this._loadingFX.resize();if(!ecModel){return;}var optionChanged=ecModel.resetOption('media');var silent=opts&&opts.silent;this[IN_MAIN_PROCESS]=true;optionChanged&&prepare(this);updateMethods.update.call(this);this[IN_MAIN_PROCESS]=false;flushPendingActions.call(this,silent);triggerUpdatedEvent.call(this,silent);};function updateStreamModes(ecIns,ecModel){var chartsMap=ecIns._chartsMap;var scheduler=ecIns._scheduler;ecModel.eachSeries(function(seriesModel){scheduler.updateStreamModes(seriesModel,chartsMap[seriesModel.__viewId]);});}/**\n * Show loading effect\n * @param {string} [name='default']\n * @param {Object} [cfg]\n */echartsProto.showLoading=function(name,cfg){if(this._disposed){disposedWarning(this.id);return;}if(isObject(name)){cfg=name;name='';}name=name||'default';this.hideLoading();if(!loadingEffects[name]){if(__DEV__){console.warn('Loading effects '+name+' not exists.');}return;}var el=loadingEffects[name](this._api,cfg);var zr=this._zr;this._loadingFX=el;zr.add(el);};/**\n * Hide loading effect\n */echartsProto.hideLoading=function(){if(this._disposed){disposedWarning(this.id);return;}this._loadingFX&&this._zr.remove(this._loadingFX);this._loadingFX=null;};/**\n * @param {Object} eventObj\n * @return {Object}\n */echartsProto.makeActionFromEvent=function(eventObj){var payload=extend({},eventObj);payload.type=eventActionMap[eventObj.type];return payload;};/**\n * @pubilc\n * @param {Object} payload\n * @param {string} [payload.type] Action type\n * @param {Object|boolean} [opt] If pass boolean, means opt.silent\n * @param {boolean} [opt.silent=false] Whether trigger events.\n * @param {boolean} [opt.flush=undefined]\n * true: Flush immediately, and then pixel in canvas can be fetched\n * immediately. Caution: it might affect performance.\n * false: Not flush.\n * undefined: Auto decide whether perform flush.\n */echartsProto.dispatchAction=function(payload,opt){if(this._disposed){disposedWarning(this.id);return;}if(!isObject(opt)){opt={silent:!!opt};}if(!actions[payload.type]){return;}// Avoid dispatch action before setOption. Especially in `connect`.\nif(!this._model){return;}// May dispatchAction in rendering procedure\nif(this[IN_MAIN_PROCESS]){this._pendingActions.push(payload);return;}doDispatchAction.call(this,payload,opt.silent);if(opt.flush){this._zr.flush(true);}else if(opt.flush!==false&&env$1.browser.weChat){// In WeChat embeded browser, `requestAnimationFrame` and `setInterval`\n// hang when sliding page (on touch event), which cause that zr does not\n// refresh util user interaction finished, which is not expected.\n// But `dispatchAction` may be called too frequently when pan on touch\n// screen, which impacts performance if do not throttle them.\nthis._throttledZrFlush();}flushPendingActions.call(this,opt.silent);triggerUpdatedEvent.call(this,opt.silent);};function doDispatchAction(payload,silent){var payloadType=payload.type;var escapeConnect=payload.escapeConnect;var actionWrap=actions[payloadType];var actionInfo=actionWrap.actionInfo;var cptType=(actionInfo.update||'update').split(':');var updateMethod=cptType.pop();cptType=cptType[0]!=null&&parseClassType(cptType[0]);this[IN_MAIN_PROCESS]=true;var payloads=[payload];var batched=false;// Batch action\nif(payload.batch){batched=true;payloads=map(payload.batch,function(item){item=defaults(extend({},item),payload);item.batch=null;return item;});}var eventObjBatch=[];var eventObj;var isHighDown=payloadType==='highlight'||payloadType==='downplay';each(payloads,function(batchItem){// Action can specify the event by return it.\neventObj=actionWrap.action(batchItem,this._model,this._api);// Emit event outside\neventObj=eventObj||extend({},batchItem);// Convert type to eventType\neventObj.type=actionInfo.event||eventObj.type;eventObjBatch.push(eventObj);// light update does not perform data process, layout and visual.\nif(isHighDown){// method, payload, mainType, subType\nupdateDirectly(this,updateMethod,batchItem,'series');}else if(cptType){updateDirectly(this,updateMethod,batchItem,cptType.main,cptType.sub);}},this);if(updateMethod!=='none'&&!isHighDown&&!cptType){// Still dirty\nif(this[OPTION_UPDATED]){// FIXME Pass payload ?\nprepare(this);updateMethods.update.call(this,payload);this[OPTION_UPDATED]=false;}else{updateMethods[updateMethod].call(this,payload);}}// Follow the rule of action batch\nif(batched){eventObj={type:actionInfo.event||payloadType,escapeConnect:escapeConnect,batch:eventObjBatch};}else{eventObj=eventObjBatch[0];}this[IN_MAIN_PROCESS]=false;!silent&&this._messageCenter.trigger(eventObj.type,eventObj);}function flushPendingActions(silent){var pendingActions=this._pendingActions;while(pendingActions.length){var payload=pendingActions.shift();doDispatchAction.call(this,payload,silent);}}function triggerUpdatedEvent(silent){!silent&&this.trigger('updated');}/**\n * Event `rendered` is triggered when zr\n * rendered. It is useful for realtime\n * snapshot (reflect animation).\n *\n * Event `finished` is triggered when:\n * (1) zrender rendering finished.\n * (2) initial animation finished.\n * (3) progressive rendering finished.\n * (4) no pending action.\n * (5) no delayed setOption needs to be processed.\n */function bindRenderedEvent(zr,ecIns){zr.on('rendered',function(){ecIns.trigger('rendered');// The `finished` event should not be triggered repeatly,\n// so it should only be triggered when rendering indeed happend\n// in zrender. (Consider the case that dipatchAction is keep\n// triggering when mouse move).\nif(// Although zr is dirty if initial animation is not finished\n// and this checking is called on frame, we also check\n// animation finished for robustness.\nzr.animation.isFinished()&&!ecIns[OPTION_UPDATED]&&!ecIns._scheduler.unfinished&&!ecIns._pendingActions.length){ecIns.trigger('finished');}});}/**\n * @param {Object} params\n * @param {number} params.seriesIndex\n * @param {Array|TypedArray} params.data\n */echartsProto.appendData=function(params){if(this._disposed){disposedWarning(this.id);return;}var seriesIndex=params.seriesIndex;var ecModel=this.getModel();var seriesModel=ecModel.getSeriesByIndex(seriesIndex);if(__DEV__){assert(params.data&&seriesModel);}seriesModel.appendData(params);// Note: `appendData` does not support that update extent of coordinate\n// system, util some scenario require that. In the expected usage of\n// `appendData`, the initial extent of coordinate system should better\n// be fixed by axis `min`/`max` setting or initial data, otherwise if\n// the extent changed while `appendData`, the location of the painted\n// graphic elements have to be changed, which make the usage of\n// `appendData` meaningless.\nthis._scheduler.unfinished=true;};/**\n * Register event\n * @method\n */echartsProto.on=createRegisterEventWithLowercaseName('on',false);echartsProto.off=createRegisterEventWithLowercaseName('off',false);echartsProto.one=createRegisterEventWithLowercaseName('one',false);/**\n * Prepare view instances of charts and components\n * @param {module:echarts/model/Global} ecModel\n * @private\n */function prepareView(ecIns,type,ecModel,scheduler){var isComponent=type==='component';var viewList=isComponent?ecIns._componentsViews:ecIns._chartsViews;var viewMap=isComponent?ecIns._componentsMap:ecIns._chartsMap;var zr=ecIns._zr;var api=ecIns._api;for(var i=0;iecModel.get('hoverLayerThreshold')&&!env$1.node){ecModel.eachSeries(function(seriesModel){if(seriesModel.preventUsingHoverLayer){return;}var chartView=ecIns._chartsMap[seriesModel.__viewId];if(chartView.__alive){chartView.group.traverse(function(el){// Don't switch back.\nel.useHoverLayer=true;});}});}}/**\n * Update chart progressive and blend.\n * @param {module:echarts/model/Series|module:echarts/model/Component} model\n * @param {module:echarts/view/Component|module:echarts/view/Chart} view\n */function updateBlend(seriesModel,chartView){var blendMode=seriesModel.get('blendMode')||null;if(__DEV__){if(!env$1.canvasSupported&&blendMode&&blendMode!=='source-over'){console.warn('Only canvas support blendMode');}}chartView.group.traverse(function(el){// FIXME marker and other components\nif(!el.isGroup){// Only set if blendMode is changed. In case element is incremental and don't wan't to rerender.\nif(el.style.blend!==blendMode){el.setStyle('blend',blendMode);}}if(el.eachPendingDisplayable){el.eachPendingDisplayable(function(displayable){displayable.setStyle('blend',blendMode);});}});}/**\n * @param {module:echarts/model/Series|module:echarts/model/Component} model\n * @param {module:echarts/view/Component|module:echarts/view/Chart} view\n */function updateZ(model,view){var z=model.get('z');var zlevel=model.get('zlevel');// Set z and zlevel\nview.group.traverse(function(el){if(el.type!=='group'){z!=null&&(el.z=z);zlevel!=null&&(el.zlevel=zlevel);}});}function createExtensionAPI(ecInstance){var coordSysMgr=ecInstance._coordSysMgr;return extend(new ExtensionAPI(ecInstance),{// Inject methods\ngetCoordinateSystems:bind(coordSysMgr.getCoordinateSystems,coordSysMgr),getComponentByElement:function getComponentByElement(el){while(el){var modelInfo=el.__ecComponentInfo;if(modelInfo!=null){return ecInstance._model.getComponent(modelInfo.mainType,modelInfo.index);}el=el.parent;}}});}/**\n * @class\n * Usage of query:\n * `chart.on('click', query, handler);`\n * The `query` can be:\n * + The component type query string, only `mainType` or `mainType.subType`,\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\n * + The component query object, like:\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\n * + The data query object, like:\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\n * + The other query object (cmponent customized query), like:\n * `{element: 'some'}` (only available in custom series).\n *\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\n * same as there is no such prop in the `query` object.\n */function EventProcessor(){// These info required: targetEl, packedEvent, model, view\nthis.eventInfo;}EventProcessor.prototype={constructor:EventProcessor,normalizeQuery:function normalizeQuery(query){var cptQuery={};var dataQuery={};var otherQuery={};// `query` is `mainType` or `mainType.subType` of component.\nif(isString(query)){var condCptType=parseClassType(query);// `.main` and `.sub` may be ''.\ncptQuery.mainType=condCptType.main||null;cptQuery.subType=condCptType.sub||null;}// `query` is an object, convert to {mainType, index, name, id}.\nelse{// `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n// can not be used in `compomentModel.filterForExposedEvent`.\nvar suffixes=['Index','Name','Id'];var dataKeys={name:1,dataIndex:1,dataType:1};each$1(query,function(val,key){var reserved=false;for(var i=0;i0&&suffixPos===key.length-propSuffix.length){var mainType=key.slice(0,suffixPos);// Consider `dataIndex`.\nif(mainType!=='data'){cptQuery.mainType=mainType;cptQuery[propSuffix.toLowerCase()]=val;reserved=true;}}}if(dataKeys.hasOwnProperty(key)){dataQuery[key]=val;reserved=true;}if(!reserved){otherQuery[key]=val;}});}return{cptQuery:cptQuery,dataQuery:dataQuery,otherQuery:otherQuery};},filter:function filter(eventType,query,args){// They should be assigned before each trigger call.\nvar eventInfo=this.eventInfo;if(!eventInfo){return true;}var targetEl=eventInfo.targetEl;var packedEvent=eventInfo.packedEvent;var model=eventInfo.model;var view=eventInfo.view;// For event like 'globalout'.\nif(!model||!view){return true;}var cptQuery=query.cptQuery;var dataQuery=query.dataQuery;return check(cptQuery,model,'mainType')&&check(cptQuery,model,'subType')&&check(cptQuery,model,'index','componentIndex')&&check(cptQuery,model,'name')&&check(cptQuery,model,'id')&&check(dataQuery,packedEvent,'name')&&check(dataQuery,packedEvent,'dataIndex')&&check(dataQuery,packedEvent,'dataType')&&(!view.filterForExposedEvent||view.filterForExposedEvent(eventType,query.otherQuery,targetEl,packedEvent));function check(query,host,prop,propOnHost){return query[prop]==null||host[propOnHost||prop]===query[prop];}},afterTrigger:function afterTrigger(){// Make sure the eventInfo wont be used in next trigger.\nthis.eventInfo=null;}};/**\n * @type {Object} key: actionType.\n * @inner\n */var actions={};/**\n * Map eventType to actionType\n * @type {Object}\n */var eventActionMap={};/**\n * Data processor functions of each stage\n * @type {Array.>}\n * @inner\n */var dataProcessorFuncs=[];/**\n * @type {Array.}\n * @inner\n */var optionPreprocessorFuncs=[];/**\n * @type {Array.}\n * @inner\n */var postUpdateFuncs=[];/**\n * Visual encoding functions of each stage\n * @type {Array.>}\n */var visualFuncs=[];/**\n * Theme storage\n * @type {Object.}\n */var themeStorage={};/**\n * Loading effects\n */var loadingEffects={};var instances={};var connectedGroups={};var idBase=new Date()-0;var groupIdBase=new Date()-0;var DOM_ATTRIBUTE_KEY='_echarts_instance_';function enableConnect(chart){var STATUS_PENDING=0;var STATUS_UPDATING=1;var STATUS_UPDATED=2;var STATUS_KEY='__connectUpdateStatus';function updateConnectedChartsStatus(charts,status){for(var i=0;i} groupId\n */function connect(groupId){// Is array of charts\nif(isArray(groupId)){var charts=groupId;groupId=null;// If any chart has group\neach(charts,function(chart){if(chart.group!=null){groupId=chart.group;}});groupId=groupId||'g_'+groupIdBase++;each(charts,function(chart){chart.group=groupId;});}connectedGroups[groupId]=true;return groupId;}/**\n * @DEPRECATED\n * @return {string} groupId\n */function disConnect(groupId){connectedGroups[groupId]=false;}/**\n * @return {string} groupId\n */var disconnect=disConnect;/**\n * Dispose a chart instance\n * @param {module:echarts~ECharts|HTMLDomElement|string} chart\n */function dispose(chart){if(typeof chart==='string'){chart=instances[chart];}else if(!(chart instanceof ECharts)){// Try to treat as dom\nchart=getInstanceByDom(chart);}if(chart instanceof ECharts&&!chart.isDisposed()){chart.dispose();}}/**\n * @param {HTMLElement} dom\n * @return {echarts~ECharts}\n */function getInstanceByDom(dom){return instances[getAttribute(dom,DOM_ATTRIBUTE_KEY)];}/**\n * @param {string} key\n * @return {echarts~ECharts}\n */function getInstanceById(key){return instances[key];}/**\n * Register theme\n */function registerTheme(name,theme$$1){themeStorage[name]=theme$$1;}/**\n * Register option preprocessor\n * @param {Function} preprocessorFunc\n */function registerPreprocessor(preprocessorFunc){optionPreprocessorFuncs.push(preprocessorFunc);}/**\n * @param {number} [priority=1000]\n * @param {Object|Function} processor\n */function registerProcessor(priority,processor){normalizeRegister(dataProcessorFuncs,priority,processor,PRIORITY_PROCESSOR_FILTER);}/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */function registerPostUpdate(postUpdateFunc){postUpdateFuncs.push(postUpdateFunc);}/**\n * Usage:\n * registerAction('someAction', 'someEvent', function () { ... });\n * registerAction('someAction', function () { ... });\n * registerAction(\n * {type: 'someAction', event: 'someEvent', update: 'updateView'},\n * function () { ... }\n * );\n *\n * @param {(string|Object)} actionInfo\n * @param {string} actionInfo.type\n * @param {string} [actionInfo.event]\n * @param {string} [actionInfo.update]\n * @param {string} [eventName]\n * @param {Function} action\n */function registerAction(actionInfo,eventName,action){if(typeof eventName==='function'){action=eventName;eventName='';}var actionType=isObject(actionInfo)?actionInfo.type:[actionInfo,actionInfo={event:eventName}][0];// Event name is all lowercase\nactionInfo.event=(actionInfo.event||actionType).toLowerCase();eventName=actionInfo.event;// Validate action type and event name.\nassert(ACTION_REG.test(actionType)&&ACTION_REG.test(eventName));if(!actions[actionType]){actions[actionType]={action:action,actionInfo:actionInfo};}eventActionMap[eventName]=actionType;}/**\n * @param {string} type\n * @param {*} CoordinateSystem\n */function registerCoordinateSystem(type,CoordinateSystem$$1){CoordinateSystemManager.register(type,CoordinateSystem$$1);}/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.}\n */function getCoordinateSystemDimensions(type){var coordSysCreator=CoordinateSystemManager.get(type);if(coordSysCreator){return coordSysCreator.getDimensionsInfo?coordSysCreator.getDimensionsInfo():coordSysCreator.dimensions.slice();}}/**\n * Layout is a special stage of visual encoding\n * Most visual encoding like color are common for different chart\n * But each chart has it's own layout algorithm\n *\n * @param {number} [priority=1000]\n * @param {Function} layoutTask\n */function registerLayout(priority,layoutTask){normalizeRegister(visualFuncs,priority,layoutTask,PRIORITY_VISUAL_LAYOUT,'layout');}/**\n * @param {number} [priority=3000]\n * @param {module:echarts/stream/Task} visualTask\n */function registerVisual(priority,visualTask){normalizeRegister(visualFuncs,priority,visualTask,PRIORITY_VISUAL_CHART,'visual');}/**\n * @param {Object|Function} fn: {seriesType, createOnAllSeries, performRawSeries, reset}\n */function normalizeRegister(targetList,priority,fn,defaultPriority,visualType){if(isFunction(priority)||isObject(priority)){fn=priority;priority=defaultPriority;}if(__DEV__){if(isNaN(priority)||priority==null){throw new Error('Illegal priority');}// Check duplicate\neach(targetList,function(wrap){assert(wrap.__raw!==fn);});}var stageHandler=Scheduler.wrapStageHandler(fn,visualType);stageHandler.__prio=priority;stageHandler.__raw=fn;targetList.push(stageHandler);return stageHandler;}/**\n * @param {string} name\n */function registerLoading(name,loadingFx){loadingEffects[name]=loadingFx;}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendComponentModel(opts/*, superClass*/){// var Clazz = ComponentModel;\n// if (superClass) {\n// var classType = parseClassType(superClass);\n// Clazz = ComponentModel.getClass(classType.main, classType.sub, true);\n// }\nreturn ComponentModel.extend(opts);}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendComponentView(opts/*, superClass*/){// var Clazz = ComponentView;\n// if (superClass) {\n// var classType = parseClassType(superClass);\n// Clazz = ComponentView.getClass(classType.main, classType.sub, true);\n// }\nreturn Component$1.extend(opts);}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendSeriesModel(opts/*, superClass*/){// var Clazz = SeriesModel;\n// if (superClass) {\n// superClass = 'series.' + superClass.replace('series.', '');\n// var classType = parseClassType(superClass);\n// Clazz = ComponentModel.getClass(classType.main, classType.sub, true);\n// }\nreturn SeriesModel.extend(opts);}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendChartView(opts/*, superClass*/){// var Clazz = ChartView;\n// if (superClass) {\n// superClass = superClass.replace('series.', '');\n// var classType = parseClassType(superClass);\n// Clazz = ChartView.getClass(classType.main, true);\n// }\nreturn Chart.extend(opts);}/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n * Be careful of using it in the browser.\n *\n * @param {Function} creator\n * @example\n * var Canvas = require('canvas');\n * var echarts = require('echarts');\n * echarts.setCanvasCreator(function () {\n * // Small size is enough.\n * return new Canvas(32, 32);\n * });\n */function setCanvasCreator(creator){$override('createCanvas',creator);}/**\n * @param {string} mapName\n * @param {Array.|Object|string} geoJson\n * @param {Object} [specialAreas]\n *\n * @example GeoJSON\n * $.get('USA.json', function (geoJson) {\n * echarts.registerMap('USA', geoJson);\n * // Or\n * echarts.registerMap('USA', {\n * geoJson: geoJson,\n * specialAreas: {}\n * })\n * });\n *\n * $.get('airport.svg', function (svg) {\n * echarts.registerMap('airport', {\n * svg: svg\n * }\n * });\n *\n * echarts.registerMap('eu', [\n * {svg: eu-topographic.svg},\n * {geoJSON: eu.json}\n * ])\n */function registerMap(mapName,geoJson,specialAreas){mapDataStorage.registerMap(mapName,geoJson,specialAreas);}/**\n * @param {string} mapName\n * @return {Object}\n */function getMap(mapName){// For backward compatibility, only return the first one.\nvar records=mapDataStorage.retrieveMap(mapName);return records&&records[0]&&{geoJson:records[0].geoJSON,specialAreas:records[0].specialAreas};}registerVisual(PRIORITY_VISUAL_GLOBAL,seriesColor);registerPreprocessor(backwardCompat);registerProcessor(PRIORITY_PROCESSOR_DATASTACK,dataStack);registerLoading('default',loadingDefault);// Default actions\nregisterAction({type:'highlight',event:'highlight',update:'highlight'},noop);registerAction({type:'downplay',event:'downplay',update:'downplay'},noop);// Default theme\nregisterTheme('light',lightTheme);registerTheme('dark',theme);// For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\nvar dataTool={};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function defaultKeyGetter(item){return item;}/**\n * @param {Array} oldArr\n * @param {Array} newArr\n * @param {Function} oldKeyGetter\n * @param {Function} newKeyGetter\n * @param {Object} [context] Can be visited by this.context in callback.\n */function DataDiffer(oldArr,newArr,oldKeyGetter,newKeyGetter,context){this._old=oldArr;this._new=newArr;this._oldKeyGetter=oldKeyGetter||defaultKeyGetter;this._newKeyGetter=newKeyGetter||defaultKeyGetter;this.context=context;}DataDiffer.prototype={constructor:DataDiffer,/**\n * Callback function when add a data\n */add:function add(func){this._add=func;return this;},/**\n * Callback function when update a data\n */update:function update(func){this._update=func;return this;},/**\n * Callback function when remove a data\n */remove:function remove(func){this._remove=func;return this;},execute:function execute(){var oldArr=this._old;var newArr=this._new;var oldDataIndexMap={};var newDataIndexMap={};var oldDataKeyArr=[];var newDataKeyArr=[];var i;initIndexMap(oldArr,oldDataIndexMap,oldDataKeyArr,'_oldKeyGetter',this);initIndexMap(newArr,newDataIndexMap,newDataKeyArr,'_newKeyGetter',this);for(i=0;i65535?CtorUint32Array:CtorUint16Array;}function cloneChunk(originalChunk){var Ctor=originalChunk.constructor;// Only shallow clone is enough when Array.\nreturn Ctor===Array?originalChunk.slice():new Ctor(originalChunk);}var TRANSFERABLE_PROPERTIES=['hasItemOption','_nameList','_idList','_invertedIndicesMap','_rawData','_chunkSize','_chunkCount','_dimValueGetter','_count','_rawCount','_nameDimIdx','_idDimIdx'];var CLONE_PROPERTIES=['_extent','_approximateExtent','_rawExtent'];function transferProperties(target,source){each$1(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods||[]),function(propName){if(source.hasOwnProperty(propName)){target[propName]=source[propName];}});target.__wrappedMethods=source.__wrappedMethods;each$1(CLONE_PROPERTIES,function(propName){target[propName]=_clone(source[propName]);});target._calculationInfo=extend(source._calculationInfo);}/**\n * @constructor\n * @alias module:echarts/data/List\n *\n * @param {Array.} dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n * @param {module:echarts/model/Model} hostModel\n */var List=function List(dimensions,hostModel){dimensions=dimensions||['x','y'];var dimensionInfos={};var dimensionNames=[];var invertedIndicesMap={};for(var i=0;i}\n */this.dimensions=dimensionNames;/**\n * Infomation of each data dimension, like data type.\n * @type {Object}\n */this._dimensionInfos=dimensionInfos;/**\n * @type {module:echarts/model/Model}\n */this.hostModel=hostModel;/**\n * @type {module:echarts/model/Model}\n */this.dataType;/**\n * Indices stores the indices of data subset after filtered.\n * This data subset will be used in chart.\n * @type {Array.}\n * @readOnly\n */this._indices=null;this._count=0;this._rawCount=0;/**\n * Data storage\n * @type {Object.>}\n * @private\n */this._storage={};/**\n * @type {Array.}\n */this._nameList=[];/**\n * @type {Array.}\n */this._idList=[];/**\n * Models of data option is stored sparse for optimizing memory cost\n * @type {Array.}\n * @private\n */this._optionModels=[];/**\n * Global visual properties after visual coding\n * @type {Object}\n * @private\n */this._visual={};/**\n * Globel layout properties.\n * @type {Object}\n * @private\n */this._layout={};/**\n * Item visual properties after visual coding\n * @type {Array.}\n * @private\n */this._itemVisuals=[];/**\n * Key: visual type, Value: boolean\n * @type {Object}\n * @readOnly\n */this.hasItemVisual={};/**\n * Item layout properties after layout\n * @type {Array.}\n * @private\n */this._itemLayouts=[];/**\n * Graphic elemnents\n * @type {Array.}\n * @private\n */this._graphicEls=[];/**\n * Max size of each chunk.\n * @type {number}\n * @private\n */this._chunkSize=1e5;/**\n * @type {number}\n * @private\n */this._chunkCount=0;/**\n * @type {Array.}\n * @private\n */this._rawData;/**\n * Raw extent will not be cloned, but only transfered.\n * It will not be calculated util needed.\n * key: dim,\n * value: {end: number, extent: Array.}\n * @type {Object}\n * @private\n */this._rawExtent={};/**\n * @type {Object}\n * @private\n */this._extent={};/**\n * key: dim\n * value: extent\n * @type {Object}\n * @private\n */this._approximateExtent={};/**\n * Cache summary info for fast visit. See \"dimensionHelper\".\n * @type {Object}\n * @private\n */this._dimensionsSummary=summarizeDimensions(this);/**\n * @type {Object.}\n * @private\n */this._invertedIndicesMap=invertedIndicesMap;/**\n * @type {Object}\n * @private\n */this._calculationInfo={};/**\n * User output info of this data.\n * DO NOT use it in other places!\n *\n * When preparing user params for user callbacks, we have\n * to clone these inner data structures to prevent users\n * from modifying them to effect built-in logic. And for\n * performance consideration we make this `userOutput` to\n * avoid clone them too many times.\n *\n * @type {Object}\n * @readOnly\n */this.userOutput=this._dimensionsSummary.userOutput;};var listProto=List.prototype;listProto.type='list';/**\n * If each data item has it's own option\n * @type {boolean}\n */listProto.hasItemOption=true;/**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatbility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * Get dimension name\n * @param {string|number} dim See above.\n * @return {string} Concrete dim name.\n */listProto.getDimension=function(dim){if(typeof dim==='number'// If being a number-like string but not being defined a dimension name.\n||!isNaN(dim)&&!this._dimensionInfos.hasOwnProperty(dim)){dim=this.dimensions[dim];}return dim;};/**\n * Get type and calculation info of particular dimension\n * @param {string|number} dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */listProto.getDimensionInfo=function(dim){// Do not clone, because there may be categories in dimInfo.\nreturn this._dimensionInfos[this.getDimension(dim)];};/**\n * @return {Array.} concrete dimension name list on coord.\n */listProto.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice();};/**\n * @param {string} coordDim\n * @param {number} [idx] A coordDim may map to more than one data dim.\n * If idx is `true`, return a array of all mapped dims.\n * If idx is not specified, return the first dim not extra.\n * @return {string|Array.} concrete data dim.\n * If idx is number, and not found, return null/undefined.\n * If idx is `true`, and not found, return empty array (always return array).\n */listProto.mapDimension=function(coordDim,idx){var dimensionsSummary=this._dimensionsSummary;if(idx==null){return dimensionsSummary.encodeFirstDimNotExtra[coordDim];}var dims=dimensionsSummary.encode[coordDim];return idx===true// always return array if idx is `true`\n?(dims||[]).slice():dims&&dims[idx];};/**\n * Initialize from data\n * @param {Array.} data source or data or data provider.\n * @param {Array.} [nameLIst] The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n * @param {Function} [dimValueGetter] (dataItem, dimName, dataIndex, dimIndex) => number\n */listProto.initData=function(data,nameList,dimValueGetter){var notProvider=Source.isInstance(data)||isArrayLike(data);if(notProvider){data=new DefaultDataProvider(data,this.dimensions.length);}if(__DEV__){if(!notProvider&&(typeof data.getItem!=='function'||typeof data.count!=='function')){throw new Error('Inavlid data provider.');}}this._rawData=data;// Clear\nthis._storage={};this._indices=null;this._nameList=nameList||[];this._idList=[];this._nameRepeatCount={};if(!dimValueGetter){this.hasItemOption=false;}/**\n * @readOnly\n */this.defaultDimValueGetter=defaultDimValueGetters[this._rawData.getSource().sourceFormat];// Default dim value getter\nthis._dimValueGetter=dimValueGetter=dimValueGetter||this.defaultDimValueGetter;this._dimValueGetterArrayRows=defaultDimValueGetters.arrayRows;// Reset raw extent.\nthis._rawExtent={};this._initDataFromProvider(0,data.count());// If data has no item option.\nif(data.pure){this.hasItemOption=false;}};listProto.getProvider=function(){return this._rawData;};/**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */listProto.appendData=function(data){if(__DEV__){assert$1(!this._indices,'appendData can only be called on raw data.');}var rawData=this._rawData;var start=this.count();rawData.appendData(data);var end=rawData.count();if(!rawData.persistent){end+=start;}this._initDataFromProvider(start,end);};/**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to storage.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param {Array.>} values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exaclty cooresponding to a dimension.\n * @param {Array.} [names]\n */listProto.appendValues=function(values,names){var chunkSize=this._chunkSize;var storage=this._storage;var dimensions=this.dimensions;var dimLen=dimensions.length;var rawExtent=this._rawExtent;var start=this.count();var end=start+Math.max(values.length,names?names.length:0);var originalChunkCount=this._chunkCount;for(var i=0;idimRawExtent[1]&&(dimRawExtent[1]=val);}if(names){this._nameList[idx]=names[sourceIdx];}}this._rawCount=this._count=end;// Reset data extent\nthis._extent={};prepareInvertedIndex(this);};listProto._initDataFromProvider=function(start,end){// Optimize.\nif(start>=end){return;}var chunkSize=this._chunkSize;var rawData=this._rawData;var storage=this._storage;var dimensions=this.dimensions;var dimLen=dimensions.length;var dimensionInfoMap=this._dimensionInfos;var nameList=this._nameList;var idList=this._idList;var rawExtent=this._rawExtent;var nameRepeatCount=this._nameRepeatCount={};var nameDimIdx;var originalChunkCount=this._chunkCount;for(var i=0;idimRawExtent[1]&&(dimRawExtent[1]=val);}// ??? FIXME not check by pure but sourceFormat?\n// TODO refactor these logic.\nif(!rawData.pure){var name=nameList[idx];if(dataItem&&name==null){// If dataItem is {name: ...}, it has highest priority.\n// That is appropriate for many common cases.\nif(dataItem.name!=null){// There is no other place to persistent dataItem.name,\n// so save it to nameList.\nnameList[idx]=name=dataItem.name;}else if(nameDimIdx!=null){var nameDim=dimensions[nameDimIdx];var nameDimChunk=storage[nameDim][chunkIndex];if(nameDimChunk){name=nameDimChunk[chunkOffset];var ordinalMeta=dimensionInfoMap[nameDim].ordinalMeta;if(ordinalMeta&&ordinalMeta.categories.length){name=ordinalMeta.categories[name];}}}}// Try using the id in option\n// id or name is used on dynamical data, mapping old and new items.\nvar id=dataItem==null?null:dataItem.id;if(id==null&&name!=null){// Use name as id and add counter to avoid same name\nnameRepeatCount[name]=nameRepeatCount[name]||0;id=name;if(nameRepeatCount[name]>0){id+='__ec__'+nameRepeatCount[name];}nameRepeatCount[name]++;}id!=null&&(idList[idx]=id);}}if(!rawData.persistent&&rawData.clean){// Clean unused data if data source is typed array.\nrawData.clean();}this._rawCount=this._count=end;// Reset data extent\nthis._extent={};prepareInvertedIndex(this);};function prepareChunks(storage,dimInfo,chunkSize,chunkCount,end){var DataCtor=dataCtors[dimInfo.type];var lastChunkIndex=chunkCount-1;var dim=dimInfo.name;var resizeChunkArray=storage[dim][lastChunkIndex];if(resizeChunkArray&&resizeChunkArray.length=0&&idx= 0 && stackedValue > 0) // Positive stack\n// || (value <= 0 && stackedValue < 0) // Negative stack\n// ) {\n// value += stackedValue;\n// }\n// stackedOn = stackedOn.stackedOn;\n// }\n// }\n// }\nreturn value;};/**\n * @param {string} dim concrete dim\n * @param {number} rawIndex\n * @return {number|string}\n */listProto.getByRawIndex=function(dim,rawIdx){if(!(rawIdx>=0&&rawIdx} [dimensions] If ignored, using all dimensions.\n * @param {number} idx\n * @return {number}\n */listProto.getValues=function(dimensions,idx/*, stack */){var values=[];if(!isArray(dimensions)){// stack = idx;\nidx=dimensions;dimensions=this.dimensions;}for(var i=0,len=dimensions.length;imax&&(max=value);}dimExtent=[min,max];this._extent[dim]=dimExtent;return dimExtent;};/**\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */listProto.getApproximateExtent=function(dim/*, stack */){dim=this.getDimension(dim);return this._approximateExtent[dim]||this.getDataExtent(dim/*, stack */);};listProto.setApproximateExtent=function(extent,dim/*, stack */){dim=this.getDimension(dim);this._approximateExtent[dim]=extent.slice();};/**\n * @param {string} key\n * @return {*}\n */listProto.getCalculationInfo=function(key){return this._calculationInfo[key];};/**\n * @param {string|Object} key or k-v object\n * @param {*} [value]\n */listProto.setCalculationInfo=function(key,value){isObject$4(key)?extend(this._calculationInfo,key):this._calculationInfo[key]=value;};/**\n * Get sum of data in one dimension\n * @param {string} dim\n */listProto.getSum=function(dim/*, stack */){var dimData=this._storage[dim];var sum=0;if(dimData){for(var i=0,len=this.count();i=this._rawCount||rawIndex<0){return-1;}if(!this._indices){return rawIndex;}// Indices are ascending\nvar indices=this._indices;// If rawIndex === dataIndex\nvar rawDataIndex=indices[rawIndex];if(rawDataIndex!=null&&rawDataIndexrawIndex){right=mid-1;}else{return mid;}}return-1;};/**\n * Retreive the index of nearest value\n * @param {string} dim\n * @param {number} value\n * @param {number} [maxDistance=Infinity]\n * @return {Array.} If and only if multiple indices has\n * the same value, they are put to the result.\n */listProto.indicesOfNearest=function(dim,value,maxDistance){var storage=this._storage;var dimData=storage[dim];var nearestIndices=[];if(!dimData){return nearestIndices;}if(maxDistance==null){maxDistance=Infinity;}var minDist=Infinity;var minDiff=-1;var nearestIndicesLen=0;// Check the test case of `test/ut/spec/data/List.js`.\nfor(var i=0,len=this.count();i= 0` in this csae.\n// But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n// should be push to `nearestIndices`.\nif(dist=0&&minDiff<0){minDist=dist;minDiff=diff;nearestIndicesLen=0;}if(diff===minDiff){nearestIndices[nearestIndicesLen++]=i;}}}nearestIndices.length=nearestIndicesLen;return nearestIndices;};/**\n * Get raw data index\n * @param {number} idx\n * @return {number}\n */listProto.getRawIndex=getRawIndexWithoutIndices;function getRawIndexWithoutIndices(idx){return idx;}function getRawIndexWithIndices(idx){if(idx=0){return this._indices[idx];}return-1;}/**\n * Get raw data item\n * @param {number} idx\n * @return {number}\n */listProto.getRawDataItem=function(idx){if(!this._rawData.persistent){var val=[];for(var i=0;i}\n * @param {Function} cb\n * @param {*} [context=this]\n *\n * @example\n * list.each('x', function (x, idx) {});\n * list.each(['x', 'y'], function (x, y, idx) {});\n * list.each(function (idx) {})\n */listProto.each=function(dims,cb,context,contextCompat){'use strict';if(!this._count){return;}if(typeof dims==='function'){contextCompat=context;context=cb;cb=dims;dims=[];}// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;dims=map(normalizeDimensions(dims),this.getDimension,this);if(__DEV__){validateDimensions(this,dims);}var dimSize=dims.length;for(var i=0;i}\n * @param {Function} cb\n * @param {*} [context=this]\n */listProto.filterSelf=function(dimensions,cb,context,contextCompat){'use strict';if(!this._count){return;}if(typeof dimensions==='function'){contextCompat=context;context=cb;cb=dimensions;dimensions=[];}// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;dimensions=map(normalizeDimensions(dimensions),this.getDimension,this);if(__DEV__){validateDimensions(this,dimensions);}var count=this.count();var Ctor=getIndicesCtor(this);var newIndices=new Ctor(count);var value=[];var dimSize=dimensions.length;var offset=0;var dim0=dimensions[0];for(var i=0;i=min&&val<=max||isNaN(val)){newIndices[offset++]=idx;}idx++;}}quickFinished=true;}else if(dimSize===2){var dimStorage=this._storage[dim0];var dimStorage2=this._storage[dimensions[1]];var min2=range[dimensions[1]][0];var max2=range[dimensions[1]][1];for(var k=0;k=min&&val<=max||isNaN(val))&&(val2>=min2&&val2<=max2||isNaN(val2))){newIndices[offset++]=idx;}idx++;}}quickFinished=true;}}if(!quickFinished){if(dimSize===1){for(var i=0;i=min&&val<=max||isNaN(val)){newIndices[offset++]=rawIndex;}}}else{for(var i=0;irange[dimk][1]){keep=false;}}if(keep){newIndices[offset++]=this.getRawIndex(i);}}}}// Set indices after filtered.\nif(offset} [dimensions]\n * @param {Function} cb\n * @param {*} [context=this]\n * @return {Array}\n */listProto.mapArray=function(dimensions,cb,context,contextCompat){'use strict';if(typeof dimensions==='function'){contextCompat=context;context=cb;cb=dimensions;dimensions=[];}// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;var result=[];this.each(dimensions,function(){result.push(cb&&cb.apply(this,arguments));},context);return result;};// Data in excludeDimensions is copied, otherwise transfered.\nfunction cloneListForMapAndSample(original,excludeDimensions){var allDimensions=original.dimensions;var list=new List(map(allDimensions,original.getDimensionInfo,original),original.hostModel);// FIXME If needs stackedOn, value may already been stacked\ntransferProperties(list,original);var storage=list._storage={};var originalStorage=original._storage;// Init storage\nfor(var i=0;i=0){storage[dim]=cloneDimStore(originalStorage[dim]);list._rawExtent[dim]=getInitialExtent();list._extent[dim]=null;}else{// Direct reference for other dimensions\nstorage[dim]=originalStorage[dim];}}}return list;}function cloneDimStore(originalDimStore){var newDimStore=new Array(originalDimStore.length);for(var j=0;j} dimensions\n * @param {Function} cb\n * @param {*} [context=this]\n * @return {Array}\n */listProto.map=function(dimensions,cb,context,contextCompat){'use strict';// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;dimensions=map(normalizeDimensions(dimensions),this.getDimension,this);if(__DEV__){validateDimensions(this,dimensions);}var list=cloneListForMapAndSample(this,dimensions);// Following properties are all immutable.\n// So we can reference to the same value\nlist._indices=this._indices;list.getRawIndex=list._indices?getRawIndexWithIndices:getRawIndexWithoutIndices;var storage=list._storage;var tmpRetValue=[];var chunkSize=this._chunkSize;var dimSize=dimensions.length;var dataCount=this.count();var values=[];var rawExtent=list._rawExtent;for(var dataIndex=0;dataIndexrawExtentOnDim[1]){rawExtentOnDim[1]=val;}}}}return list;};/**\n * Large data down sampling on given dimension\n * @param {string} dimension\n * @param {number} rate\n * @param {Function} sampleValue\n * @param {Function} sampleIndex Sample index for name and id\n */listProto.downSample=function(dimension,rate,sampleValue,sampleIndex){var list=cloneListForMapAndSample(this,[dimension]);var targetStorage=list._storage;var frameValues=[];var frameSize=Math.floor(1/rate);var dimStore=targetStorage[dimension];var len=this.count();var chunkSize=this._chunkSize;var rawExtentOnDim=list._rawExtent[dimension];var newIndices=new(getIndicesCtor(this))(len);var offset=0;for(var i=0;ilen-i){frameSize=len-i;frameValues.length=frameSize;}for(var k=0;krawExtentOnDim[1]){rawExtentOnDim[1]=value;}newIndices[offset++]=sampleFrameIdx;}list._count=offset;list._indices=newIndices;list.getRawIndex=getRawIndexWithIndices;return list;};/**\n * Get model of one data item.\n *\n * @param {number} idx\n */ // FIXME Model proxy ?\nlistProto.getItemModel=function(idx){var hostModel=this.hostModel;return new Model(this.getRawDataItem(idx),hostModel,hostModel&&hostModel.ecModel);};/**\n * Create a data differ\n * @param {module:echarts/data/List} otherList\n * @return {module:echarts/data/DataDiffer}\n */listProto.diff=function(otherList){var thisList=this;return new DataDiffer(otherList?otherList.getIndices():[],this.getIndices(),function(idx){return getId(otherList,idx);},function(idx){return getId(thisList,idx);});};/**\n * Get visual property.\n * @param {string} key\n */listProto.getVisual=function(key){var visual=this._visual;return visual&&visual[key];};/**\n * Set visual property\n * @param {string|Object} key\n * @param {*} [value]\n *\n * @example\n * setVisual('color', color);\n * setVisual({\n * 'color': color\n * });\n */listProto.setVisual=function(key,val){if(isObject$4(key)){for(var name in key){if(key.hasOwnProperty(name)){this.setVisual(name,key[name]);}}return;}this._visual=this._visual||{};this._visual[key]=val;};/**\n * Set layout property.\n * @param {string|Object} key\n * @param {*} [val]\n */listProto.setLayout=function(key,val){if(isObject$4(key)){for(var name in key){if(key.hasOwnProperty(name)){this.setLayout(name,key[name]);}}return;}this._layout[key]=val;};/**\n * Get layout property.\n * @param {string} key.\n * @return {*}\n */listProto.getLayout=function(key){return this._layout[key];};/**\n * Get layout of single data item\n * @param {number} idx\n */listProto.getItemLayout=function(idx){return this._itemLayouts[idx];};/**\n * Set layout of single data item\n * @param {number} idx\n * @param {Object} layout\n * @param {boolean=} [merge=false]\n */listProto.setItemLayout=function(idx,layout,merge$$1){this._itemLayouts[idx]=merge$$1?extend(this._itemLayouts[idx]||{},layout):layout;};/**\n * Clear all layout of single data item\n */listProto.clearItemLayouts=function(){this._itemLayouts.length=0;};/**\n * Get visual property of single data item\n * @param {number} idx\n * @param {string} key\n * @param {boolean} [ignoreParent=false]\n */listProto.getItemVisual=function(idx,key,ignoreParent){var itemVisual=this._itemVisuals[idx];var val=itemVisual&&itemVisual[key];if(val==null&&!ignoreParent){// Use global visual property\nreturn this.getVisual(key);}return val;};/**\n * Set visual property of single data item\n *\n * @param {number} idx\n * @param {string|Object} key\n * @param {*} [value]\n *\n * @example\n * setItemVisual(0, 'color', color);\n * setItemVisual(0, {\n * 'color': color\n * });\n */listProto.setItemVisual=function(idx,key,value){var itemVisual=this._itemVisuals[idx]||{};var hasItemVisual=this.hasItemVisual;this._itemVisuals[idx]=itemVisual;if(isObject$4(key)){for(var name in key){if(key.hasOwnProperty(name)){itemVisual[name]=key[name];hasItemVisual[name]=true;}}return;}itemVisual[key]=value;hasItemVisual[key]=true;};/**\n * Clear itemVisuals and list visual.\n */listProto.clearAllVisual=function(){this._visual={};this._itemVisuals=[];this.hasItemVisual={};};var setItemDataAndSeriesIndex=function setItemDataAndSeriesIndex(child){child.seriesIndex=this.seriesIndex;child.dataIndex=this.dataIndex;child.dataType=this.dataType;};/**\n * Set graphic element relative to data. It can be set as null\n * @param {number} idx\n * @param {module:zrender/Element} [el]\n */listProto.setItemGraphicEl=function(idx,el){var hostModel=this.hostModel;if(el){// Add data index and series index for indexing the data by element\n// Useful in tooltip\nel.dataIndex=idx;el.dataType=this.dataType;el.seriesIndex=hostModel&&hostModel.seriesIndex;if(el.type==='group'){el.traverse(setItemDataAndSeriesIndex,el);}}this._graphicEls[idx]=el;};/**\n * @param {number} idx\n * @return {module:zrender/Element}\n */listProto.getItemGraphicEl=function(idx){return this._graphicEls[idx];};/**\n * @param {Function} cb\n * @param {*} context\n */listProto.eachItemGraphicEl=function(cb,context){each$1(this._graphicEls,function(el,idx){if(el){cb&&cb.call(context,el,idx);}});};/**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */listProto.cloneShallow=function(list){if(!list){var dimensionInfoList=map(this.dimensions,this.getDimensionInfo,this);list=new List(dimensionInfoList,this.hostModel);}// FIXME\nlist._storage=this._storage;transferProperties(list,this);// Clone will not change the data extent and indices\nif(this._indices){var Ctor=this._indices.constructor;list._indices=new Ctor(this._indices);}else{list._indices=null;}list.getRawIndex=list._indices?getRawIndexWithIndices:getRawIndexWithoutIndices;return list;};/**\n * Wrap some method to add more feature\n * @param {string} methodName\n * @param {Function} injectFunction\n */listProto.wrapMethod=function(methodName,injectFunction){var originalMethod=this[methodName];if(typeof originalMethod!=='function'){return;}this.__wrappedMethods=this.__wrappedMethods||[];this.__wrappedMethods.push(methodName);this[methodName]=function(){var res=originalMethod.apply(this,arguments);return injectFunction.apply(this,[res].concat(slice(arguments)));};};// Methods that create a new list based on this list should be listed here.\n// Notice that those method should `RETURN` the new list.\nlistProto.TRANSFERABLE_METHODS=['cloneShallow','downSample','map'];// Methods that change indices of this list should be listed here.\nlistProto.CHANGABLE_METHODS=['filterSelf','selectRange'];/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */ /**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `sysDims`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists.\n * If not specified, auto find the next available data dim.\n * param source {module:data/Source}\n * param dimCount {number}\n * return {Object} encode Never be `null/undefined`.\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @return {Array.}\n */function completeDimensions(sysDims,source,opt){if(!Source.isInstance(source)){source=Source.seriesDataToSource(source);}opt=opt||{};sysDims=(sysDims||[]).slice();var dimsDef=(opt.dimsDef||[]).slice();var dataDimNameMap=createHashMap();var coordDimNameMap=createHashMap();// var valueCandidate;\nvar result=[];var dimCount=getDimCount(source,sysDims,dimsDef,opt.dimCount);// Apply user defined dims (`name` and `type`) and init result.\nfor(var i=0;i} [opt.coordDimensions=[]]\n * @param {number} [opt.dimensionsCount]\n * @param {string} [opt.generateCoord]\n * @param {string} [opt.generateCoordCount]\n * @param {Array.} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define.\n * @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define.\n * @param {Function} [opt.encodeDefaulter] Make default encode if user not specified.\n * @return {Array.} dimensionsInfo\n */var createDimensions=function createDimensions(source,opt){opt=opt||{};return completeDimensions(opt.coordDimensions||[],source,{dimsDef:opt.dimensionsDefine||source.dimensionsDefine,encodeDef:opt.encodeDefine||source.encodeDefine,dimCount:opt.dimensionsCount,encodeDefaulter:opt.encodeDefaulter,generateCoord:opt.generateCoord,generateCoordCount:opt.generateCoordCount});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */ // TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\n/**\n * @class\n * For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // The index of the first category axis in `coordSysDims`.\n * // `null/undefined` means no category axis exists.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */function CoordSysInfo(coordSysName){/**\n * @type {string}\n */this.coordSysName=coordSysName;/**\n * @type {Array.}\n */this.coordSysDims=[];/**\n * @type {module:zrender/core/util#HashMap}\n */this.axisMap=createHashMap();/**\n * @type {module:zrender/core/util#HashMap}\n */this.categoryAxisMap=createHashMap();/**\n * @type {number}\n */this.firstCategoryDimIndex=null;}/**\n * @return {module:model/referHelper#CoordSysInfo}\n */function getCoordSysInfoBySeries(seriesModel){var coordSysName=seriesModel.get('coordinateSystem');var result=new CoordSysInfo(coordSysName);var fetch=fetchers[coordSysName];if(fetch){fetch(seriesModel,result,result.axisMap,result.categoryAxisMap);return result;}}var fetchers={cartesian2d:function cartesian2d(seriesModel,result,axisMap,categoryAxisMap){var xAxisModel=seriesModel.getReferringComponents('xAxis')[0];var yAxisModel=seriesModel.getReferringComponents('yAxis')[0];if(__DEV__){if(!xAxisModel){throw new Error('xAxis \"'+retrieve(seriesModel.get('xAxisIndex'),seriesModel.get('xAxisId'),0)+'\" not found');}if(!yAxisModel){throw new Error('yAxis \"'+retrieve(seriesModel.get('xAxisIndex'),seriesModel.get('yAxisId'),0)+'\" not found');}}result.coordSysDims=['x','y'];axisMap.set('x',xAxisModel);axisMap.set('y',yAxisModel);if(isCategory(xAxisModel)){categoryAxisMap.set('x',xAxisModel);result.firstCategoryDimIndex=0;}if(isCategory(yAxisModel)){categoryAxisMap.set('y',yAxisModel);result.firstCategoryDimIndex==null&(result.firstCategoryDimIndex=1);}},singleAxis:function singleAxis(seriesModel,result,axisMap,categoryAxisMap){var singleAxisModel=seriesModel.getReferringComponents('singleAxis')[0];if(__DEV__){if(!singleAxisModel){throw new Error('singleAxis should be specified.');}}result.coordSysDims=['single'];axisMap.set('single',singleAxisModel);if(isCategory(singleAxisModel)){categoryAxisMap.set('single',singleAxisModel);result.firstCategoryDimIndex=0;}},polar:function polar(seriesModel,result,axisMap,categoryAxisMap){var polarModel=seriesModel.getReferringComponents('polar')[0];var radiusAxisModel=polarModel.findAxisModel('radiusAxis');var angleAxisModel=polarModel.findAxisModel('angleAxis');if(__DEV__){if(!angleAxisModel){throw new Error('angleAxis option not found');}if(!radiusAxisModel){throw new Error('radiusAxis option not found');}}result.coordSysDims=['radius','angle'];axisMap.set('radius',radiusAxisModel);axisMap.set('angle',angleAxisModel);if(isCategory(radiusAxisModel)){categoryAxisMap.set('radius',radiusAxisModel);result.firstCategoryDimIndex=0;}if(isCategory(angleAxisModel)){categoryAxisMap.set('angle',angleAxisModel);result.firstCategoryDimIndex==null&&(result.firstCategoryDimIndex=1);}},geo:function geo(seriesModel,result,axisMap,categoryAxisMap){result.coordSysDims=['lng','lat'];},parallel:function parallel(seriesModel,result,axisMap,categoryAxisMap){var ecModel=seriesModel.ecModel;var parallelModel=ecModel.getComponent('parallel',seriesModel.get('parallelIndex'));var coordSysDims=result.coordSysDims=parallelModel.dimensions.slice();each$1(parallelModel.parallelAxisIndex,function(axisIndex,index){var axisModel=ecModel.getComponent('parallelAxis',axisIndex);var axisDim=coordSysDims[index];axisMap.set(axisDim,axisModel);if(isCategory(axisModel)&&result.firstCategoryDimIndex==null){categoryAxisMap.set(axisDim,axisModel);result.firstCategoryDimIndex=index;}});}};function isCategory(axisModel){return axisModel.get('type')==='category';}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param {module:echarts/model/Series} seriesModel\n * @param {Array.} dimensionInfoList The same as the input of .\n * The input dimensionInfoList will be modified.\n * @param {Object} [opt]\n * @param {boolean} [opt.stackedCoordDimension=''] Specify a coord dimension if needed.\n * @param {boolean} [opt.byIndex=false]\n * @return {Object} calculationInfo\n * {\n * stackedDimension: string\n * stackedByDimension: string\n * isStackedByIndex: boolean\n * stackedOverDimension: string\n * stackResultDimension: string\n * }\n */function enableDataStack(seriesModel,dimensionInfoList,opt){opt=opt||{};var byIndex=opt.byIndex;var stackedCoordDimension=opt.stackedCoordDimension;// Compatibal: when `stack` is set as '', do not stack.\nvar mayStack=!!(seriesModel&&seriesModel.get('stack'));var stackedByDimInfo;var stackedDimInfo;var stackResultDimension;var stackedOverDimension;each$1(dimensionInfoList,function(dimensionInfo,index){if(isString(dimensionInfo)){dimensionInfoList[index]=dimensionInfo={name:dimensionInfo};}if(mayStack&&!dimensionInfo.isExtraCoord){// Find the first ordinal dimension as the stackedByDimInfo.\nif(!byIndex&&!stackedByDimInfo&&dimensionInfo.ordinalMeta){stackedByDimInfo=dimensionInfo;}// Find the first stackable dimension as the stackedDimInfo.\nif(!stackedDimInfo&&dimensionInfo.type!=='ordinal'&&dimensionInfo.type!=='time'&&(!stackedCoordDimension||stackedCoordDimension===dimensionInfo.coordDim)){stackedDimInfo=dimensionInfo;}}});if(stackedDimInfo&&!byIndex&&!stackedByDimInfo){// Compatible with previous design, value axis (time axis) only stack by index.\n// It may make sense if the user provides elaborately constructed data.\nbyIndex=true;}// Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n// That put stack logic in List is for using conveniently in echarts extensions, but it\n// might not be a good way.\nif(stackedDimInfo){// Use a weird name that not duplicated with other names.\nstackResultDimension='__\\0ecstackresult';stackedOverDimension='__\\0ecstackedover';// Create inverted index to fast query index by value.\nif(stackedByDimInfo){stackedByDimInfo.createInvertedIndices=true;}var stackedDimCoordDim=stackedDimInfo.coordDim;var stackedDimType=stackedDimInfo.type;var stackedDimCoordIndex=0;each$1(dimensionInfoList,function(dimensionInfo){if(dimensionInfo.coordDim===stackedDimCoordDim){stackedDimCoordIndex++;}});dimensionInfoList.push({name:stackResultDimension,coordDim:stackedDimCoordDim,coordDimIndex:stackedDimCoordIndex,type:stackedDimType,isExtraCoord:true,isCalculationCoord:true});stackedDimCoordIndex++;dimensionInfoList.push({name:stackedOverDimension,// This dimension contains stack base (generally, 0), so do not set it as\n// `stackedDimCoordDim` to avoid extent calculation, consider log scale.\ncoordDim:stackedOverDimension,coordDimIndex:stackedDimCoordIndex,type:stackedDimType,isExtraCoord:true,isCalculationCoord:true});}return{stackedDimension:stackedDimInfo&&stackedDimInfo.name,stackedByDimension:stackedByDimInfo&&stackedByDimInfo.name,isStackedByIndex:byIndex,stackedOverDimension:stackedOverDimension,stackResultDimension:stackResultDimension};}/**\n * @param {module:echarts/data/List} data\n * @param {string} stackedDim\n */function isDimensionStacked(data,stackedDim/*, stackedByDim*/){// Each single series only maps to one pair of axis. So we do not need to\n// check stackByDim, whatever stacked by a dimension or stacked by index.\nreturn!!stackedDim&&stackedDim===data.getCalculationInfo('stackedDimension');// && (\n// stackedByDim != null\n// ? stackedByDim === data.getCalculationInfo('stackedByDimension')\n// : data.getCalculationInfo('isStackedByIndex')\n// );\n}/**\n * @param {module:echarts/data/List} data\n * @param {string} targetDim\n * @param {string} [stackedByDim] If not input this parameter, check whether\n * stacked by index.\n * @return {string} dimension\n */function getStackedDimension(data,targetDim){return isDimensionStacked(data,targetDim)?data.getCalculationInfo('stackResultDimension'):targetDim;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @param {module:echarts/data/Source|Array} source Or raw data.\n * @param {module:echarts/model/Series} seriesModel\n * @param {Object} [opt]\n * @param {string} [opt.generateCoord]\n * @param {boolean} [opt.useEncodeDefaulter]\n */function createListFromArray(source,seriesModel,opt){opt=opt||{};if(!Source.isInstance(source)){source=Source.seriesDataToSource(source);}var coordSysName=seriesModel.get('coordinateSystem');var registeredCoordSys=CoordinateSystemManager.get(coordSysName);var coordSysInfo=getCoordSysInfoBySeries(seriesModel);var coordSysDimDefs;if(coordSysInfo){coordSysDimDefs=map(coordSysInfo.coordSysDims,function(dim){var dimInfo={name:dim};var axisModel=coordSysInfo.axisMap.get(dim);if(axisModel){var axisType=axisModel.get('type');dimInfo.type=getDimensionTypeByAxis(axisType);// dimInfo.stackable = isStackable(axisType);\n}return dimInfo;});}if(!coordSysDimDefs){// Get dimensions from registered coordinate system\ncoordSysDimDefs=registeredCoordSys&&(registeredCoordSys.getDimensionsInfo?registeredCoordSys.getDimensionsInfo():registeredCoordSys.dimensions.slice())||['x','y'];}var dimInfoList=createDimensions(source,{coordDimensions:coordSysDimDefs,generateCoord:opt.generateCoord,encodeDefaulter:opt.useEncodeDefaulter?curry(makeSeriesEncodeForAxisCoordSys,coordSysDimDefs,seriesModel):null});var firstCategoryDimIndex;var hasNameEncode;coordSysInfo&&each$1(dimInfoList,function(dimInfo,dimIndex){var coordDim=dimInfo.coordDim;var categoryAxisModel=coordSysInfo.categoryAxisMap.get(coordDim);if(categoryAxisModel){if(firstCategoryDimIndex==null){firstCategoryDimIndex=dimIndex;}dimInfo.ordinalMeta=categoryAxisModel.getOrdinalMeta();}if(dimInfo.otherDims.itemName!=null){hasNameEncode=true;}});if(!hasNameEncode&&firstCategoryDimIndex!=null){dimInfoList[firstCategoryDimIndex].otherDims.itemName=0;}var stackCalculationInfo=enableDataStack(seriesModel,dimInfoList);var list=new List(dimInfoList,seriesModel);list.setCalculationInfo(stackCalculationInfo);var dimValueGetter=firstCategoryDimIndex!=null&&isNeedCompleteOrdinalData(source)?function(itemOpt,dimName,dataIndex,dimIndex){// Use dataIndex as ordinal value in categoryAxis\nreturn dimIndex===firstCategoryDimIndex?dataIndex:this.defaultDimValueGetter(itemOpt,dimName,dataIndex,dimIndex);}:null;list.hasItemOption=false;list.initData(source,null,dimValueGetter);return list;}function isNeedCompleteOrdinalData(source){if(source.sourceFormat===SOURCE_FORMAT_ORIGINAL){var sampleItem=firstDataNotNull(source.data||[]);return sampleItem!=null&&!isArray(getDataItemValue(sampleItem));}}function firstDataNotNull(data){var i=0;while(i}\n * @protected\n */this._extent=[Infinity,-Infinity];/**\n * Step is calculated in adjustExtent\n * @type {Array.}\n * @protected\n */this._interval=0;this.init&&this.init.apply(this,arguments);}/**\n * Parse input val to valid inner number.\n * @param {*} val\n * @return {number}\n */Scale.prototype.parse=function(val){// Notice: This would be a trap here, If the implementation\n// of this method depends on extent, and this method is used\n// before extent set (like in dataZoom), it would be wrong.\n// Nevertheless, parse does not depend on extent generally.\nreturn val;};Scale.prototype.getSetting=function(name){return this._setting[name];};Scale.prototype.contain=function(val){var extent=this._extent;return val>=extent[0]&&val<=extent[1];};/**\n * Normalize value to linear [0, 1], return 0.5 if extent span is 0\n * @param {number} val\n * @return {number}\n */Scale.prototype.normalize=function(val){var extent=this._extent;if(extent[1]===extent[0]){return 0.5;}return(val-extent[0])/(extent[1]-extent[0]);};/**\n * Scale normalized value\n * @param {number} val\n * @return {number}\n */Scale.prototype.scale=function(val){var extent=this._extent;return val*(extent[1]-extent[0])+extent[0];};/**\n * Set extent from data\n * @param {Array.} other\n */Scale.prototype.unionExtent=function(other){var extent=this._extent;other[0]extent[1]&&(extent[1]=other[1]);// not setExtent because in log axis it may transformed to power\n// this.setExtent(extent[0], extent[1]);\n};/**\n * Set extent from data\n * @param {module:echarts/data/List} data\n * @param {string} dim\n */Scale.prototype.unionExtentFromData=function(data,dim){this.unionExtent(data.getApproximateExtent(dim));};/**\n * Get extent\n * @return {Array.}\n */Scale.prototype.getExtent=function(){return this._extent.slice();};/**\n * Set extent\n * @param {number} start\n * @param {number} end\n */Scale.prototype.setExtent=function(start,end){var thisExtent=this._extent;if(!isNaN(start)){thisExtent[0]=start;}if(!isNaN(end)){thisExtent[1]=end;}};/**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */Scale.prototype.isBlank=function(){return this._isBlank;},/**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */Scale.prototype.setBlank=function(isBlank){this._isBlank=isBlank;};/**\n * @abstract\n * @param {*} tick\n * @return {string} label of the tick.\n */Scale.prototype.getLabel=null;enableClassExtend(Scale);enableClassManagement(Scale,{registerWhenExtend:true});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @constructor\n * @param {Object} [opt]\n * @param {Object} [opt.categories=[]]\n * @param {Object} [opt.needCollect=false]\n * @param {Object} [opt.deduplication=false]\n */function OrdinalMeta(opt){/**\n * @readOnly\n * @type {Array.}\n */this.categories=opt.categories||[];/**\n * @private\n * @type {boolean}\n */this._needCollect=opt.needCollect;/**\n * @private\n * @type {boolean}\n */this._deduplication=opt.deduplication;/**\n * @private\n * @type {boolean}\n */this._map;}/**\n * @param {module:echarts/model/Model} axisModel\n * @return {module:echarts/data/OrdinalMeta}\n */OrdinalMeta.createByAxisModel=function(axisModel){var option=axisModel.option;var data=option.data;var categories=data&&map(data,getName);return new OrdinalMeta({categories:categories,needCollect:!categories,// deduplication is default in axis.\ndeduplication:option.dedplication!==false});};var proto$1=OrdinalMeta.prototype;/**\n * @param {string} category\n * @return {number} ordinal\n */proto$1.getOrdinal=function(category){return getOrCreateMap(this).get(category);};/**\n * @param {*} category\n * @return {number} The ordinal. If not found, return NaN.\n */proto$1.parseAndCollect=function(category){var index;var needCollect=this._needCollect;// The value of category dim can be the index of the given category set.\n// This feature is only supported when !needCollect, because we should\n// consider a common case: a value is 2017, which is a number but is\n// expected to be tread as a category. This case usually happen in dataset,\n// where it happent to be no need of the index feature.\nif(typeof category!=='string'&&!needCollect){return category;}// Optimize for the scenario:\n// category is ['2012-01-01', '2012-01-02', ...], where the input\n// data has been ensured not duplicate and is large data.\n// Notice, if a dataset dimension provide categroies, usually echarts\n// should remove duplication except user tell echarts dont do that\n// (set axis.deduplication = false), because echarts do not know whether\n// the values in the category dimension has duplication (consider the\n// parallel-aqi example)\nif(needCollect&&!this._deduplication){index=this.categories.length;this.categories[index]=category;return index;}var map$$1=getOrCreateMap(this);index=map$$1.get(category);if(index==null){if(needCollect){index=this.categories.length;this.categories[index]=category;map$$1.set(category,index);}else{index=NaN;}}return index;};// Consider big data, do not create map until needed.\nfunction getOrCreateMap(ordinalMeta){return ordinalMeta._map||(ordinalMeta._map=createHashMap(ordinalMeta.categories));}function getName(obj){if(isObject$1(obj)&&obj.value!=null){return obj.value;}else{return obj+'';}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Linear continuous scale\n * @module echarts/coord/scale/Ordinal\n *\n * http://en.wikipedia.org/wiki/Level_of_measurement\n */ // FIXME only one data\nvar scaleProto=Scale.prototype;var OrdinalScale=Scale.extend({type:'ordinal',/**\n * @param {module:echarts/data/OrdianlMeta|Array.} ordinalMeta\n */init:function init(ordinalMeta,extent){// Caution: Should not use instanceof, consider ec-extensions using\n// import approach to get OrdinalMeta class.\nif(!ordinalMeta||isArray(ordinalMeta)){ordinalMeta=new OrdinalMeta({categories:ordinalMeta});}this._ordinalMeta=ordinalMeta;this._extent=extent||[0,ordinalMeta.categories.length-1];},parse:function parse(val){return typeof val==='string'?this._ordinalMeta.getOrdinal(val)// val might be float.\n:Math.round(val);},contain:function contain(rank){rank=this.parse(rank);return scaleProto.contain.call(this,rank)&&this._ordinalMeta.categories[rank]!=null;},/**\n * Normalize given rank or name to linear [0, 1]\n * @param {number|string} [val]\n * @return {number}\n */normalize:function normalize(val){return scaleProto.normalize.call(this,this.parse(val));},scale:function scale(val){return Math.round(scaleProto.scale.call(this,val));},/**\n * @return {Array}\n */getTicks:function getTicks(){var ticks=[];var extent=this._extent;var rank=extent[0];while(rank<=extent[1]){ticks.push(rank);rank++;}return ticks;},/**\n * Get item on rank n\n * @param {number} n\n * @return {string}\n */getLabel:function getLabel(n){if(!this.isBlank()){// Note that if no data, ordinalMeta.categories is an empty array.\nreturn this._ordinalMeta.categories[n];}},/**\n * @return {number}\n */count:function count(){return this._extent[1]-this._extent[0]+1;},/**\n * @override\n */unionExtentFromData:function unionExtentFromData(data,dim){this.unionExtent(data.getApproximateExtent(dim));},getOrdinalMeta:function getOrdinalMeta(){return this._ordinalMeta;},niceTicks:noop,niceExtent:noop});/**\n * @return {module:echarts/scale/Time}\n */OrdinalScale.create=function(){return new OrdinalScale();};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * For testable.\n */var roundNumber$1=round$1;/**\n * @param {Array.} extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param {number} splitNumber splitNumber should be >= 1.\n * @param {number} [minInterval]\n * @param {number} [maxInterval]\n * @return {Object} {interval, intervalPrecision, niceTickExtent}\n */function intervalScaleNiceTicks(extent,splitNumber,minInterval,maxInterval){var result={};var span=extent[1]-extent[0];var interval=result.interval=nice(span/splitNumber,true);if(minInterval!=null&&intervalmaxInterval){interval=result.interval=maxInterval;}// Tow more digital for tick.\nvar precision=result.intervalPrecision=getIntervalPrecision(interval);// Niced extent inside original extent\nvar niceTickExtent=result.niceTickExtent=[roundNumber$1(Math.ceil(extent[0]/interval)*interval,precision),roundNumber$1(Math.floor(extent[1]/interval)*interval,precision)];fixExtent(niceTickExtent,extent);return result;}/**\n * @param {number} interval\n * @return {number} interval precision\n */function getIntervalPrecision(interval){// Tow more digital for tick.\nreturn getPrecisionSafe(interval)+2;}function clamp(niceTickExtent,idx,extent){niceTickExtent[idx]=Math.max(Math.min(niceTickExtent[idx],extent[1]),extent[0]);}// In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\nfunction fixExtent(niceTickExtent,extent){!isFinite(niceTickExtent[0])&&(niceTickExtent[0]=extent[0]);!isFinite(niceTickExtent[1])&&(niceTickExtent[1]=extent[1]);clamp(niceTickExtent,0,extent);clamp(niceTickExtent,1,extent);if(niceTickExtent[0]>niceTickExtent[1]){niceTickExtent[0]=niceTickExtent[1];}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Interval scale\n * @module echarts/scale/Interval\n */var roundNumber=round$1;/**\n * @alias module:echarts/coord/scale/Interval\n * @constructor\n */var IntervalScale=Scale.extend({type:'interval',_interval:0,_intervalPrecision:2,setExtent:function setExtent(start,end){var thisExtent=this._extent;//start,end may be a Number like '25',so...\nif(!isNaN(start)){thisExtent[0]=parseFloat(start);}if(!isNaN(end)){thisExtent[1]=parseFloat(end);}},unionExtent:function unionExtent(other){var extent=this._extent;other[0]extent[1]&&(extent[1]=other[1]);// unionExtent may called by it's sub classes\nIntervalScale.prototype.setExtent.call(this,extent[0],extent[1]);},/**\n * Get interval\n */getInterval:function getInterval(){return this._interval;},/**\n * Set interval\n */setInterval:function setInterval(interval){this._interval=interval;// Dropped auto calculated niceExtent and use user setted extent\n// We assume user wan't to set both interval, min, max to get a better result\nthis._niceExtent=this._extent.slice();this._intervalPrecision=getIntervalPrecision(interval);},/**\n * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.\n * @return {Array.}\n */getTicks:function getTicks(expandToNicedExtent){var interval=this._interval;var extent=this._extent;var niceTickExtent=this._niceExtent;var intervalPrecision=this._intervalPrecision;var ticks=[];// If interval is 0, return [];\nif(!interval){return ticks;}// Consider this case: using dataZoom toolbox, zoom and zoom.\nvar safeLimit=10000;if(extent[0]safeLimit){return[];}}// Consider this case: the last item of ticks is smaller\n// than niceTickExtent[1] and niceTickExtent[1] === extent[1].\nvar lastNiceTick=ticks.length?ticks[ticks.length-1]:niceTickExtent[1];if(extent[1]>lastNiceTick){if(expandToNicedExtent){ticks.push(roundNumber(lastNiceTick+interval,intervalPrecision));}else{ticks.push(extent[1]);}}return ticks;},/**\n * @param {number} [splitNumber=5]\n * @return {Array.>}\n */getMinorTicks:function getMinorTicks(splitNumber){var ticks=this.getTicks(true);var minorTicks=[];var extent=this.getExtent();for(var i=1;iextent[0]&&minorTick0){// Ignore 0 delta because they are of the same axis value\nmin=min===null?delta:Math.min(min,delta);}}// Set to null if only have one data\naxisMinGaps[key]=min;}}}return axisMinGaps;}function makeColumnLayout(barSeries){var axisMinGaps=getValueAxesMinGaps(barSeries);var seriesInfoList=[];each$1(barSeries,function(seriesModel){var cartesian=seriesModel.coordinateSystem;var baseAxis=cartesian.getBaseAxis();var axisExtent=baseAxis.getExtent();var bandWidth;if(baseAxis.type==='category'){bandWidth=baseAxis.getBandWidth();}else if(baseAxis.type==='value'||baseAxis.type==='time'){var key=baseAxis.dim+'_'+baseAxis.index;var minGap=axisMinGaps[key];var extentSpan=Math.abs(axisExtent[1]-axisExtent[0]);var scale=baseAxis.scale.getExtent();var scaleSpan=Math.abs(scale[1]-scale[0]);bandWidth=minGap?extentSpan/scaleSpan*minGap:extentSpan;// When there is only one data value\n}else{var data=seriesModel.getData();bandWidth=Math.abs(axisExtent[1]-axisExtent[0])/data.count();}var barWidth=parsePercent$1(seriesModel.get('barWidth'),bandWidth);var barMaxWidth=parsePercent$1(seriesModel.get('barMaxWidth'),bandWidth);var barMinWidth=parsePercent$1(// barMinWidth by default is 1 in cartesian. Because in value axis,\n// the auto-calculated bar width might be less than 1.\nseriesModel.get('barMinWidth')||1,bandWidth);var barGap=seriesModel.get('barGap');var barCategoryGap=seriesModel.get('barCategoryGap');seriesInfoList.push({bandWidth:bandWidth,barWidth:barWidth,barMaxWidth:barMaxWidth,barMinWidth:barMinWidth,barGap:barGap,barCategoryGap:barCategoryGap,axisKey:getAxisKey(baseAxis),stackId:getSeriesStackId(seriesModel)});});return doCalBarWidthAndOffset(seriesInfoList);}function doCalBarWidthAndOffset(seriesInfoList){// Columns info on each category axis. Key is cartesian name\nvar columnsMap={};each$1(seriesInfoList,function(seriesInfo,idx){var axisKey=seriesInfo.axisKey;var bandWidth=seriesInfo.bandWidth;var columnsOnAxis=columnsMap[axisKey]||{bandWidth:bandWidth,remainedWidth:bandWidth,autoWidthCount:0,categoryGap:'20%',gap:'30%',stacks:{}};var stacks=columnsOnAxis.stacks;columnsMap[axisKey]=columnsOnAxis;var stackId=seriesInfo.stackId;if(!stacks[stackId]){columnsOnAxis.autoWidthCount++;}stacks[stackId]=stacks[stackId]||{width:0,maxWidth:0};// Caution: In a single coordinate system, these barGrid attributes\n// will be shared by series. Consider that they have default values,\n// only the attributes set on the last series will work.\n// Do not change this fact unless there will be a break change.\nvar barWidth=seriesInfo.barWidth;if(barWidth&&!stacks[stackId].width){// See #6312, do not restrict width.\nstacks[stackId].width=barWidth;barWidth=Math.min(columnsOnAxis.remainedWidth,barWidth);columnsOnAxis.remainedWidth-=barWidth;}var barMaxWidth=seriesInfo.barMaxWidth;barMaxWidth&&(stacks[stackId].maxWidth=barMaxWidth);var barMinWidth=seriesInfo.barMinWidth;barMinWidth&&(stacks[stackId].minWidth=barMinWidth);var barGap=seriesInfo.barGap;barGap!=null&&(columnsOnAxis.gap=barGap);var barCategoryGap=seriesInfo.barCategoryGap;barCategoryGap!=null&&(columnsOnAxis.categoryGap=barCategoryGap);});var result={};each$1(columnsMap,function(columnsOnAxis,coordSysName){result[coordSysName]={};var stacks=columnsOnAxis.stacks;var bandWidth=columnsOnAxis.bandWidth;var categoryGap=parsePercent$1(columnsOnAxis.categoryGap,bandWidth);var barGapPercent=parsePercent$1(columnsOnAxis.gap,1);var remainedWidth=columnsOnAxis.remainedWidth;var autoWidthCount=columnsOnAxis.autoWidthCount;var autoWidth=(remainedWidth-categoryGap)/(autoWidthCount+(autoWidthCount-1)*barGapPercent);autoWidth=Math.max(autoWidth,0);// Find if any auto calculated bar exceeded maxBarWidth\neach$1(stacks,function(column){var maxWidth=column.maxWidth;var minWidth=column.minWidth;if(!column.width){var finalWidth=autoWidth;if(maxWidth&&maxWidthfinalWidth){finalWidth=minWidth;}if(finalWidth!==autoWidth){column.width=finalWidth;remainedWidth-=finalWidth+barGapPercent*finalWidth;autoWidthCount--;}}else{// `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n// CSS does. Becuase barWidth can be a percent value, where\n// `barMaxWidth` can be used to restrict the final width.\nvar finalWidth=column.width;if(maxWidth){finalWidth=Math.min(finalWidth,maxWidth);}// `minWidth` has higher priority, as described above\nif(minWidth){finalWidth=Math.max(finalWidth,minWidth);}column.width=finalWidth;remainedWidth-=finalWidth+barGapPercent*finalWidth;autoWidthCount--;}});// Recalculate width again\nautoWidth=(remainedWidth-categoryGap)/(autoWidthCount+(autoWidthCount-1)*barGapPercent);autoWidth=Math.max(autoWidth,0);var widthSum=0;var lastColumn;each$1(stacks,function(column,idx){if(!column.width){column.width=autoWidth;}lastColumn=column;widthSum+=column.width*(1+barGapPercent);});if(lastColumn){widthSum-=lastColumn.width*barGapPercent;}var offset=-widthSum/2;each$1(stacks,function(column,stackId){result[coordSysName][stackId]=result[coordSysName][stackId]||{bandWidth:bandWidth,offset:offset,width:column.width};offset+=column.width*(1+barGapPercent);});});return result;}/**\n * @param {Object} barWidthAndOffset The result of makeColumnLayout\n * @param {module:echarts/coord/Axis} axis\n * @param {module:echarts/model/Series} [seriesModel] If not provided, return all.\n * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided.\n */function retrieveColumnLayout(barWidthAndOffset,axis,seriesModel){if(barWidthAndOffset&&axis){var result=barWidthAndOffset[getAxisKey(axis)];if(result!=null&&seriesModel!=null){result=result[getSeriesStackId(seriesModel)];}return result;}}/**\n * @param {string} seriesType\n * @param {module:echarts/model/Global} ecModel\n */function layout(seriesType,ecModel){var seriesModels=prepareLayoutBarSeries(seriesType,ecModel);var barWidthAndOffset=makeColumnLayout(seriesModels);var lastStackCoords={};each$1(seriesModels,function(seriesModel){var data=seriesModel.getData();var cartesian=seriesModel.coordinateSystem;var baseAxis=cartesian.getBaseAxis();var stackId=getSeriesStackId(seriesModel);var columnLayoutInfo=barWidthAndOffset[getAxisKey(baseAxis)][stackId];var columnOffset=columnLayoutInfo.offset;var columnWidth=columnLayoutInfo.width;var valueAxis=cartesian.getOtherAxis(baseAxis);var barMinHeight=seriesModel.get('barMinHeight')||0;lastStackCoords[stackId]=lastStackCoords[stackId]||[];data.setLayout({bandWidth:columnLayoutInfo.bandWidth,offset:columnOffset,size:columnWidth});var valueDim=data.mapDimension(valueAxis.dim);var baseDim=data.mapDimension(baseAxis.dim);var stacked=isDimensionStacked(data,valueDim/*, baseDim*/);var isValueAxisH=valueAxis.isHorizontal();var valueAxisStart=getValueAxisStart(baseAxis,valueAxis,stacked);for(var idx=0,len=data.count();idx=0?'p':'n';var baseCoord=valueAxisStart;// Because of the barMinHeight, we can not use the value in\n// stackResultDimension directly.\nif(stacked){// Only ordinal axis can be stacked.\nif(!lastStackCoords[stackId][baseValue]){lastStackCoords[stackId][baseValue]={p:valueAxisStart,// Positive stack\nn:valueAxisStart// Negative stack\n};}// Should also consider #4243\nbaseCoord=lastStackCoords[stackId][baseValue][sign];}var x;var y;var width;var height;if(isValueAxisH){var coord=cartesian.dataToPoint([value,baseValue]);x=baseCoord;y=coord[1]+columnOffset;width=coord[0]-valueAxisStart;height=columnWidth;if(Math.abs(width)LARGE_BAR_MIN_WIDTH)){// jshint ignore:line\nbarWidth=LARGE_BAR_MIN_WIDTH;}return{progress:progress};function progress(params,data){var count=params.count;var largePoints=new LargeArr(count*2);var largeBackgroundPoints=new LargeArr(count*2);var largeDataIndices=new LargeArr(count);var dataIndex;var coord=[];var valuePair=[];var pointsOffset=0;var idxOffset=0;while((dataIndex=params.next())!=null){valuePair[valueDimIdx]=data.get(valueDim,dataIndex);valuePair[1-valueDimIdx]=data.get(baseDim,dataIndex);coord=cartesian.dataToPoint(valuePair,null,coord);// Data index might not be in order, depends on `progressiveChunkMode`.\nlargeBackgroundPoints[pointsOffset]=valueAxisHorizontal?coordLayout.x+coordLayout.width:coord[0];largePoints[pointsOffset++]=coord[0];largeBackgroundPoints[pointsOffset]=valueAxisHorizontal?coord[1]:coordLayout.y+coordLayout.height;largePoints[pointsOffset++]=coord[1];largeDataIndices[idxOffset++]=dataIndex;}data.setLayout({largePoints:largePoints,largeDataIndices:largeDataIndices,largeBackgroundPoints:largeBackgroundPoints,barWidth:barWidth,valueAxisStart:getValueAxisStart(baseAxis,valueAxis,false),backgroundStart:valueAxisHorizontal?coordLayout.x:coordLayout.y,valueAxisHorizontal:valueAxisHorizontal});}}};function isOnCartesian(seriesModel){return seriesModel.coordinateSystem&&seriesModel.coordinateSystem.type==='cartesian2d';}function isInLargeMode(seriesModel){return seriesModel.pipelineContext&&seriesModel.pipelineContext.large;}// See cases in `test/bar-start.html` and `#7412`, `#8747`.\nfunction getValueAxisStart(baseAxis,valueAxis,stacked){return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type==='log'?1:0));}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* A third-party license is embeded for some of the code in this file:\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/ // [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design have\n// concidered these common case:\n// (1) Time that is persistent in server is in UTC, but it is needed to be diplayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\nvar intervalScaleProto=IntervalScale.prototype;var mathCeil=Math.ceil;var mathFloor=Math.floor;var ONE_SECOND=1000;var ONE_MINUTE=ONE_SECOND*60;var ONE_HOUR=ONE_MINUTE*60;var ONE_DAY=ONE_HOUR*24;// FIXME 公用?\nvar bisect=function bisect(a,x,lo,hi){while(lo>>1;if(a[mid][1]maxInterval){approxInterval=maxInterval;}var scaleLevelsLen=scaleLevels.length;var idx=bisect(scaleLevels,approxInterval,0,scaleLevelsLen);var level=scaleLevels[Math.min(idx,scaleLevelsLen-1)];var interval=level[1];// Same with interval scale if span is much larger than 1 year\nif(level[0]==='year'){var yearSpan=span/interval;// From \"Nice Numbers for Graph Labels\" of Graphic Gems\n// var niceYearSpan = numberUtil.nice(yearSpan, false);\nvar yearStep=nice(yearSpan/approxTickNum,true);interval*=yearStep;}var timezoneOffset=this.getSetting('useUTC')?0:new Date(+extent[0]||+extent[1]).getTimezoneOffset()*60*1000;var niceExtent=[Math.round(mathCeil((extent[0]-timezoneOffset)/interval)*interval+timezoneOffset),Math.round(mathFloor((extent[1]-timezoneOffset)/interval)*interval+timezoneOffset)];fixExtent(niceExtent,extent);this._stepLvl=level;// Interval will be used in getTicks\nthis._interval=interval;this._niceExtent=niceExtent;},parse:function parse(val){// val might be float.\nreturn+parseDate(val);}});each$1(['contain','normalize'],function(methodName){TimeScale.prototype[methodName]=function(val){return intervalScaleProto[methodName].call(this,this.parse(val));};});/**\n * This implementation was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */var scaleLevels=[// Format interval\n['hh:mm:ss',ONE_SECOND],// 1s\n['hh:mm:ss',ONE_SECOND*5],// 5s\n['hh:mm:ss',ONE_SECOND*10],// 10s\n['hh:mm:ss',ONE_SECOND*15],// 15s\n['hh:mm:ss',ONE_SECOND*30],// 30s\n['hh:mm\\nMM-dd',ONE_MINUTE],// 1m\n['hh:mm\\nMM-dd',ONE_MINUTE*5],// 5m\n['hh:mm\\nMM-dd',ONE_MINUTE*10],// 10m\n['hh:mm\\nMM-dd',ONE_MINUTE*15],// 15m\n['hh:mm\\nMM-dd',ONE_MINUTE*30],// 30m\n['hh:mm\\nMM-dd',ONE_HOUR],// 1h\n['hh:mm\\nMM-dd',ONE_HOUR*2],// 2h\n['hh:mm\\nMM-dd',ONE_HOUR*6],// 6h\n['hh:mm\\nMM-dd',ONE_HOUR*12],// 12h\n['MM-dd\\nyyyy',ONE_DAY],// 1d\n['MM-dd\\nyyyy',ONE_DAY*2],// 2d\n['MM-dd\\nyyyy',ONE_DAY*3],// 3d\n['MM-dd\\nyyyy',ONE_DAY*4],// 4d\n['MM-dd\\nyyyy',ONE_DAY*5],// 5d\n['MM-dd\\nyyyy',ONE_DAY*6],// 6d\n['week',ONE_DAY*7],// 7d\n['MM-dd\\nyyyy',ONE_DAY*10],// 10d\n['week',ONE_DAY*14],// 2w\n['week',ONE_DAY*21],// 3w\n['month',ONE_DAY*31],// 1M\n['week',ONE_DAY*42],// 6w\n['month',ONE_DAY*62],// 2M\n['week',ONE_DAY*70],// 10w\n['quarter',ONE_DAY*95],// 3M\n['month',ONE_DAY*31*4],// 4M\n['month',ONE_DAY*31*5],// 5M\n['half-year',ONE_DAY*380/2],// 6M\n['month',ONE_DAY*31*8],// 8M\n['month',ONE_DAY*31*10],// 10M\n['year',ONE_DAY*380]// 1Y\n];/**\n * @param {module:echarts/model/Model}\n * @return {module:echarts/scale/Time}\n */TimeScale.create=function(model){return new TimeScale({useUTC:model.ecModel.get('useUTC')});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Log scale\n * @module echarts/scale/Log\n */ // Use some method of IntervalScale\nvar scaleProto$1=Scale.prototype;var intervalScaleProto$1=IntervalScale.prototype;var getPrecisionSafe$1=getPrecisionSafe;var roundingErrorFix=round$1;var mathFloor$1=Math.floor;var mathCeil$1=Math.ceil;var mathPow$1=Math.pow;var mathLog=Math.log;var LogScale=Scale.extend({type:'log',base:10,$constructor:function $constructor(){Scale.apply(this,arguments);this._originalScale=new IntervalScale();},/**\n * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.\n * @return {Array.}\n */getTicks:function getTicks(expandToNicedExtent){var originalScale=this._originalScale;var extent=this._extent;var originalExtent=originalScale.getExtent();return map(intervalScaleProto$1.getTicks.call(this,expandToNicedExtent),function(val){var powVal=round$1(mathPow$1(this.base,val));// Fix #4158\npowVal=val===extent[0]&&originalScale.__fixMin?fixRoundingError(powVal,originalExtent[0]):powVal;powVal=val===extent[1]&&originalScale.__fixMax?fixRoundingError(powVal,originalExtent[1]):powVal;return powVal;},this);},/**\n * @param {number} splitNumber\n * @return {Array.>}\n */getMinorTicks:intervalScaleProto$1.getMinorTicks,/**\n * @param {number} val\n * @return {string}\n */getLabel:intervalScaleProto$1.getLabel,/**\n * @param {number} val\n * @return {number}\n */scale:function scale(val){val=scaleProto$1.scale.call(this,val);return mathPow$1(this.base,val);},/**\n * @param {number} start\n * @param {number} end\n */setExtent:function setExtent(start,end){var base=this.base;start=mathLog(start)/mathLog(base);end=mathLog(end)/mathLog(base);intervalScaleProto$1.setExtent.call(this,start,end);},/**\n * @return {number} end\n */getExtent:function getExtent(){var base=this.base;var extent=scaleProto$1.getExtent.call(this);extent[0]=mathPow$1(base,extent[0]);extent[1]=mathPow$1(base,extent[1]);// Fix #4158\nvar originalScale=this._originalScale;var originalExtent=originalScale.getExtent();originalScale.__fixMin&&(extent[0]=fixRoundingError(extent[0],originalExtent[0]));originalScale.__fixMax&&(extent[1]=fixRoundingError(extent[1],originalExtent[1]));return extent;},/**\n * @param {Array.} extent\n */unionExtent:function unionExtent(extent){this._originalScale.unionExtent(extent);var base=this.base;extent[0]=mathLog(extent[0])/mathLog(base);extent[1]=mathLog(extent[1])/mathLog(base);scaleProto$1.unionExtent.call(this,extent);},/**\n * @override\n */unionExtentFromData:function unionExtentFromData(data,dim){// TODO\n// filter value that <= 0\nthis.unionExtent(data.getApproximateExtent(dim));},/**\n * Update interval and extent of intervals for nice ticks\n * @param {number} [approxTickNum = 10] Given approx tick number\n */niceTicks:function niceTicks(approxTickNum){approxTickNum=approxTickNum||10;var extent=this._extent;var span=extent[1]-extent[0];if(span===Infinity||span<=0){return;}var interval=quantity(span);var err=approxTickNum/span*interval;// Filter ticks to get closer to the desired count.\nif(err<=0.5){interval*=10;}// Interval should be integer\nwhile(!isNaN(interval)&&Math.abs(interval)<1&&Math.abs(interval)>0){interval*=10;}var niceExtent=[round$1(mathCeil$1(extent[0]/interval)*interval),round$1(mathFloor$1(extent[1]/interval)*interval)];this._interval=interval;this._niceExtent=niceExtent;},/**\n * Nice extent.\n * @override\n */niceExtent:function niceExtent(opt){intervalScaleProto$1.niceExtent.call(this,opt);var originalScale=this._originalScale;originalScale.__fixMin=opt.fixMin;originalScale.__fixMax=opt.fixMax;}});each$1(['contain','normalize'],function(methodName){LogScale.prototype[methodName]=function(val){val=mathLog(val)/mathLog(this.base);return scaleProto$1[methodName].call(this,val);};});LogScale.create=function(){return new LogScale();};function fixRoundingError(val,originalVal){return roundingErrorFix(val,getPrecisionSafe$1(originalVal));}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n */function getScaleExtent(scale,model){var scaleType=scale.type;var min=model.getMin();var max=model.getMax();var originalExtent=scale.getExtent();var axisDataLen;var boundaryGap;var span;if(scaleType==='ordinal'){axisDataLen=model.getCategories().length;}else{boundaryGap=model.get('boundaryGap');if(!isArray(boundaryGap)){boundaryGap=[boundaryGap||0,boundaryGap||0];}if(typeof boundaryGap[0]==='boolean'){if(__DEV__){console.warn('Boolean type for boundaryGap is only '+'allowed for ordinal axis. Please use string in '+'percentage instead, e.g., \"20%\". Currently, '+'boundaryGap is set to be 0.');}boundaryGap=[0,0];}boundaryGap[0]=parsePercent$1(boundaryGap[0],1);boundaryGap[1]=parsePercent$1(boundaryGap[1],1);span=originalExtent[1]-originalExtent[0]||Math.abs(originalExtent[0]);}// Notice: When min/max is not set (that is, when there are null/undefined,\n// which is the most common case), these cases should be ensured:\n// (1) For 'ordinal', show all axis.data.\n// (2) For others:\n// + `boundaryGap` is applied (if min/max set, boundaryGap is\n// disabled).\n// + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n// be the result that originalExtent enlarged by boundaryGap.\n// (3) If no data, it should be ensured that `scale.setBlank` is set.\n// FIXME\n// (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n// (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n// that the results processed by boundaryGap are positive/negative?\nif(min==='dataMin'){min=originalExtent[0];}else if(typeof min==='function'){min=min({min:originalExtent[0],max:originalExtent[1]});}if(max==='dataMax'){max=originalExtent[1];}else if(typeof max==='function'){max=max({min:originalExtent[0],max:originalExtent[1]});}var fixMin=min!=null;var fixMax=max!=null;if(min==null){min=scaleType==='ordinal'?axisDataLen?0:NaN:originalExtent[0]-boundaryGap[0]*span;}if(max==null){max=scaleType==='ordinal'?axisDataLen?axisDataLen-1:NaN:originalExtent[1]+boundaryGap[1]*span;}(min==null||!isFinite(min))&&(min=NaN);(max==null||!isFinite(max))&&(max=NaN);scale.setBlank(eqNaN(min)||eqNaN(max)||scaleType==='ordinal'&&!scale.getOrdinalMeta().categories.length);// Evaluate if axis needs cross zero\nif(model.getNeedCrossZero()){// Axis is over zero and min is not set\nif(min>0&&max>0&&!fixMin){min=0;}// Axis is under zero and max is not set\nif(min<0&&max<0&&!fixMax){max=0;}}// If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n// is base axis\n// FIXME\n// (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n// (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n// Should not depend on series type `bar`?\n// (3) Fix that might overlap when using dataZoom.\n// (4) Consider other chart types using `barGrid`?\n// See #6728, #4862, `test/bar-overflow-time-plot.html`\nvar ecModel=model.ecModel;if(ecModel&&scaleType==='time'/*|| scaleType === 'interval' */){var barSeriesModels=prepareLayoutBarSeries('bar',ecModel);var isBaseAxisAndHasBarSeries;each$1(barSeriesModels,function(seriesModel){isBaseAxisAndHasBarSeries|=seriesModel.getBaseAxis()===model.axis;});if(isBaseAxisAndHasBarSeries){// Calculate placement of bars on axis\nvar barWidthAndOffset=makeColumnLayout(barSeriesModels);// Adjust axis min and max to account for overflow\nvar adjustedScale=adjustScaleForOverflow(min,max,model,barWidthAndOffset);min=adjustedScale.min;max=adjustedScale.max;}}return{extent:[min,max],// \"fix\" means \"fixed\", the value should not be\n// changed in the subsequent steps.\nfixMin:fixMin,fixMax:fixMax};}function adjustScaleForOverflow(min,max,model,barWidthAndOffset){// Get Axis Length\nvar axisExtent=model.axis.getExtent();var axisLength=axisExtent[1]-axisExtent[0];// Get bars on current base axis and calculate min and max overflow\nvar barsOnCurrentAxis=retrieveColumnLayout(barWidthAndOffset,model.axis);if(barsOnCurrentAxis===undefined){return{min:min,max:max};}var minOverflow=Infinity;each$1(barsOnCurrentAxis,function(item){minOverflow=Math.min(item.offset,minOverflow);});var maxOverflow=-Infinity;each$1(barsOnCurrentAxis,function(item){maxOverflow=Math.max(item.offset+item.width,maxOverflow);});minOverflow=Math.abs(minOverflow);maxOverflow=Math.abs(maxOverflow);var totalOverFlow=minOverflow+maxOverflow;// Calulate required buffer based on old range and overflow\nvar oldRange=max-min;var oldRangePercentOfNew=1-(minOverflow+maxOverflow)/axisLength;var overflowBuffer=oldRange/oldRangePercentOfNew-oldRange;max+=overflowBuffer*(maxOverflow/totalOverFlow);min-=overflowBuffer*(minOverflow/totalOverFlow);return{min:min,max:max};}function niceScaleExtent(scale,model){var extentInfo=getScaleExtent(scale,model);var extent=extentInfo.extent;var splitNumber=model.get('splitNumber');if(scale.type==='log'){scale.base=model.get('logBase');}var scaleType=scale.type;scale.setExtent(extent[0],extent[1]);scale.niceExtent({splitNumber:splitNumber,fixMin:extentInfo.fixMin,fixMax:extentInfo.fixMax,minInterval:scaleType==='interval'||scaleType==='time'?model.get('minInterval'):null,maxInterval:scaleType==='interval'||scaleType==='time'?model.get('maxInterval'):null});// If some one specified the min, max. And the default calculated interval\n// is not good enough. He can specify the interval. It is often appeared\n// in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n// to be 60.\n// FIXME\nvar interval=model.get('interval');if(interval!=null){scale.setInterval&&scale.setInterval(interval);}}/**\n * @param {module:echarts/model/Model} model\n * @param {string} [axisType] Default retrieve from model.type\n * @return {module:echarts/scale/*}\n */function createScaleByModel(model,axisType){axisType=axisType||model.get('type');if(axisType){switch(axisType){// Buildin scale\ncase'category':return new OrdinalScale(model.getOrdinalMeta?model.getOrdinalMeta():model.getCategories(),[Infinity,-Infinity]);case'value':return new IntervalScale();// Extended scale, like time and log\ndefault:return(Scale.getClass(axisType)||IntervalScale).create(model);}}}/**\n * Check if the axis corss 0\n */function ifAxisCrossZero(axis){var dataExtent=axis.scale.getExtent();var min=dataExtent[0];var max=dataExtent[1];return!(min>0&&max>0||min<0&&max<0);}/**\n * @param {module:echarts/coord/Axis} axis\n * @return {Function} Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not requied.\n * return: {string} label string.\n */function makeLabelFormatter(axis){var labelFormatter=axis.getLabelModel().get('formatter');var categoryTickStart=axis.type==='category'?axis.scale.getExtent()[0]:null;if(typeof labelFormatter==='string'){labelFormatter=function(tpl){return function(val){// For category axis, get raw value; for numeric axis,\n// get foramtted label like '1,333,444'.\nval=axis.scale.getLabel(val);return tpl.replace('{value}',val!=null?val:'');};}(labelFormatter);// Consider empty array\nreturn labelFormatter;}else if(typeof labelFormatter==='function'){return function(tickValue,idx){// The original intention of `idx` is \"the index of the tick in all ticks\".\n// But the previous implementation of category axis do not consider the\n// `axisLabel.interval`, which cause that, for example, the `interval` is\n// `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n// corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n// the definition here for back compatibility.\nif(categoryTickStart!=null){idx=tickValue-categoryTickStart;}return labelFormatter(getAxisRawValue(axis,tickValue),idx);};}else{return function(tick){return axis.scale.getLabel(tick);};}}function getAxisRawValue(axis,value){// In category axis with data zoom, tick is not the original\n// index of axis.data. So tick should not be exposed to user\n// in category axis.\nreturn axis.type==='category'?axis.scale.getLabel(value):value;}/**\n * @param {module:echarts/coord/Axis} axis\n * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels.\n */function estimateLabelUnionRect(axis){var axisModel=axis.model;var scale=axis.scale;if(!axisModel.get('axisLabel.show')||scale.isBlank()){return;}var isCategory=axis.type==='category';var realNumberScaleTicks;var tickCount;var categoryScaleExtent=scale.getExtent();// Optimize for large category data, avoid call `getTicks()`.\nif(isCategory){tickCount=scale.count();}else{realNumberScaleTicks=scale.getTicks();tickCount=realNumberScaleTicks.length;}var axisLabelModel=axis.getLabelModel();var labelFormatter=makeLabelFormatter(axis);var rect;var step=1;// Simple optimization for large amount of labels\nif(tickCount>40){step=Math.ceil(tickCount/40);}for(var i=0;i}\n */var symbolCtors={line:Line,rect:Rect,roundRect:Rect,square:Rect,circle:Circle,diamond:Diamond,pin:Pin,arrow:Arrow,triangle:Triangle};var symbolShapeMakers={line:function line(x,y,w,h,shape){// FIXME\nshape.x1=x;shape.y1=y+h/2;shape.x2=x+w;shape.y2=y+h/2;},rect:function rect(x,y,w,h,shape){shape.x=x;shape.y=y;shape.width=w;shape.height=h;},roundRect:function roundRect(x,y,w,h,shape){shape.x=x;shape.y=y;shape.width=w;shape.height=h;shape.r=Math.min(w,h)/4;},square:function square(x,y,w,h,shape){var size=Math.min(w,h);shape.x=x;shape.y=y;shape.width=size;shape.height=size;},circle:function circle(x,y,w,h,shape){// Put circle in the center of square\nshape.cx=x+w/2;shape.cy=y+h/2;shape.r=Math.min(w,h)/2;},diamond:function diamond(x,y,w,h,shape){shape.cx=x+w/2;shape.cy=y+h/2;shape.width=w;shape.height=h;},pin:function pin(x,y,w,h,shape){shape.x=x+w/2;shape.y=y+h/2;shape.width=w;shape.height=h;},arrow:function arrow(x,y,w,h,shape){shape.x=x+w/2;shape.y=y+h/2;shape.width=w;shape.height=h;},triangle:function triangle(x,y,w,h,shape){shape.cx=x+w/2;shape.cy=y+h/2;shape.width=w;shape.height=h;}};var symbolBuildProxies={};each$1(symbolCtors,function(Ctor,name){symbolBuildProxies[name]=new Ctor();});var SymbolClz=extendShape({type:'symbol',shape:{symbolType:'',x:0,y:0,width:0,height:0},calculateTextPosition:function calculateTextPosition(out,style,rect){var res=_calculateTextPosition(out,style,rect);var shape=this.shape;if(shape&&shape.symbolType==='pin'&&style.textPosition==='inside'){res.y=rect.y+rect.height*0.4;}return res;},buildPath:function buildPath(ctx,shape,inBundle){var symbolType=shape.symbolType;if(symbolType!=='none'){var proxySymbol=symbolBuildProxies[symbolType];if(!proxySymbol){// Default rect\nsymbolType='rect';proxySymbol=symbolBuildProxies[symbolType];}symbolShapeMakers[symbolType](shape.x,shape.y,shape.width,shape.height,proxySymbol.shape);proxySymbol.buildPath(ctx,proxySymbol.shape,inBundle);}}});// Provide setColor helper method to avoid determine if set the fill or stroke outside\nfunction symbolPathSetColor(color,innerColor){if(this.type!=='image'){var symbolStyle=this.style;var symbolShape=this.shape;if(symbolShape&&symbolShape.symbolType==='line'){symbolStyle.stroke=color;}else if(this.__isEmptyBrush){symbolStyle.stroke=color;symbolStyle.fill=innerColor||'#fff';}else{// FIXME 判断图形默认是填充还是描边,使用 onlyStroke ?\nsymbolStyle.fill&&(symbolStyle.fill=color);symbolStyle.stroke&&(symbolStyle.stroke=color);}this.dirty(false);}}/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolType\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h,\n * for path and image only.\n */function createSymbol(symbolType,x,y,w,h,color,keepAspect){// TODO Support image object, DynamicImage.\nvar isEmpty=symbolType.indexOf('empty')===0;if(isEmpty){symbolType=symbolType.substr(5,1).toLowerCase()+symbolType.substr(6);}var symbolPath;if(symbolType.indexOf('image://')===0){symbolPath=makeImage(symbolType.slice(8),new BoundingRect(x,y,w,h),keepAspect?'center':'cover');}else if(symbolType.indexOf('path://')===0){symbolPath=makePath(symbolType.slice(7),{},new BoundingRect(x,y,w,h),keepAspect?'center':'cover');}else{symbolPath=new SymbolClz({shape:{symbolType:symbolType,x:x,y:y,width:w,height:h}});}symbolPath.__isEmptyBrush=isEmpty;symbolPath.setColor=symbolPathSetColor;symbolPath.setColor(color);return symbolPath;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge';\n/**\n * Create a muti dimension List structure from seriesModel.\n * @param {module:echarts/model/Model} seriesModel\n * @return {module:echarts/data/List} list\n */function createList(seriesModel){return createListFromArray(seriesModel.getSource(),seriesModel);}var dataStack$1={isDimensionStacked:isDimensionStacked,enableDataStack:enableDataStack,getStackedDimension:getStackedDimension};/**\n * Create scale\n * @param {Array.} dataExtent\n * @param {Object|module:echarts/Model} option\n */function createScale(dataExtent,option){var axisModel=option;if(!Model.isInstance(option)){axisModel=new Model(option);mixin(axisModel,axisModelCommonMixin);}var scale=createScaleByModel(axisModel);scale.setExtent(dataExtent[0],dataExtent[1]);niceScaleExtent(scale,axisModel);return scale;}/**\n * Mixin common methods to axis model,\n *\n * Inlcude methods\n * `getFormattedLabels() => Array.`\n * `getCategories() => Array.`\n * `getMin(origin: boolean) => number`\n * `getMax(origin: boolean) => number`\n * `getNeedCrossZero() => boolean`\n * `setRange(start: number, end: number)`\n * `resetRange()`\n */function mixinAxisModelCommonMethods(Model$$1){mixin(Model$$1,axisModelCommonMixin);}var helper=(Object.freeze||Object)({createList:createList,getLayoutRect:getLayoutRect,dataStack:dataStack$1,createScale:createScale,mixinAxisModelCommonMethods:mixinAxisModelCommonMethods,completeDimensions:completeDimensions,createDimensions:createDimensions,createSymbol:createSymbol});var EPSILON$3=1e-8;function isAroundEqual$1(a,b){return Math.abs(a-b)} cp\n */function Region(name,geometries,cp){/**\n * @type {string}\n * @readOnly\n */this.name=name;/**\n * @type {Array.}\n * @readOnly\n */this.geometries=geometries;if(!cp){var rect=this.getBoundingRect();cp=[rect.x+rect.width/2,rect.y+rect.height/2];}else{cp=[cp[0],cp[1]];}/**\n * @type {Array.}\n */this.center=cp;}Region.prototype={constructor:Region,properties:null,/**\n * @return {module:zrender/core/BoundingRect}\n */getBoundingRect:function getBoundingRect(){var rect=this._rect;if(rect){return rect;}var MAX_NUMBER=Number.MAX_VALUE;var min$$1=[MAX_NUMBER,MAX_NUMBER];var max$$1=[-MAX_NUMBER,-MAX_NUMBER];var min2=[];var max2=[];var geometries=this.geometries;for(var i=0;i} coord\n * @return {boolean}\n */contain:function contain(coord){var rect=this.getBoundingRect();var geometries=this.geometries;if(!rect.contain(coord[0],coord[1])){return false;}loopGeo:for(var i=0,len$$1=geometries.length;i>1^-(x&1);y=y>>1^-(y&1);// Delta deocding\nx+=prevX;y+=prevY;prevX=x;prevY=y;// Dequantize\nresult.push([x/encodeScale,y/encodeScale]);}return result;}/**\n * @alias module:echarts/coord/geo/parseGeoJson\n * @param {Object} geoJson\n * @param {string} nameProperty\n * @return {module:zrender/container/Group}\n */var parseGeoJSON=function parseGeoJSON(geoJson,nameProperty){decode(geoJson);return map(filter(geoJson.features,function(featureObj){// Output of mapshaper may have geometry null\nreturn featureObj.geometry&&featureObj.properties&&featureObj.geometry.coordinates.length>0;}),function(featureObj){var properties=featureObj.properties;var geo=featureObj.geometry;var coordinates=geo.coordinates;var geometries=[];if(geo.type==='Polygon'){geometries.push({type:'polygon',// According to the GeoJSON specification.\n// First must be exterior, and the rest are all interior(holes).\nexterior:coordinates[0],interiors:coordinates.slice(1)});}if(geo.type==='MultiPolygon'){each$1(coordinates,function(item){if(item[0]){geometries.push({type:'polygon',exterior:item[0],interiors:item.slice(1)});}});}var region=new Region(properties[nameProperty||'name'],geometries,properties.cp);region.properties=properties;return region;});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var inner$6=makeInner();/**\n * @param {module:echats/coord/Axis} axis\n * @return {Object} {\n * labels: [{\n * formattedLabel: string,\n * rawLabel: string,\n * tickValue: number\n * }, ...],\n * labelCategoryInterval: number\n * }\n */function createAxisLabels(axis){// Only ordinal scale support tick interval\nreturn axis.type==='category'?makeCategoryLabels(axis):makeRealNumberLabels(axis);}/**\n * @param {module:echats/coord/Axis} axis\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\n * @return {Object} {\n * ticks: Array.\n * tickCategoryInterval: number\n * }\n */function createAxisTicks(axis,tickModel){// Only ordinal scale support tick interval\nreturn axis.type==='category'?makeCategoryTicks(axis,tickModel):{ticks:axis.scale.getTicks()};}function makeCategoryLabels(axis){var labelModel=axis.getLabelModel();var result=makeCategoryLabelsActually(axis,labelModel);return!labelModel.get('show')||axis.scale.isBlank()?{labels:[],labelCategoryInterval:result.labelCategoryInterval}:result;}function makeCategoryLabelsActually(axis,labelModel){var labelsCache=getListCache(axis,'labels');var optionLabelInterval=getOptionCategoryInterval(labelModel);var result=listCacheGet(labelsCache,optionLabelInterval);if(result){return result;}var labels;var numericLabelInterval;if(isFunction$1(optionLabelInterval)){labels=makeLabelsByCustomizedCategoryInterval(axis,optionLabelInterval);}else{numericLabelInterval=optionLabelInterval==='auto'?makeAutoCategoryInterval(axis):optionLabelInterval;labels=makeLabelsByNumericCategoryInterval(axis,numericLabelInterval);}// Cache to avoid calling interval function repeatly.\nreturn listCacheSet(labelsCache,optionLabelInterval,{labels:labels,labelCategoryInterval:numericLabelInterval});}function makeCategoryTicks(axis,tickModel){var ticksCache=getListCache(axis,'ticks');var optionTickInterval=getOptionCategoryInterval(tickModel);var result=listCacheGet(ticksCache,optionTickInterval);if(result){return result;}var ticks;var tickCategoryInterval;// Optimize for the case that large category data and no label displayed,\n// we should not return all ticks.\nif(!tickModel.get('show')||axis.scale.isBlank()){ticks=[];}if(isFunction$1(optionTickInterval)){ticks=makeLabelsByCustomizedCategoryInterval(axis,optionTickInterval,true);}// Always use label interval by default despite label show. Consider this\n// scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n// labels. `splitLine` and `axisTick` should be consistent in this case.\nelse if(optionTickInterval==='auto'){var labelsResult=makeCategoryLabelsActually(axis,axis.getLabelModel());tickCategoryInterval=labelsResult.labelCategoryInterval;ticks=map(labelsResult.labels,function(labelItem){return labelItem.tickValue;});}else{tickCategoryInterval=optionTickInterval;ticks=makeLabelsByNumericCategoryInterval(axis,tickCategoryInterval,true);}// Cache to avoid calling interval function repeatly.\nreturn listCacheSet(ticksCache,optionTickInterval,{ticks:ticks,tickCategoryInterval:tickCategoryInterval});}function makeRealNumberLabels(axis){var ticks=axis.scale.getTicks();var labelFormatter=makeLabelFormatter(axis);return{labels:map(ticks,function(tickValue,idx){return{formattedLabel:labelFormatter(tickValue,idx),rawLabel:axis.scale.getLabel(tickValue),tickValue:tickValue};})};}// Large category data calculation is performence sensitive, and ticks and label\n// probably be fetched by multiple times. So we cache the result.\n// axis is created each time during a ec process, so we do not need to clear cache.\nfunction getListCache(axis,prop){// Because key can be funciton, and cache size always be small, we use array cache.\nreturn inner$6(axis)[prop]||(inner$6(axis)[prop]=[]);}function listCacheGet(cache,key){for(var i=0;i40){step=Math.max(1,Math.floor(tickCount/40));}var tickValue=ordinalExtent[0];var unitSpan=axis.dataToCoord(tickValue+1)-axis.dataToCoord(tickValue);var unitW=Math.abs(unitSpan*Math.cos(rotation));var unitH=Math.abs(unitSpan*Math.sin(rotation));var maxW=0;var maxH=0;// Caution: Performance sensitive for large category data.\n// Consider dataZoom, we should make appropriate step to avoid O(n) loop.\nfor(;tickValue<=ordinalExtent[1];tickValue+=step){var width=0;var height=0;// Not precise, do not consider align and vertical align\n// and each distance from axis line yet.\nvar rect=_getBoundingRect(labelFormatter(tickValue),params.font,'center','top');// Magic number\nwidth=rect.width*1.3;height=rect.height*1.3;// Min size, void long loop.\nmaxW=Math.max(maxW,width,7);maxH=Math.max(maxH,height,7);}var dw=maxW/unitW;var dh=maxH/unitH;// 0/0 is NaN, 1/0 is Infinity.\nisNaN(dw)&&(dw=Infinity);isNaN(dh)&&(dh=Infinity);var interval=Math.max(0,Math.floor(Math.min(dw,dh)));var cache=inner$6(axis.model);var axisExtent=axis.getExtent();var lastAutoInterval=cache.lastAutoInterval;var lastTickCount=cache.lastTickCount;// Use cache to keep interval stable while moving zoom window,\n// otherwise the calculated interval might jitter when the zoom\n// window size is close to the interval-changing size.\n// For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n// The jitter will cause that sometimes the displayed labels are\n// `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\nif(lastAutoInterval!=null&&lastTickCount!=null&&Math.abs(lastAutoInterval-interval)<=1&&Math.abs(lastTickCount-tickCount)<=1// Always choose the bigger one, otherwise the critical\n// point is not the same when zooming in or zooming out.\n&&lastAutoInterval>interval// If the axis change is caused by chart resize, the cache should not\n// be used. Otherwise some hiden labels might not be shown again.\n&&cache.axisExtend0===axisExtent[0]&&cache.axisExtend1===axisExtent[1]){interval=lastAutoInterval;}// Only update cache if cache not used, otherwise the\n// changing of interval is too insensitive.\nelse{cache.lastTickCount=tickCount;cache.lastAutoInterval=interval;cache.axisExtend0=axisExtent[0];cache.axisExtend1=axisExtent[1];}return interval;}function fetchAutoCategoryIntervalCalculationParams(axis){var labelModel=axis.getLabelModel();return{axisRotate:axis.getRotate?axis.getRotate():axis.isHorizontal&&!axis.isHorizontal()?90:0,labelRotate:labelModel.get('rotate')||0,font:labelModel.getFont()};}function makeLabelsByNumericCategoryInterval(axis,categoryInterval,onlyTick){var labelFormatter=makeLabelFormatter(axis);var ordinalScale=axis.scale;var ordinalExtent=ordinalScale.getExtent();var labelModel=axis.getLabelModel();var result=[];// TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\nvar step=Math.max((categoryInterval||0)+1,1);var startTick=ordinalExtent[0];var tickCount=ordinalScale.count();// Calculate start tick based on zero if possible to keep label consistent\n// while zooming and moving while interval > 0. Otherwise the selection\n// of displayable ticks and symbols probably keep changing.\n// 3 is empirical value.\nif(startTick!==0&&step>1&&tickCount/step>2){startTick=Math.round(Math.ceil(startTick/step)*step);}// (1) Only add min max label here but leave overlap checking\n// to render stage, which also ensure the returned list\n// suitable for splitLine and splitArea rendering.\n// (2) Scales except category always contain min max label so\n// do not need to perform this process.\nvar showAllLabel=shouldShowAllLabels(axis);var includeMinLabel=labelModel.get('showMinLabel')||showAllLabel;var includeMaxLabel=labelModel.get('showMaxLabel')||showAllLabel;if(includeMinLabel&&startTick!==ordinalExtent[0]){addItem(ordinalExtent[0]);}// Optimize: avoid generating large array by `ordinalScale.getTicks()`.\nvar tickValue=startTick;for(;tickValue<=ordinalExtent[1];tickValue+=step){addItem(tickValue);}if(includeMaxLabel&&tickValue-step!==ordinalExtent[1]){addItem(ordinalExtent[1]);}function addItem(tVal){result.push(onlyTick?tVal:{formattedLabel:labelFormatter(tVal),rawLabel:ordinalScale.getLabel(tVal),tickValue:tVal});}return result;}// When interval is function, the result `false` means ignore the tick.\n// It is time consuming for large category data.\nfunction makeLabelsByCustomizedCategoryInterval(axis,categoryInterval,onlyTick){var ordinalScale=axis.scale;var labelFormatter=makeLabelFormatter(axis);var result=[];each$1(ordinalScale.getTicks(),function(tickValue){var rawLabel=ordinalScale.getLabel(tickValue);if(categoryInterval(tickValue,rawLabel)){result.push(onlyTick?tickValue:{formattedLabel:labelFormatter(tickValue),rawLabel:rawLabel,tickValue:tickValue});}});return result;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var NORMALIZED_EXTENT=[0,1];/**\n * Base class of Axis.\n * @constructor\n */var Axis=function Axis(dim,scale,extent){/**\n * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'.\n * @type {string}\n */this.dim=dim;/**\n * Axis scale\n * @type {module:echarts/coord/scale/*}\n */this.scale=scale;/**\n * @type {Array.}\n * @private\n */this._extent=extent||[0,0];/**\n * @type {boolean}\n */this.inverse=false;/**\n * Usually true when axis has a ordinal scale\n * @type {boolean}\n */this.onBand=false;};Axis.prototype={constructor:Axis,/**\n * If axis extent contain given coord\n * @param {number} coord\n * @return {boolean}\n */contain:function contain(coord){var extent=this._extent;var min=Math.min(extent[0],extent[1]);var max=Math.max(extent[0],extent[1]);return coord>=min&&coord<=max;},/**\n * If axis extent contain given data\n * @param {number} data\n * @return {boolean}\n */containData:function containData(data){return this.scale.contain(data);},/**\n * Get coord extent.\n * @return {Array.}\n */getExtent:function getExtent(){return this._extent.slice();},/**\n * Get precision used for formatting\n * @param {Array.} [dataExtent]\n * @return {number}\n */getPixelPrecision:function getPixelPrecision(dataExtent){return _getPixelPrecision(dataExtent||this.scale.getExtent(),this._extent);},/**\n * Set coord extent\n * @param {number} start\n * @param {number} end\n */setExtent:function setExtent(start,end){var extent=this._extent;extent[0]=start;extent[1]=end;},/**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n * @param {number} data\n * @param {boolean} clamp\n * @return {number}\n */dataToCoord:function dataToCoord(data,clamp){var extent=this._extent;var scale=this.scale;data=scale.normalize(data);if(this.onBand&&scale.type==='ordinal'){extent=extent.slice();fixExtentWithBands(extent,scale.count());}return linearMap(data,NORMALIZED_EXTENT,extent,clamp);},/**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n * @param {number} coord\n * @param {boolean} clamp\n * @return {number}\n */coordToData:function coordToData(coord,clamp){var extent=this._extent;var scale=this.scale;if(this.onBand&&scale.type==='ordinal'){extent=extent.slice();fixExtentWithBands(extent,scale.count());}var t=linearMap(coord,extent,NORMALIZED_EXTENT,clamp);return this.scale.scale(t);},/**\n * Convert pixel point to data in axis\n * @param {Array.} point\n * @param {boolean} clamp\n * @return {number} data\n */pointToData:function pointToData(point,clamp){// Should be implemented in derived class if necessary.\n},/**\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n * `axis.getTicksCoords` considers `onBand`, which is used by\n * `boundaryGap:true` of category axis and splitLine and splitArea.\n * @param {Object} [opt]\n * @param {Model} [opt.tickModel=axis.model.getModel('axisTick')]\n * @param {boolean} [opt.clamp] If `true`, the first and the last\n * tick must be at the axis end points. Otherwise, clip ticks\n * that outside the axis extent.\n * @return {Array.} [{\n * coord: ...,\n * tickValue: ...\n * }, ...]\n */getTicksCoords:function getTicksCoords(opt){opt=opt||{};var tickModel=opt.tickModel||this.getTickModel();var result=createAxisTicks(this,tickModel);var ticks=result.ticks;var ticksCoords=map(ticks,function(tickValue){return{coord:this.dataToCoord(tickValue),tickValue:tickValue};},this);var alignWithLabel=tickModel.get('alignWithLabel');fixOnBandTicksCoords(this,ticksCoords,alignWithLabel,opt.clamp);return ticksCoords;},/**\n * @return {Array.>} [{ coord: ..., tickValue: ...}]\n */getMinorTicksCoords:function getMinorTicksCoords(){if(this.scale.type==='ordinal'){// Category axis doesn't support minor ticks\nreturn[];}var minorTickModel=this.model.getModel('minorTick');var splitNumber=minorTickModel.get('splitNumber');// Protection.\nif(!(splitNumber>0&&splitNumber<100)){splitNumber=5;}var minorTicks=this.scale.getMinorTicks(splitNumber);var minorTicksCoords=map(minorTicks,function(minorTicksGroup){return map(minorTicksGroup,function(minorTick){return{coord:this.dataToCoord(minorTick),tickValue:minorTick};},this);},this);return minorTicksCoords;},/**\n * @return {Array.} [{\n * formattedLabel: string,\n * rawLabel: axis.scale.getLabel(tickValue)\n * tickValue: number\n * }, ...]\n */getViewLabels:function getViewLabels(){return createAxisLabels(this).labels;},/**\n * @return {module:echarts/coord/model/Model}\n */getLabelModel:function getLabelModel(){return this.model.getModel('axisLabel');},/**\n * Notice here we only get the default tick model. For splitLine\n * or splitArea, we should pass the splitLineModel or splitAreaModel\n * manually when calling `getTicksCoords`.\n * In GL, this method may be overrided to:\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n * @return {module:echarts/coord/model/Model}\n */getTickModel:function getTickModel(){return this.model.getModel('axisTick');},/**\n * Get width of band\n * @return {number}\n */getBandWidth:function getBandWidth(){var axisExtent=this._extent;var dataExtent=this.scale.getExtent();var len=dataExtent[1]-dataExtent[0]+(this.onBand?1:0);// Fix #2728, avoid NaN when only one data.\nlen===0&&(len=1);var size=Math.abs(axisExtent[1]-axisExtent[0]);return Math.abs(size)/len;},/**\n * @abstract\n * @return {boolean} Is horizontal\n */isHorizontal:null,/**\n * @abstract\n * @return {number} Get axis rotate, by degree.\n */getRotate:null,/**\n * Only be called in category axis.\n * Can be overrided, consider other axes like in 3D.\n * @return {number} Auto interval for cateogry axis tick and label\n */calculateCategoryInterval:function calculateCategoryInterval(){return _calculateCategoryInterval(this);}};function fixExtentWithBands(extent,nTick){var size=extent[1]-extent[0];var len=nTick;var margin=size/len/2;extent[0]+=margin;extent[1]-=margin;}// If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\nfunction fixOnBandTicksCoords(axis,ticksCoords,alignWithLabel,clamp){var ticksLen=ticksCoords.length;if(!axis.onBand||alignWithLabel||!ticksLen){return;}var axisExtent=axis.getExtent();var last;var diffSize;if(ticksLen===1){ticksCoords[0].coord=axisExtent[0];last=ticksCoords[1]={coord:axisExtent[0]};}else{var crossLen=ticksCoords[ticksLen-1].tickValue-ticksCoords[0].tickValue;var shift=(ticksCoords[ticksLen-1].coord-ticksCoords[0].coord)/crossLen;each$1(ticksCoords,function(ticksItem){ticksItem.coord-=shift/2;});var dataExtent=axis.scale.getExtent();diffSize=1+dataExtent[1]-ticksCoords[ticksLen-1].tickValue;last={coord:ticksCoords[ticksLen-1].coord+shift*diffSize};ticksCoords.push(last);}var inverse=axisExtent[0]>axisExtent[1];// Handling clamp.\nif(littleThan(ticksCoords[0].coord,axisExtent[0])){clamp?ticksCoords[0].coord=axisExtent[0]:ticksCoords.shift();}if(clamp&&littleThan(axisExtent[0],ticksCoords[0].coord)){ticksCoords.unshift({coord:axisExtent[0]});}if(littleThan(axisExtent[1],last.coord)){clamp?last.coord=axisExtent[1]:ticksCoords.pop();}if(clamp&&littleThan(last.coord,axisExtent[1])){ticksCoords.push({coord:axisExtent[1]});}function littleThan(a,b){// Avoid rounding error cause calculated tick coord different with extent.\n// It may cause an extra unecessary tick added.\na=round$1(a);b=round$1(b);return inverse?a>b:a} [width, height]\n */var getSymbolSize=SymbolClz$1.getSymbolSize=function(data,idx){var symbolSize=data.getItemVisual(idx,'symbolSize');return symbolSize instanceof Array?symbolSize.slice():[+symbolSize,+symbolSize];};function getScale(symbolSize){return[symbolSize[0]/2,symbolSize[1]/2];}function driftSymbol(dx,dy){this.parent.drift(dx,dy);}symbolProto._createSymbol=function(symbolType,data,idx,symbolSize,keepAspect){// Remove paths created before\nthis.removeAll();var color=data.getItemVisual(idx,'color');// var symbolPath = createSymbol(\n// symbolType, -0.5, -0.5, 1, 1, color\n// );\n// If width/height are set too small (e.g., set to 1) on ios10\n// and macOS Sierra, a circle stroke become a rect, no matter what\n// the scale is set. So we set width/height as 2. See #4150.\nvar symbolPath=createSymbol(symbolType,-1,-1,2,2,color,keepAspect);symbolPath.attr({z2:100,culling:true,scale:getScale(symbolSize)});// Rewrite drift method\nsymbolPath.drift=driftSymbol;this._symbolType=symbolType;this.add(symbolPath);};/**\n * Stop animation\n * @param {boolean} toLastFrame\n */symbolProto.stopSymbolAnimation=function(toLastFrame){this.childAt(0).stopAnimation(toLastFrame);};/**\n * FIXME:\n * Caution: This method breaks the encapsulation of this module,\n * but it indeed brings convenience. So do not use the method\n * unless you detailedly know all the implements of `Symbol`,\n * especially animation.\n *\n * Get symbol path element.\n */symbolProto.getSymbolPath=function(){return this.childAt(0);};/**\n * Get scale(aka, current symbol size).\n * Including the change caused by animation\n */symbolProto.getScale=function(){return this.childAt(0).scale;};/**\n * Highlight symbol\n */symbolProto.highlight=function(){this.childAt(0).trigger('emphasis');};/**\n * Downplay symbol\n */symbolProto.downplay=function(){this.childAt(0).trigger('normal');};/**\n * @param {number} zlevel\n * @param {number} z\n */symbolProto.setZ=function(zlevel,z){var symbolPath=this.childAt(0);symbolPath.zlevel=zlevel;symbolPath.z=z;};symbolProto.setDraggable=function(draggable){var symbolPath=this.childAt(0);symbolPath.draggable=draggable;symbolPath.cursor=draggable?'move':symbolPath.cursor;};/**\n * Update symbol properties\n * @param {module:echarts/data/List} data\n * @param {number} idx\n * @param {Object} [seriesScope]\n * @param {Object} [seriesScope.itemStyle]\n * @param {Object} [seriesScope.hoverItemStyle]\n * @param {Object} [seriesScope.symbolRotate]\n * @param {Object} [seriesScope.symbolOffset]\n * @param {module:echarts/model/Model} [seriesScope.labelModel]\n * @param {module:echarts/model/Model} [seriesScope.hoverLabelModel]\n * @param {boolean} [seriesScope.hoverAnimation]\n * @param {Object} [seriesScope.cursorStyle]\n * @param {module:echarts/model/Model} [seriesScope.itemModel]\n * @param {string} [seriesScope.symbolInnerColor]\n * @param {Object} [seriesScope.fadeIn=false]\n */symbolProto.updateData=function(data,idx,seriesScope){this.silent=false;var symbolType=data.getItemVisual(idx,'symbol')||'circle';var seriesModel=data.hostModel;var symbolSize=getSymbolSize(data,idx);var isInit=symbolType!==this._symbolType;if(isInit){var keepAspect=data.getItemVisual(idx,'symbolKeepAspect');this._createSymbol(symbolType,data,idx,symbolSize,keepAspect);}else{var symbolPath=this.childAt(0);symbolPath.silent=false;updateProps(symbolPath,{scale:getScale(symbolSize)},seriesModel,idx);}this._updateCommon(data,idx,symbolSize,seriesScope);if(isInit){var symbolPath=this.childAt(0);var fadeIn=seriesScope&&seriesScope.fadeIn;var target={scale:symbolPath.scale.slice()};fadeIn&&(target.style={opacity:symbolPath.style.opacity});symbolPath.scale=[0,0];fadeIn&&(symbolPath.style.opacity=0);initProps(symbolPath,target,seriesModel,idx);}this._seriesModel=seriesModel;};// Update common properties\nvar normalStyleAccessPath=['itemStyle'];var emphasisStyleAccessPath=['emphasis','itemStyle'];var normalLabelAccessPath=['label'];var emphasisLabelAccessPath=['emphasis','label'];/**\n * @param {module:echarts/data/List} data\n * @param {number} idx\n * @param {Array.} symbolSize\n * @param {Object} [seriesScope]\n */symbolProto._updateCommon=function(data,idx,symbolSize,seriesScope){var symbolPath=this.childAt(0);var seriesModel=data.hostModel;var color=data.getItemVisual(idx,'color');// Reset style\nif(symbolPath.type!=='image'){symbolPath.useStyle({strokeNoScale:true});}else{symbolPath.setStyle({opacity:1,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});}var itemStyle=seriesScope&&seriesScope.itemStyle;var hoverItemStyle=seriesScope&&seriesScope.hoverItemStyle;var symbolOffset=seriesScope&&seriesScope.symbolOffset;var labelModel=seriesScope&&seriesScope.labelModel;var hoverLabelModel=seriesScope&&seriesScope.hoverLabelModel;var hoverAnimation=seriesScope&&seriesScope.hoverAnimation;var cursorStyle=seriesScope&&seriesScope.cursorStyle;if(!seriesScope||data.hasItemOption){var itemModel=seriesScope&&seriesScope.itemModel?seriesScope.itemModel:data.getItemModel(idx);// Color must be excluded.\n// Because symbol provide setColor individually to set fill and stroke\nitemStyle=itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']);hoverItemStyle=itemModel.getModel(emphasisStyleAccessPath).getItemStyle();symbolOffset=itemModel.getShallow('symbolOffset');labelModel=itemModel.getModel(normalLabelAccessPath);hoverLabelModel=itemModel.getModel(emphasisLabelAccessPath);hoverAnimation=itemModel.getShallow('hoverAnimation');cursorStyle=itemModel.getShallow('cursor');}else{hoverItemStyle=extend({},hoverItemStyle);}var elStyle=symbolPath.style;var symbolRotate=data.getItemVisual(idx,'symbolRotate');symbolPath.attr('rotation',(symbolRotate||0)*Math.PI/180||0);if(symbolOffset){symbolPath.attr('position',[parsePercent$1(symbolOffset[0],symbolSize[0]),parsePercent$1(symbolOffset[1],symbolSize[1])]);}cursorStyle&&symbolPath.attr('cursor',cursorStyle);// PENDING setColor before setStyle!!!\nsymbolPath.setColor(color,seriesScope&&seriesScope.symbolInnerColor);symbolPath.setStyle(itemStyle);var opacity=data.getItemVisual(idx,'opacity');if(opacity!=null){elStyle.opacity=opacity;}var liftZ=data.getItemVisual(idx,'liftZ');var z2Origin=symbolPath.__z2Origin;if(liftZ!=null){if(z2Origin==null){symbolPath.__z2Origin=symbolPath.z2;symbolPath.z2+=liftZ;}}else if(z2Origin!=null){symbolPath.z2=z2Origin;symbolPath.__z2Origin=null;}var useNameLabel=seriesScope&&seriesScope.useNameLabel;setLabelStyle(elStyle,hoverItemStyle,labelModel,hoverLabelModel,{labelFetcher:seriesModel,labelDataIndex:idx,defaultText:getLabelDefaultText,isRectText:true,autoColor:color});// Do not execute util needed.\nfunction getLabelDefaultText(idx,opt){return useNameLabel?data.getName(idx):getDefaultLabel(data,idx);}symbolPath.__symbolOriginalScale=getScale(symbolSize);symbolPath.hoverStyle=hoverItemStyle;symbolPath.highDownOnUpdate=hoverAnimation&&seriesModel.isAnimationEnabled()?highDownOnUpdate:null;setHoverStyle(symbolPath);};function highDownOnUpdate(fromState,toState){// Do not support this hover animation util some scenario required.\n// Animation can only be supported in hover layer when using `el.incremetal`.\nif(this.incremental||this.useHoverLayer){return;}if(toState==='emphasis'){var scale=this.__symbolOriginalScale;var ratio=scale[1]/scale[0];var emphasisOpt={scale:[Math.max(scale[0]*1.1,scale[0]+3),Math.max(scale[1]*1.1,scale[1]+3*ratio)]};// FIXME\n// modify it after support stop specified animation.\n// toState === fromState\n// ? (this.stopAnimation(), this.attr(emphasisOpt))\nthis.animateTo(emphasisOpt,400,'elasticOut');}else if(toState==='normal'){this.animateTo({scale:this.__symbolOriginalScale},400,'elasticOut');}}/**\n * @param {Function} cb\n * @param {Object} [opt]\n * @param {Object} [opt.keepLabel=true]\n */symbolProto.fadeOut=function(cb,opt){var symbolPath=this.childAt(0);// Avoid mistaken hover when fading out\nthis.silent=symbolPath.silent=true;// Not show text when animating\n!(opt&&opt.keepLabel)&&(symbolPath.style.text=null);updateProps(symbolPath,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,cb);};inherits(SymbolClz$1,Group);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @module echarts/chart/helper/SymbolDraw\n */ /**\n * @constructor\n * @alias module:echarts/chart/helper/SymbolDraw\n * @param {module:zrender/graphic/Group} [symbolCtor]\n */function SymbolDraw(symbolCtor){this.group=new Group();this._symbolCtor=symbolCtor||SymbolClz$1;}var symbolDrawProto=SymbolDraw.prototype;function symbolNeedsDraw(data,point,idx,opt){return point&&!isNaN(point[0])&&!isNaN(point[1])&&!(opt.isIgnore&&opt.isIgnore(idx))// We do not set clipShape on group, because it will cut part of\n// the symbol element shape. We use the same clip shape here as\n// the line clip.\n&&!(opt.clipShape&&!opt.clipShape.contain(point[0],point[1]))&&data.getItemVisual(idx,'symbol')!=='none';}/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n * @param {Object} [opt] Or isIgnore\n * @param {Function} [opt.isIgnore]\n * @param {Object} [opt.clipShape]\n */symbolDrawProto.updateData=function(data,opt){opt=normalizeUpdateOpt(opt);var group=this.group;var seriesModel=data.hostModel;var oldData=this._data;var SymbolCtor=this._symbolCtor;var seriesScope=makeSeriesScope(data);// There is no oldLineData only when first rendering or switching from\n// stream mode to normal mode, where previous elements should be removed.\nif(!oldData){group.removeAll();}data.diff(oldData).add(function(newIdx){var point=data.getItemLayout(newIdx);if(symbolNeedsDraw(data,point,newIdx,opt)){var symbolEl=new SymbolCtor(data,newIdx,seriesScope);symbolEl.attr('position',point);data.setItemGraphicEl(newIdx,symbolEl);group.add(symbolEl);}}).update(function(newIdx,oldIdx){var symbolEl=oldData.getItemGraphicEl(oldIdx);var point=data.getItemLayout(newIdx);if(!symbolNeedsDraw(data,point,newIdx,opt)){group.remove(symbolEl);return;}if(!symbolEl){symbolEl=new SymbolCtor(data,newIdx);symbolEl.attr('position',point);}else{symbolEl.updateData(data,newIdx,seriesScope);updateProps(symbolEl,{position:point},seriesModel);}// Add back\ngroup.add(symbolEl);data.setItemGraphicEl(newIdx,symbolEl);}).remove(function(oldIdx){var el=oldData.getItemGraphicEl(oldIdx);el&&el.fadeOut(function(){group.remove(el);});}).execute();this._data=data;};symbolDrawProto.isPersistent=function(){return true;};symbolDrawProto.updateLayout=function(){var data=this._data;if(data){// Not use animation\ndata.eachItemGraphicEl(function(el,idx){var point=data.getItemLayout(idx);el.attr('position',point);});}};symbolDrawProto.incrementalPrepareUpdate=function(data){this._seriesScope=makeSeriesScope(data);this._data=null;this.group.removeAll();};/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n * @param {Object} [opt] Or isIgnore\n * @param {Function} [opt.isIgnore]\n * @param {Object} [opt.clipShape]\n */symbolDrawProto.incrementalUpdate=function(taskParams,data,opt){opt=normalizeUpdateOpt(opt);function updateIncrementalAndHover(el){if(!el.isGroup){el.incremental=el.useHoverLayer=true;}}for(var idx=taskParams.start;idx0){valueStart=extent[0];}// Both negative\nelse if(extent[1]<0){valueStart=extent[1];}// If is one positive, and one negative, onZero shall be true\n}return valueStart;}function getStackedOnPoint(dataCoordInfo,coordSys,data,idx){var value=NaN;if(dataCoordInfo.stacked){value=data.get(data.getCalculationInfo('stackedOverDimension'),idx);}if(isNaN(value)){value=dataCoordInfo.valueStart;}var baseDataOffset=dataCoordInfo.baseDataOffset;var stackedData=[];stackedData[baseDataOffset]=data.get(dataCoordInfo.baseDim,idx);stackedData[1-baseDataOffset]=value;return coordSys.dataToPoint(stackedData);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // var arrayDiff = require('zrender/src/core/arrayDiff');\n// 'zrender/src/core/arrayDiff' has been used before, but it did\n// not do well in performance when roam with fixed dataZoom window.\n// function convertToIntId(newIdList, oldIdList) {\n// // Generate int id instead of string id.\n// // Compare string maybe slow in score function of arrDiff\n// // Assume id in idList are all unique\n// var idIndicesMap = {};\n// var idx = 0;\n// for (var i = 0; i < newIdList.length; i++) {\n// idIndicesMap[newIdList[i]] = idx;\n// newIdList[i] = idx++;\n// }\n// for (var i = 0; i < oldIdList.length; i++) {\n// var oldId = oldIdList[i];\n// // Same with newIdList\n// if (idIndicesMap[oldId]) {\n// oldIdList[i] = idIndicesMap[oldId];\n// }\n// else {\n// oldIdList[i] = idx++;\n// }\n// }\n// }\nfunction diffData(oldData,newData){var diffResult=[];newData.diff(oldData).add(function(idx){diffResult.push({cmd:'+',idx:idx});}).update(function(newIdx,oldIdx){diffResult.push({cmd:'=',idx:oldIdx,idx1:newIdx});}).remove(function(idx){diffResult.push({cmd:'-',idx:idx});}).execute();return diffResult;}var lineAnimationDiff=function lineAnimationDiff(oldData,newData,oldStackedOnPoints,newStackedOnPoints,oldCoordSys,newCoordSys,oldValueOrigin,newValueOrigin){var diff=diffData(oldData,newData);// var newIdList = newData.mapArray(newData.getId);\n// var oldIdList = oldData.mapArray(oldData.getId);\n// convertToIntId(newIdList, oldIdList);\n// // FIXME One data ?\n// diff = arrayDiff(oldIdList, newIdList);\nvar currPoints=[];var nextPoints=[];// Points for stacking base line\nvar currStackedPoints=[];var nextStackedPoints=[];var status=[];var sortedIndices=[];var rawIndices=[];var newDataOldCoordInfo=prepareDataCoordInfo(oldCoordSys,newData,oldValueOrigin);var oldDataNewCoordInfo=prepareDataCoordInfo(newCoordSys,oldData,newValueOrigin);for(var i=0;i= 0) !== (lastDiff >= 0))\n// ) {\n// return false;\n// }\n// if (!isNaN(diff) && diff !== 0) {\n// lastDiff = diff;\n// last = points[i][dim];\n// }\n// }\n// return true;\n// }\n/**\n * Draw smoothed line in monotone, in which only vertical or horizontal bezier\n * control points will be used. This should be used when points are monotone\n * either in x or y dimension.\n */function drawMono(ctx,points,start,segLen,allLen,dir,smoothMin,smoothMax,smooth,smoothMonotone,connectNulls){var prevIdx=0;var idx=start;for(var k=0;k=allLen||idx<0){break;}if(isPointNull(p)){if(connectNulls){idx+=dir;continue;}break;}if(idx===start){ctx[dir>0?'moveTo':'lineTo'](p[0],p[1]);}else{if(smooth>0){var prevP=points[prevIdx];var dim=smoothMonotone==='y'?1:0;// Length of control point to p, either in x or y, but not both\nvar ctrlLen=(p[dim]-prevP[dim])*smooth;v2Copy(cp0,prevP);cp0[dim]=prevP[dim]+ctrlLen;v2Copy(cp1,p);cp1[dim]=p[dim]-ctrlLen;ctx.bezierCurveTo(cp0[0],cp0[1],cp1[0],cp1[1],p[0],p[1]);}else{ctx.lineTo(p[0],p[1]);}}prevIdx=idx;idx+=dir;}return k;}/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */function drawNonMono(ctx,points,start,segLen,allLen,dir,smoothMin,smoothMax,smooth,smoothMonotone,connectNulls){var prevIdx=0;var idx=start;for(var k=0;k=allLen||idx<0){break;}if(isPointNull(p)){if(connectNulls){idx+=dir;continue;}break;}if(idx===start){ctx[dir>0?'moveTo':'lineTo'](p[0],p[1]);v2Copy(cp0,p);}else{if(smooth>0){var nextIdx=idx+dir;var nextP=points[nextIdx];if(connectNulls){// Find next point not null\nwhile(nextP&&isPointNull(points[nextIdx])){nextIdx+=dir;nextP=points[nextIdx];}}var ratioNextSeg=0.5;var prevP=points[prevIdx];var nextP=points[nextIdx];// Last point\nif(!nextP||isPointNull(nextP)){v2Copy(cp1,p);}else{// If next data is null in not connect case\nif(isPointNull(nextP)&&!connectNulls){nextP=p;}sub(v,nextP,prevP);var lenPrevSeg;var lenNextSeg;if(smoothMonotone==='x'||smoothMonotone==='y'){var dim=smoothMonotone==='x'?0:1;lenPrevSeg=Math.abs(p[dim]-prevP[dim]);lenNextSeg=Math.abs(p[dim]-nextP[dim]);}else{lenPrevSeg=dist(p,prevP);lenNextSeg=dist(p,nextP);}// Use ratio of seg length\nratioNextSeg=lenNextSeg/(lenNextSeg+lenPrevSeg);scaleAndAdd$1(cp1,p,v,-smooth*(1-ratioNextSeg));}// Smooth constraint\nvec2Min(cp0,cp0,smoothMax);vec2Max(cp0,cp0,smoothMin);vec2Min(cp1,cp1,smoothMax);vec2Max(cp1,cp1,smoothMin);ctx.bezierCurveTo(cp0[0],cp0[1],cp1[0],cp1[1],p[0],p[1]);// cp0 of next segment\nscaleAndAdd$1(cp0,p,v,smooth*ratioNextSeg);}else{ctx.lineTo(p[0],p[1]);}}prevIdx=idx;idx+=dir;}return k;}function getBoundingBox(points,smoothConstraint){var ptMin=[Infinity,Infinity];var ptMax=[-Infinity,-Infinity];if(smoothConstraint){for(var i=0;iptMax[0]){ptMax[0]=pt[0];}if(pt[1]>ptMax[1]){ptMax[1]=pt[1];}}}return{min:smoothConstraint?ptMin:ptMax,max:smoothConstraint?ptMax:ptMin};}var Polyline$1=Path.extend({type:'ec-polyline',shape:{points:[],smooth:0,smoothConstraint:true,smoothMonotone:null,connectNulls:false},style:{fill:null,stroke:'#000'},brush:fixClipWithShadow(Path.prototype.brush),buildPath:function buildPath(ctx,shape){var points=shape.points;var i=0;var len$$1=points.length;var result=getBoundingBox(points,shape.smoothConstraint);if(shape.connectNulls){// Must remove first and last null values avoid draw error in polygon\nfor(;len$$1>0;len$$1--){if(!isPointNull(points[len$$1-1])){break;}}for(;i0;len$$1--){if(!isPointNull(points[len$$1-1])){break;}}for(;i>} points\n */function getStackedOnPoints(coordSys,data,dataCoordInfo){if(!dataCoordInfo.valueDim){return[];}var points=[];for(var idx=0,len=data.count();idx=0;i--){var dimIndex=visualMetaList[i].dimension;var dimName=data.dimensions[dimIndex];var dimInfo=data.getDimensionInfo(dimName);coordDim=dimInfo&&dimInfo.coordDim;// Can only be x or y\nif(coordDim==='x'||coordDim==='y'){visualMeta=visualMetaList[i];break;}}if(!visualMeta){if(__DEV__){console.warn('Visual map on line style only support x or y dimension.');}return;}// If the area to be rendered is bigger than area defined by LinearGradient,\n// the canvas spec prescribes that the color of the first stop and the last\n// stop should be used. But if two stops are added at offset 0, in effect\n// browsers use the color of the second stop to render area outside\n// LinearGradient. So we can only infinitesimally extend area defined in\n// LinearGradient to render `outerColors`.\nvar axis=coordSys.getAxis(coordDim);// dataToCoor mapping may not be linear, but must be monotonic.\nvar colorStops=map(visualMeta.stops,function(stop){return{coord:axis.toGlobalCoord(axis.dataToCoord(stop.value)),color:stop.color};});var stopLen=colorStops.length;var outerColors=visualMeta.outerColors.slice();if(stopLen&&colorStops[0].coord>colorStops[stopLen-1].coord){colorStops.reverse();outerColors.reverse();}var tinyExtent=10;// Arbitrary value: 10px\nvar minCoord=colorStops[0].coord-tinyExtent;var maxCoord=colorStops[stopLen-1].coord+tinyExtent;var coordSpan=maxCoord-minCoord;if(coordSpan<1e-3){return'transparent';}each$1(colorStops,function(stop){stop.offset=(stop.coord-minCoord)/coordSpan;});colorStops.push({offset:stopLen?colorStops[stopLen-1].offset:0.5,color:outerColors[1]||'transparent'});colorStops.unshift({// notice colorStops.length have been changed.\noffset:stopLen?colorStops[0].offset:0.5,color:outerColors[0]||'transparent'});// zrUtil.each(colorStops, function (colorStop) {\n// // Make sure each offset has rounded px to avoid not sharp edge\n// colorStop.offset = (Math.round(colorStop.offset * (end - start) + start) - start) / (end - start);\n// });\nvar gradient=new LinearGradient(0,0,0,0,colorStops,true);gradient[coordDim]=minCoord;gradient[coordDim+'2']=maxCoord;return gradient;}function getIsIgnoreFunc(seriesModel,data,coordSys){var showAllSymbol=seriesModel.get('showAllSymbol');var isAuto=showAllSymbol==='auto';if(showAllSymbol&&!isAuto){return;}var categoryAxis=coordSys.getAxesByScale('ordinal')[0];if(!categoryAxis){return;}// Note that category label interval strategy might bring some weird effect\n// in some scenario: users may wonder why some of the symbols are not\n// displayed. So we show all symbols as possible as we can.\nif(isAuto// Simplify the logic, do not determine label overlap here.\n&&canShowAllSymbolForCategory(categoryAxis,data)){return;}// Otherwise follow the label interval strategy on category axis.\nvar categoryDataDim=data.mapDimension(categoryAxis.dim);var labelMap={};each$1(categoryAxis.getViewLabels(),function(labelItem){labelMap[labelItem.tickValue]=1;});return function(dataIndex){return!labelMap.hasOwnProperty(data.get(categoryDataDim,dataIndex));};}function canShowAllSymbolForCategory(categoryAxis,data){// In mose cases, line is monotonous on category axis, and the label size\n// is close with each other. So we check the symbol size and some of the\n// label size alone with the category axis to estimate whether all symbol\n// can be shown without overlap.\nvar axisExtent=categoryAxis.getExtent();var availSize=Math.abs(axisExtent[1]-axisExtent[0])/categoryAxis.scale.count();isNaN(availSize)&&(availSize=0);// 0/0 is NaN.\n// Sampling some points, max 5.\nvar dataLen=data.count();var step=Math.max(1,Math.round(dataLen/5));for(var dataIndex=0;dataIndexavailSize){return false;}}return true;}function createLineClipPath(coordSys,hasAnimation,seriesModel){if(coordSys.type==='cartesian2d'){var isHorizontal=coordSys.getBaseAxis().isHorizontal();var clipPath=createGridClipPath(coordSys,hasAnimation,seriesModel);// Expand clip shape to avoid clipping when line value exceeds axis\nif(!seriesModel.get('clip',true)){var rectShape=clipPath.shape;var expandSize=Math.max(rectShape.width,rectShape.height);if(isHorizontal){rectShape.y-=expandSize;rectShape.height+=expandSize*2;}else{rectShape.x-=expandSize;rectShape.width+=expandSize*2;}}return clipPath;}else{return createPolarClipPath(coordSys,hasAnimation,seriesModel);}}Chart.extend({type:'line',init:function init(){var lineGroup=new Group();var symbolDraw=new SymbolDraw();this.group.add(symbolDraw.group);this._symbolDraw=symbolDraw;this._lineGroup=lineGroup;},render:function render(seriesModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;var group=this.group;var data=seriesModel.getData();var lineStyleModel=seriesModel.getModel('lineStyle');var areaStyleModel=seriesModel.getModel('areaStyle');var points=data.mapArray(data.getItemLayout);var isCoordSysPolar=coordSys.type==='polar';var prevCoordSys=this._coordSys;var symbolDraw=this._symbolDraw;var polyline=this._polyline;var polygon=this._polygon;var lineGroup=this._lineGroup;var hasAnimation=seriesModel.get('animation');var isAreaChart=!areaStyleModel.isEmpty();var valueOrigin=areaStyleModel.get('origin');var dataCoordInfo=prepareDataCoordInfo(coordSys,data,valueOrigin);var stackedOnPoints=getStackedOnPoints(coordSys,data,dataCoordInfo);var showSymbol=seriesModel.get('showSymbol');var isIgnoreFunc=showSymbol&&!isCoordSysPolar&&getIsIgnoreFunc(seriesModel,data,coordSys);// Remove temporary symbols\nvar oldData=this._data;oldData&&oldData.eachItemGraphicEl(function(el,idx){if(el.__temp){group.remove(el);oldData.setItemGraphicEl(idx,null);}});// Remove previous created symbols if showSymbol changed to false\nif(!showSymbol){symbolDraw.remove();}group.add(lineGroup);// FIXME step not support polar\nvar step=!isCoordSysPolar&&seriesModel.get('step');var clipShapeForSymbol;if(coordSys&&coordSys.getArea&&seriesModel.get('clip',true)){clipShapeForSymbol=coordSys.getArea();// Avoid float number rounding error for symbol on the edge of axis extent.\n// See #7913 and `test/dataZoom-clip.html`.\nif(clipShapeForSymbol.width!=null){clipShapeForSymbol.x-=0.1;clipShapeForSymbol.y-=0.1;clipShapeForSymbol.width+=0.2;clipShapeForSymbol.height+=0.2;}else if(clipShapeForSymbol.r0){clipShapeForSymbol.r0-=0.5;clipShapeForSymbol.r1+=0.5;}}this._clipShapeForSymbol=clipShapeForSymbol;// Initialization animation or coordinate system changed\nif(!(polyline&&prevCoordSys.type===coordSys.type&&step===this._step)){showSymbol&&symbolDraw.updateData(data,{isIgnore:isIgnoreFunc,clipShape:clipShapeForSymbol});if(step){// TODO If stacked series is not step\npoints=turnPointsIntoStep(points,coordSys,step);stackedOnPoints=turnPointsIntoStep(stackedOnPoints,coordSys,step);}polyline=this._newPolyline(points,coordSys,hasAnimation);if(isAreaChart){polygon=this._newPolygon(points,stackedOnPoints,coordSys,hasAnimation);}lineGroup.setClipPath(createLineClipPath(coordSys,true,seriesModel));}else{if(isAreaChart&&!polygon){// If areaStyle is added\npolygon=this._newPolygon(points,stackedOnPoints,coordSys,hasAnimation);}else if(polygon&&!isAreaChart){// If areaStyle is removed\nlineGroup.remove(polygon);polygon=this._polygon=null;}// Update clipPath\nlineGroup.setClipPath(createLineClipPath(coordSys,false,seriesModel));// Always update, or it is wrong in the case turning on legend\n// because points are not changed\nshowSymbol&&symbolDraw.updateData(data,{isIgnore:isIgnoreFunc,clipShape:clipShapeForSymbol});// Stop symbol animation and sync with line points\n// FIXME performance?\ndata.eachItemGraphicEl(function(el){el.stopAnimation(true);});// In the case data zoom triggerred refreshing frequently\n// Data may not change if line has a category axis. So it should animate nothing\nif(!isPointsSame(this._stackedOnPoints,stackedOnPoints)||!isPointsSame(this._points,points)){if(hasAnimation){this._updateAnimation(data,stackedOnPoints,coordSys,api,step,valueOrigin);}else{// Not do it in update with animation\nif(step){// TODO If stacked series is not step\npoints=turnPointsIntoStep(points,coordSys,step);stackedOnPoints=turnPointsIntoStep(stackedOnPoints,coordSys,step);}polyline.setShape({points:points});polygon&&polygon.setShape({points:points,stackedOnPoints:stackedOnPoints});}}}var visualColor=getVisualGradient(data,coordSys)||data.getVisual('color');polyline.useStyle(defaults(// Use color in lineStyle first\nlineStyleModel.getLineStyle(),{fill:'none',stroke:visualColor,lineJoin:'bevel'}));var smooth=seriesModel.get('smooth');smooth=getSmooth(seriesModel.get('smooth'));polyline.setShape({smooth:smooth,smoothMonotone:seriesModel.get('smoothMonotone'),connectNulls:seriesModel.get('connectNulls')});if(polygon){var stackedOnSeries=data.getCalculationInfo('stackedOnSeries');var stackedOnSmooth=0;polygon.useStyle(defaults(areaStyleModel.getAreaStyle(),{fill:visualColor,opacity:0.7,lineJoin:'bevel'}));if(stackedOnSeries){stackedOnSmooth=getSmooth(stackedOnSeries.get('smooth'));}polygon.setShape({smooth:smooth,stackedOnSmooth:stackedOnSmooth,smoothMonotone:seriesModel.get('smoothMonotone'),connectNulls:seriesModel.get('connectNulls')});}this._data=data;// Save the coordinate system for transition animation when data changed\nthis._coordSys=coordSys;this._stackedOnPoints=stackedOnPoints;this._points=points;this._step=step;this._valueOrigin=valueOrigin;},dispose:function dispose(){},highlight:function highlight(seriesModel,ecModel,api,payload){var data=seriesModel.getData();var dataIndex=queryDataIndex(data,payload);if(!(dataIndex instanceof Array)&&dataIndex!=null&&dataIndex>=0){var symbol=data.getItemGraphicEl(dataIndex);if(!symbol){// Create a temporary symbol if it is not exists\nvar pt=data.getItemLayout(dataIndex);if(!pt){// Null data\nreturn;}// fix #11360: should't draw symbol outside clipShapeForSymbol\nif(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(pt[0],pt[1])){return;}symbol=new SymbolClz$1(data,dataIndex);symbol.position=pt;symbol.setZ(seriesModel.get('zlevel'),seriesModel.get('z'));symbol.ignore=isNaN(pt[0])||isNaN(pt[1]);symbol.__temp=true;data.setItemGraphicEl(dataIndex,symbol);// Stop scale animation\nsymbol.stopSymbolAnimation(true);this.group.add(symbol);}symbol.highlight();}else{// Highlight whole series\nChart.prototype.highlight.call(this,seriesModel,ecModel,api,payload);}},downplay:function downplay(seriesModel,ecModel,api,payload){var data=seriesModel.getData();var dataIndex=queryDataIndex(data,payload);if(dataIndex!=null&&dataIndex>=0){var symbol=data.getItemGraphicEl(dataIndex);if(symbol){if(symbol.__temp){data.setItemGraphicEl(dataIndex,null);this.group.remove(symbol);}else{symbol.downplay();}}}else{// FIXME\n// can not downplay completely.\n// Downplay whole series\nChart.prototype.downplay.call(this,seriesModel,ecModel,api,payload);}},/**\n * @param {module:zrender/container/Group} group\n * @param {Array.>} points\n * @private\n */_newPolyline:function _newPolyline(points){var polyline=this._polyline;// Remove previous created polyline\nif(polyline){this._lineGroup.remove(polyline);}polyline=new Polyline$1({shape:{points:points},silent:true,z2:10});this._lineGroup.add(polyline);this._polyline=polyline;return polyline;},/**\n * @param {module:zrender/container/Group} group\n * @param {Array.>} stackedOnPoints\n * @param {Array.>} points\n * @private\n */_newPolygon:function _newPolygon(points,stackedOnPoints){var polygon=this._polygon;// Remove previous created polygon\nif(polygon){this._lineGroup.remove(polygon);}polygon=new Polygon$1({shape:{points:points,stackedOnPoints:stackedOnPoints},silent:true});this._lineGroup.add(polygon);this._polygon=polygon;return polygon;},/**\n * @private\n */ // FIXME Two value axis\n_updateAnimation:function _updateAnimation(data,stackedOnPoints,coordSys,api,step,valueOrigin){var polyline=this._polyline;var polygon=this._polygon;var seriesModel=data.hostModel;var diff=lineAnimationDiff(this._data,data,this._stackedOnPoints,stackedOnPoints,this._coordSys,coordSys,this._valueOrigin,valueOrigin);var current=diff.current;var stackedOnCurrent=diff.stackedOnCurrent;var next=diff.next;var stackedOnNext=diff.stackedOnNext;if(step){// TODO If stacked series is not step\ncurrent=turnPointsIntoStep(diff.current,coordSys,step);stackedOnCurrent=turnPointsIntoStep(diff.stackedOnCurrent,coordSys,step);next=turnPointsIntoStep(diff.next,coordSys,step);stackedOnNext=turnPointsIntoStep(diff.stackedOnNext,coordSys,step);}// Don't apply animation if diff is large.\n// For better result and avoid memory explosion problems like\n// https://github.com/apache/incubator-echarts/issues/12229\nif(getBoundingDiff(current,next)>3000||polygon&&getBoundingDiff(stackedOnCurrent,stackedOnNext)>3000){polyline.setShape({points:next});if(polygon){polygon.setShape({points:next,stackedOnPoints:stackedOnNext});}return;}// `diff.current` is subset of `current` (which should be ensured by\n// turnPointsIntoStep), so points in `__points` can be updated when\n// points in `current` are update during animation.\npolyline.shape.__points=diff.current;polyline.shape.points=current;updateProps(polyline,{shape:{points:next}},seriesModel);if(polygon){polygon.setShape({points:current,stackedOnPoints:stackedOnCurrent});updateProps(polygon,{shape:{points:next,stackedOnPoints:stackedOnNext}},seriesModel);}var updatedDataInfo=[];var diffStatus=diff.status;for(var i=0;i}, not undefined to avoid if...else... statement\npoint=!isNaN(x)&&!isNaN(y)&&coordSys.dataToPoint(tmpIn,null,tmpOut);}if(isLargeRender){points[offset++]=point?point[0]:NaN;points[offset++]=point?point[1]:NaN;}else{data.setItemLayout(i,point&&point.slice()||[NaN,NaN]);}}isLargeRender&&data.setLayout('symbolPoints',points);}return dimLen&&{progress:progress};}};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var samplers={average:function average(frame){var sum=0;var count=0;for(var i=0;imax&&(max=frame[i]);}// NaN will cause illegal axis extent.\nreturn isFinite(max)?max:NaN;},min:function min(frame){var min=Infinity;for(var i=0;i1){var sampler;if(typeof sampling==='string'){sampler=samplers[sampling];}else if(typeof sampling==='function'){sampler=sampling;}if(sampler){// Only support sample the first dim mapped from value axis.\nseriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim),1/rate,sampler,indexSampler));}}}}};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Cartesian coordinate system\n * @module echarts/coord/Cartesian\n *\n */function dimAxisMapper(dim){return this._axes[dim];}/**\n * @alias module:echarts/coord/Cartesian\n * @constructor\n */var Cartesian=function Cartesian(name){this._axes={};this._dimList=[];/**\n * @type {string}\n */this.name=name||'';};Cartesian.prototype={constructor:Cartesian,type:'cartesian',/**\n * Get axis\n * @param {number|string} dim\n * @return {module:echarts/coord/Cartesian~Axis}\n */getAxis:function getAxis(dim){return this._axes[dim];},/**\n * Get axes list\n * @return {Array.}\n */getAxes:function getAxes(){return map(this._dimList,dimAxisMapper,this);},/**\n * Get axes list by given scale type\n */getAxesByScale:function getAxesByScale(scaleType){scaleType=scaleType.toLowerCase();return filter(this.getAxes(),function(axis){return axis.scale.type===scaleType;});},/**\n * Add axis\n * @param {module:echarts/coord/Cartesian.Axis}\n */addAxis:function addAxis(axis){var dim=axis.dim;this._axes[dim]=axis;this._dimList.push(dim);},/**\n * Convert data to coord in nd space\n * @param {Array.|Object.} val\n * @return {Array.|Object.}\n */dataToCoord:function dataToCoord(val){return this._dataCoordConvert(val,'dataToCoord');},/**\n * Convert coord in nd space to data\n * @param {Array.|Object.} val\n * @return {Array.|Object.}\n */coordToData:function coordToData(val){return this._dataCoordConvert(val,'coordToData');},_dataCoordConvert:function _dataCoordConvert(input,method){var dimList=this._dimList;var output=input instanceof Array?[]:{};for(var i=0;i}\n * @readOnly\n */dimensions:['x','y'],/**\n * Base axis will be used on stacking.\n *\n * @return {module:echarts/coord/cartesian/Axis2D}\n */getBaseAxis:function getBaseAxis(){return this.getAxesByScale('ordinal')[0]||this.getAxesByScale('time')[0]||this.getAxis('x');},/**\n * If contain point\n * @param {Array.} point\n * @return {boolean}\n */containPoint:function containPoint(point){var axisX=this.getAxis('x');var axisY=this.getAxis('y');return axisX.contain(axisX.toLocalCoord(point[0]))&&axisY.contain(axisY.toLocalCoord(point[1]));},/**\n * If contain data\n * @param {Array.} data\n * @return {boolean}\n */containData:function containData(data){return this.getAxis('x').containData(data[0])&&this.getAxis('y').containData(data[1]);},/**\n * @param {Array.} data\n * @param {Array.} out\n * @return {Array.}\n */dataToPoint:function dataToPoint(data,reserved,out){var xAxis=this.getAxis('x');var yAxis=this.getAxis('y');out=out||[];out[0]=xAxis.toGlobalCoord(xAxis.dataToCoord(data[0]));out[1]=yAxis.toGlobalCoord(yAxis.dataToCoord(data[1]));return out;},/**\n * @param {Array.} data\n * @param {Array.} out\n * @return {Array.}\n */clampData:function clampData(data,out){var xScale=this.getAxis('x').scale;var yScale=this.getAxis('y').scale;var xAxisExtent=xScale.getExtent();var yAxisExtent=yScale.getExtent();var x=xScale.parse(data[0]);var y=yScale.parse(data[1]);out=out||[];out[0]=Math.min(Math.max(Math.min(xAxisExtent[0],xAxisExtent[1]),x),Math.max(xAxisExtent[0],xAxisExtent[1]));out[1]=Math.min(Math.max(Math.min(yAxisExtent[0],yAxisExtent[1]),y),Math.max(yAxisExtent[0],yAxisExtent[1]));return out;},/**\n * @param {Array.} point\n * @param {Array.} out\n * @return {Array.}\n */pointToData:function pointToData(point,out){var xAxis=this.getAxis('x');var yAxis=this.getAxis('y');out=out||[];out[0]=xAxis.coordToData(xAxis.toLocalCoord(point[0]));out[1]=yAxis.coordToData(yAxis.toLocalCoord(point[1]));return out;},/**\n * Get other axis\n * @param {module:echarts/coord/cartesian/Axis2D} axis\n */getOtherAxis:function getOtherAxis(axis){return this.getAxis(axis.dim==='x'?'y':'x');},/**\n * Get rect area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n * @return {BoundingRect}\n */getArea:function getArea(){var xExtent=this.getAxis('x').getGlobalExtent();var yExtent=this.getAxis('y').getGlobalExtent();var x=Math.min(xExtent[0],xExtent[1]);var y=Math.min(yExtent[0],yExtent[1]);var width=Math.max(xExtent[0],xExtent[1])-x;var height=Math.max(yExtent[0],yExtent[1])-y;var rect=new BoundingRect(x,y,width,height);return rect;}};inherits(Cartesian2D,Cartesian);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Extend axis 2d\n * @constructor module:echarts/coord/cartesian/Axis2D\n * @extends {module:echarts/coord/cartesian/Axis}\n * @param {string} dim\n * @param {*} scale\n * @param {Array.} coordExtent\n * @param {string} axisType\n * @param {string} position\n */var Axis2D=function Axis2D(dim,scale,coordExtent,axisType,position){Axis.call(this,dim,scale,coordExtent);/**\n * Axis type\n * - 'category'\n * - 'value'\n * - 'time'\n * - 'log'\n * @type {string}\n */this.type=axisType||'value';/**\n * Axis position\n * - 'top'\n * - 'bottom'\n * - 'left'\n * - 'right'\n */this.position=position||'bottom';};Axis2D.prototype={constructor:Axis2D,/**\n * Index of axis, can be used as key\n */index:0,/**\n * Implemented in .\n * @return {Array.}\n * If not on zero of other axis, return null/undefined.\n * If no axes, return an empty array.\n */getAxesOnZeroOf:null,/**\n * Axis model\n * @param {module:echarts/coord/cartesian/AxisModel}\n */model:null,isHorizontal:function isHorizontal(){var position=this.position;return position==='top'||position==='bottom';},/**\n * Each item cooresponds to this.getExtent(), which\n * means globalExtent[0] may greater than globalExtent[1],\n * unless `asc` is input.\n *\n * @param {boolean} [asc]\n * @return {Array.}\n */getGlobalExtent:function getGlobalExtent(asc){var ret=this.getExtent();ret[0]=this.toGlobalCoord(ret[0]);ret[1]=this.toGlobalCoord(ret[1]);asc&&ret[0]>ret[1]&&ret.reverse();return ret;},getOtherAxis:function getOtherAxis(){this.grid.getOtherAxis();},/**\n * @override\n */pointToData:function pointToData(point,clamp){return this.coordToData(this.toLocalCoord(point[this.dim==='x'?0:1]),clamp);},/**\n * Transform global coord to local coord,\n * i.e. var localCoord = axis.toLocalCoord(80);\n * designate by module:echarts/coord/cartesian/Grid.\n * @type {Function}\n */toLocalCoord:null,/**\n * Transform global coord to local coord,\n * i.e. var globalCoord = axis.toLocalCoord(40);\n * designate by module:echarts/coord/cartesian/Grid.\n * @type {Function}\n */toGlobalCoord:null};inherits(Axis2D,Axis);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var defaultOption={show:true,zlevel:0,z:0,// Inverse the axis.\ninverse:false,// Axis name displayed.\nname:'',// 'start' | 'middle' | 'end'\nnameLocation:'end',// By degree. By default auto rotate by nameLocation.\nnameRotate:null,nameTruncate:{maxWidth:null,ellipsis:'...',placeholder:'.'},// Use global text style by default.\nnameTextStyle:{},// The gap between axisName and axisLine.\nnameGap:15,// Default `false` to support tooltip.\nsilent:false,// Default `false` to avoid legacy user event listener fail.\ntriggerEvent:false,tooltip:{show:false},axisPointer:{},axisLine:{show:true,onZero:true,onZeroAxisIndex:null,lineStyle:{color:'#333',width:1,type:'solid'},// The arrow at both ends the the axis.\nsymbol:['none','none'],symbolSize:[10,15]},axisTick:{show:true,// Whether axisTick is inside the grid or outside the grid.\ninside:false,// The length of axisTick.\nlength:5,lineStyle:{width:1}},axisLabel:{show:true,// Whether axisLabel is inside the grid or outside the grid.\ninside:false,rotate:0,// true | false | null/undefined (auto)\nshowMinLabel:null,// true | false | null/undefined (auto)\nshowMaxLabel:null,margin:8,// formatter: null,\nfontSize:12},splitLine:{show:true,lineStyle:{color:['#ccc'],width:1,type:'solid'}},splitArea:{show:false,areaStyle:{color:['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)']}}};var axisDefault={};axisDefault.categoryAxis=merge({// The gap at both ends of the axis. For categoryAxis, boolean.\nboundaryGap:true,// Set false to faster category collection.\n// Only usefull in the case like: category is\n// ['2012-01-01', '2012-01-02', ...], where the input\n// data has been ensured not duplicate and is large data.\n// null means \"auto\":\n// if axis.data provided, do not deduplication,\n// else do deduplication.\ndeduplication:null,// splitArea: {\n// show: false\n// },\nsplitLine:{show:false},axisTick:{// If tick is align with label when boundaryGap is true\nalignWithLabel:false,interval:'auto'},axisLabel:{interval:'auto'}},defaultOption);axisDefault.valueAxis=merge({// The gap at both ends of the axis. For value axis, [GAP, GAP], where\n// `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`)\nboundaryGap:[0,0],// TODO\n// min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n// Min value of the axis. can be:\n// + a number\n// + 'dataMin': use the min value in data.\n// + null/undefined: auto decide min value (consider pretty look and boundaryGap).\n// min: null,\n// Max value of the axis. can be:\n// + a number\n// + 'dataMax': use the max value in data.\n// + null/undefined: auto decide max value (consider pretty look and boundaryGap).\n// max: null,\n// Readonly prop, specifies start value of the range when using data zoom.\n// rangeStart: null\n// Readonly prop, specifies end value of the range when using data zoom.\n// rangeEnd: null\n// Optional value can be:\n// + `false`: always include value 0.\n// + `true`: the extent do not consider value 0.\n// scale: false,\n// AxisTick and axisLabel and splitLine are caculated based on splitNumber.\nsplitNumber:5,// Interval specifies the span of the ticks is mandatorily.\n// interval: null\n// Specify min interval when auto calculate tick interval.\n// minInterval: null\n// Specify max interval when auto calculate tick interval.\n// maxInterval: null\nminorTick:{// Minor tick, not available for cateogry axis.\nshow:false,// Split number of minor ticks. The value should be in range of (0, 100)\nsplitNumber:5,// Lenght of minor tick\nlength:3,// Same inside with axisTick\n// Line style\nlineStyle:{// Default to be same with axisTick\n}},minorSplitLine:{show:false,lineStyle:{color:'#eee',width:1}}},defaultOption);axisDefault.timeAxis=defaults({scale:true,min:'dataMin',max:'dataMax'},axisDefault.valueAxis);axisDefault.logAxis=defaults({scale:true,logBase:10},axisDefault.valueAxis);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // FIXME axisType is fixed ?\nvar AXIS_TYPES=['value','category','time','log'];/**\n * Generate sub axis model class\n * @param {string} axisName 'x' 'y' 'radius' 'angle' 'parallel'\n * @param {module:echarts/model/Component} BaseAxisModelClass\n * @param {Function} axisTypeDefaulter\n * @param {Object} [extraDefaultOption]\n */var axisModelCreator=function axisModelCreator(axisName,BaseAxisModelClass,axisTypeDefaulter,extraDefaultOption){each$1(AXIS_TYPES,function(axisType){BaseAxisModelClass.extend({/**\n * @readOnly\n */type:axisName+'Axis.'+axisType,mergeDefaultAndTheme:function mergeDefaultAndTheme(option,ecModel){var layoutMode=this.layoutMode;var inputPositionParams=layoutMode?getLayoutParams(option):{};var themeModel=ecModel.getTheme();merge(option,themeModel.get(axisType+'Axis'));merge(option,this.getDefaultOption());option.type=axisTypeDefaulter(axisName,option);if(layoutMode){mergeLayoutParam(option,inputPositionParams,layoutMode);}},/**\n * @override\n */optionUpdated:function optionUpdated(){var thisOption=this.option;if(thisOption.type==='category'){this.__ordinalMeta=OrdinalMeta.createByAxisModel(this);}},/**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */getCategories:function getCategories(rawData){var option=this.option;// FIXME\n// warning if called before all of 'getInitailData' finished.\nif(option.type==='category'){if(rawData){return option.data;}return this.__ordinalMeta.categories;}},getOrdinalMeta:function getOrdinalMeta(){return this.__ordinalMeta;},defaultOption:mergeAll([{},axisDefault[axisType+'Axis'],extraDefaultOption],true)});});ComponentModel.registerSubTypeDefaulter(axisName+'Axis',curry(axisTypeDefaulter,axisName));};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AxisModel=ComponentModel.extend({type:'cartesian2dAxis',/**\n * @type {module:echarts/coord/cartesian/Axis2D}\n */axis:null,/**\n * @override\n */init:function init(){AxisModel.superApply(this,'init',arguments);this.resetRange();},/**\n * @override\n */mergeOption:function mergeOption(){AxisModel.superApply(this,'mergeOption',arguments);this.resetRange();},/**\n * @override\n */restoreData:function restoreData(){AxisModel.superApply(this,'restoreData',arguments);this.resetRange();},/**\n * @override\n * @return {module:echarts/model/Component}\n */getCoordSysModel:function getCoordSysModel(){return this.ecModel.queryComponents({mainType:'grid',index:this.option.gridIndex,id:this.option.gridId})[0];}});function getAxisType(axisDim,option){// Default axis with data is category axis\nreturn option.type||(option.data?'category':'value');}merge(AxisModel.prototype,axisModelCommonMixin);var extraOption={// gridIndex: 0,\n// gridId: '',\n// Offset is for multiple axis on the same position\noffset:0};axisModelCreator('x',AxisModel,getAxisType,extraOption);axisModelCreator('y',AxisModel,getAxisType,extraOption);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Grid 是在有直角坐标系的时候必须要存在的\n// 所以这里也要被 Cartesian2D 依赖\nComponentModel.extend({type:'grid',dependencies:['xAxis','yAxis'],layoutMode:'box',/**\n * @type {module:echarts/coord/cartesian/Grid}\n */coordinateSystem:null,defaultOption:{show:false,zlevel:0,z:0,left:'10%',top:60,right:'10%',bottom:60,// If grid size contain label\ncontainLabel:false,// width: {totalWidth} - left - right,\n// height: {totalHeight} - top - bottom,\nbackgroundColor:'rgba(0,0,0,0)',borderWidth:1,borderColor:'#ccc'}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Grid is a region which contains at most 4 cartesian systems\n *\n * TODO Default cartesian\n */ // Depends on GridModel, AxisModel, which performs preprocess.\n/**\n * Check if the axis is used in the specified grid\n * @inner\n */function isAxisUsedInTheGrid(axisModel,gridModel,ecModel){return axisModel.getCoordSysModel()===gridModel;}function Grid(gridModel,ecModel,api){/**\n * @type {Object.}\n * @private\n */this._coordsMap={};/**\n * @type {Array.}\n * @private\n */this._coordsList=[];/**\n * @type {Object.>}\n * @private\n */this._axesMap={};/**\n * @type {Array.}\n * @private\n */this._axesList=[];this._initCartesian(gridModel,ecModel,api);this.model=gridModel;}var gridProto=Grid.prototype;gridProto.type='grid';gridProto.axisPointerEnabled=true;gridProto.getRect=function(){return this._rect;};gridProto.update=function(ecModel,api){var axesMap=this._axesMap;this._updateScale(ecModel,this.model);each$1(axesMap.x,function(xAxis){niceScaleExtent(xAxis.scale,xAxis.model);});each$1(axesMap.y,function(yAxis){niceScaleExtent(yAxis.scale,yAxis.model);});// Key: axisDim_axisIndex, value: boolean, whether onZero target.\nvar onZeroRecords={};each$1(axesMap.x,function(xAxis){fixAxisOnZero(axesMap,'y',xAxis,onZeroRecords);});each$1(axesMap.y,function(yAxis){fixAxisOnZero(axesMap,'x',yAxis,onZeroRecords);});// Resize again if containLabel is enabled\n// FIXME It may cause getting wrong grid size in data processing stage\nthis.resize(this.model,api);};function fixAxisOnZero(axesMap,otherAxisDim,axis,onZeroRecords){axis.getAxesOnZeroOf=function(){// TODO: onZero of multiple axes.\nreturn otherAxisOnZeroOf?[otherAxisOnZeroOf]:[];};// onZero can not be enabled in these two situations:\n// 1. When any other axis is a category axis.\n// 2. When no axis is cross 0 point.\nvar otherAxes=axesMap[otherAxisDim];var otherAxisOnZeroOf;var axisModel=axis.model;var onZero=axisModel.get('axisLine.onZero');var onZeroAxisIndex=axisModel.get('axisLine.onZeroAxisIndex');if(!onZero){return;}// If target axis is specified.\nif(onZeroAxisIndex!=null){if(canOnZeroToAxis(otherAxes[onZeroAxisIndex])){otherAxisOnZeroOf=otherAxes[onZeroAxisIndex];}}else{// Find the first available other axis.\nfor(var idx in otherAxes){if(otherAxes.hasOwnProperty(idx)&&canOnZeroToAxis(otherAxes[idx])// Consider that two Y axes on one value axis,\n// if both onZero, the two Y axes overlap.\n&&!onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]){otherAxisOnZeroOf=otherAxes[idx];break;}}}if(otherAxisOnZeroOf){onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)]=true;}function getOnZeroRecordKey(axis){return axis.dim+'_'+axis.index;}}function canOnZeroToAxis(axis){return axis&&axis.type!=='category'&&axis.type!=='time'&&ifAxisCrossZero(axis);}/**\n * Resize the grid\n * @param {module:echarts/coord/cartesian/GridModel} gridModel\n * @param {module:echarts/ExtensionAPI} api\n */gridProto.resize=function(gridModel,api,ignoreContainLabel){var gridRect=getLayoutRect(gridModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()});this._rect=gridRect;var axesList=this._axesList;adjustAxes();// Minus label size\nif(!ignoreContainLabel&&gridModel.get('containLabel')){each$1(axesList,function(axis){if(!axis.model.get('axisLabel.inside')){var labelUnionRect=estimateLabelUnionRect(axis);if(labelUnionRect){var dim=axis.isHorizontal()?'height':'width';var margin=axis.model.get('axisLabel.margin');gridRect[dim]-=labelUnionRect[dim]+margin;if(axis.position==='top'){gridRect.y+=labelUnionRect.height+margin;}else if(axis.position==='left'){gridRect.x+=labelUnionRect.width+margin;}}}});adjustAxes();}function adjustAxes(){each$1(axesList,function(axis){var isHorizontal=axis.isHorizontal();var extent=isHorizontal?[0,gridRect.width]:[0,gridRect.height];var idx=axis.inverse?1:0;axis.setExtent(extent[idx],extent[1-idx]);updateAxisTransform(axis,isHorizontal?gridRect.x:gridRect.y);});}};/**\n * @param {string} axisType\n * @param {number} [axisIndex]\n */gridProto.getAxis=function(axisType,axisIndex){var axesMapOnDim=this._axesMap[axisType];if(axesMapOnDim!=null){if(axisIndex==null){// Find first axis\nfor(var name in axesMapOnDim){if(axesMapOnDim.hasOwnProperty(name)){return axesMapOnDim[name];}}}return axesMapOnDim[axisIndex];}};/**\n * @return {Array.}\n */gridProto.getAxes=function(){return this._axesList.slice();};/**\n * Usage:\n * grid.getCartesian(xAxisIndex, yAxisIndex);\n * grid.getCartesian(xAxisIndex);\n * grid.getCartesian(null, yAxisIndex);\n * grid.getCartesian({xAxisIndex: ..., yAxisIndex: ...});\n *\n * @param {number|Object} [xAxisIndex]\n * @param {number} [yAxisIndex]\n */gridProto.getCartesian=function(xAxisIndex,yAxisIndex){if(xAxisIndex!=null&&yAxisIndex!=null){var key='x'+xAxisIndex+'y'+yAxisIndex;return this._coordsMap[key];}if(isObject$1(xAxisIndex)){yAxisIndex=xAxisIndex.yAxisIndex;xAxisIndex=xAxisIndex.xAxisIndex;}// When only xAxisIndex or yAxisIndex given, find its first cartesian.\nfor(var i=0,coordList=this._coordsList;i (0, 50)\n *\n * nameDirection or tickDirection or labelDirection is 1 means tick\n * or label is below the standard axis, whereas is -1 means above\n * the standard axis. labelOffset means offset between label and axis,\n * which is useful when 'onZero', where axisLabel is in the grid and\n * label in outside grid.\n *\n * Tips: like always,\n * positive rotation represents anticlockwise, and negative rotation\n * represents clockwise.\n * The direction of position coordinate is the same as the direction\n * of screen coordinate.\n *\n * Do not need to consider axis 'inverse', which is auto processed by\n * axis extent.\n *\n * @param {module:zrender/container/Group} group\n * @param {Object} axisModel\n * @param {Object} opt Standard axis parameters.\n * @param {Array.} opt.position [x, y]\n * @param {number} opt.rotation by radian\n * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle' or 'center'.\n * @param {number} [opt.tickDirection=1] 1 or -1\n * @param {number} [opt.labelDirection=1] 1 or -1\n * @param {number} [opt.labelOffset=0] Usefull when onZero.\n * @param {string} [opt.axisLabelShow] default get from axisModel.\n * @param {string} [opt.axisName] default get from axisModel.\n * @param {number} [opt.axisNameAvailableWidth]\n * @param {number} [opt.labelRotate] by degree, default get from axisModel.\n * @param {number} [opt.strokeContainThreshold] Default label interval when label\n * @param {number} [opt.nameTruncateMaxWidth]\n */var AxisBuilder=function AxisBuilder(axisModel,opt){/**\n * @readOnly\n */this.opt=opt;/**\n * @readOnly\n */this.axisModel=axisModel;// Default value\ndefaults(opt,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:true});/**\n * @readOnly\n */this.group=new Group();// FIXME Not use a seperate text group?\nvar dumbGroup=new Group({position:opt.position.slice(),rotation:opt.rotation});// this.group.add(dumbGroup);\n// this._dumbGroup = dumbGroup;\ndumbGroup.updateTransform();this._transform=dumbGroup.transform;this._dumbGroup=dumbGroup;};AxisBuilder.prototype={constructor:AxisBuilder,hasBuilder:function hasBuilder(name){return!!builders[name];},add:function add(name){builders[name].call(this);},getGroup:function getGroup(){return this.group;}};var builders={/**\n * @private\n */axisLine:function axisLine(){var opt=this.opt;var axisModel=this.axisModel;if(!axisModel.get('axisLine.show')){return;}var extent=this.axisModel.axis.getExtent();var matrix=this._transform;var pt1=[extent[0],0];var pt2=[extent[1],0];if(matrix){applyTransform(pt1,pt1,matrix);applyTransform(pt2,pt2,matrix);}var lineStyle=extend({lineCap:'round'},axisModel.getModel('axisLine.lineStyle').getLineStyle());this.group.add(new Line({// Id for animation\nanid:'line',subPixelOptimize:true,shape:{x1:pt1[0],y1:pt1[1],x2:pt2[0],y2:pt2[1]},style:lineStyle,strokeContainThreshold:opt.strokeContainThreshold||5,silent:true,z2:1}));var arrows=axisModel.get('axisLine.symbol');var arrowSize=axisModel.get('axisLine.symbolSize');var arrowOffset=axisModel.get('axisLine.symbolOffset')||0;if(typeof arrowOffset==='number'){arrowOffset=[arrowOffset,arrowOffset];}if(arrows!=null){if(typeof arrows==='string'){// Use the same arrow for start and end point\narrows=[arrows,arrows];}if(typeof arrowSize==='string'||typeof arrowSize==='number'){// Use the same size for width and height\narrowSize=[arrowSize,arrowSize];}var symbolWidth=arrowSize[0];var symbolHeight=arrowSize[1];each$1([{rotate:opt.rotation+Math.PI/2,offset:arrowOffset[0],r:0},{rotate:opt.rotation-Math.PI/2,offset:arrowOffset[1],r:Math.sqrt((pt1[0]-pt2[0])*(pt1[0]-pt2[0])+(pt1[1]-pt2[1])*(pt1[1]-pt2[1]))}],function(point,index){if(arrows[index]!=='none'&&arrows[index]!=null){var symbol=createSymbol(arrows[index],-symbolWidth/2,-symbolHeight/2,symbolWidth,symbolHeight,lineStyle.stroke,true);// Calculate arrow position with offset\nvar r=point.r+point.offset;var pos=[pt1[0]+r*Math.cos(opt.rotation),pt1[1]-r*Math.sin(opt.rotation)];symbol.attr({rotation:point.rotate,position:pos,silent:true,z2:11});this.group.add(symbol);}},this);}},/**\n * @private\n */axisTickLabel:function axisTickLabel(){var axisModel=this.axisModel;var opt=this.opt;var ticksEls=buildAxisMajorTicks(this,axisModel,opt);var labelEls=buildAxisLabel(this,axisModel,opt);fixMinMaxLabelShow(axisModel,labelEls,ticksEls);buildAxisMinorTicks(this,axisModel,opt);},/**\n * @private\n */axisName:function axisName(){var opt=this.opt;var axisModel=this.axisModel;var name=retrieve(opt.axisName,axisModel.get('name'));if(!name){return;}var nameLocation=axisModel.get('nameLocation');var nameDirection=opt.nameDirection;var textStyleModel=axisModel.getModel('nameTextStyle');var gap=axisModel.get('nameGap')||0;var extent=this.axisModel.axis.getExtent();var gapSignal=extent[0]>extent[1]?-1:1;var pos=[nameLocation==='start'?extent[0]-gapSignal*gap:nameLocation==='end'?extent[1]+gapSignal*gap:(extent[0]+extent[1])/2,// 'middle'\n// Reuse labelOffset.\nisNameLocationCenter(nameLocation)?opt.labelOffset+nameDirection*gap:0];var labelLayout;var nameRotation=axisModel.get('nameRotate');if(nameRotation!=null){nameRotation=nameRotation*PI$2/180;// To radian.\n}var axisNameAvailableWidth;if(isNameLocationCenter(nameLocation)){labelLayout=innerTextLayout(opt.rotation,nameRotation!=null?nameRotation:opt.rotation,// Adapt to axis.\nnameDirection);}else{labelLayout=endTextLayout(opt,nameLocation,nameRotation||0,extent);axisNameAvailableWidth=opt.axisNameAvailableWidth;if(axisNameAvailableWidth!=null){axisNameAvailableWidth=Math.abs(axisNameAvailableWidth/Math.sin(labelLayout.rotation));!isFinite(axisNameAvailableWidth)&&(axisNameAvailableWidth=null);}}var textFont=textStyleModel.getFont();var truncateOpt=axisModel.get('nameTruncate',true)||{};var ellipsis=truncateOpt.ellipsis;var maxWidth=retrieve(opt.nameTruncateMaxWidth,truncateOpt.maxWidth,axisNameAvailableWidth);// FIXME\n// truncate rich text? (consider performance)\nvar truncatedText=ellipsis!=null&&maxWidth!=null?truncateText$1(name,maxWidth,textFont,ellipsis,{minChar:2,placeholder:truncateOpt.placeholder}):name;var tooltipOpt=axisModel.get('tooltip',true);var mainType=axisModel.mainType;var formatterParams={componentType:mainType,name:name,$vars:['name']};formatterParams[mainType+'Index']=axisModel.componentIndex;var textEl=new Text({// Id for animation\nanid:'name',__fullText:name,__truncatedText:truncatedText,position:pos,rotation:labelLayout.rotation,silent:isLabelSilent(axisModel),z2:1,tooltip:tooltipOpt&&tooltipOpt.show?extend({content:name,formatter:function formatter(){return name;},formatterParams:formatterParams},tooltipOpt):null});setTextStyle(textEl.style,textStyleModel,{text:truncatedText,textFont:textFont,textFill:textStyleModel.getTextColor()||axisModel.get('axisLine.lineStyle.color'),textAlign:textStyleModel.get('align')||labelLayout.textAlign,textVerticalAlign:textStyleModel.get('verticalAlign')||labelLayout.textVerticalAlign});if(axisModel.get('triggerEvent')){textEl.eventData=makeAxisEventDataBase(axisModel);textEl.eventData.targetType='axisName';textEl.eventData.name=name;}// FIXME\nthis._dumbGroup.add(textEl);textEl.updateTransform();this.group.add(textEl);textEl.decomposeTransform();}};var makeAxisEventDataBase=AxisBuilder.makeAxisEventDataBase=function(axisModel){var eventData={componentType:axisModel.mainType,componentIndex:axisModel.componentIndex};eventData[axisModel.mainType+'Index']=axisModel.componentIndex;return eventData;};/**\n * @public\n * @static\n * @param {Object} opt\n * @param {number} axisRotation in radian\n * @param {number} textRotation in radian\n * @param {number} direction\n * @return {Object} {\n * rotation, // according to axis\n * textAlign,\n * textVerticalAlign\n * }\n */var innerTextLayout=AxisBuilder.innerTextLayout=function(axisRotation,textRotation,direction){var rotationDiff=remRadian(textRotation-axisRotation);var textAlign;var textVerticalAlign;if(isRadianAroundZero(rotationDiff)){// Label is parallel with axis line.\ntextVerticalAlign=direction>0?'top':'bottom';textAlign='center';}else if(isRadianAroundZero(rotationDiff-PI$2)){// Label is inverse parallel with axis line.\ntextVerticalAlign=direction>0?'bottom':'top';textAlign='center';}else{textVerticalAlign='middle';if(rotationDiff>0&&rotationDiff0?'right':'left';}else{textAlign=direction>0?'left':'right';}}return{rotation:rotationDiff,textAlign:textAlign,textVerticalAlign:textVerticalAlign};};function endTextLayout(opt,textPosition,textRotate,extent){var rotationDiff=remRadian(textRotate-opt.rotation);var textAlign;var textVerticalAlign;var inverse=extent[0]>extent[1];var onLeft=textPosition==='start'&&!inverse||textPosition!=='start'&&inverse;if(isRadianAroundZero(rotationDiff-PI$2/2)){textVerticalAlign=onLeft?'bottom':'top';textAlign='center';}else if(isRadianAroundZero(rotationDiff-PI$2*1.5)){textVerticalAlign=onLeft?'top':'bottom';textAlign='center';}else{textVerticalAlign='middle';if(rotationDiffPI$2/2){textAlign=onLeft?'left':'right';}else{textAlign=onLeft?'right':'left';}}return{rotation:rotationDiff,textAlign:textAlign,textVerticalAlign:textVerticalAlign};}var isLabelSilent=AxisBuilder.isLabelSilent=function(axisModel){var tooltipOpt=axisModel.get('tooltip');return axisModel.get('silent')// Consider mouse cursor, add these restrictions.\n||!(axisModel.get('triggerEvent')||tooltipOpt&&tooltipOpt.show);};function fixMinMaxLabelShow(axisModel,labelEls,tickEls){if(shouldShowAllLabels(axisModel.axis)){return;}// If min or max are user set, we need to check\n// If the tick on min(max) are overlap on their neighbour tick\n// If they are overlapped, we need to hide the min(max) tick label\nvar showMinLabel=axisModel.get('axisLabel.showMinLabel');var showMaxLabel=axisModel.get('axisLabel.showMaxLabel');// FIXME\n// Have not consider onBand yet, where tick els is more than label els.\nlabelEls=labelEls||[];tickEls=tickEls||[];var firstLabel=labelEls[0];var nextLabel=labelEls[1];var lastLabel=labelEls[labelEls.length-1];var prevLabel=labelEls[labelEls.length-2];var firstTick=tickEls[0];var nextTick=tickEls[1];var lastTick=tickEls[tickEls.length-1];var prevTick=tickEls[tickEls.length-2];if(showMinLabel===false){ignoreEl(firstLabel);ignoreEl(firstTick);}else if(isTwoLabelOverlapped(firstLabel,nextLabel)){if(showMinLabel){ignoreEl(nextLabel);ignoreEl(nextTick);}else{ignoreEl(firstLabel);ignoreEl(firstTick);}}if(showMaxLabel===false){ignoreEl(lastLabel);ignoreEl(lastTick);}else if(isTwoLabelOverlapped(prevLabel,lastLabel)){if(showMaxLabel){ignoreEl(prevLabel);ignoreEl(prevTick);}else{ignoreEl(lastLabel);ignoreEl(lastTick);}}}function ignoreEl(el){el&&(el.ignore=true);}function isTwoLabelOverlapped(current,next,labelLayout){// current and next has the same rotation.\nvar firstRect=current&¤t.getBoundingRect().clone();var nextRect=next&&next.getBoundingRect().clone();if(!firstRect||!nextRect){return;}// When checking intersect of two rotated labels, we use mRotationBack\n// to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\nvar mRotationBack=identity([]);rotate(mRotationBack,mRotationBack,-current.rotation);firstRect.applyTransform(mul$1([],mRotationBack,current.getLocalTransform()));nextRect.applyTransform(mul$1([],mRotationBack,next.getLocalTransform()));return firstRect.intersect(nextRect);}function isNameLocationCenter(nameLocation){return nameLocation==='middle'||nameLocation==='center';}function createTicks(ticksCoords,tickTransform,tickEndCoord,tickLineStyle,aniid){var tickEls=[];var pt1=[];var pt2=[];for(var i=0;i=0||linkPropValue===axisPropValue;}function fixValue(axisModel){var axisInfo=getAxisInfo(axisModel);if(!axisInfo){return;}var axisPointerModel=axisInfo.axisPointerModel;var scale=axisInfo.axis.scale;var option=axisPointerModel.option;var status=axisPointerModel.get('status');var value=axisPointerModel.get('value');// Parse init value for category and time axis.\nif(value!=null){value=scale.parse(value);}var useHandle=isHandleTrigger(axisPointerModel);// If `handle` used, `axisPointer` will always be displayed, so value\n// and status should be initialized.\nif(status==null){option.status=useHandle?'show':'hide';}var extent=scale.getExtent().slice();extent[0]>extent[1]&&extent.reverse();if(// Pick a value on axis when initializing.\nvalue==null// If both `handle` and `dataZoom` are used, value may be out of axis extent,\n// where we should re-pick a value to keep `handle` displaying normally.\n||value>extent[1]){// Make handle displayed on the end of the axis when init, which looks better.\nvalue=extent[1];}if(valueprogressiveThreshold){progressiveThreshold=largeThreshold;}return progressiveThreshold;},defaultOption:{// If clipped\n// Only available on cartesian2d\nclip:true,// If use caps on two sides of bars\n// Only available on tangential polar bar\nroundCap:false,showBackground:false,backgroundStyle:{color:'rgba(180, 180, 180, 0.2)',borderColor:null,borderWidth:0,borderType:'solid',borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function setLabel(normalStyle,hoverStyle,itemModel,color,seriesModel,dataIndex,labelPositionOutside){var labelModel=itemModel.getModel('label');var hoverLabelModel=itemModel.getModel('emphasis.label');setLabelStyle(normalStyle,hoverStyle,labelModel,hoverLabelModel,{labelFetcher:seriesModel,labelDataIndex:dataIndex,defaultText:getDefaultLabel(seriesModel.getData(),dataIndex),isRectText:true,autoColor:color});fixPosition(normalStyle);fixPosition(hoverStyle);}function fixPosition(style,labelPositionOutside){if(style.textPosition==='outside'){style.textPosition=labelPositionOutside;}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var _getBarItemStyle=makeStyleMapper([['fill','color'],['stroke','borderColor'],['lineWidth','borderWidth'],// Compatitable with 2\n['stroke','barBorderColor'],['lineWidth','barBorderWidth'],['opacity'],['shadowBlur'],['shadowOffsetX'],['shadowOffsetY'],['shadowColor']]);var barItemStyle={getBarItemStyle:function getBarItemStyle(excludes){var style=_getBarItemStyle(this,excludes);if(this.getBorderLineDash){var lineDash=this.getBorderLineDash();lineDash&&(style.lineDash=lineDash);}return style;}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Sausage: similar to sector, but have half circle on both sides\n * @public\n */var Sausage=extendShape({type:'sausage',shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:true},buildPath:function buildPath(ctx,shape){var x=shape.cx;var y=shape.cy;var r0=Math.max(shape.r0||0,0);var r=Math.max(shape.r,0);var dr=(r-r0)*0.5;var rCenter=r0+dr;var startAngle=shape.startAngle;var endAngle=shape.endAngle;var clockwise=shape.clockwise;var unitStartX=Math.cos(startAngle);var unitStartY=Math.sin(startAngle);var unitEndX=Math.cos(endAngle);var unitEndY=Math.sin(endAngle);var lessThanCircle=clockwise?endAngle-startAngle0?1:-1;var signY=layout.height>0?1:-1;return{x:layout.x+signX*fixedLineWidth/2,y:layout.y+signY*fixedLineWidth/2,width:layout.width-signX*fixedLineWidth,height:layout.height-signY*fixedLineWidth};},polar:function polar(data,dataIndex,itemModel){var layout=data.getItemLayout(dataIndex);return{cx:layout.cx,cy:layout.cy,r0:layout.r0,r:layout.r,startAngle:layout.startAngle,endAngle:layout.endAngle};}};function isZeroOnPolar(layout){return layout.startAngle!=null&&layout.endAngle!=null&&layout.startAngle===layout.endAngle;}function updateStyle(el,data,dataIndex,itemModel,layout,seriesModel,isHorizontal,isPolar){var color=data.getItemVisual(dataIndex,'color');var opacity=data.getItemVisual(dataIndex,'opacity');var stroke=data.getVisual('borderColor');var itemStyleModel=itemModel.getModel('itemStyle');var hoverStyle=itemModel.getModel('emphasis.itemStyle').getBarItemStyle();if(!isPolar){el.setShape('r',itemStyleModel.get('barBorderRadius')||0);}el.useStyle(defaults({stroke:isZeroOnPolar(layout)?'none':stroke,fill:isZeroOnPolar(layout)?'none':color,opacity:opacity},itemStyleModel.getBarItemStyle()));var cursorStyle=itemModel.getShallow('cursor');cursorStyle&&el.attr('cursor',cursorStyle);var labelPositionOutside=isHorizontal?layout.height>0?'bottom':'top':layout.width>0?'left':'right';if(!isPolar){setLabel(el.style,hoverStyle,itemModel,color,seriesModel,dataIndex,labelPositionOutside);}if(isZeroOnPolar(layout)){hoverStyle.fill=hoverStyle.stroke='none';}setHoverStyle(el,hoverStyle);}// In case width or height are too small.\nfunction getLineWidth(itemModel,rawLayout){var lineWidth=itemModel.get(BAR_BORDER_WIDTH_QUERY)||0;// width or height may be NaN for empty data\nvar width=isNaN(rawLayout.width)?Number.MAX_VALUE:Math.abs(rawLayout.width);var height=isNaN(rawLayout.height)?Number.MAX_VALUE:Math.abs(rawLayout.height);return Math.min(lineWidth,width,height);}var LargePath=Path.extend({type:'largeBar',shape:{points:[]},buildPath:function buildPath(ctx,shape){// Drawing lines is more efficient than drawing\n// a whole line or drawing rects.\nvar points=shape.points;var startPoint=this.__startPoint;var baseDimIdx=this.__baseDimIdx;for(var i=0;i=0?dataIndex:null;},30,false);function largePathFindDataIndex(largePath,x,y){var baseDimIdx=largePath.__baseDimIdx;var valueDimIdx=1-baseDimIdx;var points=largePath.shape.points;var largeDataIndices=largePath.__largeDataIndices;var barWidthHalf=Math.abs(largePath.__barWidth/2);var startValueVal=largePath.__startPoint[valueDimIdx];_eventPos[0]=x;_eventPos[1]=y;var pointerBaseVal=_eventPos[baseDimIdx];var pointerValueVal=_eventPos[1-baseDimIdx];var baseLowerBound=pointerBaseVal-barWidthHalf;var baseUpperBound=pointerBaseVal+barWidthHalf;for(var i=0,len=points.length/2;i=baseLowerBound&&barBaseVal<=baseUpperBound&&(startValueVal<=barValueVal?pointerValueVal>=startValueVal&&pointerValueVal<=barValueVal:pointerValueVal>=barValueVal&&pointerValueVal<=startValueVal)){return largeDataIndices[i];}}return-1;}function setLargeStyle(el,seriesModel,data){var borderColor=data.getVisual('borderColor')||data.getVisual('color');var itemStyle=seriesModel.getModel('itemStyle').getItemStyle(['color','borderColor']);el.useStyle(itemStyle);el.style.fill=null;el.style.stroke=borderColor;el.style.lineWidth=data.getLayout('barWidth');}function setLargeBackgroundStyle(el,backgroundModel,data){var borderColor=backgroundModel.get('borderColor')||backgroundModel.get('color');var itemStyle=backgroundModel.getItemStyle(['color','borderColor']);el.useStyle(itemStyle);el.style.fill=null;el.style.stroke=borderColor;el.style.lineWidth=data.getLayout('barWidth');}function createBackgroundShape(isHorizontalOrRadial,layout,coord){var coordLayout;var isPolar=coord.type==='polar';if(isPolar){coordLayout=coord.getArea();}else{coordLayout=coord.grid.getRect();}if(isPolar){return{cx:coordLayout.cx,cy:coordLayout.cy,r0:isHorizontalOrRadial?coordLayout.r0:layout.r0,r:isHorizontalOrRadial?coordLayout.r:layout.r,startAngle:isHorizontalOrRadial?layout.startAngle:0,endAngle:isHorizontalOrRadial?layout.endAngle:Math.PI*2};}else{return{x:isHorizontalOrRadial?layout.x:coordLayout.x,y:isHorizontalOrRadial?coordLayout.y:layout.y,width:isHorizontalOrRadial?layout.width:coordLayout.width,height:isHorizontalOrRadial?coordLayout.height:layout.height};}}function createBackgroundEl(coord,isHorizontalOrRadial,layout){var ElementClz=coord.type==='polar'?Sector:Rect;return new ElementClz({shape:createBackgroundShape(isHorizontalOrRadial,layout,coord),silent:true,z2:0});}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // In case developer forget to include grid component\nregisterLayout(PRIORITY.VISUAL.LAYOUT,curry(layout,'bar'));// Use higher prority to avoid to be blocked by other overall layout, which do not\n// only exist in this module, but probably also exist in other modules, like `barPolar`.\nregisterLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,largeLayout);registerVisual({seriesType:'bar',reset:function reset(seriesModel){// Visual coding for legend\nseriesModel.getData().setVisual('legendSymbol','roundRect');}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * [Usage]:\n * (1)\n * createListSimply(seriesModel, ['value']);\n * (2)\n * createListSimply(seriesModel, {\n * coordDimensions: ['value'],\n * dimensionsCount: 5\n * });\n *\n * @param {module:echarts/model/Series} seriesModel\n * @param {Object|Array.} opt opt or coordDimensions\n * The options in opt, see `echarts/data/helper/createDimensions`\n * @param {Array.} [nameList]\n * @return {module:echarts/data/List}\n */var createListSimply=function createListSimply(seriesModel,opt,nameList){opt=isArray(opt)&&{coordDimensions:opt}||extend({},opt);var source=seriesModel.getSource();var dimensionsInfo=createDimensions(source,opt);var list=new List(dimensionsInfo,seriesModel);list.initData(source,nameList);return list;};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Data selectable mixin for chart series.\n * To eanble data select, option of series must have `selectedMode`.\n * And each data item will use `selected` to toggle itself selected status\n */var dataSelectableMixin={/**\n * @param {Array.} targetList [{name, value, selected}, ...]\n * If targetList is an array, it should like [{name: ..., value: ...}, ...].\n * If targetList is a \"List\", it must have coordDim: 'value' dimension and name.\n */updateSelectedMap:function updateSelectedMap(targetList){this._targetList=isArray(targetList)?targetList.slice():[];this._selectTargetMap=reduce(targetList||[],function(targetMap,target){targetMap.set(target.name,target);return targetMap;},createHashMap());},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */ // PENGING If selectedMode is null ?\nselect:function select(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);var selectedMode=this.get('selectedMode');if(selectedMode==='single'){this._selectTargetMap.each(function(target){target.selected=false;});}target&&(target.selected=true);},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */unSelect:function unSelect(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);// var selectedMode = this.get('selectedMode');\n// selectedMode !== 'single' && target && (target.selected = false);\ntarget&&(target.selected=false);},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */toggleSelected:function toggleSelected(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);if(target!=null){this[target.selected?'unSelect':'select'](name,id);return target.selected;}},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */isSelected:function isSelected(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);return target&&target.selected;}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * LegendVisualProvider is an bridge that pick encoded color from data and\n * provide to the legend component.\n * @param {Function} getDataWithEncodedVisual Function to get data after filtered. It stores all the encoding info\n * @param {Function} getRawData Function to get raw data before filtered.\n */function LegendVisualProvider(getDataWithEncodedVisual,getRawData){this.getAllNames=function(){var rawData=getRawData();// We find the name from the raw data. In case it's filtered by the legend component.\n// Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\nreturn rawData.mapArray(rawData.getName);};this.containName=function(name){var rawData=getRawData();return rawData.indexOfName(name)>=0;};this.indexOfName=function(name){// Only get data when necessary.\n// Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n// Invoking Series#getData immediately will throw an error.\nvar dataWithEncodedVisual=getDataWithEncodedVisual();return dataWithEncodedVisual.indexOfName(name);};this.getItemVisual=function(dataIndex,key){// Get encoded visual properties from final filtered data.\nvar dataWithEncodedVisual=getDataWithEncodedVisual();return dataWithEncodedVisual.getItemVisual(dataIndex,key);};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var PieSeries=extendSeriesModel({type:'series.pie',// Overwrite\ninit:function init(option){PieSeries.superApply(this,'init',arguments);// Enable legend selection for each data item\n// Use a function instead of direct access because data reference may changed\nthis.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this));this.updateSelectedMap(this._createSelectableList());this._defaultLabelLine(option);},// Overwrite\nmergeOption:function mergeOption(newOption){PieSeries.superCall(this,'mergeOption',newOption);this.updateSelectedMap(this._createSelectableList());},getInitialData:function getInitialData(option,ecModel){return createListSimply(this,{coordDimensions:['value'],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)});},_createSelectableList:function _createSelectableList(){var data=this.getRawData();var valueDim=data.mapDimension('value');var targetList=[];for(var i=0,len=data.count();i0&&(isFirstRender?animationType!=='scale':animationTypeUpdate!=='transition')){var shape=data.getItemLayout(0);for(var s=1;isNaN(shape.startAngle)&&s=itemLayout.r0;}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var createDataSelectAction=function createDataSelectAction(seriesType,actionInfos){each$1(actionInfos,function(actionInfo){actionInfo.update='updateView';/**\n * @payload\n * @property {string} seriesName\n * @property {string} name\n */registerAction(actionInfo,function(payload,ecModel){var selected={};ecModel.eachComponent({mainType:'series',subType:seriesType,query:payload},function(seriesModel){if(seriesModel[actionInfo.method]){seriesModel[actionInfo.method](payload.name,payload.dataIndex);}var data=seriesModel.getData();// Create selected map\ndata.each(function(idx){var name=data.getName(idx);selected[name]=seriesModel.isSelected(name)||false;});});return{name:payload.name,selected:selected,seriesId:payload.seriesId};});});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nvar dataColor=function dataColor(seriesType){return{getTargetSeries:function getTargetSeries(ecModel){// Pie and funnel may use diferrent scope\nvar paletteScope={};var seiresModelMap=createHashMap();ecModel.eachSeriesByType(seriesType,function(seriesModel){seriesModel.__paletteScope=paletteScope;seiresModelMap.set(seriesModel.uid,seriesModel);});return seiresModelMap;},reset:function reset(seriesModel,ecModel){var dataAll=seriesModel.getRawData();var idxMap={};var data=seriesModel.getData();data.each(function(idx){var rawIdx=data.getRawIndex(idx);idxMap[rawIdx]=idx;});dataAll.each(function(rawIdx){var filteredIdx=idxMap[rawIdx];// If series.itemStyle.normal.color is a function. itemVisual may be encoded\nvar singleDataColor=filteredIdx!=null&&data.getItemVisual(filteredIdx,'color',true);var singleDataBorderColor=filteredIdx!=null&&data.getItemVisual(filteredIdx,'borderColor',true);var itemModel;if(!singleDataColor||!singleDataBorderColor){// FIXME Performance\nitemModel=dataAll.getItemModel(rawIdx);}if(!singleDataColor){var color=itemModel.get('itemStyle.color')||seriesModel.getColorFromPalette(dataAll.getName(rawIdx)||rawIdx+'',seriesModel.__paletteScope,dataAll.count());// Data is not filtered\nif(filteredIdx!=null){data.setItemVisual(filteredIdx,'color',color);}}if(!singleDataBorderColor){var borderColor=itemModel.get('itemStyle.borderColor');// Data is not filtered\nif(filteredIdx!=null){data.setItemVisual(filteredIdx,'borderColor',borderColor);}}});}};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // FIXME emphasis label position is not same with normal label position\nvar RADIAN$1=Math.PI/180;function adjustSingleSide(list,cx,cy,r,dir,viewWidth,viewHeight,viewLeft,viewTop,farthestX){list.sort(function(a,b){return a.y-b.y;});function shiftDown(start,end,delta,dir){for(var j=start;jviewTop+viewHeight){break;}list[j].y+=delta;if(j>start&&j+1list[j].y+list[j].height){shiftUp(j,delta/2);return;}}shiftUp(end-1,delta/2);}function shiftUp(end,delta){for(var j=end;j>=0;j--){if(list[j].y-delta0&&list[j].y>list[j-1].y+list[j-1].height){break;}}}function changeX(list,isDownList,cx,cy,r,dir){var lastDeltaX=dir>0?isDownList// right-side\n?Number.MAX_VALUE// down\n:0// up\n:isDownList// left-side\n?Number.MAX_VALUE// down\n:0;// up\nfor(var i=0,l=list.length;i=lastDeltaX){// right-down, left-down\ndeltaX=lastDeltaX-10;}if(!isDownList&&deltaX<=lastDeltaX){// right-up, left-up\ndeltaX=lastDeltaX+10;}list[i].x=cx+deltaX*dir;lastDeltaX=deltaX;}}var lastY=0;var delta;var len=list.length;var upList=[];var downList=[];for(var i=0;i=cy){downList.push(list[i]);}else{upList.push(list[i]);}}changeX(upList,false,cx,cy,r,dir);changeX(downList,true,cx,cy,r,dir);}function avoidOverlap(labelLayoutList,cx,cy,r,viewWidth,viewHeight,viewLeft,viewTop){var leftList=[];var rightList=[];var leftmostX=Number.MAX_VALUE;var rightmostX=-Number.MAX_VALUE;for(var i=0;i0?'right':'left':dx>0?'left':'right';}var labelRotate;var rotate=labelModel.get('rotate');if(typeof rotate==='number'){labelRotate=rotate*(Math.PI/180);}else{labelRotate=rotate?dx<0?-midAngle+Math.PI:-midAngle:0;}hasLabelRotate=!!labelRotate;layout.label={x:textX,y:textY,position:labelPosition,height:textRect.height,len:labelLineLen,len2:labelLineLen2,linePoints:linePoints,textAlign:textAlign,verticalAlign:'middle',rotation:labelRotate,inside:isLabelInside,labelDistance:labelDistance,labelAlignTo:labelAlignTo,labelMargin:labelMargin,bleedMargin:bleedMargin,textRect:textRect,text:text,font:font};// Not layout the inside label\nif(!isLabelInside){labelLayoutList.push(layout.label);}});if(!hasLabelRotate&&seriesModel.get('avoidLabelOverlap')){avoidOverlap(labelLayoutList,cx,cy,r,viewWidth,viewHeight,viewLeft,viewTop);}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var PI2$4=Math.PI*2;var RADIAN=Math.PI/180;function getViewRect(seriesModel,api){return getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()});}var pieLayout=function pieLayout(seriesType,ecModel,api,payload){ecModel.eachSeriesByType(seriesType,function(seriesModel){var data=seriesModel.getData();var valueDim=data.mapDimension('value');var viewRect=getViewRect(seriesModel,api);var center=seriesModel.get('center');var radius=seriesModel.get('radius');if(!isArray(radius)){radius=[0,radius];}if(!isArray(center)){center=[center,center];}var width=parsePercent$1(viewRect.width,api.getWidth());var height=parsePercent$1(viewRect.height,api.getHeight());var size=Math.min(width,height);var cx=parsePercent$1(center[0],width)+viewRect.x;var cy=parsePercent$1(center[1],height)+viewRect.y;var r0=parsePercent$1(radius[0],size/2);var r=parsePercent$1(radius[1],size/2);var startAngle=-seriesModel.get('startAngle')*RADIAN;var minAngle=seriesModel.get('minAngle')*RADIAN;var validDataCount=0;data.each(valueDim,function(value){!isNaN(value)&&validDataCount++;});var sum=data.getSum(valueDim);// Sum may be 0\nvar unitRadian=Math.PI/(sum||validDataCount)*2;var clockwise=seriesModel.get('clockwise');var roseType=seriesModel.get('roseType');var stillShowZeroSum=seriesModel.get('stillShowZeroSum');// [0...max]\nvar extent=data.getDataExtent(valueDim);extent[0]=0;// In the case some sector angle is smaller than minAngle\nvar restAngle=PI2$4;var valueSumLargerThanMinAngle=0;var currentAngle=startAngle;var dir=clockwise?1:-1;data.each(valueDim,function(value,idx){var angle;if(isNaN(value)){data.setItemLayout(idx,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:clockwise,cx:cx,cy:cy,r0:r0,r:roseType?NaN:r,viewRect:viewRect});return;}// FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\nif(roseType!=='area'){angle=sum===0&&stillShowZeroSum?unitRadian:value*unitRadian;}else{angle=PI2$4/validDataCount;}if(angle=0;idx--){var i=idx*2;var x0=points[i]-w/2;var y0=points[i+1]-h/2;if(x>=x0&&y>=y0&&x<=x0+w&&y<=y0+h){return idx;}}return-1;}});function LargeSymbolDraw(){this.group=new Group();}var largeSymbolProto=LargeSymbolDraw.prototype;largeSymbolProto.isPersistent=function(){return!this._incremental;};/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n * @param {Object} opt\n * @param {Object} [opt.clipShape]\n */largeSymbolProto.updateData=function(data,opt){this.group.removeAll();var symbolEl=new LargeSymbolPath({rectHover:true,cursor:'default'});symbolEl.setShape({points:data.getLayout('symbolPoints')});this._setCommon(symbolEl,data,false,opt);this.group.add(symbolEl);this._incremental=null;};largeSymbolProto.updateLayout=function(data){if(this._incremental){return;}var points=data.getLayout('symbolPoints');this.group.eachChild(function(child){if(child.startIndex!=null){var len=(child.endIndex-child.startIndex)*2;var byteOffset=child.startIndex*4*2;points=new Float32Array(points.buffer,byteOffset,len);}child.setShape('points',points);});};largeSymbolProto.incrementalPrepareUpdate=function(data){this.group.removeAll();this._clearIncremental();// Only use incremental displayables when data amount is larger than 2 million.\n// PENDING Incremental data?\nif(data.count()>2e6){if(!this._incremental){this._incremental=new IncrementalDisplayble({silent:true});}this.group.add(this._incremental);}else{this._incremental=null;}};largeSymbolProto.incrementalUpdate=function(taskParams,data,opt){var symbolEl;if(this._incremental){symbolEl=new LargeSymbolPath();this._incremental.addDisplayable(symbolEl,true);}else{symbolEl=new LargeSymbolPath({rectHover:true,cursor:'default',startIndex:taskParams.start,endIndex:taskParams.end});symbolEl.incremental=true;this.group.add(symbolEl);}symbolEl.setShape({points:data.getLayout('symbolPoints')});this._setCommon(symbolEl,data,!!this._incremental,opt);};largeSymbolProto._setCommon=function(symbolEl,data,isIncremental,opt){var hostModel=data.hostModel;opt=opt||{};// TODO\n// if (data.hasItemVisual.symbolSize) {\n// // TODO typed array?\n// symbolEl.setShape('sizes', data.mapArray(\n// function (idx) {\n// var size = data.getItemVisual(idx, 'symbolSize');\n// return (size instanceof Array) ? size : [size, size];\n// }\n// ));\n// }\n// else {\nvar size=data.getVisual('symbolSize');symbolEl.setShape('size',size instanceof Array?size:[size,size]);// }\nsymbolEl.softClipShape=opt.clipShape||null;// Create symbolProxy to build path for each data\nsymbolEl.symbolProxy=createSymbol(data.getVisual('symbol'),0,0,0,0);// Use symbolProxy setColor method\nsymbolEl.setColor=symbolEl.symbolProxy.setColor;var extrudeShadow=symbolEl.shape.size[0]=0){// Provide dataIndex for tooltip\nsymbolEl.dataIndex=dataIndex+(symbolEl.startIndex||0);}});}};largeSymbolProto.remove=function(){this._clearIncremental();this._incremental=null;this.group.removeAll();};largeSymbolProto._clearIncremental=function(){var incremental=this._incremental;if(incremental){incremental.clearDisplaybles();}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/extendChartView({type:'scatter',render:function render(seriesModel,ecModel,api){var data=seriesModel.getData();var symbolDraw=this._updateSymbolDraw(data,seriesModel);symbolDraw.updateData(data,{// TODO\n// If this parameter should be a shape or a bounding volume\n// shape will be more general.\n// But bounding volume like bounding rect will be much faster in the contain calculation\nclipShape:this._getClipShape(seriesModel)});this._finished=true;},incrementalPrepareRender:function incrementalPrepareRender(seriesModel,ecModel,api){var data=seriesModel.getData();var symbolDraw=this._updateSymbolDraw(data,seriesModel);symbolDraw.incrementalPrepareUpdate(data);this._finished=false;},incrementalRender:function incrementalRender(taskParams,seriesModel,ecModel){this._symbolDraw.incrementalUpdate(taskParams,seriesModel.getData(),{clipShape:this._getClipShape(seriesModel)});this._finished=taskParams.end===seriesModel.getData().count();},updateTransform:function updateTransform(seriesModel,ecModel,api){var data=seriesModel.getData();// Must mark group dirty and make sure the incremental layer will be cleared\n// PENDING\nthis.group.dirty();if(!this._finished||data.count()>1e4||!this._symbolDraw.isPersistent()){return{update:true};}else{var res=pointsLayout().reset(seriesModel);if(res.progress){res.progress({start:0,end:data.count()},data);}this._symbolDraw.updateLayout(data);}},_getClipShape:function _getClipShape(seriesModel){var coordSys=seriesModel.coordinateSystem;var clipArea=coordSys&&coordSys.getArea&&coordSys.getArea();return seriesModel.get('clip',true)?clipArea:null;},_updateSymbolDraw:function _updateSymbolDraw(data,seriesModel){var symbolDraw=this._symbolDraw;var pipelineContext=seriesModel.pipelineContext;var isLargeDraw=pipelineContext.large;if(!symbolDraw||isLargeDraw!==this._isLargeDraw){symbolDraw&&symbolDraw.remove();symbolDraw=this._symbolDraw=isLargeDraw?new LargeSymbolDraw():new SymbolDraw();this._isLargeDraw=isLargeDraw;this.group.removeAll();}this.group.add(symbolDraw.group);return symbolDraw;},remove:function remove(ecModel,api){this._symbolDraw&&this._symbolDraw.remove(true);this._symbolDraw=null;},dispose:function dispose(){}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // import * as zrUtil from 'zrender/src/core/util';\n// In case developer forget to include grid component\nregisterVisual(visualSymbol('scatter','circle'));registerLayout(pointsLayout('scatter'));// echarts.registerProcessor(function (ecModel, api) {\n// ecModel.eachSeriesByType('scatter', function (seriesModel) {\n// var data = seriesModel.getData();\n// var coordSys = seriesModel.coordinateSystem;\n// if (coordSys.type !== 'geo') {\n// return;\n// }\n// var startPt = coordSys.pointToData([0, 0]);\n// var endPt = coordSys.pointToData([api.getWidth(), api.getHeight()]);\n// var dims = zrUtil.map(coordSys.dimensions, function (dim) {\n// return data.mapDimension(dim);\n// });\n// var range = {};\n// range[dims[0]] = [Math.min(startPt[0], endPt[0]), Math.max(startPt[0], endPt[0])];\n// range[dims[1]] = [Math.min(startPt[1], endPt[1]), Math.max(startPt[1], endPt[1])];\n// data.selectRange(range);\n// });\n// });\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var _nonShapeGraphicElements={// Reserved but not supported in graphic component.\npath:null,compoundPath:null,// Supported in graphic component.\ngroup:Group,image:ZImage,text:Text};// -------------\n// Preprocessor\n// -------------\nregisterPreprocessor(function(option){var graphicOption=option.graphic;// Convert\n// {graphic: [{left: 10, type: 'circle'}, ...]}\n// or\n// {graphic: {left: 10, type: 'circle'}}\n// to\n// {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\nif(isArray(graphicOption)){if(!graphicOption[0]||!graphicOption[0].elements){option.graphic=[{elements:graphicOption}];}else{// Only one graphic instance can be instantiated. (We dont\n// want that too many views are created in echarts._viewMap)\noption.graphic=[option.graphic[0]];}}else if(graphicOption&&!graphicOption.elements){option.graphic=[{elements:[graphicOption]}];}});// ------\n// Model\n// ------\nvar GraphicModel=extendComponentModel({type:'graphic',defaultOption:{// Extra properties for each elements:\n//\n// left/right/top/bottom: (like 12, '22%', 'center', default undefined)\n// If left/rigth is set, shape.x/shape.cx/position will not be used.\n// If top/bottom is set, shape.y/shape.cy/position will not be used.\n// This mechanism is useful when you want to position a group/element\n// against the right side or the center of this container.\n//\n// width/height: (can only be pixel value, default 0)\n// Only be used to specify contianer(group) size, if needed. And\n// can not be percentage value (like '33%'). See the reason in the\n// layout algorithm below.\n//\n// bounding: (enum: 'all' (default) | 'raw')\n// Specify how to calculate boundingRect when locating.\n// 'all': Get uioned and transformed boundingRect\n// from both itself and its descendants.\n// This mode simplies confining a group of elements in the bounding\n// of their ancester container (e.g., using 'right: 0').\n// 'raw': Only use the boundingRect of itself and before transformed.\n// This mode is similar to css behavior, which is useful when you\n// want an element to be able to overflow its container. (Consider\n// a rotated circle needs to be located in a corner.)\n// info: custom info. enables user to mount some info on elements and use them\n// in event handlers. Update them only when user specified, otherwise, remain.\n// Note: elements is always behind its ancestors in this elements array.\nelements:[],parentId:null},/**\n * Save el options for the sake of the performance (only update modified graphics).\n * The order is the same as those in option. (ancesters -> descendants)\n *\n * @private\n * @type {Array.}\n */_elOptionsToUpdate:null,/**\n * @override\n */mergeOption:function mergeOption(option){// Prevent default merge to elements\nvar elements=this.option.elements;this.option.elements=null;GraphicModel.superApply(this,'mergeOption',arguments);this.option.elements=elements;},/**\n * @override\n */optionUpdated:function optionUpdated(newOption,isInit){var thisOption=this.option;var newList=(isInit?thisOption:newOption).elements;var existList=thisOption.elements=isInit?[]:thisOption.elements;var flattenedList=[];this._flatten(newList,flattenedList);var mappingResult=mappingToExists(existList,flattenedList);makeIdAndName(mappingResult);// Clear elOptionsToUpdate\nvar elOptionsToUpdate=this._elOptionsToUpdate=[];each$1(mappingResult,function(resultItem,index){var newElOption=resultItem.option;if(__DEV__){assert$1(isObject$1(newElOption)||resultItem.exist,'Empty graphic option definition');}if(!newElOption){return;}elOptionsToUpdate.push(newElOption);setKeyInfoToNewElOption(resultItem,newElOption);mergeNewElOptionToExist(existList,index,newElOption);setLayoutInfoToExist(existList[index],newElOption);},this);// Clean\nfor(var i=existList.length-1;i>=0;i--){if(existList[i]==null){existList.splice(i,1);}else{// $action should be volatile, otherwise option gotten from\n// `getOption` will contain unexpected $action.\ndelete existList[i].$action;}}},/**\n * Convert\n * [{\n * type: 'group',\n * id: 'xx',\n * children: [{type: 'circle'}, {type: 'polygon'}]\n * }]\n * to\n * [\n * {type: 'group', id: 'xx'},\n * {type: 'circle', parentId: 'xx'},\n * {type: 'polygon', parentId: 'xx'}\n * ]\n *\n * @private\n * @param {Array.} optionList option list\n * @param {Array.} result result of flatten\n * @param {Object} parentOption parent option\n */_flatten:function _flatten(optionList,result,parentOption){each$1(optionList,function(option){if(!option){return;}if(parentOption){option.parentOption=parentOption;}result.push(option);var children=option.children;if(option.type==='group'&&children){this._flatten(children,result,option);}// Deleting for JSON output, and for not affecting group creation.\ndelete option.children;},this);},// FIXME\n// Pass to view using payload? setOption has a payload?\nuseElOptionsToUpdate:function useElOptionsToUpdate(){var els=this._elOptionsToUpdate;// Clear to avoid render duplicately when zooming.\nthis._elOptionsToUpdate=null;return els;}});// -----\n// View\n// -----\nextendComponentView({type:'graphic',/**\n * @override\n */init:function init(ecModel,api){/**\n * @private\n * @type {module:zrender/core/util.HashMap}\n */this._elMap=createHashMap();/**\n * @private\n * @type {module:echarts/graphic/GraphicModel}\n */this._lastGraphicModel;},/**\n * @override\n */render:function render(graphicModel,ecModel,api){// Having leveraged between use cases and algorithm complexity, a very\n// simple layout mechanism is used:\n// The size(width/height) can be determined by itself or its parent (not\n// implemented yet), but can not by its children. (Top-down travel)\n// The location(x/y) can be determined by the bounding rect of itself\n// (can including its descendants or not) and the size of its parent.\n// (Bottom-up travel)\n// When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n// view will be reused.\nif(graphicModel!==this._lastGraphicModel){this._clear();}this._lastGraphicModel=graphicModel;this._updateElements(graphicModel);this._relocate(graphicModel,api);},/**\n * Update graphic elements.\n *\n * @private\n * @param {Object} graphicModel graphic model\n */_updateElements:function _updateElements(graphicModel){var elOptionsToUpdate=graphicModel.useElOptionsToUpdate();if(!elOptionsToUpdate){return;}var elMap=this._elMap;var rootGroup=this.group;// Top-down tranverse to assign graphic settings to each elements.\neach$1(elOptionsToUpdate,function(elOption){var $action=elOption.$action;var id=elOption.id;var existEl=elMap.get(id);var parentId=elOption.parentId;var targetElParent=parentId!=null?elMap.get(parentId):rootGroup;var elOptionStyle=elOption.style;if(elOption.type==='text'&&elOptionStyle){// In top/bottom mode, textVerticalAlign should not be used, which cause\n// inaccurately locating.\nif(elOption.hv&&elOption.hv[1]){elOptionStyle.textVerticalAlign=elOptionStyle.textBaseline=null;}// Compatible with previous setting: both support fill and textFill,\n// stroke and textStroke.\n!elOptionStyle.hasOwnProperty('textFill')&&elOptionStyle.fill&&(elOptionStyle.textFill=elOptionStyle.fill);!elOptionStyle.hasOwnProperty('textStroke')&&elOptionStyle.stroke&&(elOptionStyle.textStroke=elOptionStyle.stroke);}// Remove unnecessary props to avoid potential problems.\nvar elOptionCleaned=getCleanedElOption(elOption);// For simple, do not support parent change, otherwise reorder is needed.\nif(__DEV__){existEl&&assert$1(targetElParent===existEl.parent,'Changing parent is not supported.');}if(!$action||$action==='merge'){existEl?existEl.attr(elOptionCleaned):createEl(id,targetElParent,elOptionCleaned,elMap);}else if($action==='replace'){removeEl(existEl,elMap);createEl(id,targetElParent,elOptionCleaned,elMap);}else if($action==='remove'){removeEl(existEl,elMap);}var el=elMap.get(id);if(el){el.__ecGraphicWidthOption=elOption.width;el.__ecGraphicHeightOption=elOption.height;setEventData(el,graphicModel,elOption);}});},/**\n * Locate graphic elements.\n *\n * @private\n * @param {Object} graphicModel graphic model\n * @param {module:echarts/ExtensionAPI} api extension API\n */_relocate:function _relocate(graphicModel,api){var elOptions=graphicModel.option.elements;var rootGroup=this.group;var elMap=this._elMap;var apiWidth=api.getWidth();var apiHeight=api.getHeight();// Top-down to calculate percentage width/height of group\nfor(var i=0;i=0;i--){var elOption=elOptions[i];var el=elMap.get(elOption.id);if(!el){continue;}var parentEl=el.parent;var containerInfo=parentEl===rootGroup?{width:apiWidth,height:apiHeight}:{width:parentEl.__ecGraphicWidth,height:parentEl.__ecGraphicHeight};// PENDING\n// Currently, when `bounding: 'all'`, the union bounding rect of the group\n// does not include the rect of [0, 0, group.width, group.height], which\n// is probably weird for users. Should we make a break change for it?\npositionElement(el,elOption,containerInfo,null,{hv:elOption.hv,boundingMode:elOption.bounding});}},/**\n * Clear all elements.\n *\n * @private\n */_clear:function _clear(){var elMap=this._elMap;elMap.each(function(el){removeEl(el,elMap);});this._elMap=createHashMap();},/**\n * @override\n */dispose:function dispose(){this._clear();}});function createEl(id,targetElParent,elOption,elMap){var graphicType=elOption.type;if(__DEV__){assert$1(graphicType,'graphic type MUST be set');}var Clz=_nonShapeGraphicElements.hasOwnProperty(graphicType)// Those graphic elements are not shapes. They should not be\n// overwritten by users, so do them first.\n?_nonShapeGraphicElements[graphicType]:getShapeClass(graphicType);if(__DEV__){assert$1(Clz,'graphic type can not be found');}var el=new Clz(elOption);targetElParent.add(el);elMap.set(id,el);el.__ecGraphicId=id;}function removeEl(existEl,elMap){var existElParent=existEl&&existEl.parent;if(existElParent){existEl.type==='group'&&existEl.traverse(function(el){removeEl(el,elMap);});elMap.removeKey(existEl.__ecGraphicId);existElParent.remove(existEl);}}// Remove unnecessary props to avoid potential problems.\nfunction getCleanedElOption(elOption){elOption=extend({},elOption);each$1(['id','parentId','$action','hv','bounding'].concat(LOCATION_PARAMS),function(name){delete elOption[name];});return elOption;}function isSetLoc(obj,props){var isSet;each$1(props,function(prop){obj[prop]!=null&&obj[prop]!=='auto'&&(isSet=true);});return isSet;}function setKeyInfoToNewElOption(resultItem,newElOption){var existElOption=resultItem.exist;// Set id and type after id assigned.\nnewElOption.id=resultItem.keyInfo.id;!newElOption.type&&existElOption&&(newElOption.type=existElOption.type);// Set parent id if not specified\nif(newElOption.parentId==null){var newElParentOption=newElOption.parentOption;if(newElParentOption){newElOption.parentId=newElParentOption.id;}else if(existElOption){newElOption.parentId=existElOption.parentId;}}// Clear\nnewElOption.parentOption=null;}function mergeNewElOptionToExist(existList,index,newElOption){// Update existing options, for `getOption` feature.\nvar newElOptCopy=extend({},newElOption);var existElOption=existList[index];var $action=newElOption.$action||'merge';if($action==='merge'){if(existElOption){if(__DEV__){var newType=newElOption.type;assert$1(!newType||existElOption.type===newType,'Please set $action: \"replace\" to change `type`');}// We can ensure that newElOptCopy and existElOption are not\n// the same object, so `merge` will not change newElOptCopy.\nmerge(existElOption,newElOptCopy,true);// Rigid body, use ignoreSize.\nmergeLayoutParam(existElOption,newElOptCopy,{ignoreSize:true});// Will be used in render.\ncopyLayoutParams(newElOption,existElOption);}else{existList[index]=newElOptCopy;}}else if($action==='replace'){existList[index]=newElOptCopy;}else if($action==='remove'){// null will be cleaned later.\nexistElOption&&(existList[index]=null);}}function setLayoutInfoToExist(existItem,newElOption){if(!existItem){return;}existItem.hv=newElOption.hv=[// Rigid body, dont care `width`.\nisSetLoc(newElOption,['left','right']),// Rigid body, dont care `height`.\nisSetLoc(newElOption,['top','bottom'])];// Give default group size. Otherwise layout error may occur.\nif(existItem.type==='group'){existItem.width==null&&(existItem.width=newElOption.width=0);existItem.height==null&&(existItem.height=newElOption.height=0);}}function setEventData(el,graphicModel,elOption){var eventData=el.eventData;// Simple optimize for large amount of elements that no need event.\nif(!el.silent&&!el.ignore&&!eventData){eventData=el.eventData={componentType:'graphic',componentIndex:graphicModel.componentIndex,name:el.name};}// `elOption.info` enables user to mount some info on\n// elements and use them in event handlers.\nif(eventData){eventData.info=el.info;}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} {point: [x, y], el: ...} point Will not be null.\n */var findPointFromSeries=function findPointFromSeries(finder,ecModel){var point=[];var seriesIndex=finder.seriesIndex;var seriesModel;if(seriesIndex==null||!(seriesModel=ecModel.getSeriesByIndex(seriesIndex))){return{point:[]};}var data=seriesModel.getData();var dataIndex=queryDataIndex(data,finder);if(dataIndex==null||dataIndex<0||isArray(dataIndex)){return{point:[]};}var el=data.getItemGraphicEl(dataIndex);var coordSys=seriesModel.coordinateSystem;if(seriesModel.getTooltipPosition){point=seriesModel.getTooltipPosition(dataIndex)||[];}else if(coordSys&&coordSys.dataToPoint){point=coordSys.dataToPoint(data.getValues(map(coordSys.dimensions,function(dim){return data.mapDimension(dim);}),dataIndex,true))||[];}else if(el){// Use graphic bounding rect\nvar rect=el.getBoundingRect().clone();rect.applyTransform(el.transform);point=[rect.x+rect.width/2,rect.y+rect.height/2];}return{point:point,el:el};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$7=each$1;var curry$2=curry;var inner$7=makeInner();/**\n * Basic logic: check all axis, if they do not demand show/highlight,\n * then hide/downplay them.\n *\n * @param {Object} coordSysAxesInfo\n * @param {Object} payload\n * @param {string} [payload.currTrigger] 'click' | 'mousemove' | 'leave'\n * @param {Array.} [payload.x] x and y, which are mandatory, specify a point to\n * trigger axisPointer and tooltip.\n * @param {Array.} [payload.y] x and y, which are mandatory, specify a point to\n * trigger axisPointer and tooltip.\n * @param {Object} [payload.seriesIndex] finder, optional, restrict target axes.\n * @param {Object} [payload.dataIndex] finder, restrict target axes.\n * @param {Object} [payload.axesInfo] finder, restrict target axes.\n * [{\n * axisDim: 'x'|'y'|'angle'|...,\n * axisIndex: ...,\n * value: ...\n * }, ...]\n * @param {Function} [payload.dispatchAction]\n * @param {Object} [payload.tooltipOption]\n * @param {Object|Array.|Function} [payload.position] Tooltip position,\n * which can be specified in dispatchAction\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @return {Object} content of event obj for echarts.connect.\n */var axisTrigger=function axisTrigger(payload,ecModel,api){var currTrigger=payload.currTrigger;var point=[payload.x,payload.y];var finder=payload;var dispatchAction=payload.dispatchAction||bind(api.dispatchAction,api);var coordSysAxesInfo=ecModel.getComponent('axisPointer').coordSysAxesInfo;// Pending\n// See #6121. But we are not able to reproduce it yet.\nif(!coordSysAxesInfo){return;}if(illegalPoint(point)){// Used in the default behavior of `connection`: use the sample seriesIndex\n// and dataIndex. And also used in the tooltipView trigger.\npoint=findPointFromSeries({seriesIndex:finder.seriesIndex,// Do not use dataIndexInside from other ec instance.\n// FIXME: auto detect it?\ndataIndex:finder.dataIndex},ecModel).point;}var isIllegalPoint=illegalPoint(point);// Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n// Notice: In this case, it is difficult to get the `point` (which is necessary to show\n// tooltip, so if point is not given, we just use the point found by sample seriesIndex\n// and dataIndex.\nvar inputAxesInfo=finder.axesInfo;var axesInfo=coordSysAxesInfo.axesInfo;var shouldHide=currTrigger==='leave'||illegalPoint(point);var outputFinder={};var showValueMap={};var dataByCoordSys={list:[],map:{}};var updaters={showPointer:curry$2(showPointer,showValueMap),showTooltip:curry$2(showTooltip,dataByCoordSys)};// Process for triggered axes.\neach$7(coordSysAxesInfo.coordSysMap,function(coordSys,coordSysKey){// If a point given, it must be contained by the coordinate system.\nvar coordSysContainsPoint=isIllegalPoint||coordSys.containPoint(point);each$7(coordSysAxesInfo.coordSysAxesInfo[coordSysKey],function(axisInfo,key){var axis=axisInfo.axis;var inputAxisInfo=findInputAxisInfo(inputAxesInfo,axisInfo);// If no inputAxesInfo, no axis is restricted.\nif(!shouldHide&&coordSysContainsPoint&&(!inputAxesInfo||inputAxisInfo)){var val=inputAxisInfo&&inputAxisInfo.value;if(val==null&&!isIllegalPoint){val=axis.pointToData(point);}val!=null&&processOnAxis(axisInfo,val,updaters,false,outputFinder);}});});// Process for linked axes.\nvar linkTriggers={};each$7(axesInfo,function(tarAxisInfo,tarKey){var linkGroup=tarAxisInfo.linkGroup;// If axis has been triggered in the previous stage, it should not be triggered by link.\nif(linkGroup&&!showValueMap[tarKey]){each$7(linkGroup.axesInfo,function(srcAxisInfo,srcKey){var srcValItem=showValueMap[srcKey];// If srcValItem exist, source axis is triggered, so link to target axis.\nif(srcAxisInfo!==tarAxisInfo&&srcValItem){var val=srcValItem.value;linkGroup.mapper&&(val=tarAxisInfo.axis.scale.parse(linkGroup.mapper(val,makeMapperParam(srcAxisInfo),makeMapperParam(tarAxisInfo))));linkTriggers[tarAxisInfo.key]=val;}});}});each$7(linkTriggers,function(val,tarKey){processOnAxis(axesInfo[tarKey],val,updaters,true,outputFinder);});updateModelActually(showValueMap,axesInfo,outputFinder);dispatchTooltipActually(dataByCoordSys,point,payload,dispatchAction);dispatchHighDownActually(axesInfo,dispatchAction,api);return outputFinder;};function processOnAxis(axisInfo,newValue,updaters,dontSnap,outputFinder){var axis=axisInfo.axis;if(axis.scale.isBlank()||!axis.containData(newValue)){return;}if(!axisInfo.involveSeries){updaters.showPointer(axisInfo,newValue);return;}// Heavy calculation. So put it after axis.containData checking.\nvar payloadInfo=buildPayloadsBySeries(newValue,axisInfo);var payloadBatch=payloadInfo.payloadBatch;var snapToValue=payloadInfo.snapToValue;// Fill content of event obj for echarts.connect.\n// By default use the first involved series data as a sample to connect.\nif(payloadBatch[0]&&outputFinder.seriesIndex==null){extend(outputFinder,payloadBatch[0]);}// If no linkSource input, this process is for collecting link\n// target, where snap should not be accepted.\nif(!dontSnap&&axisInfo.snap){if(axis.containData(snapToValue)&&snapToValue!=null){newValue=snapToValue;}}updaters.showPointer(axisInfo,newValue,payloadBatch,outputFinder);// Tooltip should always be snapToValue, otherwise there will be\n// incorrect \"axis value ~ series value\" mapping displayed in tooltip.\nupdaters.showTooltip(axisInfo,payloadInfo,snapToValue);}function buildPayloadsBySeries(value,axisInfo){var axis=axisInfo.axis;var dim=axis.dim;var snapToValue=value;var payloadBatch=[];var minDist=Number.MAX_VALUE;var minDiff=-1;each$7(axisInfo.seriesModels,function(series,idx){var dataDim=series.getData().mapDimension(dim,true);var seriesNestestValue;var dataIndices;if(series.getAxisTooltipData){var result=series.getAxisTooltipData(dataDim,value,axis);dataIndices=result.dataIndices;seriesNestestValue=result.nestestValue;}else{dataIndices=series.getData().indicesOfNearest(dataDim[0],value,// Add a threshold to avoid find the wrong dataIndex\n// when data length is not same.\n// false,\naxis.type==='category'?0.5:null);if(!dataIndices.length){return;}seriesNestestValue=series.getData().get(dataDim[0],dataIndices[0]);}if(seriesNestestValue==null||!isFinite(seriesNestestValue)){return;}var diff=value-seriesNestestValue;var dist=Math.abs(diff);// Consider category case\nif(dist<=minDist){if(dist=0&&minDiff<0){minDist=dist;minDiff=diff;snapToValue=seriesNestestValue;payloadBatch.length=0;}each$7(dataIndices,function(dataIndex){payloadBatch.push({seriesIndex:series.seriesIndex,dataIndexInside:dataIndex,dataIndex:series.getData().getRawIndex(dataIndex)});});}});return{payloadBatch:payloadBatch,snapToValue:snapToValue};}function showPointer(showValueMap,axisInfo,value,payloadBatch){showValueMap[axisInfo.key]={value:value,payloadBatch:payloadBatch};}function showTooltip(dataByCoordSys,axisInfo,payloadInfo,value){var payloadBatch=payloadInfo.payloadBatch;var axis=axisInfo.axis;var axisModel=axis.model;var axisPointerModel=axisInfo.axisPointerModel;// If no data, do not create anything in dataByCoordSys,\n// whose length will be used to judge whether dispatch action.\nif(!axisInfo.triggerTooltip||!payloadBatch.length){return;}var coordSysModel=axisInfo.coordSys.model;var coordSysKey=makeKey(coordSysModel);var coordSysItem=dataByCoordSys.map[coordSysKey];if(!coordSysItem){coordSysItem=dataByCoordSys.map[coordSysKey]={coordSysId:coordSysModel.id,coordSysIndex:coordSysModel.componentIndex,coordSysType:coordSysModel.type,coordSysMainType:coordSysModel.mainType,dataByAxis:[]};dataByCoordSys.list.push(coordSysItem);}coordSysItem.dataByAxis.push({axisDim:axis.dim,axisIndex:axisModel.componentIndex,axisType:axisModel.type,axisId:axisModel.id,value:value,// Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n// depends that all models have been updated. So it should not be performed\n// here. Considering axisPointerModel used here is volatile, which is hard\n// to be retrieve in TooltipView, we prepare parameters here.\nvalueLabelOpt:{precision:axisPointerModel.get('label.precision'),formatter:axisPointerModel.get('label.formatter')},seriesDataIndices:payloadBatch.slice()});}function updateModelActually(showValueMap,axesInfo,outputFinder){var outputAxesInfo=outputFinder.axesInfo=[];// Basic logic: If no 'show' required, 'hide' this axisPointer.\neach$7(axesInfo,function(axisInfo,key){var option=axisInfo.axisPointerModel.option;var valItem=showValueMap[key];if(valItem){!axisInfo.useHandle&&(option.status='show');option.value=valItem.value;// For label formatter param and highlight.\noption.seriesDataIndices=(valItem.payloadBatch||[]).slice();}// When always show (e.g., handle used), remain\n// original value and status.\nelse{// If hide, value still need to be set, consider\n// click legend to toggle axis blank.\n!axisInfo.useHandle&&(option.status='hide');}// If status is 'hide', should be no info in payload.\noption.status==='show'&&outputAxesInfo.push({axisDim:axisInfo.axis.dim,axisIndex:axisInfo.axis.model.componentIndex,value:option.value});});}function dispatchTooltipActually(dataByCoordSys,point,payload,dispatchAction){// Basic logic: If no showTip required, hideTip will be dispatched.\nif(illegalPoint(point)||!dataByCoordSys.list.length){dispatchAction({type:'hideTip'});return;}// In most case only one axis (or event one series is used). It is\n// convinient to fetch payload.seriesIndex and payload.dataIndex\n// dirtectly. So put the first seriesIndex and dataIndex of the first\n// axis on the payload.\nvar sampleItem=((dataByCoordSys.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};dispatchAction({type:'showTip',escapeConnect:true,x:point[0],y:point[1],tooltipOption:payload.tooltipOption,position:payload.position,dataIndexInside:sampleItem.dataIndexInside,dataIndex:sampleItem.dataIndex,seriesIndex:sampleItem.seriesIndex,dataByCoordSys:dataByCoordSys.list});}function dispatchHighDownActually(axesInfo,dispatchAction,api){// FIXME\n// highlight status modification shoule be a stage of main process?\n// (Consider confilct (e.g., legend and axisPointer) and setOption)\nvar zr=api.getZr();var highDownKey='axisPointerLastHighlights';var lastHighlights=inner$7(zr)[highDownKey]||{};var newHighlights=inner$7(zr)[highDownKey]={};// Update highlight/downplay status according to axisPointer model.\n// Build hash map and remove duplicate incidentally.\neach$7(axesInfo,function(axisInfo,key){var option=axisInfo.axisPointerModel.option;option.status==='show'&&each$7(option.seriesDataIndices,function(batchItem){var key=batchItem.seriesIndex+' | '+batchItem.dataIndex;newHighlights[key]=batchItem;});});// Diff.\nvar toHighlight=[];var toDownplay=[];each$1(lastHighlights,function(batchItem,key){!newHighlights[key]&&toDownplay.push(batchItem);});each$1(newHighlights,function(batchItem,key){!lastHighlights[key]&&toHighlight.push(batchItem);});toDownplay.length&&api.dispatchAction({type:'downplay',escapeConnect:true,batch:toDownplay});toHighlight.length&&api.dispatchAction({type:'highlight',escapeConnect:true,batch:toHighlight});}function findInputAxisInfo(inputAxesInfo,axisInfo){for(var i=0;i<(inputAxesInfo||[]).length;i++){var inputAxisInfo=inputAxesInfo[i];if(axisInfo.axis.dim===inputAxisInfo.axisDim&&axisInfo.axis.model.componentIndex===inputAxisInfo.axisIndex){return inputAxisInfo;}}}function makeMapperParam(axisInfo){var axisModel=axisInfo.axis.model;var item={};var dim=item.axisDim=axisInfo.axis.dim;item.axisIndex=item[dim+'AxisIndex']=axisModel.componentIndex;item.axisName=item[dim+'AxisName']=axisModel.name;item.axisId=item[dim+'AxisId']=axisModel.id;return item;}function illegalPoint(point){return!point||point[0]==null||isNaN(point[0])||point[1]==null||isNaN(point[1]);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AxisPointerModel=extendComponentModel({type:'axisPointer',coordSysAxesInfo:null,defaultOption:{// 'auto' means that show when triggered by tooltip or handle.\nshow:'auto',// 'click' | 'mousemove' | 'none'\ntriggerOn:null,// set default in AxisPonterView.js\nzlevel:0,z:50,type:'line',// 'line' 'shadow' 'cross' 'none'.\n// axispointer triggered by tootip determine snap automatically,\n// see `modelHelper`.\nsnap:false,triggerTooltip:true,value:null,status:null,// Init value depends on whether handle is used.\n// [group0, group1, ...]\n// Each group can be: {\n// mapper: function () {},\n// singleTooltip: 'multiple', // 'multiple' or 'single'\n// xAxisId: ...,\n// yAxisName: ...,\n// angleAxisIndex: ...\n// }\n// mapper: can be ignored.\n// input: {axisInfo, value}\n// output: {axisInfo, value}\nlink:[],// Do not set 'auto' here, otherwise global animation: false\n// will not effect at this axispointer.\nanimation:null,animationDurationUpdate:200,lineStyle:{color:'#aaa',width:1,type:'solid'},shadowStyle:{color:'rgba(150,150,150,0.3)'},label:{show:true,formatter:null,// string | Function\nprecision:'auto',// Or a number like 0, 1, 2 ...\nmargin:3,color:'#fff',padding:[5,7,5,7],backgroundColor:'auto',// default: axis line color\nborderColor:null,borderWidth:0,shadowBlur:3,shadowColor:'#aaa'// Considering applicability, common style should\n// better not have shadowOffset.\n// shadowOffsetX: 0,\n// shadowOffsetY: 2\n},handle:{show:false,/* eslint-disable */icon:'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',// jshint ignore:line\n/* eslint-enable */size:45,// handle margin is from symbol center to axis, which is stable when circular move.\nmargin:50,// color: '#1b8bbd'\n// color: '#2f4554'\ncolor:'#333',shadowBlur:3,shadowColor:'#aaa',shadowOffsetX:0,shadowOffsetY:2,// For mobile performance\nthrottle:40}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var inner$8=makeInner();var each$8=each$1;/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n * param: {string} currTrigger\n * param: {Array.} point\n */function register(key,api,handler){if(env$1.node){return;}var zr=api.getZr();inner$8(zr).records||(inner$8(zr).records={});initGlobalListeners(zr,api);var record=inner$8(zr).records[key]||(inner$8(zr).records[key]={});record.handler=handler;}function initGlobalListeners(zr,api){if(inner$8(zr).initialized){return;}inner$8(zr).initialized=true;useHandler('click',curry(doEnter,'click'));useHandler('mousemove',curry(doEnter,'mousemove'));// useHandler('mouseout', onLeave);\nuseHandler('globalout',onLeave);function useHandler(eventType,cb){zr.on(eventType,function(e){var dis=makeDispatchAction(api);each$8(inner$8(zr).records,function(record){record&&cb(record,e,dis.dispatchAction);});dispatchTooltipFinally(dis.pendings,api);});}}function dispatchTooltipFinally(pendings,api){var showLen=pendings.showTip.length;var hideLen=pendings.hideTip.length;var actuallyPayload;if(showLen){actuallyPayload=pendings.showTip[showLen-1];}else if(hideLen){actuallyPayload=pendings.hideTip[hideLen-1];}if(actuallyPayload){actuallyPayload.dispatchAction=null;api.dispatchAction(actuallyPayload);}}function onLeave(record,e,dispatchAction){record.handler('leave',null,dispatchAction);}function doEnter(currTrigger,record,e,dispatchAction){record.handler(currTrigger,e,dispatchAction);}function makeDispatchAction(api){var pendings={showTip:[],hideTip:[]};// FIXME\n// better approach?\n// 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n// which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n// So we have to add \"final stage\" to merge those dispatched actions.\nvar dispatchAction=function dispatchAction(payload){var pendingList=pendings[payload.type];if(pendingList){pendingList.push(payload);}else{payload.dispatchAction=dispatchAction;api.dispatchAction(payload);}};return{dispatchAction:dispatchAction,pendings:pendings};}/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n */function unregister(key,api){if(env$1.node){return;}var zr=api.getZr();var record=(inner$8(zr).records||{})[key];if(record){inner$8(zr).records[key]=null;}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AxisPointerView=extendComponentView({type:'axisPointer',render:function render(globalAxisPointerModel,ecModel,api){var globalTooltipModel=ecModel.getComponent('tooltip');var triggerOn=globalAxisPointerModel.get('triggerOn')||globalTooltipModel&&globalTooltipModel.get('triggerOn')||'mousemove|click';// Register global listener in AxisPointerView to enable\n// AxisPointerView to be independent to Tooltip.\nregister('axisPointer',api,function(currTrigger,e,dispatchAction){// If 'none', it is not controlled by mouse totally.\nif(triggerOn!=='none'&&(currTrigger==='leave'||triggerOn.indexOf(currTrigger)>=0)){dispatchAction({type:'updateAxisPointer',currTrigger:currTrigger,x:e&&e.offsetX,y:e&&e.offsetY});}});},/**\n * @override\n */remove:function remove(ecModel,api){unregister(api.getZr(),'axisPointer');AxisPointerView.superApply(this._model,'remove',arguments);},/**\n * @override\n */dispose:function dispose(ecModel,api){unregister('axisPointer',api);AxisPointerView.superApply(this._model,'dispose',arguments);}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var inner$9=makeInner();var clone$4=_clone;var bind$1=bind;/**\n * Base axis pointer class in 2D.\n * Implemenents {module:echarts/component/axis/IAxisPointer}.\n */function BaseAxisPointer(){}BaseAxisPointer.prototype={/**\n * @private\n */_group:null,/**\n * @private\n */_lastGraphicKey:null,/**\n * @private\n */_handle:null,/**\n * @private\n */_dragging:false,/**\n * @private\n */_lastValue:null,/**\n * @private\n */_lastStatus:null,/**\n * @private\n */_payloadInfo:null,/**\n * In px, arbitrary value. Do not set too small,\n * no animation is ok for most cases.\n * @protected\n */animationThreshold:15,/**\n * @implement\n */render:function render(axisModel,axisPointerModel,api,forceRender){var value=axisPointerModel.get('value');var status=axisPointerModel.get('status');// Bind them to `this`, not in closure, otherwise they will not\n// be replaced when user calling setOption in not merge mode.\nthis._axisModel=axisModel;this._axisPointerModel=axisPointerModel;this._api=api;// Optimize: `render` will be called repeatly during mouse move.\n// So it is power consuming if performing `render` each time,\n// especially on mobile device.\nif(!forceRender&&this._lastValue===value&&this._lastStatus===status){return;}this._lastValue=value;this._lastStatus=status;var group=this._group;var handle=this._handle;if(!status||status==='hide'){// Do not clear here, for animation better.\ngroup&&group.hide();handle&&handle.hide();return;}group&&group.show();handle&&handle.show();// Otherwise status is 'show'\nvar elOption={};this.makeElOption(elOption,value,axisModel,axisPointerModel,api);// Enable change axis pointer type.\nvar graphicKey=elOption.graphicKey;if(graphicKey!==this._lastGraphicKey){this.clear(api);}this._lastGraphicKey=graphicKey;var moveAnimation=this._moveAnimation=this.determineAnimation(axisModel,axisPointerModel);if(!group){group=this._group=new Group();this.createPointerEl(group,elOption,axisModel,axisPointerModel);this.createLabelEl(group,elOption,axisModel,axisPointerModel);api.getZr().add(group);}else{var doUpdateProps=curry(updateProps$1,axisPointerModel,moveAnimation);this.updatePointerEl(group,elOption,doUpdateProps,axisPointerModel);this.updateLabelEl(group,elOption,doUpdateProps,axisPointerModel);}updateMandatoryProps(group,axisPointerModel,true);this._renderHandle(value);},/**\n * @implement\n */remove:function remove(api){this.clear(api);},/**\n * @implement\n */dispose:function dispose(api){this.clear(api);},/**\n * @protected\n */determineAnimation:function determineAnimation(axisModel,axisPointerModel){var animation=axisPointerModel.get('animation');var axis=axisModel.axis;var isCategoryAxis=axis.type==='category';var useSnap=axisPointerModel.get('snap');// Value axis without snap always do not snap.\nif(!useSnap&&!isCategoryAxis){return false;}if(animation==='auto'||animation==null){var animationThreshold=this.animationThreshold;if(isCategoryAxis&&axis.getBandWidth()>animationThreshold){return true;}// It is important to auto animation when snap used. Consider if there is\n// a dataZoom, animation will be disabled when too many points exist, while\n// it will be enabled for better visual effect when little points exist.\nif(useSnap){var seriesDataCount=getAxisInfo(axisModel).seriesDataCount;var axisExtent=axis.getExtent();// Approximate band width\nreturn Math.abs(axisExtent[0]-axisExtent[1])/seriesDataCount>animationThreshold;}return false;}return animation===true;},/**\n * add {pointer, label, graphicKey} to elOption\n * @protected\n */makeElOption:function makeElOption(elOption,value,axisModel,axisPointerModel,api){// Shoule be implemenented by sub-class.\n},/**\n * @protected\n */createPointerEl:function createPointerEl(group,elOption,axisModel,axisPointerModel){var pointerOption=elOption.pointer;if(pointerOption){var pointerEl=inner$9(group).pointerEl=new graphic[pointerOption.type](clone$4(elOption.pointer));group.add(pointerEl);}},/**\n * @protected\n */createLabelEl:function createLabelEl(group,elOption,axisModel,axisPointerModel){if(elOption.label){var labelEl=inner$9(group).labelEl=new Rect(clone$4(elOption.label));group.add(labelEl);updateLabelShowHide(labelEl,axisPointerModel);}},/**\n * @protected\n */updatePointerEl:function updatePointerEl(group,elOption,updateProps$$1){var pointerEl=inner$9(group).pointerEl;if(pointerEl&&elOption.pointer){pointerEl.setStyle(elOption.pointer.style);updateProps$$1(pointerEl,{shape:elOption.pointer.shape});}},/**\n * @protected\n */updateLabelEl:function updateLabelEl(group,elOption,updateProps$$1,axisPointerModel){var labelEl=inner$9(group).labelEl;if(labelEl){labelEl.setStyle(elOption.label.style);updateProps$$1(labelEl,{// Consider text length change in vertical axis, animation should\n// be used on shape, otherwise the effect will be weird.\nshape:elOption.label.shape,position:elOption.label.position});updateLabelShowHide(labelEl,axisPointerModel);}},/**\n * @private\n */_renderHandle:function _renderHandle(value){if(this._dragging||!this.updateHandleTransform){return;}var axisPointerModel=this._axisPointerModel;var zr=this._api.getZr();var handle=this._handle;var handleModel=axisPointerModel.getModel('handle');var status=axisPointerModel.get('status');if(!handleModel.get('show')||!status||status==='hide'){handle&&zr.remove(handle);this._handle=null;return;}var isInit;if(!this._handle){isInit=true;handle=this._handle=createIcon(handleModel.get('icon'),{cursor:'move',draggable:true,onmousemove:function onmousemove(e){// Fot mobile devicem, prevent screen slider on the button.\nstop(e.event);},onmousedown:bind$1(this._onHandleDragMove,this,0,0),drift:bind$1(this._onHandleDragMove,this),ondragend:bind$1(this._onHandleDragEnd,this)});zr.add(handle);}updateMandatoryProps(handle,axisPointerModel,false);// update style\nvar includeStyles=['color','borderColor','borderWidth','opacity','shadowColor','shadowBlur','shadowOffsetX','shadowOffsetY'];handle.setStyle(handleModel.getItemStyle(null,includeStyles));// update position\nvar handleSize=handleModel.get('size');if(!isArray(handleSize)){handleSize=[handleSize,handleSize];}handle.attr('scale',[handleSize[0]/2,handleSize[1]/2]);createOrUpdate(this,'_doDispatchAxisPointer',handleModel.get('throttle')||0,'fixRate');this._moveHandleToValue(value,isInit);},/**\n * @private\n */_moveHandleToValue:function _moveHandleToValue(value,isInit){updateProps$1(this._axisPointerModel,!isInit&&this._moveAnimation,this._handle,getHandleTransProps(this.getHandleTransform(value,this._axisModel,this._axisPointerModel)));},/**\n * @private\n */_onHandleDragMove:function _onHandleDragMove(dx,dy){var handle=this._handle;if(!handle){return;}this._dragging=true;// Persistent for throttle.\nvar trans=this.updateHandleTransform(getHandleTransProps(handle),[dx,dy],this._axisModel,this._axisPointerModel);this._payloadInfo=trans;handle.stopAnimation();handle.attr(getHandleTransProps(trans));inner$9(handle).lastProp=null;this._doDispatchAxisPointer();},/**\n * Throttled method.\n * @private\n */_doDispatchAxisPointer:function _doDispatchAxisPointer(){var handle=this._handle;if(!handle){return;}var payloadInfo=this._payloadInfo;var axisModel=this._axisModel;this._api.dispatchAction({type:'updateAxisPointer',x:payloadInfo.cursorPoint[0],y:payloadInfo.cursorPoint[1],tooltipOption:payloadInfo.tooltipOption,axesInfo:[{axisDim:axisModel.axis.dim,axisIndex:axisModel.componentIndex}]});},/**\n * @private\n */_onHandleDragEnd:function _onHandleDragEnd(moveAnimation){this._dragging=false;var handle=this._handle;if(!handle){return;}var value=this._axisPointerModel.get('value');// Consider snap or categroy axis, handle may be not consistent with\n// axisPointer. So move handle to align the exact value position when\n// drag ended.\nthis._moveHandleToValue(value);// For the effect: tooltip will be shown when finger holding on handle\n// button, and will be hidden after finger left handle button.\nthis._api.dispatchAction({type:'hideTip'});},/**\n * Should be implemenented by sub-class if support `handle`.\n * @protected\n * @param {number} value\n * @param {module:echarts/model/Model} axisModel\n * @param {module:echarts/model/Model} axisPointerModel\n * @return {Object} {position: [x, y], rotation: 0}\n */getHandleTransform:null,/**\n * * Should be implemenented by sub-class if support `handle`.\n * @protected\n * @param {Object} transform {position, rotation}\n * @param {Array.} delta [dx, dy]\n * @param {module:echarts/model/Model} axisModel\n * @param {module:echarts/model/Model} axisPointerModel\n * @return {Object} {position: [x, y], rotation: 0, cursorPoint: [x, y]}\n */updateHandleTransform:null,/**\n * @private\n */clear:function clear(api){this._lastValue=null;this._lastStatus=null;var zr=api.getZr();var group=this._group;var handle=this._handle;if(zr&&group){this._lastGraphicKey=null;group&&zr.remove(group);handle&&zr.remove(handle);this._group=null;this._handle=null;this._payloadInfo=null;}},/**\n * @protected\n */doClear:function doClear(){// Implemented by sub-class if necessary.\n},/**\n * @protected\n * @param {Array.} xy\n * @param {Array.} wh\n * @param {number} [xDimIndex=0] or 1\n */buildLabel:function buildLabel(xy,wh,xDimIndex){xDimIndex=xDimIndex||0;return{x:xy[xDimIndex],y:xy[1-xDimIndex],width:wh[xDimIndex],height:wh[1-xDimIndex]};}};BaseAxisPointer.prototype.constructor=BaseAxisPointer;function updateProps$1(animationModel,moveAnimation,el,props){// Animation optimize.\nif(!propsEqual(inner$9(el).lastProp,props)){inner$9(el).lastProp=props;moveAnimation?updateProps(el,props,animationModel):(el.stopAnimation(),el.attr(props));}}function propsEqual(lastProps,newProps){if(isObject$1(lastProps)&&isObject$1(newProps)){var equals=true;each$1(newProps,function(item,key){equals=equals&&propsEqual(lastProps[key],item);});return!!equals;}else{return lastProps===newProps;}}function updateLabelShowHide(labelEl,axisPointerModel){labelEl[axisPointerModel.get('label.show')?'show':'hide']();}function getHandleTransProps(trans){return{position:trans.position.slice(),rotation:trans.rotation||0};}function updateMandatoryProps(group,axisPointerModel,silent){var z=axisPointerModel.get('z');var zlevel=axisPointerModel.get('zlevel');group&&group.traverse(function(el){if(el.type!=='group'){z!=null&&(el.z=z);zlevel!=null&&(el.zlevel=zlevel);el.silent=silent;}});}enableClassExtend(BaseAxisPointer);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @param {module:echarts/model/Model} axisPointerModel\n */function buildElStyle(axisPointerModel){var axisPointerType=axisPointerModel.get('type');var styleModel=axisPointerModel.getModel(axisPointerType+'Style');var style;if(axisPointerType==='line'){style=styleModel.getLineStyle();style.fill=null;}else if(axisPointerType==='shadow'){style=styleModel.getAreaStyle();style.stroke=null;}return style;}/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */function buildLabelElOption(elOption,axisModel,axisPointerModel,api,labelPos){var value=axisPointerModel.get('value');var text=getValueLabel(value,axisModel.axis,axisModel.ecModel,axisPointerModel.get('seriesDataIndices'),{precision:axisPointerModel.get('label.precision'),formatter:axisPointerModel.get('label.formatter')});var labelModel=axisPointerModel.getModel('label');var paddings=normalizeCssArray$1(labelModel.get('padding')||0);var font=labelModel.getFont();var textRect=_getBoundingRect(text,font);var position=labelPos.position;var width=textRect.width+paddings[1]+paddings[3];var height=textRect.height+paddings[0]+paddings[2];// Adjust by align.\nvar align=labelPos.align;align==='right'&&(position[0]-=width);align==='center'&&(position[0]-=width/2);var verticalAlign=labelPos.verticalAlign;verticalAlign==='bottom'&&(position[1]-=height);verticalAlign==='middle'&&(position[1]-=height/2);// Not overflow ec container\nconfineInContainer(position,width,height,api);var bgColor=labelModel.get('backgroundColor');if(!bgColor||bgColor==='auto'){bgColor=axisModel.get('axisLine.lineStyle.color');}elOption.label={shape:{x:0,y:0,width:width,height:height,r:labelModel.get('borderRadius')},position:position.slice(),// TODO: rich\nstyle:{text:text,textFont:font,textFill:labelModel.getTextColor(),textPosition:'inside',textPadding:paddings,fill:bgColor,stroke:labelModel.get('borderColor')||'transparent',lineWidth:labelModel.get('borderWidth')||0,shadowBlur:labelModel.get('shadowBlur'),shadowColor:labelModel.get('shadowColor'),shadowOffsetX:labelModel.get('shadowOffsetX'),shadowOffsetY:labelModel.get('shadowOffsetY')},// Lable should be over axisPointer.\nz2:10};}// Do not overflow ec container\nfunction confineInContainer(position,width,height,api){var viewWidth=api.getWidth();var viewHeight=api.getHeight();position[0]=Math.min(position[0]+width,viewWidth)-width;position[1]=Math.min(position[1]+height,viewHeight)-height;position[0]=Math.max(position[0],0);position[1]=Math.max(position[1],0);}/**\n * @param {number} value\n * @param {module:echarts/coord/Axis} axis\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} opt\n * @param {Array.} seriesDataIndices\n * @param {number|string} opt.precision 'auto' or a number\n * @param {string|Function} opt.formatter label formatter\n */function getValueLabel(value,axis,ecModel,seriesDataIndices,opt){value=axis.scale.parse(value);var text=axis.scale.getLabel(// If `precision` is set, width can be fixed (like '12.00500'), which\n// helps to debounce when when moving label.\nvalue,{precision:opt.precision});var formatter=opt.formatter;if(formatter){var params={value:getAxisRawValue(axis,value),axisDimension:axis.dim,axisIndex:axis.index,seriesData:[]};each$1(seriesDataIndices,function(idxItem){var series=ecModel.getSeriesByIndex(idxItem.seriesIndex);var dataIndex=idxItem.dataIndexInside;var dataParams=series&&series.getDataParams(dataIndex);dataParams&¶ms.seriesData.push(dataParams);});if(isString(formatter)){text=formatter.replace('{value}',text);}else if(isFunction$1(formatter)){text=formatter(params);}}return text;}/**\n * @param {module:echarts/coord/Axis} axis\n * @param {number} value\n * @param {Object} layoutInfo {\n * rotation, position, labelOffset, labelDirection, labelMargin\n * }\n */function getTransformedPosition(axis,value,layoutInfo){var transform=create$1();rotate(transform,transform,layoutInfo.rotation);translate(transform,transform,layoutInfo.position);return applyTransform$1([axis.dataToCoord(value),(layoutInfo.labelOffset||0)+(layoutInfo.labelDirection||1)*(layoutInfo.labelMargin||0)],transform);}function buildCartesianSingleLabelElOption(value,elOption,layoutInfo,axisModel,axisPointerModel,api){var textLayout=AxisBuilder.innerTextLayout(layoutInfo.rotation,0,layoutInfo.labelDirection);layoutInfo.labelMargin=axisPointerModel.get('label.margin');buildLabelElOption(elOption,axisModel,axisPointerModel,api,{position:getTransformedPosition(axisModel.axis,value,layoutInfo),align:textLayout.textAlign,verticalAlign:textLayout.textVerticalAlign});}/**\n * @param {Array.} p1\n * @param {Array.} p2\n * @param {number} [xDimIndex=0] or 1\n */function makeLineShape(p1,p2,xDimIndex){xDimIndex=xDimIndex||0;return{x1:p1[xDimIndex],y1:p1[1-xDimIndex],x2:p2[xDimIndex],y2:p2[1-xDimIndex]};}/**\n * @param {Array.} xy\n * @param {Array.} wh\n * @param {number} [xDimIndex=0] or 1\n */function makeRectShape(xy,wh,xDimIndex){xDimIndex=xDimIndex||0;return{x:xy[xDimIndex],y:xy[1-xDimIndex],width:wh[xDimIndex],height:wh[1-xDimIndex]};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var CartesianAxisPointer=BaseAxisPointer.extend({/**\n * @override\n */makeElOption:function makeElOption(elOption,value,axisModel,axisPointerModel,api){var axis=axisModel.axis;var grid=axis.grid;var axisPointerType=axisPointerModel.get('type');var otherExtent=getCartesian(grid,axis).getOtherAxis(axis).getGlobalExtent();var pixelValue=axis.toGlobalCoord(axis.dataToCoord(value,true));if(axisPointerType&&axisPointerType!=='none'){var elStyle=buildElStyle(axisPointerModel);var pointerOption=pointerShapeBuilder[axisPointerType](axis,pixelValue,otherExtent);pointerOption.style=elStyle;elOption.graphicKey=pointerOption.type;elOption.pointer=pointerOption;}var layoutInfo=layout$1(grid.model,axisModel);buildCartesianSingleLabelElOption(value,elOption,layoutInfo,axisModel,axisPointerModel,api);},/**\n * @override\n */getHandleTransform:function getHandleTransform(value,axisModel,axisPointerModel){var layoutInfo=layout$1(axisModel.axis.grid.model,axisModel,{labelInside:false});layoutInfo.labelMargin=axisPointerModel.get('handle.margin');return{position:getTransformedPosition(axisModel.axis,value,layoutInfo),rotation:layoutInfo.rotation+(layoutInfo.labelDirection<0?Math.PI:0)};},/**\n * @override\n */updateHandleTransform:function updateHandleTransform(transform,delta,axisModel,axisPointerModel){var axis=axisModel.axis;var grid=axis.grid;var axisExtent=axis.getGlobalExtent(true);var otherExtent=getCartesian(grid,axis).getOtherAxis(axis).getGlobalExtent();var dimIndex=axis.dim==='x'?0:1;var currPosition=transform.position;currPosition[dimIndex]+=delta[dimIndex];currPosition[dimIndex]=Math.min(axisExtent[1],currPosition[dimIndex]);currPosition[dimIndex]=Math.max(axisExtent[0],currPosition[dimIndex]);var cursorOtherValue=(otherExtent[1]+otherExtent[0])/2;var cursorPoint=[cursorOtherValue,cursorOtherValue];cursorPoint[dimIndex]=currPosition[dimIndex];// Make tooltip do not overlap axisPointer and in the middle of the grid.\nvar tooltipOptions=[{verticalAlign:'middle'},{align:'center'}];return{position:currPosition,rotation:transform.rotation,cursorPoint:cursorPoint,tooltipOption:tooltipOptions[dimIndex]};}});function getCartesian(grid,axis){var opt={};opt[axis.dim+'AxisIndex']=axis.index;return grid.getCartesian(opt);}var pointerShapeBuilder={line:function line(axis,pixelValue,otherExtent){var targetShape=makeLineShape([pixelValue,otherExtent[0]],[pixelValue,otherExtent[1]],getAxisDimIndex(axis));return{type:'Line',subPixelOptimize:true,shape:targetShape};},shadow:function shadow(axis,pixelValue,otherExtent){var bandWidth=Math.max(1,axis.getBandWidth());var span=otherExtent[1]-otherExtent[0];return{type:'Rect',shape:makeRectShape([pixelValue-bandWidth/2,otherExtent[0]],[bandWidth,span],getAxisDimIndex(axis))};}};function getAxisDimIndex(axis){return axis.dim==='x'?0:1;}AxisView.registerAxisPointerClass('CartesianAxisPointer',CartesianAxisPointer);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // CartesianAxisPointer is not supposed to be required here. But consider\n// echarts.simple.js and online build tooltip, which only require gridSimple,\n// CartesianAxisPointer should be able to required somewhere.\nregisterPreprocessor(function(option){// Always has a global axisPointerModel for default setting.\nif(option){(!option.axisPointer||option.axisPointer.length===0)&&(option.axisPointer={});var link=option.axisPointer.link;// Normalize to array to avoid object mergin. But if link\n// is not set, remain null/undefined, otherwise it will\n// override existent link setting.\nif(link&&!isArray(link)){option.axisPointer.link=[link];}}});// This process should proformed after coordinate systems created\n// and series data processed. So put it on statistic processing stage.\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC,function(ecModel,api){// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\necModel.getComponent('axisPointer').coordSysAxesInfo=collect(ecModel,api);});// Broadcast to all views.\nregisterAction({type:'updateAxisPointer',event:'updateAxisPointer',update:':updateAxisPointer'},axisTrigger);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/extendComponentModel({type:'tooltip',dependencies:['axisPointer'],defaultOption:{zlevel:0,z:60,show:true,// tooltip主体内容\nshowContent:true,// 'trigger' only works on coordinate system.\n// 'item' | 'axis' | 'none'\ntrigger:'item',// 'click' | 'mousemove' | 'none'\ntriggerOn:'mousemove|click',alwaysShowContent:false,displayMode:'single',// 'single' | 'multipleByCoordSys'\nrenderMode:'auto',// 'auto' | 'html' | 'richText'\n// 'auto': use html by default, and use non-html if `document` is not defined\n// 'html': use html for tooltip\n// 'richText': use canvas, svg, and etc. for tooltip\n// 位置 {Array} | {Function}\n// position: null\n// Consider triggered from axisPointer handle, verticalAlign should be 'middle'\n// align: null,\n// verticalAlign: null,\n// 是否约束 content 在 viewRect 中。默认 false 是为了兼容以前版本。\nconfine:false,// 内容格式器:{string}(Template) ¦ {Function}\n// formatter: null\nshowDelay:0,// 隐藏延迟,单位ms\nhideDelay:100,// 动画变换时间,单位s\ntransitionDuration:0.4,enterable:false,// 提示背景颜色,默认为透明度为0.7的黑色\nbackgroundColor:'rgba(50,50,50,0.7)',// 提示边框颜色\nborderColor:'#333',// 提示边框圆角,单位px,默认为4\nborderRadius:4,// 提示边框线宽,单位px,默认为0(无边框)\nborderWidth:0,// 提示内边距,单位px,默认各方向内边距为5,\n// 接受数组分别设定上右下左边距,同css\npadding:5,// Extra css text\nextraCssText:'',// 坐标轴指示器,坐标轴触发有效\naxisPointer:{// 默认为直线\n// 可选为:'line' | 'shadow' | 'cross'\ntype:'line',// type 为 line 的时候有效,指定 tooltip line 所在的轴,可选\n// 可选 'x' | 'y' | 'angle' | 'radius' | 'auto'\n// 默认 'auto',会选择类型为 category 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴\n// 极坐标系会默认选择 angle 轴\naxis:'auto',animation:'auto',animationDurationUpdate:200,animationEasingUpdate:'exponentialOut',crossStyle:{color:'#999',width:1,type:'dashed',// TODO formatter\ntextStyle:{}}// lineStyle and shadowStyle should not be specified here,\n// otherwise it will always override those styles on option.axisPointer.\n},textStyle:{color:'#fff',fontSize:14}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$10=each$1;var toCamelCase$1=toCamelCase;var vendors=['','-webkit-','-moz-','-o-'];var gCssText='position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';/**\n * @param {number} duration\n * @return {string}\n * @inner\n */function assembleTransition(duration){var transitionCurve='cubic-bezier(0.23, 1, 0.32, 1)';var transitionText='left '+duration+'s '+transitionCurve+','+'top '+duration+'s '+transitionCurve;return map(vendors,function(vendorPrefix){return vendorPrefix+'transition:'+transitionText;}).join(';');}/**\n * @param {Object} textStyle\n * @return {string}\n * @inner\n */function assembleFont(textStyleModel){var cssText=[];var fontSize=textStyleModel.get('fontSize');var color=textStyleModel.getTextColor();color&&cssText.push('color:'+color);cssText.push('font:'+textStyleModel.getFont());var lineHeight=textStyleModel.get('lineHeight');if(lineHeight==null){lineHeight=Math.round(fontSize*3/2);}fontSize&&cssText.push('line-height:'+lineHeight+'px');var shadowColor=textStyleModel.get('textShadowColor');var shadowBlur=textStyleModel.get('textShadowBlur')||0;var shadowOffsetX=textStyleModel.get('textShadowOffsetX')||0;var shadowOffsetY=textStyleModel.get('textShadowOffsetY')||0;shadowBlur&&cssText.push('text-shadow:'+shadowOffsetX+'px '+shadowOffsetY+'px '+shadowBlur+'px '+shadowColor);each$10(['decoration','align'],function(name){var val=textStyleModel.get(name);val&&cssText.push('text-'+name+':'+val);});return cssText.join(';');}/**\n * @param {Object} tooltipModel\n * @return {string}\n * @inner\n */function assembleCssText(tooltipModel){var cssText=[];var transitionDuration=tooltipModel.get('transitionDuration');var backgroundColor=tooltipModel.get('backgroundColor');var textStyleModel=tooltipModel.getModel('textStyle');var padding=tooltipModel.get('padding');// Animation transition. Do not animate when transitionDuration is 0.\ntransitionDuration&&cssText.push(assembleTransition(transitionDuration));if(backgroundColor){if(env$1.canvasSupported){cssText.push('background-Color:'+backgroundColor);}else{// for ie\ncssText.push('background-Color:#'+toHex(backgroundColor));cssText.push('filter:alpha(opacity=70)');}}// Border style\neach$10(['width','color','radius'],function(name){var borderName='border-'+name;var camelCase=toCamelCase$1(borderName);var val=tooltipModel.get(camelCase);val!=null&&cssText.push(borderName+':'+val+(name==='color'?'':'px'));});// Text style\ncssText.push(assembleFont(textStyleModel));// Padding\nif(padding!=null){cssText.push('padding:'+normalizeCssArray$1(padding).join('px ')+'px');}return cssText.join(';')+';';}// If not able to make, do not modify the input `out`.\nfunction makeStyleCoord(out,zr,appendToBody,zrX,zrY){var zrPainter=zr&&zr.painter;if(appendToBody){var zrViewportRoot=zrPainter&&zrPainter.getViewportRoot();if(zrViewportRoot){// Some APPs might use scale on body, so we support CSS transform here.\ntransformLocalCoord(out,zrViewportRoot,document.body,zrX,zrY);}}else{out[0]=zrX;out[1]=zrY;// xy should be based on canvas root. But tooltipContent is\n// the sibling of canvas root. So padding of ec container\n// should be considered here.\nvar viewportRootOffset=zrPainter&&zrPainter.getViewportRootOffset();if(viewportRootOffset){out[0]+=viewportRootOffset.offsetLeft;out[1]+=viewportRootOffset.offsetTop;}}out[2]=out[0]/zr.getWidth();// The ratio of left to width\nout[3]=out[1]/zr.getHeight();// The ratio of top to height\n}/**\n * @alias module:echarts/component/tooltip/TooltipContent\n * @param {HTMLElement} container\n * @param {ExtensionAPI} api\n * @param {Object} [opt]\n * @param {boolean} [opt.appendToBody]\n * `false`: the DOM element will be inside the container. Default value.\n * `true`: the DOM element will be appended to HTML body, which avoid\n * some overflow clip but intrude outside of the container.\n * @constructor\n */function TooltipContent(container,api,opt){if(env$1.wxa){return null;}var el=document.createElement('div');el.domBelongToZr=true;this.el=el;var zr=this._zr=api.getZr();var appendToBody=this._appendToBody=opt&&opt.appendToBody;this._styleCoord=[0,0,0,0];// [left, top, left/width, top/height]\nmakeStyleCoord(this._styleCoord,zr,appendToBody,api.getWidth()/2,api.getHeight()/2);if(appendToBody){document.body.appendChild(el);}else{container.appendChild(el);}this._container=container;this._show=false;/**\n * @private\n */this._hideTimeout;// FIXME\n// Is it needed to trigger zr event manually if\n// the browser do not support `pointer-events: none`.\nvar self=this;el.onmouseenter=function(){// clear the timeout in hideLater and keep showing tooltip\nif(self._enterable){clearTimeout(self._hideTimeout);self._show=true;}self._inContent=true;};el.onmousemove=function(e){e=e||window.event;if(!self._enterable){// `pointer-events: none` is set to tooltip content div\n// if `enterable` is set as `false`, and `el.onmousemove`\n// can not be triggered. But in browser that do not\n// support `pointer-events`, we need to do this:\n// Try trigger zrender event to avoid mouse\n// in and out shape too frequently\nvar handler=zr.handler;var zrViewportRoot=zr.painter.getViewportRoot();normalizeEvent(zrViewportRoot,e,true);handler.dispatch('mousemove',e);}};el.onmouseleave=function(){if(self._enterable){if(self._show){self.hideLater(self._hideDelay);}}self._inContent=false;};}TooltipContent.prototype={constructor:TooltipContent,/**\n * @private\n * @type {boolean}\n */_enterable:true,/**\n * Update when tooltip is rendered\n */update:function update(tooltipModel){// FIXME\n// Move this logic to ec main?\nvar container=this._container;var stl=container.currentStyle||document.defaultView.getComputedStyle(container);var domStyle=container.style;if(domStyle.position!=='absolute'&&stl.position!=='absolute'){domStyle.position='relative';}var alwaysShowContent=tooltipModel.get('alwaysShowContent');alwaysShowContent&&this._moveTooltipIfResized();// Hide the tooltip\n// PENDING\n// this.hide();\n},/**\n * when `alwaysShowContent` is true,\n * we should move the tooltip after chart resized\n */_moveTooltipIfResized:function _moveTooltipIfResized(){var ratioX=this._styleCoord[2];// The ratio of left to width\nvar ratioY=this._styleCoord[3];// The ratio of top to height\nvar realX=ratioX*this._zr.getWidth();var realY=ratioY*this._zr.getHeight();this.moveTo(realX,realY);},show:function show(tooltipModel){clearTimeout(this._hideTimeout);var el=this.el;var styleCoord=this._styleCoord;el.style.cssText=gCssText+assembleCssText(tooltipModel)// Because of the reason described in:\n// http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore\n// we should set initial value to `left` and `top`.\n+';left:'+styleCoord[0]+'px;top:'+styleCoord[1]+'px;'+(tooltipModel.get('extraCssText')||'');el.style.display=el.innerHTML?'block':'none';// If mouse occasionally move over the tooltip, a mouseout event will be\n// triggered by canvas, and cause some unexpectable result like dragging\n// stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n// it. Although it is not supported by IE8~IE10, fortunately it is a rare\n// scenario.\nel.style.pointerEvents=this._enterable?'auto':'none';this._show=true;},setContent:function setContent(content){this.el.innerHTML=content==null?'':content;},setEnterable:function setEnterable(enterable){this._enterable=enterable;},getSize:function getSize(){var el=this.el;return[el.clientWidth,el.clientHeight];},moveTo:function moveTo(zrX,zrY){var styleCoord=this._styleCoord;makeStyleCoord(styleCoord,this._zr,this._appendToBody,zrX,zrY);var style=this.el.style;style.left=styleCoord[0]+'px';style.top=styleCoord[1]+'px';},hide:function hide(){this.el.style.display='none';this._show=false;},hideLater:function hideLater(time){if(this._show&&!(this._inContent&&this._enterable)){if(time){this._hideDelay=time;// Set show false to avoid invoke hideLater multiple times\nthis._show=false;this._hideTimeout=setTimeout(bind(this.hide,this),time);}else{this.hide();}}},isShow:function isShow(){return this._show;},dispose:function dispose(){this.el.parentNode.removeChild(this.el);},getOuterSize:function getOuterSize(){var width=this.el.clientWidth;var height=this.el.clientHeight;// Consider browser compatibility.\n// IE8 does not support getComputedStyle.\nif(document.defaultView&&document.defaultView.getComputedStyle){var stl=document.defaultView.getComputedStyle(this.el);if(stl){width+=parseInt(stl.borderLeftWidth,10)+parseInt(stl.borderRightWidth,10);height+=parseInt(stl.borderTopWidth,10)+parseInt(stl.borderBottomWidth,10);}}return{width:width,height:height};}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // import Group from 'zrender/src/container/Group';\nfunction makeStyleCoord$1(out,zr,zrX,zrY){out[0]=zrX;out[1]=zrY;out[2]=out[0]/zr.getWidth();// The ratio of left to width\nout[3]=out[1]/zr.getHeight();// The ratio of top to height\n}/**\n * @alias module:echarts/component/tooltip/TooltipRichContent\n * @constructor\n */function TooltipRichContent(api){var zr=this._zr=api.getZr();this._styleCoord=[0,0,0,0];// [left, top, left/width, top/height]\nmakeStyleCoord$1(this._styleCoord,zr,api.getWidth()/2,api.getHeight()/2);this._show=false;/**\n * @private\n */this._hideTimeout;}TooltipRichContent.prototype={constructor:TooltipRichContent,/**\n * @private\n * @type {boolean}\n */_enterable:true,/**\n * Update when tooltip is rendered\n */update:function update(tooltipModel){var alwaysShowContent=tooltipModel.get('alwaysShowContent');alwaysShowContent&&this._moveTooltipIfResized();},/**\n * when `alwaysShowContent` is true,\n * we should move the tooltip after chart resized\n */_moveTooltipIfResized:function _moveTooltipIfResized(){var ratioX=this._styleCoord[2];// The ratio of left to width\nvar ratioY=this._styleCoord[3];// The ratio of top to height\nvar realX=ratioX*this._zr.getWidth();var realY=ratioY*this._zr.getHeight();this.moveTo(realX,realY);},show:function show(tooltipModel){if(this._hideTimeout){clearTimeout(this._hideTimeout);}this.el.attr('show',true);this._show=true;},/**\n * Set tooltip content\n *\n * @param {string} content rich text string of content\n * @param {Object} markerRich rich text style\n * @param {Object} tooltipModel tooltip model\n */setContent:function setContent(content,markerRich,tooltipModel){if(this.el){this._zr.remove(this.el);}var markers={};var text=content;var prefix='{marker';var suffix='|}';var startId=text.indexOf(prefix);while(startId>=0){var endId=text.indexOf(suffix);var name=text.substr(startId+prefix.length,endId-startId-prefix.length);if(name.indexOf('sub')>-1){markers['marker'+name]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:markerRich[name],// TODO: textOffset is not implemented for rich text\ntextOffset:[3,0]};}else{markers['marker'+name]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:markerRich[name]};}text=text.substr(endId+1);startId=text.indexOf('{marker');}var textStyleModel=tooltipModel.getModel('textStyle');var fontSize=textStyleModel.get('fontSize');var lineHeight=tooltipModel.get('textLineHeight');if(lineHeight==null){lineHeight=Math.round(fontSize*3/2);}this.el=new Text({style:setTextStyle({},textStyleModel,{rich:markers,text:content,textBackgroundColor:tooltipModel.get('backgroundColor'),textBorderRadius:tooltipModel.get('borderRadius'),textFill:tooltipModel.get('textStyle.color'),textPadding:tooltipModel.get('padding'),textLineHeight:lineHeight}),z:tooltipModel.get('z')});this._zr.add(this.el);var self=this;this.el.on('mouseover',function(){// clear the timeout in hideLater and keep showing tooltip\nif(self._enterable){clearTimeout(self._hideTimeout);self._show=true;}self._inContent=true;});this.el.on('mouseout',function(){if(self._enterable){if(self._show){self.hideLater(self._hideDelay);}}self._inContent=false;});},setEnterable:function setEnterable(enterable){this._enterable=enterable;},getSize:function getSize(){var bounding=this.el.getBoundingRect();return[bounding.width,bounding.height];},moveTo:function moveTo(x,y){if(this.el){var styleCoord=this._styleCoord;makeStyleCoord$1(styleCoord,this._zr,x,y);this.el.attr('position',[styleCoord[0],styleCoord[1]]);}},hide:function hide(){if(this.el){this.el.hide();}this._show=false;},hideLater:function hideLater(time){if(this._show&&!(this._inContent&&this._enterable)){if(time){this._hideDelay=time;// Set show false to avoid invoke hideLater multiple times\nthis._show=false;this._hideTimeout=setTimeout(bind(this.hide,this),time);}else{this.hide();}}},isShow:function isShow(){return this._show;},dispose:function dispose(){clearTimeout(this._hideTimeout);if(this.el){this._zr.remove(this.el);}},getOuterSize:function getOuterSize(){var size=this.getSize();return{width:size[0],height:size[1]};}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var bind$2=bind;var each$9=each$1;var parsePercent$2=parsePercent$1;var proxyRect=new Rect({shape:{x:-1,y:-1,width:2,height:2}});extendComponentView({type:'tooltip',init:function init(ecModel,api){if(env$1.node){return;}var tooltipModel=ecModel.getComponent('tooltip');var renderMode=tooltipModel.get('renderMode');this._renderMode=getTooltipRenderMode(renderMode);var tooltipContent;if(this._renderMode==='html'){tooltipContent=new TooltipContent(api.getDom(),api,{appendToBody:tooltipModel.get('appendToBody',true)});this._newLine='
';}else{tooltipContent=new TooltipRichContent(api);this._newLine='\\n';}this._tooltipContent=tooltipContent;},render:function render(tooltipModel,ecModel,api){if(env$1.node){return;}// Reset\nthis.group.removeAll();/**\n * @private\n * @type {module:echarts/component/tooltip/TooltipModel}\n */this._tooltipModel=tooltipModel;/**\n * @private\n * @type {module:echarts/model/Global}\n */this._ecModel=ecModel;/**\n * @private\n * @type {module:echarts/ExtensionAPI}\n */this._api=api;/**\n * Should be cleaned when render.\n * @private\n * @type {Array.>}\n */this._lastDataByCoordSys=null;/**\n * @private\n * @type {boolean}\n */this._alwaysShowContent=tooltipModel.get('alwaysShowContent');var tooltipContent=this._tooltipContent;tooltipContent.update(tooltipModel);tooltipContent.setEnterable(tooltipModel.get('enterable'));this._initGlobalListener();this._keepShow();},_initGlobalListener:function _initGlobalListener(){var tooltipModel=this._tooltipModel;var triggerOn=tooltipModel.get('triggerOn');register('itemTooltip',this._api,bind$2(function(currTrigger,e,dispatchAction){// If 'none', it is not controlled by mouse totally.\nif(triggerOn!=='none'){if(triggerOn.indexOf(currTrigger)>=0){this._tryShow(e,dispatchAction);}else if(currTrigger==='leave'){this._hide(dispatchAction);}}},this));},_keepShow:function _keepShow(){var tooltipModel=this._tooltipModel;var ecModel=this._ecModel;var api=this._api;// Try to keep the tooltip show when refreshing\nif(this._lastX!=null&&this._lastY!=null// When user is willing to control tooltip totally using API,\n// self.manuallyShowTip({x, y}) might cause tooltip hide,\n// which is not expected.\n&&tooltipModel.get('triggerOn')!=='none'){var self=this;clearTimeout(this._refreshUpdateTimeout);this._refreshUpdateTimeout=setTimeout(function(){// Show tip next tick after other charts are rendered\n// In case highlight action has wrong result\n// FIXME\n!api.isDisposed()&&self.manuallyShowTip(tooltipModel,ecModel,api,{x:self._lastX,y:self._lastY});});}},/**\n * Show tip manually by\n * dispatchAction({\n * type: 'showTip',\n * x: 10,\n * y: 10\n * });\n * Or\n * dispatchAction({\n * type: 'showTip',\n * seriesIndex: 0,\n * dataIndex or dataIndexInside or name\n * });\n *\n * TODO Batch\n */manuallyShowTip:function manuallyShowTip(tooltipModel,ecModel,api,payload){if(payload.from===this.uid||env$1.node){return;}var dispatchAction=makeDispatchAction$1(payload,api);// Reset ticket\nthis._ticket='';// When triggered from axisPointer.\nvar dataByCoordSys=payload.dataByCoordSys;if(payload.tooltip&&payload.x!=null&&payload.y!=null){var el=proxyRect;el.position=[payload.x,payload.y];el.update();el.tooltip=payload.tooltip;// Manually show tooltip while view is not using zrender elements.\nthis._tryShow({offsetX:payload.x,offsetY:payload.y,target:el},dispatchAction);}else if(dataByCoordSys){this._tryShow({offsetX:payload.x,offsetY:payload.y,position:payload.position,dataByCoordSys:payload.dataByCoordSys,tooltipOption:payload.tooltipOption},dispatchAction);}else if(payload.seriesIndex!=null){if(this._manuallyAxisShowTip(tooltipModel,ecModel,api,payload)){return;}var pointInfo=findPointFromSeries(payload,ecModel);var cx=pointInfo.point[0];var cy=pointInfo.point[1];if(cx!=null&&cy!=null){this._tryShow({offsetX:cx,offsetY:cy,position:payload.position,target:pointInfo.el},dispatchAction);}}else if(payload.x!=null&&payload.y!=null){// FIXME\n// should wrap dispatchAction like `axisPointer/globalListener` ?\napi.dispatchAction({type:'updateAxisPointer',x:payload.x,y:payload.y});this._tryShow({offsetX:payload.x,offsetY:payload.y,position:payload.position,target:api.getZr().findHover(payload.x,payload.y).target},dispatchAction);}},manuallyHideTip:function manuallyHideTip(tooltipModel,ecModel,api,payload){var tooltipContent=this._tooltipContent;if(!this._alwaysShowContent&&this._tooltipModel){tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));}this._lastX=this._lastY=null;if(payload.from!==this.uid){this._hide(makeDispatchAction$1(payload,api));}},// Be compatible with previous design, that is, when tooltip.type is 'axis' and\n// dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n// and tooltip.\n_manuallyAxisShowTip:function _manuallyAxisShowTip(tooltipModel,ecModel,api,payload){var seriesIndex=payload.seriesIndex;var dataIndex=payload.dataIndex;var coordSysAxesInfo=ecModel.getComponent('axisPointer').coordSysAxesInfo;if(seriesIndex==null||dataIndex==null||coordSysAxesInfo==null){return;}var seriesModel=ecModel.getSeriesByIndex(seriesIndex);if(!seriesModel){return;}var data=seriesModel.getData();var tooltipModel=buildTooltipModel([data.getItemModel(dataIndex),seriesModel,(seriesModel.coordinateSystem||{}).model,tooltipModel]);if(tooltipModel.get('trigger')!=='axis'){return;}api.dispatchAction({type:'updateAxisPointer',seriesIndex:seriesIndex,dataIndex:dataIndex,position:payload.position});return true;},_tryShow:function _tryShow(e,dispatchAction){var el=e.target;var tooltipModel=this._tooltipModel;if(!tooltipModel){return;}// Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\nthis._lastX=e.offsetX;this._lastY=e.offsetY;var dataByCoordSys=e.dataByCoordSys;if(dataByCoordSys&&dataByCoordSys.length){this._showAxisTooltip(dataByCoordSys,e);}// Always show item tooltip if mouse is on the element with dataIndex\nelse if(el&&el.dataIndex!=null){this._lastDataByCoordSys=null;this._showSeriesItemTooltip(e,el,dispatchAction);}// Tooltip provided directly. Like legend.\nelse if(el&&el.tooltip){this._lastDataByCoordSys=null;this._showComponentItemTooltip(e,el,dispatchAction);}else{this._lastDataByCoordSys=null;this._hide(dispatchAction);}},_showOrMove:function _showOrMove(tooltipModel,cb){// showDelay is used in this case: tooltip.enterable is set\n// as true. User intent to move mouse into tooltip and click\n// something. `showDelay` makes it easier to enter the content\n// but tooltip do not move immediately.\nvar delay=tooltipModel.get('showDelay');cb=bind(cb,this);clearTimeout(this._showTimout);delay>0?this._showTimout=setTimeout(cb,delay):cb();},_showAxisTooltip:function _showAxisTooltip(dataByCoordSys,e){var ecModel=this._ecModel;var globalTooltipModel=this._tooltipModel;var point=[e.offsetX,e.offsetY];var singleDefaultHTML=[];var singleParamsList=[];var singleTooltipModel=buildTooltipModel([e.tooltipOption,globalTooltipModel]);var renderMode=this._renderMode;var newLine=this._newLine;var markers={};each$9(dataByCoordSys,function(itemCoordSys){// var coordParamList = [];\n// var coordDefaultHTML = [];\n// var coordTooltipModel = buildTooltipModel([\n// e.tooltipOption,\n// itemCoordSys.tooltipOption,\n// ecModel.getComponent(itemCoordSys.coordSysMainType, itemCoordSys.coordSysIndex),\n// globalTooltipModel\n// ]);\n// var displayMode = coordTooltipModel.get('displayMode');\n// var paramsList = displayMode === 'single' ? singleParamsList : [];\neach$9(itemCoordSys.dataByAxis,function(item){var axisModel=ecModel.getComponent(item.axisDim+'Axis',item.axisIndex);var axisValue=item.value;var seriesDefaultHTML=[];if(!axisModel||axisValue==null){return;}var valueLabel=getValueLabel(axisValue,axisModel.axis,ecModel,item.seriesDataIndices,item.valueLabelOpt);each$1(item.seriesDataIndices,function(idxItem){var series=ecModel.getSeriesByIndex(idxItem.seriesIndex);var dataIndex=idxItem.dataIndexInside;var dataParams=series&&series.getDataParams(dataIndex);dataParams.axisDim=item.axisDim;dataParams.axisIndex=item.axisIndex;dataParams.axisType=item.axisType;dataParams.axisId=item.axisId;dataParams.axisValue=getAxisRawValue(axisModel.axis,axisValue);dataParams.axisValueLabel=valueLabel;if(dataParams){singleParamsList.push(dataParams);var seriesTooltip=series.formatTooltip(dataIndex,true,null,renderMode);var html;if(isObject$1(seriesTooltip)){html=seriesTooltip.html;var newMarkers=seriesTooltip.markers;merge(markers,newMarkers);}else{html=seriesTooltip;}seriesDefaultHTML.push(html);}});// Default tooltip content\n// FIXME\n// (1) should be the first data which has name?\n// (2) themeRiver, firstDataIndex is array, and first line is unnecessary.\nvar firstLine=valueLabel;if(renderMode!=='html'){singleDefaultHTML.push(seriesDefaultHTML.join(newLine));}else{singleDefaultHTML.push((firstLine?encodeHTML(firstLine)+newLine:'')+seriesDefaultHTML.join(newLine));}});},this);// In most case, the second axis is shown upper than the first one.\nsingleDefaultHTML.reverse();singleDefaultHTML=singleDefaultHTML.join(this._newLine+this._newLine);var positionExpr=e.position;this._showOrMove(singleTooltipModel,function(){if(this._updateContentNotChangedOnAxis(dataByCoordSys)){this._updatePosition(singleTooltipModel,positionExpr,point[0],point[1],this._tooltipContent,singleParamsList);}else{this._showTooltipContent(singleTooltipModel,singleDefaultHTML,singleParamsList,Math.random(),point[0],point[1],positionExpr,undefined,markers);}});// Do not trigger events here, because this branch only be entered\n// from dispatchAction.\n},_showSeriesItemTooltip:function _showSeriesItemTooltip(e,el,dispatchAction){var ecModel=this._ecModel;// Use dataModel in element if possible\n// Used when mouseover on a element like markPoint or edge\n// In which case, the data is not main data in series.\nvar seriesIndex=el.seriesIndex;var seriesModel=ecModel.getSeriesByIndex(seriesIndex);// For example, graph link.\nvar dataModel=el.dataModel||seriesModel;var dataIndex=el.dataIndex;var dataType=el.dataType;var data=dataModel.getData(dataType);var tooltipModel=buildTooltipModel([data.getItemModel(dataIndex),dataModel,seriesModel&&(seriesModel.coordinateSystem||{}).model,this._tooltipModel]);var tooltipTrigger=tooltipModel.get('trigger');if(tooltipTrigger!=null&&tooltipTrigger!=='item'){return;}var params=dataModel.getDataParams(dataIndex,dataType);var seriesTooltip=dataModel.formatTooltip(dataIndex,false,dataType,this._renderMode);var defaultHtml;var markers;if(isObject$1(seriesTooltip)){defaultHtml=seriesTooltip.html;markers=seriesTooltip.markers;}else{defaultHtml=seriesTooltip;markers=null;}var asyncTicket='item_'+dataModel.name+'_'+dataIndex;this._showOrMove(tooltipModel,function(){this._showTooltipContent(tooltipModel,defaultHtml,params,asyncTicket,e.offsetX,e.offsetY,e.position,e.target,markers);});// FIXME\n// duplicated showtip if manuallyShowTip is called from dispatchAction.\ndispatchAction({type:'showTip',dataIndexInside:dataIndex,dataIndex:data.getRawIndex(dataIndex),seriesIndex:seriesIndex,from:this.uid});},_showComponentItemTooltip:function _showComponentItemTooltip(e,el,dispatchAction){var tooltipOpt=el.tooltip;if(typeof tooltipOpt==='string'){var content=tooltipOpt;tooltipOpt={content:content,// Fixed formatter\nformatter:content};}var subTooltipModel=new Model(tooltipOpt,this._tooltipModel,this._ecModel);var defaultHtml=subTooltipModel.get('content');var asyncTicket=Math.random();// Do not check whether `trigger` is 'none' here, because `trigger`\n// only works on coordinate system. In fact, we have not found case\n// that requires setting `trigger` nothing on component yet.\nthis._showOrMove(subTooltipModel,function(){this._showTooltipContent(subTooltipModel,defaultHtml,subTooltipModel.get('formatterParams')||{},asyncTicket,e.offsetX,e.offsetY,e.position,el);});// If not dispatch showTip, tip may be hide triggered by axis.\ndispatchAction({type:'showTip',from:this.uid});},_showTooltipContent:function _showTooltipContent(tooltipModel,defaultHtml,params,asyncTicket,x,y,positionExpr,el,markers){// Reset ticket\nthis._ticket='';if(!tooltipModel.get('showContent')||!tooltipModel.get('show')){return;}var tooltipContent=this._tooltipContent;var formatter=tooltipModel.get('formatter');positionExpr=positionExpr||tooltipModel.get('position');var html=defaultHtml;if(formatter&&typeof formatter==='string'){html=formatTpl(formatter,params,true);}else if(typeof formatter==='function'){var callback=bind$2(function(cbTicket,html){if(cbTicket===this._ticket){tooltipContent.setContent(html,markers,tooltipModel);this._updatePosition(tooltipModel,positionExpr,x,y,tooltipContent,params,el);}},this);this._ticket=asyncTicket;html=formatter(params,asyncTicket,callback);}tooltipContent.setContent(html,markers,tooltipModel);tooltipContent.show(tooltipModel);this._updatePosition(tooltipModel,positionExpr,x,y,tooltipContent,params,el);},/**\n * @param {string|Function|Array.|Object} positionExpr\n * @param {number} x Mouse x\n * @param {number} y Mouse y\n * @param {boolean} confine Whether confine tooltip content in view rect.\n * @param {Object|} params\n * @param {module:zrender/Element} el target element\n * @param {module:echarts/ExtensionAPI} api\n * @return {Array.}\n */_updatePosition:function _updatePosition(tooltipModel,positionExpr,x,y,content,params,el){var viewWidth=this._api.getWidth();var viewHeight=this._api.getHeight();positionExpr=positionExpr||tooltipModel.get('position');var contentSize=content.getSize();var align=tooltipModel.get('align');var vAlign=tooltipModel.get('verticalAlign');var rect=el&&el.getBoundingRect().clone();el&&rect.applyTransform(el.transform);if(typeof positionExpr==='function'){// Callback of position can be an array or a string specify the position\npositionExpr=positionExpr([x,y],params,content.el,rect,{viewSize:[viewWidth,viewHeight],contentSize:contentSize.slice()});}if(isArray(positionExpr)){x=parsePercent$2(positionExpr[0],viewWidth);y=parsePercent$2(positionExpr[1],viewHeight);}else if(isObject$1(positionExpr)){positionExpr.width=contentSize[0];positionExpr.height=contentSize[1];var layoutRect=getLayoutRect(positionExpr,{width:viewWidth,height:viewHeight});x=layoutRect.x;y=layoutRect.y;align=null;// When positionExpr is left/top/right/bottom,\n// align and verticalAlign will not work.\nvAlign=null;}// Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\nelse if(typeof positionExpr==='string'&&el){var pos=calcTooltipPosition(positionExpr,rect,contentSize);x=pos[0];y=pos[1];}else{var pos=refixTooltipPosition(x,y,content,viewWidth,viewHeight,align?null:20,vAlign?null:20);x=pos[0];y=pos[1];}align&&(x-=isCenterAlign(align)?contentSize[0]/2:align==='right'?contentSize[0]:0);vAlign&&(y-=isCenterAlign(vAlign)?contentSize[1]/2:vAlign==='bottom'?contentSize[1]:0);if(tooltipModel.get('confine')){var pos=confineTooltipPosition(x,y,content,viewWidth,viewHeight);x=pos[0];y=pos[1];}content.moveTo(x,y);},// FIXME\n// Should we remove this but leave this to user?\n_updateContentNotChangedOnAxis:function _updateContentNotChangedOnAxis(dataByCoordSys){var lastCoordSys=this._lastDataByCoordSys;var contentNotChanged=!!lastCoordSys&&lastCoordSys.length===dataByCoordSys.length;contentNotChanged&&each$9(lastCoordSys,function(lastItemCoordSys,indexCoordSys){var lastDataByAxis=lastItemCoordSys.dataByAxis||{};var thisItemCoordSys=dataByCoordSys[indexCoordSys]||{};var thisDataByAxis=thisItemCoordSys.dataByAxis||[];contentNotChanged&=lastDataByAxis.length===thisDataByAxis.length;contentNotChanged&&each$9(lastDataByAxis,function(lastItem,indexAxis){var thisItem=thisDataByAxis[indexAxis]||{};var lastIndices=lastItem.seriesDataIndices||[];var newIndices=thisItem.seriesDataIndices||[];contentNotChanged&=lastItem.value===thisItem.value&&lastItem.axisType===thisItem.axisType&&lastItem.axisId===thisItem.axisId&&lastIndices.length===newIndices.length;contentNotChanged&&each$9(lastIndices,function(lastIdxItem,j){var newIdxItem=newIndices[j];contentNotChanged&=lastIdxItem.seriesIndex===newIdxItem.seriesIndex&&lastIdxItem.dataIndex===newIdxItem.dataIndex;});});});this._lastDataByCoordSys=dataByCoordSys;return!!contentNotChanged;},_hide:function _hide(dispatchAction){// Do not directly hideLater here, because this behavior may be prevented\n// in dispatchAction when showTip is dispatched.\n// FIXME\n// duplicated hideTip if manuallyHideTip is called from dispatchAction.\nthis._lastDataByCoordSys=null;dispatchAction({type:'hideTip',from:this.uid});},dispose:function dispose(ecModel,api){if(env$1.node){return;}this._tooltipContent.dispose();unregister('itemTooltip',api);}});/**\n * @param {Array.} modelCascade\n * From top to bottom. (the last one should be globalTooltipModel);\n */function buildTooltipModel(modelCascade){var resultModel=modelCascade.pop();while(modelCascade.length){var tooltipOpt=modelCascade.pop();if(tooltipOpt){if(Model.isInstance(tooltipOpt)){tooltipOpt=tooltipOpt.get('tooltip',true);}// In each data item tooltip can be simply write:\n// {\n// value: 10,\n// tooltip: 'Something you need to know'\n// }\nif(typeof tooltipOpt==='string'){tooltipOpt={formatter:tooltipOpt};}resultModel=new Model(tooltipOpt,resultModel,resultModel.ecModel);}}return resultModel;}function makeDispatchAction$1(payload,api){return payload.dispatchAction||bind(api.dispatchAction,api);}function refixTooltipPosition(x,y,content,viewWidth,viewHeight,gapH,gapV){var size=content.getOuterSize();var width=size.width;var height=size.height;if(gapH!=null){if(x+width+gapH>viewWidth){x-=width+gapH;}else{x+=gapH;}}if(gapV!=null){if(y+height+gapV>viewHeight){y-=height+gapV;}else{y+=gapV;}}return[x,y];}function confineTooltipPosition(x,y,content,viewWidth,viewHeight){var size=content.getOuterSize();var width=size.width;var height=size.height;x=Math.min(x+width,viewWidth)-width;y=Math.min(y+height,viewHeight)-height;x=Math.max(x,0);y=Math.max(y,0);return[x,y];}function calcTooltipPosition(position,rect,contentSize){var domWidth=contentSize[0];var domHeight=contentSize[1];var gap=5;var x=0;var y=0;var rectWidth=rect.width;var rectHeight=rect.height;switch(position){case'inside':x=rect.x+rectWidth/2-domWidth/2;y=rect.y+rectHeight/2-domHeight/2;break;case'top':x=rect.x+rectWidth/2-domWidth/2;y=rect.y-domHeight-gap;break;case'bottom':x=rect.x+rectWidth/2-domWidth/2;y=rect.y+rectHeight+gap;break;case'left':x=rect.x-domWidth-gap;y=rect.y+rectHeight/2-domHeight/2;break;case'right':x=rect.x+rectWidth+gap;y=rect.y+rectHeight/2-domHeight/2;}return[x,y];}function isCenterAlign(align){return align==='center'||align==='middle';}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // FIXME Better way to pack data in graphic element\n/**\n * @action\n * @property {string} type\n * @property {number} seriesIndex\n * @property {number} dataIndex\n * @property {number} [x]\n * @property {number} [y]\n */registerAction({type:'showTip',event:'showTip',update:'tooltip:manuallyShowTip'},// noop\nfunction(){});registerAction({type:'hideTip',event:'hideTip',update:'tooltip:manuallyHideTip'},// noop\nfunction(){});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var langSelector=lang.legend.selector;var defaultSelectorOption={all:{type:'all',title:_clone(langSelector.all)},inverse:{type:'inverse',title:_clone(langSelector.inverse)}};var LegendModel=extendComponentModel({type:'legend.plain',dependencies:['series'],layoutMode:{type:'box',// legend.width/height are maxWidth/maxHeight actually,\n// whereas realy width/height is calculated by its content.\n// (Setting {left: 10, right: 10} does not make sense).\n// So consider the case:\n// `setOption({legend: {left: 10});`\n// then `setOption({legend: {right: 10});`\n// The previous `left` should be cleared by setting `ignoreSize`.\nignoreSize:true},init:function init(option,parentModel,ecModel){this.mergeDefaultAndTheme(option,ecModel);option.selected=option.selected||{};this._updateSelector(option);},mergeOption:function mergeOption(option){LegendModel.superCall(this,'mergeOption',option);this._updateSelector(option);},_updateSelector:function _updateSelector(option){var selector=option.selector;if(selector===true){selector=option.selector=['all','inverse'];}if(isArray(selector)){each$1(selector,function(item,index){isString(item)&&(item={type:item});selector[index]=merge(item,defaultSelectorOption[item.type]);});}},optionUpdated:function optionUpdated(){this._updateData(this.ecModel);var legendData=this._data;// If selectedMode is single, try to select one\nif(legendData[0]&&this.get('selectedMode')==='single'){var hasSelected=false;// If has any selected in option.selected\nfor(var i=0;i}\n * @private\n */this._availableNames=availableNames;// If legend.data not specified in option, use availableNames as data,\n// which is convinient for user preparing option.\nvar rawData=this.get('data')||potentialData;var legendData=map(rawData,function(dataItem){// Can be string or number\nif(typeof dataItem==='string'||typeof dataItem==='number'){dataItem={name:dataItem};}return new Model(dataItem,this,this.ecModel);},this);/**\n * @type {Array.}\n * @private\n */this._data=legendData;},/**\n * @return {Array.}\n */getData:function getData(){return this._data;},/**\n * @param {string} name\n */select:function select(name){var selected=this.option.selected;var selectedMode=this.get('selectedMode');if(selectedMode==='single'){var data=this._data;each$1(data,function(dataItem){selected[dataItem.get('name')]=false;});}selected[name]=true;},/**\n * @param {string} name\n */unSelect:function unSelect(name){if(this.get('selectedMode')!=='single'){this.option.selected[name]=false;}},/**\n * @param {string} name\n */toggleSelected:function toggleSelected(name){var selected=this.option.selected;// Default is true\nif(!selected.hasOwnProperty(name)){selected[name]=true;}this[selected[name]?'unSelect':'select'](name);},allSelect:function allSelect(){var data=this._data;var selected=this.option.selected;each$1(data,function(dataItem){selected[dataItem.get('name',true)]=true;});},inverseSelect:function inverseSelect(){var data=this._data;var selected=this.option.selected;each$1(data,function(dataItem){var name=dataItem.get('name',true);// Initially, default value is true\nif(!selected.hasOwnProperty(name)){selected[name]=true;}selected[name]=!selected[name];});},/**\n * @param {string} name\n */isSelected:function isSelected(name){var selected=this.option.selected;return!(selected.hasOwnProperty(name)&&!selected[name])&&indexOf(this._availableNames,name)>=0;},getOrient:function getOrient(){return this.get('orient')==='vertical'?{index:1,name:'vertical'}:{index:0,name:'horizontal'};},defaultOption:{// 一级层叠\nzlevel:0,// 二级层叠\nz:4,show:true,// 布局方式,默认为水平布局,可选为:\n// 'horizontal' | 'vertical'\norient:'horizontal',left:'center',// right: 'center',\ntop:0,// bottom: null,\n// 水平对齐\n// 'auto' | 'left' | 'right'\n// 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐\nalign:'auto',backgroundColor:'rgba(0,0,0,0)',// 图例边框颜色\nborderColor:'#ccc',borderRadius:0,// 图例边框线宽,单位px,默认为0(无边框)\nborderWidth:0,// 图例内边距,单位px,默认各方向内边距为5,\n// 接受数组分别设定上右下左边距,同css\npadding:5,// 各个item之间的间隔,单位px,默认为10,\n// 横向布局时为水平间隔,纵向布局时为纵向间隔\nitemGap:10,// the width of legend symbol\nitemWidth:25,// the height of legend symbol\nitemHeight:14,// the color of unselected legend symbol\ninactiveColor:'#ccc',// the borderColor of unselected legend symbol\ninactiveBorderColor:'#ccc',itemStyle:{// the default borderWidth of legend symbol\nborderWidth:0},textStyle:{// 图例文字颜色\ncolor:'#333'},// formatter: '',\n// 选择模式,默认开启图例开关\nselectedMode:true,// 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入\n// selected: null,\n// 图例内容(详见legend.data,数组中每一项代表一个item\n// data: [],\n// Usage:\n// selector: [{type: 'all or inverse', title: xxx}]\n// or\n// selector: true\n// or\n// selector: ['all', 'inverse']\nselector:false,selectorLabel:{show:true,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:' sans-serif',color:'#666',borderWidth:1,borderColor:'#666'},emphasis:{selectorLabel:{show:true,color:'#eee',backgroundColor:'#666'}},// Value can be 'start' or 'end'\nselectorPosition:'auto',selectorItemGap:7,selectorButtonGap:10,// Tooltip 相关配置\ntooltip:{show:false}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function legendSelectActionHandler(methodName,payload,ecModel){var selectedMap={};var isToggleSelect=methodName==='toggleSelected';var isSelected;// Update all legend components\necModel.eachComponent('legend',function(legendModel){if(isToggleSelect&&isSelected!=null){// Force other legend has same selected status\n// Or the first is toggled to true and other are toggled to false\n// In the case one legend has some item unSelected in option. And if other legend\n// doesn't has the item, they will assume it is selected.\nlegendModel[isSelected?'select':'unSelect'](payload.name);}else if(methodName==='allSelect'||methodName==='inverseSelect'){legendModel[methodName]();}else{legendModel[methodName](payload.name);isSelected=legendModel.isSelected(payload.name);}var legendData=legendModel.getData();each$1(legendData,function(model){var name=model.get('name');// Wrap element\nif(name==='\\n'||name===''){return;}var isItemSelected=legendModel.isSelected(name);if(selectedMap.hasOwnProperty(name)){// Unselected if any legend is unselected\nselectedMap[name]=selectedMap[name]&&isItemSelected;}else{selectedMap[name]=isItemSelected;}});});// Return the event explicitly\nreturn methodName==='allSelect'||methodName==='inverseSelect'?{selected:selectedMap}:{name:payload.name,selected:selectedMap};}/**\n * @event legendToggleSelect\n * @type {Object}\n * @property {string} type 'legendToggleSelect'\n * @property {string} [from]\n * @property {string} name Series name or data item name\n */registerAction('legendToggleSelect','legendselectchanged',curry(legendSelectActionHandler,'toggleSelected'));registerAction('legendAllSelect','legendselectall',curry(legendSelectActionHandler,'allSelect'));registerAction('legendInverseSelect','legendinverseselect',curry(legendSelectActionHandler,'inverseSelect'));/**\n * @event legendSelect\n * @type {Object}\n * @property {string} type 'legendSelect'\n * @property {string} name Series name or data item name\n */registerAction('legendSelect','legendselected',curry(legendSelectActionHandler,'select'));/**\n * @event legendUnSelect\n * @type {Object}\n * @property {string} type 'legendUnSelect'\n * @property {string} name Series name or data item name\n */registerAction('legendUnSelect','legendunselected',curry(legendSelectActionHandler,'unSelect'));/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */function layout$2(group,componentModel,api){var boxLayoutParams=componentModel.getBoxLayoutParams();var padding=componentModel.get('padding');var viewportSize={width:api.getWidth(),height:api.getHeight()};var rect=getLayoutRect(boxLayoutParams,viewportSize,padding);box(componentModel.get('orient'),group,componentModel.get('itemGap'),rect.width,rect.height);positionElement(group,boxLayoutParams,viewportSize,padding);}function makeBackground(rect,componentModel){var padding=normalizeCssArray$1(componentModel.get('padding'));var style=componentModel.getItemStyle(['color','opacity']);style.fill=componentModel.get('backgroundColor');var rect=new Rect({shape:{x:rect.x-padding[3],y:rect.y-padding[0],width:rect.width+padding[1]+padding[3],height:rect.height+padding[0]+padding[2],r:componentModel.get('borderRadius')},style:style,silent:true,z2:-1});// FIXME\n// `subPixelOptimizeRect` may bring some gap between edge of viewpart\n// and background rect when setting like `left: 0`, `top: 0`.\n// graphic.subPixelOptimizeRect(rect);\nreturn rect;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var curry$3=curry;var each$11=each$1;var Group$2=Group;var LegendView=extendComponentView({type:'legend.plain',newlineDisabled:false,/**\n * @override\n */init:function init(){/**\n * @private\n * @type {module:zrender/container/Group}\n */this.group.add(this._contentGroup=new Group$2());/**\n * @private\n * @type {module:zrender/Element}\n */this._backgroundEl;/**\n * @private\n * @type {module:zrender/container/Group}\n */this.group.add(this._selectorGroup=new Group$2());/**\n * If first rendering, `contentGroup.position` is [0, 0], which\n * does not make sense and may cause unexepcted animation if adopted.\n * @private\n * @type {boolean}\n */this._isFirstRender=true;},/**\n * @protected\n */getContentGroup:function getContentGroup(){return this._contentGroup;},/**\n * @protected\n */getSelectorGroup:function getSelectorGroup(){return this._selectorGroup;},/**\n * @override\n */render:function render(legendModel,ecModel,api){var isFirstRender=this._isFirstRender;this._isFirstRender=false;this.resetInner();if(!legendModel.get('show',true)){return;}var itemAlign=legendModel.get('align');var orient=legendModel.get('orient');if(!itemAlign||itemAlign==='auto'){itemAlign=legendModel.get('left')==='right'&&orient==='vertical'?'right':'left';}var selector=legendModel.get('selector',true);var selectorPosition=legendModel.get('selectorPosition',true);if(selector&&(!selectorPosition||selectorPosition==='auto')){selectorPosition=orient==='horizontal'?'end':'start';}this.renderInner(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition);// Perform layout.\nvar positionInfo=legendModel.getBoxLayoutParams();var viewportSize={width:api.getWidth(),height:api.getHeight()};var padding=legendModel.get('padding');var maxSize=getLayoutRect(positionInfo,viewportSize,padding);var mainRect=this.layoutInner(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition);// Place mainGroup, based on the calculated `mainRect`.\nvar layoutRect=getLayoutRect(defaults({width:mainRect.width,height:mainRect.height},positionInfo),viewportSize,padding);this.group.attr('position',[layoutRect.x-mainRect.x,layoutRect.y-mainRect.y]);// Render background after group is layout.\nthis.group.add(this._backgroundEl=makeBackground(mainRect,legendModel));},/**\n * @protected\n */resetInner:function resetInner(){this.getContentGroup().removeAll();this._backgroundEl&&this.group.remove(this._backgroundEl);this.getSelectorGroup().removeAll();},/**\n * @protected\n */renderInner:function renderInner(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition){var contentGroup=this.getContentGroup();var legendDrawnMap=createHashMap();var selectMode=legendModel.get('selectedMode');var excludeSeriesId=[];ecModel.eachRawSeries(function(seriesModel){!seriesModel.get('legendHoverLink')&&excludeSeriesId.push(seriesModel.id);});each$11(legendModel.getData(),function(itemModel,dataIndex){var name=itemModel.get('name');// Use empty string or \\n as a newline string\nif(!this.newlineDisabled&&(name===''||name==='\\n')){contentGroup.add(new Group$2({newline:true}));return;}// Representitive series.\nvar seriesModel=ecModel.getSeriesByName(name)[0];if(legendDrawnMap.get(name)){// Have been drawed\nreturn;}// Legend to control series.\nif(seriesModel){var data=seriesModel.getData();var color=data.getVisual('color');var borderColor=data.getVisual('borderColor');// If color is a callback function\nif(typeof color==='function'){// Use the first data\ncolor=color(seriesModel.getDataParams(0));}// If borderColor is a callback function\nif(typeof borderColor==='function'){// Use the first data\nborderColor=borderColor(seriesModel.getDataParams(0));}// Using rect symbol defaultly\nvar legendSymbolType=data.getVisual('legendSymbol')||'roundRect';var symbolType=data.getVisual('symbol');var itemGroup=this._createItem(name,dataIndex,itemModel,legendModel,legendSymbolType,symbolType,itemAlign,color,borderColor,selectMode);itemGroup.on('click',curry$3(dispatchSelectAction,name,null,api,excludeSeriesId)).on('mouseover',curry$3(dispatchHighlightAction,seriesModel.name,null,api,excludeSeriesId)).on('mouseout',curry$3(dispatchDownplayAction,seriesModel.name,null,api,excludeSeriesId));legendDrawnMap.set(name,true);}else{// Legend to control data. In pie and funnel.\necModel.eachRawSeries(function(seriesModel){// In case multiple series has same data name\nif(legendDrawnMap.get(name)){return;}if(seriesModel.legendVisualProvider){var provider=seriesModel.legendVisualProvider;if(!provider.containName(name)){return;}var idx=provider.indexOfName(name);var color=provider.getItemVisual(idx,'color');var borderColor=provider.getItemVisual(idx,'borderColor');var legendSymbolType='roundRect';var itemGroup=this._createItem(name,dataIndex,itemModel,legendModel,legendSymbolType,null,itemAlign,color,borderColor,selectMode);// FIXME: consider different series has items with the same name.\nitemGroup.on('click',curry$3(dispatchSelectAction,null,name,api,excludeSeriesId))// Should not specify the series name, consider legend controls\n// more than one pie series.\n.on('mouseover',curry$3(dispatchHighlightAction,null,name,api,excludeSeriesId)).on('mouseout',curry$3(dispatchDownplayAction,null,name,api,excludeSeriesId));legendDrawnMap.set(name,true);}},this);}if(__DEV__){if(!legendDrawnMap.get(name)){console.warn(name+' series not exists. Legend data should be same with series name or data name.');}}},this);if(selector){this._createSelector(selector,legendModel,api,orient,selectorPosition);}},_createSelector:function _createSelector(selector,legendModel,api,orient,selectorPosition){var selectorGroup=this.getSelectorGroup();each$11(selector,function(selectorItem){createSelectorButton(selectorItem);});function createSelectorButton(selectorItem){var type=selectorItem.type;var labelText=new Text({style:{x:0,y:0,align:'center',verticalAlign:'middle'},onclick:function onclick(){api.dispatchAction({type:type==='all'?'legendAllSelect':'legendInverseSelect'});}});selectorGroup.add(labelText);var labelModel=legendModel.getModel('selectorLabel');var emphasisLabelModel=legendModel.getModel('emphasis.selectorLabel');setLabelStyle(labelText.style,labelText.hoverStyle={},labelModel,emphasisLabelModel,{defaultText:selectorItem.title,isRectText:false});setHoverStyle(labelText);}},_createItem:function _createItem(name,dataIndex,itemModel,legendModel,legendSymbolType,symbolType,itemAlign,color,borderColor,selectMode){var itemWidth=legendModel.get('itemWidth');var itemHeight=legendModel.get('itemHeight');var inactiveColor=legendModel.get('inactiveColor');var inactiveBorderColor=legendModel.get('inactiveBorderColor');var symbolKeepAspect=legendModel.get('symbolKeepAspect');var legendModelItemStyle=legendModel.getModel('itemStyle');var isSelected=legendModel.isSelected(name);var itemGroup=new Group$2();var textStyleModel=itemModel.getModel('textStyle');var itemIcon=itemModel.get('icon');var tooltipModel=itemModel.getModel('tooltip');var legendGlobalTooltipModel=tooltipModel.parentModel;// Use user given icon first\nlegendSymbolType=itemIcon||legendSymbolType;var legendSymbol=createSymbol(legendSymbolType,0,0,itemWidth,itemHeight,isSelected?color:inactiveColor,// symbolKeepAspect default true for legend\nsymbolKeepAspect==null?true:symbolKeepAspect);itemGroup.add(setSymbolStyle(legendSymbol,legendSymbolType,legendModelItemStyle,borderColor,inactiveBorderColor,isSelected));// Compose symbols\n// PENDING\nif(!itemIcon&&symbolType// At least show one symbol, can't be all none\n&&(symbolType!==legendSymbolType||symbolType==='none')){var size=itemHeight*0.8;if(symbolType==='none'){symbolType='circle';}var legendSymbolCenter=createSymbol(symbolType,(itemWidth-size)/2,(itemHeight-size)/2,size,size,isSelected?color:inactiveColor,// symbolKeepAspect default true for legend\nsymbolKeepAspect==null?true:symbolKeepAspect);// Put symbol in the center\nitemGroup.add(setSymbolStyle(legendSymbolCenter,symbolType,legendModelItemStyle,borderColor,inactiveBorderColor,isSelected));}var textX=itemAlign==='left'?itemWidth+5:-5;var textAlign=itemAlign;var formatter=legendModel.get('formatter');var content=name;if(typeof formatter==='string'&&formatter){content=formatter.replace('{name}',name!=null?name:'');}else if(typeof formatter==='function'){content=formatter(name);}itemGroup.add(new Text({style:setTextStyle({},textStyleModel,{text:content,x:textX,y:itemHeight/2,textFill:isSelected?textStyleModel.getTextColor():inactiveColor,textAlign:textAlign,textVerticalAlign:'middle'})}));// Add a invisible rect to increase the area of mouse hover\nvar hitRect=new Rect({shape:itemGroup.getBoundingRect(),invisible:true,tooltip:tooltipModel.get('show')?extend({content:name,// Defaul formatter\nformatter:legendGlobalTooltipModel.get('formatter',true)||function(){return name;},formatterParams:{componentType:'legend',legendIndex:legendModel.componentIndex,name:name,$vars:['name']}},tooltipModel.option):null});itemGroup.add(hitRect);itemGroup.eachChild(function(child){child.silent=true;});hitRect.silent=!selectMode;this.getContentGroup().add(itemGroup);setHoverStyle(itemGroup);itemGroup.__legendDataIndex=dataIndex;return itemGroup;},/**\n * @protected\n */layoutInner:function layoutInner(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition){var contentGroup=this.getContentGroup();var selectorGroup=this.getSelectorGroup();// Place items in contentGroup.\nbox(legendModel.get('orient'),contentGroup,legendModel.get('itemGap'),maxSize.width,maxSize.height);var contentRect=contentGroup.getBoundingRect();var contentPos=[-contentRect.x,-contentRect.y];if(selector){// Place buttons in selectorGroup\nbox(// Buttons in selectorGroup always layout horizontally\n'horizontal',selectorGroup,legendModel.get('selectorItemGap',true));var selectorRect=selectorGroup.getBoundingRect();var selectorPos=[-selectorRect.x,-selectorRect.y];var selectorButtonGap=legendModel.get('selectorButtonGap',true);var orientIdx=legendModel.getOrient().index;var wh=orientIdx===0?'width':'height';var hw=orientIdx===0?'height':'width';var yx=orientIdx===0?'y':'x';if(selectorPosition==='end'){selectorPos[orientIdx]+=contentRect[wh]+selectorButtonGap;}else{contentPos[orientIdx]+=selectorRect[wh]+selectorButtonGap;}//Always align selector to content as 'middle'\nselectorPos[1-orientIdx]+=contentRect[hw]/2-selectorRect[hw]/2;selectorGroup.attr('position',selectorPos);contentGroup.attr('position',contentPos);var mainRect={x:0,y:0};mainRect[wh]=contentRect[wh]+selectorButtonGap+selectorRect[wh];mainRect[hw]=Math.max(contentRect[hw],selectorRect[hw]);mainRect[yx]=Math.min(0,selectorRect[yx]+selectorPos[1-orientIdx]);return mainRect;}else{contentGroup.attr('position',contentPos);return this.group.getBoundingRect();}},/**\n * @protected\n */remove:function remove(){this.getContentGroup().removeAll();this._isFirstRender=true;}});function setSymbolStyle(symbol,symbolType,legendModelItemStyle,borderColor,inactiveBorderColor,isSelected){var itemStyle;if(symbolType!=='line'&&symbolType.indexOf('empty')<0){itemStyle=legendModelItemStyle.getItemStyle();symbol.style.stroke=borderColor;if(!isSelected){itemStyle.stroke=inactiveBorderColor;}}else{itemStyle=legendModelItemStyle.getItemStyle(['borderWidth','borderColor']);}return symbol.setStyle(itemStyle);}function dispatchSelectAction(seriesName,dataName,api,excludeSeriesId){// downplay before unselect\ndispatchDownplayAction(seriesName,dataName,api,excludeSeriesId);api.dispatchAction({type:'legendToggleSelect',name:seriesName!=null?seriesName:dataName});// highlight after select\ndispatchHighlightAction(seriesName,dataName,api,excludeSeriesId);}function dispatchHighlightAction(seriesName,dataName,api,excludeSeriesId){// If element hover will move to a hoverLayer.\nvar el=api.getZr().storage.getDisplayList()[0];if(!(el&&el.useHoverLayer)){api.dispatchAction({type:'highlight',seriesName:seriesName,name:dataName,excludeSeriesId:excludeSeriesId});}}function dispatchDownplayAction(seriesName,dataName,api,excludeSeriesId){// If element hover will move to a hoverLayer.\nvar el=api.getZr().storage.getDisplayList()[0];if(!(el&&el.useHoverLayer)){api.dispatchAction({type:'downplay',seriesName:seriesName,name:dataName,excludeSeriesId:excludeSeriesId});}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var legendFilter=function legendFilter(ecModel){var legendModels=ecModel.findComponents({mainType:'legend'});if(legendModels&&legendModels.length){ecModel.filterSeries(function(series){// If in any legend component the status is not selected.\n// Because in legend series is assumed selected when it is not in the legend data.\nfor(var i=0;imaxSize[wh];var contentPos=[-contentRect.x,-contentRect.y];// Remain contentPos when scroll animation perfroming.\n// If first rendering, `contentGroup.position` is [0, 0], which\n// does not make sense and may cause unexepcted animation if adopted.\nif(!isFirstRender){contentPos[orientIdx]=contentGroup.position[orientIdx];}// Layout container group based on 0.\nvar containerPos=[0,0];var controllerPos=[-controllerRect.x,-controllerRect.y];var pageButtonGap=retrieve2(legendModel.get('pageButtonGap',true),legendModel.get('itemGap',true));// Place containerGroup and controllerGroup and contentGroup.\nif(showController){var pageButtonPosition=legendModel.get('pageButtonPosition',true);// controller is on the right / bottom.\nif(pageButtonPosition==='end'){controllerPos[orientIdx]+=maxSize[wh]-controllerRect[wh];}// controller is on the left / top.\nelse{containerPos[orientIdx]+=controllerRect[wh]+pageButtonGap;}}// Always align controller to content as 'middle'.\ncontrollerPos[1-orientIdx]+=contentRect[hw]/2-controllerRect[hw]/2;contentGroup.attr('position',contentPos);containerGroup.attr('position',containerPos);controllerGroup.attr('position',controllerPos);// Calculate `mainRect` and set `clipPath`.\n// mainRect should not be calculated by `this.group.getBoundingRect()`\n// for sake of the overflow.\nvar mainRect={x:0,y:0};// Consider content may be overflow (should be clipped).\nmainRect[wh]=showController?maxSize[wh]:contentRect[wh];mainRect[hw]=Math.max(contentRect[hw],controllerRect[hw]);// `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\nmainRect[yx]=Math.min(0,controllerRect[yx]+controllerPos[1-orientIdx]);containerGroup.__rectSize=maxSize[wh];if(showController){var clipShape={x:0,y:0};clipShape[wh]=Math.max(maxSize[wh]-controllerRect[wh]-pageButtonGap,0);clipShape[hw]=mainRect[hw];containerGroup.setClipPath(new Rect({shape:clipShape}));// Consider content may be larger than container, container rect\n// can not be obtained from `containerGroup.getBoundingRect()`.\ncontainerGroup.__rectSize=clipShape[wh];}else{// Do not remove or ignore controller. Keep them set as placeholders.\ncontrollerGroup.eachChild(function(child){child.attr({invisible:true,silent:true});});}// Content translate animation.\nvar pageInfo=this._getPageInfo(legendModel);pageInfo.pageIndex!=null&&updateProps(contentGroup,{position:pageInfo.contentPosition},// When switch from \"show controller\" to \"not show controller\", view should be\n// updated immediately without animation, otherwise causes weird effect.\nshowController?legendModel:false);this._updatePageInfoView(legendModel,pageInfo);return mainRect;},_pageGo:function _pageGo(to,legendModel,api){var scrollDataIndex=this._getPageInfo(legendModel)[to];scrollDataIndex!=null&&api.dispatchAction({type:'legendScroll',scrollDataIndex:scrollDataIndex,legendId:legendModel.id});},_updatePageInfoView:function _updatePageInfoView(legendModel,pageInfo){var controllerGroup=this._controllerGroup;each$1(['pagePrev','pageNext'],function(name){var canJump=pageInfo[name+'DataIndex']!=null;var icon=controllerGroup.childOfName(name);if(icon){icon.setStyle('fill',canJump?legendModel.get('pageIconColor',true):legendModel.get('pageIconInactiveColor',true));icon.cursor=canJump?'pointer':'default';}});var pageText=controllerGroup.childOfName('pageText');var pageFormatter=legendModel.get('pageFormatter');var pageIndex=pageInfo.pageIndex;var current=pageIndex!=null?pageIndex+1:0;var total=pageInfo.pageCount;pageText&&pageFormatter&&pageText.setStyle('text',isString(pageFormatter)?pageFormatter.replace('{current}',current).replace('{total}',total):pageFormatter({current:current,total:total}));},/**\n * @param {module:echarts/model/Model} legendModel\n * @return {Object} {\n * contentPosition: Array., null when data item not found.\n * pageIndex: number, null when data item not found.\n * pageCount: number, always be a number, can be 0.\n * pagePrevDataIndex: number, null when no previous page.\n * pageNextDataIndex: number, null when no next page.\n * }\n */_getPageInfo:function _getPageInfo(legendModel){var scrollDataIndex=legendModel.get('scrollDataIndex',true);var contentGroup=this.getContentGroup();var containerRectSize=this._containerGroup.__rectSize;var orientIdx=legendModel.getOrient().index;var wh=WH[orientIdx];var xy=XY[orientIdx];var targetItemIndex=this._findTargetItemIndex(scrollDataIndex);var children=contentGroup.children();var targetItem=children[targetItemIndex];var itemCount=children.length;var pCount=!itemCount?0:1;var result={contentPosition:contentGroup.position.slice(),pageCount:pCount,pageIndex:pCount-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!targetItem){return result;}var targetItemInfo=getItemInfo(targetItem);result.contentPosition[orientIdx]=-targetItemInfo.s;// Strategy:\n// (1) Always align based on the left/top most item.\n// (2) It is user-friendly that the last item shown in the\n// current window is shown at the begining of next window.\n// Otherwise if half of the last item is cut by the window,\n// it will have no chance to display entirely.\n// (3) Consider that item size probably be different, we\n// have calculate pageIndex by size rather than item index,\n// and we can not get page index directly by division.\n// (4) The window is to narrow to contain more than\n// one item, we should make sure that the page can be fliped.\nfor(var i=targetItemIndex+1,winStartItemInfo=targetItemInfo,winEndItemInfo=targetItemInfo,currItemInfo=null;i<=itemCount;++i){currItemInfo=getItemInfo(children[i]);if(// Half of the last item is out of the window.\n!currItemInfo&&winEndItemInfo.e>winStartItemInfo.s+containerRectSize||// If the current item does not intersect with the window, the new page\n// can be started at the current item or the last item.\ncurrItemInfo&&!intersect(currItemInfo,winStartItemInfo.s)){if(winEndItemInfo.i>winStartItemInfo.i){winStartItemInfo=winEndItemInfo;}else{// e.g., when page size is smaller than item size.\nwinStartItemInfo=currItemInfo;}if(winStartItemInfo){if(result.pageNextDataIndex==null){result.pageNextDataIndex=winStartItemInfo.i;}++result.pageCount;}}winEndItemInfo=currItemInfo;}for(var i=targetItemIndex-1,winStartItemInfo=targetItemInfo,winEndItemInfo=targetItemInfo,currItemInfo=null;i>=-1;--i){currItemInfo=getItemInfo(children[i]);if(// If the the end item does not intersect with the window started\n// from the current item, a page can be settled.\n(!currItemInfo||!intersect(winEndItemInfo,currItemInfo.s))&&// e.g., when page size is smaller than item size.\nwinStartItemInfo.i=winStart&&itemInfo.s<=winStart+containerRectSize;}},_findTargetItemIndex:function _findTargetItemIndex(targetDataIndex){if(!this._showController){return 0;}var index;var contentGroup=this.getContentGroup();var defaultIndex;contentGroup.eachChild(function(child,idx){var legendDataIdx=child.__legendDataIndex;// FIXME\n// If the given targetDataIndex (from model) is illegal,\n// we use defaultIndex. But the index on the legend model and\n// action payload is still illegal. That case will not be\n// changed until some scenario requires.\nif(defaultIndex==null&&legendDataIdx!=null){defaultIndex=idx;}if(legendDataIdx===targetDataIndex){index=idx;}});return index!=null?index:defaultIndex;}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @event legendScroll\n * @type {Object}\n * @property {string} type 'legendScroll'\n * @property {string} scrollDataIndex\n */registerAction('legendScroll','legendscroll',function(payload,ecModel){var scrollDataIndex=payload.scrollDataIndex;scrollDataIndex!=null&&ecModel.eachComponent({mainType:'legend',subType:'scroll',query:payload},function(legendModel){legendModel.setScrollDataIndex(scrollDataIndex);});});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Legend component entry file8\n */ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Model\nextendComponentModel({type:'title',layoutMode:{type:'box',ignoreSize:true},defaultOption:{// 一级层叠\nzlevel:0,// 二级层叠\nz:6,show:true,text:'',// 超链接跳转\n// link: null,\n// 仅支持self | blank\ntarget:'blank',subtext:'',// 超链接跳转\n// sublink: null,\n// 仅支持self | blank\nsubtarget:'blank',// 'center' ¦ 'left' ¦ 'right'\n// ¦ {number}(x坐标,单位px)\nleft:0,// 'top' ¦ 'bottom' ¦ 'center'\n// ¦ {number}(y坐标,单位px)\ntop:0,// 水平对齐\n// 'auto' | 'left' | 'right' | 'center'\n// 默认根据 left 的位置判断是左对齐还是右对齐\n// textAlign: null\n//\n// 垂直对齐\n// 'auto' | 'top' | 'bottom' | 'middle'\n// 默认根据 top 位置判断是上对齐还是下对齐\n// textVerticalAlign: null\n// textBaseline: null // The same as textVerticalAlign.\nbackgroundColor:'rgba(0,0,0,0)',// 标题边框颜色\nborderColor:'#ccc',// 标题边框线宽,单位px,默认为0(无边框)\nborderWidth:0,// 标题内边距,单位px,默认各方向内边距为5,\n// 接受数组分别设定上右下左边距,同css\npadding:5,// 主副标题纵向间隔,单位px,默认为10,\nitemGap:10,textStyle:{fontSize:18,fontWeight:'bolder',color:'#333'},subtextStyle:{color:'#aaa'}}});// View\nextendComponentView({type:'title',render:function render(titleModel,ecModel,api){this.group.removeAll();if(!titleModel.get('show')){return;}var group=this.group;var textStyleModel=titleModel.getModel('textStyle');var subtextStyleModel=titleModel.getModel('subtextStyle');var textAlign=titleModel.get('textAlign');var textVerticalAlign=retrieve2(titleModel.get('textBaseline'),titleModel.get('textVerticalAlign'));var textEl=new Text({style:setTextStyle({},textStyleModel,{text:titleModel.get('text'),textFill:textStyleModel.getTextColor()},{disableBox:true}),z2:10});var textRect=textEl.getBoundingRect();var subText=titleModel.get('subtext');var subTextEl=new Text({style:setTextStyle({},subtextStyleModel,{text:subText,textFill:subtextStyleModel.getTextColor(),y:textRect.height+titleModel.get('itemGap'),textVerticalAlign:'top'},{disableBox:true}),z2:10});var link=titleModel.get('link');var sublink=titleModel.get('sublink');var triggerEvent=titleModel.get('triggerEvent',true);textEl.silent=!link&&!triggerEvent;subTextEl.silent=!sublink&&!triggerEvent;if(link){textEl.on('click',function(){windowOpen(link,'_'+titleModel.get('target'));});}if(sublink){subTextEl.on('click',function(){windowOpen(sublink,'_'+titleModel.get('subtarget'));});}textEl.eventData=subTextEl.eventData=triggerEvent?{componentType:'title',componentIndex:titleModel.componentIndex}:null;group.add(textEl);subText&&group.add(subTextEl);// If no subText, but add subTextEl, there will be an empty line.\nvar groupRect=group.getBoundingRect();var layoutOption=titleModel.getBoxLayoutParams();layoutOption.width=groupRect.width;layoutOption.height=groupRect.height;var layoutRect=getLayoutRect(layoutOption,{width:api.getWidth(),height:api.getHeight()},titleModel.get('padding'));// Adjust text align based on position\nif(!textAlign){// Align left if title is on the left. center and right is same\ntextAlign=titleModel.get('left')||titleModel.get('right');if(textAlign==='middle'){textAlign='center';}// Adjust layout by text align\nif(textAlign==='right'){layoutRect.x+=layoutRect.width;}else if(textAlign==='center'){layoutRect.x+=layoutRect.width/2;}}if(!textVerticalAlign){textVerticalAlign=titleModel.get('top')||titleModel.get('bottom');if(textVerticalAlign==='center'){textVerticalAlign='middle';}if(textVerticalAlign==='bottom'){layoutRect.y+=layoutRect.height;}else if(textVerticalAlign==='middle'){layoutRect.y+=layoutRect.height/2;}textVerticalAlign=textVerticalAlign||'top';}group.attr('position',[layoutRect.x,layoutRect.y]);var alignStyle={textAlign:textAlign,textVerticalAlign:textVerticalAlign};textEl.setStyle(alignStyle);subTextEl.setStyle(alignStyle);// Render background\n// Get groupRect again because textAlign has been changed\ngroupRect=group.getBoundingRect();var padding=layoutRect.margin;var style=titleModel.getItemStyle(['color','opacity']);style.fill=titleModel.get('backgroundColor');var rect=new Rect({shape:{x:groupRect.x-padding[3],y:groupRect.y-padding[0],width:groupRect.width+padding[1]+padding[3],height:groupRect.height+padding[0]+padding[2],r:titleModel.get('borderRadius')},style:style,subPixelOptimize:true,silent:true});group.add(rect);}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var addCommas$1=addCommas;var encodeHTML$1=encodeHTML;function fillLabel(opt){defaultEmphasis(opt,'label',['show']);}var MarkerModel=extendComponentModel({type:'marker',dependencies:['series','grid','polar','geo'],/**\n * @overrite\n */init:function init(option,parentModel,ecModel){if(__DEV__){if(this.type==='marker'){throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');}}this.mergeDefaultAndTheme(option,ecModel);this._mergeOption(option,ecModel,false,true);},/**\n * @return {boolean}\n */isAnimationEnabled:function isAnimationEnabled(){if(env$1.node){return false;}var hostSeries=this.__hostSeries;return this.getShallow('animation')&&hostSeries&&hostSeries.isAnimationEnabled();},/**\n * @overrite\n */mergeOption:function mergeOption(newOpt,ecModel){this._mergeOption(newOpt,ecModel,false,false);},_mergeOption:function _mergeOption(newOpt,ecModel,createdBySelf,isInit){var MarkerModel=this.constructor;var modelPropName=this.mainType+'Model';if(!createdBySelf){ecModel.eachSeries(function(seriesModel){var markerOpt=seriesModel.get(this.mainType,true);var markerModel=seriesModel[modelPropName];if(!markerOpt||!markerOpt.data){seriesModel[modelPropName]=null;return;}if(!markerModel){if(isInit){// Default label emphasis `position` and `show`\nfillLabel(markerOpt);}each$1(markerOpt.data,function(item){// FIXME Overwrite fillLabel method ?\nif(item instanceof Array){fillLabel(item[0]);fillLabel(item[1]);}else{fillLabel(item);}});markerModel=new MarkerModel(markerOpt,this,ecModel);extend(markerModel,{mainType:this.mainType,// Use the same series index and name\nseriesIndex:seriesModel.seriesIndex,name:seriesModel.name,createdBySelf:true});markerModel.__hostSeries=seriesModel;}else{markerModel._mergeOption(markerOpt,ecModel,true);}seriesModel[modelPropName]=markerModel;},this);}},formatTooltip:function formatTooltip(dataIndex,multipleSeries,dataType,renderMode){var data=this.getData();var value=this.getRawValue(dataIndex);var formattedValue=isArray(value)?map(value,addCommas$1).join(', '):addCommas$1(value);var name=data.getName(dataIndex);var html=encodeHTML$1(this.name);var newLine=renderMode==='html'?'
':'\\n';if(value!=null||name){html+=newLine;}if(name){html+=encodeHTML$1(name);if(value!=null){html+=' : ';}}if(value!=null){html+=encodeHTML$1(formattedValue);}return html;},getData:function getData(){return this._data;},setData:function setData(data){this._data=data;}});mixin(MarkerModel,dataFormatMixin);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/MarkerModel.extend({type:'markPoint',defaultOption:{zlevel:0,z:5,symbol:'pin',symbolSize:50,//symbolRotate: 0,\n//symbolOffset: [0, 0]\ntooltip:{trigger:'item'},label:{show:true,position:'inside'},itemStyle:{borderWidth:2},emphasis:{label:{show:true}}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var indexOf$1=indexOf;function hasXOrY(item){return!(isNaN(parseFloat(item.x))&&isNaN(parseFloat(item.y)));}function hasXAndY(item){return!isNaN(parseFloat(item.x))&&!isNaN(parseFloat(item.y));}// Make it simple, do not visit all stacked value to count precision.\n// function getPrecision(data, valueAxisDim, dataIndex) {\n// var precision = -1;\n// var stackedDim = data.mapDimension(valueAxisDim);\n// do {\n// precision = Math.max(\n// numberUtil.getPrecision(data.get(stackedDim, dataIndex)),\n// precision\n// );\n// var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n// if (stackedOnSeries) {\n// var byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex);\n// data = stackedOnSeries.getData();\n// dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue);\n// stackedDim = data.getCalculationInfo('stackedDimension');\n// }\n// else {\n// data = null;\n// }\n// } while (data);\n// return precision;\n// }\nfunction markerTypeCalculatorWithExtent(mlType,data,otherDataDim,targetDataDim,otherCoordIndex,targetCoordIndex){var coordArr=[];var stacked=isDimensionStacked(data,targetDataDim/*, otherDataDim*/);var calcDataDim=stacked?data.getCalculationInfo('stackResultDimension'):targetDataDim;var value=numCalculate(data,calcDataDim,mlType);var dataIndex=data.indicesOfNearest(calcDataDim,value)[0];coordArr[otherCoordIndex]=data.get(otherDataDim,dataIndex);coordArr[targetCoordIndex]=data.get(calcDataDim,dataIndex);var coordArrValue=data.get(targetDataDim,dataIndex);// Make it simple, do not visit all stacked value to count precision.\nvar precision=getPrecision(data.get(targetDataDim,dataIndex));precision=Math.min(precision,20);if(precision>=0){coordArr[targetCoordIndex]=+coordArr[targetCoordIndex].toFixed(precision);}return[coordArr,coordArrValue];}var curry$4=curry;// TODO Specified percent\nvar markerTypeCalculator={/**\n * @method\n * @param {module:echarts/data/List} data\n * @param {string} baseAxisDim\n * @param {string} valueAxisDim\n */min:curry$4(markerTypeCalculatorWithExtent,'min'),/**\n * @method\n * @param {module:echarts/data/List} data\n * @param {string} baseAxisDim\n * @param {string} valueAxisDim\n */max:curry$4(markerTypeCalculatorWithExtent,'max'),/**\n * @method\n * @param {module:echarts/data/List} data\n * @param {string} baseAxisDim\n * @param {string} valueAxisDim\n */average:curry$4(markerTypeCalculatorWithExtent,'average')};/**\n * Transform markPoint data item to format used in List by do the following\n * 1. Calculate statistic like `max`, `min`, `average`\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/coord/*} [coordSys]\n * @param {Object} item\n * @return {Object}\n */function dataTransform(seriesModel,item){var data=seriesModel.getData();var coordSys=seriesModel.coordinateSystem;// 1. If not specify the position with pixel directly\n// 2. If `coord` is not a data array. Which uses `xAxis`,\n// `yAxis` to specify the coord on each dimension\n// parseFloat first because item.x and item.y can be percent string like '20%'\nif(item&&!hasXAndY(item)&&!isArray(item.coord)&&coordSys){var dims=coordSys.dimensions;var axisInfo=getAxisInfo$1(item,data,coordSys,seriesModel);// Clone the option\n// Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\nitem=_clone(item);if(item.type&&markerTypeCalculator[item.type]&&axisInfo.baseAxis&&axisInfo.valueAxis){var otherCoordIndex=indexOf$1(dims,axisInfo.baseAxis.dim);var targetCoordIndex=indexOf$1(dims,axisInfo.valueAxis.dim);var coordInfo=markerTypeCalculator[item.type](data,axisInfo.baseDataDim,axisInfo.valueDataDim,otherCoordIndex,targetCoordIndex);item.coord=coordInfo[0];// Force to use the value of calculated value.\n// let item use the value without stack.\nitem.value=coordInfo[1];}else{// FIXME Only has one of xAxis and yAxis.\nvar coord=[item.xAxis!=null?item.xAxis:item.radiusAxis,item.yAxis!=null?item.yAxis:item.angleAxis];// Each coord support max, min, average\nfor(var i=0;i<2;i++){if(markerTypeCalculator[coord[i]]){coord[i]=numCalculate(data,data.mapDimension(dims[i]),coord[i]);}}item.coord=coord;}}return item;}function getAxisInfo$1(item,data,coordSys,seriesModel){var ret={};if(item.valueIndex!=null||item.valueDim!=null){ret.valueDataDim=item.valueIndex!=null?data.getDimension(item.valueIndex):item.valueDim;ret.valueAxis=coordSys.getAxis(dataDimToCoordDim(seriesModel,ret.valueDataDim));ret.baseAxis=coordSys.getOtherAxis(ret.valueAxis);ret.baseDataDim=data.mapDimension(ret.baseAxis.dim);}else{ret.baseAxis=seriesModel.getBaseAxis();ret.valueAxis=coordSys.getOtherAxis(ret.baseAxis);ret.baseDataDim=data.mapDimension(ret.baseAxis.dim);ret.valueDataDim=data.mapDimension(ret.valueAxis.dim);}return ret;}function dataDimToCoordDim(seriesModel,dataDim){var data=seriesModel.getData();var dimensions=data.dimensions;dataDim=data.getDimension(dataDim);for(var i=0;i0){n[0]=-n[0];n[1]=-n[1];}var dir=tangent[0]<0?-1:1;if(label.__position!=='start'&&label.__position!=='end'){var rotation=-Math.atan2(tangent[1],tangent[0]);if(toPos[0]0.8?'left':d[0]<-0.8?'right':'center';textVerticalAlign=d[1]>0.8?'top':d[1]<-0.8?'bottom':'middle';break;case'start':textPosition=[-d[0]*distanceX+fromPos[0],-d[1]*distanceY+fromPos[1]];textAlign=d[0]>0.8?'right':d[0]<-0.8?'left':'center';textVerticalAlign=d[1]>0.8?'bottom':d[1]<-0.8?'top':'middle';break;case'insideStartTop':case'insideStart':case'insideStartBottom':textPosition=[distanceX*dir+fromPos[0],fromPos[1]+dy];textAlign=tangent[0]<0?'right':'left';textOrigin=[-distanceX*dir,-dy];break;case'insideMiddleTop':case'insideMiddle':case'insideMiddleBottom':case'middle':textPosition=[cp[0],cp[1]+dy];textAlign='center';textOrigin=[0,-dy];break;case'insideEndTop':case'insideEnd':case'insideEndBottom':textPosition=[-distanceX*dir+toPos[0],toPos[1]+dy];textAlign=tangent[0]>=0?'right':'left';textOrigin=[distanceX*dir,-dy];break;}label.attr({style:{// Use the user specified text align and baseline first\ntextVerticalAlign:label.__verticalAlign||textVerticalAlign,textAlign:label.__textAlign||textAlign},position:textPosition,scale:[invScale,invScale],origin:textOrigin});}}/**\n * @constructor\n * @extends {module:zrender/graphic/Group}\n * @alias {module:echarts/chart/helper/Line}\n */function Line$1(lineData,idx,seriesScope){Group.call(this);this._createLine(lineData,idx,seriesScope);}var lineProto=Line$1.prototype;// Update symbol position and rotation\nlineProto.beforeUpdate=updateSymbolAndLabelBeforeLineUpdate;lineProto._createLine=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel;var linePoints=lineData.getItemLayout(idx);var line=createLine(linePoints);line.shape.percent=0;initProps(line,{shape:{percent:1}},seriesModel,idx);this.add(line);var label=new Text({name:'label',// FIXME\n// Temporary solution for `focusNodeAdjacency`.\n// line label do not use the opacity of lineStyle.\nlineLabelOriginalOpacity:1});this.add(label);each$1(SYMBOL_CATEGORIES,function(symbolCategory){var symbol=createSymbol$1(symbolCategory,lineData,idx);// symbols must added after line to make sure\n// it will be updated after line#update.\n// Or symbol position and rotation update in line#beforeUpdate will be one frame slow\nthis.add(symbol);this[makeSymbolTypeKey(symbolCategory)]=lineData.getItemVisual(idx,symbolCategory);},this);this._updateCommonStl(lineData,idx,seriesScope);};lineProto.updateData=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel;var line=this.childOfName('line');var linePoints=lineData.getItemLayout(idx);var target={shape:{}};setLinePoints(target.shape,linePoints);updateProps(line,target,seriesModel,idx);each$1(SYMBOL_CATEGORIES,function(symbolCategory){var symbolType=lineData.getItemVisual(idx,symbolCategory);var key=makeSymbolTypeKey(symbolCategory);// Symbol changed\nif(this[key]!==symbolType){this.remove(this.childOfName(symbolCategory));var symbol=createSymbol$1(symbolCategory,lineData,idx);this.add(symbol);}this[key]=symbolType;},this);this._updateCommonStl(lineData,idx,seriesScope);};lineProto._updateCommonStl=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel;var line=this.childOfName('line');var lineStyle=seriesScope&&seriesScope.lineStyle;var hoverLineStyle=seriesScope&&seriesScope.hoverLineStyle;var labelModel=seriesScope&&seriesScope.labelModel;var hoverLabelModel=seriesScope&&seriesScope.hoverLabelModel;// Optimization for large dataset\nif(!seriesScope||lineData.hasItemOption){var itemModel=lineData.getItemModel(idx);lineStyle=itemModel.getModel('lineStyle').getLineStyle();hoverLineStyle=itemModel.getModel('emphasis.lineStyle').getLineStyle();labelModel=itemModel.getModel('label');hoverLabelModel=itemModel.getModel('emphasis.label');}var visualColor=lineData.getItemVisual(idx,'color');var visualOpacity=retrieve3(lineData.getItemVisual(idx,'opacity'),lineStyle.opacity,1);line.useStyle(defaults({strokeNoScale:true,fill:'none',stroke:visualColor,opacity:visualOpacity},lineStyle));line.hoverStyle=hoverLineStyle;// Update symbol\neach$1(SYMBOL_CATEGORIES,function(symbolCategory){var symbol=this.childOfName(symbolCategory);if(symbol){symbol.setColor(visualColor);symbol.setStyle({opacity:visualOpacity});}},this);var showLabel=labelModel.getShallow('show');var hoverShowLabel=hoverLabelModel.getShallow('show');var label=this.childOfName('label');var defaultLabelColor;var baseText;// FIXME: the logic below probably should be merged to `graphic.setLabelStyle`.\nif(showLabel||hoverShowLabel){defaultLabelColor=visualColor||'#000';baseText=seriesModel.getFormattedLabel(idx,'normal',lineData.dataType);if(baseText==null){var rawVal=seriesModel.getRawValue(idx);baseText=rawVal==null?lineData.getName(idx):isFinite(rawVal)?round$1(rawVal):rawVal;}}var normalText=showLabel?baseText:null;var emphasisText=hoverShowLabel?retrieve2(seriesModel.getFormattedLabel(idx,'emphasis',lineData.dataType),baseText):null;var labelStyle=label.style;// Always set `textStyle` even if `normalStyle.text` is null, because default\n// values have to be set on `normalStyle`.\nif(normalText!=null||emphasisText!=null){setTextStyle(label.style,labelModel,{text:normalText},{autoColor:defaultLabelColor});label.__textAlign=labelStyle.textAlign;label.__verticalAlign=labelStyle.textVerticalAlign;// 'start', 'middle', 'end'\nlabel.__position=labelModel.get('position')||'middle';var distance$$1=labelModel.get('distance');if(!isArray(distance$$1)){distance$$1=[distance$$1,distance$$1];}label.__labelDistance=distance$$1;}if(emphasisText!=null){// Only these properties supported in this emphasis style here.\nlabel.hoverStyle={text:emphasisText,textFill:hoverLabelModel.getTextColor(true),// For merging hover style to normal style, do not use\n// `hoverLabelModel.getFont()` here.\nfontStyle:hoverLabelModel.getShallow('fontStyle'),fontWeight:hoverLabelModel.getShallow('fontWeight'),fontSize:hoverLabelModel.getShallow('fontSize'),fontFamily:hoverLabelModel.getShallow('fontFamily')};}else{label.hoverStyle={text:null};}label.ignore=!showLabel&&!hoverShowLabel;setHoverStyle(this);};lineProto.highlight=function(){this.trigger('emphasis');};lineProto.downplay=function(){this.trigger('normal');};lineProto.updateLayout=function(lineData,idx){this.setLinePoints(lineData.getItemLayout(idx));};lineProto.setLinePoints=function(points){var linePath=this.childOfName('line');setLinePoints(linePath.shape,points);linePath.dirty();};inherits(Line$1,Group);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @module echarts/chart/helper/LineDraw\n */ // import IncrementalDisplayable from 'zrender/src/graphic/IncrementalDisplayable';\n/**\n * @alias module:echarts/component/marker/LineDraw\n * @constructor\n */function LineDraw(ctor){this._ctor=ctor||Line$1;this.group=new Group();}var lineDrawProto=LineDraw.prototype;lineDrawProto.isPersistent=function(){return true;};/**\n * @param {module:echarts/data/List} lineData\n */lineDrawProto.updateData=function(lineData){var lineDraw=this;var group=lineDraw.group;var oldLineData=lineDraw._lineData;lineDraw._lineData=lineData;// There is no oldLineData only when first rendering or switching from\n// stream mode to normal mode, where previous elements should be removed.\nif(!oldLineData){group.removeAll();}var seriesScope=makeSeriesScope$1(lineData);lineData.diff(oldLineData).add(function(idx){doAdd(lineDraw,lineData,idx,seriesScope);}).update(function(newIdx,oldIdx){doUpdate(lineDraw,oldLineData,lineData,oldIdx,newIdx,seriesScope);}).remove(function(idx){group.remove(oldLineData.getItemGraphicEl(idx));}).execute();};function doAdd(lineDraw,lineData,idx,seriesScope){var itemLayout=lineData.getItemLayout(idx);if(!lineNeedsDraw(itemLayout)){return;}var el=new lineDraw._ctor(lineData,idx,seriesScope);lineData.setItemGraphicEl(idx,el);lineDraw.group.add(el);}function doUpdate(lineDraw,oldLineData,newLineData,oldIdx,newIdx,seriesScope){var itemEl=oldLineData.getItemGraphicEl(oldIdx);if(!lineNeedsDraw(newLineData.getItemLayout(newIdx))){lineDraw.group.remove(itemEl);return;}if(!itemEl){itemEl=new lineDraw._ctor(newLineData,newIdx,seriesScope);}else{itemEl.updateData(newLineData,newIdx,seriesScope);}newLineData.setItemGraphicEl(newIdx,itemEl);lineDraw.group.add(itemEl);}lineDrawProto.updateLayout=function(){var lineData=this._lineData;// Do not support update layout in incremental mode.\nif(!lineData){return;}lineData.eachItemGraphicEl(function(el,idx){el.updateLayout(lineData,idx);},this);};lineDrawProto.incrementalPrepareUpdate=function(lineData){this._seriesScope=makeSeriesScope$1(lineData);this._lineData=null;this.group.removeAll();};function isEffectObject(el){return el.animators&&el.animators.length>0;}lineDrawProto.incrementalUpdate=function(taskParams,lineData){function updateIncrementalAndHover(el){if(!el.isGroup&&!isEffectObject(el)){el.incremental=el.useHoverLayer=true;}}for(var idx=taskParams.start;idx=0&&typeof value==='number'){value=+value.toFixed(Math.min(precision,20));}mlFrom.coord[valueIndex]=mlTo.coord[valueIndex]=value;item=[mlFrom,mlTo,{// Extra option for tooltip and label\ntype:mlType,valueIndex:item.valueIndex,// Force to use the value of calculated value.\nvalue:value}];}item=[dataTransform(seriesModel,item[0]),dataTransform(seriesModel,item[1]),extend({},item[2])];// Avoid line data type is extended by from(to) data type\nitem[2].type=item[2].type||'';// Merge from option and to option into line option\nmerge(item[2],item[0]);merge(item[2],item[1]);return item;};function isInifinity(val){return!isNaN(val)&&!isFinite(val);}// If a markLine has one dim\nfunction ifMarkLineHasOnlyDim(dimIndex,fromCoord,toCoord,coordSys){var otherDimIndex=1-dimIndex;var dimName=coordSys.dimensions[dimIndex];return isInifinity(fromCoord[otherDimIndex])&&isInifinity(toCoord[otherDimIndex])&&fromCoord[dimIndex]===toCoord[dimIndex]&&coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);}function markLineFilter(coordSys,item){if(coordSys.type==='cartesian2d'){var fromCoord=item[0].coord;var toCoord=item[1].coord;// In case\n// {\n// markLine: {\n// data: [{ yAxis: 2 }]\n// }\n// }\nif(fromCoord&&toCoord&&(ifMarkLineHasOnlyDim(1,fromCoord,toCoord,coordSys)||ifMarkLineHasOnlyDim(0,fromCoord,toCoord,coordSys))){return true;}}return dataFilter$1(coordSys,item[0])&&dataFilter$1(coordSys,item[1]);}function updateSingleMarkerEndLayout(data,idx,isFrom,seriesModel,api){var coordSys=seriesModel.coordinateSystem;var itemModel=data.getItemModel(idx);var point;var xPx=parsePercent$1(itemModel.get('x'),api.getWidth());var yPx=parsePercent$1(itemModel.get('y'),api.getHeight());if(!isNaN(xPx)&&!isNaN(yPx)){point=[xPx,yPx];}else{// Chart like bar may have there own marker positioning logic\nif(seriesModel.getMarkerPosition){// Use the getMarkerPoisition\npoint=seriesModel.getMarkerPosition(data.getValues(data.dimensions,idx));}else{var dims=coordSys.dimensions;var x=data.get(dims[0],idx);var y=data.get(dims[1],idx);point=coordSys.dataToPoint([x,y]);}// Expand line to the edge of grid if value on one axis is Inifnity\n// In case\n// markLine: {\n// data: [{\n// yAxis: 2\n// // or\n// type: 'average'\n// }]\n// }\nif(coordSys.type==='cartesian2d'){var xAxis=coordSys.getAxis('x');var yAxis=coordSys.getAxis('y');var dims=coordSys.dimensions;if(isInifinity(data.get(dims[0],idx))){point[0]=xAxis.toGlobalCoord(xAxis.getExtent()[isFrom?0:1]);}else if(isInifinity(data.get(dims[1],idx))){point[1]=yAxis.toGlobalCoord(yAxis.getExtent()[isFrom?0:1]);}}// Use x, y if has any\nif(!isNaN(xPx)){point[0]=xPx;}if(!isNaN(yPx)){point[1]=yPx;}}data.setItemLayout(idx,point);}MarkerView.extend({type:'markLine',// updateLayout: function (markLineModel, ecModel, api) {\n// ecModel.eachSeries(function (seriesModel) {\n// var mlModel = seriesModel.markLineModel;\n// if (mlModel) {\n// var mlData = mlModel.getData();\n// var fromData = mlModel.__from;\n// var toData = mlModel.__to;\n// // Update visual and layout of from symbol and to symbol\n// fromData.each(function (idx) {\n// updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api);\n// updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api);\n// });\n// // Update layout of line\n// mlData.each(function (idx) {\n// mlData.setItemLayout(idx, [\n// fromData.getItemLayout(idx),\n// toData.getItemLayout(idx)\n// ]);\n// });\n// this.markerGroupMap.get(seriesModel.id).updateLayout();\n// }\n// }, this);\n// },\nupdateTransform:function updateTransform(markLineModel,ecModel,api){ecModel.eachSeries(function(seriesModel){var mlModel=seriesModel.markLineModel;if(mlModel){var mlData=mlModel.getData();var fromData=mlModel.__from;var toData=mlModel.__to;// Update visual and layout of from symbol and to symbol\nfromData.each(function(idx){updateSingleMarkerEndLayout(fromData,idx,true,seriesModel,api);updateSingleMarkerEndLayout(toData,idx,false,seriesModel,api);});// Update layout of line\nmlData.each(function(idx){mlData.setItemLayout(idx,[fromData.getItemLayout(idx),toData.getItemLayout(idx)]);});this.markerGroupMap.get(seriesModel.id).updateLayout();}},this);},renderSeries:function renderSeries(seriesModel,mlModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;var seriesId=seriesModel.id;var seriesData=seriesModel.getData();var lineDrawMap=this.markerGroupMap;var lineDraw=lineDrawMap.get(seriesId)||lineDrawMap.set(seriesId,new LineDraw());this.group.add(lineDraw.group);var mlData=createList$2(coordSys,seriesModel,mlModel);var fromData=mlData.from;var toData=mlData.to;var lineData=mlData.line;mlModel.__from=fromData;mlModel.__to=toData;// Line data for tooltip and formatter\nmlModel.setData(lineData);var symbolType=mlModel.get('symbol');var symbolSize=mlModel.get('symbolSize');if(!isArray(symbolType)){symbolType=[symbolType,symbolType];}if(typeof symbolSize==='number'){symbolSize=[symbolSize,symbolSize];}// Update visual and layout of from symbol and to symbol\nmlData.from.each(function(idx){updateDataVisualAndLayout(fromData,idx,true);updateDataVisualAndLayout(toData,idx,false);});// Update visual and layout of line\nlineData.each(function(idx){var lineColor=lineData.getItemModel(idx).get('lineStyle.color');lineData.setItemVisual(idx,{color:lineColor||fromData.getItemVisual(idx,'color')});lineData.setItemLayout(idx,[fromData.getItemLayout(idx),toData.getItemLayout(idx)]);lineData.setItemVisual(idx,{'fromSymbolRotate':fromData.getItemVisual(idx,'symbolRotate'),'fromSymbolSize':fromData.getItemVisual(idx,'symbolSize'),'fromSymbol':fromData.getItemVisual(idx,'symbol'),'toSymbolRotate':toData.getItemVisual(idx,'symbolRotate'),'toSymbolSize':toData.getItemVisual(idx,'symbolSize'),'toSymbol':toData.getItemVisual(idx,'symbol')});});lineDraw.updateData(lineData);// Set host model for tooltip\n// FIXME\nmlData.line.eachItemGraphicEl(function(el,idx){el.traverse(function(child){child.dataModel=mlModel;});});function updateDataVisualAndLayout(data,idx,isFrom){var itemModel=data.getItemModel(idx);updateSingleMarkerEndLayout(data,idx,isFrom,seriesModel,api);data.setItemVisual(idx,{symbolRotate:itemModel.get('symbolRotate'),symbolSize:itemModel.get('symbolSize')||symbolSize[isFrom?0:1],symbol:itemModel.get('symbol',true)||symbolType[isFrom?0:1],color:itemModel.get('itemStyle.color')||seriesData.getVisual('color')});}lineDraw.__keep=true;lineDraw.group.silent=mlModel.get('silent')||seriesModel.get('silent');}});/**\n * @inner\n * @param {module:echarts/coord/*} coordSys\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Model} mpModel\n */function createList$2(coordSys,seriesModel,mlModel){var coordDimsInfos;if(coordSys){coordDimsInfos=map(coordSys&&coordSys.dimensions,function(coordDim){var info=seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim))||{};// In map series data don't have lng and lat dimension. Fallback to same with coordSys\nreturn defaults({name:coordDim},info);});}else{coordDimsInfos=[{name:'value',type:'float'}];}var fromData=new List(coordDimsInfos,mlModel);var toData=new List(coordDimsInfos,mlModel);// No dimensions\nvar lineData=new List([],mlModel);var optData=map(mlModel.get('data'),curry(markLineTransform,seriesModel,coordSys,mlModel));if(coordSys){optData=filter(optData,curry(markLineFilter,coordSys));}var dimValueGetter$$1=coordSys?dimValueGetter:function(item){return item.value;};fromData.initData(map(optData,function(item){return item[0];}),null,dimValueGetter$$1);toData.initData(map(optData,function(item){return item[1];}),null,dimValueGetter$$1);lineData.initData(map(optData,function(item){return item[2];}));lineData.hasItemOption=true;return{from:fromData,to:toData,line:lineData};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerPreprocessor(function(opt){// Make sure markLine component is enabled\nopt.markLine=opt.markLine||{};});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/MarkerModel.extend({type:'markArea',defaultOption:{zlevel:0,// PENDING\nz:1,tooltip:{trigger:'item'},// markArea should fixed on the coordinate system\nanimation:false,label:{show:true,position:'top'},itemStyle:{// color and borderColor default to use color from series\n// color: 'auto'\n// borderColor: 'auto'\nborderWidth:0},emphasis:{label:{show:true,position:'top'}}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // TODO Better on polar\nvar markAreaTransform=function markAreaTransform(seriesModel,coordSys,maModel,item){var lt=dataTransform(seriesModel,item[0]);var rb=dataTransform(seriesModel,item[1]);var retrieve$$1=retrieve;// FIXME make sure lt is less than rb\nvar ltCoord=lt.coord;var rbCoord=rb.coord;ltCoord[0]=retrieve$$1(ltCoord[0],-Infinity);ltCoord[1]=retrieve$$1(ltCoord[1],-Infinity);rbCoord[0]=retrieve$$1(rbCoord[0],Infinity);rbCoord[1]=retrieve$$1(rbCoord[1],Infinity);// Merge option into one\nvar result=mergeAll([{},lt,rb]);result.coord=[lt.coord,rb.coord];result.x0=lt.x;result.y0=lt.y;result.x1=rb.x;result.y1=rb.y;return result;};function isInifinity$1(val){return!isNaN(val)&&!isFinite(val);}// If a markArea has one dim\nfunction ifMarkLineHasOnlyDim$1(dimIndex,fromCoord,toCoord,coordSys){var otherDimIndex=1-dimIndex;return isInifinity$1(fromCoord[otherDimIndex])&&isInifinity$1(toCoord[otherDimIndex]);}function markAreaFilter(coordSys,item){var fromCoord=item.coord[0];var toCoord=item.coord[1];if(coordSys.type==='cartesian2d'){// In case\n// {\n// markArea: {\n// data: [{ yAxis: 2 }]\n// }\n// }\nif(fromCoord&&toCoord&&(ifMarkLineHasOnlyDim$1(1,fromCoord,toCoord,coordSys)||ifMarkLineHasOnlyDim$1(0,fromCoord,toCoord,coordSys))){return true;}}return dataFilter$1(coordSys,{coord:fromCoord,x:item.x0,y:item.y0})||dataFilter$1(coordSys,{coord:toCoord,x:item.x1,y:item.y1});}// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\nfunction getSingleMarkerEndPoint(data,idx,dims,seriesModel,api){var coordSys=seriesModel.coordinateSystem;var itemModel=data.getItemModel(idx);var point;var xPx=parsePercent$1(itemModel.get(dims[0]),api.getWidth());var yPx=parsePercent$1(itemModel.get(dims[1]),api.getHeight());if(!isNaN(xPx)&&!isNaN(yPx)){point=[xPx,yPx];}else{// Chart like bar may have there own marker positioning logic\nif(seriesModel.getMarkerPosition){// Use the getMarkerPoisition\npoint=seriesModel.getMarkerPosition(data.getValues(dims,idx));}else{var x=data.get(dims[0],idx);var y=data.get(dims[1],idx);var pt=[x,y];coordSys.clampData&&coordSys.clampData(pt,pt);point=coordSys.dataToPoint(pt,true);}if(coordSys.type==='cartesian2d'){var xAxis=coordSys.getAxis('x');var yAxis=coordSys.getAxis('y');var x=data.get(dims[0],idx);var y=data.get(dims[1],idx);if(isInifinity$1(x)){point[0]=xAxis.toGlobalCoord(xAxis.getExtent()[dims[0]==='x0'?0:1]);}else if(isInifinity$1(y)){point[1]=yAxis.toGlobalCoord(yAxis.getExtent()[dims[1]==='y0'?0:1]);}}// Use x, y if has any\nif(!isNaN(xPx)){point[0]=xPx;}if(!isNaN(yPx)){point[1]=yPx;}}return point;}var dimPermutations=[['x0','y0'],['x1','y0'],['x1','y1'],['x0','y1']];MarkerView.extend({type:'markArea',// updateLayout: function (markAreaModel, ecModel, api) {\n// ecModel.eachSeries(function (seriesModel) {\n// var maModel = seriesModel.markAreaModel;\n// if (maModel) {\n// var areaData = maModel.getData();\n// areaData.each(function (idx) {\n// var points = zrUtil.map(dimPermutations, function (dim) {\n// return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n// });\n// // Layout\n// areaData.setItemLayout(idx, points);\n// var el = areaData.getItemGraphicEl(idx);\n// el.setShape('points', points);\n// });\n// }\n// }, this);\n// },\nupdateTransform:function updateTransform(markAreaModel,ecModel,api){ecModel.eachSeries(function(seriesModel){var maModel=seriesModel.markAreaModel;if(maModel){var areaData=maModel.getData();areaData.each(function(idx){var points=map(dimPermutations,function(dim){return getSingleMarkerEndPoint(areaData,idx,dim,seriesModel,api);});// Layout\nareaData.setItemLayout(idx,points);var el=areaData.getItemGraphicEl(idx);el.setShape('points',points);});}},this);},renderSeries:function renderSeries(seriesModel,maModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;var seriesId=seriesModel.id;var seriesData=seriesModel.getData();var areaGroupMap=this.markerGroupMap;var polygonGroup=areaGroupMap.get(seriesId)||areaGroupMap.set(seriesId,{group:new Group()});this.group.add(polygonGroup.group);polygonGroup.__keep=true;var areaData=createList$3(coordSys,seriesModel,maModel);// Line data for tooltip and formatter\nmaModel.setData(areaData);// Update visual and layout of line\nareaData.each(function(idx){// Layout\nvar points=map(dimPermutations,function(dim){return getSingleMarkerEndPoint(areaData,idx,dim,seriesModel,api);});// If none of the area is inside coordSys, allClipped is set to be true\n// in layout so that label will not be displayed. See #12591\nvar allClipped=true;each$1(dimPermutations,function(dim){if(!allClipped){return;}var xValue=areaData.get(dim[0],idx);var yValue=areaData.get(dim[1],idx);// If is infinity, the axis should be considered not clipped\nif((isInifinity$1(xValue)||coordSys.getAxis('x').containData(xValue))&&(isInifinity$1(yValue)||coordSys.getAxis('y').containData(yValue))){allClipped=false;}});areaData.setItemLayout(idx,{points:points,allClipped:allClipped});// Visual\nareaData.setItemVisual(idx,{color:seriesData.getVisual('color')});});areaData.diff(polygonGroup.__data).add(function(idx){var layout=areaData.getItemLayout(idx);if(!layout.allClipped){var polygon=new Polygon({shape:{points:layout.points}});areaData.setItemGraphicEl(idx,polygon);polygonGroup.group.add(polygon);}}).update(function(newIdx,oldIdx){var polygon=polygonGroup.__data.getItemGraphicEl(oldIdx);var layout=areaData.getItemLayout(newIdx);if(!layout.allClipped){if(polygon){updateProps(polygon,{shape:{points:layout.points}},maModel,newIdx);}else{polygon=new Polygon({shape:{points:layout.points}});}areaData.setItemGraphicEl(newIdx,polygon);polygonGroup.group.add(polygon);}else if(polygon){polygonGroup.group.remove(polygon);}}).remove(function(idx){var polygon=polygonGroup.__data.getItemGraphicEl(idx);polygonGroup.group.remove(polygon);}).execute();areaData.eachItemGraphicEl(function(polygon,idx){var itemModel=areaData.getItemModel(idx);var labelModel=itemModel.getModel('label');var labelHoverModel=itemModel.getModel('emphasis.label');var color=areaData.getItemVisual(idx,'color');polygon.useStyle(defaults(itemModel.getModel('itemStyle').getItemStyle(),{fill:modifyAlpha(color,0.4),stroke:color}));polygon.hoverStyle=itemModel.getModel('emphasis.itemStyle').getItemStyle();setLabelStyle(polygon.style,polygon.hoverStyle,labelModel,labelHoverModel,{labelFetcher:maModel,labelDataIndex:idx,defaultText:areaData.getName(idx)||'',isRectText:true,autoColor:color});setHoverStyle(polygon,{});polygon.dataModel=maModel;});polygonGroup.__data=areaData;polygonGroup.group.silent=maModel.get('silent')||seriesModel.get('silent');}});/**\n * @inner\n * @param {module:echarts/coord/*} coordSys\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Model} mpModel\n */function createList$3(coordSys,seriesModel,maModel){var coordDimsInfos;var areaData;var dims=['x0','y0','x1','y1'];if(coordSys){coordDimsInfos=map(coordSys&&coordSys.dimensions,function(coordDim){var data=seriesModel.getData();var info=data.getDimensionInfo(data.mapDimension(coordDim))||{};// In map series data don't have lng and lat dimension. Fallback to same with coordSys\nreturn defaults({name:coordDim},info);});areaData=new List(map(dims,function(dim,idx){return{name:dim,type:coordDimsInfos[idx%2].type};}),maModel);}else{coordDimsInfos=[{name:'value',type:'float'}];areaData=new List(coordDimsInfos,maModel);}var optData=map(maModel.get('data'),curry(markAreaTransform,seriesModel,coordSys,maModel));if(coordSys){optData=filter(optData,curry(markAreaFilter,coordSys));}var dimValueGetter$$1=coordSys?function(item,dimName,dataIndex,dimIndex){return item.coord[Math.floor(dimIndex/2)][dimIndex%2];}:function(item){return item.value;};areaData.initData(optData,null,dimValueGetter$$1);areaData.hasItemOption=true;return areaData;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerPreprocessor(function(opt){// Make sure markArea component is enabled\nopt.markArea=opt.markArea||{};});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ComponentModel.registerSubTypeDefaulter('dataZoom',function(){// Default 'slider' when no type specified.\nreturn'slider';});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AXIS_DIMS=['x','y','z','radius','angle','single'];// Supported coords.\nvar COORDS=['cartesian2d','polar','singleAxis'];/**\n * @param {string} coordType\n * @return {boolean}\n */function isCoordSupported(coordType){return indexOf(COORDS,coordType)>=0;}/**\n * Create \"each\" method to iterate names.\n *\n * @pubilc\n * @param {Array.} names\n * @param {Array.=} attrs\n * @return {Function}\n */function createNameEach(names,attrs){names=names.slice();var capitalNames=map(names,capitalFirst);attrs=(attrs||[]).slice();var capitalAttrs=map(attrs,capitalFirst);return function(callback,context){each$1(names,function(name,index){var nameObj={name:name,capital:capitalNames[index]};for(var j=0;j=0;}function isLinked(node,result){var hasLink=false;forEachEdgeType(function(edgeType){each$1(edgeIdGetter(node,edgeType)||[],function(edgeId){result.records[edgeType.name][edgeId]&&(hasLink=true);});});return hasLink;}function absorb(node,result){result.nodes.push(node);forEachEdgeType(function(edgeType){each$1(edgeIdGetter(node,edgeType)||[],function(edgeId){result.records[edgeType.name][edgeId]=true;});});}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Calculate slider move result.\n * Usage:\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\n *\n * @param {number} delta Move length.\n * @param {Array.} handleEnds handleEnds[0] can be bigger then handleEnds[1].\n * handleEnds will be modified in this method.\n * @param {Array.} extent handleEnds is restricted by extent.\n * extent[0] should less or equals than extent[1].\n * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds.\n * @param {number} [minSpan] The range of dataZoom can not be smaller than that.\n * If not set, handle0 and cross handle1. If set as a non-negative\n * number (including `0`), handles will push each other when reaching\n * the minSpan.\n * @param {number} [maxSpan] The range of dataZoom can not be larger than that.\n * @return {Array.} The input handleEnds.\n */var sliderMove=function sliderMove(delta,handleEnds,extent,handleIndex,minSpan,maxSpan){delta=delta||0;var extentSpan=extent[1]-extent[0];// Notice maxSpan and minSpan can be null/undefined.\nif(minSpan!=null){minSpan=restrict(minSpan,[0,extentSpan]);}if(maxSpan!=null){maxSpan=Math.max(maxSpan,minSpan!=null?minSpan:0);}if(handleIndex==='all'){var handleSpan=Math.abs(handleEnds[1]-handleEnds[0]);handleSpan=restrict(handleSpan,[0,extentSpan]);minSpan=maxSpan=restrict(handleSpan,[minSpan,maxSpan]);handleIndex=0;}handleEnds[0]=restrict(handleEnds[0],extent);handleEnds[1]=restrict(handleEnds[1],extent);var originalDistSign=getSpanSign(handleEnds,handleIndex);handleEnds[handleIndex]+=delta;// Restrict in extent.\nvar extentMinSpan=minSpan||0;var realExtent=extent.slice();originalDistSign.sign<0?realExtent[0]+=extentMinSpan:realExtent[1]-=extentMinSpan;handleEnds[handleIndex]=restrict(handleEnds[handleIndex],realExtent);// Expand span.\nvar currDistSign=getSpanSign(handleEnds,handleIndex);if(minSpan!=null&&(currDistSign.sign!==originalDistSign.sign||currDistSign.spanmaxSpan){handleEnds[1-handleIndex]=handleEnds[handleIndex]+currDistSign.sign*maxSpan;}return handleEnds;};function getSpanSign(handleEnds,handleIndex){var dist=handleEnds[handleIndex]-handleEnds[1-handleIndex];// If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n// is at left of handleEnds[1] for non-cross case.\nreturn{span:Math.abs(dist),sign:dist>0?-1:dist<0?1:handleIndex?-1:1};}function restrict(value,extend){return Math.min(extend[1]!=null?extend[1]:Infinity,Math.max(extend[0]!=null?extend[0]:-Infinity,value));}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$13=each$1;var asc$1=asc;/**\n * Operate single axis.\n * One axis can only operated by one axis operator.\n * Different dataZoomModels may be defined to operate the same axis.\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\n * So dataZoomModels share one axisProxy in that case.\n *\n * @class\n */var AxisProxy=function AxisProxy(dimName,axisIndex,dataZoomModel,ecModel){/**\n * @private\n * @type {string}\n */this._dimName=dimName;/**\n * @private\n */this._axisIndex=axisIndex;/**\n * @private\n * @type {Array.}\n */this._valueWindow;/**\n * @private\n * @type {Array.}\n */this._percentWindow;/**\n * @private\n * @type {Array.}\n */this._dataExtent;/**\n * {minSpan, maxSpan, minValueSpan, maxValueSpan}\n * @private\n * @type {Object}\n */this._minMaxSpan;/**\n * @readOnly\n * @type {module: echarts/model/Global}\n */this.ecModel=ecModel;/**\n * @private\n * @type {module: echarts/component/dataZoom/DataZoomModel}\n */this._dataZoomModel=dataZoomModel;// /**\n// * @readOnly\n// * @private\n// */\n// this.hasSeriesStacked;\n};AxisProxy.prototype={constructor:AxisProxy,/**\n * Whether the axisProxy is hosted by dataZoomModel.\n *\n * @public\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n * @return {boolean}\n */hostedBy:function hostedBy(dataZoomModel){return this._dataZoomModel===dataZoomModel;},/**\n * @return {Array.} Value can only be NaN or finite value.\n */getDataValueWindow:function getDataValueWindow(){return this._valueWindow.slice();},/**\n * @return {Array.}\n */getDataPercentWindow:function getDataPercentWindow(){return this._percentWindow.slice();},/**\n * @public\n * @param {number} axisIndex\n * @return {Array} seriesModels\n */getTargetSeriesModels:function getTargetSeriesModels(){var seriesModels=[];var ecModel=this.ecModel;ecModel.eachSeries(function(seriesModel){if(isCoordSupported(seriesModel.get('coordinateSystem'))){var dimName=this._dimName;var axisModel=ecModel.queryComponents({mainType:dimName+'Axis',index:seriesModel.get(dimName+'AxisIndex'),id:seriesModel.get(dimName+'AxisId')})[0];if(this._axisIndex===(axisModel&&axisModel.componentIndex)){seriesModels.push(seriesModel);}}},this);return seriesModels;},getAxisModel:function getAxisModel(){return this.ecModel.getComponent(this._dimName+'Axis',this._axisIndex);},getOtherAxisModel:function getOtherAxisModel(){var axisDim=this._dimName;var ecModel=this.ecModel;var axisModel=this.getAxisModel();var isCartesian=axisDim==='x'||axisDim==='y';var otherAxisDim;var coordSysIndexName;if(isCartesian){coordSysIndexName='gridIndex';otherAxisDim=axisDim==='x'?'y':'x';}else{coordSysIndexName='polarIndex';otherAxisDim=axisDim==='angle'?'radius':'angle';}var foundOtherAxisModel;ecModel.eachComponent(otherAxisDim+'Axis',function(otherAxisModel){if((otherAxisModel.get(coordSysIndexName)||0)===(axisModel.get(coordSysIndexName)||0)){foundOtherAxisModel=otherAxisModel;}});return foundOtherAxisModel;},getMinMaxSpan:function getMinMaxSpan(){return _clone(this._minMaxSpan);},/**\n * Only calculate by given range and this._dataExtent, do not change anything.\n *\n * @param {Object} opt\n * @param {number} [opt.start]\n * @param {number} [opt.end]\n * @param {number} [opt.startValue]\n * @param {number} [opt.endValue]\n */calculateDataWindow:function calculateDataWindow(opt){var dataExtent=this._dataExtent;var axisModel=this.getAxisModel();var scale=axisModel.axis.scale;var rangePropMode=this._dataZoomModel.getRangePropMode();var percentExtent=[0,100];var percentWindow=[];var valueWindow=[];var hasPropModeValue;each$13(['start','end'],function(prop,idx){var boundPercent=opt[prop];var boundValue=opt[prop+'Value'];// Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n// on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n// but not min/max of axis, which will be calculated by data window then).\n// The former one is suitable for cases that a dataZoom component controls multiple\n// axes with different unit or extent, and the latter one is suitable for accurate\n// zoom by pixel (e.g., in dataZoomSelect).\n// we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n// only when setOption or dispatchAction, otherwise it remains its original value.\n// (Why not only record `percentProp` and always map to `valueProp`? Because\n// the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n// `valueProp`. consider two axes constrolled by one dataZoom. They have different\n// data extent. All of values that are overflow the `dataExtent` will be calculated\n// to percent '100%').\nif(rangePropMode[idx]==='percent'){boundPercent==null&&(boundPercent=percentExtent[idx]);// Use scale.parse to math round for category or time axis.\nboundValue=scale.parse(linearMap(boundPercent,percentExtent,dataExtent));}else{hasPropModeValue=true;boundValue=boundValue==null?dataExtent[idx]:scale.parse(boundValue);// Calculating `percent` from `value` may be not accurate, because\n// This calculation can not be inversed, because all of values that\n// are overflow the `dataExtent` will be calculated to percent '100%'\nboundPercent=linearMap(boundValue,dataExtent,percentExtent);}// valueWindow[idx] = round(boundValue);\n// percentWindow[idx] = round(boundPercent);\nvalueWindow[idx]=boundValue;percentWindow[idx]=boundPercent;});asc$1(valueWindow);asc$1(percentWindow);// The windows from user calling of `dispatchAction` might be out of the extent,\n// or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window\n// by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n// where API is able to initialize/modify the window size even though `zoomLock`\n// specified.\nvar spans=this._minMaxSpan;hasPropModeValue?restrictSet(valueWindow,percentWindow,dataExtent,percentExtent,false):restrictSet(percentWindow,valueWindow,percentExtent,dataExtent,true);function restrictSet(fromWindow,toWindow,fromExtent,toExtent,toValue){var suffix=toValue?'Span':'ValueSpan';sliderMove(0,fromWindow,fromExtent,'all',spans['min'+suffix],spans['max'+suffix]);for(var i=0;i<2;i++){toWindow[i]=linearMap(fromWindow[i],fromExtent,toExtent,true);toValue&&(toWindow[i]=scale.parse(toWindow[i]));}}return{valueWindow:valueWindow,percentWindow:percentWindow};},/**\n * Notice: reset should not be called before series.restoreData() called,\n * so it is recommanded to be called in \"process stage\" but not \"model init\n * stage\".\n *\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n */reset:function reset(dataZoomModel){if(dataZoomModel!==this._dataZoomModel){return;}var targetSeries=this.getTargetSeriesModels();// Culculate data window and data extent, and record them.\nthis._dataExtent=calculateDataExtent(this,this._dimName,targetSeries);// this.hasSeriesStacked = false;\n// each(targetSeries, function (series) {\n// var data = series.getData();\n// var dataDim = data.mapDimension(this._dimName);\n// var stackedDimension = data.getCalculationInfo('stackedDimension');\n// if (stackedDimension && stackedDimension === dataDim) {\n// this.hasSeriesStacked = true;\n// }\n// }, this);\n// `calculateDataWindow` uses min/maxSpan.\nsetMinMaxSpan(this);var dataWindow=this.calculateDataWindow(dataZoomModel.settledOption);this._valueWindow=dataWindow.valueWindow;this._percentWindow=dataWindow.percentWindow;// Update axis setting then.\nsetAxisModel(this);},/**\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n */restore:function restore(dataZoomModel){if(dataZoomModel!==this._dataZoomModel){return;}this._valueWindow=this._percentWindow=null;setAxisModel(this,true);},/**\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n */filterData:function filterData(dataZoomModel,api){if(dataZoomModel!==this._dataZoomModel){return;}var axisDim=this._dimName;var seriesModels=this.getTargetSeriesModels();var filterMode=dataZoomModel.get('filterMode');var valueWindow=this._valueWindow;if(filterMode==='none'){return;}// FIXME\n// Toolbox may has dataZoom injected. And if there are stacked bar chart\n// with NaN data, NaN will be filtered and stack will be wrong.\n// So we need to force the mode to be set empty.\n// In fect, it is not a big deal that do not support filterMode-'filter'\n// when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n// selection\" some day, which might need \"adapt to data extent on the\n// otherAxis\", which is disabled by filterMode-'empty'.\n// But currently, stack has been fixed to based on value but not index,\n// so this is not an issue any more.\n// var otherAxisModel = this.getOtherAxisModel();\n// if (dataZoomModel.get('$fromToolbox')\n// && otherAxisModel\n// && otherAxisModel.hasSeriesStacked\n// ) {\n// filterMode = 'empty';\n// }\n// TODO\n// filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\neach$13(seriesModels,function(seriesModel){var seriesData=seriesModel.getData();var dataDims=seriesData.mapDimension(axisDim,true);if(!dataDims.length){return;}if(filterMode==='weakFilter'){seriesData.filterSelf(function(dataIndex){var leftOut;var rightOut;var hasValue;for(var i=0;ivalueWindow[1];if(thisHasValue&&!thisLeftOut&&!thisRightOut){return true;}thisHasValue&&(hasValue=true);thisLeftOut&&(leftOut=true);thisRightOut&&(rightOut=true);}// If both left out and right out, do not filter.\nreturn hasValue&&leftOut&&rightOut;});}else{each$13(dataDims,function(dim){if(filterMode==='empty'){seriesModel.setData(seriesData=seriesData.map(dim,function(value){return!isInWindow(value)?NaN:value;}));}else{var range={};range[dim]=valueWindow;// console.time('select');\nseriesData.selectRange(range);// console.timeEnd('select');\n}});}each$13(dataDims,function(dim){seriesData.setApproximateExtent(valueWindow,dim);});});function isInWindow(value){return value>=valueWindow[0]&&value<=valueWindow[1];}}};function calculateDataExtent(axisProxy,axisDim,seriesModels){var dataExtent=[Infinity,-Infinity];each$13(seriesModels,function(seriesModel){var seriesData=seriesModel.getData();if(seriesData){each$13(seriesData.mapDimension(axisDim,true),function(dim){var seriesExtent=seriesData.getApproximateExtent(dim);seriesExtent[0]dataExtent[1]&&(dataExtent[1]=seriesExtent[1]);});}});if(dataExtent[1]0?0:NaN;}var max=axisModel.getMax(true);if(max!=null&&max!=='dataMax'&&typeof max!=='function'){dataExtent[1]=max;}else if(isCategoryAxis){dataExtent[1]=axisDataLen>0?axisDataLen-1:NaN;}if(!axisModel.get('scale',true)){dataExtent[0]>0&&(dataExtent[0]=0);dataExtent[1]<0&&(dataExtent[1]=0);}// For value axis, if min/max/scale are not set, we just use the extent obtained\n// by series data, which may be a little different from the extent calculated by\n// `axisHelper.getScaleExtent`. But the different just affects the experience a\n// little when zooming. So it will not be fixed until some users require it strongly.\nreturn dataExtent;}function setAxisModel(axisProxy,isRestore){var axisModel=axisProxy.getAxisModel();var percentWindow=axisProxy._percentWindow;var valueWindow=axisProxy._valueWindow;if(!percentWindow){return;}// [0, 500]: arbitrary value, guess axis extent.\nvar precision=_getPixelPrecision(valueWindow,[0,500]);precision=Math.min(precision,20);// isRestore or isFull\nvar useOrigin=isRestore||percentWindow[0]===0&&percentWindow[1]===100;axisModel.setRange(useOrigin?null:+valueWindow[0].toFixed(precision),useOrigin?null:+valueWindow[1].toFixed(precision));}function setMinMaxSpan(axisProxy){var minMaxSpan=axisProxy._minMaxSpan={};var dataZoomModel=axisProxy._dataZoomModel;var dataExtent=axisProxy._dataExtent;each$13(['min','max'],function(minMax){var percentSpan=dataZoomModel.get(minMax+'Span');var valueSpan=dataZoomModel.get(minMax+'ValueSpan');valueSpan!=null&&(valueSpan=axisProxy.getAxisModel().axis.scale.parse(valueSpan));// minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\nif(valueSpan!=null){percentSpan=linearMap(dataExtent[0]+valueSpan,dataExtent,[0,100],true);}else if(percentSpan!=null){valueSpan=linearMap(percentSpan,[0,100],dataExtent,true)-dataExtent[0];}minMaxSpan[minMax+'Span']=percentSpan;minMaxSpan[minMax+'ValueSpan']=valueSpan;});}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$12=each$1;var eachAxisDim=eachAxisDim$1;var DataZoomModel=extendComponentModel({type:'dataZoom',dependencies:['xAxis','yAxis','zAxis','radiusAxis','angleAxis','singleAxis','series'],/**\n * @protected\n */defaultOption:{zlevel:0,z:4,// Higher than normal component (z: 2).\norient:null,// Default auto by axisIndex. Possible value: 'horizontal', 'vertical'.\nxAxisIndex:null,// Default the first horizontal category axis.\nyAxisIndex:null,// Default the first vertical category axis.\nfilterMode:'filter',// Possible values: 'filter' or 'empty' or 'weakFilter'.\n// 'filter': data items which are out of window will be removed. This option is\n// applicable when filtering outliers. For each data item, it will be\n// filtered if one of the relevant dimensions is out of the window.\n// 'weakFilter': data items which are out of window will be removed. This option\n// is applicable when filtering outliers. For each data item, it will be\n// filtered only if all of the relevant dimensions are out of the same\n// side of the window.\n// 'empty': data items which are out of window will be set to empty.\n// This option is applicable when user should not neglect\n// that there are some data items out of window.\n// 'none': Do not filter.\n// Taking line chart as an example, line will be broken in\n// the filtered points when filterModel is set to 'empty', but\n// be connected when set to 'filter'.\nthrottle:null,// Dispatch action by the fixed rate, avoid frequency.\n// default 100. Do not throttle when use null/undefined.\n// If animation === true and animationDurationUpdate > 0,\n// default value is 100, otherwise 20.\nstart:0,// Start percent. 0 ~ 100\nend:100,// End percent. 0 ~ 100\nstartValue:null,// Start value. If startValue specified, start is ignored.\nendValue:null,// End value. If endValue specified, end is ignored.\nminSpan:null,// 0 ~ 100\nmaxSpan:null,// 0 ~ 100\nminValueSpan:null,// The range of dataZoom can not be smaller than that.\nmaxValueSpan:null,// The range of dataZoom can not be larger than that.\nrangeMode:null// Array, can be 'value' or 'percent'.\n},/**\n * @override\n */init:function init(option,parentModel,ecModel){/**\n * key like x_0, y_1\n * @private\n * @type {Object}\n */this._dataIntervalByAxis={};/**\n * @private\n */this._dataInfo={};/**\n * key like x_0, y_1\n * @private\n */this._axisProxies={};/**\n * @readOnly\n */this.textStyleModel;/**\n * @private\n */this._autoThrottle=true;/**\n * It is `[rangeModeForMin, rangeModeForMax]`.\n * The optional values for `rangeMode`:\n * + `'value'` mode: the axis extent will always be determined by\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\n * how data like and how `axis.min` and `axis.max` are.\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\n *\n * For example, when users are using dynamic data (update data periodically via `setOption`),\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\n *\n * @private\n */this._rangePropMode=['percent','percent'];var inputRawOption=retrieveRawOption(option);/**\n * Suppose a \"main process\" start at the point that model prepared (that is,\n * model initialized or merged or method called in `action`).\n * We should keep the `main process` idempotent, that is, given a set of values\n * on `option`, we get the same result.\n *\n * But sometimes, values on `option` will be updated for providing users\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\n * should not be the base/input of the `main process`.\n *\n * So in that case we should save and keep the input of the `main process`\n * separately, called `settledOption`.\n *\n * For example, consider the case:\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\n * where the original input `option.startValue`, `option.endValue` are earsed by\n * calculated value.\n * (Step)2) click the legend to hide and show a series,\n * where the new range is calculated by the earsed `startValue` and `endValue`,\n * which brings incorrect result.\n *\n * @readOnly\n */this.settledOption=inputRawOption;this.mergeDefaultAndTheme(option,ecModel);this.doInit(inputRawOption);},/**\n * @override\n */mergeOption:function mergeOption(newOption){var inputRawOption=retrieveRawOption(newOption);//FIX #2591\nmerge(this.option,newOption,true);merge(this.settledOption,inputRawOption,true);this.doInit(inputRawOption);},/**\n * @protected\n */doInit:function doInit(inputRawOption){var thisOption=this.option;// Disable realtime view update if canvas is not supported.\nif(!env$1.canvasSupported){thisOption.realtime=false;}this._setDefaultThrottle(inputRawOption);updateRangeUse(this,inputRawOption);var settledOption=this.settledOption;each$12([['start','startValue'],['end','endValue']],function(names,index){// start/end has higher priority over startValue/endValue if they\n// both set, but we should make chart.setOption({endValue: 1000})\n// effective, rather than chart.setOption({endValue: 1000, end: null}).\nif(this._rangePropMode[index]==='value'){thisOption[names[0]]=settledOption[names[0]]=null;}// Otherwise do nothing and use the merge result.\n},this);this.textStyleModel=this.getModel('textStyle');this._resetTarget();this._giveAxisProxies();},/**\n * @private\n */_giveAxisProxies:function _giveAxisProxies(){var axisProxies=this._axisProxies;this.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel,ecModel){var axisModel=this.dependentModels[dimNames.axis][axisIndex];// If exists, share axisProxy with other dataZoomModels.\nvar axisProxy=axisModel.__dzAxisProxy||(// Use the first dataZoomModel as the main model of axisProxy.\naxisModel.__dzAxisProxy=new AxisProxy(dimNames.name,axisIndex,this,ecModel));// FIXME\n// dispose __dzAxisProxy\naxisProxies[dimNames.name+'_'+axisIndex]=axisProxy;},this);},/**\n * @private\n */_resetTarget:function _resetTarget(){var thisOption=this.option;var autoMode=this._judgeAutoMode();eachAxisDim(function(dimNames){var axisIndexName=dimNames.axisIndex;thisOption[axisIndexName]=normalizeToArray(thisOption[axisIndexName]);},this);if(autoMode==='axisIndex'){this._autoSetAxisIndex();}else if(autoMode==='orient'){this._autoSetOrient();}},/**\n * @private\n */_judgeAutoMode:function _judgeAutoMode(){// Auto set only works for setOption at the first time.\n// The following is user's reponsibility. So using merged\n// option is OK.\nvar thisOption=this.option;var hasIndexSpecified=false;eachAxisDim(function(dimNames){// When user set axisIndex as a empty array, we think that user specify axisIndex\n// but do not want use auto mode. Because empty array may be encountered when\n// some error occured.\nif(thisOption[dimNames.axisIndex]!=null){hasIndexSpecified=true;}},this);var orient=thisOption.orient;if(orient==null&&hasIndexSpecified){return'orient';}else if(!hasIndexSpecified){if(orient==null){thisOption.orient='horizontal';}return'axisIndex';}},/**\n * @private\n */_autoSetAxisIndex:function _autoSetAxisIndex(){var autoAxisIndex=true;var orient=this.get('orient',true);var thisOption=this.option;var dependentModels=this.dependentModels;if(autoAxisIndex){// Find axis that parallel to dataZoom as default.\nvar dimName=orient==='vertical'?'y':'x';if(dependentModels[dimName+'Axis'].length){thisOption[dimName+'AxisIndex']=[0];autoAxisIndex=false;}else{each$12(dependentModels.singleAxis,function(singleAxisModel){if(autoAxisIndex&&singleAxisModel.get('orient',true)===orient){thisOption.singleAxisIndex=[singleAxisModel.componentIndex];autoAxisIndex=false;}});}}if(autoAxisIndex){// Find the first category axis as default. (consider polar)\neachAxisDim(function(dimNames){if(!autoAxisIndex){return;}var axisIndices=[];var axisModels=this.dependentModels[dimNames.axis];if(axisModels.length&&!axisIndices.length){for(var i=0,len=axisModels.length;i0?100:20;}},/**\n * @public\n */getFirstTargetAxisModel:function getFirstTargetAxisModel(){var firstAxisModel;eachAxisDim(function(dimNames){if(firstAxisModel==null){var indices=this.get(dimNames.axisIndex);if(indices.length){firstAxisModel=this.dependentModels[dimNames.axis][indices[0]];}}},this);return firstAxisModel;},/**\n * @public\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\n */eachTargetAxis:function eachTargetAxis(callback,context){var ecModel=this.ecModel;eachAxisDim(function(dimNames){each$12(this.get(dimNames.axisIndex),function(axisIndex){callback.call(context,dimNames,axisIndex,this,ecModel);},this);},this);},/**\n * @param {string} dimName\n * @param {number} axisIndex\n * @return {module:echarts/component/dataZoom/AxisProxy} If not found, return null/undefined.\n */getAxisProxy:function getAxisProxy(dimName,axisIndex){return this._axisProxies[dimName+'_'+axisIndex];},/**\n * @param {string} dimName\n * @param {number} axisIndex\n * @return {module:echarts/model/Model} If not found, return null/undefined.\n */getAxisModel:function getAxisModel(dimName,axisIndex){var axisProxy=this.getAxisProxy(dimName,axisIndex);return axisProxy&&axisProxy.getAxisModel();},/**\n * If not specified, set to undefined.\n *\n * @public\n * @param {Object} opt\n * @param {number} [opt.start]\n * @param {number} [opt.end]\n * @param {number} [opt.startValue]\n * @param {number} [opt.endValue]\n */setRawRange:function setRawRange(opt){var thisOption=this.option;var settledOption=this.settledOption;each$12([['start','startValue'],['end','endValue']],function(names){// Consider the pair :\n// If one has value and the other one is `null/undefined`, we both set them\n// to `settledOption`. This strategy enables the feature to clear the original\n// value in `settledOption` to `null/undefined`.\n// But if both of them are `null/undefined`, we do not set them to `settledOption`\n// and keep `settledOption` with the original value. This strategy enables users to\n// only set but not set when calling\n// `dispatchAction`.\n// The pair is treated in the same way.\nif(opt[names[0]]!=null||opt[names[1]]!=null){thisOption[names[0]]=settledOption[names[0]]=opt[names[0]];thisOption[names[1]]=settledOption[names[1]]=opt[names[1]];}},this);updateRangeUse(this,opt);},/**\n * @public\n * @param {Object} opt\n * @param {number} [opt.start]\n * @param {number} [opt.end]\n * @param {number} [opt.startValue]\n * @param {number} [opt.endValue]\n */setCalculatedRange:function setCalculatedRange(opt){var option=this.option;each$12(['start','startValue','end','endValue'],function(name){option[name]=opt[name];});},/**\n * @public\n * @return {Array.} [startPercent, endPercent]\n */getPercentRange:function getPercentRange(){var axisProxy=this.findRepresentativeAxisProxy();if(axisProxy){return axisProxy.getDataPercentWindow();}},/**\n * @public\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\n *\n * @param {string} [axisDimName]\n * @param {number} [axisIndex]\n * @return {Array.} [startValue, endValue] value can only be '-' or finite number.\n */getValueRange:function getValueRange(axisDimName,axisIndex){if(axisDimName==null&&axisIndex==null){var axisProxy=this.findRepresentativeAxisProxy();if(axisProxy){return axisProxy.getDataValueWindow();}}else{return this.getAxisProxy(axisDimName,axisIndex).getDataValueWindow();}},/**\n * @public\n * @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy\n * corresponding to the axisModel\n * @return {module:echarts/component/dataZoom/AxisProxy}\n */findRepresentativeAxisProxy:function findRepresentativeAxisProxy(axisModel){if(axisModel){return axisModel.__dzAxisProxy;}// Find the first hosted axisProxy\nvar axisProxies=this._axisProxies;for(var key in axisProxies){if(axisProxies.hasOwnProperty(key)&&axisProxies[key].hostedBy(this)){return axisProxies[key];}}// If no hosted axis find not hosted axisProxy.\n// Consider this case: dataZoomModel1 and dataZoomModel2 control the same axis,\n// and the option.start or option.end settings are different. The percentRange\n// should follow axisProxy.\n// (We encounter this problem in toolbox data zoom.)\nfor(var key in axisProxies){if(axisProxies.hasOwnProperty(key)&&!axisProxies[key].hostedBy(this)){return axisProxies[key];}}},/**\n * @return {Array.}\n */getRangePropMode:function getRangePropMode(){return this._rangePropMode.slice();}});/**\n * Retrieve the those raw params from option, which will be cached separately.\n * becasue they will be overwritten by normalized/calculated values in the main\n * process.\n */function retrieveRawOption(option){var ret={};each$12(['start','end','startValue','endValue','throttle'],function(name){option.hasOwnProperty(name)&&(ret[name]=option[name]);});return ret;}function updateRangeUse(dataZoomModel,inputRawOption){var rangePropMode=dataZoomModel._rangePropMode;var rangeModeInOption=dataZoomModel.get('rangeMode');each$12([['start','startValue'],['end','endValue']],function(names,index){var percentSpecified=inputRawOption[names[0]]!=null;var valueSpecified=inputRawOption[names[1]]!=null;if(percentSpecified&&!valueSpecified){rangePropMode[index]='percent';}else if(!percentSpecified&&valueSpecified){rangePropMode[index]='value';}else if(rangeModeInOption){rangePropMode[index]=rangeModeInOption[index];}else if(percentSpecified){// percentSpecified && valueSpecified\nrangePropMode[index]='percent';}// else remain its original setting.\n});}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var DataZoomView=Component$1.extend({type:'dataZoom',render:function render(dataZoomModel,ecModel,api,payload){this.dataZoomModel=dataZoomModel;this.ecModel=ecModel;this.api=api;},/**\n * Find the first target coordinate system.\n *\n * @protected\n * @return {Object} {\n * grid: [\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\n * ...\n * ], // cartesians must not be null/undefined.\n * polar: [\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\n * ...\n * ], // polars must not be null/undefined.\n * singleAxis: [\n * {model: coord0, axisModels: [], coordIndex: 0}\n * ]\n */getTargetCoordInfo:function getTargetCoordInfo(){var dataZoomModel=this.dataZoomModel;var ecModel=this.ecModel;var coordSysLists={};dataZoomModel.eachTargetAxis(function(dimNames,axisIndex){var axisModel=ecModel.getComponent(dimNames.axis,axisIndex);if(axisModel){var coordModel=axisModel.getCoordSysModel();coordModel&&save(coordModel,axisModel,coordSysLists[coordModel.mainType]||(coordSysLists[coordModel.mainType]=[]),coordModel.componentIndex);}},this);function save(coordModel,axisModel,store,coordIndex){var item;for(var i=0;i placeholder. Using placehoder here because\n// deault value can only be drived in view stage.\nright:'ph',// Default align to grid rect.\ntop:'ph',// Default align to grid rect.\nwidth:'ph',// Default align to grid rect.\nheight:'ph',// Default align to grid rect.\nleft:null,// Default align to grid rect.\nbottom:null,// Default align to grid rect.\nbackgroundColor:'rgba(47,69,84,0)',// Background of slider zoom component.\n// dataBackgroundColor: '#ddd', // Background coor of data shadow and border of box,\n// highest priority, remain for compatibility of\n// previous version, but not recommended any more.\ndataBackground:{lineStyle:{color:'#2f4554',width:0.5,opacity:0.3},areaStyle:{color:'rgba(47,69,84,0.3)',opacity:0.3}},borderColor:'#ddd',// border color of the box. For compatibility,\n// if dataBackgroundColor is set, borderColor\n// is ignored.\nfillerColor:'rgba(167,183,204,0.4)',// Color of selected area.\n// handleColor: 'rgba(89,170,216,0.95)', // Color of handle.\n// handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z',\n/* eslint-disable */handleIcon:'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z',/* eslint-enable */ // Percent of the slider height\nhandleSize:'100%',handleStyle:{color:'#a7b7cc'},labelPrecision:null,labelFormatter:null,showDetail:true,showDataShadow:'auto',// Default auto decision.\nrealtime:true,zoomLock:false,// Whether disable zoom.\ntextStyle:{color:'#333'}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var Rect$1=Rect;var linearMap$1=linearMap;var asc$2=asc;var bind$3=bind;var each$14=each$1;// Constants\nvar DEFAULT_LOCATION_EDGE_GAP=7;var DEFAULT_FRAME_BORDER_WIDTH=1;var DEFAULT_FILLER_SIZE=30;var HORIZONTAL='horizontal';var VERTICAL='vertical';var LABEL_GAP=5;var SHOW_DATA_SHADOW_SERIES_TYPE=['line','bar','candlestick','scatter'];var SliderZoomView=DataZoomView.extend({type:'dataZoom.slider',init:function init(ecModel,api){/**\n * @private\n * @type {Object}\n */this._displayables={};/**\n * @private\n * @type {string}\n */this._orient;/**\n * [0, 100]\n * @private\n */this._range;/**\n * [coord of the first handle, coord of the second handle]\n * @private\n */this._handleEnds;/**\n * [length, thick]\n * @private\n * @type {Array.}\n */this._size;/**\n * @private\n * @type {number}\n */this._handleWidth;/**\n * @private\n * @type {number}\n */this._handleHeight;/**\n * @private\n */this._location;/**\n * @private\n */this._dragging;/**\n * @private\n */this._dataShadowInfo;this.api=api;},/**\n * @override\n */render:function render(dataZoomModel,ecModel,api,payload){SliderZoomView.superApply(this,'render',arguments);createOrUpdate(this,'_dispatchZoomAction',this.dataZoomModel.get('throttle'),'fixRate');this._orient=dataZoomModel.get('orient');if(this.dataZoomModel.get('show')===false){this.group.removeAll();return;}// Notice: this._resetInterval() should not be executed when payload.type\n// is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n// or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\nif(!payload||payload.type!=='dataZoom'||payload.from!==this.uid){this._buildView();}this._updateView();},/**\n * @override\n */remove:function remove(){SliderZoomView.superApply(this,'remove',arguments);clear(this,'_dispatchZoomAction');},/**\n * @override\n */dispose:function dispose(){SliderZoomView.superApply(this,'dispose',arguments);clear(this,'_dispatchZoomAction');},_buildView:function _buildView(){var thisGroup=this.group;thisGroup.removeAll();this._resetLocation();this._resetInterval();var barGroup=this._displayables.barGroup=new Group();this._renderBackground();this._renderHandle();this._renderDataShadow();thisGroup.add(barGroup);this._positionGroup();},/**\n * @private\n */_resetLocation:function _resetLocation(){var dataZoomModel=this.dataZoomModel;var api=this.api;// If some of x/y/width/height are not specified,\n// auto-adapt according to target grid.\nvar coordRect=this._findCoordRect();var ecSize={width:api.getWidth(),height:api.getHeight()};// Default align by coordinate system rect.\nvar positionInfo=this._orient===HORIZONTAL?{// Why using 'right', because right should be used in vertical,\n// and it is better to be consistent for dealing with position param merge.\nright:ecSize.width-coordRect.x-coordRect.width,top:ecSize.height-DEFAULT_FILLER_SIZE-DEFAULT_LOCATION_EDGE_GAP,width:coordRect.width,height:DEFAULT_FILLER_SIZE}:{// vertical\nright:DEFAULT_LOCATION_EDGE_GAP,top:coordRect.y,width:DEFAULT_FILLER_SIZE,height:coordRect.height};// Do not write back to option and replace value 'ph', because\n// the 'ph' value should be recalculated when resize.\nvar layoutParams=getLayoutParams(dataZoomModel.option);// Replace the placeholder value.\neach$1(['right','top','width','height'],function(name){if(layoutParams[name]==='ph'){layoutParams[name]=positionInfo[name];}});var layoutRect=getLayoutRect(layoutParams,ecSize,dataZoomModel.padding);this._location={x:layoutRect.x,y:layoutRect.y};this._size=[layoutRect.width,layoutRect.height];this._orient===VERTICAL&&this._size.reverse();},/**\n * @private\n */_positionGroup:function _positionGroup(){var thisGroup=this.group;var location=this._location;var orient=this._orient;// Just use the first axis to determine mapping.\nvar targetAxisModel=this.dataZoomModel.getFirstTargetAxisModel();var inverse=targetAxisModel&&targetAxisModel.get('inverse');var barGroup=this._displayables.barGroup;var otherAxisInverse=(this._dataShadowInfo||{}).otherAxisInverse;// Transform barGroup.\nbarGroup.attr(orient===HORIZONTAL&&!inverse?{scale:otherAxisInverse?[1,1]:[1,-1]}:orient===HORIZONTAL&&inverse?{scale:otherAxisInverse?[-1,1]:[-1,-1]}:orient===VERTICAL&&!inverse?{scale:otherAxisInverse?[1,-1]:[1,1],rotation:Math.PI/2}// Dont use Math.PI, considering shadow direction.\n:{scale:otherAxisInverse?[-1,-1]:[-1,1],rotation:Math.PI/2});// Position barGroup\nvar rect=thisGroup.getBoundingRect([barGroup]);thisGroup.attr('position',[location.x-rect.x,location.y-rect.y]);},/**\n * @private\n */_getViewExtent:function _getViewExtent(){return[0,this._size[0]];},_renderBackground:function _renderBackground(){var dataZoomModel=this.dataZoomModel;var size=this._size;var barGroup=this._displayables.barGroup;barGroup.add(new Rect$1({silent:true,shape:{x:0,y:0,width:size[0],height:size[1]},style:{fill:dataZoomModel.get('backgroundColor')},z2:-40}));// Click panel, over shadow, below handles.\nbarGroup.add(new Rect$1({shape:{x:0,y:0,width:size[0],height:size[1]},style:{fill:'transparent'},z2:0,onclick:bind(this._onClickPanelClick,this)}));},_renderDataShadow:function _renderDataShadow(){var info=this._dataShadowInfo=this._prepareDataShadowInfo();if(!info){return;}var size=this._size;var seriesModel=info.series;var data=seriesModel.getRawData();var otherDim=seriesModel.getShadowDim?seriesModel.getShadowDim()// @see candlestick\n:info.otherDim;if(otherDim==null){return;}var otherDataExtent=data.getDataExtent(otherDim);// Nice extent.\nvar otherOffset=(otherDataExtent[1]-otherDataExtent[0])*0.3;otherDataExtent=[otherDataExtent[0]-otherOffset,otherDataExtent[1]+otherOffset];var otherShadowExtent=[0,size[1]];var thisShadowExtent=[0,size[0]];var areaPoints=[[size[0],0],[0,0]];var linePoints=[];var step=thisShadowExtent[1]/(data.count()-1);var thisCoord=0;// Optimize for large data shadow\nvar stride=Math.round(data.count()/size[0]);var lastIsEmpty;data.each([otherDim],function(value,index){if(stride>0&&index%stride){thisCoord+=step;return;}// FIXME\n// Should consider axis.min/axis.max when drawing dataShadow.\n// FIXME\n// 应该使用统一的空判断?还是在list里进行空判断?\nvar isEmpty=value==null||isNaN(value)||value==='';// See #4235.\nvar otherCoord=isEmpty?0:linearMap$1(value,otherDataExtent,otherShadowExtent,true);// Attempt to draw data shadow precisely when there are empty value.\nif(isEmpty&&!lastIsEmpty&&index){areaPoints.push([areaPoints[areaPoints.length-1][0],0]);linePoints.push([linePoints[linePoints.length-1][0],0]);}else if(!isEmpty&&lastIsEmpty){areaPoints.push([thisCoord,0]);linePoints.push([thisCoord,0]);}areaPoints.push([thisCoord,otherCoord]);linePoints.push([thisCoord,otherCoord]);thisCoord+=step;lastIsEmpty=isEmpty;});var dataZoomModel=this.dataZoomModel;// var dataBackgroundModel = dataZoomModel.getModel('dataBackground');\nthis._displayables.barGroup.add(new Polygon({shape:{points:areaPoints},style:defaults({fill:dataZoomModel.get('dataBackgroundColor')},dataZoomModel.getModel('dataBackground.areaStyle').getAreaStyle()),silent:true,z2:-20}));this._displayables.barGroup.add(new Polyline({shape:{points:linePoints},style:dataZoomModel.getModel('dataBackground.lineStyle').getLineStyle(),silent:true,z2:-19}));},_prepareDataShadowInfo:function _prepareDataShadowInfo(){var dataZoomModel=this.dataZoomModel;var showDataShadow=dataZoomModel.get('showDataShadow');if(showDataShadow===false){return;}// Find a representative series.\nvar result;var ecModel=this.ecModel;dataZoomModel.eachTargetAxis(function(dimNames,axisIndex){var seriesModels=dataZoomModel.getAxisProxy(dimNames.name,axisIndex).getTargetSeriesModels();each$1(seriesModels,function(seriesModel){if(result){return;}if(showDataShadow!==true&&indexOf(SHOW_DATA_SHADOW_SERIES_TYPE,seriesModel.get('type'))<0){return;}var thisAxis=ecModel.getComponent(dimNames.axis,axisIndex).axis;var otherDim=getOtherDim(dimNames.name);var otherAxisInverse;var coordSys=seriesModel.coordinateSystem;if(otherDim!=null&&coordSys.getOtherAxis){otherAxisInverse=coordSys.getOtherAxis(thisAxis).inverse;}otherDim=seriesModel.getData().mapDimension(otherDim);result={thisAxis:thisAxis,series:seriesModel,thisDim:dimNames.name,otherDim:otherDim,otherAxisInverse:otherAxisInverse};},this);},this);return result;},_renderHandle:function _renderHandle(){var displaybles=this._displayables;var handles=displaybles.handles=[];var handleLabels=displaybles.handleLabels=[];var barGroup=this._displayables.barGroup;var size=this._size;var dataZoomModel=this.dataZoomModel;barGroup.add(displaybles.filler=new Rect$1({draggable:true,cursor:getCursor(this._orient),drift:bind$3(this._onDragMove,this,'all'),ondragstart:bind$3(this._showDataInfo,this,true),ondragend:bind$3(this._onDragEnd,this),onmouseover:bind$3(this._showDataInfo,this,true),onmouseout:bind$3(this._showDataInfo,this,false),style:{fill:dataZoomModel.get('fillerColor'),textPosition:'inside'}}));// Frame border.\nbarGroup.add(new Rect$1({silent:true,subPixelOptimize:true,shape:{x:0,y:0,width:size[0],height:size[1]},style:{stroke:dataZoomModel.get('dataBackgroundColor')||dataZoomModel.get('borderColor'),lineWidth:DEFAULT_FRAME_BORDER_WIDTH,fill:'rgba(0,0,0,0)'}}));each$14([0,1],function(handleIndex){var path=createIcon(dataZoomModel.get('handleIcon'),{cursor:getCursor(this._orient),draggable:true,drift:bind$3(this._onDragMove,this,handleIndex),ondragend:bind$3(this._onDragEnd,this),onmouseover:bind$3(this._showDataInfo,this,true),onmouseout:bind$3(this._showDataInfo,this,false)},{x:-1,y:0,width:2,height:2});var bRect=path.getBoundingRect();this._handleHeight=parsePercent$1(dataZoomModel.get('handleSize'),this._size[1]);this._handleWidth=bRect.width/bRect.height*this._handleHeight;path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());var handleColor=dataZoomModel.get('handleColor');// Compatitable with previous version\nif(handleColor!=null){path.style.fill=handleColor;}barGroup.add(handles[handleIndex]=path);var textStyleModel=dataZoomModel.textStyleModel;this.group.add(handleLabels[handleIndex]=new Text({silent:true,invisible:true,style:{x:0,y:0,text:'',textVerticalAlign:'middle',textAlign:'center',textFill:textStyleModel.getTextColor(),textFont:textStyleModel.getFont()},z2:10}));},this);},/**\n * @private\n */_resetInterval:function _resetInterval(){var range=this._range=this.dataZoomModel.getPercentRange();var viewExtent=this._getViewExtent();this._handleEnds=[linearMap$1(range[0],[0,100],viewExtent,true),linearMap$1(range[1],[0,100],viewExtent,true)];},/**\n * @private\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\n * @param {number} delta\n * @return {boolean} changed\n */_updateInterval:function _updateInterval(handleIndex,delta){var dataZoomModel=this.dataZoomModel;var handleEnds=this._handleEnds;var viewExtend=this._getViewExtent();var minMaxSpan=dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();var percentExtent=[0,100];sliderMove(delta,handleEnds,viewExtend,dataZoomModel.get('zoomLock')?'all':handleIndex,minMaxSpan.minSpan!=null?linearMap$1(minMaxSpan.minSpan,percentExtent,viewExtend,true):null,minMaxSpan.maxSpan!=null?linearMap$1(minMaxSpan.maxSpan,percentExtent,viewExtend,true):null);var lastRange=this._range;var range=this._range=asc$2([linearMap$1(handleEnds[0],viewExtend,percentExtent,true),linearMap$1(handleEnds[1],viewExtend,percentExtent,true)]);return!lastRange||lastRange[0]!==range[0]||lastRange[1]!==range[1];},/**\n * @private\n */_updateView:function _updateView(nonRealtime){var displaybles=this._displayables;var handleEnds=this._handleEnds;var handleInterval=asc$2(handleEnds.slice());var size=this._size;each$14([0,1],function(handleIndex){// Handles\nvar handle=displaybles.handles[handleIndex];var handleHeight=this._handleHeight;handle.attr({scale:[handleHeight/2,handleHeight/2],position:[handleEnds[handleIndex],size[1]/2-handleHeight/2]});},this);// Filler\ndisplaybles.filler.setShape({x:handleInterval[0],y:0,width:handleInterval[1]-handleInterval[0],height:size[1]});this._updateDataInfo(nonRealtime);},/**\n * @private\n */_updateDataInfo:function _updateDataInfo(nonRealtime){var dataZoomModel=this.dataZoomModel;var displaybles=this._displayables;var handleLabels=displaybles.handleLabels;var orient=this._orient;var labelTexts=['',''];// FIXME\n// date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)\nif(dataZoomModel.get('showDetail')){var axisProxy=dataZoomModel.findRepresentativeAxisProxy();if(axisProxy){var axis=axisProxy.getAxisModel().axis;var range=this._range;var dataInterval=nonRealtime// See #4434, data and axis are not processed and reset yet in non-realtime mode.\n?axisProxy.calculateDataWindow({start:range[0],end:range[1]}).valueWindow:axisProxy.getDataValueWindow();labelTexts=[this._formatLabel(dataInterval[0],axis),this._formatLabel(dataInterval[1],axis)];}}var orderedHandleEnds=asc$2(this._handleEnds.slice());setLabel.call(this,0);setLabel.call(this,1);function setLabel(handleIndex){// Label\n// Text should not transform by barGroup.\n// Ignore handlers transform\nvar barTransform=getTransform(displaybles.handles[handleIndex].parent,this.group);var direction=transformDirection(handleIndex===0?'right':'left',barTransform);var offset=this._handleWidth/2+LABEL_GAP;var textPoint=applyTransform$1([orderedHandleEnds[handleIndex]+(handleIndex===0?-offset:offset),this._size[1]/2],barTransform);handleLabels[handleIndex].setStyle({x:textPoint[0],y:textPoint[1],textVerticalAlign:orient===HORIZONTAL?'middle':direction,textAlign:orient===HORIZONTAL?direction:'center',text:labelTexts[handleIndex]});}},/**\n * @private\n */_formatLabel:function _formatLabel(value,axis){var dataZoomModel=this.dataZoomModel;var labelFormatter=dataZoomModel.get('labelFormatter');var labelPrecision=dataZoomModel.get('labelPrecision');if(labelPrecision==null||labelPrecision==='auto'){labelPrecision=axis.getPixelPrecision();}var valueStr=value==null||isNaN(value)?''// FIXME Glue code\n:axis.type==='category'||axis.type==='time'?axis.scale.getLabel(Math.round(value))// param of toFixed should less then 20.\n:value.toFixed(Math.min(labelPrecision,20));return isFunction$1(labelFormatter)?labelFormatter(value,valueStr):isString(labelFormatter)?labelFormatter.replace('{value}',valueStr):valueStr;},/**\n * @private\n * @param {boolean} showOrHide true: show, false: hide\n */_showDataInfo:function _showDataInfo(showOrHide){// Always show when drgging.\nshowOrHide=this._dragging||showOrHide;var handleLabels=this._displayables.handleLabels;handleLabels[0].attr('invisible',!showOrHide);handleLabels[1].attr('invisible',!showOrHide);},_onDragMove:function _onDragMove(handleIndex,dx,dy,event){this._dragging=true;// For mobile device, prevent screen slider on the button.\nstop(event.event);// Transform dx, dy to bar coordination.\nvar barTransform=this._displayables.barGroup.getLocalTransform();var vertex=applyTransform$1([dx,dy],barTransform,true);var changed=this._updateInterval(handleIndex,vertex[0]);var realtime=this.dataZoomModel.get('realtime');this._updateView(!realtime);// Avoid dispatch dataZoom repeatly but range not changed,\n// which cause bad visual effect when progressive enabled.\nchanged&&realtime&&this._dispatchZoomAction();},_onDragEnd:function _onDragEnd(){this._dragging=false;this._showDataInfo(false);// While in realtime mode and stream mode, dispatch action when\n// drag end will cause the whole view rerender, which is unnecessary.\nvar realtime=this.dataZoomModel.get('realtime');!realtime&&this._dispatchZoomAction();},_onClickPanelClick:function _onClickPanelClick(e){var size=this._size;var localPoint=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(localPoint[0]<0||localPoint[0]>size[0]||localPoint[1]<0||localPoint[1]>size[1]){return;}var handleEnds=this._handleEnds;var center=(handleEnds[0]+handleEnds[1])/2;var changed=this._updateInterval('all',localPoint[0]-center);this._updateView();changed&&this._dispatchZoomAction();},/**\n * This action will be throttled.\n * @private\n */_dispatchZoomAction:function _dispatchZoomAction(){var range=this._range;this.api.dispatchAction({type:'dataZoom',from:this.uid,dataZoomId:this.dataZoomModel.id,start:range[0],end:range[1]});},/**\n * @private\n */_findCoordRect:function _findCoordRect(){// Find the grid coresponding to the first axis referred by dataZoom.\nvar rect;each$14(this.getTargetCoordInfo(),function(coordInfoList){if(!rect&&coordInfoList.length){var coordSys=coordInfoList[0].model.coordinateSystem;rect=coordSys.getRect&&coordSys.getRect();}});if(!rect){var width=this.api.getWidth();var height=this.api.getHeight();rect={x:width*0.2,y:height*0.2,width:width*0.6,height:height*0.6};}return rect;}});function getOtherDim(thisDim){// FIXME\n// 这个逻辑和getOtherAxis里一致,但是写在这里是否不好\nvar map$$1={x:'y',y:'x',radius:'angle',angle:'radius'};return map$$1[thisDim];}function getCursor(orient){return orient==='vertical'?'ns-resize':'ew-resize';}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerProcessor({// `dataZoomProcessor` will only be performed in needed series. Consider if\n// there is a line series and a pie series, it is better not to update the\n// line series if only pie series is needed to be updated.\ngetTargetSeries:function getTargetSeries(ecModel){var seriesModelMap=createHashMap();ecModel.eachComponent('dataZoom',function(dataZoomModel){dataZoomModel.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel){var axisProxy=dataZoomModel.getAxisProxy(dimNames.name,axisIndex);each$1(axisProxy.getTargetSeriesModels(),function(seriesModel){seriesModelMap.set(seriesModel.uid,seriesModel);});});});return seriesModelMap;},modifyOutputEnd:true,// Consider appendData, where filter should be performed. Because data process is\n// in block mode currently, it is not need to worry about that the overallProgress\n// execute every frame.\noverallReset:function overallReset(ecModel,api){ecModel.eachComponent('dataZoom',function(dataZoomModel){// We calculate window and reset axis here but not in model\n// init stage and not after action dispatch handler, because\n// reset should be called after seriesData.restoreData.\ndataZoomModel.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel){dataZoomModel.getAxisProxy(dimNames.name,axisIndex).reset(dataZoomModel,api);});// Caution: data zoom filtering is order sensitive when using\n// percent range and no min/max/scale set on axis.\n// For example, we have dataZoom definition:\n// [\n// {xAxisIndex: 0, start: 30, end: 70},\n// {yAxisIndex: 0, start: 20, end: 80}\n// ]\n// In this case, [20, 80] of y-dataZoom should be based on data\n// that have filtered by x-dataZoom using range of [30, 70],\n// but should not be based on full raw data. Thus sliding\n// x-dataZoom will change both ranges of xAxis and yAxis,\n// while sliding y-dataZoom will only change the range of yAxis.\n// So we should filter x-axis after reset x-axis immediately,\n// and then reset y-axis and filter y-axis.\ndataZoomModel.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel){dataZoomModel.getAxisProxy(dimNames.name,axisIndex).filterData(dataZoomModel,api);});});ecModel.eachComponent('dataZoom',function(dataZoomModel){// Fullfill all of the range props so that user\n// is able to get them from chart.getOption().\nvar axisProxy=dataZoomModel.findRepresentativeAxisProxy();var percentRange=axisProxy.getDataPercentWindow();var valueRange=axisProxy.getDataValueWindow();dataZoomModel.setCalculatedRange({start:percentRange[0],end:percentRange[1],startValue:valueRange[0],endValue:valueRange[1]});});}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerAction('dataZoom',function(payload,ecModel){var linkedNodesFinder=createLinkedNodesFinder(bind(ecModel.eachComponent,ecModel,'dataZoom'),eachAxisDim$1,function(model,dimNames){return model.get(dimNames.axisIndex);});var effectedModels=[];ecModel.eachComponent({mainType:'dataZoom',query:payload},function(model,index){effectedModels.push.apply(effectedModels,linkedNodesFinder(model).nodes);});each$1(effectedModels,function(dataZoomModel,index){dataZoomModel.setRawRange({start:payload.start,end:payload.end,startValue:payload.startValue,endValue:payload.endValue});});});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/DataZoomModel.extend({type:'dataZoom.inside',/**\n * @protected\n */defaultOption:{disabled:false,// Whether disable this inside zoom.\nzoomLock:false,// Whether disable zoom but only pan.\nzoomOnMouseWheel:true,// Can be: true / false / 'shift' / 'ctrl' / 'alt'.\nmoveOnMouseMove:true,// Can be: true / false / 'shift' / 'ctrl' / 'alt'.\nmoveOnMouseWheel:false,// Can be: true / false / 'shift' / 'ctrl' / 'alt'.\npreventDefaultMouseMove:true}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var ATTR$1='\\0_ec_interaction_mutex';function take(zr,resourceKey,userKey){var store=getStore(zr);store[resourceKey]=userKey;}function release(zr,resourceKey,userKey){var store=getStore(zr);var uKey=store[resourceKey];if(uKey===userKey){store[resourceKey]=null;}}function isTaken(zr,resourceKey){return!!getStore(zr)[resourceKey];}function getStore(zr){return zr[ATTR$1]||(zr[ATTR$1]={});}/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */registerAction({type:'takeGlobalCursor',event:'globalCursorTaken',update:'update'},function(){});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @alias module:echarts/component/helper/RoamController\n * @constructor\n * @mixin {module:zrender/mixin/Eventful}\n *\n * @param {module:zrender/zrender~ZRender} zr\n */function RoamController(zr){/**\n * @type {Function}\n */this.pointerChecker;/**\n * @type {module:zrender}\n */this._zr=zr;/**\n * @type {Object}\n */this._opt={};// Avoid two roamController bind the same handler\nvar bind$$1=bind;var mousedownHandler=bind$$1(mousedown,this);var mousemoveHandler=bind$$1(mousemove,this);var mouseupHandler=bind$$1(mouseup,this);var mousewheelHandler=bind$$1(mousewheel,this);var pinchHandler=bind$$1(pinch,this);Eventful.call(this);/**\n * @param {Function} pointerChecker\n * input: x, y\n * output: boolean\n */this.setPointerChecker=function(pointerChecker){this.pointerChecker=pointerChecker;};/**\n * Notice: only enable needed types. For example, if 'zoom'\n * is not needed, 'zoom' should not be enabled, otherwise\n * default mousewheel behaviour (scroll page) will be disabled.\n *\n * @param {boolean|string} [controlType=true] Specify the control type,\n * which can be null/undefined or true/false\n * or 'pan/move' or 'zoom'/'scale'\n * @param {Object} [opt]\n * @param {Object} [opt.zoomOnMouseWheel=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.moveOnMouseMove=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.moveOnMouseWheel=false] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.preventDefaultMouseMove=true] When pan.\n */this.enable=function(controlType,opt){// Disable previous first\nthis.disable();this._opt=defaults(_clone(opt)||{},{zoomOnMouseWheel:true,moveOnMouseMove:true,// By default, wheel do not trigger move.\nmoveOnMouseWheel:false,preventDefaultMouseMove:true});if(controlType==null){controlType=true;}if(controlType===true||controlType==='move'||controlType==='pan'){zr.on('mousedown',mousedownHandler);zr.on('mousemove',mousemoveHandler);zr.on('mouseup',mouseupHandler);}if(controlType===true||controlType==='scale'||controlType==='zoom'){zr.on('mousewheel',mousewheelHandler);zr.on('pinch',pinchHandler);}};this.disable=function(){zr.off('mousedown',mousedownHandler);zr.off('mousemove',mousemoveHandler);zr.off('mouseup',mouseupHandler);zr.off('mousewheel',mousewheelHandler);zr.off('pinch',pinchHandler);};this.dispose=this.disable;this.isDragging=function(){return this._dragging;};this.isPinching=function(){return this._pinching;};}mixin(RoamController,Eventful);function mousedown(e){if(isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable){return;}var x=e.offsetX;var y=e.offsetY;// Only check on mosedown, but not mousemove.\n// Mouse can be out of target when mouse moving.\nif(this.pointerChecker&&this.pointerChecker(e,x,y)){this._x=x;this._y=y;this._dragging=true;}}function mousemove(e){if(!this._dragging||!isAvailableBehavior('moveOnMouseMove',e,this._opt)||e.gestureEvent==='pinch'||isTaken(this._zr,'globalPan')){return;}var x=e.offsetX;var y=e.offsetY;var oldX=this._x;var oldY=this._y;var dx=x-oldX;var dy=y-oldY;this._x=x;this._y=y;this._opt.preventDefaultMouseMove&&stop(e.event);trigger(this,'pan','moveOnMouseMove',e,{dx:dx,dy:dy,oldX:oldX,oldY:oldY,newX:x,newY:y});}function mouseup(e){if(!isMiddleOrRightButtonOnMouseUpDown(e)){this._dragging=false;}}function mousewheel(e){var shouldZoom=isAvailableBehavior('zoomOnMouseWheel',e,this._opt);var shouldMove=isAvailableBehavior('moveOnMouseWheel',e,this._opt);var wheelDelta=e.wheelDelta;var absWheelDeltaDelta=Math.abs(wheelDelta);var originX=e.offsetX;var originY=e.offsetY;// wheelDelta maybe -0 in chrome mac.\nif(wheelDelta===0||!shouldZoom&&!shouldMove){return;}// If both `shouldZoom` and `shouldMove` is true, trigger\n// their event both, and the final behavior is determined\n// by event listener themselves.\nif(shouldZoom){// Convenience:\n// Mac and VM Windows on Mac: scroll up: zoom out.\n// Windows: scroll up: zoom in.\n// FIXME: Should do more test in different environment.\n// wheelDelta is too complicated in difference nvironment\n// (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n// although it has been normallized by zrender.\n// wheelDelta of mouse wheel is bigger than touch pad.\nvar factor=absWheelDeltaDelta>3?1.4:absWheelDeltaDelta>1?1.2:1.1;var scale=wheelDelta>0?factor:1/factor;checkPointerAndTrigger(this,'zoom','zoomOnMouseWheel',e,{scale:scale,originX:originX,originY:originY});}if(shouldMove){// FIXME: Should do more test in different environment.\nvar absDelta=Math.abs(wheelDelta);// wheelDelta of mouse wheel is bigger than touch pad.\nvar scrollDelta=(wheelDelta>0?1:-1)*(absDelta>3?0.4:absDelta>1?0.15:0.05);checkPointerAndTrigger(this,'scrollMove','moveOnMouseWheel',e,{scrollDelta:scrollDelta,originX:originX,originY:originY});}}function pinch(e){if(isTaken(this._zr,'globalPan')){return;}var scale=e.pinchScale>1?1.1:1/1.1;checkPointerAndTrigger(this,'zoom',null,e,{scale:scale,originX:e.pinchX,originY:e.pinchY});}function checkPointerAndTrigger(controller,eventName,behaviorToCheck,e,contollerEvent){if(controller.pointerChecker&&controller.pointerChecker(e,contollerEvent.originX,contollerEvent.originY)){// When mouse is out of roamController rect,\n// default befavoius should not be be disabled, otherwise\n// page sliding is disabled, contrary to expectation.\nstop(e.event);trigger(controller,eventName,behaviorToCheck,e,contollerEvent);}}function trigger(controller,eventName,behaviorToCheck,e,contollerEvent){// Also provide behavior checker for event listener, for some case that\n// multiple components share one listener.\ncontollerEvent.isAvailableBehavior=bind(isAvailableBehavior,null,behaviorToCheck,e);controller.trigger(eventName,contollerEvent);}// settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\nfunction isAvailableBehavior(behaviorToCheck,e,settings){var setting=settings[behaviorToCheck];return!behaviorToCheck||setting&&(!isString(setting)||e.event[setting+'Key']);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nvar ATTR='\\0_ec_dataZoom_roams';/**\n * @public\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} dataZoomInfo\n * @param {string} dataZoomInfo.coordId\n * @param {Function} dataZoomInfo.containsPoint\n * @param {Array.} dataZoomInfo.allCoordIds\n * @param {string} dataZoomInfo.dataZoomId\n * @param {Object} dataZoomInfo.getRange\n * @param {Function} dataZoomInfo.getRange.pan\n * @param {Function} dataZoomInfo.getRange.zoom\n * @param {Function} dataZoomInfo.getRange.scrollMove\n * @param {boolean} dataZoomInfo.dataZoomModel\n */function register$1(api,dataZoomInfo){var store=giveStore(api);var theDataZoomId=dataZoomInfo.dataZoomId;var theCoordId=dataZoomInfo.coordId;// Do clean when a dataZoom changes its target coordnate system.\n// Avoid memory leak, dispose all not-used-registered.\neach$1(store,function(record,coordId){var dataZoomInfos=record.dataZoomInfos;if(dataZoomInfos[theDataZoomId]&&indexOf(dataZoomInfo.allCoordIds,theCoordId)<0){delete dataZoomInfos[theDataZoomId];record.count--;}});cleanStore(store);var record=store[theCoordId];// Create if needed.\nif(!record){record=store[theCoordId]={coordId:theCoordId,dataZoomInfos:{},count:0};record.controller=createController(api,record);record.dispatchAction=curry(dispatchAction,api);}// Update reference of dataZoom.\n!record.dataZoomInfos[theDataZoomId]&&record.count++;record.dataZoomInfos[theDataZoomId]=dataZoomInfo;var controllerParams=mergeControllerParams(record.dataZoomInfos);record.controller.enable(controllerParams.controlType,controllerParams.opt);// Consider resize, area should be always updated.\nrecord.controller.setPointerChecker(dataZoomInfo.containsPoint);// Update throttle.\ncreateOrUpdate(record,'dispatchAction',dataZoomInfo.dataZoomModel.get('throttle',true),'fixRate');}/**\n * @public\n * @param {module:echarts/ExtensionAPI} api\n * @param {string} dataZoomId\n */function unregister$1(api,dataZoomId){var store=giveStore(api);each$1(store,function(record){record.controller.dispose();var dataZoomInfos=record.dataZoomInfos;if(dataZoomInfos[dataZoomId]){delete dataZoomInfos[dataZoomId];record.count--;}});cleanStore(store);}/**\n * @public\n */function generateCoordId(coordModel){return coordModel.type+'\\0_'+coordModel.id;}/**\n * Key: coordId, value: {dataZoomInfos: [], count, controller}\n * @type {Array.}\n */function giveStore(api){// Mount store on zrender instance, so that we do not\n// need to worry about dispose.\nvar zr=api.getZr();return zr[ATTR]||(zr[ATTR]={});}function createController(api,newRecord){var controller=new RoamController(api.getZr());each$1(['pan','zoom','scrollMove'],function(eventName){controller.on(eventName,function(event){var batch=[];each$1(newRecord.dataZoomInfos,function(info){// Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n// moveOnMouseWheel, ...) enabled.\nif(!event.isAvailableBehavior(info.dataZoomModel.option)){return;}var method=(info.getRange||{})[eventName];var range=method&&method(newRecord.controller,event);!info.dataZoomModel.get('disabled',true)&&range&&batch.push({dataZoomId:info.dataZoomId,start:range[0],end:range[1]});});batch.length&&newRecord.dispatchAction(batch);});});return controller;}function cleanStore(store){each$1(store,function(record,coordId){if(!record.count){record.controller.dispose();delete store[coordId];}});}/**\n * This action will be throttled.\n */function dispatchAction(api,batch){api.dispatchAction({type:'dataZoom',batch:batch});}/**\n * Merge roamController settings when multiple dataZooms share one roamController.\n */function mergeControllerParams(dataZoomInfos){var controlType;// DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n// as string, it is probably revert to reserved word by compress tool. See #7411.\nvar prefix='type_';var typePriority={'type_true':2,'type_move':1,'type_false':0,'type_undefined':-1};var preventDefaultMouseMove=true;each$1(dataZoomInfos,function(dataZoomInfo){var dataZoomModel=dataZoomInfo.dataZoomModel;var oneType=dataZoomModel.get('disabled',true)?false:dataZoomModel.get('zoomLock',true)?'move':true;if(typePriority[prefix+oneType]>typePriority[prefix+controlType]){controlType=oneType;}// Prevent default move event by default. If one false, do not prevent. Otherwise\n// users may be confused why it does not work when multiple insideZooms exist.\npreventDefaultMouseMove&=dataZoomModel.get('preventDefaultMouseMove',true);});return{controlType:controlType,opt:{// RoamController will enable all of these functionalities,\n// and the final behavior is determined by its event listener\n// provided by each inside zoom.\nzoomOnMouseWheel:true,moveOnMouseMove:true,moveOnMouseWheel:true,preventDefaultMouseMove:!!preventDefaultMouseMove}};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var bind$4=bind;var InsideZoomView=DataZoomView.extend({type:'dataZoom.inside',/**\n * @override\n */init:function init(ecModel,api){/**\n * 'throttle' is used in this.dispatchAction, so we save range\n * to avoid missing some 'pan' info.\n * @private\n * @type {Array.}\n */this._range;},/**\n * @override\n */render:function render(dataZoomModel,ecModel,api,payload){InsideZoomView.superApply(this,'render',arguments);// Hence the `throttle` util ensures to preserve command order,\n// here simply updating range all the time will not cause missing\n// any of the the roam change.\nthis._range=dataZoomModel.getPercentRange();// Reset controllers.\neach$1(this.getTargetCoordInfo(),function(coordInfoList,coordSysName){var allCoordIds=map(coordInfoList,function(coordInfo){return generateCoordId(coordInfo.model);});each$1(coordInfoList,function(coordInfo){var coordModel=coordInfo.model;var getRange={};each$1(['pan','zoom','scrollMove'],function(eventName){getRange[eventName]=bind$4(roamHandlers[eventName],this,coordInfo,coordSysName);},this);register$1(api,{coordId:generateCoordId(coordModel),allCoordIds:allCoordIds,containsPoint:function containsPoint(e,x,y){return coordModel.coordinateSystem.containPoint([x,y]);},dataZoomId:dataZoomModel.id,dataZoomModel:dataZoomModel,getRange:getRange});},this);},this);},/**\n * @override\n */dispose:function dispose(){unregister$1(this.api,this.dataZoomModel.id);InsideZoomView.superApply(this,'dispose',arguments);this._range=null;}});var roamHandlers={/**\n * @this {module:echarts/component/dataZoom/InsideZoomView}\n */zoom:function zoom(coordInfo,coordSysName,controller,e){var lastRange=this._range;var range=lastRange.slice();// Calculate transform by the first axis.\nvar axisModel=coordInfo.axisModels[0];if(!axisModel){return;}var directionInfo=getDirectionInfo[coordSysName](null,[e.originX,e.originY],axisModel,controller,coordInfo);var percentPoint=(directionInfo.signal>0?directionInfo.pixelStart+directionInfo.pixelLength-directionInfo.pixel:directionInfo.pixel-directionInfo.pixelStart)/directionInfo.pixelLength*(range[1]-range[0])+range[0];var scale=Math.max(1/e.scale,0);range[0]=(range[0]-percentPoint)*scale+percentPoint;range[1]=(range[1]-percentPoint)*scale+percentPoint;// Restrict range.\nvar minMaxSpan=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();sliderMove(0,range,[0,100],0,minMaxSpan.minSpan,minMaxSpan.maxSpan);this._range=range;if(lastRange[0]!==range[0]||lastRange[1]!==range[1]){return range;}},/**\n * @this {module:echarts/component/dataZoom/InsideZoomView}\n */pan:makeMover(function(range,axisModel,coordInfo,coordSysName,controller,e){var directionInfo=getDirectionInfo[coordSysName]([e.oldX,e.oldY],[e.newX,e.newY],axisModel,controller,coordInfo);return directionInfo.signal*(range[1]-range[0])*directionInfo.pixel/directionInfo.pixelLength;}),/**\n * @this {module:echarts/component/dataZoom/InsideZoomView}\n */scrollMove:makeMover(function(range,axisModel,coordInfo,coordSysName,controller,e){var directionInfo=getDirectionInfo[coordSysName]([0,0],[e.scrollDelta,e.scrollDelta],axisModel,controller,coordInfo);return directionInfo.signal*(range[1]-range[0])*e.scrollDelta;})};function makeMover(getPercentDelta){return function(coordInfo,coordSysName,controller,e){var lastRange=this._range;var range=lastRange.slice();// Calculate transform by the first axis.\nvar axisModel=coordInfo.axisModels[0];if(!axisModel){return;}var percentDelta=getPercentDelta(range,axisModel,coordInfo,coordSysName,controller,e);sliderMove(percentDelta,range,[0,100],'all');this._range=range;if(lastRange[0]!==range[0]||lastRange[1]!==range[1]){return range;}};}var getDirectionInfo={grid:function grid(oldPoint,newPoint,axisModel,controller,coordInfo){var axis=axisModel.axis;var ret={};var rect=coordInfo.model.coordinateSystem.getRect();oldPoint=oldPoint||[0,0];if(axis.dim==='x'){ret.pixel=newPoint[0]-oldPoint[0];ret.pixelLength=rect.width;ret.pixelStart=rect.x;ret.signal=axis.inverse?1:-1;}else{// axis.dim === 'y'\nret.pixel=newPoint[1]-oldPoint[1];ret.pixelLength=rect.height;ret.pixelStart=rect.y;ret.signal=axis.inverse?-1:1;}return ret;},polar:function polar(oldPoint,newPoint,axisModel,controller,coordInfo){var axis=axisModel.axis;var ret={};var polar=coordInfo.model.coordinateSystem;var radiusExtent=polar.getRadiusAxis().getExtent();var angleExtent=polar.getAngleAxis().getExtent();oldPoint=oldPoint?polar.pointToCoord(oldPoint):[0,0];newPoint=polar.pointToCoord(newPoint);if(axisModel.mainType==='radiusAxis'){ret.pixel=newPoint[0]-oldPoint[0];// ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n// ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\nret.pixelLength=radiusExtent[1]-radiusExtent[0];ret.pixelStart=radiusExtent[0];ret.signal=axis.inverse?1:-1;}else{// 'angleAxis'\nret.pixel=newPoint[1]-oldPoint[1];// ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n// ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\nret.pixelLength=angleExtent[1]-angleExtent[0];ret.pixelStart=angleExtent[0];ret.signal=axis.inverse?-1:1;}return ret;},singleAxis:function singleAxis(oldPoint,newPoint,axisModel,controller,coordInfo){var axis=axisModel.axis;var rect=coordInfo.model.coordinateSystem.getRect();var ret={};oldPoint=oldPoint||[0,0];if(axis.orient==='horizontal'){ret.pixel=newPoint[0]-oldPoint[0];ret.pixelLength=rect.width;ret.pixelStart=rect.x;ret.signal=axis.inverse?1:-1;}else{// 'vertical'\nret.pixel=newPoint[1]-oldPoint[1];ret.pixelLength=rect.height;ret.pixelStart=rect.y;ret.signal=axis.inverse?-1:1;}return ret;}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Do not include './dataZoomSelect',\n// since it only work for toolbox dataZoom.\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var features={};function register$2(name,ctor){features[name]=ctor;}function get$1(name){return features[name];}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var ToolboxModel=extendComponentModel({type:'toolbox',layoutMode:{type:'box',ignoreSize:true},optionUpdated:function optionUpdated(){ToolboxModel.superApply(this,'optionUpdated',arguments);each$1(this.option.feature,function(featureOpt,featureName){var Feature=get$1(featureName);Feature&&merge(featureOpt,Feature.defaultOption);});},defaultOption:{show:true,z:6,zlevel:0,orient:'horizontal',left:'right',top:'top',// right\n// bottom\nbackgroundColor:'transparent',borderColor:'#ccc',borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:true,iconStyle:{borderColor:'#666',color:'none'},emphasis:{iconStyle:{borderColor:'#3E98C5'}},// textStyle: {},\n// feature\ntooltip:{show:false}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/extendComponentView({type:'toolbox',render:function render(toolboxModel,ecModel,api,payload){var group=this.group;group.removeAll();if(!toolboxModel.get('show')){return;}var itemSize=+toolboxModel.get('itemSize');var featureOpts=toolboxModel.get('feature')||{};var features=this._features||(this._features={});var featureNames=[];each$1(featureOpts,function(opt,name){featureNames.push(name);});new DataDiffer(this._featureNames||[],featureNames).add(processFeature).update(processFeature).remove(curry(processFeature,null)).execute();// Keep for diff.\nthis._featureNames=featureNames;function processFeature(newIndex,oldIndex){var featureName=featureNames[newIndex];var oldName=featureNames[oldIndex];var featureOpt=featureOpts[featureName];var featureModel=new Model(featureOpt,toolboxModel,toolboxModel.ecModel);var feature;// FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\nif(payload&&payload.newTitle!=null&&payload.featureName===featureName){featureOpt.title=payload.newTitle;}if(featureName&&!oldName){// Create\nif(isUserFeatureName(featureName)){feature={model:featureModel,onclick:featureModel.option.onclick,featureName:featureName};}else{var Feature=get$1(featureName);if(!Feature){return;}feature=new Feature(featureModel,ecModel,api);}features[featureName]=feature;}else{feature=features[oldName];// If feature does not exsit.\nif(!feature){return;}feature.model=featureModel;feature.ecModel=ecModel;feature.api=api;}if(!featureName&&oldName){feature.dispose&&feature.dispose(ecModel,api);return;}if(!featureModel.get('show')||feature.unusable){feature.remove&&feature.remove(ecModel,api);return;}createIconPaths(featureModel,feature,featureName);featureModel.setIconStatus=function(iconName,status){var option=this.option;var iconPaths=this.iconPaths;option.iconStatus=option.iconStatus||{};option.iconStatus[iconName]=status;// FIXME\niconPaths[iconName]&&iconPaths[iconName].trigger(status);};if(feature.render){feature.render(featureModel,ecModel,api,payload);}}function createIconPaths(featureModel,feature,featureName){var iconStyleModel=featureModel.getModel('iconStyle');var iconStyleEmphasisModel=featureModel.getModel('emphasis.iconStyle');// If one feature has mutiple icon. they are orginaized as\n// {\n// icon: {\n// foo: '',\n// bar: ''\n// },\n// title: {\n// foo: '',\n// bar: ''\n// }\n// }\nvar icons=feature.getIcons?feature.getIcons():featureModel.get('icon');var titles=featureModel.get('title')||{};if(typeof icons==='string'){var icon=icons;var title=titles;icons={};titles={};icons[featureName]=icon;titles[featureName]=title;}var iconPaths=featureModel.iconPaths={};each$1(icons,function(iconStr,iconName){var path=createIcon(iconStr,{},{x:-itemSize/2,y:-itemSize/2,width:itemSize,height:itemSize});path.setStyle(iconStyleModel.getItemStyle());path.hoverStyle=iconStyleEmphasisModel.getItemStyle();// Text position calculation\npath.setStyle({text:titles[iconName],textAlign:iconStyleEmphasisModel.get('textAlign'),textBorderRadius:iconStyleEmphasisModel.get('textBorderRadius'),textPadding:iconStyleEmphasisModel.get('textPadding'),textFill:null});var tooltipModel=toolboxModel.getModel('tooltip');if(tooltipModel&&tooltipModel.get('show')){path.attr('tooltip',extend({content:titles[iconName],formatter:tooltipModel.get('formatter',true)||function(){return titles[iconName];},formatterParams:{componentType:'toolbox',name:iconName,title:titles[iconName],$vars:['name','title']},position:tooltipModel.get('position',true)||'bottom'},tooltipModel.option));}setHoverStyle(path);if(toolboxModel.get('showTitle')){path.__title=titles[iconName];path.on('mouseover',function(){// Should not reuse above hoverStyle, which might be modified.\nvar hoverStyle=iconStyleEmphasisModel.getItemStyle();var defaultTextPosition=toolboxModel.get('orient')==='vertical'?toolboxModel.get('right')==null?'right':'left':toolboxModel.get('bottom')==null?'bottom':'top';path.setStyle({textFill:iconStyleEmphasisModel.get('textFill')||hoverStyle.fill||hoverStyle.stroke||'#000',textBackgroundColor:iconStyleEmphasisModel.get('textBackgroundColor'),textPosition:iconStyleEmphasisModel.get('textPosition')||defaultTextPosition});}).on('mouseout',function(){path.setStyle({textFill:null,textBackgroundColor:null});});}path.trigger(featureModel.get('iconStatus.'+iconName)||'normal');group.add(path);path.on('click',bind(feature.onclick,feature,ecModel,api,iconName));iconPaths[iconName]=path;});}layout$2(group,toolboxModel,api);// Render background after group is layout\n// FIXME\ngroup.add(makeBackground(group.getBoundingRect(),toolboxModel));// Adjust icon title positions to avoid them out of screen\ngroup.eachChild(function(icon){var titleText=icon.__title;var hoverStyle=icon.hoverStyle;// May be background element\nif(hoverStyle&&titleText){var rect=_getBoundingRect(titleText,makeFont(hoverStyle));var offsetX=icon.position[0]+group.position[0];var offsetY=icon.position[1]+group.position[1]+itemSize;var needPutOnTop=false;if(offsetY+rect.height>api.getHeight()){hoverStyle.textPosition='top';needPutOnTop=true;}var topOffset=needPutOnTop?-5-rect.height:itemSize+8;if(offsetX+rect.width/2>api.getWidth()){hoverStyle.textPosition=['100%',topOffset];hoverStyle.textAlign='right';}else if(offsetX-rect.width/2<0){hoverStyle.textPosition=[0,topOffset];hoverStyle.textAlign='left';}}});},updateView:function updateView(toolboxModel,ecModel,api,payload){each$1(this._features,function(feature){feature.updateView&&feature.updateView(feature.model,ecModel,api,payload);});},// updateLayout: function (toolboxModel, ecModel, api, payload) {\n// zrUtil.each(this._features, function (feature) {\n// feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n// });\n// },\nremove:function remove(ecModel,api){each$1(this._features,function(feature){feature.remove&&feature.remove(ecModel,api);});this.group.removeAll();},dispose:function dispose(ecModel,api){each$1(this._features,function(feature){feature.dispose&&feature.dispose(ecModel,api);});}});function isUserFeatureName(featureName){return featureName.indexOf('my')===0;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /* global Uint8Array */var saveAsImageLang=lang.toolbox.saveAsImage;function SaveAsImage(model){this.model=model;}SaveAsImage.defaultOption={show:true,icon:'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',title:saveAsImageLang.title,type:'png',// Default use option.backgroundColor\n// backgroundColor: '#fff',\nconnectedBackgroundColor:'#fff',name:'',excludeComponents:['toolbox'],pixelRatio:1,lang:saveAsImageLang.lang.slice()};SaveAsImage.prototype.unusable=!env$1.canvasSupported;var proto$2=SaveAsImage.prototype;proto$2.onclick=function(ecModel,api){var model=this.model;var title=model.get('name')||ecModel.get('title.0.text')||'echarts';var isSvg=api.getZr().painter.getType()==='svg';var type=isSvg?'svg':model.get('type',true)||'png';var url=api.getConnectedDataURL({type:type,backgroundColor:model.get('backgroundColor',true)||ecModel.get('backgroundColor')||'#fff',connectedBackgroundColor:model.get('connectedBackgroundColor'),excludeComponents:model.get('excludeComponents'),pixelRatio:model.get('pixelRatio')});// Chrome and Firefox\nif(typeof MouseEvent==='function'&&!env$1.browser.ie&&!env$1.browser.edge){var $a=document.createElement('a');$a.download=title+'.'+type;$a.target='_blank';$a.href=url;var evt=new MouseEvent('click',{// some micro front-end framework, window maybe is a Proxy\nview:document.defaultView,bubbles:true,cancelable:false});$a.dispatchEvent(evt);}// IE\nelse{if(window.navigator.msSaveOrOpenBlob){var bstr=atob(url.split(',')[1]);var n=bstr.length;var u8arr=new Uint8Array(n);while(n--){u8arr[n]=bstr.charCodeAt(n);}var blob=new Blob([u8arr]);window.navigator.msSaveOrOpenBlob(blob,title+'.'+type);}else{var lang$$1=model.get('lang');var html=''+''+''+'';var tab=window.open();tab.document.write(html);}}};register$2('saveAsImage',SaveAsImage);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var magicTypeLang=lang.toolbox.magicType;var INNER_STACK_KEYWORD='__ec_magicType_stack__';function MagicType(model){this.model=model;}MagicType.defaultOption={show:true,type:[],// Icon group\nicon:{/* eslint-disable */line:'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',bar:'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',stack:'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'// jshint ignore:line\n/* eslint-enable */},// `line`, `bar`, `stack`, `tiled`\ntitle:_clone(magicTypeLang.title),option:{},seriesIndex:{}};var proto$3=MagicType.prototype;proto$3.getIcons=function(){var model=this.model;var availableIcons=model.get('icon');var icons={};each$1(model.get('type'),function(type){if(availableIcons[type]){icons[type]=availableIcons[type];}});return icons;};var seriesOptGenreator={'line':function line(seriesType,seriesId,seriesModel,model){if(seriesType==='bar'){return merge({id:seriesId,type:'line',// Preserve data related option\ndata:seriesModel.get('data'),stack:seriesModel.get('stack'),markPoint:seriesModel.get('markPoint'),markLine:seriesModel.get('markLine')},model.get('option.line')||{},true);}},'bar':function bar(seriesType,seriesId,seriesModel,model){if(seriesType==='line'){return merge({id:seriesId,type:'bar',// Preserve data related option\ndata:seriesModel.get('data'),stack:seriesModel.get('stack'),markPoint:seriesModel.get('markPoint'),markLine:seriesModel.get('markLine')},model.get('option.bar')||{},true);}},'stack':function stack(seriesType,seriesId,seriesModel,model){var isStack=seriesModel.get('stack')===INNER_STACK_KEYWORD;if(seriesType==='line'||seriesType==='bar'){model.setIconStatus('stack',isStack?'normal':'emphasis');return merge({id:seriesId,stack:isStack?'':INNER_STACK_KEYWORD},model.get('option.stack')||{},true);}}};var radioTypes=[['line','bar'],['stack']];proto$3.onclick=function(ecModel,api,type){var model=this.model;var seriesIndex=model.get('seriesIndex.'+type);// Not supported magicType\nif(!seriesOptGenreator[type]){return;}var newOption={series:[]};var generateNewSeriesTypes=function generateNewSeriesTypes(seriesModel){var seriesType=seriesModel.subType;var seriesId=seriesModel.id;var newSeriesOpt=seriesOptGenreator[type](seriesType,seriesId,seriesModel,model);if(newSeriesOpt){// PENDING If merge original option?\ndefaults(newSeriesOpt,seriesModel.option);newOption.series.push(newSeriesOpt);}// Modify boundaryGap\nvar coordSys=seriesModel.coordinateSystem;if(coordSys&&coordSys.type==='cartesian2d'&&(type==='line'||type==='bar')){var categoryAxis=coordSys.getAxesByScale('ordinal')[0];if(categoryAxis){var axisDim=categoryAxis.dim;var axisType=axisDim+'Axis';var axisModel=ecModel.queryComponents({mainType:axisType,index:seriesModel.get(name+'Index'),id:seriesModel.get(name+'Id')})[0];var axisIndex=axisModel.componentIndex;newOption[axisType]=newOption[axisType]||[];for(var i=0;i<=axisIndex;i++){newOption[axisType][axisIndex]=newOption[axisType][axisIndex]||{};}newOption[axisType][axisIndex].boundaryGap=type==='bar';}}};each$1(radioTypes,function(radio){if(indexOf(radio,type)>=0){each$1(radio,function(item){model.setIconStatus(item,'normal');});}});model.setIconStatus(type,'emphasis');ecModel.eachComponent({mainType:'series',query:seriesIndex==null?null:{seriesIndex:seriesIndex}},generateNewSeriesTypes);var newTitle;// Change title of stack\nif(type==='stack'){var isStack=newOption.series&&newOption.series[0]&&newOption.series[0].stack===INNER_STACK_KEYWORD;newTitle=isStack?merge({stack:magicTypeLang.title.tiled},magicTypeLang.title):_clone(magicTypeLang.title);}api.dispatchAction({type:'changeMagicType',currentType:type,newOption:newOption,newTitle:newTitle,featureName:'magicType'});};registerAction({type:'changeMagicType',event:'magicTypeChanged',update:'prepareAndUpdate'},function(payload,ecModel){ecModel.mergeOption(payload.newOption);});register$2('magicType',MagicType);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var dataViewLang=lang.toolbox.dataView;var BLOCK_SPLITER=new Array(60).join('-');var ITEM_SPLITER='\\t';/**\n * Group series into two types\n * 1. on category axis, like line, bar\n * 2. others, like scatter, pie\n * @param {module:echarts/model/Global} ecModel\n * @return {Object}\n * @inner\n */function groupSeries(ecModel){var seriesGroupByCategoryAxis={};var otherSeries=[];var meta=[];ecModel.eachRawSeries(function(seriesModel){var coordSys=seriesModel.coordinateSystem;if(coordSys&&(coordSys.type==='cartesian2d'||coordSys.type==='polar')){var baseAxis=coordSys.getBaseAxis();if(baseAxis.type==='category'){var key=baseAxis.dim+'_'+baseAxis.index;if(!seriesGroupByCategoryAxis[key]){seriesGroupByCategoryAxis[key]={categoryAxis:baseAxis,valueAxis:coordSys.getOtherAxis(baseAxis),series:[]};meta.push({axisDim:baseAxis.dim,axisIndex:baseAxis.index});}seriesGroupByCategoryAxis[key].series.push(seriesModel);}else{otherSeries.push(seriesModel);}}else{otherSeries.push(seriesModel);}});return{seriesGroupByCategoryAxis:seriesGroupByCategoryAxis,other:otherSeries,meta:meta};}/**\n * Assemble content of series on cateogory axis\n * @param {Array.} series\n * @return {string}\n * @inner\n */function assembleSeriesWithCategoryAxis(series){var tables=[];each$1(series,function(group,key){var categoryAxis=group.categoryAxis;var valueAxis=group.valueAxis;var valueAxisDim=valueAxis.dim;var headers=[' '].concat(map(group.series,function(series){return series.name;}));var columns=[categoryAxis.model.getCategories()];each$1(group.series,function(series){var rawData=series.getRawData();columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim),function(val){return val;}));});// Assemble table content\nvar lines=[headers.join(ITEM_SPLITER)];for(var i=0;i} series\n * @return {string}\n * @inner\n */function assembleOtherSeries(series){return map(series,function(series){var data=series.getRawData();var lines=[series.name];var vals=[];data.each(data.dimensions,function(){var argLen=arguments.length;var dataIndex=arguments[argLen-1];var name=data.getName(dataIndex);for(var i=0;i=0){return true;}}var itemSplitRegex=new RegExp('['+ITEM_SPLITER+']+','g');/**\n * @param {string} tsv\n * @return {Object}\n */function parseTSVContents(tsv){var tsvLines=tsv.split(/\\n+/g);var headers=trim$1(tsvLines.shift()).split(itemSplitRegex);var categories=[];var series=map(headers,function(header){return{name:header,data:[]};});for(var i=0;i}\n * @inner\n */function parseListContents(str){var lines=str.split(/\\n+/g);var seriesName=trim$1(lines.shift());var data=[];for(var i=0;i} blockMetaList\n * @return {Object}\n * @inner\n */function parseContents(str,blockMetaList){var blocks=str.split(new RegExp('\\n*'+BLOCK_SPLITER+'\\n*','g'));var newOption={series:[]};each$1(blocks,function(block,idx){if(isTSVFormat(block)){var result=parseTSVContents(block);var blockMeta=blockMetaList[idx];var axisKey=blockMeta.axisDim+'Axis';if(blockMeta){newOption[axisKey]=newOption[axisKey]||[];newOption[axisKey][blockMeta.axisIndex]={data:result.categories};newOption.series=newOption.series.concat(result.series);}}else{var result=parseListContents(block);newOption.series.push(result);}});return newOption;}/**\n * @alias {module:echarts/component/toolbox/feature/DataView}\n * @constructor\n * @param {module:echarts/model/Model} model\n */function DataView(model){this._dom=null;this.model=model;}DataView.defaultOption={show:true,readOnly:false,optionToContent:null,contentToOption:null,icon:'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',title:_clone(dataViewLang.title),lang:_clone(dataViewLang.lang),backgroundColor:'#fff',textColor:'#000',textareaColor:'#fff',textareaBorderColor:'#333',buttonColor:'#c23531',buttonTextColor:'#fff'};DataView.prototype.onclick=function(ecModel,api){var container=api.getDom();var model=this.model;if(this._dom){container.removeChild(this._dom);}var root=document.createElement('div');root.style.cssText='position:absolute;left:5px;top:5px;bottom:5px;right:5px;';root.style.backgroundColor=model.get('backgroundColor')||'#fff';// Create elements\nvar header=document.createElement('h4');var lang$$1=model.get('lang')||[];header.innerHTML=lang$$1[0]||model.get('title');header.style.cssText='margin: 10px 20px;';header.style.color=model.get('textColor');var viewMain=document.createElement('div');var textarea=document.createElement('textarea');viewMain.style.cssText='display:block;width:100%;overflow:auto;';var optionToContent=model.get('optionToContent');var contentToOption=model.get('contentToOption');var result=getContentFromModel(ecModel);if(typeof optionToContent==='function'){var htmlOrDom=optionToContent(api.getOption());if(typeof htmlOrDom==='string'){viewMain.innerHTML=htmlOrDom;}else if(isDom(htmlOrDom)){viewMain.appendChild(htmlOrDom);}}else{// Use default textarea\nviewMain.appendChild(textarea);textarea.readOnly=model.get('readOnly');textarea.style.cssText='width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';textarea.style.color=model.get('textColor');textarea.style.borderColor=model.get('textareaBorderColor');textarea.style.backgroundColor=model.get('textareaColor');textarea.value=result.value;}var blockMetaList=result.meta;var buttonContainer=document.createElement('div');buttonContainer.style.cssText='position:absolute;bottom:0;left:0;right:0;';var buttonStyle='float:right;margin-right:20px;border:none;'+'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';var closeButton=document.createElement('div');var refreshButton=document.createElement('div');buttonStyle+=';background-color:'+model.get('buttonColor');buttonStyle+=';color:'+model.get('buttonTextColor');var self=this;function close(){container.removeChild(root);self._dom=null;}addEventListener(closeButton,'click',close);addEventListener(refreshButton,'click',function(){var newOption;try{if(typeof contentToOption==='function'){newOption=contentToOption(viewMain,api.getOption());}else{newOption=parseContents(textarea.value,blockMetaList);}}catch(e){close();throw new Error('Data view format error '+e);}if(newOption){api.dispatchAction({type:'changeDataView',newOption:newOption});}close();});closeButton.innerHTML=lang$$1[1];refreshButton.innerHTML=lang$$1[2];refreshButton.style.cssText=buttonStyle;closeButton.style.cssText=buttonStyle;!model.get('readOnly')&&buttonContainer.appendChild(refreshButton);buttonContainer.appendChild(closeButton);root.appendChild(header);root.appendChild(viewMain);root.appendChild(buttonContainer);viewMain.style.height=container.clientHeight-80+'px';container.appendChild(root);this._dom=root;};DataView.prototype.remove=function(ecModel,api){this._dom&&api.getDom().removeChild(this._dom);};DataView.prototype.dispose=function(ecModel,api){this.remove(ecModel,api);};/**\n * @inner\n */function tryMergeDataOption(newData,originalData){return map(newData,function(newVal,idx){var original=originalData&&originalData[idx];if(isObject$1(original)&&!isArray(original)){var newValIsObject=isObject$1(newVal)&&!isArray(newVal);if(!newValIsObject){newVal={value:newVal};}// original data has name but new data has no name\nvar shouldDeleteName=original.name!=null&&newVal.name==null;// Original data has option\nnewVal=defaults(newVal,original);shouldDeleteName&&delete newVal.name;return newVal;}else{return newVal;}});}register$2('dataView',DataView);registerAction({type:'changeDataView',event:'dataViewChanged',update:'prepareAndUpdate'},function(payload,ecModel){var newSeriesOptList=[];each$1(payload.newOption.series,function(seriesOpt){var seriesModel=ecModel.getSeriesByName(seriesOpt.name)[0];if(!seriesModel){// New created series\n// Geuss the series type\nnewSeriesOptList.push(extend({// Default is scatter\ntype:'scatter'},seriesOpt));}else{var originalData=seriesModel.get('data');newSeriesOptList.push({name:seriesOpt.name,data:tryMergeDataOption(seriesOpt.data,originalData)});}});ecModel.mergeOption(defaults({series:newSeriesOptList},payload.newOption));});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var curry$5=curry;var each$16=each$1;var map$2=map;var mathMin$5=Math.min;var mathMax$5=Math.max;var mathPow$2=Math.pow;var COVER_Z=10000;var UNSELECT_THRESHOLD=6;var MIN_RESIZE_LINE_WIDTH=6;var MUTEX_RESOURCE_KEY='globalPan';var DIRECTION_MAP={w:[0,0],e:[0,1],n:[1,0],s:[1,1]};var CURSOR_MAP={w:'ew',e:'ew',n:'ns',s:'ns',ne:'nesw',sw:'nesw',nw:'nwse',se:'nwse'};var DEFAULT_BRUSH_OPT={brushStyle:{lineWidth:2,stroke:'rgba(0,0,0,0.3)',fill:'rgba(0,0,0,0.1)'},transformable:true,brushMode:'single',removeOnClick:false};var baseUID=0;/**\n * @alias module:echarts/component/helper/BrushController\n * @constructor\n * @mixin {module:zrender/mixin/Eventful}\n * @event module:echarts/component/helper/BrushController#brush\n * params:\n * areas: Array., coord relates to container group,\n * If no container specified, to global.\n * opt {\n * isEnd: boolean,\n * removeOnClick: boolean\n * }\n *\n * @param {module:zrender/zrender~ZRender} zr\n */function BrushController(zr){if(__DEV__){assert$1(zr);}Eventful.call(this);/**\n * @type {module:zrender/zrender~ZRender}\n * @private\n */this._zr=zr;/**\n * @type {module:zrender/container/Group}\n * @readOnly\n */this.group=new Group();/**\n * Only for drawing (after enabledBrush).\n * 'line', 'rect', 'polygon' or false\n * If passing false/null/undefined, disable brush.\n * If passing 'auto', determined by panel.defaultBrushType\n * @private\n * @type {string}\n */this._brushType;/**\n * Only for drawing (after enabledBrush).\n *\n * @private\n * @type {Object}\n */this._brushOption;/**\n * @private\n * @type {Object}\n */this._panels;/**\n * @private\n * @type {Array.}\n */this._track=[];/**\n * @private\n * @type {boolean}\n */this._dragging;/**\n * @private\n * @type {Array}\n */this._covers=[];/**\n * @private\n * @type {moudule:zrender/container/Group}\n */this._creatingCover;/**\n * `true` means global panel\n * @private\n * @type {module:zrender/container/Group|boolean}\n */this._creatingPanel;/**\n * @private\n * @type {boolean}\n */this._enableGlobalPan;/**\n * @private\n * @type {boolean}\n */if(__DEV__){this._mounted;}/**\n * @private\n * @type {string}\n */this._uid='brushController_'+baseUID++;/**\n * @private\n * @type {Object}\n */this._handlers={};each$16(pointerHandlers,function(handler,eventName){this._handlers[eventName]=bind(handler,this);},this);}BrushController.prototype={constructor:BrushController,/**\n * If set to null/undefined/false, select disabled.\n * @param {Object} brushOption\n * @param {string|boolean} brushOption.brushType 'line', 'rect', 'polygon' or false\n * If passing false/null/undefined, disable brush.\n * If passing 'auto', determined by panel.defaultBrushType.\n * ('auto' can not be used in global panel)\n * @param {number} [brushOption.brushMode='single'] 'single' or 'multiple'\n * @param {boolean} [brushOption.transformable=true]\n * @param {boolean} [brushOption.removeOnClick=false]\n * @param {Object} [brushOption.brushStyle]\n * @param {number} [brushOption.brushStyle.width]\n * @param {number} [brushOption.brushStyle.lineWidth]\n * @param {string} [brushOption.brushStyle.stroke]\n * @param {string} [brushOption.brushStyle.fill]\n * @param {number} [brushOption.z]\n */enableBrush:function enableBrush(brushOption){if(__DEV__){assert$1(this._mounted);}this._brushType&&doDisableBrush(this);brushOption.brushType&&doEnableBrush(this,brushOption);return this;},/**\n * @param {Array.} panelOpts If not pass, it is global brush.\n * Each items: {\n * panelId, // mandatory.\n * clipPath, // mandatory. function.\n * isTargetByCursor, // mandatory. function.\n * defaultBrushType, // optional, only used when brushType is 'auto'.\n * getLinearBrushOtherExtent, // optional. function.\n * }\n */setPanels:function setPanels(panelOpts){if(panelOpts&&panelOpts.length){var panels=this._panels={};each$1(panelOpts,function(panelOpts){panels[panelOpts.panelId]=_clone(panelOpts);});}else{this._panels=null;}return this;},/**\n * @param {Object} [opt]\n * @return {boolean} [opt.enableGlobalPan=false]\n */mount:function mount(opt){opt=opt||{};if(__DEV__){this._mounted=true;// should be at first.\n}this._enableGlobalPan=opt.enableGlobalPan;var thisGroup=this.group;this._zr.add(thisGroup);thisGroup.attr({position:opt.position||[0,0],rotation:opt.rotation||0,scale:opt.scale||[1,1]});this._transform=thisGroup.getLocalTransform();return this;},eachCover:function eachCover(cb,context){each$16(this._covers,cb,context);},/**\n * Update covers.\n * @param {Array.} brushOptionList Like:\n * [\n * {id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable},\n * {id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]},\n * ...\n * ]\n * `brushType` is required in each cover info. (can not be 'auto')\n * `id` is not mandatory.\n * `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default.\n * If brushOptionList is null/undefined, all covers removed.\n */updateCovers:function updateCovers(brushOptionList){if(__DEV__){assert$1(this._mounted);}brushOptionList=map(brushOptionList,function(brushOption){return merge(_clone(DEFAULT_BRUSH_OPT),brushOption,true);});var tmpIdPrefix='\\0-brush-index-';var oldCovers=this._covers;var newCovers=this._covers=[];var controller=this;var creatingCover=this._creatingCover;new DataDiffer(oldCovers,brushOptionList,oldGetKey,getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();return this;function getKey(brushOption,index){return(brushOption.id!=null?brushOption.id:tmpIdPrefix+index)+'-'+brushOption.brushType;}function oldGetKey(cover,index){return getKey(cover.__brushOption,index);}function addOrUpdate(newIndex,oldIndex){var newBrushOption=brushOptionList[newIndex];// Consider setOption in event listener of brushSelect,\n// where updating cover when creating should be forbiden.\nif(oldIndex!=null&&oldCovers[oldIndex]===creatingCover){newCovers[newIndex]=oldCovers[oldIndex];}else{var cover=newCovers[newIndex]=oldIndex!=null?(oldCovers[oldIndex].__brushOption=newBrushOption,oldCovers[oldIndex]):endCreating(controller,createCover(controller,newBrushOption));updateCoverAfterCreation(controller,cover);}}function remove(oldIndex){if(oldCovers[oldIndex]!==creatingCover){controller.group.remove(oldCovers[oldIndex]);}}},unmount:function unmount(){if(__DEV__){if(!this._mounted){return;}}this.enableBrush(false);// container may 'removeAll' outside.\nclearCovers(this);this._zr.remove(this.group);if(__DEV__){this._mounted=false;// should be at last.\n}return this;},dispose:function dispose(){this.unmount();this.off();}};mixin(BrushController,Eventful);function doEnableBrush(controller,brushOption){var zr=controller._zr;// Consider roam, which takes globalPan too.\nif(!controller._enableGlobalPan){take(zr,MUTEX_RESOURCE_KEY,controller._uid);}mountHandlers(zr,controller._handlers);controller._brushType=brushOption.brushType;controller._brushOption=merge(_clone(DEFAULT_BRUSH_OPT),brushOption,true);}function doDisableBrush(controller){var zr=controller._zr;release(zr,MUTEX_RESOURCE_KEY,controller._uid);unmountHandlers(zr,controller._handlers);controller._brushType=controller._brushOption=null;}function mountHandlers(zr,handlers){each$16(handlers,function(handler,eventName){zr.on(eventName,handler);});}function unmountHandlers(zr,handlers){each$16(handlers,function(handler,eventName){zr.off(eventName,handler);});}function createCover(controller,brushOption){var cover=coverRenderers[brushOption.brushType].createCover(controller,brushOption);cover.__brushOption=brushOption;updateZ$1(cover,brushOption);controller.group.add(cover);return cover;}function endCreating(controller,creatingCover){var coverRenderer=getCoverRenderer(creatingCover);if(coverRenderer.endCreating){coverRenderer.endCreating(controller,creatingCover);updateZ$1(creatingCover,creatingCover.__brushOption);}return creatingCover;}function updateCoverShape(controller,cover){var brushOption=cover.__brushOption;getCoverRenderer(cover).updateCoverShape(controller,cover,brushOption.range,brushOption);}function updateZ$1(cover,brushOption){var z=brushOption.z;z==null&&(z=COVER_Z);cover.traverse(function(el){el.z=z;el.z2=z;// Consider in given container.\n});}function updateCoverAfterCreation(controller,cover){getCoverRenderer(cover).updateCommon(controller,cover);updateCoverShape(controller,cover);}function getCoverRenderer(cover){return coverRenderers[cover.__brushOption.brushType];}// return target panel or `true` (means global panel)\nfunction getPanelByPoint(controller,e,localCursorPoint){var panels=controller._panels;if(!panels){return true;// Global panel\n}var panel;var transform=controller._transform;each$16(panels,function(pn){pn.isTargetByCursor(e,localCursorPoint,transform)&&(panel=pn);});return panel;}// Return a panel or true\nfunction getPanelByCover(controller,cover){var panels=controller._panels;if(!panels){return true;// Global panel\n}var panelId=cover.__brushOption.panelId;// User may give cover without coord sys info,\n// which is then treated as global panel.\nreturn panelId!=null?panels[panelId]:true;}function clearCovers(controller){var covers=controller._covers;var originalLength=covers.length;each$16(covers,function(cover){controller.group.remove(cover);},controller);covers.length=0;return!!originalLength;}function trigger$1(controller,opt){var areas=map$2(controller._covers,function(cover){var brushOption=cover.__brushOption;var range=_clone(brushOption.range);return{brushType:brushOption.brushType,panelId:brushOption.panelId,range:range};});controller.trigger('brush',areas,{isEnd:!!opt.isEnd,removeOnClick:!!opt.removeOnClick});}function shouldShowCover(controller){var track=controller._track;if(!track.length){return false;}var p2=track[track.length-1];var p1=track[0];var dx=p2[0]-p1[0];var dy=p2[1]-p1[1];var dist=mathPow$2(dx*dx+dy*dy,0.5);return dist>UNSELECT_THRESHOLD;}function getTrackEnds(track){var tail=track.length-1;tail<0&&(tail=0);return[track[0],track[tail]];}function createBaseRectCover(doDrift,controller,brushOption,edgeNames){var cover=new Group();cover.add(new Rect({name:'main',style:makeStyle(brushOption),silent:true,draggable:true,cursor:'move',drift:curry$5(doDrift,controller,cover,'nswe'),ondragend:curry$5(trigger$1,controller,{isEnd:true})}));each$16(edgeNames,function(name){cover.add(new Rect({name:name,style:{opacity:0},draggable:true,silent:true,invisible:true,drift:curry$5(doDrift,controller,cover,name),ondragend:curry$5(trigger$1,controller,{isEnd:true})}));});return cover;}function updateBaseRect(controller,cover,localRange,brushOption){var lineWidth=brushOption.brushStyle.lineWidth||0;var handleSize=mathMax$5(lineWidth,MIN_RESIZE_LINE_WIDTH);var x=localRange[0][0];var y=localRange[1][0];var xa=x-lineWidth/2;var ya=y-lineWidth/2;var x2=localRange[0][1];var y2=localRange[1][1];var x2a=x2-handleSize+lineWidth/2;var y2a=y2-handleSize+lineWidth/2;var width=x2-x;var height=y2-y;var widtha=width+lineWidth;var heighta=height+lineWidth;updateRectShape(controller,cover,'main',x,y,width,height);if(brushOption.transformable){updateRectShape(controller,cover,'w',xa,ya,handleSize,heighta);updateRectShape(controller,cover,'e',x2a,ya,handleSize,heighta);updateRectShape(controller,cover,'n',xa,ya,widtha,handleSize);updateRectShape(controller,cover,'s',xa,y2a,widtha,handleSize);updateRectShape(controller,cover,'nw',xa,ya,handleSize,handleSize);updateRectShape(controller,cover,'ne',x2a,ya,handleSize,handleSize);updateRectShape(controller,cover,'sw',xa,y2a,handleSize,handleSize);updateRectShape(controller,cover,'se',x2a,y2a,handleSize,handleSize);}}function updateCommon(controller,cover){var brushOption=cover.__brushOption;var transformable=brushOption.transformable;var mainEl=cover.childAt(0);mainEl.useStyle(makeStyle(brushOption));mainEl.attr({silent:!transformable,cursor:transformable?'move':'default'});each$16(['w','e','n','s','se','sw','ne','nw'],function(name){var el=cover.childOfName(name);var globalDir=getGlobalDirection(controller,name);el&&el.attr({silent:!transformable,invisible:!transformable,cursor:transformable?CURSOR_MAP[globalDir]+'-resize':null});});}function updateRectShape(controller,cover,name,x,y,w,h){var el=cover.childOfName(name);el&&el.setShape(pointsToRect(clipByPanel(controller,cover,[[x,y],[x+w,y+h]])));}function makeStyle(brushOption){return defaults({strokeNoScale:true},brushOption.brushStyle);}function formatRectRange(x,y,x2,y2){var min=[mathMin$5(x,x2),mathMin$5(y,y2)];var max=[mathMax$5(x,x2),mathMax$5(y,y2)];return[[min[0],max[0]],// x range\n[min[1],max[1]]// y range\n];}function getTransform$1(controller){return getTransform(controller.group);}function getGlobalDirection(controller,localDirection){if(localDirection.length>1){localDirection=localDirection.split('');var globalDir=[getGlobalDirection(controller,localDirection[0]),getGlobalDirection(controller,localDirection[1])];(globalDir[0]==='e'||globalDir[0]==='w')&&globalDir.reverse();return globalDir.join('');}else{var map$$1={w:'left',e:'right',n:'top',s:'bottom'};var inverseMap={left:'w',right:'e',top:'n',bottom:'s'};var globalDir=transformDirection(map$$1[localDirection],getTransform$1(controller));return inverseMap[globalDir];}}function driftRect(toRectRange,fromRectRange,controller,cover,name,dx,dy,e){var brushOption=cover.__brushOption;var rectRange=toRectRange(brushOption.range);var localDelta=toLocalDelta(controller,dx,dy);each$16(name.split(''),function(namePart){var ind=DIRECTION_MAP[namePart];rectRange[ind[0]][ind[1]]+=localDelta[ind[0]];});brushOption.range=fromRectRange(formatRectRange(rectRange[0][0],rectRange[1][0],rectRange[0][1],rectRange[1][1]));updateCoverAfterCreation(controller,cover);trigger$1(controller,{isEnd:false});}function driftPolygon(controller,cover,dx,dy,e){var range=cover.__brushOption.range;var localDelta=toLocalDelta(controller,dx,dy);each$16(range,function(point){point[0]+=localDelta[0];point[1]+=localDelta[1];});updateCoverAfterCreation(controller,cover);trigger$1(controller,{isEnd:false});}function toLocalDelta(controller,dx,dy){var thisGroup=controller.group;var localD=thisGroup.transformCoordToLocal(dx,dy);var localZero=thisGroup.transformCoordToLocal(0,0);return[localD[0]-localZero[0],localD[1]-localZero[1]];}function clipByPanel(controller,cover,data){var panel=getPanelByCover(controller,cover);return panel&&panel!==true?panel.clipPath(data,controller._transform):_clone(data);}function pointsToRect(points){var xmin=mathMin$5(points[0][0],points[1][0]);var ymin=mathMin$5(points[0][1],points[1][1]);var xmax=mathMax$5(points[0][0],points[1][0]);var ymax=mathMax$5(points[0][1],points[1][1]);return{x:xmin,y:ymin,width:xmax-xmin,height:ymax-ymin};}function resetCursor(controller,e,localCursorPoint){if(// Check active\n!controller._brushType// resetCursor should be always called when mouse is in zr area,\n// but not called when mouse is out of zr area to avoid bad influence\n// if `mousemove`, `mouseup` are triggered from `document` event.\n||isOutsideZrArea(controller,e)){return;}var zr=controller._zr;var covers=controller._covers;var currPanel=getPanelByPoint(controller,e,localCursorPoint);// Check whether in covers.\nif(!controller._dragging){for(var i=0;izr.getWidth()||y<0||y>zr.getHeight();}/**\n * key: brushType\n * @type {Object}\n */var coverRenderers={lineX:getLineRenderer(0),lineY:getLineRenderer(1),rect:{createCover:function createCover(controller,brushOption){return createBaseRectCover(curry$5(driftRect,function(range){return range;},function(range){return range;}),controller,brushOption,['w','e','n','s','se','sw','ne','nw']);},getCreatingRange:function getCreatingRange(localTrack){var ends=getTrackEnds(localTrack);return formatRectRange(ends[1][0],ends[1][1],ends[0][0],ends[0][1]);},updateCoverShape:function updateCoverShape(controller,cover,localRange,brushOption){updateBaseRect(controller,cover,localRange,brushOption);},updateCommon:updateCommon,contain:mainShapeContain},polygon:{createCover:function createCover(controller,brushOption){var cover=new Group();// Do not use graphic.Polygon because graphic.Polyline do not close the\n// border of the shape when drawing, which is a better experience for user.\ncover.add(new Polyline({name:'main',style:makeStyle(brushOption),silent:true}));return cover;},getCreatingRange:function getCreatingRange(localTrack){return localTrack;},endCreating:function endCreating(controller,cover){cover.remove(cover.childAt(0));// Use graphic.Polygon close the shape.\ncover.add(new Polygon({name:'main',draggable:true,drift:curry$5(driftPolygon,controller,cover),ondragend:curry$5(trigger$1,controller,{isEnd:true})}));},updateCoverShape:function updateCoverShape(controller,cover,localRange,brushOption){cover.childAt(0).setShape({points:clipByPanel(controller,cover,localRange)});},updateCommon:updateCommon,contain:mainShapeContain}};function getLineRenderer(xyIndex){return{createCover:function createCover(controller,brushOption){return createBaseRectCover(curry$5(driftRect,function(range){var rectRange=[range,[0,100]];xyIndex&&rectRange.reverse();return rectRange;},function(rectRange){return rectRange[xyIndex];}),controller,brushOption,[['w','e'],['n','s']][xyIndex]);},getCreatingRange:function getCreatingRange(localTrack){var ends=getTrackEnds(localTrack);var min=mathMin$5(ends[0][xyIndex],ends[1][xyIndex]);var max=mathMax$5(ends[0][xyIndex],ends[1][xyIndex]);return[min,max];},updateCoverShape:function updateCoverShape(controller,cover,localRange,brushOption){var otherExtent;// If brushWidth not specified, fit the panel.\nvar panel=getPanelByCover(controller,cover);if(panel!==true&&panel.getLinearBrushOtherExtent){otherExtent=panel.getLinearBrushOtherExtent(xyIndex,controller._transform);}else{var zr=controller._zr;otherExtent=[0,[zr.getWidth(),zr.getHeight()][1-xyIndex]];}var rectRange=[localRange,otherExtent];xyIndex&&rectRange.reverse();updateBaseRect(controller,cover,rectRange,brushOption);},updateCommon:updateCommon,contain:mainShapeContain};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var IRRELEVANT_EXCLUDES={'axisPointer':1,'tooltip':1,'brush':1};/**\n * Avoid that: mouse click on a elements that is over geo or graph,\n * but roam is triggered.\n */function onIrrelevantElement(e,api,targetCoordSysModel){var model=api.getComponentByElement(e.topTarget);// If model is axisModel, it works only if it is injected with coordinateSystem.\nvar coordSys=model&&model.coordinateSystem;return model&&model!==targetCoordSysModel&&!IRRELEVANT_EXCLUDES[model.mainType]&&coordSys&&coordSys.model!==targetCoordSysModel;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function makeRectPanelClipPath(rect){rect=normalizeRect(rect);return function(localPoints,transform){return clipPointsByRect(localPoints,rect);};}function makeLinearBrushOtherExtent(rect,specifiedXYIndex){rect=normalizeRect(rect);return function(xyIndex){var idx=specifiedXYIndex!=null?specifiedXYIndex:xyIndex;var brushWidth=idx?rect.width:rect.height;var base=idx?rect.x:rect.y;return[base,base+(brushWidth||0)];};}function makeRectIsTargetByCursor(rect,api,targetModel){rect=normalizeRect(rect);return function(e,localCursorPoint,transform){return rect.contain(localCursorPoint[0],localCursorPoint[1])&&!onIrrelevantElement(e,api,targetModel);};}// Consider width/height is negative.\nfunction normalizeRect(rect){return BoundingRect.create(rect);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$17=each$1;var indexOf$2=indexOf;var curry$6=curry;var COORD_CONVERTS=['dataToPoint','pointToData'];// FIXME\n// how to genarialize to more coordinate systems.\nvar INCLUDE_FINDER_MAIN_TYPES=['grid','xAxis','yAxis','geo','graph','polar','radiusAxis','angleAxis','bmap'];/**\n * [option in constructor]:\n * {\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * }\n *\n *\n * [targetInfo]:\n *\n * There can be multiple axes in a single targetInfo. Consider the case\n * of `grid` component, a targetInfo represents a grid which contains one or more\n * cartesian and one or more axes. And consider the case of parallel system,\n * which has multiple axes in a coordinate system.\n * Can be {\n * panelId: ...,\n * coordSys: ,\n * coordSyses: all cartesians.\n * gridModel: \n * xAxes: correspond to coordSyses on index\n * yAxes: correspond to coordSyses on index\n * }\n * or {\n * panelId: ...,\n * coordSys: \n * coordSyses: []\n * geoModel: \n * }\n *\n *\n * [panelOpt]:\n *\n * Make from targetInfo. Input to BrushController.\n * {\n * panelId: ...,\n * rect: ...\n * }\n *\n *\n * [area]:\n *\n * Generated by BrushController or user input.\n * {\n * panelId: Used to locate coordInfo directly. If user inpput, no panelId.\n * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y').\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * range: pixel range.\n * coordRange: representitive coord range (the first one of coordRanges).\n * coordRanges: coord ranges, used in multiple cartesian in one grid.\n * }\n */ /**\n * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} [opt]\n * @param {Array.} [opt.include] include coordinate system types.\n */function BrushTargetManager(option,ecModel,opt){/**\n * @private\n * @type {Array.}\n */var targetInfoList=this._targetInfoList=[];var info={};var foundCpts=parseFinder$1(ecModel,option);each$17(targetInfoBuilders,function(builder,type){if(!opt||!opt.include||indexOf$2(opt.include,type)>=0){builder(foundCpts,targetInfoList,info);}});}var proto$5=BrushTargetManager.prototype;proto$5.setOutputRanges=function(areas,ecModel){this.matchOutputRanges(areas,ecModel,function(area,coordRange,coordSys){(area.coordRanges||(area.coordRanges=[])).push(coordRange);// area.coordRange is the first of area.coordRanges\nif(!area.coordRange){area.coordRange=coordRange;// In 'category' axis, coord to pixel is not reversible, so we can not\n// rebuild range by coordRange accrately, which may bring trouble when\n// brushing only one item. So we use __rangeOffset to rebuilding range\n// by coordRange. And this it only used in brush component so it is no\n// need to be adapted to coordRanges.\nvar result=coordConvert[area.brushType](0,coordSys,coordRange);area.__rangeOffset={offset:diffProcessor[area.brushType](result.values,area.range,[1,1]),xyMinMax:result.xyMinMax};}});};proto$5.matchOutputRanges=function(areas,ecModel,cb){each$17(areas,function(area){var targetInfo=this.findTargetInfo(area,ecModel);if(targetInfo&&targetInfo!==true){each$1(targetInfo.coordSyses,function(coordSys){var result=coordConvert[area.brushType](1,coordSys,area.range);cb(area,result.values,coordSys,ecModel);});}},this);};proto$5.setInputRanges=function(areas,ecModel){each$17(areas,function(area){var targetInfo=this.findTargetInfo(area,ecModel);if(__DEV__){assert$1(!targetInfo||targetInfo===true||area.coordRange,'coordRange must be specified when coord index specified.');assert$1(!targetInfo||targetInfo!==true||area.range,'range must be specified in global brush.');}area.range=area.range||[];// convert coordRange to global range and set panelId.\nif(targetInfo&&targetInfo!==true){area.panelId=targetInfo.panelId;// (1) area.range shoule always be calculate from coordRange but does\n// not keep its original value, for the sake of the dataZoom scenario,\n// where area.coordRange remains unchanged but area.range may be changed.\n// (2) Only support converting one coordRange to pixel range in brush\n// component. So do not consider `coordRanges`.\n// (3) About __rangeOffset, see comment above.\nvar result=coordConvert[area.brushType](0,targetInfo.coordSys,area.coordRange);var rangeOffset=area.__rangeOffset;area.range=rangeOffset?diffProcessor[area.brushType](result.values,rangeOffset.offset,getScales(result.xyMinMax,rangeOffset.xyMinMax)):result.values;}},this);};proto$5.makePanelOpts=function(api,getDefaultBrushType){return map(this._targetInfoList,function(targetInfo){var rect=targetInfo.getPanelRect();return{panelId:targetInfo.panelId,defaultBrushType:getDefaultBrushType&&getDefaultBrushType(targetInfo),clipPath:makeRectPanelClipPath(rect),isTargetByCursor:makeRectIsTargetByCursor(rect,api,targetInfo.coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(rect)};});};proto$5.controlSeries=function(area,seriesModel,ecModel){// Check whether area is bound in coord, and series do not belong to that coord.\n// If do not do this check, some brush (like lineX) will controll all axes.\nvar targetInfo=this.findTargetInfo(area,ecModel);return targetInfo===true||targetInfo&&indexOf$2(targetInfo.coordSyses,seriesModel.coordinateSystem)>=0;};/**\n * If return Object, a coord found.\n * If reutrn true, global found.\n * Otherwise nothing found.\n *\n * @param {Object} area\n * @param {Array} targetInfoList\n * @return {Object|boolean}\n */proto$5.findTargetInfo=function(area,ecModel){var targetInfoList=this._targetInfoList;var foundCpts=parseFinder$1(ecModel,area);for(var i=0;iminMax[1]&&minMax.reverse();return minMax;}function parseFinder$1(ecModel,option){return parseFinder(ecModel,option,{includeMainTypes:INCLUDE_FINDER_MAIN_TYPES});}var targetInfoBuilders={grid:function grid(foundCpts,targetInfoList){var xAxisModels=foundCpts.xAxisModels;var yAxisModels=foundCpts.yAxisModels;var gridModels=foundCpts.gridModels;// Remove duplicated.\nvar gridModelMap=createHashMap();var xAxesHas={};var yAxesHas={};if(!xAxisModels&&!yAxisModels&&!gridModels){return;}each$17(xAxisModels,function(axisModel){var gridModel=axisModel.axis.grid.model;gridModelMap.set(gridModel.id,gridModel);xAxesHas[gridModel.id]=true;});each$17(yAxisModels,function(axisModel){var gridModel=axisModel.axis.grid.model;gridModelMap.set(gridModel.id,gridModel);yAxesHas[gridModel.id]=true;});each$17(gridModels,function(gridModel){gridModelMap.set(gridModel.id,gridModel);xAxesHas[gridModel.id]=true;yAxesHas[gridModel.id]=true;});gridModelMap.each(function(gridModel){var grid=gridModel.coordinateSystem;var cartesians=[];each$17(grid.getCartesians(),function(cartesian,index){if(indexOf$2(xAxisModels,cartesian.getAxis('x').model)>=0||indexOf$2(yAxisModels,cartesian.getAxis('y').model)>=0){cartesians.push(cartesian);}});targetInfoList.push({panelId:'grid--'+gridModel.id,gridModel:gridModel,coordSysModel:gridModel,// Use the first one as the representitive coordSys.\ncoordSys:cartesians[0],coordSyses:cartesians,getPanelRect:panelRectBuilder.grid,xAxisDeclared:xAxesHas[gridModel.id],yAxisDeclared:yAxesHas[gridModel.id]});});},geo:function geo(foundCpts,targetInfoList){each$17(foundCpts.geoModels,function(geoModel){var coordSys=geoModel.coordinateSystem;targetInfoList.push({panelId:'geo--'+geoModel.id,geoModel:geoModel,coordSysModel:geoModel,coordSys:coordSys,coordSyses:[coordSys],getPanelRect:panelRectBuilder.geo});});}};var targetInfoMatchers=[// grid\nfunction(foundCpts,targetInfo){var xAxisModel=foundCpts.xAxisModel;var yAxisModel=foundCpts.yAxisModel;var gridModel=foundCpts.gridModel;!gridModel&&xAxisModel&&(gridModel=xAxisModel.axis.grid.model);!gridModel&&yAxisModel&&(gridModel=yAxisModel.axis.grid.model);return gridModel&&gridModel===targetInfo.gridModel;},// geo\nfunction(foundCpts,targetInfo){var geoModel=foundCpts.geoModel;return geoModel&&geoModel===targetInfo.geoModel;}];var panelRectBuilder={grid:function grid(){// grid is not Transformable.\nreturn this.coordSys.grid.getRect().clone();},geo:function geo(){var coordSys=this.coordSys;var rect=coordSys.getBoundingRect().clone();// geo roam and zoom transform\nrect.applyTransform(getTransform(coordSys));return rect;}};var coordConvert={lineX:curry$6(axisConvert,0),lineY:curry$6(axisConvert,1),rect:function rect(to,coordSys,rangeOrCoordRange){var xminymin=coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0],rangeOrCoordRange[1][0]]);var xmaxymax=coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1],rangeOrCoordRange[1][1]]);var values=[formatMinMax([xminymin[0],xmaxymax[0]]),formatMinMax([xminymin[1],xmaxymax[1]])];return{values:values,xyMinMax:values};},polygon:function polygon(to,coordSys,rangeOrCoordRange){var xyMinMax=[[Infinity,-Infinity],[Infinity,-Infinity]];var values=map(rangeOrCoordRange,function(item){var p=coordSys[COORD_CONVERTS[to]](item);xyMinMax[0][0]=Math.min(xyMinMax[0][0],p[0]);xyMinMax[1][0]=Math.min(xyMinMax[1][0],p[1]);xyMinMax[0][1]=Math.max(xyMinMax[0][1],p[0]);xyMinMax[1][1]=Math.max(xyMinMax[1][1],p[1]);return p;});return{values:values,xyMinMax:xyMinMax};}};function axisConvert(axisNameIndex,to,coordSys,rangeOrCoordRange){if(__DEV__){assert$1(coordSys.type==='cartesian2d','lineX/lineY brush is available only in cartesian2d.');}var axis=coordSys.getAxis(['x','y'][axisNameIndex]);var values=formatMinMax(map([0,1],function(i){return to?axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])):axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));}));var xyMinMax=[];xyMinMax[axisNameIndex]=values;xyMinMax[1-axisNameIndex]=[NaN,NaN];return{values:values,xyMinMax:xyMinMax};}var diffProcessor={lineX:curry$6(axisDiffProcessor,0),lineY:curry$6(axisDiffProcessor,1),rect:function rect(values,refer,scales){return[[values[0][0]-scales[0]*refer[0][0],values[0][1]-scales[0]*refer[0][1]],[values[1][0]-scales[1]*refer[1][0],values[1][1]-scales[1]*refer[1][1]]];},polygon:function polygon(values,refer,scales){return map(values,function(item,idx){return[item[0]-scales[0]*refer[idx][0],item[1]-scales[1]*refer[idx][1]];});}};function axisDiffProcessor(axisNameIndex,values,refer,scales){return[values[0]-scales[axisNameIndex]*refer[0],values[1]-scales[axisNameIndex]*refer[1]];}// We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\nfunction getScales(xyMinMaxCurr,xyMinMaxOrigin){var sizeCurr=getSize(xyMinMaxCurr);var sizeOrigin=getSize(xyMinMaxOrigin);var scales=[sizeCurr[0]/sizeOrigin[0],sizeCurr[1]/sizeOrigin[1]];isNaN(scales[0])&&(scales[0]=1);isNaN(scales[1])&&(scales[1]=1);return scales;}function getSize(xyMinMax){return xyMinMax?[xyMinMax[0][1]-xyMinMax[0][0],xyMinMax[1][1]-xyMinMax[1][0]]:[NaN,NaN];}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$18=each$1;var ATTR$2='\\0_ec_hist_store';/**\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]}\n */function push(ecModel,newSnapshot){var store=giveStore$1(ecModel);// If previous dataZoom can not be found,\n// complete an range with current range.\neach$18(newSnapshot,function(batchItem,dataZoomId){var i=store.length-1;for(;i>=0;i--){var snapshot=store[i];if(snapshot[dataZoomId]){break;}}if(i<0){// No origin range set, create one by current range.\nvar dataZoomModel=ecModel.queryComponents({mainType:'dataZoom',subType:'select',id:dataZoomId})[0];if(dataZoomModel){var percentRange=dataZoomModel.getPercentRange();store[0][dataZoomId]={dataZoomId:dataZoomId,start:percentRange[0],end:percentRange[1]};}}});store.push(newSnapshot);}/**\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} snapshot\n */function pop(ecModel){var store=giveStore$1(ecModel);var head=store[store.length-1];store.length>1&&store.pop();// Find top for all dataZoom.\nvar snapshot={};each$18(head,function(batchItem,dataZoomId){for(var i=store.length-1;i>=0;i--){var batchItem=store[i][dataZoomId];if(batchItem){snapshot[dataZoomId]=batchItem;break;}}});return snapshot;}/**\n * @param {module:echarts/model/Global} ecModel\n */function clear$1(ecModel){ecModel[ATTR$2]=null;}/**\n * @param {module:echarts/model/Global} ecModel\n * @return {number} records. always >= 1.\n */function count(ecModel){return giveStore$1(ecModel).length;}/**\n * [{key: dataZoomId, value: {dataZoomId, range}}, ...]\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n * @type {Array.}\n */function giveStore$1(ecModel){var store=ecModel[ATTR$2];if(!store){store=ecModel[ATTR$2]=[{}];}return store;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/DataZoomModel.extend({type:'dataZoom.select'});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/DataZoomView.extend({type:'dataZoom.select'});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Only work for toolbox dataZoom. User\n * MUST NOT import this module directly.\n */ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Use dataZoomSelect\nvar dataZoomLang=lang.toolbox.dataZoom;var each$15=each$1;// Spectial component id start with \\0ec\\0, see echarts/model/Global.js~hasInnerId\nvar DATA_ZOOM_ID_BASE='\\0_ec_\\0toolbox-dataZoom_';function DataZoom(model,ecModel,api){/**\n * @private\n * @type {module:echarts/component/helper/BrushController}\n */(this._brushController=new BrushController(api.getZr())).on('brush',bind(this._onBrush,this)).mount();/**\n * @private\n * @type {boolean}\n */this._isZoomActive;}DataZoom.defaultOption={show:true,filterMode:'filter',// Icon group\nicon:{zoom:'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',back:'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'},// `zoom`, `back`\ntitle:_clone(dataZoomLang.title),brushStyle:{borderWidth:0,color:'rgba(0,0,0,0.2)'}};var proto$4=DataZoom.prototype;proto$4.render=function(featureModel,ecModel,api,payload){this.model=featureModel;this.ecModel=ecModel;this.api=api;updateZoomBtnStatus(featureModel,ecModel,this,payload,api);updateBackBtnStatus(featureModel,ecModel);};proto$4.onclick=function(ecModel,api,type){handlers[type].call(this);};proto$4.remove=function(ecModel,api){this._brushController.unmount();};proto$4.dispose=function(ecModel,api){this._brushController.dispose();};/**\n * @private\n */var handlers={zoom:function zoom(){var nextActive=!this._isZoomActive;this.api.dispatchAction({type:'takeGlobalCursor',key:'dataZoomSelect',dataZoomSelectActive:nextActive});},back:function back(){this._dispatchZoomAction(pop(this.ecModel));}};/**\n * @private\n */proto$4._onBrush=function(areas,opt){if(!opt.isEnd||!areas.length){return;}var snapshot={};var ecModel=this.ecModel;this._brushController.updateCovers([]);// remove cover\nvar brushTargetManager=new BrushTargetManager(retrieveAxisSetting(this.model.option),ecModel,{include:['grid']});brushTargetManager.matchOutputRanges(areas,ecModel,function(area,coordRange,coordSys){if(coordSys.type!=='cartesian2d'){return;}var brushType=area.brushType;if(brushType==='rect'){setBatch('x',coordSys,coordRange[0]);setBatch('y',coordSys,coordRange[1]);}else{setBatch({lineX:'x',lineY:'y'}[brushType],coordSys,coordRange);}});push(ecModel,snapshot);this._dispatchZoomAction(snapshot);function setBatch(dimName,coordSys,minMax){var axis=coordSys.getAxis(dimName);var axisModel=axis.model;var dataZoomModel=findDataZoom(dimName,axisModel,ecModel);// Restrict range.\nvar minMaxSpan=dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();if(minMaxSpan.minValueSpan!=null||minMaxSpan.maxValueSpan!=null){minMax=sliderMove(0,minMax.slice(),axis.scale.getExtent(),0,minMaxSpan.minValueSpan,minMaxSpan.maxValueSpan);}dataZoomModel&&(snapshot[dataZoomModel.id]={dataZoomId:dataZoomModel.id,startValue:minMax[0],endValue:minMax[1]});}function findDataZoom(dimName,axisModel,ecModel){var found;ecModel.eachComponent({mainType:'dataZoom',subType:'select'},function(dzModel){var has=dzModel.getAxisModel(dimName,axisModel.componentIndex);has&&(found=dzModel);});return found;}};/**\n * @private\n */proto$4._dispatchZoomAction=function(snapshot){var batch=[];// Convert from hash map to array.\neach$15(snapshot,function(batchItem,dataZoomId){batch.push(_clone(batchItem));});batch.length&&this.api.dispatchAction({type:'dataZoom',from:this.uid,batch:batch});};function retrieveAxisSetting(option){var setting={};// Compatible with previous setting: null => all axis, false => no axis.\neach$1(['xAxisIndex','yAxisIndex'],function(name){setting[name]=option[name];setting[name]==null&&(setting[name]='all');(setting[name]===false||setting[name]==='none')&&(setting[name]=[]);});return setting;}function updateBackBtnStatus(featureModel,ecModel){featureModel.setIconStatus('back',count(ecModel)>1?'emphasis':'normal');}function updateZoomBtnStatus(featureModel,ecModel,view,payload,api){var zoomActive=view._isZoomActive;if(payload&&payload.type==='takeGlobalCursor'){zoomActive=payload.key==='dataZoomSelect'?payload.dataZoomSelectActive:false;}view._isZoomActive=zoomActive;featureModel.setIconStatus('zoom',zoomActive?'emphasis':'normal');var brushTargetManager=new BrushTargetManager(retrieveAxisSetting(featureModel.option),ecModel,{include:['grid']});view._brushController.setPanels(brushTargetManager.makePanelOpts(api,function(targetInfo){return targetInfo.xAxisDeclared&&!targetInfo.yAxisDeclared?'lineX':!targetInfo.xAxisDeclared&&targetInfo.yAxisDeclared?'lineY':'rect';})).enableBrush(zoomActive?{brushType:'auto',brushStyle:featureModel.getModel('brushStyle').getItemStyle()}:false);}register$2('dataZoom',DataZoom);// Create special dataZoom option for select\n// FIXME consider the case of merge option, where axes options are not exists.\nregisterPreprocessor(function(option){if(!option){return;}var dataZoomOpts=option.dataZoom||(option.dataZoom=[]);if(!isArray(dataZoomOpts)){option.dataZoom=dataZoomOpts=[dataZoomOpts];}var toolboxOpt=option.toolbox;if(toolboxOpt){// Assume there is only one toolbox\nif(isArray(toolboxOpt)){toolboxOpt=toolboxOpt[0];}if(toolboxOpt&&toolboxOpt.feature){var dataZoomOpt=toolboxOpt.feature.dataZoom;// FIXME: If add dataZoom when setOption in merge mode,\n// no axis info to be added. See `test/dataZoom-extreme.html`\naddForAxis('xAxis',dataZoomOpt);addForAxis('yAxis',dataZoomOpt);}}function addForAxis(axisName,dataZoomOpt){if(!dataZoomOpt){return;}// Try not to modify model, because it is not merged yet.\nvar axisIndicesName=axisName+'Index';var givenAxisIndices=dataZoomOpt[axisIndicesName];if(givenAxisIndices!=null&&givenAxisIndices!=='all'&&!isArray(givenAxisIndices)){givenAxisIndices=givenAxisIndices===false||givenAxisIndices==='none'?[]:[givenAxisIndices];}forEachComponent(axisName,function(axisOpt,axisIndex){if(givenAxisIndices!=null&&givenAxisIndices!=='all'&&indexOf(givenAxisIndices,axisIndex)===-1){return;}var newOpt={type:'select',$fromToolbox:true,// Default to be filter\nfilterMode:dataZoomOpt.filterMode||'filter',// Id for merge mapping.\nid:DATA_ZOOM_ID_BASE+axisName+axisIndex};// FIXME\n// Only support one axis now.\nnewOpt[axisIndicesName]=axisIndex;dataZoomOpts.push(newOpt);});}function forEachComponent(mainType,cb){var opts=option[mainType];if(!isArray(opts)){opts=opts?[opts]:[];}each$15(opts,cb);}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var restoreLang=lang.toolbox.restore;function Restore(model){this.model=model;}Restore.defaultOption={show:true,/* eslint-disable */icon:'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',/* eslint-enable */title:restoreLang.title};var proto$6=Restore.prototype;proto$6.onclick=function(ecModel,api,type){clear$1(ecModel);api.dispatchAction({type:'restore',from:this.uid});};register$2('restore',Restore);registerAction({type:'restore',event:'restore',update:'prepareAndUpdate'},function(payload,ecModel){ecModel.resetOption('recreate');});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var urn='urn:schemas-microsoft-com:vml';var win=typeof window==='undefined'?null:window;var vmlInited=false;var doc=win&&win.document;function createNode(tagName){return doCreateNode(tagName);}// Avoid assign to an exported variable, for transforming to cjs.\nvar doCreateNode;if(doc&&!env$1.canvasSupported){try{!doc.namespaces.zrvml&&doc.namespaces.add('zrvml',urn);doCreateNode=function doCreateNode(tagName){return doc.createElement('');};}catch(e){doCreateNode=function doCreateNode(tagName){return doc.createElement('<'+tagName+' xmlns=\"'+urn+'\" class=\"zrvml\">');};}}// From raphael\nfunction initVML(){if(vmlInited||!doc){return;}vmlInited=true;var styleSheets=doc.styleSheets;if(styleSheets.length<31){doc.createStyleSheet().addRule('.zrvml','behavior:url(#default#VML)');}else{// http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx\nstyleSheets[0].addRule('.zrvml','behavior:url(#default#VML)');}}// http://www.w3.org/TR/NOTE-VML\n// TODO Use proxy like svg instead of overwrite brush methods\nvar CMD$3=PathProxy.CMD;var round$2=Math.round;var sqrt=Math.sqrt;var abs$1=Math.abs;var cos=Math.cos;var sin=Math.sin;var mathMax$6=Math.max;if(!env$1.canvasSupported){var comma=',';var imageTransformPrefix='progid:DXImageTransform.Microsoft';var Z=21600;var Z2=Z/2;var ZLEVEL_BASE=100000;var Z_BASE=1000;var initRootElStyle=function initRootElStyle(el){el.style.cssText='position:absolute;left:0;top:0;width:1px;height:1px;';el.coordsize=Z+','+Z;el.coordorigin='0,0';};var encodeHtmlAttribute=function encodeHtmlAttribute(s){return String(s).replace(/&/g,'&').replace(/\"/g,'"');};var rgb2Str=function rgb2Str(r,g,b){return'rgb('+[r,g,b].join(',')+')';};var append=function append(parent,child){if(child&&parent&&child.parentNode!==parent){parent.appendChild(child);}};var remove=function remove(parent,child){if(child&&parent&&child.parentNode===parent){parent.removeChild(child);}};var getZIndex=function getZIndex(zlevel,z,z2){// z 的取值范围为 [0, 1000]\nreturn(parseFloat(zlevel)||0)*ZLEVEL_BASE+(parseFloat(z)||0)*Z_BASE+z2;};var parsePercent$3=parsePercent;/***************************************************\n * PATH\n **************************************************/var setColorAndOpacity=function setColorAndOpacity(el,color,opacity){var colorArr=parse(color);opacity=+opacity;if(isNaN(opacity)){opacity=1;}if(colorArr){el.color=rgb2Str(colorArr[0],colorArr[1],colorArr[2]);el.opacity=opacity*colorArr[3];}};var getColorAndAlpha=function getColorAndAlpha(color){var colorArr=parse(color);return[rgb2Str(colorArr[0],colorArr[1],colorArr[2]),colorArr[3]];};var updateFillNode=function updateFillNode(el,style,zrEl){// TODO pattern\nvar fill=style.fill;if(fill!=null){// Modified from excanvas\nif(fill instanceof Gradient){var gradientType;var angle=0;var focus=[0,0];// additional offset\nvar shift=0;// scale factor for offset\nvar expansion=1;var rect=zrEl.getBoundingRect();var rectWidth=rect.width;var rectHeight=rect.height;if(fill.type==='linear'){gradientType='gradient';var transform=zrEl.transform;var p0=[fill.x*rectWidth,fill.y*rectHeight];var p1=[fill.x2*rectWidth,fill.y2*rectHeight];if(transform){applyTransform(p0,p0,transform);applyTransform(p1,p1,transform);}var dx=p1[0]-p0[0];var dy=p1[1]-p0[1];angle=Math.atan2(dx,dy)*180/Math.PI;// The angle should be a non-negative number.\nif(angle<0){angle+=360;}// Very small angles produce an unexpected result because they are\n// converted to a scientific notation string.\nif(angle<1e-6){angle=0;}}else{gradientType='gradientradial';var p0=[fill.x*rectWidth,fill.y*rectHeight];var transform=zrEl.transform;var scale$$1=zrEl.scale;var width=rectWidth;var height=rectHeight;focus=[// Percent in bounding rect\n(p0[0]-rect.x)/width,(p0[1]-rect.y)/height];if(transform){applyTransform(p0,p0,transform);}width/=scale$$1[0]*Z;height/=scale$$1[1]*Z;var dimension=mathMax$6(width,height);shift=2*0/dimension;expansion=2*fill.r/dimension-shift;}// We need to sort the color stops in ascending order by offset,\n// otherwise IE won't interpret it correctly.\nvar stops=fill.colorStops.slice();stops.sort(function(cs1,cs2){return cs1.offset-cs2.offset;});var length$$1=stops.length;// Color and alpha list of first and last stop\nvar colorAndAlphaList=[];var colors=[];for(var i=0;i=2){var color1=colorAndAlphaList[0][0];var color2=colorAndAlphaList[1][0];var opacity1=colorAndAlphaList[0][1]*style.opacity;var opacity2=colorAndAlphaList[1][1]*style.opacity;el.type=gradientType;el.method='none';el.focus='100%';el.angle=angle;el.color=color1;el.color2=color2;el.colors=colors.join(',');// When colors attribute is used, the meanings of opacity and o:opacity2\n// are reversed.\nel.opacity=opacity2;// FIXME g_o_:opacity ?\nel.opacity2=opacity1;}if(gradientType==='radial'){el.focusposition=focus.join(',');}}else{// FIXME Change from Gradient fill to color fill\nsetColorAndOpacity(el,fill,style.opacity);}}};var updateStrokeNode=function updateStrokeNode(el,style){// if (style.lineJoin != null) {\n// el.joinstyle = style.lineJoin;\n// }\n// if (style.miterLimit != null) {\n// el.miterlimit = style.miterLimit * Z;\n// }\n// if (style.lineCap != null) {\n// el.endcap = style.lineCap;\n// }\nif(style.lineDash){el.dashstyle=style.lineDash.join(' ');}if(style.stroke!=null&&!(style.stroke instanceof Gradient)){setColorAndOpacity(el,style.stroke,style.opacity);}};var updateFillAndStroke=function updateFillAndStroke(vmlEl,type,style,zrEl){var isFill=type==='fill';var el=vmlEl.getElementsByTagName(type)[0];// Stroke must have lineWidth\nif(style[type]!=null&&style[type]!=='none'&&(isFill||!isFill&&style.lineWidth)){vmlEl[isFill?'filled':'stroked']='true';// FIXME Remove before updating, or set `colors` will throw error\nif(style[type]instanceof Gradient){remove(vmlEl,el);}if(!el){el=createNode(type);}isFill?updateFillNode(el,style,zrEl):updateStrokeNode(el,style);append(vmlEl,el);}else{vmlEl[isFill?'filled':'stroked']='false';remove(vmlEl,el);}};var points$1=[[],[],[]];var pathDataToString=function pathDataToString(path,m){var M=CMD$3.M;var C=CMD$3.C;var L=CMD$3.L;var A=CMD$3.A;var Q=CMD$3.Q;var str=[];var nPoint;var cmdStr;var cmd;var i;var xi;var yi;var data=path.data;var dataLength=path.len();for(i=0;i1e-2){// Offset x0 by 1/80 of a pixel. Use something\n// that can be represented in binary\nif(clockwise){x0+=270/Z;}}else{// Avoid case draw full circle\nif(Math.abs(y0-cy)<1e-4){if(clockwise&&x0cx){y1-=270/Z;}else{y1+=270/Z;}}else if(clockwise&&y0cy){x1+=270/Z;}else{x1-=270/Z;}}}str.push(type,round$2(((cx-rx)*sx+x)*Z-Z2),comma,round$2(((cy-ry)*sy+y)*Z-Z2),comma,round$2(((cx+rx)*sx+x)*Z-Z2),comma,round$2(((cy+ry)*sy+y)*Z-Z2),comma,round$2((x0*sx+x)*Z-Z2),comma,round$2((y0*sy+y)*Z-Z2),comma,round$2((x1*sx+x)*Z-Z2),comma,round$2((y1*sy+y)*Z-Z2));xi=x1;yi=y1;break;case CMD$3.R:var p0=points$1[0];var p1=points$1[1];// x0, y0\np0[0]=data[i++];p0[1]=data[i++];// x1, y1\np1[0]=p0[0]+data[i++];p1[1]=p0[1]+data[i++];if(m){applyTransform(p0,p0,m);applyTransform(p1,p1,m);}p0[0]=round$2(p0[0]*Z-Z2);p1[0]=round$2(p1[0]*Z-Z2);p0[1]=round$2(p0[1]*Z-Z2);p1[1]=round$2(p1[1]*Z-Z2);str.push(// x0, y0\n' m ',p0[0],comma,p0[1],// x1, y0\n' l ',p1[0],comma,p0[1],// x1, y1\n' l ',p1[0],comma,p1[1],// x0, y1\n' l ',p0[0],comma,p1[1]);break;case CMD$3.Z:// FIXME Update xi, yi\nstr.push(' x ');}if(nPoint>0){str.push(cmdStr);for(var k=0;kMAX_FONT_CACHE_SIZE){fontStyleCacheCount=0;fontStyleCache={};}var style=fontEl.style;var fontFamily;try{style.font=fontString;fontFamily=style.fontFamily.split(',')[0];}catch(e){}fontStyle={style:style.fontStyle||DEFAULT_STYLE_NORMAL,variant:style.fontVariant||DEFAULT_STYLE_NORMAL,weight:style.fontWeight||DEFAULT_STYLE_NORMAL,size:parseFloat(style.fontSize||12)|0,family:fontFamily||'Microsoft YaHei'};fontStyleCache[fontString]=fontStyle;fontStyleCacheCount++;}return fontStyle;};var textMeasureEl;// Overwrite measure text method\n$override$1('measureText',function(text,textFont){var doc$$1=doc;if(!textMeasureEl){textMeasureEl=doc$$1.createElement('div');textMeasureEl.style.cssText='position:absolute;top:-20000px;left:0;'+'padding:0;margin:0;border:none;white-space:pre;';doc.body.appendChild(textMeasureEl);}try{textMeasureEl.style.font=textFont;}catch(ex){// Ignore failures to set to invalid font.\n}textMeasureEl.innerHTML='';// Don't use innerHTML or innerText because they allow markup/whitespace.\ntextMeasureEl.appendChild(doc$$1.createTextNode(text));return{width:textMeasureEl.offsetWidth};});var tmpRect$2=new BoundingRect();var drawRectText=function drawRectText(vmlRoot,rect,textRect,fromTextEl){var style=this.style;// Optimize, avoid normalize every time.\nthis.__dirty&&normalizeTextStyle(style,true);var text=style.text;// Convert to string\ntext!=null&&(text+='');if(!text){return;}// Convert rich text to plain text. Rich text is not supported in\n// IE8-, but tags in rich text template will be removed.\nif(style.rich){var contentBlock=parseRichText(text,style);text=[];for(var i=0;i-EPSILON$4;}function pathHasFill(style,isText){var fill=isText?style.textFill:style.fill;return fill!=null&&fill!==NONE;}function pathHasStroke(style,isText){var stroke=isText?style.textStroke:style.stroke;return stroke!=null&&stroke!==NONE;}function setTransform(svgEl,m){if(m){attr(svgEl,'transform','matrix('+arrayJoin.call(m,',')+')');}}function attr(el,key,val){if(!val||val.type!=='linear'&&val.type!=='radial'){// Don't set attribute for gradient, since it need new dom nodes\nel.setAttribute(key,val);}}function attrXLink(el,key,val){el.setAttributeNS('http://www.w3.org/1999/xlink',key,val);}function bindStyle(svgEl,style,isText,el){if(pathHasFill(style,isText)){var fill=isText?style.textFill:style.fill;fill=fill==='transparent'?NONE:fill;attr(svgEl,'fill',fill);attr(svgEl,'fill-opacity',style.fillOpacity!=null?style.fillOpacity*style.opacity:style.opacity);}else{attr(svgEl,'fill',NONE);}if(pathHasStroke(style,isText)){var stroke=isText?style.textStroke:style.stroke;stroke=stroke==='transparent'?NONE:stroke;attr(svgEl,'stroke',stroke);var strokeWidth=isText?style.textStrokeWidth:style.lineWidth;var strokeScale=!isText&&style.strokeNoScale?el.getLineScale():1;attr(svgEl,'stroke-width',strokeWidth/strokeScale);// stroke then fill for text; fill then stroke for others\nattr(svgEl,'paint-order',isText?'stroke':'fill');attr(svgEl,'stroke-opacity',style.strokeOpacity!=null?style.strokeOpacity:style.opacity);var lineDash=style.lineDash;if(lineDash){attr(svgEl,'stroke-dasharray',style.lineDash.join(','));attr(svgEl,'stroke-dashoffset',mathRound(style.lineDashOffset||0));}else{attr(svgEl,'stroke-dasharray','');}// PENDING\nstyle.lineCap&&attr(svgEl,'stroke-linecap',style.lineCap);style.lineJoin&&attr(svgEl,'stroke-linejoin',style.lineJoin);style.miterLimit&&attr(svgEl,'stroke-miterlimit',style.miterLimit);}else{attr(svgEl,'stroke',NONE);}}/***************************************************\n * PATH\n **************************************************/function pathDataToString$1(path){var str=[];var data=path.data;var dataLength=path.len();for(var i=0;i=PI2$5:-dTheta>=PI2$5);// Mapping to 0~2PI\nvar unifiedTheta=dTheta>0?dTheta%PI2$5:dTheta%PI2$5+PI2$5;var large=false;if(isCircle){large=true;}else if(isAroundZero$1(dThetaPositive)){large=false;}else{large=unifiedTheta>=PI$3===!!clockwise;}var x0=round4(cx+rx*mathCos$3(theta));var y0=round4(cy+ry*mathSin$3(theta));// It will not draw if start point and end point are exactly the same\n// We need to shift the end point with a small value\n// FIXME A better way to draw circle ?\nif(isCircle){if(clockwise){dTheta=PI2$5-1e-4;}else{dTheta=-PI2$5+1e-4;}large=true;if(i===9){// Move to (x0, y0) only when CMD.A comes at the\n// first position of a shape.\n// For instance, when drawing a ring, CMD.A comes\n// after CMD.M, so it's unnecessary to move to\n// (x0, y0).\nstr.push('M',x0,y0);}}var x=round4(cx+rx*mathCos$3(theta+dTheta));var y=round4(cy+ry*mathSin$3(theta+dTheta));// FIXME Ellipse\nstr.push('A',round4(rx),round4(ry),mathRound(psi*degree),+large,+clockwise,x,y);break;case CMD$4.Z:cmdStr='Z';break;case CMD$4.R:var x=round4(data[i++]);var y=round4(data[i++]);var w=round4(data[i++]);var h=round4(data[i++]);str.push('M',x,y,'L',x+w,y,'L',x+w,y+h,'L',x,y+h,'L',x,y);break;}cmdStr&&str.push(cmdStr);for(var j=0;j to reset all of the text font as inherit?\n// otherwise the outer in svg, where nodeName is 'style',\n// CSS classes is defined globally wherever the style tags are declared.\nif(nodeName==='defs'){// define flag\nthis._isDefine=true;}else if(nodeName==='text'){this._isText=true;}var el;if(this._isDefine){var parser=defineParsers[nodeName];if(parser){var def=parser.call(this,xmlNode);var id=xmlNode.getAttribute('id');if(id){this._defs[id]=def;}}}else{var parser=nodeParsers[nodeName];if(parser){el=parser.call(this,xmlNode,parentGroup);parentGroup.add(el);}}var child=xmlNode.firstChild;while(child){if(child.nodeType===1){this._parseNode(child,el);}// Is text\nif(child.nodeType===3&&this._isText){this._parseText(child,el);}child=child.nextSibling;}// Quit define\nif(nodeName==='defs'){this._isDefine=false;}else if(nodeName==='text'){this._isText=false;}};SVGParser.prototype._parseText=function(xmlNode,parentGroup){if(xmlNode.nodeType===1){var dx=xmlNode.getAttribute('dx')||0;var dy=xmlNode.getAttribute('dy')||0;this._textX+=parseFloat(dx);this._textY+=parseFloat(dy);}var text=new Text({style:{text:xmlNode.textContent,transformText:true},position:[this._textX||0,this._textY||0]});inheritStyle(parentGroup,text);parseAttributes(xmlNode,text,this._defs);var fontSize=text.style.fontSize;if(fontSize&&fontSize<9){// PENDING\ntext.style.fontSize=9;text.scale=text.scale||[1,1];text.scale[0]*=fontSize/9;text.scale[1]*=fontSize/9;}var rect=text.getBoundingRect();this._textX+=rect.width;parentGroup.add(text);return text;};var nodeParsers={'g':function g(xmlNode,parentGroup){var g=new Group();inheritStyle(parentGroup,g);parseAttributes(xmlNode,g,this._defs);return g;},'rect':function rect(xmlNode,parentGroup){var rect=new Rect();inheritStyle(parentGroup,rect);parseAttributes(xmlNode,rect,this._defs);rect.setShape({x:parseFloat(xmlNode.getAttribute('x')||0),y:parseFloat(xmlNode.getAttribute('y')||0),width:parseFloat(xmlNode.getAttribute('width')||0),height:parseFloat(xmlNode.getAttribute('height')||0)});// console.log(xmlNode.getAttribute('transform'));\n// console.log(rect.transform);\nreturn rect;},'circle':function circle(xmlNode,parentGroup){var circle=new Circle();inheritStyle(parentGroup,circle);parseAttributes(xmlNode,circle,this._defs);circle.setShape({cx:parseFloat(xmlNode.getAttribute('cx')||0),cy:parseFloat(xmlNode.getAttribute('cy')||0),r:parseFloat(xmlNode.getAttribute('r')||0)});return circle;},'line':function line(xmlNode,parentGroup){var line=new Line();inheritStyle(parentGroup,line);parseAttributes(xmlNode,line,this._defs);line.setShape({x1:parseFloat(xmlNode.getAttribute('x1')||0),y1:parseFloat(xmlNode.getAttribute('y1')||0),x2:parseFloat(xmlNode.getAttribute('x2')||0),y2:parseFloat(xmlNode.getAttribute('y2')||0)});return line;},'ellipse':function ellipse(xmlNode,parentGroup){var ellipse=new Ellipse();inheritStyle(parentGroup,ellipse);parseAttributes(xmlNode,ellipse,this._defs);ellipse.setShape({cx:parseFloat(xmlNode.getAttribute('cx')||0),cy:parseFloat(xmlNode.getAttribute('cy')||0),rx:parseFloat(xmlNode.getAttribute('rx')||0),ry:parseFloat(xmlNode.getAttribute('ry')||0)});return ellipse;},'polygon':function polygon(xmlNode,parentGroup){var points=xmlNode.getAttribute('points');if(points){points=parsePoints(points);}var polygon=new Polygon({shape:{points:points||[]}});inheritStyle(parentGroup,polygon);parseAttributes(xmlNode,polygon,this._defs);return polygon;},'polyline':function polyline(xmlNode,parentGroup){var path=new Path();inheritStyle(parentGroup,path);parseAttributes(xmlNode,path,this._defs);var points=xmlNode.getAttribute('points');if(points){points=parsePoints(points);}var polyline=new Polyline({shape:{points:points||[]}});return polyline;},'image':function image(xmlNode,parentGroup){var img=new ZImage();inheritStyle(parentGroup,img);parseAttributes(xmlNode,img,this._defs);img.setStyle({image:xmlNode.getAttribute('xlink:href'),x:xmlNode.getAttribute('x'),y:xmlNode.getAttribute('y'),width:xmlNode.getAttribute('width'),height:xmlNode.getAttribute('height')});return img;},'text':function text(xmlNode,parentGroup){var x=xmlNode.getAttribute('x')||0;var y=xmlNode.getAttribute('y')||0;var dx=xmlNode.getAttribute('dx')||0;var dy=xmlNode.getAttribute('dy')||0;this._textX=parseFloat(x)+parseFloat(dx);this._textY=parseFloat(y)+parseFloat(dy);var g=new Group();inheritStyle(parentGroup,g);parseAttributes(xmlNode,g,this._defs);return g;},'tspan':function tspan(xmlNode,parentGroup){var x=xmlNode.getAttribute('x');var y=xmlNode.getAttribute('y');if(x!=null){// new offset x\nthis._textX=parseFloat(x);}if(y!=null){// new offset y\nthis._textY=parseFloat(y);}var dx=xmlNode.getAttribute('dx')||0;var dy=xmlNode.getAttribute('dy')||0;var g=new Group();inheritStyle(parentGroup,g);parseAttributes(xmlNode,g,this._defs);this._textX+=dx;this._textY+=dy;return g;},'path':function path(xmlNode,parentGroup){// TODO svg fill rule\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n// path.style.globalCompositeOperation = 'xor';\nvar d=xmlNode.getAttribute('d')||'';// Performance sensitive.\nvar path=createFromString(d);inheritStyle(parentGroup,path);parseAttributes(xmlNode,path,this._defs);return path;}};var defineParsers={'lineargradient':function lineargradient(xmlNode){var x1=parseInt(xmlNode.getAttribute('x1')||0,10);var y1=parseInt(xmlNode.getAttribute('y1')||0,10);var x2=parseInt(xmlNode.getAttribute('x2')||10,10);var y2=parseInt(xmlNode.getAttribute('y2')||0,10);var gradient=new LinearGradient(x1,y1,x2,y2);_parseGradientColorStops(xmlNode,gradient);return gradient;},'radialgradient':function radialgradient(xmlNode){}};function _parseGradientColorStops(xmlNode,gradient){var stop=xmlNode.firstChild;while(stop){if(stop.nodeType===1){var offset=stop.getAttribute('offset');if(offset.indexOf('%')>0){// percentage\noffset=parseInt(offset,10)/100;}else if(offset){// number from 0 to 1\noffset=parseFloat(offset);}else{offset=0;}var stopColor=stop.getAttribute('stop-color')||'#000000';gradient.addColorStop(offset,stopColor);}stop=stop.nextSibling;}}function inheritStyle(parent,child){if(parent&&parent.__inheritedStyle){if(!child.__inheritedStyle){child.__inheritedStyle={};}defaults(child.__inheritedStyle,parent.__inheritedStyle);}}function parsePoints(pointsString){var list=trim(pointsString).split(DILIMITER_REG);var points=[];for(var i=0;i0;i-=2){var value=transformOps[i];var type=transformOps[i-1];m=m||create$1();switch(type){case'translate':value=trim(value).split(DILIMITER_REG);translate(m,m,[parseFloat(value[0]),parseFloat(value[1]||0)]);break;case'scale':value=trim(value).split(DILIMITER_REG);scale$1(m,m,[parseFloat(value[0]),parseFloat(value[1]||value[0])]);break;case'rotate':value=trim(value).split(DILIMITER_REG);rotate(m,m,parseFloat(value[0]));break;case'skew':value=trim(value).split(DILIMITER_REG);console.warn('Skew transform is not supported yet');break;case'matrix':var value=trim(value).split(DILIMITER_REG);m[0]=parseFloat(value[0]);m[1]=parseFloat(value[1]);m[2]=parseFloat(value[2]);m[3]=parseFloat(value[3]);m[4]=parseFloat(value[4]);m[5]=parseFloat(value[5]);break;}}node.setLocalTransform(m);}}// Value may contain space.\nvar styleRegex=/([^\\s:;]+)\\s*:\\s*([^:;]+)/g;function parseStyleAttribute(xmlNode){var style=xmlNode.getAttribute('style');var result={};if(!style){return result;}var styleList={};styleRegex.lastIndex=0;var styleRegResult;while((styleRegResult=styleRegex.exec(style))!=null){styleList[styleRegResult[1]]=styleRegResult[2];}for(var svgAttrName in attributesMap){if(attributesMap.hasOwnProperty(svgAttrName)&&styleList[svgAttrName]!=null){result[attributesMap[svgAttrName]]=styleList[svgAttrName];}}return result;}/**\n * @param {Array.} viewBoxRect\n * @param {number} width\n * @param {number} height\n * @return {Object} {scale, position}\n */function makeViewBoxTransform(viewBoxRect,width,height){var scaleX=width/viewBoxRect.width;var scaleY=height/viewBoxRect.height;var scale=Math.min(scaleX,scaleY);// preserveAspectRatio 'xMidYMid'\nvar viewBoxScale=[scale,scale];var viewBoxPosition=[-(viewBoxRect.x+viewBoxRect.width/2)*scale+width/2,-(viewBoxRect.y+viewBoxRect.height/2)*scale+height/2];return{scale:viewBoxScale,position:viewBoxPosition};}/**\n * @param {string|XMLElement} xml\n * @param {Object} [opt]\n * @param {number} [opt.width] Default width if svg width not specified or is a percent value.\n * @param {number} [opt.height] Default height if svg height not specified or is a percent value.\n * @param {boolean} [opt.ignoreViewBox]\n * @param {boolean} [opt.ignoreRootClip]\n * @return {Object} result:\n * {\n * root: Group, The root of the the result tree of zrender shapes,\n * width: number, the viewport width of the SVG,\n * height: number, the viewport height of the SVG,\n * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists,\n * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists.\n * }\n */ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var storage=createHashMap();// For minimize the code size of common echarts package,\n// do not put too much logic in this module.\nvar mapDataStorage={// The format of record: see `echarts.registerMap`.\n// Compatible with previous `echarts.registerMap`.\nregisterMap:function registerMap(mapName,rawGeoJson,rawSpecialAreas){var records;if(isArray(rawGeoJson)){records=rawGeoJson;}else if(rawGeoJson.svg){records=[{type:'svg',source:rawGeoJson.svg,specialAreas:rawGeoJson.specialAreas}];}else{// Backward compatibility.\nif(rawGeoJson.geoJson&&!rawGeoJson.features){rawSpecialAreas=rawGeoJson.specialAreas;rawGeoJson=rawGeoJson.geoJson;}records=[{type:'geoJSON',source:rawGeoJson,specialAreas:rawSpecialAreas}];}each$1(records,function(record){var type=record.type;type==='geoJson'&&(type=record.type='geoJSON');var parse=parsers[type];if(__DEV__){assert$1(parse,'Illegal map type: '+type);}parse(record);});return storage.set(mapName,records);},retrieveMap:function retrieveMap(mapName){return storage.get(mapName);}};var parsers={geoJSON:function geoJSON(record){var source=record.source;record.geoJSON=!isString(source)?source:typeof JSON!=='undefined'&&JSON.parse?JSON.parse(source):new Function('return ('+source+');')();},// Only perform parse to XML object here, which might be time\n// consiming for large SVG.\n// Although convert XML to zrender element is also time consiming,\n// if we do it here, the clone of zrender elements has to be\n// required. So we do it once for each geo instance, util real\n// performance issues call for optimizing it.\nsvg:function svg(record){record.svgXML=parseXML(record.source);}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var assert=assert$1;var each=each$1;var isFunction=isFunction$1;var isObject=isObject$1;var parseClassType=ComponentModel.parseClassType;var version='4.9.0';var dependencies={zrender:'4.3.2'};var TEST_FRAME_REMAIN_TIME=1;var PRIORITY_PROCESSOR_FILTER=1000;var PRIORITY_PROCESSOR_SERIES_FILTER=800;var PRIORITY_PROCESSOR_DATASTACK=900;var PRIORITY_PROCESSOR_STATISTIC=5000;var PRIORITY_VISUAL_LAYOUT=1000;var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT=1100;var PRIORITY_VISUAL_GLOBAL=2000;var PRIORITY_VISUAL_CHART=3000;var PRIORITY_VISUAL_POST_CHART_LAYOUT=3500;var PRIORITY_VISUAL_COMPONENT=4000;// FIXME\n// necessary?\nvar PRIORITY_VISUAL_BRUSH=5000;var PRIORITY={PROCESSOR:{FILTER:PRIORITY_PROCESSOR_FILTER,SERIES_FILTER:PRIORITY_PROCESSOR_SERIES_FILTER,STATISTIC:PRIORITY_PROCESSOR_STATISTIC},VISUAL:{LAYOUT:PRIORITY_VISUAL_LAYOUT,PROGRESSIVE_LAYOUT:PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,GLOBAL:PRIORITY_VISUAL_GLOBAL,CHART:PRIORITY_VISUAL_CHART,POST_CHART_LAYOUT:PRIORITY_VISUAL_POST_CHART_LAYOUT,COMPONENT:PRIORITY_VISUAL_COMPONENT,BRUSH:PRIORITY_VISUAL_BRUSH}};// Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\nvar IN_MAIN_PROCESS='__flagInMainProcess';var OPTION_UPDATED='__optionUpdated';var ACTION_REG=/^[a-zA-Z0-9_]+$/;function createRegisterEventWithLowercaseName(method,ignoreDisposed){return function(eventName,handler,context){if(!ignoreDisposed&&this._disposed){disposedWarning(this.id);return;}// Event name is all lowercase\neventName=eventName&&eventName.toLowerCase();Eventful.prototype[method].call(this,eventName,handler,context);};}/**\n * @module echarts~MessageCenter\n */function MessageCenter(){Eventful.call(this);}MessageCenter.prototype.on=createRegisterEventWithLowercaseName('on',true);MessageCenter.prototype.off=createRegisterEventWithLowercaseName('off',true);MessageCenter.prototype.one=createRegisterEventWithLowercaseName('one',true);mixin(MessageCenter,Eventful);/**\n * @module echarts~ECharts\n */function ECharts(dom,theme$$1,opts){opts=opts||{};// Get theme by name\nif(typeof theme$$1==='string'){theme$$1=themeStorage[theme$$1];}/**\n * @type {string}\n */this.id;/**\n * Group id\n * @type {string}\n */this.group;/**\n * @type {HTMLElement}\n * @private\n */this._dom=dom;var defaultRenderer='canvas';if(__DEV__){defaultRenderer=(typeof window==='undefined'?global:window).__ECHARTS__DEFAULT__RENDERER__||defaultRenderer;}/**\n * @type {module:zrender/ZRender}\n * @private\n */var zr=this._zr=init$1(dom,{renderer:opts.renderer||defaultRenderer,devicePixelRatio:opts.devicePixelRatio,width:opts.width,height:opts.height});/**\n * Expect 60 fps.\n * @type {Function}\n * @private\n */this._throttledZrFlush=throttle(bind(zr.flush,zr),17);var theme$$1=_clone(theme$$1);theme$$1&&backwardCompat(theme$$1,true);/**\n * @type {Object}\n * @private\n */this._theme=theme$$1;/**\n * @type {Array.}\n * @private\n */this._chartsViews=[];/**\n * @type {Object.}\n * @private\n */this._chartsMap={};/**\n * @type {Array.}\n * @private\n */this._componentsViews=[];/**\n * @type {Object.}\n * @private\n */this._componentsMap={};/**\n * @type {module:echarts/CoordinateSystem}\n * @private\n */this._coordSysMgr=new CoordinateSystemManager();/**\n * @type {module:echarts/ExtensionAPI}\n * @private\n */var api=this._api=createExtensionAPI(this);// Sort on demand\nfunction prioritySortFunc(a,b){return a.__prio-b.__prio;}sort(visualFuncs,prioritySortFunc);sort(dataProcessorFuncs,prioritySortFunc);/**\n * @type {module:echarts/stream/Scheduler}\n */this._scheduler=new Scheduler(this,api,dataProcessorFuncs,visualFuncs);Eventful.call(this,this._ecEventProcessor=new EventProcessor());/**\n * @type {module:echarts~MessageCenter}\n * @private\n */this._messageCenter=new MessageCenter();// Init mouse events\nthis._initEvents();// In case some people write `window.onresize = chart.resize`\nthis.resize=bind(this.resize,this);// Can't dispatch action during rendering procedure\nthis._pendingActions=[];zr.animation.on('frame',this._onframe,this);bindRenderedEvent(zr,this);// ECharts instance can be used as value.\nsetAsPrimitive(this);}var echartsProto=ECharts.prototype;echartsProto._onframe=function(){if(this._disposed){return;}var scheduler=this._scheduler;// Lazy update\nif(this[OPTION_UPDATED]){var silent=this[OPTION_UPDATED].silent;this[IN_MAIN_PROCESS]=true;prepare(this);updateMethods.update.call(this);this[IN_MAIN_PROCESS]=false;this[OPTION_UPDATED]=false;flushPendingActions.call(this,silent);triggerUpdatedEvent.call(this,silent);}// Avoid do both lazy update and progress in one frame.\nelse if(scheduler.unfinished){// Stream progress.\nvar remainTime=TEST_FRAME_REMAIN_TIME;var ecModel=this._model;var api=this._api;scheduler.unfinished=false;do{var startTime=+new Date();scheduler.performSeriesTasks(ecModel);// Currently dataProcessorFuncs do not check threshold.\nscheduler.performDataProcessorTasks(ecModel);updateStreamModes(this,ecModel);// Do not update coordinate system here. Because that coord system update in\n// each frame is not a good user experience. So we follow the rule that\n// the extent of the coordinate system is determin in the first frame (the\n// frame is executed immedietely after task reset.\n// this._coordSysMgr.update(ecModel, api);\n// console.log('--- ec frame visual ---', remainTime);\nscheduler.performVisualTasks(ecModel);renderSeries(this,this._model,api,'remain');remainTime-=+new Date()-startTime;}while(remainTime>0&&scheduler.unfinished);// Call flush explicitly for trigger finished event.\nif(!scheduler.unfinished){this._zr.flush();}// Else, zr flushing be ensue within the same frame,\n// because zr flushing is after onframe event.\n}};/**\n * @return {HTMLElement}\n */echartsProto.getDom=function(){return this._dom;};/**\n * @return {module:zrender~ZRender}\n */echartsProto.getZr=function(){return this._zr;};/**\n * Usage:\n * chart.setOption(option, notMerge, lazyUpdate);\n * chart.setOption(option, {\n * notMerge: ...,\n * lazyUpdate: ...,\n * silent: ...\n * });\n *\n * @param {Object} option\n * @param {Object|boolean} [opts] opts or notMerge.\n * @param {boolean} [opts.notMerge=false]\n * @param {boolean} [opts.lazyUpdate=false] Useful when setOption frequently.\n */echartsProto.setOption=function(option,notMerge,lazyUpdate){if(__DEV__){assert(!this[IN_MAIN_PROCESS],'`setOption` should not be called during main process.');}if(this._disposed){disposedWarning(this.id);return;}var silent;if(isObject(notMerge)){lazyUpdate=notMerge.lazyUpdate;silent=notMerge.silent;notMerge=notMerge.notMerge;}this[IN_MAIN_PROCESS]=true;if(!this._model||notMerge){var optionManager=new OptionManager(this._api);var theme$$1=this._theme;var ecModel=this._model=new GlobalModel();ecModel.scheduler=this._scheduler;ecModel.init(null,null,theme$$1,optionManager);}this._model.setOption(option,optionPreprocessorFuncs);if(lazyUpdate){this[OPTION_UPDATED]={silent:silent};this[IN_MAIN_PROCESS]=false;}else{prepare(this);updateMethods.update.call(this);// Ensure zr refresh sychronously, and then pixel in canvas can be\n// fetched after `setOption`.\nthis._zr.flush();this[OPTION_UPDATED]=false;this[IN_MAIN_PROCESS]=false;flushPendingActions.call(this,silent);triggerUpdatedEvent.call(this,silent);}};/**\n * @DEPRECATED\n */echartsProto.setTheme=function(){console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');};/**\n * @return {module:echarts/model/Global}\n */echartsProto.getModel=function(){return this._model;};/**\n * @return {Object}\n */echartsProto.getOption=function(){return this._model&&this._model.getOption();};/**\n * @return {number}\n */echartsProto.getWidth=function(){return this._zr.getWidth();};/**\n * @return {number}\n */echartsProto.getHeight=function(){return this._zr.getHeight();};/**\n * @return {number}\n */echartsProto.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1;};/**\n * Get canvas which has all thing rendered\n * @param {Object} opts\n * @param {string} [opts.backgroundColor]\n * @return {string}\n */echartsProto.getRenderedCanvas=function(opts){if(!env$1.canvasSupported){return;}opts=opts||{};opts.pixelRatio=opts.pixelRatio||1;opts.backgroundColor=opts.backgroundColor||this._model.get('backgroundColor');var zr=this._zr;// var list = zr.storage.getDisplayList();\n// Stop animations\n// Never works before in init animation, so remove it.\n// zrUtil.each(list, function (el) {\n// el.stopAnimation(true);\n// });\nreturn zr.painter.getRenderedCanvas(opts);};/**\n * Get svg data url\n * @return {string}\n */echartsProto.getSvgDataURL=function(){if(!env$1.svgSupported){return;}var zr=this._zr;var list=zr.storage.getDisplayList();// Stop animations\neach$1(list,function(el){el.stopAnimation(true);});return zr.painter.toDataURL();};/**\n * @return {string}\n * @param {Object} opts\n * @param {string} [opts.type='png']\n * @param {string} [opts.pixelRatio=1]\n * @param {string} [opts.backgroundColor]\n * @param {string} [opts.excludeComponents]\n */echartsProto.getDataURL=function(opts){if(this._disposed){disposedWarning(this.id);return;}opts=opts||{};var excludeComponents=opts.excludeComponents;var ecModel=this._model;var excludesComponentViews=[];var self=this;each(excludeComponents,function(componentType){ecModel.eachComponent({mainType:componentType},function(component){var view=self._componentsMap[component.__viewId];if(!view.group.ignore){excludesComponentViews.push(view);view.group.ignore=true;}});});var url=this._zr.painter.getType()==='svg'?this.getSvgDataURL():this.getRenderedCanvas(opts).toDataURL('image/'+(opts&&opts.type||'png'));each(excludesComponentViews,function(view){view.group.ignore=false;});return url;};/**\n * @return {string}\n * @param {Object} opts\n * @param {string} [opts.type='png']\n * @param {string} [opts.pixelRatio=1]\n * @param {string} [opts.backgroundColor]\n */echartsProto.getConnectedDataURL=function(opts){if(this._disposed){disposedWarning(this.id);return;}if(!env$1.canvasSupported){return;}var isSvg=opts.type==='svg';var groupId=this.group;var mathMin=Math.min;var mathMax=Math.max;var MAX_NUMBER=Infinity;if(connectedGroups[groupId]){var left=MAX_NUMBER;var top=MAX_NUMBER;var right=-MAX_NUMBER;var bottom=-MAX_NUMBER;var canvasList=[];var dpr=opts&&opts.pixelRatio||1;each$1(instances,function(chart,id){if(chart.group===groupId){var canvas=isSvg?chart.getZr().painter.getSvgDom().innerHTML:chart.getRenderedCanvas(_clone(opts));var boundingRect=chart.getDom().getBoundingClientRect();left=mathMin(boundingRect.left,left);top=mathMin(boundingRect.top,top);right=mathMax(boundingRect.right,right);bottom=mathMax(boundingRect.bottom,bottom);canvasList.push({dom:canvas,left:boundingRect.left,top:boundingRect.top});}});left*=dpr;top*=dpr;right*=dpr;bottom*=dpr;var width=right-left;var height=bottom-top;var targetCanvas=createCanvas();var zr=init$1(targetCanvas,{renderer:isSvg?'svg':'canvas'});zr.resize({width:width,height:height});if(isSvg){var content='';each(canvasList,function(item){var x=item.left-left;var y=item.top-top;content+=''+item.dom+'';});zr.painter.getSvgRoot().innerHTML=content;if(opts.connectedBackgroundColor){zr.painter.setBackgroundColor(opts.connectedBackgroundColor);}zr.refreshImmediately();return zr.painter.toDataURL();}else{// Background between the charts\nif(opts.connectedBackgroundColor){zr.add(new Rect({shape:{x:0,y:0,width:width,height:height},style:{fill:opts.connectedBackgroundColor}}));}each(canvasList,function(item){var img=new ZImage({style:{x:item.left*dpr-left,y:item.top*dpr-top,image:item.dom}});zr.add(img);});zr.refreshImmediately();return targetCanvas.toDataURL('image/'+(opts&&opts.type||'png'));}}else{return this.getDataURL(opts);}};/**\n * Convert from logical coordinate system to pixel coordinate system.\n * See CoordinateSystem#convertToPixel.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId, geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName,\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {Array|number} result\n */echartsProto.convertToPixel=curry(doConvertPixel,'convertToPixel');/**\n * Convert from pixel coordinate system to logical coordinate system.\n * See CoordinateSystem#convertFromPixel.\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * geoIndex / geoId / geoName,\n * bmapIndex / bmapId / bmapName,\n * xAxisIndex / xAxisId / xAxisName,\n * yAxisIndex / yAxisId / yAxisName\n * gridIndex / gridId / gridName,\n * ... (can be extended)\n * }\n * @param {Array|number} value\n * @return {Array|number} result\n */echartsProto.convertFromPixel=curry(doConvertPixel,'convertFromPixel');function doConvertPixel(methodName,finder,value){if(this._disposed){disposedWarning(this.id);return;}var ecModel=this._model;var coordSysList=this._coordSysMgr.getCoordinateSystems();var result;finder=parseFinder(ecModel,finder);for(var i=0;i=0&&each$1(models,function(model){var coordSys=model.coordinateSystem;if(coordSys&&coordSys.containPoint){result|=!!coordSys.containPoint(value);}else if(key==='seriesModels'){var view=this._chartsMap[model.__viewId];if(view&&view.containPoint){result|=view.containPoint(value,model);}else{if(__DEV__){console.warn(key+': '+(view?'The found component do not support containPoint.':'No view mapping to the found component.'));}}}else{if(__DEV__){console.warn(key+': containPoint is not supported');}}},this);},this);return!!result;};/**\n * Get visual from series or data.\n * @param {string|Object} finder\n * If string, e.g., 'series', means {seriesIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * dataIndex / dataIndexInside\n * }\n * If dataIndex is not specified, series visual will be fetched,\n * but not data item visual.\n * If all of seriesIndex, seriesId, seriesName are not specified,\n * visual will be fetched from first series.\n * @param {string} visualType 'color', 'symbol', 'symbolSize'\n */echartsProto.getVisual=function(finder,visualType){var ecModel=this._model;finder=parseFinder(ecModel,finder,{defaultMainType:'series'});var seriesModel=finder.seriesModel;if(__DEV__){if(!seriesModel){console.warn('There is no specified seires model');}}var data=seriesModel.getData();var dataIndexInside=finder.hasOwnProperty('dataIndexInside')?finder.dataIndexInside:finder.hasOwnProperty('dataIndex')?data.indexOfRawIndex(finder.dataIndex):null;return dataIndexInside!=null?data.getItemVisual(dataIndexInside,visualType):data.getVisual(visualType);};/**\n * Get view of corresponding component model\n * @param {module:echarts/model/Component} componentModel\n * @return {module:echarts/view/Component}\n */echartsProto.getViewOfComponentModel=function(componentModel){return this._componentsMap[componentModel.__viewId];};/**\n * Get view of corresponding series model\n * @param {module:echarts/model/Series} seriesModel\n * @return {module:echarts/view/Chart}\n */echartsProto.getViewOfSeriesModel=function(seriesModel){return this._chartsMap[seriesModel.__viewId];};var updateMethods={prepareAndUpdate:function prepareAndUpdate(payload){prepare(this);updateMethods.update.call(this,payload);},/**\n * @param {Object} payload\n * @private\n */update:function update(payload){// console.profile && console.profile('update');\nvar ecModel=this._model;var api=this._api;var zr=this._zr;var coordSysMgr=this._coordSysMgr;var scheduler=this._scheduler;// update before setOption\nif(!ecModel){return;}scheduler.restoreData(ecModel,payload);scheduler.performSeriesTasks(ecModel);// TODO\n// Save total ecModel here for undo/redo (after restoring data and before processing data).\n// Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n// Create new coordinate system each update\n// In LineView may save the old coordinate system and use it to get the orignal point\ncoordSysMgr.create(ecModel,api);scheduler.performDataProcessorTasks(ecModel,payload);// Current stream render is not supported in data process. So we can update\n// stream modes after data processing, where the filtered data is used to\n// deteming whether use progressive rendering.\nupdateStreamModes(this,ecModel);// We update stream modes before coordinate system updated, then the modes info\n// can be fetched when coord sys updating (consider the barGrid extent fix). But\n// the drawback is the full coord info can not be fetched. Fortunately this full\n// coord is not requied in stream mode updater currently.\ncoordSysMgr.update(ecModel,api);clearColorPalette(ecModel);scheduler.performVisualTasks(ecModel,payload);render(this,ecModel,api,payload);// Set background\nvar backgroundColor=ecModel.get('backgroundColor')||'transparent';// In IE8\nif(!env$1.canvasSupported){var colorArr=parse(backgroundColor);backgroundColor=stringify(colorArr,'rgb');if(colorArr[3]===0){backgroundColor='transparent';}}else{zr.setBackgroundColor(backgroundColor);}performPostUpdateFuncs(ecModel,api);// console.profile && console.profileEnd('update');\n},/**\n * @param {Object} payload\n * @private\n */updateTransform:function updateTransform(payload){var ecModel=this._model;var ecIns=this;var api=this._api;// update before setOption\nif(!ecModel){return;}// ChartView.markUpdateMethod(payload, 'updateTransform');\nvar componentDirtyList=[];ecModel.eachComponent(function(componentType,componentModel){var componentView=ecIns.getViewOfComponentModel(componentModel);if(componentView&&componentView.__alive){if(componentView.updateTransform){var result=componentView.updateTransform(componentModel,ecModel,api,payload);result&&result.update&&componentDirtyList.push(componentView);}else{componentDirtyList.push(componentView);}}});var seriesDirtyMap=createHashMap();ecModel.eachSeries(function(seriesModel){var chartView=ecIns._chartsMap[seriesModel.__viewId];if(chartView.updateTransform){var result=chartView.updateTransform(seriesModel,ecModel,api,payload);result&&result.update&&seriesDirtyMap.set(seriesModel.uid,1);}else{seriesDirtyMap.set(seriesModel.uid,1);}});clearColorPalette(ecModel);// Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n// this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\nthis._scheduler.performVisualTasks(ecModel,payload,{setDirty:true,dirtyMap:seriesDirtyMap});// Currently, not call render of components. Geo render cost a lot.\n// renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\nrenderSeries(ecIns,ecModel,api,payload,seriesDirtyMap);performPostUpdateFuncs(ecModel,this._api);},/**\n * @param {Object} payload\n * @private\n */updateView:function updateView(payload){var ecModel=this._model;// update before setOption\nif(!ecModel){return;}Chart.markUpdateMethod(payload,'updateView');clearColorPalette(ecModel);// Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\nthis._scheduler.performVisualTasks(ecModel,payload,{setDirty:true});render(this,this._model,this._api,payload);performPostUpdateFuncs(ecModel,this._api);},/**\n * @param {Object} payload\n * @private\n */updateVisual:function updateVisual(payload){updateMethods.update.call(this,payload);// var ecModel = this._model;\n// // update before setOption\n// if (!ecModel) {\n// return;\n// }\n// ChartView.markUpdateMethod(payload, 'updateVisual');\n// clearColorPalette(ecModel);\n// // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n// this._scheduler.performVisualTasks(ecModel, payload, {visualType: 'visual', setDirty: true});\n// render(this, this._model, this._api, payload);\n// performPostUpdateFuncs(ecModel, this._api);\n},/**\n * @param {Object} payload\n * @private\n */updateLayout:function updateLayout(payload){updateMethods.update.call(this,payload);// var ecModel = this._model;\n// // update before setOption\n// if (!ecModel) {\n// return;\n// }\n// ChartView.markUpdateMethod(payload, 'updateLayout');\n// // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n// // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n// this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true});\n// render(this, this._model, this._api, payload);\n// performPostUpdateFuncs(ecModel, this._api);\n}};function prepare(ecIns){var ecModel=ecIns._model;var scheduler=ecIns._scheduler;scheduler.restorePipelines(ecModel);scheduler.prepareStageTasks();prepareView(ecIns,'component',ecModel,scheduler);prepareView(ecIns,'chart',ecModel,scheduler);scheduler.plan();}/**\n * @private\n */function updateDirectly(ecIns,method,payload,mainType,subType){var ecModel=ecIns._model;// broadcast\nif(!mainType){// FIXME\n// Chart will not be update directly here, except set dirty.\n// But there is no such scenario now.\neach(ecIns._componentsViews.concat(ecIns._chartsViews),callView);return;}var query={};query[mainType+'Id']=payload[mainType+'Id'];query[mainType+'Index']=payload[mainType+'Index'];query[mainType+'Name']=payload[mainType+'Name'];var condition={mainType:mainType,query:query};subType&&(condition.subType=subType);// subType may be '' by parseClassType;\nvar excludeSeriesId=payload.excludeSeriesId;if(excludeSeriesId!=null){excludeSeriesId=createHashMap(normalizeToArray(excludeSeriesId));}// If dispatchAction before setOption, do nothing.\necModel&&ecModel.eachComponent(condition,function(model){if(!excludeSeriesId||excludeSeriesId.get(model.id)==null){callView(ecIns[mainType==='series'?'_chartsMap':'_componentsMap'][model.__viewId]);}},ecIns);function callView(view){view&&view.__alive&&view[method]&&view[method](view.__model,ecModel,ecIns._api,payload);}}/**\n * Resize the chart\n * @param {Object} opts\n * @param {number} [opts.width] Can be 'auto' (the same as null/undefined)\n * @param {number} [opts.height] Can be 'auto' (the same as null/undefined)\n * @param {boolean} [opts.silent=false]\n */echartsProto.resize=function(opts){if(__DEV__){assert(!this[IN_MAIN_PROCESS],'`resize` should not be called during main process.');}if(this._disposed){disposedWarning(this.id);return;}this._zr.resize(opts);var ecModel=this._model;// Resize loading effect\nthis._loadingFX&&this._loadingFX.resize();if(!ecModel){return;}var optionChanged=ecModel.resetOption('media');var silent=opts&&opts.silent;this[IN_MAIN_PROCESS]=true;optionChanged&&prepare(this);updateMethods.update.call(this);this[IN_MAIN_PROCESS]=false;flushPendingActions.call(this,silent);triggerUpdatedEvent.call(this,silent);};function updateStreamModes(ecIns,ecModel){var chartsMap=ecIns._chartsMap;var scheduler=ecIns._scheduler;ecModel.eachSeries(function(seriesModel){scheduler.updateStreamModes(seriesModel,chartsMap[seriesModel.__viewId]);});}/**\n * Show loading effect\n * @param {string} [name='default']\n * @param {Object} [cfg]\n */echartsProto.showLoading=function(name,cfg){if(this._disposed){disposedWarning(this.id);return;}if(isObject(name)){cfg=name;name='';}name=name||'default';this.hideLoading();if(!loadingEffects[name]){if(__DEV__){console.warn('Loading effects '+name+' not exists.');}return;}var el=loadingEffects[name](this._api,cfg);var zr=this._zr;this._loadingFX=el;zr.add(el);};/**\n * Hide loading effect\n */echartsProto.hideLoading=function(){if(this._disposed){disposedWarning(this.id);return;}this._loadingFX&&this._zr.remove(this._loadingFX);this._loadingFX=null;};/**\n * @param {Object} eventObj\n * @return {Object}\n */echartsProto.makeActionFromEvent=function(eventObj){var payload=extend({},eventObj);payload.type=eventActionMap[eventObj.type];return payload;};/**\n * @pubilc\n * @param {Object} payload\n * @param {string} [payload.type] Action type\n * @param {Object|boolean} [opt] If pass boolean, means opt.silent\n * @param {boolean} [opt.silent=false] Whether trigger events.\n * @param {boolean} [opt.flush=undefined]\n * true: Flush immediately, and then pixel in canvas can be fetched\n * immediately. Caution: it might affect performance.\n * false: Not flush.\n * undefined: Auto decide whether perform flush.\n */echartsProto.dispatchAction=function(payload,opt){if(this._disposed){disposedWarning(this.id);return;}if(!isObject(opt)){opt={silent:!!opt};}if(!actions[payload.type]){return;}// Avoid dispatch action before setOption. Especially in `connect`.\nif(!this._model){return;}// May dispatchAction in rendering procedure\nif(this[IN_MAIN_PROCESS]){this._pendingActions.push(payload);return;}doDispatchAction.call(this,payload,opt.silent);if(opt.flush){this._zr.flush(true);}else if(opt.flush!==false&&env$1.browser.weChat){// In WeChat embeded browser, `requestAnimationFrame` and `setInterval`\n// hang when sliding page (on touch event), which cause that zr does not\n// refresh util user interaction finished, which is not expected.\n// But `dispatchAction` may be called too frequently when pan on touch\n// screen, which impacts performance if do not throttle them.\nthis._throttledZrFlush();}flushPendingActions.call(this,opt.silent);triggerUpdatedEvent.call(this,opt.silent);};function doDispatchAction(payload,silent){var payloadType=payload.type;var escapeConnect=payload.escapeConnect;var actionWrap=actions[payloadType];var actionInfo=actionWrap.actionInfo;var cptType=(actionInfo.update||'update').split(':');var updateMethod=cptType.pop();cptType=cptType[0]!=null&&parseClassType(cptType[0]);this[IN_MAIN_PROCESS]=true;var payloads=[payload];var batched=false;// Batch action\nif(payload.batch){batched=true;payloads=map(payload.batch,function(item){item=defaults(extend({},item),payload);item.batch=null;return item;});}var eventObjBatch=[];var eventObj;var isHighDown=payloadType==='highlight'||payloadType==='downplay';each(payloads,function(batchItem){// Action can specify the event by return it.\neventObj=actionWrap.action(batchItem,this._model,this._api);// Emit event outside\neventObj=eventObj||extend({},batchItem);// Convert type to eventType\neventObj.type=actionInfo.event||eventObj.type;eventObjBatch.push(eventObj);// light update does not perform data process, layout and visual.\nif(isHighDown){// method, payload, mainType, subType\nupdateDirectly(this,updateMethod,batchItem,'series');}else if(cptType){updateDirectly(this,updateMethod,batchItem,cptType.main,cptType.sub);}},this);if(updateMethod!=='none'&&!isHighDown&&!cptType){// Still dirty\nif(this[OPTION_UPDATED]){// FIXME Pass payload ?\nprepare(this);updateMethods.update.call(this,payload);this[OPTION_UPDATED]=false;}else{updateMethods[updateMethod].call(this,payload);}}// Follow the rule of action batch\nif(batched){eventObj={type:actionInfo.event||payloadType,escapeConnect:escapeConnect,batch:eventObjBatch};}else{eventObj=eventObjBatch[0];}this[IN_MAIN_PROCESS]=false;!silent&&this._messageCenter.trigger(eventObj.type,eventObj);}function flushPendingActions(silent){var pendingActions=this._pendingActions;while(pendingActions.length){var payload=pendingActions.shift();doDispatchAction.call(this,payload,silent);}}function triggerUpdatedEvent(silent){!silent&&this.trigger('updated');}/**\n * Event `rendered` is triggered when zr\n * rendered. It is useful for realtime\n * snapshot (reflect animation).\n *\n * Event `finished` is triggered when:\n * (1) zrender rendering finished.\n * (2) initial animation finished.\n * (3) progressive rendering finished.\n * (4) no pending action.\n * (5) no delayed setOption needs to be processed.\n */function bindRenderedEvent(zr,ecIns){zr.on('rendered',function(){ecIns.trigger('rendered');// The `finished` event should not be triggered repeatly,\n// so it should only be triggered when rendering indeed happend\n// in zrender. (Consider the case that dipatchAction is keep\n// triggering when mouse move).\nif(// Although zr is dirty if initial animation is not finished\n// and this checking is called on frame, we also check\n// animation finished for robustness.\nzr.animation.isFinished()&&!ecIns[OPTION_UPDATED]&&!ecIns._scheduler.unfinished&&!ecIns._pendingActions.length){ecIns.trigger('finished');}});}/**\n * @param {Object} params\n * @param {number} params.seriesIndex\n * @param {Array|TypedArray} params.data\n */echartsProto.appendData=function(params){if(this._disposed){disposedWarning(this.id);return;}var seriesIndex=params.seriesIndex;var ecModel=this.getModel();var seriesModel=ecModel.getSeriesByIndex(seriesIndex);if(__DEV__){assert(params.data&&seriesModel);}seriesModel.appendData(params);// Note: `appendData` does not support that update extent of coordinate\n// system, util some scenario require that. In the expected usage of\n// `appendData`, the initial extent of coordinate system should better\n// be fixed by axis `min`/`max` setting or initial data, otherwise if\n// the extent changed while `appendData`, the location of the painted\n// graphic elements have to be changed, which make the usage of\n// `appendData` meaningless.\nthis._scheduler.unfinished=true;};/**\n * Register event\n * @method\n */echartsProto.on=createRegisterEventWithLowercaseName('on',false);echartsProto.off=createRegisterEventWithLowercaseName('off',false);echartsProto.one=createRegisterEventWithLowercaseName('one',false);/**\n * Prepare view instances of charts and components\n * @param {module:echarts/model/Global} ecModel\n * @private\n */function prepareView(ecIns,type,ecModel,scheduler){var isComponent=type==='component';var viewList=isComponent?ecIns._componentsViews:ecIns._chartsViews;var viewMap=isComponent?ecIns._componentsMap:ecIns._chartsMap;var zr=ecIns._zr;var api=ecIns._api;for(var i=0;iecModel.get('hoverLayerThreshold')&&!env$1.node){ecModel.eachSeries(function(seriesModel){if(seriesModel.preventUsingHoverLayer){return;}var chartView=ecIns._chartsMap[seriesModel.__viewId];if(chartView.__alive){chartView.group.traverse(function(el){// Don't switch back.\nel.useHoverLayer=true;});}});}}/**\n * Update chart progressive and blend.\n * @param {module:echarts/model/Series|module:echarts/model/Component} model\n * @param {module:echarts/view/Component|module:echarts/view/Chart} view\n */function updateBlend(seriesModel,chartView){var blendMode=seriesModel.get('blendMode')||null;if(__DEV__){if(!env$1.canvasSupported&&blendMode&&blendMode!=='source-over'){console.warn('Only canvas support blendMode');}}chartView.group.traverse(function(el){// FIXME marker and other components\nif(!el.isGroup){// Only set if blendMode is changed. In case element is incremental and don't wan't to rerender.\nif(el.style.blend!==blendMode){el.setStyle('blend',blendMode);}}if(el.eachPendingDisplayable){el.eachPendingDisplayable(function(displayable){displayable.setStyle('blend',blendMode);});}});}/**\n * @param {module:echarts/model/Series|module:echarts/model/Component} model\n * @param {module:echarts/view/Component|module:echarts/view/Chart} view\n */function updateZ(model,view){var z=model.get('z');var zlevel=model.get('zlevel');// Set z and zlevel\nview.group.traverse(function(el){if(el.type!=='group'){z!=null&&(el.z=z);zlevel!=null&&(el.zlevel=zlevel);}});}function createExtensionAPI(ecInstance){var coordSysMgr=ecInstance._coordSysMgr;return extend(new ExtensionAPI(ecInstance),{// Inject methods\ngetCoordinateSystems:bind(coordSysMgr.getCoordinateSystems,coordSysMgr),getComponentByElement:function getComponentByElement(el){while(el){var modelInfo=el.__ecComponentInfo;if(modelInfo!=null){return ecInstance._model.getComponent(modelInfo.mainType,modelInfo.index);}el=el.parent;}}});}/**\n * @class\n * Usage of query:\n * `chart.on('click', query, handler);`\n * The `query` can be:\n * + The component type query string, only `mainType` or `mainType.subType`,\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\n * + The component query object, like:\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\n * + The data query object, like:\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\n * + The other query object (cmponent customized query), like:\n * `{element: 'some'}` (only available in custom series).\n *\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\n * same as there is no such prop in the `query` object.\n */function EventProcessor(){// These info required: targetEl, packedEvent, model, view\nthis.eventInfo;}EventProcessor.prototype={constructor:EventProcessor,normalizeQuery:function normalizeQuery(query){var cptQuery={};var dataQuery={};var otherQuery={};// `query` is `mainType` or `mainType.subType` of component.\nif(isString(query)){var condCptType=parseClassType(query);// `.main` and `.sub` may be ''.\ncptQuery.mainType=condCptType.main||null;cptQuery.subType=condCptType.sub||null;}// `query` is an object, convert to {mainType, index, name, id}.\nelse{// `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n// can not be used in `compomentModel.filterForExposedEvent`.\nvar suffixes=['Index','Name','Id'];var dataKeys={name:1,dataIndex:1,dataType:1};each$1(query,function(val,key){var reserved=false;for(var i=0;i0&&suffixPos===key.length-propSuffix.length){var mainType=key.slice(0,suffixPos);// Consider `dataIndex`.\nif(mainType!=='data'){cptQuery.mainType=mainType;cptQuery[propSuffix.toLowerCase()]=val;reserved=true;}}}if(dataKeys.hasOwnProperty(key)){dataQuery[key]=val;reserved=true;}if(!reserved){otherQuery[key]=val;}});}return{cptQuery:cptQuery,dataQuery:dataQuery,otherQuery:otherQuery};},filter:function filter(eventType,query,args){// They should be assigned before each trigger call.\nvar eventInfo=this.eventInfo;if(!eventInfo){return true;}var targetEl=eventInfo.targetEl;var packedEvent=eventInfo.packedEvent;var model=eventInfo.model;var view=eventInfo.view;// For event like 'globalout'.\nif(!model||!view){return true;}var cptQuery=query.cptQuery;var dataQuery=query.dataQuery;return check(cptQuery,model,'mainType')&&check(cptQuery,model,'subType')&&check(cptQuery,model,'index','componentIndex')&&check(cptQuery,model,'name')&&check(cptQuery,model,'id')&&check(dataQuery,packedEvent,'name')&&check(dataQuery,packedEvent,'dataIndex')&&check(dataQuery,packedEvent,'dataType')&&(!view.filterForExposedEvent||view.filterForExposedEvent(eventType,query.otherQuery,targetEl,packedEvent));function check(query,host,prop,propOnHost){return query[prop]==null||host[propOnHost||prop]===query[prop];}},afterTrigger:function afterTrigger(){// Make sure the eventInfo wont be used in next trigger.\nthis.eventInfo=null;}};/**\n * @type {Object} key: actionType.\n * @inner\n */var actions={};/**\n * Map eventType to actionType\n * @type {Object}\n */var eventActionMap={};/**\n * Data processor functions of each stage\n * @type {Array.>}\n * @inner\n */var dataProcessorFuncs=[];/**\n * @type {Array.}\n * @inner\n */var optionPreprocessorFuncs=[];/**\n * @type {Array.}\n * @inner\n */var postUpdateFuncs=[];/**\n * Visual encoding functions of each stage\n * @type {Array.>}\n */var visualFuncs=[];/**\n * Theme storage\n * @type {Object.}\n */var themeStorage={};/**\n * Loading effects\n */var loadingEffects={};var instances={};var connectedGroups={};var idBase=new Date()-0;var groupIdBase=new Date()-0;var DOM_ATTRIBUTE_KEY='_echarts_instance_';function enableConnect(chart){var STATUS_PENDING=0;var STATUS_UPDATING=1;var STATUS_UPDATED=2;var STATUS_KEY='__connectUpdateStatus';function updateConnectedChartsStatus(charts,status){for(var i=0;i} groupId\n */function connect(groupId){// Is array of charts\nif(isArray(groupId)){var charts=groupId;groupId=null;// If any chart has group\neach(charts,function(chart){if(chart.group!=null){groupId=chart.group;}});groupId=groupId||'g_'+groupIdBase++;each(charts,function(chart){chart.group=groupId;});}connectedGroups[groupId]=true;return groupId;}/**\n * @DEPRECATED\n * @return {string} groupId\n */function disConnect(groupId){connectedGroups[groupId]=false;}/**\n * @return {string} groupId\n */var disconnect=disConnect;/**\n * Dispose a chart instance\n * @param {module:echarts~ECharts|HTMLDomElement|string} chart\n */function dispose(chart){if(typeof chart==='string'){chart=instances[chart];}else if(!(chart instanceof ECharts)){// Try to treat as dom\nchart=getInstanceByDom(chart);}if(chart instanceof ECharts&&!chart.isDisposed()){chart.dispose();}}/**\n * @param {HTMLElement} dom\n * @return {echarts~ECharts}\n */function getInstanceByDom(dom){return instances[getAttribute(dom,DOM_ATTRIBUTE_KEY)];}/**\n * @param {string} key\n * @return {echarts~ECharts}\n */function getInstanceById(key){return instances[key];}/**\n * Register theme\n */function registerTheme(name,theme$$1){themeStorage[name]=theme$$1;}/**\n * Register option preprocessor\n * @param {Function} preprocessorFunc\n */function registerPreprocessor(preprocessorFunc){optionPreprocessorFuncs.push(preprocessorFunc);}/**\n * @param {number} [priority=1000]\n * @param {Object|Function} processor\n */function registerProcessor(priority,processor){normalizeRegister(dataProcessorFuncs,priority,processor,PRIORITY_PROCESSOR_FILTER);}/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */function registerPostUpdate(postUpdateFunc){postUpdateFuncs.push(postUpdateFunc);}/**\n * Usage:\n * registerAction('someAction', 'someEvent', function () { ... });\n * registerAction('someAction', function () { ... });\n * registerAction(\n * {type: 'someAction', event: 'someEvent', update: 'updateView'},\n * function () { ... }\n * );\n *\n * @param {(string|Object)} actionInfo\n * @param {string} actionInfo.type\n * @param {string} [actionInfo.event]\n * @param {string} [actionInfo.update]\n * @param {string} [eventName]\n * @param {Function} action\n */function registerAction(actionInfo,eventName,action){if(typeof eventName==='function'){action=eventName;eventName='';}var actionType=isObject(actionInfo)?actionInfo.type:[actionInfo,actionInfo={event:eventName}][0];// Event name is all lowercase\nactionInfo.event=(actionInfo.event||actionType).toLowerCase();eventName=actionInfo.event;// Validate action type and event name.\nassert(ACTION_REG.test(actionType)&&ACTION_REG.test(eventName));if(!actions[actionType]){actions[actionType]={action:action,actionInfo:actionInfo};}eventActionMap[eventName]=actionType;}/**\n * @param {string} type\n * @param {*} CoordinateSystem\n */function registerCoordinateSystem(type,CoordinateSystem$$1){CoordinateSystemManager.register(type,CoordinateSystem$$1);}/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.}\n */function getCoordinateSystemDimensions(type){var coordSysCreator=CoordinateSystemManager.get(type);if(coordSysCreator){return coordSysCreator.getDimensionsInfo?coordSysCreator.getDimensionsInfo():coordSysCreator.dimensions.slice();}}/**\n * Layout is a special stage of visual encoding\n * Most visual encoding like color are common for different chart\n * But each chart has it's own layout algorithm\n *\n * @param {number} [priority=1000]\n * @param {Function} layoutTask\n */function registerLayout(priority,layoutTask){normalizeRegister(visualFuncs,priority,layoutTask,PRIORITY_VISUAL_LAYOUT,'layout');}/**\n * @param {number} [priority=3000]\n * @param {module:echarts/stream/Task} visualTask\n */function registerVisual(priority,visualTask){normalizeRegister(visualFuncs,priority,visualTask,PRIORITY_VISUAL_CHART,'visual');}/**\n * @param {Object|Function} fn: {seriesType, createOnAllSeries, performRawSeries, reset}\n */function normalizeRegister(targetList,priority,fn,defaultPriority,visualType){if(isFunction(priority)||isObject(priority)){fn=priority;priority=defaultPriority;}if(__DEV__){if(isNaN(priority)||priority==null){throw new Error('Illegal priority');}// Check duplicate\neach(targetList,function(wrap){assert(wrap.__raw!==fn);});}var stageHandler=Scheduler.wrapStageHandler(fn,visualType);stageHandler.__prio=priority;stageHandler.__raw=fn;targetList.push(stageHandler);return stageHandler;}/**\n * @param {string} name\n */function registerLoading(name,loadingFx){loadingEffects[name]=loadingFx;}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendComponentModel(opts/*, superClass*/){// var Clazz = ComponentModel;\n// if (superClass) {\n// var classType = parseClassType(superClass);\n// Clazz = ComponentModel.getClass(classType.main, classType.sub, true);\n// }\nreturn ComponentModel.extend(opts);}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendComponentView(opts/*, superClass*/){// var Clazz = ComponentView;\n// if (superClass) {\n// var classType = parseClassType(superClass);\n// Clazz = ComponentView.getClass(classType.main, classType.sub, true);\n// }\nreturn Component$1.extend(opts);}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendSeriesModel(opts/*, superClass*/){// var Clazz = SeriesModel;\n// if (superClass) {\n// superClass = 'series.' + superClass.replace('series.', '');\n// var classType = parseClassType(superClass);\n// Clazz = ComponentModel.getClass(classType.main, classType.sub, true);\n// }\nreturn SeriesModel.extend(opts);}/**\n * @param {Object} opts\n * @param {string} [superClass]\n */function extendChartView(opts/*, superClass*/){// var Clazz = ChartView;\n// if (superClass) {\n// superClass = superClass.replace('series.', '');\n// var classType = parseClassType(superClass);\n// Clazz = ChartView.getClass(classType.main, true);\n// }\nreturn Chart.extend(opts);}/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n * Be careful of using it in the browser.\n *\n * @param {Function} creator\n * @example\n * var Canvas = require('canvas');\n * var echarts = require('echarts');\n * echarts.setCanvasCreator(function () {\n * // Small size is enough.\n * return new Canvas(32, 32);\n * });\n */function setCanvasCreator(creator){$override('createCanvas',creator);}/**\n * @param {string} mapName\n * @param {Array.|Object|string} geoJson\n * @param {Object} [specialAreas]\n *\n * @example GeoJSON\n * $.get('USA.json', function (geoJson) {\n * echarts.registerMap('USA', geoJson);\n * // Or\n * echarts.registerMap('USA', {\n * geoJson: geoJson,\n * specialAreas: {}\n * })\n * });\n *\n * $.get('airport.svg', function (svg) {\n * echarts.registerMap('airport', {\n * svg: svg\n * }\n * });\n *\n * echarts.registerMap('eu', [\n * {svg: eu-topographic.svg},\n * {geoJSON: eu.json}\n * ])\n */function registerMap(mapName,geoJson,specialAreas){mapDataStorage.registerMap(mapName,geoJson,specialAreas);}/**\n * @param {string} mapName\n * @return {Object}\n */function getMap(mapName){// For backward compatibility, only return the first one.\nvar records=mapDataStorage.retrieveMap(mapName);return records&&records[0]&&{geoJson:records[0].geoJSON,specialAreas:records[0].specialAreas};}registerVisual(PRIORITY_VISUAL_GLOBAL,seriesColor);registerPreprocessor(backwardCompat);registerProcessor(PRIORITY_PROCESSOR_DATASTACK,dataStack);registerLoading('default',loadingDefault);// Default actions\nregisterAction({type:'highlight',event:'highlight',update:'highlight'},noop);registerAction({type:'downplay',event:'downplay',update:'downplay'},noop);// Default theme\nregisterTheme('light',lightTheme);registerTheme('dark',theme);// For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\nvar dataTool={};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function defaultKeyGetter(item){return item;}/**\n * @param {Array} oldArr\n * @param {Array} newArr\n * @param {Function} oldKeyGetter\n * @param {Function} newKeyGetter\n * @param {Object} [context] Can be visited by this.context in callback.\n */function DataDiffer(oldArr,newArr,oldKeyGetter,newKeyGetter,context){this._old=oldArr;this._new=newArr;this._oldKeyGetter=oldKeyGetter||defaultKeyGetter;this._newKeyGetter=newKeyGetter||defaultKeyGetter;this.context=context;}DataDiffer.prototype={constructor:DataDiffer,/**\n * Callback function when add a data\n */add:function add(func){this._add=func;return this;},/**\n * Callback function when update a data\n */update:function update(func){this._update=func;return this;},/**\n * Callback function when remove a data\n */remove:function remove(func){this._remove=func;return this;},execute:function execute(){var oldArr=this._old;var newArr=this._new;var oldDataIndexMap={};var newDataIndexMap={};var oldDataKeyArr=[];var newDataKeyArr=[];var i;initIndexMap(oldArr,oldDataIndexMap,oldDataKeyArr,'_oldKeyGetter',this);initIndexMap(newArr,newDataIndexMap,newDataKeyArr,'_newKeyGetter',this);for(i=0;i65535?CtorUint32Array:CtorUint16Array;}function cloneChunk(originalChunk){var Ctor=originalChunk.constructor;// Only shallow clone is enough when Array.\nreturn Ctor===Array?originalChunk.slice():new Ctor(originalChunk);}var TRANSFERABLE_PROPERTIES=['hasItemOption','_nameList','_idList','_invertedIndicesMap','_rawData','_chunkSize','_chunkCount','_dimValueGetter','_count','_rawCount','_nameDimIdx','_idDimIdx'];var CLONE_PROPERTIES=['_extent','_approximateExtent','_rawExtent'];function transferProperties(target,source){each$1(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods||[]),function(propName){if(source.hasOwnProperty(propName)){target[propName]=source[propName];}});target.__wrappedMethods=source.__wrappedMethods;each$1(CLONE_PROPERTIES,function(propName){target[propName]=_clone(source[propName]);});target._calculationInfo=extend(source._calculationInfo);}/**\n * @constructor\n * @alias module:echarts/data/List\n *\n * @param {Array.} dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n * @param {module:echarts/model/Model} hostModel\n */var List=function List(dimensions,hostModel){dimensions=dimensions||['x','y'];var dimensionInfos={};var dimensionNames=[];var invertedIndicesMap={};for(var i=0;i}\n */this.dimensions=dimensionNames;/**\n * Infomation of each data dimension, like data type.\n * @type {Object}\n */this._dimensionInfos=dimensionInfos;/**\n * @type {module:echarts/model/Model}\n */this.hostModel=hostModel;/**\n * @type {module:echarts/model/Model}\n */this.dataType;/**\n * Indices stores the indices of data subset after filtered.\n * This data subset will be used in chart.\n * @type {Array.}\n * @readOnly\n */this._indices=null;this._count=0;this._rawCount=0;/**\n * Data storage\n * @type {Object.>}\n * @private\n */this._storage={};/**\n * @type {Array.}\n */this._nameList=[];/**\n * @type {Array.}\n */this._idList=[];/**\n * Models of data option is stored sparse for optimizing memory cost\n * @type {Array.}\n * @private\n */this._optionModels=[];/**\n * Global visual properties after visual coding\n * @type {Object}\n * @private\n */this._visual={};/**\n * Globel layout properties.\n * @type {Object}\n * @private\n */this._layout={};/**\n * Item visual properties after visual coding\n * @type {Array.}\n * @private\n */this._itemVisuals=[];/**\n * Key: visual type, Value: boolean\n * @type {Object}\n * @readOnly\n */this.hasItemVisual={};/**\n * Item layout properties after layout\n * @type {Array.}\n * @private\n */this._itemLayouts=[];/**\n * Graphic elemnents\n * @type {Array.}\n * @private\n */this._graphicEls=[];/**\n * Max size of each chunk.\n * @type {number}\n * @private\n */this._chunkSize=1e5;/**\n * @type {number}\n * @private\n */this._chunkCount=0;/**\n * @type {Array.}\n * @private\n */this._rawData;/**\n * Raw extent will not be cloned, but only transfered.\n * It will not be calculated util needed.\n * key: dim,\n * value: {end: number, extent: Array.}\n * @type {Object}\n * @private\n */this._rawExtent={};/**\n * @type {Object}\n * @private\n */this._extent={};/**\n * key: dim\n * value: extent\n * @type {Object}\n * @private\n */this._approximateExtent={};/**\n * Cache summary info for fast visit. See \"dimensionHelper\".\n * @type {Object}\n * @private\n */this._dimensionsSummary=summarizeDimensions(this);/**\n * @type {Object.}\n * @private\n */this._invertedIndicesMap=invertedIndicesMap;/**\n * @type {Object}\n * @private\n */this._calculationInfo={};/**\n * User output info of this data.\n * DO NOT use it in other places!\n *\n * When preparing user params for user callbacks, we have\n * to clone these inner data structures to prevent users\n * from modifying them to effect built-in logic. And for\n * performance consideration we make this `userOutput` to\n * avoid clone them too many times.\n *\n * @type {Object}\n * @readOnly\n */this.userOutput=this._dimensionsSummary.userOutput;};var listProto=List.prototype;listProto.type='list';/**\n * If each data item has it's own option\n * @type {boolean}\n */listProto.hasItemOption=true;/**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `this.dimensions`, it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatbility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * Get dimension name\n * @param {string|number} dim See above.\n * @return {string} Concrete dim name.\n */listProto.getDimension=function(dim){if(typeof dim==='number'// If being a number-like string but not being defined a dimension name.\n||!isNaN(dim)&&!this._dimensionInfos.hasOwnProperty(dim)){dim=this.dimensions[dim];}return dim;};/**\n * Get type and calculation info of particular dimension\n * @param {string|number} dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */listProto.getDimensionInfo=function(dim){// Do not clone, because there may be categories in dimInfo.\nreturn this._dimensionInfos[this.getDimension(dim)];};/**\n * @return {Array.} concrete dimension name list on coord.\n */listProto.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice();};/**\n * @param {string} coordDim\n * @param {number} [idx] A coordDim may map to more than one data dim.\n * If idx is `true`, return a array of all mapped dims.\n * If idx is not specified, return the first dim not extra.\n * @return {string|Array.} concrete data dim.\n * If idx is number, and not found, return null/undefined.\n * If idx is `true`, and not found, return empty array (always return array).\n */listProto.mapDimension=function(coordDim,idx){var dimensionsSummary=this._dimensionsSummary;if(idx==null){return dimensionsSummary.encodeFirstDimNotExtra[coordDim];}var dims=dimensionsSummary.encode[coordDim];return idx===true// always return array if idx is `true`\n?(dims||[]).slice():dims&&dims[idx];};/**\n * Initialize from data\n * @param {Array.} data source or data or data provider.\n * @param {Array.} [nameLIst] The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n * @param {Function} [dimValueGetter] (dataItem, dimName, dataIndex, dimIndex) => number\n */listProto.initData=function(data,nameList,dimValueGetter){var notProvider=Source.isInstance(data)||isArrayLike(data);if(notProvider){data=new DefaultDataProvider(data,this.dimensions.length);}if(__DEV__){if(!notProvider&&(typeof data.getItem!=='function'||typeof data.count!=='function')){throw new Error('Inavlid data provider.');}}this._rawData=data;// Clear\nthis._storage={};this._indices=null;this._nameList=nameList||[];this._idList=[];this._nameRepeatCount={};if(!dimValueGetter){this.hasItemOption=false;}/**\n * @readOnly\n */this.defaultDimValueGetter=defaultDimValueGetters[this._rawData.getSource().sourceFormat];// Default dim value getter\nthis._dimValueGetter=dimValueGetter=dimValueGetter||this.defaultDimValueGetter;this._dimValueGetterArrayRows=defaultDimValueGetters.arrayRows;// Reset raw extent.\nthis._rawExtent={};this._initDataFromProvider(0,data.count());// If data has no item option.\nif(data.pure){this.hasItemOption=false;}};listProto.getProvider=function(){return this._rawData;};/**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */listProto.appendData=function(data){if(__DEV__){assert$1(!this._indices,'appendData can only be called on raw data.');}var rawData=this._rawData;var start=this.count();rawData.appendData(data);var end=rawData.count();if(!rawData.persistent){end+=start;}this._initDataFromProvider(start,end);};/**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to storage.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param {Array.>} values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exaclty cooresponding to a dimension.\n * @param {Array.} [names]\n */listProto.appendValues=function(values,names){var chunkSize=this._chunkSize;var storage=this._storage;var dimensions=this.dimensions;var dimLen=dimensions.length;var rawExtent=this._rawExtent;var start=this.count();var end=start+Math.max(values.length,names?names.length:0);var originalChunkCount=this._chunkCount;for(var i=0;idimRawExtent[1]&&(dimRawExtent[1]=val);}if(names){this._nameList[idx]=names[sourceIdx];}}this._rawCount=this._count=end;// Reset data extent\nthis._extent={};prepareInvertedIndex(this);};listProto._initDataFromProvider=function(start,end){// Optimize.\nif(start>=end){return;}var chunkSize=this._chunkSize;var rawData=this._rawData;var storage=this._storage;var dimensions=this.dimensions;var dimLen=dimensions.length;var dimensionInfoMap=this._dimensionInfos;var nameList=this._nameList;var idList=this._idList;var rawExtent=this._rawExtent;var nameRepeatCount=this._nameRepeatCount={};var nameDimIdx;var originalChunkCount=this._chunkCount;for(var i=0;idimRawExtent[1]&&(dimRawExtent[1]=val);}// ??? FIXME not check by pure but sourceFormat?\n// TODO refactor these logic.\nif(!rawData.pure){var name=nameList[idx];if(dataItem&&name==null){// If dataItem is {name: ...}, it has highest priority.\n// That is appropriate for many common cases.\nif(dataItem.name!=null){// There is no other place to persistent dataItem.name,\n// so save it to nameList.\nnameList[idx]=name=dataItem.name;}else if(nameDimIdx!=null){var nameDim=dimensions[nameDimIdx];var nameDimChunk=storage[nameDim][chunkIndex];if(nameDimChunk){name=nameDimChunk[chunkOffset];var ordinalMeta=dimensionInfoMap[nameDim].ordinalMeta;if(ordinalMeta&&ordinalMeta.categories.length){name=ordinalMeta.categories[name];}}}}// Try using the id in option\n// id or name is used on dynamical data, mapping old and new items.\nvar id=dataItem==null?null:dataItem.id;if(id==null&&name!=null){// Use name as id and add counter to avoid same name\nnameRepeatCount[name]=nameRepeatCount[name]||0;id=name;if(nameRepeatCount[name]>0){id+='__ec__'+nameRepeatCount[name];}nameRepeatCount[name]++;}id!=null&&(idList[idx]=id);}}if(!rawData.persistent&&rawData.clean){// Clean unused data if data source is typed array.\nrawData.clean();}this._rawCount=this._count=end;// Reset data extent\nthis._extent={};prepareInvertedIndex(this);};function prepareChunks(storage,dimInfo,chunkSize,chunkCount,end){var DataCtor=dataCtors[dimInfo.type];var lastChunkIndex=chunkCount-1;var dim=dimInfo.name;var resizeChunkArray=storage[dim][lastChunkIndex];if(resizeChunkArray&&resizeChunkArray.length=0&&idx= 0 && stackedValue > 0) // Positive stack\n// || (value <= 0 && stackedValue < 0) // Negative stack\n// ) {\n// value += stackedValue;\n// }\n// stackedOn = stackedOn.stackedOn;\n// }\n// }\n// }\nreturn value;};/**\n * @param {string} dim concrete dim\n * @param {number} rawIndex\n * @return {number|string}\n */listProto.getByRawIndex=function(dim,rawIdx){if(!(rawIdx>=0&&rawIdx} [dimensions] If ignored, using all dimensions.\n * @param {number} idx\n * @return {number}\n */listProto.getValues=function(dimensions,idx/*, stack */){var values=[];if(!isArray(dimensions)){// stack = idx;\nidx=dimensions;dimensions=this.dimensions;}for(var i=0,len=dimensions.length;imax&&(max=value);}dimExtent=[min,max];this._extent[dim]=dimExtent;return dimExtent;};/**\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */listProto.getApproximateExtent=function(dim/*, stack */){dim=this.getDimension(dim);return this._approximateExtent[dim]||this.getDataExtent(dim/*, stack */);};listProto.setApproximateExtent=function(extent,dim/*, stack */){dim=this.getDimension(dim);this._approximateExtent[dim]=extent.slice();};/**\n * @param {string} key\n * @return {*}\n */listProto.getCalculationInfo=function(key){return this._calculationInfo[key];};/**\n * @param {string|Object} key or k-v object\n * @param {*} [value]\n */listProto.setCalculationInfo=function(key,value){isObject$4(key)?extend(this._calculationInfo,key):this._calculationInfo[key]=value;};/**\n * Get sum of data in one dimension\n * @param {string} dim\n */listProto.getSum=function(dim/*, stack */){var dimData=this._storage[dim];var sum=0;if(dimData){for(var i=0,len=this.count();i=this._rawCount||rawIndex<0){return-1;}if(!this._indices){return rawIndex;}// Indices are ascending\nvar indices=this._indices;// If rawIndex === dataIndex\nvar rawDataIndex=indices[rawIndex];if(rawDataIndex!=null&&rawDataIndexrawIndex){right=mid-1;}else{return mid;}}return-1;};/**\n * Retreive the index of nearest value\n * @param {string} dim\n * @param {number} value\n * @param {number} [maxDistance=Infinity]\n * @return {Array.} If and only if multiple indices has\n * the same value, they are put to the result.\n */listProto.indicesOfNearest=function(dim,value,maxDistance){var storage=this._storage;var dimData=storage[dim];var nearestIndices=[];if(!dimData){return nearestIndices;}if(maxDistance==null){maxDistance=Infinity;}var minDist=Infinity;var minDiff=-1;var nearestIndicesLen=0;// Check the test case of `test/ut/spec/data/List.js`.\nfor(var i=0,len=this.count();i= 0` in this csae.\n// But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n// should be push to `nearestIndices`.\nif(dist=0&&minDiff<0){minDist=dist;minDiff=diff;nearestIndicesLen=0;}if(diff===minDiff){nearestIndices[nearestIndicesLen++]=i;}}}nearestIndices.length=nearestIndicesLen;return nearestIndices;};/**\n * Get raw data index\n * @param {number} idx\n * @return {number}\n */listProto.getRawIndex=getRawIndexWithoutIndices;function getRawIndexWithoutIndices(idx){return idx;}function getRawIndexWithIndices(idx){if(idx=0){return this._indices[idx];}return-1;}/**\n * Get raw data item\n * @param {number} idx\n * @return {number}\n */listProto.getRawDataItem=function(idx){if(!this._rawData.persistent){var val=[];for(var i=0;i}\n * @param {Function} cb\n * @param {*} [context=this]\n *\n * @example\n * list.each('x', function (x, idx) {});\n * list.each(['x', 'y'], function (x, y, idx) {});\n * list.each(function (idx) {})\n */listProto.each=function(dims,cb,context,contextCompat){'use strict';if(!this._count){return;}if(typeof dims==='function'){contextCompat=context;context=cb;cb=dims;dims=[];}// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;dims=map(normalizeDimensions(dims),this.getDimension,this);if(__DEV__){validateDimensions(this,dims);}var dimSize=dims.length;for(var i=0;i}\n * @param {Function} cb\n * @param {*} [context=this]\n */listProto.filterSelf=function(dimensions,cb,context,contextCompat){'use strict';if(!this._count){return;}if(typeof dimensions==='function'){contextCompat=context;context=cb;cb=dimensions;dimensions=[];}// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;dimensions=map(normalizeDimensions(dimensions),this.getDimension,this);if(__DEV__){validateDimensions(this,dimensions);}var count=this.count();var Ctor=getIndicesCtor(this);var newIndices=new Ctor(count);var value=[];var dimSize=dimensions.length;var offset=0;var dim0=dimensions[0];for(var i=0;i=min&&val<=max||isNaN(val)){newIndices[offset++]=idx;}idx++;}}quickFinished=true;}else if(dimSize===2){var dimStorage=this._storage[dim0];var dimStorage2=this._storage[dimensions[1]];var min2=range[dimensions[1]][0];var max2=range[dimensions[1]][1];for(var k=0;k=min&&val<=max||isNaN(val))&&(val2>=min2&&val2<=max2||isNaN(val2))){newIndices[offset++]=idx;}idx++;}}quickFinished=true;}}if(!quickFinished){if(dimSize===1){for(var i=0;i=min&&val<=max||isNaN(val)){newIndices[offset++]=rawIndex;}}}else{for(var i=0;irange[dimk][1]){keep=false;}}if(keep){newIndices[offset++]=this.getRawIndex(i);}}}}// Set indices after filtered.\nif(offset} [dimensions]\n * @param {Function} cb\n * @param {*} [context=this]\n * @return {Array}\n */listProto.mapArray=function(dimensions,cb,context,contextCompat){'use strict';if(typeof dimensions==='function'){contextCompat=context;context=cb;cb=dimensions;dimensions=[];}// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;var result=[];this.each(dimensions,function(){result.push(cb&&cb.apply(this,arguments));},context);return result;};// Data in excludeDimensions is copied, otherwise transfered.\nfunction cloneListForMapAndSample(original,excludeDimensions){var allDimensions=original.dimensions;var list=new List(map(allDimensions,original.getDimensionInfo,original),original.hostModel);// FIXME If needs stackedOn, value may already been stacked\ntransferProperties(list,original);var storage=list._storage={};var originalStorage=original._storage;// Init storage\nfor(var i=0;i=0){storage[dim]=cloneDimStore(originalStorage[dim]);list._rawExtent[dim]=getInitialExtent();list._extent[dim]=null;}else{// Direct reference for other dimensions\nstorage[dim]=originalStorage[dim];}}}return list;}function cloneDimStore(originalDimStore){var newDimStore=new Array(originalDimStore.length);for(var j=0;j} dimensions\n * @param {Function} cb\n * @param {*} [context=this]\n * @return {Array}\n */listProto.map=function(dimensions,cb,context,contextCompat){'use strict';// contextCompat just for compat echarts3\ncontext=context||contextCompat||this;dimensions=map(normalizeDimensions(dimensions),this.getDimension,this);if(__DEV__){validateDimensions(this,dimensions);}var list=cloneListForMapAndSample(this,dimensions);// Following properties are all immutable.\n// So we can reference to the same value\nlist._indices=this._indices;list.getRawIndex=list._indices?getRawIndexWithIndices:getRawIndexWithoutIndices;var storage=list._storage;var tmpRetValue=[];var chunkSize=this._chunkSize;var dimSize=dimensions.length;var dataCount=this.count();var values=[];var rawExtent=list._rawExtent;for(var dataIndex=0;dataIndexrawExtentOnDim[1]){rawExtentOnDim[1]=val;}}}}return list;};/**\n * Large data down sampling on given dimension\n * @param {string} dimension\n * @param {number} rate\n * @param {Function} sampleValue\n * @param {Function} sampleIndex Sample index for name and id\n */listProto.downSample=function(dimension,rate,sampleValue,sampleIndex){var list=cloneListForMapAndSample(this,[dimension]);var targetStorage=list._storage;var frameValues=[];var frameSize=Math.floor(1/rate);var dimStore=targetStorage[dimension];var len=this.count();var chunkSize=this._chunkSize;var rawExtentOnDim=list._rawExtent[dimension];var newIndices=new(getIndicesCtor(this))(len);var offset=0;for(var i=0;ilen-i){frameSize=len-i;frameValues.length=frameSize;}for(var k=0;krawExtentOnDim[1]){rawExtentOnDim[1]=value;}newIndices[offset++]=sampleFrameIdx;}list._count=offset;list._indices=newIndices;list.getRawIndex=getRawIndexWithIndices;return list;};/**\n * Get model of one data item.\n *\n * @param {number} idx\n */ // FIXME Model proxy ?\nlistProto.getItemModel=function(idx){var hostModel=this.hostModel;return new Model(this.getRawDataItem(idx),hostModel,hostModel&&hostModel.ecModel);};/**\n * Create a data differ\n * @param {module:echarts/data/List} otherList\n * @return {module:echarts/data/DataDiffer}\n */listProto.diff=function(otherList){var thisList=this;return new DataDiffer(otherList?otherList.getIndices():[],this.getIndices(),function(idx){return getId(otherList,idx);},function(idx){return getId(thisList,idx);});};/**\n * Get visual property.\n * @param {string} key\n */listProto.getVisual=function(key){var visual=this._visual;return visual&&visual[key];};/**\n * Set visual property\n * @param {string|Object} key\n * @param {*} [value]\n *\n * @example\n * setVisual('color', color);\n * setVisual({\n * 'color': color\n * });\n */listProto.setVisual=function(key,val){if(isObject$4(key)){for(var name in key){if(key.hasOwnProperty(name)){this.setVisual(name,key[name]);}}return;}this._visual=this._visual||{};this._visual[key]=val;};/**\n * Set layout property.\n * @param {string|Object} key\n * @param {*} [val]\n */listProto.setLayout=function(key,val){if(isObject$4(key)){for(var name in key){if(key.hasOwnProperty(name)){this.setLayout(name,key[name]);}}return;}this._layout[key]=val;};/**\n * Get layout property.\n * @param {string} key.\n * @return {*}\n */listProto.getLayout=function(key){return this._layout[key];};/**\n * Get layout of single data item\n * @param {number} idx\n */listProto.getItemLayout=function(idx){return this._itemLayouts[idx];};/**\n * Set layout of single data item\n * @param {number} idx\n * @param {Object} layout\n * @param {boolean=} [merge=false]\n */listProto.setItemLayout=function(idx,layout,merge$$1){this._itemLayouts[idx]=merge$$1?extend(this._itemLayouts[idx]||{},layout):layout;};/**\n * Clear all layout of single data item\n */listProto.clearItemLayouts=function(){this._itemLayouts.length=0;};/**\n * Get visual property of single data item\n * @param {number} idx\n * @param {string} key\n * @param {boolean} [ignoreParent=false]\n */listProto.getItemVisual=function(idx,key,ignoreParent){var itemVisual=this._itemVisuals[idx];var val=itemVisual&&itemVisual[key];if(val==null&&!ignoreParent){// Use global visual property\nreturn this.getVisual(key);}return val;};/**\n * Set visual property of single data item\n *\n * @param {number} idx\n * @param {string|Object} key\n * @param {*} [value]\n *\n * @example\n * setItemVisual(0, 'color', color);\n * setItemVisual(0, {\n * 'color': color\n * });\n */listProto.setItemVisual=function(idx,key,value){var itemVisual=this._itemVisuals[idx]||{};var hasItemVisual=this.hasItemVisual;this._itemVisuals[idx]=itemVisual;if(isObject$4(key)){for(var name in key){if(key.hasOwnProperty(name)){itemVisual[name]=key[name];hasItemVisual[name]=true;}}return;}itemVisual[key]=value;hasItemVisual[key]=true;};/**\n * Clear itemVisuals and list visual.\n */listProto.clearAllVisual=function(){this._visual={};this._itemVisuals=[];this.hasItemVisual={};};var setItemDataAndSeriesIndex=function setItemDataAndSeriesIndex(child){child.seriesIndex=this.seriesIndex;child.dataIndex=this.dataIndex;child.dataType=this.dataType;};/**\n * Set graphic element relative to data. It can be set as null\n * @param {number} idx\n * @param {module:zrender/Element} [el]\n */listProto.setItemGraphicEl=function(idx,el){var hostModel=this.hostModel;if(el){// Add data index and series index for indexing the data by element\n// Useful in tooltip\nel.dataIndex=idx;el.dataType=this.dataType;el.seriesIndex=hostModel&&hostModel.seriesIndex;if(el.type==='group'){el.traverse(setItemDataAndSeriesIndex,el);}}this._graphicEls[idx]=el;};/**\n * @param {number} idx\n * @return {module:zrender/Element}\n */listProto.getItemGraphicEl=function(idx){return this._graphicEls[idx];};/**\n * @param {Function} cb\n * @param {*} context\n */listProto.eachItemGraphicEl=function(cb,context){each$1(this._graphicEls,function(el,idx){if(el){cb&&cb.call(context,el,idx);}});};/**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */listProto.cloneShallow=function(list){if(!list){var dimensionInfoList=map(this.dimensions,this.getDimensionInfo,this);list=new List(dimensionInfoList,this.hostModel);}// FIXME\nlist._storage=this._storage;transferProperties(list,this);// Clone will not change the data extent and indices\nif(this._indices){var Ctor=this._indices.constructor;list._indices=new Ctor(this._indices);}else{list._indices=null;}list.getRawIndex=list._indices?getRawIndexWithIndices:getRawIndexWithoutIndices;return list;};/**\n * Wrap some method to add more feature\n * @param {string} methodName\n * @param {Function} injectFunction\n */listProto.wrapMethod=function(methodName,injectFunction){var originalMethod=this[methodName];if(typeof originalMethod!=='function'){return;}this.__wrappedMethods=this.__wrappedMethods||[];this.__wrappedMethods.push(methodName);this[methodName]=function(){var res=originalMethod.apply(this,arguments);return injectFunction.apply(this,[res].concat(slice(arguments)));};};// Methods that create a new list based on this list should be listed here.\n// Notice that those method should `RETURN` the new list.\nlistProto.TRANSFERABLE_METHODS=['cloneShallow','downSample','map'];// Methods that change indices of this list should be listed here.\nlistProto.CHANGABLE_METHODS=['filterSelf','selectRange'];/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */ /**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * This method builds the relationship between:\n * + \"what the coord sys or series requires (see `sysDims`)\",\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimsDef` and `opt.encodeDef`)\"\n * + \"what the data source provids (see `source`)\".\n *\n * Some guess strategy will be adapted if user does not define something.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {Function} [opt.encodeDefaulter] Called if no `opt.encodeDef` exists.\n * If not specified, auto find the next available data dim.\n * param source {module:data/Source}\n * param dimCount {number}\n * return {Object} encode Never be `null/undefined`.\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @return {Array.}\n */function completeDimensions(sysDims,source,opt){if(!Source.isInstance(source)){source=Source.seriesDataToSource(source);}opt=opt||{};sysDims=(sysDims||[]).slice();var dimsDef=(opt.dimsDef||[]).slice();var dataDimNameMap=createHashMap();var coordDimNameMap=createHashMap();// var valueCandidate;\nvar result=[];var dimCount=getDimCount(source,sysDims,dimsDef,opt.dimCount);// Apply user defined dims (`name` and `type`) and init result.\nfor(var i=0;i} [opt.coordDimensions=[]]\n * @param {number} [opt.dimensionsCount]\n * @param {string} [opt.generateCoord]\n * @param {string} [opt.generateCoordCount]\n * @param {Array.} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define.\n * @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define.\n * @param {Function} [opt.encodeDefaulter] Make default encode if user not specified.\n * @return {Array.} dimensionsInfo\n */var createDimensions=function createDimensions(source,opt){opt=opt||{};return completeDimensions(opt.coordDimensions||[],source,{dimsDef:opt.dimensionsDefine||source.dimensionsDefine,encodeDef:opt.encodeDefine||source.encodeDefine,dimCount:opt.dimensionsCount,encodeDefaulter:opt.encodeDefaulter,generateCoord:opt.generateCoord,generateCoordCount:opt.generateCoordCount});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */ // TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\n/**\n * @class\n * For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // The index of the first category axis in `coordSysDims`.\n * // `null/undefined` means no category axis exists.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */function CoordSysInfo(coordSysName){/**\n * @type {string}\n */this.coordSysName=coordSysName;/**\n * @type {Array.}\n */this.coordSysDims=[];/**\n * @type {module:zrender/core/util#HashMap}\n */this.axisMap=createHashMap();/**\n * @type {module:zrender/core/util#HashMap}\n */this.categoryAxisMap=createHashMap();/**\n * @type {number}\n */this.firstCategoryDimIndex=null;}/**\n * @return {module:model/referHelper#CoordSysInfo}\n */function getCoordSysInfoBySeries(seriesModel){var coordSysName=seriesModel.get('coordinateSystem');var result=new CoordSysInfo(coordSysName);var fetch=fetchers[coordSysName];if(fetch){fetch(seriesModel,result,result.axisMap,result.categoryAxisMap);return result;}}var fetchers={cartesian2d:function cartesian2d(seriesModel,result,axisMap,categoryAxisMap){var xAxisModel=seriesModel.getReferringComponents('xAxis')[0];var yAxisModel=seriesModel.getReferringComponents('yAxis')[0];if(__DEV__){if(!xAxisModel){throw new Error('xAxis \"'+retrieve(seriesModel.get('xAxisIndex'),seriesModel.get('xAxisId'),0)+'\" not found');}if(!yAxisModel){throw new Error('yAxis \"'+retrieve(seriesModel.get('xAxisIndex'),seriesModel.get('yAxisId'),0)+'\" not found');}}result.coordSysDims=['x','y'];axisMap.set('x',xAxisModel);axisMap.set('y',yAxisModel);if(isCategory(xAxisModel)){categoryAxisMap.set('x',xAxisModel);result.firstCategoryDimIndex=0;}if(isCategory(yAxisModel)){categoryAxisMap.set('y',yAxisModel);result.firstCategoryDimIndex==null&(result.firstCategoryDimIndex=1);}},singleAxis:function singleAxis(seriesModel,result,axisMap,categoryAxisMap){var singleAxisModel=seriesModel.getReferringComponents('singleAxis')[0];if(__DEV__){if(!singleAxisModel){throw new Error('singleAxis should be specified.');}}result.coordSysDims=['single'];axisMap.set('single',singleAxisModel);if(isCategory(singleAxisModel)){categoryAxisMap.set('single',singleAxisModel);result.firstCategoryDimIndex=0;}},polar:function polar(seriesModel,result,axisMap,categoryAxisMap){var polarModel=seriesModel.getReferringComponents('polar')[0];var radiusAxisModel=polarModel.findAxisModel('radiusAxis');var angleAxisModel=polarModel.findAxisModel('angleAxis');if(__DEV__){if(!angleAxisModel){throw new Error('angleAxis option not found');}if(!radiusAxisModel){throw new Error('radiusAxis option not found');}}result.coordSysDims=['radius','angle'];axisMap.set('radius',radiusAxisModel);axisMap.set('angle',angleAxisModel);if(isCategory(radiusAxisModel)){categoryAxisMap.set('radius',radiusAxisModel);result.firstCategoryDimIndex=0;}if(isCategory(angleAxisModel)){categoryAxisMap.set('angle',angleAxisModel);result.firstCategoryDimIndex==null&&(result.firstCategoryDimIndex=1);}},geo:function geo(seriesModel,result,axisMap,categoryAxisMap){result.coordSysDims=['lng','lat'];},parallel:function parallel(seriesModel,result,axisMap,categoryAxisMap){var ecModel=seriesModel.ecModel;var parallelModel=ecModel.getComponent('parallel',seriesModel.get('parallelIndex'));var coordSysDims=result.coordSysDims=parallelModel.dimensions.slice();each$1(parallelModel.parallelAxisIndex,function(axisIndex,index){var axisModel=ecModel.getComponent('parallelAxis',axisIndex);var axisDim=coordSysDims[index];axisMap.set(axisDim,axisModel);if(isCategory(axisModel)&&result.firstCategoryDimIndex==null){categoryAxisMap.set(axisDim,axisModel);result.firstCategoryDimIndex=index;}});}};function isCategory(axisModel){return axisModel.get('type')==='category';}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Note that it is too complicated to support 3d stack by value\n * (have to create two-dimension inverted index), so in 3d case\n * we just support that stacked by index.\n *\n * @param {module:echarts/model/Series} seriesModel\n * @param {Array.} dimensionInfoList The same as the input of .\n * The input dimensionInfoList will be modified.\n * @param {Object} [opt]\n * @param {boolean} [opt.stackedCoordDimension=''] Specify a coord dimension if needed.\n * @param {boolean} [opt.byIndex=false]\n * @return {Object} calculationInfo\n * {\n * stackedDimension: string\n * stackedByDimension: string\n * isStackedByIndex: boolean\n * stackedOverDimension: string\n * stackResultDimension: string\n * }\n */function enableDataStack(seriesModel,dimensionInfoList,opt){opt=opt||{};var byIndex=opt.byIndex;var stackedCoordDimension=opt.stackedCoordDimension;// Compatibal: when `stack` is set as '', do not stack.\nvar mayStack=!!(seriesModel&&seriesModel.get('stack'));var stackedByDimInfo;var stackedDimInfo;var stackResultDimension;var stackedOverDimension;each$1(dimensionInfoList,function(dimensionInfo,index){if(isString(dimensionInfo)){dimensionInfoList[index]=dimensionInfo={name:dimensionInfo};}if(mayStack&&!dimensionInfo.isExtraCoord){// Find the first ordinal dimension as the stackedByDimInfo.\nif(!byIndex&&!stackedByDimInfo&&dimensionInfo.ordinalMeta){stackedByDimInfo=dimensionInfo;}// Find the first stackable dimension as the stackedDimInfo.\nif(!stackedDimInfo&&dimensionInfo.type!=='ordinal'&&dimensionInfo.type!=='time'&&(!stackedCoordDimension||stackedCoordDimension===dimensionInfo.coordDim)){stackedDimInfo=dimensionInfo;}}});if(stackedDimInfo&&!byIndex&&!stackedByDimInfo){// Compatible with previous design, value axis (time axis) only stack by index.\n// It may make sense if the user provides elaborately constructed data.\nbyIndex=true;}// Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n// That put stack logic in List is for using conveniently in echarts extensions, but it\n// might not be a good way.\nif(stackedDimInfo){// Use a weird name that not duplicated with other names.\nstackResultDimension='__\\0ecstackresult';stackedOverDimension='__\\0ecstackedover';// Create inverted index to fast query index by value.\nif(stackedByDimInfo){stackedByDimInfo.createInvertedIndices=true;}var stackedDimCoordDim=stackedDimInfo.coordDim;var stackedDimType=stackedDimInfo.type;var stackedDimCoordIndex=0;each$1(dimensionInfoList,function(dimensionInfo){if(dimensionInfo.coordDim===stackedDimCoordDim){stackedDimCoordIndex++;}});dimensionInfoList.push({name:stackResultDimension,coordDim:stackedDimCoordDim,coordDimIndex:stackedDimCoordIndex,type:stackedDimType,isExtraCoord:true,isCalculationCoord:true});stackedDimCoordIndex++;dimensionInfoList.push({name:stackedOverDimension,// This dimension contains stack base (generally, 0), so do not set it as\n// `stackedDimCoordDim` to avoid extent calculation, consider log scale.\ncoordDim:stackedOverDimension,coordDimIndex:stackedDimCoordIndex,type:stackedDimType,isExtraCoord:true,isCalculationCoord:true});}return{stackedDimension:stackedDimInfo&&stackedDimInfo.name,stackedByDimension:stackedByDimInfo&&stackedByDimInfo.name,isStackedByIndex:byIndex,stackedOverDimension:stackedOverDimension,stackResultDimension:stackResultDimension};}/**\n * @param {module:echarts/data/List} data\n * @param {string} stackedDim\n */function isDimensionStacked(data,stackedDim/*, stackedByDim*/){// Each single series only maps to one pair of axis. So we do not need to\n// check stackByDim, whatever stacked by a dimension or stacked by index.\nreturn!!stackedDim&&stackedDim===data.getCalculationInfo('stackedDimension');// && (\n// stackedByDim != null\n// ? stackedByDim === data.getCalculationInfo('stackedByDimension')\n// : data.getCalculationInfo('isStackedByIndex')\n// );\n}/**\n * @param {module:echarts/data/List} data\n * @param {string} targetDim\n * @param {string} [stackedByDim] If not input this parameter, check whether\n * stacked by index.\n * @return {string} dimension\n */function getStackedDimension(data,targetDim){return isDimensionStacked(data,targetDim)?data.getCalculationInfo('stackResultDimension'):targetDim;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @param {module:echarts/data/Source|Array} source Or raw data.\n * @param {module:echarts/model/Series} seriesModel\n * @param {Object} [opt]\n * @param {string} [opt.generateCoord]\n * @param {boolean} [opt.useEncodeDefaulter]\n */function createListFromArray(source,seriesModel,opt){opt=opt||{};if(!Source.isInstance(source)){source=Source.seriesDataToSource(source);}var coordSysName=seriesModel.get('coordinateSystem');var registeredCoordSys=CoordinateSystemManager.get(coordSysName);var coordSysInfo=getCoordSysInfoBySeries(seriesModel);var coordSysDimDefs;if(coordSysInfo){coordSysDimDefs=map(coordSysInfo.coordSysDims,function(dim){var dimInfo={name:dim};var axisModel=coordSysInfo.axisMap.get(dim);if(axisModel){var axisType=axisModel.get('type');dimInfo.type=getDimensionTypeByAxis(axisType);// dimInfo.stackable = isStackable(axisType);\n}return dimInfo;});}if(!coordSysDimDefs){// Get dimensions from registered coordinate system\ncoordSysDimDefs=registeredCoordSys&&(registeredCoordSys.getDimensionsInfo?registeredCoordSys.getDimensionsInfo():registeredCoordSys.dimensions.slice())||['x','y'];}var dimInfoList=createDimensions(source,{coordDimensions:coordSysDimDefs,generateCoord:opt.generateCoord,encodeDefaulter:opt.useEncodeDefaulter?curry(makeSeriesEncodeForAxisCoordSys,coordSysDimDefs,seriesModel):null});var firstCategoryDimIndex;var hasNameEncode;coordSysInfo&&each$1(dimInfoList,function(dimInfo,dimIndex){var coordDim=dimInfo.coordDim;var categoryAxisModel=coordSysInfo.categoryAxisMap.get(coordDim);if(categoryAxisModel){if(firstCategoryDimIndex==null){firstCategoryDimIndex=dimIndex;}dimInfo.ordinalMeta=categoryAxisModel.getOrdinalMeta();}if(dimInfo.otherDims.itemName!=null){hasNameEncode=true;}});if(!hasNameEncode&&firstCategoryDimIndex!=null){dimInfoList[firstCategoryDimIndex].otherDims.itemName=0;}var stackCalculationInfo=enableDataStack(seriesModel,dimInfoList);var list=new List(dimInfoList,seriesModel);list.setCalculationInfo(stackCalculationInfo);var dimValueGetter=firstCategoryDimIndex!=null&&isNeedCompleteOrdinalData(source)?function(itemOpt,dimName,dataIndex,dimIndex){// Use dataIndex as ordinal value in categoryAxis\nreturn dimIndex===firstCategoryDimIndex?dataIndex:this.defaultDimValueGetter(itemOpt,dimName,dataIndex,dimIndex);}:null;list.hasItemOption=false;list.initData(source,null,dimValueGetter);return list;}function isNeedCompleteOrdinalData(source){if(source.sourceFormat===SOURCE_FORMAT_ORIGINAL){var sampleItem=firstDataNotNull(source.data||[]);return sampleItem!=null&&!isArray(getDataItemValue(sampleItem));}}function firstDataNotNull(data){var i=0;while(i}\n * @protected\n */this._extent=[Infinity,-Infinity];/**\n * Step is calculated in adjustExtent\n * @type {Array.}\n * @protected\n */this._interval=0;this.init&&this.init.apply(this,arguments);}/**\n * Parse input val to valid inner number.\n * @param {*} val\n * @return {number}\n */Scale.prototype.parse=function(val){// Notice: This would be a trap here, If the implementation\n// of this method depends on extent, and this method is used\n// before extent set (like in dataZoom), it would be wrong.\n// Nevertheless, parse does not depend on extent generally.\nreturn val;};Scale.prototype.getSetting=function(name){return this._setting[name];};Scale.prototype.contain=function(val){var extent=this._extent;return val>=extent[0]&&val<=extent[1];};/**\n * Normalize value to linear [0, 1], return 0.5 if extent span is 0\n * @param {number} val\n * @return {number}\n */Scale.prototype.normalize=function(val){var extent=this._extent;if(extent[1]===extent[0]){return 0.5;}return(val-extent[0])/(extent[1]-extent[0]);};/**\n * Scale normalized value\n * @param {number} val\n * @return {number}\n */Scale.prototype.scale=function(val){var extent=this._extent;return val*(extent[1]-extent[0])+extent[0];};/**\n * Set extent from data\n * @param {Array.} other\n */Scale.prototype.unionExtent=function(other){var extent=this._extent;other[0]extent[1]&&(extent[1]=other[1]);// not setExtent because in log axis it may transformed to power\n// this.setExtent(extent[0], extent[1]);\n};/**\n * Set extent from data\n * @param {module:echarts/data/List} data\n * @param {string} dim\n */Scale.prototype.unionExtentFromData=function(data,dim){this.unionExtent(data.getApproximateExtent(dim));};/**\n * Get extent\n * @return {Array.}\n */Scale.prototype.getExtent=function(){return this._extent.slice();};/**\n * Set extent\n * @param {number} start\n * @param {number} end\n */Scale.prototype.setExtent=function(start,end){var thisExtent=this._extent;if(!isNaN(start)){thisExtent[0]=start;}if(!isNaN(end)){thisExtent[1]=end;}};/**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */Scale.prototype.isBlank=function(){return this._isBlank;},/**\n * When axis extent depends on data and no data exists,\n * axis ticks should not be drawn, which is named 'blank'.\n */Scale.prototype.setBlank=function(isBlank){this._isBlank=isBlank;};/**\n * @abstract\n * @param {*} tick\n * @return {string} label of the tick.\n */Scale.prototype.getLabel=null;enableClassExtend(Scale);enableClassManagement(Scale,{registerWhenExtend:true});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @constructor\n * @param {Object} [opt]\n * @param {Object} [opt.categories=[]]\n * @param {Object} [opt.needCollect=false]\n * @param {Object} [opt.deduplication=false]\n */function OrdinalMeta(opt){/**\n * @readOnly\n * @type {Array.}\n */this.categories=opt.categories||[];/**\n * @private\n * @type {boolean}\n */this._needCollect=opt.needCollect;/**\n * @private\n * @type {boolean}\n */this._deduplication=opt.deduplication;/**\n * @private\n * @type {boolean}\n */this._map;}/**\n * @param {module:echarts/model/Model} axisModel\n * @return {module:echarts/data/OrdinalMeta}\n */OrdinalMeta.createByAxisModel=function(axisModel){var option=axisModel.option;var data=option.data;var categories=data&&map(data,getName);return new OrdinalMeta({categories:categories,needCollect:!categories,// deduplication is default in axis.\ndeduplication:option.dedplication!==false});};var proto$1=OrdinalMeta.prototype;/**\n * @param {string} category\n * @return {number} ordinal\n */proto$1.getOrdinal=function(category){return getOrCreateMap(this).get(category);};/**\n * @param {*} category\n * @return {number} The ordinal. If not found, return NaN.\n */proto$1.parseAndCollect=function(category){var index;var needCollect=this._needCollect;// The value of category dim can be the index of the given category set.\n// This feature is only supported when !needCollect, because we should\n// consider a common case: a value is 2017, which is a number but is\n// expected to be tread as a category. This case usually happen in dataset,\n// where it happent to be no need of the index feature.\nif(typeof category!=='string'&&!needCollect){return category;}// Optimize for the scenario:\n// category is ['2012-01-01', '2012-01-02', ...], where the input\n// data has been ensured not duplicate and is large data.\n// Notice, if a dataset dimension provide categroies, usually echarts\n// should remove duplication except user tell echarts dont do that\n// (set axis.deduplication = false), because echarts do not know whether\n// the values in the category dimension has duplication (consider the\n// parallel-aqi example)\nif(needCollect&&!this._deduplication){index=this.categories.length;this.categories[index]=category;return index;}var map$$1=getOrCreateMap(this);index=map$$1.get(category);if(index==null){if(needCollect){index=this.categories.length;this.categories[index]=category;map$$1.set(category,index);}else{index=NaN;}}return index;};// Consider big data, do not create map until needed.\nfunction getOrCreateMap(ordinalMeta){return ordinalMeta._map||(ordinalMeta._map=createHashMap(ordinalMeta.categories));}function getName(obj){if(isObject$1(obj)&&obj.value!=null){return obj.value;}else{return obj+'';}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Linear continuous scale\n * @module echarts/coord/scale/Ordinal\n *\n * http://en.wikipedia.org/wiki/Level_of_measurement\n */ // FIXME only one data\nvar scaleProto=Scale.prototype;var OrdinalScale=Scale.extend({type:'ordinal',/**\n * @param {module:echarts/data/OrdianlMeta|Array.} ordinalMeta\n */init:function init(ordinalMeta,extent){// Caution: Should not use instanceof, consider ec-extensions using\n// import approach to get OrdinalMeta class.\nif(!ordinalMeta||isArray(ordinalMeta)){ordinalMeta=new OrdinalMeta({categories:ordinalMeta});}this._ordinalMeta=ordinalMeta;this._extent=extent||[0,ordinalMeta.categories.length-1];},parse:function parse(val){return typeof val==='string'?this._ordinalMeta.getOrdinal(val)// val might be float.\n:Math.round(val);},contain:function contain(rank){rank=this.parse(rank);return scaleProto.contain.call(this,rank)&&this._ordinalMeta.categories[rank]!=null;},/**\n * Normalize given rank or name to linear [0, 1]\n * @param {number|string} [val]\n * @return {number}\n */normalize:function normalize(val){return scaleProto.normalize.call(this,this.parse(val));},scale:function scale(val){return Math.round(scaleProto.scale.call(this,val));},/**\n * @return {Array}\n */getTicks:function getTicks(){var ticks=[];var extent=this._extent;var rank=extent[0];while(rank<=extent[1]){ticks.push(rank);rank++;}return ticks;},/**\n * Get item on rank n\n * @param {number} n\n * @return {string}\n */getLabel:function getLabel(n){if(!this.isBlank()){// Note that if no data, ordinalMeta.categories is an empty array.\nreturn this._ordinalMeta.categories[n];}},/**\n * @return {number}\n */count:function count(){return this._extent[1]-this._extent[0]+1;},/**\n * @override\n */unionExtentFromData:function unionExtentFromData(data,dim){this.unionExtent(data.getApproximateExtent(dim));},getOrdinalMeta:function getOrdinalMeta(){return this._ordinalMeta;},niceTicks:noop,niceExtent:noop});/**\n * @return {module:echarts/scale/Time}\n */OrdinalScale.create=function(){return new OrdinalScale();};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * For testable.\n */var roundNumber$1=round$1;/**\n * @param {Array.} extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param {number} splitNumber splitNumber should be >= 1.\n * @param {number} [minInterval]\n * @param {number} [maxInterval]\n * @return {Object} {interval, intervalPrecision, niceTickExtent}\n */function intervalScaleNiceTicks(extent,splitNumber,minInterval,maxInterval){var result={};var span=extent[1]-extent[0];var interval=result.interval=nice(span/splitNumber,true);if(minInterval!=null&&intervalmaxInterval){interval=result.interval=maxInterval;}// Tow more digital for tick.\nvar precision=result.intervalPrecision=getIntervalPrecision(interval);// Niced extent inside original extent\nvar niceTickExtent=result.niceTickExtent=[roundNumber$1(Math.ceil(extent[0]/interval)*interval,precision),roundNumber$1(Math.floor(extent[1]/interval)*interval,precision)];fixExtent(niceTickExtent,extent);return result;}/**\n * @param {number} interval\n * @return {number} interval precision\n */function getIntervalPrecision(interval){// Tow more digital for tick.\nreturn getPrecisionSafe(interval)+2;}function clamp(niceTickExtent,idx,extent){niceTickExtent[idx]=Math.max(Math.min(niceTickExtent[idx],extent[1]),extent[0]);}// In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\nfunction fixExtent(niceTickExtent,extent){!isFinite(niceTickExtent[0])&&(niceTickExtent[0]=extent[0]);!isFinite(niceTickExtent[1])&&(niceTickExtent[1]=extent[1]);clamp(niceTickExtent,0,extent);clamp(niceTickExtent,1,extent);if(niceTickExtent[0]>niceTickExtent[1]){niceTickExtent[0]=niceTickExtent[1];}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Interval scale\n * @module echarts/scale/Interval\n */var roundNumber=round$1;/**\n * @alias module:echarts/coord/scale/Interval\n * @constructor\n */var IntervalScale=Scale.extend({type:'interval',_interval:0,_intervalPrecision:2,setExtent:function setExtent(start,end){var thisExtent=this._extent;//start,end may be a Number like '25',so...\nif(!isNaN(start)){thisExtent[0]=parseFloat(start);}if(!isNaN(end)){thisExtent[1]=parseFloat(end);}},unionExtent:function unionExtent(other){var extent=this._extent;other[0]extent[1]&&(extent[1]=other[1]);// unionExtent may called by it's sub classes\nIntervalScale.prototype.setExtent.call(this,extent[0],extent[1]);},/**\n * Get interval\n */getInterval:function getInterval(){return this._interval;},/**\n * Set interval\n */setInterval:function setInterval(interval){this._interval=interval;// Dropped auto calculated niceExtent and use user setted extent\n// We assume user wan't to set both interval, min, max to get a better result\nthis._niceExtent=this._extent.slice();this._intervalPrecision=getIntervalPrecision(interval);},/**\n * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.\n * @return {Array.}\n */getTicks:function getTicks(expandToNicedExtent){var interval=this._interval;var extent=this._extent;var niceTickExtent=this._niceExtent;var intervalPrecision=this._intervalPrecision;var ticks=[];// If interval is 0, return [];\nif(!interval){return ticks;}// Consider this case: using dataZoom toolbox, zoom and zoom.\nvar safeLimit=10000;if(extent[0]safeLimit){return[];}}// Consider this case: the last item of ticks is smaller\n// than niceTickExtent[1] and niceTickExtent[1] === extent[1].\nvar lastNiceTick=ticks.length?ticks[ticks.length-1]:niceTickExtent[1];if(extent[1]>lastNiceTick){if(expandToNicedExtent){ticks.push(roundNumber(lastNiceTick+interval,intervalPrecision));}else{ticks.push(extent[1]);}}return ticks;},/**\n * @param {number} [splitNumber=5]\n * @return {Array.>}\n */getMinorTicks:function getMinorTicks(splitNumber){var ticks=this.getTicks(true);var minorTicks=[];var extent=this.getExtent();for(var i=1;iextent[0]&&minorTick0){// Ignore 0 delta because they are of the same axis value\nmin=min===null?delta:Math.min(min,delta);}}// Set to null if only have one data\naxisMinGaps[key]=min;}}}return axisMinGaps;}function makeColumnLayout(barSeries){var axisMinGaps=getValueAxesMinGaps(barSeries);var seriesInfoList=[];each$1(barSeries,function(seriesModel){var cartesian=seriesModel.coordinateSystem;var baseAxis=cartesian.getBaseAxis();var axisExtent=baseAxis.getExtent();var bandWidth;if(baseAxis.type==='category'){bandWidth=baseAxis.getBandWidth();}else if(baseAxis.type==='value'||baseAxis.type==='time'){var key=baseAxis.dim+'_'+baseAxis.index;var minGap=axisMinGaps[key];var extentSpan=Math.abs(axisExtent[1]-axisExtent[0]);var scale=baseAxis.scale.getExtent();var scaleSpan=Math.abs(scale[1]-scale[0]);bandWidth=minGap?extentSpan/scaleSpan*minGap:extentSpan;// When there is only one data value\n}else{var data=seriesModel.getData();bandWidth=Math.abs(axisExtent[1]-axisExtent[0])/data.count();}var barWidth=parsePercent$1(seriesModel.get('barWidth'),bandWidth);var barMaxWidth=parsePercent$1(seriesModel.get('barMaxWidth'),bandWidth);var barMinWidth=parsePercent$1(// barMinWidth by default is 1 in cartesian. Because in value axis,\n// the auto-calculated bar width might be less than 1.\nseriesModel.get('barMinWidth')||1,bandWidth);var barGap=seriesModel.get('barGap');var barCategoryGap=seriesModel.get('barCategoryGap');seriesInfoList.push({bandWidth:bandWidth,barWidth:barWidth,barMaxWidth:barMaxWidth,barMinWidth:barMinWidth,barGap:barGap,barCategoryGap:barCategoryGap,axisKey:getAxisKey(baseAxis),stackId:getSeriesStackId(seriesModel)});});return doCalBarWidthAndOffset(seriesInfoList);}function doCalBarWidthAndOffset(seriesInfoList){// Columns info on each category axis. Key is cartesian name\nvar columnsMap={};each$1(seriesInfoList,function(seriesInfo,idx){var axisKey=seriesInfo.axisKey;var bandWidth=seriesInfo.bandWidth;var columnsOnAxis=columnsMap[axisKey]||{bandWidth:bandWidth,remainedWidth:bandWidth,autoWidthCount:0,categoryGap:'20%',gap:'30%',stacks:{}};var stacks=columnsOnAxis.stacks;columnsMap[axisKey]=columnsOnAxis;var stackId=seriesInfo.stackId;if(!stacks[stackId]){columnsOnAxis.autoWidthCount++;}stacks[stackId]=stacks[stackId]||{width:0,maxWidth:0};// Caution: In a single coordinate system, these barGrid attributes\n// will be shared by series. Consider that they have default values,\n// only the attributes set on the last series will work.\n// Do not change this fact unless there will be a break change.\nvar barWidth=seriesInfo.barWidth;if(barWidth&&!stacks[stackId].width){// See #6312, do not restrict width.\nstacks[stackId].width=barWidth;barWidth=Math.min(columnsOnAxis.remainedWidth,barWidth);columnsOnAxis.remainedWidth-=barWidth;}var barMaxWidth=seriesInfo.barMaxWidth;barMaxWidth&&(stacks[stackId].maxWidth=barMaxWidth);var barMinWidth=seriesInfo.barMinWidth;barMinWidth&&(stacks[stackId].minWidth=barMinWidth);var barGap=seriesInfo.barGap;barGap!=null&&(columnsOnAxis.gap=barGap);var barCategoryGap=seriesInfo.barCategoryGap;barCategoryGap!=null&&(columnsOnAxis.categoryGap=barCategoryGap);});var result={};each$1(columnsMap,function(columnsOnAxis,coordSysName){result[coordSysName]={};var stacks=columnsOnAxis.stacks;var bandWidth=columnsOnAxis.bandWidth;var categoryGap=parsePercent$1(columnsOnAxis.categoryGap,bandWidth);var barGapPercent=parsePercent$1(columnsOnAxis.gap,1);var remainedWidth=columnsOnAxis.remainedWidth;var autoWidthCount=columnsOnAxis.autoWidthCount;var autoWidth=(remainedWidth-categoryGap)/(autoWidthCount+(autoWidthCount-1)*barGapPercent);autoWidth=Math.max(autoWidth,0);// Find if any auto calculated bar exceeded maxBarWidth\neach$1(stacks,function(column){var maxWidth=column.maxWidth;var minWidth=column.minWidth;if(!column.width){var finalWidth=autoWidth;if(maxWidth&&maxWidthfinalWidth){finalWidth=minWidth;}if(finalWidth!==autoWidth){column.width=finalWidth;remainedWidth-=finalWidth+barGapPercent*finalWidth;autoWidthCount--;}}else{// `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n// CSS does. Becuase barWidth can be a percent value, where\n// `barMaxWidth` can be used to restrict the final width.\nvar finalWidth=column.width;if(maxWidth){finalWidth=Math.min(finalWidth,maxWidth);}// `minWidth` has higher priority, as described above\nif(minWidth){finalWidth=Math.max(finalWidth,minWidth);}column.width=finalWidth;remainedWidth-=finalWidth+barGapPercent*finalWidth;autoWidthCount--;}});// Recalculate width again\nautoWidth=(remainedWidth-categoryGap)/(autoWidthCount+(autoWidthCount-1)*barGapPercent);autoWidth=Math.max(autoWidth,0);var widthSum=0;var lastColumn;each$1(stacks,function(column,idx){if(!column.width){column.width=autoWidth;}lastColumn=column;widthSum+=column.width*(1+barGapPercent);});if(lastColumn){widthSum-=lastColumn.width*barGapPercent;}var offset=-widthSum/2;each$1(stacks,function(column,stackId){result[coordSysName][stackId]=result[coordSysName][stackId]||{bandWidth:bandWidth,offset:offset,width:column.width};offset+=column.width*(1+barGapPercent);});});return result;}/**\n * @param {Object} barWidthAndOffset The result of makeColumnLayout\n * @param {module:echarts/coord/Axis} axis\n * @param {module:echarts/model/Series} [seriesModel] If not provided, return all.\n * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided.\n */function retrieveColumnLayout(barWidthAndOffset,axis,seriesModel){if(barWidthAndOffset&&axis){var result=barWidthAndOffset[getAxisKey(axis)];if(result!=null&&seriesModel!=null){result=result[getSeriesStackId(seriesModel)];}return result;}}/**\n * @param {string} seriesType\n * @param {module:echarts/model/Global} ecModel\n */function layout(seriesType,ecModel){var seriesModels=prepareLayoutBarSeries(seriesType,ecModel);var barWidthAndOffset=makeColumnLayout(seriesModels);var lastStackCoords={};each$1(seriesModels,function(seriesModel){var data=seriesModel.getData();var cartesian=seriesModel.coordinateSystem;var baseAxis=cartesian.getBaseAxis();var stackId=getSeriesStackId(seriesModel);var columnLayoutInfo=barWidthAndOffset[getAxisKey(baseAxis)][stackId];var columnOffset=columnLayoutInfo.offset;var columnWidth=columnLayoutInfo.width;var valueAxis=cartesian.getOtherAxis(baseAxis);var barMinHeight=seriesModel.get('barMinHeight')||0;lastStackCoords[stackId]=lastStackCoords[stackId]||[];data.setLayout({bandWidth:columnLayoutInfo.bandWidth,offset:columnOffset,size:columnWidth});var valueDim=data.mapDimension(valueAxis.dim);var baseDim=data.mapDimension(baseAxis.dim);var stacked=isDimensionStacked(data,valueDim/*, baseDim*/);var isValueAxisH=valueAxis.isHorizontal();var valueAxisStart=getValueAxisStart(baseAxis,valueAxis,stacked);for(var idx=0,len=data.count();idx=0?'p':'n';var baseCoord=valueAxisStart;// Because of the barMinHeight, we can not use the value in\n// stackResultDimension directly.\nif(stacked){// Only ordinal axis can be stacked.\nif(!lastStackCoords[stackId][baseValue]){lastStackCoords[stackId][baseValue]={p:valueAxisStart,// Positive stack\nn:valueAxisStart// Negative stack\n};}// Should also consider #4243\nbaseCoord=lastStackCoords[stackId][baseValue][sign];}var x;var y;var width;var height;if(isValueAxisH){var coord=cartesian.dataToPoint([value,baseValue]);x=baseCoord;y=coord[1]+columnOffset;width=coord[0]-valueAxisStart;height=columnWidth;if(Math.abs(width)LARGE_BAR_MIN_WIDTH)){// jshint ignore:line\nbarWidth=LARGE_BAR_MIN_WIDTH;}return{progress:progress};function progress(params,data){var count=params.count;var largePoints=new LargeArr(count*2);var largeBackgroundPoints=new LargeArr(count*2);var largeDataIndices=new LargeArr(count);var dataIndex;var coord=[];var valuePair=[];var pointsOffset=0;var idxOffset=0;while((dataIndex=params.next())!=null){valuePair[valueDimIdx]=data.get(valueDim,dataIndex);valuePair[1-valueDimIdx]=data.get(baseDim,dataIndex);coord=cartesian.dataToPoint(valuePair,null,coord);// Data index might not be in order, depends on `progressiveChunkMode`.\nlargeBackgroundPoints[pointsOffset]=valueAxisHorizontal?coordLayout.x+coordLayout.width:coord[0];largePoints[pointsOffset++]=coord[0];largeBackgroundPoints[pointsOffset]=valueAxisHorizontal?coord[1]:coordLayout.y+coordLayout.height;largePoints[pointsOffset++]=coord[1];largeDataIndices[idxOffset++]=dataIndex;}data.setLayout({largePoints:largePoints,largeDataIndices:largeDataIndices,largeBackgroundPoints:largeBackgroundPoints,barWidth:barWidth,valueAxisStart:getValueAxisStart(baseAxis,valueAxis,false),backgroundStart:valueAxisHorizontal?coordLayout.x:coordLayout.y,valueAxisHorizontal:valueAxisHorizontal});}}};function isOnCartesian(seriesModel){return seriesModel.coordinateSystem&&seriesModel.coordinateSystem.type==='cartesian2d';}function isInLargeMode(seriesModel){return seriesModel.pipelineContext&&seriesModel.pipelineContext.large;}// See cases in `test/bar-start.html` and `#7412`, `#8747`.\nfunction getValueAxisStart(baseAxis,valueAxis,stacked){return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type==='log'?1:0));}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* A third-party license is embeded for some of the code in this file:\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\n* ).\n*/ // [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design have\n// concidered these common case:\n// (1) Time that is persistent in server is in UTC, but it is needed to be diplayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\nvar intervalScaleProto=IntervalScale.prototype;var mathCeil=Math.ceil;var mathFloor=Math.floor;var ONE_SECOND=1000;var ONE_MINUTE=ONE_SECOND*60;var ONE_HOUR=ONE_MINUTE*60;var ONE_DAY=ONE_HOUR*24;// FIXME 公用?\nvar bisect=function bisect(a,x,lo,hi){while(lo>>1;if(a[mid][1]maxInterval){approxInterval=maxInterval;}var scaleLevelsLen=scaleLevels.length;var idx=bisect(scaleLevels,approxInterval,0,scaleLevelsLen);var level=scaleLevels[Math.min(idx,scaleLevelsLen-1)];var interval=level[1];// Same with interval scale if span is much larger than 1 year\nif(level[0]==='year'){var yearSpan=span/interval;// From \"Nice Numbers for Graph Labels\" of Graphic Gems\n// var niceYearSpan = numberUtil.nice(yearSpan, false);\nvar yearStep=nice(yearSpan/approxTickNum,true);interval*=yearStep;}var timezoneOffset=this.getSetting('useUTC')?0:new Date(+extent[0]||+extent[1]).getTimezoneOffset()*60*1000;var niceExtent=[Math.round(mathCeil((extent[0]-timezoneOffset)/interval)*interval+timezoneOffset),Math.round(mathFloor((extent[1]-timezoneOffset)/interval)*interval+timezoneOffset)];fixExtent(niceExtent,extent);this._stepLvl=level;// Interval will be used in getTicks\nthis._interval=interval;this._niceExtent=niceExtent;},parse:function parse(val){// val might be float.\nreturn+parseDate(val);}});each$1(['contain','normalize'],function(methodName){TimeScale.prototype[methodName]=function(val){return intervalScaleProto[methodName].call(this,this.parse(val));};});/**\n * This implementation was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */var scaleLevels=[// Format interval\n['hh:mm:ss',ONE_SECOND],// 1s\n['hh:mm:ss',ONE_SECOND*5],// 5s\n['hh:mm:ss',ONE_SECOND*10],// 10s\n['hh:mm:ss',ONE_SECOND*15],// 15s\n['hh:mm:ss',ONE_SECOND*30],// 30s\n['hh:mm\\nMM-dd',ONE_MINUTE],// 1m\n['hh:mm\\nMM-dd',ONE_MINUTE*5],// 5m\n['hh:mm\\nMM-dd',ONE_MINUTE*10],// 10m\n['hh:mm\\nMM-dd',ONE_MINUTE*15],// 15m\n['hh:mm\\nMM-dd',ONE_MINUTE*30],// 30m\n['hh:mm\\nMM-dd',ONE_HOUR],// 1h\n['hh:mm\\nMM-dd',ONE_HOUR*2],// 2h\n['hh:mm\\nMM-dd',ONE_HOUR*6],// 6h\n['hh:mm\\nMM-dd',ONE_HOUR*12],// 12h\n['MM-dd\\nyyyy',ONE_DAY],// 1d\n['MM-dd\\nyyyy',ONE_DAY*2],// 2d\n['MM-dd\\nyyyy',ONE_DAY*3],// 3d\n['MM-dd\\nyyyy',ONE_DAY*4],// 4d\n['MM-dd\\nyyyy',ONE_DAY*5],// 5d\n['MM-dd\\nyyyy',ONE_DAY*6],// 6d\n['week',ONE_DAY*7],// 7d\n['MM-dd\\nyyyy',ONE_DAY*10],// 10d\n['week',ONE_DAY*14],// 2w\n['week',ONE_DAY*21],// 3w\n['month',ONE_DAY*31],// 1M\n['week',ONE_DAY*42],// 6w\n['month',ONE_DAY*62],// 2M\n['week',ONE_DAY*70],// 10w\n['quarter',ONE_DAY*95],// 3M\n['month',ONE_DAY*31*4],// 4M\n['month',ONE_DAY*31*5],// 5M\n['half-year',ONE_DAY*380/2],// 6M\n['month',ONE_DAY*31*8],// 8M\n['month',ONE_DAY*31*10],// 10M\n['year',ONE_DAY*380]// 1Y\n];/**\n * @param {module:echarts/model/Model}\n * @return {module:echarts/scale/Time}\n */TimeScale.create=function(model){return new TimeScale({useUTC:model.ecModel.get('useUTC')});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Log scale\n * @module echarts/scale/Log\n */ // Use some method of IntervalScale\nvar scaleProto$1=Scale.prototype;var intervalScaleProto$1=IntervalScale.prototype;var getPrecisionSafe$1=getPrecisionSafe;var roundingErrorFix=round$1;var mathFloor$1=Math.floor;var mathCeil$1=Math.ceil;var mathPow$1=Math.pow;var mathLog=Math.log;var LogScale=Scale.extend({type:'log',base:10,$constructor:function $constructor(){Scale.apply(this,arguments);this._originalScale=new IntervalScale();},/**\n * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.\n * @return {Array.}\n */getTicks:function getTicks(expandToNicedExtent){var originalScale=this._originalScale;var extent=this._extent;var originalExtent=originalScale.getExtent();return map(intervalScaleProto$1.getTicks.call(this,expandToNicedExtent),function(val){var powVal=round$1(mathPow$1(this.base,val));// Fix #4158\npowVal=val===extent[0]&&originalScale.__fixMin?fixRoundingError(powVal,originalExtent[0]):powVal;powVal=val===extent[1]&&originalScale.__fixMax?fixRoundingError(powVal,originalExtent[1]):powVal;return powVal;},this);},/**\n * @param {number} splitNumber\n * @return {Array.>}\n */getMinorTicks:intervalScaleProto$1.getMinorTicks,/**\n * @param {number} val\n * @return {string}\n */getLabel:intervalScaleProto$1.getLabel,/**\n * @param {number} val\n * @return {number}\n */scale:function scale(val){val=scaleProto$1.scale.call(this,val);return mathPow$1(this.base,val);},/**\n * @param {number} start\n * @param {number} end\n */setExtent:function setExtent(start,end){var base=this.base;start=mathLog(start)/mathLog(base);end=mathLog(end)/mathLog(base);intervalScaleProto$1.setExtent.call(this,start,end);},/**\n * @return {number} end\n */getExtent:function getExtent(){var base=this.base;var extent=scaleProto$1.getExtent.call(this);extent[0]=mathPow$1(base,extent[0]);extent[1]=mathPow$1(base,extent[1]);// Fix #4158\nvar originalScale=this._originalScale;var originalExtent=originalScale.getExtent();originalScale.__fixMin&&(extent[0]=fixRoundingError(extent[0],originalExtent[0]));originalScale.__fixMax&&(extent[1]=fixRoundingError(extent[1],originalExtent[1]));return extent;},/**\n * @param {Array.} extent\n */unionExtent:function unionExtent(extent){this._originalScale.unionExtent(extent);var base=this.base;extent[0]=mathLog(extent[0])/mathLog(base);extent[1]=mathLog(extent[1])/mathLog(base);scaleProto$1.unionExtent.call(this,extent);},/**\n * @override\n */unionExtentFromData:function unionExtentFromData(data,dim){// TODO\n// filter value that <= 0\nthis.unionExtent(data.getApproximateExtent(dim));},/**\n * Update interval and extent of intervals for nice ticks\n * @param {number} [approxTickNum = 10] Given approx tick number\n */niceTicks:function niceTicks(approxTickNum){approxTickNum=approxTickNum||10;var extent=this._extent;var span=extent[1]-extent[0];if(span===Infinity||span<=0){return;}var interval=quantity(span);var err=approxTickNum/span*interval;// Filter ticks to get closer to the desired count.\nif(err<=0.5){interval*=10;}// Interval should be integer\nwhile(!isNaN(interval)&&Math.abs(interval)<1&&Math.abs(interval)>0){interval*=10;}var niceExtent=[round$1(mathCeil$1(extent[0]/interval)*interval),round$1(mathFloor$1(extent[1]/interval)*interval)];this._interval=interval;this._niceExtent=niceExtent;},/**\n * Nice extent.\n * @override\n */niceExtent:function niceExtent(opt){intervalScaleProto$1.niceExtent.call(this,opt);var originalScale=this._originalScale;originalScale.__fixMin=opt.fixMin;originalScale.__fixMax=opt.fixMax;}});each$1(['contain','normalize'],function(methodName){LogScale.prototype[methodName]=function(val){val=mathLog(val)/mathLog(this.base);return scaleProto$1[methodName].call(this,val);};});LogScale.create=function(){return new LogScale();};function fixRoundingError(val,originalVal){return roundingErrorFix(val,getPrecisionSafe$1(originalVal));}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n */function getScaleExtent(scale,model){var scaleType=scale.type;var min=model.getMin();var max=model.getMax();var originalExtent=scale.getExtent();var axisDataLen;var boundaryGap;var span;if(scaleType==='ordinal'){axisDataLen=model.getCategories().length;}else{boundaryGap=model.get('boundaryGap');if(!isArray(boundaryGap)){boundaryGap=[boundaryGap||0,boundaryGap||0];}if(typeof boundaryGap[0]==='boolean'){if(__DEV__){console.warn('Boolean type for boundaryGap is only '+'allowed for ordinal axis. Please use string in '+'percentage instead, e.g., \"20%\". Currently, '+'boundaryGap is set to be 0.');}boundaryGap=[0,0];}boundaryGap[0]=parsePercent$1(boundaryGap[0],1);boundaryGap[1]=parsePercent$1(boundaryGap[1],1);span=originalExtent[1]-originalExtent[0]||Math.abs(originalExtent[0]);}// Notice: When min/max is not set (that is, when there are null/undefined,\n// which is the most common case), these cases should be ensured:\n// (1) For 'ordinal', show all axis.data.\n// (2) For others:\n// + `boundaryGap` is applied (if min/max set, boundaryGap is\n// disabled).\n// + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n// be the result that originalExtent enlarged by boundaryGap.\n// (3) If no data, it should be ensured that `scale.setBlank` is set.\n// FIXME\n// (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n// (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n// that the results processed by boundaryGap are positive/negative?\nif(min==='dataMin'){min=originalExtent[0];}else if(typeof min==='function'){min=min({min:originalExtent[0],max:originalExtent[1]});}if(max==='dataMax'){max=originalExtent[1];}else if(typeof max==='function'){max=max({min:originalExtent[0],max:originalExtent[1]});}var fixMin=min!=null;var fixMax=max!=null;if(min==null){min=scaleType==='ordinal'?axisDataLen?0:NaN:originalExtent[0]-boundaryGap[0]*span;}if(max==null){max=scaleType==='ordinal'?axisDataLen?axisDataLen-1:NaN:originalExtent[1]+boundaryGap[1]*span;}(min==null||!isFinite(min))&&(min=NaN);(max==null||!isFinite(max))&&(max=NaN);scale.setBlank(eqNaN(min)||eqNaN(max)||scaleType==='ordinal'&&!scale.getOrdinalMeta().categories.length);// Evaluate if axis needs cross zero\nif(model.getNeedCrossZero()){// Axis is over zero and min is not set\nif(min>0&&max>0&&!fixMin){min=0;}// Axis is under zero and max is not set\nif(min<0&&max<0&&!fixMax){max=0;}}// If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n// is base axis\n// FIXME\n// (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n// (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n// Should not depend on series type `bar`?\n// (3) Fix that might overlap when using dataZoom.\n// (4) Consider other chart types using `barGrid`?\n// See #6728, #4862, `test/bar-overflow-time-plot.html`\nvar ecModel=model.ecModel;if(ecModel&&scaleType==='time'/*|| scaleType === 'interval' */){var barSeriesModels=prepareLayoutBarSeries('bar',ecModel);var isBaseAxisAndHasBarSeries;each$1(barSeriesModels,function(seriesModel){isBaseAxisAndHasBarSeries|=seriesModel.getBaseAxis()===model.axis;});if(isBaseAxisAndHasBarSeries){// Calculate placement of bars on axis\nvar barWidthAndOffset=makeColumnLayout(barSeriesModels);// Adjust axis min and max to account for overflow\nvar adjustedScale=adjustScaleForOverflow(min,max,model,barWidthAndOffset);min=adjustedScale.min;max=adjustedScale.max;}}return{extent:[min,max],// \"fix\" means \"fixed\", the value should not be\n// changed in the subsequent steps.\nfixMin:fixMin,fixMax:fixMax};}function adjustScaleForOverflow(min,max,model,barWidthAndOffset){// Get Axis Length\nvar axisExtent=model.axis.getExtent();var axisLength=axisExtent[1]-axisExtent[0];// Get bars on current base axis and calculate min and max overflow\nvar barsOnCurrentAxis=retrieveColumnLayout(barWidthAndOffset,model.axis);if(barsOnCurrentAxis===undefined){return{min:min,max:max};}var minOverflow=Infinity;each$1(barsOnCurrentAxis,function(item){minOverflow=Math.min(item.offset,minOverflow);});var maxOverflow=-Infinity;each$1(barsOnCurrentAxis,function(item){maxOverflow=Math.max(item.offset+item.width,maxOverflow);});minOverflow=Math.abs(minOverflow);maxOverflow=Math.abs(maxOverflow);var totalOverFlow=minOverflow+maxOverflow;// Calulate required buffer based on old range and overflow\nvar oldRange=max-min;var oldRangePercentOfNew=1-(minOverflow+maxOverflow)/axisLength;var overflowBuffer=oldRange/oldRangePercentOfNew-oldRange;max+=overflowBuffer*(maxOverflow/totalOverFlow);min-=overflowBuffer*(minOverflow/totalOverFlow);return{min:min,max:max};}function niceScaleExtent(scale,model){var extentInfo=getScaleExtent(scale,model);var extent=extentInfo.extent;var splitNumber=model.get('splitNumber');if(scale.type==='log'){scale.base=model.get('logBase');}var scaleType=scale.type;scale.setExtent(extent[0],extent[1]);scale.niceExtent({splitNumber:splitNumber,fixMin:extentInfo.fixMin,fixMax:extentInfo.fixMax,minInterval:scaleType==='interval'||scaleType==='time'?model.get('minInterval'):null,maxInterval:scaleType==='interval'||scaleType==='time'?model.get('maxInterval'):null});// If some one specified the min, max. And the default calculated interval\n// is not good enough. He can specify the interval. It is often appeared\n// in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n// to be 60.\n// FIXME\nvar interval=model.get('interval');if(interval!=null){scale.setInterval&&scale.setInterval(interval);}}/**\n * @param {module:echarts/model/Model} model\n * @param {string} [axisType] Default retrieve from model.type\n * @return {module:echarts/scale/*}\n */function createScaleByModel(model,axisType){axisType=axisType||model.get('type');if(axisType){switch(axisType){// Buildin scale\ncase'category':return new OrdinalScale(model.getOrdinalMeta?model.getOrdinalMeta():model.getCategories(),[Infinity,-Infinity]);case'value':return new IntervalScale();// Extended scale, like time and log\ndefault:return(Scale.getClass(axisType)||IntervalScale).create(model);}}}/**\n * Check if the axis corss 0\n */function ifAxisCrossZero(axis){var dataExtent=axis.scale.getExtent();var min=dataExtent[0];var max=dataExtent[1];return!(min>0&&max>0||min<0&&max<0);}/**\n * @param {module:echarts/coord/Axis} axis\n * @return {Function} Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not requied.\n * return: {string} label string.\n */function makeLabelFormatter(axis){var labelFormatter=axis.getLabelModel().get('formatter');var categoryTickStart=axis.type==='category'?axis.scale.getExtent()[0]:null;if(typeof labelFormatter==='string'){labelFormatter=function(tpl){return function(val){// For category axis, get raw value; for numeric axis,\n// get foramtted label like '1,333,444'.\nval=axis.scale.getLabel(val);return tpl.replace('{value}',val!=null?val:'');};}(labelFormatter);// Consider empty array\nreturn labelFormatter;}else if(typeof labelFormatter==='function'){return function(tickValue,idx){// The original intention of `idx` is \"the index of the tick in all ticks\".\n// But the previous implementation of category axis do not consider the\n// `axisLabel.interval`, which cause that, for example, the `interval` is\n// `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n// corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n// the definition here for back compatibility.\nif(categoryTickStart!=null){idx=tickValue-categoryTickStart;}return labelFormatter(getAxisRawValue(axis,tickValue),idx);};}else{return function(tick){return axis.scale.getLabel(tick);};}}function getAxisRawValue(axis,value){// In category axis with data zoom, tick is not the original\n// index of axis.data. So tick should not be exposed to user\n// in category axis.\nreturn axis.type==='category'?axis.scale.getLabel(value):value;}/**\n * @param {module:echarts/coord/Axis} axis\n * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels.\n */function estimateLabelUnionRect(axis){var axisModel=axis.model;var scale=axis.scale;if(!axisModel.get('axisLabel.show')||scale.isBlank()){return;}var isCategory=axis.type==='category';var realNumberScaleTicks;var tickCount;var categoryScaleExtent=scale.getExtent();// Optimize for large category data, avoid call `getTicks()`.\nif(isCategory){tickCount=scale.count();}else{realNumberScaleTicks=scale.getTicks();tickCount=realNumberScaleTicks.length;}var axisLabelModel=axis.getLabelModel();var labelFormatter=makeLabelFormatter(axis);var rect;var step=1;// Simple optimization for large amount of labels\nif(tickCount>40){step=Math.ceil(tickCount/40);}for(var i=0;i}\n */var symbolCtors={line:Line,rect:Rect,roundRect:Rect,square:Rect,circle:Circle,diamond:Diamond,pin:Pin,arrow:Arrow,triangle:Triangle};var symbolShapeMakers={line:function line(x,y,w,h,shape){// FIXME\nshape.x1=x;shape.y1=y+h/2;shape.x2=x+w;shape.y2=y+h/2;},rect:function rect(x,y,w,h,shape){shape.x=x;shape.y=y;shape.width=w;shape.height=h;},roundRect:function roundRect(x,y,w,h,shape){shape.x=x;shape.y=y;shape.width=w;shape.height=h;shape.r=Math.min(w,h)/4;},square:function square(x,y,w,h,shape){var size=Math.min(w,h);shape.x=x;shape.y=y;shape.width=size;shape.height=size;},circle:function circle(x,y,w,h,shape){// Put circle in the center of square\nshape.cx=x+w/2;shape.cy=y+h/2;shape.r=Math.min(w,h)/2;},diamond:function diamond(x,y,w,h,shape){shape.cx=x+w/2;shape.cy=y+h/2;shape.width=w;shape.height=h;},pin:function pin(x,y,w,h,shape){shape.x=x+w/2;shape.y=y+h/2;shape.width=w;shape.height=h;},arrow:function arrow(x,y,w,h,shape){shape.x=x+w/2;shape.y=y+h/2;shape.width=w;shape.height=h;},triangle:function triangle(x,y,w,h,shape){shape.cx=x+w/2;shape.cy=y+h/2;shape.width=w;shape.height=h;}};var symbolBuildProxies={};each$1(symbolCtors,function(Ctor,name){symbolBuildProxies[name]=new Ctor();});var SymbolClz=extendShape({type:'symbol',shape:{symbolType:'',x:0,y:0,width:0,height:0},calculateTextPosition:function calculateTextPosition(out,style,rect){var res=_calculateTextPosition(out,style,rect);var shape=this.shape;if(shape&&shape.symbolType==='pin'&&style.textPosition==='inside'){res.y=rect.y+rect.height*0.4;}return res;},buildPath:function buildPath(ctx,shape,inBundle){var symbolType=shape.symbolType;if(symbolType!=='none'){var proxySymbol=symbolBuildProxies[symbolType];if(!proxySymbol){// Default rect\nsymbolType='rect';proxySymbol=symbolBuildProxies[symbolType];}symbolShapeMakers[symbolType](shape.x,shape.y,shape.width,shape.height,proxySymbol.shape);proxySymbol.buildPath(ctx,proxySymbol.shape,inBundle);}}});// Provide setColor helper method to avoid determine if set the fill or stroke outside\nfunction symbolPathSetColor(color,innerColor){if(this.type!=='image'){var symbolStyle=this.style;var symbolShape=this.shape;if(symbolShape&&symbolShape.symbolType==='line'){symbolStyle.stroke=color;}else if(this.__isEmptyBrush){symbolStyle.stroke=color;symbolStyle.fill=innerColor||'#fff';}else{// FIXME 判断图形默认是填充还是描边,使用 onlyStroke ?\nsymbolStyle.fill&&(symbolStyle.fill=color);symbolStyle.stroke&&(symbolStyle.stroke=color);}this.dirty(false);}}/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolType\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h,\n * for path and image only.\n */function createSymbol(symbolType,x,y,w,h,color,keepAspect){// TODO Support image object, DynamicImage.\nvar isEmpty=symbolType.indexOf('empty')===0;if(isEmpty){symbolType=symbolType.substr(5,1).toLowerCase()+symbolType.substr(6);}var symbolPath;if(symbolType.indexOf('image://')===0){symbolPath=makeImage(symbolType.slice(8),new BoundingRect(x,y,w,h),keepAspect?'center':'cover');}else if(symbolType.indexOf('path://')===0){symbolPath=makePath(symbolType.slice(7),{},new BoundingRect(x,y,w,h),keepAspect?'center':'cover');}else{symbolPath=new SymbolClz({shape:{symbolType:symbolType,x:x,y:y,width:w,height:h}});}symbolPath.__isEmptyBrush=isEmpty;symbolPath.setColor=symbolPathSetColor;symbolPath.setColor(color);return symbolPath;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge';\n/**\n * Create a muti dimension List structure from seriesModel.\n * @param {module:echarts/model/Model} seriesModel\n * @return {module:echarts/data/List} list\n */function createList(seriesModel){return createListFromArray(seriesModel.getSource(),seriesModel);}var dataStack$1={isDimensionStacked:isDimensionStacked,enableDataStack:enableDataStack,getStackedDimension:getStackedDimension};/**\n * Create scale\n * @param {Array.} dataExtent\n * @param {Object|module:echarts/Model} option\n */function createScale(dataExtent,option){var axisModel=option;if(!Model.isInstance(option)){axisModel=new Model(option);mixin(axisModel,axisModelCommonMixin);}var scale=createScaleByModel(axisModel);scale.setExtent(dataExtent[0],dataExtent[1]);niceScaleExtent(scale,axisModel);return scale;}/**\n * Mixin common methods to axis model,\n *\n * Inlcude methods\n * `getFormattedLabels() => Array.`\n * `getCategories() => Array.`\n * `getMin(origin: boolean) => number`\n * `getMax(origin: boolean) => number`\n * `getNeedCrossZero() => boolean`\n * `setRange(start: number, end: number)`\n * `resetRange()`\n */function mixinAxisModelCommonMethods(Model$$1){mixin(Model$$1,axisModelCommonMixin);}var helper=(Object.freeze||Object)({createList:createList,getLayoutRect:getLayoutRect,dataStack:dataStack$1,createScale:createScale,mixinAxisModelCommonMethods:mixinAxisModelCommonMethods,completeDimensions:completeDimensions,createDimensions:createDimensions,createSymbol:createSymbol});var EPSILON$3=1e-8;function isAroundEqual$1(a,b){return Math.abs(a-b)} cp\n */function Region(name,geometries,cp){/**\n * @type {string}\n * @readOnly\n */this.name=name;/**\n * @type {Array.}\n * @readOnly\n */this.geometries=geometries;if(!cp){var rect=this.getBoundingRect();cp=[rect.x+rect.width/2,rect.y+rect.height/2];}else{cp=[cp[0],cp[1]];}/**\n * @type {Array.}\n */this.center=cp;}Region.prototype={constructor:Region,properties:null,/**\n * @return {module:zrender/core/BoundingRect}\n */getBoundingRect:function getBoundingRect(){var rect=this._rect;if(rect){return rect;}var MAX_NUMBER=Number.MAX_VALUE;var min$$1=[MAX_NUMBER,MAX_NUMBER];var max$$1=[-MAX_NUMBER,-MAX_NUMBER];var min2=[];var max2=[];var geometries=this.geometries;for(var i=0;i} coord\n * @return {boolean}\n */contain:function contain(coord){var rect=this.getBoundingRect();var geometries=this.geometries;if(!rect.contain(coord[0],coord[1])){return false;}loopGeo:for(var i=0,len$$1=geometries.length;i>1^-(x&1);y=y>>1^-(y&1);// Delta deocding\nx+=prevX;y+=prevY;prevX=x;prevY=y;// Dequantize\nresult.push([x/encodeScale,y/encodeScale]);}return result;}/**\n * @alias module:echarts/coord/geo/parseGeoJson\n * @param {Object} geoJson\n * @param {string} nameProperty\n * @return {module:zrender/container/Group}\n */var parseGeoJSON=function parseGeoJSON(geoJson,nameProperty){decode(geoJson);return map(filter(geoJson.features,function(featureObj){// Output of mapshaper may have geometry null\nreturn featureObj.geometry&&featureObj.properties&&featureObj.geometry.coordinates.length>0;}),function(featureObj){var properties=featureObj.properties;var geo=featureObj.geometry;var coordinates=geo.coordinates;var geometries=[];if(geo.type==='Polygon'){geometries.push({type:'polygon',// According to the GeoJSON specification.\n// First must be exterior, and the rest are all interior(holes).\nexterior:coordinates[0],interiors:coordinates.slice(1)});}if(geo.type==='MultiPolygon'){each$1(coordinates,function(item){if(item[0]){geometries.push({type:'polygon',exterior:item[0],interiors:item.slice(1)});}});}var region=new Region(properties[nameProperty||'name'],geometries,properties.cp);region.properties=properties;return region;});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var inner$6=makeInner();/**\n * @param {module:echats/coord/Axis} axis\n * @return {Object} {\n * labels: [{\n * formattedLabel: string,\n * rawLabel: string,\n * tickValue: number\n * }, ...],\n * labelCategoryInterval: number\n * }\n */function createAxisLabels(axis){// Only ordinal scale support tick interval\nreturn axis.type==='category'?makeCategoryLabels(axis):makeRealNumberLabels(axis);}/**\n * @param {module:echats/coord/Axis} axis\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\n * @return {Object} {\n * ticks: Array.\n * tickCategoryInterval: number\n * }\n */function createAxisTicks(axis,tickModel){// Only ordinal scale support tick interval\nreturn axis.type==='category'?makeCategoryTicks(axis,tickModel):{ticks:axis.scale.getTicks()};}function makeCategoryLabels(axis){var labelModel=axis.getLabelModel();var result=makeCategoryLabelsActually(axis,labelModel);return!labelModel.get('show')||axis.scale.isBlank()?{labels:[],labelCategoryInterval:result.labelCategoryInterval}:result;}function makeCategoryLabelsActually(axis,labelModel){var labelsCache=getListCache(axis,'labels');var optionLabelInterval=getOptionCategoryInterval(labelModel);var result=listCacheGet(labelsCache,optionLabelInterval);if(result){return result;}var labels;var numericLabelInterval;if(isFunction$1(optionLabelInterval)){labels=makeLabelsByCustomizedCategoryInterval(axis,optionLabelInterval);}else{numericLabelInterval=optionLabelInterval==='auto'?makeAutoCategoryInterval(axis):optionLabelInterval;labels=makeLabelsByNumericCategoryInterval(axis,numericLabelInterval);}// Cache to avoid calling interval function repeatly.\nreturn listCacheSet(labelsCache,optionLabelInterval,{labels:labels,labelCategoryInterval:numericLabelInterval});}function makeCategoryTicks(axis,tickModel){var ticksCache=getListCache(axis,'ticks');var optionTickInterval=getOptionCategoryInterval(tickModel);var result=listCacheGet(ticksCache,optionTickInterval);if(result){return result;}var ticks;var tickCategoryInterval;// Optimize for the case that large category data and no label displayed,\n// we should not return all ticks.\nif(!tickModel.get('show')||axis.scale.isBlank()){ticks=[];}if(isFunction$1(optionTickInterval)){ticks=makeLabelsByCustomizedCategoryInterval(axis,optionTickInterval,true);}// Always use label interval by default despite label show. Consider this\n// scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n// labels. `splitLine` and `axisTick` should be consistent in this case.\nelse if(optionTickInterval==='auto'){var labelsResult=makeCategoryLabelsActually(axis,axis.getLabelModel());tickCategoryInterval=labelsResult.labelCategoryInterval;ticks=map(labelsResult.labels,function(labelItem){return labelItem.tickValue;});}else{tickCategoryInterval=optionTickInterval;ticks=makeLabelsByNumericCategoryInterval(axis,tickCategoryInterval,true);}// Cache to avoid calling interval function repeatly.\nreturn listCacheSet(ticksCache,optionTickInterval,{ticks:ticks,tickCategoryInterval:tickCategoryInterval});}function makeRealNumberLabels(axis){var ticks=axis.scale.getTicks();var labelFormatter=makeLabelFormatter(axis);return{labels:map(ticks,function(tickValue,idx){return{formattedLabel:labelFormatter(tickValue,idx),rawLabel:axis.scale.getLabel(tickValue),tickValue:tickValue};})};}// Large category data calculation is performence sensitive, and ticks and label\n// probably be fetched by multiple times. So we cache the result.\n// axis is created each time during a ec process, so we do not need to clear cache.\nfunction getListCache(axis,prop){// Because key can be funciton, and cache size always be small, we use array cache.\nreturn inner$6(axis)[prop]||(inner$6(axis)[prop]=[]);}function listCacheGet(cache,key){for(var i=0;i40){step=Math.max(1,Math.floor(tickCount/40));}var tickValue=ordinalExtent[0];var unitSpan=axis.dataToCoord(tickValue+1)-axis.dataToCoord(tickValue);var unitW=Math.abs(unitSpan*Math.cos(rotation));var unitH=Math.abs(unitSpan*Math.sin(rotation));var maxW=0;var maxH=0;// Caution: Performance sensitive for large category data.\n// Consider dataZoom, we should make appropriate step to avoid O(n) loop.\nfor(;tickValue<=ordinalExtent[1];tickValue+=step){var width=0;var height=0;// Not precise, do not consider align and vertical align\n// and each distance from axis line yet.\nvar rect=_getBoundingRect(labelFormatter(tickValue),params.font,'center','top');// Magic number\nwidth=rect.width*1.3;height=rect.height*1.3;// Min size, void long loop.\nmaxW=Math.max(maxW,width,7);maxH=Math.max(maxH,height,7);}var dw=maxW/unitW;var dh=maxH/unitH;// 0/0 is NaN, 1/0 is Infinity.\nisNaN(dw)&&(dw=Infinity);isNaN(dh)&&(dh=Infinity);var interval=Math.max(0,Math.floor(Math.min(dw,dh)));var cache=inner$6(axis.model);var axisExtent=axis.getExtent();var lastAutoInterval=cache.lastAutoInterval;var lastTickCount=cache.lastTickCount;// Use cache to keep interval stable while moving zoom window,\n// otherwise the calculated interval might jitter when the zoom\n// window size is close to the interval-changing size.\n// For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n// The jitter will cause that sometimes the displayed labels are\n// `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\nif(lastAutoInterval!=null&&lastTickCount!=null&&Math.abs(lastAutoInterval-interval)<=1&&Math.abs(lastTickCount-tickCount)<=1// Always choose the bigger one, otherwise the critical\n// point is not the same when zooming in or zooming out.\n&&lastAutoInterval>interval// If the axis change is caused by chart resize, the cache should not\n// be used. Otherwise some hiden labels might not be shown again.\n&&cache.axisExtend0===axisExtent[0]&&cache.axisExtend1===axisExtent[1]){interval=lastAutoInterval;}// Only update cache if cache not used, otherwise the\n// changing of interval is too insensitive.\nelse{cache.lastTickCount=tickCount;cache.lastAutoInterval=interval;cache.axisExtend0=axisExtent[0];cache.axisExtend1=axisExtent[1];}return interval;}function fetchAutoCategoryIntervalCalculationParams(axis){var labelModel=axis.getLabelModel();return{axisRotate:axis.getRotate?axis.getRotate():axis.isHorizontal&&!axis.isHorizontal()?90:0,labelRotate:labelModel.get('rotate')||0,font:labelModel.getFont()};}function makeLabelsByNumericCategoryInterval(axis,categoryInterval,onlyTick){var labelFormatter=makeLabelFormatter(axis);var ordinalScale=axis.scale;var ordinalExtent=ordinalScale.getExtent();var labelModel=axis.getLabelModel();var result=[];// TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\nvar step=Math.max((categoryInterval||0)+1,1);var startTick=ordinalExtent[0];var tickCount=ordinalScale.count();// Calculate start tick based on zero if possible to keep label consistent\n// while zooming and moving while interval > 0. Otherwise the selection\n// of displayable ticks and symbols probably keep changing.\n// 3 is empirical value.\nif(startTick!==0&&step>1&&tickCount/step>2){startTick=Math.round(Math.ceil(startTick/step)*step);}// (1) Only add min max label here but leave overlap checking\n// to render stage, which also ensure the returned list\n// suitable for splitLine and splitArea rendering.\n// (2) Scales except category always contain min max label so\n// do not need to perform this process.\nvar showAllLabel=shouldShowAllLabels(axis);var includeMinLabel=labelModel.get('showMinLabel')||showAllLabel;var includeMaxLabel=labelModel.get('showMaxLabel')||showAllLabel;if(includeMinLabel&&startTick!==ordinalExtent[0]){addItem(ordinalExtent[0]);}// Optimize: avoid generating large array by `ordinalScale.getTicks()`.\nvar tickValue=startTick;for(;tickValue<=ordinalExtent[1];tickValue+=step){addItem(tickValue);}if(includeMaxLabel&&tickValue-step!==ordinalExtent[1]){addItem(ordinalExtent[1]);}function addItem(tVal){result.push(onlyTick?tVal:{formattedLabel:labelFormatter(tVal),rawLabel:ordinalScale.getLabel(tVal),tickValue:tVal});}return result;}// When interval is function, the result `false` means ignore the tick.\n// It is time consuming for large category data.\nfunction makeLabelsByCustomizedCategoryInterval(axis,categoryInterval,onlyTick){var ordinalScale=axis.scale;var labelFormatter=makeLabelFormatter(axis);var result=[];each$1(ordinalScale.getTicks(),function(tickValue){var rawLabel=ordinalScale.getLabel(tickValue);if(categoryInterval(tickValue,rawLabel)){result.push(onlyTick?tickValue:{formattedLabel:labelFormatter(tickValue),rawLabel:rawLabel,tickValue:tickValue});}});return result;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var NORMALIZED_EXTENT=[0,1];/**\n * Base class of Axis.\n * @constructor\n */var Axis=function Axis(dim,scale,extent){/**\n * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'.\n * @type {string}\n */this.dim=dim;/**\n * Axis scale\n * @type {module:echarts/coord/scale/*}\n */this.scale=scale;/**\n * @type {Array.}\n * @private\n */this._extent=extent||[0,0];/**\n * @type {boolean}\n */this.inverse=false;/**\n * Usually true when axis has a ordinal scale\n * @type {boolean}\n */this.onBand=false;};Axis.prototype={constructor:Axis,/**\n * If axis extent contain given coord\n * @param {number} coord\n * @return {boolean}\n */contain:function contain(coord){var extent=this._extent;var min=Math.min(extent[0],extent[1]);var max=Math.max(extent[0],extent[1]);return coord>=min&&coord<=max;},/**\n * If axis extent contain given data\n * @param {number} data\n * @return {boolean}\n */containData:function containData(data){return this.scale.contain(data);},/**\n * Get coord extent.\n * @return {Array.}\n */getExtent:function getExtent(){return this._extent.slice();},/**\n * Get precision used for formatting\n * @param {Array.} [dataExtent]\n * @return {number}\n */getPixelPrecision:function getPixelPrecision(dataExtent){return _getPixelPrecision(dataExtent||this.scale.getExtent(),this._extent);},/**\n * Set coord extent\n * @param {number} start\n * @param {number} end\n */setExtent:function setExtent(start,end){var extent=this._extent;extent[0]=start;extent[1]=end;},/**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n * @param {number} data\n * @param {boolean} clamp\n * @return {number}\n */dataToCoord:function dataToCoord(data,clamp){var extent=this._extent;var scale=this.scale;data=scale.normalize(data);if(this.onBand&&scale.type==='ordinal'){extent=extent.slice();fixExtentWithBands(extent,scale.count());}return linearMap(data,NORMALIZED_EXTENT,extent,clamp);},/**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n * @param {number} coord\n * @param {boolean} clamp\n * @return {number}\n */coordToData:function coordToData(coord,clamp){var extent=this._extent;var scale=this.scale;if(this.onBand&&scale.type==='ordinal'){extent=extent.slice();fixExtentWithBands(extent,scale.count());}var t=linearMap(coord,extent,NORMALIZED_EXTENT,clamp);return this.scale.scale(t);},/**\n * Convert pixel point to data in axis\n * @param {Array.} point\n * @param {boolean} clamp\n * @return {number} data\n */pointToData:function pointToData(point,clamp){// Should be implemented in derived class if necessary.\n},/**\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n * `axis.getTicksCoords` considers `onBand`, which is used by\n * `boundaryGap:true` of category axis and splitLine and splitArea.\n * @param {Object} [opt]\n * @param {Model} [opt.tickModel=axis.model.getModel('axisTick')]\n * @param {boolean} [opt.clamp] If `true`, the first and the last\n * tick must be at the axis end points. Otherwise, clip ticks\n * that outside the axis extent.\n * @return {Array.} [{\n * coord: ...,\n * tickValue: ...\n * }, ...]\n */getTicksCoords:function getTicksCoords(opt){opt=opt||{};var tickModel=opt.tickModel||this.getTickModel();var result=createAxisTicks(this,tickModel);var ticks=result.ticks;var ticksCoords=map(ticks,function(tickValue){return{coord:this.dataToCoord(tickValue),tickValue:tickValue};},this);var alignWithLabel=tickModel.get('alignWithLabel');fixOnBandTicksCoords(this,ticksCoords,alignWithLabel,opt.clamp);return ticksCoords;},/**\n * @return {Array.>} [{ coord: ..., tickValue: ...}]\n */getMinorTicksCoords:function getMinorTicksCoords(){if(this.scale.type==='ordinal'){// Category axis doesn't support minor ticks\nreturn[];}var minorTickModel=this.model.getModel('minorTick');var splitNumber=minorTickModel.get('splitNumber');// Protection.\nif(!(splitNumber>0&&splitNumber<100)){splitNumber=5;}var minorTicks=this.scale.getMinorTicks(splitNumber);var minorTicksCoords=map(minorTicks,function(minorTicksGroup){return map(minorTicksGroup,function(minorTick){return{coord:this.dataToCoord(minorTick),tickValue:minorTick};},this);},this);return minorTicksCoords;},/**\n * @return {Array.} [{\n * formattedLabel: string,\n * rawLabel: axis.scale.getLabel(tickValue)\n * tickValue: number\n * }, ...]\n */getViewLabels:function getViewLabels(){return createAxisLabels(this).labels;},/**\n * @return {module:echarts/coord/model/Model}\n */getLabelModel:function getLabelModel(){return this.model.getModel('axisLabel');},/**\n * Notice here we only get the default tick model. For splitLine\n * or splitArea, we should pass the splitLineModel or splitAreaModel\n * manually when calling `getTicksCoords`.\n * In GL, this method may be overrided to:\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n * @return {module:echarts/coord/model/Model}\n */getTickModel:function getTickModel(){return this.model.getModel('axisTick');},/**\n * Get width of band\n * @return {number}\n */getBandWidth:function getBandWidth(){var axisExtent=this._extent;var dataExtent=this.scale.getExtent();var len=dataExtent[1]-dataExtent[0]+(this.onBand?1:0);// Fix #2728, avoid NaN when only one data.\nlen===0&&(len=1);var size=Math.abs(axisExtent[1]-axisExtent[0]);return Math.abs(size)/len;},/**\n * @abstract\n * @return {boolean} Is horizontal\n */isHorizontal:null,/**\n * @abstract\n * @return {number} Get axis rotate, by degree.\n */getRotate:null,/**\n * Only be called in category axis.\n * Can be overrided, consider other axes like in 3D.\n * @return {number} Auto interval for cateogry axis tick and label\n */calculateCategoryInterval:function calculateCategoryInterval(){return _calculateCategoryInterval(this);}};function fixExtentWithBands(extent,nTick){var size=extent[1]-extent[0];var len=nTick;var margin=size/len/2;extent[0]+=margin;extent[1]-=margin;}// If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\nfunction fixOnBandTicksCoords(axis,ticksCoords,alignWithLabel,clamp){var ticksLen=ticksCoords.length;if(!axis.onBand||alignWithLabel||!ticksLen){return;}var axisExtent=axis.getExtent();var last;var diffSize;if(ticksLen===1){ticksCoords[0].coord=axisExtent[0];last=ticksCoords[1]={coord:axisExtent[0]};}else{var crossLen=ticksCoords[ticksLen-1].tickValue-ticksCoords[0].tickValue;var shift=(ticksCoords[ticksLen-1].coord-ticksCoords[0].coord)/crossLen;each$1(ticksCoords,function(ticksItem){ticksItem.coord-=shift/2;});var dataExtent=axis.scale.getExtent();diffSize=1+dataExtent[1]-ticksCoords[ticksLen-1].tickValue;last={coord:ticksCoords[ticksLen-1].coord+shift*diffSize};ticksCoords.push(last);}var inverse=axisExtent[0]>axisExtent[1];// Handling clamp.\nif(littleThan(ticksCoords[0].coord,axisExtent[0])){clamp?ticksCoords[0].coord=axisExtent[0]:ticksCoords.shift();}if(clamp&&littleThan(axisExtent[0],ticksCoords[0].coord)){ticksCoords.unshift({coord:axisExtent[0]});}if(littleThan(axisExtent[1],last.coord)){clamp?last.coord=axisExtent[1]:ticksCoords.pop();}if(clamp&&littleThan(last.coord,axisExtent[1])){ticksCoords.push({coord:axisExtent[1]});}function littleThan(a,b){// Avoid rounding error cause calculated tick coord different with extent.\n// It may cause an extra unecessary tick added.\na=round$1(a);b=round$1(b);return inverse?a>b:a} [width, height]\n */var getSymbolSize=SymbolClz$1.getSymbolSize=function(data,idx){var symbolSize=data.getItemVisual(idx,'symbolSize');return symbolSize instanceof Array?symbolSize.slice():[+symbolSize,+symbolSize];};function getScale(symbolSize){return[symbolSize[0]/2,symbolSize[1]/2];}function driftSymbol(dx,dy){this.parent.drift(dx,dy);}symbolProto._createSymbol=function(symbolType,data,idx,symbolSize,keepAspect){// Remove paths created before\nthis.removeAll();var color=data.getItemVisual(idx,'color');// var symbolPath = createSymbol(\n// symbolType, -0.5, -0.5, 1, 1, color\n// );\n// If width/height are set too small (e.g., set to 1) on ios10\n// and macOS Sierra, a circle stroke become a rect, no matter what\n// the scale is set. So we set width/height as 2. See #4150.\nvar symbolPath=createSymbol(symbolType,-1,-1,2,2,color,keepAspect);symbolPath.attr({z2:100,culling:true,scale:getScale(symbolSize)});// Rewrite drift method\nsymbolPath.drift=driftSymbol;this._symbolType=symbolType;this.add(symbolPath);};/**\n * Stop animation\n * @param {boolean} toLastFrame\n */symbolProto.stopSymbolAnimation=function(toLastFrame){this.childAt(0).stopAnimation(toLastFrame);};/**\n * FIXME:\n * Caution: This method breaks the encapsulation of this module,\n * but it indeed brings convenience. So do not use the method\n * unless you detailedly know all the implements of `Symbol`,\n * especially animation.\n *\n * Get symbol path element.\n */symbolProto.getSymbolPath=function(){return this.childAt(0);};/**\n * Get scale(aka, current symbol size).\n * Including the change caused by animation\n */symbolProto.getScale=function(){return this.childAt(0).scale;};/**\n * Highlight symbol\n */symbolProto.highlight=function(){this.childAt(0).trigger('emphasis');};/**\n * Downplay symbol\n */symbolProto.downplay=function(){this.childAt(0).trigger('normal');};/**\n * @param {number} zlevel\n * @param {number} z\n */symbolProto.setZ=function(zlevel,z){var symbolPath=this.childAt(0);symbolPath.zlevel=zlevel;symbolPath.z=z;};symbolProto.setDraggable=function(draggable){var symbolPath=this.childAt(0);symbolPath.draggable=draggable;symbolPath.cursor=draggable?'move':symbolPath.cursor;};/**\n * Update symbol properties\n * @param {module:echarts/data/List} data\n * @param {number} idx\n * @param {Object} [seriesScope]\n * @param {Object} [seriesScope.itemStyle]\n * @param {Object} [seriesScope.hoverItemStyle]\n * @param {Object} [seriesScope.symbolRotate]\n * @param {Object} [seriesScope.symbolOffset]\n * @param {module:echarts/model/Model} [seriesScope.labelModel]\n * @param {module:echarts/model/Model} [seriesScope.hoverLabelModel]\n * @param {boolean} [seriesScope.hoverAnimation]\n * @param {Object} [seriesScope.cursorStyle]\n * @param {module:echarts/model/Model} [seriesScope.itemModel]\n * @param {string} [seriesScope.symbolInnerColor]\n * @param {Object} [seriesScope.fadeIn=false]\n */symbolProto.updateData=function(data,idx,seriesScope){this.silent=false;var symbolType=data.getItemVisual(idx,'symbol')||'circle';var seriesModel=data.hostModel;var symbolSize=getSymbolSize(data,idx);var isInit=symbolType!==this._symbolType;if(isInit){var keepAspect=data.getItemVisual(idx,'symbolKeepAspect');this._createSymbol(symbolType,data,idx,symbolSize,keepAspect);}else{var symbolPath=this.childAt(0);symbolPath.silent=false;updateProps(symbolPath,{scale:getScale(symbolSize)},seriesModel,idx);}this._updateCommon(data,idx,symbolSize,seriesScope);if(isInit){var symbolPath=this.childAt(0);var fadeIn=seriesScope&&seriesScope.fadeIn;var target={scale:symbolPath.scale.slice()};fadeIn&&(target.style={opacity:symbolPath.style.opacity});symbolPath.scale=[0,0];fadeIn&&(symbolPath.style.opacity=0);initProps(symbolPath,target,seriesModel,idx);}this._seriesModel=seriesModel;};// Update common properties\nvar normalStyleAccessPath=['itemStyle'];var emphasisStyleAccessPath=['emphasis','itemStyle'];var normalLabelAccessPath=['label'];var emphasisLabelAccessPath=['emphasis','label'];/**\n * @param {module:echarts/data/List} data\n * @param {number} idx\n * @param {Array.} symbolSize\n * @param {Object} [seriesScope]\n */symbolProto._updateCommon=function(data,idx,symbolSize,seriesScope){var symbolPath=this.childAt(0);var seriesModel=data.hostModel;var color=data.getItemVisual(idx,'color');// Reset style\nif(symbolPath.type!=='image'){symbolPath.useStyle({strokeNoScale:true});}else{symbolPath.setStyle({opacity:1,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});}var itemStyle=seriesScope&&seriesScope.itemStyle;var hoverItemStyle=seriesScope&&seriesScope.hoverItemStyle;var symbolOffset=seriesScope&&seriesScope.symbolOffset;var labelModel=seriesScope&&seriesScope.labelModel;var hoverLabelModel=seriesScope&&seriesScope.hoverLabelModel;var hoverAnimation=seriesScope&&seriesScope.hoverAnimation;var cursorStyle=seriesScope&&seriesScope.cursorStyle;if(!seriesScope||data.hasItemOption){var itemModel=seriesScope&&seriesScope.itemModel?seriesScope.itemModel:data.getItemModel(idx);// Color must be excluded.\n// Because symbol provide setColor individually to set fill and stroke\nitemStyle=itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']);hoverItemStyle=itemModel.getModel(emphasisStyleAccessPath).getItemStyle();symbolOffset=itemModel.getShallow('symbolOffset');labelModel=itemModel.getModel(normalLabelAccessPath);hoverLabelModel=itemModel.getModel(emphasisLabelAccessPath);hoverAnimation=itemModel.getShallow('hoverAnimation');cursorStyle=itemModel.getShallow('cursor');}else{hoverItemStyle=extend({},hoverItemStyle);}var elStyle=symbolPath.style;var symbolRotate=data.getItemVisual(idx,'symbolRotate');symbolPath.attr('rotation',(symbolRotate||0)*Math.PI/180||0);if(symbolOffset){symbolPath.attr('position',[parsePercent$1(symbolOffset[0],symbolSize[0]),parsePercent$1(symbolOffset[1],symbolSize[1])]);}cursorStyle&&symbolPath.attr('cursor',cursorStyle);// PENDING setColor before setStyle!!!\nsymbolPath.setColor(color,seriesScope&&seriesScope.symbolInnerColor);symbolPath.setStyle(itemStyle);var opacity=data.getItemVisual(idx,'opacity');if(opacity!=null){elStyle.opacity=opacity;}var liftZ=data.getItemVisual(idx,'liftZ');var z2Origin=symbolPath.__z2Origin;if(liftZ!=null){if(z2Origin==null){symbolPath.__z2Origin=symbolPath.z2;symbolPath.z2+=liftZ;}}else if(z2Origin!=null){symbolPath.z2=z2Origin;symbolPath.__z2Origin=null;}var useNameLabel=seriesScope&&seriesScope.useNameLabel;setLabelStyle(elStyle,hoverItemStyle,labelModel,hoverLabelModel,{labelFetcher:seriesModel,labelDataIndex:idx,defaultText:getLabelDefaultText,isRectText:true,autoColor:color});// Do not execute util needed.\nfunction getLabelDefaultText(idx,opt){return useNameLabel?data.getName(idx):getDefaultLabel(data,idx);}symbolPath.__symbolOriginalScale=getScale(symbolSize);symbolPath.hoverStyle=hoverItemStyle;symbolPath.highDownOnUpdate=hoverAnimation&&seriesModel.isAnimationEnabled()?highDownOnUpdate:null;setHoverStyle(symbolPath);};function highDownOnUpdate(fromState,toState){// Do not support this hover animation util some scenario required.\n// Animation can only be supported in hover layer when using `el.incremetal`.\nif(this.incremental||this.useHoverLayer){return;}if(toState==='emphasis'){var scale=this.__symbolOriginalScale;var ratio=scale[1]/scale[0];var emphasisOpt={scale:[Math.max(scale[0]*1.1,scale[0]+3),Math.max(scale[1]*1.1,scale[1]+3*ratio)]};// FIXME\n// modify it after support stop specified animation.\n// toState === fromState\n// ? (this.stopAnimation(), this.attr(emphasisOpt))\nthis.animateTo(emphasisOpt,400,'elasticOut');}else if(toState==='normal'){this.animateTo({scale:this.__symbolOriginalScale},400,'elasticOut');}}/**\n * @param {Function} cb\n * @param {Object} [opt]\n * @param {Object} [opt.keepLabel=true]\n */symbolProto.fadeOut=function(cb,opt){var symbolPath=this.childAt(0);// Avoid mistaken hover when fading out\nthis.silent=symbolPath.silent=true;// Not show text when animating\n!(opt&&opt.keepLabel)&&(symbolPath.style.text=null);updateProps(symbolPath,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,cb);};inherits(SymbolClz$1,Group);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @module echarts/chart/helper/SymbolDraw\n */ /**\n * @constructor\n * @alias module:echarts/chart/helper/SymbolDraw\n * @param {module:zrender/graphic/Group} [symbolCtor]\n */function SymbolDraw(symbolCtor){this.group=new Group();this._symbolCtor=symbolCtor||SymbolClz$1;}var symbolDrawProto=SymbolDraw.prototype;function symbolNeedsDraw(data,point,idx,opt){return point&&!isNaN(point[0])&&!isNaN(point[1])&&!(opt.isIgnore&&opt.isIgnore(idx))// We do not set clipShape on group, because it will cut part of\n// the symbol element shape. We use the same clip shape here as\n// the line clip.\n&&!(opt.clipShape&&!opt.clipShape.contain(point[0],point[1]))&&data.getItemVisual(idx,'symbol')!=='none';}/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n * @param {Object} [opt] Or isIgnore\n * @param {Function} [opt.isIgnore]\n * @param {Object} [opt.clipShape]\n */symbolDrawProto.updateData=function(data,opt){opt=normalizeUpdateOpt(opt);var group=this.group;var seriesModel=data.hostModel;var oldData=this._data;var SymbolCtor=this._symbolCtor;var seriesScope=makeSeriesScope(data);// There is no oldLineData only when first rendering or switching from\n// stream mode to normal mode, where previous elements should be removed.\nif(!oldData){group.removeAll();}data.diff(oldData).add(function(newIdx){var point=data.getItemLayout(newIdx);if(symbolNeedsDraw(data,point,newIdx,opt)){var symbolEl=new SymbolCtor(data,newIdx,seriesScope);symbolEl.attr('position',point);data.setItemGraphicEl(newIdx,symbolEl);group.add(symbolEl);}}).update(function(newIdx,oldIdx){var symbolEl=oldData.getItemGraphicEl(oldIdx);var point=data.getItemLayout(newIdx);if(!symbolNeedsDraw(data,point,newIdx,opt)){group.remove(symbolEl);return;}if(!symbolEl){symbolEl=new SymbolCtor(data,newIdx);symbolEl.attr('position',point);}else{symbolEl.updateData(data,newIdx,seriesScope);updateProps(symbolEl,{position:point},seriesModel);}// Add back\ngroup.add(symbolEl);data.setItemGraphicEl(newIdx,symbolEl);}).remove(function(oldIdx){var el=oldData.getItemGraphicEl(oldIdx);el&&el.fadeOut(function(){group.remove(el);});}).execute();this._data=data;};symbolDrawProto.isPersistent=function(){return true;};symbolDrawProto.updateLayout=function(){var data=this._data;if(data){// Not use animation\ndata.eachItemGraphicEl(function(el,idx){var point=data.getItemLayout(idx);el.attr('position',point);});}};symbolDrawProto.incrementalPrepareUpdate=function(data){this._seriesScope=makeSeriesScope(data);this._data=null;this.group.removeAll();};/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n * @param {Object} [opt] Or isIgnore\n * @param {Function} [opt.isIgnore]\n * @param {Object} [opt.clipShape]\n */symbolDrawProto.incrementalUpdate=function(taskParams,data,opt){opt=normalizeUpdateOpt(opt);function updateIncrementalAndHover(el){if(!el.isGroup){el.incremental=el.useHoverLayer=true;}}for(var idx=taskParams.start;idx0){valueStart=extent[0];}// Both negative\nelse if(extent[1]<0){valueStart=extent[1];}// If is one positive, and one negative, onZero shall be true\n}return valueStart;}function getStackedOnPoint(dataCoordInfo,coordSys,data,idx){var value=NaN;if(dataCoordInfo.stacked){value=data.get(data.getCalculationInfo('stackedOverDimension'),idx);}if(isNaN(value)){value=dataCoordInfo.valueStart;}var baseDataOffset=dataCoordInfo.baseDataOffset;var stackedData=[];stackedData[baseDataOffset]=data.get(dataCoordInfo.baseDim,idx);stackedData[1-baseDataOffset]=value;return coordSys.dataToPoint(stackedData);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // var arrayDiff = require('zrender/src/core/arrayDiff');\n// 'zrender/src/core/arrayDiff' has been used before, but it did\n// not do well in performance when roam with fixed dataZoom window.\n// function convertToIntId(newIdList, oldIdList) {\n// // Generate int id instead of string id.\n// // Compare string maybe slow in score function of arrDiff\n// // Assume id in idList are all unique\n// var idIndicesMap = {};\n// var idx = 0;\n// for (var i = 0; i < newIdList.length; i++) {\n// idIndicesMap[newIdList[i]] = idx;\n// newIdList[i] = idx++;\n// }\n// for (var i = 0; i < oldIdList.length; i++) {\n// var oldId = oldIdList[i];\n// // Same with newIdList\n// if (idIndicesMap[oldId]) {\n// oldIdList[i] = idIndicesMap[oldId];\n// }\n// else {\n// oldIdList[i] = idx++;\n// }\n// }\n// }\nfunction diffData(oldData,newData){var diffResult=[];newData.diff(oldData).add(function(idx){diffResult.push({cmd:'+',idx:idx});}).update(function(newIdx,oldIdx){diffResult.push({cmd:'=',idx:oldIdx,idx1:newIdx});}).remove(function(idx){diffResult.push({cmd:'-',idx:idx});}).execute();return diffResult;}var lineAnimationDiff=function lineAnimationDiff(oldData,newData,oldStackedOnPoints,newStackedOnPoints,oldCoordSys,newCoordSys,oldValueOrigin,newValueOrigin){var diff=diffData(oldData,newData);// var newIdList = newData.mapArray(newData.getId);\n// var oldIdList = oldData.mapArray(oldData.getId);\n// convertToIntId(newIdList, oldIdList);\n// // FIXME One data ?\n// diff = arrayDiff(oldIdList, newIdList);\nvar currPoints=[];var nextPoints=[];// Points for stacking base line\nvar currStackedPoints=[];var nextStackedPoints=[];var status=[];var sortedIndices=[];var rawIndices=[];var newDataOldCoordInfo=prepareDataCoordInfo(oldCoordSys,newData,oldValueOrigin);var oldDataNewCoordInfo=prepareDataCoordInfo(newCoordSys,oldData,newValueOrigin);for(var i=0;i= 0) !== (lastDiff >= 0))\n// ) {\n// return false;\n// }\n// if (!isNaN(diff) && diff !== 0) {\n// lastDiff = diff;\n// last = points[i][dim];\n// }\n// }\n// return true;\n// }\n/**\n * Draw smoothed line in monotone, in which only vertical or horizontal bezier\n * control points will be used. This should be used when points are monotone\n * either in x or y dimension.\n */function drawMono(ctx,points,start,segLen,allLen,dir,smoothMin,smoothMax,smooth,smoothMonotone,connectNulls){var prevIdx=0;var idx=start;for(var k=0;k=allLen||idx<0){break;}if(isPointNull(p)){if(connectNulls){idx+=dir;continue;}break;}if(idx===start){ctx[dir>0?'moveTo':'lineTo'](p[0],p[1]);}else{if(smooth>0){var prevP=points[prevIdx];var dim=smoothMonotone==='y'?1:0;// Length of control point to p, either in x or y, but not both\nvar ctrlLen=(p[dim]-prevP[dim])*smooth;v2Copy(cp0,prevP);cp0[dim]=prevP[dim]+ctrlLen;v2Copy(cp1,p);cp1[dim]=p[dim]-ctrlLen;ctx.bezierCurveTo(cp0[0],cp0[1],cp1[0],cp1[1],p[0],p[1]);}else{ctx.lineTo(p[0],p[1]);}}prevIdx=idx;idx+=dir;}return k;}/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */function drawNonMono(ctx,points,start,segLen,allLen,dir,smoothMin,smoothMax,smooth,smoothMonotone,connectNulls){var prevIdx=0;var idx=start;for(var k=0;k=allLen||idx<0){break;}if(isPointNull(p)){if(connectNulls){idx+=dir;continue;}break;}if(idx===start){ctx[dir>0?'moveTo':'lineTo'](p[0],p[1]);v2Copy(cp0,p);}else{if(smooth>0){var nextIdx=idx+dir;var nextP=points[nextIdx];if(connectNulls){// Find next point not null\nwhile(nextP&&isPointNull(points[nextIdx])){nextIdx+=dir;nextP=points[nextIdx];}}var ratioNextSeg=0.5;var prevP=points[prevIdx];var nextP=points[nextIdx];// Last point\nif(!nextP||isPointNull(nextP)){v2Copy(cp1,p);}else{// If next data is null in not connect case\nif(isPointNull(nextP)&&!connectNulls){nextP=p;}sub(v,nextP,prevP);var lenPrevSeg;var lenNextSeg;if(smoothMonotone==='x'||smoothMonotone==='y'){var dim=smoothMonotone==='x'?0:1;lenPrevSeg=Math.abs(p[dim]-prevP[dim]);lenNextSeg=Math.abs(p[dim]-nextP[dim]);}else{lenPrevSeg=dist(p,prevP);lenNextSeg=dist(p,nextP);}// Use ratio of seg length\nratioNextSeg=lenNextSeg/(lenNextSeg+lenPrevSeg);scaleAndAdd$1(cp1,p,v,-smooth*(1-ratioNextSeg));}// Smooth constraint\nvec2Min(cp0,cp0,smoothMax);vec2Max(cp0,cp0,smoothMin);vec2Min(cp1,cp1,smoothMax);vec2Max(cp1,cp1,smoothMin);ctx.bezierCurveTo(cp0[0],cp0[1],cp1[0],cp1[1],p[0],p[1]);// cp0 of next segment\nscaleAndAdd$1(cp0,p,v,smooth*ratioNextSeg);}else{ctx.lineTo(p[0],p[1]);}}prevIdx=idx;idx+=dir;}return k;}function getBoundingBox(points,smoothConstraint){var ptMin=[Infinity,Infinity];var ptMax=[-Infinity,-Infinity];if(smoothConstraint){for(var i=0;iptMax[0]){ptMax[0]=pt[0];}if(pt[1]>ptMax[1]){ptMax[1]=pt[1];}}}return{min:smoothConstraint?ptMin:ptMax,max:smoothConstraint?ptMax:ptMin};}var Polyline$1=Path.extend({type:'ec-polyline',shape:{points:[],smooth:0,smoothConstraint:true,smoothMonotone:null,connectNulls:false},style:{fill:null,stroke:'#000'},brush:fixClipWithShadow(Path.prototype.brush),buildPath:function buildPath(ctx,shape){var points=shape.points;var i=0;var len$$1=points.length;var result=getBoundingBox(points,shape.smoothConstraint);if(shape.connectNulls){// Must remove first and last null values avoid draw error in polygon\nfor(;len$$1>0;len$$1--){if(!isPointNull(points[len$$1-1])){break;}}for(;i0;len$$1--){if(!isPointNull(points[len$$1-1])){break;}}for(;i>} points\n */function getStackedOnPoints(coordSys,data,dataCoordInfo){if(!dataCoordInfo.valueDim){return[];}var points=[];for(var idx=0,len=data.count();idx=0;i--){var dimIndex=visualMetaList[i].dimension;var dimName=data.dimensions[dimIndex];var dimInfo=data.getDimensionInfo(dimName);coordDim=dimInfo&&dimInfo.coordDim;// Can only be x or y\nif(coordDim==='x'||coordDim==='y'){visualMeta=visualMetaList[i];break;}}if(!visualMeta){if(__DEV__){console.warn('Visual map on line style only support x or y dimension.');}return;}// If the area to be rendered is bigger than area defined by LinearGradient,\n// the canvas spec prescribes that the color of the first stop and the last\n// stop should be used. But if two stops are added at offset 0, in effect\n// browsers use the color of the second stop to render area outside\n// LinearGradient. So we can only infinitesimally extend area defined in\n// LinearGradient to render `outerColors`.\nvar axis=coordSys.getAxis(coordDim);// dataToCoor mapping may not be linear, but must be monotonic.\nvar colorStops=map(visualMeta.stops,function(stop){return{coord:axis.toGlobalCoord(axis.dataToCoord(stop.value)),color:stop.color};});var stopLen=colorStops.length;var outerColors=visualMeta.outerColors.slice();if(stopLen&&colorStops[0].coord>colorStops[stopLen-1].coord){colorStops.reverse();outerColors.reverse();}var tinyExtent=10;// Arbitrary value: 10px\nvar minCoord=colorStops[0].coord-tinyExtent;var maxCoord=colorStops[stopLen-1].coord+tinyExtent;var coordSpan=maxCoord-minCoord;if(coordSpan<1e-3){return'transparent';}each$1(colorStops,function(stop){stop.offset=(stop.coord-minCoord)/coordSpan;});colorStops.push({offset:stopLen?colorStops[stopLen-1].offset:0.5,color:outerColors[1]||'transparent'});colorStops.unshift({// notice colorStops.length have been changed.\noffset:stopLen?colorStops[0].offset:0.5,color:outerColors[0]||'transparent'});// zrUtil.each(colorStops, function (colorStop) {\n// // Make sure each offset has rounded px to avoid not sharp edge\n// colorStop.offset = (Math.round(colorStop.offset * (end - start) + start) - start) / (end - start);\n// });\nvar gradient=new LinearGradient(0,0,0,0,colorStops,true);gradient[coordDim]=minCoord;gradient[coordDim+'2']=maxCoord;return gradient;}function getIsIgnoreFunc(seriesModel,data,coordSys){var showAllSymbol=seriesModel.get('showAllSymbol');var isAuto=showAllSymbol==='auto';if(showAllSymbol&&!isAuto){return;}var categoryAxis=coordSys.getAxesByScale('ordinal')[0];if(!categoryAxis){return;}// Note that category label interval strategy might bring some weird effect\n// in some scenario: users may wonder why some of the symbols are not\n// displayed. So we show all symbols as possible as we can.\nif(isAuto// Simplify the logic, do not determine label overlap here.\n&&canShowAllSymbolForCategory(categoryAxis,data)){return;}// Otherwise follow the label interval strategy on category axis.\nvar categoryDataDim=data.mapDimension(categoryAxis.dim);var labelMap={};each$1(categoryAxis.getViewLabels(),function(labelItem){labelMap[labelItem.tickValue]=1;});return function(dataIndex){return!labelMap.hasOwnProperty(data.get(categoryDataDim,dataIndex));};}function canShowAllSymbolForCategory(categoryAxis,data){// In mose cases, line is monotonous on category axis, and the label size\n// is close with each other. So we check the symbol size and some of the\n// label size alone with the category axis to estimate whether all symbol\n// can be shown without overlap.\nvar axisExtent=categoryAxis.getExtent();var availSize=Math.abs(axisExtent[1]-axisExtent[0])/categoryAxis.scale.count();isNaN(availSize)&&(availSize=0);// 0/0 is NaN.\n// Sampling some points, max 5.\nvar dataLen=data.count();var step=Math.max(1,Math.round(dataLen/5));for(var dataIndex=0;dataIndexavailSize){return false;}}return true;}function createLineClipPath(coordSys,hasAnimation,seriesModel){if(coordSys.type==='cartesian2d'){var isHorizontal=coordSys.getBaseAxis().isHorizontal();var clipPath=createGridClipPath(coordSys,hasAnimation,seriesModel);// Expand clip shape to avoid clipping when line value exceeds axis\nif(!seriesModel.get('clip',true)){var rectShape=clipPath.shape;var expandSize=Math.max(rectShape.width,rectShape.height);if(isHorizontal){rectShape.y-=expandSize;rectShape.height+=expandSize*2;}else{rectShape.x-=expandSize;rectShape.width+=expandSize*2;}}return clipPath;}else{return createPolarClipPath(coordSys,hasAnimation,seriesModel);}}Chart.extend({type:'line',init:function init(){var lineGroup=new Group();var symbolDraw=new SymbolDraw();this.group.add(symbolDraw.group);this._symbolDraw=symbolDraw;this._lineGroup=lineGroup;},render:function render(seriesModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;var group=this.group;var data=seriesModel.getData();var lineStyleModel=seriesModel.getModel('lineStyle');var areaStyleModel=seriesModel.getModel('areaStyle');var points=data.mapArray(data.getItemLayout);var isCoordSysPolar=coordSys.type==='polar';var prevCoordSys=this._coordSys;var symbolDraw=this._symbolDraw;var polyline=this._polyline;var polygon=this._polygon;var lineGroup=this._lineGroup;var hasAnimation=seriesModel.get('animation');var isAreaChart=!areaStyleModel.isEmpty();var valueOrigin=areaStyleModel.get('origin');var dataCoordInfo=prepareDataCoordInfo(coordSys,data,valueOrigin);var stackedOnPoints=getStackedOnPoints(coordSys,data,dataCoordInfo);var showSymbol=seriesModel.get('showSymbol');var isIgnoreFunc=showSymbol&&!isCoordSysPolar&&getIsIgnoreFunc(seriesModel,data,coordSys);// Remove temporary symbols\nvar oldData=this._data;oldData&&oldData.eachItemGraphicEl(function(el,idx){if(el.__temp){group.remove(el);oldData.setItemGraphicEl(idx,null);}});// Remove previous created symbols if showSymbol changed to false\nif(!showSymbol){symbolDraw.remove();}group.add(lineGroup);// FIXME step not support polar\nvar step=!isCoordSysPolar&&seriesModel.get('step');var clipShapeForSymbol;if(coordSys&&coordSys.getArea&&seriesModel.get('clip',true)){clipShapeForSymbol=coordSys.getArea();// Avoid float number rounding error for symbol on the edge of axis extent.\n// See #7913 and `test/dataZoom-clip.html`.\nif(clipShapeForSymbol.width!=null){clipShapeForSymbol.x-=0.1;clipShapeForSymbol.y-=0.1;clipShapeForSymbol.width+=0.2;clipShapeForSymbol.height+=0.2;}else if(clipShapeForSymbol.r0){clipShapeForSymbol.r0-=0.5;clipShapeForSymbol.r1+=0.5;}}this._clipShapeForSymbol=clipShapeForSymbol;// Initialization animation or coordinate system changed\nif(!(polyline&&prevCoordSys.type===coordSys.type&&step===this._step)){showSymbol&&symbolDraw.updateData(data,{isIgnore:isIgnoreFunc,clipShape:clipShapeForSymbol});if(step){// TODO If stacked series is not step\npoints=turnPointsIntoStep(points,coordSys,step);stackedOnPoints=turnPointsIntoStep(stackedOnPoints,coordSys,step);}polyline=this._newPolyline(points,coordSys,hasAnimation);if(isAreaChart){polygon=this._newPolygon(points,stackedOnPoints,coordSys,hasAnimation);}lineGroup.setClipPath(createLineClipPath(coordSys,true,seriesModel));}else{if(isAreaChart&&!polygon){// If areaStyle is added\npolygon=this._newPolygon(points,stackedOnPoints,coordSys,hasAnimation);}else if(polygon&&!isAreaChart){// If areaStyle is removed\nlineGroup.remove(polygon);polygon=this._polygon=null;}// Update clipPath\nlineGroup.setClipPath(createLineClipPath(coordSys,false,seriesModel));// Always update, or it is wrong in the case turning on legend\n// because points are not changed\nshowSymbol&&symbolDraw.updateData(data,{isIgnore:isIgnoreFunc,clipShape:clipShapeForSymbol});// Stop symbol animation and sync with line points\n// FIXME performance?\ndata.eachItemGraphicEl(function(el){el.stopAnimation(true);});// In the case data zoom triggerred refreshing frequently\n// Data may not change if line has a category axis. So it should animate nothing\nif(!isPointsSame(this._stackedOnPoints,stackedOnPoints)||!isPointsSame(this._points,points)){if(hasAnimation){this._updateAnimation(data,stackedOnPoints,coordSys,api,step,valueOrigin);}else{// Not do it in update with animation\nif(step){// TODO If stacked series is not step\npoints=turnPointsIntoStep(points,coordSys,step);stackedOnPoints=turnPointsIntoStep(stackedOnPoints,coordSys,step);}polyline.setShape({points:points});polygon&&polygon.setShape({points:points,stackedOnPoints:stackedOnPoints});}}}var visualColor=getVisualGradient(data,coordSys)||data.getVisual('color');polyline.useStyle(defaults(// Use color in lineStyle first\nlineStyleModel.getLineStyle(),{fill:'none',stroke:visualColor,lineJoin:'bevel'}));var smooth=seriesModel.get('smooth');smooth=getSmooth(seriesModel.get('smooth'));polyline.setShape({smooth:smooth,smoothMonotone:seriesModel.get('smoothMonotone'),connectNulls:seriesModel.get('connectNulls')});if(polygon){var stackedOnSeries=data.getCalculationInfo('stackedOnSeries');var stackedOnSmooth=0;polygon.useStyle(defaults(areaStyleModel.getAreaStyle(),{fill:visualColor,opacity:0.7,lineJoin:'bevel'}));if(stackedOnSeries){stackedOnSmooth=getSmooth(stackedOnSeries.get('smooth'));}polygon.setShape({smooth:smooth,stackedOnSmooth:stackedOnSmooth,smoothMonotone:seriesModel.get('smoothMonotone'),connectNulls:seriesModel.get('connectNulls')});}this._data=data;// Save the coordinate system for transition animation when data changed\nthis._coordSys=coordSys;this._stackedOnPoints=stackedOnPoints;this._points=points;this._step=step;this._valueOrigin=valueOrigin;},dispose:function dispose(){},highlight:function highlight(seriesModel,ecModel,api,payload){var data=seriesModel.getData();var dataIndex=queryDataIndex(data,payload);if(!(dataIndex instanceof Array)&&dataIndex!=null&&dataIndex>=0){var symbol=data.getItemGraphicEl(dataIndex);if(!symbol){// Create a temporary symbol if it is not exists\nvar pt=data.getItemLayout(dataIndex);if(!pt){// Null data\nreturn;}// fix #11360: should't draw symbol outside clipShapeForSymbol\nif(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(pt[0],pt[1])){return;}symbol=new SymbolClz$1(data,dataIndex);symbol.position=pt;symbol.setZ(seriesModel.get('zlevel'),seriesModel.get('z'));symbol.ignore=isNaN(pt[0])||isNaN(pt[1]);symbol.__temp=true;data.setItemGraphicEl(dataIndex,symbol);// Stop scale animation\nsymbol.stopSymbolAnimation(true);this.group.add(symbol);}symbol.highlight();}else{// Highlight whole series\nChart.prototype.highlight.call(this,seriesModel,ecModel,api,payload);}},downplay:function downplay(seriesModel,ecModel,api,payload){var data=seriesModel.getData();var dataIndex=queryDataIndex(data,payload);if(dataIndex!=null&&dataIndex>=0){var symbol=data.getItemGraphicEl(dataIndex);if(symbol){if(symbol.__temp){data.setItemGraphicEl(dataIndex,null);this.group.remove(symbol);}else{symbol.downplay();}}}else{// FIXME\n// can not downplay completely.\n// Downplay whole series\nChart.prototype.downplay.call(this,seriesModel,ecModel,api,payload);}},/**\n * @param {module:zrender/container/Group} group\n * @param {Array.>} points\n * @private\n */_newPolyline:function _newPolyline(points){var polyline=this._polyline;// Remove previous created polyline\nif(polyline){this._lineGroup.remove(polyline);}polyline=new Polyline$1({shape:{points:points},silent:true,z2:10});this._lineGroup.add(polyline);this._polyline=polyline;return polyline;},/**\n * @param {module:zrender/container/Group} group\n * @param {Array.>} stackedOnPoints\n * @param {Array.>} points\n * @private\n */_newPolygon:function _newPolygon(points,stackedOnPoints){var polygon=this._polygon;// Remove previous created polygon\nif(polygon){this._lineGroup.remove(polygon);}polygon=new Polygon$1({shape:{points:points,stackedOnPoints:stackedOnPoints},silent:true});this._lineGroup.add(polygon);this._polygon=polygon;return polygon;},/**\n * @private\n */ // FIXME Two value axis\n_updateAnimation:function _updateAnimation(data,stackedOnPoints,coordSys,api,step,valueOrigin){var polyline=this._polyline;var polygon=this._polygon;var seriesModel=data.hostModel;var diff=lineAnimationDiff(this._data,data,this._stackedOnPoints,stackedOnPoints,this._coordSys,coordSys,this._valueOrigin,valueOrigin);var current=diff.current;var stackedOnCurrent=diff.stackedOnCurrent;var next=diff.next;var stackedOnNext=diff.stackedOnNext;if(step){// TODO If stacked series is not step\ncurrent=turnPointsIntoStep(diff.current,coordSys,step);stackedOnCurrent=turnPointsIntoStep(diff.stackedOnCurrent,coordSys,step);next=turnPointsIntoStep(diff.next,coordSys,step);stackedOnNext=turnPointsIntoStep(diff.stackedOnNext,coordSys,step);}// Don't apply animation if diff is large.\n// For better result and avoid memory explosion problems like\n// https://github.com/apache/incubator-echarts/issues/12229\nif(getBoundingDiff(current,next)>3000||polygon&&getBoundingDiff(stackedOnCurrent,stackedOnNext)>3000){polyline.setShape({points:next});if(polygon){polygon.setShape({points:next,stackedOnPoints:stackedOnNext});}return;}// `diff.current` is subset of `current` (which should be ensured by\n// turnPointsIntoStep), so points in `__points` can be updated when\n// points in `current` are update during animation.\npolyline.shape.__points=diff.current;polyline.shape.points=current;updateProps(polyline,{shape:{points:next}},seriesModel);if(polygon){polygon.setShape({points:current,stackedOnPoints:stackedOnCurrent});updateProps(polygon,{shape:{points:next,stackedOnPoints:stackedOnNext}},seriesModel);}var updatedDataInfo=[];var diffStatus=diff.status;for(var i=0;i}, not undefined to avoid if...else... statement\npoint=!isNaN(x)&&!isNaN(y)&&coordSys.dataToPoint(tmpIn,null,tmpOut);}if(isLargeRender){points[offset++]=point?point[0]:NaN;points[offset++]=point?point[1]:NaN;}else{data.setItemLayout(i,point&&point.slice()||[NaN,NaN]);}}isLargeRender&&data.setLayout('symbolPoints',points);}return dimLen&&{progress:progress};}};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var samplers={average:function average(frame){var sum=0;var count=0;for(var i=0;imax&&(max=frame[i]);}// NaN will cause illegal axis extent.\nreturn isFinite(max)?max:NaN;},min:function min(frame){var min=Infinity;for(var i=0;i1){var sampler;if(typeof sampling==='string'){sampler=samplers[sampling];}else if(typeof sampling==='function'){sampler=sampling;}if(sampler){// Only support sample the first dim mapped from value axis.\nseriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim),1/rate,sampler,indexSampler));}}}}};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Cartesian coordinate system\n * @module echarts/coord/Cartesian\n *\n */function dimAxisMapper(dim){return this._axes[dim];}/**\n * @alias module:echarts/coord/Cartesian\n * @constructor\n */var Cartesian=function Cartesian(name){this._axes={};this._dimList=[];/**\n * @type {string}\n */this.name=name||'';};Cartesian.prototype={constructor:Cartesian,type:'cartesian',/**\n * Get axis\n * @param {number|string} dim\n * @return {module:echarts/coord/Cartesian~Axis}\n */getAxis:function getAxis(dim){return this._axes[dim];},/**\n * Get axes list\n * @return {Array.}\n */getAxes:function getAxes(){return map(this._dimList,dimAxisMapper,this);},/**\n * Get axes list by given scale type\n */getAxesByScale:function getAxesByScale(scaleType){scaleType=scaleType.toLowerCase();return filter(this.getAxes(),function(axis){return axis.scale.type===scaleType;});},/**\n * Add axis\n * @param {module:echarts/coord/Cartesian.Axis}\n */addAxis:function addAxis(axis){var dim=axis.dim;this._axes[dim]=axis;this._dimList.push(dim);},/**\n * Convert data to coord in nd space\n * @param {Array.|Object.} val\n * @return {Array.|Object.}\n */dataToCoord:function dataToCoord(val){return this._dataCoordConvert(val,'dataToCoord');},/**\n * Convert coord in nd space to data\n * @param {Array.|Object.} val\n * @return {Array.|Object.}\n */coordToData:function coordToData(val){return this._dataCoordConvert(val,'coordToData');},_dataCoordConvert:function _dataCoordConvert(input,method){var dimList=this._dimList;var output=input instanceof Array?[]:{};for(var i=0;i}\n * @readOnly\n */dimensions:['x','y'],/**\n * Base axis will be used on stacking.\n *\n * @return {module:echarts/coord/cartesian/Axis2D}\n */getBaseAxis:function getBaseAxis(){return this.getAxesByScale('ordinal')[0]||this.getAxesByScale('time')[0]||this.getAxis('x');},/**\n * If contain point\n * @param {Array.} point\n * @return {boolean}\n */containPoint:function containPoint(point){var axisX=this.getAxis('x');var axisY=this.getAxis('y');return axisX.contain(axisX.toLocalCoord(point[0]))&&axisY.contain(axisY.toLocalCoord(point[1]));},/**\n * If contain data\n * @param {Array.} data\n * @return {boolean}\n */containData:function containData(data){return this.getAxis('x').containData(data[0])&&this.getAxis('y').containData(data[1]);},/**\n * @param {Array.} data\n * @param {Array.} out\n * @return {Array.}\n */dataToPoint:function dataToPoint(data,reserved,out){var xAxis=this.getAxis('x');var yAxis=this.getAxis('y');out=out||[];out[0]=xAxis.toGlobalCoord(xAxis.dataToCoord(data[0]));out[1]=yAxis.toGlobalCoord(yAxis.dataToCoord(data[1]));return out;},/**\n * @param {Array.} data\n * @param {Array.} out\n * @return {Array.}\n */clampData:function clampData(data,out){var xScale=this.getAxis('x').scale;var yScale=this.getAxis('y').scale;var xAxisExtent=xScale.getExtent();var yAxisExtent=yScale.getExtent();var x=xScale.parse(data[0]);var y=yScale.parse(data[1]);out=out||[];out[0]=Math.min(Math.max(Math.min(xAxisExtent[0],xAxisExtent[1]),x),Math.max(xAxisExtent[0],xAxisExtent[1]));out[1]=Math.min(Math.max(Math.min(yAxisExtent[0],yAxisExtent[1]),y),Math.max(yAxisExtent[0],yAxisExtent[1]));return out;},/**\n * @param {Array.} point\n * @param {Array.} out\n * @return {Array.}\n */pointToData:function pointToData(point,out){var xAxis=this.getAxis('x');var yAxis=this.getAxis('y');out=out||[];out[0]=xAxis.coordToData(xAxis.toLocalCoord(point[0]));out[1]=yAxis.coordToData(yAxis.toLocalCoord(point[1]));return out;},/**\n * Get other axis\n * @param {module:echarts/coord/cartesian/Axis2D} axis\n */getOtherAxis:function getOtherAxis(axis){return this.getAxis(axis.dim==='x'?'y':'x');},/**\n * Get rect area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n * @return {BoundingRect}\n */getArea:function getArea(){var xExtent=this.getAxis('x').getGlobalExtent();var yExtent=this.getAxis('y').getGlobalExtent();var x=Math.min(xExtent[0],xExtent[1]);var y=Math.min(yExtent[0],yExtent[1]);var width=Math.max(xExtent[0],xExtent[1])-x;var height=Math.max(yExtent[0],yExtent[1])-y;var rect=new BoundingRect(x,y,width,height);return rect;}};inherits(Cartesian2D,Cartesian);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Extend axis 2d\n * @constructor module:echarts/coord/cartesian/Axis2D\n * @extends {module:echarts/coord/cartesian/Axis}\n * @param {string} dim\n * @param {*} scale\n * @param {Array.} coordExtent\n * @param {string} axisType\n * @param {string} position\n */var Axis2D=function Axis2D(dim,scale,coordExtent,axisType,position){Axis.call(this,dim,scale,coordExtent);/**\n * Axis type\n * - 'category'\n * - 'value'\n * - 'time'\n * - 'log'\n * @type {string}\n */this.type=axisType||'value';/**\n * Axis position\n * - 'top'\n * - 'bottom'\n * - 'left'\n * - 'right'\n */this.position=position||'bottom';};Axis2D.prototype={constructor:Axis2D,/**\n * Index of axis, can be used as key\n */index:0,/**\n * Implemented in .\n * @return {Array.}\n * If not on zero of other axis, return null/undefined.\n * If no axes, return an empty array.\n */getAxesOnZeroOf:null,/**\n * Axis model\n * @param {module:echarts/coord/cartesian/AxisModel}\n */model:null,isHorizontal:function isHorizontal(){var position=this.position;return position==='top'||position==='bottom';},/**\n * Each item cooresponds to this.getExtent(), which\n * means globalExtent[0] may greater than globalExtent[1],\n * unless `asc` is input.\n *\n * @param {boolean} [asc]\n * @return {Array.}\n */getGlobalExtent:function getGlobalExtent(asc){var ret=this.getExtent();ret[0]=this.toGlobalCoord(ret[0]);ret[1]=this.toGlobalCoord(ret[1]);asc&&ret[0]>ret[1]&&ret.reverse();return ret;},getOtherAxis:function getOtherAxis(){this.grid.getOtherAxis();},/**\n * @override\n */pointToData:function pointToData(point,clamp){return this.coordToData(this.toLocalCoord(point[this.dim==='x'?0:1]),clamp);},/**\n * Transform global coord to local coord,\n * i.e. var localCoord = axis.toLocalCoord(80);\n * designate by module:echarts/coord/cartesian/Grid.\n * @type {Function}\n */toLocalCoord:null,/**\n * Transform global coord to local coord,\n * i.e. var globalCoord = axis.toLocalCoord(40);\n * designate by module:echarts/coord/cartesian/Grid.\n * @type {Function}\n */toGlobalCoord:null};inherits(Axis2D,Axis);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var defaultOption={show:true,zlevel:0,z:0,// Inverse the axis.\ninverse:false,// Axis name displayed.\nname:'',// 'start' | 'middle' | 'end'\nnameLocation:'end',// By degree. By default auto rotate by nameLocation.\nnameRotate:null,nameTruncate:{maxWidth:null,ellipsis:'...',placeholder:'.'},// Use global text style by default.\nnameTextStyle:{},// The gap between axisName and axisLine.\nnameGap:15,// Default `false` to support tooltip.\nsilent:false,// Default `false` to avoid legacy user event listener fail.\ntriggerEvent:false,tooltip:{show:false},axisPointer:{},axisLine:{show:true,onZero:true,onZeroAxisIndex:null,lineStyle:{color:'#333',width:1,type:'solid'},// The arrow at both ends the the axis.\nsymbol:['none','none'],symbolSize:[10,15]},axisTick:{show:true,// Whether axisTick is inside the grid or outside the grid.\ninside:false,// The length of axisTick.\nlength:5,lineStyle:{width:1}},axisLabel:{show:true,// Whether axisLabel is inside the grid or outside the grid.\ninside:false,rotate:0,// true | false | null/undefined (auto)\nshowMinLabel:null,// true | false | null/undefined (auto)\nshowMaxLabel:null,margin:8,// formatter: null,\nfontSize:12},splitLine:{show:true,lineStyle:{color:['#ccc'],width:1,type:'solid'}},splitArea:{show:false,areaStyle:{color:['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)']}}};var axisDefault={};axisDefault.categoryAxis=merge({// The gap at both ends of the axis. For categoryAxis, boolean.\nboundaryGap:true,// Set false to faster category collection.\n// Only usefull in the case like: category is\n// ['2012-01-01', '2012-01-02', ...], where the input\n// data has been ensured not duplicate and is large data.\n// null means \"auto\":\n// if axis.data provided, do not deduplication,\n// else do deduplication.\ndeduplication:null,// splitArea: {\n// show: false\n// },\nsplitLine:{show:false},axisTick:{// If tick is align with label when boundaryGap is true\nalignWithLabel:false,interval:'auto'},axisLabel:{interval:'auto'}},defaultOption);axisDefault.valueAxis=merge({// The gap at both ends of the axis. For value axis, [GAP, GAP], where\n// `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`)\nboundaryGap:[0,0],// TODO\n// min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n// Min value of the axis. can be:\n// + a number\n// + 'dataMin': use the min value in data.\n// + null/undefined: auto decide min value (consider pretty look and boundaryGap).\n// min: null,\n// Max value of the axis. can be:\n// + a number\n// + 'dataMax': use the max value in data.\n// + null/undefined: auto decide max value (consider pretty look and boundaryGap).\n// max: null,\n// Readonly prop, specifies start value of the range when using data zoom.\n// rangeStart: null\n// Readonly prop, specifies end value of the range when using data zoom.\n// rangeEnd: null\n// Optional value can be:\n// + `false`: always include value 0.\n// + `true`: the extent do not consider value 0.\n// scale: false,\n// AxisTick and axisLabel and splitLine are caculated based on splitNumber.\nsplitNumber:5,// Interval specifies the span of the ticks is mandatorily.\n// interval: null\n// Specify min interval when auto calculate tick interval.\n// minInterval: null\n// Specify max interval when auto calculate tick interval.\n// maxInterval: null\nminorTick:{// Minor tick, not available for cateogry axis.\nshow:false,// Split number of minor ticks. The value should be in range of (0, 100)\nsplitNumber:5,// Lenght of minor tick\nlength:3,// Same inside with axisTick\n// Line style\nlineStyle:{// Default to be same with axisTick\n}},minorSplitLine:{show:false,lineStyle:{color:'#eee',width:1}}},defaultOption);axisDefault.timeAxis=defaults({scale:true,min:'dataMin',max:'dataMax'},axisDefault.valueAxis);axisDefault.logAxis=defaults({scale:true,logBase:10},axisDefault.valueAxis);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // FIXME axisType is fixed ?\nvar AXIS_TYPES=['value','category','time','log'];/**\n * Generate sub axis model class\n * @param {string} axisName 'x' 'y' 'radius' 'angle' 'parallel'\n * @param {module:echarts/model/Component} BaseAxisModelClass\n * @param {Function} axisTypeDefaulter\n * @param {Object} [extraDefaultOption]\n */var axisModelCreator=function axisModelCreator(axisName,BaseAxisModelClass,axisTypeDefaulter,extraDefaultOption){each$1(AXIS_TYPES,function(axisType){BaseAxisModelClass.extend({/**\n * @readOnly\n */type:axisName+'Axis.'+axisType,mergeDefaultAndTheme:function mergeDefaultAndTheme(option,ecModel){var layoutMode=this.layoutMode;var inputPositionParams=layoutMode?getLayoutParams(option):{};var themeModel=ecModel.getTheme();merge(option,themeModel.get(axisType+'Axis'));merge(option,this.getDefaultOption());option.type=axisTypeDefaulter(axisName,option);if(layoutMode){mergeLayoutParam(option,inputPositionParams,layoutMode);}},/**\n * @override\n */optionUpdated:function optionUpdated(){var thisOption=this.option;if(thisOption.type==='category'){this.__ordinalMeta=OrdinalMeta.createByAxisModel(this);}},/**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */getCategories:function getCategories(rawData){var option=this.option;// FIXME\n// warning if called before all of 'getInitailData' finished.\nif(option.type==='category'){if(rawData){return option.data;}return this.__ordinalMeta.categories;}},getOrdinalMeta:function getOrdinalMeta(){return this.__ordinalMeta;},defaultOption:mergeAll([{},axisDefault[axisType+'Axis'],extraDefaultOption],true)});});ComponentModel.registerSubTypeDefaulter(axisName+'Axis',curry(axisTypeDefaulter,axisName));};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AxisModel=ComponentModel.extend({type:'cartesian2dAxis',/**\n * @type {module:echarts/coord/cartesian/Axis2D}\n */axis:null,/**\n * @override\n */init:function init(){AxisModel.superApply(this,'init',arguments);this.resetRange();},/**\n * @override\n */mergeOption:function mergeOption(){AxisModel.superApply(this,'mergeOption',arguments);this.resetRange();},/**\n * @override\n */restoreData:function restoreData(){AxisModel.superApply(this,'restoreData',arguments);this.resetRange();},/**\n * @override\n * @return {module:echarts/model/Component}\n */getCoordSysModel:function getCoordSysModel(){return this.ecModel.queryComponents({mainType:'grid',index:this.option.gridIndex,id:this.option.gridId})[0];}});function getAxisType(axisDim,option){// Default axis with data is category axis\nreturn option.type||(option.data?'category':'value');}merge(AxisModel.prototype,axisModelCommonMixin);var extraOption={// gridIndex: 0,\n// gridId: '',\n// Offset is for multiple axis on the same position\noffset:0};axisModelCreator('x',AxisModel,getAxisType,extraOption);axisModelCreator('y',AxisModel,getAxisType,extraOption);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Grid 是在有直角坐标系的时候必须要存在的\n// 所以这里也要被 Cartesian2D 依赖\nComponentModel.extend({type:'grid',dependencies:['xAxis','yAxis'],layoutMode:'box',/**\n * @type {module:echarts/coord/cartesian/Grid}\n */coordinateSystem:null,defaultOption:{show:false,zlevel:0,z:0,left:'10%',top:60,right:'10%',bottom:60,// If grid size contain label\ncontainLabel:false,// width: {totalWidth} - left - right,\n// height: {totalHeight} - top - bottom,\nbackgroundColor:'rgba(0,0,0,0)',borderWidth:1,borderColor:'#ccc'}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Grid is a region which contains at most 4 cartesian systems\n *\n * TODO Default cartesian\n */ // Depends on GridModel, AxisModel, which performs preprocess.\n/**\n * Check if the axis is used in the specified grid\n * @inner\n */function isAxisUsedInTheGrid(axisModel,gridModel,ecModel){return axisModel.getCoordSysModel()===gridModel;}function Grid(gridModel,ecModel,api){/**\n * @type {Object.}\n * @private\n */this._coordsMap={};/**\n * @type {Array.}\n * @private\n */this._coordsList=[];/**\n * @type {Object.>}\n * @private\n */this._axesMap={};/**\n * @type {Array.}\n * @private\n */this._axesList=[];this._initCartesian(gridModel,ecModel,api);this.model=gridModel;}var gridProto=Grid.prototype;gridProto.type='grid';gridProto.axisPointerEnabled=true;gridProto.getRect=function(){return this._rect;};gridProto.update=function(ecModel,api){var axesMap=this._axesMap;this._updateScale(ecModel,this.model);each$1(axesMap.x,function(xAxis){niceScaleExtent(xAxis.scale,xAxis.model);});each$1(axesMap.y,function(yAxis){niceScaleExtent(yAxis.scale,yAxis.model);});// Key: axisDim_axisIndex, value: boolean, whether onZero target.\nvar onZeroRecords={};each$1(axesMap.x,function(xAxis){fixAxisOnZero(axesMap,'y',xAxis,onZeroRecords);});each$1(axesMap.y,function(yAxis){fixAxisOnZero(axesMap,'x',yAxis,onZeroRecords);});// Resize again if containLabel is enabled\n// FIXME It may cause getting wrong grid size in data processing stage\nthis.resize(this.model,api);};function fixAxisOnZero(axesMap,otherAxisDim,axis,onZeroRecords){axis.getAxesOnZeroOf=function(){// TODO: onZero of multiple axes.\nreturn otherAxisOnZeroOf?[otherAxisOnZeroOf]:[];};// onZero can not be enabled in these two situations:\n// 1. When any other axis is a category axis.\n// 2. When no axis is cross 0 point.\nvar otherAxes=axesMap[otherAxisDim];var otherAxisOnZeroOf;var axisModel=axis.model;var onZero=axisModel.get('axisLine.onZero');var onZeroAxisIndex=axisModel.get('axisLine.onZeroAxisIndex');if(!onZero){return;}// If target axis is specified.\nif(onZeroAxisIndex!=null){if(canOnZeroToAxis(otherAxes[onZeroAxisIndex])){otherAxisOnZeroOf=otherAxes[onZeroAxisIndex];}}else{// Find the first available other axis.\nfor(var idx in otherAxes){if(otherAxes.hasOwnProperty(idx)&&canOnZeroToAxis(otherAxes[idx])// Consider that two Y axes on one value axis,\n// if both onZero, the two Y axes overlap.\n&&!onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]){otherAxisOnZeroOf=otherAxes[idx];break;}}}if(otherAxisOnZeroOf){onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)]=true;}function getOnZeroRecordKey(axis){return axis.dim+'_'+axis.index;}}function canOnZeroToAxis(axis){return axis&&axis.type!=='category'&&axis.type!=='time'&&ifAxisCrossZero(axis);}/**\n * Resize the grid\n * @param {module:echarts/coord/cartesian/GridModel} gridModel\n * @param {module:echarts/ExtensionAPI} api\n */gridProto.resize=function(gridModel,api,ignoreContainLabel){var gridRect=getLayoutRect(gridModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()});this._rect=gridRect;var axesList=this._axesList;adjustAxes();// Minus label size\nif(!ignoreContainLabel&&gridModel.get('containLabel')){each$1(axesList,function(axis){if(!axis.model.get('axisLabel.inside')){var labelUnionRect=estimateLabelUnionRect(axis);if(labelUnionRect){var dim=axis.isHorizontal()?'height':'width';var margin=axis.model.get('axisLabel.margin');gridRect[dim]-=labelUnionRect[dim]+margin;if(axis.position==='top'){gridRect.y+=labelUnionRect.height+margin;}else if(axis.position==='left'){gridRect.x+=labelUnionRect.width+margin;}}}});adjustAxes();}function adjustAxes(){each$1(axesList,function(axis){var isHorizontal=axis.isHorizontal();var extent=isHorizontal?[0,gridRect.width]:[0,gridRect.height];var idx=axis.inverse?1:0;axis.setExtent(extent[idx],extent[1-idx]);updateAxisTransform(axis,isHorizontal?gridRect.x:gridRect.y);});}};/**\n * @param {string} axisType\n * @param {number} [axisIndex]\n */gridProto.getAxis=function(axisType,axisIndex){var axesMapOnDim=this._axesMap[axisType];if(axesMapOnDim!=null){if(axisIndex==null){// Find first axis\nfor(var name in axesMapOnDim){if(axesMapOnDim.hasOwnProperty(name)){return axesMapOnDim[name];}}}return axesMapOnDim[axisIndex];}};/**\n * @return {Array.}\n */gridProto.getAxes=function(){return this._axesList.slice();};/**\n * Usage:\n * grid.getCartesian(xAxisIndex, yAxisIndex);\n * grid.getCartesian(xAxisIndex);\n * grid.getCartesian(null, yAxisIndex);\n * grid.getCartesian({xAxisIndex: ..., yAxisIndex: ...});\n *\n * @param {number|Object} [xAxisIndex]\n * @param {number} [yAxisIndex]\n */gridProto.getCartesian=function(xAxisIndex,yAxisIndex){if(xAxisIndex!=null&&yAxisIndex!=null){var key='x'+xAxisIndex+'y'+yAxisIndex;return this._coordsMap[key];}if(isObject$1(xAxisIndex)){yAxisIndex=xAxisIndex.yAxisIndex;xAxisIndex=xAxisIndex.xAxisIndex;}// When only xAxisIndex or yAxisIndex given, find its first cartesian.\nfor(var i=0,coordList=this._coordsList;i (0, 50)\n *\n * nameDirection or tickDirection or labelDirection is 1 means tick\n * or label is below the standard axis, whereas is -1 means above\n * the standard axis. labelOffset means offset between label and axis,\n * which is useful when 'onZero', where axisLabel is in the grid and\n * label in outside grid.\n *\n * Tips: like always,\n * positive rotation represents anticlockwise, and negative rotation\n * represents clockwise.\n * The direction of position coordinate is the same as the direction\n * of screen coordinate.\n *\n * Do not need to consider axis 'inverse', which is auto processed by\n * axis extent.\n *\n * @param {module:zrender/container/Group} group\n * @param {Object} axisModel\n * @param {Object} opt Standard axis parameters.\n * @param {Array.} opt.position [x, y]\n * @param {number} opt.rotation by radian\n * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle' or 'center'.\n * @param {number} [opt.tickDirection=1] 1 or -1\n * @param {number} [opt.labelDirection=1] 1 or -1\n * @param {number} [opt.labelOffset=0] Usefull when onZero.\n * @param {string} [opt.axisLabelShow] default get from axisModel.\n * @param {string} [opt.axisName] default get from axisModel.\n * @param {number} [opt.axisNameAvailableWidth]\n * @param {number} [opt.labelRotate] by degree, default get from axisModel.\n * @param {number} [opt.strokeContainThreshold] Default label interval when label\n * @param {number} [opt.nameTruncateMaxWidth]\n */var AxisBuilder=function AxisBuilder(axisModel,opt){/**\n * @readOnly\n */this.opt=opt;/**\n * @readOnly\n */this.axisModel=axisModel;// Default value\ndefaults(opt,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:true});/**\n * @readOnly\n */this.group=new Group();// FIXME Not use a seperate text group?\nvar dumbGroup=new Group({position:opt.position.slice(),rotation:opt.rotation});// this.group.add(dumbGroup);\n// this._dumbGroup = dumbGroup;\ndumbGroup.updateTransform();this._transform=dumbGroup.transform;this._dumbGroup=dumbGroup;};AxisBuilder.prototype={constructor:AxisBuilder,hasBuilder:function hasBuilder(name){return!!builders[name];},add:function add(name){builders[name].call(this);},getGroup:function getGroup(){return this.group;}};var builders={/**\n * @private\n */axisLine:function axisLine(){var opt=this.opt;var axisModel=this.axisModel;if(!axisModel.get('axisLine.show')){return;}var extent=this.axisModel.axis.getExtent();var matrix=this._transform;var pt1=[extent[0],0];var pt2=[extent[1],0];if(matrix){applyTransform(pt1,pt1,matrix);applyTransform(pt2,pt2,matrix);}var lineStyle=extend({lineCap:'round'},axisModel.getModel('axisLine.lineStyle').getLineStyle());this.group.add(new Line({// Id for animation\nanid:'line',subPixelOptimize:true,shape:{x1:pt1[0],y1:pt1[1],x2:pt2[0],y2:pt2[1]},style:lineStyle,strokeContainThreshold:opt.strokeContainThreshold||5,silent:true,z2:1}));var arrows=axisModel.get('axisLine.symbol');var arrowSize=axisModel.get('axisLine.symbolSize');var arrowOffset=axisModel.get('axisLine.symbolOffset')||0;if(typeof arrowOffset==='number'){arrowOffset=[arrowOffset,arrowOffset];}if(arrows!=null){if(typeof arrows==='string'){// Use the same arrow for start and end point\narrows=[arrows,arrows];}if(typeof arrowSize==='string'||typeof arrowSize==='number'){// Use the same size for width and height\narrowSize=[arrowSize,arrowSize];}var symbolWidth=arrowSize[0];var symbolHeight=arrowSize[1];each$1([{rotate:opt.rotation+Math.PI/2,offset:arrowOffset[0],r:0},{rotate:opt.rotation-Math.PI/2,offset:arrowOffset[1],r:Math.sqrt((pt1[0]-pt2[0])*(pt1[0]-pt2[0])+(pt1[1]-pt2[1])*(pt1[1]-pt2[1]))}],function(point,index){if(arrows[index]!=='none'&&arrows[index]!=null){var symbol=createSymbol(arrows[index],-symbolWidth/2,-symbolHeight/2,symbolWidth,symbolHeight,lineStyle.stroke,true);// Calculate arrow position with offset\nvar r=point.r+point.offset;var pos=[pt1[0]+r*Math.cos(opt.rotation),pt1[1]-r*Math.sin(opt.rotation)];symbol.attr({rotation:point.rotate,position:pos,silent:true,z2:11});this.group.add(symbol);}},this);}},/**\n * @private\n */axisTickLabel:function axisTickLabel(){var axisModel=this.axisModel;var opt=this.opt;var ticksEls=buildAxisMajorTicks(this,axisModel,opt);var labelEls=buildAxisLabel(this,axisModel,opt);fixMinMaxLabelShow(axisModel,labelEls,ticksEls);buildAxisMinorTicks(this,axisModel,opt);},/**\n * @private\n */axisName:function axisName(){var opt=this.opt;var axisModel=this.axisModel;var name=retrieve(opt.axisName,axisModel.get('name'));if(!name){return;}var nameLocation=axisModel.get('nameLocation');var nameDirection=opt.nameDirection;var textStyleModel=axisModel.getModel('nameTextStyle');var gap=axisModel.get('nameGap')||0;var extent=this.axisModel.axis.getExtent();var gapSignal=extent[0]>extent[1]?-1:1;var pos=[nameLocation==='start'?extent[0]-gapSignal*gap:nameLocation==='end'?extent[1]+gapSignal*gap:(extent[0]+extent[1])/2,// 'middle'\n// Reuse labelOffset.\nisNameLocationCenter(nameLocation)?opt.labelOffset+nameDirection*gap:0];var labelLayout;var nameRotation=axisModel.get('nameRotate');if(nameRotation!=null){nameRotation=nameRotation*PI$2/180;// To radian.\n}var axisNameAvailableWidth;if(isNameLocationCenter(nameLocation)){labelLayout=innerTextLayout(opt.rotation,nameRotation!=null?nameRotation:opt.rotation,// Adapt to axis.\nnameDirection);}else{labelLayout=endTextLayout(opt,nameLocation,nameRotation||0,extent);axisNameAvailableWidth=opt.axisNameAvailableWidth;if(axisNameAvailableWidth!=null){axisNameAvailableWidth=Math.abs(axisNameAvailableWidth/Math.sin(labelLayout.rotation));!isFinite(axisNameAvailableWidth)&&(axisNameAvailableWidth=null);}}var textFont=textStyleModel.getFont();var truncateOpt=axisModel.get('nameTruncate',true)||{};var ellipsis=truncateOpt.ellipsis;var maxWidth=retrieve(opt.nameTruncateMaxWidth,truncateOpt.maxWidth,axisNameAvailableWidth);// FIXME\n// truncate rich text? (consider performance)\nvar truncatedText=ellipsis!=null&&maxWidth!=null?truncateText$1(name,maxWidth,textFont,ellipsis,{minChar:2,placeholder:truncateOpt.placeholder}):name;var tooltipOpt=axisModel.get('tooltip',true);var mainType=axisModel.mainType;var formatterParams={componentType:mainType,name:name,$vars:['name']};formatterParams[mainType+'Index']=axisModel.componentIndex;var textEl=new Text({// Id for animation\nanid:'name',__fullText:name,__truncatedText:truncatedText,position:pos,rotation:labelLayout.rotation,silent:isLabelSilent(axisModel),z2:1,tooltip:tooltipOpt&&tooltipOpt.show?extend({content:name,formatter:function formatter(){return name;},formatterParams:formatterParams},tooltipOpt):null});setTextStyle(textEl.style,textStyleModel,{text:truncatedText,textFont:textFont,textFill:textStyleModel.getTextColor()||axisModel.get('axisLine.lineStyle.color'),textAlign:textStyleModel.get('align')||labelLayout.textAlign,textVerticalAlign:textStyleModel.get('verticalAlign')||labelLayout.textVerticalAlign});if(axisModel.get('triggerEvent')){textEl.eventData=makeAxisEventDataBase(axisModel);textEl.eventData.targetType='axisName';textEl.eventData.name=name;}// FIXME\nthis._dumbGroup.add(textEl);textEl.updateTransform();this.group.add(textEl);textEl.decomposeTransform();}};var makeAxisEventDataBase=AxisBuilder.makeAxisEventDataBase=function(axisModel){var eventData={componentType:axisModel.mainType,componentIndex:axisModel.componentIndex};eventData[axisModel.mainType+'Index']=axisModel.componentIndex;return eventData;};/**\n * @public\n * @static\n * @param {Object} opt\n * @param {number} axisRotation in radian\n * @param {number} textRotation in radian\n * @param {number} direction\n * @return {Object} {\n * rotation, // according to axis\n * textAlign,\n * textVerticalAlign\n * }\n */var innerTextLayout=AxisBuilder.innerTextLayout=function(axisRotation,textRotation,direction){var rotationDiff=remRadian(textRotation-axisRotation);var textAlign;var textVerticalAlign;if(isRadianAroundZero(rotationDiff)){// Label is parallel with axis line.\ntextVerticalAlign=direction>0?'top':'bottom';textAlign='center';}else if(isRadianAroundZero(rotationDiff-PI$2)){// Label is inverse parallel with axis line.\ntextVerticalAlign=direction>0?'bottom':'top';textAlign='center';}else{textVerticalAlign='middle';if(rotationDiff>0&&rotationDiff0?'right':'left';}else{textAlign=direction>0?'left':'right';}}return{rotation:rotationDiff,textAlign:textAlign,textVerticalAlign:textVerticalAlign};};function endTextLayout(opt,textPosition,textRotate,extent){var rotationDiff=remRadian(textRotate-opt.rotation);var textAlign;var textVerticalAlign;var inverse=extent[0]>extent[1];var onLeft=textPosition==='start'&&!inverse||textPosition!=='start'&&inverse;if(isRadianAroundZero(rotationDiff-PI$2/2)){textVerticalAlign=onLeft?'bottom':'top';textAlign='center';}else if(isRadianAroundZero(rotationDiff-PI$2*1.5)){textVerticalAlign=onLeft?'top':'bottom';textAlign='center';}else{textVerticalAlign='middle';if(rotationDiffPI$2/2){textAlign=onLeft?'left':'right';}else{textAlign=onLeft?'right':'left';}}return{rotation:rotationDiff,textAlign:textAlign,textVerticalAlign:textVerticalAlign};}var isLabelSilent=AxisBuilder.isLabelSilent=function(axisModel){var tooltipOpt=axisModel.get('tooltip');return axisModel.get('silent')// Consider mouse cursor, add these restrictions.\n||!(axisModel.get('triggerEvent')||tooltipOpt&&tooltipOpt.show);};function fixMinMaxLabelShow(axisModel,labelEls,tickEls){if(shouldShowAllLabels(axisModel.axis)){return;}// If min or max are user set, we need to check\n// If the tick on min(max) are overlap on their neighbour tick\n// If they are overlapped, we need to hide the min(max) tick label\nvar showMinLabel=axisModel.get('axisLabel.showMinLabel');var showMaxLabel=axisModel.get('axisLabel.showMaxLabel');// FIXME\n// Have not consider onBand yet, where tick els is more than label els.\nlabelEls=labelEls||[];tickEls=tickEls||[];var firstLabel=labelEls[0];var nextLabel=labelEls[1];var lastLabel=labelEls[labelEls.length-1];var prevLabel=labelEls[labelEls.length-2];var firstTick=tickEls[0];var nextTick=tickEls[1];var lastTick=tickEls[tickEls.length-1];var prevTick=tickEls[tickEls.length-2];if(showMinLabel===false){ignoreEl(firstLabel);ignoreEl(firstTick);}else if(isTwoLabelOverlapped(firstLabel,nextLabel)){if(showMinLabel){ignoreEl(nextLabel);ignoreEl(nextTick);}else{ignoreEl(firstLabel);ignoreEl(firstTick);}}if(showMaxLabel===false){ignoreEl(lastLabel);ignoreEl(lastTick);}else if(isTwoLabelOverlapped(prevLabel,lastLabel)){if(showMaxLabel){ignoreEl(prevLabel);ignoreEl(prevTick);}else{ignoreEl(lastLabel);ignoreEl(lastTick);}}}function ignoreEl(el){el&&(el.ignore=true);}function isTwoLabelOverlapped(current,next,labelLayout){// current and next has the same rotation.\nvar firstRect=current&¤t.getBoundingRect().clone();var nextRect=next&&next.getBoundingRect().clone();if(!firstRect||!nextRect){return;}// When checking intersect of two rotated labels, we use mRotationBack\n// to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\nvar mRotationBack=identity([]);rotate(mRotationBack,mRotationBack,-current.rotation);firstRect.applyTransform(mul$1([],mRotationBack,current.getLocalTransform()));nextRect.applyTransform(mul$1([],mRotationBack,next.getLocalTransform()));return firstRect.intersect(nextRect);}function isNameLocationCenter(nameLocation){return nameLocation==='middle'||nameLocation==='center';}function createTicks(ticksCoords,tickTransform,tickEndCoord,tickLineStyle,aniid){var tickEls=[];var pt1=[];var pt2=[];for(var i=0;i=0||linkPropValue===axisPropValue;}function fixValue(axisModel){var axisInfo=getAxisInfo(axisModel);if(!axisInfo){return;}var axisPointerModel=axisInfo.axisPointerModel;var scale=axisInfo.axis.scale;var option=axisPointerModel.option;var status=axisPointerModel.get('status');var value=axisPointerModel.get('value');// Parse init value for category and time axis.\nif(value!=null){value=scale.parse(value);}var useHandle=isHandleTrigger(axisPointerModel);// If `handle` used, `axisPointer` will always be displayed, so value\n// and status should be initialized.\nif(status==null){option.status=useHandle?'show':'hide';}var extent=scale.getExtent().slice();extent[0]>extent[1]&&extent.reverse();if(// Pick a value on axis when initializing.\nvalue==null// If both `handle` and `dataZoom` are used, value may be out of axis extent,\n// where we should re-pick a value to keep `handle` displaying normally.\n||value>extent[1]){// Make handle displayed on the end of the axis when init, which looks better.\nvalue=extent[1];}if(valueprogressiveThreshold){progressiveThreshold=largeThreshold;}return progressiveThreshold;},defaultOption:{// If clipped\n// Only available on cartesian2d\nclip:true,// If use caps on two sides of bars\n// Only available on tangential polar bar\nroundCap:false,showBackground:false,backgroundStyle:{color:'rgba(180, 180, 180, 0.2)',borderColor:null,borderWidth:0,borderType:'solid',borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function setLabel(normalStyle,hoverStyle,itemModel,color,seriesModel,dataIndex,labelPositionOutside){var labelModel=itemModel.getModel('label');var hoverLabelModel=itemModel.getModel('emphasis.label');setLabelStyle(normalStyle,hoverStyle,labelModel,hoverLabelModel,{labelFetcher:seriesModel,labelDataIndex:dataIndex,defaultText:getDefaultLabel(seriesModel.getData(),dataIndex),isRectText:true,autoColor:color});fixPosition(normalStyle);fixPosition(hoverStyle);}function fixPosition(style,labelPositionOutside){if(style.textPosition==='outside'){style.textPosition=labelPositionOutside;}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var _getBarItemStyle=makeStyleMapper([['fill','color'],['stroke','borderColor'],['lineWidth','borderWidth'],// Compatitable with 2\n['stroke','barBorderColor'],['lineWidth','barBorderWidth'],['opacity'],['shadowBlur'],['shadowOffsetX'],['shadowOffsetY'],['shadowColor']]);var barItemStyle={getBarItemStyle:function getBarItemStyle(excludes){var style=_getBarItemStyle(this,excludes);if(this.getBorderLineDash){var lineDash=this.getBorderLineDash();lineDash&&(style.lineDash=lineDash);}return style;}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Sausage: similar to sector, but have half circle on both sides\n * @public\n */var Sausage=extendShape({type:'sausage',shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:true},buildPath:function buildPath(ctx,shape){var x=shape.cx;var y=shape.cy;var r0=Math.max(shape.r0||0,0);var r=Math.max(shape.r,0);var dr=(r-r0)*0.5;var rCenter=r0+dr;var startAngle=shape.startAngle;var endAngle=shape.endAngle;var clockwise=shape.clockwise;var unitStartX=Math.cos(startAngle);var unitStartY=Math.sin(startAngle);var unitEndX=Math.cos(endAngle);var unitEndY=Math.sin(endAngle);var lessThanCircle=clockwise?endAngle-startAngle0?1:-1;var signY=layout.height>0?1:-1;return{x:layout.x+signX*fixedLineWidth/2,y:layout.y+signY*fixedLineWidth/2,width:layout.width-signX*fixedLineWidth,height:layout.height-signY*fixedLineWidth};},polar:function polar(data,dataIndex,itemModel){var layout=data.getItemLayout(dataIndex);return{cx:layout.cx,cy:layout.cy,r0:layout.r0,r:layout.r,startAngle:layout.startAngle,endAngle:layout.endAngle};}};function isZeroOnPolar(layout){return layout.startAngle!=null&&layout.endAngle!=null&&layout.startAngle===layout.endAngle;}function updateStyle(el,data,dataIndex,itemModel,layout,seriesModel,isHorizontal,isPolar){var color=data.getItemVisual(dataIndex,'color');var opacity=data.getItemVisual(dataIndex,'opacity');var stroke=data.getVisual('borderColor');var itemStyleModel=itemModel.getModel('itemStyle');var hoverStyle=itemModel.getModel('emphasis.itemStyle').getBarItemStyle();if(!isPolar){el.setShape('r',itemStyleModel.get('barBorderRadius')||0);}el.useStyle(defaults({stroke:isZeroOnPolar(layout)?'none':stroke,fill:isZeroOnPolar(layout)?'none':color,opacity:opacity},itemStyleModel.getBarItemStyle()));var cursorStyle=itemModel.getShallow('cursor');cursorStyle&&el.attr('cursor',cursorStyle);var labelPositionOutside=isHorizontal?layout.height>0?'bottom':'top':layout.width>0?'left':'right';if(!isPolar){setLabel(el.style,hoverStyle,itemModel,color,seriesModel,dataIndex,labelPositionOutside);}if(isZeroOnPolar(layout)){hoverStyle.fill=hoverStyle.stroke='none';}setHoverStyle(el,hoverStyle);}// In case width or height are too small.\nfunction getLineWidth(itemModel,rawLayout){var lineWidth=itemModel.get(BAR_BORDER_WIDTH_QUERY)||0;// width or height may be NaN for empty data\nvar width=isNaN(rawLayout.width)?Number.MAX_VALUE:Math.abs(rawLayout.width);var height=isNaN(rawLayout.height)?Number.MAX_VALUE:Math.abs(rawLayout.height);return Math.min(lineWidth,width,height);}var LargePath=Path.extend({type:'largeBar',shape:{points:[]},buildPath:function buildPath(ctx,shape){// Drawing lines is more efficient than drawing\n// a whole line or drawing rects.\nvar points=shape.points;var startPoint=this.__startPoint;var baseDimIdx=this.__baseDimIdx;for(var i=0;i=0?dataIndex:null;},30,false);function largePathFindDataIndex(largePath,x,y){var baseDimIdx=largePath.__baseDimIdx;var valueDimIdx=1-baseDimIdx;var points=largePath.shape.points;var largeDataIndices=largePath.__largeDataIndices;var barWidthHalf=Math.abs(largePath.__barWidth/2);var startValueVal=largePath.__startPoint[valueDimIdx];_eventPos[0]=x;_eventPos[1]=y;var pointerBaseVal=_eventPos[baseDimIdx];var pointerValueVal=_eventPos[1-baseDimIdx];var baseLowerBound=pointerBaseVal-barWidthHalf;var baseUpperBound=pointerBaseVal+barWidthHalf;for(var i=0,len=points.length/2;i=baseLowerBound&&barBaseVal<=baseUpperBound&&(startValueVal<=barValueVal?pointerValueVal>=startValueVal&&pointerValueVal<=barValueVal:pointerValueVal>=barValueVal&&pointerValueVal<=startValueVal)){return largeDataIndices[i];}}return-1;}function setLargeStyle(el,seriesModel,data){var borderColor=data.getVisual('borderColor')||data.getVisual('color');var itemStyle=seriesModel.getModel('itemStyle').getItemStyle(['color','borderColor']);el.useStyle(itemStyle);el.style.fill=null;el.style.stroke=borderColor;el.style.lineWidth=data.getLayout('barWidth');}function setLargeBackgroundStyle(el,backgroundModel,data){var borderColor=backgroundModel.get('borderColor')||backgroundModel.get('color');var itemStyle=backgroundModel.getItemStyle(['color','borderColor']);el.useStyle(itemStyle);el.style.fill=null;el.style.stroke=borderColor;el.style.lineWidth=data.getLayout('barWidth');}function createBackgroundShape(isHorizontalOrRadial,layout,coord){var coordLayout;var isPolar=coord.type==='polar';if(isPolar){coordLayout=coord.getArea();}else{coordLayout=coord.grid.getRect();}if(isPolar){return{cx:coordLayout.cx,cy:coordLayout.cy,r0:isHorizontalOrRadial?coordLayout.r0:layout.r0,r:isHorizontalOrRadial?coordLayout.r:layout.r,startAngle:isHorizontalOrRadial?layout.startAngle:0,endAngle:isHorizontalOrRadial?layout.endAngle:Math.PI*2};}else{return{x:isHorizontalOrRadial?layout.x:coordLayout.x,y:isHorizontalOrRadial?coordLayout.y:layout.y,width:isHorizontalOrRadial?layout.width:coordLayout.width,height:isHorizontalOrRadial?coordLayout.height:layout.height};}}function createBackgroundEl(coord,isHorizontalOrRadial,layout){var ElementClz=coord.type==='polar'?Sector:Rect;return new ElementClz({shape:createBackgroundShape(isHorizontalOrRadial,layout,coord),silent:true,z2:0});}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // In case developer forget to include grid component\nregisterLayout(PRIORITY.VISUAL.LAYOUT,curry(layout,'bar'));// Use higher prority to avoid to be blocked by other overall layout, which do not\n// only exist in this module, but probably also exist in other modules, like `barPolar`.\nregisterLayout(PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,largeLayout);registerVisual({seriesType:'bar',reset:function reset(seriesModel){// Visual coding for legend\nseriesModel.getData().setVisual('legendSymbol','roundRect');}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * [Usage]:\n * (1)\n * createListSimply(seriesModel, ['value']);\n * (2)\n * createListSimply(seriesModel, {\n * coordDimensions: ['value'],\n * dimensionsCount: 5\n * });\n *\n * @param {module:echarts/model/Series} seriesModel\n * @param {Object|Array.} opt opt or coordDimensions\n * The options in opt, see `echarts/data/helper/createDimensions`\n * @param {Array.} [nameList]\n * @return {module:echarts/data/List}\n */var createListSimply=function createListSimply(seriesModel,opt,nameList){opt=isArray(opt)&&{coordDimensions:opt}||extend({},opt);var source=seriesModel.getSource();var dimensionsInfo=createDimensions(source,opt);var list=new List(dimensionsInfo,seriesModel);list.initData(source,nameList);return list;};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Data selectable mixin for chart series.\n * To eanble data select, option of series must have `selectedMode`.\n * And each data item will use `selected` to toggle itself selected status\n */var dataSelectableMixin={/**\n * @param {Array.} targetList [{name, value, selected}, ...]\n * If targetList is an array, it should like [{name: ..., value: ...}, ...].\n * If targetList is a \"List\", it must have coordDim: 'value' dimension and name.\n */updateSelectedMap:function updateSelectedMap(targetList){this._targetList=isArray(targetList)?targetList.slice():[];this._selectTargetMap=reduce(targetList||[],function(targetMap,target){targetMap.set(target.name,target);return targetMap;},createHashMap());},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */ // PENGING If selectedMode is null ?\nselect:function select(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);var selectedMode=this.get('selectedMode');if(selectedMode==='single'){this._selectTargetMap.each(function(target){target.selected=false;});}target&&(target.selected=true);},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */unSelect:function unSelect(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);// var selectedMode = this.get('selectedMode');\n// selectedMode !== 'single' && target && (target.selected = false);\ntarget&&(target.selected=false);},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */toggleSelected:function toggleSelected(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);if(target!=null){this[target.selected?'unSelect':'select'](name,id);return target.selected;}},/**\n * Either name or id should be passed as input here.\n * If both of them are defined, id is used.\n *\n * @param {string|undefined} name name of data\n * @param {number|undefined} id dataIndex of data\n */isSelected:function isSelected(name,id){var target=id!=null?this._targetList[id]:this._selectTargetMap.get(name);return target&&target.selected;}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * LegendVisualProvider is an bridge that pick encoded color from data and\n * provide to the legend component.\n * @param {Function} getDataWithEncodedVisual Function to get data after filtered. It stores all the encoding info\n * @param {Function} getRawData Function to get raw data before filtered.\n */function LegendVisualProvider(getDataWithEncodedVisual,getRawData){this.getAllNames=function(){var rawData=getRawData();// We find the name from the raw data. In case it's filtered by the legend component.\n// Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\nreturn rawData.mapArray(rawData.getName);};this.containName=function(name){var rawData=getRawData();return rawData.indexOfName(name)>=0;};this.indexOfName=function(name){// Only get data when necessary.\n// Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n// Invoking Series#getData immediately will throw an error.\nvar dataWithEncodedVisual=getDataWithEncodedVisual();return dataWithEncodedVisual.indexOfName(name);};this.getItemVisual=function(dataIndex,key){// Get encoded visual properties from final filtered data.\nvar dataWithEncodedVisual=getDataWithEncodedVisual();return dataWithEncodedVisual.getItemVisual(dataIndex,key);};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var PieSeries=extendSeriesModel({type:'series.pie',// Overwrite\ninit:function init(option){PieSeries.superApply(this,'init',arguments);// Enable legend selection for each data item\n// Use a function instead of direct access because data reference may changed\nthis.legendVisualProvider=new LegendVisualProvider(bind(this.getData,this),bind(this.getRawData,this));this.updateSelectedMap(this._createSelectableList());this._defaultLabelLine(option);},// Overwrite\nmergeOption:function mergeOption(newOption){PieSeries.superCall(this,'mergeOption',newOption);this.updateSelectedMap(this._createSelectableList());},getInitialData:function getInitialData(option,ecModel){return createListSimply(this,{coordDimensions:['value'],encodeDefaulter:curry(makeSeriesEncodeForNameBased,this)});},_createSelectableList:function _createSelectableList(){var data=this.getRawData();var valueDim=data.mapDimension('value');var targetList=[];for(var i=0,len=data.count();i0&&(isFirstRender?animationType!=='scale':animationTypeUpdate!=='transition')){var shape=data.getItemLayout(0);for(var s=1;isNaN(shape.startAngle)&&s=itemLayout.r0;}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var createDataSelectAction=function createDataSelectAction(seriesType,actionInfos){each$1(actionInfos,function(actionInfo){actionInfo.update='updateView';/**\n * @payload\n * @property {string} seriesName\n * @property {string} name\n */registerAction(actionInfo,function(payload,ecModel){var selected={};ecModel.eachComponent({mainType:'series',subType:seriesType,query:payload},function(seriesModel){if(seriesModel[actionInfo.method]){seriesModel[actionInfo.method](payload.name,payload.dataIndex);}var data=seriesModel.getData();// Create selected map\ndata.each(function(idx){var name=data.getName(idx);selected[name]=seriesModel.isSelected(name)||false;});});return{name:payload.name,selected:selected,seriesId:payload.seriesId};});});};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nvar dataColor=function dataColor(seriesType){return{getTargetSeries:function getTargetSeries(ecModel){// Pie and funnel may use diferrent scope\nvar paletteScope={};var seiresModelMap=createHashMap();ecModel.eachSeriesByType(seriesType,function(seriesModel){seriesModel.__paletteScope=paletteScope;seiresModelMap.set(seriesModel.uid,seriesModel);});return seiresModelMap;},reset:function reset(seriesModel,ecModel){var dataAll=seriesModel.getRawData();var idxMap={};var data=seriesModel.getData();data.each(function(idx){var rawIdx=data.getRawIndex(idx);idxMap[rawIdx]=idx;});dataAll.each(function(rawIdx){var filteredIdx=idxMap[rawIdx];// If series.itemStyle.normal.color is a function. itemVisual may be encoded\nvar singleDataColor=filteredIdx!=null&&data.getItemVisual(filteredIdx,'color',true);var singleDataBorderColor=filteredIdx!=null&&data.getItemVisual(filteredIdx,'borderColor',true);var itemModel;if(!singleDataColor||!singleDataBorderColor){// FIXME Performance\nitemModel=dataAll.getItemModel(rawIdx);}if(!singleDataColor){var color=itemModel.get('itemStyle.color')||seriesModel.getColorFromPalette(dataAll.getName(rawIdx)||rawIdx+'',seriesModel.__paletteScope,dataAll.count());// Data is not filtered\nif(filteredIdx!=null){data.setItemVisual(filteredIdx,'color',color);}}if(!singleDataBorderColor){var borderColor=itemModel.get('itemStyle.borderColor');// Data is not filtered\nif(filteredIdx!=null){data.setItemVisual(filteredIdx,'borderColor',borderColor);}}});}};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // FIXME emphasis label position is not same with normal label position\nvar RADIAN$1=Math.PI/180;function adjustSingleSide(list,cx,cy,r,dir,viewWidth,viewHeight,viewLeft,viewTop,farthestX){list.sort(function(a,b){return a.y-b.y;});function shiftDown(start,end,delta,dir){for(var j=start;jviewTop+viewHeight){break;}list[j].y+=delta;if(j>start&&j+1list[j].y+list[j].height){shiftUp(j,delta/2);return;}}shiftUp(end-1,delta/2);}function shiftUp(end,delta){for(var j=end;j>=0;j--){if(list[j].y-delta0&&list[j].y>list[j-1].y+list[j-1].height){break;}}}function changeX(list,isDownList,cx,cy,r,dir){var lastDeltaX=dir>0?isDownList// right-side\n?Number.MAX_VALUE// down\n:0// up\n:isDownList// left-side\n?Number.MAX_VALUE// down\n:0;// up\nfor(var i=0,l=list.length;i=lastDeltaX){// right-down, left-down\ndeltaX=lastDeltaX-10;}if(!isDownList&&deltaX<=lastDeltaX){// right-up, left-up\ndeltaX=lastDeltaX+10;}list[i].x=cx+deltaX*dir;lastDeltaX=deltaX;}}var lastY=0;var delta;var len=list.length;var upList=[];var downList=[];for(var i=0;i=cy){downList.push(list[i]);}else{upList.push(list[i]);}}changeX(upList,false,cx,cy,r,dir);changeX(downList,true,cx,cy,r,dir);}function avoidOverlap(labelLayoutList,cx,cy,r,viewWidth,viewHeight,viewLeft,viewTop){var leftList=[];var rightList=[];var leftmostX=Number.MAX_VALUE;var rightmostX=-Number.MAX_VALUE;for(var i=0;i0?'right':'left':dx>0?'left':'right';}var labelRotate;var rotate=labelModel.get('rotate');if(typeof rotate==='number'){labelRotate=rotate*(Math.PI/180);}else{labelRotate=rotate?dx<0?-midAngle+Math.PI:-midAngle:0;}hasLabelRotate=!!labelRotate;layout.label={x:textX,y:textY,position:labelPosition,height:textRect.height,len:labelLineLen,len2:labelLineLen2,linePoints:linePoints,textAlign:textAlign,verticalAlign:'middle',rotation:labelRotate,inside:isLabelInside,labelDistance:labelDistance,labelAlignTo:labelAlignTo,labelMargin:labelMargin,bleedMargin:bleedMargin,textRect:textRect,text:text,font:font};// Not layout the inside label\nif(!isLabelInside){labelLayoutList.push(layout.label);}});if(!hasLabelRotate&&seriesModel.get('avoidLabelOverlap')){avoidOverlap(labelLayoutList,cx,cy,r,viewWidth,viewHeight,viewLeft,viewTop);}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var PI2$4=Math.PI*2;var RADIAN=Math.PI/180;function getViewRect(seriesModel,api){return getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()});}var pieLayout=function pieLayout(seriesType,ecModel,api,payload){ecModel.eachSeriesByType(seriesType,function(seriesModel){var data=seriesModel.getData();var valueDim=data.mapDimension('value');var viewRect=getViewRect(seriesModel,api);var center=seriesModel.get('center');var radius=seriesModel.get('radius');if(!isArray(radius)){radius=[0,radius];}if(!isArray(center)){center=[center,center];}var width=parsePercent$1(viewRect.width,api.getWidth());var height=parsePercent$1(viewRect.height,api.getHeight());var size=Math.min(width,height);var cx=parsePercent$1(center[0],width)+viewRect.x;var cy=parsePercent$1(center[1],height)+viewRect.y;var r0=parsePercent$1(radius[0],size/2);var r=parsePercent$1(radius[1],size/2);var startAngle=-seriesModel.get('startAngle')*RADIAN;var minAngle=seriesModel.get('minAngle')*RADIAN;var validDataCount=0;data.each(valueDim,function(value){!isNaN(value)&&validDataCount++;});var sum=data.getSum(valueDim);// Sum may be 0\nvar unitRadian=Math.PI/(sum||validDataCount)*2;var clockwise=seriesModel.get('clockwise');var roseType=seriesModel.get('roseType');var stillShowZeroSum=seriesModel.get('stillShowZeroSum');// [0...max]\nvar extent=data.getDataExtent(valueDim);extent[0]=0;// In the case some sector angle is smaller than minAngle\nvar restAngle=PI2$4;var valueSumLargerThanMinAngle=0;var currentAngle=startAngle;var dir=clockwise?1:-1;data.each(valueDim,function(value,idx){var angle;if(isNaN(value)){data.setItemLayout(idx,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:clockwise,cx:cx,cy:cy,r0:r0,r:roseType?NaN:r,viewRect:viewRect});return;}// FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\nif(roseType!=='area'){angle=sum===0&&stillShowZeroSum?unitRadian:value*unitRadian;}else{angle=PI2$4/validDataCount;}if(angle=0;idx--){var i=idx*2;var x0=points[i]-w/2;var y0=points[i+1]-h/2;if(x>=x0&&y>=y0&&x<=x0+w&&y<=y0+h){return idx;}}return-1;}});function LargeSymbolDraw(){this.group=new Group();}var largeSymbolProto=LargeSymbolDraw.prototype;largeSymbolProto.isPersistent=function(){return!this._incremental;};/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n * @param {Object} opt\n * @param {Object} [opt.clipShape]\n */largeSymbolProto.updateData=function(data,opt){this.group.removeAll();var symbolEl=new LargeSymbolPath({rectHover:true,cursor:'default'});symbolEl.setShape({points:data.getLayout('symbolPoints')});this._setCommon(symbolEl,data,false,opt);this.group.add(symbolEl);this._incremental=null;};largeSymbolProto.updateLayout=function(data){if(this._incremental){return;}var points=data.getLayout('symbolPoints');this.group.eachChild(function(child){if(child.startIndex!=null){var len=(child.endIndex-child.startIndex)*2;var byteOffset=child.startIndex*4*2;points=new Float32Array(points.buffer,byteOffset,len);}child.setShape('points',points);});};largeSymbolProto.incrementalPrepareUpdate=function(data){this.group.removeAll();this._clearIncremental();// Only use incremental displayables when data amount is larger than 2 million.\n// PENDING Incremental data?\nif(data.count()>2e6){if(!this._incremental){this._incremental=new IncrementalDisplayble({silent:true});}this.group.add(this._incremental);}else{this._incremental=null;}};largeSymbolProto.incrementalUpdate=function(taskParams,data,opt){var symbolEl;if(this._incremental){symbolEl=new LargeSymbolPath();this._incremental.addDisplayable(symbolEl,true);}else{symbolEl=new LargeSymbolPath({rectHover:true,cursor:'default',startIndex:taskParams.start,endIndex:taskParams.end});symbolEl.incremental=true;this.group.add(symbolEl);}symbolEl.setShape({points:data.getLayout('symbolPoints')});this._setCommon(symbolEl,data,!!this._incremental,opt);};largeSymbolProto._setCommon=function(symbolEl,data,isIncremental,opt){var hostModel=data.hostModel;opt=opt||{};// TODO\n// if (data.hasItemVisual.symbolSize) {\n// // TODO typed array?\n// symbolEl.setShape('sizes', data.mapArray(\n// function (idx) {\n// var size = data.getItemVisual(idx, 'symbolSize');\n// return (size instanceof Array) ? size : [size, size];\n// }\n// ));\n// }\n// else {\nvar size=data.getVisual('symbolSize');symbolEl.setShape('size',size instanceof Array?size:[size,size]);// }\nsymbolEl.softClipShape=opt.clipShape||null;// Create symbolProxy to build path for each data\nsymbolEl.symbolProxy=createSymbol(data.getVisual('symbol'),0,0,0,0);// Use symbolProxy setColor method\nsymbolEl.setColor=symbolEl.symbolProxy.setColor;var extrudeShadow=symbolEl.shape.size[0]=0){// Provide dataIndex for tooltip\nsymbolEl.dataIndex=dataIndex+(symbolEl.startIndex||0);}});}};largeSymbolProto.remove=function(){this._clearIncremental();this._incremental=null;this.group.removeAll();};largeSymbolProto._clearIncremental=function(){var incremental=this._incremental;if(incremental){incremental.clearDisplaybles();}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/extendChartView({type:'scatter',render:function render(seriesModel,ecModel,api){var data=seriesModel.getData();var symbolDraw=this._updateSymbolDraw(data,seriesModel);symbolDraw.updateData(data,{// TODO\n// If this parameter should be a shape or a bounding volume\n// shape will be more general.\n// But bounding volume like bounding rect will be much faster in the contain calculation\nclipShape:this._getClipShape(seriesModel)});this._finished=true;},incrementalPrepareRender:function incrementalPrepareRender(seriesModel,ecModel,api){var data=seriesModel.getData();var symbolDraw=this._updateSymbolDraw(data,seriesModel);symbolDraw.incrementalPrepareUpdate(data);this._finished=false;},incrementalRender:function incrementalRender(taskParams,seriesModel,ecModel){this._symbolDraw.incrementalUpdate(taskParams,seriesModel.getData(),{clipShape:this._getClipShape(seriesModel)});this._finished=taskParams.end===seriesModel.getData().count();},updateTransform:function updateTransform(seriesModel,ecModel,api){var data=seriesModel.getData();// Must mark group dirty and make sure the incremental layer will be cleared\n// PENDING\nthis.group.dirty();if(!this._finished||data.count()>1e4||!this._symbolDraw.isPersistent()){return{update:true};}else{var res=pointsLayout().reset(seriesModel);if(res.progress){res.progress({start:0,end:data.count()},data);}this._symbolDraw.updateLayout(data);}},_getClipShape:function _getClipShape(seriesModel){var coordSys=seriesModel.coordinateSystem;var clipArea=coordSys&&coordSys.getArea&&coordSys.getArea();return seriesModel.get('clip',true)?clipArea:null;},_updateSymbolDraw:function _updateSymbolDraw(data,seriesModel){var symbolDraw=this._symbolDraw;var pipelineContext=seriesModel.pipelineContext;var isLargeDraw=pipelineContext.large;if(!symbolDraw||isLargeDraw!==this._isLargeDraw){symbolDraw&&symbolDraw.remove();symbolDraw=this._symbolDraw=isLargeDraw?new LargeSymbolDraw():new SymbolDraw();this._isLargeDraw=isLargeDraw;this.group.removeAll();}this.group.add(symbolDraw.group);return symbolDraw;},remove:function remove(ecModel,api){this._symbolDraw&&this._symbolDraw.remove(true);this._symbolDraw=null;},dispose:function dispose(){}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // import * as zrUtil from 'zrender/src/core/util';\n// In case developer forget to include grid component\nregisterVisual(visualSymbol('scatter','circle'));registerLayout(pointsLayout('scatter'));// echarts.registerProcessor(function (ecModel, api) {\n// ecModel.eachSeriesByType('scatter', function (seriesModel) {\n// var data = seriesModel.getData();\n// var coordSys = seriesModel.coordinateSystem;\n// if (coordSys.type !== 'geo') {\n// return;\n// }\n// var startPt = coordSys.pointToData([0, 0]);\n// var endPt = coordSys.pointToData([api.getWidth(), api.getHeight()]);\n// var dims = zrUtil.map(coordSys.dimensions, function (dim) {\n// return data.mapDimension(dim);\n// });\n// var range = {};\n// range[dims[0]] = [Math.min(startPt[0], endPt[0]), Math.max(startPt[0], endPt[0])];\n// range[dims[1]] = [Math.min(startPt[1], endPt[1]), Math.max(startPt[1], endPt[1])];\n// data.selectRange(range);\n// });\n// });\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var _nonShapeGraphicElements={// Reserved but not supported in graphic component.\npath:null,compoundPath:null,// Supported in graphic component.\ngroup:Group,image:ZImage,text:Text};// -------------\n// Preprocessor\n// -------------\nregisterPreprocessor(function(option){var graphicOption=option.graphic;// Convert\n// {graphic: [{left: 10, type: 'circle'}, ...]}\n// or\n// {graphic: {left: 10, type: 'circle'}}\n// to\n// {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\nif(isArray(graphicOption)){if(!graphicOption[0]||!graphicOption[0].elements){option.graphic=[{elements:graphicOption}];}else{// Only one graphic instance can be instantiated. (We dont\n// want that too many views are created in echarts._viewMap)\noption.graphic=[option.graphic[0]];}}else if(graphicOption&&!graphicOption.elements){option.graphic=[{elements:[graphicOption]}];}});// ------\n// Model\n// ------\nvar GraphicModel=extendComponentModel({type:'graphic',defaultOption:{// Extra properties for each elements:\n//\n// left/right/top/bottom: (like 12, '22%', 'center', default undefined)\n// If left/rigth is set, shape.x/shape.cx/position will not be used.\n// If top/bottom is set, shape.y/shape.cy/position will not be used.\n// This mechanism is useful when you want to position a group/element\n// against the right side or the center of this container.\n//\n// width/height: (can only be pixel value, default 0)\n// Only be used to specify contianer(group) size, if needed. And\n// can not be percentage value (like '33%'). See the reason in the\n// layout algorithm below.\n//\n// bounding: (enum: 'all' (default) | 'raw')\n// Specify how to calculate boundingRect when locating.\n// 'all': Get uioned and transformed boundingRect\n// from both itself and its descendants.\n// This mode simplies confining a group of elements in the bounding\n// of their ancester container (e.g., using 'right: 0').\n// 'raw': Only use the boundingRect of itself and before transformed.\n// This mode is similar to css behavior, which is useful when you\n// want an element to be able to overflow its container. (Consider\n// a rotated circle needs to be located in a corner.)\n// info: custom info. enables user to mount some info on elements and use them\n// in event handlers. Update them only when user specified, otherwise, remain.\n// Note: elements is always behind its ancestors in this elements array.\nelements:[],parentId:null},/**\n * Save el options for the sake of the performance (only update modified graphics).\n * The order is the same as those in option. (ancesters -> descendants)\n *\n * @private\n * @type {Array.}\n */_elOptionsToUpdate:null,/**\n * @override\n */mergeOption:function mergeOption(option){// Prevent default merge to elements\nvar elements=this.option.elements;this.option.elements=null;GraphicModel.superApply(this,'mergeOption',arguments);this.option.elements=elements;},/**\n * @override\n */optionUpdated:function optionUpdated(newOption,isInit){var thisOption=this.option;var newList=(isInit?thisOption:newOption).elements;var existList=thisOption.elements=isInit?[]:thisOption.elements;var flattenedList=[];this._flatten(newList,flattenedList);var mappingResult=mappingToExists(existList,flattenedList);makeIdAndName(mappingResult);// Clear elOptionsToUpdate\nvar elOptionsToUpdate=this._elOptionsToUpdate=[];each$1(mappingResult,function(resultItem,index){var newElOption=resultItem.option;if(__DEV__){assert$1(isObject$1(newElOption)||resultItem.exist,'Empty graphic option definition');}if(!newElOption){return;}elOptionsToUpdate.push(newElOption);setKeyInfoToNewElOption(resultItem,newElOption);mergeNewElOptionToExist(existList,index,newElOption);setLayoutInfoToExist(existList[index],newElOption);},this);// Clean\nfor(var i=existList.length-1;i>=0;i--){if(existList[i]==null){existList.splice(i,1);}else{// $action should be volatile, otherwise option gotten from\n// `getOption` will contain unexpected $action.\ndelete existList[i].$action;}}},/**\n * Convert\n * [{\n * type: 'group',\n * id: 'xx',\n * children: [{type: 'circle'}, {type: 'polygon'}]\n * }]\n * to\n * [\n * {type: 'group', id: 'xx'},\n * {type: 'circle', parentId: 'xx'},\n * {type: 'polygon', parentId: 'xx'}\n * ]\n *\n * @private\n * @param {Array.} optionList option list\n * @param {Array.} result result of flatten\n * @param {Object} parentOption parent option\n */_flatten:function _flatten(optionList,result,parentOption){each$1(optionList,function(option){if(!option){return;}if(parentOption){option.parentOption=parentOption;}result.push(option);var children=option.children;if(option.type==='group'&&children){this._flatten(children,result,option);}// Deleting for JSON output, and for not affecting group creation.\ndelete option.children;},this);},// FIXME\n// Pass to view using payload? setOption has a payload?\nuseElOptionsToUpdate:function useElOptionsToUpdate(){var els=this._elOptionsToUpdate;// Clear to avoid render duplicately when zooming.\nthis._elOptionsToUpdate=null;return els;}});// -----\n// View\n// -----\nextendComponentView({type:'graphic',/**\n * @override\n */init:function init(ecModel,api){/**\n * @private\n * @type {module:zrender/core/util.HashMap}\n */this._elMap=createHashMap();/**\n * @private\n * @type {module:echarts/graphic/GraphicModel}\n */this._lastGraphicModel;},/**\n * @override\n */render:function render(graphicModel,ecModel,api){// Having leveraged between use cases and algorithm complexity, a very\n// simple layout mechanism is used:\n// The size(width/height) can be determined by itself or its parent (not\n// implemented yet), but can not by its children. (Top-down travel)\n// The location(x/y) can be determined by the bounding rect of itself\n// (can including its descendants or not) and the size of its parent.\n// (Bottom-up travel)\n// When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n// view will be reused.\nif(graphicModel!==this._lastGraphicModel){this._clear();}this._lastGraphicModel=graphicModel;this._updateElements(graphicModel);this._relocate(graphicModel,api);},/**\n * Update graphic elements.\n *\n * @private\n * @param {Object} graphicModel graphic model\n */_updateElements:function _updateElements(graphicModel){var elOptionsToUpdate=graphicModel.useElOptionsToUpdate();if(!elOptionsToUpdate){return;}var elMap=this._elMap;var rootGroup=this.group;// Top-down tranverse to assign graphic settings to each elements.\neach$1(elOptionsToUpdate,function(elOption){var $action=elOption.$action;var id=elOption.id;var existEl=elMap.get(id);var parentId=elOption.parentId;var targetElParent=parentId!=null?elMap.get(parentId):rootGroup;var elOptionStyle=elOption.style;if(elOption.type==='text'&&elOptionStyle){// In top/bottom mode, textVerticalAlign should not be used, which cause\n// inaccurately locating.\nif(elOption.hv&&elOption.hv[1]){elOptionStyle.textVerticalAlign=elOptionStyle.textBaseline=null;}// Compatible with previous setting: both support fill and textFill,\n// stroke and textStroke.\n!elOptionStyle.hasOwnProperty('textFill')&&elOptionStyle.fill&&(elOptionStyle.textFill=elOptionStyle.fill);!elOptionStyle.hasOwnProperty('textStroke')&&elOptionStyle.stroke&&(elOptionStyle.textStroke=elOptionStyle.stroke);}// Remove unnecessary props to avoid potential problems.\nvar elOptionCleaned=getCleanedElOption(elOption);// For simple, do not support parent change, otherwise reorder is needed.\nif(__DEV__){existEl&&assert$1(targetElParent===existEl.parent,'Changing parent is not supported.');}if(!$action||$action==='merge'){existEl?existEl.attr(elOptionCleaned):createEl(id,targetElParent,elOptionCleaned,elMap);}else if($action==='replace'){removeEl(existEl,elMap);createEl(id,targetElParent,elOptionCleaned,elMap);}else if($action==='remove'){removeEl(existEl,elMap);}var el=elMap.get(id);if(el){el.__ecGraphicWidthOption=elOption.width;el.__ecGraphicHeightOption=elOption.height;setEventData(el,graphicModel,elOption);}});},/**\n * Locate graphic elements.\n *\n * @private\n * @param {Object} graphicModel graphic model\n * @param {module:echarts/ExtensionAPI} api extension API\n */_relocate:function _relocate(graphicModel,api){var elOptions=graphicModel.option.elements;var rootGroup=this.group;var elMap=this._elMap;var apiWidth=api.getWidth();var apiHeight=api.getHeight();// Top-down to calculate percentage width/height of group\nfor(var i=0;i=0;i--){var elOption=elOptions[i];var el=elMap.get(elOption.id);if(!el){continue;}var parentEl=el.parent;var containerInfo=parentEl===rootGroup?{width:apiWidth,height:apiHeight}:{width:parentEl.__ecGraphicWidth,height:parentEl.__ecGraphicHeight};// PENDING\n// Currently, when `bounding: 'all'`, the union bounding rect of the group\n// does not include the rect of [0, 0, group.width, group.height], which\n// is probably weird for users. Should we make a break change for it?\npositionElement(el,elOption,containerInfo,null,{hv:elOption.hv,boundingMode:elOption.bounding});}},/**\n * Clear all elements.\n *\n * @private\n */_clear:function _clear(){var elMap=this._elMap;elMap.each(function(el){removeEl(el,elMap);});this._elMap=createHashMap();},/**\n * @override\n */dispose:function dispose(){this._clear();}});function createEl(id,targetElParent,elOption,elMap){var graphicType=elOption.type;if(__DEV__){assert$1(graphicType,'graphic type MUST be set');}var Clz=_nonShapeGraphicElements.hasOwnProperty(graphicType)// Those graphic elements are not shapes. They should not be\n// overwritten by users, so do them first.\n?_nonShapeGraphicElements[graphicType]:getShapeClass(graphicType);if(__DEV__){assert$1(Clz,'graphic type can not be found');}var el=new Clz(elOption);targetElParent.add(el);elMap.set(id,el);el.__ecGraphicId=id;}function removeEl(existEl,elMap){var existElParent=existEl&&existEl.parent;if(existElParent){existEl.type==='group'&&existEl.traverse(function(el){removeEl(el,elMap);});elMap.removeKey(existEl.__ecGraphicId);existElParent.remove(existEl);}}// Remove unnecessary props to avoid potential problems.\nfunction getCleanedElOption(elOption){elOption=extend({},elOption);each$1(['id','parentId','$action','hv','bounding'].concat(LOCATION_PARAMS),function(name){delete elOption[name];});return elOption;}function isSetLoc(obj,props){var isSet;each$1(props,function(prop){obj[prop]!=null&&obj[prop]!=='auto'&&(isSet=true);});return isSet;}function setKeyInfoToNewElOption(resultItem,newElOption){var existElOption=resultItem.exist;// Set id and type after id assigned.\nnewElOption.id=resultItem.keyInfo.id;!newElOption.type&&existElOption&&(newElOption.type=existElOption.type);// Set parent id if not specified\nif(newElOption.parentId==null){var newElParentOption=newElOption.parentOption;if(newElParentOption){newElOption.parentId=newElParentOption.id;}else if(existElOption){newElOption.parentId=existElOption.parentId;}}// Clear\nnewElOption.parentOption=null;}function mergeNewElOptionToExist(existList,index,newElOption){// Update existing options, for `getOption` feature.\nvar newElOptCopy=extend({},newElOption);var existElOption=existList[index];var $action=newElOption.$action||'merge';if($action==='merge'){if(existElOption){if(__DEV__){var newType=newElOption.type;assert$1(!newType||existElOption.type===newType,'Please set $action: \"replace\" to change `type`');}// We can ensure that newElOptCopy and existElOption are not\n// the same object, so `merge` will not change newElOptCopy.\nmerge(existElOption,newElOptCopy,true);// Rigid body, use ignoreSize.\nmergeLayoutParam(existElOption,newElOptCopy,{ignoreSize:true});// Will be used in render.\ncopyLayoutParams(newElOption,existElOption);}else{existList[index]=newElOptCopy;}}else if($action==='replace'){existList[index]=newElOptCopy;}else if($action==='remove'){// null will be cleaned later.\nexistElOption&&(existList[index]=null);}}function setLayoutInfoToExist(existItem,newElOption){if(!existItem){return;}existItem.hv=newElOption.hv=[// Rigid body, dont care `width`.\nisSetLoc(newElOption,['left','right']),// Rigid body, dont care `height`.\nisSetLoc(newElOption,['top','bottom'])];// Give default group size. Otherwise layout error may occur.\nif(existItem.type==='group'){existItem.width==null&&(existItem.width=newElOption.width=0);existItem.height==null&&(existItem.height=newElOption.height=0);}}function setEventData(el,graphicModel,elOption){var eventData=el.eventData;// Simple optimize for large amount of elements that no need event.\nif(!el.silent&&!el.ignore&&!eventData){eventData=el.eventData={componentType:'graphic',componentIndex:graphicModel.componentIndex,name:el.name};}// `elOption.info` enables user to mount some info on\n// elements and use them in event handlers.\nif(eventData){eventData.info=el.info;}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} {point: [x, y], el: ...} point Will not be null.\n */var findPointFromSeries=function findPointFromSeries(finder,ecModel){var point=[];var seriesIndex=finder.seriesIndex;var seriesModel;if(seriesIndex==null||!(seriesModel=ecModel.getSeriesByIndex(seriesIndex))){return{point:[]};}var data=seriesModel.getData();var dataIndex=queryDataIndex(data,finder);if(dataIndex==null||dataIndex<0||isArray(dataIndex)){return{point:[]};}var el=data.getItemGraphicEl(dataIndex);var coordSys=seriesModel.coordinateSystem;if(seriesModel.getTooltipPosition){point=seriesModel.getTooltipPosition(dataIndex)||[];}else if(coordSys&&coordSys.dataToPoint){point=coordSys.dataToPoint(data.getValues(map(coordSys.dimensions,function(dim){return data.mapDimension(dim);}),dataIndex,true))||[];}else if(el){// Use graphic bounding rect\nvar rect=el.getBoundingRect().clone();rect.applyTransform(el.transform);point=[rect.x+rect.width/2,rect.y+rect.height/2];}return{point:point,el:el};};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$7=each$1;var curry$2=curry;var inner$7=makeInner();/**\n * Basic logic: check all axis, if they do not demand show/highlight,\n * then hide/downplay them.\n *\n * @param {Object} coordSysAxesInfo\n * @param {Object} payload\n * @param {string} [payload.currTrigger] 'click' | 'mousemove' | 'leave'\n * @param {Array.} [payload.x] x and y, which are mandatory, specify a point to\n * trigger axisPointer and tooltip.\n * @param {Array.} [payload.y] x and y, which are mandatory, specify a point to\n * trigger axisPointer and tooltip.\n * @param {Object} [payload.seriesIndex] finder, optional, restrict target axes.\n * @param {Object} [payload.dataIndex] finder, restrict target axes.\n * @param {Object} [payload.axesInfo] finder, restrict target axes.\n * [{\n * axisDim: 'x'|'y'|'angle'|...,\n * axisIndex: ...,\n * value: ...\n * }, ...]\n * @param {Function} [payload.dispatchAction]\n * @param {Object} [payload.tooltipOption]\n * @param {Object|Array.|Function} [payload.position] Tooltip position,\n * which can be specified in dispatchAction\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n * @return {Object} content of event obj for echarts.connect.\n */var axisTrigger=function axisTrigger(payload,ecModel,api){var currTrigger=payload.currTrigger;var point=[payload.x,payload.y];var finder=payload;var dispatchAction=payload.dispatchAction||bind(api.dispatchAction,api);var coordSysAxesInfo=ecModel.getComponent('axisPointer').coordSysAxesInfo;// Pending\n// See #6121. But we are not able to reproduce it yet.\nif(!coordSysAxesInfo){return;}if(illegalPoint(point)){// Used in the default behavior of `connection`: use the sample seriesIndex\n// and dataIndex. And also used in the tooltipView trigger.\npoint=findPointFromSeries({seriesIndex:finder.seriesIndex,// Do not use dataIndexInside from other ec instance.\n// FIXME: auto detect it?\ndataIndex:finder.dataIndex},ecModel).point;}var isIllegalPoint=illegalPoint(point);// Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n// Notice: In this case, it is difficult to get the `point` (which is necessary to show\n// tooltip, so if point is not given, we just use the point found by sample seriesIndex\n// and dataIndex.\nvar inputAxesInfo=finder.axesInfo;var axesInfo=coordSysAxesInfo.axesInfo;var shouldHide=currTrigger==='leave'||illegalPoint(point);var outputFinder={};var showValueMap={};var dataByCoordSys={list:[],map:{}};var updaters={showPointer:curry$2(showPointer,showValueMap),showTooltip:curry$2(showTooltip,dataByCoordSys)};// Process for triggered axes.\neach$7(coordSysAxesInfo.coordSysMap,function(coordSys,coordSysKey){// If a point given, it must be contained by the coordinate system.\nvar coordSysContainsPoint=isIllegalPoint||coordSys.containPoint(point);each$7(coordSysAxesInfo.coordSysAxesInfo[coordSysKey],function(axisInfo,key){var axis=axisInfo.axis;var inputAxisInfo=findInputAxisInfo(inputAxesInfo,axisInfo);// If no inputAxesInfo, no axis is restricted.\nif(!shouldHide&&coordSysContainsPoint&&(!inputAxesInfo||inputAxisInfo)){var val=inputAxisInfo&&inputAxisInfo.value;if(val==null&&!isIllegalPoint){val=axis.pointToData(point);}val!=null&&processOnAxis(axisInfo,val,updaters,false,outputFinder);}});});// Process for linked axes.\nvar linkTriggers={};each$7(axesInfo,function(tarAxisInfo,tarKey){var linkGroup=tarAxisInfo.linkGroup;// If axis has been triggered in the previous stage, it should not be triggered by link.\nif(linkGroup&&!showValueMap[tarKey]){each$7(linkGroup.axesInfo,function(srcAxisInfo,srcKey){var srcValItem=showValueMap[srcKey];// If srcValItem exist, source axis is triggered, so link to target axis.\nif(srcAxisInfo!==tarAxisInfo&&srcValItem){var val=srcValItem.value;linkGroup.mapper&&(val=tarAxisInfo.axis.scale.parse(linkGroup.mapper(val,makeMapperParam(srcAxisInfo),makeMapperParam(tarAxisInfo))));linkTriggers[tarAxisInfo.key]=val;}});}});each$7(linkTriggers,function(val,tarKey){processOnAxis(axesInfo[tarKey],val,updaters,true,outputFinder);});updateModelActually(showValueMap,axesInfo,outputFinder);dispatchTooltipActually(dataByCoordSys,point,payload,dispatchAction);dispatchHighDownActually(axesInfo,dispatchAction,api);return outputFinder;};function processOnAxis(axisInfo,newValue,updaters,dontSnap,outputFinder){var axis=axisInfo.axis;if(axis.scale.isBlank()||!axis.containData(newValue)){return;}if(!axisInfo.involveSeries){updaters.showPointer(axisInfo,newValue);return;}// Heavy calculation. So put it after axis.containData checking.\nvar payloadInfo=buildPayloadsBySeries(newValue,axisInfo);var payloadBatch=payloadInfo.payloadBatch;var snapToValue=payloadInfo.snapToValue;// Fill content of event obj for echarts.connect.\n// By default use the first involved series data as a sample to connect.\nif(payloadBatch[0]&&outputFinder.seriesIndex==null){extend(outputFinder,payloadBatch[0]);}// If no linkSource input, this process is for collecting link\n// target, where snap should not be accepted.\nif(!dontSnap&&axisInfo.snap){if(axis.containData(snapToValue)&&snapToValue!=null){newValue=snapToValue;}}updaters.showPointer(axisInfo,newValue,payloadBatch,outputFinder);// Tooltip should always be snapToValue, otherwise there will be\n// incorrect \"axis value ~ series value\" mapping displayed in tooltip.\nupdaters.showTooltip(axisInfo,payloadInfo,snapToValue);}function buildPayloadsBySeries(value,axisInfo){var axis=axisInfo.axis;var dim=axis.dim;var snapToValue=value;var payloadBatch=[];var minDist=Number.MAX_VALUE;var minDiff=-1;each$7(axisInfo.seriesModels,function(series,idx){var dataDim=series.getData().mapDimension(dim,true);var seriesNestestValue;var dataIndices;if(series.getAxisTooltipData){var result=series.getAxisTooltipData(dataDim,value,axis);dataIndices=result.dataIndices;seriesNestestValue=result.nestestValue;}else{dataIndices=series.getData().indicesOfNearest(dataDim[0],value,// Add a threshold to avoid find the wrong dataIndex\n// when data length is not same.\n// false,\naxis.type==='category'?0.5:null);if(!dataIndices.length){return;}seriesNestestValue=series.getData().get(dataDim[0],dataIndices[0]);}if(seriesNestestValue==null||!isFinite(seriesNestestValue)){return;}var diff=value-seriesNestestValue;var dist=Math.abs(diff);// Consider category case\nif(dist<=minDist){if(dist=0&&minDiff<0){minDist=dist;minDiff=diff;snapToValue=seriesNestestValue;payloadBatch.length=0;}each$7(dataIndices,function(dataIndex){payloadBatch.push({seriesIndex:series.seriesIndex,dataIndexInside:dataIndex,dataIndex:series.getData().getRawIndex(dataIndex)});});}});return{payloadBatch:payloadBatch,snapToValue:snapToValue};}function showPointer(showValueMap,axisInfo,value,payloadBatch){showValueMap[axisInfo.key]={value:value,payloadBatch:payloadBatch};}function showTooltip(dataByCoordSys,axisInfo,payloadInfo,value){var payloadBatch=payloadInfo.payloadBatch;var axis=axisInfo.axis;var axisModel=axis.model;var axisPointerModel=axisInfo.axisPointerModel;// If no data, do not create anything in dataByCoordSys,\n// whose length will be used to judge whether dispatch action.\nif(!axisInfo.triggerTooltip||!payloadBatch.length){return;}var coordSysModel=axisInfo.coordSys.model;var coordSysKey=makeKey(coordSysModel);var coordSysItem=dataByCoordSys.map[coordSysKey];if(!coordSysItem){coordSysItem=dataByCoordSys.map[coordSysKey]={coordSysId:coordSysModel.id,coordSysIndex:coordSysModel.componentIndex,coordSysType:coordSysModel.type,coordSysMainType:coordSysModel.mainType,dataByAxis:[]};dataByCoordSys.list.push(coordSysItem);}coordSysItem.dataByAxis.push({axisDim:axis.dim,axisIndex:axisModel.componentIndex,axisType:axisModel.type,axisId:axisModel.id,value:value,// Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n// depends that all models have been updated. So it should not be performed\n// here. Considering axisPointerModel used here is volatile, which is hard\n// to be retrieve in TooltipView, we prepare parameters here.\nvalueLabelOpt:{precision:axisPointerModel.get('label.precision'),formatter:axisPointerModel.get('label.formatter')},seriesDataIndices:payloadBatch.slice()});}function updateModelActually(showValueMap,axesInfo,outputFinder){var outputAxesInfo=outputFinder.axesInfo=[];// Basic logic: If no 'show' required, 'hide' this axisPointer.\neach$7(axesInfo,function(axisInfo,key){var option=axisInfo.axisPointerModel.option;var valItem=showValueMap[key];if(valItem){!axisInfo.useHandle&&(option.status='show');option.value=valItem.value;// For label formatter param and highlight.\noption.seriesDataIndices=(valItem.payloadBatch||[]).slice();}// When always show (e.g., handle used), remain\n// original value and status.\nelse{// If hide, value still need to be set, consider\n// click legend to toggle axis blank.\n!axisInfo.useHandle&&(option.status='hide');}// If status is 'hide', should be no info in payload.\noption.status==='show'&&outputAxesInfo.push({axisDim:axisInfo.axis.dim,axisIndex:axisInfo.axis.model.componentIndex,value:option.value});});}function dispatchTooltipActually(dataByCoordSys,point,payload,dispatchAction){// Basic logic: If no showTip required, hideTip will be dispatched.\nif(illegalPoint(point)||!dataByCoordSys.list.length){dispatchAction({type:'hideTip'});return;}// In most case only one axis (or event one series is used). It is\n// convinient to fetch payload.seriesIndex and payload.dataIndex\n// dirtectly. So put the first seriesIndex and dataIndex of the first\n// axis on the payload.\nvar sampleItem=((dataByCoordSys.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};dispatchAction({type:'showTip',escapeConnect:true,x:point[0],y:point[1],tooltipOption:payload.tooltipOption,position:payload.position,dataIndexInside:sampleItem.dataIndexInside,dataIndex:sampleItem.dataIndex,seriesIndex:sampleItem.seriesIndex,dataByCoordSys:dataByCoordSys.list});}function dispatchHighDownActually(axesInfo,dispatchAction,api){// FIXME\n// highlight status modification shoule be a stage of main process?\n// (Consider confilct (e.g., legend and axisPointer) and setOption)\nvar zr=api.getZr();var highDownKey='axisPointerLastHighlights';var lastHighlights=inner$7(zr)[highDownKey]||{};var newHighlights=inner$7(zr)[highDownKey]={};// Update highlight/downplay status according to axisPointer model.\n// Build hash map and remove duplicate incidentally.\neach$7(axesInfo,function(axisInfo,key){var option=axisInfo.axisPointerModel.option;option.status==='show'&&each$7(option.seriesDataIndices,function(batchItem){var key=batchItem.seriesIndex+' | '+batchItem.dataIndex;newHighlights[key]=batchItem;});});// Diff.\nvar toHighlight=[];var toDownplay=[];each$1(lastHighlights,function(batchItem,key){!newHighlights[key]&&toDownplay.push(batchItem);});each$1(newHighlights,function(batchItem,key){!lastHighlights[key]&&toHighlight.push(batchItem);});toDownplay.length&&api.dispatchAction({type:'downplay',escapeConnect:true,batch:toDownplay});toHighlight.length&&api.dispatchAction({type:'highlight',escapeConnect:true,batch:toHighlight});}function findInputAxisInfo(inputAxesInfo,axisInfo){for(var i=0;i<(inputAxesInfo||[]).length;i++){var inputAxisInfo=inputAxesInfo[i];if(axisInfo.axis.dim===inputAxisInfo.axisDim&&axisInfo.axis.model.componentIndex===inputAxisInfo.axisIndex){return inputAxisInfo;}}}function makeMapperParam(axisInfo){var axisModel=axisInfo.axis.model;var item={};var dim=item.axisDim=axisInfo.axis.dim;item.axisIndex=item[dim+'AxisIndex']=axisModel.componentIndex;item.axisName=item[dim+'AxisName']=axisModel.name;item.axisId=item[dim+'AxisId']=axisModel.id;return item;}function illegalPoint(point){return!point||point[0]==null||isNaN(point[0])||point[1]==null||isNaN(point[1]);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AxisPointerModel=extendComponentModel({type:'axisPointer',coordSysAxesInfo:null,defaultOption:{// 'auto' means that show when triggered by tooltip or handle.\nshow:'auto',// 'click' | 'mousemove' | 'none'\ntriggerOn:null,// set default in AxisPonterView.js\nzlevel:0,z:50,type:'line',// 'line' 'shadow' 'cross' 'none'.\n// axispointer triggered by tootip determine snap automatically,\n// see `modelHelper`.\nsnap:false,triggerTooltip:true,value:null,status:null,// Init value depends on whether handle is used.\n// [group0, group1, ...]\n// Each group can be: {\n// mapper: function () {},\n// singleTooltip: 'multiple', // 'multiple' or 'single'\n// xAxisId: ...,\n// yAxisName: ...,\n// angleAxisIndex: ...\n// }\n// mapper: can be ignored.\n// input: {axisInfo, value}\n// output: {axisInfo, value}\nlink:[],// Do not set 'auto' here, otherwise global animation: false\n// will not effect at this axispointer.\nanimation:null,animationDurationUpdate:200,lineStyle:{color:'#aaa',width:1,type:'solid'},shadowStyle:{color:'rgba(150,150,150,0.3)'},label:{show:true,formatter:null,// string | Function\nprecision:'auto',// Or a number like 0, 1, 2 ...\nmargin:3,color:'#fff',padding:[5,7,5,7],backgroundColor:'auto',// default: axis line color\nborderColor:null,borderWidth:0,shadowBlur:3,shadowColor:'#aaa'// Considering applicability, common style should\n// better not have shadowOffset.\n// shadowOffsetX: 0,\n// shadowOffsetY: 2\n},handle:{show:false,/* eslint-disable */icon:'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',// jshint ignore:line\n/* eslint-enable */size:45,// handle margin is from symbol center to axis, which is stable when circular move.\nmargin:50,// color: '#1b8bbd'\n// color: '#2f4554'\ncolor:'#333',shadowBlur:3,shadowColor:'#aaa',shadowOffsetX:0,shadowOffsetY:2,// For mobile performance\nthrottle:40}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var inner$8=makeInner();var each$8=each$1;/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n * param: {string} currTrigger\n * param: {Array.} point\n */function register(key,api,handler){if(env$1.node){return;}var zr=api.getZr();inner$8(zr).records||(inner$8(zr).records={});initGlobalListeners(zr,api);var record=inner$8(zr).records[key]||(inner$8(zr).records[key]={});record.handler=handler;}function initGlobalListeners(zr,api){if(inner$8(zr).initialized){return;}inner$8(zr).initialized=true;useHandler('click',curry(doEnter,'click'));useHandler('mousemove',curry(doEnter,'mousemove'));// useHandler('mouseout', onLeave);\nuseHandler('globalout',onLeave);function useHandler(eventType,cb){zr.on(eventType,function(e){var dis=makeDispatchAction(api);each$8(inner$8(zr).records,function(record){record&&cb(record,e,dis.dispatchAction);});dispatchTooltipFinally(dis.pendings,api);});}}function dispatchTooltipFinally(pendings,api){var showLen=pendings.showTip.length;var hideLen=pendings.hideTip.length;var actuallyPayload;if(showLen){actuallyPayload=pendings.showTip[showLen-1];}else if(hideLen){actuallyPayload=pendings.hideTip[hideLen-1];}if(actuallyPayload){actuallyPayload.dispatchAction=null;api.dispatchAction(actuallyPayload);}}function onLeave(record,e,dispatchAction){record.handler('leave',null,dispatchAction);}function doEnter(currTrigger,record,e,dispatchAction){record.handler(currTrigger,e,dispatchAction);}function makeDispatchAction(api){var pendings={showTip:[],hideTip:[]};// FIXME\n// better approach?\n// 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n// which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n// So we have to add \"final stage\" to merge those dispatched actions.\nvar dispatchAction=function dispatchAction(payload){var pendingList=pendings[payload.type];if(pendingList){pendingList.push(payload);}else{payload.dispatchAction=dispatchAction;api.dispatchAction(payload);}};return{dispatchAction:dispatchAction,pendings:pendings};}/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n */function unregister(key,api){if(env$1.node){return;}var zr=api.getZr();var record=(inner$8(zr).records||{})[key];if(record){inner$8(zr).records[key]=null;}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AxisPointerView=extendComponentView({type:'axisPointer',render:function render(globalAxisPointerModel,ecModel,api){var globalTooltipModel=ecModel.getComponent('tooltip');var triggerOn=globalAxisPointerModel.get('triggerOn')||globalTooltipModel&&globalTooltipModel.get('triggerOn')||'mousemove|click';// Register global listener in AxisPointerView to enable\n// AxisPointerView to be independent to Tooltip.\nregister('axisPointer',api,function(currTrigger,e,dispatchAction){// If 'none', it is not controlled by mouse totally.\nif(triggerOn!=='none'&&(currTrigger==='leave'||triggerOn.indexOf(currTrigger)>=0)){dispatchAction({type:'updateAxisPointer',currTrigger:currTrigger,x:e&&e.offsetX,y:e&&e.offsetY});}});},/**\n * @override\n */remove:function remove(ecModel,api){unregister(api.getZr(),'axisPointer');AxisPointerView.superApply(this._model,'remove',arguments);},/**\n * @override\n */dispose:function dispose(ecModel,api){unregister('axisPointer',api);AxisPointerView.superApply(this._model,'dispose',arguments);}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var inner$9=makeInner();var clone$4=_clone;var bind$1=bind;/**\n * Base axis pointer class in 2D.\n * Implemenents {module:echarts/component/axis/IAxisPointer}.\n */function BaseAxisPointer(){}BaseAxisPointer.prototype={/**\n * @private\n */_group:null,/**\n * @private\n */_lastGraphicKey:null,/**\n * @private\n */_handle:null,/**\n * @private\n */_dragging:false,/**\n * @private\n */_lastValue:null,/**\n * @private\n */_lastStatus:null,/**\n * @private\n */_payloadInfo:null,/**\n * In px, arbitrary value. Do not set too small,\n * no animation is ok for most cases.\n * @protected\n */animationThreshold:15,/**\n * @implement\n */render:function render(axisModel,axisPointerModel,api,forceRender){var value=axisPointerModel.get('value');var status=axisPointerModel.get('status');// Bind them to `this`, not in closure, otherwise they will not\n// be replaced when user calling setOption in not merge mode.\nthis._axisModel=axisModel;this._axisPointerModel=axisPointerModel;this._api=api;// Optimize: `render` will be called repeatly during mouse move.\n// So it is power consuming if performing `render` each time,\n// especially on mobile device.\nif(!forceRender&&this._lastValue===value&&this._lastStatus===status){return;}this._lastValue=value;this._lastStatus=status;var group=this._group;var handle=this._handle;if(!status||status==='hide'){// Do not clear here, for animation better.\ngroup&&group.hide();handle&&handle.hide();return;}group&&group.show();handle&&handle.show();// Otherwise status is 'show'\nvar elOption={};this.makeElOption(elOption,value,axisModel,axisPointerModel,api);// Enable change axis pointer type.\nvar graphicKey=elOption.graphicKey;if(graphicKey!==this._lastGraphicKey){this.clear(api);}this._lastGraphicKey=graphicKey;var moveAnimation=this._moveAnimation=this.determineAnimation(axisModel,axisPointerModel);if(!group){group=this._group=new Group();this.createPointerEl(group,elOption,axisModel,axisPointerModel);this.createLabelEl(group,elOption,axisModel,axisPointerModel);api.getZr().add(group);}else{var doUpdateProps=curry(updateProps$1,axisPointerModel,moveAnimation);this.updatePointerEl(group,elOption,doUpdateProps,axisPointerModel);this.updateLabelEl(group,elOption,doUpdateProps,axisPointerModel);}updateMandatoryProps(group,axisPointerModel,true);this._renderHandle(value);},/**\n * @implement\n */remove:function remove(api){this.clear(api);},/**\n * @implement\n */dispose:function dispose(api){this.clear(api);},/**\n * @protected\n */determineAnimation:function determineAnimation(axisModel,axisPointerModel){var animation=axisPointerModel.get('animation');var axis=axisModel.axis;var isCategoryAxis=axis.type==='category';var useSnap=axisPointerModel.get('snap');// Value axis without snap always do not snap.\nif(!useSnap&&!isCategoryAxis){return false;}if(animation==='auto'||animation==null){var animationThreshold=this.animationThreshold;if(isCategoryAxis&&axis.getBandWidth()>animationThreshold){return true;}// It is important to auto animation when snap used. Consider if there is\n// a dataZoom, animation will be disabled when too many points exist, while\n// it will be enabled for better visual effect when little points exist.\nif(useSnap){var seriesDataCount=getAxisInfo(axisModel).seriesDataCount;var axisExtent=axis.getExtent();// Approximate band width\nreturn Math.abs(axisExtent[0]-axisExtent[1])/seriesDataCount>animationThreshold;}return false;}return animation===true;},/**\n * add {pointer, label, graphicKey} to elOption\n * @protected\n */makeElOption:function makeElOption(elOption,value,axisModel,axisPointerModel,api){// Shoule be implemenented by sub-class.\n},/**\n * @protected\n */createPointerEl:function createPointerEl(group,elOption,axisModel,axisPointerModel){var pointerOption=elOption.pointer;if(pointerOption){var pointerEl=inner$9(group).pointerEl=new graphic[pointerOption.type](clone$4(elOption.pointer));group.add(pointerEl);}},/**\n * @protected\n */createLabelEl:function createLabelEl(group,elOption,axisModel,axisPointerModel){if(elOption.label){var labelEl=inner$9(group).labelEl=new Rect(clone$4(elOption.label));group.add(labelEl);updateLabelShowHide(labelEl,axisPointerModel);}},/**\n * @protected\n */updatePointerEl:function updatePointerEl(group,elOption,updateProps$$1){var pointerEl=inner$9(group).pointerEl;if(pointerEl&&elOption.pointer){pointerEl.setStyle(elOption.pointer.style);updateProps$$1(pointerEl,{shape:elOption.pointer.shape});}},/**\n * @protected\n */updateLabelEl:function updateLabelEl(group,elOption,updateProps$$1,axisPointerModel){var labelEl=inner$9(group).labelEl;if(labelEl){labelEl.setStyle(elOption.label.style);updateProps$$1(labelEl,{// Consider text length change in vertical axis, animation should\n// be used on shape, otherwise the effect will be weird.\nshape:elOption.label.shape,position:elOption.label.position});updateLabelShowHide(labelEl,axisPointerModel);}},/**\n * @private\n */_renderHandle:function _renderHandle(value){if(this._dragging||!this.updateHandleTransform){return;}var axisPointerModel=this._axisPointerModel;var zr=this._api.getZr();var handle=this._handle;var handleModel=axisPointerModel.getModel('handle');var status=axisPointerModel.get('status');if(!handleModel.get('show')||!status||status==='hide'){handle&&zr.remove(handle);this._handle=null;return;}var isInit;if(!this._handle){isInit=true;handle=this._handle=createIcon(handleModel.get('icon'),{cursor:'move',draggable:true,onmousemove:function onmousemove(e){// Fot mobile devicem, prevent screen slider on the button.\nstop(e.event);},onmousedown:bind$1(this._onHandleDragMove,this,0,0),drift:bind$1(this._onHandleDragMove,this),ondragend:bind$1(this._onHandleDragEnd,this)});zr.add(handle);}updateMandatoryProps(handle,axisPointerModel,false);// update style\nvar includeStyles=['color','borderColor','borderWidth','opacity','shadowColor','shadowBlur','shadowOffsetX','shadowOffsetY'];handle.setStyle(handleModel.getItemStyle(null,includeStyles));// update position\nvar handleSize=handleModel.get('size');if(!isArray(handleSize)){handleSize=[handleSize,handleSize];}handle.attr('scale',[handleSize[0]/2,handleSize[1]/2]);createOrUpdate(this,'_doDispatchAxisPointer',handleModel.get('throttle')||0,'fixRate');this._moveHandleToValue(value,isInit);},/**\n * @private\n */_moveHandleToValue:function _moveHandleToValue(value,isInit){updateProps$1(this._axisPointerModel,!isInit&&this._moveAnimation,this._handle,getHandleTransProps(this.getHandleTransform(value,this._axisModel,this._axisPointerModel)));},/**\n * @private\n */_onHandleDragMove:function _onHandleDragMove(dx,dy){var handle=this._handle;if(!handle){return;}this._dragging=true;// Persistent for throttle.\nvar trans=this.updateHandleTransform(getHandleTransProps(handle),[dx,dy],this._axisModel,this._axisPointerModel);this._payloadInfo=trans;handle.stopAnimation();handle.attr(getHandleTransProps(trans));inner$9(handle).lastProp=null;this._doDispatchAxisPointer();},/**\n * Throttled method.\n * @private\n */_doDispatchAxisPointer:function _doDispatchAxisPointer(){var handle=this._handle;if(!handle){return;}var payloadInfo=this._payloadInfo;var axisModel=this._axisModel;this._api.dispatchAction({type:'updateAxisPointer',x:payloadInfo.cursorPoint[0],y:payloadInfo.cursorPoint[1],tooltipOption:payloadInfo.tooltipOption,axesInfo:[{axisDim:axisModel.axis.dim,axisIndex:axisModel.componentIndex}]});},/**\n * @private\n */_onHandleDragEnd:function _onHandleDragEnd(moveAnimation){this._dragging=false;var handle=this._handle;if(!handle){return;}var value=this._axisPointerModel.get('value');// Consider snap or categroy axis, handle may be not consistent with\n// axisPointer. So move handle to align the exact value position when\n// drag ended.\nthis._moveHandleToValue(value);// For the effect: tooltip will be shown when finger holding on handle\n// button, and will be hidden after finger left handle button.\nthis._api.dispatchAction({type:'hideTip'});},/**\n * Should be implemenented by sub-class if support `handle`.\n * @protected\n * @param {number} value\n * @param {module:echarts/model/Model} axisModel\n * @param {module:echarts/model/Model} axisPointerModel\n * @return {Object} {position: [x, y], rotation: 0}\n */getHandleTransform:null,/**\n * * Should be implemenented by sub-class if support `handle`.\n * @protected\n * @param {Object} transform {position, rotation}\n * @param {Array.} delta [dx, dy]\n * @param {module:echarts/model/Model} axisModel\n * @param {module:echarts/model/Model} axisPointerModel\n * @return {Object} {position: [x, y], rotation: 0, cursorPoint: [x, y]}\n */updateHandleTransform:null,/**\n * @private\n */clear:function clear(api){this._lastValue=null;this._lastStatus=null;var zr=api.getZr();var group=this._group;var handle=this._handle;if(zr&&group){this._lastGraphicKey=null;group&&zr.remove(group);handle&&zr.remove(handle);this._group=null;this._handle=null;this._payloadInfo=null;}},/**\n * @protected\n */doClear:function doClear(){// Implemented by sub-class if necessary.\n},/**\n * @protected\n * @param {Array.} xy\n * @param {Array.} wh\n * @param {number} [xDimIndex=0] or 1\n */buildLabel:function buildLabel(xy,wh,xDimIndex){xDimIndex=xDimIndex||0;return{x:xy[xDimIndex],y:xy[1-xDimIndex],width:wh[xDimIndex],height:wh[1-xDimIndex]};}};BaseAxisPointer.prototype.constructor=BaseAxisPointer;function updateProps$1(animationModel,moveAnimation,el,props){// Animation optimize.\nif(!propsEqual(inner$9(el).lastProp,props)){inner$9(el).lastProp=props;moveAnimation?updateProps(el,props,animationModel):(el.stopAnimation(),el.attr(props));}}function propsEqual(lastProps,newProps){if(isObject$1(lastProps)&&isObject$1(newProps)){var equals=true;each$1(newProps,function(item,key){equals=equals&&propsEqual(lastProps[key],item);});return!!equals;}else{return lastProps===newProps;}}function updateLabelShowHide(labelEl,axisPointerModel){labelEl[axisPointerModel.get('label.show')?'show':'hide']();}function getHandleTransProps(trans){return{position:trans.position.slice(),rotation:trans.rotation||0};}function updateMandatoryProps(group,axisPointerModel,silent){var z=axisPointerModel.get('z');var zlevel=axisPointerModel.get('zlevel');group&&group.traverse(function(el){if(el.type!=='group'){z!=null&&(el.z=z);zlevel!=null&&(el.zlevel=zlevel);el.silent=silent;}});}enableClassExtend(BaseAxisPointer);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @param {module:echarts/model/Model} axisPointerModel\n */function buildElStyle(axisPointerModel){var axisPointerType=axisPointerModel.get('type');var styleModel=axisPointerModel.getModel(axisPointerType+'Style');var style;if(axisPointerType==='line'){style=styleModel.getLineStyle();style.fill=null;}else if(axisPointerType==='shadow'){style=styleModel.getAreaStyle();style.stroke=null;}return style;}/**\n * @param {Function} labelPos {align, verticalAlign, position}\n */function buildLabelElOption(elOption,axisModel,axisPointerModel,api,labelPos){var value=axisPointerModel.get('value');var text=getValueLabel(value,axisModel.axis,axisModel.ecModel,axisPointerModel.get('seriesDataIndices'),{precision:axisPointerModel.get('label.precision'),formatter:axisPointerModel.get('label.formatter')});var labelModel=axisPointerModel.getModel('label');var paddings=normalizeCssArray$1(labelModel.get('padding')||0);var font=labelModel.getFont();var textRect=_getBoundingRect(text,font);var position=labelPos.position;var width=textRect.width+paddings[1]+paddings[3];var height=textRect.height+paddings[0]+paddings[2];// Adjust by align.\nvar align=labelPos.align;align==='right'&&(position[0]-=width);align==='center'&&(position[0]-=width/2);var verticalAlign=labelPos.verticalAlign;verticalAlign==='bottom'&&(position[1]-=height);verticalAlign==='middle'&&(position[1]-=height/2);// Not overflow ec container\nconfineInContainer(position,width,height,api);var bgColor=labelModel.get('backgroundColor');if(!bgColor||bgColor==='auto'){bgColor=axisModel.get('axisLine.lineStyle.color');}elOption.label={shape:{x:0,y:0,width:width,height:height,r:labelModel.get('borderRadius')},position:position.slice(),// TODO: rich\nstyle:{text:text,textFont:font,textFill:labelModel.getTextColor(),textPosition:'inside',textPadding:paddings,fill:bgColor,stroke:labelModel.get('borderColor')||'transparent',lineWidth:labelModel.get('borderWidth')||0,shadowBlur:labelModel.get('shadowBlur'),shadowColor:labelModel.get('shadowColor'),shadowOffsetX:labelModel.get('shadowOffsetX'),shadowOffsetY:labelModel.get('shadowOffsetY')},// Lable should be over axisPointer.\nz2:10};}// Do not overflow ec container\nfunction confineInContainer(position,width,height,api){var viewWidth=api.getWidth();var viewHeight=api.getHeight();position[0]=Math.min(position[0]+width,viewWidth)-width;position[1]=Math.min(position[1]+height,viewHeight)-height;position[0]=Math.max(position[0],0);position[1]=Math.max(position[1],0);}/**\n * @param {number} value\n * @param {module:echarts/coord/Axis} axis\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} opt\n * @param {Array.} seriesDataIndices\n * @param {number|string} opt.precision 'auto' or a number\n * @param {string|Function} opt.formatter label formatter\n */function getValueLabel(value,axis,ecModel,seriesDataIndices,opt){value=axis.scale.parse(value);var text=axis.scale.getLabel(// If `precision` is set, width can be fixed (like '12.00500'), which\n// helps to debounce when when moving label.\nvalue,{precision:opt.precision});var formatter=opt.formatter;if(formatter){var params={value:getAxisRawValue(axis,value),axisDimension:axis.dim,axisIndex:axis.index,seriesData:[]};each$1(seriesDataIndices,function(idxItem){var series=ecModel.getSeriesByIndex(idxItem.seriesIndex);var dataIndex=idxItem.dataIndexInside;var dataParams=series&&series.getDataParams(dataIndex);dataParams&¶ms.seriesData.push(dataParams);});if(isString(formatter)){text=formatter.replace('{value}',text);}else if(isFunction$1(formatter)){text=formatter(params);}}return text;}/**\n * @param {module:echarts/coord/Axis} axis\n * @param {number} value\n * @param {Object} layoutInfo {\n * rotation, position, labelOffset, labelDirection, labelMargin\n * }\n */function getTransformedPosition(axis,value,layoutInfo){var transform=create$1();rotate(transform,transform,layoutInfo.rotation);translate(transform,transform,layoutInfo.position);return applyTransform$1([axis.dataToCoord(value),(layoutInfo.labelOffset||0)+(layoutInfo.labelDirection||1)*(layoutInfo.labelMargin||0)],transform);}function buildCartesianSingleLabelElOption(value,elOption,layoutInfo,axisModel,axisPointerModel,api){var textLayout=AxisBuilder.innerTextLayout(layoutInfo.rotation,0,layoutInfo.labelDirection);layoutInfo.labelMargin=axisPointerModel.get('label.margin');buildLabelElOption(elOption,axisModel,axisPointerModel,api,{position:getTransformedPosition(axisModel.axis,value,layoutInfo),align:textLayout.textAlign,verticalAlign:textLayout.textVerticalAlign});}/**\n * @param {Array.} p1\n * @param {Array.} p2\n * @param {number} [xDimIndex=0] or 1\n */function makeLineShape(p1,p2,xDimIndex){xDimIndex=xDimIndex||0;return{x1:p1[xDimIndex],y1:p1[1-xDimIndex],x2:p2[xDimIndex],y2:p2[1-xDimIndex]};}/**\n * @param {Array.} xy\n * @param {Array.} wh\n * @param {number} [xDimIndex=0] or 1\n */function makeRectShape(xy,wh,xDimIndex){xDimIndex=xDimIndex||0;return{x:xy[xDimIndex],y:xy[1-xDimIndex],width:wh[xDimIndex],height:wh[1-xDimIndex]};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var CartesianAxisPointer=BaseAxisPointer.extend({/**\n * @override\n */makeElOption:function makeElOption(elOption,value,axisModel,axisPointerModel,api){var axis=axisModel.axis;var grid=axis.grid;var axisPointerType=axisPointerModel.get('type');var otherExtent=getCartesian(grid,axis).getOtherAxis(axis).getGlobalExtent();var pixelValue=axis.toGlobalCoord(axis.dataToCoord(value,true));if(axisPointerType&&axisPointerType!=='none'){var elStyle=buildElStyle(axisPointerModel);var pointerOption=pointerShapeBuilder[axisPointerType](axis,pixelValue,otherExtent);pointerOption.style=elStyle;elOption.graphicKey=pointerOption.type;elOption.pointer=pointerOption;}var layoutInfo=layout$1(grid.model,axisModel);buildCartesianSingleLabelElOption(value,elOption,layoutInfo,axisModel,axisPointerModel,api);},/**\n * @override\n */getHandleTransform:function getHandleTransform(value,axisModel,axisPointerModel){var layoutInfo=layout$1(axisModel.axis.grid.model,axisModel,{labelInside:false});layoutInfo.labelMargin=axisPointerModel.get('handle.margin');return{position:getTransformedPosition(axisModel.axis,value,layoutInfo),rotation:layoutInfo.rotation+(layoutInfo.labelDirection<0?Math.PI:0)};},/**\n * @override\n */updateHandleTransform:function updateHandleTransform(transform,delta,axisModel,axisPointerModel){var axis=axisModel.axis;var grid=axis.grid;var axisExtent=axis.getGlobalExtent(true);var otherExtent=getCartesian(grid,axis).getOtherAxis(axis).getGlobalExtent();var dimIndex=axis.dim==='x'?0:1;var currPosition=transform.position;currPosition[dimIndex]+=delta[dimIndex];currPosition[dimIndex]=Math.min(axisExtent[1],currPosition[dimIndex]);currPosition[dimIndex]=Math.max(axisExtent[0],currPosition[dimIndex]);var cursorOtherValue=(otherExtent[1]+otherExtent[0])/2;var cursorPoint=[cursorOtherValue,cursorOtherValue];cursorPoint[dimIndex]=currPosition[dimIndex];// Make tooltip do not overlap axisPointer and in the middle of the grid.\nvar tooltipOptions=[{verticalAlign:'middle'},{align:'center'}];return{position:currPosition,rotation:transform.rotation,cursorPoint:cursorPoint,tooltipOption:tooltipOptions[dimIndex]};}});function getCartesian(grid,axis){var opt={};opt[axis.dim+'AxisIndex']=axis.index;return grid.getCartesian(opt);}var pointerShapeBuilder={line:function line(axis,pixelValue,otherExtent){var targetShape=makeLineShape([pixelValue,otherExtent[0]],[pixelValue,otherExtent[1]],getAxisDimIndex(axis));return{type:'Line',subPixelOptimize:true,shape:targetShape};},shadow:function shadow(axis,pixelValue,otherExtent){var bandWidth=Math.max(1,axis.getBandWidth());var span=otherExtent[1]-otherExtent[0];return{type:'Rect',shape:makeRectShape([pixelValue-bandWidth/2,otherExtent[0]],[bandWidth,span],getAxisDimIndex(axis))};}};function getAxisDimIndex(axis){return axis.dim==='x'?0:1;}AxisView.registerAxisPointerClass('CartesianAxisPointer',CartesianAxisPointer);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // CartesianAxisPointer is not supposed to be required here. But consider\n// echarts.simple.js and online build tooltip, which only require gridSimple,\n// CartesianAxisPointer should be able to required somewhere.\nregisterPreprocessor(function(option){// Always has a global axisPointerModel for default setting.\nif(option){(!option.axisPointer||option.axisPointer.length===0)&&(option.axisPointer={});var link=option.axisPointer.link;// Normalize to array to avoid object mergin. But if link\n// is not set, remain null/undefined, otherwise it will\n// override existent link setting.\nif(link&&!isArray(link)){option.axisPointer.link=[link];}}});// This process should proformed after coordinate systems created\n// and series data processed. So put it on statistic processing stage.\nregisterProcessor(PRIORITY.PROCESSOR.STATISTIC,function(ecModel,api){// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\necModel.getComponent('axisPointer').coordSysAxesInfo=collect(ecModel,api);});// Broadcast to all views.\nregisterAction({type:'updateAxisPointer',event:'updateAxisPointer',update:':updateAxisPointer'},axisTrigger);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/extendComponentModel({type:'tooltip',dependencies:['axisPointer'],defaultOption:{zlevel:0,z:60,show:true,// tooltip主体内容\nshowContent:true,// 'trigger' only works on coordinate system.\n// 'item' | 'axis' | 'none'\ntrigger:'item',// 'click' | 'mousemove' | 'none'\ntriggerOn:'mousemove|click',alwaysShowContent:false,displayMode:'single',// 'single' | 'multipleByCoordSys'\nrenderMode:'auto',// 'auto' | 'html' | 'richText'\n// 'auto': use html by default, and use non-html if `document` is not defined\n// 'html': use html for tooltip\n// 'richText': use canvas, svg, and etc. for tooltip\n// 位置 {Array} | {Function}\n// position: null\n// Consider triggered from axisPointer handle, verticalAlign should be 'middle'\n// align: null,\n// verticalAlign: null,\n// 是否约束 content 在 viewRect 中。默认 false 是为了兼容以前版本。\nconfine:false,// 内容格式器:{string}(Template) ¦ {Function}\n// formatter: null\nshowDelay:0,// 隐藏延迟,单位ms\nhideDelay:100,// 动画变换时间,单位s\ntransitionDuration:0.4,enterable:false,// 提示背景颜色,默认为透明度为0.7的黑色\nbackgroundColor:'rgba(50,50,50,0.7)',// 提示边框颜色\nborderColor:'#333',// 提示边框圆角,单位px,默认为4\nborderRadius:4,// 提示边框线宽,单位px,默认为0(无边框)\nborderWidth:0,// 提示内边距,单位px,默认各方向内边距为5,\n// 接受数组分别设定上右下左边距,同css\npadding:5,// Extra css text\nextraCssText:'',// 坐标轴指示器,坐标轴触发有效\naxisPointer:{// 默认为直线\n// 可选为:'line' | 'shadow' | 'cross'\ntype:'line',// type 为 line 的时候有效,指定 tooltip line 所在的轴,可选\n// 可选 'x' | 'y' | 'angle' | 'radius' | 'auto'\n// 默认 'auto',会选择类型为 category 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴\n// 极坐标系会默认选择 angle 轴\naxis:'auto',animation:'auto',animationDurationUpdate:200,animationEasingUpdate:'exponentialOut',crossStyle:{color:'#999',width:1,type:'dashed',// TODO formatter\ntextStyle:{}}// lineStyle and shadowStyle should not be specified here,\n// otherwise it will always override those styles on option.axisPointer.\n},textStyle:{color:'#fff',fontSize:14}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$10=each$1;var toCamelCase$1=toCamelCase;var vendors=['','-webkit-','-moz-','-o-'];var gCssText='position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';/**\n * @param {number} duration\n * @return {string}\n * @inner\n */function assembleTransition(duration){var transitionCurve='cubic-bezier(0.23, 1, 0.32, 1)';var transitionText='left '+duration+'s '+transitionCurve+','+'top '+duration+'s '+transitionCurve;return map(vendors,function(vendorPrefix){return vendorPrefix+'transition:'+transitionText;}).join(';');}/**\n * @param {Object} textStyle\n * @return {string}\n * @inner\n */function assembleFont(textStyleModel){var cssText=[];var fontSize=textStyleModel.get('fontSize');var color=textStyleModel.getTextColor();color&&cssText.push('color:'+color);cssText.push('font:'+textStyleModel.getFont());var lineHeight=textStyleModel.get('lineHeight');if(lineHeight==null){lineHeight=Math.round(fontSize*3/2);}fontSize&&cssText.push('line-height:'+lineHeight+'px');var shadowColor=textStyleModel.get('textShadowColor');var shadowBlur=textStyleModel.get('textShadowBlur')||0;var shadowOffsetX=textStyleModel.get('textShadowOffsetX')||0;var shadowOffsetY=textStyleModel.get('textShadowOffsetY')||0;shadowBlur&&cssText.push('text-shadow:'+shadowOffsetX+'px '+shadowOffsetY+'px '+shadowBlur+'px '+shadowColor);each$10(['decoration','align'],function(name){var val=textStyleModel.get(name);val&&cssText.push('text-'+name+':'+val);});return cssText.join(';');}/**\n * @param {Object} tooltipModel\n * @return {string}\n * @inner\n */function assembleCssText(tooltipModel){var cssText=[];var transitionDuration=tooltipModel.get('transitionDuration');var backgroundColor=tooltipModel.get('backgroundColor');var textStyleModel=tooltipModel.getModel('textStyle');var padding=tooltipModel.get('padding');// Animation transition. Do not animate when transitionDuration is 0.\ntransitionDuration&&cssText.push(assembleTransition(transitionDuration));if(backgroundColor){if(env$1.canvasSupported){cssText.push('background-Color:'+backgroundColor);}else{// for ie\ncssText.push('background-Color:#'+toHex(backgroundColor));cssText.push('filter:alpha(opacity=70)');}}// Border style\neach$10(['width','color','radius'],function(name){var borderName='border-'+name;var camelCase=toCamelCase$1(borderName);var val=tooltipModel.get(camelCase);val!=null&&cssText.push(borderName+':'+val+(name==='color'?'':'px'));});// Text style\ncssText.push(assembleFont(textStyleModel));// Padding\nif(padding!=null){cssText.push('padding:'+normalizeCssArray$1(padding).join('px ')+'px');}return cssText.join(';')+';';}// If not able to make, do not modify the input `out`.\nfunction makeStyleCoord(out,zr,appendToBody,zrX,zrY){var zrPainter=zr&&zr.painter;if(appendToBody){var zrViewportRoot=zrPainter&&zrPainter.getViewportRoot();if(zrViewportRoot){// Some APPs might use scale on body, so we support CSS transform here.\ntransformLocalCoord(out,zrViewportRoot,document.body,zrX,zrY);}}else{out[0]=zrX;out[1]=zrY;// xy should be based on canvas root. But tooltipContent is\n// the sibling of canvas root. So padding of ec container\n// should be considered here.\nvar viewportRootOffset=zrPainter&&zrPainter.getViewportRootOffset();if(viewportRootOffset){out[0]+=viewportRootOffset.offsetLeft;out[1]+=viewportRootOffset.offsetTop;}}out[2]=out[0]/zr.getWidth();// The ratio of left to width\nout[3]=out[1]/zr.getHeight();// The ratio of top to height\n}/**\n * @alias module:echarts/component/tooltip/TooltipContent\n * @param {HTMLElement} container\n * @param {ExtensionAPI} api\n * @param {Object} [opt]\n * @param {boolean} [opt.appendToBody]\n * `false`: the DOM element will be inside the container. Default value.\n * `true`: the DOM element will be appended to HTML body, which avoid\n * some overflow clip but intrude outside of the container.\n * @constructor\n */function TooltipContent(container,api,opt){if(env$1.wxa){return null;}var el=document.createElement('div');el.domBelongToZr=true;this.el=el;var zr=this._zr=api.getZr();var appendToBody=this._appendToBody=opt&&opt.appendToBody;this._styleCoord=[0,0,0,0];// [left, top, left/width, top/height]\nmakeStyleCoord(this._styleCoord,zr,appendToBody,api.getWidth()/2,api.getHeight()/2);if(appendToBody){document.body.appendChild(el);}else{container.appendChild(el);}this._container=container;this._show=false;/**\n * @private\n */this._hideTimeout;// FIXME\n// Is it needed to trigger zr event manually if\n// the browser do not support `pointer-events: none`.\nvar self=this;el.onmouseenter=function(){// clear the timeout in hideLater and keep showing tooltip\nif(self._enterable){clearTimeout(self._hideTimeout);self._show=true;}self._inContent=true;};el.onmousemove=function(e){e=e||window.event;if(!self._enterable){// `pointer-events: none` is set to tooltip content div\n// if `enterable` is set as `false`, and `el.onmousemove`\n// can not be triggered. But in browser that do not\n// support `pointer-events`, we need to do this:\n// Try trigger zrender event to avoid mouse\n// in and out shape too frequently\nvar handler=zr.handler;var zrViewportRoot=zr.painter.getViewportRoot();normalizeEvent(zrViewportRoot,e,true);handler.dispatch('mousemove',e);}};el.onmouseleave=function(){if(self._enterable){if(self._show){self.hideLater(self._hideDelay);}}self._inContent=false;};}TooltipContent.prototype={constructor:TooltipContent,/**\n * @private\n * @type {boolean}\n */_enterable:true,/**\n * Update when tooltip is rendered\n */update:function update(tooltipModel){// FIXME\n// Move this logic to ec main?\nvar container=this._container;var stl=container.currentStyle||document.defaultView.getComputedStyle(container);var domStyle=container.style;if(domStyle.position!=='absolute'&&stl.position!=='absolute'){domStyle.position='relative';}var alwaysShowContent=tooltipModel.get('alwaysShowContent');alwaysShowContent&&this._moveTooltipIfResized();// Hide the tooltip\n// PENDING\n// this.hide();\n},/**\n * when `alwaysShowContent` is true,\n * we should move the tooltip after chart resized\n */_moveTooltipIfResized:function _moveTooltipIfResized(){var ratioX=this._styleCoord[2];// The ratio of left to width\nvar ratioY=this._styleCoord[3];// The ratio of top to height\nvar realX=ratioX*this._zr.getWidth();var realY=ratioY*this._zr.getHeight();this.moveTo(realX,realY);},show:function show(tooltipModel){clearTimeout(this._hideTimeout);var el=this.el;var styleCoord=this._styleCoord;el.style.cssText=gCssText+assembleCssText(tooltipModel)// Because of the reason described in:\n// http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore\n// we should set initial value to `left` and `top`.\n+';left:'+styleCoord[0]+'px;top:'+styleCoord[1]+'px;'+(tooltipModel.get('extraCssText')||'');el.style.display=el.innerHTML?'block':'none';// If mouse occasionally move over the tooltip, a mouseout event will be\n// triggered by canvas, and cause some unexpectable result like dragging\n// stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n// it. Although it is not supported by IE8~IE10, fortunately it is a rare\n// scenario.\nel.style.pointerEvents=this._enterable?'auto':'none';this._show=true;},setContent:function setContent(content){this.el.innerHTML=content==null?'':content;},setEnterable:function setEnterable(enterable){this._enterable=enterable;},getSize:function getSize(){var el=this.el;return[el.clientWidth,el.clientHeight];},moveTo:function moveTo(zrX,zrY){var styleCoord=this._styleCoord;makeStyleCoord(styleCoord,this._zr,this._appendToBody,zrX,zrY);var style=this.el.style;style.left=styleCoord[0]+'px';style.top=styleCoord[1]+'px';},hide:function hide(){this.el.style.display='none';this._show=false;},hideLater:function hideLater(time){if(this._show&&!(this._inContent&&this._enterable)){if(time){this._hideDelay=time;// Set show false to avoid invoke hideLater multiple times\nthis._show=false;this._hideTimeout=setTimeout(bind(this.hide,this),time);}else{this.hide();}}},isShow:function isShow(){return this._show;},dispose:function dispose(){this.el.parentNode.removeChild(this.el);},getOuterSize:function getOuterSize(){var width=this.el.clientWidth;var height=this.el.clientHeight;// Consider browser compatibility.\n// IE8 does not support getComputedStyle.\nif(document.defaultView&&document.defaultView.getComputedStyle){var stl=document.defaultView.getComputedStyle(this.el);if(stl){width+=parseInt(stl.borderLeftWidth,10)+parseInt(stl.borderRightWidth,10);height+=parseInt(stl.borderTopWidth,10)+parseInt(stl.borderBottomWidth,10);}}return{width:width,height:height};}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // import Group from 'zrender/src/container/Group';\nfunction makeStyleCoord$1(out,zr,zrX,zrY){out[0]=zrX;out[1]=zrY;out[2]=out[0]/zr.getWidth();// The ratio of left to width\nout[3]=out[1]/zr.getHeight();// The ratio of top to height\n}/**\n * @alias module:echarts/component/tooltip/TooltipRichContent\n * @constructor\n */function TooltipRichContent(api){var zr=this._zr=api.getZr();this._styleCoord=[0,0,0,0];// [left, top, left/width, top/height]\nmakeStyleCoord$1(this._styleCoord,zr,api.getWidth()/2,api.getHeight()/2);this._show=false;/**\n * @private\n */this._hideTimeout;}TooltipRichContent.prototype={constructor:TooltipRichContent,/**\n * @private\n * @type {boolean}\n */_enterable:true,/**\n * Update when tooltip is rendered\n */update:function update(tooltipModel){var alwaysShowContent=tooltipModel.get('alwaysShowContent');alwaysShowContent&&this._moveTooltipIfResized();},/**\n * when `alwaysShowContent` is true,\n * we should move the tooltip after chart resized\n */_moveTooltipIfResized:function _moveTooltipIfResized(){var ratioX=this._styleCoord[2];// The ratio of left to width\nvar ratioY=this._styleCoord[3];// The ratio of top to height\nvar realX=ratioX*this._zr.getWidth();var realY=ratioY*this._zr.getHeight();this.moveTo(realX,realY);},show:function show(tooltipModel){if(this._hideTimeout){clearTimeout(this._hideTimeout);}this.el.attr('show',true);this._show=true;},/**\n * Set tooltip content\n *\n * @param {string} content rich text string of content\n * @param {Object} markerRich rich text style\n * @param {Object} tooltipModel tooltip model\n */setContent:function setContent(content,markerRich,tooltipModel){if(this.el){this._zr.remove(this.el);}var markers={};var text=content;var prefix='{marker';var suffix='|}';var startId=text.indexOf(prefix);while(startId>=0){var endId=text.indexOf(suffix);var name=text.substr(startId+prefix.length,endId-startId-prefix.length);if(name.indexOf('sub')>-1){markers['marker'+name]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:markerRich[name],// TODO: textOffset is not implemented for rich text\ntextOffset:[3,0]};}else{markers['marker'+name]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:markerRich[name]};}text=text.substr(endId+1);startId=text.indexOf('{marker');}var textStyleModel=tooltipModel.getModel('textStyle');var fontSize=textStyleModel.get('fontSize');var lineHeight=tooltipModel.get('textLineHeight');if(lineHeight==null){lineHeight=Math.round(fontSize*3/2);}this.el=new Text({style:setTextStyle({},textStyleModel,{rich:markers,text:content,textBackgroundColor:tooltipModel.get('backgroundColor'),textBorderRadius:tooltipModel.get('borderRadius'),textFill:tooltipModel.get('textStyle.color'),textPadding:tooltipModel.get('padding'),textLineHeight:lineHeight}),z:tooltipModel.get('z')});this._zr.add(this.el);var self=this;this.el.on('mouseover',function(){// clear the timeout in hideLater and keep showing tooltip\nif(self._enterable){clearTimeout(self._hideTimeout);self._show=true;}self._inContent=true;});this.el.on('mouseout',function(){if(self._enterable){if(self._show){self.hideLater(self._hideDelay);}}self._inContent=false;});},setEnterable:function setEnterable(enterable){this._enterable=enterable;},getSize:function getSize(){var bounding=this.el.getBoundingRect();return[bounding.width,bounding.height];},moveTo:function moveTo(x,y){if(this.el){var styleCoord=this._styleCoord;makeStyleCoord$1(styleCoord,this._zr,x,y);this.el.attr('position',[styleCoord[0],styleCoord[1]]);}},hide:function hide(){if(this.el){this.el.hide();}this._show=false;},hideLater:function hideLater(time){if(this._show&&!(this._inContent&&this._enterable)){if(time){this._hideDelay=time;// Set show false to avoid invoke hideLater multiple times\nthis._show=false;this._hideTimeout=setTimeout(bind(this.hide,this),time);}else{this.hide();}}},isShow:function isShow(){return this._show;},dispose:function dispose(){clearTimeout(this._hideTimeout);if(this.el){this._zr.remove(this.el);}},getOuterSize:function getOuterSize(){var size=this.getSize();return{width:size[0],height:size[1]};}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var bind$2=bind;var each$9=each$1;var parsePercent$2=parsePercent$1;var proxyRect=new Rect({shape:{x:-1,y:-1,width:2,height:2}});extendComponentView({type:'tooltip',init:function init(ecModel,api){if(env$1.node){return;}var tooltipModel=ecModel.getComponent('tooltip');var renderMode=tooltipModel.get('renderMode');this._renderMode=getTooltipRenderMode(renderMode);var tooltipContent;if(this._renderMode==='html'){tooltipContent=new TooltipContent(api.getDom(),api,{appendToBody:tooltipModel.get('appendToBody',true)});this._newLine='
';}else{tooltipContent=new TooltipRichContent(api);this._newLine='\\n';}this._tooltipContent=tooltipContent;},render:function render(tooltipModel,ecModel,api){if(env$1.node){return;}// Reset\nthis.group.removeAll();/**\n * @private\n * @type {module:echarts/component/tooltip/TooltipModel}\n */this._tooltipModel=tooltipModel;/**\n * @private\n * @type {module:echarts/model/Global}\n */this._ecModel=ecModel;/**\n * @private\n * @type {module:echarts/ExtensionAPI}\n */this._api=api;/**\n * Should be cleaned when render.\n * @private\n * @type {Array.>}\n */this._lastDataByCoordSys=null;/**\n * @private\n * @type {boolean}\n */this._alwaysShowContent=tooltipModel.get('alwaysShowContent');var tooltipContent=this._tooltipContent;tooltipContent.update(tooltipModel);tooltipContent.setEnterable(tooltipModel.get('enterable'));this._initGlobalListener();this._keepShow();},_initGlobalListener:function _initGlobalListener(){var tooltipModel=this._tooltipModel;var triggerOn=tooltipModel.get('triggerOn');register('itemTooltip',this._api,bind$2(function(currTrigger,e,dispatchAction){// If 'none', it is not controlled by mouse totally.\nif(triggerOn!=='none'){if(triggerOn.indexOf(currTrigger)>=0){this._tryShow(e,dispatchAction);}else if(currTrigger==='leave'){this._hide(dispatchAction);}}},this));},_keepShow:function _keepShow(){var tooltipModel=this._tooltipModel;var ecModel=this._ecModel;var api=this._api;// Try to keep the tooltip show when refreshing\nif(this._lastX!=null&&this._lastY!=null// When user is willing to control tooltip totally using API,\n// self.manuallyShowTip({x, y}) might cause tooltip hide,\n// which is not expected.\n&&tooltipModel.get('triggerOn')!=='none'){var self=this;clearTimeout(this._refreshUpdateTimeout);this._refreshUpdateTimeout=setTimeout(function(){// Show tip next tick after other charts are rendered\n// In case highlight action has wrong result\n// FIXME\n!api.isDisposed()&&self.manuallyShowTip(tooltipModel,ecModel,api,{x:self._lastX,y:self._lastY});});}},/**\n * Show tip manually by\n * dispatchAction({\n * type: 'showTip',\n * x: 10,\n * y: 10\n * });\n * Or\n * dispatchAction({\n * type: 'showTip',\n * seriesIndex: 0,\n * dataIndex or dataIndexInside or name\n * });\n *\n * TODO Batch\n */manuallyShowTip:function manuallyShowTip(tooltipModel,ecModel,api,payload){if(payload.from===this.uid||env$1.node){return;}var dispatchAction=makeDispatchAction$1(payload,api);// Reset ticket\nthis._ticket='';// When triggered from axisPointer.\nvar dataByCoordSys=payload.dataByCoordSys;if(payload.tooltip&&payload.x!=null&&payload.y!=null){var el=proxyRect;el.position=[payload.x,payload.y];el.update();el.tooltip=payload.tooltip;// Manually show tooltip while view is not using zrender elements.\nthis._tryShow({offsetX:payload.x,offsetY:payload.y,target:el},dispatchAction);}else if(dataByCoordSys){this._tryShow({offsetX:payload.x,offsetY:payload.y,position:payload.position,dataByCoordSys:payload.dataByCoordSys,tooltipOption:payload.tooltipOption},dispatchAction);}else if(payload.seriesIndex!=null){if(this._manuallyAxisShowTip(tooltipModel,ecModel,api,payload)){return;}var pointInfo=findPointFromSeries(payload,ecModel);var cx=pointInfo.point[0];var cy=pointInfo.point[1];if(cx!=null&&cy!=null){this._tryShow({offsetX:cx,offsetY:cy,position:payload.position,target:pointInfo.el},dispatchAction);}}else if(payload.x!=null&&payload.y!=null){// FIXME\n// should wrap dispatchAction like `axisPointer/globalListener` ?\napi.dispatchAction({type:'updateAxisPointer',x:payload.x,y:payload.y});this._tryShow({offsetX:payload.x,offsetY:payload.y,position:payload.position,target:api.getZr().findHover(payload.x,payload.y).target},dispatchAction);}},manuallyHideTip:function manuallyHideTip(tooltipModel,ecModel,api,payload){var tooltipContent=this._tooltipContent;if(!this._alwaysShowContent&&this._tooltipModel){tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));}this._lastX=this._lastY=null;if(payload.from!==this.uid){this._hide(makeDispatchAction$1(payload,api));}},// Be compatible with previous design, that is, when tooltip.type is 'axis' and\n// dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n// and tooltip.\n_manuallyAxisShowTip:function _manuallyAxisShowTip(tooltipModel,ecModel,api,payload){var seriesIndex=payload.seriesIndex;var dataIndex=payload.dataIndex;var coordSysAxesInfo=ecModel.getComponent('axisPointer').coordSysAxesInfo;if(seriesIndex==null||dataIndex==null||coordSysAxesInfo==null){return;}var seriesModel=ecModel.getSeriesByIndex(seriesIndex);if(!seriesModel){return;}var data=seriesModel.getData();var tooltipModel=buildTooltipModel([data.getItemModel(dataIndex),seriesModel,(seriesModel.coordinateSystem||{}).model,tooltipModel]);if(tooltipModel.get('trigger')!=='axis'){return;}api.dispatchAction({type:'updateAxisPointer',seriesIndex:seriesIndex,dataIndex:dataIndex,position:payload.position});return true;},_tryShow:function _tryShow(e,dispatchAction){var el=e.target;var tooltipModel=this._tooltipModel;if(!tooltipModel){return;}// Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\nthis._lastX=e.offsetX;this._lastY=e.offsetY;var dataByCoordSys=e.dataByCoordSys;if(dataByCoordSys&&dataByCoordSys.length){this._showAxisTooltip(dataByCoordSys,e);}// Always show item tooltip if mouse is on the element with dataIndex\nelse if(el&&el.dataIndex!=null){this._lastDataByCoordSys=null;this._showSeriesItemTooltip(e,el,dispatchAction);}// Tooltip provided directly. Like legend.\nelse if(el&&el.tooltip){this._lastDataByCoordSys=null;this._showComponentItemTooltip(e,el,dispatchAction);}else{this._lastDataByCoordSys=null;this._hide(dispatchAction);}},_showOrMove:function _showOrMove(tooltipModel,cb){// showDelay is used in this case: tooltip.enterable is set\n// as true. User intent to move mouse into tooltip and click\n// something. `showDelay` makes it easier to enter the content\n// but tooltip do not move immediately.\nvar delay=tooltipModel.get('showDelay');cb=bind(cb,this);clearTimeout(this._showTimout);delay>0?this._showTimout=setTimeout(cb,delay):cb();},_showAxisTooltip:function _showAxisTooltip(dataByCoordSys,e){var ecModel=this._ecModel;var globalTooltipModel=this._tooltipModel;var point=[e.offsetX,e.offsetY];var singleDefaultHTML=[];var singleParamsList=[];var singleTooltipModel=buildTooltipModel([e.tooltipOption,globalTooltipModel]);var renderMode=this._renderMode;var newLine=this._newLine;var markers={};each$9(dataByCoordSys,function(itemCoordSys){// var coordParamList = [];\n// var coordDefaultHTML = [];\n// var coordTooltipModel = buildTooltipModel([\n// e.tooltipOption,\n// itemCoordSys.tooltipOption,\n// ecModel.getComponent(itemCoordSys.coordSysMainType, itemCoordSys.coordSysIndex),\n// globalTooltipModel\n// ]);\n// var displayMode = coordTooltipModel.get('displayMode');\n// var paramsList = displayMode === 'single' ? singleParamsList : [];\neach$9(itemCoordSys.dataByAxis,function(item){var axisModel=ecModel.getComponent(item.axisDim+'Axis',item.axisIndex);var axisValue=item.value;var seriesDefaultHTML=[];if(!axisModel||axisValue==null){return;}var valueLabel=getValueLabel(axisValue,axisModel.axis,ecModel,item.seriesDataIndices,item.valueLabelOpt);each$1(item.seriesDataIndices,function(idxItem){var series=ecModel.getSeriesByIndex(idxItem.seriesIndex);var dataIndex=idxItem.dataIndexInside;var dataParams=series&&series.getDataParams(dataIndex);dataParams.axisDim=item.axisDim;dataParams.axisIndex=item.axisIndex;dataParams.axisType=item.axisType;dataParams.axisId=item.axisId;dataParams.axisValue=getAxisRawValue(axisModel.axis,axisValue);dataParams.axisValueLabel=valueLabel;if(dataParams){singleParamsList.push(dataParams);var seriesTooltip=series.formatTooltip(dataIndex,true,null,renderMode);var html;if(isObject$1(seriesTooltip)){html=seriesTooltip.html;var newMarkers=seriesTooltip.markers;merge(markers,newMarkers);}else{html=seriesTooltip;}seriesDefaultHTML.push(html);}});// Default tooltip content\n// FIXME\n// (1) should be the first data which has name?\n// (2) themeRiver, firstDataIndex is array, and first line is unnecessary.\nvar firstLine=valueLabel;if(renderMode!=='html'){singleDefaultHTML.push(seriesDefaultHTML.join(newLine));}else{singleDefaultHTML.push((firstLine?encodeHTML(firstLine)+newLine:'')+seriesDefaultHTML.join(newLine));}});},this);// In most case, the second axis is shown upper than the first one.\nsingleDefaultHTML.reverse();singleDefaultHTML=singleDefaultHTML.join(this._newLine+this._newLine);var positionExpr=e.position;this._showOrMove(singleTooltipModel,function(){if(this._updateContentNotChangedOnAxis(dataByCoordSys)){this._updatePosition(singleTooltipModel,positionExpr,point[0],point[1],this._tooltipContent,singleParamsList);}else{this._showTooltipContent(singleTooltipModel,singleDefaultHTML,singleParamsList,Math.random(),point[0],point[1],positionExpr,undefined,markers);}});// Do not trigger events here, because this branch only be entered\n// from dispatchAction.\n},_showSeriesItemTooltip:function _showSeriesItemTooltip(e,el,dispatchAction){var ecModel=this._ecModel;// Use dataModel in element if possible\n// Used when mouseover on a element like markPoint or edge\n// In which case, the data is not main data in series.\nvar seriesIndex=el.seriesIndex;var seriesModel=ecModel.getSeriesByIndex(seriesIndex);// For example, graph link.\nvar dataModel=el.dataModel||seriesModel;var dataIndex=el.dataIndex;var dataType=el.dataType;var data=dataModel.getData(dataType);var tooltipModel=buildTooltipModel([data.getItemModel(dataIndex),dataModel,seriesModel&&(seriesModel.coordinateSystem||{}).model,this._tooltipModel]);var tooltipTrigger=tooltipModel.get('trigger');if(tooltipTrigger!=null&&tooltipTrigger!=='item'){return;}var params=dataModel.getDataParams(dataIndex,dataType);var seriesTooltip=dataModel.formatTooltip(dataIndex,false,dataType,this._renderMode);var defaultHtml;var markers;if(isObject$1(seriesTooltip)){defaultHtml=seriesTooltip.html;markers=seriesTooltip.markers;}else{defaultHtml=seriesTooltip;markers=null;}var asyncTicket='item_'+dataModel.name+'_'+dataIndex;this._showOrMove(tooltipModel,function(){this._showTooltipContent(tooltipModel,defaultHtml,params,asyncTicket,e.offsetX,e.offsetY,e.position,e.target,markers);});// FIXME\n// duplicated showtip if manuallyShowTip is called from dispatchAction.\ndispatchAction({type:'showTip',dataIndexInside:dataIndex,dataIndex:data.getRawIndex(dataIndex),seriesIndex:seriesIndex,from:this.uid});},_showComponentItemTooltip:function _showComponentItemTooltip(e,el,dispatchAction){var tooltipOpt=el.tooltip;if(typeof tooltipOpt==='string'){var content=tooltipOpt;tooltipOpt={content:content,// Fixed formatter\nformatter:content};}var subTooltipModel=new Model(tooltipOpt,this._tooltipModel,this._ecModel);var defaultHtml=subTooltipModel.get('content');var asyncTicket=Math.random();// Do not check whether `trigger` is 'none' here, because `trigger`\n// only works on coordinate system. In fact, we have not found case\n// that requires setting `trigger` nothing on component yet.\nthis._showOrMove(subTooltipModel,function(){this._showTooltipContent(subTooltipModel,defaultHtml,subTooltipModel.get('formatterParams')||{},asyncTicket,e.offsetX,e.offsetY,e.position,el);});// If not dispatch showTip, tip may be hide triggered by axis.\ndispatchAction({type:'showTip',from:this.uid});},_showTooltipContent:function _showTooltipContent(tooltipModel,defaultHtml,params,asyncTicket,x,y,positionExpr,el,markers){// Reset ticket\nthis._ticket='';if(!tooltipModel.get('showContent')||!tooltipModel.get('show')){return;}var tooltipContent=this._tooltipContent;var formatter=tooltipModel.get('formatter');positionExpr=positionExpr||tooltipModel.get('position');var html=defaultHtml;if(formatter&&typeof formatter==='string'){html=formatTpl(formatter,params,true);}else if(typeof formatter==='function'){var callback=bind$2(function(cbTicket,html){if(cbTicket===this._ticket){tooltipContent.setContent(html,markers,tooltipModel);this._updatePosition(tooltipModel,positionExpr,x,y,tooltipContent,params,el);}},this);this._ticket=asyncTicket;html=formatter(params,asyncTicket,callback);}tooltipContent.setContent(html,markers,tooltipModel);tooltipContent.show(tooltipModel);this._updatePosition(tooltipModel,positionExpr,x,y,tooltipContent,params,el);},/**\n * @param {string|Function|Array.|Object} positionExpr\n * @param {number} x Mouse x\n * @param {number} y Mouse y\n * @param {boolean} confine Whether confine tooltip content in view rect.\n * @param {Object|} params\n * @param {module:zrender/Element} el target element\n * @param {module:echarts/ExtensionAPI} api\n * @return {Array.}\n */_updatePosition:function _updatePosition(tooltipModel,positionExpr,x,y,content,params,el){var viewWidth=this._api.getWidth();var viewHeight=this._api.getHeight();positionExpr=positionExpr||tooltipModel.get('position');var contentSize=content.getSize();var align=tooltipModel.get('align');var vAlign=tooltipModel.get('verticalAlign');var rect=el&&el.getBoundingRect().clone();el&&rect.applyTransform(el.transform);if(typeof positionExpr==='function'){// Callback of position can be an array or a string specify the position\npositionExpr=positionExpr([x,y],params,content.el,rect,{viewSize:[viewWidth,viewHeight],contentSize:contentSize.slice()});}if(isArray(positionExpr)){x=parsePercent$2(positionExpr[0],viewWidth);y=parsePercent$2(positionExpr[1],viewHeight);}else if(isObject$1(positionExpr)){positionExpr.width=contentSize[0];positionExpr.height=contentSize[1];var layoutRect=getLayoutRect(positionExpr,{width:viewWidth,height:viewHeight});x=layoutRect.x;y=layoutRect.y;align=null;// When positionExpr is left/top/right/bottom,\n// align and verticalAlign will not work.\nvAlign=null;}// Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\nelse if(typeof positionExpr==='string'&&el){var pos=calcTooltipPosition(positionExpr,rect,contentSize);x=pos[0];y=pos[1];}else{var pos=refixTooltipPosition(x,y,content,viewWidth,viewHeight,align?null:20,vAlign?null:20);x=pos[0];y=pos[1];}align&&(x-=isCenterAlign(align)?contentSize[0]/2:align==='right'?contentSize[0]:0);vAlign&&(y-=isCenterAlign(vAlign)?contentSize[1]/2:vAlign==='bottom'?contentSize[1]:0);if(tooltipModel.get('confine')){var pos=confineTooltipPosition(x,y,content,viewWidth,viewHeight);x=pos[0];y=pos[1];}content.moveTo(x,y);},// FIXME\n// Should we remove this but leave this to user?\n_updateContentNotChangedOnAxis:function _updateContentNotChangedOnAxis(dataByCoordSys){var lastCoordSys=this._lastDataByCoordSys;var contentNotChanged=!!lastCoordSys&&lastCoordSys.length===dataByCoordSys.length;contentNotChanged&&each$9(lastCoordSys,function(lastItemCoordSys,indexCoordSys){var lastDataByAxis=lastItemCoordSys.dataByAxis||{};var thisItemCoordSys=dataByCoordSys[indexCoordSys]||{};var thisDataByAxis=thisItemCoordSys.dataByAxis||[];contentNotChanged&=lastDataByAxis.length===thisDataByAxis.length;contentNotChanged&&each$9(lastDataByAxis,function(lastItem,indexAxis){var thisItem=thisDataByAxis[indexAxis]||{};var lastIndices=lastItem.seriesDataIndices||[];var newIndices=thisItem.seriesDataIndices||[];contentNotChanged&=lastItem.value===thisItem.value&&lastItem.axisType===thisItem.axisType&&lastItem.axisId===thisItem.axisId&&lastIndices.length===newIndices.length;contentNotChanged&&each$9(lastIndices,function(lastIdxItem,j){var newIdxItem=newIndices[j];contentNotChanged&=lastIdxItem.seriesIndex===newIdxItem.seriesIndex&&lastIdxItem.dataIndex===newIdxItem.dataIndex;});});});this._lastDataByCoordSys=dataByCoordSys;return!!contentNotChanged;},_hide:function _hide(dispatchAction){// Do not directly hideLater here, because this behavior may be prevented\n// in dispatchAction when showTip is dispatched.\n// FIXME\n// duplicated hideTip if manuallyHideTip is called from dispatchAction.\nthis._lastDataByCoordSys=null;dispatchAction({type:'hideTip',from:this.uid});},dispose:function dispose(ecModel,api){if(env$1.node){return;}this._tooltipContent.dispose();unregister('itemTooltip',api);}});/**\n * @param {Array.} modelCascade\n * From top to bottom. (the last one should be globalTooltipModel);\n */function buildTooltipModel(modelCascade){var resultModel=modelCascade.pop();while(modelCascade.length){var tooltipOpt=modelCascade.pop();if(tooltipOpt){if(Model.isInstance(tooltipOpt)){tooltipOpt=tooltipOpt.get('tooltip',true);}// In each data item tooltip can be simply write:\n// {\n// value: 10,\n// tooltip: 'Something you need to know'\n// }\nif(typeof tooltipOpt==='string'){tooltipOpt={formatter:tooltipOpt};}resultModel=new Model(tooltipOpt,resultModel,resultModel.ecModel);}}return resultModel;}function makeDispatchAction$1(payload,api){return payload.dispatchAction||bind(api.dispatchAction,api);}function refixTooltipPosition(x,y,content,viewWidth,viewHeight,gapH,gapV){var size=content.getOuterSize();var width=size.width;var height=size.height;if(gapH!=null){if(x+width+gapH>viewWidth){x-=width+gapH;}else{x+=gapH;}}if(gapV!=null){if(y+height+gapV>viewHeight){y-=height+gapV;}else{y+=gapV;}}return[x,y];}function confineTooltipPosition(x,y,content,viewWidth,viewHeight){var size=content.getOuterSize();var width=size.width;var height=size.height;x=Math.min(x+width,viewWidth)-width;y=Math.min(y+height,viewHeight)-height;x=Math.max(x,0);y=Math.max(y,0);return[x,y];}function calcTooltipPosition(position,rect,contentSize){var domWidth=contentSize[0];var domHeight=contentSize[1];var gap=5;var x=0;var y=0;var rectWidth=rect.width;var rectHeight=rect.height;switch(position){case'inside':x=rect.x+rectWidth/2-domWidth/2;y=rect.y+rectHeight/2-domHeight/2;break;case'top':x=rect.x+rectWidth/2-domWidth/2;y=rect.y-domHeight-gap;break;case'bottom':x=rect.x+rectWidth/2-domWidth/2;y=rect.y+rectHeight+gap;break;case'left':x=rect.x-domWidth-gap;y=rect.y+rectHeight/2-domHeight/2;break;case'right':x=rect.x+rectWidth+gap;y=rect.y+rectHeight/2-domHeight/2;}return[x,y];}function isCenterAlign(align){return align==='center'||align==='middle';}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // FIXME Better way to pack data in graphic element\n/**\n * @action\n * @property {string} type\n * @property {number} seriesIndex\n * @property {number} dataIndex\n * @property {number} [x]\n * @property {number} [y]\n */registerAction({type:'showTip',event:'showTip',update:'tooltip:manuallyShowTip'},// noop\nfunction(){});registerAction({type:'hideTip',event:'hideTip',update:'tooltip:manuallyHideTip'},// noop\nfunction(){});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var langSelector=lang.legend.selector;var defaultSelectorOption={all:{type:'all',title:_clone(langSelector.all)},inverse:{type:'inverse',title:_clone(langSelector.inverse)}};var LegendModel=extendComponentModel({type:'legend.plain',dependencies:['series'],layoutMode:{type:'box',// legend.width/height are maxWidth/maxHeight actually,\n// whereas realy width/height is calculated by its content.\n// (Setting {left: 10, right: 10} does not make sense).\n// So consider the case:\n// `setOption({legend: {left: 10});`\n// then `setOption({legend: {right: 10});`\n// The previous `left` should be cleared by setting `ignoreSize`.\nignoreSize:true},init:function init(option,parentModel,ecModel){this.mergeDefaultAndTheme(option,ecModel);option.selected=option.selected||{};this._updateSelector(option);},mergeOption:function mergeOption(option){LegendModel.superCall(this,'mergeOption',option);this._updateSelector(option);},_updateSelector:function _updateSelector(option){var selector=option.selector;if(selector===true){selector=option.selector=['all','inverse'];}if(isArray(selector)){each$1(selector,function(item,index){isString(item)&&(item={type:item});selector[index]=merge(item,defaultSelectorOption[item.type]);});}},optionUpdated:function optionUpdated(){this._updateData(this.ecModel);var legendData=this._data;// If selectedMode is single, try to select one\nif(legendData[0]&&this.get('selectedMode')==='single'){var hasSelected=false;// If has any selected in option.selected\nfor(var i=0;i}\n * @private\n */this._availableNames=availableNames;// If legend.data not specified in option, use availableNames as data,\n// which is convinient for user preparing option.\nvar rawData=this.get('data')||potentialData;var legendData=map(rawData,function(dataItem){// Can be string or number\nif(typeof dataItem==='string'||typeof dataItem==='number'){dataItem={name:dataItem};}return new Model(dataItem,this,this.ecModel);},this);/**\n * @type {Array.}\n * @private\n */this._data=legendData;},/**\n * @return {Array.}\n */getData:function getData(){return this._data;},/**\n * @param {string} name\n */select:function select(name){var selected=this.option.selected;var selectedMode=this.get('selectedMode');if(selectedMode==='single'){var data=this._data;each$1(data,function(dataItem){selected[dataItem.get('name')]=false;});}selected[name]=true;},/**\n * @param {string} name\n */unSelect:function unSelect(name){if(this.get('selectedMode')!=='single'){this.option.selected[name]=false;}},/**\n * @param {string} name\n */toggleSelected:function toggleSelected(name){var selected=this.option.selected;// Default is true\nif(!selected.hasOwnProperty(name)){selected[name]=true;}this[selected[name]?'unSelect':'select'](name);},allSelect:function allSelect(){var data=this._data;var selected=this.option.selected;each$1(data,function(dataItem){selected[dataItem.get('name',true)]=true;});},inverseSelect:function inverseSelect(){var data=this._data;var selected=this.option.selected;each$1(data,function(dataItem){var name=dataItem.get('name',true);// Initially, default value is true\nif(!selected.hasOwnProperty(name)){selected[name]=true;}selected[name]=!selected[name];});},/**\n * @param {string} name\n */isSelected:function isSelected(name){var selected=this.option.selected;return!(selected.hasOwnProperty(name)&&!selected[name])&&indexOf(this._availableNames,name)>=0;},getOrient:function getOrient(){return this.get('orient')==='vertical'?{index:1,name:'vertical'}:{index:0,name:'horizontal'};},defaultOption:{// 一级层叠\nzlevel:0,// 二级层叠\nz:4,show:true,// 布局方式,默认为水平布局,可选为:\n// 'horizontal' | 'vertical'\norient:'horizontal',left:'center',// right: 'center',\ntop:0,// bottom: null,\n// 水平对齐\n// 'auto' | 'left' | 'right'\n// 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐\nalign:'auto',backgroundColor:'rgba(0,0,0,0)',// 图例边框颜色\nborderColor:'#ccc',borderRadius:0,// 图例边框线宽,单位px,默认为0(无边框)\nborderWidth:0,// 图例内边距,单位px,默认各方向内边距为5,\n// 接受数组分别设定上右下左边距,同css\npadding:5,// 各个item之间的间隔,单位px,默认为10,\n// 横向布局时为水平间隔,纵向布局时为纵向间隔\nitemGap:10,// the width of legend symbol\nitemWidth:25,// the height of legend symbol\nitemHeight:14,// the color of unselected legend symbol\ninactiveColor:'#ccc',// the borderColor of unselected legend symbol\ninactiveBorderColor:'#ccc',itemStyle:{// the default borderWidth of legend symbol\nborderWidth:0},textStyle:{// 图例文字颜色\ncolor:'#333'},// formatter: '',\n// 选择模式,默认开启图例开关\nselectedMode:true,// 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入\n// selected: null,\n// 图例内容(详见legend.data,数组中每一项代表一个item\n// data: [],\n// Usage:\n// selector: [{type: 'all or inverse', title: xxx}]\n// or\n// selector: true\n// or\n// selector: ['all', 'inverse']\nselector:false,selectorLabel:{show:true,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:' sans-serif',color:'#666',borderWidth:1,borderColor:'#666'},emphasis:{selectorLabel:{show:true,color:'#eee',backgroundColor:'#666'}},// Value can be 'start' or 'end'\nselectorPosition:'auto',selectorItemGap:7,selectorButtonGap:10,// Tooltip 相关配置\ntooltip:{show:false}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function legendSelectActionHandler(methodName,payload,ecModel){var selectedMap={};var isToggleSelect=methodName==='toggleSelected';var isSelected;// Update all legend components\necModel.eachComponent('legend',function(legendModel){if(isToggleSelect&&isSelected!=null){// Force other legend has same selected status\n// Or the first is toggled to true and other are toggled to false\n// In the case one legend has some item unSelected in option. And if other legend\n// doesn't has the item, they will assume it is selected.\nlegendModel[isSelected?'select':'unSelect'](payload.name);}else if(methodName==='allSelect'||methodName==='inverseSelect'){legendModel[methodName]();}else{legendModel[methodName](payload.name);isSelected=legendModel.isSelected(payload.name);}var legendData=legendModel.getData();each$1(legendData,function(model){var name=model.get('name');// Wrap element\nif(name==='\\n'||name===''){return;}var isItemSelected=legendModel.isSelected(name);if(selectedMap.hasOwnProperty(name)){// Unselected if any legend is unselected\nselectedMap[name]=selectedMap[name]&&isItemSelected;}else{selectedMap[name]=isItemSelected;}});});// Return the event explicitly\nreturn methodName==='allSelect'||methodName==='inverseSelect'?{selected:selectedMap}:{name:payload.name,selected:selectedMap};}/**\n * @event legendToggleSelect\n * @type {Object}\n * @property {string} type 'legendToggleSelect'\n * @property {string} [from]\n * @property {string} name Series name or data item name\n */registerAction('legendToggleSelect','legendselectchanged',curry(legendSelectActionHandler,'toggleSelected'));registerAction('legendAllSelect','legendselectall',curry(legendSelectActionHandler,'allSelect'));registerAction('legendInverseSelect','legendinverseselect',curry(legendSelectActionHandler,'inverseSelect'));/**\n * @event legendSelect\n * @type {Object}\n * @property {string} type 'legendSelect'\n * @property {string} name Series name or data item name\n */registerAction('legendSelect','legendselected',curry(legendSelectActionHandler,'select'));/**\n * @event legendUnSelect\n * @type {Object}\n * @property {string} type 'legendUnSelect'\n * @property {string} name Series name or data item name\n */registerAction('legendUnSelect','legendunselected',curry(legendSelectActionHandler,'unSelect'));/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */function layout$2(group,componentModel,api){var boxLayoutParams=componentModel.getBoxLayoutParams();var padding=componentModel.get('padding');var viewportSize={width:api.getWidth(),height:api.getHeight()};var rect=getLayoutRect(boxLayoutParams,viewportSize,padding);box(componentModel.get('orient'),group,componentModel.get('itemGap'),rect.width,rect.height);positionElement(group,boxLayoutParams,viewportSize,padding);}function makeBackground(rect,componentModel){var padding=normalizeCssArray$1(componentModel.get('padding'));var style=componentModel.getItemStyle(['color','opacity']);style.fill=componentModel.get('backgroundColor');var rect=new Rect({shape:{x:rect.x-padding[3],y:rect.y-padding[0],width:rect.width+padding[1]+padding[3],height:rect.height+padding[0]+padding[2],r:componentModel.get('borderRadius')},style:style,silent:true,z2:-1});// FIXME\n// `subPixelOptimizeRect` may bring some gap between edge of viewpart\n// and background rect when setting like `left: 0`, `top: 0`.\n// graphic.subPixelOptimizeRect(rect);\nreturn rect;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var curry$3=curry;var each$11=each$1;var Group$2=Group;var LegendView=extendComponentView({type:'legend.plain',newlineDisabled:false,/**\n * @override\n */init:function init(){/**\n * @private\n * @type {module:zrender/container/Group}\n */this.group.add(this._contentGroup=new Group$2());/**\n * @private\n * @type {module:zrender/Element}\n */this._backgroundEl;/**\n * @private\n * @type {module:zrender/container/Group}\n */this.group.add(this._selectorGroup=new Group$2());/**\n * If first rendering, `contentGroup.position` is [0, 0], which\n * does not make sense and may cause unexepcted animation if adopted.\n * @private\n * @type {boolean}\n */this._isFirstRender=true;},/**\n * @protected\n */getContentGroup:function getContentGroup(){return this._contentGroup;},/**\n * @protected\n */getSelectorGroup:function getSelectorGroup(){return this._selectorGroup;},/**\n * @override\n */render:function render(legendModel,ecModel,api){var isFirstRender=this._isFirstRender;this._isFirstRender=false;this.resetInner();if(!legendModel.get('show',true)){return;}var itemAlign=legendModel.get('align');var orient=legendModel.get('orient');if(!itemAlign||itemAlign==='auto'){itemAlign=legendModel.get('left')==='right'&&orient==='vertical'?'right':'left';}var selector=legendModel.get('selector',true);var selectorPosition=legendModel.get('selectorPosition',true);if(selector&&(!selectorPosition||selectorPosition==='auto')){selectorPosition=orient==='horizontal'?'end':'start';}this.renderInner(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition);// Perform layout.\nvar positionInfo=legendModel.getBoxLayoutParams();var viewportSize={width:api.getWidth(),height:api.getHeight()};var padding=legendModel.get('padding');var maxSize=getLayoutRect(positionInfo,viewportSize,padding);var mainRect=this.layoutInner(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition);// Place mainGroup, based on the calculated `mainRect`.\nvar layoutRect=getLayoutRect(defaults({width:mainRect.width,height:mainRect.height},positionInfo),viewportSize,padding);this.group.attr('position',[layoutRect.x-mainRect.x,layoutRect.y-mainRect.y]);// Render background after group is layout.\nthis.group.add(this._backgroundEl=makeBackground(mainRect,legendModel));},/**\n * @protected\n */resetInner:function resetInner(){this.getContentGroup().removeAll();this._backgroundEl&&this.group.remove(this._backgroundEl);this.getSelectorGroup().removeAll();},/**\n * @protected\n */renderInner:function renderInner(itemAlign,legendModel,ecModel,api,selector,orient,selectorPosition){var contentGroup=this.getContentGroup();var legendDrawnMap=createHashMap();var selectMode=legendModel.get('selectedMode');var excludeSeriesId=[];ecModel.eachRawSeries(function(seriesModel){!seriesModel.get('legendHoverLink')&&excludeSeriesId.push(seriesModel.id);});each$11(legendModel.getData(),function(itemModel,dataIndex){var name=itemModel.get('name');// Use empty string or \\n as a newline string\nif(!this.newlineDisabled&&(name===''||name==='\\n')){contentGroup.add(new Group$2({newline:true}));return;}// Representitive series.\nvar seriesModel=ecModel.getSeriesByName(name)[0];if(legendDrawnMap.get(name)){// Have been drawed\nreturn;}// Legend to control series.\nif(seriesModel){var data=seriesModel.getData();var color=data.getVisual('color');var borderColor=data.getVisual('borderColor');// If color is a callback function\nif(typeof color==='function'){// Use the first data\ncolor=color(seriesModel.getDataParams(0));}// If borderColor is a callback function\nif(typeof borderColor==='function'){// Use the first data\nborderColor=borderColor(seriesModel.getDataParams(0));}// Using rect symbol defaultly\nvar legendSymbolType=data.getVisual('legendSymbol')||'roundRect';var symbolType=data.getVisual('symbol');var itemGroup=this._createItem(name,dataIndex,itemModel,legendModel,legendSymbolType,symbolType,itemAlign,color,borderColor,selectMode);itemGroup.on('click',curry$3(dispatchSelectAction,name,null,api,excludeSeriesId)).on('mouseover',curry$3(dispatchHighlightAction,seriesModel.name,null,api,excludeSeriesId)).on('mouseout',curry$3(dispatchDownplayAction,seriesModel.name,null,api,excludeSeriesId));legendDrawnMap.set(name,true);}else{// Legend to control data. In pie and funnel.\necModel.eachRawSeries(function(seriesModel){// In case multiple series has same data name\nif(legendDrawnMap.get(name)){return;}if(seriesModel.legendVisualProvider){var provider=seriesModel.legendVisualProvider;if(!provider.containName(name)){return;}var idx=provider.indexOfName(name);var color=provider.getItemVisual(idx,'color');var borderColor=provider.getItemVisual(idx,'borderColor');var legendSymbolType='roundRect';var itemGroup=this._createItem(name,dataIndex,itemModel,legendModel,legendSymbolType,null,itemAlign,color,borderColor,selectMode);// FIXME: consider different series has items with the same name.\nitemGroup.on('click',curry$3(dispatchSelectAction,null,name,api,excludeSeriesId))// Should not specify the series name, consider legend controls\n// more than one pie series.\n.on('mouseover',curry$3(dispatchHighlightAction,null,name,api,excludeSeriesId)).on('mouseout',curry$3(dispatchDownplayAction,null,name,api,excludeSeriesId));legendDrawnMap.set(name,true);}},this);}if(__DEV__){if(!legendDrawnMap.get(name)){console.warn(name+' series not exists. Legend data should be same with series name or data name.');}}},this);if(selector){this._createSelector(selector,legendModel,api,orient,selectorPosition);}},_createSelector:function _createSelector(selector,legendModel,api,orient,selectorPosition){var selectorGroup=this.getSelectorGroup();each$11(selector,function(selectorItem){createSelectorButton(selectorItem);});function createSelectorButton(selectorItem){var type=selectorItem.type;var labelText=new Text({style:{x:0,y:0,align:'center',verticalAlign:'middle'},onclick:function onclick(){api.dispatchAction({type:type==='all'?'legendAllSelect':'legendInverseSelect'});}});selectorGroup.add(labelText);var labelModel=legendModel.getModel('selectorLabel');var emphasisLabelModel=legendModel.getModel('emphasis.selectorLabel');setLabelStyle(labelText.style,labelText.hoverStyle={},labelModel,emphasisLabelModel,{defaultText:selectorItem.title,isRectText:false});setHoverStyle(labelText);}},_createItem:function _createItem(name,dataIndex,itemModel,legendModel,legendSymbolType,symbolType,itemAlign,color,borderColor,selectMode){var itemWidth=legendModel.get('itemWidth');var itemHeight=legendModel.get('itemHeight');var inactiveColor=legendModel.get('inactiveColor');var inactiveBorderColor=legendModel.get('inactiveBorderColor');var symbolKeepAspect=legendModel.get('symbolKeepAspect');var legendModelItemStyle=legendModel.getModel('itemStyle');var isSelected=legendModel.isSelected(name);var itemGroup=new Group$2();var textStyleModel=itemModel.getModel('textStyle');var itemIcon=itemModel.get('icon');var tooltipModel=itemModel.getModel('tooltip');var legendGlobalTooltipModel=tooltipModel.parentModel;// Use user given icon first\nlegendSymbolType=itemIcon||legendSymbolType;var legendSymbol=createSymbol(legendSymbolType,0,0,itemWidth,itemHeight,isSelected?color:inactiveColor,// symbolKeepAspect default true for legend\nsymbolKeepAspect==null?true:symbolKeepAspect);itemGroup.add(setSymbolStyle(legendSymbol,legendSymbolType,legendModelItemStyle,borderColor,inactiveBorderColor,isSelected));// Compose symbols\n// PENDING\nif(!itemIcon&&symbolType// At least show one symbol, can't be all none\n&&(symbolType!==legendSymbolType||symbolType==='none')){var size=itemHeight*0.8;if(symbolType==='none'){symbolType='circle';}var legendSymbolCenter=createSymbol(symbolType,(itemWidth-size)/2,(itemHeight-size)/2,size,size,isSelected?color:inactiveColor,// symbolKeepAspect default true for legend\nsymbolKeepAspect==null?true:symbolKeepAspect);// Put symbol in the center\nitemGroup.add(setSymbolStyle(legendSymbolCenter,symbolType,legendModelItemStyle,borderColor,inactiveBorderColor,isSelected));}var textX=itemAlign==='left'?itemWidth+5:-5;var textAlign=itemAlign;var formatter=legendModel.get('formatter');var content=name;if(typeof formatter==='string'&&formatter){content=formatter.replace('{name}',name!=null?name:'');}else if(typeof formatter==='function'){content=formatter(name);}itemGroup.add(new Text({style:setTextStyle({},textStyleModel,{text:content,x:textX,y:itemHeight/2,textFill:isSelected?textStyleModel.getTextColor():inactiveColor,textAlign:textAlign,textVerticalAlign:'middle'})}));// Add a invisible rect to increase the area of mouse hover\nvar hitRect=new Rect({shape:itemGroup.getBoundingRect(),invisible:true,tooltip:tooltipModel.get('show')?extend({content:name,// Defaul formatter\nformatter:legendGlobalTooltipModel.get('formatter',true)||function(){return name;},formatterParams:{componentType:'legend',legendIndex:legendModel.componentIndex,name:name,$vars:['name']}},tooltipModel.option):null});itemGroup.add(hitRect);itemGroup.eachChild(function(child){child.silent=true;});hitRect.silent=!selectMode;this.getContentGroup().add(itemGroup);setHoverStyle(itemGroup);itemGroup.__legendDataIndex=dataIndex;return itemGroup;},/**\n * @protected\n */layoutInner:function layoutInner(legendModel,itemAlign,maxSize,isFirstRender,selector,selectorPosition){var contentGroup=this.getContentGroup();var selectorGroup=this.getSelectorGroup();// Place items in contentGroup.\nbox(legendModel.get('orient'),contentGroup,legendModel.get('itemGap'),maxSize.width,maxSize.height);var contentRect=contentGroup.getBoundingRect();var contentPos=[-contentRect.x,-contentRect.y];if(selector){// Place buttons in selectorGroup\nbox(// Buttons in selectorGroup always layout horizontally\n'horizontal',selectorGroup,legendModel.get('selectorItemGap',true));var selectorRect=selectorGroup.getBoundingRect();var selectorPos=[-selectorRect.x,-selectorRect.y];var selectorButtonGap=legendModel.get('selectorButtonGap',true);var orientIdx=legendModel.getOrient().index;var wh=orientIdx===0?'width':'height';var hw=orientIdx===0?'height':'width';var yx=orientIdx===0?'y':'x';if(selectorPosition==='end'){selectorPos[orientIdx]+=contentRect[wh]+selectorButtonGap;}else{contentPos[orientIdx]+=selectorRect[wh]+selectorButtonGap;}//Always align selector to content as 'middle'\nselectorPos[1-orientIdx]+=contentRect[hw]/2-selectorRect[hw]/2;selectorGroup.attr('position',selectorPos);contentGroup.attr('position',contentPos);var mainRect={x:0,y:0};mainRect[wh]=contentRect[wh]+selectorButtonGap+selectorRect[wh];mainRect[hw]=Math.max(contentRect[hw],selectorRect[hw]);mainRect[yx]=Math.min(0,selectorRect[yx]+selectorPos[1-orientIdx]);return mainRect;}else{contentGroup.attr('position',contentPos);return this.group.getBoundingRect();}},/**\n * @protected\n */remove:function remove(){this.getContentGroup().removeAll();this._isFirstRender=true;}});function setSymbolStyle(symbol,symbolType,legendModelItemStyle,borderColor,inactiveBorderColor,isSelected){var itemStyle;if(symbolType!=='line'&&symbolType.indexOf('empty')<0){itemStyle=legendModelItemStyle.getItemStyle();symbol.style.stroke=borderColor;if(!isSelected){itemStyle.stroke=inactiveBorderColor;}}else{itemStyle=legendModelItemStyle.getItemStyle(['borderWidth','borderColor']);}return symbol.setStyle(itemStyle);}function dispatchSelectAction(seriesName,dataName,api,excludeSeriesId){// downplay before unselect\ndispatchDownplayAction(seriesName,dataName,api,excludeSeriesId);api.dispatchAction({type:'legendToggleSelect',name:seriesName!=null?seriesName:dataName});// highlight after select\ndispatchHighlightAction(seriesName,dataName,api,excludeSeriesId);}function dispatchHighlightAction(seriesName,dataName,api,excludeSeriesId){// If element hover will move to a hoverLayer.\nvar el=api.getZr().storage.getDisplayList()[0];if(!(el&&el.useHoverLayer)){api.dispatchAction({type:'highlight',seriesName:seriesName,name:dataName,excludeSeriesId:excludeSeriesId});}}function dispatchDownplayAction(seriesName,dataName,api,excludeSeriesId){// If element hover will move to a hoverLayer.\nvar el=api.getZr().storage.getDisplayList()[0];if(!(el&&el.useHoverLayer)){api.dispatchAction({type:'downplay',seriesName:seriesName,name:dataName,excludeSeriesId:excludeSeriesId});}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var legendFilter=function legendFilter(ecModel){var legendModels=ecModel.findComponents({mainType:'legend'});if(legendModels&&legendModels.length){ecModel.filterSeries(function(series){// If in any legend component the status is not selected.\n// Because in legend series is assumed selected when it is not in the legend data.\nfor(var i=0;imaxSize[wh];var contentPos=[-contentRect.x,-contentRect.y];// Remain contentPos when scroll animation perfroming.\n// If first rendering, `contentGroup.position` is [0, 0], which\n// does not make sense and may cause unexepcted animation if adopted.\nif(!isFirstRender){contentPos[orientIdx]=contentGroup.position[orientIdx];}// Layout container group based on 0.\nvar containerPos=[0,0];var controllerPos=[-controllerRect.x,-controllerRect.y];var pageButtonGap=retrieve2(legendModel.get('pageButtonGap',true),legendModel.get('itemGap',true));// Place containerGroup and controllerGroup and contentGroup.\nif(showController){var pageButtonPosition=legendModel.get('pageButtonPosition',true);// controller is on the right / bottom.\nif(pageButtonPosition==='end'){controllerPos[orientIdx]+=maxSize[wh]-controllerRect[wh];}// controller is on the left / top.\nelse{containerPos[orientIdx]+=controllerRect[wh]+pageButtonGap;}}// Always align controller to content as 'middle'.\ncontrollerPos[1-orientIdx]+=contentRect[hw]/2-controllerRect[hw]/2;contentGroup.attr('position',contentPos);containerGroup.attr('position',containerPos);controllerGroup.attr('position',controllerPos);// Calculate `mainRect` and set `clipPath`.\n// mainRect should not be calculated by `this.group.getBoundingRect()`\n// for sake of the overflow.\nvar mainRect={x:0,y:0};// Consider content may be overflow (should be clipped).\nmainRect[wh]=showController?maxSize[wh]:contentRect[wh];mainRect[hw]=Math.max(contentRect[hw],controllerRect[hw]);// `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\nmainRect[yx]=Math.min(0,controllerRect[yx]+controllerPos[1-orientIdx]);containerGroup.__rectSize=maxSize[wh];if(showController){var clipShape={x:0,y:0};clipShape[wh]=Math.max(maxSize[wh]-controllerRect[wh]-pageButtonGap,0);clipShape[hw]=mainRect[hw];containerGroup.setClipPath(new Rect({shape:clipShape}));// Consider content may be larger than container, container rect\n// can not be obtained from `containerGroup.getBoundingRect()`.\ncontainerGroup.__rectSize=clipShape[wh];}else{// Do not remove or ignore controller. Keep them set as placeholders.\ncontrollerGroup.eachChild(function(child){child.attr({invisible:true,silent:true});});}// Content translate animation.\nvar pageInfo=this._getPageInfo(legendModel);pageInfo.pageIndex!=null&&updateProps(contentGroup,{position:pageInfo.contentPosition},// When switch from \"show controller\" to \"not show controller\", view should be\n// updated immediately without animation, otherwise causes weird effect.\nshowController?legendModel:false);this._updatePageInfoView(legendModel,pageInfo);return mainRect;},_pageGo:function _pageGo(to,legendModel,api){var scrollDataIndex=this._getPageInfo(legendModel)[to];scrollDataIndex!=null&&api.dispatchAction({type:'legendScroll',scrollDataIndex:scrollDataIndex,legendId:legendModel.id});},_updatePageInfoView:function _updatePageInfoView(legendModel,pageInfo){var controllerGroup=this._controllerGroup;each$1(['pagePrev','pageNext'],function(name){var canJump=pageInfo[name+'DataIndex']!=null;var icon=controllerGroup.childOfName(name);if(icon){icon.setStyle('fill',canJump?legendModel.get('pageIconColor',true):legendModel.get('pageIconInactiveColor',true));icon.cursor=canJump?'pointer':'default';}});var pageText=controllerGroup.childOfName('pageText');var pageFormatter=legendModel.get('pageFormatter');var pageIndex=pageInfo.pageIndex;var current=pageIndex!=null?pageIndex+1:0;var total=pageInfo.pageCount;pageText&&pageFormatter&&pageText.setStyle('text',isString(pageFormatter)?pageFormatter.replace('{current}',current).replace('{total}',total):pageFormatter({current:current,total:total}));},/**\n * @param {module:echarts/model/Model} legendModel\n * @return {Object} {\n * contentPosition: Array., null when data item not found.\n * pageIndex: number, null when data item not found.\n * pageCount: number, always be a number, can be 0.\n * pagePrevDataIndex: number, null when no previous page.\n * pageNextDataIndex: number, null when no next page.\n * }\n */_getPageInfo:function _getPageInfo(legendModel){var scrollDataIndex=legendModel.get('scrollDataIndex',true);var contentGroup=this.getContentGroup();var containerRectSize=this._containerGroup.__rectSize;var orientIdx=legendModel.getOrient().index;var wh=WH[orientIdx];var xy=XY[orientIdx];var targetItemIndex=this._findTargetItemIndex(scrollDataIndex);var children=contentGroup.children();var targetItem=children[targetItemIndex];var itemCount=children.length;var pCount=!itemCount?0:1;var result={contentPosition:contentGroup.position.slice(),pageCount:pCount,pageIndex:pCount-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!targetItem){return result;}var targetItemInfo=getItemInfo(targetItem);result.contentPosition[orientIdx]=-targetItemInfo.s;// Strategy:\n// (1) Always align based on the left/top most item.\n// (2) It is user-friendly that the last item shown in the\n// current window is shown at the begining of next window.\n// Otherwise if half of the last item is cut by the window,\n// it will have no chance to display entirely.\n// (3) Consider that item size probably be different, we\n// have calculate pageIndex by size rather than item index,\n// and we can not get page index directly by division.\n// (4) The window is to narrow to contain more than\n// one item, we should make sure that the page can be fliped.\nfor(var i=targetItemIndex+1,winStartItemInfo=targetItemInfo,winEndItemInfo=targetItemInfo,currItemInfo=null;i<=itemCount;++i){currItemInfo=getItemInfo(children[i]);if(// Half of the last item is out of the window.\n!currItemInfo&&winEndItemInfo.e>winStartItemInfo.s+containerRectSize// If the current item does not intersect with the window, the new page\n// can be started at the current item or the last item.\n||currItemInfo&&!intersect(currItemInfo,winStartItemInfo.s)){if(winEndItemInfo.i>winStartItemInfo.i){winStartItemInfo=winEndItemInfo;}else{// e.g., when page size is smaller than item size.\nwinStartItemInfo=currItemInfo;}if(winStartItemInfo){if(result.pageNextDataIndex==null){result.pageNextDataIndex=winStartItemInfo.i;}++result.pageCount;}}winEndItemInfo=currItemInfo;}for(var i=targetItemIndex-1,winStartItemInfo=targetItemInfo,winEndItemInfo=targetItemInfo,currItemInfo=null;i>=-1;--i){currItemInfo=getItemInfo(children[i]);if(// If the the end item does not intersect with the window started\n// from the current item, a page can be settled.\n(!currItemInfo||!intersect(winEndItemInfo,currItemInfo.s)// e.g., when page size is smaller than item size.\n)&&winStartItemInfo.i=winStart&&itemInfo.s<=winStart+containerRectSize;}},_findTargetItemIndex:function _findTargetItemIndex(targetDataIndex){if(!this._showController){return 0;}var index;var contentGroup=this.getContentGroup();var defaultIndex;contentGroup.eachChild(function(child,idx){var legendDataIdx=child.__legendDataIndex;// FIXME\n// If the given targetDataIndex (from model) is illegal,\n// we use defaultIndex. But the index on the legend model and\n// action payload is still illegal. That case will not be\n// changed until some scenario requires.\nif(defaultIndex==null&&legendDataIdx!=null){defaultIndex=idx;}if(legendDataIdx===targetDataIndex){index=idx;}});return index!=null?index:defaultIndex;}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @event legendScroll\n * @type {Object}\n * @property {string} type 'legendScroll'\n * @property {string} scrollDataIndex\n */registerAction('legendScroll','legendscroll',function(payload,ecModel){var scrollDataIndex=payload.scrollDataIndex;scrollDataIndex!=null&&ecModel.eachComponent({mainType:'legend',subType:'scroll',query:payload},function(legendModel){legendModel.setScrollDataIndex(scrollDataIndex);});});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Legend component entry file8\n */ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Model\nextendComponentModel({type:'title',layoutMode:{type:'box',ignoreSize:true},defaultOption:{// 一级层叠\nzlevel:0,// 二级层叠\nz:6,show:true,text:'',// 超链接跳转\n// link: null,\n// 仅支持self | blank\ntarget:'blank',subtext:'',// 超链接跳转\n// sublink: null,\n// 仅支持self | blank\nsubtarget:'blank',// 'center' ¦ 'left' ¦ 'right'\n// ¦ {number}(x坐标,单位px)\nleft:0,// 'top' ¦ 'bottom' ¦ 'center'\n// ¦ {number}(y坐标,单位px)\ntop:0,// 水平对齐\n// 'auto' | 'left' | 'right' | 'center'\n// 默认根据 left 的位置判断是左对齐还是右对齐\n// textAlign: null\n//\n// 垂直对齐\n// 'auto' | 'top' | 'bottom' | 'middle'\n// 默认根据 top 位置判断是上对齐还是下对齐\n// textVerticalAlign: null\n// textBaseline: null // The same as textVerticalAlign.\nbackgroundColor:'rgba(0,0,0,0)',// 标题边框颜色\nborderColor:'#ccc',// 标题边框线宽,单位px,默认为0(无边框)\nborderWidth:0,// 标题内边距,单位px,默认各方向内边距为5,\n// 接受数组分别设定上右下左边距,同css\npadding:5,// 主副标题纵向间隔,单位px,默认为10,\nitemGap:10,textStyle:{fontSize:18,fontWeight:'bolder',color:'#333'},subtextStyle:{color:'#aaa'}}});// View\nextendComponentView({type:'title',render:function render(titleModel,ecModel,api){this.group.removeAll();if(!titleModel.get('show')){return;}var group=this.group;var textStyleModel=titleModel.getModel('textStyle');var subtextStyleModel=titleModel.getModel('subtextStyle');var textAlign=titleModel.get('textAlign');var textVerticalAlign=retrieve2(titleModel.get('textBaseline'),titleModel.get('textVerticalAlign'));var textEl=new Text({style:setTextStyle({},textStyleModel,{text:titleModel.get('text'),textFill:textStyleModel.getTextColor()},{disableBox:true}),z2:10});var textRect=textEl.getBoundingRect();var subText=titleModel.get('subtext');var subTextEl=new Text({style:setTextStyle({},subtextStyleModel,{text:subText,textFill:subtextStyleModel.getTextColor(),y:textRect.height+titleModel.get('itemGap'),textVerticalAlign:'top'},{disableBox:true}),z2:10});var link=titleModel.get('link');var sublink=titleModel.get('sublink');var triggerEvent=titleModel.get('triggerEvent',true);textEl.silent=!link&&!triggerEvent;subTextEl.silent=!sublink&&!triggerEvent;if(link){textEl.on('click',function(){windowOpen(link,'_'+titleModel.get('target'));});}if(sublink){subTextEl.on('click',function(){windowOpen(sublink,'_'+titleModel.get('subtarget'));});}textEl.eventData=subTextEl.eventData=triggerEvent?{componentType:'title',componentIndex:titleModel.componentIndex}:null;group.add(textEl);subText&&group.add(subTextEl);// If no subText, but add subTextEl, there will be an empty line.\nvar groupRect=group.getBoundingRect();var layoutOption=titleModel.getBoxLayoutParams();layoutOption.width=groupRect.width;layoutOption.height=groupRect.height;var layoutRect=getLayoutRect(layoutOption,{width:api.getWidth(),height:api.getHeight()},titleModel.get('padding'));// Adjust text align based on position\nif(!textAlign){// Align left if title is on the left. center and right is same\ntextAlign=titleModel.get('left')||titleModel.get('right');if(textAlign==='middle'){textAlign='center';}// Adjust layout by text align\nif(textAlign==='right'){layoutRect.x+=layoutRect.width;}else if(textAlign==='center'){layoutRect.x+=layoutRect.width/2;}}if(!textVerticalAlign){textVerticalAlign=titleModel.get('top')||titleModel.get('bottom');if(textVerticalAlign==='center'){textVerticalAlign='middle';}if(textVerticalAlign==='bottom'){layoutRect.y+=layoutRect.height;}else if(textVerticalAlign==='middle'){layoutRect.y+=layoutRect.height/2;}textVerticalAlign=textVerticalAlign||'top';}group.attr('position',[layoutRect.x,layoutRect.y]);var alignStyle={textAlign:textAlign,textVerticalAlign:textVerticalAlign};textEl.setStyle(alignStyle);subTextEl.setStyle(alignStyle);// Render background\n// Get groupRect again because textAlign has been changed\ngroupRect=group.getBoundingRect();var padding=layoutRect.margin;var style=titleModel.getItemStyle(['color','opacity']);style.fill=titleModel.get('backgroundColor');var rect=new Rect({shape:{x:groupRect.x-padding[3],y:groupRect.y-padding[0],width:groupRect.width+padding[1]+padding[3],height:groupRect.height+padding[0]+padding[2],r:titleModel.get('borderRadius')},style:style,subPixelOptimize:true,silent:true});group.add(rect);}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var addCommas$1=addCommas;var encodeHTML$1=encodeHTML;function fillLabel(opt){defaultEmphasis(opt,'label',['show']);}var MarkerModel=extendComponentModel({type:'marker',dependencies:['series','grid','polar','geo'],/**\n * @overrite\n */init:function init(option,parentModel,ecModel){if(__DEV__){if(this.type==='marker'){throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');}}this.mergeDefaultAndTheme(option,ecModel);this._mergeOption(option,ecModel,false,true);},/**\n * @return {boolean}\n */isAnimationEnabled:function isAnimationEnabled(){if(env$1.node){return false;}var hostSeries=this.__hostSeries;return this.getShallow('animation')&&hostSeries&&hostSeries.isAnimationEnabled();},/**\n * @overrite\n */mergeOption:function mergeOption(newOpt,ecModel){this._mergeOption(newOpt,ecModel,false,false);},_mergeOption:function _mergeOption(newOpt,ecModel,createdBySelf,isInit){var MarkerModel=this.constructor;var modelPropName=this.mainType+'Model';if(!createdBySelf){ecModel.eachSeries(function(seriesModel){var markerOpt=seriesModel.get(this.mainType,true);var markerModel=seriesModel[modelPropName];if(!markerOpt||!markerOpt.data){seriesModel[modelPropName]=null;return;}if(!markerModel){if(isInit){// Default label emphasis `position` and `show`\nfillLabel(markerOpt);}each$1(markerOpt.data,function(item){// FIXME Overwrite fillLabel method ?\nif(item instanceof Array){fillLabel(item[0]);fillLabel(item[1]);}else{fillLabel(item);}});markerModel=new MarkerModel(markerOpt,this,ecModel);extend(markerModel,{mainType:this.mainType,// Use the same series index and name\nseriesIndex:seriesModel.seriesIndex,name:seriesModel.name,createdBySelf:true});markerModel.__hostSeries=seriesModel;}else{markerModel._mergeOption(markerOpt,ecModel,true);}seriesModel[modelPropName]=markerModel;},this);}},formatTooltip:function formatTooltip(dataIndex,multipleSeries,dataType,renderMode){var data=this.getData();var value=this.getRawValue(dataIndex);var formattedValue=isArray(value)?map(value,addCommas$1).join(', '):addCommas$1(value);var name=data.getName(dataIndex);var html=encodeHTML$1(this.name);var newLine=renderMode==='html'?'
':'\\n';if(value!=null||name){html+=newLine;}if(name){html+=encodeHTML$1(name);if(value!=null){html+=' : ';}}if(value!=null){html+=encodeHTML$1(formattedValue);}return html;},getData:function getData(){return this._data;},setData:function setData(data){this._data=data;}});mixin(MarkerModel,dataFormatMixin);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/MarkerModel.extend({type:'markPoint',defaultOption:{zlevel:0,z:5,symbol:'pin',symbolSize:50,//symbolRotate: 0,\n//symbolOffset: [0, 0]\ntooltip:{trigger:'item'},label:{show:true,position:'inside'},itemStyle:{borderWidth:2},emphasis:{label:{show:true}}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var indexOf$1=indexOf;function hasXOrY(item){return!(isNaN(parseFloat(item.x))&&isNaN(parseFloat(item.y)));}function hasXAndY(item){return!isNaN(parseFloat(item.x))&&!isNaN(parseFloat(item.y));}// Make it simple, do not visit all stacked value to count precision.\n// function getPrecision(data, valueAxisDim, dataIndex) {\n// var precision = -1;\n// var stackedDim = data.mapDimension(valueAxisDim);\n// do {\n// precision = Math.max(\n// numberUtil.getPrecision(data.get(stackedDim, dataIndex)),\n// precision\n// );\n// var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n// if (stackedOnSeries) {\n// var byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex);\n// data = stackedOnSeries.getData();\n// dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue);\n// stackedDim = data.getCalculationInfo('stackedDimension');\n// }\n// else {\n// data = null;\n// }\n// } while (data);\n// return precision;\n// }\nfunction markerTypeCalculatorWithExtent(mlType,data,otherDataDim,targetDataDim,otherCoordIndex,targetCoordIndex){var coordArr=[];var stacked=isDimensionStacked(data,targetDataDim/*, otherDataDim*/);var calcDataDim=stacked?data.getCalculationInfo('stackResultDimension'):targetDataDim;var value=numCalculate(data,calcDataDim,mlType);var dataIndex=data.indicesOfNearest(calcDataDim,value)[0];coordArr[otherCoordIndex]=data.get(otherDataDim,dataIndex);coordArr[targetCoordIndex]=data.get(calcDataDim,dataIndex);var coordArrValue=data.get(targetDataDim,dataIndex);// Make it simple, do not visit all stacked value to count precision.\nvar precision=getPrecision(data.get(targetDataDim,dataIndex));precision=Math.min(precision,20);if(precision>=0){coordArr[targetCoordIndex]=+coordArr[targetCoordIndex].toFixed(precision);}return[coordArr,coordArrValue];}var curry$4=curry;// TODO Specified percent\nvar markerTypeCalculator={/**\n * @method\n * @param {module:echarts/data/List} data\n * @param {string} baseAxisDim\n * @param {string} valueAxisDim\n */min:curry$4(markerTypeCalculatorWithExtent,'min'),/**\n * @method\n * @param {module:echarts/data/List} data\n * @param {string} baseAxisDim\n * @param {string} valueAxisDim\n */max:curry$4(markerTypeCalculatorWithExtent,'max'),/**\n * @method\n * @param {module:echarts/data/List} data\n * @param {string} baseAxisDim\n * @param {string} valueAxisDim\n */average:curry$4(markerTypeCalculatorWithExtent,'average')};/**\n * Transform markPoint data item to format used in List by do the following\n * 1. Calculate statistic like `max`, `min`, `average`\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/coord/*} [coordSys]\n * @param {Object} item\n * @return {Object}\n */function dataTransform(seriesModel,item){var data=seriesModel.getData();var coordSys=seriesModel.coordinateSystem;// 1. If not specify the position with pixel directly\n// 2. If `coord` is not a data array. Which uses `xAxis`,\n// `yAxis` to specify the coord on each dimension\n// parseFloat first because item.x and item.y can be percent string like '20%'\nif(item&&!hasXAndY(item)&&!isArray(item.coord)&&coordSys){var dims=coordSys.dimensions;var axisInfo=getAxisInfo$1(item,data,coordSys,seriesModel);// Clone the option\n// Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\nitem=_clone(item);if(item.type&&markerTypeCalculator[item.type]&&axisInfo.baseAxis&&axisInfo.valueAxis){var otherCoordIndex=indexOf$1(dims,axisInfo.baseAxis.dim);var targetCoordIndex=indexOf$1(dims,axisInfo.valueAxis.dim);var coordInfo=markerTypeCalculator[item.type](data,axisInfo.baseDataDim,axisInfo.valueDataDim,otherCoordIndex,targetCoordIndex);item.coord=coordInfo[0];// Force to use the value of calculated value.\n// let item use the value without stack.\nitem.value=coordInfo[1];}else{// FIXME Only has one of xAxis and yAxis.\nvar coord=[item.xAxis!=null?item.xAxis:item.radiusAxis,item.yAxis!=null?item.yAxis:item.angleAxis];// Each coord support max, min, average\nfor(var i=0;i<2;i++){if(markerTypeCalculator[coord[i]]){coord[i]=numCalculate(data,data.mapDimension(dims[i]),coord[i]);}}item.coord=coord;}}return item;}function getAxisInfo$1(item,data,coordSys,seriesModel){var ret={};if(item.valueIndex!=null||item.valueDim!=null){ret.valueDataDim=item.valueIndex!=null?data.getDimension(item.valueIndex):item.valueDim;ret.valueAxis=coordSys.getAxis(dataDimToCoordDim(seriesModel,ret.valueDataDim));ret.baseAxis=coordSys.getOtherAxis(ret.valueAxis);ret.baseDataDim=data.mapDimension(ret.baseAxis.dim);}else{ret.baseAxis=seriesModel.getBaseAxis();ret.valueAxis=coordSys.getOtherAxis(ret.baseAxis);ret.baseDataDim=data.mapDimension(ret.baseAxis.dim);ret.valueDataDim=data.mapDimension(ret.valueAxis.dim);}return ret;}function dataDimToCoordDim(seriesModel,dataDim){var data=seriesModel.getData();var dimensions=data.dimensions;dataDim=data.getDimension(dataDim);for(var i=0;i0){n[0]=-n[0];n[1]=-n[1];}var dir=tangent[0]<0?-1:1;if(label.__position!=='start'&&label.__position!=='end'){var rotation=-Math.atan2(tangent[1],tangent[0]);if(toPos[0]0.8?'left':d[0]<-0.8?'right':'center';textVerticalAlign=d[1]>0.8?'top':d[1]<-0.8?'bottom':'middle';break;case'start':textPosition=[-d[0]*distanceX+fromPos[0],-d[1]*distanceY+fromPos[1]];textAlign=d[0]>0.8?'right':d[0]<-0.8?'left':'center';textVerticalAlign=d[1]>0.8?'bottom':d[1]<-0.8?'top':'middle';break;case'insideStartTop':case'insideStart':case'insideStartBottom':textPosition=[distanceX*dir+fromPos[0],fromPos[1]+dy];textAlign=tangent[0]<0?'right':'left';textOrigin=[-distanceX*dir,-dy];break;case'insideMiddleTop':case'insideMiddle':case'insideMiddleBottom':case'middle':textPosition=[cp[0],cp[1]+dy];textAlign='center';textOrigin=[0,-dy];break;case'insideEndTop':case'insideEnd':case'insideEndBottom':textPosition=[-distanceX*dir+toPos[0],toPos[1]+dy];textAlign=tangent[0]>=0?'right':'left';textOrigin=[distanceX*dir,-dy];break;}label.attr({style:{// Use the user specified text align and baseline first\ntextVerticalAlign:label.__verticalAlign||textVerticalAlign,textAlign:label.__textAlign||textAlign},position:textPosition,scale:[invScale,invScale],origin:textOrigin});}}/**\n * @constructor\n * @extends {module:zrender/graphic/Group}\n * @alias {module:echarts/chart/helper/Line}\n */function Line$1(lineData,idx,seriesScope){Group.call(this);this._createLine(lineData,idx,seriesScope);}var lineProto=Line$1.prototype;// Update symbol position and rotation\nlineProto.beforeUpdate=updateSymbolAndLabelBeforeLineUpdate;lineProto._createLine=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel;var linePoints=lineData.getItemLayout(idx);var line=createLine(linePoints);line.shape.percent=0;initProps(line,{shape:{percent:1}},seriesModel,idx);this.add(line);var label=new Text({name:'label',// FIXME\n// Temporary solution for `focusNodeAdjacency`.\n// line label do not use the opacity of lineStyle.\nlineLabelOriginalOpacity:1});this.add(label);each$1(SYMBOL_CATEGORIES,function(symbolCategory){var symbol=createSymbol$1(symbolCategory,lineData,idx);// symbols must added after line to make sure\n// it will be updated after line#update.\n// Or symbol position and rotation update in line#beforeUpdate will be one frame slow\nthis.add(symbol);this[makeSymbolTypeKey(symbolCategory)]=lineData.getItemVisual(idx,symbolCategory);},this);this._updateCommonStl(lineData,idx,seriesScope);};lineProto.updateData=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel;var line=this.childOfName('line');var linePoints=lineData.getItemLayout(idx);var target={shape:{}};setLinePoints(target.shape,linePoints);updateProps(line,target,seriesModel,idx);each$1(SYMBOL_CATEGORIES,function(symbolCategory){var symbolType=lineData.getItemVisual(idx,symbolCategory);var key=makeSymbolTypeKey(symbolCategory);// Symbol changed\nif(this[key]!==symbolType){this.remove(this.childOfName(symbolCategory));var symbol=createSymbol$1(symbolCategory,lineData,idx);this.add(symbol);}this[key]=symbolType;},this);this._updateCommonStl(lineData,idx,seriesScope);};lineProto._updateCommonStl=function(lineData,idx,seriesScope){var seriesModel=lineData.hostModel;var line=this.childOfName('line');var lineStyle=seriesScope&&seriesScope.lineStyle;var hoverLineStyle=seriesScope&&seriesScope.hoverLineStyle;var labelModel=seriesScope&&seriesScope.labelModel;var hoverLabelModel=seriesScope&&seriesScope.hoverLabelModel;// Optimization for large dataset\nif(!seriesScope||lineData.hasItemOption){var itemModel=lineData.getItemModel(idx);lineStyle=itemModel.getModel('lineStyle').getLineStyle();hoverLineStyle=itemModel.getModel('emphasis.lineStyle').getLineStyle();labelModel=itemModel.getModel('label');hoverLabelModel=itemModel.getModel('emphasis.label');}var visualColor=lineData.getItemVisual(idx,'color');var visualOpacity=retrieve3(lineData.getItemVisual(idx,'opacity'),lineStyle.opacity,1);line.useStyle(defaults({strokeNoScale:true,fill:'none',stroke:visualColor,opacity:visualOpacity},lineStyle));line.hoverStyle=hoverLineStyle;// Update symbol\neach$1(SYMBOL_CATEGORIES,function(symbolCategory){var symbol=this.childOfName(symbolCategory);if(symbol){symbol.setColor(visualColor);symbol.setStyle({opacity:visualOpacity});}},this);var showLabel=labelModel.getShallow('show');var hoverShowLabel=hoverLabelModel.getShallow('show');var label=this.childOfName('label');var defaultLabelColor;var baseText;// FIXME: the logic below probably should be merged to `graphic.setLabelStyle`.\nif(showLabel||hoverShowLabel){defaultLabelColor=visualColor||'#000';baseText=seriesModel.getFormattedLabel(idx,'normal',lineData.dataType);if(baseText==null){var rawVal=seriesModel.getRawValue(idx);baseText=rawVal==null?lineData.getName(idx):isFinite(rawVal)?round$1(rawVal):rawVal;}}var normalText=showLabel?baseText:null;var emphasisText=hoverShowLabel?retrieve2(seriesModel.getFormattedLabel(idx,'emphasis',lineData.dataType),baseText):null;var labelStyle=label.style;// Always set `textStyle` even if `normalStyle.text` is null, because default\n// values have to be set on `normalStyle`.\nif(normalText!=null||emphasisText!=null){setTextStyle(label.style,labelModel,{text:normalText},{autoColor:defaultLabelColor});label.__textAlign=labelStyle.textAlign;label.__verticalAlign=labelStyle.textVerticalAlign;// 'start', 'middle', 'end'\nlabel.__position=labelModel.get('position')||'middle';var distance$$1=labelModel.get('distance');if(!isArray(distance$$1)){distance$$1=[distance$$1,distance$$1];}label.__labelDistance=distance$$1;}if(emphasisText!=null){// Only these properties supported in this emphasis style here.\nlabel.hoverStyle={text:emphasisText,textFill:hoverLabelModel.getTextColor(true),// For merging hover style to normal style, do not use\n// `hoverLabelModel.getFont()` here.\nfontStyle:hoverLabelModel.getShallow('fontStyle'),fontWeight:hoverLabelModel.getShallow('fontWeight'),fontSize:hoverLabelModel.getShallow('fontSize'),fontFamily:hoverLabelModel.getShallow('fontFamily')};}else{label.hoverStyle={text:null};}label.ignore=!showLabel&&!hoverShowLabel;setHoverStyle(this);};lineProto.highlight=function(){this.trigger('emphasis');};lineProto.downplay=function(){this.trigger('normal');};lineProto.updateLayout=function(lineData,idx){this.setLinePoints(lineData.getItemLayout(idx));};lineProto.setLinePoints=function(points){var linePath=this.childOfName('line');setLinePoints(linePath.shape,points);linePath.dirty();};inherits(Line$1,Group);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @module echarts/chart/helper/LineDraw\n */ // import IncrementalDisplayable from 'zrender/src/graphic/IncrementalDisplayable';\n/**\n * @alias module:echarts/component/marker/LineDraw\n * @constructor\n */function LineDraw(ctor){this._ctor=ctor||Line$1;this.group=new Group();}var lineDrawProto=LineDraw.prototype;lineDrawProto.isPersistent=function(){return true;};/**\n * @param {module:echarts/data/List} lineData\n */lineDrawProto.updateData=function(lineData){var lineDraw=this;var group=lineDraw.group;var oldLineData=lineDraw._lineData;lineDraw._lineData=lineData;// There is no oldLineData only when first rendering or switching from\n// stream mode to normal mode, where previous elements should be removed.\nif(!oldLineData){group.removeAll();}var seriesScope=makeSeriesScope$1(lineData);lineData.diff(oldLineData).add(function(idx){doAdd(lineDraw,lineData,idx,seriesScope);}).update(function(newIdx,oldIdx){doUpdate(lineDraw,oldLineData,lineData,oldIdx,newIdx,seriesScope);}).remove(function(idx){group.remove(oldLineData.getItemGraphicEl(idx));}).execute();};function doAdd(lineDraw,lineData,idx,seriesScope){var itemLayout=lineData.getItemLayout(idx);if(!lineNeedsDraw(itemLayout)){return;}var el=new lineDraw._ctor(lineData,idx,seriesScope);lineData.setItemGraphicEl(idx,el);lineDraw.group.add(el);}function doUpdate(lineDraw,oldLineData,newLineData,oldIdx,newIdx,seriesScope){var itemEl=oldLineData.getItemGraphicEl(oldIdx);if(!lineNeedsDraw(newLineData.getItemLayout(newIdx))){lineDraw.group.remove(itemEl);return;}if(!itemEl){itemEl=new lineDraw._ctor(newLineData,newIdx,seriesScope);}else{itemEl.updateData(newLineData,newIdx,seriesScope);}newLineData.setItemGraphicEl(newIdx,itemEl);lineDraw.group.add(itemEl);}lineDrawProto.updateLayout=function(){var lineData=this._lineData;// Do not support update layout in incremental mode.\nif(!lineData){return;}lineData.eachItemGraphicEl(function(el,idx){el.updateLayout(lineData,idx);},this);};lineDrawProto.incrementalPrepareUpdate=function(lineData){this._seriesScope=makeSeriesScope$1(lineData);this._lineData=null;this.group.removeAll();};function isEffectObject(el){return el.animators&&el.animators.length>0;}lineDrawProto.incrementalUpdate=function(taskParams,lineData){function updateIncrementalAndHover(el){if(!el.isGroup&&!isEffectObject(el)){el.incremental=el.useHoverLayer=true;}}for(var idx=taskParams.start;idx=0&&typeof value==='number'){value=+value.toFixed(Math.min(precision,20));}mlFrom.coord[valueIndex]=mlTo.coord[valueIndex]=value;item=[mlFrom,mlTo,{// Extra option for tooltip and label\ntype:mlType,valueIndex:item.valueIndex,// Force to use the value of calculated value.\nvalue:value}];}item=[dataTransform(seriesModel,item[0]),dataTransform(seriesModel,item[1]),extend({},item[2])];// Avoid line data type is extended by from(to) data type\nitem[2].type=item[2].type||'';// Merge from option and to option into line option\nmerge(item[2],item[0]);merge(item[2],item[1]);return item;};function isInifinity(val){return!isNaN(val)&&!isFinite(val);}// If a markLine has one dim\nfunction ifMarkLineHasOnlyDim(dimIndex,fromCoord,toCoord,coordSys){var otherDimIndex=1-dimIndex;var dimName=coordSys.dimensions[dimIndex];return isInifinity(fromCoord[otherDimIndex])&&isInifinity(toCoord[otherDimIndex])&&fromCoord[dimIndex]===toCoord[dimIndex]&&coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);}function markLineFilter(coordSys,item){if(coordSys.type==='cartesian2d'){var fromCoord=item[0].coord;var toCoord=item[1].coord;// In case\n// {\n// markLine: {\n// data: [{ yAxis: 2 }]\n// }\n// }\nif(fromCoord&&toCoord&&(ifMarkLineHasOnlyDim(1,fromCoord,toCoord,coordSys)||ifMarkLineHasOnlyDim(0,fromCoord,toCoord,coordSys))){return true;}}return dataFilter$1(coordSys,item[0])&&dataFilter$1(coordSys,item[1]);}function updateSingleMarkerEndLayout(data,idx,isFrom,seriesModel,api){var coordSys=seriesModel.coordinateSystem;var itemModel=data.getItemModel(idx);var point;var xPx=parsePercent$1(itemModel.get('x'),api.getWidth());var yPx=parsePercent$1(itemModel.get('y'),api.getHeight());if(!isNaN(xPx)&&!isNaN(yPx)){point=[xPx,yPx];}else{// Chart like bar may have there own marker positioning logic\nif(seriesModel.getMarkerPosition){// Use the getMarkerPoisition\npoint=seriesModel.getMarkerPosition(data.getValues(data.dimensions,idx));}else{var dims=coordSys.dimensions;var x=data.get(dims[0],idx);var y=data.get(dims[1],idx);point=coordSys.dataToPoint([x,y]);}// Expand line to the edge of grid if value on one axis is Inifnity\n// In case\n// markLine: {\n// data: [{\n// yAxis: 2\n// // or\n// type: 'average'\n// }]\n// }\nif(coordSys.type==='cartesian2d'){var xAxis=coordSys.getAxis('x');var yAxis=coordSys.getAxis('y');var dims=coordSys.dimensions;if(isInifinity(data.get(dims[0],idx))){point[0]=xAxis.toGlobalCoord(xAxis.getExtent()[isFrom?0:1]);}else if(isInifinity(data.get(dims[1],idx))){point[1]=yAxis.toGlobalCoord(yAxis.getExtent()[isFrom?0:1]);}}// Use x, y if has any\nif(!isNaN(xPx)){point[0]=xPx;}if(!isNaN(yPx)){point[1]=yPx;}}data.setItemLayout(idx,point);}MarkerView.extend({type:'markLine',// updateLayout: function (markLineModel, ecModel, api) {\n// ecModel.eachSeries(function (seriesModel) {\n// var mlModel = seriesModel.markLineModel;\n// if (mlModel) {\n// var mlData = mlModel.getData();\n// var fromData = mlModel.__from;\n// var toData = mlModel.__to;\n// // Update visual and layout of from symbol and to symbol\n// fromData.each(function (idx) {\n// updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api);\n// updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api);\n// });\n// // Update layout of line\n// mlData.each(function (idx) {\n// mlData.setItemLayout(idx, [\n// fromData.getItemLayout(idx),\n// toData.getItemLayout(idx)\n// ]);\n// });\n// this.markerGroupMap.get(seriesModel.id).updateLayout();\n// }\n// }, this);\n// },\nupdateTransform:function updateTransform(markLineModel,ecModel,api){ecModel.eachSeries(function(seriesModel){var mlModel=seriesModel.markLineModel;if(mlModel){var mlData=mlModel.getData();var fromData=mlModel.__from;var toData=mlModel.__to;// Update visual and layout of from symbol and to symbol\nfromData.each(function(idx){updateSingleMarkerEndLayout(fromData,idx,true,seriesModel,api);updateSingleMarkerEndLayout(toData,idx,false,seriesModel,api);});// Update layout of line\nmlData.each(function(idx){mlData.setItemLayout(idx,[fromData.getItemLayout(idx),toData.getItemLayout(idx)]);});this.markerGroupMap.get(seriesModel.id).updateLayout();}},this);},renderSeries:function renderSeries(seriesModel,mlModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;var seriesId=seriesModel.id;var seriesData=seriesModel.getData();var lineDrawMap=this.markerGroupMap;var lineDraw=lineDrawMap.get(seriesId)||lineDrawMap.set(seriesId,new LineDraw());this.group.add(lineDraw.group);var mlData=createList$2(coordSys,seriesModel,mlModel);var fromData=mlData.from;var toData=mlData.to;var lineData=mlData.line;mlModel.__from=fromData;mlModel.__to=toData;// Line data for tooltip and formatter\nmlModel.setData(lineData);var symbolType=mlModel.get('symbol');var symbolSize=mlModel.get('symbolSize');if(!isArray(symbolType)){symbolType=[symbolType,symbolType];}if(typeof symbolSize==='number'){symbolSize=[symbolSize,symbolSize];}// Update visual and layout of from symbol and to symbol\nmlData.from.each(function(idx){updateDataVisualAndLayout(fromData,idx,true);updateDataVisualAndLayout(toData,idx,false);});// Update visual and layout of line\nlineData.each(function(idx){var lineColor=lineData.getItemModel(idx).get('lineStyle.color');lineData.setItemVisual(idx,{color:lineColor||fromData.getItemVisual(idx,'color')});lineData.setItemLayout(idx,[fromData.getItemLayout(idx),toData.getItemLayout(idx)]);lineData.setItemVisual(idx,{'fromSymbolRotate':fromData.getItemVisual(idx,'symbolRotate'),'fromSymbolSize':fromData.getItemVisual(idx,'symbolSize'),'fromSymbol':fromData.getItemVisual(idx,'symbol'),'toSymbolRotate':toData.getItemVisual(idx,'symbolRotate'),'toSymbolSize':toData.getItemVisual(idx,'symbolSize'),'toSymbol':toData.getItemVisual(idx,'symbol')});});lineDraw.updateData(lineData);// Set host model for tooltip\n// FIXME\nmlData.line.eachItemGraphicEl(function(el,idx){el.traverse(function(child){child.dataModel=mlModel;});});function updateDataVisualAndLayout(data,idx,isFrom){var itemModel=data.getItemModel(idx);updateSingleMarkerEndLayout(data,idx,isFrom,seriesModel,api);data.setItemVisual(idx,{symbolRotate:itemModel.get('symbolRotate'),symbolSize:itemModel.get('symbolSize')||symbolSize[isFrom?0:1],symbol:itemModel.get('symbol',true)||symbolType[isFrom?0:1],color:itemModel.get('itemStyle.color')||seriesData.getVisual('color')});}lineDraw.__keep=true;lineDraw.group.silent=mlModel.get('silent')||seriesModel.get('silent');}});/**\n * @inner\n * @param {module:echarts/coord/*} coordSys\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Model} mpModel\n */function createList$2(coordSys,seriesModel,mlModel){var coordDimsInfos;if(coordSys){coordDimsInfos=map(coordSys&&coordSys.dimensions,function(coordDim){var info=seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim))||{};// In map series data don't have lng and lat dimension. Fallback to same with coordSys\nreturn defaults({name:coordDim},info);});}else{coordDimsInfos=[{name:'value',type:'float'}];}var fromData=new List(coordDimsInfos,mlModel);var toData=new List(coordDimsInfos,mlModel);// No dimensions\nvar lineData=new List([],mlModel);var optData=map(mlModel.get('data'),curry(markLineTransform,seriesModel,coordSys,mlModel));if(coordSys){optData=filter(optData,curry(markLineFilter,coordSys));}var dimValueGetter$$1=coordSys?dimValueGetter:function(item){return item.value;};fromData.initData(map(optData,function(item){return item[0];}),null,dimValueGetter$$1);toData.initData(map(optData,function(item){return item[1];}),null,dimValueGetter$$1);lineData.initData(map(optData,function(item){return item[2];}));lineData.hasItemOption=true;return{from:fromData,to:toData,line:lineData};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerPreprocessor(function(opt){// Make sure markLine component is enabled\nopt.markLine=opt.markLine||{};});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/MarkerModel.extend({type:'markArea',defaultOption:{zlevel:0,// PENDING\nz:1,tooltip:{trigger:'item'},// markArea should fixed on the coordinate system\nanimation:false,label:{show:true,position:'top'},itemStyle:{// color and borderColor default to use color from series\n// color: 'auto'\n// borderColor: 'auto'\nborderWidth:0},emphasis:{label:{show:true,position:'top'}}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // TODO Better on polar\nvar markAreaTransform=function markAreaTransform(seriesModel,coordSys,maModel,item){var lt=dataTransform(seriesModel,item[0]);var rb=dataTransform(seriesModel,item[1]);var retrieve$$1=retrieve;// FIXME make sure lt is less than rb\nvar ltCoord=lt.coord;var rbCoord=rb.coord;ltCoord[0]=retrieve$$1(ltCoord[0],-Infinity);ltCoord[1]=retrieve$$1(ltCoord[1],-Infinity);rbCoord[0]=retrieve$$1(rbCoord[0],Infinity);rbCoord[1]=retrieve$$1(rbCoord[1],Infinity);// Merge option into one\nvar result=mergeAll([{},lt,rb]);result.coord=[lt.coord,rb.coord];result.x0=lt.x;result.y0=lt.y;result.x1=rb.x;result.y1=rb.y;return result;};function isInifinity$1(val){return!isNaN(val)&&!isFinite(val);}// If a markArea has one dim\nfunction ifMarkLineHasOnlyDim$1(dimIndex,fromCoord,toCoord,coordSys){var otherDimIndex=1-dimIndex;return isInifinity$1(fromCoord[otherDimIndex])&&isInifinity$1(toCoord[otherDimIndex]);}function markAreaFilter(coordSys,item){var fromCoord=item.coord[0];var toCoord=item.coord[1];if(coordSys.type==='cartesian2d'){// In case\n// {\n// markArea: {\n// data: [{ yAxis: 2 }]\n// }\n// }\nif(fromCoord&&toCoord&&(ifMarkLineHasOnlyDim$1(1,fromCoord,toCoord,coordSys)||ifMarkLineHasOnlyDim$1(0,fromCoord,toCoord,coordSys))){return true;}}return dataFilter$1(coordSys,{coord:fromCoord,x:item.x0,y:item.y0})||dataFilter$1(coordSys,{coord:toCoord,x:item.x1,y:item.y1});}// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\nfunction getSingleMarkerEndPoint(data,idx,dims,seriesModel,api){var coordSys=seriesModel.coordinateSystem;var itemModel=data.getItemModel(idx);var point;var xPx=parsePercent$1(itemModel.get(dims[0]),api.getWidth());var yPx=parsePercent$1(itemModel.get(dims[1]),api.getHeight());if(!isNaN(xPx)&&!isNaN(yPx)){point=[xPx,yPx];}else{// Chart like bar may have there own marker positioning logic\nif(seriesModel.getMarkerPosition){// Use the getMarkerPoisition\npoint=seriesModel.getMarkerPosition(data.getValues(dims,idx));}else{var x=data.get(dims[0],idx);var y=data.get(dims[1],idx);var pt=[x,y];coordSys.clampData&&coordSys.clampData(pt,pt);point=coordSys.dataToPoint(pt,true);}if(coordSys.type==='cartesian2d'){var xAxis=coordSys.getAxis('x');var yAxis=coordSys.getAxis('y');var x=data.get(dims[0],idx);var y=data.get(dims[1],idx);if(isInifinity$1(x)){point[0]=xAxis.toGlobalCoord(xAxis.getExtent()[dims[0]==='x0'?0:1]);}else if(isInifinity$1(y)){point[1]=yAxis.toGlobalCoord(yAxis.getExtent()[dims[1]==='y0'?0:1]);}}// Use x, y if has any\nif(!isNaN(xPx)){point[0]=xPx;}if(!isNaN(yPx)){point[1]=yPx;}}return point;}var dimPermutations=[['x0','y0'],['x1','y0'],['x1','y1'],['x0','y1']];MarkerView.extend({type:'markArea',// updateLayout: function (markAreaModel, ecModel, api) {\n// ecModel.eachSeries(function (seriesModel) {\n// var maModel = seriesModel.markAreaModel;\n// if (maModel) {\n// var areaData = maModel.getData();\n// areaData.each(function (idx) {\n// var points = zrUtil.map(dimPermutations, function (dim) {\n// return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n// });\n// // Layout\n// areaData.setItemLayout(idx, points);\n// var el = areaData.getItemGraphicEl(idx);\n// el.setShape('points', points);\n// });\n// }\n// }, this);\n// },\nupdateTransform:function updateTransform(markAreaModel,ecModel,api){ecModel.eachSeries(function(seriesModel){var maModel=seriesModel.markAreaModel;if(maModel){var areaData=maModel.getData();areaData.each(function(idx){var points=map(dimPermutations,function(dim){return getSingleMarkerEndPoint(areaData,idx,dim,seriesModel,api);});// Layout\nareaData.setItemLayout(idx,points);var el=areaData.getItemGraphicEl(idx);el.setShape('points',points);});}},this);},renderSeries:function renderSeries(seriesModel,maModel,ecModel,api){var coordSys=seriesModel.coordinateSystem;var seriesId=seriesModel.id;var seriesData=seriesModel.getData();var areaGroupMap=this.markerGroupMap;var polygonGroup=areaGroupMap.get(seriesId)||areaGroupMap.set(seriesId,{group:new Group()});this.group.add(polygonGroup.group);polygonGroup.__keep=true;var areaData=createList$3(coordSys,seriesModel,maModel);// Line data for tooltip and formatter\nmaModel.setData(areaData);// Update visual and layout of line\nareaData.each(function(idx){// Layout\nvar points=map(dimPermutations,function(dim){return getSingleMarkerEndPoint(areaData,idx,dim,seriesModel,api);});// If none of the area is inside coordSys, allClipped is set to be true\n// in layout so that label will not be displayed. See #12591\nvar allClipped=true;each$1(dimPermutations,function(dim){if(!allClipped){return;}var xValue=areaData.get(dim[0],idx);var yValue=areaData.get(dim[1],idx);// If is infinity, the axis should be considered not clipped\nif((isInifinity$1(xValue)||coordSys.getAxis('x').containData(xValue))&&(isInifinity$1(yValue)||coordSys.getAxis('y').containData(yValue))){allClipped=false;}});areaData.setItemLayout(idx,{points:points,allClipped:allClipped});// Visual\nareaData.setItemVisual(idx,{color:seriesData.getVisual('color')});});areaData.diff(polygonGroup.__data).add(function(idx){var layout=areaData.getItemLayout(idx);if(!layout.allClipped){var polygon=new Polygon({shape:{points:layout.points}});areaData.setItemGraphicEl(idx,polygon);polygonGroup.group.add(polygon);}}).update(function(newIdx,oldIdx){var polygon=polygonGroup.__data.getItemGraphicEl(oldIdx);var layout=areaData.getItemLayout(newIdx);if(!layout.allClipped){if(polygon){updateProps(polygon,{shape:{points:layout.points}},maModel,newIdx);}else{polygon=new Polygon({shape:{points:layout.points}});}areaData.setItemGraphicEl(newIdx,polygon);polygonGroup.group.add(polygon);}else if(polygon){polygonGroup.group.remove(polygon);}}).remove(function(idx){var polygon=polygonGroup.__data.getItemGraphicEl(idx);polygonGroup.group.remove(polygon);}).execute();areaData.eachItemGraphicEl(function(polygon,idx){var itemModel=areaData.getItemModel(idx);var labelModel=itemModel.getModel('label');var labelHoverModel=itemModel.getModel('emphasis.label');var color=areaData.getItemVisual(idx,'color');polygon.useStyle(defaults(itemModel.getModel('itemStyle').getItemStyle(),{fill:modifyAlpha(color,0.4),stroke:color}));polygon.hoverStyle=itemModel.getModel('emphasis.itemStyle').getItemStyle();setLabelStyle(polygon.style,polygon.hoverStyle,labelModel,labelHoverModel,{labelFetcher:maModel,labelDataIndex:idx,defaultText:areaData.getName(idx)||'',isRectText:true,autoColor:color});setHoverStyle(polygon,{});polygon.dataModel=maModel;});polygonGroup.__data=areaData;polygonGroup.group.silent=maModel.get('silent')||seriesModel.get('silent');}});/**\n * @inner\n * @param {module:echarts/coord/*} coordSys\n * @param {module:echarts/model/Series} seriesModel\n * @param {module:echarts/model/Model} mpModel\n */function createList$3(coordSys,seriesModel,maModel){var coordDimsInfos;var areaData;var dims=['x0','y0','x1','y1'];if(coordSys){coordDimsInfos=map(coordSys&&coordSys.dimensions,function(coordDim){var data=seriesModel.getData();var info=data.getDimensionInfo(data.mapDimension(coordDim))||{};// In map series data don't have lng and lat dimension. Fallback to same with coordSys\nreturn defaults({name:coordDim},info);});areaData=new List(map(dims,function(dim,idx){return{name:dim,type:coordDimsInfos[idx%2].type};}),maModel);}else{coordDimsInfos=[{name:'value',type:'float'}];areaData=new List(coordDimsInfos,maModel);}var optData=map(maModel.get('data'),curry(markAreaTransform,seriesModel,coordSys,maModel));if(coordSys){optData=filter(optData,curry(markAreaFilter,coordSys));}var dimValueGetter$$1=coordSys?function(item,dimName,dataIndex,dimIndex){return item.coord[Math.floor(dimIndex/2)][dimIndex%2];}:function(item){return item.value;};areaData.initData(optData,null,dimValueGetter$$1);areaData.hasItemOption=true;return areaData;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerPreprocessor(function(opt){// Make sure markArea component is enabled\nopt.markArea=opt.markArea||{};});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ComponentModel.registerSubTypeDefaulter('dataZoom',function(){// Default 'slider' when no type specified.\nreturn'slider';});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var AXIS_DIMS=['x','y','z','radius','angle','single'];// Supported coords.\nvar COORDS=['cartesian2d','polar','singleAxis'];/**\n * @param {string} coordType\n * @return {boolean}\n */function isCoordSupported(coordType){return indexOf(COORDS,coordType)>=0;}/**\n * Create \"each\" method to iterate names.\n *\n * @pubilc\n * @param {Array.} names\n * @param {Array.=} attrs\n * @return {Function}\n */function createNameEach(names,attrs){names=names.slice();var capitalNames=map(names,capitalFirst);attrs=(attrs||[]).slice();var capitalAttrs=map(attrs,capitalFirst);return function(callback,context){each$1(names,function(name,index){var nameObj={name:name,capital:capitalNames[index]};for(var j=0;j=0;}function isLinked(node,result){var hasLink=false;forEachEdgeType(function(edgeType){each$1(edgeIdGetter(node,edgeType)||[],function(edgeId){result.records[edgeType.name][edgeId]&&(hasLink=true);});});return hasLink;}function absorb(node,result){result.nodes.push(node);forEachEdgeType(function(edgeType){each$1(edgeIdGetter(node,edgeType)||[],function(edgeId){result.records[edgeType.name][edgeId]=true;});});}}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Calculate slider move result.\n * Usage:\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\n *\n * @param {number} delta Move length.\n * @param {Array.} handleEnds handleEnds[0] can be bigger then handleEnds[1].\n * handleEnds will be modified in this method.\n * @param {Array.} extent handleEnds is restricted by extent.\n * extent[0] should less or equals than extent[1].\n * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds.\n * @param {number} [minSpan] The range of dataZoom can not be smaller than that.\n * If not set, handle0 and cross handle1. If set as a non-negative\n * number (including `0`), handles will push each other when reaching\n * the minSpan.\n * @param {number} [maxSpan] The range of dataZoom can not be larger than that.\n * @return {Array.} The input handleEnds.\n */var sliderMove=function sliderMove(delta,handleEnds,extent,handleIndex,minSpan,maxSpan){delta=delta||0;var extentSpan=extent[1]-extent[0];// Notice maxSpan and minSpan can be null/undefined.\nif(minSpan!=null){minSpan=restrict(minSpan,[0,extentSpan]);}if(maxSpan!=null){maxSpan=Math.max(maxSpan,minSpan!=null?minSpan:0);}if(handleIndex==='all'){var handleSpan=Math.abs(handleEnds[1]-handleEnds[0]);handleSpan=restrict(handleSpan,[0,extentSpan]);minSpan=maxSpan=restrict(handleSpan,[minSpan,maxSpan]);handleIndex=0;}handleEnds[0]=restrict(handleEnds[0],extent);handleEnds[1]=restrict(handleEnds[1],extent);var originalDistSign=getSpanSign(handleEnds,handleIndex);handleEnds[handleIndex]+=delta;// Restrict in extent.\nvar extentMinSpan=minSpan||0;var realExtent=extent.slice();originalDistSign.sign<0?realExtent[0]+=extentMinSpan:realExtent[1]-=extentMinSpan;handleEnds[handleIndex]=restrict(handleEnds[handleIndex],realExtent);// Expand span.\nvar currDistSign=getSpanSign(handleEnds,handleIndex);if(minSpan!=null&&(currDistSign.sign!==originalDistSign.sign||currDistSign.spanmaxSpan){handleEnds[1-handleIndex]=handleEnds[handleIndex]+currDistSign.sign*maxSpan;}return handleEnds;};function getSpanSign(handleEnds,handleIndex){var dist=handleEnds[handleIndex]-handleEnds[1-handleIndex];// If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n// is at left of handleEnds[1] for non-cross case.\nreturn{span:Math.abs(dist),sign:dist>0?-1:dist<0?1:handleIndex?-1:1};}function restrict(value,extend){return Math.min(extend[1]!=null?extend[1]:Infinity,Math.max(extend[0]!=null?extend[0]:-Infinity,value));}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$13=each$1;var asc$1=asc;/**\n * Operate single axis.\n * One axis can only operated by one axis operator.\n * Different dataZoomModels may be defined to operate the same axis.\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\n * So dataZoomModels share one axisProxy in that case.\n *\n * @class\n */var AxisProxy=function AxisProxy(dimName,axisIndex,dataZoomModel,ecModel){/**\n * @private\n * @type {string}\n */this._dimName=dimName;/**\n * @private\n */this._axisIndex=axisIndex;/**\n * @private\n * @type {Array.}\n */this._valueWindow;/**\n * @private\n * @type {Array.}\n */this._percentWindow;/**\n * @private\n * @type {Array.}\n */this._dataExtent;/**\n * {minSpan, maxSpan, minValueSpan, maxValueSpan}\n * @private\n * @type {Object}\n */this._minMaxSpan;/**\n * @readOnly\n * @type {module: echarts/model/Global}\n */this.ecModel=ecModel;/**\n * @private\n * @type {module: echarts/component/dataZoom/DataZoomModel}\n */this._dataZoomModel=dataZoomModel;// /**\n// * @readOnly\n// * @private\n// */\n// this.hasSeriesStacked;\n};AxisProxy.prototype={constructor:AxisProxy,/**\n * Whether the axisProxy is hosted by dataZoomModel.\n *\n * @public\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n * @return {boolean}\n */hostedBy:function hostedBy(dataZoomModel){return this._dataZoomModel===dataZoomModel;},/**\n * @return {Array.} Value can only be NaN or finite value.\n */getDataValueWindow:function getDataValueWindow(){return this._valueWindow.slice();},/**\n * @return {Array.}\n */getDataPercentWindow:function getDataPercentWindow(){return this._percentWindow.slice();},/**\n * @public\n * @param {number} axisIndex\n * @return {Array} seriesModels\n */getTargetSeriesModels:function getTargetSeriesModels(){var seriesModels=[];var ecModel=this.ecModel;ecModel.eachSeries(function(seriesModel){if(isCoordSupported(seriesModel.get('coordinateSystem'))){var dimName=this._dimName;var axisModel=ecModel.queryComponents({mainType:dimName+'Axis',index:seriesModel.get(dimName+'AxisIndex'),id:seriesModel.get(dimName+'AxisId')})[0];if(this._axisIndex===(axisModel&&axisModel.componentIndex)){seriesModels.push(seriesModel);}}},this);return seriesModels;},getAxisModel:function getAxisModel(){return this.ecModel.getComponent(this._dimName+'Axis',this._axisIndex);},getOtherAxisModel:function getOtherAxisModel(){var axisDim=this._dimName;var ecModel=this.ecModel;var axisModel=this.getAxisModel();var isCartesian=axisDim==='x'||axisDim==='y';var otherAxisDim;var coordSysIndexName;if(isCartesian){coordSysIndexName='gridIndex';otherAxisDim=axisDim==='x'?'y':'x';}else{coordSysIndexName='polarIndex';otherAxisDim=axisDim==='angle'?'radius':'angle';}var foundOtherAxisModel;ecModel.eachComponent(otherAxisDim+'Axis',function(otherAxisModel){if((otherAxisModel.get(coordSysIndexName)||0)===(axisModel.get(coordSysIndexName)||0)){foundOtherAxisModel=otherAxisModel;}});return foundOtherAxisModel;},getMinMaxSpan:function getMinMaxSpan(){return _clone(this._minMaxSpan);},/**\n * Only calculate by given range and this._dataExtent, do not change anything.\n *\n * @param {Object} opt\n * @param {number} [opt.start]\n * @param {number} [opt.end]\n * @param {number} [opt.startValue]\n * @param {number} [opt.endValue]\n */calculateDataWindow:function calculateDataWindow(opt){var dataExtent=this._dataExtent;var axisModel=this.getAxisModel();var scale=axisModel.axis.scale;var rangePropMode=this._dataZoomModel.getRangePropMode();var percentExtent=[0,100];var percentWindow=[];var valueWindow=[];var hasPropModeValue;each$13(['start','end'],function(prop,idx){var boundPercent=opt[prop];var boundValue=opt[prop+'Value'];// Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n// on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n// but not min/max of axis, which will be calculated by data window then).\n// The former one is suitable for cases that a dataZoom component controls multiple\n// axes with different unit or extent, and the latter one is suitable for accurate\n// zoom by pixel (e.g., in dataZoomSelect).\n// we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n// only when setOption or dispatchAction, otherwise it remains its original value.\n// (Why not only record `percentProp` and always map to `valueProp`? Because\n// the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n// `valueProp`. consider two axes constrolled by one dataZoom. They have different\n// data extent. All of values that are overflow the `dataExtent` will be calculated\n// to percent '100%').\nif(rangePropMode[idx]==='percent'){boundPercent==null&&(boundPercent=percentExtent[idx]);// Use scale.parse to math round for category or time axis.\nboundValue=scale.parse(linearMap(boundPercent,percentExtent,dataExtent));}else{hasPropModeValue=true;boundValue=boundValue==null?dataExtent[idx]:scale.parse(boundValue);// Calculating `percent` from `value` may be not accurate, because\n// This calculation can not be inversed, because all of values that\n// are overflow the `dataExtent` will be calculated to percent '100%'\nboundPercent=linearMap(boundValue,dataExtent,percentExtent);}// valueWindow[idx] = round(boundValue);\n// percentWindow[idx] = round(boundPercent);\nvalueWindow[idx]=boundValue;percentWindow[idx]=boundPercent;});asc$1(valueWindow);asc$1(percentWindow);// The windows from user calling of `dispatchAction` might be out of the extent,\n// or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window\n// by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n// where API is able to initialize/modify the window size even though `zoomLock`\n// specified.\nvar spans=this._minMaxSpan;hasPropModeValue?restrictSet(valueWindow,percentWindow,dataExtent,percentExtent,false):restrictSet(percentWindow,valueWindow,percentExtent,dataExtent,true);function restrictSet(fromWindow,toWindow,fromExtent,toExtent,toValue){var suffix=toValue?'Span':'ValueSpan';sliderMove(0,fromWindow,fromExtent,'all',spans['min'+suffix],spans['max'+suffix]);for(var i=0;i<2;i++){toWindow[i]=linearMap(fromWindow[i],fromExtent,toExtent,true);toValue&&(toWindow[i]=scale.parse(toWindow[i]));}}return{valueWindow:valueWindow,percentWindow:percentWindow};},/**\n * Notice: reset should not be called before series.restoreData() called,\n * so it is recommanded to be called in \"process stage\" but not \"model init\n * stage\".\n *\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n */reset:function reset(dataZoomModel){if(dataZoomModel!==this._dataZoomModel){return;}var targetSeries=this.getTargetSeriesModels();// Culculate data window and data extent, and record them.\nthis._dataExtent=calculateDataExtent(this,this._dimName,targetSeries);// this.hasSeriesStacked = false;\n// each(targetSeries, function (series) {\n// var data = series.getData();\n// var dataDim = data.mapDimension(this._dimName);\n// var stackedDimension = data.getCalculationInfo('stackedDimension');\n// if (stackedDimension && stackedDimension === dataDim) {\n// this.hasSeriesStacked = true;\n// }\n// }, this);\n// `calculateDataWindow` uses min/maxSpan.\nsetMinMaxSpan(this);var dataWindow=this.calculateDataWindow(dataZoomModel.settledOption);this._valueWindow=dataWindow.valueWindow;this._percentWindow=dataWindow.percentWindow;// Update axis setting then.\nsetAxisModel(this);},/**\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n */restore:function restore(dataZoomModel){if(dataZoomModel!==this._dataZoomModel){return;}this._valueWindow=this._percentWindow=null;setAxisModel(this,true);},/**\n * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel\n */filterData:function filterData(dataZoomModel,api){if(dataZoomModel!==this._dataZoomModel){return;}var axisDim=this._dimName;var seriesModels=this.getTargetSeriesModels();var filterMode=dataZoomModel.get('filterMode');var valueWindow=this._valueWindow;if(filterMode==='none'){return;}// FIXME\n// Toolbox may has dataZoom injected. And if there are stacked bar chart\n// with NaN data, NaN will be filtered and stack will be wrong.\n// So we need to force the mode to be set empty.\n// In fect, it is not a big deal that do not support filterMode-'filter'\n// when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n// selection\" some day, which might need \"adapt to data extent on the\n// otherAxis\", which is disabled by filterMode-'empty'.\n// But currently, stack has been fixed to based on value but not index,\n// so this is not an issue any more.\n// var otherAxisModel = this.getOtherAxisModel();\n// if (dataZoomModel.get('$fromToolbox')\n// && otherAxisModel\n// && otherAxisModel.hasSeriesStacked\n// ) {\n// filterMode = 'empty';\n// }\n// TODO\n// filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\neach$13(seriesModels,function(seriesModel){var seriesData=seriesModel.getData();var dataDims=seriesData.mapDimension(axisDim,true);if(!dataDims.length){return;}if(filterMode==='weakFilter'){seriesData.filterSelf(function(dataIndex){var leftOut;var rightOut;var hasValue;for(var i=0;ivalueWindow[1];if(thisHasValue&&!thisLeftOut&&!thisRightOut){return true;}thisHasValue&&(hasValue=true);thisLeftOut&&(leftOut=true);thisRightOut&&(rightOut=true);}// If both left out and right out, do not filter.\nreturn hasValue&&leftOut&&rightOut;});}else{each$13(dataDims,function(dim){if(filterMode==='empty'){seriesModel.setData(seriesData=seriesData.map(dim,function(value){return!isInWindow(value)?NaN:value;}));}else{var range={};range[dim]=valueWindow;// console.time('select');\nseriesData.selectRange(range);// console.timeEnd('select');\n}});}each$13(dataDims,function(dim){seriesData.setApproximateExtent(valueWindow,dim);});});function isInWindow(value){return value>=valueWindow[0]&&value<=valueWindow[1];}}};function calculateDataExtent(axisProxy,axisDim,seriesModels){var dataExtent=[Infinity,-Infinity];each$13(seriesModels,function(seriesModel){var seriesData=seriesModel.getData();if(seriesData){each$13(seriesData.mapDimension(axisDim,true),function(dim){var seriesExtent=seriesData.getApproximateExtent(dim);seriesExtent[0]dataExtent[1]&&(dataExtent[1]=seriesExtent[1]);});}});if(dataExtent[1]0?0:NaN;}var max=axisModel.getMax(true);if(max!=null&&max!=='dataMax'&&typeof max!=='function'){dataExtent[1]=max;}else if(isCategoryAxis){dataExtent[1]=axisDataLen>0?axisDataLen-1:NaN;}if(!axisModel.get('scale',true)){dataExtent[0]>0&&(dataExtent[0]=0);dataExtent[1]<0&&(dataExtent[1]=0);}// For value axis, if min/max/scale are not set, we just use the extent obtained\n// by series data, which may be a little different from the extent calculated by\n// `axisHelper.getScaleExtent`. But the different just affects the experience a\n// little when zooming. So it will not be fixed until some users require it strongly.\nreturn dataExtent;}function setAxisModel(axisProxy,isRestore){var axisModel=axisProxy.getAxisModel();var percentWindow=axisProxy._percentWindow;var valueWindow=axisProxy._valueWindow;if(!percentWindow){return;}// [0, 500]: arbitrary value, guess axis extent.\nvar precision=_getPixelPrecision(valueWindow,[0,500]);precision=Math.min(precision,20);// isRestore or isFull\nvar useOrigin=isRestore||percentWindow[0]===0&&percentWindow[1]===100;axisModel.setRange(useOrigin?null:+valueWindow[0].toFixed(precision),useOrigin?null:+valueWindow[1].toFixed(precision));}function setMinMaxSpan(axisProxy){var minMaxSpan=axisProxy._minMaxSpan={};var dataZoomModel=axisProxy._dataZoomModel;var dataExtent=axisProxy._dataExtent;each$13(['min','max'],function(minMax){var percentSpan=dataZoomModel.get(minMax+'Span');var valueSpan=dataZoomModel.get(minMax+'ValueSpan');valueSpan!=null&&(valueSpan=axisProxy.getAxisModel().axis.scale.parse(valueSpan));// minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\nif(valueSpan!=null){percentSpan=linearMap(dataExtent[0]+valueSpan,dataExtent,[0,100],true);}else if(percentSpan!=null){valueSpan=linearMap(percentSpan,[0,100],dataExtent,true)-dataExtent[0];}minMaxSpan[minMax+'Span']=percentSpan;minMaxSpan[minMax+'ValueSpan']=valueSpan;});}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$12=each$1;var eachAxisDim=eachAxisDim$1;var DataZoomModel=extendComponentModel({type:'dataZoom',dependencies:['xAxis','yAxis','zAxis','radiusAxis','angleAxis','singleAxis','series'],/**\n * @protected\n */defaultOption:{zlevel:0,z:4,// Higher than normal component (z: 2).\norient:null,// Default auto by axisIndex. Possible value: 'horizontal', 'vertical'.\nxAxisIndex:null,// Default the first horizontal category axis.\nyAxisIndex:null,// Default the first vertical category axis.\nfilterMode:'filter',// Possible values: 'filter' or 'empty' or 'weakFilter'.\n// 'filter': data items which are out of window will be removed. This option is\n// applicable when filtering outliers. For each data item, it will be\n// filtered if one of the relevant dimensions is out of the window.\n// 'weakFilter': data items which are out of window will be removed. This option\n// is applicable when filtering outliers. For each data item, it will be\n// filtered only if all of the relevant dimensions are out of the same\n// side of the window.\n// 'empty': data items which are out of window will be set to empty.\n// This option is applicable when user should not neglect\n// that there are some data items out of window.\n// 'none': Do not filter.\n// Taking line chart as an example, line will be broken in\n// the filtered points when filterModel is set to 'empty', but\n// be connected when set to 'filter'.\nthrottle:null,// Dispatch action by the fixed rate, avoid frequency.\n// default 100. Do not throttle when use null/undefined.\n// If animation === true and animationDurationUpdate > 0,\n// default value is 100, otherwise 20.\nstart:0,// Start percent. 0 ~ 100\nend:100,// End percent. 0 ~ 100\nstartValue:null,// Start value. If startValue specified, start is ignored.\nendValue:null,// End value. If endValue specified, end is ignored.\nminSpan:null,// 0 ~ 100\nmaxSpan:null,// 0 ~ 100\nminValueSpan:null,// The range of dataZoom can not be smaller than that.\nmaxValueSpan:null,// The range of dataZoom can not be larger than that.\nrangeMode:null// Array, can be 'value' or 'percent'.\n},/**\n * @override\n */init:function init(option,parentModel,ecModel){/**\n * key like x_0, y_1\n * @private\n * @type {Object}\n */this._dataIntervalByAxis={};/**\n * @private\n */this._dataInfo={};/**\n * key like x_0, y_1\n * @private\n */this._axisProxies={};/**\n * @readOnly\n */this.textStyleModel;/**\n * @private\n */this._autoThrottle=true;/**\n * It is `[rangeModeForMin, rangeModeForMax]`.\n * The optional values for `rangeMode`:\n * + `'value'` mode: the axis extent will always be determined by\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\n * how data like and how `axis.min` and `axis.max` are.\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\n *\n * For example, when users are using dynamic data (update data periodically via `setOption`),\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\n *\n * @private\n */this._rangePropMode=['percent','percent'];var inputRawOption=retrieveRawOption(option);/**\n * Suppose a \"main process\" start at the point that model prepared (that is,\n * model initialized or merged or method called in `action`).\n * We should keep the `main process` idempotent, that is, given a set of values\n * on `option`, we get the same result.\n *\n * But sometimes, values on `option` will be updated for providing users\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\n * should not be the base/input of the `main process`.\n *\n * So in that case we should save and keep the input of the `main process`\n * separately, called `settledOption`.\n *\n * For example, consider the case:\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\n * where the original input `option.startValue`, `option.endValue` are earsed by\n * calculated value.\n * (Step)2) click the legend to hide and show a series,\n * where the new range is calculated by the earsed `startValue` and `endValue`,\n * which brings incorrect result.\n *\n * @readOnly\n */this.settledOption=inputRawOption;this.mergeDefaultAndTheme(option,ecModel);this.doInit(inputRawOption);},/**\n * @override\n */mergeOption:function mergeOption(newOption){var inputRawOption=retrieveRawOption(newOption);//FIX #2591\nmerge(this.option,newOption,true);merge(this.settledOption,inputRawOption,true);this.doInit(inputRawOption);},/**\n * @protected\n */doInit:function doInit(inputRawOption){var thisOption=this.option;// Disable realtime view update if canvas is not supported.\nif(!env$1.canvasSupported){thisOption.realtime=false;}this._setDefaultThrottle(inputRawOption);updateRangeUse(this,inputRawOption);var settledOption=this.settledOption;each$12([['start','startValue'],['end','endValue']],function(names,index){// start/end has higher priority over startValue/endValue if they\n// both set, but we should make chart.setOption({endValue: 1000})\n// effective, rather than chart.setOption({endValue: 1000, end: null}).\nif(this._rangePropMode[index]==='value'){thisOption[names[0]]=settledOption[names[0]]=null;}// Otherwise do nothing and use the merge result.\n},this);this.textStyleModel=this.getModel('textStyle');this._resetTarget();this._giveAxisProxies();},/**\n * @private\n */_giveAxisProxies:function _giveAxisProxies(){var axisProxies=this._axisProxies;this.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel,ecModel){var axisModel=this.dependentModels[dimNames.axis][axisIndex];// If exists, share axisProxy with other dataZoomModels.\nvar axisProxy=axisModel.__dzAxisProxy||(// Use the first dataZoomModel as the main model of axisProxy.\naxisModel.__dzAxisProxy=new AxisProxy(dimNames.name,axisIndex,this,ecModel));// FIXME\n// dispose __dzAxisProxy\naxisProxies[dimNames.name+'_'+axisIndex]=axisProxy;},this);},/**\n * @private\n */_resetTarget:function _resetTarget(){var thisOption=this.option;var autoMode=this._judgeAutoMode();eachAxisDim(function(dimNames){var axisIndexName=dimNames.axisIndex;thisOption[axisIndexName]=normalizeToArray(thisOption[axisIndexName]);},this);if(autoMode==='axisIndex'){this._autoSetAxisIndex();}else if(autoMode==='orient'){this._autoSetOrient();}},/**\n * @private\n */_judgeAutoMode:function _judgeAutoMode(){// Auto set only works for setOption at the first time.\n// The following is user's reponsibility. So using merged\n// option is OK.\nvar thisOption=this.option;var hasIndexSpecified=false;eachAxisDim(function(dimNames){// When user set axisIndex as a empty array, we think that user specify axisIndex\n// but do not want use auto mode. Because empty array may be encountered when\n// some error occured.\nif(thisOption[dimNames.axisIndex]!=null){hasIndexSpecified=true;}},this);var orient=thisOption.orient;if(orient==null&&hasIndexSpecified){return'orient';}else if(!hasIndexSpecified){if(orient==null){thisOption.orient='horizontal';}return'axisIndex';}},/**\n * @private\n */_autoSetAxisIndex:function _autoSetAxisIndex(){var autoAxisIndex=true;var orient=this.get('orient',true);var thisOption=this.option;var dependentModels=this.dependentModels;if(autoAxisIndex){// Find axis that parallel to dataZoom as default.\nvar dimName=orient==='vertical'?'y':'x';if(dependentModels[dimName+'Axis'].length){thisOption[dimName+'AxisIndex']=[0];autoAxisIndex=false;}else{each$12(dependentModels.singleAxis,function(singleAxisModel){if(autoAxisIndex&&singleAxisModel.get('orient',true)===orient){thisOption.singleAxisIndex=[singleAxisModel.componentIndex];autoAxisIndex=false;}});}}if(autoAxisIndex){// Find the first category axis as default. (consider polar)\neachAxisDim(function(dimNames){if(!autoAxisIndex){return;}var axisIndices=[];var axisModels=this.dependentModels[dimNames.axis];if(axisModels.length&&!axisIndices.length){for(var i=0,len=axisModels.length;i0?100:20;}},/**\n * @public\n */getFirstTargetAxisModel:function getFirstTargetAxisModel(){var firstAxisModel;eachAxisDim(function(dimNames){if(firstAxisModel==null){var indices=this.get(dimNames.axisIndex);if(indices.length){firstAxisModel=this.dependentModels[dimNames.axis][indices[0]];}}},this);return firstAxisModel;},/**\n * @public\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\n */eachTargetAxis:function eachTargetAxis(callback,context){var ecModel=this.ecModel;eachAxisDim(function(dimNames){each$12(this.get(dimNames.axisIndex),function(axisIndex){callback.call(context,dimNames,axisIndex,this,ecModel);},this);},this);},/**\n * @param {string} dimName\n * @param {number} axisIndex\n * @return {module:echarts/component/dataZoom/AxisProxy} If not found, return null/undefined.\n */getAxisProxy:function getAxisProxy(dimName,axisIndex){return this._axisProxies[dimName+'_'+axisIndex];},/**\n * @param {string} dimName\n * @param {number} axisIndex\n * @return {module:echarts/model/Model} If not found, return null/undefined.\n */getAxisModel:function getAxisModel(dimName,axisIndex){var axisProxy=this.getAxisProxy(dimName,axisIndex);return axisProxy&&axisProxy.getAxisModel();},/**\n * If not specified, set to undefined.\n *\n * @public\n * @param {Object} opt\n * @param {number} [opt.start]\n * @param {number} [opt.end]\n * @param {number} [opt.startValue]\n * @param {number} [opt.endValue]\n */setRawRange:function setRawRange(opt){var thisOption=this.option;var settledOption=this.settledOption;each$12([['start','startValue'],['end','endValue']],function(names){// Consider the pair :\n// If one has value and the other one is `null/undefined`, we both set them\n// to `settledOption`. This strategy enables the feature to clear the original\n// value in `settledOption` to `null/undefined`.\n// But if both of them are `null/undefined`, we do not set them to `settledOption`\n// and keep `settledOption` with the original value. This strategy enables users to\n// only set but not set when calling\n// `dispatchAction`.\n// The pair is treated in the same way.\nif(opt[names[0]]!=null||opt[names[1]]!=null){thisOption[names[0]]=settledOption[names[0]]=opt[names[0]];thisOption[names[1]]=settledOption[names[1]]=opt[names[1]];}},this);updateRangeUse(this,opt);},/**\n * @public\n * @param {Object} opt\n * @param {number} [opt.start]\n * @param {number} [opt.end]\n * @param {number} [opt.startValue]\n * @param {number} [opt.endValue]\n */setCalculatedRange:function setCalculatedRange(opt){var option=this.option;each$12(['start','startValue','end','endValue'],function(name){option[name]=opt[name];});},/**\n * @public\n * @return {Array.} [startPercent, endPercent]\n */getPercentRange:function getPercentRange(){var axisProxy=this.findRepresentativeAxisProxy();if(axisProxy){return axisProxy.getDataPercentWindow();}},/**\n * @public\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\n *\n * @param {string} [axisDimName]\n * @param {number} [axisIndex]\n * @return {Array.} [startValue, endValue] value can only be '-' or finite number.\n */getValueRange:function getValueRange(axisDimName,axisIndex){if(axisDimName==null&&axisIndex==null){var axisProxy=this.findRepresentativeAxisProxy();if(axisProxy){return axisProxy.getDataValueWindow();}}else{return this.getAxisProxy(axisDimName,axisIndex).getDataValueWindow();}},/**\n * @public\n * @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy\n * corresponding to the axisModel\n * @return {module:echarts/component/dataZoom/AxisProxy}\n */findRepresentativeAxisProxy:function findRepresentativeAxisProxy(axisModel){if(axisModel){return axisModel.__dzAxisProxy;}// Find the first hosted axisProxy\nvar axisProxies=this._axisProxies;for(var key in axisProxies){if(axisProxies.hasOwnProperty(key)&&axisProxies[key].hostedBy(this)){return axisProxies[key];}}// If no hosted axis find not hosted axisProxy.\n// Consider this case: dataZoomModel1 and dataZoomModel2 control the same axis,\n// and the option.start or option.end settings are different. The percentRange\n// should follow axisProxy.\n// (We encounter this problem in toolbox data zoom.)\nfor(var key in axisProxies){if(axisProxies.hasOwnProperty(key)&&!axisProxies[key].hostedBy(this)){return axisProxies[key];}}},/**\n * @return {Array.}\n */getRangePropMode:function getRangePropMode(){return this._rangePropMode.slice();}});/**\n * Retrieve the those raw params from option, which will be cached separately.\n * becasue they will be overwritten by normalized/calculated values in the main\n * process.\n */function retrieveRawOption(option){var ret={};each$12(['start','end','startValue','endValue','throttle'],function(name){option.hasOwnProperty(name)&&(ret[name]=option[name]);});return ret;}function updateRangeUse(dataZoomModel,inputRawOption){var rangePropMode=dataZoomModel._rangePropMode;var rangeModeInOption=dataZoomModel.get('rangeMode');each$12([['start','startValue'],['end','endValue']],function(names,index){var percentSpecified=inputRawOption[names[0]]!=null;var valueSpecified=inputRawOption[names[1]]!=null;if(percentSpecified&&!valueSpecified){rangePropMode[index]='percent';}else if(!percentSpecified&&valueSpecified){rangePropMode[index]='value';}else if(rangeModeInOption){rangePropMode[index]=rangeModeInOption[index];}else if(percentSpecified){// percentSpecified && valueSpecified\nrangePropMode[index]='percent';}// else remain its original setting.\n});}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var DataZoomView=Component$1.extend({type:'dataZoom',render:function render(dataZoomModel,ecModel,api,payload){this.dataZoomModel=dataZoomModel;this.ecModel=ecModel;this.api=api;},/**\n * Find the first target coordinate system.\n *\n * @protected\n * @return {Object} {\n * grid: [\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\n * ...\n * ], // cartesians must not be null/undefined.\n * polar: [\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\n * ...\n * ], // polars must not be null/undefined.\n * singleAxis: [\n * {model: coord0, axisModels: [], coordIndex: 0}\n * ]\n */getTargetCoordInfo:function getTargetCoordInfo(){var dataZoomModel=this.dataZoomModel;var ecModel=this.ecModel;var coordSysLists={};dataZoomModel.eachTargetAxis(function(dimNames,axisIndex){var axisModel=ecModel.getComponent(dimNames.axis,axisIndex);if(axisModel){var coordModel=axisModel.getCoordSysModel();coordModel&&save(coordModel,axisModel,coordSysLists[coordModel.mainType]||(coordSysLists[coordModel.mainType]=[]),coordModel.componentIndex);}},this);function save(coordModel,axisModel,store,coordIndex){var item;for(var i=0;i placeholder. Using placehoder here because\n// deault value can only be drived in view stage.\nright:'ph',// Default align to grid rect.\ntop:'ph',// Default align to grid rect.\nwidth:'ph',// Default align to grid rect.\nheight:'ph',// Default align to grid rect.\nleft:null,// Default align to grid rect.\nbottom:null,// Default align to grid rect.\nbackgroundColor:'rgba(47,69,84,0)',// Background of slider zoom component.\n// dataBackgroundColor: '#ddd', // Background coor of data shadow and border of box,\n// highest priority, remain for compatibility of\n// previous version, but not recommended any more.\ndataBackground:{lineStyle:{color:'#2f4554',width:0.5,opacity:0.3},areaStyle:{color:'rgba(47,69,84,0.3)',opacity:0.3}},borderColor:'#ddd',// border color of the box. For compatibility,\n// if dataBackgroundColor is set, borderColor\n// is ignored.\nfillerColor:'rgba(167,183,204,0.4)',// Color of selected area.\n// handleColor: 'rgba(89,170,216,0.95)', // Color of handle.\n// handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z',\n/* eslint-disable */handleIcon:'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z',/* eslint-enable */ // Percent of the slider height\nhandleSize:'100%',handleStyle:{color:'#a7b7cc'},labelPrecision:null,labelFormatter:null,showDetail:true,showDataShadow:'auto',// Default auto decision.\nrealtime:true,zoomLock:false,// Whether disable zoom.\ntextStyle:{color:'#333'}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var Rect$1=Rect;var linearMap$1=linearMap;var asc$2=asc;var bind$3=bind;var each$14=each$1;// Constants\nvar DEFAULT_LOCATION_EDGE_GAP=7;var DEFAULT_FRAME_BORDER_WIDTH=1;var DEFAULT_FILLER_SIZE=30;var HORIZONTAL='horizontal';var VERTICAL='vertical';var LABEL_GAP=5;var SHOW_DATA_SHADOW_SERIES_TYPE=['line','bar','candlestick','scatter'];var SliderZoomView=DataZoomView.extend({type:'dataZoom.slider',init:function init(ecModel,api){/**\n * @private\n * @type {Object}\n */this._displayables={};/**\n * @private\n * @type {string}\n */this._orient;/**\n * [0, 100]\n * @private\n */this._range;/**\n * [coord of the first handle, coord of the second handle]\n * @private\n */this._handleEnds;/**\n * [length, thick]\n * @private\n * @type {Array.}\n */this._size;/**\n * @private\n * @type {number}\n */this._handleWidth;/**\n * @private\n * @type {number}\n */this._handleHeight;/**\n * @private\n */this._location;/**\n * @private\n */this._dragging;/**\n * @private\n */this._dataShadowInfo;this.api=api;},/**\n * @override\n */render:function render(dataZoomModel,ecModel,api,payload){SliderZoomView.superApply(this,'render',arguments);createOrUpdate(this,'_dispatchZoomAction',this.dataZoomModel.get('throttle'),'fixRate');this._orient=dataZoomModel.get('orient');if(this.dataZoomModel.get('show')===false){this.group.removeAll();return;}// Notice: this._resetInterval() should not be executed when payload.type\n// is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n// or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\nif(!payload||payload.type!=='dataZoom'||payload.from!==this.uid){this._buildView();}this._updateView();},/**\n * @override\n */remove:function remove(){SliderZoomView.superApply(this,'remove',arguments);clear(this,'_dispatchZoomAction');},/**\n * @override\n */dispose:function dispose(){SliderZoomView.superApply(this,'dispose',arguments);clear(this,'_dispatchZoomAction');},_buildView:function _buildView(){var thisGroup=this.group;thisGroup.removeAll();this._resetLocation();this._resetInterval();var barGroup=this._displayables.barGroup=new Group();this._renderBackground();this._renderHandle();this._renderDataShadow();thisGroup.add(barGroup);this._positionGroup();},/**\n * @private\n */_resetLocation:function _resetLocation(){var dataZoomModel=this.dataZoomModel;var api=this.api;// If some of x/y/width/height are not specified,\n// auto-adapt according to target grid.\nvar coordRect=this._findCoordRect();var ecSize={width:api.getWidth(),height:api.getHeight()};// Default align by coordinate system rect.\nvar positionInfo=this._orient===HORIZONTAL?{// Why using 'right', because right should be used in vertical,\n// and it is better to be consistent for dealing with position param merge.\nright:ecSize.width-coordRect.x-coordRect.width,top:ecSize.height-DEFAULT_FILLER_SIZE-DEFAULT_LOCATION_EDGE_GAP,width:coordRect.width,height:DEFAULT_FILLER_SIZE}:{// vertical\nright:DEFAULT_LOCATION_EDGE_GAP,top:coordRect.y,width:DEFAULT_FILLER_SIZE,height:coordRect.height};// Do not write back to option and replace value 'ph', because\n// the 'ph' value should be recalculated when resize.\nvar layoutParams=getLayoutParams(dataZoomModel.option);// Replace the placeholder value.\neach$1(['right','top','width','height'],function(name){if(layoutParams[name]==='ph'){layoutParams[name]=positionInfo[name];}});var layoutRect=getLayoutRect(layoutParams,ecSize,dataZoomModel.padding);this._location={x:layoutRect.x,y:layoutRect.y};this._size=[layoutRect.width,layoutRect.height];this._orient===VERTICAL&&this._size.reverse();},/**\n * @private\n */_positionGroup:function _positionGroup(){var thisGroup=this.group;var location=this._location;var orient=this._orient;// Just use the first axis to determine mapping.\nvar targetAxisModel=this.dataZoomModel.getFirstTargetAxisModel();var inverse=targetAxisModel&&targetAxisModel.get('inverse');var barGroup=this._displayables.barGroup;var otherAxisInverse=(this._dataShadowInfo||{}).otherAxisInverse;// Transform barGroup.\nbarGroup.attr(orient===HORIZONTAL&&!inverse?{scale:otherAxisInverse?[1,1]:[1,-1]}:orient===HORIZONTAL&&inverse?{scale:otherAxisInverse?[-1,1]:[-1,-1]}:orient===VERTICAL&&!inverse?{scale:otherAxisInverse?[1,-1]:[1,1],rotation:Math.PI/2}// Dont use Math.PI, considering shadow direction.\n:{scale:otherAxisInverse?[-1,-1]:[-1,1],rotation:Math.PI/2});// Position barGroup\nvar rect=thisGroup.getBoundingRect([barGroup]);thisGroup.attr('position',[location.x-rect.x,location.y-rect.y]);},/**\n * @private\n */_getViewExtent:function _getViewExtent(){return[0,this._size[0]];},_renderBackground:function _renderBackground(){var dataZoomModel=this.dataZoomModel;var size=this._size;var barGroup=this._displayables.barGroup;barGroup.add(new Rect$1({silent:true,shape:{x:0,y:0,width:size[0],height:size[1]},style:{fill:dataZoomModel.get('backgroundColor')},z2:-40}));// Click panel, over shadow, below handles.\nbarGroup.add(new Rect$1({shape:{x:0,y:0,width:size[0],height:size[1]},style:{fill:'transparent'},z2:0,onclick:bind(this._onClickPanelClick,this)}));},_renderDataShadow:function _renderDataShadow(){var info=this._dataShadowInfo=this._prepareDataShadowInfo();if(!info){return;}var size=this._size;var seriesModel=info.series;var data=seriesModel.getRawData();var otherDim=seriesModel.getShadowDim?seriesModel.getShadowDim()// @see candlestick\n:info.otherDim;if(otherDim==null){return;}var otherDataExtent=data.getDataExtent(otherDim);// Nice extent.\nvar otherOffset=(otherDataExtent[1]-otherDataExtent[0])*0.3;otherDataExtent=[otherDataExtent[0]-otherOffset,otherDataExtent[1]+otherOffset];var otherShadowExtent=[0,size[1]];var thisShadowExtent=[0,size[0]];var areaPoints=[[size[0],0],[0,0]];var linePoints=[];var step=thisShadowExtent[1]/(data.count()-1);var thisCoord=0;// Optimize for large data shadow\nvar stride=Math.round(data.count()/size[0]);var lastIsEmpty;data.each([otherDim],function(value,index){if(stride>0&&index%stride){thisCoord+=step;return;}// FIXME\n// Should consider axis.min/axis.max when drawing dataShadow.\n// FIXME\n// 应该使用统一的空判断?还是在list里进行空判断?\nvar isEmpty=value==null||isNaN(value)||value==='';// See #4235.\nvar otherCoord=isEmpty?0:linearMap$1(value,otherDataExtent,otherShadowExtent,true);// Attempt to draw data shadow precisely when there are empty value.\nif(isEmpty&&!lastIsEmpty&&index){areaPoints.push([areaPoints[areaPoints.length-1][0],0]);linePoints.push([linePoints[linePoints.length-1][0],0]);}else if(!isEmpty&&lastIsEmpty){areaPoints.push([thisCoord,0]);linePoints.push([thisCoord,0]);}areaPoints.push([thisCoord,otherCoord]);linePoints.push([thisCoord,otherCoord]);thisCoord+=step;lastIsEmpty=isEmpty;});var dataZoomModel=this.dataZoomModel;// var dataBackgroundModel = dataZoomModel.getModel('dataBackground');\nthis._displayables.barGroup.add(new Polygon({shape:{points:areaPoints},style:defaults({fill:dataZoomModel.get('dataBackgroundColor')},dataZoomModel.getModel('dataBackground.areaStyle').getAreaStyle()),silent:true,z2:-20}));this._displayables.barGroup.add(new Polyline({shape:{points:linePoints},style:dataZoomModel.getModel('dataBackground.lineStyle').getLineStyle(),silent:true,z2:-19}));},_prepareDataShadowInfo:function _prepareDataShadowInfo(){var dataZoomModel=this.dataZoomModel;var showDataShadow=dataZoomModel.get('showDataShadow');if(showDataShadow===false){return;}// Find a representative series.\nvar result;var ecModel=this.ecModel;dataZoomModel.eachTargetAxis(function(dimNames,axisIndex){var seriesModels=dataZoomModel.getAxisProxy(dimNames.name,axisIndex).getTargetSeriesModels();each$1(seriesModels,function(seriesModel){if(result){return;}if(showDataShadow!==true&&indexOf(SHOW_DATA_SHADOW_SERIES_TYPE,seriesModel.get('type'))<0){return;}var thisAxis=ecModel.getComponent(dimNames.axis,axisIndex).axis;var otherDim=getOtherDim(dimNames.name);var otherAxisInverse;var coordSys=seriesModel.coordinateSystem;if(otherDim!=null&&coordSys.getOtherAxis){otherAxisInverse=coordSys.getOtherAxis(thisAxis).inverse;}otherDim=seriesModel.getData().mapDimension(otherDim);result={thisAxis:thisAxis,series:seriesModel,thisDim:dimNames.name,otherDim:otherDim,otherAxisInverse:otherAxisInverse};},this);},this);return result;},_renderHandle:function _renderHandle(){var displaybles=this._displayables;var handles=displaybles.handles=[];var handleLabels=displaybles.handleLabels=[];var barGroup=this._displayables.barGroup;var size=this._size;var dataZoomModel=this.dataZoomModel;barGroup.add(displaybles.filler=new Rect$1({draggable:true,cursor:getCursor(this._orient),drift:bind$3(this._onDragMove,this,'all'),ondragstart:bind$3(this._showDataInfo,this,true),ondragend:bind$3(this._onDragEnd,this),onmouseover:bind$3(this._showDataInfo,this,true),onmouseout:bind$3(this._showDataInfo,this,false),style:{fill:dataZoomModel.get('fillerColor'),textPosition:'inside'}}));// Frame border.\nbarGroup.add(new Rect$1({silent:true,subPixelOptimize:true,shape:{x:0,y:0,width:size[0],height:size[1]},style:{stroke:dataZoomModel.get('dataBackgroundColor')||dataZoomModel.get('borderColor'),lineWidth:DEFAULT_FRAME_BORDER_WIDTH,fill:'rgba(0,0,0,0)'}}));each$14([0,1],function(handleIndex){var path=createIcon(dataZoomModel.get('handleIcon'),{cursor:getCursor(this._orient),draggable:true,drift:bind$3(this._onDragMove,this,handleIndex),ondragend:bind$3(this._onDragEnd,this),onmouseover:bind$3(this._showDataInfo,this,true),onmouseout:bind$3(this._showDataInfo,this,false)},{x:-1,y:0,width:2,height:2});var bRect=path.getBoundingRect();this._handleHeight=parsePercent$1(dataZoomModel.get('handleSize'),this._size[1]);this._handleWidth=bRect.width/bRect.height*this._handleHeight;path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());var handleColor=dataZoomModel.get('handleColor');// Compatitable with previous version\nif(handleColor!=null){path.style.fill=handleColor;}barGroup.add(handles[handleIndex]=path);var textStyleModel=dataZoomModel.textStyleModel;this.group.add(handleLabels[handleIndex]=new Text({silent:true,invisible:true,style:{x:0,y:0,text:'',textVerticalAlign:'middle',textAlign:'center',textFill:textStyleModel.getTextColor(),textFont:textStyleModel.getFont()},z2:10}));},this);},/**\n * @private\n */_resetInterval:function _resetInterval(){var range=this._range=this.dataZoomModel.getPercentRange();var viewExtent=this._getViewExtent();this._handleEnds=[linearMap$1(range[0],[0,100],viewExtent,true),linearMap$1(range[1],[0,100],viewExtent,true)];},/**\n * @private\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\n * @param {number} delta\n * @return {boolean} changed\n */_updateInterval:function _updateInterval(handleIndex,delta){var dataZoomModel=this.dataZoomModel;var handleEnds=this._handleEnds;var viewExtend=this._getViewExtent();var minMaxSpan=dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();var percentExtent=[0,100];sliderMove(delta,handleEnds,viewExtend,dataZoomModel.get('zoomLock')?'all':handleIndex,minMaxSpan.minSpan!=null?linearMap$1(minMaxSpan.minSpan,percentExtent,viewExtend,true):null,minMaxSpan.maxSpan!=null?linearMap$1(minMaxSpan.maxSpan,percentExtent,viewExtend,true):null);var lastRange=this._range;var range=this._range=asc$2([linearMap$1(handleEnds[0],viewExtend,percentExtent,true),linearMap$1(handleEnds[1],viewExtend,percentExtent,true)]);return!lastRange||lastRange[0]!==range[0]||lastRange[1]!==range[1];},/**\n * @private\n */_updateView:function _updateView(nonRealtime){var displaybles=this._displayables;var handleEnds=this._handleEnds;var handleInterval=asc$2(handleEnds.slice());var size=this._size;each$14([0,1],function(handleIndex){// Handles\nvar handle=displaybles.handles[handleIndex];var handleHeight=this._handleHeight;handle.attr({scale:[handleHeight/2,handleHeight/2],position:[handleEnds[handleIndex],size[1]/2-handleHeight/2]});},this);// Filler\ndisplaybles.filler.setShape({x:handleInterval[0],y:0,width:handleInterval[1]-handleInterval[0],height:size[1]});this._updateDataInfo(nonRealtime);},/**\n * @private\n */_updateDataInfo:function _updateDataInfo(nonRealtime){var dataZoomModel=this.dataZoomModel;var displaybles=this._displayables;var handleLabels=displaybles.handleLabels;var orient=this._orient;var labelTexts=['',''];// FIXME\n// date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)\nif(dataZoomModel.get('showDetail')){var axisProxy=dataZoomModel.findRepresentativeAxisProxy();if(axisProxy){var axis=axisProxy.getAxisModel().axis;var range=this._range;var dataInterval=nonRealtime// See #4434, data and axis are not processed and reset yet in non-realtime mode.\n?axisProxy.calculateDataWindow({start:range[0],end:range[1]}).valueWindow:axisProxy.getDataValueWindow();labelTexts=[this._formatLabel(dataInterval[0],axis),this._formatLabel(dataInterval[1],axis)];}}var orderedHandleEnds=asc$2(this._handleEnds.slice());setLabel.call(this,0);setLabel.call(this,1);function setLabel(handleIndex){// Label\n// Text should not transform by barGroup.\n// Ignore handlers transform\nvar barTransform=getTransform(displaybles.handles[handleIndex].parent,this.group);var direction=transformDirection(handleIndex===0?'right':'left',barTransform);var offset=this._handleWidth/2+LABEL_GAP;var textPoint=applyTransform$1([orderedHandleEnds[handleIndex]+(handleIndex===0?-offset:offset),this._size[1]/2],barTransform);handleLabels[handleIndex].setStyle({x:textPoint[0],y:textPoint[1],textVerticalAlign:orient===HORIZONTAL?'middle':direction,textAlign:orient===HORIZONTAL?direction:'center',text:labelTexts[handleIndex]});}},/**\n * @private\n */_formatLabel:function _formatLabel(value,axis){var dataZoomModel=this.dataZoomModel;var labelFormatter=dataZoomModel.get('labelFormatter');var labelPrecision=dataZoomModel.get('labelPrecision');if(labelPrecision==null||labelPrecision==='auto'){labelPrecision=axis.getPixelPrecision();}var valueStr=value==null||isNaN(value)?''// FIXME Glue code\n:axis.type==='category'||axis.type==='time'?axis.scale.getLabel(Math.round(value))// param of toFixed should less then 20.\n:value.toFixed(Math.min(labelPrecision,20));return isFunction$1(labelFormatter)?labelFormatter(value,valueStr):isString(labelFormatter)?labelFormatter.replace('{value}',valueStr):valueStr;},/**\n * @private\n * @param {boolean} showOrHide true: show, false: hide\n */_showDataInfo:function _showDataInfo(showOrHide){// Always show when drgging.\nshowOrHide=this._dragging||showOrHide;var handleLabels=this._displayables.handleLabels;handleLabels[0].attr('invisible',!showOrHide);handleLabels[1].attr('invisible',!showOrHide);},_onDragMove:function _onDragMove(handleIndex,dx,dy,event){this._dragging=true;// For mobile device, prevent screen slider on the button.\nstop(event.event);// Transform dx, dy to bar coordination.\nvar barTransform=this._displayables.barGroup.getLocalTransform();var vertex=applyTransform$1([dx,dy],barTransform,true);var changed=this._updateInterval(handleIndex,vertex[0]);var realtime=this.dataZoomModel.get('realtime');this._updateView(!realtime);// Avoid dispatch dataZoom repeatly but range not changed,\n// which cause bad visual effect when progressive enabled.\nchanged&&realtime&&this._dispatchZoomAction();},_onDragEnd:function _onDragEnd(){this._dragging=false;this._showDataInfo(false);// While in realtime mode and stream mode, dispatch action when\n// drag end will cause the whole view rerender, which is unnecessary.\nvar realtime=this.dataZoomModel.get('realtime');!realtime&&this._dispatchZoomAction();},_onClickPanelClick:function _onClickPanelClick(e){var size=this._size;var localPoint=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(localPoint[0]<0||localPoint[0]>size[0]||localPoint[1]<0||localPoint[1]>size[1]){return;}var handleEnds=this._handleEnds;var center=(handleEnds[0]+handleEnds[1])/2;var changed=this._updateInterval('all',localPoint[0]-center);this._updateView();changed&&this._dispatchZoomAction();},/**\n * This action will be throttled.\n * @private\n */_dispatchZoomAction:function _dispatchZoomAction(){var range=this._range;this.api.dispatchAction({type:'dataZoom',from:this.uid,dataZoomId:this.dataZoomModel.id,start:range[0],end:range[1]});},/**\n * @private\n */_findCoordRect:function _findCoordRect(){// Find the grid coresponding to the first axis referred by dataZoom.\nvar rect;each$14(this.getTargetCoordInfo(),function(coordInfoList){if(!rect&&coordInfoList.length){var coordSys=coordInfoList[0].model.coordinateSystem;rect=coordSys.getRect&&coordSys.getRect();}});if(!rect){var width=this.api.getWidth();var height=this.api.getHeight();rect={x:width*0.2,y:height*0.2,width:width*0.6,height:height*0.6};}return rect;}});function getOtherDim(thisDim){// FIXME\n// 这个逻辑和getOtherAxis里一致,但是写在这里是否不好\nvar map$$1={x:'y',y:'x',radius:'angle',angle:'radius'};return map$$1[thisDim];}function getCursor(orient){return orient==='vertical'?'ns-resize':'ew-resize';}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerProcessor({// `dataZoomProcessor` will only be performed in needed series. Consider if\n// there is a line series and a pie series, it is better not to update the\n// line series if only pie series is needed to be updated.\ngetTargetSeries:function getTargetSeries(ecModel){var seriesModelMap=createHashMap();ecModel.eachComponent('dataZoom',function(dataZoomModel){dataZoomModel.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel){var axisProxy=dataZoomModel.getAxisProxy(dimNames.name,axisIndex);each$1(axisProxy.getTargetSeriesModels(),function(seriesModel){seriesModelMap.set(seriesModel.uid,seriesModel);});});});return seriesModelMap;},modifyOutputEnd:true,// Consider appendData, where filter should be performed. Because data process is\n// in block mode currently, it is not need to worry about that the overallProgress\n// execute every frame.\noverallReset:function overallReset(ecModel,api){ecModel.eachComponent('dataZoom',function(dataZoomModel){// We calculate window and reset axis here but not in model\n// init stage and not after action dispatch handler, because\n// reset should be called after seriesData.restoreData.\ndataZoomModel.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel){dataZoomModel.getAxisProxy(dimNames.name,axisIndex).reset(dataZoomModel,api);});// Caution: data zoom filtering is order sensitive when using\n// percent range and no min/max/scale set on axis.\n// For example, we have dataZoom definition:\n// [\n// {xAxisIndex: 0, start: 30, end: 70},\n// {yAxisIndex: 0, start: 20, end: 80}\n// ]\n// In this case, [20, 80] of y-dataZoom should be based on data\n// that have filtered by x-dataZoom using range of [30, 70],\n// but should not be based on full raw data. Thus sliding\n// x-dataZoom will change both ranges of xAxis and yAxis,\n// while sliding y-dataZoom will only change the range of yAxis.\n// So we should filter x-axis after reset x-axis immediately,\n// and then reset y-axis and filter y-axis.\ndataZoomModel.eachTargetAxis(function(dimNames,axisIndex,dataZoomModel){dataZoomModel.getAxisProxy(dimNames.name,axisIndex).filterData(dataZoomModel,api);});});ecModel.eachComponent('dataZoom',function(dataZoomModel){// Fullfill all of the range props so that user\n// is able to get them from chart.getOption().\nvar axisProxy=dataZoomModel.findRepresentativeAxisProxy();var percentRange=axisProxy.getDataPercentWindow();var valueRange=axisProxy.getDataValueWindow();dataZoomModel.setCalculatedRange({start:percentRange[0],end:percentRange[1],startValue:valueRange[0],endValue:valueRange[1]});});}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/registerAction('dataZoom',function(payload,ecModel){var linkedNodesFinder=createLinkedNodesFinder(bind(ecModel.eachComponent,ecModel,'dataZoom'),eachAxisDim$1,function(model,dimNames){return model.get(dimNames.axisIndex);});var effectedModels=[];ecModel.eachComponent({mainType:'dataZoom',query:payload},function(model,index){effectedModels.push.apply(effectedModels,linkedNodesFinder(model).nodes);});each$1(effectedModels,function(dataZoomModel,index){dataZoomModel.setRawRange({start:payload.start,end:payload.end,startValue:payload.startValue,endValue:payload.endValue});});});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/DataZoomModel.extend({type:'dataZoom.inside',/**\n * @protected\n */defaultOption:{disabled:false,// Whether disable this inside zoom.\nzoomLock:false,// Whether disable zoom but only pan.\nzoomOnMouseWheel:true,// Can be: true / false / 'shift' / 'ctrl' / 'alt'.\nmoveOnMouseMove:true,// Can be: true / false / 'shift' / 'ctrl' / 'alt'.\nmoveOnMouseWheel:false,// Can be: true / false / 'shift' / 'ctrl' / 'alt'.\npreventDefaultMouseMove:true}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var ATTR$1='\\0_ec_interaction_mutex';function take(zr,resourceKey,userKey){var store=getStore(zr);store[resourceKey]=userKey;}function release(zr,resourceKey,userKey){var store=getStore(zr);var uKey=store[resourceKey];if(uKey===userKey){store[resourceKey]=null;}}function isTaken(zr,resourceKey){return!!getStore(zr)[resourceKey];}function getStore(zr){return zr[ATTR$1]||(zr[ATTR$1]={});}/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */registerAction({type:'takeGlobalCursor',event:'globalCursorTaken',update:'update'},function(){});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * @alias module:echarts/component/helper/RoamController\n * @constructor\n * @mixin {module:zrender/mixin/Eventful}\n *\n * @param {module:zrender/zrender~ZRender} zr\n */function RoamController(zr){/**\n * @type {Function}\n */this.pointerChecker;/**\n * @type {module:zrender}\n */this._zr=zr;/**\n * @type {Object}\n */this._opt={};// Avoid two roamController bind the same handler\nvar bind$$1=bind;var mousedownHandler=bind$$1(mousedown,this);var mousemoveHandler=bind$$1(mousemove,this);var mouseupHandler=bind$$1(mouseup,this);var mousewheelHandler=bind$$1(mousewheel,this);var pinchHandler=bind$$1(pinch,this);Eventful.call(this);/**\n * @param {Function} pointerChecker\n * input: x, y\n * output: boolean\n */this.setPointerChecker=function(pointerChecker){this.pointerChecker=pointerChecker;};/**\n * Notice: only enable needed types. For example, if 'zoom'\n * is not needed, 'zoom' should not be enabled, otherwise\n * default mousewheel behaviour (scroll page) will be disabled.\n *\n * @param {boolean|string} [controlType=true] Specify the control type,\n * which can be null/undefined or true/false\n * or 'pan/move' or 'zoom'/'scale'\n * @param {Object} [opt]\n * @param {Object} [opt.zoomOnMouseWheel=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.moveOnMouseMove=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.moveOnMouseWheel=false] The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n * @param {Object} [opt.preventDefaultMouseMove=true] When pan.\n */this.enable=function(controlType,opt){// Disable previous first\nthis.disable();this._opt=defaults(_clone(opt)||{},{zoomOnMouseWheel:true,moveOnMouseMove:true,// By default, wheel do not trigger move.\nmoveOnMouseWheel:false,preventDefaultMouseMove:true});if(controlType==null){controlType=true;}if(controlType===true||controlType==='move'||controlType==='pan'){zr.on('mousedown',mousedownHandler);zr.on('mousemove',mousemoveHandler);zr.on('mouseup',mouseupHandler);}if(controlType===true||controlType==='scale'||controlType==='zoom'){zr.on('mousewheel',mousewheelHandler);zr.on('pinch',pinchHandler);}};this.disable=function(){zr.off('mousedown',mousedownHandler);zr.off('mousemove',mousemoveHandler);zr.off('mouseup',mouseupHandler);zr.off('mousewheel',mousewheelHandler);zr.off('pinch',pinchHandler);};this.dispose=this.disable;this.isDragging=function(){return this._dragging;};this.isPinching=function(){return this._pinching;};}mixin(RoamController,Eventful);function mousedown(e){if(isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable){return;}var x=e.offsetX;var y=e.offsetY;// Only check on mosedown, but not mousemove.\n// Mouse can be out of target when mouse moving.\nif(this.pointerChecker&&this.pointerChecker(e,x,y)){this._x=x;this._y=y;this._dragging=true;}}function mousemove(e){if(!this._dragging||!isAvailableBehavior('moveOnMouseMove',e,this._opt)||e.gestureEvent==='pinch'||isTaken(this._zr,'globalPan')){return;}var x=e.offsetX;var y=e.offsetY;var oldX=this._x;var oldY=this._y;var dx=x-oldX;var dy=y-oldY;this._x=x;this._y=y;this._opt.preventDefaultMouseMove&&stop(e.event);trigger(this,'pan','moveOnMouseMove',e,{dx:dx,dy:dy,oldX:oldX,oldY:oldY,newX:x,newY:y});}function mouseup(e){if(!isMiddleOrRightButtonOnMouseUpDown(e)){this._dragging=false;}}function mousewheel(e){var shouldZoom=isAvailableBehavior('zoomOnMouseWheel',e,this._opt);var shouldMove=isAvailableBehavior('moveOnMouseWheel',e,this._opt);var wheelDelta=e.wheelDelta;var absWheelDeltaDelta=Math.abs(wheelDelta);var originX=e.offsetX;var originY=e.offsetY;// wheelDelta maybe -0 in chrome mac.\nif(wheelDelta===0||!shouldZoom&&!shouldMove){return;}// If both `shouldZoom` and `shouldMove` is true, trigger\n// their event both, and the final behavior is determined\n// by event listener themselves.\nif(shouldZoom){// Convenience:\n// Mac and VM Windows on Mac: scroll up: zoom out.\n// Windows: scroll up: zoom in.\n// FIXME: Should do more test in different environment.\n// wheelDelta is too complicated in difference nvironment\n// (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n// although it has been normallized by zrender.\n// wheelDelta of mouse wheel is bigger than touch pad.\nvar factor=absWheelDeltaDelta>3?1.4:absWheelDeltaDelta>1?1.2:1.1;var scale=wheelDelta>0?factor:1/factor;checkPointerAndTrigger(this,'zoom','zoomOnMouseWheel',e,{scale:scale,originX:originX,originY:originY});}if(shouldMove){// FIXME: Should do more test in different environment.\nvar absDelta=Math.abs(wheelDelta);// wheelDelta of mouse wheel is bigger than touch pad.\nvar scrollDelta=(wheelDelta>0?1:-1)*(absDelta>3?0.4:absDelta>1?0.15:0.05);checkPointerAndTrigger(this,'scrollMove','moveOnMouseWheel',e,{scrollDelta:scrollDelta,originX:originX,originY:originY});}}function pinch(e){if(isTaken(this._zr,'globalPan')){return;}var scale=e.pinchScale>1?1.1:1/1.1;checkPointerAndTrigger(this,'zoom',null,e,{scale:scale,originX:e.pinchX,originY:e.pinchY});}function checkPointerAndTrigger(controller,eventName,behaviorToCheck,e,contollerEvent){if(controller.pointerChecker&&controller.pointerChecker(e,contollerEvent.originX,contollerEvent.originY)){// When mouse is out of roamController rect,\n// default befavoius should not be be disabled, otherwise\n// page sliding is disabled, contrary to expectation.\nstop(e.event);trigger(controller,eventName,behaviorToCheck,e,contollerEvent);}}function trigger(controller,eventName,behaviorToCheck,e,contollerEvent){// Also provide behavior checker for event listener, for some case that\n// multiple components share one listener.\ncontollerEvent.isAvailableBehavior=bind(isAvailableBehavior,null,behaviorToCheck,e);controller.trigger(eventName,contollerEvent);}// settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\nfunction isAvailableBehavior(behaviorToCheck,e,settings){var setting=settings[behaviorToCheck];return!behaviorToCheck||setting&&(!isString(setting)||e.event[setting+'Key']);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nvar ATTR='\\0_ec_dataZoom_roams';/**\n * @public\n * @param {module:echarts/ExtensionAPI} api\n * @param {Object} dataZoomInfo\n * @param {string} dataZoomInfo.coordId\n * @param {Function} dataZoomInfo.containsPoint\n * @param {Array.} dataZoomInfo.allCoordIds\n * @param {string} dataZoomInfo.dataZoomId\n * @param {Object} dataZoomInfo.getRange\n * @param {Function} dataZoomInfo.getRange.pan\n * @param {Function} dataZoomInfo.getRange.zoom\n * @param {Function} dataZoomInfo.getRange.scrollMove\n * @param {boolean} dataZoomInfo.dataZoomModel\n */function register$1(api,dataZoomInfo){var store=giveStore(api);var theDataZoomId=dataZoomInfo.dataZoomId;var theCoordId=dataZoomInfo.coordId;// Do clean when a dataZoom changes its target coordnate system.\n// Avoid memory leak, dispose all not-used-registered.\neach$1(store,function(record,coordId){var dataZoomInfos=record.dataZoomInfos;if(dataZoomInfos[theDataZoomId]&&indexOf(dataZoomInfo.allCoordIds,theCoordId)<0){delete dataZoomInfos[theDataZoomId];record.count--;}});cleanStore(store);var record=store[theCoordId];// Create if needed.\nif(!record){record=store[theCoordId]={coordId:theCoordId,dataZoomInfos:{},count:0};record.controller=createController(api,record);record.dispatchAction=curry(dispatchAction,api);}// Update reference of dataZoom.\n!record.dataZoomInfos[theDataZoomId]&&record.count++;record.dataZoomInfos[theDataZoomId]=dataZoomInfo;var controllerParams=mergeControllerParams(record.dataZoomInfos);record.controller.enable(controllerParams.controlType,controllerParams.opt);// Consider resize, area should be always updated.\nrecord.controller.setPointerChecker(dataZoomInfo.containsPoint);// Update throttle.\ncreateOrUpdate(record,'dispatchAction',dataZoomInfo.dataZoomModel.get('throttle',true),'fixRate');}/**\n * @public\n * @param {module:echarts/ExtensionAPI} api\n * @param {string} dataZoomId\n */function unregister$1(api,dataZoomId){var store=giveStore(api);each$1(store,function(record){record.controller.dispose();var dataZoomInfos=record.dataZoomInfos;if(dataZoomInfos[dataZoomId]){delete dataZoomInfos[dataZoomId];record.count--;}});cleanStore(store);}/**\n * @public\n */function generateCoordId(coordModel){return coordModel.type+'\\0_'+coordModel.id;}/**\n * Key: coordId, value: {dataZoomInfos: [], count, controller}\n * @type {Array.}\n */function giveStore(api){// Mount store on zrender instance, so that we do not\n// need to worry about dispose.\nvar zr=api.getZr();return zr[ATTR]||(zr[ATTR]={});}function createController(api,newRecord){var controller=new RoamController(api.getZr());each$1(['pan','zoom','scrollMove'],function(eventName){controller.on(eventName,function(event){var batch=[];each$1(newRecord.dataZoomInfos,function(info){// Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n// moveOnMouseWheel, ...) enabled.\nif(!event.isAvailableBehavior(info.dataZoomModel.option)){return;}var method=(info.getRange||{})[eventName];var range=method&&method(newRecord.controller,event);!info.dataZoomModel.get('disabled',true)&&range&&batch.push({dataZoomId:info.dataZoomId,start:range[0],end:range[1]});});batch.length&&newRecord.dispatchAction(batch);});});return controller;}function cleanStore(store){each$1(store,function(record,coordId){if(!record.count){record.controller.dispose();delete store[coordId];}});}/**\n * This action will be throttled.\n */function dispatchAction(api,batch){api.dispatchAction({type:'dataZoom',batch:batch});}/**\n * Merge roamController settings when multiple dataZooms share one roamController.\n */function mergeControllerParams(dataZoomInfos){var controlType;// DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n// as string, it is probably revert to reserved word by compress tool. See #7411.\nvar prefix='type_';var typePriority={'type_true':2,'type_move':1,'type_false':0,'type_undefined':-1};var preventDefaultMouseMove=true;each$1(dataZoomInfos,function(dataZoomInfo){var dataZoomModel=dataZoomInfo.dataZoomModel;var oneType=dataZoomModel.get('disabled',true)?false:dataZoomModel.get('zoomLock',true)?'move':true;if(typePriority[prefix+oneType]>typePriority[prefix+controlType]){controlType=oneType;}// Prevent default move event by default. If one false, do not prevent. Otherwise\n// users may be confused why it does not work when multiple insideZooms exist.\npreventDefaultMouseMove&=dataZoomModel.get('preventDefaultMouseMove',true);});return{controlType:controlType,opt:{// RoamController will enable all of these functionalities,\n// and the final behavior is determined by its event listener\n// provided by each inside zoom.\nzoomOnMouseWheel:true,moveOnMouseMove:true,moveOnMouseWheel:true,preventDefaultMouseMove:!!preventDefaultMouseMove}};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var bind$4=bind;var InsideZoomView=DataZoomView.extend({type:'dataZoom.inside',/**\n * @override\n */init:function init(ecModel,api){/**\n * 'throttle' is used in this.dispatchAction, so we save range\n * to avoid missing some 'pan' info.\n * @private\n * @type {Array.}\n */this._range;},/**\n * @override\n */render:function render(dataZoomModel,ecModel,api,payload){InsideZoomView.superApply(this,'render',arguments);// Hence the `throttle` util ensures to preserve command order,\n// here simply updating range all the time will not cause missing\n// any of the the roam change.\nthis._range=dataZoomModel.getPercentRange();// Reset controllers.\neach$1(this.getTargetCoordInfo(),function(coordInfoList,coordSysName){var allCoordIds=map(coordInfoList,function(coordInfo){return generateCoordId(coordInfo.model);});each$1(coordInfoList,function(coordInfo){var coordModel=coordInfo.model;var getRange={};each$1(['pan','zoom','scrollMove'],function(eventName){getRange[eventName]=bind$4(roamHandlers[eventName],this,coordInfo,coordSysName);},this);register$1(api,{coordId:generateCoordId(coordModel),allCoordIds:allCoordIds,containsPoint:function containsPoint(e,x,y){return coordModel.coordinateSystem.containPoint([x,y]);},dataZoomId:dataZoomModel.id,dataZoomModel:dataZoomModel,getRange:getRange});},this);},this);},/**\n * @override\n */dispose:function dispose(){unregister$1(this.api,this.dataZoomModel.id);InsideZoomView.superApply(this,'dispose',arguments);this._range=null;}});var roamHandlers={/**\n * @this {module:echarts/component/dataZoom/InsideZoomView}\n */zoom:function zoom(coordInfo,coordSysName,controller,e){var lastRange=this._range;var range=lastRange.slice();// Calculate transform by the first axis.\nvar axisModel=coordInfo.axisModels[0];if(!axisModel){return;}var directionInfo=getDirectionInfo[coordSysName](null,[e.originX,e.originY],axisModel,controller,coordInfo);var percentPoint=(directionInfo.signal>0?directionInfo.pixelStart+directionInfo.pixelLength-directionInfo.pixel:directionInfo.pixel-directionInfo.pixelStart)/directionInfo.pixelLength*(range[1]-range[0])+range[0];var scale=Math.max(1/e.scale,0);range[0]=(range[0]-percentPoint)*scale+percentPoint;range[1]=(range[1]-percentPoint)*scale+percentPoint;// Restrict range.\nvar minMaxSpan=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();sliderMove(0,range,[0,100],0,minMaxSpan.minSpan,minMaxSpan.maxSpan);this._range=range;if(lastRange[0]!==range[0]||lastRange[1]!==range[1]){return range;}},/**\n * @this {module:echarts/component/dataZoom/InsideZoomView}\n */pan:makeMover(function(range,axisModel,coordInfo,coordSysName,controller,e){var directionInfo=getDirectionInfo[coordSysName]([e.oldX,e.oldY],[e.newX,e.newY],axisModel,controller,coordInfo);return directionInfo.signal*(range[1]-range[0])*directionInfo.pixel/directionInfo.pixelLength;}),/**\n * @this {module:echarts/component/dataZoom/InsideZoomView}\n */scrollMove:makeMover(function(range,axisModel,coordInfo,coordSysName,controller,e){var directionInfo=getDirectionInfo[coordSysName]([0,0],[e.scrollDelta,e.scrollDelta],axisModel,controller,coordInfo);return directionInfo.signal*(range[1]-range[0])*e.scrollDelta;})};function makeMover(getPercentDelta){return function(coordInfo,coordSysName,controller,e){var lastRange=this._range;var range=lastRange.slice();// Calculate transform by the first axis.\nvar axisModel=coordInfo.axisModels[0];if(!axisModel){return;}var percentDelta=getPercentDelta(range,axisModel,coordInfo,coordSysName,controller,e);sliderMove(percentDelta,range,[0,100],'all');this._range=range;if(lastRange[0]!==range[0]||lastRange[1]!==range[1]){return range;}};}var getDirectionInfo={grid:function grid(oldPoint,newPoint,axisModel,controller,coordInfo){var axis=axisModel.axis;var ret={};var rect=coordInfo.model.coordinateSystem.getRect();oldPoint=oldPoint||[0,0];if(axis.dim==='x'){ret.pixel=newPoint[0]-oldPoint[0];ret.pixelLength=rect.width;ret.pixelStart=rect.x;ret.signal=axis.inverse?1:-1;}else{// axis.dim === 'y'\nret.pixel=newPoint[1]-oldPoint[1];ret.pixelLength=rect.height;ret.pixelStart=rect.y;ret.signal=axis.inverse?-1:1;}return ret;},polar:function polar(oldPoint,newPoint,axisModel,controller,coordInfo){var axis=axisModel.axis;var ret={};var polar=coordInfo.model.coordinateSystem;var radiusExtent=polar.getRadiusAxis().getExtent();var angleExtent=polar.getAngleAxis().getExtent();oldPoint=oldPoint?polar.pointToCoord(oldPoint):[0,0];newPoint=polar.pointToCoord(newPoint);if(axisModel.mainType==='radiusAxis'){ret.pixel=newPoint[0]-oldPoint[0];// ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n// ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\nret.pixelLength=radiusExtent[1]-radiusExtent[0];ret.pixelStart=radiusExtent[0];ret.signal=axis.inverse?1:-1;}else{// 'angleAxis'\nret.pixel=newPoint[1]-oldPoint[1];// ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n// ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\nret.pixelLength=angleExtent[1]-angleExtent[0];ret.pixelStart=angleExtent[0];ret.signal=axis.inverse?-1:1;}return ret;},singleAxis:function singleAxis(oldPoint,newPoint,axisModel,controller,coordInfo){var axis=axisModel.axis;var rect=coordInfo.model.coordinateSystem.getRect();var ret={};oldPoint=oldPoint||[0,0];if(axis.orient==='horizontal'){ret.pixel=newPoint[0]-oldPoint[0];ret.pixelLength=rect.width;ret.pixelStart=rect.x;ret.signal=axis.inverse?1:-1;}else{// 'vertical'\nret.pixel=newPoint[1]-oldPoint[1];ret.pixelLength=rect.height;ret.pixelStart=rect.y;ret.signal=axis.inverse?-1:1;}return ret;}};/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Do not include './dataZoomSelect',\n// since it only work for toolbox dataZoom.\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var features={};function register$2(name,ctor){features[name]=ctor;}function get$1(name){return features[name];}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var ToolboxModel=extendComponentModel({type:'toolbox',layoutMode:{type:'box',ignoreSize:true},optionUpdated:function optionUpdated(){ToolboxModel.superApply(this,'optionUpdated',arguments);each$1(this.option.feature,function(featureOpt,featureName){var Feature=get$1(featureName);Feature&&merge(featureOpt,Feature.defaultOption);});},defaultOption:{show:true,z:6,zlevel:0,orient:'horizontal',left:'right',top:'top',// right\n// bottom\nbackgroundColor:'transparent',borderColor:'#ccc',borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:true,iconStyle:{borderColor:'#666',color:'none'},emphasis:{iconStyle:{borderColor:'#3E98C5'}},// textStyle: {},\n// feature\ntooltip:{show:false}}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/extendComponentView({type:'toolbox',render:function render(toolboxModel,ecModel,api,payload){var group=this.group;group.removeAll();if(!toolboxModel.get('show')){return;}var itemSize=+toolboxModel.get('itemSize');var featureOpts=toolboxModel.get('feature')||{};var features=this._features||(this._features={});var featureNames=[];each$1(featureOpts,function(opt,name){featureNames.push(name);});new DataDiffer(this._featureNames||[],featureNames).add(processFeature).update(processFeature).remove(curry(processFeature,null)).execute();// Keep for diff.\nthis._featureNames=featureNames;function processFeature(newIndex,oldIndex){var featureName=featureNames[newIndex];var oldName=featureNames[oldIndex];var featureOpt=featureOpts[featureName];var featureModel=new Model(featureOpt,toolboxModel,toolboxModel.ecModel);var feature;// FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\nif(payload&&payload.newTitle!=null&&payload.featureName===featureName){featureOpt.title=payload.newTitle;}if(featureName&&!oldName){// Create\nif(isUserFeatureName(featureName)){feature={model:featureModel,onclick:featureModel.option.onclick,featureName:featureName};}else{var Feature=get$1(featureName);if(!Feature){return;}feature=new Feature(featureModel,ecModel,api);}features[featureName]=feature;}else{feature=features[oldName];// If feature does not exsit.\nif(!feature){return;}feature.model=featureModel;feature.ecModel=ecModel;feature.api=api;}if(!featureName&&oldName){feature.dispose&&feature.dispose(ecModel,api);return;}if(!featureModel.get('show')||feature.unusable){feature.remove&&feature.remove(ecModel,api);return;}createIconPaths(featureModel,feature,featureName);featureModel.setIconStatus=function(iconName,status){var option=this.option;var iconPaths=this.iconPaths;option.iconStatus=option.iconStatus||{};option.iconStatus[iconName]=status;// FIXME\niconPaths[iconName]&&iconPaths[iconName].trigger(status);};if(feature.render){feature.render(featureModel,ecModel,api,payload);}}function createIconPaths(featureModel,feature,featureName){var iconStyleModel=featureModel.getModel('iconStyle');var iconStyleEmphasisModel=featureModel.getModel('emphasis.iconStyle');// If one feature has mutiple icon. they are orginaized as\n// {\n// icon: {\n// foo: '',\n// bar: ''\n// },\n// title: {\n// foo: '',\n// bar: ''\n// }\n// }\nvar icons=feature.getIcons?feature.getIcons():featureModel.get('icon');var titles=featureModel.get('title')||{};if(typeof icons==='string'){var icon=icons;var title=titles;icons={};titles={};icons[featureName]=icon;titles[featureName]=title;}var iconPaths=featureModel.iconPaths={};each$1(icons,function(iconStr,iconName){var path=createIcon(iconStr,{},{x:-itemSize/2,y:-itemSize/2,width:itemSize,height:itemSize});path.setStyle(iconStyleModel.getItemStyle());path.hoverStyle=iconStyleEmphasisModel.getItemStyle();// Text position calculation\npath.setStyle({text:titles[iconName],textAlign:iconStyleEmphasisModel.get('textAlign'),textBorderRadius:iconStyleEmphasisModel.get('textBorderRadius'),textPadding:iconStyleEmphasisModel.get('textPadding'),textFill:null});var tooltipModel=toolboxModel.getModel('tooltip');if(tooltipModel&&tooltipModel.get('show')){path.attr('tooltip',extend({content:titles[iconName],formatter:tooltipModel.get('formatter',true)||function(){return titles[iconName];},formatterParams:{componentType:'toolbox',name:iconName,title:titles[iconName],$vars:['name','title']},position:tooltipModel.get('position',true)||'bottom'},tooltipModel.option));}setHoverStyle(path);if(toolboxModel.get('showTitle')){path.__title=titles[iconName];path.on('mouseover',function(){// Should not reuse above hoverStyle, which might be modified.\nvar hoverStyle=iconStyleEmphasisModel.getItemStyle();var defaultTextPosition=toolboxModel.get('orient')==='vertical'?toolboxModel.get('right')==null?'right':'left':toolboxModel.get('bottom')==null?'bottom':'top';path.setStyle({textFill:iconStyleEmphasisModel.get('textFill')||hoverStyle.fill||hoverStyle.stroke||'#000',textBackgroundColor:iconStyleEmphasisModel.get('textBackgroundColor'),textPosition:iconStyleEmphasisModel.get('textPosition')||defaultTextPosition});}).on('mouseout',function(){path.setStyle({textFill:null,textBackgroundColor:null});});}path.trigger(featureModel.get('iconStatus.'+iconName)||'normal');group.add(path);path.on('click',bind(feature.onclick,feature,ecModel,api,iconName));iconPaths[iconName]=path;});}layout$2(group,toolboxModel,api);// Render background after group is layout\n// FIXME\ngroup.add(makeBackground(group.getBoundingRect(),toolboxModel));// Adjust icon title positions to avoid them out of screen\ngroup.eachChild(function(icon){var titleText=icon.__title;var hoverStyle=icon.hoverStyle;// May be background element\nif(hoverStyle&&titleText){var rect=_getBoundingRect(titleText,makeFont(hoverStyle));var offsetX=icon.position[0]+group.position[0];var offsetY=icon.position[1]+group.position[1]+itemSize;var needPutOnTop=false;if(offsetY+rect.height>api.getHeight()){hoverStyle.textPosition='top';needPutOnTop=true;}var topOffset=needPutOnTop?-5-rect.height:itemSize+8;if(offsetX+rect.width/2>api.getWidth()){hoverStyle.textPosition=['100%',topOffset];hoverStyle.textAlign='right';}else if(offsetX-rect.width/2<0){hoverStyle.textPosition=[0,topOffset];hoverStyle.textAlign='left';}}});},updateView:function updateView(toolboxModel,ecModel,api,payload){each$1(this._features,function(feature){feature.updateView&&feature.updateView(feature.model,ecModel,api,payload);});},// updateLayout: function (toolboxModel, ecModel, api, payload) {\n// zrUtil.each(this._features, function (feature) {\n// feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n// });\n// },\nremove:function remove(ecModel,api){each$1(this._features,function(feature){feature.remove&&feature.remove(ecModel,api);});this.group.removeAll();},dispose:function dispose(ecModel,api){each$1(this._features,function(feature){feature.dispose&&feature.dispose(ecModel,api);});}});function isUserFeatureName(featureName){return featureName.indexOf('my')===0;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /* global Uint8Array */var saveAsImageLang=lang.toolbox.saveAsImage;function SaveAsImage(model){this.model=model;}SaveAsImage.defaultOption={show:true,icon:'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',title:saveAsImageLang.title,type:'png',// Default use option.backgroundColor\n// backgroundColor: '#fff',\nconnectedBackgroundColor:'#fff',name:'',excludeComponents:['toolbox'],pixelRatio:1,lang:saveAsImageLang.lang.slice()};SaveAsImage.prototype.unusable=!env$1.canvasSupported;var proto$2=SaveAsImage.prototype;proto$2.onclick=function(ecModel,api){var model=this.model;var title=model.get('name')||ecModel.get('title.0.text')||'echarts';var isSvg=api.getZr().painter.getType()==='svg';var type=isSvg?'svg':model.get('type',true)||'png';var url=api.getConnectedDataURL({type:type,backgroundColor:model.get('backgroundColor',true)||ecModel.get('backgroundColor')||'#fff',connectedBackgroundColor:model.get('connectedBackgroundColor'),excludeComponents:model.get('excludeComponents'),pixelRatio:model.get('pixelRatio')});// Chrome and Firefox\nif(typeof MouseEvent==='function'&&!env$1.browser.ie&&!env$1.browser.edge){var $a=document.createElement('a');$a.download=title+'.'+type;$a.target='_blank';$a.href=url;var evt=new MouseEvent('click',{// some micro front-end framework, window maybe is a Proxy\nview:document.defaultView,bubbles:true,cancelable:false});$a.dispatchEvent(evt);}// IE\nelse{if(window.navigator.msSaveOrOpenBlob){var bstr=atob(url.split(',')[1]);var n=bstr.length;var u8arr=new Uint8Array(n);while(n--){u8arr[n]=bstr.charCodeAt(n);}var blob=new Blob([u8arr]);window.navigator.msSaveOrOpenBlob(blob,title+'.'+type);}else{var lang$$1=model.get('lang');var html=''+''+''+'';var tab=window.open();tab.document.write(html);}}};register$2('saveAsImage',SaveAsImage);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var magicTypeLang=lang.toolbox.magicType;var INNER_STACK_KEYWORD='__ec_magicType_stack__';function MagicType(model){this.model=model;}MagicType.defaultOption={show:true,type:[],// Icon group\nicon:{/* eslint-disable */line:'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',bar:'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',stack:'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'// jshint ignore:line\n/* eslint-enable */},// `line`, `bar`, `stack`, `tiled`\ntitle:_clone(magicTypeLang.title),option:{},seriesIndex:{}};var proto$3=MagicType.prototype;proto$3.getIcons=function(){var model=this.model;var availableIcons=model.get('icon');var icons={};each$1(model.get('type'),function(type){if(availableIcons[type]){icons[type]=availableIcons[type];}});return icons;};var seriesOptGenreator={'line':function line(seriesType,seriesId,seriesModel,model){if(seriesType==='bar'){return merge({id:seriesId,type:'line',// Preserve data related option\ndata:seriesModel.get('data'),stack:seriesModel.get('stack'),markPoint:seriesModel.get('markPoint'),markLine:seriesModel.get('markLine')},model.get('option.line')||{},true);}},'bar':function bar(seriesType,seriesId,seriesModel,model){if(seriesType==='line'){return merge({id:seriesId,type:'bar',// Preserve data related option\ndata:seriesModel.get('data'),stack:seriesModel.get('stack'),markPoint:seriesModel.get('markPoint'),markLine:seriesModel.get('markLine')},model.get('option.bar')||{},true);}},'stack':function stack(seriesType,seriesId,seriesModel,model){var isStack=seriesModel.get('stack')===INNER_STACK_KEYWORD;if(seriesType==='line'||seriesType==='bar'){model.setIconStatus('stack',isStack?'normal':'emphasis');return merge({id:seriesId,stack:isStack?'':INNER_STACK_KEYWORD},model.get('option.stack')||{},true);}}};var radioTypes=[['line','bar'],['stack']];proto$3.onclick=function(ecModel,api,type){var model=this.model;var seriesIndex=model.get('seriesIndex.'+type);// Not supported magicType\nif(!seriesOptGenreator[type]){return;}var newOption={series:[]};var generateNewSeriesTypes=function generateNewSeriesTypes(seriesModel){var seriesType=seriesModel.subType;var seriesId=seriesModel.id;var newSeriesOpt=seriesOptGenreator[type](seriesType,seriesId,seriesModel,model);if(newSeriesOpt){// PENDING If merge original option?\ndefaults(newSeriesOpt,seriesModel.option);newOption.series.push(newSeriesOpt);}// Modify boundaryGap\nvar coordSys=seriesModel.coordinateSystem;if(coordSys&&coordSys.type==='cartesian2d'&&(type==='line'||type==='bar')){var categoryAxis=coordSys.getAxesByScale('ordinal')[0];if(categoryAxis){var axisDim=categoryAxis.dim;var axisType=axisDim+'Axis';var axisModel=ecModel.queryComponents({mainType:axisType,index:seriesModel.get(name+'Index'),id:seriesModel.get(name+'Id')})[0];var axisIndex=axisModel.componentIndex;newOption[axisType]=newOption[axisType]||[];for(var i=0;i<=axisIndex;i++){newOption[axisType][axisIndex]=newOption[axisType][axisIndex]||{};}newOption[axisType][axisIndex].boundaryGap=type==='bar';}}};each$1(radioTypes,function(radio){if(indexOf(radio,type)>=0){each$1(radio,function(item){model.setIconStatus(item,'normal');});}});model.setIconStatus(type,'emphasis');ecModel.eachComponent({mainType:'series',query:seriesIndex==null?null:{seriesIndex:seriesIndex}},generateNewSeriesTypes);var newTitle;// Change title of stack\nif(type==='stack'){var isStack=newOption.series&&newOption.series[0]&&newOption.series[0].stack===INNER_STACK_KEYWORD;newTitle=isStack?merge({stack:magicTypeLang.title.tiled},magicTypeLang.title):_clone(magicTypeLang.title);}api.dispatchAction({type:'changeMagicType',currentType:type,newOption:newOption,newTitle:newTitle,featureName:'magicType'});};registerAction({type:'changeMagicType',event:'magicTypeChanged',update:'prepareAndUpdate'},function(payload,ecModel){ecModel.mergeOption(payload.newOption);});register$2('magicType',MagicType);/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var dataViewLang=lang.toolbox.dataView;var BLOCK_SPLITER=new Array(60).join('-');var ITEM_SPLITER='\\t';/**\n * Group series into two types\n * 1. on category axis, like line, bar\n * 2. others, like scatter, pie\n * @param {module:echarts/model/Global} ecModel\n * @return {Object}\n * @inner\n */function groupSeries(ecModel){var seriesGroupByCategoryAxis={};var otherSeries=[];var meta=[];ecModel.eachRawSeries(function(seriesModel){var coordSys=seriesModel.coordinateSystem;if(coordSys&&(coordSys.type==='cartesian2d'||coordSys.type==='polar')){var baseAxis=coordSys.getBaseAxis();if(baseAxis.type==='category'){var key=baseAxis.dim+'_'+baseAxis.index;if(!seriesGroupByCategoryAxis[key]){seriesGroupByCategoryAxis[key]={categoryAxis:baseAxis,valueAxis:coordSys.getOtherAxis(baseAxis),series:[]};meta.push({axisDim:baseAxis.dim,axisIndex:baseAxis.index});}seriesGroupByCategoryAxis[key].series.push(seriesModel);}else{otherSeries.push(seriesModel);}}else{otherSeries.push(seriesModel);}});return{seriesGroupByCategoryAxis:seriesGroupByCategoryAxis,other:otherSeries,meta:meta};}/**\n * Assemble content of series on cateogory axis\n * @param {Array.} series\n * @return {string}\n * @inner\n */function assembleSeriesWithCategoryAxis(series){var tables=[];each$1(series,function(group,key){var categoryAxis=group.categoryAxis;var valueAxis=group.valueAxis;var valueAxisDim=valueAxis.dim;var headers=[' '].concat(map(group.series,function(series){return series.name;}));var columns=[categoryAxis.model.getCategories()];each$1(group.series,function(series){var rawData=series.getRawData();columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim),function(val){return val;}));});// Assemble table content\nvar lines=[headers.join(ITEM_SPLITER)];for(var i=0;i} series\n * @return {string}\n * @inner\n */function assembleOtherSeries(series){return map(series,function(series){var data=series.getRawData();var lines=[series.name];var vals=[];data.each(data.dimensions,function(){var argLen=arguments.length;var dataIndex=arguments[argLen-1];var name=data.getName(dataIndex);for(var i=0;i=0){return true;}}var itemSplitRegex=new RegExp('['+ITEM_SPLITER+']+','g');/**\n * @param {string} tsv\n * @return {Object}\n */function parseTSVContents(tsv){var tsvLines=tsv.split(/\\n+/g);var headers=trim$1(tsvLines.shift()).split(itemSplitRegex);var categories=[];var series=map(headers,function(header){return{name:header,data:[]};});for(var i=0;i}\n * @inner\n */function parseListContents(str){var lines=str.split(/\\n+/g);var seriesName=trim$1(lines.shift());var data=[];for(var i=0;i} blockMetaList\n * @return {Object}\n * @inner\n */function parseContents(str,blockMetaList){var blocks=str.split(new RegExp('\\n*'+BLOCK_SPLITER+'\\n*','g'));var newOption={series:[]};each$1(blocks,function(block,idx){if(isTSVFormat(block)){var result=parseTSVContents(block);var blockMeta=blockMetaList[idx];var axisKey=blockMeta.axisDim+'Axis';if(blockMeta){newOption[axisKey]=newOption[axisKey]||[];newOption[axisKey][blockMeta.axisIndex]={data:result.categories};newOption.series=newOption.series.concat(result.series);}}else{var result=parseListContents(block);newOption.series.push(result);}});return newOption;}/**\n * @alias {module:echarts/component/toolbox/feature/DataView}\n * @constructor\n * @param {module:echarts/model/Model} model\n */function DataView(model){this._dom=null;this.model=model;}DataView.defaultOption={show:true,readOnly:false,optionToContent:null,contentToOption:null,icon:'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',title:_clone(dataViewLang.title),lang:_clone(dataViewLang.lang),backgroundColor:'#fff',textColor:'#000',textareaColor:'#fff',textareaBorderColor:'#333',buttonColor:'#c23531',buttonTextColor:'#fff'};DataView.prototype.onclick=function(ecModel,api){var container=api.getDom();var model=this.model;if(this._dom){container.removeChild(this._dom);}var root=document.createElement('div');root.style.cssText='position:absolute;left:5px;top:5px;bottom:5px;right:5px;';root.style.backgroundColor=model.get('backgroundColor')||'#fff';// Create elements\nvar header=document.createElement('h4');var lang$$1=model.get('lang')||[];header.innerHTML=lang$$1[0]||model.get('title');header.style.cssText='margin: 10px 20px;';header.style.color=model.get('textColor');var viewMain=document.createElement('div');var textarea=document.createElement('textarea');viewMain.style.cssText='display:block;width:100%;overflow:auto;';var optionToContent=model.get('optionToContent');var contentToOption=model.get('contentToOption');var result=getContentFromModel(ecModel);if(typeof optionToContent==='function'){var htmlOrDom=optionToContent(api.getOption());if(typeof htmlOrDom==='string'){viewMain.innerHTML=htmlOrDom;}else if(isDom(htmlOrDom)){viewMain.appendChild(htmlOrDom);}}else{// Use default textarea\nviewMain.appendChild(textarea);textarea.readOnly=model.get('readOnly');textarea.style.cssText='width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';textarea.style.color=model.get('textColor');textarea.style.borderColor=model.get('textareaBorderColor');textarea.style.backgroundColor=model.get('textareaColor');textarea.value=result.value;}var blockMetaList=result.meta;var buttonContainer=document.createElement('div');buttonContainer.style.cssText='position:absolute;bottom:0;left:0;right:0;';var buttonStyle='float:right;margin-right:20px;border:none;'+'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';var closeButton=document.createElement('div');var refreshButton=document.createElement('div');buttonStyle+=';background-color:'+model.get('buttonColor');buttonStyle+=';color:'+model.get('buttonTextColor');var self=this;function close(){container.removeChild(root);self._dom=null;}addEventListener(closeButton,'click',close);addEventListener(refreshButton,'click',function(){var newOption;try{if(typeof contentToOption==='function'){newOption=contentToOption(viewMain,api.getOption());}else{newOption=parseContents(textarea.value,blockMetaList);}}catch(e){close();throw new Error('Data view format error '+e);}if(newOption){api.dispatchAction({type:'changeDataView',newOption:newOption});}close();});closeButton.innerHTML=lang$$1[1];refreshButton.innerHTML=lang$$1[2];refreshButton.style.cssText=buttonStyle;closeButton.style.cssText=buttonStyle;!model.get('readOnly')&&buttonContainer.appendChild(refreshButton);buttonContainer.appendChild(closeButton);root.appendChild(header);root.appendChild(viewMain);root.appendChild(buttonContainer);viewMain.style.height=container.clientHeight-80+'px';container.appendChild(root);this._dom=root;};DataView.prototype.remove=function(ecModel,api){this._dom&&api.getDom().removeChild(this._dom);};DataView.prototype.dispose=function(ecModel,api){this.remove(ecModel,api);};/**\n * @inner\n */function tryMergeDataOption(newData,originalData){return map(newData,function(newVal,idx){var original=originalData&&originalData[idx];if(isObject$1(original)&&!isArray(original)){var newValIsObject=isObject$1(newVal)&&!isArray(newVal);if(!newValIsObject){newVal={value:newVal};}// original data has name but new data has no name\nvar shouldDeleteName=original.name!=null&&newVal.name==null;// Original data has option\nnewVal=defaults(newVal,original);shouldDeleteName&&delete newVal.name;return newVal;}else{return newVal;}});}register$2('dataView',DataView);registerAction({type:'changeDataView',event:'dataViewChanged',update:'prepareAndUpdate'},function(payload,ecModel){var newSeriesOptList=[];each$1(payload.newOption.series,function(seriesOpt){var seriesModel=ecModel.getSeriesByName(seriesOpt.name)[0];if(!seriesModel){// New created series\n// Geuss the series type\nnewSeriesOptList.push(extend({// Default is scatter\ntype:'scatter'},seriesOpt));}else{var originalData=seriesModel.get('data');newSeriesOptList.push({name:seriesOpt.name,data:tryMergeDataOption(seriesOpt.data,originalData)});}});ecModel.mergeOption(defaults({series:newSeriesOptList},payload.newOption));});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var curry$5=curry;var each$16=each$1;var map$2=map;var mathMin$5=Math.min;var mathMax$5=Math.max;var mathPow$2=Math.pow;var COVER_Z=10000;var UNSELECT_THRESHOLD=6;var MIN_RESIZE_LINE_WIDTH=6;var MUTEX_RESOURCE_KEY='globalPan';var DIRECTION_MAP={w:[0,0],e:[0,1],n:[1,0],s:[1,1]};var CURSOR_MAP={w:'ew',e:'ew',n:'ns',s:'ns',ne:'nesw',sw:'nesw',nw:'nwse',se:'nwse'};var DEFAULT_BRUSH_OPT={brushStyle:{lineWidth:2,stroke:'rgba(0,0,0,0.3)',fill:'rgba(0,0,0,0.1)'},transformable:true,brushMode:'single',removeOnClick:false};var baseUID=0;/**\n * @alias module:echarts/component/helper/BrushController\n * @constructor\n * @mixin {module:zrender/mixin/Eventful}\n * @event module:echarts/component/helper/BrushController#brush\n * params:\n * areas: Array., coord relates to container group,\n * If no container specified, to global.\n * opt {\n * isEnd: boolean,\n * removeOnClick: boolean\n * }\n *\n * @param {module:zrender/zrender~ZRender} zr\n */function BrushController(zr){if(__DEV__){assert$1(zr);}Eventful.call(this);/**\n * @type {module:zrender/zrender~ZRender}\n * @private\n */this._zr=zr;/**\n * @type {module:zrender/container/Group}\n * @readOnly\n */this.group=new Group();/**\n * Only for drawing (after enabledBrush).\n * 'line', 'rect', 'polygon' or false\n * If passing false/null/undefined, disable brush.\n * If passing 'auto', determined by panel.defaultBrushType\n * @private\n * @type {string}\n */this._brushType;/**\n * Only for drawing (after enabledBrush).\n *\n * @private\n * @type {Object}\n */this._brushOption;/**\n * @private\n * @type {Object}\n */this._panels;/**\n * @private\n * @type {Array.}\n */this._track=[];/**\n * @private\n * @type {boolean}\n */this._dragging;/**\n * @private\n * @type {Array}\n */this._covers=[];/**\n * @private\n * @type {moudule:zrender/container/Group}\n */this._creatingCover;/**\n * `true` means global panel\n * @private\n * @type {module:zrender/container/Group|boolean}\n */this._creatingPanel;/**\n * @private\n * @type {boolean}\n */this._enableGlobalPan;/**\n * @private\n * @type {boolean}\n */if(__DEV__){this._mounted;}/**\n * @private\n * @type {string}\n */this._uid='brushController_'+baseUID++;/**\n * @private\n * @type {Object}\n */this._handlers={};each$16(pointerHandlers,function(handler,eventName){this._handlers[eventName]=bind(handler,this);},this);}BrushController.prototype={constructor:BrushController,/**\n * If set to null/undefined/false, select disabled.\n * @param {Object} brushOption\n * @param {string|boolean} brushOption.brushType 'line', 'rect', 'polygon' or false\n * If passing false/null/undefined, disable brush.\n * If passing 'auto', determined by panel.defaultBrushType.\n * ('auto' can not be used in global panel)\n * @param {number} [brushOption.brushMode='single'] 'single' or 'multiple'\n * @param {boolean} [brushOption.transformable=true]\n * @param {boolean} [brushOption.removeOnClick=false]\n * @param {Object} [brushOption.brushStyle]\n * @param {number} [brushOption.brushStyle.width]\n * @param {number} [brushOption.brushStyle.lineWidth]\n * @param {string} [brushOption.brushStyle.stroke]\n * @param {string} [brushOption.brushStyle.fill]\n * @param {number} [brushOption.z]\n */enableBrush:function enableBrush(brushOption){if(__DEV__){assert$1(this._mounted);}this._brushType&&doDisableBrush(this);brushOption.brushType&&doEnableBrush(this,brushOption);return this;},/**\n * @param {Array.} panelOpts If not pass, it is global brush.\n * Each items: {\n * panelId, // mandatory.\n * clipPath, // mandatory. function.\n * isTargetByCursor, // mandatory. function.\n * defaultBrushType, // optional, only used when brushType is 'auto'.\n * getLinearBrushOtherExtent, // optional. function.\n * }\n */setPanels:function setPanels(panelOpts){if(panelOpts&&panelOpts.length){var panels=this._panels={};each$1(panelOpts,function(panelOpts){panels[panelOpts.panelId]=_clone(panelOpts);});}else{this._panels=null;}return this;},/**\n * @param {Object} [opt]\n * @return {boolean} [opt.enableGlobalPan=false]\n */mount:function mount(opt){opt=opt||{};if(__DEV__){this._mounted=true;// should be at first.\n}this._enableGlobalPan=opt.enableGlobalPan;var thisGroup=this.group;this._zr.add(thisGroup);thisGroup.attr({position:opt.position||[0,0],rotation:opt.rotation||0,scale:opt.scale||[1,1]});this._transform=thisGroup.getLocalTransform();return this;},eachCover:function eachCover(cb,context){each$16(this._covers,cb,context);},/**\n * Update covers.\n * @param {Array.} brushOptionList Like:\n * [\n * {id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable},\n * {id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]},\n * ...\n * ]\n * `brushType` is required in each cover info. (can not be 'auto')\n * `id` is not mandatory.\n * `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default.\n * If brushOptionList is null/undefined, all covers removed.\n */updateCovers:function updateCovers(brushOptionList){if(__DEV__){assert$1(this._mounted);}brushOptionList=map(brushOptionList,function(brushOption){return merge(_clone(DEFAULT_BRUSH_OPT),brushOption,true);});var tmpIdPrefix='\\0-brush-index-';var oldCovers=this._covers;var newCovers=this._covers=[];var controller=this;var creatingCover=this._creatingCover;new DataDiffer(oldCovers,brushOptionList,oldGetKey,getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();return this;function getKey(brushOption,index){return(brushOption.id!=null?brushOption.id:tmpIdPrefix+index)+'-'+brushOption.brushType;}function oldGetKey(cover,index){return getKey(cover.__brushOption,index);}function addOrUpdate(newIndex,oldIndex){var newBrushOption=brushOptionList[newIndex];// Consider setOption in event listener of brushSelect,\n// where updating cover when creating should be forbiden.\nif(oldIndex!=null&&oldCovers[oldIndex]===creatingCover){newCovers[newIndex]=oldCovers[oldIndex];}else{var cover=newCovers[newIndex]=oldIndex!=null?(oldCovers[oldIndex].__brushOption=newBrushOption,oldCovers[oldIndex]):endCreating(controller,createCover(controller,newBrushOption));updateCoverAfterCreation(controller,cover);}}function remove(oldIndex){if(oldCovers[oldIndex]!==creatingCover){controller.group.remove(oldCovers[oldIndex]);}}},unmount:function unmount(){if(__DEV__){if(!this._mounted){return;}}this.enableBrush(false);// container may 'removeAll' outside.\nclearCovers(this);this._zr.remove(this.group);if(__DEV__){this._mounted=false;// should be at last.\n}return this;},dispose:function dispose(){this.unmount();this.off();}};mixin(BrushController,Eventful);function doEnableBrush(controller,brushOption){var zr=controller._zr;// Consider roam, which takes globalPan too.\nif(!controller._enableGlobalPan){take(zr,MUTEX_RESOURCE_KEY,controller._uid);}mountHandlers(zr,controller._handlers);controller._brushType=brushOption.brushType;controller._brushOption=merge(_clone(DEFAULT_BRUSH_OPT),brushOption,true);}function doDisableBrush(controller){var zr=controller._zr;release(zr,MUTEX_RESOURCE_KEY,controller._uid);unmountHandlers(zr,controller._handlers);controller._brushType=controller._brushOption=null;}function mountHandlers(zr,handlers){each$16(handlers,function(handler,eventName){zr.on(eventName,handler);});}function unmountHandlers(zr,handlers){each$16(handlers,function(handler,eventName){zr.off(eventName,handler);});}function createCover(controller,brushOption){var cover=coverRenderers[brushOption.brushType].createCover(controller,brushOption);cover.__brushOption=brushOption;updateZ$1(cover,brushOption);controller.group.add(cover);return cover;}function endCreating(controller,creatingCover){var coverRenderer=getCoverRenderer(creatingCover);if(coverRenderer.endCreating){coverRenderer.endCreating(controller,creatingCover);updateZ$1(creatingCover,creatingCover.__brushOption);}return creatingCover;}function updateCoverShape(controller,cover){var brushOption=cover.__brushOption;getCoverRenderer(cover).updateCoverShape(controller,cover,brushOption.range,brushOption);}function updateZ$1(cover,brushOption){var z=brushOption.z;z==null&&(z=COVER_Z);cover.traverse(function(el){el.z=z;el.z2=z;// Consider in given container.\n});}function updateCoverAfterCreation(controller,cover){getCoverRenderer(cover).updateCommon(controller,cover);updateCoverShape(controller,cover);}function getCoverRenderer(cover){return coverRenderers[cover.__brushOption.brushType];}// return target panel or `true` (means global panel)\nfunction getPanelByPoint(controller,e,localCursorPoint){var panels=controller._panels;if(!panels){return true;// Global panel\n}var panel;var transform=controller._transform;each$16(panels,function(pn){pn.isTargetByCursor(e,localCursorPoint,transform)&&(panel=pn);});return panel;}// Return a panel or true\nfunction getPanelByCover(controller,cover){var panels=controller._panels;if(!panels){return true;// Global panel\n}var panelId=cover.__brushOption.panelId;// User may give cover without coord sys info,\n// which is then treated as global panel.\nreturn panelId!=null?panels[panelId]:true;}function clearCovers(controller){var covers=controller._covers;var originalLength=covers.length;each$16(covers,function(cover){controller.group.remove(cover);},controller);covers.length=0;return!!originalLength;}function trigger$1(controller,opt){var areas=map$2(controller._covers,function(cover){var brushOption=cover.__brushOption;var range=_clone(brushOption.range);return{brushType:brushOption.brushType,panelId:brushOption.panelId,range:range};});controller.trigger('brush',areas,{isEnd:!!opt.isEnd,removeOnClick:!!opt.removeOnClick});}function shouldShowCover(controller){var track=controller._track;if(!track.length){return false;}var p2=track[track.length-1];var p1=track[0];var dx=p2[0]-p1[0];var dy=p2[1]-p1[1];var dist=mathPow$2(dx*dx+dy*dy,0.5);return dist>UNSELECT_THRESHOLD;}function getTrackEnds(track){var tail=track.length-1;tail<0&&(tail=0);return[track[0],track[tail]];}function createBaseRectCover(doDrift,controller,brushOption,edgeNames){var cover=new Group();cover.add(new Rect({name:'main',style:makeStyle(brushOption),silent:true,draggable:true,cursor:'move',drift:curry$5(doDrift,controller,cover,'nswe'),ondragend:curry$5(trigger$1,controller,{isEnd:true})}));each$16(edgeNames,function(name){cover.add(new Rect({name:name,style:{opacity:0},draggable:true,silent:true,invisible:true,drift:curry$5(doDrift,controller,cover,name),ondragend:curry$5(trigger$1,controller,{isEnd:true})}));});return cover;}function updateBaseRect(controller,cover,localRange,brushOption){var lineWidth=brushOption.brushStyle.lineWidth||0;var handleSize=mathMax$5(lineWidth,MIN_RESIZE_LINE_WIDTH);var x=localRange[0][0];var y=localRange[1][0];var xa=x-lineWidth/2;var ya=y-lineWidth/2;var x2=localRange[0][1];var y2=localRange[1][1];var x2a=x2-handleSize+lineWidth/2;var y2a=y2-handleSize+lineWidth/2;var width=x2-x;var height=y2-y;var widtha=width+lineWidth;var heighta=height+lineWidth;updateRectShape(controller,cover,'main',x,y,width,height);if(brushOption.transformable){updateRectShape(controller,cover,'w',xa,ya,handleSize,heighta);updateRectShape(controller,cover,'e',x2a,ya,handleSize,heighta);updateRectShape(controller,cover,'n',xa,ya,widtha,handleSize);updateRectShape(controller,cover,'s',xa,y2a,widtha,handleSize);updateRectShape(controller,cover,'nw',xa,ya,handleSize,handleSize);updateRectShape(controller,cover,'ne',x2a,ya,handleSize,handleSize);updateRectShape(controller,cover,'sw',xa,y2a,handleSize,handleSize);updateRectShape(controller,cover,'se',x2a,y2a,handleSize,handleSize);}}function updateCommon(controller,cover){var brushOption=cover.__brushOption;var transformable=brushOption.transformable;var mainEl=cover.childAt(0);mainEl.useStyle(makeStyle(brushOption));mainEl.attr({silent:!transformable,cursor:transformable?'move':'default'});each$16(['w','e','n','s','se','sw','ne','nw'],function(name){var el=cover.childOfName(name);var globalDir=getGlobalDirection(controller,name);el&&el.attr({silent:!transformable,invisible:!transformable,cursor:transformable?CURSOR_MAP[globalDir]+'-resize':null});});}function updateRectShape(controller,cover,name,x,y,w,h){var el=cover.childOfName(name);el&&el.setShape(pointsToRect(clipByPanel(controller,cover,[[x,y],[x+w,y+h]])));}function makeStyle(brushOption){return defaults({strokeNoScale:true},brushOption.brushStyle);}function formatRectRange(x,y,x2,y2){var min=[mathMin$5(x,x2),mathMin$5(y,y2)];var max=[mathMax$5(x,x2),mathMax$5(y,y2)];return[[min[0],max[0]],// x range\n[min[1],max[1]]// y range\n];}function getTransform$1(controller){return getTransform(controller.group);}function getGlobalDirection(controller,localDirection){if(localDirection.length>1){localDirection=localDirection.split('');var globalDir=[getGlobalDirection(controller,localDirection[0]),getGlobalDirection(controller,localDirection[1])];(globalDir[0]==='e'||globalDir[0]==='w')&&globalDir.reverse();return globalDir.join('');}else{var map$$1={w:'left',e:'right',n:'top',s:'bottom'};var inverseMap={left:'w',right:'e',top:'n',bottom:'s'};var globalDir=transformDirection(map$$1[localDirection],getTransform$1(controller));return inverseMap[globalDir];}}function driftRect(toRectRange,fromRectRange,controller,cover,name,dx,dy,e){var brushOption=cover.__brushOption;var rectRange=toRectRange(brushOption.range);var localDelta=toLocalDelta(controller,dx,dy);each$16(name.split(''),function(namePart){var ind=DIRECTION_MAP[namePart];rectRange[ind[0]][ind[1]]+=localDelta[ind[0]];});brushOption.range=fromRectRange(formatRectRange(rectRange[0][0],rectRange[1][0],rectRange[0][1],rectRange[1][1]));updateCoverAfterCreation(controller,cover);trigger$1(controller,{isEnd:false});}function driftPolygon(controller,cover,dx,dy,e){var range=cover.__brushOption.range;var localDelta=toLocalDelta(controller,dx,dy);each$16(range,function(point){point[0]+=localDelta[0];point[1]+=localDelta[1];});updateCoverAfterCreation(controller,cover);trigger$1(controller,{isEnd:false});}function toLocalDelta(controller,dx,dy){var thisGroup=controller.group;var localD=thisGroup.transformCoordToLocal(dx,dy);var localZero=thisGroup.transformCoordToLocal(0,0);return[localD[0]-localZero[0],localD[1]-localZero[1]];}function clipByPanel(controller,cover,data){var panel=getPanelByCover(controller,cover);return panel&&panel!==true?panel.clipPath(data,controller._transform):_clone(data);}function pointsToRect(points){var xmin=mathMin$5(points[0][0],points[1][0]);var ymin=mathMin$5(points[0][1],points[1][1]);var xmax=mathMax$5(points[0][0],points[1][0]);var ymax=mathMax$5(points[0][1],points[1][1]);return{x:xmin,y:ymin,width:xmax-xmin,height:ymax-ymin};}function resetCursor(controller,e,localCursorPoint){if(// Check active\n!controller._brushType// resetCursor should be always called when mouse is in zr area,\n// but not called when mouse is out of zr area to avoid bad influence\n// if `mousemove`, `mouseup` are triggered from `document` event.\n||isOutsideZrArea(controller,e)){return;}var zr=controller._zr;var covers=controller._covers;var currPanel=getPanelByPoint(controller,e,localCursorPoint);// Check whether in covers.\nif(!controller._dragging){for(var i=0;izr.getWidth()||y<0||y>zr.getHeight();}/**\n * key: brushType\n * @type {Object}\n */var coverRenderers={lineX:getLineRenderer(0),lineY:getLineRenderer(1),rect:{createCover:function createCover(controller,brushOption){return createBaseRectCover(curry$5(driftRect,function(range){return range;},function(range){return range;}),controller,brushOption,['w','e','n','s','se','sw','ne','nw']);},getCreatingRange:function getCreatingRange(localTrack){var ends=getTrackEnds(localTrack);return formatRectRange(ends[1][0],ends[1][1],ends[0][0],ends[0][1]);},updateCoverShape:function updateCoverShape(controller,cover,localRange,brushOption){updateBaseRect(controller,cover,localRange,brushOption);},updateCommon:updateCommon,contain:mainShapeContain},polygon:{createCover:function createCover(controller,brushOption){var cover=new Group();// Do not use graphic.Polygon because graphic.Polyline do not close the\n// border of the shape when drawing, which is a better experience for user.\ncover.add(new Polyline({name:'main',style:makeStyle(brushOption),silent:true}));return cover;},getCreatingRange:function getCreatingRange(localTrack){return localTrack;},endCreating:function endCreating(controller,cover){cover.remove(cover.childAt(0));// Use graphic.Polygon close the shape.\ncover.add(new Polygon({name:'main',draggable:true,drift:curry$5(driftPolygon,controller,cover),ondragend:curry$5(trigger$1,controller,{isEnd:true})}));},updateCoverShape:function updateCoverShape(controller,cover,localRange,brushOption){cover.childAt(0).setShape({points:clipByPanel(controller,cover,localRange)});},updateCommon:updateCommon,contain:mainShapeContain}};function getLineRenderer(xyIndex){return{createCover:function createCover(controller,brushOption){return createBaseRectCover(curry$5(driftRect,function(range){var rectRange=[range,[0,100]];xyIndex&&rectRange.reverse();return rectRange;},function(rectRange){return rectRange[xyIndex];}),controller,brushOption,[['w','e'],['n','s']][xyIndex]);},getCreatingRange:function getCreatingRange(localTrack){var ends=getTrackEnds(localTrack);var min=mathMin$5(ends[0][xyIndex],ends[1][xyIndex]);var max=mathMax$5(ends[0][xyIndex],ends[1][xyIndex]);return[min,max];},updateCoverShape:function updateCoverShape(controller,cover,localRange,brushOption){var otherExtent;// If brushWidth not specified, fit the panel.\nvar panel=getPanelByCover(controller,cover);if(panel!==true&&panel.getLinearBrushOtherExtent){otherExtent=panel.getLinearBrushOtherExtent(xyIndex,controller._transform);}else{var zr=controller._zr;otherExtent=[0,[zr.getWidth(),zr.getHeight()][1-xyIndex]];}var rectRange=[localRange,otherExtent];xyIndex&&rectRange.reverse();updateBaseRect(controller,cover,rectRange,brushOption);},updateCommon:updateCommon,contain:mainShapeContain};}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var IRRELEVANT_EXCLUDES={'axisPointer':1,'tooltip':1,'brush':1};/**\n * Avoid that: mouse click on a elements that is over geo or graph,\n * but roam is triggered.\n */function onIrrelevantElement(e,api,targetCoordSysModel){var model=api.getComponentByElement(e.topTarget);// If model is axisModel, it works only if it is injected with coordinateSystem.\nvar coordSys=model&&model.coordinateSystem;return model&&model!==targetCoordSysModel&&!IRRELEVANT_EXCLUDES[model.mainType]&&coordSys&&coordSys.model!==targetCoordSysModel;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/function makeRectPanelClipPath(rect){rect=normalizeRect(rect);return function(localPoints,transform){return clipPointsByRect(localPoints,rect);};}function makeLinearBrushOtherExtent(rect,specifiedXYIndex){rect=normalizeRect(rect);return function(xyIndex){var idx=specifiedXYIndex!=null?specifiedXYIndex:xyIndex;var brushWidth=idx?rect.width:rect.height;var base=idx?rect.x:rect.y;return[base,base+(brushWidth||0)];};}function makeRectIsTargetByCursor(rect,api,targetModel){rect=normalizeRect(rect);return function(e,localCursorPoint,transform){return rect.contain(localCursorPoint[0],localCursorPoint[1])&&!onIrrelevantElement(e,api,targetModel);};}// Consider width/height is negative.\nfunction normalizeRect(rect){return BoundingRect.create(rect);}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$17=each$1;var indexOf$2=indexOf;var curry$6=curry;var COORD_CONVERTS=['dataToPoint','pointToData'];// FIXME\n// how to genarialize to more coordinate systems.\nvar INCLUDE_FINDER_MAIN_TYPES=['grid','xAxis','yAxis','geo','graph','polar','radiusAxis','angleAxis','bmap'];/**\n * [option in constructor]:\n * {\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * }\n *\n *\n * [targetInfo]:\n *\n * There can be multiple axes in a single targetInfo. Consider the case\n * of `grid` component, a targetInfo represents a grid which contains one or more\n * cartesian and one or more axes. And consider the case of parallel system,\n * which has multiple axes in a coordinate system.\n * Can be {\n * panelId: ...,\n * coordSys: ,\n * coordSyses: all cartesians.\n * gridModel: \n * xAxes: correspond to coordSyses on index\n * yAxes: correspond to coordSyses on index\n * }\n * or {\n * panelId: ...,\n * coordSys: \n * coordSyses: []\n * geoModel: \n * }\n *\n *\n * [panelOpt]:\n *\n * Make from targetInfo. Input to BrushController.\n * {\n * panelId: ...,\n * rect: ...\n * }\n *\n *\n * [area]:\n *\n * Generated by BrushController or user input.\n * {\n * panelId: Used to locate coordInfo directly. If user inpput, no panelId.\n * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y').\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * range: pixel range.\n * coordRange: representitive coord range (the first one of coordRanges).\n * coordRanges: coord ranges, used in multiple cartesian in one grid.\n * }\n */ /**\n * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} [opt]\n * @param {Array.} [opt.include] include coordinate system types.\n */function BrushTargetManager(option,ecModel,opt){/**\n * @private\n * @type {Array.}\n */var targetInfoList=this._targetInfoList=[];var info={};var foundCpts=parseFinder$1(ecModel,option);each$17(targetInfoBuilders,function(builder,type){if(!opt||!opt.include||indexOf$2(opt.include,type)>=0){builder(foundCpts,targetInfoList,info);}});}var proto$5=BrushTargetManager.prototype;proto$5.setOutputRanges=function(areas,ecModel){this.matchOutputRanges(areas,ecModel,function(area,coordRange,coordSys){(area.coordRanges||(area.coordRanges=[])).push(coordRange);// area.coordRange is the first of area.coordRanges\nif(!area.coordRange){area.coordRange=coordRange;// In 'category' axis, coord to pixel is not reversible, so we can not\n// rebuild range by coordRange accrately, which may bring trouble when\n// brushing only one item. So we use __rangeOffset to rebuilding range\n// by coordRange. And this it only used in brush component so it is no\n// need to be adapted to coordRanges.\nvar result=coordConvert[area.brushType](0,coordSys,coordRange);area.__rangeOffset={offset:diffProcessor[area.brushType](result.values,area.range,[1,1]),xyMinMax:result.xyMinMax};}});};proto$5.matchOutputRanges=function(areas,ecModel,cb){each$17(areas,function(area){var targetInfo=this.findTargetInfo(area,ecModel);if(targetInfo&&targetInfo!==true){each$1(targetInfo.coordSyses,function(coordSys){var result=coordConvert[area.brushType](1,coordSys,area.range);cb(area,result.values,coordSys,ecModel);});}},this);};proto$5.setInputRanges=function(areas,ecModel){each$17(areas,function(area){var targetInfo=this.findTargetInfo(area,ecModel);if(__DEV__){assert$1(!targetInfo||targetInfo===true||area.coordRange,'coordRange must be specified when coord index specified.');assert$1(!targetInfo||targetInfo!==true||area.range,'range must be specified in global brush.');}area.range=area.range||[];// convert coordRange to global range and set panelId.\nif(targetInfo&&targetInfo!==true){area.panelId=targetInfo.panelId;// (1) area.range shoule always be calculate from coordRange but does\n// not keep its original value, for the sake of the dataZoom scenario,\n// where area.coordRange remains unchanged but area.range may be changed.\n// (2) Only support converting one coordRange to pixel range in brush\n// component. So do not consider `coordRanges`.\n// (3) About __rangeOffset, see comment above.\nvar result=coordConvert[area.brushType](0,targetInfo.coordSys,area.coordRange);var rangeOffset=area.__rangeOffset;area.range=rangeOffset?diffProcessor[area.brushType](result.values,rangeOffset.offset,getScales(result.xyMinMax,rangeOffset.xyMinMax)):result.values;}},this);};proto$5.makePanelOpts=function(api,getDefaultBrushType){return map(this._targetInfoList,function(targetInfo){var rect=targetInfo.getPanelRect();return{panelId:targetInfo.panelId,defaultBrushType:getDefaultBrushType&&getDefaultBrushType(targetInfo),clipPath:makeRectPanelClipPath(rect),isTargetByCursor:makeRectIsTargetByCursor(rect,api,targetInfo.coordSysModel),getLinearBrushOtherExtent:makeLinearBrushOtherExtent(rect)};});};proto$5.controlSeries=function(area,seriesModel,ecModel){// Check whether area is bound in coord, and series do not belong to that coord.\n// If do not do this check, some brush (like lineX) will controll all axes.\nvar targetInfo=this.findTargetInfo(area,ecModel);return targetInfo===true||targetInfo&&indexOf$2(targetInfo.coordSyses,seriesModel.coordinateSystem)>=0;};/**\n * If return Object, a coord found.\n * If reutrn true, global found.\n * Otherwise nothing found.\n *\n * @param {Object} area\n * @param {Array} targetInfoList\n * @return {Object|boolean}\n */proto$5.findTargetInfo=function(area,ecModel){var targetInfoList=this._targetInfoList;var foundCpts=parseFinder$1(ecModel,area);for(var i=0;iminMax[1]&&minMax.reverse();return minMax;}function parseFinder$1(ecModel,option){return parseFinder(ecModel,option,{includeMainTypes:INCLUDE_FINDER_MAIN_TYPES});}var targetInfoBuilders={grid:function grid(foundCpts,targetInfoList){var xAxisModels=foundCpts.xAxisModels;var yAxisModels=foundCpts.yAxisModels;var gridModels=foundCpts.gridModels;// Remove duplicated.\nvar gridModelMap=createHashMap();var xAxesHas={};var yAxesHas={};if(!xAxisModels&&!yAxisModels&&!gridModels){return;}each$17(xAxisModels,function(axisModel){var gridModel=axisModel.axis.grid.model;gridModelMap.set(gridModel.id,gridModel);xAxesHas[gridModel.id]=true;});each$17(yAxisModels,function(axisModel){var gridModel=axisModel.axis.grid.model;gridModelMap.set(gridModel.id,gridModel);yAxesHas[gridModel.id]=true;});each$17(gridModels,function(gridModel){gridModelMap.set(gridModel.id,gridModel);xAxesHas[gridModel.id]=true;yAxesHas[gridModel.id]=true;});gridModelMap.each(function(gridModel){var grid=gridModel.coordinateSystem;var cartesians=[];each$17(grid.getCartesians(),function(cartesian,index){if(indexOf$2(xAxisModels,cartesian.getAxis('x').model)>=0||indexOf$2(yAxisModels,cartesian.getAxis('y').model)>=0){cartesians.push(cartesian);}});targetInfoList.push({panelId:'grid--'+gridModel.id,gridModel:gridModel,coordSysModel:gridModel,// Use the first one as the representitive coordSys.\ncoordSys:cartesians[0],coordSyses:cartesians,getPanelRect:panelRectBuilder.grid,xAxisDeclared:xAxesHas[gridModel.id],yAxisDeclared:yAxesHas[gridModel.id]});});},geo:function geo(foundCpts,targetInfoList){each$17(foundCpts.geoModels,function(geoModel){var coordSys=geoModel.coordinateSystem;targetInfoList.push({panelId:'geo--'+geoModel.id,geoModel:geoModel,coordSysModel:geoModel,coordSys:coordSys,coordSyses:[coordSys],getPanelRect:panelRectBuilder.geo});});}};var targetInfoMatchers=[// grid\nfunction(foundCpts,targetInfo){var xAxisModel=foundCpts.xAxisModel;var yAxisModel=foundCpts.yAxisModel;var gridModel=foundCpts.gridModel;!gridModel&&xAxisModel&&(gridModel=xAxisModel.axis.grid.model);!gridModel&&yAxisModel&&(gridModel=yAxisModel.axis.grid.model);return gridModel&&gridModel===targetInfo.gridModel;},// geo\nfunction(foundCpts,targetInfo){var geoModel=foundCpts.geoModel;return geoModel&&geoModel===targetInfo.geoModel;}];var panelRectBuilder={grid:function grid(){// grid is not Transformable.\nreturn this.coordSys.grid.getRect().clone();},geo:function geo(){var coordSys=this.coordSys;var rect=coordSys.getBoundingRect().clone();// geo roam and zoom transform\nrect.applyTransform(getTransform(coordSys));return rect;}};var coordConvert={lineX:curry$6(axisConvert,0),lineY:curry$6(axisConvert,1),rect:function rect(to,coordSys,rangeOrCoordRange){var xminymin=coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0],rangeOrCoordRange[1][0]]);var xmaxymax=coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1],rangeOrCoordRange[1][1]]);var values=[formatMinMax([xminymin[0],xmaxymax[0]]),formatMinMax([xminymin[1],xmaxymax[1]])];return{values:values,xyMinMax:values};},polygon:function polygon(to,coordSys,rangeOrCoordRange){var xyMinMax=[[Infinity,-Infinity],[Infinity,-Infinity]];var values=map(rangeOrCoordRange,function(item){var p=coordSys[COORD_CONVERTS[to]](item);xyMinMax[0][0]=Math.min(xyMinMax[0][0],p[0]);xyMinMax[1][0]=Math.min(xyMinMax[1][0],p[1]);xyMinMax[0][1]=Math.max(xyMinMax[0][1],p[0]);xyMinMax[1][1]=Math.max(xyMinMax[1][1],p[1]);return p;});return{values:values,xyMinMax:xyMinMax};}};function axisConvert(axisNameIndex,to,coordSys,rangeOrCoordRange){if(__DEV__){assert$1(coordSys.type==='cartesian2d','lineX/lineY brush is available only in cartesian2d.');}var axis=coordSys.getAxis(['x','y'][axisNameIndex]);var values=formatMinMax(map([0,1],function(i){return to?axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])):axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));}));var xyMinMax=[];xyMinMax[axisNameIndex]=values;xyMinMax[1-axisNameIndex]=[NaN,NaN];return{values:values,xyMinMax:xyMinMax};}var diffProcessor={lineX:curry$6(axisDiffProcessor,0),lineY:curry$6(axisDiffProcessor,1),rect:function rect(values,refer,scales){return[[values[0][0]-scales[0]*refer[0][0],values[0][1]-scales[0]*refer[0][1]],[values[1][0]-scales[1]*refer[1][0],values[1][1]-scales[1]*refer[1][1]]];},polygon:function polygon(values,refer,scales){return map(values,function(item,idx){return[item[0]-scales[0]*refer[idx][0],item[1]-scales[1]*refer[idx][1]];});}};function axisDiffProcessor(axisNameIndex,values,refer,scales){return[values[0]-scales[axisNameIndex]*refer[0],values[1]-scales[axisNameIndex]*refer[1]];}// We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\nfunction getScales(xyMinMaxCurr,xyMinMaxOrigin){var sizeCurr=getSize(xyMinMaxCurr);var sizeOrigin=getSize(xyMinMaxOrigin);var scales=[sizeCurr[0]/sizeOrigin[0],sizeCurr[1]/sizeOrigin[1]];isNaN(scales[0])&&(scales[0]=1);isNaN(scales[1])&&(scales[1]=1);return scales;}function getSize(xyMinMax){return xyMinMax?[xyMinMax[0][1]-xyMinMax[0][0],xyMinMax[1][1]-xyMinMax[1][0]]:[NaN,NaN];}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var each$18=each$1;var ATTR$2='\\0_ec_hist_store';/**\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]}\n */function push(ecModel,newSnapshot){var store=giveStore$1(ecModel);// If previous dataZoom can not be found,\n// complete an range with current range.\neach$18(newSnapshot,function(batchItem,dataZoomId){var i=store.length-1;for(;i>=0;i--){var snapshot=store[i];if(snapshot[dataZoomId]){break;}}if(i<0){// No origin range set, create one by current range.\nvar dataZoomModel=ecModel.queryComponents({mainType:'dataZoom',subType:'select',id:dataZoomId})[0];if(dataZoomModel){var percentRange=dataZoomModel.getPercentRange();store[0][dataZoomId]={dataZoomId:dataZoomId,start:percentRange[0],end:percentRange[1]};}}});store.push(newSnapshot);}/**\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} snapshot\n */function pop(ecModel){var store=giveStore$1(ecModel);var head=store[store.length-1];store.length>1&&store.pop();// Find top for all dataZoom.\nvar snapshot={};each$18(head,function(batchItem,dataZoomId){for(var i=store.length-1;i>=0;i--){var batchItem=store[i][dataZoomId];if(batchItem){snapshot[dataZoomId]=batchItem;break;}}});return snapshot;}/**\n * @param {module:echarts/model/Global} ecModel\n */function clear$1(ecModel){ecModel[ATTR$2]=null;}/**\n * @param {module:echarts/model/Global} ecModel\n * @return {number} records. always >= 1.\n */function count(ecModel){return giveStore$1(ecModel).length;}/**\n * [{key: dataZoomId, value: {dataZoomId, range}}, ...]\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n * @type {Array.}\n */function giveStore$1(ecModel){var store=ecModel[ATTR$2];if(!store){store=ecModel[ATTR$2]=[{}];}return store;}/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/DataZoomModel.extend({type:'dataZoom.select'});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/DataZoomView.extend({type:'dataZoom.select'});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ /**\n * Only work for toolbox dataZoom. User\n * MUST NOT import this module directly.\n */ /*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/ // Use dataZoomSelect\nvar dataZoomLang=lang.toolbox.dataZoom;var each$15=each$1;// Spectial component id start with \\0ec\\0, see echarts/model/Global.js~hasInnerId\nvar DATA_ZOOM_ID_BASE='\\0_ec_\\0toolbox-dataZoom_';function DataZoom(model,ecModel,api){/**\n * @private\n * @type {module:echarts/component/helper/BrushController}\n */(this._brushController=new BrushController(api.getZr())).on('brush',bind(this._onBrush,this)).mount();/**\n * @private\n * @type {boolean}\n */this._isZoomActive;}DataZoom.defaultOption={show:true,filterMode:'filter',// Icon group\nicon:{zoom:'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',back:'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'},// `zoom`, `back`\ntitle:_clone(dataZoomLang.title),brushStyle:{borderWidth:0,color:'rgba(0,0,0,0.2)'}};var proto$4=DataZoom.prototype;proto$4.render=function(featureModel,ecModel,api,payload){this.model=featureModel;this.ecModel=ecModel;this.api=api;updateZoomBtnStatus(featureModel,ecModel,this,payload,api);updateBackBtnStatus(featureModel,ecModel);};proto$4.onclick=function(ecModel,api,type){handlers[type].call(this);};proto$4.remove=function(ecModel,api){this._brushController.unmount();};proto$4.dispose=function(ecModel,api){this._brushController.dispose();};/**\n * @private\n */var handlers={zoom:function zoom(){var nextActive=!this._isZoomActive;this.api.dispatchAction({type:'takeGlobalCursor',key:'dataZoomSelect',dataZoomSelectActive:nextActive});},back:function back(){this._dispatchZoomAction(pop(this.ecModel));}};/**\n * @private\n */proto$4._onBrush=function(areas,opt){if(!opt.isEnd||!areas.length){return;}var snapshot={};var ecModel=this.ecModel;this._brushController.updateCovers([]);// remove cover\nvar brushTargetManager=new BrushTargetManager(retrieveAxisSetting(this.model.option),ecModel,{include:['grid']});brushTargetManager.matchOutputRanges(areas,ecModel,function(area,coordRange,coordSys){if(coordSys.type!=='cartesian2d'){return;}var brushType=area.brushType;if(brushType==='rect'){setBatch('x',coordSys,coordRange[0]);setBatch('y',coordSys,coordRange[1]);}else{setBatch({lineX:'x',lineY:'y'}[brushType],coordSys,coordRange);}});push(ecModel,snapshot);this._dispatchZoomAction(snapshot);function setBatch(dimName,coordSys,minMax){var axis=coordSys.getAxis(dimName);var axisModel=axis.model;var dataZoomModel=findDataZoom(dimName,axisModel,ecModel);// Restrict range.\nvar minMaxSpan=dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();if(minMaxSpan.minValueSpan!=null||minMaxSpan.maxValueSpan!=null){minMax=sliderMove(0,minMax.slice(),axis.scale.getExtent(),0,minMaxSpan.minValueSpan,minMaxSpan.maxValueSpan);}dataZoomModel&&(snapshot[dataZoomModel.id]={dataZoomId:dataZoomModel.id,startValue:minMax[0],endValue:minMax[1]});}function findDataZoom(dimName,axisModel,ecModel){var found;ecModel.eachComponent({mainType:'dataZoom',subType:'select'},function(dzModel){var has=dzModel.getAxisModel(dimName,axisModel.componentIndex);has&&(found=dzModel);});return found;}};/**\n * @private\n */proto$4._dispatchZoomAction=function(snapshot){var batch=[];// Convert from hash map to array.\neach$15(snapshot,function(batchItem,dataZoomId){batch.push(_clone(batchItem));});batch.length&&this.api.dispatchAction({type:'dataZoom',from:this.uid,batch:batch});};function retrieveAxisSetting(option){var setting={};// Compatible with previous setting: null => all axis, false => no axis.\neach$1(['xAxisIndex','yAxisIndex'],function(name){setting[name]=option[name];setting[name]==null&&(setting[name]='all');(setting[name]===false||setting[name]==='none')&&(setting[name]=[]);});return setting;}function updateBackBtnStatus(featureModel,ecModel){featureModel.setIconStatus('back',count(ecModel)>1?'emphasis':'normal');}function updateZoomBtnStatus(featureModel,ecModel,view,payload,api){var zoomActive=view._isZoomActive;if(payload&&payload.type==='takeGlobalCursor'){zoomActive=payload.key==='dataZoomSelect'?payload.dataZoomSelectActive:false;}view._isZoomActive=zoomActive;featureModel.setIconStatus('zoom',zoomActive?'emphasis':'normal');var brushTargetManager=new BrushTargetManager(retrieveAxisSetting(featureModel.option),ecModel,{include:['grid']});view._brushController.setPanels(brushTargetManager.makePanelOpts(api,function(targetInfo){return targetInfo.xAxisDeclared&&!targetInfo.yAxisDeclared?'lineX':!targetInfo.xAxisDeclared&&targetInfo.yAxisDeclared?'lineY':'rect';})).enableBrush(zoomActive?{brushType:'auto',brushStyle:featureModel.getModel('brushStyle').getItemStyle()}:false);}register$2('dataZoom',DataZoom);// Create special dataZoom option for select\n// FIXME consider the case of merge option, where axes options are not exists.\nregisterPreprocessor(function(option){if(!option){return;}var dataZoomOpts=option.dataZoom||(option.dataZoom=[]);if(!isArray(dataZoomOpts)){option.dataZoom=dataZoomOpts=[dataZoomOpts];}var toolboxOpt=option.toolbox;if(toolboxOpt){// Assume there is only one toolbox\nif(isArray(toolboxOpt)){toolboxOpt=toolboxOpt[0];}if(toolboxOpt&&toolboxOpt.feature){var dataZoomOpt=toolboxOpt.feature.dataZoom;// FIXME: If add dataZoom when setOption in merge mode,\n// no axis info to be added. See `test/dataZoom-extreme.html`\naddForAxis('xAxis',dataZoomOpt);addForAxis('yAxis',dataZoomOpt);}}function addForAxis(axisName,dataZoomOpt){if(!dataZoomOpt){return;}// Try not to modify model, because it is not merged yet.\nvar axisIndicesName=axisName+'Index';var givenAxisIndices=dataZoomOpt[axisIndicesName];if(givenAxisIndices!=null&&givenAxisIndices!=='all'&&!isArray(givenAxisIndices)){givenAxisIndices=givenAxisIndices===false||givenAxisIndices==='none'?[]:[givenAxisIndices];}forEachComponent(axisName,function(axisOpt,axisIndex){if(givenAxisIndices!=null&&givenAxisIndices!=='all'&&indexOf(givenAxisIndices,axisIndex)===-1){return;}var newOpt={type:'select',$fromToolbox:true,// Default to be filter\nfilterMode:dataZoomOpt.filterMode||'filter',// Id for merge mapping.\nid:DATA_ZOOM_ID_BASE+axisName+axisIndex};// FIXME\n// Only support one axis now.\nnewOpt[axisIndicesName]=axisIndex;dataZoomOpts.push(newOpt);});}function forEachComponent(mainType,cb){var opts=option[mainType];if(!isArray(opts)){opts=opts?[opts]:[];}each$15(opts,cb);}});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var restoreLang=lang.toolbox.restore;function Restore(model){this.model=model;}Restore.defaultOption={show:true,/* eslint-disable */icon:'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',/* eslint-enable */title:restoreLang.title};var proto$6=Restore.prototype;proto$6.onclick=function(ecModel,api,type){clear$1(ecModel);api.dispatchAction({type:'restore',from:this.uid});};register$2('restore',Restore);registerAction({type:'restore',event:'restore',update:'prepareAndUpdate'},function(payload,ecModel){ecModel.resetOption('recreate');});/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/var urn='urn:schemas-microsoft-com:vml';var win=typeof window==='undefined'?null:window;var vmlInited=false;var doc=win&&win.document;function createNode(tagName){return doCreateNode(tagName);}// Avoid assign to an exported variable, for transforming to cjs.\nvar doCreateNode;if(doc&&!env$1.canvasSupported){try{!doc.namespaces.zrvml&&doc.namespaces.add('zrvml',urn);doCreateNode=function doCreateNode(tagName){return doc.createElement('');};}catch(e){doCreateNode=function doCreateNode(tagName){return doc.createElement('<'+tagName+' xmlns=\"'+urn+'\" class=\"zrvml\">');};}}// From raphael\nfunction initVML(){if(vmlInited||!doc){return;}vmlInited=true;var styleSheets=doc.styleSheets;if(styleSheets.length<31){doc.createStyleSheet().addRule('.zrvml','behavior:url(#default#VML)');}else{// http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx\nstyleSheets[0].addRule('.zrvml','behavior:url(#default#VML)');}}// http://www.w3.org/TR/NOTE-VML\n// TODO Use proxy like svg instead of overwrite brush methods\nvar CMD$3=PathProxy.CMD;var round$2=Math.round;var sqrt=Math.sqrt;var abs$1=Math.abs;var cos=Math.cos;var sin=Math.sin;var mathMax$6=Math.max;if(!env$1.canvasSupported){var comma=',';var imageTransformPrefix='progid:DXImageTransform.Microsoft';var Z=21600;var Z2=Z/2;var ZLEVEL_BASE=100000;var Z_BASE=1000;var initRootElStyle=function initRootElStyle(el){el.style.cssText='position:absolute;left:0;top:0;width:1px;height:1px;';el.coordsize=Z+','+Z;el.coordorigin='0,0';};var encodeHtmlAttribute=function encodeHtmlAttribute(s){return String(s).replace(/&/g,'&').replace(/\"/g,'"');};var rgb2Str=function rgb2Str(r,g,b){return'rgb('+[r,g,b].join(',')+')';};var append=function append(parent,child){if(child&&parent&&child.parentNode!==parent){parent.appendChild(child);}};var remove=function remove(parent,child){if(child&&parent&&child.parentNode===parent){parent.removeChild(child);}};var getZIndex=function getZIndex(zlevel,z,z2){// z 的取值范围为 [0, 1000]\nreturn(parseFloat(zlevel)||0)*ZLEVEL_BASE+(parseFloat(z)||0)*Z_BASE+z2;};var parsePercent$3=parsePercent;/***************************************************\n * PATH\n **************************************************/var setColorAndOpacity=function setColorAndOpacity(el,color,opacity){var colorArr=parse(color);opacity=+opacity;if(isNaN(opacity)){opacity=1;}if(colorArr){el.color=rgb2Str(colorArr[0],colorArr[1],colorArr[2]);el.opacity=opacity*colorArr[3];}};var getColorAndAlpha=function getColorAndAlpha(color){var colorArr=parse(color);return[rgb2Str(colorArr[0],colorArr[1],colorArr[2]),colorArr[3]];};var updateFillNode=function updateFillNode(el,style,zrEl){// TODO pattern\nvar fill=style.fill;if(fill!=null){// Modified from excanvas\nif(fill instanceof Gradient){var gradientType;var angle=0;var focus=[0,0];// additional offset\nvar shift=0;// scale factor for offset\nvar expansion=1;var rect=zrEl.getBoundingRect();var rectWidth=rect.width;var rectHeight=rect.height;if(fill.type==='linear'){gradientType='gradient';var transform=zrEl.transform;var p0=[fill.x*rectWidth,fill.y*rectHeight];var p1=[fill.x2*rectWidth,fill.y2*rectHeight];if(transform){applyTransform(p0,p0,transform);applyTransform(p1,p1,transform);}var dx=p1[0]-p0[0];var dy=p1[1]-p0[1];angle=Math.atan2(dx,dy)*180/Math.PI;// The angle should be a non-negative number.\nif(angle<0){angle+=360;}// Very small angles produce an unexpected result because they are\n// converted to a scientific notation string.\nif(angle<1e-6){angle=0;}}else{gradientType='gradientradial';var p0=[fill.x*rectWidth,fill.y*rectHeight];var transform=zrEl.transform;var scale$$1=zrEl.scale;var width=rectWidth;var height=rectHeight;focus=[// Percent in bounding rect\n(p0[0]-rect.x)/width,(p0[1]-rect.y)/height];if(transform){applyTransform(p0,p0,transform);}width/=scale$$1[0]*Z;height/=scale$$1[1]*Z;var dimension=mathMax$6(width,height);shift=2*0/dimension;expansion=2*fill.r/dimension-shift;}// We need to sort the color stops in ascending order by offset,\n// otherwise IE won't interpret it correctly.\nvar stops=fill.colorStops.slice();stops.sort(function(cs1,cs2){return cs1.offset-cs2.offset;});var length$$1=stops.length;// Color and alpha list of first and last stop\nvar colorAndAlphaList=[];var colors=[];for(var i=0;i=2){var color1=colorAndAlphaList[0][0];var color2=colorAndAlphaList[1][0];var opacity1=colorAndAlphaList[0][1]*style.opacity;var opacity2=colorAndAlphaList[1][1]*style.opacity;el.type=gradientType;el.method='none';el.focus='100%';el.angle=angle;el.color=color1;el.color2=color2;el.colors=colors.join(',');// When colors attribute is used, the meanings of opacity and o:opacity2\n// are reversed.\nel.opacity=opacity2;// FIXME g_o_:opacity ?\nel.opacity2=opacity1;}if(gradientType==='radial'){el.focusposition=focus.join(',');}}else{// FIXME Change from Gradient fill to color fill\nsetColorAndOpacity(el,fill,style.opacity);}}};var updateStrokeNode=function updateStrokeNode(el,style){// if (style.lineJoin != null) {\n// el.joinstyle = style.lineJoin;\n// }\n// if (style.miterLimit != null) {\n// el.miterlimit = style.miterLimit * Z;\n// }\n// if (style.lineCap != null) {\n// el.endcap = style.lineCap;\n// }\nif(style.lineDash){el.dashstyle=style.lineDash.join(' ');}if(style.stroke!=null&&!(style.stroke instanceof Gradient)){setColorAndOpacity(el,style.stroke,style.opacity);}};var updateFillAndStroke=function updateFillAndStroke(vmlEl,type,style,zrEl){var isFill=type==='fill';var el=vmlEl.getElementsByTagName(type)[0];// Stroke must have lineWidth\nif(style[type]!=null&&style[type]!=='none'&&(isFill||!isFill&&style.lineWidth)){vmlEl[isFill?'filled':'stroked']='true';// FIXME Remove before updating, or set `colors` will throw error\nif(style[type]instanceof Gradient){remove(vmlEl,el);}if(!el){el=createNode(type);}isFill?updateFillNode(el,style,zrEl):updateStrokeNode(el,style);append(vmlEl,el);}else{vmlEl[isFill?'filled':'stroked']='false';remove(vmlEl,el);}};var points$1=[[],[],[]];var pathDataToString=function pathDataToString(path,m){var M=CMD$3.M;var C=CMD$3.C;var L=CMD$3.L;var A=CMD$3.A;var Q=CMD$3.Q;var str=[];var nPoint;var cmdStr;var cmd;var i;var xi;var yi;var data=path.data;var dataLength=path.len();for(i=0;i1e-2){// Offset x0 by 1/80 of a pixel. Use something\n// that can be represented in binary\nif(clockwise){x0+=270/Z;}}else{// Avoid case draw full circle\nif(Math.abs(y0-cy)<1e-4){if(clockwise&&x0cx){y1-=270/Z;}else{y1+=270/Z;}}else if(clockwise&&y0cy){x1+=270/Z;}else{x1-=270/Z;}}}str.push(type,round$2(((cx-rx)*sx+x)*Z-Z2),comma,round$2(((cy-ry)*sy+y)*Z-Z2),comma,round$2(((cx+rx)*sx+x)*Z-Z2),comma,round$2(((cy+ry)*sy+y)*Z-Z2),comma,round$2((x0*sx+x)*Z-Z2),comma,round$2((y0*sy+y)*Z-Z2),comma,round$2((x1*sx+x)*Z-Z2),comma,round$2((y1*sy+y)*Z-Z2));xi=x1;yi=y1;break;case CMD$3.R:var p0=points$1[0];var p1=points$1[1];// x0, y0\np0[0]=data[i++];p0[1]=data[i++];// x1, y1\np1[0]=p0[0]+data[i++];p1[1]=p0[1]+data[i++];if(m){applyTransform(p0,p0,m);applyTransform(p1,p1,m);}p0[0]=round$2(p0[0]*Z-Z2);p1[0]=round$2(p1[0]*Z-Z2);p0[1]=round$2(p0[1]*Z-Z2);p1[1]=round$2(p1[1]*Z-Z2);str.push(// x0, y0\n' m ',p0[0],comma,p0[1],// x1, y0\n' l ',p1[0],comma,p0[1],// x1, y1\n' l ',p1[0],comma,p1[1],// x0, y1\n' l ',p0[0],comma,p1[1]);break;case CMD$3.Z:// FIXME Update xi, yi\nstr.push(' x ');}if(nPoint>0){str.push(cmdStr);for(var k=0;kMAX_FONT_CACHE_SIZE){fontStyleCacheCount=0;fontStyleCache={};}var style=fontEl.style;var fontFamily;try{style.font=fontString;fontFamily=style.fontFamily.split(',')[0];}catch(e){}fontStyle={style:style.fontStyle||DEFAULT_STYLE_NORMAL,variant:style.fontVariant||DEFAULT_STYLE_NORMAL,weight:style.fontWeight||DEFAULT_STYLE_NORMAL,size:parseFloat(style.fontSize||12)|0,family:fontFamily||'Microsoft YaHei'};fontStyleCache[fontString]=fontStyle;fontStyleCacheCount++;}return fontStyle;};var textMeasureEl;// Overwrite measure text method\n$override$1('measureText',function(text,textFont){var doc$$1=doc;if(!textMeasureEl){textMeasureEl=doc$$1.createElement('div');textMeasureEl.style.cssText='position:absolute;top:-20000px;left:0;'+'padding:0;margin:0;border:none;white-space:pre;';doc.body.appendChild(textMeasureEl);}try{textMeasureEl.style.font=textFont;}catch(ex){// Ignore failures to set to invalid font.\n}textMeasureEl.innerHTML='';// Don't use innerHTML or innerText because they allow markup/whitespace.\ntextMeasureEl.appendChild(doc$$1.createTextNode(text));return{width:textMeasureEl.offsetWidth};});var tmpRect$2=new BoundingRect();var drawRectText=function drawRectText(vmlRoot,rect,textRect,fromTextEl){var style=this.style;// Optimize, avoid normalize every time.\nthis.__dirty&&normalizeTextStyle(style,true);var text=style.text;// Convert to string\ntext!=null&&(text+='');if(!text){return;}// Convert rich text to plain text. Rich text is not supported in\n// IE8-, but tags in rich text template will be removed.\nif(style.rich){var contentBlock=parseRichText(text,style);text=[];for(var i=0;i-EPSILON$4;}function pathHasFill(style,isText){var fill=isText?style.textFill:style.fill;return fill!=null&&fill!==NONE;}function pathHasStroke(style,isText){var stroke=isText?style.textStroke:style.stroke;return stroke!=null&&stroke!==NONE;}function setTransform(svgEl,m){if(m){attr(svgEl,'transform','matrix('+arrayJoin.call(m,',')+')');}}function attr(el,key,val){if(!val||val.type!=='linear'&&val.type!=='radial'){// Don't set attribute for gradient, since it need new dom nodes\nel.setAttribute(key,val);}}function attrXLink(el,key,val){el.setAttributeNS('http://www.w3.org/1999/xlink',key,val);}function bindStyle(svgEl,style,isText,el){if(pathHasFill(style,isText)){var fill=isText?style.textFill:style.fill;fill=fill==='transparent'?NONE:fill;attr(svgEl,'fill',fill);attr(svgEl,'fill-opacity',style.fillOpacity!=null?style.fillOpacity*style.opacity:style.opacity);}else{attr(svgEl,'fill',NONE);}if(pathHasStroke(style,isText)){var stroke=isText?style.textStroke:style.stroke;stroke=stroke==='transparent'?NONE:stroke;attr(svgEl,'stroke',stroke);var strokeWidth=isText?style.textStrokeWidth:style.lineWidth;var strokeScale=!isText&&style.strokeNoScale?el.getLineScale():1;attr(svgEl,'stroke-width',strokeWidth/strokeScale);// stroke then fill for text; fill then stroke for others\nattr(svgEl,'paint-order',isText?'stroke':'fill');attr(svgEl,'stroke-opacity',style.strokeOpacity!=null?style.strokeOpacity:style.opacity);var lineDash=style.lineDash;if(lineDash){attr(svgEl,'stroke-dasharray',style.lineDash.join(','));attr(svgEl,'stroke-dashoffset',mathRound(style.lineDashOffset||0));}else{attr(svgEl,'stroke-dasharray','');}// PENDING\nstyle.lineCap&&attr(svgEl,'stroke-linecap',style.lineCap);style.lineJoin&&attr(svgEl,'stroke-linejoin',style.lineJoin);style.miterLimit&&attr(svgEl,'stroke-miterlimit',style.miterLimit);}else{attr(svgEl,'stroke',NONE);}}/***************************************************\n * PATH\n **************************************************/function pathDataToString$1(path){var str=[];var data=path.data;var dataLength=path.len();for(var i=0;i=PI2$5:-dTheta>=PI2$5);// Mapping to 0~2PI\nvar unifiedTheta=dTheta>0?dTheta%PI2$5:dTheta%PI2$5+PI2$5;var large=false;if(isCircle){large=true;}else if(isAroundZero$1(dThetaPositive)){large=false;}else{large=unifiedTheta>=PI$3===!!clockwise;}var x0=round4(cx+rx*mathCos$3(theta));var y0=round4(cy+ry*mathSin$3(theta));// It will not draw if start point and end point are exactly the same\n// We need to shift the end point with a small value\n// FIXME A better way to draw circle ?\nif(isCircle){if(clockwise){dTheta=PI2$5-1e-4;}else{dTheta=-PI2$5+1e-4;}large=true;if(i===9){// Move to (x0, y0) only when CMD.A comes at the\n// first position of a shape.\n// For instance, when drawing a ring, CMD.A comes\n// after CMD.M, so it's unnecessary to move to\n// (x0, y0).\nstr.push('M',x0,y0);}}var x=round4(cx+rx*mathCos$3(theta+dTheta));var y=round4(cy+ry*mathSin$3(theta+dTheta));// FIXME Ellipse\nstr.push('A',round4(rx),round4(ry),mathRound(psi*degree),+large,+clockwise,x,y);break;case CMD$4.Z:cmdStr='Z';break;case CMD$4.R:var x=round4(data[i++]);var y=round4(data[i++]);var w=round4(data[i++]);var h=round4(data[i++]);str.push('M',x,y,'L',x+w,y,'L',x+w,y+h,'L',x,y+h,'L',x,y);break;}cmdStr&&str.push(cmdStr);for(var j=0;j to reset all of the text font as inherit?\n// otherwise the outer \n",o.getDoc().setValue(t)}),(0,d.default)(".start-date").change(function(){v("start")}),(0,d.default)(".end-date").change(function(){v("end")}),(0,d.default)(".freeze-date").change(function(){v("freeze")});var e=(0,d.default)("#start").val(),i=(0,d.default)("#end").val(),n=(0,d.default)("#freeze").val();e&&g("start",e),i&&g("end",i),n&&g("freeze",n),(0,d.default)("#mail_useauth").change(function(){(0,d.default)("#mail_username_password").toggle(this.checked)}).change();var r=f.default.extend(m.default),s=document.createElement("div");document.querySelector("#user-field-list").appendChild(s),new r({propsData:{type:"user"}}).$mount(s);var c=document.createElement("div");document.querySelector("#team-field-list").appendChild(c),new r({propsData:{type:"team"}}).$mount(c)})},"./CTFd/themes/admin/assets/js/pages/main.js":function(e,t,a){var i=f(a("./CTFd/themes/core/assets/js/CTFd.js")),o=f(a("./node_modules/jquery/dist/jquery.js")),n=f(a("./node_modules/dayjs/dayjs.min.js")),r=f(a("./node_modules/dayjs/plugin/advancedFormat.js")),s=f(a("./node_modules/nunjucks/browser/nunjucks.js")),c=a("./node_modules/howler/dist/howler.js"),d=f(a("./CTFd/themes/core/assets/js/events.js")),l=f(a("./CTFd/themes/core/assets/js/times.js")),u=f(a("./CTFd/themes/admin/assets/js/styles.js")),p=f(a("./CTFd/themes/core/assets/js/helpers.js"));function f(e){return e&&e.__esModule?e:{default:e}}n.default.extend(r.default),i.default.init(window.init),window.CTFd=i.default,window.helpers=p.default,window.$=o.default,window.dayjs=n.default,window.nunjucks=s.default,window.Howl=c.Howl,(0,o.default)(function(){(0,u.default)(),(0,l.default)(),(0,d.default)(i.default.config.urlRoot)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=l,t.bindMarkdownEditor=u,t.bindMarkdownEditors=p,t.default=void 0,a("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var i=a("./CTFd/themes/core/assets/js/utils.js"),o=d(a("./node_modules/jquery/dist/jquery.js")),n=d(a("./node_modules/easymde/src/js/easymde.js")),r=d(a("./node_modules/vue/dist/vue.esm.browser.js")),s=d(a("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),c=d(a("./node_modules/highlight.js/lib/index.js"));function d(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=r.default.extend(s.default),a=document.createElement("div");document.querySelector("main").appendChild(a);var i=new t({propsData:{editor:e}}).$mount(a);(0,o.default)("#media-modal").on("hidden.bs.modal",function(e){i.$destroy(),(0,o.default)("#media-modal").remove()}),(0,o.default)("#media-modal").modal()}function u(e){var t;!1===e.hasOwnProperty("mde")&&(t=new n.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){l(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,o.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:c.default}}),e.mde=t,e.codemirror=t.codemirror,(0,o.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,o.default)(e).val()),t.codemirror.refresh()}))}function p(){(0,o.default)("textarea.markdown").each(function(e,t){u(t)})}t.default=function(){(0,o.default)(":input").each(function(){(0,o.default)(this).data("initial",(0,o.default)(this).val())}),(0,o.default)(function(){(0,o.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,o.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,o.default)("[data-checkbox]").click(function(e){(0,o.default)(e.target).is("input[type=checkbox]")||(0,o.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,o.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,o.default)(this).prop("checked"),a=(0,o.default)(this).index()+1;(0,o.default)(this).closest("table").find("tr td:nth-child(".concat(a,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,o.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,o.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,o.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,o.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,o.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,o.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),p(),(0,i.makeSortableTables)(),(0,o.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){c.default.highlightBlock(e)})})}},"./CTFd/themes/admin/assets/js/timezones.js":function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/NSW","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","CET","CST6CDT","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Chile/EasterIsland","Cuba","EET","EST","EST5EDT","Egypt","Eire","Etc/GMT","Etc/GMT+0","Etc/GMT+1","Etc/GMT+10","Etc/GMT+11","Etc/GMT+12","Etc/GMT+2","Etc/GMT+3","Etc/GMT+4","Etc/GMT+5","Etc/GMT+6","Etc/GMT+7","Etc/GMT+8","Etc/GMT+9","Etc/GMT-0","Etc/GMT-1","Etc/GMT-10","Etc/GMT-11","Etc/GMT-12","Etc/GMT-13","Etc/GMT-14","Etc/GMT-2","Etc/GMT-3","Etc/GMT-4","Etc/GMT-5","Etc/GMT-6","Etc/GMT-7","Etc/GMT-8","Etc/GMT-9","Etc/GMT0","Etc/Greenwich","Etc/UCT","Etc/UTC","Etc/Universal","Etc/Zulu","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT+0","GMT-0","GMT0","Greenwich","HST","Hongkong","Iceland","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","Jamaica","Japan","Kwajalein","Libya","MET","MST","MST7MDT","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","NZ","NZ-CHAT","Navajo","PRC","PST8PDT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","Poland","Portugal","ROC","ROK","Singapore","Turkey","UCT","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","Universal","W-SU","WET","Zulu"];t.default=i},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=d(a("./CTFd/themes/core/assets/js/fetch.js")),o=d(a("./CTFd/themes/core/assets/js/config.js")),n=a("./CTFd/themes/core/assets/js/api.js");a("./CTFd/themes/core/assets/js/patch.js");var r=d(a("./node_modules/markdown-it/index.js")),s=d(a("./node_modules/jquery/dist/jquery.js")),c=d(a("./CTFd/themes/core/assets/js/ezq.js"));function d(e){return e&&e.__esModule?e:{default:e}}function l(t,e){var a,i=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,a)),i}function u(o){for(var e=1;e".concat(e.body,"

")):a.find(".modal-body").append((0,s.default)(e.body));var i=(0,s.default)(u.format(e.button));return e.success&&(0,s.default)(i).click(function(){e.success()}),e.large&&a.find(".modal-dialog").addClass("modal-lg"),a.find(".modal-footer").append(i),a.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,s.default)("main").append(a),a.modal("show"),(0,s.default)(a).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),a}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,a=c.format(e.title,e.body),i=(0,s.default)(a);e.onclose&&(0,s.default)(i).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(i).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var o=!1!==e.autohide,n=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(i),i.toast({autohide:o,delay:r,animation:n}),i.toast("show"),i}function g(e){var t=r.format(e.title),a=(0,s.default)(t);"string"==typeof e.body?a.find(".modal-body").append("

".concat(e.body,"

")):a.find(".modal-body").append((0,s.default)(e.body));var i=(0,s.default)(f),o=(0,s.default)(p);return a.find(".modal-footer").append(o),a.find(".modal-footer").append(i),a.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,s.default)("main").append(a),(0,s.default)(a).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(i).click(function(){e.success()}),a.modal("show"),a}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var a=d.format(e.width),i=r.format(e.title),o=(0,s.default)(i);return o.find(".modal-body").append((0,s.default)(a)),(0,s.default)("main").append(o),o.modal("show")}function A(e){var t={success:l,error:o}[e.type].format(e.body);return(0,s.default)(t)}var y={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:A};t.default=y},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("./node_modules/whatwg-fetch/fetch.js");var i,o=(i=a("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=o.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,a){var i,s=(i=a("./node_modules/q/q.js"))&&i.__esModule?i:{default:i},o=a("./CTFd/themes/core/assets/js/api.js");function r(t,e){var a,i=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,a)),i}function n(o){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),a=0;a'),(0,r.default)("th.sort-col").click(function(){var o,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((o=(0,r.default)(this).index(),function(e,t){var a=n(e,o),i=n(t,o);return r.default.isNumeric(a)&&r.default.isNumeric(i)?a-i:a.toString().localeCompare(i)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var a=0;a").text(c.default.tz.guess()),a=((0,d.default)(e).append(t),h.default),i=0;i").text(a[i]);(0,d.default)(e).append(o)}}c.default.extend(p.default),c.default.extend(f.default),c.default.extend(m.default),(0,d.default)(function(){var i=r.default.fromTextArea(document.getElementById("theme-header"),{lineNumbers:!0,lineWrapping:!0,mode:"htmlmixed",htmlMode:!0}),t=r.default.fromTextArea(document.getElementById("theme-footer"),{lineNumbers:!0,lineWrapping:!0,mode:"htmlmixed",htmlMode:!0}),a=r.default.fromTextArea(document.getElementById("theme-settings"),{lineNumbers:!0,lineWrapping:!0,readOnly:!0,mode:{name:"javascript",json:!0}}),e=((0,d.default)("a[href='#theme']").on("shown.bs.tab",function(e){i.refresh(),t.refresh(),a.refresh()}),(0,d.default)("a[href='#legal'], a[href='#tos-config'], a[href='#privacy-policy-config']").on("shown.bs.tab",function(e){(0,d.default)("#tos-config .CodeMirror").each(function(e,t){t.CodeMirror.refresh()}),(0,d.default)("#privacy-policy-config .CodeMirror").each(function(e,t){t.CodeMirror.refresh()})}),(0,d.default)("#theme-settings-modal form").submit(function(e){e.preventDefault(),a.getDoc().setValue(JSON.stringify((0,d.default)(this).serializeJSON(),null,2)),(0,d.default)("#theme-settings-modal").modal("hide")}),(0,d.default)("#theme-settings-button").click(function(){var t,i=(0,d.default)("#theme-settings-modal form");try{t=JSON.parse(a.getValue())}catch(e){t={}}d.default.each(t,function(e,t){var a=i.find("[name='".concat(e,"']"));switch(a.prop("type")){case"radio":case"checkbox":a.each(function(){(0,d.default)(this).attr("value")==t&&(0,d.default)(this).attr("checked",t)});break;default:a.val(t)}}),(0,d.default)("#theme-settings-modal").modal()}),u((0,d.default)("#start-timezone")),u((0,d.default)("#end-timezone")),u((0,d.default)("#freeze-timezone")),(0,d.default)(".config-section > form:not(.form-upload, .custom-config-form)").submit(y),(0,d.default)("#logo-upload").submit(_),(0,d.default)("#user-mode-form").submit(j),(0,d.default)("#remove-logo").click(T),(0,d.default)("#ctf-small-icon-upload").submit(b),(0,d.default)("#remove-small-icon").click(E),(0,d.default)("#export-button").click(I),(0,d.default)("#import-button").click(w),(0,d.default)("#import-csv-form").submit(C),(0,d.default)("#config-color-update").click(function(){var e,t=(0,d.default)("#config-color-picker").val(),a=i.getValue();a=a.length?(e="theme-color: ".concat(t,";"),a.replace(/theme-color: (.*);/,e)):'\n",i.getDoc().setValue(a)}),(0,d.default)(".start-date").change(function(){l("start")}),(0,d.default)(".end-date").change(function(){l("end")}),(0,d.default)(".freeze-date").change(function(){l("freeze")}),(0,d.default)("#start").val()),o=(0,d.default)("#end").val(),n=(0,d.default)("#freeze").val(),e=(e&&s("start",e),o&&s("end",o),n&&s("freeze",n),(0,d.default)("#mail_useauth").change(function(){(0,d.default)("#mail_username_password").toggle(this.checked)}).change(),A.default.extend(v.default)),o=document.createElement("div"),n=(document.querySelector("#user-field-list").appendChild(o),new e({propsData:{type:"user"}}).$mount(o),document.createElement("div"));document.querySelector("#team-field-list").appendChild(n),new e({propsData:{type:"team"}}).$mount(n)})},"./CTFd/themes/admin/assets/js/pages/main.js":function(l,u,e){var t=d(e("./CTFd/themes/core/assets/js/CTFd.js")),a=d(e("./node_modules/jquery/dist/jquery.js")),i=d(e("./node_modules/dayjs/dayjs.min.js")),o=d(e("./node_modules/dayjs/plugin/advancedFormat.js")),n=d(e("./node_modules/nunjucks/browser/nunjucks.js")),r=e("./node_modules/howler/dist/howler.js"),s=d(e("./CTFd/themes/core/assets/js/events.js")),c=d(e("./CTFd/themes/core/assets/js/times.js")),p=d(e("./CTFd/themes/admin/assets/js/styles.js")),e=d(e("./CTFd/themes/core/assets/js/helpers.js"));function d(e){return e&&e.__esModule?e:{default:e}}i.default.extend(o.default),t.default.init(window.init),window.CTFd=t.default,window.helpers=e.default,window.$=a.default,window.dayjs=i.default,window.nunjucks=n.default,window.Howl=r.Howl,(0,a.default)(function(){(0,p.default)(),(0,c.default)(),(0,s.default)(t.default.config.urlRoot)})},"./CTFd/themes/admin/assets/js/styles.js":function(l,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=c,e.bindMarkdownEditors=d,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var a=t("./CTFd/themes/core/assets/js/utils.js"),o=r(t("./node_modules/jquery/dist/jquery.js")),i=r(t("./node_modules/easymde/src/js/easymde.js")),u=r(t("./node_modules/vue/dist/vue.esm.browser.js")),p=r(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),n=r(t("./node_modules/highlight.js/lib/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=u.default.extend(p.default),a=document.createElement("div"),i=(document.querySelector("main").appendChild(a),new t({propsData:{editor:e}}).$mount(a));(0,o.default)("#media-modal").on("hidden.bs.modal",function(e){i.$destroy(),(0,o.default)("#media-modal").remove()}),(0,o.default)("#media-modal").modal()}function c(e){var t;!1===e.hasOwnProperty("mde")&&(t=new i.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,o.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:n.default}}),e.mde=t,e.codemirror=t.codemirror,(0,o.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,o.default)(e).val()),t.codemirror.refresh()}))}function d(){(0,o.default)("textarea.markdown").each(function(e,t){c(t)})}e.default=function(){(0,o.default)(":input").each(function(){(0,o.default)(this).data("initial",(0,o.default)(this).val())}),(0,o.default)(function(){(0,o.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,o.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,o.default)("[data-checkbox]").click(function(e){(0,o.default)(e.target).is("input[type=checkbox]")||(0,o.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,o.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,o.default)(this).prop("checked"),a=(0,o.default)(this).index()+1;(0,o.default)(this).closest("table").find("tr td:nth-child(".concat(a,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,o.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,o.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,o.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,o.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,o.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,o.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),d(),(0,a.makeSortableTables)(),(0,o.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){n.default.highlightBlock(e)})})}},"./CTFd/themes/admin/assets/js/timezones.js":function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/NSW","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","CET","CST6CDT","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Chile/EasterIsland","Cuba","EET","EST","EST5EDT","Egypt","Eire","Etc/GMT","Etc/GMT+0","Etc/GMT+1","Etc/GMT+10","Etc/GMT+11","Etc/GMT+12","Etc/GMT+2","Etc/GMT+3","Etc/GMT+4","Etc/GMT+5","Etc/GMT+6","Etc/GMT+7","Etc/GMT+8","Etc/GMT+9","Etc/GMT-0","Etc/GMT-1","Etc/GMT-10","Etc/GMT-11","Etc/GMT-12","Etc/GMT-13","Etc/GMT-14","Etc/GMT-2","Etc/GMT-3","Etc/GMT-4","Etc/GMT-5","Etc/GMT-6","Etc/GMT-7","Etc/GMT-8","Etc/GMT-9","Etc/GMT0","Etc/Greenwich","Etc/UCT","Etc/UTC","Etc/Universal","Etc/Zulu","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT+0","GMT-0","GMT0","Greenwich","HST","Hongkong","Iceland","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","Jamaica","Japan","Kwajalein","Libya","MET","MST","MST7MDT","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","NZ","NZ-CHAT","Navajo","PRC","PST8PDT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","Poland","Portugal","ROC","ROK","Singapore","Turkey","UCT","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","Universal","W-SU","WET","Zulu"]},"./CTFd/themes/core/assets/js/CTFd.js":function(l,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=o(t("./CTFd/themes/core/assets/js/fetch.js")),a=o(t("./CTFd/themes/core/assets/js/config.js")),i=t("./CTFd/themes/core/assets/js/api.js"),p=(t("./CTFd/themes/core/assets/js/patch.js"),o(t("./node_modules/markdown-it/index.js"))),f=o(t("./node_modules/jquery/dist/jquery.js")),t=o(t("./CTFd/themes/core/assets/js/ezq.js"));function o(e){return e&&e.__esModule?e:{default:e}}function n(t,e){var a,i=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,a)),i}function r(i){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,n.default)(e.body)),(0,n.default)(h.format(e.button)));return e.success&&(0,n.default)(a).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(a),t.find("pre code").each(function(e){o.default.highlightBlock(this)}),(0,n.default)("main").append(t),t.modal("show"),(0,n.default)(t).on("hidden.bs.modal",function(){(0,n.default)(this).modal("dispose")}),t}function s(e){(0,n.default)("#ezq--notifications-toast-container").length||(0,n.default)("body").append((0,n.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=u.format(e.title,e.body),t=(0,n.default)(t),a=(e.onclose&&(0,n.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((a=(0,n.default)(t).find(".toast-body")).addClass("cursor-pointer"),a.click(function(){e.onclick()})),!1!==e.autohide),i=!1!==e.animation,o=e.delay||1e4;return(0,n.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:a,delay:o,animation:i}),t.toast("show"),t}function c(e){var t=r.format(e.title),t=(0,n.default)(t),a=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,n.default)(e.body)),(0,n.default)(A)),i=(0,n.default)(g);return t.find(".modal-footer").append(i),t.find(".modal-footer").append(a),t.find("pre code").each(function(e){o.default.highlightBlock(this)}),(0,n.default)("main").append(t),(0,n.default)(t).on("hidden.bs.modal",function(){(0,n.default)(this).modal("dispose")}),(0,n.default)(a).click(function(){e.success()}),t.modal("show"),t}function d(e){if(e.target)return(t=(0,n.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=p.format(e.width),e=r.format(e.title),e=(0,n.default)(e);return e.find(".modal-body").append((0,n.default)(t)),(0,n.default)("main").append(e),e.modal("show")}function v(e){e={success:m,error:f}[e.type].format(e.body);return(0,n.default)(e)}e.default={ezAlert:i,ezToast:s,ezQuery:c,ezProgressBar:d,ezBadge:v}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("./node_modules/whatwg-fetch/fetch.js");var i=(a=a("./CTFd/themes/core/assets/js/config.js"))&&a.__esModule?a:{default:a};var o=window.fetch;t.default=function(e,t){return e=i.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=i.default.csrfNonce,o(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,a){var s=(i=a("./node_modules/q/q.js"))&&i.__esModule?i:{default:i},i=a("./CTFd/themes/core/assets/js/api.js");function n(t,e){var a,i=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,a)),i}function o(i){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=o.getItem(r)||0;o.setItem(r,++e),(0,n.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=o.getItem(r);null===e?o.setItem(r,0):0'),(0,n.default)("th.sort-col").click(function(){var a,e=(0,n.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((a=(0,n.default)(this).index(),function(e,t){e=o(e,a),t=o(t,a);return n.default.isNumeric(e)&&n.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function g(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function j(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var y={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:j};t.default=y},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function j(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:j}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function g(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function g(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function j(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var y={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:j};t.default=y},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function j(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:j}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteSelectedUsers(_event) {\n var pageIDs = (0, _jquery[\"default\"])(\"input[data-page-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"page-id\");\n });\n var target = pageIDs.length === 1 ? \"page\" : \"pages\";\n (0, _ezq.ezQuery)({\n title: \"Delete Pages\",\n body: \"Are you sure you want to delete \".concat(pageIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(pageIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pageID = _step.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/pages/\".concat(pageID), {\n method: \"DELETE\"\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#pages-delete-button\").click(deleteSelectedUsers);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/pages.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteSelectedUsers(_event) {\n var pageIDs = (0, _jquery[\"default\"])(\"input[data-page-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"page-id\");\n });\n var target = pageIDs.length === 1 ? \"page\" : \"pages\";\n (0, _ezq.ezQuery)({\n title: \"Delete Pages\",\n body: \"Are you sure you want to delete \".concat(pageIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(pageIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pageID = _step.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/pages/\".concat(pageID), {\n method: \"DELETE\"\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#pages-delete-button\").click(deleteSelectedUsers);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/pages.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/pages.min.js b/CTFd/themes/admin/static/js/pages/pages.min.js index 73589926e..d8b9f6567 100644 --- a/CTFd/themes/admin/static/js/pages/pages.min.js +++ b/CTFd/themes/admin/static/js/pages/pages.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,i,o=e[0],n=e[1],r=e[2],a=0,s=[];a=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 r,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw r}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){r.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,r=!1!==e.animation,a=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:a,animation:r}),o.toast("show"),o}function g(e){var t=a.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){r.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=a.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var r=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,r(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function r(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,a.default)("th.sort-col").click(function(){var n,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,a.default)(this).index(),function(e,t){var i=r(e,n),o=r(t,n);return a.default.isNumeric(i)&&a.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};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 n,a=!0,r=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==o.return||o.return()}finally{if(r)throw n}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function g(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar api_func = {\n users: function users(x, y) {\n return _CTFd[\"default\"].api.patch_user_public({\n userId: x\n }, y);\n },\n teams: function teams(x, y) {\n return _CTFd[\"default\"].api.patch_team_public({\n teamId: x\n }, y);\n }\n};\n\nfunction toggleAccount() {\n var $btn = (0, _jquery[\"default\"])(this);\n var id = $btn.data(\"account-id\");\n var state = $btn.data(\"state\");\n var hidden = undefined;\n\n if (state === \"visible\") {\n hidden = true;\n } else if (state === \"hidden\") {\n hidden = false;\n }\n\n var params = {\n hidden: hidden\n };\n\n api_func[_CTFd[\"default\"].config.userMode](id, params).then(function (response) {\n if (response.success) {\n if (hidden) {\n $btn.data(\"state\", \"hidden\");\n $btn.addClass(\"btn-danger\").removeClass(\"btn-success\");\n $btn.text(\"Hidden\");\n } else {\n $btn.data(\"state\", \"visible\");\n $btn.addClass(\"btn-success\").removeClass(\"btn-danger\");\n $btn.text(\"Visible\");\n }\n }\n });\n}\n\nfunction toggleSelectedAccounts(selectedAccounts, action) {\n var params = {\n hidden: action === \"hidden\" ? true : false\n };\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(selectedAccounts.accounts),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var accId = _step.value;\n reqs.push(api_func[_CTFd[\"default\"].config.userMode](accId, params));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(selectedAccounts.users),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _accId = _step2.value;\n reqs.push(api_func[\"users\"](_accId, params));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n}\n\nfunction bulkToggleAccounts(_event) {\n // Get selected account and user IDs but only on the active tab.\n // Technically this could work for both tabs at the same time but that seems like\n // bad behavior. We don't want to accidentally unhide a user/team accidentally\n var accountIDs = (0, _jquery[\"default\"])(\".tab-pane.active input[data-account-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"account-id\");\n });\n var userIDs = (0, _jquery[\"default\"])(\".tab-pane.active input[data-user-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"user-id\");\n });\n var selectedUsers = {\n accounts: accountIDs,\n users: userIDs\n };\n (0, _ezq.ezAlert)({\n title: \"Toggle Visibility\",\n body: (0, _jquery[\"default\"])(\"\\n
\\n
\\n \\n \\n
\\n
\\n \"),\n button: \"Submit\",\n success: function success() {\n var data = (0, _jquery[\"default\"])(\"#scoreboard-bulk-edit\").serializeJSON(true);\n var state = data.visibility;\n toggleSelectedAccounts(selectedUsers, state);\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\".scoreboard-toggle\").click(toggleAccount);\n (0, _jquery[\"default\"])(\"#scoreboard-edit-button\").click(bulkToggleAccounts);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/scoreboard.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar api_func = {\n users: function users(x, y) {\n return _CTFd[\"default\"].api.patch_user_public({\n userId: x\n }, y);\n },\n teams: function teams(x, y) {\n return _CTFd[\"default\"].api.patch_team_public({\n teamId: x\n }, y);\n }\n};\n\nfunction toggleAccount() {\n var $btn = (0, _jquery[\"default\"])(this);\n var id = $btn.data(\"account-id\");\n var state = $btn.data(\"state\");\n var hidden = undefined;\n\n if (state === \"visible\") {\n hidden = true;\n } else if (state === \"hidden\") {\n hidden = false;\n }\n\n var params = {\n hidden: hidden\n };\n\n api_func[_CTFd[\"default\"].config.userMode](id, params).then(function (response) {\n if (response.success) {\n if (hidden) {\n $btn.data(\"state\", \"hidden\");\n $btn.addClass(\"btn-danger\").removeClass(\"btn-success\");\n $btn.text(\"Hidden\");\n } else {\n $btn.data(\"state\", \"visible\");\n $btn.addClass(\"btn-success\").removeClass(\"btn-danger\");\n $btn.text(\"Visible\");\n }\n }\n });\n}\n\nfunction toggleSelectedAccounts(selectedAccounts, action) {\n var params = {\n hidden: action === \"hidden\" ? true : false\n };\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(selectedAccounts.accounts),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var accId = _step.value;\n reqs.push(api_func[_CTFd[\"default\"].config.userMode](accId, params));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(selectedAccounts.users),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _accId = _step2.value;\n reqs.push(api_func[\"users\"](_accId, params));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n}\n\nfunction bulkToggleAccounts(_event) {\n // Get selected account and user IDs but only on the active tab.\n // Technically this could work for both tabs at the same time but that seems like\n // bad behavior. We don't want to accidentally unhide a user/team accidentally\n var accountIDs = (0, _jquery[\"default\"])(\".tab-pane.active input[data-account-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"account-id\");\n });\n var userIDs = (0, _jquery[\"default\"])(\".tab-pane.active input[data-user-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"user-id\");\n });\n var selectedUsers = {\n accounts: accountIDs,\n users: userIDs\n };\n (0, _ezq.ezAlert)({\n title: \"Toggle Visibility\",\n body: (0, _jquery[\"default\"])(\"\\n
\\n
\\n \\n \\n
\\n
\\n \"),\n button: \"Submit\",\n success: function success() {\n var data = (0, _jquery[\"default\"])(\"#scoreboard-bulk-edit\").serializeJSON(true);\n var state = data.visibility;\n toggleSelectedAccounts(selectedUsers, state);\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\".scoreboard-toggle\").click(toggleAccount);\n (0, _jquery[\"default\"])(\"#scoreboard-edit-button\").click(bulkToggleAccounts);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/scoreboard.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/scoreboard.min.js b/CTFd/themes/admin/static/js/pages/scoreboard.min.js index 1ed047017..300b538d1 100644 --- a/CTFd/themes/admin/static/js/pages/scoreboard.min.js +++ b/CTFd/themes/admin/static/js/pages/scoreboard.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,i,o=e[0],n=e[1],a=e[2],r=0,s=[];r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,r=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i\n
\n \n \n
\n \n '),button:"Submit",success:function(){var e=(0,a.default)("#scoreboard-bulk-edit").serializeJSON(!0).visibility;!function(e,t){var i,o={hidden:"hidden"===t},n=[],a=l(e.accounts);try{for(a.s();!(i=a.n()).done;){var r=i.value;n.push(u[p.default.config.userMode](r,o))}}catch(e){a.e(e)}finally{a.f()}var s,d=l(e.users);try{for(d.s();!(s=d.n()).done;){var c=s.value;n.push(u.users(c,o))}}catch(e){d.e(e)}finally{d.f()}Promise.all(n).then(function(e){window.location.reload()})}(t,e)}})}(0,a.default)(function(){(0,a.default)(".scoreboard-toggle").click(r),(0,a.default)("#scoreboard-edit-button").click(s)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=p,t.bindMarkdownEditor=l,t.bindMarkdownEditors=u,t.default=void 0,i("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var o=i("./CTFd/themes/core/assets/js/utils.js"),n=c(i("./node_modules/jquery/dist/jquery.js")),a=c(i("./node_modules/easymde/src/js/easymde.js")),r=c(i("./node_modules/vue/dist/vue.esm.browser.js")),s=c(i("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),d=c(i("./node_modules/highlight.js/lib/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=r.default.extend(s.default),i=document.createElement("div");document.querySelector("main").appendChild(i);var o=new t({propsData:{editor:e}}).$mount(i);(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function l(e){var t;!1===e.hasOwnProperty("mde")&&(t=new a.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){p(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:d.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function u(){(0,n.default)("textarea.markdown").each(function(e,t){l(t)})}t.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,n.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),u(),(0,o.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){d.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=c(i("./CTFd/themes/core/assets/js/fetch.js")),n=c(i("./CTFd/themes/core/assets/js/config.js")),a=i("./CTFd/themes/core/assets/js/api.js");i("./CTFd/themes/core/assets/js/patch.js");var r=c(i("./node_modules/markdown-it/index.js")),s=c(i("./node_modules/jquery/dist/jquery.js")),d=c(i("./CTFd/themes/core/assets/js/ezq.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function l(n){for(var e=1;e".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function g(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};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 n,a=!0,r=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==o.return||o.return()}finally{if(r)throw n}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i\n
\n \n \n
\n \n '),button:"Submit",success:function(){var e,t=(0,u.default)("#scoreboard-bulk-edit").serializeJSON(!0).visibility,i=p,o={hidden:"hidden"===t},n=[],a=f(i.accounts);try{for(a.s();!(e=a.n()).done;){var r=e.value;n.push(m[l.default.config.userMode](r,o))}}catch(e){a.e(e)}finally{a.f()}var s,d=f(i.users);try{for(d.s();!(s=d.n()).done;){var c=s.value;n.push(m.users(c,o))}}catch(e){d.e(e)}finally{d.f()}Promise.all(n).then(function(e){window.location.reload()})}})}(0,u.default)(function(){(0,u.default)(".scoreboard-toggle").click(o),(0,u.default)("#scoreboard-edit-button").click(n)})},"./CTFd/themes/admin/assets/js/styles.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=d,e.bindMarkdownEditors=c,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var i=t("./CTFd/themes/core/assets/js/utils.js"),n=r(t("./node_modules/jquery/dist/jquery.js")),o=r(t("./node_modules/easymde/src/js/easymde.js")),l=r(t("./node_modules/vue/dist/vue.esm.browser.js")),u=r(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),a=r(t("./node_modules/highlight.js/lib/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=l.default.extend(u.default),i=document.createElement("div"),o=(document.querySelector("main").appendChild(i),new t({propsData:{editor:e}}).$mount(i));(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function d(e){var t;!1===e.hasOwnProperty("mde")&&(t=new o.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:a.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function c(){(0,n.default)("textarea.markdown").each(function(e,t){d(t)})}e.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,n.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),c(),(0,i.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){a.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(t("./CTFd/themes/core/assets/js/fetch.js")),i=n(t("./CTFd/themes/core/assets/js/config.js")),o=t("./CTFd/themes/core/assets/js/api.js"),u=(t("./CTFd/themes/core/assets/js/patch.js"),n(t("./node_modules/markdown-it/index.js"))),f=n(t("./node_modules/jquery/dist/jquery.js")),t=n(t("./CTFd/themes/core/assets/js/ezq.js"));function n(e){return e&&e.__esModule?e:{default:e}}function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function r(o){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o".concat(e.body,"

")):o.find(".modal-body").append((0,s.default)(e.body));var i=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(i).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(i),o.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(o),o.modal("show"),(0,s.default)(o).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),o}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,o=d.format(e.title,e.body),i=(0,s.default)(o);e.onclose&&(0,s.default)(i).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(i).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(i),i.toast({autohide:n,delay:r,animation:a}),i.toast("show"),i}function g(e){var t=r.format(e.title),o=(0,s.default)(t);"string"==typeof e.body?o.find(".modal-body").append("

".concat(e.body,"

")):o.find(".modal-body").append((0,s.default)(e.body));var i=(0,s.default)(f),n=(0,s.default)(u);return o.find(".modal-footer").append(n),o.find(".modal-footer").append(i),o.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(o),(0,s.default)(o).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(i).click(function(){e.success()}),o.modal("show"),o}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=c.format(e.width),i=r.format(e.title),n=(0,s.default)(i);return n.find(".modal-body").append((0,s.default)(o)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var i,n=(i=o("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,o){var i,s=(i=o("./node_modules/q/q.js"))&&i.__esModule?i:{default:i},n=o("./CTFd/themes/core/assets/js/api.js");function r(t,e){var o,i=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,o)),i}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var o=a(e,n),i=a(t,n);return r.default.isNumeric(o)&&r.default.isNumeric(i)?o-i:o.toString().localeCompare(i)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(o).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(o),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),o=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((o=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),o.click(function(){e.onclick()})),!1!==e.autohide),i=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:o,delay:n,animation:i}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),o=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(y)),i=(0,a.default)(g);return t.find(".modal-footer").append(i),t.find(".modal-footer").append(o),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(o).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function v(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:i,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:v}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var i=(o=o("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var n=window.fetch;t.default=function(e,t){return e=i.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=i.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,o){var s=(i=o("./node_modules/q/q.js"))&&i.__esModule?i:{default:i},i=o("./CTFd/themes/core/assets/js/api.js");function a(t,e){var o,i=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,o)),i}function n(i){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var o,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((o=(0,a.default)(this).index(),function(e,t){e=n(e,o),t=n(t,o);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteCorrectSubmission(_event) {\n var key_id = (0, _jquery[\"default\"])(this).data(\"submission-id\");\n var $elem = (0, _jquery[\"default\"])(this).parent().parent();\n var chal_name = $elem.find(\".chal\").text().trim();\n var team_name = $elem.find(\".team\").text().trim();\n var row = (0, _jquery[\"default\"])(this).parent().parent();\n (0, _ezq.ezQuery)({\n title: \"Delete Submission\",\n body: \"Are you sure you want to delete correct submission from {0} for challenge {1}\".format(\"\" + (0, _utils.htmlEntities)(team_name) + \"\", \"\" + (0, _utils.htmlEntities)(chal_name) + \"\"),\n success: function success() {\n _CTFd[\"default\"].api.delete_submission({\n submissionId: key_id\n }).then(function (response) {\n if (response.success) {\n row.remove();\n }\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(_event) {\n var submissionIDs = (0, _jquery[\"default\"])(\"input[data-submission-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"submission-id\");\n });\n var target = submissionIDs.length === 1 ? \"submission\" : \"submissions\";\n (0, _ezq.ezQuery)({\n title: \"Delete Submissions\",\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(submissionIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var subId = _step.value;\n reqs.push(_CTFd[\"default\"].api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\".delete-correct-submission\").click(deleteCorrectSubmission);\n (0, _jquery[\"default\"])(\"#submission-delete-button\").click(deleteSelectedSubmissions);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/submissions.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _utils = __webpack_require__(/*! core/utils */ \"./CTFd/themes/core/assets/js/utils.js\");\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteCorrectSubmission(_event) {\n var key_id = (0, _jquery[\"default\"])(this).data(\"submission-id\");\n var $elem = (0, _jquery[\"default\"])(this).parent().parent();\n var chal_name = $elem.find(\".chal\").text().trim();\n var team_name = $elem.find(\".team\").text().trim();\n var row = (0, _jquery[\"default\"])(this).parent().parent();\n (0, _ezq.ezQuery)({\n title: \"Delete Submission\",\n body: \"Are you sure you want to delete correct submission from {0} for challenge {1}\".format(\"\" + (0, _utils.htmlEntities)(team_name) + \"\", \"\" + (0, _utils.htmlEntities)(chal_name) + \"\"),\n success: function success() {\n _CTFd[\"default\"].api.delete_submission({\n submissionId: key_id\n }).then(function (response) {\n if (response.success) {\n row.remove();\n }\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(_event) {\n var submissionIDs = (0, _jquery[\"default\"])(\"input[data-submission-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"submission-id\");\n });\n var target = submissionIDs.length === 1 ? \"submission\" : \"submissions\";\n (0, _ezq.ezQuery)({\n title: \"Delete Submissions\",\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(submissionIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var subId = _step.value;\n reqs.push(_CTFd[\"default\"].api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\".delete-correct-submission\").click(deleteCorrectSubmission);\n (0, _jquery[\"default\"])(\"#submission-delete-button\").click(deleteSelectedSubmissions);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/submissions.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/submissions.min.js b/CTFd/themes/admin/static/js/pages/submissions.min.js index 28e4d86cd..ad13b9a6b 100644 --- a/CTFd/themes/admin/static/js/pages/submissions.min.js +++ b/CTFd/themes/admin/static/js/pages/submissions.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,i,o=e[0],n=e[1],r=e[2],a=0,s=[];a=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 r,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw r}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i"+(0,d.htmlEntities)(n)+"",""+(0,d.htmlEntities)(o)+""),success:function(){a.default.api.delete_submission({submissionId:t}).then(function(e){e.success&&r.remove()})}})}function l(e){var n=(0,s.default)("input[data-submission-id]:checked").map(function(){return(0,s.default)(this).data("submission-id")}),t=1===n.length?"submission":"submissions";(0,c.ezQuery)({title:"Delete Submissions",body:"Are you sure you want to delete ".concat(n.length," ").concat(t,"?"),success:function(){var e,t=[],i=r(n);try{for(i.s();!(e=i.n()).done;){var o=e.value;t.push(a.default.api.delete_submission({submissionId:o}))}}catch(e){i.e(e)}finally{i.f()}Promise.all(t).then(function(e){window.location.reload()})}})}(0,s.default)(function(){(0,s.default)(".delete-correct-submission").click(n),(0,s.default)("#submission-delete-button").click(l)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=p,t.bindMarkdownEditor=l,t.bindMarkdownEditors=u,t.default=void 0,i("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var o=i("./CTFd/themes/core/assets/js/utils.js"),n=c(i("./node_modules/jquery/dist/jquery.js")),r=c(i("./node_modules/easymde/src/js/easymde.js")),a=c(i("./node_modules/vue/dist/vue.esm.browser.js")),s=c(i("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),d=c(i("./node_modules/highlight.js/lib/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=a.default.extend(s.default),i=document.createElement("div");document.querySelector("main").appendChild(i);var o=new t({propsData:{editor:e}}).$mount(i);(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function l(e){var t;!1===e.hasOwnProperty("mde")&&(t=new r.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){p(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:d.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function u(){(0,n.default)("textarea.markdown").each(function(e,t){l(t)})}t.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,n.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),u(),(0,o.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){d.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=c(i("./CTFd/themes/core/assets/js/fetch.js")),n=c(i("./CTFd/themes/core/assets/js/config.js")),r=i("./CTFd/themes/core/assets/js/api.js");i("./CTFd/themes/core/assets/js/patch.js");var a=c(i("./node_modules/markdown-it/index.js")),s=c(i("./node_modules/jquery/dist/jquery.js")),d=c(i("./CTFd/themes/core/assets/js/ezq.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function l(n){for(var e=1;e".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){r.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,r=!1!==e.animation,a=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:a,animation:r}),o.toast("show"),o}function g(e){var t=a.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){r.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=a.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var r=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,r(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function r(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,a.default)("th.sort-col").click(function(){var n,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,a.default)(this).index(),function(e,t){var i=r(e,n),o=r(t,n);return a.default.isNumeric(i)&&a.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};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 n,r=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return r=e.done,e},e:function(e){a=!0,n=e},f:function(){try{r||null==o.return||o.return()}finally{if(a)throw n}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i"+(0,s.htmlEntities)(i)+"",""+(0,s.htmlEntities)(o)+""),success:function(){r.default.api.delete_submission({submissionId:t}).then(function(e){e.success&&n.remove()})}})}function o(e){var n=(0,a.default)("input[data-submission-id]:checked").map(function(){return(0,a.default)(this).data("submission-id")}),t=1===n.length?"submission":"submissions";(0,d.ezQuery)({title:"Delete Submissions",body:"Are you sure you want to delete ".concat(n.length," ").concat(t,"?"),success:function(){var e,t=[],i=c(n);try{for(i.s();!(e=i.n()).done;){var o=e.value;t.push(r.default.api.delete_submission({submissionId:o}))}}catch(e){i.e(e)}finally{i.f()}Promise.all(t).then(function(e){window.location.reload()})}})}(0,a.default)(function(){(0,a.default)(".delete-correct-submission").click(i),(0,a.default)("#submission-delete-button").click(o)})},"./CTFd/themes/admin/assets/js/styles.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=d,e.bindMarkdownEditors=c,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var i=t("./CTFd/themes/core/assets/js/utils.js"),n=a(t("./node_modules/jquery/dist/jquery.js")),o=a(t("./node_modules/easymde/src/js/easymde.js")),l=a(t("./node_modules/vue/dist/vue.esm.browser.js")),u=a(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),r=a(t("./node_modules/highlight.js/lib/index.js"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=l.default.extend(u.default),i=document.createElement("div"),o=(document.querySelector("main").appendChild(i),new t({propsData:{editor:e}}).$mount(i));(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function d(e){var t;!1===e.hasOwnProperty("mde")&&(t=new o.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:r.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function c(){(0,n.default)("textarea.markdown").each(function(e,t){d(t)})}e.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,n.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),c(),(0,i.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){r.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(t("./CTFd/themes/core/assets/js/fetch.js")),i=n(t("./CTFd/themes/core/assets/js/config.js")),o=t("./CTFd/themes/core/assets/js/api.js"),u=(t("./CTFd/themes/core/assets/js/patch.js"),n(t("./node_modules/markdown-it/index.js"))),f=n(t("./node_modules/jquery/dist/jquery.js")),t=n(t("./CTFd/themes/core/assets/js/ezq.js"));function n(e){return e&&e.__esModule?e:{default:e}}function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(o){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,r.default)(e.body)),(0,r.default)(h.format(e.button)));return e.success&&(0,r.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,r.default)("main").append(t),t.modal("show"),(0,r.default)(t).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),t}function s(e){(0,r.default)("#ezq--notifications-toast-container").length||(0,r.default)("body").append((0,r.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,r.default)(t),i=(e.onclose&&(0,r.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,r.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,r.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=a.format(e.title),t=(0,r.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,r.default)(e.body)),(0,r.default)(v)),o=(0,r.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,r.default)("main").append(t),(0,r.default)(t).on("hidden.bs.modal",function(){(0,r.default)(this).modal("dispose")}),(0,r.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,r.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=a.format(e.title),e=(0,r.default)(e);return e.find(".modal-body").append((0,r.default)(t)),(0,r.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,r.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(a)||0;n.setItem(a,++e),(0,r.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(a);null===e?n.setItem(a,0):0'),(0,r.default)("th.sort-col").click(function(){var i,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,r.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return r.default.isNumeric(e)&&r.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction createTeam(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#team-info-create-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n }\n\n _CTFd[\"default\"].fetch(\"/api/v1/teams\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var team_id = response.data.id;\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/teams/\" + team_id;\n } else {\n (0, _jquery[\"default\"])(\"#team-info-create-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#team-info-create-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#team-info-create-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction updateTeam(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#team-info-edit-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n }\n\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#team-info-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#team-info-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#team-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(event, target) {\n var submissions;\n var type;\n var title;\n\n switch (target) {\n case \"solves\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=correct]:checked\");\n type = \"solve\";\n title = \"Solves\";\n break;\n\n case \"fails\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=incorrect]:checked\");\n type = \"fail\";\n title = \"Fails\";\n break;\n\n default:\n break;\n }\n\n var submissionIDs = submissions.map(function () {\n return (0, _jquery[\"default\"])(this).data(\"submission-id\");\n });\n var target_string = submissionIDs.length === 1 ? type : type + \"s\";\n (0, _ezq.ezQuery)({\n title: \"Delete \".concat(title),\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target_string, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(submissionIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var subId = _step.value;\n reqs.push(_CTFd[\"default\"].api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction deleteSelectedAwards(_event) {\n var awardIDs = (0, _jquery[\"default\"])(\"input[data-award-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"award-id\");\n });\n var target = awardIDs.length === 1 ? \"award\" : \"awards\";\n (0, _ezq.ezQuery)({\n title: \"Delete Awards\",\n body: \"Are you sure you want to delete \".concat(awardIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(awardIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var awardID = _step2.value;\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/awards/\" + awardID, {\n method: \"DELETE\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction solveSelectedMissingChallenges(event) {\n event.preventDefault();\n var challengeIDs = (0, _jquery[\"default\"])(\"input[data-missing-challenge-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"missing-challenge-id\");\n });\n var target = challengeIDs.length === 1 ? \"challenge\" : \"challenges\";\n (0, _ezq.ezQuery)({\n title: \"Mark Correct\",\n body: \"Are you sure you want to mark \".concat(challengeIDs.length, \" \").concat(target, \" correct for \").concat((0, _utils.htmlEntities)(window.TEAM_NAME), \"?\"),\n success: function success() {\n (0, _ezq.ezAlert)({\n title: \"User Attribution\",\n body: \"\\n Which user on \".concat((0, _utils.htmlEntities)(window.TEAM_NAME), \" solved these challenges?\\n
\\n \").concat((0, _jquery[\"default\"])(\"#team-member-select\").html(), \"\\n
\\n \"),\n button: \"Mark Correct\",\n success: function success() {\n var USER_ID = (0, _jquery[\"default\"])(\"#query-team-member-solve > select\").val();\n var reqs = [];\n\n var _iterator3 = _createForOfIteratorHelper(challengeIDs),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var challengeID = _step3.value;\n var params = {\n provided: \"MARKED AS SOLVED BY ADMIN\",\n user_id: USER_ID,\n team_id: window.TEAM_ID,\n challenge_id: challengeID,\n type: \"correct\"\n };\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/submissions\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n }\n });\n}\n\nvar api_funcs = {\n team: [function (x) {\n return _CTFd[\"default\"].api.get_team_solves({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_fails({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_awards({\n teamId: x\n });\n }],\n user: [function (x) {\n return _CTFd[\"default\"].api.get_user_solves({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_fails({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_awards({\n userId: x\n });\n }]\n};\n\nvar createGraphs = function createGraphs(type, id, name, account_id) {\n var _api_funcs$type = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type[0],\n fails_func = _api_funcs$type[1],\n awards_func = _api_funcs$type[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.createGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\nvar updateGraphs = function updateGraphs(type, id, name, account_id) {\n var _api_funcs$type2 = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type2[0],\n fails_func = _api_funcs$type2[1],\n awards_func = _api_funcs$type2[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.updateGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#team-captain-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#team-captain-form\").serializeJSON(true);\n\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#team-captain-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#team-captain-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#team-captain-form\").find(\"select[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\".edit-team\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-info-edit-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".invite-team\").click(function (_e) {\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\".concat(window.TEAM_ID, \"/members\"), {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var code = response.data.code;\n var url = \"\".concat(window.location.origin).concat(_CTFd[\"default\"].config.urlRoot, \"/teams/invite?code=\").concat(code);\n (0, _jquery[\"default\"])(\"#team-invite-modal input[name=link]\").val(url);\n (0, _jquery[\"default\"])(\"#team-invite-modal\").modal(\"toggle\");\n }\n });\n });\n (0, _jquery[\"default\"])(\"#team-invite-link-copy\").click(function (e) {\n (0, _utils2.copyToClipboard)(e, \"#team-invite-link\");\n });\n (0, _jquery[\"default\"])(\".members-team\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-add-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".edit-captain\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-captain-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".award-team\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-award-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".addresses-team\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#team-addresses-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\"#user-award-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-award-form\").serializeJSON(true);\n params[\"user_id\"] = (0, _jquery[\"default\"])(\"#award-member-input\").val();\n params[\"team_id\"] = window.TEAM_ID;\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").empty();\n\n if (!params[\"user_id\"]) {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: \"Please select a team member\"\n }));\n return;\n }\n\n params[\"user_id\"] = parseInt(params[\"user_id\"]);\n\n _CTFd[\"default\"].fetch(\"/api/v1/awards\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-award-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\".delete-member\").click(function (e) {\n e.preventDefault();\n var member_id = (0, _jquery[\"default\"])(this).attr(\"member-id\");\n var member_name = (0, _jquery[\"default\"])(this).attr(\"member-name\");\n var params = {\n user_id: member_id\n };\n var row = (0, _jquery[\"default\"])(this).parent().parent();\n (0, _ezq.ezQuery)({\n title: \"Remove Member\",\n body: \"Are you sure you want to remove {0} from {1}?

All of their challenge solves, attempts, awards, and unlocked hints will also be deleted!\".format(\"\" + (0, _utils.htmlEntities)(member_name) + \"\", \"\" + (0, _utils.htmlEntities)(window.TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID + \"/members\", {\n method: \"DELETE\",\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n row.remove();\n }\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\".delete-team\").click(function (_e) {\n (0, _ezq.ezQuery)({\n title: \"Delete Team\",\n body: \"Are you sure you want to delete {0}\".format(\"\" + (0, _utils.htmlEntities)(window.TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID, {\n method: \"DELETE\"\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/teams\";\n }\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\"#solves-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"solves\");\n });\n (0, _jquery[\"default\"])(\"#fails-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"fails\");\n });\n (0, _jquery[\"default\"])(\"#awards-delete-button\").click(function (e) {\n deleteSelectedAwards(e);\n });\n (0, _jquery[\"default\"])(\"#missing-solve-button\").click(function (e) {\n solveSelectedMissingChallenges(e);\n });\n (0, _jquery[\"default\"])(\"#team-info-create-form\").submit(createTeam);\n (0, _jquery[\"default\"])(\"#team-info-edit-form\").submit(updateTeam); // Insert CommentBox element\n\n var commentBox = _vueEsm[\"default\"].extend(_CommentBox[\"default\"]);\n\n var vueContainer = document.createElement(\"div\");\n document.querySelector(\"#comment-box\").appendChild(vueContainer);\n new commentBox({\n propsData: {\n type: \"team\",\n id: window.TEAM_ID\n }\n }).$mount(vueContainer); // Insert team member addition form\n\n var userAddForm = _vueEsm[\"default\"].extend(_UserAddForm[\"default\"]);\n\n var memberFormContainer = document.createElement(\"div\");\n document.querySelector(\"#team-add-modal .modal-body\").appendChild(memberFormContainer);\n new userAddForm({\n propsData: {\n team_id: window.TEAM_ID\n }\n }).$mount(memberFormContainer);\n var type, id, name, account_id;\n var _window$stats_data = window.stats_data;\n type = _window$stats_data.type;\n id = _window$stats_data.id;\n name = _window$stats_data.name;\n account_id = _window$stats_data.account_id;\n var intervalId;\n (0, _jquery[\"default\"])(\"#team-statistics-modal\").on(\"shown.bs.modal\", function (_e) {\n createGraphs(type, id, name, account_id);\n intervalId = setInterval(function () {\n updateGraphs(type, id, name, account_id);\n }, 300000);\n });\n (0, _jquery[\"default\"])(\"#team-statistics-modal\").on(\"hidden.bs.modal\", function (_e) {\n clearInterval(intervalId);\n });\n (0, _jquery[\"default\"])(\".statistics-team\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#team-statistics-modal\").modal(\"toggle\");\n });\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/team.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _utils = __webpack_require__(/*! core/utils */ \"./CTFd/themes/core/assets/js/utils.js\");\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nvar _graphs = __webpack_require__(/*! core/graphs */ \"./CTFd/themes/core/assets/js/graphs.js\");\n\nvar _vueEsm = _interopRequireDefault(__webpack_require__(/*! vue/dist/vue.esm.browser */ \"./node_modules/vue/dist/vue.esm.browser.js\"));\n\nvar _CommentBox = _interopRequireDefault(__webpack_require__(/*! ../components/comments/CommentBox.vue */ \"./CTFd/themes/admin/assets/js/components/comments/CommentBox.vue\"));\n\nvar _UserAddForm = _interopRequireDefault(__webpack_require__(/*! ../components/teams/UserAddForm.vue */ \"./CTFd/themes/admin/assets/js/components/teams/UserAddForm.vue\"));\n\nvar _utils2 = __webpack_require__(/*! ../../../../core/assets/js/utils */ \"./CTFd/themes/core/assets/js/utils.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction createTeam(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#team-info-create-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n }\n\n _CTFd[\"default\"].fetch(\"/api/v1/teams\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var team_id = response.data.id;\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/teams/\" + team_id;\n } else {\n (0, _jquery[\"default\"])(\"#team-info-create-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#team-info-create-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#team-info-create-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction updateTeam(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#team-info-edit-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n }\n\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#team-info-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#team-info-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#team-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(event, target) {\n var submissions;\n var type;\n var title;\n\n switch (target) {\n case \"solves\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=correct]:checked\");\n type = \"solve\";\n title = \"Solves\";\n break;\n\n case \"fails\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=incorrect]:checked\");\n type = \"fail\";\n title = \"Fails\";\n break;\n\n default:\n break;\n }\n\n var submissionIDs = submissions.map(function () {\n return (0, _jquery[\"default\"])(this).data(\"submission-id\");\n });\n var target_string = submissionIDs.length === 1 ? type : type + \"s\";\n (0, _ezq.ezQuery)({\n title: \"Delete \".concat(title),\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target_string, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(submissionIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var subId = _step.value;\n reqs.push(_CTFd[\"default\"].api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction deleteSelectedAwards(_event) {\n var awardIDs = (0, _jquery[\"default\"])(\"input[data-award-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"award-id\");\n });\n var target = awardIDs.length === 1 ? \"award\" : \"awards\";\n (0, _ezq.ezQuery)({\n title: \"Delete Awards\",\n body: \"Are you sure you want to delete \".concat(awardIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(awardIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var awardID = _step2.value;\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/awards/\" + awardID, {\n method: \"DELETE\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction solveSelectedMissingChallenges(event) {\n event.preventDefault();\n var challengeIDs = (0, _jquery[\"default\"])(\"input[data-missing-challenge-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"missing-challenge-id\");\n });\n var target = challengeIDs.length === 1 ? \"challenge\" : \"challenges\";\n (0, _ezq.ezQuery)({\n title: \"Mark Correct\",\n body: \"Are you sure you want to mark \".concat(challengeIDs.length, \" \").concat(target, \" correct for \").concat((0, _utils.htmlEntities)(window.TEAM_NAME), \"?\"),\n success: function success() {\n (0, _ezq.ezAlert)({\n title: \"User Attribution\",\n body: \"\\n Which user on \".concat((0, _utils.htmlEntities)(window.TEAM_NAME), \" solved these challenges?\\n
\\n \").concat((0, _jquery[\"default\"])(\"#team-member-select\").html(), \"\\n
\\n \"),\n button: \"Mark Correct\",\n success: function success() {\n var USER_ID = (0, _jquery[\"default\"])(\"#query-team-member-solve > select\").val();\n var reqs = [];\n\n var _iterator3 = _createForOfIteratorHelper(challengeIDs),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var challengeID = _step3.value;\n var params = {\n provided: \"MARKED AS SOLVED BY ADMIN\",\n user_id: USER_ID,\n team_id: window.TEAM_ID,\n challenge_id: challengeID,\n type: \"correct\"\n };\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/submissions\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n }\n });\n}\n\nvar api_funcs = {\n team: [function (x) {\n return _CTFd[\"default\"].api.get_team_solves({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_fails({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_awards({\n teamId: x\n });\n }],\n user: [function (x) {\n return _CTFd[\"default\"].api.get_user_solves({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_fails({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_awards({\n userId: x\n });\n }]\n};\n\nvar createGraphs = function createGraphs(type, id, name, account_id) {\n var _api_funcs$type = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type[0],\n fails_func = _api_funcs$type[1],\n awards_func = _api_funcs$type[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.createGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\nvar updateGraphs = function updateGraphs(type, id, name, account_id) {\n var _api_funcs$type2 = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type2[0],\n fails_func = _api_funcs$type2[1],\n awards_func = _api_funcs$type2[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.updateGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#team-captain-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#team-captain-form\").serializeJSON(true);\n\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#team-captain-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#team-captain-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#team-captain-form\").find(\"select[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\".edit-team\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-info-edit-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".invite-team\").click(function (_e) {\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\".concat(window.TEAM_ID, \"/members\"), {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var code = response.data.code;\n var url = \"\".concat(window.location.origin).concat(_CTFd[\"default\"].config.urlRoot, \"/teams/invite?code=\").concat(code);\n (0, _jquery[\"default\"])(\"#team-invite-modal input[name=link]\").val(url);\n (0, _jquery[\"default\"])(\"#team-invite-modal\").modal(\"toggle\");\n }\n });\n });\n (0, _jquery[\"default\"])(\"#team-invite-link-copy\").click(function (e) {\n (0, _utils2.copyToClipboard)(e, \"#team-invite-link\");\n });\n (0, _jquery[\"default\"])(\".members-team\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-add-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".edit-captain\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-captain-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".award-team\").click(function (_e) {\n (0, _jquery[\"default\"])(\"#team-award-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".addresses-team\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#team-addresses-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\"#user-award-form\").submit(function (e) {\n e.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-award-form\").serializeJSON(true);\n params[\"user_id\"] = (0, _jquery[\"default\"])(\"#award-member-input\").val();\n params[\"team_id\"] = window.TEAM_ID;\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").empty();\n\n if (!params[\"user_id\"]) {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: \"Please select a team member\"\n }));\n return;\n }\n\n params[\"user_id\"] = parseInt(params[\"user_id\"]);\n\n _CTFd[\"default\"].fetch(\"/api/v1/awards\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-award-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\".delete-member\").click(function (e) {\n e.preventDefault();\n var member_id = (0, _jquery[\"default\"])(this).attr(\"member-id\");\n var member_name = (0, _jquery[\"default\"])(this).attr(\"member-name\");\n var params = {\n user_id: member_id\n };\n var row = (0, _jquery[\"default\"])(this).parent().parent();\n (0, _ezq.ezQuery)({\n title: \"Remove Member\",\n body: \"Are you sure you want to remove {0} from {1}?

All of their challenge solves, attempts, awards, and unlocked hints will also be deleted!\".format(\"\" + (0, _utils.htmlEntities)(member_name) + \"\", \"\" + (0, _utils.htmlEntities)(window.TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID + \"/members\", {\n method: \"DELETE\",\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n row.remove();\n }\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\".delete-team\").click(function (_e) {\n (0, _ezq.ezQuery)({\n title: \"Delete Team\",\n body: \"Are you sure you want to delete {0}\".format(\"\" + (0, _utils.htmlEntities)(window.TEAM_NAME) + \"\"),\n success: function success() {\n _CTFd[\"default\"].fetch(\"/api/v1/teams/\" + window.TEAM_ID, {\n method: \"DELETE\"\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/teams\";\n }\n });\n }\n });\n });\n (0, _jquery[\"default\"])(\"#solves-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"solves\");\n });\n (0, _jquery[\"default\"])(\"#fails-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"fails\");\n });\n (0, _jquery[\"default\"])(\"#awards-delete-button\").click(function (e) {\n deleteSelectedAwards(e);\n });\n (0, _jquery[\"default\"])(\"#missing-solve-button\").click(function (e) {\n solveSelectedMissingChallenges(e);\n });\n (0, _jquery[\"default\"])(\"#team-info-create-form\").submit(createTeam);\n (0, _jquery[\"default\"])(\"#team-info-edit-form\").submit(updateTeam); // Insert CommentBox element\n\n var commentBox = _vueEsm[\"default\"].extend(_CommentBox[\"default\"]);\n\n var vueContainer = document.createElement(\"div\");\n document.querySelector(\"#comment-box\").appendChild(vueContainer);\n new commentBox({\n propsData: {\n type: \"team\",\n id: window.TEAM_ID\n }\n }).$mount(vueContainer); // Insert team member addition form\n\n var userAddForm = _vueEsm[\"default\"].extend(_UserAddForm[\"default\"]);\n\n var memberFormContainer = document.createElement(\"div\");\n document.querySelector(\"#team-add-modal .modal-body\").appendChild(memberFormContainer);\n new userAddForm({\n propsData: {\n team_id: window.TEAM_ID\n }\n }).$mount(memberFormContainer);\n var type, id, name, account_id;\n var _window$stats_data = window.stats_data;\n type = _window$stats_data.type;\n id = _window$stats_data.id;\n name = _window$stats_data.name;\n account_id = _window$stats_data.account_id;\n var intervalId;\n (0, _jquery[\"default\"])(\"#team-statistics-modal\").on(\"shown.bs.modal\", function (_e) {\n createGraphs(type, id, name, account_id);\n intervalId = setInterval(function () {\n updateGraphs(type, id, name, account_id);\n }, 300000);\n });\n (0, _jquery[\"default\"])(\"#team-statistics-modal\").on(\"hidden.bs.modal\", function (_e) {\n clearInterval(intervalId);\n });\n (0, _jquery[\"default\"])(\".statistics-team\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#team-statistics-modal\").modal(\"toggle\");\n });\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/team.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/team.min.js b/CTFd/themes/admin/static/js/pages/team.min.js index 219acabea..8db12aada 100644 --- a/CTFd/themes/admin/static/js/pages/team.min.js +++ b/CTFd/themes/admin/static/js/pages/team.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,o,n=e[0],i=e[1],a=e[2],r=0,s=[];r=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==o.return||o.return()}finally{if(s)throw a}}}}function c(e,t){if(e){if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o #results").empty(),Object.keys(i.errors).forEach(function(e,t){(0,d.default)("#team-info-create-form > #results").append((0,h.ezBadge)({type:"error",body:i.errors[e]}));var o=(0,d.default)("#team-info-create-form").find("input[name={0}]".format(e)),n=(0,d.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function T(e){e.preventDefault();var t,o,n,i=(0,d.default)("#team-info-edit-form").serializeJSON(!0);for(t in i.fields=[],i){t.match(/fields\[\d+\]/)&&(o={},n=parseInt(t.slice(7,-1)),o.field_id=n,o.value=i[t],i.fields.push(o),delete i[t])}m.default.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}).then(function(e){return e.json()}).then(function(i){i.success?window.location.reload():((0,d.default)("#team-info-form > #results").empty(),Object.keys(i.errors).forEach(function(e,t){(0,d.default)("#team-info-form > #results").append((0,h.ezBadge)({type:"error",body:i.errors[e]}));var o=(0,d.default)("#team-info-form").find("input[name={0}]".format(e)),n=(0,d.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}function w(e,t){var o,n,i;switch(t){case"solves":o=(0,d.default)("input[data-submission-type=correct]:checked"),n="solve",i="Solves";break;case"fails":o=(0,d.default)("input[data-submission-type=incorrect]:checked"),n="fail",i="Fails"}var a=o.map(function(){return(0,d.default)(this).data("submission-id")}),r=1===a.length?n:n+"s";(0,h.ezQuery)({title:"Delete ".concat(i),body:"Are you sure you want to delete ".concat(a.length," ").concat(r,"?"),success:function(){var e,t=[],o=_(a);try{for(o.s();!(e=o.n()).done;){var n=e.value;t.push(m.default.api.delete_submission({submissionId:n}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}var C={team:[function(e){return m.default.api.get_team_solves({teamId:e})},function(e){return m.default.api.get_team_fails({teamId:e})},function(e){return m.default.api.get_team_awards({teamId:e})}],user:[function(e){return m.default.api.get_user_solves({userId:e})},function(e){return m.default.api.get_user_fails({userId:e})},function(e){return m.default.api.get_user_awards({userId:e})}]};(0,d.default)(function(){(0,d.default)("#team-captain-form").submit(function(e){e.preventDefault();var t=(0,d.default)("#team-captain-form").serializeJSON(!0);m.default.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(i){i.success?window.location.reload():((0,d.default)("#team-captain-form > #results").empty(),Object.keys(i.errors).forEach(function(e,t){(0,d.default)("#team-captain-form > #results").append((0,h.ezBadge)({type:"error",body:i.errors[e]}));var o=(0,d.default)("#team-captain-form").find("select[name={0}]".format(e)),n=(0,d.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})}),(0,d.default)(".edit-team").click(function(e){(0,d.default)("#team-info-edit-modal").modal("toggle")}),(0,d.default)(".invite-team").click(function(e){m.default.fetch("/api/v1/teams/".concat(window.TEAM_ID,"/members"),{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(e){return e.json()}).then(function(e){var t,o;e.success&&(t=e.data.code,o="".concat(window.location.origin).concat(m.default.config.urlRoot,"/teams/invite?code=").concat(t),(0,d.default)("#team-invite-modal input[name=link]").val(o),(0,d.default)("#team-invite-modal").modal("toggle"))})}),(0,d.default)("#team-invite-link-copy").click(function(e){(0,y.copyToClipboard)(e,"#team-invite-link")}),(0,d.default)(".members-team").click(function(e){(0,d.default)("#team-add-modal").modal("toggle")}),(0,d.default)(".edit-captain").click(function(e){(0,d.default)("#team-captain-modal").modal("toggle")}),(0,d.default)(".award-team").click(function(e){(0,d.default)("#team-award-modal").modal("toggle")}),(0,d.default)(".addresses-team").click(function(e){(0,d.default)("#team-addresses-modal").modal("toggle")}),(0,d.default)("#user-award-form").submit(function(e){e.preventDefault();var t=(0,d.default)("#user-award-form").serializeJSON(!0);t.user_id=(0,d.default)("#award-member-input").val(),t.team_id=window.TEAM_ID,(0,d.default)("#user-award-form > #results").empty(),t.user_id?(t.user_id=parseInt(t.user_id),m.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(i){i.success?window.location.reload():((0,d.default)("#user-award-form > #results").empty(),Object.keys(i.errors).forEach(function(e,t){(0,d.default)("#user-award-form > #results").append((0,h.ezBadge)({type:"error",body:i.errors[e]}));var o=(0,d.default)("#user-award-form").find("input[name={0}]".format(e)),n=(0,d.default)(o);n.addClass("input-filled-invalid"),n.removeClass("input-filled-valid")}))})):(0,d.default)("#user-award-form > #results").append((0,h.ezBadge)({type:"error",body:"Please select a team member"}))}),(0,d.default)(".delete-member").click(function(e){e.preventDefault();var t=(0,d.default)(this).attr("member-id"),o=(0,d.default)(this).attr("member-name"),n={user_id:t},i=(0,d.default)(this).parent().parent();(0,h.ezQuery)({title:"Remove Member",body:"Are you sure you want to remove {0} from {1}?

All of their challenge solves, attempts, awards, and unlocked hints will also be deleted!".format(""+(0,a.htmlEntities)(o)+"",""+(0,a.htmlEntities)(window.TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+window.TEAM_ID+"/members",{method:"DELETE",body:JSON.stringify(n)}).then(function(e){return e.json()}).then(function(e){e.success&&i.remove()})}})}),(0,d.default)(".delete-team").click(function(e){(0,h.ezQuery)({title:"Delete Team",body:"Are you sure you want to delete {0}".format(""+(0,a.htmlEntities)(window.TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=m.default.config.urlRoot+"/admin/teams")})}})}),(0,d.default)("#solves-delete-button").click(function(e){w(0,"solves")}),(0,d.default)("#fails-delete-button").click(function(e){w(0,"fails")}),(0,d.default)("#awards-delete-button").click(function(e){var a,t;a=(0,d.default)("input[data-award-id]:checked").map(function(){return(0,d.default)(this).data("award-id")}),t=1===a.length?"award":"awards",(0,h.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(a.length," ").concat(t,"?"),success:function(){var e,t=[],o=_(a);try{for(o.s();!(e=o.n()).done;){var n=e.value,i=m.default.fetch("/api/v1/awards/"+n,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});t.push(i)}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}),(0,d.default)("#missing-solve-button").click(function(e){!function(e){e.preventDefault();var s=(0,d.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,d.default)(this).data("missing-challenge-id")}),t=1===s.length?"challenge":"challenges";(0,h.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(s.length," ").concat(t," correct for ").concat((0,a.htmlEntities)(window.TEAM_NAME),"?"),success:function(){(0,h.ezAlert)({title:"User Attribution",body:"\n Which user on ".concat((0,a.htmlEntities)(window.TEAM_NAME),' solved these challenges?\n
\n ').concat((0,d.default)("#team-member-select").html(),"\n
\n "),button:"Mark Correct",success:function(){var e,t=(0,d.default)("#query-team-member-solve > select").val(),o=[],n=_(s);try{for(n.s();!(e=n.n()).done;){var i=e.value,a={provided:"MARKED AS SOLVED BY ADMIN",user_id:t,team_id:window.TEAM_ID,challenge_id:i,type:"correct"},r=m.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)});o.push(r)}}catch(e){n.e(e)}finally{n.f()}Promise.all(o).then(function(e){window.location.reload()})}})}})}(e)}),(0,d.default)("#team-info-create-form").submit(b),(0,d.default)("#team-info-edit-form").submit(T);var e=r.default.extend(s.default),t=document.createElement("div");document.querySelector("#comment-box").appendChild(t),new e({propsData:{type:"team",id:window.TEAM_ID}}).$mount(t);var o=r.default.extend(v.default),n=document.createElement("div");document.querySelector("#team-add-modal .modal-body").appendChild(n),new o({propsData:{team_id:window.TEAM_ID}}).$mount(n);var c,i=window.stats_data,l=i.type,u=i.id,p=i.name,f=i.account_id;(0,d.default)("#team-statistics-modal").on("shown.bs.modal",function(e){var t,o,n,i,a,r,s,d;o=u,n=p,i=f,a=j(C[t=l],3),r=a[0],s=a[1],d=a[2],Promise.all([r(i),s(i),d(i)]).then(function(e){(0,g.createGraph)("score_graph","#score-graph",e,t,o,n,i),(0,g.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,i),(0,g.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,i)}),c=setInterval(function(){var t,o,n,i,e,a,r,s;o=u,n=p,i=f,e=j(C[t=l],3),a=e[0],r=e[1],s=e[2],Promise.all([a(i),r(i),s(i)]).then(function(e){(0,g.updateGraph)("score_graph","#score-graph",e,t,o,n,i),(0,g.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,i),(0,g.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,i)})},3e5)}),(0,d.default)("#team-statistics-modal").on("hidden.bs.modal",function(e){clearInterval(c)}),(0,d.default)(".statistics-team").click(function(e){(0,d.default)("#team-statistics-modal").modal("toggle")})})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=l,t.bindMarkdownEditor=u,t.bindMarkdownEditors=p,t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var n=o("./CTFd/themes/core/assets/js/utils.js"),i=c(o("./node_modules/jquery/dist/jquery.js")),a=c(o("./node_modules/easymde/src/js/easymde.js")),r=c(o("./node_modules/vue/dist/vue.esm.browser.js")),s=c(o("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),d=c(o("./node_modules/highlight.js/lib/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=r.default.extend(s.default),o=document.createElement("div");document.querySelector("main").appendChild(o);var n=new t({propsData:{editor:e}}).$mount(o);(0,i.default)("#media-modal").on("hidden.bs.modal",function(e){n.$destroy(),(0,i.default)("#media-modal").remove()}),(0,i.default)("#media-modal").modal()}function u(e){var t;!1===e.hasOwnProperty("mde")&&(t=new a.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){l(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,i.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:d.default}}),e.mde=t,e.codemirror=t.codemirror,(0,i.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,i.default)(e).val()),t.codemirror.refresh()}))}function p(){(0,i.default)("textarea.markdown").each(function(e,t){u(t)})}t.default=function(){(0,i.default)(":input").each(function(){(0,i.default)(this).data("initial",(0,i.default)(this).val())}),(0,i.default)(function(){(0,i.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,i.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,i.default)("[data-checkbox]").click(function(e){(0,i.default)(e.target).is("input[type=checkbox]")||(0,i.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,i.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,i.default)(this).prop("checked"),o=(0,i.default)(this).index()+1;(0,i.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,i.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,i.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,i.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,i.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,i.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,i.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),p(),(0,n.makeSortableTables)(),(0,i.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){d.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=c(o("./CTFd/themes/core/assets/js/fetch.js")),i=c(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var r=c(o("./node_modules/markdown-it/index.js")),s=c(o("./node_modules/jquery/dist/jquery.js")),d=c(o("./CTFd/themes/core/assets/js/ezq.js"));function c(e){return e&&e.__esModule?e:{default:e}}function l(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function u(i){for(var e=1;e".concat(e.body,"

")):o.find(".modal-body").append((0,s.default)(e.body));var n=(0,s.default)(u.format(e.button));return e.success&&(0,s.default)(n).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(n),o.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(o),o.modal("show"),(0,s.default)(o).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),o}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,o=d.format(e.title,e.body),n=(0,s.default)(o);e.onclose&&(0,s.default)(n).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(n).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var i=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(n),n.toast({autohide:i,delay:r,animation:a}),n.toast("show"),n}function g(e){var t=r.format(e.title),o=(0,s.default)(t);"string"==typeof e.body?o.find(".modal-body").append("

".concat(e.body,"

")):o.find(".modal-body").append((0,s.default)(e.body));var n=(0,s.default)(f),i=(0,s.default)(p);return o.find(".modal-footer").append(i),o.find(".modal-footer").append(n),o.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(o),(0,s.default)(o).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(n).click(function(){e.success()}),o.modal("show"),o}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=c.format(e.width),n=r.format(e.title),i=(0,s.default)(n);return i.find(".modal-body").append((0,s.default)(o)),(0,s.default)("main").append(i),i.modal("show")}function y(e){var t={success:l,error:i}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n,i=(n=o("./CTFd/themes/core/assets/js/config.js"))&&n.__esModule?n:{default:n};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=i.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=i.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,n,i,a,r){var s=u[e],d=l.default.init(document.querySelector(t));d.setOption(s.format(n,i,a,r,o)),(0,c.default)(window).on("resize",function(){null!=d&&null!=d&&d.resize()})},t.updateGraph=function(e,t,o,n,i,a,r){var s=u[e];l.default.init(document.querySelector(t)).setOption(s.format(n,i,a,r,o))},t.disposeGraph=function(e){l.default.dispose(document.querySelector(e))};var c=n(o("./node_modules/jquery/dist/jquery.js")),l=n(o("./node_modules/echarts/dist/echarts-en.common.js")),f=n(o("./node_modules/dayjs/dayjs.min.js")),m=o("./CTFd/themes/core/assets/js/utils.js");function n(e){return e&&e.__esModule?e:{default:e}}var u={score_graph:{format:function(e,t,o,n,i){var a={title:{left:"center",text:"Score over Time"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]},r=[],s=[],d=i[0].data,c=i[2].data,l=d.concat(c);l.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var u=0;u").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,r.default)("th.sort-col").click(function(){var i,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,r.default)(this).index(),function(e,t){var o=a(e,i),n=a(t,i);return r.default.isNumeric(o)&&r.default.isNumeric(n)?o-n:o.toString().localeCompare(n)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};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,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){r=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(r)throw i}}}}function d(e,t){if(e){if("string"==typeof e)return c(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(o="Object"===o&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,f.default)("#team-info-create-form > #results").append((0,r.ezBadge)({type:"error",body:o.errors[e]}));e=(0,f.default)("#team-info-create-form").find("input[name={0}]".format(e)),e=(0,f.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}function b(e){e.preventDefault();var t,o,n,i=(0,f.default)("#team-info-edit-form").serializeJSON(!0);for(t in i.fields=[],i)t.match(/fields\[\d+\]/)&&(o={},n=parseInt(t.slice(7,-1)),o.field_id=n,o.value=i[t],i.fields.push(o),delete i[t]);m.default.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)}).then(function(e){return e.json()}).then(function(o){o.success?window.location.reload():((0,f.default)("#team-info-form > #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,f.default)("#team-info-form > #results").append((0,r.ezBadge)({type:"error",body:o.errors[e]}));e=(0,f.default)("#team-info-form").find("input[name={0}]".format(e)),e=(0,f.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}function T(e,t){var o,n,i;switch(t){case"solves":o=(0,f.default)("input[data-submission-type=correct]:checked"),n="solve",i="Solves";break;case"fails":o=(0,f.default)("input[data-submission-type=incorrect]:checked"),n="fail",i="Fails"}var a=o.map(function(){return(0,f.default)(this).data("submission-id")}),t=1===a.length?n:n+"s";(0,r.ezQuery)({title:"Delete ".concat(i),body:"Are you sure you want to delete ".concat(a.length," ").concat(t,"?"),success:function(){var e,t=[],o=v(a);try{for(o.s();!(e=o.n()).done;){var n=e.value;t.push(m.default.api.delete_submission({submissionId:n}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}var w={team:[function(e){return m.default.api.get_team_solves({teamId:e})},function(e){return m.default.api.get_team_fails({teamId:e})},function(e){return m.default.api.get_team_awards({teamId:e})}],user:[function(e){return m.default.api.get_user_solves({userId:e})},function(e){return m.default.api.get_user_fails({userId:e})},function(e){return m.default.api.get_user_awards({userId:e})}]};(0,f.default)(function(){(0,f.default)("#team-captain-form").submit(function(e){e.preventDefault();e=(0,f.default)("#team-captain-form").serializeJSON(!0);m.default.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()}).then(function(o){o.success?window.location.reload():((0,f.default)("#team-captain-form > #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,f.default)("#team-captain-form > #results").append((0,r.ezBadge)({type:"error",body:o.errors[e]}));e=(0,f.default)("#team-captain-form").find("select[name={0}]".format(e)),e=(0,f.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}),(0,f.default)(".edit-team").click(function(e){(0,f.default)("#team-info-edit-modal").modal("toggle")}),(0,f.default)(".invite-team").click(function(e){m.default.fetch("/api/v1/teams/".concat(window.TEAM_ID,"/members"),{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(e){return e.json()}).then(function(e){e.success&&(e=e.data.code,e="".concat(window.location.origin).concat(m.default.config.urlRoot,"/teams/invite?code=").concat(e),(0,f.default)("#team-invite-modal input[name=link]").val(e),(0,f.default)("#team-invite-modal").modal("toggle"))})}),(0,f.default)("#team-invite-link-copy").click(function(e){(0,j.copyToClipboard)(e,"#team-invite-link")}),(0,f.default)(".members-team").click(function(e){(0,f.default)("#team-add-modal").modal("toggle")}),(0,f.default)(".edit-captain").click(function(e){(0,f.default)("#team-captain-modal").modal("toggle")}),(0,f.default)(".award-team").click(function(e){(0,f.default)("#team-award-modal").modal("toggle")}),(0,f.default)(".addresses-team").click(function(e){(0,f.default)("#team-addresses-modal").modal("toggle")}),(0,f.default)("#user-award-form").submit(function(e){e.preventDefault();e=(0,f.default)("#user-award-form").serializeJSON(!0);e.user_id=(0,f.default)("#award-member-input").val(),e.team_id=window.TEAM_ID,(0,f.default)("#user-award-form > #results").empty(),e.user_id?(e.user_id=parseInt(e.user_id),m.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()}).then(function(o){o.success?window.location.reload():((0,f.default)("#user-award-form > #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,f.default)("#user-award-form > #results").append((0,r.ezBadge)({type:"error",body:o.errors[e]}));e=(0,f.default)("#user-award-form").find("input[name={0}]".format(e)),e=(0,f.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})):(0,f.default)("#user-award-form > #results").append((0,r.ezBadge)({type:"error",body:"Please select a team member"}))}),(0,f.default)(".delete-member").click(function(e){e.preventDefault();var e=(0,f.default)(this).attr("member-id"),t=(0,f.default)(this).attr("member-name"),o={user_id:e},n=(0,f.default)(this).parent().parent();(0,r.ezQuery)({title:"Remove Member",body:"Are you sure you want to remove {0} from {1}?

All of their challenge solves, attempts, awards, and unlocked hints will also be deleted!".format(""+(0,i.htmlEntities)(t)+"",""+(0,i.htmlEntities)(window.TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+window.TEAM_ID+"/members",{method:"DELETE",body:JSON.stringify(o)}).then(function(e){return e.json()}).then(function(e){e.success&&n.remove()})}})}),(0,f.default)(".delete-team").click(function(e){(0,r.ezQuery)({title:"Delete Team",body:"Are you sure you want to delete {0}".format(""+(0,i.htmlEntities)(window.TEAM_NAME)+""),success:function(){m.default.fetch("/api/v1/teams/"+window.TEAM_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=m.default.config.urlRoot+"/admin/teams")})}})}),(0,f.default)("#solves-delete-button").click(function(e){T(0,"solves")}),(0,f.default)("#fails-delete-button").click(function(e){T(0,"fails")}),(0,f.default)("#awards-delete-button").click(function(e){var a,t;a=(0,f.default)("input[data-award-id]:checked").map(function(){return(0,f.default)(this).data("award-id")}),t=1===a.length?"award":"awards",(0,r.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(a.length," ").concat(t,"?"),success:function(){var e,t=[],o=v(a);try{for(o.s();!(e=o.n()).done;){var n=e.value,i=m.default.fetch("/api/v1/awards/"+n,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});t.push(i)}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}),(0,f.default)("#missing-solve-button").click(function(e){var s;(e=e).preventDefault(),s=(0,f.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,f.default)(this).data("missing-challenge-id")}),e=1===s.length?"challenge":"challenges",(0,r.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(s.length," ").concat(e," correct for ").concat((0,i.htmlEntities)(window.TEAM_NAME),"?"),success:function(){(0,r.ezAlert)({title:"User Attribution",body:"\n Which user on ".concat((0,i.htmlEntities)(window.TEAM_NAME),' solved these challenges?\n
\n ').concat((0,f.default)("#team-member-select").html(),"\n
\n "),button:"Mark Correct",success:function(){var e,t=(0,f.default)("#query-team-member-solve > select").val(),o=[],n=v(s);try{for(n.s();!(e=n.n()).done;){var i=e.value,a={provided:"MARKED AS SOLVED BY ADMIN",user_id:t,team_id:window.TEAM_ID,challenge_id:i,type:"correct"},r=m.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(a)});o.push(r)}}catch(e){n.e(e)}finally{n.f()}Promise.all(o).then(function(e){window.location.reload()})}})}})}),(0,f.default)("#team-info-create-form").submit(_),(0,f.default)("#team-info-edit-form").submit(b);var d,e=o.default.extend(s.default),t=document.createElement("div"),e=(document.querySelector("#comment-box").appendChild(t),new e({propsData:{type:"team",id:window.TEAM_ID}}).$mount(t),o.default.extend(y.default)),t=document.createElement("div"),e=(document.querySelector("#team-add-modal .modal-body").appendChild(t),new e({propsData:{team_id:window.TEAM_ID}}).$mount(t),window.stats_data),c=e.type,l=e.id,p=e.name,u=e.account_id;(0,f.default)("#team-statistics-modal").on("shown.bs.modal",function(e){var t,o,n,i,a,r,s;o=l,n=p,i=u,a=g(w[t=c],3),r=a[0],s=a[1],a=a[2],Promise.all([r(i),s(i),a(i)]).then(function(e){(0,h.createGraph)("score_graph","#score-graph",e,t,o,n,i),(0,h.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,i),(0,h.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,i)}),d=setInterval(function(){var t,o,n,i,e,a,r;o=l,n=p,i=u,e=g(w[t=c],3),a=e[0],r=e[1],e=e[2],Promise.all([a(i),r(i),e(i)]).then(function(e){(0,h.updateGraph)("score_graph","#score-graph",e,t,o,n,i),(0,h.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,n,i),(0,h.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,n,i)})},3e5)}),(0,f.default)("#team-statistics-modal").on("hidden.bs.modal",function(e){clearInterval(d)}),(0,f.default)(".statistics-team").click(function(e){(0,f.default)("#team-statistics-modal").modal("toggle")})})},"./CTFd/themes/admin/assets/js/styles.js":function(l,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=d,e.bindMarkdownEditors=c,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var o=t("./CTFd/themes/core/assets/js/utils.js"),i=r(t("./node_modules/jquery/dist/jquery.js")),n=r(t("./node_modules/easymde/src/js/easymde.js")),p=r(t("./node_modules/vue/dist/vue.esm.browser.js")),u=r(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),a=r(t("./node_modules/highlight.js/lib/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=p.default.extend(u.default),o=document.createElement("div"),n=(document.querySelector("main").appendChild(o),new t({propsData:{editor:e}}).$mount(o));(0,i.default)("#media-modal").on("hidden.bs.modal",function(e){n.$destroy(),(0,i.default)("#media-modal").remove()}),(0,i.default)("#media-modal").modal()}function d(e){var t;!1===e.hasOwnProperty("mde")&&(t=new n.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,i.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:a.default}}),e.mde=t,e.codemirror=t.codemirror,(0,i.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,i.default)(e).val()),t.codemirror.refresh()}))}function c(){(0,i.default)("textarea.markdown").each(function(e,t){d(t)})}e.default=function(){(0,i.default)(":input").each(function(){(0,i.default)(this).data("initial",(0,i.default)(this).val())}),(0,i.default)(function(){(0,i.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,i.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,i.default)("[data-checkbox]").click(function(e){(0,i.default)(e.target).is("input[type=checkbox]")||(0,i.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,i.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,i.default)(this).prop("checked"),o=(0,i.default)(this).index()+1;(0,i.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,i.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,i.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,i.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,i.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,i.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,i.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),c(),(0,o.makeSortableTables)(),(0,i.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){a.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(l,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var p=i(t("./CTFd/themes/core/assets/js/fetch.js")),o=i(t("./CTFd/themes/core/assets/js/config.js")),n=t("./CTFd/themes/core/assets/js/api.js"),u=(t("./CTFd/themes/core/assets/js/patch.js"),i(t("./node_modules/markdown-it/index.js"))),f=i(t("./node_modules/jquery/dist/jquery.js")),t=i(t("./CTFd/themes/core/assets/js/ezq.js"));function i(e){return e&&e.__esModule?e:{default:e}}function a(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function r(n){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(o).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(o),t.find("pre code").each(function(e){i.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=p.format(e.title,e.body),t=(0,a.default)(t),o=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((o=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),o.click(function(){e.onclick()})),!1!==e.autohide),n=!1!==e.animation,i=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:o,delay:i,animation:n}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),o=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),n=(0,a.default)(g);return t.find(".modal-footer").append(n),t.find(".modal-footer").append(o),t.find("pre code").each(function(e){i.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(o).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:n,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var n=(o=o("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var i=window.fetch;t.default=function(e,t){return e=n.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,i(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,n,i,a,r){var e=l[e],s=c.default.init(document.querySelector(t));s.setOption(e.format(n,i,a,r,o)),(0,d.default)(window).on("resize",function(){null!=s&&s.resize()})},t.disposeGraph=function(e){c.default.dispose(document.querySelector(e))},t.updateGraph=function(e,t,o,n,i,a,r){e=l[e];c.default.init(document.querySelector(t)).setOption(e.format(n,i,a,r,o))};var d=n(o("./node_modules/jquery/dist/jquery.js")),c=n(o("./node_modules/echarts/dist/echarts-en.common.js")),u=n(o("./node_modules/dayjs/dayjs.min.js")),m=o("./CTFd/themes/core/assets/js/utils.js");function n(e){return e&&e.__esModule?e:{default:e}}var l={score_graph:{format:function(l,e,t,p,o){var n={title:{left:"center",text:"Score over Time"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[t]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]},i=[],a=[],r=o[0].data,o=o[2].data,s=r.concat(o);s.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var d=0;d").text(e).html()},t.inc_notification_counter=function(){var e=i.getItem(r)||0;i.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=i.getItem(r);null===e?i.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var o,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((o=(0,a.default)(this).index(),function(e,t){e=i(e,o),t=i(t,o);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var n=0;n= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteSelectedTeams(_event) {\n var teamIDs = (0, _jquery[\"default\"])(\"input[data-team-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"team-id\");\n });\n var target = teamIDs.length === 1 ? \"team\" : \"teams\";\n (0, _ezq.ezQuery)({\n title: \"Delete Teams\",\n body: \"Are you sure you want to delete \".concat(teamIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(teamIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var teamID = _step.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/teams/\".concat(teamID), {\n method: \"DELETE\"\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction bulkEditTeams(_event) {\n var teamIDs = (0, _jquery[\"default\"])(\"input[data-team-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"team-id\");\n });\n (0, _ezq.ezAlert)({\n title: \"Edit Teams\",\n body: (0, _jquery[\"default\"])(\"\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \"),\n button: \"Submit\",\n success: function success() {\n var data = (0, _jquery[\"default\"])(\"#teams-bulk-edit\").serializeJSON(true);\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(teamIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var teamID = _step2.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/teams/\".concat(teamID), {\n method: \"PATCH\",\n body: JSON.stringify(data)\n }));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#teams-delete-button\").click(deleteSelectedTeams);\n (0, _jquery[\"default\"])(\"#teams-edit-button\").click(bulkEditTeams);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/teams.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteSelectedTeams(_event) {\n var teamIDs = (0, _jquery[\"default\"])(\"input[data-team-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"team-id\");\n });\n var target = teamIDs.length === 1 ? \"team\" : \"teams\";\n (0, _ezq.ezQuery)({\n title: \"Delete Teams\",\n body: \"Are you sure you want to delete \".concat(teamIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(teamIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var teamID = _step.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/teams/\".concat(teamID), {\n method: \"DELETE\"\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction bulkEditTeams(_event) {\n var teamIDs = (0, _jquery[\"default\"])(\"input[data-team-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"team-id\");\n });\n (0, _ezq.ezAlert)({\n title: \"Edit Teams\",\n body: (0, _jquery[\"default\"])(\"\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \"),\n button: \"Submit\",\n success: function success() {\n var data = (0, _jquery[\"default\"])(\"#teams-bulk-edit\").serializeJSON(true);\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(teamIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var teamID = _step2.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/teams/\".concat(teamID), {\n method: \"PATCH\",\n body: JSON.stringify(data)\n }));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#teams-delete-button\").click(deleteSelectedTeams);\n (0, _jquery[\"default\"])(\"#teams-edit-button\").click(bulkEditTeams);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/teams.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/teams.min.js b/CTFd/themes/admin/static/js/pages/teams.min.js index 279cb4b5a..115c96d3e 100644 --- a/CTFd/themes/admin/static/js/pages/teams.min.js +++ b/CTFd/themes/admin/static/js/pages/teams.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,i,o=e[0],n=e[1],a=e[2],r=0,s=[];r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,r=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i\n
\n \n \n
\n
\n \n \n
\n \n '),button:"Submit",success:function(){var e,t=(0,s.default)("#teams-bulk-edit").serializeJSON(!0),i=[],o=d(a);try{for(o.s();!(e=o.n()).done;){var n=e.value;i.push(r.default.fetch("/api/v1/teams/".concat(n),{method:"PATCH",body:JSON.stringify(t)}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(i).then(function(e){window.location.reload()})}})}(0,s.default)(function(){(0,s.default)("#teams-delete-button").click(a),(0,s.default)("#teams-edit-button").click(p)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=p,t.bindMarkdownEditor=l,t.bindMarkdownEditors=u,t.default=void 0,i("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var o=i("./CTFd/themes/core/assets/js/utils.js"),n=c(i("./node_modules/jquery/dist/jquery.js")),a=c(i("./node_modules/easymde/src/js/easymde.js")),r=c(i("./node_modules/vue/dist/vue.esm.browser.js")),s=c(i("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),d=c(i("./node_modules/highlight.js/lib/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=r.default.extend(s.default),i=document.createElement("div");document.querySelector("main").appendChild(i);var o=new t({propsData:{editor:e}}).$mount(i);(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function l(e){var t;!1===e.hasOwnProperty("mde")&&(t=new a.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){p(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:d.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function u(){(0,n.default)("textarea.markdown").each(function(e,t){l(t)})}t.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,n.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),u(),(0,o.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){d.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=c(i("./CTFd/themes/core/assets/js/fetch.js")),n=c(i("./CTFd/themes/core/assets/js/config.js")),a=i("./CTFd/themes/core/assets/js/api.js");i("./CTFd/themes/core/assets/js/patch.js");var r=c(i("./node_modules/markdown-it/index.js")),s=c(i("./node_modules/jquery/dist/jquery.js")),d=c(i("./CTFd/themes/core/assets/js/ezq.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function l(n){for(var e=1;e".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function g(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};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 n,a=!0,r=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==o.return||o.return()}finally{if(r)throw n}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i\n
\n \n \n
\n
\n \n \n
\n \n '),button:"Submit",success:function(){var e,t=(0,s.default)("#teams-bulk-edit").serializeJSON(!0),i=[],o=d(a);try{for(o.s();!(e=o.n()).done;){var n=e.value;i.push(r.default.fetch("/api/v1/teams/".concat(n),{method:"PATCH",body:JSON.stringify(t)}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(i).then(function(e){window.location.reload()})}})}(0,s.default)(function(){(0,s.default)("#teams-delete-button").click(o),(0,s.default)("#teams-edit-button").click(n)})},"./CTFd/themes/admin/assets/js/styles.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=d,e.bindMarkdownEditors=c,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var i=t("./CTFd/themes/core/assets/js/utils.js"),n=r(t("./node_modules/jquery/dist/jquery.js")),o=r(t("./node_modules/easymde/src/js/easymde.js")),l=r(t("./node_modules/vue/dist/vue.esm.browser.js")),u=r(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),a=r(t("./node_modules/highlight.js/lib/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=l.default.extend(u.default),i=document.createElement("div"),o=(document.querySelector("main").appendChild(i),new t({propsData:{editor:e}}).$mount(i));(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function d(e){var t;!1===e.hasOwnProperty("mde")&&(t=new o.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:a.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function c(){(0,n.default)("textarea.markdown").each(function(e,t){d(t)})}e.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,n.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),c(),(0,i.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){a.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(t("./CTFd/themes/core/assets/js/fetch.js")),i=n(t("./CTFd/themes/core/assets/js/config.js")),o=t("./CTFd/themes/core/assets/js/api.js"),u=(t("./CTFd/themes/core/assets/js/patch.js"),n(t("./node_modules/markdown-it/index.js"))),f=n(t("./node_modules/jquery/dist/jquery.js")),t=n(t("./CTFd/themes/core/assets/js/ezq.js"));function n(e){return e&&e.__esModule?e:{default:e}}function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function r(o){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction createUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-info-create-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n } // Move the notify value into a GET param\n\n\n var url = \"/api/v1/users\";\n var notify = params.notify;\n\n if (notify === true) {\n url = \"\".concat(url, \"?notify=true\");\n }\n\n delete params.notify;\n\n _CTFd[\"default\"].fetch(url, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var user_id = response.data.id;\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/users/\" + user_id;\n } else {\n (0, _jquery[\"default\"])(\"#user-info-create-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-info-create-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction updateUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-info-edit-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n }\n\n _CTFd[\"default\"].fetch(\"/api/v1/users/\" + window.USER_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#user-info-edit-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-info-edit-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-info-edit-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteUser(event) {\n event.preventDefault();\n (0, _ezq.ezQuery)({\n title: \"Delete User\",\n body: \"Are you sure you want to delete {0}\".format(\"\" + (0, _utils.htmlEntities)(window.USER_NAME) + \"\"),\n success: function success() {\n _CTFd[\"default\"].fetch(\"/api/v1/users/\" + window.USER_ID, {\n method: \"DELETE\"\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/users\";\n }\n });\n }\n });\n}\n\nfunction awardUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-award-form\").serializeJSON(true);\n params[\"user_id\"] = window.USER_ID;\n\n _CTFd[\"default\"].fetch(\"/api/v1/awards\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-award-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction emailUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-mail-form\").serializeJSON(true);\n\n _CTFd[\"default\"].fetch(\"/api/v1/users/\" + window.USER_ID + \"/email\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n (0, _jquery[\"default\"])(\"#user-mail-form > #results\").append((0, _ezq.ezBadge)({\n type: \"success\",\n body: \"E-Mail sent successfully!\"\n }));\n (0, _jquery[\"default\"])(\"#user-mail-form\").find(\"input[type=text], textarea\").val(\"\");\n } else {\n (0, _jquery[\"default\"])(\"#user-mail-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-mail-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-mail-form\").find(\"input[name={0}], textarea[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(event, target) {\n var submissions;\n var type;\n var title;\n\n switch (target) {\n case \"solves\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=correct]:checked\");\n type = \"solve\";\n title = \"Solves\";\n break;\n\n case \"fails\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=incorrect]:checked\");\n type = \"fail\";\n title = \"Fails\";\n break;\n\n default:\n break;\n }\n\n var submissionIDs = submissions.map(function () {\n return (0, _jquery[\"default\"])(this).data(\"submission-id\");\n });\n var target_string = submissionIDs.length === 1 ? type : type + \"s\";\n (0, _ezq.ezQuery)({\n title: \"Delete \".concat(title),\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target_string, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(submissionIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var subId = _step.value;\n reqs.push(_CTFd[\"default\"].api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction deleteSelectedAwards(_event) {\n var awardIDs = (0, _jquery[\"default\"])(\"input[data-award-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"award-id\");\n });\n var target = awardIDs.length === 1 ? \"award\" : \"awards\";\n (0, _ezq.ezQuery)({\n title: \"Delete Awards\",\n body: \"Are you sure you want to delete \".concat(awardIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(awardIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var awardID = _step2.value;\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/awards/\" + awardID, {\n method: \"DELETE\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction solveSelectedMissingChallenges(event) {\n event.preventDefault();\n var challengeIDs = (0, _jquery[\"default\"])(\"input[data-missing-challenge-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"missing-challenge-id\");\n });\n var target = challengeIDs.length === 1 ? \"challenge\" : \"challenges\";\n (0, _ezq.ezQuery)({\n title: \"Mark Correct\",\n body: \"Are you sure you want to mark \".concat(challengeIDs.length, \" \").concat(target, \" correct for \").concat((0, _utils.htmlEntities)(window.USER_NAME), \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator3 = _createForOfIteratorHelper(challengeIDs),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var challengeID = _step3.value;\n var params = {\n provided: \"MARKED AS SOLVED BY ADMIN\",\n user_id: window.USER_ID,\n team_id: window.TEAM_ID,\n challenge_id: challengeID,\n type: \"correct\"\n };\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/submissions\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nvar api_funcs = {\n team: [function (x) {\n return _CTFd[\"default\"].api.get_team_solves({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_fails({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_awards({\n teamId: x\n });\n }],\n user: [function (x) {\n return _CTFd[\"default\"].api.get_user_solves({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_fails({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_awards({\n userId: x\n });\n }]\n};\n\nvar createGraphs = function createGraphs(type, id, name, account_id) {\n var _api_funcs$type = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type[0],\n fails_func = _api_funcs$type[1],\n awards_func = _api_funcs$type[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.createGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\nvar updateGraphs = function updateGraphs(type, id, name, account_id) {\n var _api_funcs$type2 = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type2[0],\n fails_func = _api_funcs$type2[1],\n awards_func = _api_funcs$type2[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.updateGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\".delete-user\").click(deleteUser);\n (0, _jquery[\"default\"])(\".edit-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-info-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".award-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-award-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".email-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-email-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".addresses-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-addresses-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\"#user-mail-form\").submit(emailUser);\n (0, _jquery[\"default\"])(\"#solves-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"solves\");\n });\n (0, _jquery[\"default\"])(\"#fails-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"fails\");\n });\n (0, _jquery[\"default\"])(\"#awards-delete-button\").click(function (e) {\n deleteSelectedAwards(e);\n });\n (0, _jquery[\"default\"])(\"#missing-solve-button\").click(function (e) {\n solveSelectedMissingChallenges(e);\n });\n (0, _jquery[\"default\"])(\"#user-info-create-form\").submit(createUser);\n (0, _jquery[\"default\"])(\"#user-info-edit-form\").submit(updateUser);\n (0, _jquery[\"default\"])(\"#user-award-form\").submit(awardUser); // Insert CommentBox element\n\n var commentBox = _vueEsm[\"default\"].extend(_CommentBox[\"default\"]);\n\n var vueContainer = document.createElement(\"div\");\n document.querySelector(\"#comment-box\").appendChild(vueContainer);\n new commentBox({\n propsData: {\n type: \"user\",\n id: window.USER_ID\n }\n }).$mount(vueContainer);\n var type, id, name, account_id;\n var _window$stats_data = window.stats_data;\n type = _window$stats_data.type;\n id = _window$stats_data.id;\n name = _window$stats_data.name;\n account_id = _window$stats_data.account_id;\n var intervalId;\n (0, _jquery[\"default\"])(\"#user-statistics-modal\").on(\"shown.bs.modal\", function (_e) {\n createGraphs(type, id, name, account_id);\n intervalId = setInterval(function () {\n updateGraphs(type, id, name, account_id);\n }, 300000);\n });\n (0, _jquery[\"default\"])(\"#user-statistics-modal\").on(\"hidden.bs.modal\", function (_e) {\n clearInterval(intervalId);\n });\n (0, _jquery[\"default\"])(\".statistics-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-statistics-modal\").modal(\"toggle\");\n });\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/user.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _utils = __webpack_require__(/*! core/utils */ \"./CTFd/themes/core/assets/js/utils.js\");\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nvar _graphs = __webpack_require__(/*! core/graphs */ \"./CTFd/themes/core/assets/js/graphs.js\");\n\nvar _vueEsm = _interopRequireDefault(__webpack_require__(/*! vue/dist/vue.esm.browser */ \"./node_modules/vue/dist/vue.esm.browser.js\"));\n\nvar _CommentBox = _interopRequireDefault(__webpack_require__(/*! ../components/comments/CommentBox.vue */ \"./CTFd/themes/admin/assets/js/components/comments/CommentBox.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction createUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-info-create-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n } // Move the notify value into a GET param\n\n\n var url = \"/api/v1/users\";\n var notify = params.notify;\n\n if (notify === true) {\n url = \"\".concat(url, \"?notify=true\");\n }\n\n delete params.notify;\n\n _CTFd[\"default\"].fetch(url, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n var user_id = response.data.id;\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/users/\" + user_id;\n } else {\n (0, _jquery[\"default\"])(\"#user-info-create-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-info-create-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-info-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction updateUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-info-edit-form\").serializeJSON(true);\n params.fields = [];\n\n for (var property in params) {\n if (property.match(/fields\\[\\d+\\]/)) {\n var field = {};\n var id = parseInt(property.slice(7, -1));\n field[\"field_id\"] = id;\n field[\"value\"] = params[property];\n params.fields.push(field);\n delete params[property];\n }\n }\n\n _CTFd[\"default\"].fetch(\"/api/v1/users/\" + window.USER_ID, {\n method: \"PATCH\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#user-info-edit-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-info-edit-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-info-edit-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteUser(event) {\n event.preventDefault();\n (0, _ezq.ezQuery)({\n title: \"Delete User\",\n body: \"Are you sure you want to delete {0}\".format(\"\" + (0, _utils.htmlEntities)(window.USER_NAME) + \"\"),\n success: function success() {\n _CTFd[\"default\"].fetch(\"/api/v1/users/\" + window.USER_ID, {\n method: \"DELETE\"\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location = _CTFd[\"default\"].config.urlRoot + \"/admin/users\";\n }\n });\n }\n });\n}\n\nfunction awardUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-award-form\").serializeJSON(true);\n params[\"user_id\"] = window.USER_ID;\n\n _CTFd[\"default\"].fetch(\"/api/v1/awards\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n window.location.reload();\n } else {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-award-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-award-form\").find(\"input[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction emailUser(event) {\n event.preventDefault();\n var params = (0, _jquery[\"default\"])(\"#user-mail-form\").serializeJSON(true);\n\n _CTFd[\"default\"].fetch(\"/api/v1/users/\" + window.USER_ID + \"/email\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n }).then(function (response) {\n return response.json();\n }).then(function (response) {\n if (response.success) {\n (0, _jquery[\"default\"])(\"#user-mail-form > #results\").append((0, _ezq.ezBadge)({\n type: \"success\",\n body: \"E-Mail sent successfully!\"\n }));\n (0, _jquery[\"default\"])(\"#user-mail-form\").find(\"input[type=text], textarea\").val(\"\");\n } else {\n (0, _jquery[\"default\"])(\"#user-mail-form > #results\").empty();\n Object.keys(response.errors).forEach(function (key, _index) {\n (0, _jquery[\"default\"])(\"#user-mail-form > #results\").append((0, _ezq.ezBadge)({\n type: \"error\",\n body: response.errors[key]\n }));\n var i = (0, _jquery[\"default\"])(\"#user-mail-form\").find(\"input[name={0}], textarea[name={0}]\".format(key));\n var input = (0, _jquery[\"default\"])(i);\n input.addClass(\"input-filled-invalid\");\n input.removeClass(\"input-filled-valid\");\n });\n }\n });\n}\n\nfunction deleteSelectedSubmissions(event, target) {\n var submissions;\n var type;\n var title;\n\n switch (target) {\n case \"solves\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=correct]:checked\");\n type = \"solve\";\n title = \"Solves\";\n break;\n\n case \"fails\":\n submissions = (0, _jquery[\"default\"])(\"input[data-submission-type=incorrect]:checked\");\n type = \"fail\";\n title = \"Fails\";\n break;\n\n default:\n break;\n }\n\n var submissionIDs = submissions.map(function () {\n return (0, _jquery[\"default\"])(this).data(\"submission-id\");\n });\n var target_string = submissionIDs.length === 1 ? type : type + \"s\";\n (0, _ezq.ezQuery)({\n title: \"Delete \".concat(title),\n body: \"Are you sure you want to delete \".concat(submissionIDs.length, \" \").concat(target_string, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(submissionIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var subId = _step.value;\n reqs.push(_CTFd[\"default\"].api.delete_submission({\n submissionId: subId\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction deleteSelectedAwards(_event) {\n var awardIDs = (0, _jquery[\"default\"])(\"input[data-award-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"award-id\");\n });\n var target = awardIDs.length === 1 ? \"award\" : \"awards\";\n (0, _ezq.ezQuery)({\n title: \"Delete Awards\",\n body: \"Are you sure you want to delete \".concat(awardIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(awardIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var awardID = _step2.value;\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/awards/\" + awardID, {\n method: \"DELETE\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction solveSelectedMissingChallenges(event) {\n event.preventDefault();\n var challengeIDs = (0, _jquery[\"default\"])(\"input[data-missing-challenge-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"missing-challenge-id\");\n });\n var target = challengeIDs.length === 1 ? \"challenge\" : \"challenges\";\n (0, _ezq.ezQuery)({\n title: \"Mark Correct\",\n body: \"Are you sure you want to mark \".concat(challengeIDs.length, \" \").concat(target, \" correct for \").concat((0, _utils.htmlEntities)(window.USER_NAME), \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator3 = _createForOfIteratorHelper(challengeIDs),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var challengeID = _step3.value;\n var params = {\n provided: \"MARKED AS SOLVED BY ADMIN\",\n user_id: window.USER_ID,\n team_id: window.TEAM_ID,\n challenge_id: challengeID,\n type: \"correct\"\n };\n\n var req = _CTFd[\"default\"].fetch(\"/api/v1/submissions\", {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(params)\n });\n\n reqs.push(req);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nvar api_funcs = {\n team: [function (x) {\n return _CTFd[\"default\"].api.get_team_solves({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_fails({\n teamId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_team_awards({\n teamId: x\n });\n }],\n user: [function (x) {\n return _CTFd[\"default\"].api.get_user_solves({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_fails({\n userId: x\n });\n }, function (x) {\n return _CTFd[\"default\"].api.get_user_awards({\n userId: x\n });\n }]\n};\n\nvar createGraphs = function createGraphs(type, id, name, account_id) {\n var _api_funcs$type = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type[0],\n fails_func = _api_funcs$type[1],\n awards_func = _api_funcs$type[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.createGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.createGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\nvar updateGraphs = function updateGraphs(type, id, name, account_id) {\n var _api_funcs$type2 = _slicedToArray(api_funcs[type], 3),\n solves_func = _api_funcs$type2[0],\n fails_func = _api_funcs$type2[1],\n awards_func = _api_funcs$type2[2];\n\n Promise.all([solves_func(account_id), fails_func(account_id), awards_func(account_id)]).then(function (responses) {\n (0, _graphs.updateGraph)(\"score_graph\", \"#score-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"category_breakdown\", \"#categories-pie-graph\", responses, type, id, name, account_id);\n (0, _graphs.updateGraph)(\"solve_percentages\", \"#keys-pie-graph\", responses, type, id, name, account_id);\n });\n};\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\".delete-user\").click(deleteUser);\n (0, _jquery[\"default\"])(\".edit-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-info-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".award-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-award-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".email-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-email-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\".addresses-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-addresses-modal\").modal(\"toggle\");\n });\n (0, _jquery[\"default\"])(\"#user-mail-form\").submit(emailUser);\n (0, _jquery[\"default\"])(\"#solves-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"solves\");\n });\n (0, _jquery[\"default\"])(\"#fails-delete-button\").click(function (e) {\n deleteSelectedSubmissions(e, \"fails\");\n });\n (0, _jquery[\"default\"])(\"#awards-delete-button\").click(function (e) {\n deleteSelectedAwards(e);\n });\n (0, _jquery[\"default\"])(\"#missing-solve-button\").click(function (e) {\n solveSelectedMissingChallenges(e);\n });\n (0, _jquery[\"default\"])(\"#user-info-create-form\").submit(createUser);\n (0, _jquery[\"default\"])(\"#user-info-edit-form\").submit(updateUser);\n (0, _jquery[\"default\"])(\"#user-award-form\").submit(awardUser); // Insert CommentBox element\n\n var commentBox = _vueEsm[\"default\"].extend(_CommentBox[\"default\"]);\n\n var vueContainer = document.createElement(\"div\");\n document.querySelector(\"#comment-box\").appendChild(vueContainer);\n new commentBox({\n propsData: {\n type: \"user\",\n id: window.USER_ID\n }\n }).$mount(vueContainer);\n var type, id, name, account_id;\n var _window$stats_data = window.stats_data;\n type = _window$stats_data.type;\n id = _window$stats_data.id;\n name = _window$stats_data.name;\n account_id = _window$stats_data.account_id;\n var intervalId;\n (0, _jquery[\"default\"])(\"#user-statistics-modal\").on(\"shown.bs.modal\", function (_e) {\n createGraphs(type, id, name, account_id);\n intervalId = setInterval(function () {\n updateGraphs(type, id, name, account_id);\n }, 300000);\n });\n (0, _jquery[\"default\"])(\"#user-statistics-modal\").on(\"hidden.bs.modal\", function (_e) {\n clearInterval(intervalId);\n });\n (0, _jquery[\"default\"])(\".statistics-user\").click(function (_event) {\n (0, _jquery[\"default\"])(\"#user-statistics-modal\").modal(\"toggle\");\n });\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/user.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/user.min.js b/CTFd/themes/admin/static/js/pages/user.min.js index f6d180c87..775aab8f9 100644 --- a/CTFd/themes/admin/static/js/pages/user.min.js +++ b/CTFd/themes/admin/static/js/pages/user.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,o,i=e[0],n=e[1],a=e[2],r=0,s=[];r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==o.return||o.return()}finally{if(s)throw a}}}}function c(e,t){if(e){if("string"==typeof e)return l(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);o #results").empty(),Object.keys(n.errors).forEach(function(e,t){(0,s.default)("#user-info-create-form > #results").append((0,m.ezBadge)({type:"error",body:n.errors[e]}));var o=(0,s.default)("#user-info-form").find("input[name={0}]".format(e)),i=(0,s.default)(o);i.addClass("input-filled-invalid"),i.removeClass("input-filled-valid")}))})}function j(e){e.preventDefault();var t,o,i,n=(0,s.default)("#user-info-edit-form").serializeJSON(!0);for(t in n.fields=[],n){t.match(/fields\[\d+\]/)&&(o={},i=parseInt(t.slice(7,-1)),o.field_id=i,o.value=n[t],n.fields.push(o),delete n[t])}d.default.fetch("/api/v1/users/"+window.USER_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(function(e){return e.json()}).then(function(n){n.success?window.location.reload():((0,s.default)("#user-info-edit-form > #results").empty(),Object.keys(n.errors).forEach(function(e,t){(0,s.default)("#user-info-edit-form > #results").append((0,m.ezBadge)({type:"error",body:n.errors[e]}));var o=(0,s.default)("#user-info-edit-form").find("input[name={0}]".format(e)),i=(0,s.default)(o);i.addClass("input-filled-invalid"),i.removeClass("input-filled-valid")}))})}function _(e){e.preventDefault(),(0,m.ezQuery)({title:"Delete User",body:"Are you sure you want to delete {0}".format(""+(0,i.htmlEntities)(window.USER_NAME)+""),success:function(){d.default.fetch("/api/v1/users/"+window.USER_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=d.default.config.urlRoot+"/admin/users")})}})}function b(e){e.preventDefault();var t=(0,s.default)("#user-award-form").serializeJSON(!0);t.user_id=window.USER_ID,d.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(n){n.success?window.location.reload():((0,s.default)("#user-award-form > #results").empty(),Object.keys(n.errors).forEach(function(e,t){(0,s.default)("#user-award-form > #results").append((0,m.ezBadge)({type:"error",body:n.errors[e]}));var o=(0,s.default)("#user-award-form").find("input[name={0}]".format(e)),i=(0,s.default)(o);i.addClass("input-filled-invalid"),i.removeClass("input-filled-valid")}))})}function T(e){e.preventDefault();var t=(0,s.default)("#user-mail-form").serializeJSON(!0);d.default.fetch("/api/v1/users/"+window.USER_ID+"/email",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}).then(function(e){return e.json()}).then(function(n){n.success?((0,s.default)("#user-mail-form > #results").append((0,m.ezBadge)({type:"success",body:"E-Mail sent successfully!"})),(0,s.default)("#user-mail-form").find("input[type=text], textarea").val("")):((0,s.default)("#user-mail-form > #results").empty(),Object.keys(n.errors).forEach(function(e,t){(0,s.default)("#user-mail-form > #results").append((0,m.ezBadge)({type:"error",body:n.errors[e]}));var o=(0,s.default)("#user-mail-form").find("input[name={0}], textarea[name={0}]".format(e)),i=(0,s.default)(o);i.addClass("input-filled-invalid"),i.removeClass("input-filled-valid")}))})}function w(e,t){var o,i,n;switch(t){case"solves":o=(0,s.default)("input[data-submission-type=correct]:checked"),i="solve",n="Solves";break;case"fails":o=(0,s.default)("input[data-submission-type=incorrect]:checked"),i="fail",n="Fails"}var a=o.map(function(){return(0,s.default)(this).data("submission-id")}),r=1===a.length?i:i+"s";(0,m.ezQuery)({title:"Delete ".concat(n),body:"Are you sure you want to delete ".concat(a.length," ").concat(r,"?"),success:function(){var e,t=[],o=v(a);try{for(o.s();!(e=o.n()).done;){var i=e.value;t.push(d.default.api.delete_submission({submissionId:i}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}var C={team:[function(e){return d.default.api.get_team_solves({teamId:e})},function(e){return d.default.api.get_team_fails({teamId:e})},function(e){return d.default.api.get_team_awards({teamId:e})}],user:[function(e){return d.default.api.get_user_solves({userId:e})},function(e){return d.default.api.get_user_fails({userId:e})},function(e){return d.default.api.get_user_awards({userId:e})}]};(0,s.default)(function(){(0,s.default)(".delete-user").click(_),(0,s.default)(".edit-user").click(function(e){(0,s.default)("#user-info-modal").modal("toggle")}),(0,s.default)(".award-user").click(function(e){(0,s.default)("#user-award-modal").modal("toggle")}),(0,s.default)(".email-user").click(function(e){(0,s.default)("#user-email-modal").modal("toggle")}),(0,s.default)(".addresses-user").click(function(e){(0,s.default)("#user-addresses-modal").modal("toggle")}),(0,s.default)("#user-mail-form").submit(T),(0,s.default)("#solves-delete-button").click(function(e){w(0,"solves")}),(0,s.default)("#fails-delete-button").click(function(e){w(0,"fails")}),(0,s.default)("#awards-delete-button").click(function(e){var a,t;a=(0,s.default)("input[data-award-id]:checked").map(function(){return(0,s.default)(this).data("award-id")}),t=1===a.length?"award":"awards",(0,m.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(a.length," ").concat(t,"?"),success:function(){var e,t=[],o=v(a);try{for(o.s();!(e=o.n()).done;){var i=e.value,n=d.default.fetch("/api/v1/awards/"+i,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});t.push(n)}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}),(0,s.default)("#missing-solve-button").click(function(e){!function(e){e.preventDefault();var r=(0,s.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,s.default)(this).data("missing-challenge-id")}),t=1===r.length?"challenge":"challenges";(0,m.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(r.length," ").concat(t," correct for ").concat((0,i.htmlEntities)(window.USER_NAME),"?"),success:function(){var e,t=[],o=v(r);try{for(o.s();!(e=o.n()).done;){var i=e.value,n={provided:"MARKED AS SOLVED BY ADMIN",user_id:window.USER_ID,team_id:window.TEAM_ID,challenge_id:i,type:"correct"},a=d.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)});t.push(a)}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}(e)}),(0,s.default)("#user-info-create-form").submit(y),(0,s.default)("#user-info-edit-form").submit(j),(0,s.default)("#user-award-form").submit(b);var e=n.default.extend(a.default),t=document.createElement("div");document.querySelector("#comment-box").appendChild(t),new e({propsData:{type:"user",id:window.USER_ID}}).$mount(t);var c,o=window.stats_data,l=o.type,u=o.id,p=o.name,f=o.account_id;(0,s.default)("#user-statistics-modal").on("shown.bs.modal",function(e){var t,o,i,n,a,r,s,d;o=u,i=p,n=f,a=g(C[t=l],3),r=a[0],s=a[1],d=a[2],Promise.all([r(n),s(n),d(n)]).then(function(e){(0,h.createGraph)("score_graph","#score-graph",e,t,o,i,n),(0,h.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,i,n),(0,h.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,i,n)}),c=setInterval(function(){var t,o,i,n,e,a,r,s;o=u,i=p,n=f,e=g(C[t=l],3),a=e[0],r=e[1],s=e[2],Promise.all([a(n),r(n),s(n)]).then(function(e){(0,h.updateGraph)("score_graph","#score-graph",e,t,o,i,n),(0,h.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,i,n),(0,h.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,i,n)})},3e5)}),(0,s.default)("#user-statistics-modal").on("hidden.bs.modal",function(e){clearInterval(c)}),(0,s.default)(".statistics-user").click(function(e){(0,s.default)("#user-statistics-modal").modal("toggle")})})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=l,t.bindMarkdownEditor=u,t.bindMarkdownEditors=p,t.default=void 0,o("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var i=o("./CTFd/themes/core/assets/js/utils.js"),n=c(o("./node_modules/jquery/dist/jquery.js")),a=c(o("./node_modules/easymde/src/js/easymde.js")),r=c(o("./node_modules/vue/dist/vue.esm.browser.js")),s=c(o("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),d=c(o("./node_modules/highlight.js/lib/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=r.default.extend(s.default),o=document.createElement("div");document.querySelector("main").appendChild(o);var i=new t({propsData:{editor:e}}).$mount(o);(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){i.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function u(e){var t;!1===e.hasOwnProperty("mde")&&(t=new a.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){l(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:d.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function p(){(0,n.default)("textarea.markdown").each(function(e,t){u(t)})}t.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),o=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,n.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),p(),(0,i.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){d.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=c(o("./CTFd/themes/core/assets/js/fetch.js")),n=c(o("./CTFd/themes/core/assets/js/config.js")),a=o("./CTFd/themes/core/assets/js/api.js");o("./CTFd/themes/core/assets/js/patch.js");var r=c(o("./node_modules/markdown-it/index.js")),s=c(o("./node_modules/jquery/dist/jquery.js")),d=c(o("./CTFd/themes/core/assets/js/ezq.js"));function c(e){return e&&e.__esModule?e:{default:e}}function l(t,e){var o,i=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,o)),i}function u(n){for(var e=1;e".concat(e.body,"

")):o.find(".modal-body").append((0,s.default)(e.body));var i=(0,s.default)(u.format(e.button));return e.success&&(0,s.default)(i).click(function(){e.success()}),e.large&&o.find(".modal-dialog").addClass("modal-lg"),o.find(".modal-footer").append(i),o.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(o),o.modal("show"),(0,s.default)(o).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),o}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,o=d.format(e.title,e.body),i=(0,s.default)(o);e.onclose&&(0,s.default)(i).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(i).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(i),i.toast({autohide:n,delay:r,animation:a}),i.toast("show"),i}function g(e){var t=r.format(e.title),o=(0,s.default)(t);"string"==typeof e.body?o.find(".modal-body").append("

".concat(e.body,"

")):o.find(".modal-body").append((0,s.default)(e.body));var i=(0,s.default)(f),n=(0,s.default)(p);return o.find(".modal-footer").append(n),o.find(".modal-footer").append(i),o.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(o),(0,s.default)(o).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(i).click(function(){e.success()}),o.modal("show"),o}function v(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var o=c.format(e.width),i=r.format(e.title),n=(0,s.default)(i);return n.find(".modal-body").append((0,s.default)(o)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:l,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:g,ezProgressBar:v,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var i,n=(i=o("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,i,n,a,r){var s=u[e],d=l.default.init(document.querySelector(t));d.setOption(s.format(i,n,a,r,o)),(0,c.default)(window).on("resize",function(){null!=d&&null!=d&&d.resize()})},t.updateGraph=function(e,t,o,i,n,a,r){var s=u[e];l.default.init(document.querySelector(t)).setOption(s.format(i,n,a,r,o))},t.disposeGraph=function(e){l.default.dispose(document.querySelector(e))};var c=i(o("./node_modules/jquery/dist/jquery.js")),l=i(o("./node_modules/echarts/dist/echarts-en.common.js")),f=i(o("./node_modules/dayjs/dayjs.min.js")),m=o("./CTFd/themes/core/assets/js/utils.js");function i(e){return e&&e.__esModule?e:{default:e}}var u={score_graph:{format:function(e,t,o,i,n){var a={title:{left:"center",text:"Score over Time"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]},r=[],s=[],d=n[0].data,c=n[2].data,l=d.concat(c);l.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var u=0;u").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),o=0;o'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var o=a(e,n),i=a(t,n);return r.default.isNumeric(o)&&r.default.isNumeric(i)?o-i:o.toString().localeCompare(i)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};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 n,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function d(e,t){if(e){if("string"==typeof e)return c(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(o="Object"===o&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);o #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,s.default)("#user-info-create-form > #results").append((0,m.ezBadge)({type:"error",body:o.errors[e]}));e=(0,s.default)("#user-info-form").find("input[name={0}]".format(e)),e=(0,s.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}function j(e){e.preventDefault();var t,o,i,n=(0,s.default)("#user-info-edit-form").serializeJSON(!0);for(t in n.fields=[],n)t.match(/fields\[\d+\]/)&&(o={},i=parseInt(t.slice(7,-1)),o.field_id=i,o.value=n[t],n.fields.push(o),delete n[t]);f.default.fetch("/api/v1/users/"+window.USER_ID,{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then(function(e){return e.json()}).then(function(o){o.success?window.location.reload():((0,s.default)("#user-info-edit-form > #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,s.default)("#user-info-edit-form > #results").append((0,m.ezBadge)({type:"error",body:o.errors[e]}));e=(0,s.default)("#user-info-edit-form").find("input[name={0}]".format(e)),e=(0,s.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}function _(e){e.preventDefault(),(0,m.ezQuery)({title:"Delete User",body:"Are you sure you want to delete {0}".format(""+(0,o.htmlEntities)(window.USER_NAME)+""),success:function(){f.default.fetch("/api/v1/users/"+window.USER_ID,{method:"DELETE"}).then(function(e){return e.json()}).then(function(e){e.success&&(window.location=f.default.config.urlRoot+"/admin/users")})}})}function b(e){e.preventDefault();e=(0,s.default)("#user-award-form").serializeJSON(!0);e.user_id=window.USER_ID,f.default.fetch("/api/v1/awards",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()}).then(function(o){o.success?window.location.reload():((0,s.default)("#user-award-form > #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,s.default)("#user-award-form > #results").append((0,m.ezBadge)({type:"error",body:o.errors[e]}));e=(0,s.default)("#user-award-form").find("input[name={0}]".format(e)),e=(0,s.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}function T(e){e.preventDefault();e=(0,s.default)("#user-mail-form").serializeJSON(!0);f.default.fetch("/api/v1/users/"+window.USER_ID+"/email",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){return e.json()}).then(function(o){o.success?((0,s.default)("#user-mail-form > #results").append((0,m.ezBadge)({type:"success",body:"E-Mail sent successfully!"})),(0,s.default)("#user-mail-form").find("input[type=text], textarea").val("")):((0,s.default)("#user-mail-form > #results").empty(),Object.keys(o.errors).forEach(function(e,t){(0,s.default)("#user-mail-form > #results").append((0,m.ezBadge)({type:"error",body:o.errors[e]}));e=(0,s.default)("#user-mail-form").find("input[name={0}], textarea[name={0}]".format(e)),e=(0,s.default)(e);e.addClass("input-filled-invalid"),e.removeClass("input-filled-valid")}))})}function w(e,t){var o,i,n;switch(t){case"solves":o=(0,s.default)("input[data-submission-type=correct]:checked"),i="solve",n="Solves";break;case"fails":o=(0,s.default)("input[data-submission-type=incorrect]:checked"),i="fail",n="Fails"}var a=o.map(function(){return(0,s.default)(this).data("submission-id")}),t=1===a.length?i:i+"s";(0,m.ezQuery)({title:"Delete ".concat(n),body:"Are you sure you want to delete ".concat(a.length," ").concat(t,"?"),success:function(){var e,t=[],o=y(a);try{for(o.s();!(e=o.n()).done;){var i=e.value;t.push(f.default.api.delete_submission({submissionId:i}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}var C={team:[function(e){return f.default.api.get_team_solves({teamId:e})},function(e){return f.default.api.get_team_fails({teamId:e})},function(e){return f.default.api.get_team_awards({teamId:e})}],user:[function(e){return f.default.api.get_user_solves({userId:e})},function(e){return f.default.api.get_user_fails({userId:e})},function(e){return f.default.api.get_user_awards({userId:e})}]};(0,s.default)(function(){(0,s.default)(".delete-user").click(_),(0,s.default)(".edit-user").click(function(e){(0,s.default)("#user-info-modal").modal("toggle")}),(0,s.default)(".award-user").click(function(e){(0,s.default)("#user-award-modal").modal("toggle")}),(0,s.default)(".email-user").click(function(e){(0,s.default)("#user-email-modal").modal("toggle")}),(0,s.default)(".addresses-user").click(function(e){(0,s.default)("#user-addresses-modal").modal("toggle")}),(0,s.default)("#user-mail-form").submit(T),(0,s.default)("#solves-delete-button").click(function(e){w(0,"solves")}),(0,s.default)("#fails-delete-button").click(function(e){w(0,"fails")}),(0,s.default)("#awards-delete-button").click(function(e){var a,t;a=(0,s.default)("input[data-award-id]:checked").map(function(){return(0,s.default)(this).data("award-id")}),t=1===a.length?"award":"awards",(0,m.ezQuery)({title:"Delete Awards",body:"Are you sure you want to delete ".concat(a.length," ").concat(t,"?"),success:function(){var e,t=[],o=y(a);try{for(o.s();!(e=o.n()).done;){var i=e.value,n=f.default.fetch("/api/v1/awards/"+i,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});t.push(n)}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}),(0,s.default)("#missing-solve-button").click(function(e){var r;(e=e).preventDefault(),r=(0,s.default)("input[data-missing-challenge-id]:checked").map(function(){return(0,s.default)(this).data("missing-challenge-id")}),e=1===r.length?"challenge":"challenges",(0,m.ezQuery)({title:"Mark Correct",body:"Are you sure you want to mark ".concat(r.length," ").concat(e," correct for ").concat((0,o.htmlEntities)(window.USER_NAME),"?"),success:function(){var e,t=[],o=y(r);try{for(o.s();!(e=o.n()).done;){var i=e.value,n={provided:"MARKED AS SOLVED BY ADMIN",user_id:window.USER_ID,team_id:window.TEAM_ID,challenge_id:i,type:"correct"},a=f.default.fetch("/api/v1/submissions",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)});t.push(a)}}catch(e){o.e(e)}finally{o.f()}Promise.all(t).then(function(e){window.location.reload()})}})}),(0,s.default)("#user-info-create-form").submit(v),(0,s.default)("#user-info-edit-form").submit(j),(0,s.default)("#user-award-form").submit(b);var d,e=a.default.extend(r.default),t=document.createElement("div"),e=(document.querySelector("#comment-box").appendChild(t),new e({propsData:{type:"user",id:window.USER_ID}}).$mount(t),window.stats_data),c=e.type,l=e.id,u=e.name,p=e.account_id;(0,s.default)("#user-statistics-modal").on("shown.bs.modal",function(e){var t,o,i,n,a,r,s;o=l,i=u,n=p,a=g(C[t=c],3),r=a[0],s=a[1],a=a[2],Promise.all([r(n),s(n),a(n)]).then(function(e){(0,h.createGraph)("score_graph","#score-graph",e,t,o,i,n),(0,h.createGraph)("category_breakdown","#categories-pie-graph",e,t,o,i,n),(0,h.createGraph)("solve_percentages","#keys-pie-graph",e,t,o,i,n)}),d=setInterval(function(){var t,o,i,n,e,a,r;o=l,i=u,n=p,e=g(C[t=c],3),a=e[0],r=e[1],e=e[2],Promise.all([a(n),r(n),e(n)]).then(function(e){(0,h.updateGraph)("score_graph","#score-graph",e,t,o,i,n),(0,h.updateGraph)("category_breakdown","#categories-pie-graph",e,t,o,i,n),(0,h.updateGraph)("solve_percentages","#keys-pie-graph",e,t,o,i,n)})},3e5)}),(0,s.default)("#user-statistics-modal").on("hidden.bs.modal",function(e){clearInterval(d)}),(0,s.default)(".statistics-user").click(function(e){(0,s.default)("#user-statistics-modal").modal("toggle")})})},"./CTFd/themes/admin/assets/js/styles.js":function(l,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=d,e.bindMarkdownEditors=c,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var o=t("./CTFd/themes/core/assets/js/utils.js"),n=r(t("./node_modules/jquery/dist/jquery.js")),i=r(t("./node_modules/easymde/src/js/easymde.js")),u=r(t("./node_modules/vue/dist/vue.esm.browser.js")),p=r(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),a=r(t("./node_modules/highlight.js/lib/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=u.default.extend(p.default),o=document.createElement("div"),i=(document.querySelector("main").appendChild(o),new t({propsData:{editor:e}}).$mount(o));(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){i.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function d(e){var t;!1===e.hasOwnProperty("mde")&&(t=new i.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:a.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function c(){(0,n.default)("textarea.markdown").each(function(e,t){d(t)})}e.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),o=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(o,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,n.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),c(),(0,o.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){a.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(l,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=n(t("./CTFd/themes/core/assets/js/fetch.js")),o=n(t("./CTFd/themes/core/assets/js/config.js")),i=t("./CTFd/themes/core/assets/js/api.js"),p=(t("./CTFd/themes/core/assets/js/patch.js"),n(t("./node_modules/markdown-it/index.js"))),f=n(t("./node_modules/jquery/dist/jquery.js")),t=n(t("./CTFd/themes/core/assets/js/ezq.js"));function n(e){return e&&e.__esModule?e:{default:e}}function a(t,e){var o,i=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,o)),i}function r(i){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(o).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(o),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=u.format(e.title,e.body),t=(0,a.default)(t),o=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((o=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),o.click(function(){e.onclick()})),!1!==e.autohide),i=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:o,delay:n,animation:i}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),o=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(y)),i=(0,a.default)(g);return t.find(".modal-footer").append(i),t.find(".modal-footer").append(o),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(o).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=p.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function v(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:i,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:v}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,o("./node_modules/whatwg-fetch/fetch.js");var i=(o=o("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var n=window.fetch;t.default=function(e,t){return e=i.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=i.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/graphs.js":function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createGraph=function(e,t,o,i,n,a,r){var e=l[e],s=c.default.init(document.querySelector(t));s.setOption(e.format(i,n,a,r,o)),(0,d.default)(window).on("resize",function(){null!=s&&s.resize()})},t.disposeGraph=function(e){c.default.dispose(document.querySelector(e))},t.updateGraph=function(e,t,o,i,n,a,r){e=l[e];c.default.init(document.querySelector(t)).setOption(e.format(i,n,a,r,o))};var d=i(o("./node_modules/jquery/dist/jquery.js")),c=i(o("./node_modules/echarts/dist/echarts-en.common.js")),p=i(o("./node_modules/dayjs/dayjs.min.js")),m=o("./CTFd/themes/core/assets/js/utils.js");function i(e){return e&&e.__esModule?e:{default:e}}var l={score_graph:{format:function(l,e,t,u,o){var i={title:{left:"center",text:"Score over Time"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[t]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]},n=[],a=[],r=o[0].data,o=o[2].data,s=r.concat(o);s.sort(function(e,t){return new Date(e.date)-new Date(t.date)});for(var d=0;d").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var o,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((o=(0,a.default)(this).index(),function(e,t){e=n(e,o),t=n(t,o);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteSelectedUsers(_event) {\n var userIDs = (0, _jquery[\"default\"])(\"input[data-user-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"user-id\");\n });\n var target = userIDs.length === 1 ? \"user\" : \"users\";\n (0, _ezq.ezQuery)({\n title: \"Delete Users\",\n body: \"Are you sure you want to delete \".concat(userIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(userIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var userID = _step.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/users/\".concat(userID), {\n method: \"DELETE\"\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction bulkEditUsers(_event) {\n var userIDs = (0, _jquery[\"default\"])(\"input[data-user-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"user-id\");\n });\n (0, _ezq.ezAlert)({\n title: \"Edit Users\",\n body: (0, _jquery[\"default\"])(\"\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \"),\n button: \"Submit\",\n success: function success() {\n var data = (0, _jquery[\"default\"])(\"#users-bulk-edit\").serializeJSON(true);\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(userIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var userID = _step2.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/users/\".concat(userID), {\n method: \"PATCH\",\n body: JSON.stringify(data)\n }));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#users-delete-button\").click(deleteSelectedUsers);\n (0, _jquery[\"default\"])(\"#users-edit-button\").click(bulkEditUsers);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/users.js?"); +eval("\n\n__webpack_require__(/*! ./main */ \"./CTFd/themes/admin/assets/js/pages/main.js\");\n\nvar _CTFd = _interopRequireDefault(__webpack_require__(/*! core/CTFd */ \"./CTFd/themes/core/assets/js/CTFd.js\"));\n\nvar _jquery = _interopRequireDefault(__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\"));\n\nvar _ezq = __webpack_require__(/*! core/ezq */ \"./CTFd/themes/core/assets/js/ezq.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction deleteSelectedUsers(_event) {\n var userIDs = (0, _jquery[\"default\"])(\"input[data-user-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"user-id\");\n });\n var target = userIDs.length === 1 ? \"user\" : \"users\";\n (0, _ezq.ezQuery)({\n title: \"Delete Users\",\n body: \"Are you sure you want to delete \".concat(userIDs.length, \" \").concat(target, \"?\"),\n success: function success() {\n var reqs = [];\n\n var _iterator = _createForOfIteratorHelper(userIDs),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var userID = _step.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/users/\".concat(userID), {\n method: \"DELETE\"\n }));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\nfunction bulkEditUsers(_event) {\n var userIDs = (0, _jquery[\"default\"])(\"input[data-user-id]:checked\").map(function () {\n return (0, _jquery[\"default\"])(this).data(\"user-id\");\n });\n (0, _ezq.ezAlert)({\n title: \"Edit Users\",\n body: (0, _jquery[\"default\"])(\"\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \"),\n button: \"Submit\",\n success: function success() {\n var data = (0, _jquery[\"default\"])(\"#users-bulk-edit\").serializeJSON(true);\n var reqs = [];\n\n var _iterator2 = _createForOfIteratorHelper(userIDs),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var userID = _step2.value;\n reqs.push(_CTFd[\"default\"].fetch(\"/api/v1/users/\".concat(userID), {\n method: \"PATCH\",\n body: JSON.stringify(data)\n }));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n Promise.all(reqs).then(function (_responses) {\n window.location.reload();\n });\n }\n });\n}\n\n(0, _jquery[\"default\"])(function () {\n (0, _jquery[\"default\"])(\"#users-delete-button\").click(deleteSelectedUsers);\n (0, _jquery[\"default\"])(\"#users-edit-button\").click(bulkEditUsers);\n});\n\n//# sourceURL=webpack:///./CTFd/themes/admin/assets/js/pages/users.js?"); /***/ }) diff --git a/CTFd/themes/admin/static/js/pages/users.min.js b/CTFd/themes/admin/static/js/pages/users.min.js index 713648ef7..57b0c47a8 100644 --- a/CTFd/themes/admin/static/js/pages/users.min.js +++ b/CTFd/themes/admin/static/js/pages/users.min.js @@ -1 +1 @@ -!function(d){function e(e){for(var t,i,o=e[0],n=e[1],a=e[2],r=0,s=[];r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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 a,r=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n '),button:"Submit",success:function(){var e,t=(0,s.default)("#users-bulk-edit").serializeJSON(!0),i=[],o=d(a);try{for(o.s();!(e=o.n()).done;){var n=e.value;i.push(r.default.fetch("/api/v1/users/".concat(n),{method:"PATCH",body:JSON.stringify(t)}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(i).then(function(e){window.location.reload()})}})}(0,s.default)(function(){(0,s.default)("#users-delete-button").click(a),(0,s.default)("#users-edit-button").click(p)})},"./CTFd/themes/admin/assets/js/styles.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.showMediaLibrary=p,t.bindMarkdownEditor=l,t.bindMarkdownEditors=u,t.default=void 0,i("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var o=i("./CTFd/themes/core/assets/js/utils.js"),n=c(i("./node_modules/jquery/dist/jquery.js")),a=c(i("./node_modules/easymde/src/js/easymde.js")),r=c(i("./node_modules/vue/dist/vue.esm.browser.js")),s=c(i("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),d=c(i("./node_modules/highlight.js/lib/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=r.default.extend(s.default),i=document.createElement("div");document.querySelector("main").appendChild(i);var o=new t({propsData:{editor:e}}).$mount(i);(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function l(e){var t;!1===e.hasOwnProperty("mde")&&(t=new a.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){p(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:d.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function u(){(0,n.default)("textarea.markdown").each(function(e,t){l(t)})}t.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e,t=sessionStorage.getItem("activeTab");t&&((e=(0,n.default)('.nav-tabs a[href="'.concat(t,'"], .nav-pills a[href="').concat(t,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),u(),(0,o.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){d.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=c(i("./CTFd/themes/core/assets/js/fetch.js")),n=c(i("./CTFd/themes/core/assets/js/config.js")),a=i("./CTFd/themes/core/assets/js/api.js");i("./CTFd/themes/core/assets/js/patch.js");var r=c(i("./node_modules/markdown-it/index.js")),s=c(i("./node_modules/jquery/dist/jquery.js")),d=c(i("./CTFd/themes/core/assets/js/ezq.js"));function c(e){return e&&e.__esModule?e:{default:e}}function p(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function l(n){for(var e=1;e".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(l.format(e.button));return e.success&&(0,s.default)(o).click(function(){e.success()}),e.large&&i.find(".modal-dialog").addClass("modal-lg"),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),i.modal("show"),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),i}function h(e){(0,s.default)("#ezq--notifications-toast-container").length||(0,s.default)("body").append((0,s.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t,i=d.format(e.title,e.body),o=(0,s.default)(i);e.onclose&&(0,s.default)(o).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((t=(0,s.default)(o).find(".toast-body")).addClass("cursor-pointer"),t.click(function(){e.onclick()}));var n=!1!==e.autohide,a=!1!==e.animation,r=e.delay||1e4;return(0,s.default)("#ezq--notifications-toast-container").prepend(o),o.toast({autohide:n,delay:r,animation:a}),o.toast("show"),o}function v(e){var t=r.format(e.title),i=(0,s.default)(t);"string"==typeof e.body?i.find(".modal-body").append("

".concat(e.body,"

")):i.find(".modal-body").append((0,s.default)(e.body));var o=(0,s.default)(f),n=(0,s.default)(u);return i.find(".modal-footer").append(n),i.find(".modal-footer").append(o),i.find("pre code").each(function(e){a.default.highlightBlock(this)}),(0,s.default)("main").append(i),(0,s.default)(i).on("hidden.bs.modal",function(){(0,s.default)(this).modal("dispose")}),(0,s.default)(o).click(function(){e.success()}),i.modal("show"),i}function g(e){if(e.target){var t=(0,s.default)(e.target);return t.find(".progress-bar").css("width",e.width+"%"),t}var i=c.format(e.width),o=r.format(e.title),n=(0,s.default)(o);return n.find(".modal-body").append((0,s.default)(i)),(0,s.default)("main").append(n),n.modal("show")}function y(e){var t={success:p,error:n}[e.type].format(e.body);return(0,s.default)(t)}var j={ezAlert:m,ezToast:h,ezQuery:v,ezProgressBar:g,ezBadge:y};t.default=j},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o,n=(o=i("./CTFd/themes/core/assets/js/config.js"))&&o.__esModule?o:{default:o};var a=window.fetch;t.default=function(e,t){return void 0===t&&(t={method:"GET",credentials:"same-origin",headers:{}}),e=n.default.urlRoot+e,void 0===t.headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=n.default.csrfNonce,a(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var o,s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},n=i("./CTFd/themes/core/assets/js/api.js");function r(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function a(n){for(var e=1;e").text(e).html()},t.cumulativeSum=function(e){for(var t=e.concat(),i=0;i'),(0,r.default)("th.sort-col").click(function(){var n,e=(0,r.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((n=(0,r.default)(this).index(),function(e,t){var i=a(e,n),o=a(t,n);return r.default.isNumeric(i)&&r.default.isNumeric(o)?i-o:i.toString().localeCompare(o)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var i=0;i=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};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 n,a=!0,r=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==o.return||o.return()}finally{if(r)throw n}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n '),button:"Submit",success:function(){var e,t=(0,s.default)("#users-bulk-edit").serializeJSON(!0),i=[],o=d(a);try{for(o.s();!(e=o.n()).done;){var n=e.value;i.push(r.default.fetch("/api/v1/users/".concat(n),{method:"PATCH",body:JSON.stringify(t)}))}}catch(e){o.e(e)}finally{o.f()}Promise.all(i).then(function(e){window.location.reload()})}})}(0,s.default)(function(){(0,s.default)("#users-delete-button").click(o),(0,s.default)("#users-edit-button").click(n)})},"./CTFd/themes/admin/assets/js/styles.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.bindMarkdownEditor=d,e.bindMarkdownEditors=c,e.default=void 0,e.showMediaLibrary=s,t("./node_modules/bootstrap/dist/js/bootstrap.bundle.js");var i=t("./CTFd/themes/core/assets/js/utils.js"),n=r(t("./node_modules/jquery/dist/jquery.js")),o=r(t("./node_modules/easymde/src/js/easymde.js")),l=r(t("./node_modules/vue/dist/vue.esm.browser.js")),u=r(t("./CTFd/themes/admin/assets/js/components/files/MediaLibrary.vue")),a=r(t("./node_modules/highlight.js/lib/index.js"));function r(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=l.default.extend(u.default),i=document.createElement("div"),o=(document.querySelector("main").appendChild(i),new t({propsData:{editor:e}}).$mount(i));(0,n.default)("#media-modal").on("hidden.bs.modal",function(e){o.$destroy(),(0,n.default)("#media-modal").remove()}),(0,n.default)("#media-modal").modal()}function d(e){var t;!1===e.hasOwnProperty("mde")&&(t=new o.default({autoDownloadFontAwesome:!1,toolbar:["bold","italic","heading","|","quote","unordered-list","ordered-list","|","link","image",{name:"media",action:function(e){s(e)},className:"fas fa-file-upload",title:"Media Library"},"|","preview","guide"],element:e,initialValue:(0,n.default)(e).val(),forceSync:!0,minHeight:"200px",renderingConfig:{codeSyntaxHighlighting:!0,hljs:a.default}}),e.mde=t,e.codemirror=t.codemirror,(0,n.default)(e).on("change keyup paste",function(){t.codemirror.getDoc().setValue((0,n.default)(e).val()),t.codemirror.refresh()}))}function c(){(0,n.default)("textarea.markdown").each(function(e,t){d(t)})}e.default=function(){(0,n.default)(":input").each(function(){(0,n.default)(this).data("initial",(0,n.default)(this).val())}),(0,n.default)(function(){(0,n.default)("tr[data-href], td[data-href]").click(function(){var e;return getSelection().toString()||(e=(0,n.default)(this).attr("data-href"))&&(window.location=e),!1}),(0,n.default)("[data-checkbox]").click(function(e){(0,n.default)(e.target).is("input[type=checkbox]")||(0,n.default)(this).find("input[type=checkbox]").click(),e.stopImmediatePropagation()}),(0,n.default)("[data-checkbox-all]").on("click change",function(e){var t=(0,n.default)(this).prop("checked"),i=(0,n.default)(this).index()+1;(0,n.default)(this).closest("table").find("tr td:nth-child(".concat(i,") input[type=checkbox]")).prop("checked",t),e.stopImmediatePropagation()}),(0,n.default)("tr[data-href] a, tr[data-href] button").click(function(e){(0,n.default)(this).attr("data-dismiss")||e.stopPropagation()}),(0,n.default)(".page-select").change(function(){var e=new URL(window.location);e.searchParams.set("page",this.value),window.location.href=e.toString()}),(0,n.default)('a[data-toggle="tab"]').on("shown.bs.tab",function(e){sessionStorage.setItem("activeTab",(0,n.default)(e.target).attr("href"))});var e=sessionStorage.getItem("activeTab");e&&((e=(0,n.default)('.nav-tabs a[href="'.concat(e,'"], .nav-pills a[href="').concat(e,'"]'))).length?e.tab("show"):sessionStorage.removeItem("activeTab")),c(),(0,i.makeSortableTables)(),(0,n.default)('[data-toggle="tooltip"]').tooltip(),document.querySelectorAll("pre code").forEach(function(e){a.default.highlightBlock(e)})})}},"./CTFd/themes/core/assets/js/CTFd.js":function(p,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=n(t("./CTFd/themes/core/assets/js/fetch.js")),i=n(t("./CTFd/themes/core/assets/js/config.js")),o=t("./CTFd/themes/core/assets/js/api.js"),u=(t("./CTFd/themes/core/assets/js/patch.js"),n(t("./node_modules/markdown-it/index.js"))),f=n(t("./node_modules/jquery/dist/jquery.js")),t=n(t("./CTFd/themes/core/assets/js/ezq.js"));function n(e){return e&&e.__esModule?e:{default:e}}function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function r(o){for(var e=1;e".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(h.format(e.button)));return e.success&&(0,a.default)(i).click(function(){e.success()}),e.large&&t.find(".modal-dialog").addClass("modal-lg"),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),t.modal("show"),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),t}function s(e){(0,a.default)("#ezq--notifications-toast-container").length||(0,a.default)("body").append((0,a.default)("
").attr({id:"ezq--notifications-toast-container"}).css({position:"fixed",bottom:"0",right:"0","min-width":"20%"}));var t=l.format(e.title,e.body),t=(0,a.default)(t),i=(e.onclose&&(0,a.default)(t).find("button[data-dismiss=toast]").click(function(){e.onclose()}),e.onclick&&((i=(0,a.default)(t).find(".toast-body")).addClass("cursor-pointer"),i.click(function(){e.onclick()})),!1!==e.autohide),o=!1!==e.animation,n=e.delay||1e4;return(0,a.default)("#ezq--notifications-toast-container").prepend(t),t.toast({autohide:i,delay:n,animation:o}),t.toast("show"),t}function d(e){var t=r.format(e.title),t=(0,a.default)(t),i=("string"==typeof e.body?t.find(".modal-body").append("

".concat(e.body,"

")):t.find(".modal-body").append((0,a.default)(e.body)),(0,a.default)(v)),o=(0,a.default)(g);return t.find(".modal-footer").append(o),t.find(".modal-footer").append(i),t.find("pre code").each(function(e){n.default.highlightBlock(this)}),(0,a.default)("main").append(t),(0,a.default)(t).on("hidden.bs.modal",function(){(0,a.default)(this).modal("dispose")}),(0,a.default)(i).click(function(){e.success()}),t.modal("show"),t}function c(e){if(e.target)return(t=(0,a.default)(e.target)).find(".progress-bar").css("width",e.width+"%"),t;var t=u.format(e.width),e=r.format(e.title),e=(0,a.default)(e);return e.find(".modal-body").append((0,a.default)(t)),(0,a.default)("main").append(e),e.modal("show")}function y(e){e={success:m,error:f}[e.type].format(e.body);return(0,a.default)(e)}e.default={ezAlert:o,ezToast:s,ezQuery:d,ezProgressBar:c,ezBadge:y}},"./CTFd/themes/core/assets/js/fetch.js":function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i("./node_modules/whatwg-fetch/fetch.js");var o=(i=i("./CTFd/themes/core/assets/js/config.js"))&&i.__esModule?i:{default:i};var n=window.fetch;t.default=function(e,t){return e=o.default.urlRoot+e,void 0===(t=void 0===t?{method:"GET",credentials:"same-origin",headers:{}}:t).headers&&(t.headers={}),t.credentials="same-origin",t.headers.Accept="application/json",t.headers["Content-Type"]="application/json",t.headers["CSRF-Token"]=o.default.csrfNonce,n(e,t)}},"./CTFd/themes/core/assets/js/patch.js":function(e,t,i){var s=(o=i("./node_modules/q/q.js"))&&o.__esModule?o:{default:o},o=i("./CTFd/themes/core/assets/js/api.js");function a(t,e){var i,o=Object.keys(t);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(t),e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)),o}function n(o){for(var e=1;e").text(e).html()},t.inc_notification_counter=function(){var e=n.getItem(r)||0;n.setItem(r,++e),(0,a.default)(".badge-notification").text(e)},t.init_notification_counter=function(){var e=n.getItem(r);null===e?n.setItem(r,0):0'),(0,a.default)("th.sort-col").click(function(){var i,e=(0,a.default)(this).parents("table").eq(0),t=e.find("tr:gt(0)").toArray().sort((i=(0,a.default)(this).index(),function(e,t){e=n(e,i),t=n(t,i);return a.default.isNumeric(e)&&a.default.isNumeric(t)?e-t:e.toString().localeCompare(t)}));this.asc=!this.asc,this.asc||(t=t.reverse());for(var o=0;o 0) {\n throw new Error('Invalid string. Length must be a multiple of 4');\n } // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n\n\n var validLen = b64.indexOf('=');\n if (validLen === -1) validLen = len;\n var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n} // base64 is 4/3 + up to two characters of the original data\n\n\nfunction byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n}\n\nfunction _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n}\n\nfunction toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars\n\n var len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i;\n\n for (i = 0; i < len; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[curByte++] = tmp >> 16 & 0xFF;\n arr[curByte++] = tmp >> 8 & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[curByte++] = tmp & 0xFF;\n }\n\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n\n return arr;\n}\n\nfunction tripletToBase64(num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n}\n\nfunction encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);\n output.push(tripletToBase64(tmp));\n }\n\n return output.join('');\n}\n\nfunction fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');\n }\n\n return parts.join('');\n}\n\n//# sourceURL=webpack:///./node_modules/base64-js/index.js?"); - -/***/ }), - /***/ "./node_modules/bootstrap/dist/js/bootstrap.bundle.js": /*!************************************************************!*\ !*** ./node_modules/bootstrap/dist/js/bootstrap.bundle.js ***! @@ -20,7 +8,7 @@ eval("\n\nexports.byteLength = byteLength;\nexports.toByteArray = toByteArray;\n /***/ (function(module, exports, __webpack_require__) { ; -eval("/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*!\n * Bootstrap v4.3.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n(function (global, factory) {\n ( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (undefined);\n})(void 0, function (exports, $) {\n 'use strict';\n\n $ = $ && $.hasOwnProperty('default') ? $['default'] : $;\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined; // eslint-disable-line no-undefined\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $(this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator;\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n var hrefAttr = element.getAttribute('href');\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';\n }\n\n try {\n return document.querySelector(selector) ? selector : null;\n } catch (err) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $(element).css('transition-duration');\n var transitionDelay = $(element).css('transition-delay');\n var floatTransitionDuration = parseFloat(transitionDuration);\n var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END);\n },\n // TODO: Remove in v5\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n },\n findShadowRoot: function findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null;\n } // Can find the shadow root otherwise it'll return the document\n\n\n if (typeof element.getRootNode === 'function') {\n var root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n } // when we don't find a shadow root\n\n\n if (!element.parentNode) {\n return null;\n }\n\n return Util.findShadowRoot(element.parentNode);\n }\n };\n setTransitionEndSupport();\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME = 'alert';\n var VERSION = '4.3.1';\n var DATA_KEY = 'bs.alert';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $.fn[NAME];\n var Selector = {\n DISMISS: '[data-dismiss=\"alert\"]'\n };\n var Event = {\n CLOSE: \"close\" + EVENT_KEY,\n CLOSED: \"closed\" + EVENT_KEY,\n CLICK_DATA_API: \"click\" + EVENT_KEY + DATA_API_KEY\n };\n var ClassName = {\n ALERT: 'alert',\n FADE: 'fade',\n SHOW: 'show'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Alert = /*#__PURE__*/function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype; // Public\n\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY);\n this._element = null;\n } // Private\n ;\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n if (!parent) {\n parent = $(element).closest(\".\" + ClassName.ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $.Event(Event.CLOSE);\n $(element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $(element).removeClass(ClassName.SHOW);\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $(element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $(element).detach().trigger(Event.CLOSED).remove();\n } // Static\n ;\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $(this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY, data);\n }\n\n if (config === 'close') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Alert;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface;\n $.fn[NAME].Constructor = Alert;\n\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Alert._jQueryInterface;\n };\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$1 = 'button';\n var VERSION$1 = '4.3.1';\n var DATA_KEY$1 = 'bs.button';\n var EVENT_KEY$1 = \".\" + DATA_KEY$1;\n var DATA_API_KEY$1 = '.data-api';\n var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];\n var ClassName$1 = {\n ACTIVE: 'active',\n BUTTON: 'btn',\n FOCUS: 'focus'\n };\n var Selector$1 = {\n DATA_TOGGLE_CARROT: '[data-toggle^=\"button\"]',\n DATA_TOGGLE: '[data-toggle=\"buttons\"]',\n INPUT: 'input:not([type=\"hidden\"])',\n ACTIVE: '.active',\n BUTTON: '.btn'\n };\n var Event$1 = {\n CLICK_DATA_API: \"click\" + EVENT_KEY$1 + DATA_API_KEY$1,\n FOCUS_BLUR_DATA_API: \"focus\" + EVENT_KEY$1 + DATA_API_KEY$1 + \" \" + (\"blur\" + EVENT_KEY$1 + DATA_API_KEY$1)\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Button = /*#__PURE__*/function () {\n function Button(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Button.prototype; // Public\n\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];\n\n if (rootElement) {\n var input = this._element.querySelector(Selector$1.INPUT);\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = rootElement.querySelector(Selector$1.ACTIVE);\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName$1.ACTIVE);\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {\n return;\n }\n\n input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);\n $(input).trigger('change');\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName$1.ACTIVE);\n }\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$1);\n this._element = null;\n } // Static\n ;\n\n Button._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$1);\n\n if (!data) {\n data = new Button(this);\n $(this).data(DATA_KEY$1, data);\n }\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$1;\n }\n }]);\n\n return Button;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {\n event.preventDefault();\n var button = event.target;\n\n if (!$(button).hasClass(ClassName$1.BUTTON)) {\n button = $(button).closest(Selector$1.BUTTON);\n }\n\n Button._jQueryInterface.call($(button), 'toggle');\n }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {\n var button = $(event.target).closest(Selector$1.BUTTON)[0];\n $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$1] = Button._jQueryInterface;\n $.fn[NAME$1].Constructor = Button;\n\n $.fn[NAME$1].noConflict = function () {\n $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;\n return Button._jQueryInterface;\n };\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$2 = 'carousel';\n var VERSION$2 = '4.3.1';\n var DATA_KEY$2 = 'bs.carousel';\n var EVENT_KEY$2 = \".\" + DATA_KEY$2;\n var DATA_API_KEY$2 = '.data-api';\n var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var SWIPE_THRESHOLD = 40;\n var Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true,\n touch: true\n };\n var DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean',\n touch: 'boolean'\n };\n var Direction = {\n NEXT: 'next',\n PREV: 'prev',\n LEFT: 'left',\n RIGHT: 'right'\n };\n var Event$2 = {\n SLIDE: \"slide\" + EVENT_KEY$2,\n SLID: \"slid\" + EVENT_KEY$2,\n KEYDOWN: \"keydown\" + EVENT_KEY$2,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$2,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$2,\n TOUCHSTART: \"touchstart\" + EVENT_KEY$2,\n TOUCHMOVE: \"touchmove\" + EVENT_KEY$2,\n TOUCHEND: \"touchend\" + EVENT_KEY$2,\n POINTERDOWN: \"pointerdown\" + EVENT_KEY$2,\n POINTERUP: \"pointerup\" + EVENT_KEY$2,\n DRAG_START: \"dragstart\" + EVENT_KEY$2,\n LOAD_DATA_API: \"load\" + EVENT_KEY$2 + DATA_API_KEY$2,\n CLICK_DATA_API: \"click\" + EVENT_KEY$2 + DATA_API_KEY$2\n };\n var ClassName$2 = {\n CAROUSEL: 'carousel',\n ACTIVE: 'active',\n SLIDE: 'slide',\n RIGHT: 'carousel-item-right',\n LEFT: 'carousel-item-left',\n NEXT: 'carousel-item-next',\n PREV: 'carousel-item-prev',\n ITEM: 'carousel-item',\n POINTER_EVENT: 'pointer-event'\n };\n var Selector$2 = {\n ACTIVE: '.active',\n ACTIVE_ITEM: '.active.carousel-item',\n ITEM: '.carousel-item',\n ITEM_IMG: '.carousel-item img',\n NEXT_PREV: '.carousel-item-next, .carousel-item-prev',\n INDICATORS: '.carousel-indicators',\n DATA_SLIDE: '[data-slide], [data-slide-to]',\n DATA_RIDE: '[data-ride=\"carousel\"]'\n };\n var PointerType = {\n TOUCH: 'touch',\n PEN: 'pen'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Carousel = /*#__PURE__*/function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this.touchStartX = 0;\n this.touchDeltaX = 0;\n this._config = this._getConfig(config);\n this._element = element;\n this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype; // Public\n\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (this._element.querySelector(Selector$2.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $(this._element).one(Event$2.SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $(this._element).off(EVENT_KEY$2);\n $.removeData(this._element, DATA_KEY$2);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default, config);\n Util.typeCheckConfig(NAME$2, config, DefaultType);\n return config;\n };\n\n _proto._handleSwipe = function _handleSwipe() {\n var absDeltax = Math.abs(this.touchDeltaX);\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return;\n }\n\n var direction = absDeltax / this.touchDeltaX; // swipe left\n\n if (direction > 0) {\n this.prev();\n } // swipe right\n\n\n if (direction < 0) {\n this.next();\n }\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $(this._element).on(Event$2.KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === 'hover') {\n $(this._element).on(Event$2.MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(Event$2.MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners();\n }\n };\n\n _proto._addTouchEventListeners = function _addTouchEventListeners() {\n var _this3 = this;\n\n if (!this._touchSupported) {\n return;\n }\n\n var start = function start(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchStartX = event.originalEvent.clientX;\n } else if (!_this3._pointerEvent) {\n _this3.touchStartX = event.originalEvent.touches[0].clientX;\n }\n };\n\n var move = function move(event) {\n // ensure swiping with one touch and not pinching\n if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {\n _this3.touchDeltaX = 0;\n } else {\n _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;\n }\n };\n\n var end = function end(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;\n }\n\n _this3._handleSwipe();\n\n if (_this3._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n _this3.pause();\n\n if (_this3.touchTimeout) {\n clearTimeout(_this3.touchTimeout);\n }\n\n _this3.touchTimeout = setTimeout(function (event) {\n return _this3.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);\n }\n };\n\n $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {\n return e.preventDefault();\n });\n\n if (this._pointerEvent) {\n $(this._element).on(Event$2.POINTERDOWN, function (event) {\n return start(event);\n });\n $(this._element).on(Event$2.POINTERUP, function (event) {\n return end(event);\n });\n\n this._element.classList.add(ClassName$2.POINTER_EVENT);\n } else {\n $(this._element).on(Event$2.TOUCHSTART, function (event) {\n return start(event);\n });\n $(this._element).on(Event$2.TOUCHMOVE, function (event) {\n return move(event);\n });\n $(this._element).on(Event$2.TOUCHEND, function (event) {\n return end(event);\n });\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n\n default:\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === Direction.NEXT;\n var isPrevDirection = direction === Direction.PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === Direction.PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));\n\n var slideEvent = $.Event(Event$2.SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $(this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));\n $(indicators).removeClass(ClassName$2.ACTIVE);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName$2.ACTIVE);\n }\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this4 = this;\n\n var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName$2.LEFT;\n orderClassName = ClassName$2.NEXT;\n eventDirectionName = Direction.LEFT;\n } else {\n directionalClassName = ClassName$2.RIGHT;\n orderClassName = ClassName$2.PREV;\n eventDirectionName = Direction.RIGHT;\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n var slidEvent = $.Event(Event$2.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($(this._element).hasClass(ClassName$2.SLIDE)) {\n $(nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $(activeElement).addClass(directionalClassName);\n $(nextElement).addClass(directionalClassName);\n var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);\n\n if (nextElementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval;\n this._config.interval = nextElementInterval;\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $(activeElement).one(Util.TRANSITION_END, function () {\n $(nextElement).removeClass(directionalClassName + \" \" + orderClassName).addClass(ClassName$2.ACTIVE);\n $(activeElement).removeClass(ClassName$2.ACTIVE + \" \" + orderClassName + \" \" + directionalClassName);\n _this4._isSliding = false;\n setTimeout(function () {\n return $(_this4._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $(activeElement).removeClass(ClassName$2.ACTIVE);\n $(nextElement).addClass(ClassName$2.ACTIVE);\n this._isSliding = false;\n $(this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n } // Static\n ;\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$2);\n\n var _config = _objectSpread({}, Default, $(this).data());\n\n if (_typeof(config) === 'object') {\n _config = _objectSpread({}, _config, config);\n }\n\n var action = typeof config === 'string' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $(this).data(DATA_KEY$2, data);\n }\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + action + \"\\\"\");\n }\n\n data[action]();\n } else if (_config.interval && _config.ride) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $(selector)[0];\n\n if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {\n return;\n }\n\n var config = _objectSpread({}, $(target).data(), $(this).data());\n\n var slideIndex = this.getAttribute('data-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($(target), config);\n\n if (slideIndex) {\n $(target).data(DATA_KEY$2).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$2;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);\n $(window).on(Event$2.LOAD_DATA_API, function () {\n var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));\n\n for (var i = 0, len = carousels.length; i < len; i++) {\n var $carousel = $(carousels[i]);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$2] = Carousel._jQueryInterface;\n $.fn[NAME$2].Constructor = Carousel;\n\n $.fn[NAME$2].noConflict = function () {\n $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;\n return Carousel._jQueryInterface;\n };\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$3 = 'collapse';\n var VERSION$3 = '4.3.1';\n var DATA_KEY$3 = 'bs.collapse';\n var EVENT_KEY$3 = \".\" + DATA_KEY$3;\n var DATA_API_KEY$3 = '.data-api';\n var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];\n var Default$1 = {\n toggle: true,\n parent: ''\n };\n var DefaultType$1 = {\n toggle: 'boolean',\n parent: '(string|element)'\n };\n var Event$3 = {\n SHOW: \"show\" + EVENT_KEY$3,\n SHOWN: \"shown\" + EVENT_KEY$3,\n HIDE: \"hide\" + EVENT_KEY$3,\n HIDDEN: \"hidden\" + EVENT_KEY$3,\n CLICK_DATA_API: \"click\" + EVENT_KEY$3 + DATA_API_KEY$3\n };\n var ClassName$3 = {\n SHOW: 'show',\n COLLAPSE: 'collapse',\n COLLAPSING: 'collapsing',\n COLLAPSED: 'collapsed'\n };\n var Dimension = {\n WIDTH: 'width',\n HEIGHT: 'height'\n };\n var Selector$3 = {\n ACTIVES: '.show, .collapsing',\n DATA_TOGGLE: '[data-toggle=\"collapse\"]'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Collapse = /*#__PURE__*/function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = [].slice.call(document.querySelectorAll(\"[data-toggle=\\\"collapse\\\"][href=\\\"#\" + element.id + \"\\\"],\" + (\"[data-toggle=\\\"collapse\\\"][data-target=\\\"#\" + element.id + \"\\\"]\")));\n var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));\n\n for (var i = 0, len = toggleList.length; i < len; i++) {\n var elem = toggleList[i];\n var selector = Util.getSelectorFromElement(elem);\n var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {\n return foundElem === element;\n });\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype; // Public\n\n _proto.toggle = function toggle() {\n if ($(this._element).hasClass(ClassName$3.SHOW)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {\n if (typeof _this._config.parent === 'string') {\n return elem.getAttribute('data-parent') === _this._config.parent;\n }\n\n return elem.classList.contains(ClassName$3.COLLAPSE);\n });\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY$3);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $.Event(Event$3.SHOW);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');\n\n if (!activesData) {\n $(actives).data(DATA_KEY$3, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length) {\n $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);\n _this._element.style[dimension] = '';\n\n _this.setTransitioning(false);\n\n $(_this._element).trigger(Event$3.SHOWN);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = \"scroll\" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + \"px\";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {\n return;\n }\n\n var startEvent = $.Event(Event$3.HIDE);\n $(this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + \"px\";\n Util.reflow(this._element);\n $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);\n var triggerArrayLength = this._triggerArray.length;\n\n if (triggerArrayLength > 0) {\n for (var i = 0; i < triggerArrayLength; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $([].slice.call(document.querySelectorAll(selector)));\n\n if (!$elem.hasClass(ClassName$3.SHOW)) {\n $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);\n };\n\n this._element.style[dimension] = '';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$3);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default$1, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME$3, config, DefaultType$1);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $(this._element).hasClass(Dimension.WIDTH);\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It's a jQuery object\n\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0];\n }\n } else {\n parent = document.querySelector(this._config.parent);\n }\n\n var selector = \"[data-toggle=\\\"collapse\\\"][data-parent=\\\"\" + this._config.parent + \"\\\"]\";\n var children = [].slice.call(parent.querySelectorAll(selector));\n $(children).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n var isOpen = $(element).hasClass(ClassName$3.SHOW);\n\n if (triggerArray.length) {\n $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);\n }\n } // Static\n ;\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $(this);\n var data = $this.data(DATA_KEY$3);\n\n var _config = _objectSpread({}, Default$1, $this.data(), _typeof(config) === 'object' && config ? config : {});\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $this.data(DATA_KEY$3, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$3;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$1;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n var $trigger = $(this);\n var selector = Util.getSelectorFromElement(this);\n var selectors = [].slice.call(document.querySelectorAll(selector));\n $(selectors).each(function () {\n var $target = $(this);\n var data = $target.data(DATA_KEY$3);\n var config = data ? 'toggle' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$3] = Collapse._jQueryInterface;\n $.fn[NAME$3].Constructor = Collapse;\n\n $.fn[NAME$3].noConflict = function () {\n $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;\n return Collapse._jQueryInterface;\n };\n /**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.14.7\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 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n var timeoutDuration = 0;\n\n for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n }\n\n function microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n }\n\n function taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n }\n\n var supportsMicroTasks = isBrowser && window.Promise;\n /**\n * Create a debounced version of a method, that's asynchronously deferred\n * but called in the minimum time possible.\n *\n * @method\n * @memberof Popper.Utils\n * @argument {Function} fn\n * @returns {Function}\n */\n\n var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n /**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\n\n function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n }\n /**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\n\n\n function getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n } // NOTE: 1 DOM access here\n\n\n var window = element.ownerDocument.defaultView;\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n }\n /**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\n\n\n function getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n\n return element.parentNode || element.host;\n }\n /**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\n\n\n function getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n\n case '#document':\n return element.body;\n } // Firefox want us to check `-x` and `-y` variations as well\n\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n }\n\n var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\n var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n /**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\n\n function isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n\n if (version === 10) {\n return isIE10;\n }\n\n return isIE11 || isIE10;\n }\n /**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n\n\n function getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here\n\n var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent\n\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n } // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n\n\n if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n }\n\n function isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n }\n /**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\n\n\n function getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n }\n /**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\n\n\n function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n } // Here we make sure to give as \"start\" the element that comes first in the DOM\n\n\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1; // Get common ancestor container\n\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n } // one of the nodes is inside shadowDOM, find which one\n\n\n var element1root = getRoot(element1);\n\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n }\n /**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\n\n\n function getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n }\n /*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\n\n\n function includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n }\n /*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\n\n function getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);\n }\n\n function getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);\n }\n\n function getWindowSizes(document) {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n }\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var defineProperty = function defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n };\n\n var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n /**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\n\n\n function getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n }\n /**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\n\n\n function getBoundingClientRect(element) {\n var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n }; // subtract scrollbar size from sizes\n\n var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n }\n\n function getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth, 10);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop, 10);\n var marginLeft = parseFloat(styles.marginLeft, 10);\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them\n\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n }\n\n function getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n return getClientRect(offset);\n }\n /**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\n\n\n function isFixed(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n\n var parentNode = getParentNode(element);\n\n if (!parentNode) {\n return false;\n }\n\n return isFixed(parentNode);\n }\n /**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\n\n function getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n\n var el = element.parentElement;\n\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n\n return el || document.documentElement;\n }\n /**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\n\n\n function getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here\n\n var boundaries = {\n top: 0,\n left: 0\n };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); // Handle viewport case\n\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation\n\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(popper.ownerDocument),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n } // Add paddings\n\n\n padding = padding || 0;\n var isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0;\n boundaries.top += isPaddingNumber ? padding : padding.top || 0;\n boundaries.right -= isPaddingNumber ? padding : padding.right || 0;\n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;\n return boundaries;\n }\n\n function getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n return width * height;\n }\n /**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n var variation = placement.split('-')[1];\n return computedPlacement + (variation ? '-' + variation : '');\n }\n /**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\n\n\n function getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n }\n /**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\n\n\n function getOuterSizes(element) {\n var window = element.ownerDocument.defaultView;\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n }\n /**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\n\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 * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\n\n\n function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0]; // Get popper node sizes\n\n var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object\n\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n }; // depending by the popper placement we have to compute its offsets slightly differently\n\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n }\n /**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\n\n\n function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n } // use `filter` to obtain the same behavior of `find`\n\n\n return arr.filter(check)[0];\n }\n /**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\n\n\n function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n } // use `find` + `indexOf` if `findIndex` isn't supported\n\n\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n }\n /**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\n\n\n function runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n data = fn(data, modifier);\n }\n });\n return data;\n }\n /**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\n\n\n function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n }; // compute reference element offsets\n\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement`\n\n data.originalPlacement = data.placement;\n data.positionFixed = this.options.positionFixed; // compute the popper offsets\n\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers\n\n data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n }\n /**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\n\n\n function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n }\n /**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\n\n\n function getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n\n return null;\n }\n /**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\n\n\n function destroy() {\n this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled\n\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners(); // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n\n return this;\n }\n /**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\n\n\n function getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n }\n\n function attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, {\n passive: true\n });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n\n scrollParents.push(target);\n }\n /**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\n\n\n function setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, {\n passive: true\n }); // Scroll event listener on scroll parents\n\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n return state;\n }\n /**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\n\n\n function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n }\n /**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\n\n\n function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }\n /**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\n\n\n function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n }\n /**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\n\n\n function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n }\n /**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\n\n\n function setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = ''; // add unit if the value is numeric and is one of the following\n\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n\n element.style[prop] = styles[prop] + unit;\n });\n }\n /**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\n\n\n function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\n\n\n function applyStyle(data) {\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 setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n\n setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties\n\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n }\n /**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\n\n\n function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n\n setStyles(popper, {\n position: options.positionFixed ? 'fixed' : 'absolute'\n });\n return options;\n }\n /**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\n\n\n function getRoundedOffsets(data, shouldRound) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var round = Math.round,\n floor = Math.floor;\n\n var noRound = function noRound(v) {\n return v;\n };\n\n var referenceWidth = round(reference.width);\n var popperWidth = round(popper.width);\n var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n var isVariation = data.placement.indexOf('-') !== -1;\n var sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;\n var verticalToInteger = !shouldRound ? noRound : round;\n return {\n left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right)\n };\n }\n\n var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n function computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent); // Styles\n\n var styles = {\n position: popper.position\n };\n var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n\n var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n\n var left = void 0,\n top = void 0;\n\n if (sideA === 'bottom') {\n // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n } // Attributes\n\n\n var attributes = {\n 'x-placement': data.placement\n }; // Update `data` attributes, styles and arrowStyles\n\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n return data;\n }\n /**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\n\n\n function isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n\n return isRequired;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function arrow(data, options) {\n var _data$offsets$arrow; // arrow depends on keepTogether in order to work\n\n\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector\n\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier\n\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len]; //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n // top/left side\n\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n } // bottom/right side\n\n\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n\n data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper\n\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper\n\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n return data;\n }\n /**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\n\n\n function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n\n return variation;\n }\n /**\n * List of accepted placements to use as values of the `placement` option.
\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\n\n\n var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; // Get rid of `auto` `auto-start` and `auto-end`\n\n var validPlacements = placements.slice(3);\n /**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\n\n function clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n }\n\n var BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n };\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\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 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here\n\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required\n\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n }\n /**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\n\n\n function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2]; // If it's not a number it's an operator, I guess\n\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n }\n /**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\n\n\n function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n }); // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n } // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n\n\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; // Convert the values with units to absolute pixels to allow our computations\n\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, []) // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n }); // Loop trough the offsets arrays and execute the operations\n\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\n\n\n function offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var basePlacement = placement.split('-')[0];\n var offsets = void 0;\n\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n } // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n\n\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n options.boundaries = boundaries;\n var order = options.priority;\n var popper = data.offsets.popper;\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n\n return defineProperty({}, mainSide, value);\n }\n };\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n data.offsets.popper = popper;\n return data;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier\n\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n }\n /**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\n\n\n function inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n return data;\n }\n /**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n /**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\n\n\n var modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: offset,\n\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: arrow,\n\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: flip,\n\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: computeStyle,\n\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n\n /** @prop {ModifierFn} */\n fn: applyStyle,\n\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined\n }\n };\n /**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n /**\n * Default options provided to Popper.js constructor.
\n * These can be overridden using the `options` argument of Popper.js.
\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\n\n var Defaults = {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers: modifiers\n };\n /**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n /**\n * @callback onUpdate\n * @param {dataObject} data\n */\n // Utils\n // Methods\n\n var Popper = function () {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n }; // make update() debounced, so that it only runs at most once-per-tick\n\n\n this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it\n\n this.options = _extends({}, Popper.Defaults, options); // init state\n\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n }; // get reference and popper elements (allow jQuery wrappers)\n\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options\n\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n }); // Refactoring modifiers' list (Object => Array)\n\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n }) // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n }); // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n }); // fire the first update to position the popper in the right place\n\n this.update();\n var eventsEnabled = this.options.eventsEnabled;\n\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n } // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n }();\n /**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\n Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n Popper.placements = placements;\n Popper.Defaults = Defaults;\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$4 = 'dropdown';\n var VERSION$4 = '4.3.1';\n var DATA_KEY$4 = 'bs.dropdown';\n var EVENT_KEY$4 = \".\" + DATA_KEY$4;\n var DATA_API_KEY$4 = '.data-api';\n var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + \"|\" + ARROW_DOWN_KEYCODE + \"|\" + ESCAPE_KEYCODE);\n var Event$4 = {\n HIDE: \"hide\" + EVENT_KEY$4,\n HIDDEN: \"hidden\" + EVENT_KEY$4,\n SHOW: \"show\" + EVENT_KEY$4,\n SHOWN: \"shown\" + EVENT_KEY$4,\n CLICK: \"click\" + EVENT_KEY$4,\n CLICK_DATA_API: \"click\" + EVENT_KEY$4 + DATA_API_KEY$4,\n KEYDOWN_DATA_API: \"keydown\" + EVENT_KEY$4 + DATA_API_KEY$4,\n KEYUP_DATA_API: \"keyup\" + EVENT_KEY$4 + DATA_API_KEY$4\n };\n var ClassName$4 = {\n DISABLED: 'disabled',\n SHOW: 'show',\n DROPUP: 'dropup',\n DROPRIGHT: 'dropright',\n DROPLEFT: 'dropleft',\n MENURIGHT: 'dropdown-menu-right',\n MENULEFT: 'dropdown-menu-left',\n POSITION_STATIC: 'position-static'\n };\n var Selector$4 = {\n DATA_TOGGLE: '[data-toggle=\"dropdown\"]',\n FORM_CHILD: '.dropdown form',\n MENU: '.dropdown-menu',\n NAVBAR_NAV: '.navbar-nav',\n VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n };\n var AttachmentMap = {\n TOP: 'top-start',\n TOPEND: 'top-end',\n BOTTOM: 'bottom-start',\n BOTTOMEND: 'bottom-end',\n RIGHT: 'right-start',\n RIGHTEND: 'right-end',\n LEFT: 'left-start',\n LEFTEND: 'left-end'\n };\n var Default$2 = {\n offset: 0,\n flip: true,\n boundary: 'scrollParent',\n reference: 'toggle',\n display: 'dynamic'\n };\n var DefaultType$2 = {\n offset: '(number|string|function)',\n flip: 'boolean',\n boundary: '(string|element)',\n reference: '(string|element)',\n display: 'string'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Dropdown = /*#__PURE__*/function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype; // Public\n\n _proto.toggle = function toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n var isActive = $(this._menu).hasClass(ClassName$4.SHOW);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $.Event(Event$4.SHOW, relatedTarget);\n $(parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Disable totally Popper.js for Dropdown in Navbar\n\n\n if (!this._inNavbar) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper.js (https://popper.js.org/)');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it's jQuery element\n\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName$4.POSITION_STATIC);\n }\n\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n $(this._menu).toggleClass(ClassName$4.SHOW);\n $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));\n };\n\n _proto.show = function show() {\n if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $.Event(Event$4.SHOW, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $(parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n }\n\n $(this._menu).toggleClass(ClassName$4.SHOW);\n $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));\n };\n\n _proto.hide = function hide() {\n if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var hideEvent = $.Event(Event$4.HIDE, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(this._menu).toggleClass(ClassName$4.SHOW);\n $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$4);\n $(this._element).off(EVENT_KEY$4);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Private\n ;\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $(this._element).on(Event$4.CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);\n Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n if (parent) {\n this._menu = parent.querySelector(Selector$4.MENU);\n }\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $(this._element.parentNode);\n var placement = AttachmentMap.BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {\n placement = AttachmentMap.TOP;\n\n if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {\n placement = AttachmentMap.TOPEND;\n }\n } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT;\n } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {\n placement = AttachmentMap.LEFT;\n } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0;\n };\n\n _proto._getOffset = function _getOffset() {\n var _this2 = this;\n\n var offset = {};\n\n if (typeof this._config.offset === 'function') {\n offset.fn = function (data) {\n data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});\n return data;\n };\n } else {\n offset.offset = this._config.offset;\n }\n\n return offset;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n } // Disable Popper.js if we have a static display\n\n };\n\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return popperConfig;\n } // Static\n ;\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$4);\n\n var _config = _typeof(config) === 'object' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $(this).data(DATA_KEY$4, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));\n\n for (var i = 0, len = toggles.length; i < len; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $(toggles[i]).data(DATA_KEY$4);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$(parent).hasClass(ClassName$4.SHOW)) {\n continue;\n }\n\n if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $.Event(Event$4.HIDE, relatedTarget);\n $(parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n toggles[i].setAttribute('aria-expanded', 'false');\n $(dropdownMenu).removeClass(ClassName$4.SHOW);\n $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n return parent || element.parentNode;\n } // eslint-disable-next-line complexity\n ;\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $(parent).hasClass(ClassName$4.SHOW);\n\n if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);\n $(toggle).trigger('focus');\n }\n\n $(this).trigger('click');\n return;\n }\n\n var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$4;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$2;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$2;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + \" \" + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($(this), 'toggle');\n }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$4] = Dropdown._jQueryInterface;\n $.fn[NAME$4].Constructor = Dropdown;\n\n $.fn[NAME$4].noConflict = function () {\n $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;\n return Dropdown._jQueryInterface;\n };\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$5 = 'modal';\n var VERSION$5 = '4.3.1';\n var DATA_KEY$5 = 'bs.modal';\n var EVENT_KEY$5 = \".\" + DATA_KEY$5;\n var DATA_API_KEY$5 = '.data-api';\n var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];\n var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var Default$3 = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType$3 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean',\n show: 'boolean'\n };\n var Event$5 = {\n HIDE: \"hide\" + EVENT_KEY$5,\n HIDDEN: \"hidden\" + EVENT_KEY$5,\n SHOW: \"show\" + EVENT_KEY$5,\n SHOWN: \"shown\" + EVENT_KEY$5,\n FOCUSIN: \"focusin\" + EVENT_KEY$5,\n RESIZE: \"resize\" + EVENT_KEY$5,\n CLICK_DISMISS: \"click.dismiss\" + EVENT_KEY$5,\n KEYDOWN_DISMISS: \"keydown.dismiss\" + EVENT_KEY$5,\n MOUSEUP_DISMISS: \"mouseup.dismiss\" + EVENT_KEY$5,\n MOUSEDOWN_DISMISS: \"mousedown.dismiss\" + EVENT_KEY$5,\n CLICK_DATA_API: \"click\" + EVENT_KEY$5 + DATA_API_KEY$5\n };\n var ClassName$5 = {\n SCROLLABLE: 'modal-dialog-scrollable',\n SCROLLBAR_MEASURER: 'modal-scrollbar-measure',\n BACKDROP: 'modal-backdrop',\n OPEN: 'modal-open',\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector$5 = {\n DIALOG: '.modal-dialog',\n MODAL_BODY: '.modal-body',\n DATA_TOGGLE: '[data-toggle=\"modal\"]',\n DATA_DISMISS: '[data-dismiss=\"modal\"]',\n FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT: '.sticky-top'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Modal = /*#__PURE__*/function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = element.querySelector(Selector$5.DIALOG);\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._isTransitioning = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype; // Public\n\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isShown || this._isTransitioning) {\n return;\n }\n\n if ($(this._element).hasClass(ClassName$5.FADE)) {\n this._isTransitioning = true;\n }\n\n var showEvent = $.Event(Event$5.SHOW, {\n relatedTarget: relatedTarget\n });\n $(this._element).trigger(showEvent);\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {\n return _this.hide(event);\n });\n $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {\n $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {\n if ($(event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n\n var hideEvent = $.Event(Event$5.HIDE);\n $(this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $(this._element).hasClass(ClassName$5.FADE);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $(document).off(Event$5.FOCUSIN);\n $(this._element).removeClass(ClassName$5.SHOW);\n $(this._element).off(Event$5.CLICK_DISMISS);\n $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $(this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n [window, this._element, this._dialog].forEach(function (htmlElement) {\n return $(htmlElement).off(EVENT_KEY$5);\n });\n /**\n * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `Event.CLICK_DATA_API` event that should remain\n */\n\n $(document).off(Event$5.FOCUSIN);\n $.removeData(this._element, DATA_KEY$5);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._isTransitioning = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default$3, config);\n Util.typeCheckConfig(NAME$5, config, DefaultType$3);\n return config;\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this3 = this;\n\n var transition = $(this._element).hasClass(ClassName$5.FADE);\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) {\n this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0;\n } else {\n this._element.scrollTop = 0;\n }\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $(this._element).addClass(ClassName$5.SHOW);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $.Event(Event$5.SHOWN, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this3._config.focus) {\n _this3._element.focus();\n }\n\n _this3._isTransitioning = false;\n $(_this3._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);\n $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this4 = this;\n\n $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop\n .on(Event$5.FOCUSIN, function (event) {\n if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {\n _this4._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this5 = this;\n\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {\n if (event.which === ESCAPE_KEYCODE$1) {\n event.preventDefault();\n\n _this5.hide();\n }\n });\n } else if (!this._isShown) {\n $(this._element).off(Event$5.KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this6 = this;\n\n if (this._isShown) {\n $(window).on(Event$5.RESIZE, function (event) {\n return _this6.handleUpdate(event);\n });\n } else {\n $(window).off(Event$5.RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this7 = this;\n\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $(document.body).removeClass(ClassName$5.OPEN);\n\n _this7._resetAdjustments();\n\n _this7._resetScrollbar();\n\n $(_this7._element).trigger(Event$5.HIDDEN);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this8 = this;\n\n var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div');\n this._backdrop.className = ClassName$5.BACKDROP;\n\n if (animate) {\n this._backdrop.classList.add(animate);\n }\n\n $(this._backdrop).appendTo(document.body);\n $(this._element).on(Event$5.CLICK_DISMISS, function (event) {\n if (_this8._ignoreBackdropClick) {\n _this8._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (_this8._config.backdrop === 'static') {\n _this8._element.focus();\n } else {\n _this8.hide();\n }\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $(this._backdrop).addClass(ClassName$5.SHOW);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName$5.SHOW);\n\n var callbackRemove = function callbackRemove() {\n _this8._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($(this._element).hasClass(ClassName$5.FADE)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n } // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n ;\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + \"px\";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + \"px\";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this9 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));\n var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding\n\n $(fixedContent).each(function (index, element) {\n var actualPadding = element.style.paddingRight;\n var calculatedPadding = $(element).css('padding-right');\n $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + \"px\");\n }); // Adjust sticky content margin\n\n $(stickyContent).each(function (index, element) {\n var actualMargin = element.style.marginRight;\n var calculatedMargin = $(element).css('margin-right');\n $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + \"px\");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $(document.body).css('padding-right');\n $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + \"px\");\n }\n\n $(document.body).addClass(ClassName$5.OPEN);\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));\n $(fixedContent).each(function (index, element) {\n var padding = $(element).data('padding-right');\n $(element).removeData('padding-right');\n element.style.paddingRight = padding ? padding : '';\n }); // Restore sticky content\n\n var elements = [].slice.call(document.querySelectorAll(\"\" + Selector$5.STICKY_CONTENT));\n $(elements).each(function (index, element) {\n var margin = $(element).data('margin-right');\n\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right');\n }\n }); // Restore body padding\n\n var padding = $(document.body).data('padding-right');\n $(document.body).removeData('padding-right');\n document.body.style.paddingRight = padding ? padding : '';\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement('div');\n scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n } // Static\n ;\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$5);\n\n var _config = _objectSpread({}, Default$3, $(this).data(), _typeof(config) === 'object' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $(this).data(DATA_KEY$5, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$5;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$3;\n }\n }]);\n\n return Modal;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {\n var _this10 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault();\n }\n\n var $target = $(target).one(Event$5.SHOW, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(Event$5.HIDDEN, function () {\n if ($(_this10).is(':visible')) {\n _this10.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($(target), config, this);\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME$5] = Modal._jQueryInterface;\n $.fn[NAME$5].Constructor = Modal;\n\n $.fn[NAME$5].noConflict = function () {\n $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;\n return Modal._jQueryInterface;\n };\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];\n var ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\n var DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n /**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n };\n var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n /**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;\n\n function allowedAttribute(attr, allowedAttributeList) {\n var attrName = attr.nodeName.toLowerCase();\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));\n }\n\n return true;\n }\n\n var regExp = allowedAttributeList.filter(function (attrRegex) {\n return attrRegex instanceof RegExp;\n }); // Check if a regular expression validates the attribute.\n\n for (var i = 0, l = regExp.length; i < l; i++) {\n if (attrName.match(regExp[i])) {\n return true;\n }\n }\n\n return false;\n }\n\n function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml;\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml);\n }\n\n var domParser = new window.DOMParser();\n var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n var whitelistKeys = Object.keys(whiteList);\n var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));\n\n var _loop = function _loop(i, len) {\n var el = elements[i];\n var elName = el.nodeName.toLowerCase();\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el);\n return \"continue\";\n }\n\n var attributeList = [].slice.call(el.attributes);\n var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);\n attributeList.forEach(function (attr) {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName);\n }\n });\n };\n\n for (var i = 0, len = elements.length; i < len; i++) {\n var _ret = _loop(i, len);\n\n if (_ret === \"continue\") continue;\n }\n\n return createdDocument.body.innerHTML;\n }\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$6 = 'tooltip';\n var VERSION$6 = '4.3.1';\n var DATA_KEY$6 = 'bs.tooltip';\n var EVENT_KEY$6 = \".\" + DATA_KEY$6;\n var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];\n var DefaultType$4 = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string|function)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n whiteList: 'object'\n };\n var AttachmentMap$1 = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default$4 = {\n animation: true,\n template: '
' + '
' + '
',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent',\n sanitize: true,\n sanitizeFn: null,\n whiteList: DefaultWhitelist\n };\n var HoverState = {\n SHOW: 'show',\n OUT: 'out'\n };\n var Event$6 = {\n HIDE: \"hide\" + EVENT_KEY$6,\n HIDDEN: \"hidden\" + EVENT_KEY$6,\n SHOW: \"show\" + EVENT_KEY$6,\n SHOWN: \"shown\" + EVENT_KEY$6,\n INSERTED: \"inserted\" + EVENT_KEY$6,\n CLICK: \"click\" + EVENT_KEY$6,\n FOCUSIN: \"focusin\" + EVENT_KEY$6,\n FOCUSOUT: \"focusout\" + EVENT_KEY$6,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$6,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$6\n };\n var ClassName$6 = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector$6 = {\n TOOLTIP: '.tooltip',\n TOOLTIP_INNER: '.tooltip-inner',\n ARROW: '.arrow'\n };\n var Trigger = {\n HOVER: 'hover',\n FOCUS: 'focus',\n CLICK: 'click',\n MANUAL: 'manual'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Tooltip = /*#__PURE__*/function () {\n function Tooltip(element, config) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper.js (https://popper.js.org/)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype; // Public\n\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $.removeData(this.element, this.constructor.DATA_KEY);\n $(this.element).off(this.constructor.EVENT_KEY);\n $(this.element).closest('.modal').off('hide.bs.modal');\n\n if (this.tip) {\n $(this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $.Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent);\n var shadowRoot = Util.findShadowRoot(this.element);\n var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $(tip).addClass(ClassName$6.FADE);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n\n var container = this._getContainer();\n\n $(tip).data(this.constructor.DATA_KEY, this);\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container);\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper(this.element, tip, {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector$6.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n return _this._handlePopperPlacementChange(data);\n }\n });\n $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $(_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HoverState.OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($(this.tip).hasClass(ClassName$6.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $.Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $(this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop);\n }\n\n this._activeTrigger[Trigger.CLICK] = false;\n this._activeTrigger[Trigger.FOCUS] = false;\n this._activeTrigger[Trigger.HOVER] = false;\n\n if ($(this.tip).hasClass(ClassName$6.FADE)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Protected\n ;\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var tip = this.getTipElement();\n this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());\n $(tip).removeClass(ClassName$6.FADE + \" \" + ClassName$6.SHOW);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n if (_typeof(content) === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($(content).text());\n }\n\n return;\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);\n }\n\n $element.html(content);\n } else {\n $element.text(content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n } // Private\n ;\n\n _proto._getOffset = function _getOffset() {\n var _this3 = this;\n\n var offset = {};\n\n if (typeof this.config.offset === 'function') {\n offset.fn = function (data) {\n data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});\n return data;\n };\n } else {\n offset.offset = this.config.offset;\n }\n\n return offset;\n };\n\n _proto._getContainer = function _getContainer() {\n if (this.config.container === false) {\n return document.body;\n }\n\n if (Util.isElement(this.config.container)) {\n return $(this.config.container);\n }\n\n return $(document).find(this.config.container);\n };\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap$1[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this4 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {\n return _this4.toggle(event);\n });\n } else if (trigger !== Trigger.MANUAL) {\n var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;\n var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;\n $(_this4.element).on(eventIn, _this4.config.selector, function (event) {\n return _this4._enter(event);\n }).on(eventOut, _this4.config.selector, function (event) {\n return _this4._leave(event);\n });\n }\n });\n $(this.element).closest('.modal').on('hide.bs.modal', function () {\n if (_this4.element) {\n _this4.hide();\n }\n });\n\n if (this.config.selector) {\n this.config = _objectSpread({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = _typeof(this.element.getAttribute('data-original-title'));\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;\n }\n\n if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $(event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $(event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HoverState.OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HoverState.OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n var dataAttributes = $(this.element).data();\n Object.keys(dataAttributes).forEach(function (dataAttr) {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr];\n }\n });\n config = _objectSpread({}, this.constructor.Default, dataAttributes, _typeof(config) === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);\n }\n\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {\n var popperInstance = popperData.instance;\n this.tip = popperInstance.popper;\n\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(popperData.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $(tip).removeClass(ClassName$6.FADE);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n } // Static\n ;\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$6);\n\n var _config = _typeof(config) === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $(this).data(DATA_KEY$6, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$6;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$4;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME$6;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY$6;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event$6;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY$6;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$4;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME$6] = Tooltip._jQueryInterface;\n $.fn[NAME$6].Constructor = Tooltip;\n\n $.fn[NAME$6].noConflict = function () {\n $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;\n return Tooltip._jQueryInterface;\n };\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$7 = 'popover';\n var VERSION$7 = '4.3.1';\n var DATA_KEY$7 = 'bs.popover';\n var EVENT_KEY$7 = \".\" + DATA_KEY$7;\n var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];\n var CLASS_PREFIX$1 = 'bs-popover';\n var BSCLS_PREFIX_REGEX$1 = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX$1 + \"\\\\S+\", 'g');\n\n var Default$5 = _objectSpread({}, Tooltip.Default, {\n placement: 'right',\n trigger: 'click',\n content: '',\n template: '
' + '
' + '

' + '
'\n });\n\n var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {\n content: '(string|element|function)'\n });\n\n var ClassName$7 = {\n FADE: 'fade',\n SHOW: 'show'\n };\n var Selector$7 = {\n TITLE: '.popover-header',\n CONTENT: '.popover-body'\n };\n var Event$7 = {\n HIDE: \"hide\" + EVENT_KEY$7,\n HIDDEN: \"hidden\" + EVENT_KEY$7,\n SHOW: \"show\" + EVENT_KEY$7,\n SHOWN: \"shown\" + EVENT_KEY$7,\n INSERTED: \"inserted\" + EVENT_KEY$7,\n CLICK: \"click\" + EVENT_KEY$7,\n FOCUSIN: \"focusin\" + EVENT_KEY$7,\n FOCUSOUT: \"focusout\" + EVENT_KEY$7,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$7,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$7\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var Popover = /*#__PURE__*/function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype; // Overrides\n\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(CLASS_PREFIX$1 + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $(this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector$7.CONTENT), content);\n $tip.removeClass(ClassName$7.FADE + \" \" + ClassName$7.SHOW);\n } // Private\n ;\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute('data-content') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $(this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n } // Static\n ;\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $(this).data(DATA_KEY$7);\n\n var _config = _typeof(config) === 'object' ? config : null;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $(this).data(DATA_KEY$7, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: \"VERSION\",\n // Getters\n get: function get() {\n return VERSION$7;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$5;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME$7;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY$7;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event$7;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY$7;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$5;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $.fn[NAME$7] = Popover._jQueryInterface;\n $.fn[NAME$7].Constructor = Popover;\n\n $.fn[NAME$7].noConflict = function () {\n $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;\n return Popover._jQueryInterface;\n };\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n\n var NAME$8 = 'scrollspy';\n var VERSION$8 = '4.3.1';\n var DATA_KEY$8 = 'bs.scrollspy';\n var EVENT_KEY$8 = \".\" + DATA_KEY$8;\n var DATA_API_KEY$6 = '.data-api';\n var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];\n var Default$6 = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n var DefaultType$6 = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n var Event$8 = {\n ACTIVATE: \"activate\" + EVENT_KEY$8,\n SCROLL: \"scroll\" + EVENT_KEY$8,\n LOAD_DATA_API: \"load\" + EVENT_KEY$8 + DATA_API_KEY$6\n };\n var ClassName$8 = {\n DROPDOWN_ITEM: 'dropdown-item',\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active'\n };\n var Selector$8 = {\n DATA_SPY: '[data-spy=\"scroll\"]',\n ACTIVE: '.active',\n NAV_LIST_GROUP: '.nav, .list-group',\n NAV_LINKS: '.nav-link',\n NAV_ITEMS: '.nav-item',\n LIST_ITEMS: '.list-group-item',\n DROPDOWN: '.dropdown',\n DROPDOWN_ITEMS: '.dropdown-item',\n DROPDOWN_TOGGLE: '.dropdown-toggle'\n };\n var OffsetMethod = {\n OFFSET: 'offset',\n POSITION: 'position'\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n };\n\n var ScrollSpy = /*#__PURE__*/function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === 'BODY' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + \" \" + Selector$8.NAV_LINKS + \",\" + (this._config.target + \" \" + Selector$8.LIST_ITEMS + \",\") + (this._config.target + \" \" + Selector$8.DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $(this._scrollElement).on(Event$8.SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype; // Public\n\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;\n var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = [].slice.call(document.querySelectorAll(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = document.querySelector(targetSelector);\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$(target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(function (item) {\n return item;\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $.removeData(this._element, DATA_KEY$8);\n $(this._scrollElement).off(EVENT_KEY$8);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _objectSpread({}, Default$6, _typeof(config) === 'object' && config ? config : {});\n\n if (typeof config.target !== 'string') {\n var id = $(config.target).attr('id');\n\n if (!id) {\n id = Util.getUID(NAME$8);\n $(config.target).attr('id', id);\n }\n\n config.target = \"#\" + id;\n }\n\n Util.typeCheckConfig(NAME$8, config, DefaultType$6);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n var offsetLength = this._offsets.length;\n\n for (var i = offsetLength; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(',').map(function (selector) {\n return selector + \"[data-target=\\\"\" + target + \"\\\"],\" + selector + \"[href=\\\"\" + target + \"\\\"]\";\n });\n\n var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));\n\n if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {\n $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);\n $link.addClass(ClassName$8.ACTIVE);\n } else {\n // Set triggered link as active\n $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active\n // With both