\")\n\n this.$renderLine(html, row, false, row == foldStart ? foldLine : false);\n\n if (this.$useLineGroups())\n html.push(\"
\"); // end the line group\n\n row++;\n }\n this.element.innerHTML = html.join(\"\");\n };\n\n this.$textToken = {\n \"text\": true,\n \"rparen\": true,\n \"lparen\": true\n };\n\n this.$renderToken = function(stringBuilder, screenColumn, token, value) {\n var self = this;\n var replaceReg = /\\t|&|<|>|( +)|([\\x00-\\x1f\\x80-\\xa0\\xad\\u1680\\u180E\\u2000-\\u200f\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF\\uFFF9-\\uFFFC])|[\\u1100-\\u115F\\u11A3-\\u11A7\\u11FA-\\u11FF\\u2329-\\u232A\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3000-\\u303E\\u3041-\\u3096\\u3099-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u31BA\\u31C0-\\u31E3\\u31F0-\\u321E\\u3220-\\u3247\\u3250-\\u32FE\\u3300-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE66\\uFE68-\\uFE6B\\uFF01-\\uFF60\\uFFE0-\\uFFE6]/g;\n var replaceFunc = function(c, a, b, tabIdx, idx4) {\n if (a) {\n return self.showInvisibles\n ? \"\"\n );\n }\n\n stringBuilder.push(lang.stringRepeat(\"\\xa0\", splits.indent));\n\n split ++;\n screenColumn = 0;\n splitChars = splits[split] || Number.MAX_VALUE;\n }\n if (value.length != 0) {\n chars += value.length;\n screenColumn = this.$renderToken(\n stringBuilder, screenColumn, token, value\n );\n }\n }\n }\n };\n\n this.$renderSimpleLine = function(stringBuilder, tokens) {\n var screenColumn = 0;\n var token = tokens[0];\n var value = token.value;\n if (this.displayIndentGuides)\n value = this.renderIndentGuide(stringBuilder, value);\n if (value)\n screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value);\n for (var i = 1; i < tokens.length; i++) {\n token = tokens[i];\n value = token.value;\n screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value);\n }\n };\n this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) {\n if (!foldLine && foldLine != false)\n foldLine = this.session.getFoldLine(row);\n\n if (foldLine)\n var tokens = this.$getFoldLineTokens(row, foldLine);\n else\n var tokens = this.session.getTokens(row);\n\n\n if (!onlyContents) {\n stringBuilder.push(\n \"
\"\n );\n }\n\n if (tokens.length) {\n var splits = this.session.getRowSplitData(row);\n if (splits && splits.length)\n this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents);\n else\n this.$renderSimpleLine(stringBuilder, tokens);\n }\n\n if (this.showInvisibles) {\n if (foldLine)\n row = foldLine.end.row\n\n stringBuilder.push(\n \"\",\n row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR,\n \"\"\n );\n }\n if (!onlyContents)\n stringBuilder.push(\"
\");\n };\n\n this.$getFoldLineTokens = function(row, foldLine) {\n var session = this.session;\n var renderTokens = [];\n\n function addTokens(tokens, from, to) {\n var idx = 0, col = 0;\n while ((col + tokens[idx].value.length) < from) {\n col += tokens[idx].value.length;\n idx++;\n\n if (idx == tokens.length)\n return;\n }\n if (col != from) {\n var value = tokens[idx].value.substring(from - col);\n if (value.length > (to - from))\n value = value.substring(0, to - from);\n\n renderTokens.push({\n type: tokens[idx].type,\n value: value\n });\n\n col = from + value.length;\n idx += 1;\n }\n\n while (col < to && idx < tokens.length) {\n var value = tokens[idx].value;\n if (value.length + col > to) {\n renderTokens.push({\n type: tokens[idx].type,\n value: value.substring(0, to - col)\n });\n } else\n renderTokens.push(tokens[idx]);\n col += value.length;\n idx += 1;\n }\n }\n\n var tokens = session.getTokens(row);\n foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) {\n if (placeholder != null) {\n renderTokens.push({\n type: \"fold\",\n value: placeholder\n });\n } else {\n if (isNewRow)\n tokens = session.getTokens(row);\n\n if (tokens.length)\n addTokens(tokens, lastColumn, column);\n }\n }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);\n\n return renderTokens;\n };\n\n this.$useLineGroups = function() {\n return this.session.getUseWrapMode();\n };\n\n this.destroy = function() {\n clearInterval(this.$pollSizeChangesTimer);\n if (this.$measureNode)\n this.$measureNode.parentNode.removeChild(this.$measureNode);\n delete this.$measureNode;\n };\n\n}).call(Text.prototype);\n\nexports.Text = Text;\n\n});\n\nace.define(\"ace/layer/cursor\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar dom = acequire(\"../lib/dom\");\nvar isIE8;\n\nvar Cursor = function(parentEl) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_layer ace_cursor-layer\";\n parentEl.appendChild(this.element);\n \n if (isIE8 === undefined)\n isIE8 = !(\"opacity\" in this.element.style);\n\n this.isVisible = false;\n this.isBlinking = true;\n this.blinkInterval = 1000;\n this.smoothBlinking = false;\n\n this.cursors = [];\n this.cursor = this.addCursor();\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.$updateCursors = (isIE8\n ? this.$updateVisibility\n : this.$updateOpacity).bind(this);\n};\n\n(function() {\n \n this.$updateVisibility = function(val) {\n var cursors = this.cursors;\n for (var i = cursors.length; i--; )\n cursors[i].style.visibility = val ? \"\" : \"hidden\";\n };\n this.$updateOpacity = function(val) {\n var cursors = this.cursors;\n for (var i = cursors.length; i--; )\n cursors[i].style.opacity = val ? \"\" : \"0\";\n };\n \n\n this.$padding = 0;\n this.setPadding = function(padding) {\n this.$padding = padding;\n };\n\n this.setSession = function(session) {\n this.session = session;\n };\n\n this.setBlinking = function(blinking) {\n if (blinking != this.isBlinking){\n this.isBlinking = blinking;\n this.restartTimer();\n }\n };\n\n this.setBlinkInterval = function(blinkInterval) {\n if (blinkInterval != this.blinkInterval){\n this.blinkInterval = blinkInterval;\n this.restartTimer();\n }\n };\n\n this.setSmoothBlinking = function(smoothBlinking) {\n if (smoothBlinking != this.smoothBlinking && !isIE8) {\n this.smoothBlinking = smoothBlinking;\n dom.setCssClass(this.element, \"ace_smooth-blinking\", smoothBlinking);\n this.$updateCursors(true);\n this.$updateCursors = (this.$updateOpacity).bind(this);\n this.restartTimer();\n }\n };\n\n this.addCursor = function() {\n var el = dom.createElement(\"div\");\n el.className = \"ace_cursor\";\n this.element.appendChild(el);\n this.cursors.push(el);\n return el;\n };\n\n this.removeCursor = function() {\n if (this.cursors.length > 1) {\n var el = this.cursors.pop();\n el.parentNode.removeChild(el);\n return el;\n }\n };\n\n this.hideCursor = function() {\n this.isVisible = false;\n dom.addCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n\n this.showCursor = function() {\n this.isVisible = true;\n dom.removeCssClass(this.element, \"ace_hidden-cursors\");\n this.restartTimer();\n };\n\n this.restartTimer = function() {\n var update = this.$updateCursors;\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n if (this.smoothBlinking) {\n dom.removeCssClass(this.element, \"ace_smooth-blinking\");\n }\n \n update(true);\n\n if (!this.isBlinking || !this.blinkInterval || !this.isVisible)\n return;\n\n if (this.smoothBlinking) {\n setTimeout(function(){\n dom.addCssClass(this.element, \"ace_smooth-blinking\");\n }.bind(this));\n }\n \n var blink = function(){\n this.timeoutId = setTimeout(function() {\n update(false);\n }, 0.6 * this.blinkInterval);\n }.bind(this);\n\n this.intervalId = setInterval(function() {\n update(true);\n blink();\n }, this.blinkInterval);\n\n blink();\n };\n\n this.getPixelPosition = function(position, onScreen) {\n if (!this.config || !this.session)\n return {left : 0, top : 0};\n\n if (!position)\n position = this.session.selection.getCursor();\n var pos = this.session.documentToScreenPosition(position);\n var cursorLeft = this.$padding + pos.column * this.config.characterWidth;\n var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *\n this.config.lineHeight;\n\n return {left : cursorLeft, top : cursorTop};\n };\n\n this.update = function(config) {\n this.config = config;\n\n var selections = this.session.$selectionMarkers;\n var i = 0, cursorIndex = 0;\n\n if (selections === undefined || selections.length === 0){\n selections = [{cursor: null}];\n }\n\n for (var i = 0, n = selections.length; i < n; i++) {\n var pixelPos = this.getPixelPosition(selections[i].cursor, true);\n if ((pixelPos.top > config.height + config.offset ||\n pixelPos.top < 0) && i > 1) {\n continue;\n }\n\n var style = (this.cursors[cursorIndex++] || this.addCursor()).style;\n \n if (!this.drawCursor) {\n style.left = pixelPos.left + \"px\";\n style.top = pixelPos.top + \"px\";\n style.width = config.characterWidth + \"px\";\n style.height = config.lineHeight + \"px\";\n } else {\n this.drawCursor(style, pixelPos, config, selections[i], this.session);\n }\n }\n while (this.cursors.length > cursorIndex)\n this.removeCursor();\n\n var overwrite = this.session.getOverwrite();\n this.$setOverwrite(overwrite);\n this.$pixelPos = pixelPos;\n this.restartTimer();\n };\n \n this.drawCursor = null;\n\n this.$setOverwrite = function(overwrite) {\n if (overwrite != this.overwrite) {\n this.overwrite = overwrite;\n if (overwrite)\n dom.addCssClass(this.element, \"ace_overwrite-cursors\");\n else\n dom.removeCssClass(this.element, \"ace_overwrite-cursors\");\n }\n };\n\n this.destroy = function() {\n clearInterval(this.intervalId);\n clearTimeout(this.timeoutId);\n };\n\n}).call(Cursor.prototype);\n\nexports.Cursor = Cursor;\n\n});\n\nace.define(\"ace/scrollbar\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/lib/event_emitter\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"./lib/oop\");\nvar dom = acequire(\"./lib/dom\");\nvar event = acequire(\"./lib/event\");\nvar EventEmitter = acequire(\"./lib/event_emitter\").EventEmitter;\nvar MAX_SCROLL_H = 0x8000;\nvar ScrollBar = function(parent) {\n this.element = dom.createElement(\"div\");\n this.element.className = \"ace_scrollbar ace_scrollbar\" + this.classSuffix;\n\n this.inner = dom.createElement(\"div\");\n this.inner.className = \"ace_scrollbar-inner\";\n this.element.appendChild(this.inner);\n\n parent.appendChild(this.element);\n\n this.setVisible(false);\n this.skipEvent = false;\n\n event.addListener(this.element, \"scroll\", this.onScroll.bind(this));\n event.addListener(this.element, \"mousedown\", event.preventDefault);\n};\n\n(function() {\n oop.implement(this, EventEmitter);\n\n this.setVisible = function(isVisible) {\n this.element.style.display = isVisible ? \"\" : \"none\";\n this.isVisible = isVisible;\n this.coeff = 1;\n };\n}).call(ScrollBar.prototype);\nvar VScrollBar = function(parent, renderer) {\n ScrollBar.call(this, parent);\n this.scrollTop = 0;\n this.scrollHeight = 0;\n renderer.$scrollbarWidth = \n this.width = dom.scrollbarWidth(parent.ownerDocument);\n this.inner.style.width =\n this.element.style.width = (this.width || 15) + 5 + \"px\";\n};\n\noop.inherits(VScrollBar, ScrollBar);\n\n(function() {\n\n this.classSuffix = '-v';\n this.onScroll = function() {\n if (!this.skipEvent) {\n this.scrollTop = this.element.scrollTop;\n if (this.coeff != 1) {\n var h = this.element.clientHeight / this.scrollHeight;\n this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h);\n }\n this._emit(\"scroll\", {data: this.scrollTop});\n }\n this.skipEvent = false;\n };\n this.getWidth = function() {\n return this.isVisible ? this.width : 0;\n };\n this.setHeight = function(height) {\n this.element.style.height = height + \"px\";\n };\n this.setInnerHeight =\n this.setScrollHeight = function(height) {\n this.scrollHeight = height;\n if (height > MAX_SCROLL_H) {\n this.coeff = MAX_SCROLL_H / height;\n height = MAX_SCROLL_H;\n } else if (this.coeff != 1) {\n this.coeff = 1\n }\n this.inner.style.height = height + \"px\";\n };\n this.setScrollTop = function(scrollTop) {\n if (this.scrollTop != scrollTop) {\n this.skipEvent = true;\n this.scrollTop = scrollTop;\n this.element.scrollTop = scrollTop * this.coeff;\n }\n };\n\n}).call(VScrollBar.prototype);\nvar HScrollBar = function(parent, renderer) {\n ScrollBar.call(this, parent);\n this.scrollLeft = 0;\n this.height = renderer.$scrollbarWidth;\n this.inner.style.height =\n this.element.style.height = (this.height || 15) + 5 + \"px\";\n};\n\noop.inherits(HScrollBar, ScrollBar);\n\n(function() {\n\n this.classSuffix = '-h';\n this.onScroll = function() {\n if (!this.skipEvent) {\n this.scrollLeft = this.element.scrollLeft;\n this._emit(\"scroll\", {data: this.scrollLeft});\n }\n this.skipEvent = false;\n };\n this.getHeight = function() {\n return this.isVisible ? this.height : 0;\n };\n this.setWidth = function(width) {\n this.element.style.width = width + \"px\";\n };\n this.setInnerWidth = function(width) {\n this.inner.style.width = width + \"px\";\n };\n this.setScrollWidth = function(width) {\n this.inner.style.width = width + \"px\";\n };\n this.setScrollLeft = function(scrollLeft) {\n if (this.scrollLeft != scrollLeft) {\n this.skipEvent = true;\n this.scrollLeft = this.element.scrollLeft = scrollLeft;\n }\n };\n\n}).call(HScrollBar.prototype);\n\n\nexports.ScrollBar = VScrollBar; // backward compatibility\nexports.ScrollBarV = VScrollBar; // backward compatibility\nexports.ScrollBarH = HScrollBar; // backward compatibility\n\nexports.VScrollBar = VScrollBar;\nexports.HScrollBar = HScrollBar;\n});\n\nace.define(\"ace/renderloop\",[\"require\",\"exports\",\"module\",\"ace/lib/event\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar event = acequire(\"./lib/event\");\n\n\nvar RenderLoop = function(onRender, win) {\n this.onRender = onRender;\n this.pending = false;\n this.changes = 0;\n this.window = win || window;\n};\n\n(function() {\n\n\n this.schedule = function(change) {\n this.changes = this.changes | change;\n if (!this.pending && this.changes) {\n this.pending = true;\n var _self = this;\n event.nextFrame(function() {\n _self.pending = false;\n var changes;\n while (changes = _self.changes) {\n _self.changes = 0;\n _self.onRender(changes);\n }\n }, this.window);\n }\n };\n\n}).call(RenderLoop.prototype);\n\nexports.RenderLoop = RenderLoop;\n});\n\nace.define(\"ace/layer/font_metrics\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/lib/lang\",\"ace/lib/useragent\",\"ace/lib/event_emitter\"], function(acequire, exports, module) {\n\nvar oop = acequire(\"../lib/oop\");\nvar dom = acequire(\"../lib/dom\");\nvar lang = acequire(\"../lib/lang\");\nvar useragent = acequire(\"../lib/useragent\");\nvar EventEmitter = acequire(\"../lib/event_emitter\").EventEmitter;\n\nvar CHAR_COUNT = 0;\n\nvar FontMetrics = exports.FontMetrics = function(parentEl) {\n this.el = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.el.style, true);\n \n this.$main = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$main.style);\n \n this.$measureNode = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(this.$measureNode.style);\n \n \n this.el.appendChild(this.$main);\n this.el.appendChild(this.$measureNode);\n parentEl.appendChild(this.el);\n \n if (!CHAR_COUNT)\n this.$testFractionalRect();\n this.$measureNode.innerHTML = lang.stringRepeat(\"X\", CHAR_COUNT);\n \n this.$characterSize = {width: 0, height: 0};\n this.checkForSizeChanges();\n};\n\n(function() {\n\n oop.implement(this, EventEmitter);\n \n this.$characterSize = {width: 0, height: 0};\n \n this.$testFractionalRect = function() {\n var el = dom.createElement(\"div\");\n this.$setMeasureNodeStyles(el.style);\n el.style.width = \"0.2px\";\n document.documentElement.appendChild(el);\n var w = el.getBoundingClientRect().width;\n if (w > 0 && w < 1)\n CHAR_COUNT = 50;\n else\n CHAR_COUNT = 100;\n el.parentNode.removeChild(el);\n };\n \n this.$setMeasureNodeStyles = function(style, isRoot) {\n style.width = style.height = \"auto\";\n style.left = style.top = \"0px\";\n style.visibility = \"hidden\";\n style.position = \"absolute\";\n style.whiteSpace = \"pre\";\n\n if (useragent.isIE < 8) {\n style[\"font-family\"] = \"inherit\";\n } else {\n style.font = \"inherit\";\n }\n style.overflow = isRoot ? \"hidden\" : \"visible\";\n };\n\n this.checkForSizeChanges = function() {\n var size = this.$measureSizes();\n if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {\n this.$measureNode.style.fontWeight = \"bold\";\n var boldSize = this.$measureSizes();\n this.$measureNode.style.fontWeight = \"\";\n this.$characterSize = size;\n this.charSizes = Object.create(null);\n this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;\n this._emit(\"changeCharacterSize\", {data: size});\n }\n };\n\n this.$pollSizeChanges = function() {\n if (this.$pollSizeChangesTimer)\n return this.$pollSizeChangesTimer;\n var self = this;\n return this.$pollSizeChangesTimer = setInterval(function() {\n self.checkForSizeChanges();\n }, 500);\n };\n \n this.setPolling = function(val) {\n if (val) {\n this.$pollSizeChanges();\n } else if (this.$pollSizeChangesTimer) {\n clearInterval(this.$pollSizeChangesTimer);\n this.$pollSizeChangesTimer = 0;\n }\n };\n\n this.$measureSizes = function() {\n if (CHAR_COUNT === 50) {\n var rect = null;\n try { \n rect = this.$measureNode.getBoundingClientRect();\n } catch(e) {\n rect = {width: 0, height:0 };\n }\n var size = {\n height: rect.height,\n width: rect.width / CHAR_COUNT\n };\n } else {\n var size = {\n height: this.$measureNode.clientHeight,\n width: this.$measureNode.clientWidth / CHAR_COUNT\n };\n }\n if (size.width === 0 || size.height === 0)\n return null;\n return size;\n };\n\n this.$measureCharWidth = function(ch) {\n this.$main.innerHTML = lang.stringRepeat(ch, CHAR_COUNT);\n var rect = this.$main.getBoundingClientRect();\n return rect.width / CHAR_COUNT;\n };\n \n this.getCharacterWidth = function(ch) {\n var w = this.charSizes[ch];\n if (w === undefined) {\n w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;\n }\n return w;\n };\n\n this.destroy = function() {\n clearInterval(this.$pollSizeChangesTimer);\n if (this.el && this.el.parentNode)\n this.el.parentNode.removeChild(this.el);\n };\n\n}).call(FontMetrics.prototype);\n\n});\n\nace.define(\"ace/virtual_renderer\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/config\",\"ace/lib/useragent\",\"ace/layer/gutter\",\"ace/layer/marker\",\"ace/layer/text\",\"ace/layer/cursor\",\"ace/scrollbar\",\"ace/scrollbar\",\"ace/renderloop\",\"ace/layer/font_metrics\",\"ace/lib/event_emitter\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"./lib/oop\");\nvar dom = acequire(\"./lib/dom\");\nvar config = acequire(\"./config\");\nvar useragent = acequire(\"./lib/useragent\");\nvar GutterLayer = acequire(\"./layer/gutter\").Gutter;\nvar MarkerLayer = acequire(\"./layer/marker\").Marker;\nvar TextLayer = acequire(\"./layer/text\").Text;\nvar CursorLayer = acequire(\"./layer/cursor\").Cursor;\nvar HScrollBar = acequire(\"./scrollbar\").HScrollBar;\nvar VScrollBar = acequire(\"./scrollbar\").VScrollBar;\nvar RenderLoop = acequire(\"./renderloop\").RenderLoop;\nvar FontMetrics = acequire(\"./layer/font_metrics\").FontMetrics;\nvar EventEmitter = acequire(\"./lib/event_emitter\").EventEmitter;\nvar editorCss = \".ace_editor {\\\nposition: relative;\\\noverflow: hidden;\\\nfont: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\\\ndirection: ltr;\\\ntext-align: left;\\\n}\\\n.ace_scroller {\\\nposition: absolute;\\\noverflow: hidden;\\\ntop: 0;\\\nbottom: 0;\\\nbackground-color: inherit;\\\n-ms-user-select: none;\\\n-moz-user-select: none;\\\n-webkit-user-select: none;\\\nuser-select: none;\\\ncursor: text;\\\n}\\\n.ace_content {\\\nposition: absolute;\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\nmin-width: 100%;\\\n}\\\n.ace_dragging .ace_scroller:before{\\\nposition: absolute;\\\ntop: 0;\\\nleft: 0;\\\nright: 0;\\\nbottom: 0;\\\ncontent: '';\\\nbackground: rgba(250, 250, 250, 0.01);\\\nz-index: 1000;\\\n}\\\n.ace_dragging.ace_dark .ace_scroller:before{\\\nbackground: rgba(0, 0, 0, 0.01);\\\n}\\\n.ace_selecting, .ace_selecting * {\\\ncursor: text !important;\\\n}\\\n.ace_gutter {\\\nposition: absolute;\\\noverflow : hidden;\\\nwidth: auto;\\\ntop: 0;\\\nbottom: 0;\\\nleft: 0;\\\ncursor: default;\\\nz-index: 4;\\\n-ms-user-select: none;\\\n-moz-user-select: none;\\\n-webkit-user-select: none;\\\nuser-select: none;\\\n}\\\n.ace_gutter-active-line {\\\nposition: absolute;\\\nleft: 0;\\\nright: 0;\\\n}\\\n.ace_scroller.ace_scroll-left {\\\nbox-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\\\n}\\\n.ace_gutter-cell {\\\npadding-left: 19px;\\\npadding-right: 6px;\\\nbackground-repeat: no-repeat;\\\n}\\\n.ace_gutter-cell.ace_error {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\\\");\\\nbackground-repeat: no-repeat;\\\nbackground-position: 2px center;\\\n}\\\n.ace_gutter-cell.ace_warning {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\\\");\\\nbackground-position: 2px center;\\\n}\\\n.ace_gutter-cell.ace_info {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\\\");\\\nbackground-position: 2px center;\\\n}\\\n.ace_dark .ace_gutter-cell.ace_info {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\\\");\\\n}\\\n.ace_scrollbar {\\\nposition: absolute;\\\nright: 0;\\\nbottom: 0;\\\nz-index: 6;\\\n}\\\n.ace_scrollbar-inner {\\\nposition: absolute;\\\ncursor: text;\\\nleft: 0;\\\ntop: 0;\\\n}\\\n.ace_scrollbar-v{\\\noverflow-x: hidden;\\\noverflow-y: scroll;\\\ntop: 0;\\\n}\\\n.ace_scrollbar-h {\\\noverflow-x: scroll;\\\noverflow-y: hidden;\\\nleft: 0;\\\n}\\\n.ace_print-margin {\\\nposition: absolute;\\\nheight: 100%;\\\n}\\\n.ace_text-input {\\\nposition: absolute;\\\nz-index: 0;\\\nwidth: 0.5em;\\\nheight: 1em;\\\nopacity: 0;\\\nbackground: transparent;\\\n-moz-appearance: none;\\\nappearance: none;\\\nborder: none;\\\nresize: none;\\\noutline: none;\\\noverflow: hidden;\\\nfont: inherit;\\\npadding: 0 1px;\\\nmargin: 0 -1px;\\\ntext-indent: -1em;\\\n-ms-user-select: text;\\\n-moz-user-select: text;\\\n-webkit-user-select: text;\\\nuser-select: text;\\\nwhite-space: pre!important;\\\n}\\\n.ace_text-input.ace_composition {\\\nbackground: inherit;\\\ncolor: inherit;\\\nz-index: 1000;\\\nopacity: 1;\\\ntext-indent: 0;\\\n}\\\n.ace_layer {\\\nz-index: 1;\\\nposition: absolute;\\\noverflow: hidden;\\\nword-wrap: normal;\\\nwhite-space: pre;\\\nheight: 100%;\\\nwidth: 100%;\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\npointer-events: none;\\\n}\\\n.ace_gutter-layer {\\\nposition: relative;\\\nwidth: auto;\\\ntext-align: right;\\\npointer-events: auto;\\\n}\\\n.ace_text-layer {\\\nfont: inherit !important;\\\n}\\\n.ace_cjk {\\\ndisplay: inline-block;\\\ntext-align: center;\\\n}\\\n.ace_cursor-layer {\\\nz-index: 4;\\\n}\\\n.ace_cursor {\\\nz-index: 4;\\\nposition: absolute;\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\nborder-left: 2px solid;\\\ntransform: translatez(0);\\\n}\\\n.ace_slim-cursors .ace_cursor {\\\nborder-left-width: 1px;\\\n}\\\n.ace_overwrite-cursors .ace_cursor {\\\nborder-left-width: 0;\\\nborder-bottom: 1px solid;\\\n}\\\n.ace_hidden-cursors .ace_cursor {\\\nopacity: 0.2;\\\n}\\\n.ace_smooth-blinking .ace_cursor {\\\n-webkit-transition: opacity 0.18s;\\\ntransition: opacity 0.18s;\\\n}\\\n.ace_editor.ace_multiselect .ace_cursor {\\\nborder-left-width: 1px;\\\n}\\\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\\\nposition: absolute;\\\nz-index: 3;\\\n}\\\n.ace_marker-layer .ace_selection {\\\nposition: absolute;\\\nz-index: 5;\\\n}\\\n.ace_marker-layer .ace_bracket {\\\nposition: absolute;\\\nz-index: 6;\\\n}\\\n.ace_marker-layer .ace_active-line {\\\nposition: absolute;\\\nz-index: 2;\\\n}\\\n.ace_marker-layer .ace_selected-word {\\\nposition: absolute;\\\nz-index: 4;\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\n}\\\n.ace_line .ace_fold {\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\ndisplay: inline-block;\\\nheight: 11px;\\\nmargin-top: -2px;\\\nvertical-align: middle;\\\nbackground-image:\\\nurl(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\\nurl(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\\\");\\\nbackground-repeat: no-repeat, repeat-x;\\\nbackground-position: center center, top left;\\\ncolor: transparent;\\\nborder: 1px solid black;\\\nborder-radius: 2px;\\\ncursor: pointer;\\\npointer-events: auto;\\\n}\\\n.ace_dark .ace_fold {\\\n}\\\n.ace_fold:hover{\\\nbackground-image:\\\nurl(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\\\"),\\\nurl(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\\\");\\\n}\\\n.ace_tooltip {\\\nbackground-color: #FFF;\\\nbackground-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));\\\nbackground-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\\\nborder: 1px solid gray;\\\nborder-radius: 1px;\\\nbox-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\\\ncolor: black;\\\nmax-width: 100%;\\\npadding: 3px 4px;\\\nposition: fixed;\\\nz-index: 999999;\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\ncursor: default;\\\nwhite-space: pre;\\\nword-wrap: break-word;\\\nline-height: normal;\\\nfont-style: normal;\\\nfont-weight: normal;\\\nletter-spacing: normal;\\\npointer-events: none;\\\n}\\\n.ace_folding-enabled > .ace_gutter-cell {\\\npadding-right: 13px;\\\n}\\\n.ace_fold-widget {\\\n-moz-box-sizing: border-box;\\\n-webkit-box-sizing: border-box;\\\nbox-sizing: border-box;\\\nmargin: 0 -12px 0 1px;\\\ndisplay: none;\\\nwidth: 11px;\\\nvertical-align: top;\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\\\");\\\nbackground-repeat: no-repeat;\\\nbackground-position: center;\\\nborder-radius: 3px;\\\nborder: 1px solid transparent;\\\ncursor: pointer;\\\n}\\\n.ace_folding-enabled .ace_fold-widget {\\\ndisplay: inline-block; \\\n}\\\n.ace_fold-widget.ace_end {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\\\");\\\n}\\\n.ace_fold-widget.ace_closed {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\\\");\\\n}\\\n.ace_fold-widget:hover {\\\nborder: 1px solid rgba(0, 0, 0, 0.3);\\\nbackground-color: rgba(255, 255, 255, 0.2);\\\nbox-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\\\n}\\\n.ace_fold-widget:active {\\\nborder: 1px solid rgba(0, 0, 0, 0.4);\\\nbackground-color: rgba(0, 0, 0, 0.05);\\\nbox-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\\\n}\\\n.ace_dark .ace_fold-widget {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\\\");\\\n}\\\n.ace_dark .ace_fold-widget.ace_end {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\\\");\\\n}\\\n.ace_dark .ace_fold-widget.ace_closed {\\\nbackground-image: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\\\");\\\n}\\\n.ace_dark .ace_fold-widget:hover {\\\nbox-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\\nbackground-color: rgba(255, 255, 255, 0.1);\\\n}\\\n.ace_dark .ace_fold-widget:active {\\\nbox-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\\\n}\\\n.ace_fold-widget.ace_invalid {\\\nbackground-color: #FFB4B4;\\\nborder-color: #DE5555;\\\n}\\\n.ace_fade-fold-widgets .ace_fold-widget {\\\n-webkit-transition: opacity 0.4s ease 0.05s;\\\ntransition: opacity 0.4s ease 0.05s;\\\nopacity: 0;\\\n}\\\n.ace_fade-fold-widgets:hover .ace_fold-widget {\\\n-webkit-transition: opacity 0.05s ease 0.05s;\\\ntransition: opacity 0.05s ease 0.05s;\\\nopacity:1;\\\n}\\\n.ace_underline {\\\ntext-decoration: underline;\\\n}\\\n.ace_bold {\\\nfont-weight: bold;\\\n}\\\n.ace_nobold .ace_bold {\\\nfont-weight: normal;\\\n}\\\n.ace_italic {\\\nfont-style: italic;\\\n}\\\n.ace_error-marker {\\\nbackground-color: rgba(255, 0, 0,0.2);\\\nposition: absolute;\\\nz-index: 9;\\\n}\\\n.ace_highlight-marker {\\\nbackground-color: rgba(255, 255, 0,0.2);\\\nposition: absolute;\\\nz-index: 8;\\\n}\\\n.ace_br1 {border-top-left-radius : 3px;}\\\n.ace_br2 {border-top-right-radius : 3px;}\\\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\\\n.ace_br4 {border-bottom-right-radius: 3px;}\\\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\\\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\\\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\\\n.ace_br8 {border-bottom-left-radius : 3px;}\\\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\\\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\\\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\\\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\\\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\\\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\\\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\\\n\";\n\ndom.importCssString(editorCss, \"ace_editor.css\");\n\nvar VirtualRenderer = function(container, theme) {\n var _self = this;\n\n this.container = container || dom.createElement(\"div\");\n this.$keepTextAreaAtCursor = !useragent.isOldIE;\n\n dom.addCssClass(this.container, \"ace_editor\");\n\n this.setTheme(theme);\n\n this.$gutter = dom.createElement(\"div\");\n this.$gutter.className = \"ace_gutter\";\n this.container.appendChild(this.$gutter);\n\n this.scroller = dom.createElement(\"div\");\n this.scroller.className = \"ace_scroller\";\n this.container.appendChild(this.scroller);\n\n this.content = dom.createElement(\"div\");\n this.content.className = \"ace_content\";\n this.scroller.appendChild(this.content);\n\n this.$gutterLayer = new GutterLayer(this.$gutter);\n this.$gutterLayer.on(\"changeGutterWidth\", this.onGutterResize.bind(this));\n\n this.$markerBack = new MarkerLayer(this.content);\n\n var textLayer = this.$textLayer = new TextLayer(this.content);\n this.canvas = textLayer.element;\n\n this.$markerFront = new MarkerLayer(this.content);\n\n this.$cursorLayer = new CursorLayer(this.content);\n this.$horizScroll = false;\n this.$vScroll = false;\n\n this.scrollBar = \n this.scrollBarV = new VScrollBar(this.container, this);\n this.scrollBarH = new HScrollBar(this.container, this);\n this.scrollBarV.addEventListener(\"scroll\", function(e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollTop(e.data - _self.scrollMargin.top);\n });\n this.scrollBarH.addEventListener(\"scroll\", function(e) {\n if (!_self.$scrollAnimation)\n _self.session.setScrollLeft(e.data - _self.scrollMargin.left);\n });\n\n this.scrollTop = 0;\n this.scrollLeft = 0;\n\n this.cursorPos = {\n row : 0,\n column : 0\n };\n\n this.$fontMetrics = new FontMetrics(this.container);\n this.$textLayer.$setFontMetrics(this.$fontMetrics);\n this.$textLayer.addEventListener(\"changeCharacterSize\", function(e) {\n _self.updateCharacterSize();\n _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height);\n _self._signal(\"changeCharacterSize\", e);\n });\n\n this.$size = {\n width: 0,\n height: 0,\n scrollerHeight: 0,\n scrollerWidth: 0,\n $dirty: true\n };\n\n this.layerConfig = {\n width : 1,\n padding : 0,\n firstRow : 0,\n firstRowScreen: 0,\n lastRow : 0,\n lineHeight : 0,\n characterWidth : 0,\n minHeight : 1,\n maxHeight : 1,\n offset : 0,\n height : 1,\n gutterOffset: 1\n };\n \n this.scrollMargin = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n v: 0,\n h: 0\n };\n\n this.$loop = new RenderLoop(\n this.$renderChanges.bind(this),\n this.container.ownerDocument.defaultView\n );\n this.$loop.schedule(this.CHANGE_FULL);\n\n this.updateCharacterSize();\n this.setPadding(4);\n config.resetOptions(this);\n config._emit(\"renderer\", this);\n};\n\n(function() {\n\n this.CHANGE_CURSOR = 1;\n this.CHANGE_MARKER = 2;\n this.CHANGE_GUTTER = 4;\n this.CHANGE_SCROLL = 8;\n this.CHANGE_LINES = 16;\n this.CHANGE_TEXT = 32;\n this.CHANGE_SIZE = 64;\n this.CHANGE_MARKER_BACK = 128;\n this.CHANGE_MARKER_FRONT = 256;\n this.CHANGE_FULL = 512;\n this.CHANGE_H_SCROLL = 1024;\n\n oop.implement(this, EventEmitter);\n\n this.updateCharacterSize = function() {\n if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) {\n this.$allowBoldFonts = this.$textLayer.allowBoldFonts;\n this.setStyle(\"ace_nobold\", !this.$allowBoldFonts);\n }\n\n this.layerConfig.characterWidth =\n this.characterWidth = this.$textLayer.getCharacterWidth();\n this.layerConfig.lineHeight =\n this.lineHeight = this.$textLayer.getLineHeight();\n this.$updatePrintMargin();\n };\n this.setSession = function(session) {\n if (this.session)\n this.session.doc.off(\"changeNewLineMode\", this.onChangeNewLineMode);\n \n this.session = session;\n if (session && this.scrollMargin.top && session.getScrollTop() <= 0)\n session.setScrollTop(-this.scrollMargin.top);\n\n this.$cursorLayer.setSession(session);\n this.$markerBack.setSession(session);\n this.$markerFront.setSession(session);\n this.$gutterLayer.setSession(session);\n this.$textLayer.setSession(session);\n if (!session)\n return;\n \n this.$loop.schedule(this.CHANGE_FULL);\n this.session.$setFontMetrics(this.$fontMetrics);\n this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;\n \n this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);\n this.onChangeNewLineMode()\n this.session.doc.on(\"changeNewLineMode\", this.onChangeNewLineMode);\n };\n this.updateLines = function(firstRow, lastRow, force) {\n if (lastRow === undefined)\n lastRow = Infinity;\n\n if (!this.$changedLines) {\n this.$changedLines = {\n firstRow: firstRow,\n lastRow: lastRow\n };\n }\n else {\n if (this.$changedLines.firstRow > firstRow)\n this.$changedLines.firstRow = firstRow;\n\n if (this.$changedLines.lastRow < lastRow)\n this.$changedLines.lastRow = lastRow;\n }\n if (this.$changedLines.lastRow < this.layerConfig.firstRow) {\n if (force)\n this.$changedLines.lastRow = this.layerConfig.lastRow;\n else\n return;\n }\n if (this.$changedLines.firstRow > this.layerConfig.lastRow)\n return;\n this.$loop.schedule(this.CHANGE_LINES);\n };\n\n this.onChangeNewLineMode = function() {\n this.$loop.schedule(this.CHANGE_TEXT);\n this.$textLayer.$updateEolChar();\n };\n \n this.onChangeTabSize = function() {\n this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);\n this.$textLayer.onChangeTabSize();\n };\n this.updateText = function() {\n this.$loop.schedule(this.CHANGE_TEXT);\n };\n this.updateFull = function(force) {\n if (force)\n this.$renderChanges(this.CHANGE_FULL, true);\n else\n this.$loop.schedule(this.CHANGE_FULL);\n };\n this.updateFontSize = function() {\n this.$textLayer.checkForSizeChanges();\n };\n\n this.$changes = 0;\n this.$updateSizeAsync = function() {\n if (this.$loop.pending)\n this.$size.$dirty = true;\n else\n this.onResize();\n };\n this.onResize = function(force, gutterWidth, width, height) {\n if (this.resizing > 2)\n return;\n else if (this.resizing > 0)\n this.resizing++;\n else\n this.resizing = force ? 1 : 0;\n var el = this.container;\n if (!height)\n height = el.clientHeight || el.scrollHeight;\n if (!width)\n width = el.clientWidth || el.scrollWidth;\n var changes = this.$updateCachedSize(force, gutterWidth, width, height);\n\n \n if (!this.$size.scrollerHeight || (!width && !height))\n return this.resizing = 0;\n\n if (force)\n this.$gutterLayer.$padding = null;\n\n if (force)\n this.$renderChanges(changes | this.$changes, true);\n else\n this.$loop.schedule(changes | this.$changes);\n\n if (this.resizing)\n this.resizing = 0;\n this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null;\n };\n \n this.$updateCachedSize = function(force, gutterWidth, width, height) {\n height -= (this.$extraHeight || 0);\n var changes = 0;\n var size = this.$size;\n var oldSize = {\n width: size.width,\n height: size.height,\n scrollerHeight: size.scrollerHeight,\n scrollerWidth: size.scrollerWidth\n };\n if (height && (force || size.height != height)) {\n size.height = height;\n changes |= this.CHANGE_SIZE;\n\n size.scrollerHeight = size.height;\n if (this.$horizScroll)\n size.scrollerHeight -= this.scrollBarH.getHeight();\n this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + \"px\";\n\n changes = changes | this.CHANGE_SCROLL;\n }\n\n if (width && (force || size.width != width)) {\n changes |= this.CHANGE_SIZE;\n size.width = width;\n \n if (gutterWidth == null)\n gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;\n \n this.gutterWidth = gutterWidth;\n \n this.scrollBarH.element.style.left = \n this.scroller.style.left = gutterWidth + \"px\";\n size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); \n \n this.scrollBarH.element.style.right = \n this.scroller.style.right = this.scrollBarV.getWidth() + \"px\";\n this.scroller.style.bottom = this.scrollBarH.getHeight() + \"px\";\n\n if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force)\n changes |= this.CHANGE_FULL;\n }\n \n size.$dirty = !width || !height;\n\n if (changes)\n this._signal(\"resize\", oldSize);\n\n return changes;\n };\n\n this.onGutterResize = function() {\n var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;\n if (gutterWidth != this.gutterWidth)\n this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height);\n\n if (this.session.getUseWrapMode() && this.adjustWrapLimit()) {\n this.$loop.schedule(this.CHANGE_FULL);\n } else if (this.$size.$dirty) {\n this.$loop.schedule(this.CHANGE_FULL);\n } else {\n this.$computeLayerConfig();\n this.$loop.schedule(this.CHANGE_MARKER);\n }\n };\n this.adjustWrapLimit = function() {\n var availableWidth = this.$size.scrollerWidth - this.$padding * 2;\n var limit = Math.floor(availableWidth / this.characterWidth);\n return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn);\n };\n this.setAnimatedScroll = function(shouldAnimate){\n this.setOption(\"animatedScroll\", shouldAnimate);\n };\n this.getAnimatedScroll = function() {\n return this.$animatedScroll;\n };\n this.setShowInvisibles = function(showInvisibles) {\n this.setOption(\"showInvisibles\", showInvisibles);\n };\n this.getShowInvisibles = function() {\n return this.getOption(\"showInvisibles\");\n };\n this.getDisplayIndentGuides = function() {\n return this.getOption(\"displayIndentGuides\");\n };\n\n this.setDisplayIndentGuides = function(display) {\n this.setOption(\"displayIndentGuides\", display);\n };\n this.setShowPrintMargin = function(showPrintMargin) {\n this.setOption(\"showPrintMargin\", showPrintMargin);\n };\n this.getShowPrintMargin = function() {\n return this.getOption(\"showPrintMargin\");\n };\n this.setPrintMarginColumn = function(showPrintMargin) {\n this.setOption(\"printMarginColumn\", showPrintMargin);\n };\n this.getPrintMarginColumn = function() {\n return this.getOption(\"printMarginColumn\");\n };\n this.getShowGutter = function(){\n return this.getOption(\"showGutter\");\n };\n this.setShowGutter = function(show){\n return this.setOption(\"showGutter\", show);\n };\n\n this.getFadeFoldWidgets = function(){\n return this.getOption(\"fadeFoldWidgets\")\n };\n\n this.setFadeFoldWidgets = function(show) {\n this.setOption(\"fadeFoldWidgets\", show);\n };\n\n this.setHighlightGutterLine = function(shouldHighlight) {\n this.setOption(\"highlightGutterLine\", shouldHighlight);\n };\n\n this.getHighlightGutterLine = function() {\n return this.getOption(\"highlightGutterLine\");\n };\n\n this.$updateGutterLineHighlight = function() {\n var pos = this.$cursorLayer.$pixelPos;\n var height = this.layerConfig.lineHeight;\n if (this.session.getUseWrapMode()) {\n var cursor = this.session.selection.getCursor();\n cursor.column = 0;\n pos = this.$cursorLayer.getPixelPosition(cursor, true);\n height *= this.session.getRowLength(cursor.row);\n }\n this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + \"px\";\n this.$gutterLineHighlight.style.height = height + \"px\";\n };\n\n this.$updatePrintMargin = function() {\n if (!this.$showPrintMargin && !this.$printMarginEl)\n return;\n\n if (!this.$printMarginEl) {\n var containerEl = dom.createElement(\"div\");\n containerEl.className = \"ace_layer ace_print-margin-layer\";\n this.$printMarginEl = dom.createElement(\"div\");\n this.$printMarginEl.className = \"ace_print-margin\";\n containerEl.appendChild(this.$printMarginEl);\n this.content.insertBefore(containerEl, this.content.firstChild);\n }\n\n var style = this.$printMarginEl.style;\n style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + \"px\";\n style.visibility = this.$showPrintMargin ? \"visible\" : \"hidden\";\n \n if (this.session && this.session.$wrap == -1)\n this.adjustWrapLimit();\n };\n this.getContainerElement = function() {\n return this.container;\n };\n this.getMouseEventTarget = function() {\n return this.scroller;\n };\n this.getTextAreaContainer = function() {\n return this.container;\n };\n this.$moveTextAreaToCursor = function() {\n if (!this.$keepTextAreaAtCursor)\n return;\n var config = this.layerConfig;\n var posTop = this.$cursorLayer.$pixelPos.top;\n var posLeft = this.$cursorLayer.$pixelPos.left;\n posTop -= config.offset;\n\n var style = this.textarea.style;\n var h = this.lineHeight;\n if (posTop < 0 || posTop > config.height - h) {\n style.top = style.left = \"0\";\n return;\n }\n\n var w = this.characterWidth;\n if (this.$composition) {\n var val = this.textarea.value.replace(/^\\x01+/, \"\");\n w *= (this.session.$getStringScreenWidth(val)[0]+2);\n h += 2;\n }\n posLeft -= this.scrollLeft;\n if (posLeft > this.$size.scrollerWidth - w)\n posLeft = this.$size.scrollerWidth - w;\n\n posLeft += this.gutterWidth;\n style.height = h + \"px\";\n style.width = w + \"px\";\n style.left = Math.min(posLeft, this.$size.scrollerWidth - w) + \"px\";\n style.top = Math.min(posTop, this.$size.height - h) + \"px\";\n };\n this.getFirstVisibleRow = function() {\n return this.layerConfig.firstRow;\n };\n this.getFirstFullyVisibleRow = function() {\n return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);\n };\n this.getLastFullyVisibleRow = function() {\n var config = this.layerConfig;\n var lastRow = config.lastRow\n var top = this.session.documentToScreenRow(lastRow, 0) * config.lineHeight;\n if (top - this.session.getScrollTop() > config.height - config.lineHeight)\n return lastRow - 1;\n return lastRow;\n };\n this.getLastVisibleRow = function() {\n return this.layerConfig.lastRow;\n };\n\n this.$padding = null;\n this.setPadding = function(padding) {\n this.$padding = padding;\n this.$textLayer.setPadding(padding);\n this.$cursorLayer.setPadding(padding);\n this.$markerFront.setPadding(padding);\n this.$markerBack.setPadding(padding);\n this.$loop.schedule(this.CHANGE_FULL);\n this.$updatePrintMargin();\n };\n \n this.setScrollMargin = function(top, bottom, left, right) {\n var sm = this.scrollMargin;\n sm.top = top|0;\n sm.bottom = bottom|0;\n sm.right = right|0;\n sm.left = left|0;\n sm.v = sm.top + sm.bottom;\n sm.h = sm.left + sm.right;\n if (sm.top && this.scrollTop <= 0 && this.session)\n this.session.setScrollTop(-sm.top);\n this.updateFull();\n };\n this.getHScrollBarAlwaysVisible = function() {\n return this.$hScrollBarAlwaysVisible;\n };\n this.setHScrollBarAlwaysVisible = function(alwaysVisible) {\n this.setOption(\"hScrollBarAlwaysVisible\", alwaysVisible);\n };\n this.getVScrollBarAlwaysVisible = function() {\n return this.$vScrollBarAlwaysVisible;\n };\n this.setVScrollBarAlwaysVisible = function(alwaysVisible) {\n this.setOption(\"vScrollBarAlwaysVisible\", alwaysVisible);\n };\n\n this.$updateScrollBarV = function() {\n var scrollHeight = this.layerConfig.maxHeight;\n var scrollerHeight = this.$size.scrollerHeight;\n if (!this.$maxLines && this.$scrollPastEnd) {\n scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd;\n if (this.scrollTop > scrollHeight - scrollerHeight) {\n scrollHeight = this.scrollTop + scrollerHeight;\n this.scrollBarV.scrollTop = null;\n }\n }\n this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v);\n this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);\n };\n this.$updateScrollBarH = function() {\n this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h);\n this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);\n };\n \n this.$frozen = false;\n this.freeze = function() {\n this.$frozen = true;\n };\n \n this.unfreeze = function() {\n this.$frozen = false;\n };\n\n this.$renderChanges = function(changes, force) {\n if (this.$changes) {\n changes |= this.$changes;\n this.$changes = 0;\n }\n if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) {\n this.$changes |= changes;\n return; \n } \n if (this.$size.$dirty) {\n this.$changes |= changes;\n return this.onResize(true);\n }\n if (!this.lineHeight) {\n this.$textLayer.checkForSizeChanges();\n }\n \n this._signal(\"beforeRender\");\n var config = this.layerConfig;\n if (changes & this.CHANGE_FULL ||\n changes & this.CHANGE_SIZE ||\n changes & this.CHANGE_TEXT ||\n changes & this.CHANGE_LINES ||\n changes & this.CHANGE_SCROLL ||\n changes & this.CHANGE_H_SCROLL\n ) {\n changes |= this.$computeLayerConfig();\n if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) {\n var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight;\n if (st > 0) {\n this.scrollTop = st;\n changes = changes | this.CHANGE_SCROLL;\n changes |= this.$computeLayerConfig();\n }\n }\n config = this.layerConfig;\n this.$updateScrollBarV();\n if (changes & this.CHANGE_H_SCROLL)\n this.$updateScrollBarH();\n this.$gutterLayer.element.style.marginTop = (-config.offset) + \"px\";\n this.content.style.marginTop = (-config.offset) + \"px\";\n this.content.style.width = config.width + 2 * this.$padding + \"px\";\n this.content.style.height = config.minHeight + \"px\";\n }\n if (changes & this.CHANGE_H_SCROLL) {\n this.content.style.marginLeft = -this.scrollLeft + \"px\";\n this.scroller.className = this.scrollLeft <= 0 ? \"ace_scroller\" : \"ace_scroller ace_scroll-left\";\n }\n if (changes & this.CHANGE_FULL) {\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this.$highlightGutterLine && this.$updateGutterLineHighlight();\n this._signal(\"afterRender\");\n return;\n }\n if (changes & this.CHANGE_SCROLL) {\n if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)\n this.$textLayer.update(config);\n else\n this.$textLayer.scrollLines(config);\n\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n this.$markerBack.update(config);\n this.$markerFront.update(config);\n this.$cursorLayer.update(config);\n this.$highlightGutterLine && this.$updateGutterLineHighlight();\n this.$moveTextAreaToCursor();\n this._signal(\"afterRender\");\n return;\n }\n\n if (changes & this.CHANGE_TEXT) {\n this.$textLayer.update(config);\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n }\n else if (changes & this.CHANGE_LINES) {\n if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter)\n this.$gutterLayer.update(config);\n }\n else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {\n if (this.$showGutter)\n this.$gutterLayer.update(config);\n }\n\n if (changes & this.CHANGE_CURSOR) {\n this.$cursorLayer.update(config);\n this.$moveTextAreaToCursor();\n this.$highlightGutterLine && this.$updateGutterLineHighlight();\n }\n\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {\n this.$markerFront.update(config);\n }\n\n if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) {\n this.$markerBack.update(config);\n }\n\n this._signal(\"afterRender\");\n };\n\n \n this.$autosize = function() {\n var height = this.session.getScreenLength() * this.lineHeight;\n var maxHeight = this.$maxLines * this.lineHeight;\n var desiredHeight = Math.min(maxHeight,\n Math.max((this.$minLines || 1) * this.lineHeight, height)\n ) + this.scrollMargin.v + (this.$extraHeight || 0);\n if (this.$horizScroll)\n desiredHeight += this.scrollBarH.getHeight();\n if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight)\n desiredHeight = this.$maxPixelHeight;\n var vScroll = height > maxHeight;\n \n if (desiredHeight != this.desiredHeight ||\n this.$size.height != this.desiredHeight || vScroll != this.$vScroll) {\n if (vScroll != this.$vScroll) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n \n var w = this.container.clientWidth;\n this.container.style.height = desiredHeight + \"px\";\n this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight);\n this.desiredHeight = desiredHeight;\n \n this._signal(\"autosize\");\n }\n };\n \n this.$computeLayerConfig = function() {\n var session = this.session;\n var size = this.$size;\n \n var hideScrollbars = size.height <= 2 * this.lineHeight;\n var screenLines = this.session.getScreenLength();\n var maxHeight = screenLines * this.lineHeight;\n\n var longestLine = this.$getLongestLine();\n \n var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||\n size.scrollerWidth - longestLine - 2 * this.$padding < 0);\n\n var hScrollChanged = this.$horizScroll !== horizScroll;\n if (hScrollChanged) {\n this.$horizScroll = horizScroll;\n this.scrollBarH.setVisible(horizScroll);\n }\n var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine\n if (this.$maxLines && this.lineHeight > 1)\n this.$autosize();\n\n var offset = this.scrollTop % this.lineHeight;\n var minHeight = size.scrollerHeight + this.lineHeight;\n \n var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd\n ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd\n : 0;\n maxHeight += scrollPastEnd;\n \n var sm = this.scrollMargin;\n this.session.setScrollTop(Math.max(-sm.top,\n Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom)));\n\n this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, \n longestLine + 2 * this.$padding - size.scrollerWidth + sm.right)));\n \n var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible ||\n size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top);\n var vScrollChanged = vScrollBefore !== vScroll;\n if (vScrollChanged) {\n this.$vScroll = vScroll;\n this.scrollBarV.setVisible(vScroll);\n }\n\n var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;\n var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));\n var lastRow = firstRow + lineCount;\n var firstRowScreen, firstRowHeight;\n var lineHeight = this.lineHeight;\n firstRow = session.screenToDocumentRow(firstRow, 0);\n var foldLine = session.getFoldLine(firstRow);\n if (foldLine) {\n firstRow = foldLine.start.row;\n }\n\n firstRowScreen = session.documentToScreenRow(firstRow, 0);\n firstRowHeight = session.getRowLength(firstRow) * lineHeight;\n\n lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);\n minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +\n firstRowHeight;\n\n offset = this.scrollTop - firstRowScreen * lineHeight;\n\n var changes = 0;\n if (this.layerConfig.width != longestLine) \n changes = this.CHANGE_H_SCROLL;\n if (hScrollChanged || vScrollChanged) {\n changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height);\n this._signal(\"scrollbarVisibilityChanged\");\n if (vScrollChanged)\n longestLine = this.$getLongestLine();\n }\n \n this.layerConfig = {\n width : longestLine,\n padding : this.$padding,\n firstRow : firstRow,\n firstRowScreen: firstRowScreen,\n lastRow : lastRow,\n lineHeight : lineHeight,\n characterWidth : this.characterWidth,\n minHeight : minHeight,\n maxHeight : maxHeight,\n offset : offset,\n gutterOffset : lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0,\n height : this.$size.scrollerHeight\n };\n\n return changes;\n };\n\n this.$updateLines = function() {\n var firstRow = this.$changedLines.firstRow;\n var lastRow = this.$changedLines.lastRow;\n this.$changedLines = null;\n\n var layerConfig = this.layerConfig;\n\n if (firstRow > layerConfig.lastRow + 1) { return; }\n if (lastRow < layerConfig.firstRow) { return; }\n if (lastRow === Infinity) {\n if (this.$showGutter)\n this.$gutterLayer.update(layerConfig);\n this.$textLayer.update(layerConfig);\n return;\n }\n this.$textLayer.updateLines(layerConfig, firstRow, lastRow);\n return true;\n };\n\n this.$getLongestLine = function() {\n var charCount = this.session.getScreenWidth();\n if (this.showInvisibles && !this.session.$useWrapMode)\n charCount += 1;\n\n return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));\n };\n this.updateFrontMarkers = function() {\n this.$markerFront.setMarkers(this.session.getMarkers(true));\n this.$loop.schedule(this.CHANGE_MARKER_FRONT);\n };\n this.updateBackMarkers = function() {\n this.$markerBack.setMarkers(this.session.getMarkers());\n this.$loop.schedule(this.CHANGE_MARKER_BACK);\n };\n this.addGutterDecoration = function(row, className){\n this.$gutterLayer.addGutterDecoration(row, className);\n };\n this.removeGutterDecoration = function(row, className){\n this.$gutterLayer.removeGutterDecoration(row, className);\n };\n this.updateBreakpoints = function(rows) {\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n this.setAnnotations = function(annotations) {\n this.$gutterLayer.setAnnotations(annotations);\n this.$loop.schedule(this.CHANGE_GUTTER);\n };\n this.updateCursor = function() {\n this.$loop.schedule(this.CHANGE_CURSOR);\n };\n this.hideCursor = function() {\n this.$cursorLayer.hideCursor();\n };\n this.showCursor = function() {\n this.$cursorLayer.showCursor();\n };\n\n this.scrollSelectionIntoView = function(anchor, lead, offset) {\n this.scrollCursorIntoView(anchor, offset);\n this.scrollCursorIntoView(lead, offset);\n };\n this.scrollCursorIntoView = function(cursor, offset, $viewMargin) {\n if (this.$size.scrollerHeight === 0)\n return;\n\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n\n var left = pos.left;\n var top = pos.top;\n \n var topMargin = $viewMargin && $viewMargin.top || 0;\n var bottomMargin = $viewMargin && $viewMargin.bottom || 0;\n \n var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;\n \n if (scrollTop + topMargin > top) {\n if (offset && scrollTop + topMargin > top + this.lineHeight)\n top -= offset * this.$size.scrollerHeight;\n if (top === 0)\n top = -this.scrollMargin.top;\n this.session.setScrollTop(top);\n } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) {\n if (offset && scrollTop + this.$size.scrollerHeight - bottomMargin < top - this.lineHeight)\n top += offset * this.$size.scrollerHeight;\n this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight);\n }\n\n var scrollLeft = this.scrollLeft;\n\n if (scrollLeft > left) {\n if (left < this.$padding + 2 * this.layerConfig.characterWidth)\n left = -this.scrollMargin.left;\n this.session.setScrollLeft(left);\n } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {\n this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth));\n } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) {\n this.session.setScrollLeft(0);\n }\n };\n this.getScrollTop = function() {\n return this.session.getScrollTop();\n };\n this.getScrollLeft = function() {\n return this.session.getScrollLeft();\n };\n this.getScrollTopRow = function() {\n return this.scrollTop / this.lineHeight;\n };\n this.getScrollBottomRow = function() {\n return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);\n };\n this.scrollToRow = function(row) {\n this.session.setScrollTop(row * this.lineHeight);\n };\n\n this.alignCursor = function(cursor, alignment) {\n if (typeof cursor == \"number\")\n cursor = {row: cursor, column: 0};\n\n var pos = this.$cursorLayer.getPixelPosition(cursor);\n var h = this.$size.scrollerHeight - this.lineHeight;\n var offset = pos.top - h * (alignment || 0);\n\n this.session.setScrollTop(offset);\n return offset;\n };\n\n this.STEPS = 8;\n this.$calcSteps = function(fromValue, toValue){\n var i = 0;\n var l = this.STEPS;\n var steps = [];\n\n var func = function(t, x_min, dx) {\n return dx * (Math.pow(t - 1, 3) + 1) + x_min;\n };\n\n for (i = 0; i < l; ++i)\n steps.push(func(i / this.STEPS, fromValue, toValue - fromValue));\n\n return steps;\n };\n this.scrollToLine = function(line, center, animate, callback) {\n var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0});\n var offset = pos.top;\n if (center)\n offset -= this.$size.scrollerHeight / 2;\n\n var initialScroll = this.scrollTop;\n this.session.setScrollTop(offset);\n if (animate !== false)\n this.animateScrolling(initialScroll, callback);\n };\n\n this.animateScrolling = function(fromValue, callback) {\n var toValue = this.scrollTop;\n if (!this.$animatedScroll)\n return;\n var _self = this;\n \n if (fromValue == toValue)\n return;\n \n if (this.$scrollAnimation) {\n var oldSteps = this.$scrollAnimation.steps;\n if (oldSteps.length) {\n fromValue = oldSteps[0];\n if (fromValue == toValue)\n return;\n }\n }\n \n var steps = _self.$calcSteps(fromValue, toValue);\n this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps};\n\n clearInterval(this.$timer);\n\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n this.$timer = setInterval(function() {\n if (steps.length) {\n _self.session.setScrollTop(steps.shift());\n _self.session.$scrollTop = toValue;\n } else if (toValue != null) {\n _self.session.$scrollTop = -1;\n _self.session.setScrollTop(toValue);\n toValue = null;\n } else {\n _self.$timer = clearInterval(_self.$timer);\n _self.$scrollAnimation = null;\n callback && callback();\n }\n }, 10);\n };\n this.scrollToY = function(scrollTop) {\n if (this.scrollTop !== scrollTop) {\n this.$loop.schedule(this.CHANGE_SCROLL);\n this.scrollTop = scrollTop;\n }\n };\n this.scrollToX = function(scrollLeft) {\n if (this.scrollLeft !== scrollLeft)\n this.scrollLeft = scrollLeft;\n this.$loop.schedule(this.CHANGE_H_SCROLL);\n };\n this.scrollTo = function(x, y) {\n this.session.setScrollTop(y);\n this.session.setScrollLeft(y);\n };\n this.scrollBy = function(deltaX, deltaY) {\n deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);\n deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);\n };\n this.isScrollableBy = function(deltaX, deltaY) {\n if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top)\n return true;\n if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight\n - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom)\n return true;\n if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left)\n return true;\n if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth\n - this.layerConfig.width < -1 + this.scrollMargin.right)\n return true;\n };\n\n this.pixelToScreenCoordinates = function(x, y) {\n var canvasPos = this.scroller.getBoundingClientRect();\n\n var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth;\n var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);\n var col = Math.round(offset);\n\n return {row: row, column: col, side: offset - col > 0 ? 1 : -1};\n };\n\n this.screenToTextCoordinates = function(x, y) {\n var canvasPos = this.scroller.getBoundingClientRect();\n\n var col = Math.round(\n (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth\n );\n\n var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight;\n\n return this.session.screenToDocumentPosition(row, Math.max(col, 0));\n };\n this.textToScreenCoordinates = function(row, column) {\n var canvasPos = this.scroller.getBoundingClientRect();\n var pos = this.session.documentToScreenPosition(row, column);\n\n var x = this.$padding + Math.round(pos.column * this.characterWidth);\n var y = pos.row * this.lineHeight;\n\n return {\n pageX: canvasPos.left + x - this.scrollLeft,\n pageY: canvasPos.top + y - this.scrollTop\n };\n };\n this.visualizeFocus = function() {\n dom.addCssClass(this.container, \"ace_focus\");\n };\n this.visualizeBlur = function() {\n dom.removeCssClass(this.container, \"ace_focus\");\n };\n this.showComposition = function(position) {\n if (!this.$composition)\n this.$composition = {\n keepTextAreaAtCursor: this.$keepTextAreaAtCursor,\n cssText: this.textarea.style.cssText\n };\n\n this.$keepTextAreaAtCursor = true;\n dom.addCssClass(this.textarea, \"ace_composition\");\n this.textarea.style.cssText = \"\";\n this.$moveTextAreaToCursor();\n };\n this.setCompositionText = function(text) {\n this.$moveTextAreaToCursor();\n };\n this.hideComposition = function() {\n if (!this.$composition)\n return;\n\n dom.removeCssClass(this.textarea, \"ace_composition\");\n this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor;\n this.textarea.style.cssText = this.$composition.cssText;\n this.$composition = null;\n };\n this.setTheme = function(theme, cb) {\n var _self = this;\n this.$themeId = theme;\n _self._dispatchEvent('themeChange',{theme:theme});\n\n if (!theme || typeof theme == \"string\") {\n var moduleName = theme || this.$options.theme.initialValue;\n config.loadModule([\"theme\", moduleName], afterLoad);\n } else {\n afterLoad(theme);\n }\n\n function afterLoad(module) {\n if (_self.$themeId != theme)\n return cb && cb();\n if (!module || !module.cssClass)\n throw new Error(\"couldn't load module \" + theme + \" or it didn't call define\");\n dom.importCssString(\n module.cssText,\n module.cssClass,\n _self.container.ownerDocument\n );\n\n if (_self.theme)\n dom.removeCssClass(_self.container, _self.theme.cssClass);\n\n var padding = \"padding\" in module ? module.padding \n : \"padding\" in (_self.theme || {}) ? 4 : _self.$padding;\n if (_self.$padding && padding != _self.$padding)\n _self.setPadding(padding);\n _self.$theme = module.cssClass;\n\n _self.theme = module;\n dom.addCssClass(_self.container, module.cssClass);\n dom.setCssClass(_self.container, \"ace_dark\", module.isDark);\n if (_self.$size) {\n _self.$size.width = 0;\n _self.$updateSizeAsync();\n }\n\n _self._dispatchEvent('themeLoaded', {theme:module});\n cb && cb();\n }\n };\n this.getTheme = function() {\n return this.$themeId;\n };\n this.setStyle = function(style, include) {\n dom.setCssClass(this.container, style, include !== false);\n };\n this.unsetStyle = function(style) {\n dom.removeCssClass(this.container, style);\n };\n \n this.setCursorStyle = function(style) {\n if (this.scroller.style.cursor != style)\n this.scroller.style.cursor = style;\n };\n this.setMouseCursor = function(cursorStyle) {\n this.scroller.style.cursor = cursorStyle;\n };\n this.destroy = function() {\n this.$textLayer.destroy();\n this.$cursorLayer.destroy();\n };\n\n}).call(VirtualRenderer.prototype);\n\n\nconfig.defineOptions(VirtualRenderer.prototype, \"renderer\", {\n animatedScroll: {initialValue: false},\n showInvisibles: {\n set: function(value) {\n if (this.$textLayer.setShowInvisibles(value))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: false\n },\n showPrintMargin: {\n set: function() { this.$updatePrintMargin(); },\n initialValue: true\n },\n printMarginColumn: {\n set: function() { this.$updatePrintMargin(); },\n initialValue: 80\n },\n printMargin: {\n set: function(val) {\n if (typeof val == \"number\")\n this.$printMarginColumn = val;\n this.$showPrintMargin = !!val;\n this.$updatePrintMargin();\n },\n get: function() {\n return this.$showPrintMargin && this.$printMarginColumn; \n }\n },\n showGutter: {\n set: function(show){\n this.$gutter.style.display = show ? \"block\" : \"none\";\n this.$loop.schedule(this.CHANGE_FULL);\n this.onGutterResize();\n },\n initialValue: true\n },\n fadeFoldWidgets: {\n set: function(show) {\n dom.setCssClass(this.$gutter, \"ace_fade-fold-widgets\", show);\n },\n initialValue: false\n },\n showFoldWidgets: {\n set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)},\n initialValue: true\n },\n showLineNumbers: {\n set: function(show) {\n this.$gutterLayer.setShowLineNumbers(show);\n this.$loop.schedule(this.CHANGE_GUTTER);\n },\n initialValue: true\n },\n displayIndentGuides: {\n set: function(show) {\n if (this.$textLayer.setDisplayIndentGuides(show))\n this.$loop.schedule(this.CHANGE_TEXT);\n },\n initialValue: true\n },\n highlightGutterLine: {\n set: function(shouldHighlight) {\n if (!this.$gutterLineHighlight) {\n this.$gutterLineHighlight = dom.createElement(\"div\");\n this.$gutterLineHighlight.className = \"ace_gutter-active-line\";\n this.$gutter.appendChild(this.$gutterLineHighlight);\n return;\n }\n\n this.$gutterLineHighlight.style.display = shouldHighlight ? \"\" : \"none\";\n if (this.$cursorLayer.$pixelPos)\n this.$updateGutterLineHighlight();\n },\n initialValue: false,\n value: true\n },\n hScrollBarAlwaysVisible: {\n set: function(val) {\n if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n vScrollBarAlwaysVisible: {\n set: function(val) {\n if (!this.$vScrollBarAlwaysVisible || !this.$vScroll)\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: false\n },\n fontSize: {\n set: function(size) {\n if (typeof size == \"number\")\n size = size + \"px\";\n this.container.style.fontSize = size;\n this.updateFontSize();\n },\n initialValue: 12\n },\n fontFamily: {\n set: function(name) {\n this.container.style.fontFamily = name;\n this.updateFontSize();\n }\n },\n maxLines: {\n set: function(val) {\n this.updateFull();\n }\n },\n minLines: {\n set: function(val) {\n this.updateFull();\n }\n },\n maxPixelHeight: {\n set: function(val) {\n this.updateFull();\n },\n initialValue: 0\n },\n scrollPastEnd: {\n set: function(val) {\n val = +val || 0;\n if (this.$scrollPastEnd == val)\n return;\n this.$scrollPastEnd = val;\n this.$loop.schedule(this.CHANGE_SCROLL);\n },\n initialValue: 0,\n handlesSet: true\n },\n fixedWidthGutter: {\n set: function(val) {\n this.$gutterLayer.$fixedWidth = !!val;\n this.$loop.schedule(this.CHANGE_GUTTER);\n }\n },\n theme: {\n set: function(val) { this.setTheme(val) },\n get: function() { return this.$themeId || this.theme; },\n initialValue: \"./theme/textmate\",\n handlesSet: true\n }\n});\n\nexports.VirtualRenderer = VirtualRenderer;\n});\n\nace.define(\"ace/worker/worker_client\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/net\",\"ace/lib/event_emitter\",\"ace/config\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"../lib/oop\");\nvar net = acequire(\"../lib/net\");\nvar EventEmitter = acequire(\"../lib/event_emitter\").EventEmitter;\nvar config = acequire(\"../config\");\n\nvar WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {\n this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);\n this.changeListener = this.changeListener.bind(this);\n this.onMessage = this.onMessage.bind(this);\n if (acequire.nameToUrl && !acequire.toUrl)\n acequire.toUrl = acequire.nameToUrl;\n \n if (config.get(\"packaged\") || !acequire.toUrl) {\n workerUrl = workerUrl || config.moduleUrl(mod.id, \"worker\")\n } else {\n var normalizePath = this.$normalizePath;\n workerUrl = workerUrl || normalizePath(acequire.toUrl(\"ace/worker/worker.js\", null, \"_\"));\n\n var tlns = {};\n topLevelNamespaces.forEach(function(ns) {\n tlns[ns] = normalizePath(acequire.toUrl(ns, null, \"_\").replace(/(\\.js)?(\\?.*)?$/, \"\"));\n });\n }\n\n try {\n var workerSrc = mod.src;\n var Blob = __webpack_require__(1587);\n var blob = new Blob([ workerSrc ], { type: 'application/javascript' });\n var blobUrl = (window.URL || window.webkitURL).createObjectURL(blob);\n\n this.$worker = new Worker(blobUrl);\n\n } catch(e) {\n if (e instanceof window.DOMException) {\n var blob = this.$workerBlob(workerUrl);\n var URL = window.URL || window.webkitURL;\n var blobURL = URL.createObjectURL(blob);\n\n this.$worker = new Worker(blobURL);\n URL.revokeObjectURL(blobURL);\n } else {\n throw e;\n }\n }\n this.$worker.postMessage({\n init : true,\n tlns : tlns,\n module : mod.id,\n classname : classname\n });\n\n this.callbackId = 1;\n this.callbacks = {};\n\n this.$worker.onmessage = this.onMessage;\n};\n\n(function(){\n\n oop.implement(this, EventEmitter);\n\n this.onMessage = function(e) {\n var msg = e.data;\n switch(msg.type) {\n case \"event\":\n this._signal(msg.name, {data: msg.data});\n break;\n case \"call\":\n var callback = this.callbacks[msg.id];\n if (callback) {\n callback(msg.data);\n delete this.callbacks[msg.id];\n }\n break;\n case \"error\":\n this.reportError(msg.data);\n break;\n case \"log\":\n window.console && console.log && console.log.apply(console, msg.data);\n break;\n }\n };\n \n this.reportError = function(err) {\n window.console && console.error && console.error(err);\n };\n\n this.$normalizePath = function(path) {\n return net.qualifyURL(path);\n };\n\n this.terminate = function() {\n this._signal(\"terminate\", {});\n this.deltaQueue = null;\n this.$worker.terminate();\n this.$worker = null;\n if (this.$doc)\n this.$doc.off(\"change\", this.changeListener);\n this.$doc = null;\n };\n\n this.send = function(cmd, args) {\n this.$worker.postMessage({command: cmd, args: args});\n };\n\n this.call = function(cmd, args, callback) {\n if (callback) {\n var id = this.callbackId++;\n this.callbacks[id] = callback;\n args.push(id);\n }\n this.send(cmd, args);\n };\n\n this.emit = function(event, data) {\n try {\n this.$worker.postMessage({event: event, data: {data: data.data}});\n }\n catch(ex) {\n console.error(ex.stack);\n }\n };\n\n this.attachToDocument = function(doc) {\n if(this.$doc)\n this.terminate();\n\n this.$doc = doc;\n this.call(\"setValue\", [doc.getValue()]);\n doc.on(\"change\", this.changeListener);\n };\n\n this.changeListener = function(delta) {\n if (!this.deltaQueue) {\n this.deltaQueue = [];\n setTimeout(this.$sendDeltaQueue, 0);\n }\n if (delta.action == \"insert\")\n this.deltaQueue.push(delta.start, delta.lines);\n else\n this.deltaQueue.push(delta.start, delta.end);\n };\n\n this.$sendDeltaQueue = function() {\n var q = this.deltaQueue;\n if (!q) return;\n this.deltaQueue = null;\n if (q.length > 50 && q.length > this.$doc.getLength() >> 1) {\n this.call(\"setValue\", [this.$doc.getValue()]);\n } else\n this.emit(\"change\", {data: q});\n };\n\n this.$workerBlob = function(workerUrl) {\n var script = \"importScripts('\" + net.qualifyURL(workerUrl) + \"');\";\n try {\n return new Blob([script], {\"type\": \"application/javascript\"});\n } catch (e) { // Backwards-compatibility\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;\n var blobBuilder = new BlobBuilder();\n blobBuilder.append(script);\n return blobBuilder.getBlob(\"application/javascript\");\n }\n };\n\n}).call(WorkerClient.prototype);\n\n\nvar UIWorkerClient = function(topLevelNamespaces, mod, classname) {\n this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);\n this.changeListener = this.changeListener.bind(this);\n this.callbackId = 1;\n this.callbacks = {};\n this.messageBuffer = [];\n\n var main = null;\n var emitSync = false;\n var sender = Object.create(EventEmitter);\n var _self = this;\n\n this.$worker = {};\n this.$worker.terminate = function() {};\n this.$worker.postMessage = function(e) {\n _self.messageBuffer.push(e);\n if (main) {\n if (emitSync)\n setTimeout(processNext);\n else\n processNext();\n }\n };\n this.setEmitSync = function(val) { emitSync = val };\n\n var processNext = function() {\n var msg = _self.messageBuffer.shift();\n if (msg.command)\n main[msg.command].apply(main, msg.args);\n else if (msg.event)\n sender._signal(msg.event, msg.data);\n };\n\n sender.postMessage = function(msg) {\n _self.onMessage({data: msg});\n };\n sender.callback = function(data, callbackId) {\n this.postMessage({type: \"call\", id: callbackId, data: data});\n };\n sender.emit = function(name, data) {\n this.postMessage({type: \"event\", name: name, data: data});\n };\n\n config.loadModule([\"worker\", mod], function(Main) {\n main = new Main[classname](sender);\n while (_self.messageBuffer.length)\n processNext();\n });\n};\n\nUIWorkerClient.prototype = WorkerClient.prototype;\n\nexports.UIWorkerClient = UIWorkerClient;\nexports.WorkerClient = WorkerClient;\n\n});\n\nace.define(\"ace/placeholder\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/lib/oop\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar Range = acequire(\"./range\").Range;\nvar EventEmitter = acequire(\"./lib/event_emitter\").EventEmitter;\nvar oop = acequire(\"./lib/oop\");\n\nvar PlaceHolder = function(session, length, pos, others, mainClass, othersClass) {\n var _self = this;\n this.length = length;\n this.session = session;\n this.doc = session.getDocument();\n this.mainClass = mainClass;\n this.othersClass = othersClass;\n this.$onUpdate = this.onUpdate.bind(this);\n this.doc.on(\"change\", this.$onUpdate);\n this.$others = others;\n \n this.$onCursorChange = function() {\n setTimeout(function() {\n _self.onCursorChange();\n });\n };\n \n this.$pos = pos;\n var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1};\n this.$undoStackDepth = undoStack.length;\n this.setup();\n\n session.selection.on(\"changeCursor\", this.$onCursorChange);\n};\n\n(function() {\n\n oop.implement(this, EventEmitter);\n this.setup = function() {\n var _self = this;\n var doc = this.doc;\n var session = this.session;\n \n this.selectionBefore = session.selection.toJSON();\n if (session.selection.inMultiSelectMode)\n session.selection.toSingleRange();\n\n this.pos = doc.createAnchor(this.$pos.row, this.$pos.column);\n var pos = this.pos;\n pos.$insertRight = true;\n pos.detach();\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);\n this.others = [];\n this.$others.forEach(function(other) {\n var anchor = doc.createAnchor(other.row, other.column);\n anchor.$insertRight = true;\n anchor.detach();\n _self.others.push(anchor);\n });\n session.setUndoSelect(false);\n };\n this.showOtherMarkers = function() {\n if (this.othersActive) return;\n var session = this.session;\n var _self = this;\n this.othersActive = true;\n this.others.forEach(function(anchor) {\n anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false);\n });\n };\n this.hideOtherMarkers = function() {\n if (!this.othersActive) return;\n this.othersActive = false;\n for (var i = 0; i < this.others.length; i++) {\n this.session.removeMarker(this.others[i].markerId);\n }\n };\n this.onUpdate = function(delta) {\n if (this.$updating)\n return this.updateAnchors(delta);\n \n var range = delta;\n if (range.start.row !== range.end.row) return;\n if (range.start.row !== this.pos.row) return;\n this.$updating = true;\n var lengthDiff = delta.action === \"insert\" ? range.end.column - range.start.column : range.start.column - range.end.column;\n var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1;\n var distanceFromStart = range.start.column - this.pos.column;\n \n this.updateAnchors(delta);\n \n if (inMainRange)\n this.length += lengthDiff;\n\n if (inMainRange && !this.session.$fromUndo) {\n if (delta.action === 'insert') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};\n this.doc.insertMergedLines(newPos, delta.lines);\n }\n } else if (delta.action === 'remove') {\n for (var i = this.others.length - 1; i >= 0; i--) {\n var otherPos = this.others[i];\n var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};\n this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));\n }\n }\n }\n \n this.$updating = false;\n this.updateMarkers();\n };\n \n this.updateAnchors = function(delta) {\n this.pos.onChange(delta);\n for (var i = this.others.length; i--;)\n this.others[i].onChange(delta);\n this.updateMarkers();\n };\n \n this.updateMarkers = function() {\n if (this.$updating)\n return;\n var _self = this;\n var session = this.session;\n var updateMarker = function(pos, className) {\n session.removeMarker(pos.markerId);\n pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column+_self.length), className, null, false);\n };\n updateMarker(this.pos, this.mainClass);\n for (var i = this.others.length; i--;)\n updateMarker(this.others[i], this.othersClass);\n };\n\n this.onCursorChange = function(event) {\n if (this.$updating || !this.session) return;\n var pos = this.session.selection.getCursor();\n if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) {\n this.showOtherMarkers();\n this._emit(\"cursorEnter\", event);\n } else {\n this.hideOtherMarkers();\n this._emit(\"cursorLeave\", event);\n }\n }; \n this.detach = function() {\n this.session.removeMarker(this.pos && this.pos.markerId);\n this.hideOtherMarkers();\n this.doc.removeEventListener(\"change\", this.$onUpdate);\n this.session.selection.removeEventListener(\"changeCursor\", this.$onCursorChange);\n this.session.setUndoSelect(true);\n this.session = null;\n };\n this.cancel = function() {\n if (this.$undoStackDepth === -1)\n return;\n var undoManager = this.session.getUndoManager();\n var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth;\n for (var i = 0; i < undosRequired; i++) {\n undoManager.undo(true);\n }\n if (this.selectionBefore)\n this.session.selection.fromJSON(this.selectionBefore);\n };\n}).call(PlaceHolder.prototype);\n\n\nexports.PlaceHolder = PlaceHolder;\n});\n\nace.define(\"ace/mouse/multi_select_handler\",[\"require\",\"exports\",\"module\",\"ace/lib/event\",\"ace/lib/useragent\"], function(acequire, exports, module) {\n\nvar event = acequire(\"../lib/event\");\nvar useragent = acequire(\"../lib/useragent\");\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\n\nfunction onMouseDown(e) {\n var ev = e.domEvent;\n var alt = ev.altKey;\n var shift = ev.shiftKey;\n var ctrl = ev.ctrlKey;\n var accel = e.getAccelKey();\n var button = e.getButton();\n \n if (ctrl && useragent.isMac)\n button = ev.button;\n\n if (e.editor.inMultiSelectMode && button == 2) {\n e.editor.textInput.onContextMenu(e.domEvent);\n return;\n }\n \n if (!ctrl && !alt && !accel) {\n if (button === 0 && e.editor.inMultiSelectMode)\n e.editor.exitMultiSelectMode();\n return;\n }\n \n if (button !== 0)\n return;\n\n var editor = e.editor;\n var selection = editor.selection;\n var isMultiSelect = editor.inMultiSelectMode;\n var pos = e.getDocumentPosition();\n var cursor = selection.getCursor();\n var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor));\n\n var mouseX = e.x, mouseY = e.y;\n var onMouseSelection = function(e) {\n mouseX = e.clientX;\n mouseY = e.clientY;\n };\n \n var session = editor.session;\n var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var screenCursor = screenAnchor;\n \n var selectionMode;\n if (editor.$mouseHandler.$enableJumpToDef) {\n if (ctrl && alt || accel && alt)\n selectionMode = shift ? \"block\" : \"add\";\n else if (alt && editor.$blockSelectEnabled)\n selectionMode = \"block\";\n } else {\n if (accel && !alt) {\n selectionMode = \"add\";\n if (!isMultiSelect && shift)\n return;\n } else if (alt && editor.$blockSelectEnabled) {\n selectionMode = \"block\";\n }\n }\n \n if (selectionMode && useragent.isMac && ev.ctrlKey) {\n editor.$mouseHandler.cancelContextMenu();\n }\n\n if (selectionMode == \"add\") {\n if (!isMultiSelect && inSelection)\n return; // dragging\n\n if (!isMultiSelect) {\n var range = selection.toOrientedRange();\n editor.addSelectionMarker(range);\n }\n\n var oldRange = selection.rangeList.rangeAtPoint(pos);\n \n \n editor.$blockScrolling++;\n editor.inVirtualSelectionMode = true;\n \n if (shift) {\n oldRange = null;\n range = selection.ranges[0] || range;\n editor.removeSelectionMarker(range);\n }\n editor.once(\"mouseup\", function() {\n var tmpSel = selection.toOrientedRange();\n\n if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))\n selection.substractPoint(tmpSel.cursor);\n else {\n if (shift) {\n selection.substractPoint(range.cursor);\n } else if (range) {\n editor.removeSelectionMarker(range);\n selection.addRange(range);\n }\n selection.addRange(tmpSel);\n }\n editor.$blockScrolling--;\n editor.inVirtualSelectionMode = false;\n });\n\n } else if (selectionMode == \"block\") {\n e.stop();\n editor.inVirtualSelectionMode = true; \n var initialRange;\n var rectSel = [];\n var blockSelect = function() {\n var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);\n var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column);\n\n if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead))\n return;\n screenCursor = newCursor;\n \n editor.$blockScrolling++;\n editor.selection.moveToPosition(cursor);\n editor.renderer.scrollCursorIntoView();\n\n editor.removeSelectionMarkers(rectSel);\n rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor);\n if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty())\n rectSel[0] = editor.$mouseHandler.$clickSelection.clone();\n rectSel.forEach(editor.addSelectionMarker, editor);\n editor.updateSelectionMarkers();\n editor.$blockScrolling--;\n };\n editor.$blockScrolling++;\n if (isMultiSelect && !accel) {\n selection.toSingleRange();\n } else if (!isMultiSelect && accel) {\n initialRange = selection.toOrientedRange();\n editor.addSelectionMarker(initialRange);\n }\n \n if (shift)\n screenAnchor = session.documentToScreenPosition(selection.lead); \n else\n selection.moveToPosition(pos);\n editor.$blockScrolling--;\n \n screenCursor = {row: -1, column: -1};\n\n var onMouseSelectionEnd = function(e) {\n clearInterval(timerId);\n editor.removeSelectionMarkers(rectSel);\n if (!rectSel.length)\n rectSel = [selection.toOrientedRange()];\n editor.$blockScrolling++;\n if (initialRange) {\n editor.removeSelectionMarker(initialRange);\n selection.toSingleRange(initialRange);\n }\n for (var i = 0; i < rectSel.length; i++)\n selection.addRange(rectSel[i]);\n editor.inVirtualSelectionMode = false;\n editor.$mouseHandler.$clickSelection = null;\n editor.$blockScrolling--;\n };\n\n var onSelectionInterval = blockSelect;\n\n event.capture(editor.container, onMouseSelection, onMouseSelectionEnd);\n var timerId = setInterval(function() {onSelectionInterval();}, 20);\n\n return e.preventDefault();\n }\n}\n\n\nexports.onMouseDown = onMouseDown;\n\n});\n\nace.define(\"ace/commands/multi_select_commands\",[\"require\",\"exports\",\"module\",\"ace/keyboard/hash_handler\"], function(acequire, exports, module) {\nexports.defaultCommands = [{\n name: \"addCursorAbove\",\n exec: function(editor) { editor.selectMoreLines(-1); },\n bindKey: {win: \"Ctrl-Alt-Up\", mac: \"Ctrl-Alt-Up\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"addCursorBelow\",\n exec: function(editor) { editor.selectMoreLines(1); },\n bindKey: {win: \"Ctrl-Alt-Down\", mac: \"Ctrl-Alt-Down\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"addCursorAboveSkipCurrent\",\n exec: function(editor) { editor.selectMoreLines(-1, true); },\n bindKey: {win: \"Ctrl-Alt-Shift-Up\", mac: \"Ctrl-Alt-Shift-Up\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"addCursorBelowSkipCurrent\",\n exec: function(editor) { editor.selectMoreLines(1, true); },\n bindKey: {win: \"Ctrl-Alt-Shift-Down\", mac: \"Ctrl-Alt-Shift-Down\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"selectMoreBefore\",\n exec: function(editor) { editor.selectMore(-1); },\n bindKey: {win: \"Ctrl-Alt-Left\", mac: \"Ctrl-Alt-Left\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"selectMoreAfter\",\n exec: function(editor) { editor.selectMore(1); },\n bindKey: {win: \"Ctrl-Alt-Right\", mac: \"Ctrl-Alt-Right\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"selectNextBefore\",\n exec: function(editor) { editor.selectMore(-1, true); },\n bindKey: {win: \"Ctrl-Alt-Shift-Left\", mac: \"Ctrl-Alt-Shift-Left\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"selectNextAfter\",\n exec: function(editor) { editor.selectMore(1, true); },\n bindKey: {win: \"Ctrl-Alt-Shift-Right\", mac: \"Ctrl-Alt-Shift-Right\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}, {\n name: \"splitIntoLines\",\n exec: function(editor) { editor.multiSelect.splitIntoLines(); },\n bindKey: {win: \"Ctrl-Alt-L\", mac: \"Ctrl-Alt-L\"},\n readOnly: true\n}, {\n name: \"alignCursors\",\n exec: function(editor) { editor.alignCursors(); },\n bindKey: {win: \"Ctrl-Alt-A\", mac: \"Ctrl-Alt-A\"},\n scrollIntoView: \"cursor\"\n}, {\n name: \"findAll\",\n exec: function(editor) { editor.findAll(); },\n bindKey: {win: \"Ctrl-Alt-K\", mac: \"Ctrl-Alt-G\"},\n scrollIntoView: \"cursor\",\n readOnly: true\n}];\nexports.multiSelectCommands = [{\n name: \"singleSelection\",\n bindKey: \"esc\",\n exec: function(editor) { editor.exitMultiSelectMode(); },\n scrollIntoView: \"cursor\",\n readOnly: true,\n isAvailable: function(editor) {return editor && editor.inMultiSelectMode}\n}];\n\nvar HashHandler = acequire(\"../keyboard/hash_handler\").HashHandler;\nexports.keyboardHandler = new HashHandler(exports.multiSelectCommands);\n\n});\n\nace.define(\"ace/multi_select\",[\"require\",\"exports\",\"module\",\"ace/range_list\",\"ace/range\",\"ace/selection\",\"ace/mouse/multi_select_handler\",\"ace/lib/event\",\"ace/lib/lang\",\"ace/commands/multi_select_commands\",\"ace/search\",\"ace/edit_session\",\"ace/editor\",\"ace/config\"], function(acequire, exports, module) {\n\nvar RangeList = acequire(\"./range_list\").RangeList;\nvar Range = acequire(\"./range\").Range;\nvar Selection = acequire(\"./selection\").Selection;\nvar onMouseDown = acequire(\"./mouse/multi_select_handler\").onMouseDown;\nvar event = acequire(\"./lib/event\");\nvar lang = acequire(\"./lib/lang\");\nvar commands = acequire(\"./commands/multi_select_commands\");\nexports.commands = commands.defaultCommands.concat(commands.multiSelectCommands);\nvar Search = acequire(\"./search\").Search;\nvar search = new Search();\n\nfunction find(session, needle, dir) {\n search.$options.wrap = true;\n search.$options.needle = needle;\n search.$options.backwards = dir == -1;\n return search.find(session);\n}\nvar EditSession = acequire(\"./edit_session\").EditSession;\n(function() {\n this.getSelectionMarkers = function() {\n return this.$selectionMarkers;\n };\n}).call(EditSession.prototype);\n(function() {\n this.ranges = null;\n this.rangeList = null;\n this.addRange = function(range, $blockChangeEvents) {\n if (!range)\n return;\n\n if (!this.inMultiSelectMode && this.rangeCount === 0) {\n var oldRange = this.toOrientedRange();\n this.rangeList.add(oldRange);\n this.rangeList.add(range);\n if (this.rangeList.ranges.length != 2) {\n this.rangeList.removeAll();\n return $blockChangeEvents || this.fromOrientedRange(range);\n }\n this.rangeList.removeAll();\n this.rangeList.add(oldRange);\n this.$onAddRange(oldRange);\n }\n\n if (!range.cursor)\n range.cursor = range.end;\n\n var removed = this.rangeList.add(range);\n\n this.$onAddRange(range);\n\n if (removed.length)\n this.$onRemoveRange(removed);\n\n if (this.rangeCount > 1 && !this.inMultiSelectMode) {\n this._signal(\"multiSelect\");\n this.inMultiSelectMode = true;\n this.session.$undoSelect = false;\n this.rangeList.attach(this.session);\n }\n\n return $blockChangeEvents || this.fromOrientedRange(range);\n };\n\n this.toSingleRange = function(range) {\n range = range || this.ranges[0];\n var removed = this.rangeList.removeAll();\n if (removed.length)\n this.$onRemoveRange(removed);\n\n range && this.fromOrientedRange(range);\n };\n this.substractPoint = function(pos) {\n var removed = this.rangeList.substractPoint(pos);\n if (removed) {\n this.$onRemoveRange(removed);\n return removed[0];\n }\n };\n this.mergeOverlappingRanges = function() {\n var removed = this.rangeList.merge();\n if (removed.length)\n this.$onRemoveRange(removed);\n else if(this.ranges[0])\n this.fromOrientedRange(this.ranges[0]);\n };\n\n this.$onAddRange = function(range) {\n this.rangeCount = this.rangeList.ranges.length;\n this.ranges.unshift(range);\n this._signal(\"addRange\", {range: range});\n };\n\n this.$onRemoveRange = function(removed) {\n this.rangeCount = this.rangeList.ranges.length;\n if (this.rangeCount == 1 && this.inMultiSelectMode) {\n var lastRange = this.rangeList.ranges.pop();\n removed.push(lastRange);\n this.rangeCount = 0;\n }\n\n for (var i = removed.length; i--; ) {\n var index = this.ranges.indexOf(removed[i]);\n this.ranges.splice(index, 1);\n }\n\n this._signal(\"removeRange\", {ranges: removed});\n\n if (this.rangeCount === 0 && this.inMultiSelectMode) {\n this.inMultiSelectMode = false;\n this._signal(\"singleSelect\");\n this.session.$undoSelect = true;\n this.rangeList.detach(this.session);\n }\n\n lastRange = lastRange || this.ranges[0];\n if (lastRange && !lastRange.isEqual(this.getRange()))\n this.fromOrientedRange(lastRange);\n };\n this.$initRangeList = function() {\n if (this.rangeList)\n return;\n\n this.rangeList = new RangeList();\n this.ranges = [];\n this.rangeCount = 0;\n };\n this.getAllRanges = function() {\n return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];\n };\n\n this.splitIntoLines = function () {\n if (this.rangeCount > 1) {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n } else {\n var range = this.getRange();\n var isBackwards = this.isBackwards();\n var startRow = range.start.row;\n var endRow = range.end.row;\n if (startRow == endRow) {\n if (isBackwards)\n var start = range.end, end = range.start;\n else\n var start = range.start, end = range.end;\n \n this.addRange(Range.fromPoints(end, end));\n this.addRange(Range.fromPoints(start, start));\n return;\n }\n\n var rectSel = [];\n var r = this.getLineRange(startRow, true);\n r.start.column = range.start.column;\n rectSel.push(r);\n\n for (var i = startRow + 1; i < endRow; i++)\n rectSel.push(this.getLineRange(i, true));\n\n r = this.getLineRange(endRow, true);\n r.end.column = range.end.column;\n rectSel.push(r);\n\n rectSel.forEach(this.addRange, this);\n }\n };\n this.toggleBlockSelection = function () {\n if (this.rangeCount > 1) {\n var ranges = this.rangeList.ranges;\n var lastRange = ranges[ranges.length - 1];\n var range = Range.fromPoints(ranges[0].start, lastRange.end);\n\n this.toSingleRange();\n this.setSelectionRange(range, lastRange.cursor == lastRange.start);\n } else {\n var cursor = this.session.documentToScreenPosition(this.selectionLead);\n var anchor = this.session.documentToScreenPosition(this.selectionAnchor);\n\n var rectSel = this.rectangularRangeBlock(cursor, anchor);\n rectSel.forEach(this.addRange, this);\n }\n };\n this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) {\n var rectSel = [];\n\n var xBackwards = screenCursor.column < screenAnchor.column;\n if (xBackwards) {\n var startColumn = screenCursor.column;\n var endColumn = screenAnchor.column;\n } else {\n var startColumn = screenAnchor.column;\n var endColumn = screenCursor.column;\n }\n\n var yBackwards = screenCursor.row < screenAnchor.row;\n if (yBackwards) {\n var startRow = screenCursor.row;\n var endRow = screenAnchor.row;\n } else {\n var startRow = screenAnchor.row;\n var endRow = screenCursor.row;\n }\n\n if (startColumn < 0)\n startColumn = 0;\n if (startRow < 0)\n startRow = 0;\n\n if (startRow == endRow)\n includeEmptyLines = true;\n\n for (var row = startRow; row <= endRow; row++) {\n var range = Range.fromPoints(\n this.session.screenToDocumentPosition(row, startColumn),\n this.session.screenToDocumentPosition(row, endColumn)\n );\n if (range.isEmpty()) {\n if (docEnd && isSamePoint(range.end, docEnd))\n break;\n var docEnd = range.end;\n }\n range.cursor = xBackwards ? range.start : range.end;\n rectSel.push(range);\n }\n\n if (yBackwards)\n rectSel.reverse();\n\n if (!includeEmptyLines) {\n var end = rectSel.length - 1;\n while (rectSel[end].isEmpty() && end > 0)\n end--;\n if (end > 0) {\n var start = 0;\n while (rectSel[start].isEmpty())\n start++;\n }\n for (var i = end; i >= start; i--) {\n if (rectSel[i].isEmpty())\n rectSel.splice(i, 1);\n }\n }\n\n return rectSel;\n };\n}).call(Selection.prototype);\nvar Editor = acequire(\"./editor\").Editor;\n(function() {\n this.updateSelectionMarkers = function() {\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n this.addSelectionMarker = function(orientedRange) {\n if (!orientedRange.cursor)\n orientedRange.cursor = orientedRange.end;\n\n var style = this.getSelectionStyle();\n orientedRange.marker = this.session.addMarker(orientedRange, \"ace_selection\", style);\n\n this.session.$selectionMarkers.push(orientedRange);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n return orientedRange;\n };\n this.removeSelectionMarker = function(range) {\n if (!range.marker)\n return;\n this.session.removeMarker(range.marker);\n var index = this.session.$selectionMarkers.indexOf(range);\n if (index != -1)\n this.session.$selectionMarkers.splice(index, 1);\n this.session.selectionMarkerCount = this.session.$selectionMarkers.length;\n };\n\n this.removeSelectionMarkers = function(ranges) {\n var markerList = this.session.$selectionMarkers;\n for (var i = ranges.length; i--; ) {\n var range = ranges[i];\n if (!range.marker)\n continue;\n this.session.removeMarker(range.marker);\n var index = markerList.indexOf(range);\n if (index != -1)\n markerList.splice(index, 1);\n }\n this.session.selectionMarkerCount = markerList.length;\n };\n\n this.$onAddRange = function(e) {\n this.addSelectionMarker(e.range);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n\n this.$onRemoveRange = function(e) {\n this.removeSelectionMarkers(e.ranges);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n\n this.$onMultiSelect = function(e) {\n if (this.inMultiSelectMode)\n return;\n this.inMultiSelectMode = true;\n\n this.setStyle(\"ace_multiselect\");\n this.keyBinding.addKeyboardHandler(commands.keyboardHandler);\n this.commands.setDefaultHandler(\"exec\", this.$onMultiSelectExec);\n\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n };\n\n this.$onSingleSelect = function(e) {\n if (this.session.multiSelect.inVirtualMode)\n return;\n this.inMultiSelectMode = false;\n\n this.unsetStyle(\"ace_multiselect\");\n this.keyBinding.removeKeyboardHandler(commands.keyboardHandler);\n\n this.commands.removeDefaultHandler(\"exec\", this.$onMultiSelectExec);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n this._emit(\"changeSelection\");\n };\n\n this.$onMultiSelectExec = function(e) {\n var command = e.command;\n var editor = e.editor;\n if (!editor.multiSelect)\n return;\n if (!command.multiSelectAction) {\n var result = command.exec(editor, e.args || {});\n editor.multiSelect.addRange(editor.multiSelect.toOrientedRange());\n editor.multiSelect.mergeOverlappingRanges();\n } else if (command.multiSelectAction == \"forEach\") {\n result = editor.forEachSelection(command, e.args);\n } else if (command.multiSelectAction == \"forEachLine\") {\n result = editor.forEachSelection(command, e.args, true);\n } else if (command.multiSelectAction == \"single\") {\n editor.exitMultiSelectMode();\n result = command.exec(editor, e.args || {});\n } else {\n result = command.multiSelectAction(editor, e.args || {});\n }\n return result;\n }; \n this.forEachSelection = function(cmd, args, options) {\n if (this.inVirtualSelectionMode)\n return;\n var keepOrder = options && options.keepOrder;\n var $byLines = options == true || options && options.$byLines\n var session = this.session;\n var selection = this.selection;\n var rangeList = selection.rangeList;\n var ranges = (keepOrder ? selection : rangeList).ranges;\n var result;\n \n if (!ranges.length)\n return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n \n var reg = selection._eventRegistry;\n selection._eventRegistry = {};\n\n var tmpSel = new Selection(session);\n this.inVirtualSelectionMode = true;\n for (var i = ranges.length; i--;) {\n if ($byLines) {\n while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row)\n i--;\n }\n tmpSel.fromOrientedRange(ranges[i]);\n tmpSel.index = i;\n this.selection = session.selection = tmpSel;\n var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {});\n if (!result && cmdResult !== undefined)\n result = cmdResult;\n tmpSel.toOrientedRange(ranges[i]);\n }\n tmpSel.detach();\n\n this.selection = session.selection = selection;\n this.inVirtualSelectionMode = false;\n selection._eventRegistry = reg;\n selection.mergeOverlappingRanges();\n \n var anim = this.renderer.$scrollAnimation;\n this.onCursorChange();\n this.onSelectionChange();\n if (anim && anim.from == anim.to)\n this.renderer.animateScrolling(anim.from);\n \n return result;\n };\n this.exitMultiSelectMode = function() {\n if (!this.inMultiSelectMode || this.inVirtualSelectionMode)\n return;\n this.multiSelect.toSingleRange();\n };\n\n this.getSelectedText = function() {\n var text = \"\";\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var ranges = this.multiSelect.rangeList.ranges;\n var buf = [];\n for (var i = 0; i < ranges.length; i++) {\n buf.push(this.session.getTextRange(ranges[i]));\n }\n var nl = this.session.getDocument().getNewLineCharacter();\n text = buf.join(nl);\n if (text.length == (buf.length - 1) * nl.length)\n text = \"\";\n } else if (!this.selection.isEmpty()) {\n text = this.session.getTextRange(this.getSelectionRange());\n }\n return text;\n };\n \n this.$checkMultiselectChange = function(e, anchor) {\n if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {\n var range = this.multiSelect.ranges[0];\n if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor)\n return;\n var pos = anchor == this.multiSelect.anchor\n ? range.cursor == range.start ? range.end : range.start\n : range.cursor;\n if (pos.row != anchor.row \n || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column)\n this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());\n }\n };\n this.findAll = function(needle, options, additive) {\n options = options || {};\n options.needle = needle || options.needle;\n if (options.needle == undefined) {\n var range = this.selection.isEmpty()\n ? this.selection.getWordRange()\n : this.selection.getRange();\n options.needle = this.session.getTextRange(range);\n } \n this.$search.set(options);\n \n var ranges = this.$search.findAll(this.session);\n if (!ranges.length)\n return 0;\n\n this.$blockScrolling += 1;\n var selection = this.multiSelect;\n\n if (!additive)\n selection.toSingleRange(ranges[0]);\n\n for (var i = ranges.length; i--; )\n selection.addRange(ranges[i], true);\n if (range && selection.rangeList.rangeAtPoint(range.start))\n selection.addRange(range, true);\n \n this.$blockScrolling -= 1;\n\n return ranges.length;\n };\n this.selectMoreLines = function(dir, skip) {\n var range = this.selection.toOrientedRange();\n var isBackwards = range.cursor == range.end;\n\n var screenLead = this.session.documentToScreenPosition(range.cursor);\n if (this.selection.$desiredColumn)\n screenLead.column = this.selection.$desiredColumn;\n\n var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column);\n\n if (!range.isEmpty()) {\n var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start);\n var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column);\n } else {\n var anchor = lead;\n }\n\n if (isBackwards) {\n var newRange = Range.fromPoints(lead, anchor);\n newRange.cursor = newRange.start;\n } else {\n var newRange = Range.fromPoints(anchor, lead);\n newRange.cursor = newRange.end;\n }\n\n newRange.desiredColumn = screenLead.column;\n if (!this.selection.inMultiSelectMode) {\n this.selection.addRange(range);\n } else {\n if (skip)\n var toRemove = range.cursor;\n }\n\n this.selection.addRange(newRange);\n if (toRemove)\n this.selection.substractPoint(toRemove);\n };\n this.transposeSelections = function(dir) {\n var session = this.session;\n var sel = session.multiSelect;\n var all = sel.ranges;\n\n for (var i = all.length; i--; ) {\n var range = all[i];\n if (range.isEmpty()) {\n var tmp = session.getWordRange(range.start.row, range.start.column);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n range.end.row = tmp.end.row;\n range.end.column = tmp.end.column;\n }\n }\n sel.mergeOverlappingRanges();\n\n var words = [];\n for (var i = all.length; i--; ) {\n var range = all[i];\n words.unshift(session.getTextRange(range));\n }\n\n if (dir < 0)\n words.unshift(words.pop());\n else\n words.push(words.shift());\n\n for (var i = all.length; i--; ) {\n var range = all[i];\n var tmp = range.clone();\n session.replace(range, words[i]);\n range.start.row = tmp.start.row;\n range.start.column = tmp.start.column;\n }\n };\n this.selectMore = function(dir, skip, stopAtFirst) {\n var session = this.session;\n var sel = session.multiSelect;\n\n var range = sel.toOrientedRange();\n if (range.isEmpty()) {\n range = session.getWordRange(range.start.row, range.start.column);\n range.cursor = dir == -1 ? range.start : range.end;\n this.multiSelect.addRange(range);\n if (stopAtFirst)\n return;\n }\n var needle = session.getTextRange(range);\n\n var newRange = find(session, needle, dir);\n if (newRange) {\n newRange.cursor = dir == -1 ? newRange.start : newRange.end;\n this.$blockScrolling += 1;\n this.session.unfold(newRange);\n this.multiSelect.addRange(newRange);\n this.$blockScrolling -= 1;\n this.renderer.scrollCursorIntoView(null, 0.5);\n }\n if (skip)\n this.multiSelect.substractPoint(range.cursor);\n };\n this.alignCursors = function() {\n var session = this.session;\n var sel = session.multiSelect;\n var ranges = sel.ranges;\n var row = -1;\n var sameRowRanges = ranges.filter(function(r) {\n if (r.cursor.row == row)\n return true;\n row = r.cursor.row;\n });\n \n if (!ranges.length || sameRowRanges.length == ranges.length - 1) {\n var range = this.selection.getRange();\n var fr = range.start.row, lr = range.end.row;\n var guessRange = fr == lr;\n if (guessRange) {\n var max = this.session.getLength();\n var line;\n do {\n line = this.session.getLine(lr);\n } while (/[=:]/.test(line) && ++lr < max);\n do {\n line = this.session.getLine(fr);\n } while (/[=:]/.test(line) && --fr > 0);\n \n if (fr < 0) fr = 0;\n if (lr >= max) lr = max - 1;\n }\n var lines = this.session.removeFullLines(fr, lr);\n lines = this.$reAlignText(lines, guessRange);\n this.session.insert({row: fr, column: 0}, lines.join(\"\\n\") + \"\\n\");\n if (!guessRange) {\n range.start.column = 0;\n range.end.column = lines[lines.length - 1].length;\n }\n this.selection.setRange(range);\n } else {\n sameRowRanges.forEach(function(r) {\n sel.substractPoint(r.cursor);\n });\n\n var maxCol = 0;\n var minSpace = Infinity;\n var spaceOffsets = ranges.map(function(r) {\n var p = r.cursor;\n var line = session.getLine(p.row);\n var spaceOffset = line.substr(p.column).search(/\\S/g);\n if (spaceOffset == -1)\n spaceOffset = 0;\n\n if (p.column > maxCol)\n maxCol = p.column;\n if (spaceOffset < minSpace)\n minSpace = spaceOffset;\n return spaceOffset;\n });\n ranges.forEach(function(r, i) {\n var p = r.cursor;\n var l = maxCol - p.column;\n var d = spaceOffsets[i] - minSpace;\n if (l > d)\n session.insert(p, lang.stringRepeat(\" \", l - d));\n else\n session.remove(new Range(p.row, p.column, p.row, p.column - l + d));\n\n r.start.column = r.end.column = maxCol;\n r.start.row = r.end.row = p.row;\n r.cursor = r.end;\n });\n sel.fromOrientedRange(ranges[0]);\n this.renderer.updateCursor();\n this.renderer.updateBackMarkers();\n }\n };\n\n this.$reAlignText = function(lines, forceLeft) {\n var isLeftAligned = true, isRightAligned = true;\n var startW, textW, endW;\n\n return lines.map(function(line) {\n var m = line.match(/(\\s*)(.*?)(\\s*)([=:].*)/);\n if (!m)\n return [line];\n\n if (startW == null) {\n startW = m[1].length;\n textW = m[2].length;\n endW = m[3].length;\n return m;\n }\n\n if (startW + textW + endW != m[1].length + m[2].length + m[3].length)\n isRightAligned = false;\n if (startW != m[1].length)\n isLeftAligned = false;\n\n if (startW > m[1].length)\n startW = m[1].length;\n if (textW < m[2].length)\n textW = m[2].length;\n if (endW > m[3].length)\n endW = m[3].length;\n\n return m;\n }).map(forceLeft ? alignLeft :\n isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign);\n\n function spaces(n) {\n return lang.stringRepeat(\" \", n);\n }\n\n function alignLeft(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(textW - m[2].length + endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function alignRight(m) {\n return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2]\n + spaces(endW, \" \")\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n function unAlign(m) {\n return !m[2] ? m[0] : spaces(startW) + m[2]\n + spaces(endW)\n + m[4].replace(/^([=:])\\s+/, \"$1 \");\n }\n };\n}).call(Editor.prototype);\n\n\nfunction isSamePoint(p1, p2) {\n return p1.row == p2.row && p1.column == p2.column;\n}\nexports.onSessionChange = function(e) {\n var session = e.session;\n if (session && !session.multiSelect) {\n session.$selectionMarkers = [];\n session.selection.$initRangeList();\n session.multiSelect = session.selection;\n }\n this.multiSelect = session && session.multiSelect;\n\n var oldSession = e.oldSession;\n if (oldSession) {\n oldSession.multiSelect.off(\"addRange\", this.$onAddRange);\n oldSession.multiSelect.off(\"removeRange\", this.$onRemoveRange);\n oldSession.multiSelect.off(\"multiSelect\", this.$onMultiSelect);\n oldSession.multiSelect.off(\"singleSelect\", this.$onSingleSelect);\n oldSession.multiSelect.lead.off(\"change\", this.$checkMultiselectChange);\n oldSession.multiSelect.anchor.off(\"change\", this.$checkMultiselectChange);\n }\n\n if (session) {\n session.multiSelect.on(\"addRange\", this.$onAddRange);\n session.multiSelect.on(\"removeRange\", this.$onRemoveRange);\n session.multiSelect.on(\"multiSelect\", this.$onMultiSelect);\n session.multiSelect.on(\"singleSelect\", this.$onSingleSelect);\n session.multiSelect.lead.on(\"change\", this.$checkMultiselectChange);\n session.multiSelect.anchor.on(\"change\", this.$checkMultiselectChange);\n }\n\n if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) {\n if (session.selection.inMultiSelectMode)\n this.$onMultiSelect();\n else\n this.$onSingleSelect();\n }\n};\nfunction MultiSelect(editor) {\n if (editor.$multiselectOnSessionChange)\n return;\n editor.$onAddRange = editor.$onAddRange.bind(editor);\n editor.$onRemoveRange = editor.$onRemoveRange.bind(editor);\n editor.$onMultiSelect = editor.$onMultiSelect.bind(editor);\n editor.$onSingleSelect = editor.$onSingleSelect.bind(editor);\n editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor);\n editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor);\n\n editor.$multiselectOnSessionChange(editor);\n editor.on(\"changeSession\", editor.$multiselectOnSessionChange);\n\n editor.on(\"mousedown\", onMouseDown);\n editor.commands.addCommands(commands.defaultCommands);\n\n addAltCursorListeners(editor);\n}\n\nfunction addAltCursorListeners(editor){\n var el = editor.textInput.getElement();\n var altCursor = false;\n event.addListener(el, \"keydown\", function(e) {\n var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey);\n if (editor.$blockSelectEnabled && altDown) {\n if (!altCursor) {\n editor.renderer.setMouseCursor(\"crosshair\");\n altCursor = true;\n }\n } else if (altCursor) {\n reset();\n }\n });\n\n event.addListener(el, \"keyup\", reset);\n event.addListener(el, \"blur\", reset);\n function reset(e) {\n if (altCursor) {\n editor.renderer.setMouseCursor(\"\");\n altCursor = false;\n }\n }\n}\n\nexports.MultiSelect = MultiSelect;\n\n\nacequire(\"./config\").defineOptions(Editor.prototype, \"editor\", {\n enableMultiselect: {\n set: function(val) {\n MultiSelect(this);\n if (val) {\n this.on(\"changeSession\", this.$multiselectOnSessionChange);\n this.on(\"mousedown\", onMouseDown);\n } else {\n this.off(\"changeSession\", this.$multiselectOnSessionChange);\n this.off(\"mousedown\", onMouseDown);\n }\n },\n value: true\n },\n enableBlockSelect: {\n set: function(val) {\n this.$blockSelectEnabled = val;\n },\n value: true\n }\n});\n\n\n\n});\n\nace.define(\"ace/mode/folding/fold_mode\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar Range = acequire(\"../../range\").Range;\n\nvar FoldMode = exports.FoldMode = function() {};\n\n(function() {\n\n this.foldingStartMarker = null;\n this.foldingStopMarker = null;\n this.getFoldWidget = function(session, foldStyle, row) {\n var line = session.getLine(row);\n if (this.foldingStartMarker.test(line))\n return \"start\";\n if (foldStyle == \"markbeginend\"\n && this.foldingStopMarker\n && this.foldingStopMarker.test(line))\n return \"end\";\n return \"\";\n };\n\n this.getFoldWidgetRange = function(session, foldStyle, row) {\n return null;\n };\n\n this.indentationBlock = function(session, row, column) {\n var re = /\\S/;\n var line = session.getLine(row);\n var startLevel = line.search(re);\n if (startLevel == -1)\n return;\n\n var startColumn = column || line.length;\n var maxRow = session.getLength();\n var startRow = row;\n var endRow = row;\n\n while (++row < maxRow) {\n var level = session.getLine(row).search(re);\n\n if (level == -1)\n continue;\n\n if (level <= startLevel)\n break;\n\n endRow = row;\n }\n\n if (endRow > startRow) {\n var endColumn = session.getLine(endRow).length;\n return new Range(startRow, startColumn, endRow, endColumn);\n }\n };\n\n this.openingBracketBlock = function(session, bracket, row, column, typeRe) {\n var start = {row: row, column: column + 1};\n var end = session.$findClosingBracket(bracket, start, typeRe);\n if (!end)\n return;\n\n var fw = session.foldWidgets[end.row];\n if (fw == null)\n fw = session.getFoldWidget(end.row);\n\n if (fw == \"start\" && end.row > start.row) {\n end.row --;\n end.column = session.getLine(end.row).length;\n }\n return Range.fromPoints(start, end);\n };\n\n this.closingBracketBlock = function(session, bracket, row, column, typeRe) {\n var end = {row: row, column: column};\n var start = session.$findOpeningBracket(bracket, end);\n\n if (!start)\n return;\n\n start.column++;\n end.column--;\n\n return Range.fromPoints(start, end);\n };\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/theme/textmate\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(acequire, exports, module) {\n\"use strict\";\n\nexports.isDark = false;\nexports.cssClass = \"ace-tm\";\nexports.cssText = \".ace-tm .ace_gutter {\\\nbackground: #f0f0f0;\\\ncolor: #333;\\\n}\\\n.ace-tm .ace_print-margin {\\\nwidth: 1px;\\\nbackground: #e8e8e8;\\\n}\\\n.ace-tm .ace_fold {\\\nbackground-color: #6B72E6;\\\n}\\\n.ace-tm {\\\nbackground-color: #FFFFFF;\\\ncolor: black;\\\n}\\\n.ace-tm .ace_cursor {\\\ncolor: black;\\\n}\\\n.ace-tm .ace_invisible {\\\ncolor: rgb(191, 191, 191);\\\n}\\\n.ace-tm .ace_storage,\\\n.ace-tm .ace_keyword {\\\ncolor: blue;\\\n}\\\n.ace-tm .ace_constant {\\\ncolor: rgb(197, 6, 11);\\\n}\\\n.ace-tm .ace_constant.ace_buildin {\\\ncolor: rgb(88, 72, 246);\\\n}\\\n.ace-tm .ace_constant.ace_language {\\\ncolor: rgb(88, 92, 246);\\\n}\\\n.ace-tm .ace_constant.ace_library {\\\ncolor: rgb(6, 150, 14);\\\n}\\\n.ace-tm .ace_invalid {\\\nbackground-color: rgba(255, 0, 0, 0.1);\\\ncolor: red;\\\n}\\\n.ace-tm .ace_support.ace_function {\\\ncolor: rgb(60, 76, 114);\\\n}\\\n.ace-tm .ace_support.ace_constant {\\\ncolor: rgb(6, 150, 14);\\\n}\\\n.ace-tm .ace_support.ace_type,\\\n.ace-tm .ace_support.ace_class {\\\ncolor: rgb(109, 121, 222);\\\n}\\\n.ace-tm .ace_keyword.ace_operator {\\\ncolor: rgb(104, 118, 135);\\\n}\\\n.ace-tm .ace_string {\\\ncolor: rgb(3, 106, 7);\\\n}\\\n.ace-tm .ace_comment {\\\ncolor: rgb(76, 136, 107);\\\n}\\\n.ace-tm .ace_comment.ace_doc {\\\ncolor: rgb(0, 102, 255);\\\n}\\\n.ace-tm .ace_comment.ace_doc.ace_tag {\\\ncolor: rgb(128, 159, 191);\\\n}\\\n.ace-tm .ace_constant.ace_numeric {\\\ncolor: rgb(0, 0, 205);\\\n}\\\n.ace-tm .ace_variable {\\\ncolor: rgb(49, 132, 149);\\\n}\\\n.ace-tm .ace_xml-pe {\\\ncolor: rgb(104, 104, 91);\\\n}\\\n.ace-tm .ace_entity.ace_name.ace_function {\\\ncolor: #0000A2;\\\n}\\\n.ace-tm .ace_heading {\\\ncolor: rgb(12, 7, 255);\\\n}\\\n.ace-tm .ace_list {\\\ncolor:rgb(185, 6, 144);\\\n}\\\n.ace-tm .ace_meta.ace_tag {\\\ncolor:rgb(0, 22, 142);\\\n}\\\n.ace-tm .ace_string.ace_regex {\\\ncolor: rgb(255, 0, 0)\\\n}\\\n.ace-tm .ace_marker-layer .ace_selection {\\\nbackground: rgb(181, 213, 255);\\\n}\\\n.ace-tm.ace_multiselect .ace_selection.ace_start {\\\nbox-shadow: 0 0 3px 0px white;\\\n}\\\n.ace-tm .ace_marker-layer .ace_step {\\\nbackground: rgb(252, 255, 0);\\\n}\\\n.ace-tm .ace_marker-layer .ace_stack {\\\nbackground: rgb(164, 229, 101);\\\n}\\\n.ace-tm .ace_marker-layer .ace_bracket {\\\nmargin: -1px 0 0 -1px;\\\nborder: 1px solid rgb(192, 192, 192);\\\n}\\\n.ace-tm .ace_marker-layer .ace_active-line {\\\nbackground: rgba(0, 0, 0, 0.07);\\\n}\\\n.ace-tm .ace_gutter-active-line {\\\nbackground-color : #dcdcdc;\\\n}\\\n.ace-tm .ace_marker-layer .ace_selected-word {\\\nbackground: rgb(250, 250, 255);\\\nborder: 1px solid rgb(200, 200, 250);\\\n}\\\n.ace-tm .ace_indent-guide {\\\nbackground: url(\\\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\\\") right repeat-y;\\\n}\\\n\";\n\nvar dom = acequire(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass);\n});\n\nace.define(\"ace/line_widgets\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/dom\",\"ace/range\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"./lib/oop\");\nvar dom = acequire(\"./lib/dom\");\nvar Range = acequire(\"./range\").Range;\n\n\nfunction LineWidgets(session) {\n this.session = session;\n this.session.widgetManager = this;\n this.session.getRowLength = this.getRowLength;\n this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;\n this.updateOnChange = this.updateOnChange.bind(this);\n this.renderWidgets = this.renderWidgets.bind(this);\n this.measureWidgets = this.measureWidgets.bind(this);\n this.session._changedWidgets = [];\n this.$onChangeEditor = this.$onChangeEditor.bind(this);\n \n this.session.on(\"change\", this.updateOnChange);\n this.session.on(\"changeFold\", this.updateOnFold);\n this.session.on(\"changeEditor\", this.$onChangeEditor);\n}\n\n(function() {\n this.getRowLength = function(row) {\n var h;\n if (this.lineWidgets)\n h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;\n else \n h = 0;\n if (!this.$useWrapMode || !this.$wrapData[row]) {\n return 1 + h;\n } else {\n return this.$wrapData[row].length + 1 + h;\n }\n };\n\n this.$getWidgetScreenLength = function() {\n var screenRows = 0;\n this.lineWidgets.forEach(function(w){\n if (w && w.rowCount && !w.hidden)\n screenRows += w.rowCount;\n });\n return screenRows;\n }; \n \n this.$onChangeEditor = function(e) {\n this.attach(e.editor);\n };\n \n this.attach = function(editor) {\n if (editor && editor.widgetManager && editor.widgetManager != this)\n editor.widgetManager.detach();\n\n if (this.editor == editor)\n return;\n\n this.detach();\n this.editor = editor;\n \n if (editor) {\n editor.widgetManager = this;\n editor.renderer.on(\"beforeRender\", this.measureWidgets);\n editor.renderer.on(\"afterRender\", this.renderWidgets);\n }\n };\n this.detach = function(e) {\n var editor = this.editor;\n if (!editor)\n return;\n \n this.editor = null;\n editor.widgetManager = null;\n \n editor.renderer.off(\"beforeRender\", this.measureWidgets);\n editor.renderer.off(\"afterRender\", this.renderWidgets);\n var lineWidgets = this.session.lineWidgets;\n lineWidgets && lineWidgets.forEach(function(w) {\n if (w && w.el && w.el.parentNode) {\n w._inDocument = false;\n w.el.parentNode.removeChild(w.el);\n }\n });\n };\n\n this.updateOnFold = function(e, session) {\n var lineWidgets = session.lineWidgets;\n if (!lineWidgets || !e.action)\n return;\n var fold = e.data;\n var start = fold.start.row;\n var end = fold.end.row;\n var hide = e.action == \"add\";\n for (var i = start + 1; i < end; i++) {\n if (lineWidgets[i])\n lineWidgets[i].hidden = hide;\n }\n if (lineWidgets[end]) {\n if (hide) {\n if (!lineWidgets[start])\n lineWidgets[start] = lineWidgets[end];\n else\n lineWidgets[end].hidden = hide;\n } else {\n if (lineWidgets[start] == lineWidgets[end])\n lineWidgets[start] = undefined;\n lineWidgets[end].hidden = hide;\n }\n }\n };\n \n this.updateOnChange = function(delta) {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets) return;\n \n var startRow = delta.start.row;\n var len = delta.end.row - startRow;\n\n if (len === 0) {\n } else if (delta.action == 'remove') {\n var removed = lineWidgets.splice(startRow + 1, len);\n removed.forEach(function(w) {\n w && this.removeLineWidget(w);\n }, this);\n this.$updateRows();\n } else {\n var args = new Array(len);\n args.unshift(startRow, 0);\n lineWidgets.splice.apply(lineWidgets, args);\n this.$updateRows();\n }\n };\n \n this.$updateRows = function() {\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets) return;\n var noWidgets = true;\n lineWidgets.forEach(function(w, i) {\n if (w) {\n noWidgets = false;\n w.row = i;\n while (w.$oldWidget) {\n w.$oldWidget.row = i;\n w = w.$oldWidget;\n }\n }\n });\n if (noWidgets)\n this.session.lineWidgets = null;\n };\n\n this.addLineWidget = function(w) {\n if (!this.session.lineWidgets)\n this.session.lineWidgets = new Array(this.session.getLength());\n \n var old = this.session.lineWidgets[w.row];\n if (old) {\n w.$oldWidget = old;\n if (old.el && old.el.parentNode) {\n old.el.parentNode.removeChild(old.el);\n old._inDocument = false;\n }\n }\n \n this.session.lineWidgets[w.row] = w;\n \n w.session = this.session;\n \n var renderer = this.editor.renderer;\n if (w.html && !w.el) {\n w.el = dom.createElement(\"div\");\n w.el.innerHTML = w.html;\n }\n if (w.el) {\n dom.addCssClass(w.el, \"ace_lineWidgetContainer\");\n w.el.style.position = \"absolute\";\n w.el.style.zIndex = 5;\n renderer.container.appendChild(w.el);\n w._inDocument = true;\n }\n \n if (!w.coverGutter) {\n w.el.style.zIndex = 3;\n }\n if (w.pixelHeight == null) {\n w.pixelHeight = w.el.offsetHeight;\n }\n if (w.rowCount == null) {\n w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;\n }\n \n var fold = this.session.getFoldAt(w.row, 0);\n w.$fold = fold;\n if (fold) {\n var lineWidgets = this.session.lineWidgets;\n if (w.row == fold.end.row && !lineWidgets[fold.start.row])\n lineWidgets[fold.start.row] = w;\n else\n w.hidden = true;\n }\n \n this.session._emit(\"changeFold\", {data:{start:{row: w.row}}});\n \n this.$updateRows();\n this.renderWidgets(null, renderer);\n this.onWidgetChanged(w);\n return w;\n };\n \n this.removeLineWidget = function(w) {\n w._inDocument = false;\n w.session = null;\n if (w.el && w.el.parentNode)\n w.el.parentNode.removeChild(w.el);\n if (w.editor && w.editor.destroy) try {\n w.editor.destroy();\n } catch(e){}\n if (this.session.lineWidgets) {\n var w1 = this.session.lineWidgets[w.row]\n if (w1 == w) {\n this.session.lineWidgets[w.row] = w.$oldWidget;\n if (w.$oldWidget)\n this.onWidgetChanged(w.$oldWidget);\n } else {\n while (w1) {\n if (w1.$oldWidget == w) {\n w1.$oldWidget = w.$oldWidget;\n break;\n }\n w1 = w1.$oldWidget;\n }\n }\n }\n this.session._emit(\"changeFold\", {data:{start:{row: w.row}}});\n this.$updateRows();\n };\n \n this.getWidgetsAtRow = function(row) {\n var lineWidgets = this.session.lineWidgets;\n var w = lineWidgets && lineWidgets[row];\n var list = [];\n while (w) {\n list.push(w);\n w = w.$oldWidget;\n }\n return list;\n };\n \n this.onWidgetChanged = function(w) {\n this.session._changedWidgets.push(w);\n this.editor && this.editor.renderer.updateFull();\n };\n \n this.measureWidgets = function(e, renderer) {\n var changedWidgets = this.session._changedWidgets;\n var config = renderer.layerConfig;\n \n if (!changedWidgets || !changedWidgets.length) return;\n var min = Infinity;\n for (var i = 0; i < changedWidgets.length; i++) {\n var w = changedWidgets[i];\n if (!w || !w.el) continue;\n if (w.session != this.session) continue;\n if (!w._inDocument) {\n if (this.session.lineWidgets[w.row] != w)\n continue;\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n \n w.h = w.el.offsetHeight;\n \n if (!w.fixedWidth) {\n w.w = w.el.offsetWidth;\n w.screenWidth = Math.ceil(w.w / config.characterWidth);\n }\n \n var rowCount = w.h / config.lineHeight;\n if (w.coverLine) {\n rowCount -= this.session.getRowLineCount(w.row);\n if (rowCount < 0)\n rowCount = 0;\n }\n if (w.rowCount != rowCount) {\n w.rowCount = rowCount;\n if (w.row < min)\n min = w.row;\n }\n }\n if (min != Infinity) {\n this.session._emit(\"changeFold\", {data:{start:{row: min}}});\n this.session.lineWidgetWidth = null;\n }\n this.session._changedWidgets = [];\n };\n \n this.renderWidgets = function(e, renderer) {\n var config = renderer.layerConfig;\n var lineWidgets = this.session.lineWidgets;\n if (!lineWidgets)\n return;\n var first = Math.min(this.firstRow, config.firstRow);\n var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length);\n \n while (first > 0 && !lineWidgets[first])\n first--;\n \n this.firstRow = config.firstRow;\n this.lastRow = config.lastRow;\n\n renderer.$cursorLayer.config = config;\n for (var i = first; i <= last; i++) {\n var w = lineWidgets[i];\n if (!w || !w.el) continue;\n if (w.hidden) {\n w.el.style.top = -100 - (w.pixelHeight || 0) + \"px\";\n continue;\n }\n if (!w._inDocument) {\n w._inDocument = true;\n renderer.container.appendChild(w.el);\n }\n var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top;\n if (!w.coverLine)\n top += config.lineHeight * this.session.getRowLineCount(w.row);\n w.el.style.top = top - config.offset + \"px\";\n \n var left = w.coverGutter ? 0 : renderer.gutterWidth;\n if (!w.fixedWidth)\n left -= renderer.scrollLeft;\n w.el.style.left = left + \"px\";\n \n if (w.fullWidth && w.screenWidth) {\n w.el.style.minWidth = config.width + 2 * config.padding + \"px\";\n }\n \n if (w.fixedWidth) {\n w.el.style.right = renderer.scrollBar.getWidth() + \"px\";\n } else {\n w.el.style.right = \"\";\n }\n }\n };\n \n}).call(LineWidgets.prototype);\n\n\nexports.LineWidgets = LineWidgets;\n\n});\n\nace.define(\"ace/ext/error_marker\",[\"require\",\"exports\",\"module\",\"ace/line_widgets\",\"ace/lib/dom\",\"ace/range\"], function(acequire, exports, module) {\n\"use strict\";\nvar LineWidgets = acequire(\"../line_widgets\").LineWidgets;\nvar dom = acequire(\"../lib/dom\");\nvar Range = acequire(\"../range\").Range;\n\nfunction binarySearch(array, needle, comparator) {\n var first = 0;\n var last = array.length - 1;\n\n while (first <= last) {\n var mid = (first + last) >> 1;\n var c = comparator(needle, array[mid]);\n if (c > 0)\n first = mid + 1;\n else if (c < 0)\n last = mid - 1;\n else\n return mid;\n }\n return -(first + 1);\n}\n\nfunction findAnnotations(session, row, dir) {\n var annotations = session.getAnnotations().sort(Range.comparePoints);\n if (!annotations.length)\n return;\n \n var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints);\n if (i < 0)\n i = -i - 1;\n \n if (i >= annotations.length)\n i = dir > 0 ? 0 : annotations.length - 1;\n else if (i === 0 && dir < 0)\n i = annotations.length - 1;\n \n var annotation = annotations[i];\n if (!annotation || !dir)\n return;\n\n if (annotation.row === row) {\n do {\n annotation = annotations[i += dir];\n } while (annotation && annotation.row === row);\n if (!annotation)\n return annotations.slice();\n }\n \n \n var matched = [];\n row = annotation.row;\n do {\n matched[dir < 0 ? \"unshift\" : \"push\"](annotation);\n annotation = annotations[i += dir];\n } while (annotation && annotation.row == row);\n return matched.length && matched;\n}\n\nexports.showErrorMarker = function(editor, dir) {\n var session = editor.session;\n if (!session.widgetManager) {\n session.widgetManager = new LineWidgets(session);\n session.widgetManager.attach(editor);\n }\n \n var pos = editor.getCursorPosition();\n var row = pos.row;\n var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function(w) {\n return w.type == \"errorMarker\";\n })[0];\n if (oldWidget) {\n oldWidget.destroy();\n } else {\n row -= dir;\n }\n var annotations = findAnnotations(session, row, dir);\n var gutterAnno;\n if (annotations) {\n var annotation = annotations[0];\n pos.column = (annotation.pos && typeof annotation.column != \"number\"\n ? annotation.pos.sc\n : annotation.column) || 0;\n pos.row = annotation.row;\n gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];\n } else if (oldWidget) {\n return;\n } else {\n gutterAnno = {\n text: [\"Looks good!\"],\n className: \"ace_ok\"\n };\n }\n editor.session.unfold(pos.row);\n editor.selection.moveToPosition(pos);\n \n var w = {\n row: pos.row, \n fixedWidth: true,\n coverGutter: true,\n el: dom.createElement(\"div\"),\n type: \"errorMarker\"\n };\n var el = w.el.appendChild(dom.createElement(\"div\"));\n var arrow = w.el.appendChild(dom.createElement(\"div\"));\n arrow.className = \"error_widget_arrow \" + gutterAnno.className;\n \n var left = editor.renderer.$cursorLayer\n .getPixelPosition(pos).left;\n arrow.style.left = left + editor.renderer.gutterWidth - 5 + \"px\";\n \n w.el.className = \"error_widget_wrapper\";\n el.className = \"error_widget \" + gutterAnno.className;\n el.innerHTML = gutterAnno.text.join(\"
\");\n \n el.appendChild(dom.createElement(\"div\"));\n \n var kb = function(_, hashId, keyString) {\n if (hashId === 0 && (keyString === \"esc\" || keyString === \"return\")) {\n w.destroy();\n return {command: \"null\"};\n }\n };\n \n w.destroy = function() {\n if (editor.$mouseHandler.isMousePressed)\n return;\n editor.keyBinding.removeKeyboardHandler(kb);\n session.widgetManager.removeLineWidget(w);\n editor.off(\"changeSelection\", w.destroy);\n editor.off(\"changeSession\", w.destroy);\n editor.off(\"mouseup\", w.destroy);\n editor.off(\"change\", w.destroy);\n };\n \n editor.keyBinding.addKeyboardHandler(kb);\n editor.on(\"changeSelection\", w.destroy);\n editor.on(\"changeSession\", w.destroy);\n editor.on(\"mouseup\", w.destroy);\n editor.on(\"change\", w.destroy);\n \n editor.session.widgetManager.addLineWidget(w);\n \n w.el.onmousedown = editor.focus.bind(editor);\n \n editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight});\n};\n\n\ndom.importCssString(\"\\\n .error_widget_wrapper {\\\n background: inherit;\\\n color: inherit;\\\n border:none\\\n }\\\n .error_widget {\\\n border-top: solid 2px;\\\n border-bottom: solid 2px;\\\n margin: 5px 0;\\\n padding: 10px 40px;\\\n white-space: pre-wrap;\\\n }\\\n .error_widget.ace_error, .error_widget_arrow.ace_error{\\\n border-color: #ff5a5a\\\n }\\\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\\\n border-color: #F1D817\\\n }\\\n .error_widget.ace_info, .error_widget_arrow.ace_info{\\\n border-color: #5a5a5a\\\n }\\\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\\\n border-color: #5aaa5a\\\n }\\\n .error_widget_arrow {\\\n position: absolute;\\\n border: solid 5px;\\\n border-top-color: transparent!important;\\\n border-right-color: transparent!important;\\\n border-left-color: transparent!important;\\\n top: -5px;\\\n }\\\n\", \"\");\n\n});\n\nace.define(\"ace/ace\",[\"require\",\"exports\",\"module\",\"ace/lib/fixoldbrowsers\",\"ace/lib/dom\",\"ace/lib/event\",\"ace/editor\",\"ace/edit_session\",\"ace/undomanager\",\"ace/virtual_renderer\",\"ace/worker/worker_client\",\"ace/keyboard/hash_handler\",\"ace/placeholder\",\"ace/multi_select\",\"ace/mode/folding/fold_mode\",\"ace/theme/textmate\",\"ace/ext/error_marker\",\"ace/config\"], function(acequire, exports, module) {\n\"use strict\";\n\nacequire(\"./lib/fixoldbrowsers\");\n\nvar dom = acequire(\"./lib/dom\");\nvar event = acequire(\"./lib/event\");\n\nvar Editor = acequire(\"./editor\").Editor;\nvar EditSession = acequire(\"./edit_session\").EditSession;\nvar UndoManager = acequire(\"./undomanager\").UndoManager;\nvar Renderer = acequire(\"./virtual_renderer\").VirtualRenderer;\nacequire(\"./worker/worker_client\");\nacequire(\"./keyboard/hash_handler\");\nacequire(\"./placeholder\");\nacequire(\"./multi_select\");\nacequire(\"./mode/folding/fold_mode\");\nacequire(\"./theme/textmate\");\nacequire(\"./ext/error_marker\");\n\nexports.config = acequire(\"./config\");\nexports.acequire = acequire;\n\nif (true)\n exports.define = __webpack_require__(547);\nexports.edit = function(el) {\n if (typeof el == \"string\") {\n var _id = el;\n el = document.getElementById(_id);\n if (!el)\n throw new Error(\"ace.edit can't find div #\" + _id);\n }\n\n if (el && el.env && el.env.editor instanceof Editor)\n return el.env.editor;\n\n var value = \"\";\n if (el && /input|textarea/i.test(el.tagName)) {\n var oldNode = el;\n value = oldNode.value;\n el = dom.createElement(\"pre\");\n oldNode.parentNode.replaceChild(el, oldNode);\n } else if (el) {\n value = dom.getInnerText(el);\n el.innerHTML = \"\";\n }\n\n var doc = exports.createEditSession(value);\n\n var editor = new Editor(new Renderer(el));\n editor.setSession(doc);\n\n var env = {\n document: doc,\n editor: editor,\n onResize: editor.resize.bind(editor, null)\n };\n if (oldNode) env.textarea = oldNode;\n event.addListener(window, \"resize\", env.onResize);\n editor.on(\"destroy\", function() {\n event.removeListener(window, \"resize\", env.onResize);\n env.editor.container.env = null; // prevent memory leak on old ie\n });\n editor.container.env = editor.env = env;\n return editor;\n};\nexports.createEditSession = function(text, mode) {\n var doc = new EditSession(text, mode);\n doc.setUndoManager(new UndoManager());\n return doc;\n}\nexports.EditSession = EditSession;\nexports.UndoManager = UndoManager;\nexports.version = \"1.2.6\";\n});\n (function() {\n ace.acequire([\"ace/ace\"], function(a) {\n if (a) {\n a.config.init(true);\n a.define = ace.define;\n }\n if (!window.ace)\n window.ace = a;\n for (var key in a) if (a.hasOwnProperty(key))\n window.ace[key] = a[key];\n });\n })();\n \nmodule.exports = window.ace.acequire(\"ace/ace\");\n\n/***/ }),\n/* 931 */\n/***/ (function(module, exports, __webpack_require__) {\n\nace.define(\"ace/mode/json_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"../lib/oop\");\nvar TextHighlightRules = acequire(\"./text_highlight_rules\").TextHighlightRules;\n\nvar JsonHighlightRules = function() {\n this.$rules = {\n \"start\" : [\n {\n token : \"variable\", // single line\n regex : '[\"](?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?[\"]\\\\s*(?=:)'\n }, {\n token : \"string\", // single line\n regex : '\"',\n next : \"string\"\n }, {\n token : \"constant.numeric\", // hex\n regex : \"0[xX][0-9a-fA-F]+\\\\b\"\n }, {\n token : \"constant.numeric\", // float\n regex : \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"\n }, {\n token : \"constant.language.boolean\",\n regex : \"(?:true|false)\\\\b\"\n }, {\n token : \"invalid.illegal\", // single quoted strings are not allowed\n regex : \"['](?:(?:\\\\\\\\.)|(?:[^'\\\\\\\\]))*?[']\"\n }, {\n token : \"invalid.illegal\", // comments are not allowed\n regex : \"\\\\/\\\\/.*$\"\n }, {\n token : \"paren.lparen\",\n regex : \"[[({]\"\n }, {\n token : \"paren.rparen\",\n regex : \"[\\\\])}]\"\n }, {\n token : \"text\",\n regex : \"\\\\s+\"\n }\n ],\n \"string\" : [\n {\n token : \"constant.language.escape\",\n regex : /\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[\"\\\\\\/bfnrt])/\n }, {\n token : \"string\",\n regex : '[^\"\\\\\\\\]+'\n }, {\n token : \"string\",\n regex : '\"',\n next : \"start\"\n }, {\n token : \"string\",\n regex : \"\",\n next : \"start\"\n }\n ]\n };\n \n};\n\noop.inherits(JsonHighlightRules, TextHighlightRules);\n\nexports.JsonHighlightRules = JsonHighlightRules;\n});\n\nace.define(\"ace/mode/matching_brace_outdent\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar Range = acequire(\"../range\").Range;\n\nvar MatchingBraceOutdent = function() {};\n\n(function() {\n\n this.checkOutdent = function(line, input) {\n if (! /^\\s+$/.test(line))\n return false;\n\n return /^\\s*\\}/.test(input);\n };\n\n this.autoOutdent = function(doc, row) {\n var line = doc.getLine(row);\n var match = line.match(/^(\\s*\\})/);\n\n if (!match) return 0;\n\n var column = match[1].length;\n var openBracePos = doc.findMatchingBracket({row: row, column: column});\n\n if (!openBracePos || openBracePos.row == row) return 0;\n\n var indent = this.$getIndent(doc.getLine(openBracePos.row));\n doc.replace(new Range(row, 0, row, column-1), indent);\n };\n\n this.$getIndent = function(line) {\n return line.match(/^\\s*/)[0];\n };\n\n}).call(MatchingBraceOutdent.prototype);\n\nexports.MatchingBraceOutdent = MatchingBraceOutdent;\n});\n\nace.define(\"ace/mode/folding/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/range\",\"ace/mode/folding/fold_mode\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"../../lib/oop\");\nvar Range = acequire(\"../../range\").Range;\nvar BaseFoldMode = acequire(\"./fold_mode\").FoldMode;\n\nvar FoldMode = exports.FoldMode = function(commentRegex) {\n if (commentRegex) {\n this.foldingStartMarker = new RegExp(\n this.foldingStartMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.start)\n );\n this.foldingStopMarker = new RegExp(\n this.foldingStopMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.end)\n );\n }\n};\noop.inherits(FoldMode, BaseFoldMode);\n\n(function() {\n \n this.foldingStartMarker = /(\\{|\\[)[^\\}\\]]*$|^\\s*(\\/\\*)/;\n this.foldingStopMarker = /^[^\\[\\{]*(\\}|\\])|^[\\s\\*]*(\\*\\/)/;\n this.singleLineBlockCommentRe= /^\\s*(\\/\\*).*\\*\\/\\s*$/;\n this.tripleStarBlockCommentRe = /^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/;\n this.startRegionRe = /^\\s*(\\/\\*|\\/\\/)#?region\\b/;\n this._getFoldWidgetBase = this.getFoldWidget;\n this.getFoldWidget = function(session, foldStyle, row) {\n var line = session.getLine(row);\n \n if (this.singleLineBlockCommentRe.test(line)) {\n if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))\n return \"\";\n }\n \n var fw = this._getFoldWidgetBase(session, foldStyle, row);\n \n if (!fw && this.startRegionRe.test(line))\n return \"start\"; // lineCommentRegionStart\n \n return fw;\n };\n\n this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {\n var line = session.getLine(row);\n \n if (this.startRegionRe.test(line))\n return this.getCommentRegionBlock(session, line, row);\n \n var match = line.match(this.foldingStartMarker);\n if (match) {\n var i = match.index;\n\n if (match[1])\n return this.openingBracketBlock(session, match[1], row, i);\n \n var range = session.getCommentFoldRange(row, i + match[0].length, 1);\n \n if (range && !range.isMultiLine()) {\n if (forceMultiline) {\n range = this.getSectionRange(session, row);\n } else if (foldStyle != \"all\")\n range = null;\n }\n \n return range;\n }\n\n if (foldStyle === \"markbegin\")\n return;\n\n var match = line.match(this.foldingStopMarker);\n if (match) {\n var i = match.index + match[0].length;\n\n if (match[1])\n return this.closingBracketBlock(session, match[1], row, i);\n\n return session.getCommentFoldRange(row, i, -1);\n }\n };\n \n this.getSectionRange = function(session, row) {\n var line = session.getLine(row);\n var startIndent = line.search(/\\S/);\n var startRow = row;\n var startColumn = line.length;\n row = row + 1;\n var endRow = row;\n var maxRow = session.getLength();\n while (++row < maxRow) {\n line = session.getLine(row);\n var indent = line.search(/\\S/);\n if (indent === -1)\n continue;\n if (startIndent > indent)\n break;\n var subRange = this.getFoldWidgetRange(session, \"all\", row);\n \n if (subRange) {\n if (subRange.start.row <= startRow) {\n break;\n } else if (subRange.isMultiLine()) {\n row = subRange.end.row;\n } else if (startIndent == indent) {\n break;\n }\n }\n endRow = row;\n }\n \n return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);\n };\n this.getCommentRegionBlock = function(session, line, row) {\n var startColumn = line.search(/\\s*$/);\n var maxRow = session.getLength();\n var startRow = row;\n \n var re = /^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/;\n var depth = 1;\n while (++row < maxRow) {\n line = session.getLine(row);\n var m = re.exec(line);\n if (!m) continue;\n if (m[1]) depth--;\n else depth++;\n\n if (!depth) break;\n }\n\n var endRow = row;\n if (endRow > startRow) {\n return new Range(startRow, startColumn, endRow, line.length);\n }\n };\n\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/mode/json\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/json_highlight_rules\",\"ace/mode/matching_brace_outdent\",\"ace/mode/behaviour/cstyle\",\"ace/mode/folding/cstyle\",\"ace/worker/worker_client\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"../lib/oop\");\nvar TextMode = acequire(\"./text\").Mode;\nvar HighlightRules = acequire(\"./json_highlight_rules\").JsonHighlightRules;\nvar MatchingBraceOutdent = acequire(\"./matching_brace_outdent\").MatchingBraceOutdent;\nvar CstyleBehaviour = acequire(\"./behaviour/cstyle\").CstyleBehaviour;\nvar CStyleFoldMode = acequire(\"./folding/cstyle\").FoldMode;\nvar WorkerClient = acequire(\"../worker/worker_client\").WorkerClient;\n\nvar Mode = function() {\n this.HighlightRules = HighlightRules;\n this.$outdent = new MatchingBraceOutdent();\n this.$behaviour = new CstyleBehaviour();\n this.foldingRules = new CStyleFoldMode();\n};\noop.inherits(Mode, TextMode);\n\n(function() {\n\n this.getNextLineIndent = function(state, line, tab) {\n var indent = this.$getIndent(line);\n\n if (state == \"start\") {\n var match = line.match(/^.*[\\{\\(\\[]\\s*$/);\n if (match) {\n indent += tab;\n }\n }\n\n return indent;\n };\n\n this.checkOutdent = function(state, line, input) {\n return this.$outdent.checkOutdent(line, input);\n };\n\n this.autoOutdent = function(state, doc, row) {\n this.$outdent.autoOutdent(doc, row);\n };\n\n this.createWorker = function(session) {\n var worker = new WorkerClient([\"ace\"], __webpack_require__(934), \"JsonWorker\");\n worker.attachToDocument(session.getDocument());\n\n worker.on(\"annotate\", function(e) {\n session.setAnnotations(e.data);\n });\n\n worker.on(\"terminate\", function() {\n session.clearAnnotations();\n });\n\n return worker;\n };\n\n\n this.$id = \"ace/mode/json\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n});\n\n\n/***/ }),\n/* 932 */\n/***/ (function(module, exports) {\n\nace.define(\"ace/mode/sql_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"../lib/oop\");\nvar TextHighlightRules = acequire(\"./text_highlight_rules\").TextHighlightRules;\n\nvar SqlHighlightRules = function() {\n\n var keywords = (\n \"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|\" +\n \"when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|\" +\n \"foreign|not|references|default|null|inner|cross|natural|database|drop|grant\"\n );\n\n var builtinConstants = (\n \"true|false\"\n );\n\n var builtinFunctions = (\n \"avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|\" + \n \"coalesce|ifnull|isnull|nvl\"\n );\n\n var dataTypes = (\n \"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|\" +\n \"money|real|number|integer\"\n );\n\n var keywordMapper = this.createKeywordMapper({\n \"support.function\": builtinFunctions,\n \"keyword\": keywords,\n \"constant.language\": builtinConstants,\n \"storage.type\": dataTypes\n }, \"identifier\", true);\n\n this.$rules = {\n \"start\" : [ {\n token : \"comment\",\n regex : \"--.*$\"\n }, {\n token : \"comment\",\n start : \"/\\\\*\",\n end : \"\\\\*/\"\n }, {\n token : \"string\", // \" string\n regex : '\".*?\"'\n }, {\n token : \"string\", // ' string\n regex : \"'.*?'\"\n }, {\n token : \"constant.numeric\", // float\n regex : \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"\n }, {\n token : keywordMapper,\n regex : \"[a-zA-Z_$][a-zA-Z0-9_$]*\\\\b\"\n }, {\n token : \"keyword.operator\",\n regex : \"\\\\+|\\\\-|\\\\/|\\\\/\\\\/|%|<@>|@>|<@|&|\\\\^|~|<|>|<=|=>|==|!=|<>|=\"\n }, {\n token : \"paren.lparen\",\n regex : \"[\\\\(]\"\n }, {\n token : \"paren.rparen\",\n regex : \"[\\\\)]\"\n }, {\n token : \"text\",\n regex : \"\\\\s+\"\n } ]\n };\n this.normalizeRules();\n};\n\noop.inherits(SqlHighlightRules, TextHighlightRules);\n\nexports.SqlHighlightRules = SqlHighlightRules;\n});\n\nace.define(\"ace/mode/sql\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/sql_highlight_rules\"], function(acequire, exports, module) {\n\"use strict\";\n\nvar oop = acequire(\"../lib/oop\");\nvar TextMode = acequire(\"./text\").Mode;\nvar SqlHighlightRules = acequire(\"./sql_highlight_rules\").SqlHighlightRules;\n\nvar Mode = function() {\n this.HighlightRules = SqlHighlightRules;\n this.$behaviour = this.$defaultBehaviour;\n};\noop.inherits(Mode, TextMode);\n\n(function() {\n\n this.lineCommentStart = \"--\";\n\n this.$id = \"ace/mode/sql\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n\n});\n\n\n/***/ }),\n/* 933 */\n/***/ (function(module, exports) {\n\nace.define(\"ace/theme/monokai\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"], function(acequire, exports, module) {\n\nexports.isDark = true;\nexports.cssClass = \"ace-monokai\";\nexports.cssText = \".ace-monokai .ace_gutter {\\\nbackground: #2F3129;\\\ncolor: #8F908A\\\n}\\\n.ace-monokai .ace_print-margin {\\\nwidth: 1px;\\\nbackground: #555651\\\n}\\\n.ace-monokai {\\\nbackground-color: #272822;\\\ncolor: #F8F8F2\\\n}\\\n.ace-monokai .ace_cursor {\\\ncolor: #F8F8F0\\\n}\\\n.ace-monokai .ace_marker-layer .ace_selection {\\\nbackground: #49483E\\\n}\\\n.ace-monokai.ace_multiselect .ace_selection.ace_start {\\\nbox-shadow: 0 0 3px 0px #272822;\\\n}\\\n.ace-monokai .ace_marker-layer .ace_step {\\\nbackground: rgb(102, 82, 0)\\\n}\\\n.ace-monokai .ace_marker-layer .ace_bracket {\\\nmargin: -1px 0 0 -1px;\\\nborder: 1px solid #49483E\\\n}\\\n.ace-monokai .ace_marker-layer .ace_active-line {\\\nbackground: #202020\\\n}\\\n.ace-monokai .ace_gutter-active-line {\\\nbackground-color: #272727\\\n}\\\n.ace-monokai .ace_marker-layer .ace_selected-word {\\\nborder: 1px solid #49483E\\\n}\\\n.ace-monokai .ace_invisible {\\\ncolor: #52524d\\\n}\\\n.ace-monokai .ace_entity.ace_name.ace_tag,\\\n.ace-monokai .ace_keyword,\\\n.ace-monokai .ace_meta.ace_tag,\\\n.ace-monokai .ace_storage {\\\ncolor: #F92672\\\n}\\\n.ace-monokai .ace_punctuation,\\\n.ace-monokai .ace_punctuation.ace_tag {\\\ncolor: #fff\\\n}\\\n.ace-monokai .ace_constant.ace_character,\\\n.ace-monokai .ace_constant.ace_language,\\\n.ace-monokai .ace_constant.ace_numeric,\\\n.ace-monokai .ace_constant.ace_other {\\\ncolor: #AE81FF\\\n}\\\n.ace-monokai .ace_invalid {\\\ncolor: #F8F8F0;\\\nbackground-color: #F92672\\\n}\\\n.ace-monokai .ace_invalid.ace_deprecated {\\\ncolor: #F8F8F0;\\\nbackground-color: #AE81FF\\\n}\\\n.ace-monokai .ace_support.ace_constant,\\\n.ace-monokai .ace_support.ace_function {\\\ncolor: #66D9EF\\\n}\\\n.ace-monokai .ace_fold {\\\nbackground-color: #A6E22E;\\\nborder-color: #F8F8F2\\\n}\\\n.ace-monokai .ace_storage.ace_type,\\\n.ace-monokai .ace_support.ace_class,\\\n.ace-monokai .ace_support.ace_type {\\\nfont-style: italic;\\\ncolor: #66D9EF\\\n}\\\n.ace-monokai .ace_entity.ace_name.ace_function,\\\n.ace-monokai .ace_entity.ace_other,\\\n.ace-monokai .ace_entity.ace_other.ace_attribute-name,\\\n.ace-monokai .ace_variable {\\\ncolor: #A6E22E\\\n}\\\n.ace-monokai .ace_variable.ace_parameter {\\\nfont-style: italic;\\\ncolor: #FD971F\\\n}\\\n.ace-monokai .ace_string {\\\ncolor: #E6DB74\\\n}\\\n.ace-monokai .ace_comment {\\\ncolor: #75715E\\\n}\\\n.ace-monokai .ace_indent-guide {\\\nbackground: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\\\n}\";\n\nvar dom = acequire(\"../lib/dom\");\ndom.importCssString(exports.cssText, exports.cssClass);\n});\n\n\n/***/ }),\n/* 934 */\n/***/ (function(module, exports) {\n\nmodule.exports.id = 'ace/mode/json_worker';\nmodule.exports.src = \"\\\"no use strict\\\";(function(window){function resolveModuleId(id,paths){for(var testPath=id,tail=\\\"\\\";testPath;){var alias=paths[testPath];if(\\\"string\\\"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\\\/*$/,\\\"/\\\")+(tail||alias.main||alias.name);if(alias===!1)return\\\"\\\";var i=testPath.lastIndexOf(\\\"/\\\");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:\\\"log\\\",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:\\\"error\\\",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf(\\\"!\\\")){var chunks=moduleName.split(\\\"!\\\");return window.normalizeModule(parentId,chunks[0])+\\\"!\\\"+window.normalizeModule(parentId,chunks[1])}if(\\\".\\\"==moduleName.charAt(0)){var base=parentId.split(\\\"/\\\").slice(0,-1).join(\\\"/\\\");for(moduleName=(base?base+\\\"/\\\":\\\"\\\")+moduleName;-1!==moduleName.indexOf(\\\".\\\")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\\\.\\\\//,\\\"\\\").replace(/\\\\/\\\\.\\\\//,\\\"/\\\").replace(/[^\\\\/]+\\\\/\\\\.\\\\.\\\\//,\\\"\\\")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error(\\\"worker.js acequire() accepts only (parentId, id) as arguments\\\");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log(\\\"unable to load \\\"+id);var path=resolveModuleId(id,window.acequire.tlns);return\\\".js\\\"!=path.slice(-3)&&(path+=\\\".js\\\"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,\\\"string\\\"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),\\\"function\\\"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=[\\\"require\\\",\\\"exports\\\",\\\"module\\\"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case\\\"require\\\":return req;case\\\"exports\\\":return module.exports;case\\\"module\\\":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire(\\\"ace/lib/event_emitter\\\").EventEmitter,oop=window.acequire(\\\"ace/lib/oop\\\"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:\\\"call\\\",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:\\\"event\\\",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error(\\\"Unknown command:\\\"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire(\\\"ace/lib/es5-shim\\\"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}})(this),ace.define(\\\"ace/lib/oop\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(acequire,exports){\\\"use strict\\\";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define(\\\"ace/range\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(acequire,exports){\\\"use strict\\\";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return\\\"Range: [\\\"+this.start.row+\\\"/\\\"+this.start.column+\\\"] -> [\\\"+this.end.row+\\\"/\\\"+this.end.column+\\\"]\\\"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){\\\"object\\\"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){\\\"object\\\"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define(\\\"ace/apply_delta\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(acequire,exports){\\\"use strict\\\";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||\\\"\\\";switch(delta.action){case\\\"insert\\\":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case\\\"remove\\\":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define(\\\"ace/lib/event_emitter\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(acequire,exports){\\\"use strict\\\";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){\\\"object\\\"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?\\\"unshift\\\":\\\"push\\\"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define(\\\"ace/anchor\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\",\\\"ace/lib/oop\\\",\\\"ace/lib/event_emitter\\\"],function(acequire,exports){\\\"use strict\\\";var oop=acequire(\\\"./lib/oop\\\"),EventEmitter=acequire(\\\"./lib/event_emitter\\\").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.column
this.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal(\\\"change\\\",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener(\\\"change\\\",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on(\\\"change\\\",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define(\\\"ace/document\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\",\\\"ace/lib/oop\\\",\\\"ace/apply_delta\\\",\\\"ace/lib/event_emitter\\\",\\\"ace/range\\\",\\\"ace/anchor\\\"],function(acequire,exports){\\\"use strict\\\";var oop=acequire(\\\"./lib/oop\\\"),applyDelta=acequire(\\\"./apply_delta\\\").applyDelta,EventEmitter=acequire(\\\"./lib/event_emitter\\\").EventEmitter,Range=acequire(\\\"./range\\\").Range,Anchor=acequire(\\\"./anchor\\\").Anchor,Document=function(textOrLines){this.$lines=[\\\"\\\"],0===textOrLines.length?this.$lines=[\\\"\\\"]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0===\\\"aaa\\\".split(/a/).length?function(text){return text.replace(/\\\\r\\\\n|\\\\r/g,\\\"\\\\n\\\").split(\\\"\\\\n\\\")}:function(text){return text.split(/\\\\r\\\\n|\\\\r|\\\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\\\r\\\\n|\\\\r|\\\\n)/m);this.$autoNewLine=match?match[1]:\\\"\\\\n\\\",this._signal(\\\"changeNewLineMode\\\")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case\\\"windows\\\":return\\\"\\\\r\\\\n\\\";case\\\"unix\\\":return\\\"\\\\n\\\";default:return this.$autoNewLine||\\\"\\\\n\\\"}},this.$autoNewLine=\\\"\\\",this.$newLineMode=\\\"auto\\\",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal(\\\"changeNewLineMode\\\"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return\\\"\\\\r\\\\n\\\"==text||\\\"\\\\r\\\"==text||\\\"\\\\n\\\"==text},this.getLine=function(row){return this.$lines[row]||\\\"\\\"},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||\\\"\\\").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn(\\\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\\\"),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn(\\\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\\\"),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn(\\\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\\\"),this.insertMergedLines(position,[\\\"\\\",\\\"\\\"])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:\\\"insert\\\",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([\\\"\\\"]),column=0):(lines=[\\\"\\\"].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:\\\"insert\\\",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:\\\"remove\\\",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:\\\"remove\\\",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:\\\"remove\\\",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:\\\"remove\\\",lines:[\\\"\\\",\\\"\\\"]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert=\\\"insert\\\"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal(\\\"change\\\",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(\\\"\\\"),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:\\\"insert\\\"==delta.action?\\\"remove\\\":\\\"insert\\\",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define(\\\"ace/lib/lang\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(acequire,exports){\\\"use strict\\\";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split(\\\"\\\").reverse().join(\\\"\\\")},exports.stringRepeat=function(string,count){for(var result=\\\"\\\";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\\\s\\\\s*/,trimEndRegexp=/\\\\s\\\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,\\\"\\\")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,\\\"\\\")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&\\\"object\\\"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if(\\\"object\\\"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}if(\\\"[object Object]\\\"!==Object.prototype.toString.call(obj))return obj;copy={};for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\\\]\\\\/\\\\\\\\])/g,\\\"\\\\\\\\$1\\\")},exports.escapeHTML=function(str){return str.replace(/&/g,\\\"&\\\").replace(/\\\"/g,\\\""\\\").replace(/'/g,\\\"'\\\").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:\\\"insert\\\",start:data[i],lines:data[i+1]};else var d={action:\\\"remove\\\",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define(\\\"ace/mode/json/json_parse\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(){\\\"use strict\\\";var at,ch,text,value,escapee={'\\\"':'\\\"',\\\"\\\\\\\\\\\":\\\"\\\\\\\\\\\",\\\"/\\\":\\\"/\\\",b:\\\"\\\\b\\\",f:\\\"\\\\f\\\",n:\\\"\\\\n\\\",r:\\\"\\\\r\\\",t:\\\"\\t\\\"},error=function(m){throw{name:\\\"SyntaxError\\\",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error(\\\"Expected '\\\"+c+\\\"' instead of '\\\"+ch+\\\"'\\\"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string=\\\"\\\";for(\\\"-\\\"===ch&&(string=\\\"-\\\",next(\\\"-\\\"));ch>=\\\"0\\\"&&\\\"9\\\">=ch;)string+=ch,next();if(\\\".\\\"===ch)for(string+=\\\".\\\";next()&&ch>=\\\"0\\\"&&\\\"9\\\">=ch;)string+=ch;if(\\\"e\\\"===ch||\\\"E\\\"===ch)for(string+=ch,next(),(\\\"-\\\"===ch||\\\"+\\\"===ch)&&(string+=ch,next());ch>=\\\"0\\\"&&\\\"9\\\">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error(\\\"Bad number\\\"),void 0):number},string=function(){var hex,i,uffff,string=\\\"\\\";if('\\\"'===ch)for(;next();){if('\\\"'===ch)return next(),string;if(\\\"\\\\\\\\\\\"===ch)if(next(),\\\"u\\\"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if(\\\"string\\\"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error(\\\"Bad string\\\")},white=function(){for(;ch&&\\\" \\\">=ch;)next()},word=function(){switch(ch){case\\\"t\\\":return next(\\\"t\\\"),next(\\\"r\\\"),next(\\\"u\\\"),next(\\\"e\\\"),!0;case\\\"f\\\":return next(\\\"f\\\"),next(\\\"a\\\"),next(\\\"l\\\"),next(\\\"s\\\"),next(\\\"e\\\"),!1;case\\\"n\\\":return next(\\\"n\\\"),next(\\\"u\\\"),next(\\\"l\\\"),next(\\\"l\\\"),null}error(\\\"Unexpected '\\\"+ch+\\\"'\\\")},array=function(){var array=[];if(\\\"[\\\"===ch){if(next(\\\"[\\\"),white(),\\\"]\\\"===ch)return next(\\\"]\\\"),array;for(;ch;){if(array.push(value()),white(),\\\"]\\\"===ch)return next(\\\"]\\\"),array;next(\\\",\\\"),white()}}error(\\\"Bad array\\\")},object=function(){var key,object={};if(\\\"{\\\"===ch){if(next(\\\"{\\\"),white(),\\\"}\\\"===ch)return next(\\\"}\\\"),object;for(;ch;){if(key=string(),white(),next(\\\":\\\"),Object.hasOwnProperty.call(object,key)&&error('Duplicate key \\\"'+key+'\\\"'),object[key]=value(),white(),\\\"}\\\"===ch)return next(\\\"}\\\"),object;next(\\\",\\\"),white()}}error(\\\"Bad object\\\")};return value=function(){switch(white(),ch){case\\\"{\\\":return object();case\\\"[\\\":return array();case'\\\"':return string();case\\\"-\\\":return number();default:return ch>=\\\"0\\\"&&\\\"9\\\">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=\\\" \\\",result=value(),white(),ch&&error(\\\"Syntax error\\\"),\\\"function\\\"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&\\\"object\\\"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({\\\"\\\":result},\\\"\\\"):result}}),ace.define(\\\"ace/mode/json_worker\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\",\\\"ace/lib/oop\\\",\\\"ace/worker/mirror\\\",\\\"ace/mode/json/json_parse\\\"],function(acequire,exports){\\\"use strict\\\";var oop=acequire(\\\"../lib/oop\\\"),Mirror=acequire(\\\"../worker/mirror\\\").Mirror,parse=acequire(\\\"./json/json_parse\\\"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:\\\"error\\\"})}this.sender.emit(\\\"annotate\\\",errors)}}.call(JsonWorker.prototype)}),ace.define(\\\"ace/lib/es5-shim\\\",[\\\"require\\\",\\\"exports\\\",\\\"module\\\"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,\\\"sentinel\\\",{}),\\\"sentinel\\\"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if(\\\"function\\\"!=typeof target)throw new TypeError(\\\"Function.prototype.bind called on incompatible \\\"+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,\\\"__defineGetter__\\\"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,\\\"XXX\\\"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0\\n}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return\\\"[object Array]\\\"==_toString(obj)});var boxedString=Object(\\\"a\\\"),splitString=\\\"a\\\"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,thisp=arguments[1],i=-1,length=self.length>>>0;if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError(fun+\\\" is not a function\\\");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,length=self.length>>>0,result=[],thisp=arguments[1];if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError(fun+\\\" is not a function\\\");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,length=self.length>>>0,thisp=arguments[1];if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError(fun+\\\" is not a function\\\");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,length=self.length>>>0,thisp=arguments[1];if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError(fun+\\\" is not a function\\\");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,length=self.length>>>0;if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError(fun+\\\" is not a function\\\");if(!length&&1==arguments.length)throw new TypeError(\\\"reduce of empty array with no initial value\\\");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError(\\\"reduce of empty array with no initial value\\\")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):object,length=self.length>>>0;if(\\\"[object Function]\\\"!=_toString(fun))throw new TypeError(fun+\\\" is not a function\\\");if(!length&&1==arguments.length)throw new TypeError(\\\"reduceRight of empty array with no initial value\\\");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError(\\\"reduceRight of empty array with no initial value\\\")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&\\\"[object String]\\\"==_toString(this)?this.split(\\\"\\\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT=\\\"Object.getOwnPropertyDescriptor called on a non-object: \\\";Object.getOwnPropertyDescriptor=function(object,property){if(\\\"object\\\"!=typeof object&&\\\"function\\\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if(\\\"object\\\"!=typeof prototype)throw new TypeError(\\\"typeof prototype[\\\"+typeof prototype+\\\"] != 'object'\\\");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom=\\\"undefined\\\"==typeof document||doesDefinePropertyWork(document.createElement(\\\"div\\\"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR=\\\"Property description must be an object: \\\",ERR_NON_OBJECT_TARGET=\\\"Object.defineProperty called on non-object: \\\",ERR_ACCESSORS_NOT_SUPPORTED=\\\"getters & setters can not be defined on this javascript engine\\\";Object.defineProperty=function(object,property,descriptor){if(\\\"object\\\"!=typeof object&&\\\"function\\\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if(\\\"object\\\"!=typeof descriptor&&\\\"function\\\"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,\\\"value\\\"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,\\\"get\\\")&&defineGetter(object,property,descriptor.get),owns(descriptor,\\\"set\\\")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return\\\"function\\\"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name=\\\"\\\";owns(object,name);)name+=\\\"?\\\";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=[\\\"toString\\\",\\\"toLocaleString\\\",\\\"valueOf\\\",\\\"hasOwnProperty\\\",\\\"isPrototypeOf\\\",\\\"propertyIsEnumerable\\\",\\\"constructor\\\"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if(\\\"object\\\"!=typeof object&&\\\"function\\\"!=typeof object||null===object)throw new TypeError(\\\"Object.keys called on a non-object\\\");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws=\\\"\\t\\\\n\\u000b\\\\f\\\\r \\\\u2028\\\\u2029\\\";if(!String.prototype.trim||ws.trim()){ws=\\\"[\\\"+ws+\\\"]\\\";var trimBeginRegexp=RegExp(\\\"^\\\"+ws+ws+\\\"*\\\"),trimEndRegexp=RegExp(ws+ws+\\\"*$\\\");String.prototype.trim=function(){return(this+\\\"\\\").replace(trimBeginRegexp,\\\"\\\").replace(trimEndRegexp,\\\"\\\")}}var toObject=function(o){if(null==o)throw new TypeError(\\\"can't convert \\\"+o+\\\" to object\\\");return Object(o)}});\";\n\n/***/ }),\n/* 935 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(929)\nvar ieee754 = __webpack_require__(1327)\nvar isArray = __webpack_require__(1329)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(108)))\n\n/***/ }),\n/* 936 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*!\n * clipboard.js v2.0.4\n * https://zenorocha.github.io/clipboard.js\n * \n * Licensed MIT © Zeno Rocha\n */\n!function(t,e){ true?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=0)}([function(t,e,n){\"use strict\";var r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},i=function(){function o(t,e){for(var n=0;n Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(78)\n , toLength = __webpack_require__(170)\n , toIndex = __webpack_require__(973);\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n/***/ }),\n/* 953 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = __webpack_require__(95)\n , IObject = __webpack_require__(230)\n , toObject = __webpack_require__(137)\n , toLength = __webpack_require__(170)\n , asc = __webpack_require__(955);\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n\n/***/ }),\n/* 954 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(97)\n , isArray = __webpack_require__(336)\n , SPECIES = __webpack_require__(39)('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n\n/***/ }),\n/* 955 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = __webpack_require__(954);\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};\n\n/***/ }),\n/* 956 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar dP = __webpack_require__(56).f\n , create = __webpack_require__(233)\n , redefineAll = __webpack_require__(235)\n , ctx = __webpack_require__(95)\n , anInstance = __webpack_require__(226)\n , defined = __webpack_require__(132)\n , forOf = __webpack_require__(168)\n , $iterDefine = __webpack_require__(231)\n , step = __webpack_require__(339)\n , setSpecies = __webpack_require__(346)\n , DESCRIPTORS = __webpack_require__(64)\n , fastKey = __webpack_require__(232).fastKey\n , SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function(that, key){\n // fast case\n var index = fastKey(key), entry;\n if(index !== 'F')return that._i[index];\n // frozen object case\n for(entry = that._f; entry; entry = entry.n){\n if(entry.k == key)return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function(wrapper, NAME, IS_MAP, ADDER){\n var C = wrapper(function(that, iterable){\n anInstance(that, C, NAME, '_i');\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear(){\n for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){\n entry.r = true;\n if(entry.p)entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function(key){\n var that = this\n , entry = getEntry(that, key);\n if(entry){\n var next = entry.n\n , prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if(prev)prev.n = next;\n if(next)next.p = prev;\n if(that._f == entry)that._f = next;\n if(that._l == entry)that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /*, that = undefined */){\n anInstance(this, C, 'forEach');\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)\n , entry;\n while(entry = entry ? entry.n : this._f){\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key){\n return !!getEntry(this, key);\n }\n });\n if(DESCRIPTORS)dP(C.prototype, 'size', {\n get: function(){\n return defined(this[SIZE]);\n }\n });\n return C;\n },\n def: function(that, key, value){\n var entry = getEntry(that, key)\n , prev, index;\n // change existing entry\n if(entry){\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if(!that._f)that._f = entry;\n if(prev)prev.n = entry;\n that[SIZE]++;\n // add to index\n if(index !== 'F')that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function(C, NAME, IS_MAP){\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function(iterated, kind){\n this._t = iterated; // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function(){\n var that = this\n , kind = that._k\n , entry = that._l;\n // revert to the last existing entry\n while(entry && entry.r)entry = entry.p;\n // get next entry\n if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if(kind == 'keys' )return step(0, entry.k);\n if(kind == 'values')return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n/***/ }),\n/* 957 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = __webpack_require__(227)\n , from = __webpack_require__(951);\nmodule.exports = function(NAME){\n return function toJSON(){\n if(classof(this) != NAME)throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n\n/***/ }),\n/* 958 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(38)\n , $export = __webpack_require__(43)\n , meta = __webpack_require__(232)\n , fails = __webpack_require__(76)\n , hide = __webpack_require__(77)\n , redefineAll = __webpack_require__(235)\n , forOf = __webpack_require__(168)\n , anInstance = __webpack_require__(226)\n , isObject = __webpack_require__(97)\n , setToStringTag = __webpack_require__(136)\n , dP = __webpack_require__(56).f\n , each = __webpack_require__(953)(0)\n , DESCRIPTORS = __webpack_require__(64);\n\nmodule.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){\n var Base = global[NAME]\n , C = Base\n , ADDER = IS_MAP ? 'set' : 'add'\n , proto = C && C.prototype\n , O = {};\n if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){\n new C().entries().next();\n }))){\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n C = wrapper(function(target, iterable){\n anInstance(target, C, NAME, '_c');\n target._c = new Base;\n if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target);\n });\n each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','),function(KEY){\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){\n anInstance(this, C, KEY);\n if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false;\n var result = this._c[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n });\n if('size' in proto)dP(C.prototype, 'size', {\n get: function(){\n return this._c.size;\n }\n });\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F, O);\n\n if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n/***/ }),\n/* 959 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $defineProperty = __webpack_require__(56)\n , createDesc = __webpack_require__(135);\n\nmodule.exports = function(object, index, value){\n if(index in object)$defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n\n/***/ }),\n/* 960 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(98)\n , gOPS = __webpack_require__(234)\n , pIE = __webpack_require__(134);\nmodule.exports = function(it){\n var result = getKeys(it)\n , getSymbols = gOPS.f;\n if(getSymbols){\n var symbols = getSymbols(it)\n , isEnum = pIE.f\n , i = 0\n , key;\n while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);\n } return result;\n};\n\n/***/ }),\n/* 961 */\n/***/ (function(module, exports) {\n\n// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function(fn, args, that){\n var un = that === undefined;\n switch(args.length){\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n\n/***/ }),\n/* 962 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar create = __webpack_require__(233)\n , descriptor = __webpack_require__(135)\n , setToStringTag = __webpack_require__(136)\n , IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(77)(IteratorPrototype, __webpack_require__(39)('iterator'), function(){ return this; });\n\nmodule.exports = function(Constructor, NAME, next){\n Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n/***/ }),\n/* 963 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar getKeys = __webpack_require__(98)\n , toIObject = __webpack_require__(78);\nmodule.exports = function(object, el){\n var O = toIObject(object)\n , keys = getKeys(O)\n , length = keys.length\n , index = 0\n , key;\n while(length > index)if(O[key = keys[index++]] === el)return key;\n};\n\n/***/ }),\n/* 964 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(38)\n , macrotask = __webpack_require__(348).set\n , Observer = global.MutationObserver || global.WebKitMutationObserver\n , process = global.process\n , Promise = global.Promise\n , isNode = __webpack_require__(131)(process) == 'process';\n\nmodule.exports = function(){\n var head, last, notify;\n\n var flush = function(){\n var parent, fn;\n if(isNode && (parent = process.domain))parent.exit();\n while(head){\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch(e){\n if(head)notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if(parent)parent.enter();\n };\n\n // Node.js\n if(isNode){\n notify = function(){\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if(Observer){\n var toggle = true\n , node = document.createTextNode('');\n new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new\n notify = function(){\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if(Promise && Promise.resolve){\n var promise = Promise.resolve();\n notify = function(){\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function(){\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function(fn){\n var task = {fn: fn, next: undefined};\n if(last)last.next = task;\n if(!head){\n head = task;\n notify();\n } last = task;\n };\n};\n\n/***/ }),\n/* 965 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(98)\n , gOPS = __webpack_require__(234)\n , pIE = __webpack_require__(134)\n , toObject = __webpack_require__(137)\n , IObject = __webpack_require__(230)\n , $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(76)(function(){\n var A = {}\n , B = {}\n , S = Symbol()\n , K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function(k){ B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source){ // eslint-disable-line no-unused-vars\n var T = toObject(target)\n , aLen = arguments.length\n , index = 1\n , getSymbols = gOPS.f\n , isEnum = pIE.f;\n while(aLen > index){\n var S = IObject(arguments[index++])\n , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)\n , length = keys.length\n , j = 0\n , key;\n while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];\n } return T;\n} : $assign;\n\n/***/ }),\n/* 966 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(56)\n , anObject = __webpack_require__(94)\n , getKeys = __webpack_require__(98);\n\nmodule.exports = __webpack_require__(64) ? Object.defineProperties : function defineProperties(O, Properties){\n anObject(O);\n var keys = getKeys(Properties)\n , length = keys.length\n , i = 0\n , P;\n while(length > i)dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n/***/ }),\n/* 967 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pIE = __webpack_require__(134)\n , createDesc = __webpack_require__(135)\n , toIObject = __webpack_require__(78)\n , toPrimitive = __webpack_require__(239)\n , has = __webpack_require__(96)\n , IE8_DOM_DEFINE = __webpack_require__(334)\n , gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(64) ? gOPD : function getOwnPropertyDescriptor(O, P){\n O = toIObject(O);\n P = toPrimitive(P, true);\n if(IE8_DOM_DEFINE)try {\n return gOPD(O, P);\n } catch(e){ /* empty */ }\n if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n/***/ }),\n/* 968 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(96)\n , toObject = __webpack_require__(137)\n , IE_PROTO = __webpack_require__(236)('IE_PROTO')\n , ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function(O){\n O = toObject(O);\n if(has(O, IE_PROTO))return O[IE_PROTO];\n if(typeof O.constructor == 'function' && O instanceof O.constructor){\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n/***/ }),\n/* 969 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $parseInt = __webpack_require__(38).parseInt\n , $trim = __webpack_require__(972).trim\n , ws = __webpack_require__(347)\n , hex = /^[\\-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n\n/***/ }),\n/* 970 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(94)\n , aFunction = __webpack_require__(225)\n , SPECIES = __webpack_require__(39)('species');\nmodule.exports = function(O, D){\n var C = anObject(O).constructor, S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n/***/ }),\n/* 971 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(238)\n , defined = __webpack_require__(132);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function(TO_STRING){\n return function(that, pos){\n var s = String(defined(that))\n , i = toInteger(pos)\n , l = s.length\n , a, b;\n if(i < 0 || i >= l)return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n/***/ }),\n/* 972 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(43)\n , defined = __webpack_require__(132)\n , fails = __webpack_require__(76)\n , spaces = __webpack_require__(347)\n , space = '[' + spaces + ']'\n , non = '\\u200b\\u0085'\n , ltrim = RegExp('^' + space + space + '*')\n , rtrim = RegExp(space + space + '*$');\n\nvar exporter = function(KEY, exec, ALIAS){\n var exp = {};\n var FORCE = fails(function(){\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if(ALIAS)exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function(string, TYPE){\n string = String(defined(string));\n if(TYPE & 1)string = string.replace(ltrim, '');\n if(TYPE & 2)string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n\n/***/ }),\n/* 973 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(238)\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n/***/ }),\n/* 974 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar ctx = __webpack_require__(95)\n , $export = __webpack_require__(43)\n , toObject = __webpack_require__(137)\n , call = __webpack_require__(337)\n , isArrayIter = __webpack_require__(335)\n , toLength = __webpack_require__(170)\n , createProperty = __webpack_require__(959)\n , getIterFn = __webpack_require__(349);\n\n$export($export.S + $export.F * !__webpack_require__(338)(function(iter){ Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){\n var O = toObject(arrayLike)\n , C = typeof this == 'function' ? this : Array\n , aLen = arguments.length\n , mapfn = aLen > 1 ? arguments[1] : undefined\n , mapping = mapfn !== undefined\n , index = 0\n , iterFn = getIterFn(O)\n , length, result, step, iterator;\n if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){\n for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for(result = new C(length); length > index; index++){\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n\n\n/***/ }),\n/* 975 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar addToUnscopables = __webpack_require__(950)\n , step = __webpack_require__(339)\n , Iterators = __webpack_require__(133)\n , toIObject = __webpack_require__(78);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(231)(Array, 'Array', function(iterated, kind){\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function(){\n var O = this._t\n , kind = this._k\n , index = this._i++;\n if(!O || index >= O.length){\n this._t = undefined;\n return step(1);\n }\n if(kind == 'keys' )return step(0, index);\n if(kind == 'values')return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n/***/ }),\n/* 976 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(43)\n , $parseInt = __webpack_require__(969);\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt});\n\n/***/ }),\n/* 977 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(43);\n\n$export($export.S + $export.F, 'Object', {assign: __webpack_require__(965)});\n\n/***/ }),\n/* 978 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $export = __webpack_require__(43);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(64), 'Object', {defineProperty: __webpack_require__(56).f});\n\n/***/ }),\n/* 979 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.7 Object.getOwnPropertyNames(O)\n__webpack_require__(343)('getOwnPropertyNames', function(){\n return __webpack_require__(340).f;\n});\n\n/***/ }),\n/* 980 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(137)\n , $keys = __webpack_require__(98);\n\n__webpack_require__(343)('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});\n\n/***/ }),\n/* 981 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(169)\n , global = __webpack_require__(38)\n , ctx = __webpack_require__(95)\n , classof = __webpack_require__(227)\n , $export = __webpack_require__(43)\n , isObject = __webpack_require__(97)\n , aFunction = __webpack_require__(225)\n , anInstance = __webpack_require__(226)\n , forOf = __webpack_require__(168)\n , speciesConstructor = __webpack_require__(970)\n , task = __webpack_require__(348).set\n , microtask = __webpack_require__(964)()\n , PROMISE = 'Promise'\n , TypeError = global.TypeError\n , process = global.process\n , $Promise = global[PROMISE]\n , process = global.process\n , isNode = classof(process) == 'process'\n , empty = function(){ /* empty */ }\n , Internal, GenericPromiseCapability, Wrapper;\n\nvar USE_NATIVE = !!function(){\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1)\n , FakePromise = (promise.constructor = {})[__webpack_require__(39)('species')] = function(exec){ exec(empty, empty); };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch(e){ /* empty */ }\n}();\n\n// helpers\nvar sameConstructor = function(a, b){\n // with library wrapper special case\n return a === b || a === $Promise && b === Wrapper;\n};\nvar isThenable = function(it){\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar newPromiseCapability = function(C){\n return sameConstructor($Promise, C)\n ? new PromiseCapability(C)\n : new GenericPromiseCapability(C);\n};\nvar PromiseCapability = GenericPromiseCapability = function(C){\n var resolve, reject;\n this.promise = new C(function($$resolve, $$reject){\n if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n};\nvar perform = function(exec){\n try {\n exec();\n } catch(e){\n return {error: e};\n }\n};\nvar notify = function(promise, isReject){\n if(promise._n)return;\n promise._n = true;\n var chain = promise._c;\n microtask(function(){\n var value = promise._v\n , ok = promise._s == 1\n , i = 0;\n var run = function(reaction){\n var handler = ok ? reaction.ok : reaction.fail\n , resolve = reaction.resolve\n , reject = reaction.reject\n , domain = reaction.domain\n , result, then;\n try {\n if(handler){\n if(!ok){\n if(promise._h == 2)onHandleUnhandled(promise);\n promise._h = 1;\n }\n if(handler === true)result = value;\n else {\n if(domain)domain.enter();\n result = handler(value);\n if(domain)domain.exit();\n }\n if(result === reaction.promise){\n reject(TypeError('Promise-chain cycle'));\n } else if(then = isThenable(result)){\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch(e){\n reject(e);\n }\n };\n while(chain.length > i)run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if(isReject && !promise._h)onUnhandled(promise);\n });\n};\nvar onUnhandled = function(promise){\n task.call(global, function(){\n var value = promise._v\n , abrupt, handler, console;\n if(isUnhandled(promise)){\n abrupt = perform(function(){\n if(isNode){\n process.emit('unhandledRejection', value, promise);\n } else if(handler = global.onunhandledrejection){\n handler({promise: promise, reason: value});\n } else if((console = global.console) && console.error){\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if(abrupt)throw abrupt.error;\n });\n};\nvar isUnhandled = function(promise){\n if(promise._h == 1)return false;\n var chain = promise._a || promise._c\n , i = 0\n , reaction;\n while(chain.length > i){\n reaction = chain[i++];\n if(reaction.fail || !isUnhandled(reaction.promise))return false;\n } return true;\n};\nvar onHandleUnhandled = function(promise){\n task.call(global, function(){\n var handler;\n if(isNode){\n process.emit('rejectionHandled', promise);\n } else if(handler = global.onrejectionhandled){\n handler({promise: promise, reason: promise._v});\n }\n });\n};\nvar $reject = function(value){\n var promise = this;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if(!promise._a)promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function(value){\n var promise = this\n , then;\n if(promise._d)return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if(promise === value)throw TypeError(\"Promise can't be resolved itself\");\n if(then = isThenable(value)){\n microtask(function(){\n var wrapper = {_w: promise, _d: false}; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch(e){\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch(e){\n $reject.call({_w: promise, _d: false}, e); // wrap\n }\n};\n\n// constructor polyfill\nif(!USE_NATIVE){\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor){\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch(err){\n $reject.call(this, err);\n }\n };\n Internal = function Promise(executor){\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(235)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected){\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if(this._a)this._a.push(reaction);\n if(this._s)notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function(onRejected){\n return this.then(undefined, onRejected);\n }\n });\n PromiseCapability = function(){\n var promise = new Internal;\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});\n__webpack_require__(136)($Promise, PROMISE);\n__webpack_require__(346)(PROMISE);\nWrapper = __webpack_require__(33)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r){\n var capability = newPromiseCapability(this)\n , $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x){\n // instanceof instead of internal slot check because we should fix it without replacement native Promise core\n if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;\n var capability = newPromiseCapability(this)\n , $$resolve = capability.resolve;\n $$resolve(x);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(338)(function(iter){\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , resolve = capability.resolve\n , reject = capability.reject;\n var abrupt = perform(function(){\n var values = []\n , index = 0\n , remaining = 1;\n forOf(iterable, false, function(promise){\n var $index = index++\n , alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function(value){\n if(alreadyCalled)return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable){\n var C = this\n , capability = newPromiseCapability(C)\n , reject = capability.reject;\n var abrupt = perform(function(){\n forOf(iterable, false, function(promise){\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if(abrupt)reject(abrupt.error);\n return capability.promise;\n }\n});\n\n/***/ }),\n/* 982 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(956);\n\n// 23.2 Set Objects\nmodule.exports = __webpack_require__(958)('Set', function(get){\n return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value){\n return strong.def(this, value = value === 0 ? 0 : value, value);\n }\n}, strong);\n\n/***/ }),\n/* 983 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(38)\n , has = __webpack_require__(96)\n , DESCRIPTORS = __webpack_require__(64)\n , $export = __webpack_require__(43)\n , redefine = __webpack_require__(345)\n , META = __webpack_require__(232).KEY\n , $fails = __webpack_require__(76)\n , shared = __webpack_require__(237)\n , setToStringTag = __webpack_require__(136)\n , uid = __webpack_require__(171)\n , wks = __webpack_require__(39)\n , wksExt = __webpack_require__(241)\n , wksDefine = __webpack_require__(240)\n , keyOf = __webpack_require__(963)\n , enumKeys = __webpack_require__(960)\n , isArray = __webpack_require__(336)\n , anObject = __webpack_require__(94)\n , toIObject = __webpack_require__(78)\n , toPrimitive = __webpack_require__(239)\n , createDesc = __webpack_require__(135)\n , _create = __webpack_require__(233)\n , gOPNExt = __webpack_require__(340)\n , $GOPD = __webpack_require__(967)\n , $DP = __webpack_require__(56)\n , $keys = __webpack_require__(98)\n , gOPD = $GOPD.f\n , dP = $DP.f\n , gOPN = gOPNExt.f\n , $Symbol = global.Symbol\n , $JSON = global.JSON\n , _stringify = $JSON && $JSON.stringify\n , PROTOTYPE = 'prototype'\n , HIDDEN = wks('_hidden')\n , TO_PRIMITIVE = wks('toPrimitive')\n , isEnum = {}.propertyIsEnumerable\n , SymbolRegistry = shared('symbol-registry')\n , AllSymbols = shared('symbols')\n , OPSymbols = shared('op-symbols')\n , ObjectProto = Object[PROTOTYPE]\n , USE_NATIVE = typeof $Symbol == 'function'\n , QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function(){\n return _create(dP({}, 'a', {\n get: function(){ return dP(this, 'a', {value: 7}).a; }\n })).a != 7;\n}) ? function(it, key, D){\n var protoDesc = gOPD(ObjectProto, key);\n if(protoDesc)delete ObjectProto[key];\n dP(it, key, D);\n if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function(tag){\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){\n return typeof it == 'symbol';\n} : function(it){\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D){\n if(it === ObjectProto)$defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if(has(AllSymbols, key)){\n if(!D.enumerable){\n if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;\n D = _create(D, {enumerable: createDesc(0, false)});\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P){\n anObject(it);\n var keys = enumKeys(P = toIObject(P))\n , i = 0\n , l = keys.length\n , key;\n while(l > i)$defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P){\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key){\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){\n it = toIObject(it);\n key = toPrimitive(key, true);\n if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;\n var D = gOPD(it, key);\n if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it){\n var names = gOPN(toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it){\n var IS_OP = it === ObjectProto\n , names = gOPN(IS_OP ? OPSymbols : toIObject(it))\n , result = []\n , i = 0\n , key;\n while(names.length > i){\n if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif(!USE_NATIVE){\n $Symbol = function Symbol(){\n if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function(value){\n if(this === ObjectProto)$set.call(OPSymbols, value);\n if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString(){\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(341).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(134).f = $propertyIsEnumerable;\n __webpack_require__(234).f = $getOwnPropertySymbols;\n\n if(DESCRIPTORS && !__webpack_require__(169)){\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function(name){\n return wrap(wks(name));\n }\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});\n\nfor(var symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);\n\nfor(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function(key){\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(key){\n if(isSymbol(key))return keyOf(SymbolRegistry, key);\n throw TypeError(key + ' is not a symbol!');\n },\n useSetter: function(){ setter = true; },\n useSimple: function(){ setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it){\n if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined\n var args = [it]\n , i = 1\n , replacer, $replacer;\n while(arguments.length > i)args.push(arguments[i++]);\n replacer = args[1];\n if(typeof replacer == 'function')$replacer = replacer;\n if($replacer || !isArray(replacer))replacer = function(key, value){\n if($replacer)value = $replacer.call(this, key, value);\n if(!isSymbol(value))return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(77)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n/***/ }),\n/* 984 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(43)\n , $entries = __webpack_require__(344)(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it){\n return $entries(it);\n }\n});\n\n/***/ }),\n/* 985 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(43)\n , $values = __webpack_require__(344)(false);\n\n$export($export.S, 'Object', {\n values: function values(it){\n return $values(it);\n }\n});\n\n/***/ }),\n/* 986 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(43);\n\n$export($export.P + $export.R, 'Set', {toJSON: __webpack_require__(957)('Set')});\n\n/***/ }),\n/* 987 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(240)('asyncIterator');\n\n/***/ }),\n/* 988 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(240)('observable');\n\n/***/ }),\n/* 989 */,\n/* 990 */,\n/* 991 */,\n/* 992 */,\n/* 993 */,\n/* 994 */,\n/* 995 */,\n/* 996 */,\n/* 997 */,\n/* 998 */,\n/* 999 */,\n/* 1000 */,\n/* 1001 */,\n/* 1002 */,\n/* 1003 */,\n/* 1004 */,\n/* 1005 */,\n/* 1006 */,\n/* 1007 */,\n/* 1008 */,\n/* 1009 */,\n/* 1010 */,\n/* 1011 */,\n/* 1012 */,\n/* 1013 */,\n/* 1014 */,\n/* 1015 */,\n/* 1016 */,\n/* 1017 */,\n/* 1018 */,\n/* 1019 */,\n/* 1020 */,\n/* 1021 */,\n/* 1022 */,\n/* 1023 */,\n/* 1024 */,\n/* 1025 */,\n/* 1026 */,\n/* 1027 */,\n/* 1028 */,\n/* 1029 */,\n/* 1030 */,\n/* 1031 */,\n/* 1032 */,\n/* 1033 */,\n/* 1034 */,\n/* 1035 */,\n/* 1036 */,\n/* 1037 */,\n/* 1038 */,\n/* 1039 */,\n/* 1040 */,\n/* 1041 */,\n/* 1042 */,\n/* 1043 */,\n/* 1044 */,\n/* 1045 */,\n/* 1046 */,\n/* 1047 */,\n/* 1048 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {}\n}\n\nfunction cloneIfNecessary(value, optionsArgument) {\n var clone = optionsArgument && optionsArgument.clone === true;\n return (clone && isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, optionsArgument) : value\n}\n\nfunction defaultArrayMerge(target, source, optionsArgument) {\n var destination = target.slice();\n source.forEach(function(e, i) {\n if (typeof destination[i] === 'undefined') {\n destination[i] = cloneIfNecessary(e, optionsArgument);\n } else if (isMergeableObject(e)) {\n destination[i] = deepmerge(target[i], e, optionsArgument);\n } else if (target.indexOf(e) === -1) {\n destination.push(cloneIfNecessary(e, optionsArgument));\n }\n });\n return destination\n}\n\nfunction mergeObject(target, source, optionsArgument) {\n var destination = {};\n if (isMergeableObject(target)) {\n Object.keys(target).forEach(function(key) {\n destination[key] = cloneIfNecessary(target[key], optionsArgument);\n });\n }\n Object.keys(source).forEach(function(key) {\n if (!isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneIfNecessary(source[key], optionsArgument);\n } else {\n destination[key] = deepmerge(target[key], source[key], optionsArgument);\n }\n });\n return destination\n}\n\nfunction deepmerge(target, source, optionsArgument) {\n var sourceIsArray = Array.isArray(source);\n var targetIsArray = Array.isArray(target);\n var options = optionsArgument || { arrayMerge: defaultArrayMerge };\n var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n if (!sourceAndTargetTypesMatch) {\n return cloneIfNecessary(source, optionsArgument)\n } else if (sourceIsArray) {\n var arrayMerge = options.arrayMerge || defaultArrayMerge;\n return arrayMerge(target, source, optionsArgument)\n } else {\n return mergeObject(target, source, optionsArgument)\n }\n}\n\ndeepmerge.all = function deepmergeAll(array, optionsArgument) {\n if (!Array.isArray(array) || array.length < 2) {\n throw new Error('first argument should be an array with at least two elements')\n }\n\n // we are sure there are at least 2 values, so it is safe to have no initial value\n return array.reduce(function(prev, next) {\n return deepmerge(prev, next, optionsArgument)\n })\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n\n\n/***/ }),\n/* 1049 */\n/***/ (function(module, exports) {\n\n/**\n * Diff Match and Patch\n * Copyright 2018 The diff-match-patch Authors.\n * https://github.com/google/diff-match-patch\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * 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, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Computes the difference between two texts to create a patch.\n * Applies the patch onto another text, allowing for errors.\n * @author fraser@google.com (Neil Fraser)\n */\n\n/**\n * Class containing the diff, match and patch methods.\n * @constructor\n */\nfunction diff_match_patch() {\n\n // Defaults.\n // Redefine these in your program to override the defaults.\n\n // Number of seconds to map a diff before giving up (0 for infinity).\n this.Diff_Timeout = 1.0;\n // Cost of an empty edit operation in terms of edit characters.\n this.Diff_EditCost = 4;\n // At what point is no match declared (0.0 = perfection, 1.0 = very loose).\n this.Match_Threshold = 0.5;\n // How far to search for a match (0 = exact location, 1000+ = broad match).\n // A match this many characters away from the expected location will add\n // 1.0 to the score (0.0 is a perfect match).\n this.Match_Distance = 1000;\n // When deleting a large block of text (over ~64 characters), how close do\n // the contents have to be to match the expected contents. (0.0 = perfection,\n // 1.0 = very loose). Note that Match_Threshold controls how closely the\n // end points of a delete need to match.\n this.Patch_DeleteThreshold = 0.5;\n // Chunk size for context length.\n this.Patch_Margin = 4;\n\n // The number of bits in an int.\n this.Match_MaxBits = 32;\n}\n\n\n// DIFF FUNCTIONS\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/** @typedef {{0: number, 1: string}} */\ndiff_match_patch.Diff;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean=} opt_checklines Optional speedup flag. If present and false,\n * then don't run a line-level diff first to identify the changed areas.\n * Defaults to true, which does a faster, slightly less optimal diff.\n * @param {number} opt_deadline Optional time when the diff should be complete\n * by. Used internally for recursive calls. Users should set DiffTimeout\n * instead.\n * @return {!Array.} Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,\n opt_deadline) {\n // Set a deadline by which time the diff must be complete.\n if (typeof opt_deadline == 'undefined') {\n if (this.Diff_Timeout <= 0) {\n opt_deadline = Number.MAX_VALUE;\n } else {\n opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000;\n }\n }\n var deadline = opt_deadline;\n\n // Check for null inputs.\n if (text1 == null || text2 == null) {\n throw new Error('Null input. (diff_main)');\n }\n\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (typeof opt_checklines == 'undefined') {\n opt_checklines = true;\n }\n var checklines = opt_checklines;\n\n // Trim off common prefix (speedup).\n var commonlength = this.diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = this.diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = this.diff_compute_(text1, text2, checklines, deadline);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n this.diff_cleanupMerge(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean} checklines Speedup flag. If false, then don't run a\n * line-level diff first to identify the changed areas.\n * If true, then run a faster, slightly less optimal diff.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,\n deadline) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = this.diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);\n var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n if (checklines && text1.length > 100 && text2.length > 100) {\n return this.diff_lineMode_(text1, text2, deadline);\n }\n\n return this.diff_bisect_(text1, text2, deadline);\n};\n\n\n/**\n * Do a quick line-level diff on both strings, then rediff the parts for\n * greater accuracy.\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {\n // Scan the text on a line-by-line basis first.\n var a = this.diff_linesToChars_(text1, text2);\n text1 = a.chars1;\n text2 = a.chars2;\n var linearray = a.lineArray;\n\n var diffs = this.diff_main(text1, text2, false, deadline);\n\n // Convert the diff back to original text.\n this.diff_charsToLines_(diffs, linearray);\n // Eliminate freak matches (e.g. blank lines)\n this.diff_cleanupSemantic(diffs);\n\n // Rediff any replacement blocks, this time character-by-character.\n // Add a dummy entry at the end.\n diffs.push([DIFF_EQUAL, '']);\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete >= 1 && count_insert >= 1) {\n // Delete the offending records and add the merged ones.\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert);\n pointer = pointer - count_delete - count_insert;\n var a = this.diff_main(text_delete, text_insert, false, deadline);\n for (var j = a.length - 1; j >= 0; j--) {\n diffs.splice(pointer, 0, a[j]);\n }\n pointer = pointer + a.length;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n pointer++;\n }\n diffs.pop(); // Remove the dummy entry at the end.\n\n return diffs;\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Bail out if deadline is reached.\n if ((new Date()).getTime() > deadline) {\n break;\n }\n\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,\n deadline) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = this.diff_main(text1a, text2a, false, deadline);\n var diffsb = this.diff_main(text1b, text2b, false, deadline);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Split two texts into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {{chars1: string, chars2: string, lineArray: !Array.}}\n * An object containing the encoded text1, the encoded text2 and\n * the array of unique strings.\n * The zeroth element of the array of unique strings is intentionally blank.\n * @private\n */\ndiff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {\n var lineArray = []; // e.g. lineArray[4] == 'Hello\\n'\n var lineHash = {}; // e.g. lineHash['Hello\\n'] == 4\n\n // '\\x00' is a valid character, but various debuggers don't like it.\n // So we'll insert a junk entry to avoid generating a null character.\n lineArray[0] = '';\n\n /**\n * Split a text into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * Modifies linearray and linehash through being a closure.\n * @param {string} text String to encode.\n * @return {string} Encoded string.\n * @private\n */\n function diff_linesToCharsMunge_(text) {\n var chars = '';\n // Walk the text, pulling out a substring for each line.\n // text.split('\\n') would would temporarily double our memory footprint.\n // Modifying text would create many large strings to garbage collect.\n var lineStart = 0;\n var lineEnd = -1;\n // Keeping our own length variable is faster than looking it up.\n var lineArrayLength = lineArray.length;\n while (lineEnd < text.length - 1) {\n lineEnd = text.indexOf('\\n', lineStart);\n if (lineEnd == -1) {\n lineEnd = text.length - 1;\n }\n var line = text.substring(lineStart, lineEnd + 1);\n lineStart = lineEnd + 1;\n\n if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :\n (lineHash[line] !== undefined)) {\n chars += String.fromCharCode(lineHash[line]);\n } else {\n chars += String.fromCharCode(lineArrayLength);\n lineHash[line] = lineArrayLength;\n lineArray[lineArrayLength++] = line;\n }\n }\n return chars;\n }\n\n var chars1 = diff_linesToCharsMunge_(text1);\n var chars2 = diff_linesToCharsMunge_(text2);\n return {chars1: chars1, chars2: chars2, lineArray: lineArray};\n};\n\n\n/**\n * Rehydrate the text in a diff from a string of line hashes to real lines of\n * text.\n * @param {!Array.} diffs Array of diff tuples.\n * @param {!Array.} lineArray Array of unique strings.\n * @private\n */\ndiff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {\n for (var x = 0; x < diffs.length; x++) {\n var chars = diffs[x][1];\n var text = [];\n for (var y = 0; y < chars.length; y++) {\n text[y] = lineArray[chars.charCodeAt(y)];\n }\n diffs[x][1] = text.join('');\n }\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\ndiff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\ndiff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\ndiff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (found == 0 || text1.substring(text_length - length) ==\n text2.substring(0, length)) {\n best = length;\n length++;\n }\n }\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n * @private\n */\ndiff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {\n if (this.Diff_Timeout <= 0) {\n // Don't risk returning a non-optimal diff if we have unlimited time.\n return null;\n }\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (lastequality && (lastequality.length <=\n Math.max(length_insertions1, length_deletions1)) &&\n (lastequality.length <= Math.max(length_insertions2,\n length_deletions2))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n [DIFF_DELETE, lastequality]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n this.diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0,\n [DIFF_EQUAL, insertion.substring(0, overlap_length1)]);\n diffs[pointer - 1][1] =\n deletion.substring(0, deletion.length - overlap_length1);\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0,\n [DIFF_EQUAL, deletion.substring(0, overlap_length2)]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] =\n insertion.substring(0, insertion.length - overlap_length2);\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] =\n deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n};\n\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 &&\n char1.match(diff_match_patch.whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 &&\n char2.match(diff_match_patch.whitespaceRegex_);\n var lineBreak1 = whitespace1 &&\n char1.match(diff_match_patch.linebreakRegex_);\n var lineBreak2 = whitespace2 &&\n char2.match(diff_match_patch.linebreakRegex_);\n var blankLine1 = lineBreak1 &&\n one.match(diff_match_patch.blanklineEndRegex_);\n var blankLine2 = lineBreak2 &&\n two.match(diff_match_patch.blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = this.diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n};\n\n// Define some regex patterns for matching boundaries.\ndiff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\ndiff_match_patch.whitespaceRegex_ = /\\s/;\ndiff_match_patch.linebreakRegex_ = /[\\r\\n]/;\ndiff_match_patch.blanklineEndRegex_ = /\\n\\r?\\n$/;\ndiff_match_patch.blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Reduce the number of edits by eliminating operationally trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Is there an insertion operation before the last equality.\n var pre_ins = false;\n // Is there a deletion operation before the last equality.\n var pre_del = false;\n // Is there an insertion operation after the last equality.\n var post_ins = false;\n // Is there a deletion operation after the last equality.\n var post_del = false;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n if (diffs[pointer][1].length < this.Diff_EditCost &&\n (post_ins || post_del)) {\n // Candidate found.\n equalities[equalitiesLength++] = pointer;\n pre_ins = post_ins;\n pre_del = post_del;\n lastequality = diffs[pointer][1];\n } else {\n // Not a candidate, and can never become one.\n equalitiesLength = 0;\n lastequality = null;\n }\n post_ins = post_del = false;\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_DELETE) {\n post_del = true;\n } else {\n post_ins = true;\n }\n /*\n * Five types to be split:\n * ABXYCD\n * AXCD\n * ABXC\n * AXCD\n * ABXC\n */\n if (lastequality && ((pre_ins && pre_del && post_ins && post_del) ||\n ((lastequality.length < this.Diff_EditCost / 2) &&\n (pre_ins + pre_del + post_ins + post_del) == 3))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n [DIFF_DELETE, lastequality]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n equalitiesLength--; // Throw away the equality we just deleted;\n lastequality = null;\n if (pre_ins && pre_del) {\n // No changes made which could affect previous entry, keep going.\n post_ins = post_del = true;\n equalitiesLength = 0;\n } else {\n equalitiesLength--; // Throw away the previous equality.\n pointer = equalitiesLength > 0 ?\n equalities[equalitiesLength - 1] : -1;\n post_ins = post_del = false;\n }\n changes = true;\n }\n }\n pointer++;\n }\n\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupMerge = function(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = this.diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = this.diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * loc is a location in text1, compute and return the equivalent location in\n * text2.\n * e.g. 'The cat' vs 'The big cat', 1->1, 5->8\n * @param {!Array.} diffs Array of diff tuples.\n * @param {number} loc Location within text1.\n * @return {number} Location within text2.\n */\ndiff_match_patch.prototype.diff_xIndex = function(diffs, loc) {\n var chars1 = 0;\n var chars2 = 0;\n var last_chars1 = 0;\n var last_chars2 = 0;\n var x;\n for (x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion.\n chars1 += diffs[x][1].length;\n }\n if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion.\n chars2 += diffs[x][1].length;\n }\n if (chars1 > loc) { // Overshot the location.\n break;\n }\n last_chars1 = chars1;\n last_chars2 = chars2;\n }\n // Was the location was deleted?\n if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {\n return last_chars2;\n }\n // Add the remaining character length.\n return last_chars2 + (loc - last_chars1);\n};\n\n\n/**\n * Convert a diff array into a pretty HTML report.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} HTML representation.\n */\ndiff_match_patch.prototype.diff_prettyHtml = function(diffs) {\n var html = [];\n var pattern_amp = /&/g;\n var pattern_lt = //g;\n var pattern_para = /\\n/g;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0]; // Operation (insert, delete, equal)\n var data = diffs[x][1]; // Text of change.\n var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')\n .replace(pattern_gt, '>').replace(pattern_para, '¶
');\n switch (op) {\n case DIFF_INSERT:\n html[x] = '' + text + '';\n break;\n case DIFF_DELETE:\n html[x] = '' + text + '';\n break;\n case DIFF_EQUAL:\n html[x] = '' + text + '';\n break;\n }\n }\n return html.join('');\n};\n\n\n/**\n * Compute and return the source text (all equalities and deletions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Source text.\n */\ndiff_match_patch.prototype.diff_text1 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute and return the destination text (all equalities and insertions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Destination text.\n */\ndiff_match_patch.prototype.diff_text2 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_DELETE) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute the Levenshtein distance; the number of inserted, deleted or\n * substituted characters.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {number} Number of changes.\n */\ndiff_match_patch.prototype.diff_levenshtein = function(diffs) {\n var levenshtein = 0;\n var insertions = 0;\n var deletions = 0;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0];\n var data = diffs[x][1];\n switch (op) {\n case DIFF_INSERT:\n insertions += data.length;\n break;\n case DIFF_DELETE:\n deletions += data.length;\n break;\n case DIFF_EQUAL:\n // A deletion and an insertion is one substitution.\n levenshtein += Math.max(insertions, deletions);\n insertions = 0;\n deletions = 0;\n break;\n }\n }\n levenshtein += Math.max(insertions, deletions);\n return levenshtein;\n};\n\n\n/**\n * Crush the diff into an encoded string which describes the operations\n * required to transform text1 into text2.\n * E.g. =3\\t-2\\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.\n * Operations are tab-separated. Inserted text is escaped using %xx notation.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Delta text.\n */\ndiff_match_patch.prototype.diff_toDelta = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n switch (diffs[x][0]) {\n case DIFF_INSERT:\n text[x] = '+' + encodeURI(diffs[x][1]);\n break;\n case DIFF_DELETE:\n text[x] = '-' + diffs[x][1].length;\n break;\n case DIFF_EQUAL:\n text[x] = '=' + diffs[x][1].length;\n break;\n }\n }\n return text.join('\\t').replace(/%20/g, ' ');\n};\n\n\n/**\n * Given the original text1, and an encoded string which describes the\n * operations required to transform text1 into text2, compute the full diff.\n * @param {string} text1 Source string for the diff.\n * @param {string} delta Delta text.\n * @return {!Array.} Array of diff tuples.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.diff_fromDelta = function(text1, delta) {\n var diffs = [];\n var diffsLength = 0; // Keeping our own length var is faster in JS.\n var pointer = 0; // Cursor in text1\n var tokens = delta.split(/\\t/g);\n for (var x = 0; x < tokens.length; x++) {\n // Each token begins with a one character parameter which specifies the\n // operation of this token (delete, insert, equality).\n var param = tokens[x].substring(1);\n switch (tokens[x].charAt(0)) {\n case '+':\n try {\n diffs[diffsLength++] = [DIFF_INSERT, decodeURI(param)];\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in diff_fromDelta: ' + param);\n }\n break;\n case '-':\n // Fall through.\n case '=':\n var n = parseInt(param, 10);\n if (isNaN(n) || n < 0) {\n throw new Error('Invalid number in diff_fromDelta: ' + param);\n }\n var text = text1.substring(pointer, pointer += n);\n if (tokens[x].charAt(0) == '=') {\n diffs[diffsLength++] = [DIFF_EQUAL, text];\n } else {\n diffs[diffsLength++] = [DIFF_DELETE, text];\n }\n break;\n default:\n // Blank tokens are ok (from a trailing \\t).\n // Anything else is an error.\n if (tokens[x]) {\n throw new Error('Invalid diff operation in diff_fromDelta: ' +\n tokens[x]);\n }\n }\n }\n if (pointer != text1.length) {\n throw new Error('Delta length (' + pointer +\n ') does not equal source text length (' + text1.length + ').');\n }\n return diffs;\n};\n\n\n// MATCH FUNCTIONS\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc'.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n */\ndiff_match_patch.prototype.match_main = function(text, pattern, loc) {\n // Check for null inputs.\n if (text == null || pattern == null || loc == null) {\n throw new Error('Null input. (match_main)');\n }\n\n loc = Math.max(0, Math.min(loc, text.length));\n if (text == pattern) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (!text.length) {\n // Nothing to match.\n return -1;\n } else if (text.substring(loc, loc + pattern.length) == pattern) {\n // Perfect match at the perfect spot! (Includes case of null pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return this.match_bitap_(text, pattern, loc);\n }\n};\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc' using the\n * Bitap algorithm.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n * @private\n */\ndiff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {\n if (pattern.length > this.Match_MaxBits) {\n throw new Error('Pattern too long for this browser.');\n }\n\n // Initialise the alphabet.\n var s = this.match_alphabet_(pattern);\n\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Compute and return the score for a match with e errors and x location.\n * Accesses loc and pattern through being a closure.\n * @param {number} e Number of errors in match.\n * @param {number} x Location of match.\n * @return {number} Overall score for match (0.0 = good, 1.0 = bad).\n * @private\n */\n function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length;\n var proximity = Math.abs(loc - x);\n if (!dmp.Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / dmp.Match_Distance);\n }\n\n // Highest score beyond which we give up.\n var score_threshold = this.Match_Threshold;\n // Is there a nearby exact match? (speedup)\n var best_loc = text.indexOf(pattern, loc);\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);\n // What about in the other direction? (speedup)\n best_loc = text.lastIndexOf(pattern, loc + pattern.length);\n if (best_loc != -1) {\n score_threshold =\n Math.min(match_bitapScore_(0, best_loc), score_threshold);\n }\n }\n\n // Initialise the bit arrays.\n var matchmask = 1 << (pattern.length - 1);\n best_loc = -1;\n\n var bin_min, bin_mid;\n var bin_max = pattern.length + text.length;\n var last_rd;\n for (var d = 0; d < pattern.length; d++) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from 'loc' we can stray at this\n // error level.\n bin_min = 0;\n bin_mid = bin_max;\n while (bin_min < bin_mid) {\n if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n bin_min = bin_mid;\n } else {\n bin_max = bin_mid;\n }\n bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);\n }\n // Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid;\n var start = Math.max(1, loc - bin_mid + 1);\n var finish = Math.min(loc + bin_mid, text.length) + pattern.length;\n\n var rd = Array(finish + 2);\n rd[finish + 1] = (1 << d) - 1;\n for (var j = finish; j >= start; j--) {\n // The alphabet (s) is a sparse hash, so the following line generates\n // warnings.\n var charMatch = s[text.charAt(j - 1)];\n if (d === 0) { // First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;\n } else { // Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |\n (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |\n last_rd[j + 1];\n }\n if (rd[j] & matchmask) {\n var score = match_bitapScore_(d, j - 1);\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (score <= score_threshold) {\n // Told you so.\n score_threshold = score;\n best_loc = j - 1;\n if (best_loc > loc) {\n // When passing loc, don't exceed our current distance from loc.\n start = Math.max(1, 2 * loc - best_loc);\n } else {\n // Already passed loc, downhill from here on in.\n break;\n }\n }\n }\n }\n // No hope for a (better) match at greater error levels.\n if (match_bitapScore_(d + 1, loc) > score_threshold) {\n break;\n }\n last_rd = rd;\n }\n return best_loc;\n};\n\n\n/**\n * Initialise the alphabet for the Bitap algorithm.\n * @param {string} pattern The text to encode.\n * @return {!Object} Hash of character locations.\n * @private\n */\ndiff_match_patch.prototype.match_alphabet_ = function(pattern) {\n var s = {};\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] = 0;\n }\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);\n }\n return s;\n};\n\n\n// PATCH FUNCTIONS\n\n\n/**\n * Increase the context until it is unique,\n * but don't let the pattern expand beyond Match_MaxBits.\n * @param {!diff_match_patch.patch_obj} patch The patch to grow.\n * @param {string} text Source text.\n * @private\n */\ndiff_match_patch.prototype.patch_addContext_ = function(patch, text) {\n if (text.length == 0) {\n return;\n }\n var pattern = text.substring(patch.start2, patch.start2 + patch.length1);\n var padding = 0;\n\n // Look for the first and last matches of pattern in text. If two different\n // matches are found, increase the pattern length.\n while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&\n pattern.length < this.Match_MaxBits - this.Patch_Margin -\n this.Patch_Margin) {\n padding += this.Patch_Margin;\n pattern = text.substring(patch.start2 - padding,\n patch.start2 + patch.length1 + padding);\n }\n // Add one chunk for good luck.\n padding += this.Patch_Margin;\n\n // Add the prefix.\n var prefix = text.substring(patch.start2 - padding, patch.start2);\n if (prefix) {\n patch.diffs.unshift([DIFF_EQUAL, prefix]);\n }\n // Add the suffix.\n var suffix = text.substring(patch.start2 + patch.length1,\n patch.start2 + patch.length1 + padding);\n if (suffix) {\n patch.diffs.push([DIFF_EQUAL, suffix]);\n }\n\n // Roll back the start points.\n patch.start1 -= prefix.length;\n patch.start2 -= prefix.length;\n // Extend the lengths.\n patch.length1 += prefix.length + suffix.length;\n patch.length2 += prefix.length + suffix.length;\n};\n\n\n/**\n * Compute a list of patches to turn text1 into text2.\n * Use diffs if provided, otherwise compute it ourselves.\n * There are four ways to call this function, depending on what data is\n * available to the caller:\n * Method 1:\n * a = text1, b = text2\n * Method 2:\n * a = diffs\n * Method 3 (optimal):\n * a = text1, b = diffs\n * Method 4 (deprecated, use method 3):\n * a = text1, b = text2, c = diffs\n *\n * @param {string|!Array.} a text1 (methods 1,3,4) or\n * Array of diff tuples for text1 to text2 (method 2).\n * @param {string|!Array.} opt_b text2 (methods 1,4) or\n * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).\n * @param {string|!Array.} opt_c Array of diff tuples\n * for text1 to text2 (method 4) or undefined (methods 1,2,3).\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {\n var text1, diffs;\n if (typeof a == 'string' && typeof opt_b == 'string' &&\n typeof opt_c == 'undefined') {\n // Method 1: text1, text2\n // Compute diffs from text1 and text2.\n text1 = /** @type {string} */(a);\n diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);\n if (diffs.length > 2) {\n this.diff_cleanupSemantic(diffs);\n this.diff_cleanupEfficiency(diffs);\n }\n } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&\n typeof opt_c == 'undefined') {\n // Method 2: diffs\n // Compute text1 from diffs.\n diffs = /** @type {!Array.} */(a);\n text1 = this.diff_text1(diffs);\n } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&\n typeof opt_c == 'undefined') {\n // Method 3: text1, diffs\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_b);\n } else if (typeof a == 'string' && typeof opt_b == 'string' &&\n opt_c && typeof opt_c == 'object') {\n // Method 4: text1, text2, diffs\n // text2 is not used.\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_c);\n } else {\n throw new Error('Unknown call format to patch_make.');\n }\n\n if (diffs.length === 0) {\n return []; // Get rid of the null case.\n }\n var patches = [];\n var patch = new diff_match_patch.patch_obj();\n var patchDiffLength = 0; // Keeping our own length var is faster in JS.\n var char_count1 = 0; // Number of characters into the text1 string.\n var char_count2 = 0; // Number of characters into the text2 string.\n // Start with text1 (prepatch_text) and apply the diffs until we arrive at\n // text2 (postpatch_text). We recreate the patches one by one to determine\n // context info.\n var prepatch_text = text1;\n var postpatch_text = text1;\n for (var x = 0; x < diffs.length; x++) {\n var diff_type = diffs[x][0];\n var diff_text = diffs[x][1];\n\n if (!patchDiffLength && diff_type !== DIFF_EQUAL) {\n // A new patch starts here.\n patch.start1 = char_count1;\n patch.start2 = char_count2;\n }\n\n switch (diff_type) {\n case DIFF_INSERT:\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length2 += diff_text.length;\n postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +\n postpatch_text.substring(char_count2);\n break;\n case DIFF_DELETE:\n patch.length1 += diff_text.length;\n patch.diffs[patchDiffLength++] = diffs[x];\n postpatch_text = postpatch_text.substring(0, char_count2) +\n postpatch_text.substring(char_count2 +\n diff_text.length);\n break;\n case DIFF_EQUAL:\n if (diff_text.length <= 2 * this.Patch_Margin &&\n patchDiffLength && diffs.length != x + 1) {\n // Small equality inside a patch.\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length1 += diff_text.length;\n patch.length2 += diff_text.length;\n } else if (diff_text.length >= 2 * this.Patch_Margin) {\n // Time for a new patch.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n patch = new diff_match_patch.patch_obj();\n patchDiffLength = 0;\n // Unlike Unidiff, our patch lists have a rolling context.\n // http://code.google.com/p/google-diff-match-patch/wiki/Unidiff\n // Update prepatch text & pos to reflect the application of the\n // just completed patch.\n prepatch_text = postpatch_text;\n char_count1 = char_count2;\n }\n }\n break;\n }\n\n // Update the current character count.\n if (diff_type !== DIFF_INSERT) {\n char_count1 += diff_text.length;\n }\n if (diff_type !== DIFF_DELETE) {\n char_count2 += diff_text.length;\n }\n }\n // Pick up the leftover patch if not empty.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n }\n\n return patches;\n};\n\n\n/**\n * Given an array of patches, return another array that is identical.\n * @param {!Array.} patches Array of Patch objects.\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_deepCopy = function(patches) {\n // Making deep copies is hard in JavaScript.\n var patchesCopy = [];\n for (var x = 0; x < patches.length; x++) {\n var patch = patches[x];\n var patchCopy = new diff_match_patch.patch_obj();\n patchCopy.diffs = [];\n for (var y = 0; y < patch.diffs.length; y++) {\n patchCopy.diffs[y] = patch.diffs[y].slice();\n }\n patchCopy.start1 = patch.start1;\n patchCopy.start2 = patch.start2;\n patchCopy.length1 = patch.length1;\n patchCopy.length2 = patch.length2;\n patchesCopy[x] = patchCopy;\n }\n return patchesCopy;\n};\n\n\n/**\n * Merge a set of patches onto the text. Return a patched text, as well\n * as a list of true/false values indicating which patches were applied.\n * @param {!Array.} patches Array of Patch objects.\n * @param {string} text Old text.\n * @return {!Array.>} Two element Array, containing the\n * new text and an array of boolean values.\n */\ndiff_match_patch.prototype.patch_apply = function(patches, text) {\n if (patches.length == 0) {\n return [text, []];\n }\n\n // Deep copy the patches so that no changes are made to originals.\n patches = this.patch_deepCopy(patches);\n\n var nullPadding = this.patch_addPadding(patches);\n text = nullPadding + text + nullPadding;\n\n this.patch_splitMax(patches);\n // delta keeps track of the offset between the expected and actual location\n // of the previous patch. If there are patches expected at positions 10 and\n // 20, but the first patch was found at 12, delta is 2 and the second patch\n // has an effective expected position of 22.\n var delta = 0;\n var results = [];\n for (var x = 0; x < patches.length; x++) {\n var expected_loc = patches[x].start2 + delta;\n var text1 = this.diff_text1(patches[x].diffs);\n var start_loc;\n var end_loc = -1;\n if (text1.length > this.Match_MaxBits) {\n // patch_splitMax will only provide an oversized pattern in the case of\n // a monster delete.\n start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits),\n expected_loc);\n if (start_loc != -1) {\n end_loc = this.match_main(text,\n text1.substring(text1.length - this.Match_MaxBits),\n expected_loc + text1.length - this.Match_MaxBits);\n if (end_loc == -1 || start_loc >= end_loc) {\n // Can't find valid trailing context. Drop this patch.\n start_loc = -1;\n }\n }\n } else {\n start_loc = this.match_main(text, text1, expected_loc);\n }\n if (start_loc == -1) {\n // No match found. :(\n results[x] = false;\n // Subtract the delta for this failed patch from subsequent patches.\n delta -= patches[x].length2 - patches[x].length1;\n } else {\n // Found a match. :)\n results[x] = true;\n delta = start_loc - expected_loc;\n var text2;\n if (end_loc == -1) {\n text2 = text.substring(start_loc, start_loc + text1.length);\n } else {\n text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);\n }\n if (text1 == text2) {\n // Perfect match, just shove the replacement text in.\n text = text.substring(0, start_loc) +\n this.diff_text2(patches[x].diffs) +\n text.substring(start_loc + text1.length);\n } else {\n // Imperfect match. Run a diff to get a framework of equivalent\n // indices.\n var diffs = this.diff_main(text1, text2, false);\n if (text1.length > this.Match_MaxBits &&\n this.diff_levenshtein(diffs) / text1.length >\n this.Patch_DeleteThreshold) {\n // The end points match, but the content is unacceptably bad.\n results[x] = false;\n } else {\n this.diff_cleanupSemanticLossless(diffs);\n var index1 = 0;\n var index2;\n for (var y = 0; y < patches[x].diffs.length; y++) {\n var mod = patches[x].diffs[y];\n if (mod[0] !== DIFF_EQUAL) {\n index2 = this.diff_xIndex(diffs, index1);\n }\n if (mod[0] === DIFF_INSERT) { // Insertion\n text = text.substring(0, start_loc + index2) + mod[1] +\n text.substring(start_loc + index2);\n } else if (mod[0] === DIFF_DELETE) { // Deletion\n text = text.substring(0, start_loc + index2) +\n text.substring(start_loc + this.diff_xIndex(diffs,\n index1 + mod[1].length));\n }\n if (mod[0] !== DIFF_DELETE) {\n index1 += mod[1].length;\n }\n }\n }\n }\n }\n }\n // Strip the padding off.\n text = text.substring(nullPadding.length, text.length - nullPadding.length);\n return [text, results];\n};\n\n\n/**\n * Add some padding on text start and end so that edges can match something.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} The padding string added to each side.\n */\ndiff_match_patch.prototype.patch_addPadding = function(patches) {\n var paddingLength = this.Patch_Margin;\n var nullPadding = '';\n for (var x = 1; x <= paddingLength; x++) {\n nullPadding += String.fromCharCode(x);\n }\n\n // Bump all the patches forward.\n for (var x = 0; x < patches.length; x++) {\n patches[x].start1 += paddingLength;\n patches[x].start2 += paddingLength;\n }\n\n // Add some padding on start of first diff.\n var patch = patches[0];\n var diffs = patch.diffs;\n if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.unshift([DIFF_EQUAL, nullPadding]);\n patch.start1 -= paddingLength; // Should be 0.\n patch.start2 -= paddingLength; // Should be 0.\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[0][1].length) {\n // Grow first equality.\n var extraLength = paddingLength - diffs[0][1].length;\n diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];\n patch.start1 -= extraLength;\n patch.start2 -= extraLength;\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n // Add some padding on end of last diff.\n patch = patches[patches.length - 1];\n diffs = patch.diffs;\n if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.push([DIFF_EQUAL, nullPadding]);\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[diffs.length - 1][1].length) {\n // Grow last equality.\n var extraLength = paddingLength - diffs[diffs.length - 1][1].length;\n diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n return nullPadding;\n};\n\n\n/**\n * Look through the patches and break up any which are longer than the maximum\n * limit of the match algorithm.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_splitMax = function(patches) {\n var patch_size = this.Match_MaxBits;\n for (var x = 0; x < patches.length; x++) {\n if (patches[x].length1 <= patch_size) {\n continue;\n }\n var bigpatch = patches[x];\n // Remove the big old patch.\n patches.splice(x--, 1);\n var start1 = bigpatch.start1;\n var start2 = bigpatch.start2;\n var precontext = '';\n while (bigpatch.diffs.length !== 0) {\n // Create one of several smaller patches.\n var patch = new diff_match_patch.patch_obj();\n var empty = true;\n patch.start1 = start1 - precontext.length;\n patch.start2 = start2 - precontext.length;\n if (precontext !== '') {\n patch.length1 = patch.length2 = precontext.length;\n patch.diffs.push([DIFF_EQUAL, precontext]);\n }\n while (bigpatch.diffs.length !== 0 &&\n patch.length1 < patch_size - this.Patch_Margin) {\n var diff_type = bigpatch.diffs[0][0];\n var diff_text = bigpatch.diffs[0][1];\n if (diff_type === DIFF_INSERT) {\n // Insertions are harmless.\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n patch.diffs.push(bigpatch.diffs.shift());\n empty = false;\n } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 &&\n patch.diffs[0][0] == DIFF_EQUAL &&\n diff_text.length > 2 * patch_size) {\n // This is a large deletion. Let it pass in one chunk.\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n empty = false;\n patch.diffs.push([diff_type, diff_text]);\n bigpatch.diffs.shift();\n } else {\n // Deletion or equality. Only take as much as we can stomach.\n diff_text = diff_text.substring(0,\n patch_size - patch.length1 - this.Patch_Margin);\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n if (diff_type === DIFF_EQUAL) {\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n } else {\n empty = false;\n }\n patch.diffs.push([diff_type, diff_text]);\n if (diff_text == bigpatch.diffs[0][1]) {\n bigpatch.diffs.shift();\n } else {\n bigpatch.diffs[0][1] =\n bigpatch.diffs[0][1].substring(diff_text.length);\n }\n }\n }\n // Compute the head context for the next patch.\n precontext = this.diff_text2(patch.diffs);\n precontext =\n precontext.substring(precontext.length - this.Patch_Margin);\n // Append the end context for this patch.\n var postcontext = this.diff_text1(bigpatch.diffs)\n .substring(0, this.Patch_Margin);\n if (postcontext !== '') {\n patch.length1 += postcontext.length;\n patch.length2 += postcontext.length;\n if (patch.diffs.length !== 0 &&\n patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {\n patch.diffs[patch.diffs.length - 1][1] += postcontext;\n } else {\n patch.diffs.push([DIFF_EQUAL, postcontext]);\n }\n }\n if (!empty) {\n patches.splice(++x, 0, patch);\n }\n }\n }\n};\n\n\n/**\n * Take a list of patches and return a textual representation.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} Text representation of patches.\n */\ndiff_match_patch.prototype.patch_toText = function(patches) {\n var text = [];\n for (var x = 0; x < patches.length; x++) {\n text[x] = patches[x];\n }\n return text.join('');\n};\n\n\n/**\n * Parse a textual representation of patches and return a list of Patch objects.\n * @param {string} textline Text representation of patches.\n * @return {!Array.} Array of Patch objects.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.patch_fromText = function(textline) {\n var patches = [];\n if (!textline) {\n return patches;\n }\n var text = textline.split('\\n');\n var textPointer = 0;\n var patchHeader = /^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$/;\n while (textPointer < text.length) {\n var m = text[textPointer].match(patchHeader);\n if (!m) {\n throw new Error('Invalid patch string: ' + text[textPointer]);\n }\n var patch = new diff_match_patch.patch_obj();\n patches.push(patch);\n patch.start1 = parseInt(m[1], 10);\n if (m[2] === '') {\n patch.start1--;\n patch.length1 = 1;\n } else if (m[2] == '0') {\n patch.length1 = 0;\n } else {\n patch.start1--;\n patch.length1 = parseInt(m[2], 10);\n }\n\n patch.start2 = parseInt(m[3], 10);\n if (m[4] === '') {\n patch.start2--;\n patch.length2 = 1;\n } else if (m[4] == '0') {\n patch.length2 = 0;\n } else {\n patch.start2--;\n patch.length2 = parseInt(m[4], 10);\n }\n textPointer++;\n\n while (textPointer < text.length) {\n var sign = text[textPointer].charAt(0);\n try {\n var line = decodeURI(text[textPointer].substring(1));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in patch_fromText: ' + line);\n }\n if (sign == '-') {\n // Deletion.\n patch.diffs.push([DIFF_DELETE, line]);\n } else if (sign == '+') {\n // Insertion.\n patch.diffs.push([DIFF_INSERT, line]);\n } else if (sign == ' ') {\n // Minor equality.\n patch.diffs.push([DIFF_EQUAL, line]);\n } else if (sign == '@') {\n // Start of next patch.\n break;\n } else if (sign === '') {\n // Blank line? Whatever.\n } else {\n // WTF?\n throw new Error('Invalid patch mode \"' + sign + '\" in: ' + line);\n }\n textPointer++;\n }\n }\n return patches;\n};\n\n\n/**\n * Class representing one patch operation.\n * @constructor\n */\ndiff_match_patch.patch_obj = function() {\n /** @type {!Array.} */\n this.diffs = [];\n /** @type {?number} */\n this.start1 = null;\n /** @type {?number} */\n this.start2 = null;\n /** @type {number} */\n this.length1 = 0;\n /** @type {number} */\n this.length2 = 0;\n};\n\n\n/**\n * Emmulate GNU diff's format.\n * Header: @@ -382,8 +481,9 @@\n * Indicies are printed as 1-based, not 0-based.\n * @return {string} The GNU diff string.\n */\ndiff_match_patch.patch_obj.prototype.toString = function() {\n var coords1, coords2;\n if (this.length1 === 0) {\n coords1 = this.start1 + ',0';\n } else if (this.length1 == 1) {\n coords1 = this.start1 + 1;\n } else {\n coords1 = (this.start1 + 1) + ',' + this.length1;\n }\n if (this.length2 === 0) {\n coords2 = this.start2 + ',0';\n } else if (this.length2 == 1) {\n coords2 = this.start2 + 1;\n } else {\n coords2 = (this.start2 + 1) + ',' + this.length2;\n }\n var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\\n'];\n var op;\n // Escape the body of the patch with %xx notation.\n for (var x = 0; x < this.diffs.length; x++) {\n switch (this.diffs[x][0]) {\n case DIFF_INSERT:\n op = '+';\n break;\n case DIFF_DELETE:\n op = '-';\n break;\n case DIFF_EQUAL:\n op = ' ';\n break;\n }\n text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\\n';\n }\n return text.join('').replace(/%20/g, ' ');\n};\n\n\n// The following export code was added by @ForbesLindesay\nmodule.exports = diff_match_patch;\nmodule.exports['diff_match_patch'] = diff_match_patch;\nmodule.exports['DIFF_DELETE'] = DIFF_DELETE;\nmodule.exports['DIFF_INSERT'] = DIFF_INSERT;\nmodule.exports['DIFF_EQUAL'] = DIFF_EQUAL;\n\n/***/ }),\n/* 1050 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar BaseBarSeries = __webpack_require__(354);\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*/\nvar _default = BaseBarSeries.extend({\n type: 'series.bar',\n dependencies: ['grid', 'polar'],\n brushSelector: 'rect',\n\n /**\n * @override\n */\n getProgressive: function () {\n // Do not support progressive in normal mode.\n return this.get('large') ? this.get('progressive') : false;\n },\n\n /**\n * @override\n */\n getProgressiveThreshold: function () {\n // Do not support progressive in normal mode.\n var progressiveThreshold = this.get('progressiveThreshold');\n var largeThreshold = this.get('largeThreshold');\n\n if (largeThreshold > progressiveThreshold) {\n progressiveThreshold = largeThreshold;\n }\n\n return progressiveThreshold;\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1051 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar _helper = __webpack_require__(355);\n\nvar setLabel = _helper.setLabel;\n\nvar Model = __webpack_require__(31);\n\nvar barItemStyle = __webpack_require__(1054);\n\nvar Path = __webpack_require__(22);\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*/\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth']; // FIXME\n// Just for compatible with ec2.\n\nzrUtil.extend(Model.prototype, barItemStyle);\n\nvar _default = echarts.extendChartView({\n type: 'bar',\n render: function (seriesModel, ecModel, api) {\n this._updateDrawMode(seriesModel);\n\n var coordinateSystemType = seriesModel.get('coordinateSystem');\n\n if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') {\n this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api);\n } else {}\n\n return this.group;\n },\n incrementalPrepareRender: function (seriesModel, ecModel, api) {\n this._clear();\n\n this._updateDrawMode(seriesModel);\n },\n incrementalRender: function (params, seriesModel, ecModel, api) {\n // Do not support progressive in normal mode.\n this._incrementalRenderLarge(params, seriesModel);\n },\n _updateDrawMode: function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n },\n _renderNormal: function (seriesModel, ecModel, api) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coord = seriesModel.coordinateSystem;\n var baseAxis = coord.getBaseAxis();\n var isHorizontalOrRadial;\n\n if (coord.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n } else if (coord.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n }\n\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\n data.diff(oldData).add(function (dataIndex) {\n if (!data.hasValue(dataIndex)) {\n return;\n }\n\n var itemModel = data.getItemModel(dataIndex);\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\n var el = elementCreator[coord.type](data, dataIndex, itemModel, layout, isHorizontalOrRadial, animationModel);\n data.setItemGraphicEl(dataIndex, el);\n group.add(el);\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n }).update(function (newIndex, oldIndex) {\n var el = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex)) {\n group.remove(el);\n return;\n }\n\n var itemModel = data.getItemModel(newIndex);\n var layout = getLayout[coord.type](data, newIndex, itemModel);\n\n if (el) {\n graphic.updateProps(el, {\n shape: layout\n }, animationModel, newIndex);\n } else {\n el = elementCreator[coord.type](data, newIndex, itemModel, layout, isHorizontalOrRadial, animationModel, true);\n }\n\n data.setItemGraphicEl(newIndex, el); // Add back\n\n group.add(el);\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n }).remove(function (dataIndex) {\n var el = oldData.getItemGraphicEl(dataIndex);\n\n if (coord.type === 'cartesian2d') {\n el && removeRect(dataIndex, animationModel, el);\n } else {\n el && removeSector(dataIndex, animationModel, el);\n }\n }).execute();\n this._data = data;\n },\n _renderLarge: function (seriesModel, ecModel, api) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n },\n _incrementalRenderLarge: function (params, seriesModel) {\n createLarge(seriesModel, this.group, true);\n },\n dispose: zrUtil.noop,\n remove: function (ecModel) {\n this._clear(ecModel);\n },\n _clear: function (ecModel) {\n var group = this.group;\n var data = this._data;\n\n if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) {\n data.eachItemGraphicEl(function (el) {\n if (el.type === 'sector') {\n removeSector(el.dataIndex, ecModel, el);\n } else {\n removeRect(el.dataIndex, ecModel, el);\n }\n });\n } else {\n group.removeAll();\n }\n\n this._data = null;\n }\n});\n\nvar elementCreator = {\n cartesian2d: function (data, dataIndex, itemModel, layout, isHorizontal, animationModel, isUpdate) {\n var rect = new graphic.Rect({\n shape: zrUtil.extend({}, layout)\n }); // Animation\n\n if (animationModel) {\n var rectShape = rect.shape;\n var animateProperty = isHorizontal ? 'height' : 'width';\n var animateTarget = {};\n rectShape[animateProperty] = 0;\n animateTarget[animateProperty] = layout[animateProperty];\n graphic[isUpdate ? 'updateProps' : 'initProps'](rect, {\n shape: animateTarget\n }, animationModel, dataIndex);\n }\n\n return rect;\n },\n polar: function (data, dataIndex, itemModel, layout, isRadial, animationModel, isUpdate) {\n // Keep the same logic with bar in catesion: use end value to control\n // direction. Notice that if clockwise is true (by default), the sector\n // will always draw clockwisely, no matter whether endAngle is greater\n // or less than startAngle.\n var clockwise = layout.startAngle < layout.endAngle;\n var sector = new graphic.Sector({\n shape: zrUtil.defaults({\n clockwise: clockwise\n }, layout)\n }); // Animation\n\n if (animationModel) {\n var sectorShape = sector.shape;\n var animateProperty = isRadial ? 'r' : 'endAngle';\n var animateTarget = {};\n sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle;\n animateTarget[animateProperty] = layout[animateProperty];\n graphic[isUpdate ? 'updateProps' : 'initProps'](sector, {\n shape: animateTarget\n }, animationModel, dataIndex);\n }\n\n return sector;\n }\n};\n\nfunction removeRect(dataIndex, animationModel, el) {\n // Not show text when animating\n el.style.text = null;\n graphic.updateProps(el, {\n shape: {\n width: 0\n }\n }, animationModel, dataIndex, function () {\n el.parent && el.parent.remove(el);\n });\n}\n\nfunction removeSector(dataIndex, animationModel, el) {\n // Not show text when animating\n el.style.text = null;\n graphic.updateProps(el, {\n shape: {\n r: el.shape.r0\n }\n }, animationModel, dataIndex, function () {\n el.parent && el.parent.remove(el);\n });\n}\n\nvar getLayout = {\n cartesian2d: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n var fixedLineWidth = getLineWidth(itemModel, layout); // fix layout with lineWidth\n\n var signX = layout.width > 0 ? 1 : -1;\n var signY = layout.height > 0 ? 1 : -1;\n return {\n x: layout.x + signX * fixedLineWidth / 2,\n y: layout.y + signY * fixedLineWidth / 2,\n width: layout.width - signX * fixedLineWidth,\n height: layout.height - signY * fixedLineWidth\n };\n },\n polar: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n return {\n cx: layout.cx,\n cy: layout.cy,\n r0: layout.r0,\n r: layout.r,\n startAngle: layout.startAngle,\n endAngle: layout.endAngle\n };\n }\n};\n\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {\n var color = data.getItemVisual(dataIndex, 'color');\n var opacity = data.getItemVisual(dataIndex, 'opacity');\n var itemStyleModel = itemModel.getModel('itemStyle');\n var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle();\n\n if (!isPolar) {\n el.setShape('r', itemStyleModel.get('barBorderRadius') || 0);\n }\n\n el.useStyle(zrUtil.defaults({\n fill: color,\n opacity: opacity\n }, itemStyleModel.getBarItemStyle()));\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && el.attr('cursor', cursorStyle);\n var labelPositionOutside = isHorizontal ? layout.height > 0 ? 'bottom' : 'top' : layout.width > 0 ? 'left' : 'right';\n\n if (!isPolar) {\n setLabel(el.style, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside);\n }\n\n graphic.setHoverStyle(el, hoverStyle);\n} // In case width or height are too small.\n\n\nfunction getLineWidth(itemModel, rawLayout) {\n var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height));\n}\n\nvar LargePath = Path.extend({\n type: 'largeBar',\n shape: {\n points: []\n },\n buildPath: function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n var startPoint = this.__startPoint;\n var valueIdx = this.__valueIdx;\n\n for (var i = 0; i < points.length; i += 2) {\n startPoint[this.__valueIdx] = points[i + valueIdx];\n ctx.moveTo(startPoint[0], startPoint[1]);\n ctx.lineTo(points[i], points[i + 1]);\n }\n }\n});\n\nfunction createLarge(seriesModel, group, incremental) {\n // TODO support polar\n var data = seriesModel.getData();\n var startPoint = [];\n var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\n startPoint[1 - valueIdx] = data.getLayout('valueAxisStart');\n var el = new LargePath({\n shape: {\n points: data.getLayout('largePoints')\n },\n incremental: !!incremental,\n __startPoint: startPoint,\n __valueIdx: valueIdx\n });\n group.add(el);\n setLargeStyle(el, seriesModel, data);\n}\n\nfunction setLargeStyle(el, seriesModel, data) {\n var borderColor = data.getVisual('borderColor') || data.getVisual('color');\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(['color', 'borderColor']);\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor;\n el.style.lineWidth = data.getLayout('barWidth');\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1052 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar BaseBarSeries = __webpack_require__(354);\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*/\nvar PictorialBarSeries = BaseBarSeries.extend({\n type: 'series.pictorialBar',\n dependencies: ['grid'],\n defaultOption: {\n symbol: 'circle',\n // Customized bar shape\n symbolSize: null,\n // Can be ['100%', '100%'], null means auto.\n symbolRotate: null,\n symbolPosition: null,\n // 'start' or 'end' or 'center', null means auto.\n symbolOffset: null,\n symbolMargin: null,\n // start margin and end margin. Can be a number or a percent string.\n // Auto margin by defualt.\n symbolRepeat: false,\n // false/null/undefined, means no repeat.\n // Can be true, means auto calculate repeat times and cut by data.\n // Can be a number, specifies repeat times, and do not cut by data.\n // Can be 'fixed', means auto calculate repeat times but do not cut by data.\n symbolRepeatDirection: 'end',\n // 'end' means from 'start' to 'end'.\n symbolClip: false,\n symbolBoundingData: null,\n // Can be 60 or -40 or [-40, 60]\n symbolPatternSize: 400,\n // 400 * 400 px\n barGap: '-100%',\n // In most case, overlap is needed.\n // z can be set in data item, which is z2 actually.\n // Disable progressive\n progressive: 0,\n hoverAnimation: false // Open only when needed.\n\n },\n getInitialData: function (option) {\n // Disable stack.\n option.stack = null;\n return PictorialBarSeries.superApply(this, 'getInitialData', arguments);\n }\n});\nvar _default = PictorialBarSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1053 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar _symbol = __webpack_require__(50);\n\nvar createSymbol = _symbol.createSymbol;\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\nvar isNumeric = _number.isNumeric;\n\nvar _helper = __webpack_require__(355);\n\nvar setLabel = _helper.setLabel;\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*/\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth']; // index: +isHorizontal\n\nvar LAYOUT_ATTRS = [{\n xy: 'x',\n wh: 'width',\n index: 0,\n posDesc: ['left', 'right']\n}, {\n xy: 'y',\n wh: 'height',\n index: 1,\n posDesc: ['top', 'bottom']\n}];\nvar pathForLineWidth = new graphic.Circle();\nvar BarView = echarts.extendChartView({\n type: 'pictorialBar',\n render: function (seriesModel, ecModel, api) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = !!baseAxis.isHorizontal();\n var coordSysRect = cartesian.grid.getRect();\n var opt = {\n ecSize: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n seriesModel: seriesModel,\n coordSys: cartesian,\n coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],\n isHorizontal: isHorizontal,\n valueDim: LAYOUT_ATTRS[+isHorizontal],\n categoryDim: LAYOUT_ATTRS[1 - isHorizontal]\n };\n data.diff(oldData).add(function (dataIndex) {\n if (!data.hasValue(dataIndex)) {\n return;\n }\n\n var itemModel = getItemModel(data, dataIndex);\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\n var bar = createBar(data, opt, symbolMeta);\n data.setItemGraphicEl(dataIndex, bar);\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).update(function (newIndex, oldIndex) {\n var bar = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex)) {\n group.remove(bar);\n return;\n }\n\n var itemModel = getItemModel(data, newIndex);\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\n\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\n group.remove(bar);\n data.setItemGraphicEl(newIndex, null);\n bar = null;\n }\n\n if (bar) {\n updateBar(bar, opt, symbolMeta);\n } else {\n bar = createBar(data, opt, symbolMeta, true);\n }\n\n data.setItemGraphicEl(newIndex, bar);\n bar.__pictorialSymbolMeta = symbolMeta; // Add back\n\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).remove(function (dataIndex) {\n var bar = oldData.getItemGraphicEl(dataIndex);\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\n }).execute();\n this._data = data;\n return this.group;\n },\n dispose: zrUtil.noop,\n remove: function (ecModel, api) {\n var group = this.group;\n var data = this._data;\n\n if (ecModel.get('animation')) {\n if (data) {\n data.eachItemGraphicEl(function (bar) {\n removeBar(data, bar.dataIndex, ecModel, bar);\n });\n }\n } else {\n group.removeAll();\n }\n }\n}); // Set or calculate default value about symbol, and calculate layout info.\n\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.\n\n\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n boundingLength = symbolBoundingExtent[pxSignIdx];\n } else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n } else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n } else {\n boundingLength = layout[valueDim.wh];\n }\n\n output.boundingLength = boundingLength;\n\n if (symbolRepeat) {\n output.repeatCutLength = layout[valueDim.wh];\n }\n\n output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\n}\n\nfunction convertToCoordOnAxis(axis, value) {\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\n} // Support ['100%', '100%']\n\n\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, output) {\n var valueDim = opt.valueDim;\n var categoryDim = opt.categoryDim;\n var categorySize = Math.abs(layout[categoryDim.wh]);\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\n\n if (zrUtil.isArray(symbolSize)) {\n symbolSize = symbolSize.slice();\n } else {\n if (symbolSize == null) {\n symbolSize = '100%';\n }\n\n symbolSize = [symbolSize, symbolSize];\n } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\n // to complicated to calculate real percent value if considering scaled lineWidth.\n // So the actual size will bigger than layout size if lineWidth is bigger than zero,\n // which can be tolerated in pictorial chart.\n\n\n symbolSize[categoryDim.index] = parsePercent(symbolSize[categoryDim.index], categorySize);\n symbolSize[valueDim.index] = parsePercent(symbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\n output.symbolSize = symbolSize; // If x or y is less than zero, show reversed shape.\n\n var symbolScale = output.symbolScale = [symbolSize[0] / symbolPatternSize, symbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale.\n\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\n}\n\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, output) {\n // In symbols are drawn with scale, so do not need to care about the case that width\n // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\n // be calculated.\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n\n if (valueLineWidth) {\n pathForLineWidth.attr({\n scale: symbolScale.slice(),\n rotation: rotation\n });\n pathForLineWidth.updateTransform();\n valueLineWidth /= pathForLineWidth.getLineScale();\n valueLineWidth *= symbolScale[opt.valueDim.index];\n }\n\n output.valueLineWidth = valueLineWidth;\n}\n\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, output) {\n var categoryDim = opt.categoryDim;\n var valueDim = opt.valueDim;\n var pxSign = output.pxSign;\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\n var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may\n // want symbols to rotate on its center, which should not be translated\n // when rotating.\n\n if (symbolRepeat) {\n var absBoundingLength = Math.abs(boundingLength);\n var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\n var hasEndGap = false;\n\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\n hasEndGap = true;\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\n }\n\n symbolMargin = parsePercent(symbolMargin, symbolSize[valueDim.index]);\n var uLenWithMargin = Math.max(unitLength + symbolMargin * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted\n // to ensure that all of the symbols will not be overflow the given area.\n\n var endFix = hasEndGap ? 0 : symbolMargin * 2; // Both final repeatTimes and final symbolMargin area calculated based on\n // boundingLength.\n\n var repeatSpecified = isNumeric(symbolRepeat);\n var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed\n // entirely in the given layout area.\n\n var mDiff = absBoundingLength - repeatTimes * unitLength;\n symbolMargin = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1);\n uLenWithMargin = unitLength + symbolMargin * 2;\n endFix = hasEndGap ? 0 : symbolMargin * 2; // Update repeatTimes when not all symbol will be shown.\n\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\n repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;\n }\n\n pathLen = repeatTimes * uLenWithMargin - endFix;\n output.repeatTimes = repeatTimes;\n output.symbolMargin = symbolMargin;\n }\n\n var sizeFix = pxSign * (pathLen / 2);\n var pathPosition = output.pathPosition = [];\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\n pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center'\n\n if (symbolOffset) {\n pathPosition[0] += symbolOffset[0];\n pathPosition[1] += symbolOffset[1];\n }\n\n var bundlePosition = output.bundlePosition = [];\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\n bundlePosition[valueDim.index] = layout[valueDim.xy];\n var barRectShape = output.barRectShape = zrUtil.extend({}, layout);\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\n var clipShape = output.clipShape = {}; // Consider that symbol may be overflow layout rect.\n\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\n clipShape[valueDim.xy] = 0;\n clipShape[valueDim.wh] = layout[valueDim.wh];\n}\n\nfunction createPath(symbolMeta) {\n var symbolPatternSize = symbolMeta.symbolPatternSize;\n var path = createSymbol( // Consider texture img, make a big size.\n symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize, symbolMeta.color);\n path.attr({\n culling: true\n });\n path.type !== 'image' && path.setStyle({\n strokeNoScale: true\n });\n return path;\n}\n\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var symbolSize = symbolMeta.symbolSize;\n var valueLineWidth = symbolMeta.valueLineWidth;\n var pathPosition = symbolMeta.pathPosition;\n var valueDim = opt.valueDim;\n var repeatTimes = symbolMeta.repeatTimes || 0;\n var index = 0;\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\n eachPath(bar, function (path) {\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n\n if (index < repeatTimes) {\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\n } else {\n updateAttr(path, null, {\n scale: [0, 0]\n }, symbolMeta, isUpdate, function () {\n bundle.remove(path);\n });\n }\n\n updateHoverAnimation(path, symbolMeta);\n index++;\n });\n\n for (; index < repeatTimes; index++) {\n var path = createPath(symbolMeta);\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n bundle.add(path);\n var target = makeTarget(index);\n updateAttr(path, {\n position: target.position,\n scale: [0, 0]\n }, {\n scale: target.scale,\n rotation: target.rotation\n }, symbolMeta, isUpdate); // FIXME\n // If all emphasis/normal through action.\n\n path.on('mouseover', onMouseOver).on('mouseout', onMouseOut);\n updateHoverAnimation(path, symbolMeta);\n }\n\n function makeTarget(index) {\n var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\n // Otherwise: i = index;\n\n var pxSign = symbolMeta.pxSign;\n var i = index;\n\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\n i = repeatTimes - 1 - index;\n }\n\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\n return {\n position: position,\n scale: symbolMeta.symbolScale.slice(),\n rotation: symbolMeta.rotation\n };\n }\n\n function onMouseOver() {\n eachPath(bar, function (path) {\n path.trigger('emphasis');\n });\n }\n\n function onMouseOut() {\n eachPath(bar, function (path) {\n path.trigger('normal');\n });\n }\n}\n\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var mainPath = bar.__pictorialMainPath;\n\n if (!mainPath) {\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\n bundle.add(mainPath);\n updateAttr(mainPath, {\n position: symbolMeta.pathPosition.slice(),\n scale: [0, 0],\n rotation: symbolMeta.rotation\n }, {\n scale: symbolMeta.symbolScale.slice()\n }, symbolMeta, isUpdate);\n mainPath.on('mouseover', onMouseOver).on('mouseout', onMouseOut);\n } else {\n updateAttr(mainPath, null, {\n position: symbolMeta.pathPosition.slice(),\n scale: symbolMeta.symbolScale.slice(),\n rotation: symbolMeta.rotation\n }, symbolMeta, isUpdate);\n }\n\n updateHoverAnimation(mainPath, symbolMeta);\n\n function onMouseOver() {\n this.trigger('emphasis');\n }\n\n function onMouseOut() {\n this.trigger('normal');\n }\n} // bar rect is used for label.\n\n\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\n var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\n var barRect = bar.__pictorialBarRect;\n\n if (!barRect) {\n barRect = bar.__pictorialBarRect = new graphic.Rect({\n z2: 2,\n shape: rectShape,\n silent: true,\n style: {\n stroke: 'transparent',\n fill: 'transparent',\n lineWidth: 0\n }\n });\n bar.add(barRect);\n } else {\n updateAttr(barRect, null, {\n shape: rectShape\n }, symbolMeta, isUpdate);\n }\n}\n\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\n // If not clip, symbol will be remove and rebuilt.\n if (symbolMeta.symbolClip) {\n var clipPath = bar.__pictorialClipPath;\n var clipShape = zrUtil.extend({}, symbolMeta.clipShape);\n var valueDim = opt.valueDim;\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n\n if (clipPath) {\n graphic.updateProps(clipPath, {\n shape: clipShape\n }, animationModel, dataIndex);\n } else {\n clipShape[valueDim.wh] = 0;\n clipPath = new graphic.Rect({\n shape: clipShape\n });\n\n bar.__pictorialBundle.setClipPath(clipPath);\n\n bar.__pictorialClipPath = clipPath;\n var target = {};\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, {\n shape: target\n }, animationModel, dataIndex);\n }\n }\n}\n\nfunction getItemModel(data, dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\n itemModel.isAnimationEnabled = isAnimationEnabled;\n return itemModel;\n}\n\nfunction getAnimationDelayParams(path) {\n // The order is the same as the z-order, see `symbolRepeatDiretion`.\n return {\n index: path.__pictorialAnimationIndex,\n count: path.__pictorialRepeatTimes\n };\n}\n\nfunction isAnimationEnabled() {\n // `animation` prop can be set on itemModel in pictorial bar chart.\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\n}\n\nfunction updateHoverAnimation(path, symbolMeta) {\n path.off('emphasis').off('normal');\n var scale = symbolMeta.symbolScale.slice();\n symbolMeta.hoverAnimation && path.on('emphasis', function () {\n this.animateTo({\n scale: [scale[0] * 1.1, scale[1] * 1.1]\n }, 400, 'elasticOut');\n }).on('normal', function () {\n this.animateTo({\n scale: scale.slice()\n }, 400, 'elasticOut');\n });\n}\n\nfunction createBar(data, opt, symbolMeta, isUpdate) {\n // bar is the main element for each data.\n var bar = new graphic.Group(); // bundle is used for location and clip.\n\n var bundle = new graphic.Group();\n bar.add(bundle);\n bar.__pictorialBundle = bundle;\n bundle.attr('position', symbolMeta.bundlePosition.slice());\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\n bar.__pictorialSymbolMeta = symbolMeta;\n return bar;\n}\n\nfunction updateBar(bar, opt, symbolMeta) {\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n var bundle = bar.__pictorialBundle;\n graphic.updateProps(bundle, {\n position: symbolMeta.bundlePosition.slice()\n }, animationModel, dataIndex);\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, true);\n createOrUpdateClip(bar, opt, symbolMeta, true);\n}\n\nfunction removeBar(data, dataIndex, animationModel, bar) {\n // Not show text when animating\n var labelRect = bar.__pictorialBarRect;\n labelRect && (labelRect.style.text = null);\n var pathes = [];\n eachPath(bar, function (path) {\n pathes.push(path);\n });\n bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet.\n\n bar.__pictorialClipPath && (animationModel = null);\n zrUtil.each(pathes, function (path) {\n graphic.updateProps(path, {\n scale: [0, 0]\n }, animationModel, dataIndex, function () {\n bar.parent && bar.parent.remove(bar);\n });\n });\n data.setItemGraphicEl(dataIndex, null);\n}\n\nfunction getShapeStr(data, symbolMeta) {\n return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':');\n}\n\nfunction eachPath(bar, cb, context) {\n // Do not use Group#eachChild, because it do not support remove.\n zrUtil.each(bar.__pictorialBundle.children(), function (el) {\n el !== bar.__pictorialBarRect && cb.call(context, el);\n });\n}\n\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\n immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\n\n if (symbolMeta.symbolClip && !isUpdate) {\n animationAttrs && el.attr(animationAttrs);\n } else {\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\n }\n}\n\nfunction updateCommon(bar, opt, symbolMeta) {\n var color = symbolMeta.color;\n var dataIndex = symbolMeta.dataIndex;\n var itemModel = symbolMeta.itemModel; // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var normalStyle = itemModel.getModel('itemStyle').getItemStyle(['color']);\n var hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle();\n var cursorStyle = itemModel.getShallow('cursor');\n eachPath(bar, function (path) {\n // PENDING setColor should be before setStyle!!!\n path.setColor(color);\n path.setStyle(zrUtil.defaults({\n fill: color,\n opacity: symbolMeta.opacity\n }, normalStyle));\n graphic.setHoverStyle(path, hoverStyle);\n cursorStyle && (path.cursor = cursorStyle);\n path.z2 = symbolMeta.z2;\n });\n var barRectHoverStyle = {};\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\n var barRect = bar.__pictorialBarRect;\n setLabel(barRect.style, barRectHoverStyle, itemModel, color, opt.seriesModel, dataIndex, barPositionOutside);\n graphic.setHoverStyle(barRect, barRectHoverStyle);\n}\n\nfunction toIntTimes(times) {\n var roundedTimes = Math.round(times); // Escapse accurate error\n\n return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);\n}\n\nvar _default = BarView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1054 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar makeStyleMapper = __webpack_require__(119);\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*/\nvar getBarItemStyle = makeStyleMapper([['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], // Compatitable with 2\n['stroke', 'barBorderColor'], ['lineWidth', 'barBorderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor']]);\nvar _default = {\n getBarItemStyle: function (excludes) {\n var style = getBarItemStyle(this, excludes);\n\n if (this.getBorderLineDash) {\n var lineDash = this.getBorderLineDash();\n lineDash && (style.lineDash = lineDash);\n }\n\n return style;\n }\n};\nmodule.exports = _default;\n\n/***/ }),\n/* 1055 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1056);\n\n__webpack_require__(1057);\n\nvar boxplotVisual = __webpack_require__(1059);\n\nvar boxplotLayout = __webpack_require__(1058);\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*/\necharts.registerVisual(boxplotVisual);\necharts.registerLayout(boxplotLayout);\n\n/***/ }),\n/* 1056 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar _whiskerBoxCommon = __webpack_require__(362);\n\nvar seriesModelMixin = _whiskerBoxCommon.seriesModelMixin;\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*/\nvar BoxplotSeries = SeriesModel.extend({\n type: 'series.boxplot',\n dependencies: ['xAxis', 'yAxis', 'grid'],\n // TODO\n // box width represents group size, so dimension should have 'size'.\n\n /**\n * @see \n * The meanings of 'min' and 'max' depend on user,\n * and echarts do not need to know it.\n * @readOnly\n */\n defaultValueDimensions: [{\n name: 'min',\n defaultTooltip: true\n }, {\n name: 'Q1',\n defaultTooltip: true\n }, {\n name: 'median',\n defaultTooltip: true\n }, {\n name: 'Q3',\n defaultTooltip: true\n }, {\n name: 'max',\n defaultTooltip: true\n }],\n\n /**\n * @type {Array.}\n * @readOnly\n */\n dimensions: null,\n\n /**\n * @override\n */\n defaultOption: {\n zlevel: 0,\n // 一级层叠\n z: 2,\n // 二级层叠\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n hoverAnimation: true,\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n layout: null,\n // 'horizontal' or 'vertical'\n boxWidth: [7, 50],\n // [min, max] can be percent of band width.\n itemStyle: {\n color: '#fff',\n borderWidth: 1\n },\n emphasis: {\n itemStyle: {\n borderWidth: 2,\n shadowBlur: 5,\n shadowOffsetX: 2,\n shadowOffsetY: 2,\n shadowColor: 'rgba(0,0,0,0.4)'\n }\n },\n animationEasing: 'elasticOut',\n animationDuration: 800\n }\n});\nzrUtil.mixin(BoxplotSeries, seriesModelMixin, true);\nvar _default = BoxplotSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1057 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar ChartView = __webpack_require__(65);\n\nvar graphic = __webpack_require__(5);\n\nvar Path = __webpack_require__(22);\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*/\n// Update common properties\nvar NORMAL_ITEM_STYLE_PATH = ['itemStyle'];\nvar EMPHASIS_ITEM_STYLE_PATH = ['emphasis', 'itemStyle'];\nvar BoxplotView = ChartView.extend({\n type: 'boxplot',\n render: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var group = this.group;\n var oldData = this._data; // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(symbolEl);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (!symbolEl) {\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\n } else {\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\n }\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n },\n remove: function (ecModel) {\n var group = this.group;\n var data = this._data;\n this._data = null;\n data && data.eachItemGraphicEl(function (el) {\n el && group.remove(el);\n });\n },\n dispose: zrUtil.noop\n});\nvar BoxPath = Path.extend({\n type: 'boxplotBoxPath',\n shape: {},\n buildPath: function (ctx, shape) {\n var ends = shape.points;\n var i = 0;\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n\n for (; i < 4; i++) {\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n\n ctx.closePath();\n\n for (; i < ends.length; i++) {\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n }\n});\n\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\n var ends = itemLayout.ends;\n var el = new BoxPath({\n shape: {\n points: isInit ? transInit(ends, constDim, itemLayout) : ends\n }\n });\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\n return el;\n}\n\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\n var seriesModel = data.hostModel;\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\n updateMethod(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, dataIndex);\n var itemModel = data.getItemModel(dataIndex);\n var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH);\n var borderColor = data.getItemVisual(dataIndex, 'color'); // Exclude borderColor.\n\n var itemStyle = normalItemStyleModel.getItemStyle(['borderColor']);\n itemStyle.stroke = borderColor;\n itemStyle.strokeNoScale = true;\n el.useStyle(itemStyle);\n el.z2 = 100;\n var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH).getItemStyle();\n graphic.setHoverStyle(el, hoverStyle);\n}\n\nfunction transInit(points, dim, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[dim] = itemLayout.initBaseline;\n return point;\n });\n}\n\nvar _default = BoxplotView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1058 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\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*/\nvar each = zrUtil.each;\n\nfunction _default(ecModel) {\n var groupResult = groupSeriesByAxis(ecModel);\n each(groupResult, function (groupItem) {\n var seriesModels = groupItem.seriesModels;\n\n if (!seriesModels.length) {\n return;\n }\n\n calculateBase(groupItem);\n each(seriesModels, function (seriesModel, idx) {\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\n });\n });\n}\n/**\n * Group series by axis.\n */\n\n\nfunction groupSeriesByAxis(ecModel) {\n var result = [];\n var axisList = [];\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n var baseAxis = seriesModel.getBaseAxis();\n var idx = zrUtil.indexOf(axisList, baseAxis);\n\n if (idx < 0) {\n idx = axisList.length;\n axisList[idx] = baseAxis;\n result[idx] = {\n axis: baseAxis,\n seriesModels: []\n };\n }\n\n result[idx].seriesModels.push(seriesModel);\n });\n return result;\n}\n/**\n * Calculate offset and box width for each series.\n */\n\n\nfunction calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}\n/**\n * Calculate points location for each series.\n */\n\n\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var halfWidth = boxWidth / 2;\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\n var vDimIdx = 1 - cDimIdx;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimension(coordDims[vDimIdx], true);\n\n if (cDim == null || vDims.length < 5) {\n return;\n }\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var axisDimVal = data.get(cDim, dataIndex);\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\n var ends = [];\n addBodyEnd(ends, end2, 0);\n addBodyEnd(ends, end4, 1);\n ends.push(end1, end2, end5, end4);\n layEndLine(ends, end1);\n layEndLine(ends, end5);\n layEndLine(ends, median);\n data.setItemLayout(dataIndex, {\n initBaseline: median[vDimIdx],\n ends: ends\n });\n }\n\n function getPoint(axisDimVal, dimIdx, dataIndex) {\n var val = data.get(dimIdx, dataIndex);\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n var point;\n\n if (isNaN(axisDimVal) || isNaN(val)) {\n point = [NaN, NaN];\n } else {\n point = coordSys.dataToPoint(p);\n point[cDimIdx] += offset;\n }\n\n return point;\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] += halfWidth;\n point2[cDimIdx] -= halfWidth;\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function layEndLine(ends, endCenter) {\n var from = endCenter.slice();\n var to = endCenter.slice();\n from[cDimIdx] -= halfWidth;\n to[cDimIdx] += halfWidth;\n ends.push(from, to);\n }\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1059 */\n/***/ (function(module, exports) {\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*/\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*/\nvar borderColorQuery = ['itemStyle', 'borderColor'];\n\nfunction _default(ecModel, api) {\n var globalColors = ecModel.get('color');\n ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {\n var defaulColor = globalColors[seriesModel.seriesIndex % globalColors.length];\n var data = seriesModel.getData();\n data.setVisual({\n legendSymbol: 'roundRect',\n // Use name 'color' but not 'borderColor' for legend usage and\n // visual coding from other component like dataRange.\n color: seriesModel.get(borderColorQuery) || defaulColor\n }); // Only visible series has each data be visual encoded\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n data.setItemVisual(idx, {\n color: itemModel.get(borderColorQuery, true)\n });\n });\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1060 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1061);\n\n__webpack_require__(1062);\n\nvar preprocessor = __webpack_require__(1065);\n\nvar candlestickVisual = __webpack_require__(1064);\n\nvar candlestickLayout = __webpack_require__(1063);\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*/\necharts.registerPreprocessor(preprocessor);\necharts.registerVisual(candlestickVisual);\necharts.registerLayout(candlestickLayout);\n\n/***/ }),\n/* 1061 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar _whiskerBoxCommon = __webpack_require__(362);\n\nvar seriesModelMixin = _whiskerBoxCommon.seriesModelMixin;\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*/\nvar CandlestickSeries = SeriesModel.extend({\n type: 'series.candlestick',\n dependencies: ['xAxis', 'yAxis', 'grid'],\n\n /**\n * @readOnly\n */\n defaultValueDimensions: [{\n name: 'open',\n defaultTooltip: true\n }, {\n name: 'close',\n defaultTooltip: true\n }, {\n name: 'lowest',\n defaultTooltip: true\n }, {\n name: 'highest',\n defaultTooltip: true\n }],\n\n /**\n * @type {Array.}\n * @readOnly\n */\n dimensions: null,\n\n /**\n * @override\n */\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n hoverAnimation: true,\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n layout: null,\n // 'horizontal' or 'vertical'\n itemStyle: {\n color: '#c23531',\n // 阳线 positive\n color0: '#314656',\n // 阴线 negative '#c23531', '#314656'\n borderWidth: 1,\n // FIXME\n // ec2中使用的是lineStyle.color 和 lineStyle.color0\n borderColor: '#c23531',\n borderColor0: '#314656'\n },\n emphasis: {\n itemStyle: {\n borderWidth: 2\n }\n },\n barMaxWidth: null,\n barMinWidth: null,\n barWidth: null,\n large: true,\n largeThreshold: 600,\n progressive: 3e3,\n progressiveThreshold: 1e4,\n progressiveChunkMode: 'mod',\n animationUpdate: false,\n animationEasing: 'linear',\n animationDuration: 300\n },\n\n /**\n * Get dimension for shadow in dataZoom\n * @return {string} dimension name\n */\n getShadowDim: function () {\n return 'open';\n },\n brushSelector: function (dataIndex, data, selectors) {\n var itemLayout = data.getItemLayout(dataIndex);\n return itemLayout && selectors.rect(itemLayout.brushRect);\n }\n});\nzrUtil.mixin(CandlestickSeries, seriesModelMixin, true);\nvar _default = CandlestickSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1062 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar ChartView = __webpack_require__(65);\n\nvar graphic = __webpack_require__(5);\n\nvar Path = __webpack_require__(22);\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*/\nvar NORMAL_ITEM_STYLE_PATH = ['itemStyle'];\nvar EMPHASIS_ITEM_STYLE_PATH = ['emphasis', 'itemStyle'];\nvar SKIP_PROPS = ['color', 'color0', 'borderColor', 'borderColor0'];\nvar CandlestickView = ChartView.extend({\n type: 'candlestick',\n render: function (seriesModel, ecModel, api) {\n this._updateDrawMode(seriesModel);\n\n this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);\n },\n incrementalPrepareRender: function (seriesModel, ecModel, api) {\n this._clear();\n\n this._updateDrawMode(seriesModel);\n },\n incrementalRender: function (params, seriesModel, ecModel, api) {\n this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);\n },\n _updateDrawMode: function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n },\n _renderNormal: function (seriesModel) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var isSimpleBox = data.getLayout('isSimpleBox'); // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var el;\n var itemLayout = data.getItemLayout(newIdx);\n el = createNormalBox(itemLayout, newIdx, true);\n graphic.initProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }\n }).update(function (newIdx, oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(el);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (!el) {\n el = createNormalBox(itemLayout, newIdx);\n } else {\n graphic.updateProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n }\n\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n },\n _renderLarge: function (seriesModel) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n },\n _incrementalRenderNormal: function (params, seriesModel) {\n var data = seriesModel.getData();\n var isSimpleBox = data.getLayout('isSimpleBox');\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var el;\n var itemLayout = data.getItemLayout(dataIndex);\n el = createNormalBox(itemLayout, dataIndex);\n setBoxCommon(el, data, dataIndex, isSimpleBox);\n el.incremental = true;\n this.group.add(el);\n }\n },\n _incrementalRenderLarge: function (params, seriesModel) {\n createLarge(seriesModel, this.group, true);\n },\n remove: function (ecModel) {\n this._clear();\n },\n _clear: function () {\n this.group.removeAll();\n this._data = null;\n },\n dispose: zrUtil.noop\n});\nvar NormalBoxPath = Path.extend({\n type: 'normalCandlestickBox',\n shape: {},\n buildPath: function (ctx, shape) {\n var ends = shape.points;\n\n if (this.__simpleBox) {\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[6][0], ends[6][1]);\n } else {\n ctx.moveTo(ends[0][0], ends[0][1]);\n ctx.lineTo(ends[1][0], ends[1][1]);\n ctx.lineTo(ends[2][0], ends[2][1]);\n ctx.lineTo(ends[3][0], ends[3][1]);\n ctx.closePath();\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[5][0], ends[5][1]);\n ctx.moveTo(ends[6][0], ends[6][1]);\n ctx.lineTo(ends[7][0], ends[7][1]);\n }\n }\n});\n\nfunction createNormalBox(itemLayout, dataIndex, isInit) {\n var ends = itemLayout.ends;\n return new NormalBoxPath({\n shape: {\n points: isInit ? transInit(ends, itemLayout) : ends\n },\n z2: 100\n });\n}\n\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\n var itemModel = data.getItemModel(dataIndex);\n var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH);\n var color = data.getItemVisual(dataIndex, 'color');\n var borderColor = data.getItemVisual(dataIndex, 'borderColor') || color; // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var itemStyle = normalItemStyleModel.getItemStyle(SKIP_PROPS);\n el.useStyle(itemStyle);\n el.style.strokeNoScale = true;\n el.style.fill = color;\n el.style.stroke = borderColor;\n el.__simpleBox = isSimpleBox;\n var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH).getItemStyle();\n graphic.setHoverStyle(el, hoverStyle);\n}\n\nfunction transInit(points, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[1] = itemLayout.initBaseline;\n return point;\n });\n}\n\nvar LargeBoxPath = Path.extend({\n type: 'largeCandlestickBox',\n shape: {},\n buildPath: function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n\n for (var i = 0; i < points.length;) {\n if (this.__sign === points[i++]) {\n var x = points[i++];\n ctx.moveTo(x, points[i++]);\n ctx.lineTo(x, points[i++]);\n } else {\n i += 3;\n }\n }\n }\n});\n\nfunction createLarge(seriesModel, group, incremental) {\n var data = seriesModel.getData();\n var largePoints = data.getLayout('largePoints');\n var elP = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 1\n });\n group.add(elP);\n var elN = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: -1\n });\n group.add(elN);\n setLargeStyle(1, elP, seriesModel, data);\n setLargeStyle(-1, elN, seriesModel, data);\n\n if (incremental) {\n elP.incremental = true;\n elN.incremental = true;\n }\n}\n\nfunction setLargeStyle(sign, el, seriesModel, data) {\n var suffix = sign > 0 ? 'P' : 'N';\n var borderColor = data.getVisual('borderColor' + suffix) || data.getVisual('color' + suffix); // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var itemStyle = seriesModel.getModel(NORMAL_ITEM_STYLE_PATH).getItemStyle(SKIP_PROPS);\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor; // No different\n // el.style.lineWidth = .5;\n}\n\nvar _default = CandlestickView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1063 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _graphic = __webpack_require__(5);\n\nvar subPixelOptimize = _graphic.subPixelOptimize;\n\nvar createRenderPlanner = __webpack_require__(116);\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\n\nvar _util = __webpack_require__(0);\n\nvar retrieve2 = _util.retrieve2;\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*/\n\n/* global Float32Array */\nvar LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar _default = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var candleWidth = calculateCandleWidth(seriesModel, data);\n var cDimIdx = 0;\n var vDimIdx = 1;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimension(coordDims[vDimIdx], true);\n var openDim = vDims[0];\n var closeDim = vDims[1];\n var lowestDim = vDims[2];\n var highestDim = vDims[3];\n data.setLayout({\n candleWidth: candleWidth,\n // The value is experimented visually.\n isSimpleBox: candleWidth <= 1.3\n });\n\n if (cDim == null || vDims.length < 4) {\n return;\n }\n\n return {\n progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress\n };\n\n function normalProgress(params, data) {\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = data.get(cDim, dataIndex);\n var openVal = data.get(openDim, dataIndex);\n var closeVal = data.get(closeDim, dataIndex);\n var lowestVal = data.get(lowestDim, dataIndex);\n var highestVal = data.get(highestDim, dataIndex);\n var ocLow = Math.min(openVal, closeVal);\n var ocHigh = Math.max(openVal, closeVal);\n var ocLowPoint = getPoint(ocLow, axisDimVal);\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\n var lowestPoint = getPoint(lowestVal, axisDimVal);\n var highestPoint = getPoint(highestVal, axisDimVal);\n var ends = [];\n addBodyEnd(ends, ocHighPoint, 0);\n addBodyEnd(ends, ocLowPoint, 1);\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\n data.setItemLayout(dataIndex, {\n sign: getSign(data, dataIndex, openVal, closeVal, closeDim),\n initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\n // open point.\n ends: ends,\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\n });\n }\n\n function getPoint(val, axisDimVal) {\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p);\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);\n point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\n var pmin = getPoint(lowestVal, axisDimVal);\n var pmax = getPoint(highestVal, axisDimVal);\n pmin[cDimIdx] -= candleWidth / 2;\n pmax[cDimIdx] -= candleWidth / 2;\n return {\n x: pmin[0],\n y: pmin[1],\n width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\n height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\n };\n }\n\n function subPixelOptimizePoint(point) {\n point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\n return point;\n }\n }\n\n function largeProgress(params, data) {\n // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\n var points = new LargeArr(params.count * 5);\n var offset = 0;\n var point;\n var tmpIn = [];\n var tmpOut = [];\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = data.get(cDim, dataIndex);\n var openVal = data.get(openDim, dataIndex);\n var closeVal = data.get(closeDim, dataIndex);\n var lowestVal = data.get(lowestDim, dataIndex);\n var highestVal = data.get(highestDim, dataIndex);\n\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\n points[offset++] = NaN;\n offset += 4;\n continue;\n }\n\n points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim);\n tmpIn[cDimIdx] = axisDimVal;\n tmpIn[vDimIdx] = lowestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n tmpIn[vDimIdx] = highestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[1] : NaN;\n }\n\n data.setLayout('largePoints', points);\n }\n }\n};\n\nfunction getSign(data, dataIndex, openVal, closeVal, closeDim) {\n var sign;\n\n if (openVal > closeVal) {\n sign = -1;\n } else if (openVal < closeVal) {\n sign = 1;\n } else {\n sign = dataIndex > 0 // If close === open, compare with close of last record\n ? data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1 : // No record of previous, set to be positive\n 1;\n }\n\n return sign;\n}\n\nfunction calculateCandleWidth(seriesModel, data) {\n var baseAxis = seriesModel.getBaseAxis();\n var extent;\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());\n var barMaxWidth = parsePercent(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\n var barMinWidth = parsePercent(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\n var barWidth = seriesModel.get('barWidth');\n return barWidth != null ? parsePercent(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap.\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1064 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar createRenderPlanner = __webpack_require__(116);\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*/\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\nvar positiveColorQuery = ['itemStyle', 'color'];\nvar negativeColorQuery = ['itemStyle', 'color0'];\nvar _default = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var isLargeRender = seriesModel.pipelineContext.large;\n data.setVisual({\n legendSymbol: 'roundRect',\n colorP: getColor(1, seriesModel),\n colorN: getColor(-1, seriesModel),\n borderColorP: getBorderColor(1, seriesModel),\n borderColorN: getBorderColor(-1, seriesModel)\n }); // Only visible series has each data be visual encoded\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n return !isLargeRender && {\n progress: progress\n };\n\n function progress(params, data) {\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemModel = data.getItemModel(dataIndex);\n var sign = data.getItemLayout(dataIndex).sign;\n data.setItemVisual(dataIndex, {\n color: getColor(sign, itemModel),\n borderColor: getBorderColor(sign, itemModel)\n });\n }\n }\n\n function getColor(sign, model) {\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\n }\n\n function getBorderColor(sign, model) {\n return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\n }\n }\n};\nmodule.exports = _default;\n\n/***/ }),\n/* 1065 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\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*/\nfunction _default(option) {\n if (!option || !zrUtil.isArray(option.series)) {\n return;\n } // Translate 'k' to 'candlestick'.\n\n\n zrUtil.each(option.series, function (seriesItem) {\n if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\n seriesItem.type = 'candlestick';\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1066 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphicUtil = __webpack_require__(5);\n\nvar _labelHelper = __webpack_require__(248);\n\nvar getDefaultLabel = _labelHelper.getDefaultLabel;\n\nvar createListFromArray = __webpack_require__(70);\n\nvar _barGrid = __webpack_require__(180);\n\nvar getLayoutOnAxis = _barGrid.getLayoutOnAxis;\n\nvar DataDiffer = __webpack_require__(102);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar ChartView = __webpack_require__(65);\n\nvar prepareCartesian2d = __webpack_require__(1257);\n\nvar prepareGeo = __webpack_require__(1266);\n\nvar prepareSingleAxis = __webpack_require__(1284);\n\nvar preparePolar = __webpack_require__(1277);\n\nvar prepareCalendar = __webpack_require__(1252);\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*/\nvar ITEM_STYLE_NORMAL_PATH = ['itemStyle'];\nvar ITEM_STYLE_EMPHASIS_PATH = ['emphasis', 'itemStyle'];\nvar LABEL_NORMAL = ['label'];\nvar LABEL_EMPHASIS = ['emphasis', 'label']; // Use prefix to avoid index to be the same as el.name,\n// which will cause weird udpate animation.\n\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\n/**\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\n * of each coordinate systems are not required by each coordinate systems directly, but\n * required by the module `custom`.\n *\n * prepareInfoForCustomSeries {Function}: optional\n * @return {Object} {coordSys: {...}, api: {\n * coord: function (data, clamp) {}, // return point in global.\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\n * }}\n */\n\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n singleAxis: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n}; // ------\n// Model\n// ------\n\nSeriesModel.extend({\n type: 'series.custom',\n dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'],\n defaultOption: {\n coordinateSystem: 'cartesian2d',\n // Can be set as 'none'\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n useTransform: true // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // label: {}\n // itemStyle: {}\n\n },\n\n /**\n * @override\n */\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n },\n\n /**\n * @override\n */\n getDataParams: function (dataIndex, dataType, el) {\n var params = SeriesModel.prototype.getDataParams.apply(this, arguments);\n el && (params.info = el.info);\n return params;\n }\n}); // -----\n// View\n// -----\n\nChartView.extend({\n type: 'custom',\n\n /**\n * @private\n * @type {module:echarts/data/List}\n */\n _data: null,\n\n /**\n * @override\n */\n render: function (customSeries, ecModel, api, payload) {\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api); // By default, merge mode is applied. In most cases, custom series is\n // used in the scenario that data amount is not large but graphic elements\n // is complicated, where merge mode is probably necessary for optimization.\n // For example, reuse graphic elements and only update the transform when\n // roam or data zoom according to `actionType`.\n\n data.diff(oldData).add(function (newIdx) {\n createOrUpdate(null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).update(function (newIdx, oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n createOrUpdate(el, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n },\n incrementalPrepareRender: function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n },\n incrementalRender: function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.useHoverLayer = true;\n }\n }\n\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdate(null, idx, renderItem(idx, payload), customSeries, this.group, data);\n el.traverse(setIncrementalAndHoverLayer);\n }\n },\n\n /**\n * @override\n */\n dispose: zrUtil.noop,\n\n /**\n * @override\n */\n filterForExposedEvent: function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n\n if (elementName == null || targetEl.name === elementName) {\n return true;\n } // Enable to give a name on a group made by `renderItem`, and listen\n // events that triggerd by its descendents.\n\n\n while ((targetEl = targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n\n return false;\n }\n});\n\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el;\n\n if (graphicType === 'path') {\n var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path.\n\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default.\n\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n el.__customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n el.__customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({});\n el.__customText = elOption.style.text;\n } else {\n var Clz = graphicUtil[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)];\n el = new Clz();\n }\n\n el.__customGraphicType = graphicType;\n el.name = elOption.name;\n return el;\n}\n\nfunction updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot) {\n var transitionProps = {};\n var elOptionStyle = elOption.style || {};\n elOption.shape && (transitionProps.shape = zrUtil.clone(elOption.shape));\n elOption.position && (transitionProps.position = elOption.position.slice());\n elOption.scale && (transitionProps.scale = elOption.scale.slice());\n elOption.origin && (transitionProps.origin = elOption.origin.slice());\n elOption.rotation && (transitionProps.rotation = elOption.rotation);\n\n if (el.type === 'image' && elOption.style) {\n var targetStyle = transitionProps.style = {};\n zrUtil.each(['x', 'y', 'width', 'height'], function (prop) {\n prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit);\n });\n }\n\n if (el.type === 'text' && elOption.style) {\n var targetStyle = transitionProps.style = {};\n zrUtil.each(['x', 'y'], function (prop) {\n prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit);\n }); // Compatible with previous: both support\n // textFill and fill, textStroke and stroke in 'text' element.\n\n !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && (elOptionStyle.textFill = elOptionStyle.fill);\n !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && (elOptionStyle.textStroke = elOptionStyle.stroke);\n }\n\n if (el.type !== 'group') {\n el.useStyle(elOptionStyle); // Init animation.\n\n if (isInit) {\n el.style.opacity = 0;\n var targetOpacity = elOptionStyle.opacity;\n targetOpacity == null && (targetOpacity = 1);\n graphicUtil.initProps(el, {\n style: {\n opacity: targetOpacity\n }\n }, animatableModel, dataIndex);\n }\n }\n\n if (isInit) {\n el.attr(transitionProps);\n } else {\n graphicUtil.updateProps(el, transitionProps, animatableModel, dataIndex);\n } // Merge by default.\n // z2 must not be null/undefined, otherwise sort error may occur.\n\n\n elOption.hasOwnProperty('z2') && el.attr('z2', elOption.z2 || 0);\n elOption.hasOwnProperty('silent') && el.attr('silent', elOption.silent);\n elOption.hasOwnProperty('invisible') && el.attr('invisible', elOption.invisible);\n elOption.hasOwnProperty('ignore') && el.attr('ignore', elOption.ignore); // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n\n elOption.hasOwnProperty('info') && el.attr('info', elOption.info); // If `elOption.styleEmphasis` is `false`, remove hover style. The\n // logic is ensured by `graphicUtil.setElementHoverStyle`.\n\n var styleEmphasis = elOption.styleEmphasis;\n var disableStyleEmphasis = styleEmphasis === false;\n\n if (!( // Try to escapse setting hover style for performance.\n el.__cusHasEmphStl && styleEmphasis == null || !el.__cusHasEmphStl && disableStyleEmphasis)) {\n // Should not use graphicUtil.setHoverStyle, since the styleEmphasis\n // should not be share by group and its descendants.\n graphicUtil.setElementHoverStyle(el, styleEmphasis);\n el.__cusHasEmphStl = !disableStyleEmphasis;\n }\n\n isRoot && graphicUtil.setAsHoverStyleTrigger(el, !disableStyleEmphasis);\n}\n\nfunction prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) {\n if (elOptionStyle[prop] != null && !isInit) {\n targetStyle[prop] = elOptionStyle[prop];\n elOptionStyle[prop] = oldElStyle[prop];\n }\n}\n\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n\n if (coordSys) {\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms() : prepareCustoms[coordSys.type](coordSys);\n }\n\n var userAPI = zrUtil.defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n }; // Do not support call `api` asynchronously without dataIndexInside input.\n\n var currDataIndexInside;\n var currDirty = true;\n var currItemModel;\n var currLabelNormalModel;\n var currLabelEmphasisModel;\n var currVisualColor;\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currDirty = true;\n return renderItem && renderItem(zrUtil.defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n }; // Do not update cache until api called.\n\n function updateCache(dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n\n if (currDirty) {\n currItemModel = data.getItemModel(dataIndexInside);\n currLabelNormalModel = currItemModel.getModel(LABEL_NORMAL);\n currLabelEmphasisModel = currItemModel.getModel(LABEL_EMPHASIS);\n currVisualColor = data.getItemVisual(dataIndexInside, 'color');\n currDirty = false;\n }\n }\n /**\n * @public\n * @param {number|string} dim\n * @param {number} [dataIndexInside=currDataIndexInside]\n * @return {number|string} value\n */\n\n\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.get(data.getDimension(dim || 0), dataIndexInside);\n }\n /**\n * By default, `visual` is applied to style (to support visualMap).\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\n * it can be implemented as:\n * `api.style({stroke: api.visual('color'), fill: null})`;\n * @public\n * @param {Object} [extra]\n * @param {number} [dataIndexInside=currDataIndexInside]\n */\n\n\n function style(extra, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n updateCache(dataIndexInside);\n var itemStyle = currItemModel.getModel(ITEM_STYLE_NORMAL_PATH).getItemStyle();\n currVisualColor != null && (itemStyle.fill = currVisualColor);\n var opacity = data.getItemVisual(dataIndexInside, 'opacity');\n opacity != null && (itemStyle.opacity = opacity);\n graphicUtil.setTextStyle(itemStyle, currLabelNormalModel, null, {\n autoColor: currVisualColor,\n isRectText: true\n });\n itemStyle.text = currLabelNormalModel.getShallow('show') ? zrUtil.retrieve2(customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside)) : null;\n extra && zrUtil.extend(itemStyle, extra);\n return itemStyle;\n }\n /**\n * @public\n * @param {Object} [extra]\n * @param {number} [dataIndexInside=currDataIndexInside]\n */\n\n\n function styleEmphasis(extra, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n updateCache(dataIndexInside);\n var itemStyle = currItemModel.getModel(ITEM_STYLE_EMPHASIS_PATH).getItemStyle();\n graphicUtil.setTextStyle(itemStyle, currLabelEmphasisModel, null, {\n isRectText: true\n }, true);\n itemStyle.text = currLabelEmphasisModel.getShallow('show') ? zrUtil.retrieve3(customSeries.getFormattedLabel(dataIndexInside, 'emphasis'), customSeries.getFormattedLabel(dataIndexInside, 'normal'), getDefaultLabel(data, dataIndexInside)) : null;\n extra && zrUtil.extend(itemStyle, extra);\n return itemStyle;\n }\n /**\n * @public\n * @param {string} visualType\n * @param {number} [dataIndexInside=currDataIndexInside]\n */\n\n\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.getItemVisual(dataIndexInside, visualType);\n }\n /**\n * @public\n * @param {number} opt.count Positive interger.\n * @param {number} [opt.barWidth]\n * @param {number} [opt.barMaxWidth]\n * @param {number} [opt.barGap]\n * @param {number} [opt.barCategoryGap]\n * @return {Object} {width, offset, offsetCenter} is not support, return undefined.\n */\n\n\n function barLayout(opt) {\n if (coordSys.getBaseAxis) {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(zrUtil.defaults({\n axis: baseAxis\n }, opt), api);\n }\n }\n /**\n * @public\n * @return {Array.}\n */\n\n\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\n * @public\n * @param {Object} opt\n * @param {string} [opt.fontStyle]\n * @param {number} [opt.fontWeight]\n * @param {number} [opt.fontSize]\n * @param {string} [opt.fontFamily]\n * @return {string} font string\n */\n\n\n function font(opt) {\n return graphicUtil.getFont(opt, ecModel);\n }\n}\n\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n zrUtil.each(data.dimensions, function (dimName, dataDimIndex) {\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = dataDimIndex;\n }\n });\n return encodeDef;\n}\n\nfunction createOrUpdate(el, dataIndex, elOption, animatableModel, group, data) {\n el = doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, true);\n el && data.setItemGraphicEl(dataIndex, el);\n return el;\n}\n\nfunction doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, isRoot) {\n // [Rule]\n // By default, follow merge mode.\n // (It probably brings benifit for performance in some cases of large data, where\n // user program can be optimized to that only updated props needed to be re-calculated,\n // or according to `actionType` some calculation can be skipped.)\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n var simplyRemove = !elOption; // `null`/`undefined`/`false`\n\n elOption = elOption || {};\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n\n if (el && (simplyRemove // || elOption.$merge === false\n // If `elOptionType` is `null`, follow the merge principle.\n || elOptionType != null && elOptionType !== el.__customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== el.__customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== el.__customImagePath // FIXME test and remove this restriction?\n || elOptionType === 'text' && hasOwn(elOptionShape, 'text') && elOptionStyle.text !== el.__customText)) {\n group.remove(el);\n el = null;\n } // `elOption.type` is undefined when `renderItem` returns nothing.\n\n\n if (simplyRemove) {\n return;\n }\n\n var isInit = !el;\n !el && (el = createEl(elOption));\n updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot);\n\n if (elOptionType === 'group') {\n mergeChildren(el, dataIndex, elOption, animatableModel, data);\n } // Always add whatever already added to ensure sequence.\n\n\n group.add(el);\n return el;\n} // Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates that\n// the existing children will not be removed, and enables the feature that\n// update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will happen.\n//\n// For implementation simpleness, do not provide a direct way to remove sinlge\n// child (otherwise the total indicies of the children array have to be modified).\n// User can remove a single child by set its `ignore` as `true` or replace\n// it by another element, where its `$merge` can be set as `true` if necessary.\n\n\nfunction mergeChildren(el, dataIndex, elOption, animatableModel, data) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated.\n\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary.\n\n if (!newLen && !byName && !notMerge) {\n return;\n }\n\n if (byName) {\n diffGroupChildren({\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n animatableModel: animatableModel,\n group: el,\n data: data\n });\n return;\n }\n\n notMerge && el.removeAll(); // Mapping children of a group simply by index, which\n // might be better performance.\n\n var index = 0;\n\n for (; index < newLen; index++) {\n newChildren[index] && doCreateOrUpdate(el.childAt(index), dataIndex, newChildren[index], animatableModel, el, data);\n }\n}\n\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\n\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\n\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdate(child, context.dataIndex, childOption, context.animatableModel, context.group, context.data);\n}\n\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n child && context.group.remove(child);\n}\n\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\n\nfunction hasOwnPathData(shape) {\n return shape && (shape.hasOwnProperty('pathData') || shape.hasOwnProperty('d'));\n}\n\nfunction hasOwn(host, prop) {\n return host && host.hasOwnProperty(prop);\n}\n\n/***/ }),\n/* 1067 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1068);\n\n__webpack_require__(1069);\n\nvar visualSymbol = __webpack_require__(107);\n\nvar layoutPoints = __webpack_require__(148);\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*/\necharts.registerVisual(visualSymbol('effectScatter', 'circle'));\necharts.registerLayout(layoutPoints('effectScatter'));\n\n/***/ }),\n/* 1068 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar createListFromArray = __webpack_require__(70);\n\nvar SeriesModel = __webpack_require__(30);\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*/\nvar _default = SeriesModel.extend({\n type: 'series.effectScatter',\n dependencies: ['grid', 'polar'],\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n },\n brushSelector: 'point',\n defaultOption: {\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n effectType: 'ripple',\n progressive: 0,\n // When to show the effect, option: 'render'|'emphasis'\n showEffectOn: 'render',\n // Ripple effect config\n rippleEffect: {\n period: 4,\n // Scale of ripple\n scale: 2.5,\n // Brush type can be fill or stroke\n brushType: 'fill'\n },\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // symbol: null, // 图形类型\n symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2\n // symbolRotate: null, // 图形旋转控制\n // large: false,\n // Available when large is true\n // largeThreshold: 2000,\n // itemStyle: {\n // opacity: 1\n // }\n\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1069 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar SymbolDraw = __webpack_require__(138);\n\nvar EffectSymbol = __webpack_require__(1096);\n\nvar matrix = __webpack_require__(36);\n\nvar pointsLayout = __webpack_require__(148);\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*/\nvar _default = echarts.extendChartView({\n type: 'effectScatter',\n init: function () {\n this._symbolDraw = new SymbolDraw(EffectSymbol);\n },\n render: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var effectSymbolDraw = this._symbolDraw;\n effectSymbolDraw.updateData(data);\n this.group.add(effectSymbolDraw.group);\n },\n updateTransform: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n this.group.dirty();\n var res = pointsLayout().reset(seriesModel);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout(data);\n },\n _updateGroupTransform: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.getRoamTransform) {\n this.group.transform = matrix.clone(coordSys.getRoamTransform());\n this.group.decomposeTransform();\n }\n },\n remove: function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(api);\n },\n dispose: function () {}\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1070 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1071);\n\n__webpack_require__(1072);\n\nvar dataColor = __webpack_require__(184);\n\nvar funnelLayout = __webpack_require__(1073);\n\nvar dataFilter = __webpack_require__(149);\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*/\necharts.registerVisual(dataColor('funnel'));\necharts.registerLayout(funnelLayout);\necharts.registerProcessor(dataFilter('funnel'));\n\n/***/ }),\n/* 1071 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar createListSimply = __webpack_require__(115);\n\nvar _model = __webpack_require__(9);\n\nvar defaultEmphasis = _model.defaultEmphasis;\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*/\nvar FunnelSeries = echarts.extendSeriesModel({\n type: 'series.funnel',\n init: function (option) {\n FunnelSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n this.legendDataProvider = function () {\n return this.getRawData();\n }; // Extend labelLine emphasis\n\n\n this._defaultLabelLine(option);\n },\n getInitialData: function (option, ecModel) {\n return createListSimply(this, ['value']);\n },\n _defaultLabelLine: function (option) {\n // Extend labelLine emphasis\n defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n },\n // Overwrite\n getDataParams: function (dataIndex) {\n var data = this.getData();\n var params = FunnelSeries.superCall(this, 'getDataParams', dataIndex);\n var valueDim = data.mapDimension('value');\n var sum = data.getSum(valueDim); // Percent is 0 if sum is 0\n\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\n params.$vars.push('percent');\n return params;\n },\n defaultOption: {\n zlevel: 0,\n // 一级层叠\n z: 2,\n // 二级层叠\n legendHoverLink: true,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n // 默认取数据最小最大值\n // min: 0,\n // max: 100,\n minSize: '0%',\n maxSize: '100%',\n sort: 'descending',\n // 'ascending', 'descending'\n gap: 0,\n funnelAlign: 'center',\n label: {\n show: true,\n position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n labelLine: {\n show: true,\n length: 20,\n lineStyle: {\n // color: 各异,\n width: 1,\n type: 'solid'\n }\n },\n itemStyle: {\n // color: 各异,\n borderColor: '#fff',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true\n }\n }\n }\n});\nvar _default = FunnelSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1072 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar zrUtil = __webpack_require__(0);\n\nvar ChartView = __webpack_require__(65);\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*/\n\n/**\n * Piece of pie including Sector, Label, LabelLine\n * @constructor\n * @extends {module:zrender/graphic/Group}\n */\nfunction FunnelPiece(data, idx) {\n graphic.Group.call(this);\n var polygon = new graphic.Polygon();\n var labelLine = new graphic.Polyline();\n var text = new graphic.Text();\n this.add(polygon);\n this.add(labelLine);\n this.add(text);\n this.updateData(data, idx, true); // Hover to change label and labelLine\n\n function onEmphasis() {\n labelLine.ignore = labelLine.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }\n\n function onNormal() {\n labelLine.ignore = labelLine.normalIgnore;\n text.ignore = text.normalIgnore;\n }\n\n this.on('emphasis', onEmphasis).on('normal', onNormal).on('mouseover', onEmphasis).on('mouseout', onNormal);\n}\n\nvar funnelPieceProto = FunnelPiece.prototype;\nvar opacityAccessPath = ['itemStyle', 'opacity'];\n\nfunnelPieceProto.updateData = function (data, idx, firstCreate) {\n var polygon = this.childAt(0);\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var opacity = data.getItemModel(idx).get(opacityAccessPath);\n opacity = opacity == null ? 1 : opacity; // Reset style\n\n polygon.useStyle({});\n\n if (firstCreate) {\n polygon.setShape({\n points: layout.points\n });\n polygon.setStyle({\n opacity: 0\n });\n graphic.initProps(polygon, {\n style: {\n opacity: opacity\n }\n }, seriesModel, idx);\n } else {\n graphic.updateProps(polygon, {\n style: {\n opacity: opacity\n },\n shape: {\n points: layout.points\n }\n }, seriesModel, idx);\n } // Update common style\n\n\n var itemStyleModel = itemModel.getModel('itemStyle');\n var visualColor = data.getItemVisual(idx, 'color');\n polygon.setStyle(zrUtil.defaults({\n lineJoin: 'round',\n fill: visualColor\n }, itemStyleModel.getItemStyle(['opacity'])));\n polygon.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle();\n\n this._updateLabel(data, idx);\n\n graphic.setHoverStyle(this);\n};\n\nfunnelPieceProto._updateLabel = function (data, idx) {\n var labelLine = this.childAt(1);\n var labelText = this.childAt(2);\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var labelLayout = layout.label;\n var visualColor = data.getItemVisual(idx, 'color');\n graphic.updateProps(labelLine, {\n shape: {\n points: labelLayout.linePoints || labelLayout.linePoints\n }\n }, seriesModel, idx);\n graphic.updateProps(labelText, {\n style: {\n x: labelLayout.x,\n y: labelLayout.y\n }\n }, seriesModel, idx);\n labelText.attr({\n rotation: labelLayout.rotation,\n origin: [labelLayout.x, labelLayout.y],\n z2: 10\n });\n var labelModel = itemModel.getModel('label');\n var labelHoverModel = itemModel.getModel('emphasis.label');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineHoverModel = itemModel.getModel('emphasis.labelLine');\n var visualColor = data.getItemVisual(idx, 'color');\n graphic.setLabelStyle(labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n defaultText: data.getName(idx),\n autoColor: visualColor,\n useInsideStyle: !!labelLayout.inside\n }, {\n textAlign: labelLayout.textAlign,\n textVerticalAlign: labelLayout.verticalAlign\n });\n labelText.ignore = labelText.normalIgnore = !labelModel.get('show');\n labelText.hoverIgnore = !labelHoverModel.get('show');\n labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show');\n labelLine.hoverIgnore = !labelLineHoverModel.get('show'); // Default use item visual color\n\n labelLine.setStyle({\n stroke: visualColor\n });\n labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle());\n labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle();\n};\n\nzrUtil.inherits(FunnelPiece, graphic.Group);\nvar FunnelView = ChartView.extend({\n type: 'funnel',\n render: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n data.diff(oldData).add(function (idx) {\n var funnelPiece = new FunnelPiece(data, idx);\n data.setItemGraphicEl(idx, funnelPiece);\n group.add(funnelPiece);\n }).update(function (newIdx, oldIdx) {\n var piePiece = oldData.getItemGraphicEl(oldIdx);\n piePiece.updateData(data, newIdx);\n group.add(piePiece);\n data.setItemGraphicEl(newIdx, piePiece);\n }).remove(function (idx) {\n var piePiece = oldData.getItemGraphicEl(idx);\n group.remove(piePiece);\n }).execute();\n this._data = data;\n },\n remove: function () {\n this.group.removeAll();\n this._data = null;\n },\n dispose: function () {}\n});\nvar _default = FunnelView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1073 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar layout = __webpack_require__(16);\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\nvar linearMap = _number.linearMap;\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*/\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction getSortedIndices(data, sort) {\n var valueDim = data.mapDimension('value');\n var valueArr = data.mapArray(valueDim, function (val) {\n return val;\n });\n var indices = [];\n var isAscending = sort === 'ascending';\n\n for (var i = 0, len = data.count(); i < len; i++) {\n indices[i] = i;\n } // Add custom sortable function & none sortable opetion by \"options.sort\"\n\n\n if (typeof sort === 'function') {\n indices.sort(sort);\n } else if (sort !== 'none') {\n indices.sort(function (a, b) {\n return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];\n });\n }\n\n return indices;\n}\n\nfunction labelLayout(data) {\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label');\n var labelPosition = labelModel.get('position');\n var labelLineModel = itemModel.getModel('labelLine');\n var layout = data.getItemLayout(idx);\n var points = layout.points;\n var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center';\n var textAlign;\n var textX;\n var textY;\n var linePoints;\n\n if (isLabelInside) {\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\n textAlign = 'center';\n linePoints = [[textX, textY], [textX, textY]];\n } else {\n var x1;\n var y1;\n var x2;\n var labelLineLen = labelLineModel.get('length');\n\n if (labelPosition === 'left') {\n // Left side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n } else {\n // Right side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n }\n\n var y2 = y1;\n linePoints = [[x1, y1], [x2, y2]];\n textY = y2;\n }\n\n layout.label = {\n linePoints: linePoints,\n x: textX,\n y: textY,\n verticalAlign: 'middle',\n textAlign: textAlign,\n inside: isLabelInside\n };\n });\n}\n\nfunction _default(ecModel, api, payload) {\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var sort = seriesModel.get('sort');\n var viewRect = getViewRect(seriesModel, api);\n var indices = getSortedIndices(data, sort);\n var sizeExtent = [parsePercent(seriesModel.get('minSize'), viewRect.width), parsePercent(seriesModel.get('maxSize'), viewRect.width)];\n var dataExtent = data.getDataExtent(valueDim);\n var min = seriesModel.get('min');\n var max = seriesModel.get('max');\n\n if (min == null) {\n min = Math.min(dataExtent[0], 0);\n }\n\n if (max == null) {\n max = dataExtent[1];\n }\n\n var funnelAlign = seriesModel.get('funnelAlign');\n var gap = seriesModel.get('gap');\n var itemHeight = (viewRect.height - gap * (data.count() - 1)) / data.count();\n var y = viewRect.y;\n\n var getLinePoints = function (idx, offY) {\n // End point index is data.count() and we assign it 0\n var val = data.get(valueDim, idx) || 0;\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\n var x0;\n\n switch (funnelAlign) {\n case 'left':\n x0 = viewRect.x;\n break;\n\n case 'center':\n x0 = viewRect.x + (viewRect.width - itemWidth) / 2;\n break;\n\n case 'right':\n x0 = viewRect.x + viewRect.width - itemWidth;\n break;\n }\n\n return [[x0, offY], [x0 + itemWidth, offY]];\n };\n\n if (sort === 'ascending') {\n // From bottom to top\n itemHeight = -itemHeight;\n gap = -gap;\n y += viewRect.height;\n indices = indices.reverse();\n }\n\n for (var i = 0; i < indices.length; i++) {\n var idx = indices[i];\n var nextIdx = indices[i + 1];\n var itemModel = data.getItemModel(idx);\n var height = itemModel.get('itemStyle.height');\n\n if (height == null) {\n height = itemHeight;\n } else {\n height = parsePercent(height, viewRect.height);\n\n if (sort === 'ascending') {\n height = -height;\n }\n }\n\n var start = getLinePoints(idx, y);\n var end = getLinePoints(nextIdx, y + height);\n y += height + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n }\n\n labelLayout(data);\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1074 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\n__webpack_require__(1075);\n\n__webpack_require__(1076);\n\n/***/ }),\n/* 1075 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar createListSimply = __webpack_require__(115);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar zrUtil = __webpack_require__(0);\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*/\nvar GaugeSeries = SeriesModel.extend({\n type: 'series.gauge',\n getInitialData: function (option, ecModel) {\n var dataOpt = option.data || [];\n\n if (!zrUtil.isArray(dataOpt)) {\n dataOpt = [dataOpt];\n }\n\n option.data = dataOpt;\n return createListSimply(this, ['value']);\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n legendHoverLink: true,\n radius: '75%',\n startAngle: 225,\n endAngle: -45,\n clockwise: true,\n // 最小值\n min: 0,\n // 最大值\n max: 100,\n // 分割段数,默认为10\n splitNumber: 10,\n // 坐标轴线\n axisLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n lineStyle: {\n // 属性lineStyle控制线条样式\n color: [[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']],\n width: 30\n }\n },\n // 分隔线\n splitLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n // 属性length控制线长\n length: 30,\n // 属性lineStyle(详见lineStyle)控制线条样式\n lineStyle: {\n color: '#eee',\n width: 2,\n type: 'solid'\n }\n },\n // 坐标轴小标记\n axisTick: {\n // 属性show控制显示与否,默认不显示\n show: true,\n // 每份split细分多少段\n splitNumber: 5,\n // 属性length控制线长\n length: 8,\n // 属性lineStyle控制线条样式\n lineStyle: {\n color: '#eee',\n width: 1,\n type: 'solid'\n }\n },\n axisLabel: {\n show: true,\n distance: 5,\n // formatter: null,\n color: 'auto'\n },\n pointer: {\n show: true,\n length: '80%',\n width: 8\n },\n itemStyle: {\n color: 'auto'\n },\n title: {\n show: true,\n // x, y,单位px\n offsetCenter: [0, '-40%'],\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#333',\n fontSize: 15\n },\n detail: {\n show: true,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n borderColor: '#ccc',\n width: 100,\n height: null,\n // self-adaption\n padding: [5, 10],\n // x, y,单位px\n offsetCenter: [0, '40%'],\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: 'auto',\n fontSize: 30\n }\n }\n});\nvar _default = GaugeSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1076 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar PointerPath = __webpack_require__(1077);\n\nvar graphic = __webpack_require__(5);\n\nvar ChartView = __webpack_require__(65);\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\nvar round = _number.round;\nvar linearMap = _number.linearMap;\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*/\nfunction parsePosition(seriesModel, api) {\n var center = seriesModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], api.getWidth());\n var cy = parsePercent(center[1], api.getHeight());\n var r = parsePercent(seriesModel.get('radius'), size / 2);\n return {\n cx: cx,\n cy: cy,\n r: r\n };\n}\n\nfunction formatLabel(label, labelFormatter) {\n if (labelFormatter) {\n if (typeof labelFormatter === 'string') {\n label = labelFormatter.replace('{value}', label != null ? label : '');\n } else if (typeof labelFormatter === 'function') {\n label = labelFormatter(label);\n }\n }\n\n return label;\n}\n\nvar PI2 = Math.PI * 2;\nvar GaugeView = ChartView.extend({\n type: 'gauge',\n render: function (seriesModel, ecModel, api) {\n this.group.removeAll();\n var colorList = seriesModel.get('axisLine.lineStyle.color');\n var posInfo = parsePosition(seriesModel, api);\n\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\n },\n dispose: function () {},\n _renderMain: function (seriesModel, ecModel, api, colorList, posInfo) {\n var group = this.group;\n var axisLineModel = seriesModel.getModel('axisLine');\n var lineStyleModel = axisLineModel.getModel('lineStyle');\n var clockwise = seriesModel.get('clockwise');\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\n var angleRangeSpan = (endAngle - startAngle) % PI2;\n var prevEndAngle = startAngle;\n var axisLineWidth = lineStyleModel.get('width');\n\n for (var i = 0; i < colorList.length; i++) {\n // Clamp\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\n var endAngle = startAngle + angleRangeSpan * percent;\n var sector = new graphic.Sector({\n shape: {\n startAngle: prevEndAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: posInfo.r - axisLineWidth,\n r: posInfo.r\n },\n silent: true\n });\n sector.setStyle({\n fill: colorList[i][1]\n });\n sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc\n // so the properties for stroking are useless\n ['color', 'borderWidth', 'borderColor']));\n group.add(sector);\n prevEndAngle = endAngle;\n }\n\n var getColor = function (percent) {\n // Less than 0\n if (percent <= 0) {\n return colorList[0][1];\n }\n\n for (var i = 0; i < colorList.length; i++) {\n if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\n return colorList[i][1];\n }\n } // More than 1\n\n\n return colorList[i - 1][1];\n };\n\n if (!clockwise) {\n var tmp = startAngle;\n startAngle = endAngle;\n endAngle = tmp;\n }\n\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise);\n\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise);\n\n this._renderTitle(seriesModel, ecModel, api, getColor, posInfo);\n\n this._renderDetail(seriesModel, ecModel, api, getColor, posInfo);\n },\n _renderTicks: function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise) {\n var group = this.group;\n var cx = posInfo.cx;\n var cy = posInfo.cy;\n var r = posInfo.r;\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var splitLineModel = seriesModel.getModel('splitLine');\n var tickModel = seriesModel.getModel('axisTick');\n var labelModel = seriesModel.getModel('axisLabel');\n var splitNumber = seriesModel.get('splitNumber');\n var subSplitNumber = tickModel.get('splitNumber');\n var splitLineLen = parsePercent(splitLineModel.get('length'), r);\n var tickLen = parsePercent(tickModel.get('length'), r);\n var angle = startAngle;\n var step = (endAngle - startAngle) / splitNumber;\n var subStep = step / subSplitNumber;\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\n\n for (var i = 0; i <= splitNumber; i++) {\n var unitX = Math.cos(angle);\n var unitY = Math.sin(angle); // Split line\n\n if (splitLineModel.get('show')) {\n var splitLine = new graphic.Line({\n shape: {\n x1: unitX * r + cx,\n y1: unitY * r + cy,\n x2: unitX * (r - splitLineLen) + cx,\n y2: unitY * (r - splitLineLen) + cy\n },\n style: splitLineStyle,\n silent: true\n });\n\n if (splitLineStyle.stroke === 'auto') {\n splitLine.setStyle({\n stroke: getColor(i / splitNumber)\n });\n }\n\n group.add(splitLine);\n } // Label\n\n\n if (labelModel.get('show')) {\n var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\n var distance = labelModel.get('distance');\n var autoColor = getColor(i / splitNumber);\n group.add(new graphic.Text({\n style: graphic.setTextStyle({}, labelModel, {\n text: label,\n x: unitX * (r - splitLineLen - distance) + cx,\n y: unitY * (r - splitLineLen - distance) + cy,\n textVerticalAlign: unitY < -0.4 ? 'top' : unitY > 0.4 ? 'bottom' : 'middle',\n textAlign: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center'\n }, {\n autoColor: autoColor\n }),\n silent: true\n }));\n } // Axis tick\n\n\n if (tickModel.get('show') && i !== splitNumber) {\n for (var j = 0; j <= subSplitNumber; j++) {\n var unitX = Math.cos(angle);\n var unitY = Math.sin(angle);\n var tickLine = new graphic.Line({\n shape: {\n x1: unitX * r + cx,\n y1: unitY * r + cy,\n x2: unitX * (r - tickLen) + cx,\n y2: unitY * (r - tickLen) + cy\n },\n silent: true,\n style: tickLineStyle\n });\n\n if (tickLineStyle.stroke === 'auto') {\n tickLine.setStyle({\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\n });\n }\n\n group.add(tickLine);\n angle += subStep;\n }\n\n angle -= subStep;\n } else {\n angle += step;\n }\n }\n },\n _renderPointer: function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise) {\n var group = this.group;\n var oldData = this._data;\n\n if (!seriesModel.get('pointer.show')) {\n // Remove old element\n oldData && oldData.eachItemGraphicEl(function (el) {\n group.remove(el);\n });\n return;\n }\n\n var valueExtent = [+seriesModel.get('min'), +seriesModel.get('max')];\n var angleExtent = [startAngle, endAngle];\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n data.diff(oldData).add(function (idx) {\n var pointer = new PointerPath({\n shape: {\n angle: startAngle\n }\n });\n graphic.initProps(pointer, {\n shape: {\n angle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true)\n }\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(idx, pointer);\n }).update(function (newIdx, oldIdx) {\n var pointer = oldData.getItemGraphicEl(oldIdx);\n graphic.updateProps(pointer, {\n shape: {\n angle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true)\n }\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(newIdx, pointer);\n }).remove(function (idx) {\n var pointer = oldData.getItemGraphicEl(idx);\n group.remove(pointer);\n }).execute();\n data.eachItemGraphicEl(function (pointer, idx) {\n var itemModel = data.getItemModel(idx);\n var pointerModel = itemModel.getModel('pointer');\n pointer.setShape({\n x: posInfo.cx,\n y: posInfo.cy,\n width: parsePercent(pointerModel.get('width'), posInfo.r),\n r: parsePercent(pointerModel.get('length'), posInfo.r)\n });\n pointer.useStyle(itemModel.getModel('itemStyle').getItemStyle());\n\n if (pointer.style.fill === 'auto') {\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\n }\n\n graphic.setHoverStyle(pointer, itemModel.getModel('emphasis.itemStyle').getItemStyle());\n });\n this._data = data;\n },\n _renderTitle: function (seriesModel, ecModel, api, getColor, posInfo) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var titleModel = seriesModel.getModel('title');\n\n if (titleModel.get('show')) {\n var offsetCenter = titleModel.get('offsetCenter');\n var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r);\n var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r);\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var value = seriesModel.getData().get(valueDim, 0);\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n this.group.add(new graphic.Text({\n silent: true,\n style: graphic.setTextStyle({}, titleModel, {\n x: x,\n y: y,\n // FIXME First data name ?\n text: data.getName(0),\n textAlign: 'center',\n textVerticalAlign: 'middle'\n }, {\n autoColor: autoColor,\n forceRich: true\n })\n }));\n }\n },\n _renderDetail: function (seriesModel, ecModel, api, getColor, posInfo) {\n var detailModel = seriesModel.getModel('detail');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n\n if (detailModel.get('show')) {\n var offsetCenter = detailModel.get('offsetCenter');\n var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r);\n var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r);\n var width = parsePercent(detailModel.get('width'), posInfo.r);\n var height = parsePercent(detailModel.get('height'), posInfo.r);\n var data = seriesModel.getData();\n var value = data.get(data.mapDimension('value'), 0);\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n this.group.add(new graphic.Text({\n silent: true,\n style: graphic.setTextStyle({}, detailModel, {\n x: x,\n y: y,\n text: formatLabel( // FIXME First data name ?\n value, detailModel.get('formatter')),\n textWidth: isNaN(width) ? null : width,\n textHeight: isNaN(height) ? null : height,\n textAlign: 'center',\n textVerticalAlign: 'middle'\n }, {\n autoColor: autoColor,\n forceRich: true\n })\n }));\n }\n }\n});\nvar _default = GaugeView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1077 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar Path = __webpack_require__(22);\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*/\nvar _default = Path.extend({\n type: 'echartsGaugePointer',\n shape: {\n angle: 0,\n width: 10,\n r: 10,\n x: 0,\n y: 0\n },\n buildPath: function (ctx, shape) {\n var mathCos = Math.cos;\n var mathSin = Math.sin;\n var r = shape.r;\n var width = shape.width;\n var angle = shape.angle;\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\n angle = shape.angle - Math.PI / 2;\n ctx.moveTo(x, y);\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\n ctx.lineTo(x, y);\n return;\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1078 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1079);\n\n__webpack_require__(1080);\n\n__webpack_require__(1089);\n\nvar categoryFilter = __webpack_require__(1082);\n\nvar visualSymbol = __webpack_require__(107);\n\nvar categoryVisual = __webpack_require__(1083);\n\nvar edgeVisual = __webpack_require__(1086);\n\nvar simpleLayout = __webpack_require__(1090);\n\nvar circularLayout = __webpack_require__(1084);\n\nvar forceLayout = __webpack_require__(1088);\n\nvar createView = __webpack_require__(1085);\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*/\necharts.registerProcessor(categoryFilter);\necharts.registerVisual(visualSymbol('graph', 'circle', null));\necharts.registerVisual(categoryVisual);\necharts.registerVisual(edgeVisual);\necharts.registerLayout(simpleLayout);\necharts.registerLayout(circularLayout);\necharts.registerLayout(forceLayout); // Graph view coordinate system\n\necharts.registerCoordinateSystem('graphView', {\n create: createView\n});\n\n/***/ }),\n/* 1079 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar List = __webpack_require__(49);\n\nvar zrUtil = __webpack_require__(0);\n\nvar _model = __webpack_require__(9);\n\nvar defaultEmphasis = _model.defaultEmphasis;\n\nvar Model = __webpack_require__(31);\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\n\nvar createGraphFromNodeEdge = __webpack_require__(360);\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*/\nvar GraphSeries = echarts.extendSeriesModel({\n type: 'series.graph',\n init: function (option) {\n GraphSeries.superApply(this, 'init', arguments); // Provide data for legend select\n\n this.legendDataProvider = function () {\n return this._categoriesData;\n };\n\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n },\n mergeOption: function (option) {\n GraphSeries.superApply(this, 'mergeOption', arguments);\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n },\n mergeDefaultAndTheme: function (option) {\n GraphSeries.superApply(this, 'mergeDefaultAndTheme', arguments);\n defaultEmphasis(option, ['edgeLabel'], ['show']);\n },\n getInitialData: function (option, ecModel) {\n var edges = option.edges || option.links || [];\n var nodes = option.data || option.nodes || [];\n var self = this;\n\n if (nodes && edges) {\n return createGraphFromNodeEdge(nodes, edges, this, true, beforeLink).data;\n }\n\n function beforeLink(nodeData, edgeData) {\n // Overwrite nodeData.getItemModel to\n nodeData.wrapMethod('getItemModel', function (model) {\n var categoriesModels = self._categoriesModels;\n var categoryIdx = model.getShallow('category');\n var categoryModel = categoriesModels[categoryIdx];\n\n if (categoryModel) {\n categoryModel.parentModel = model.parentModel;\n model.parentModel = categoryModel;\n }\n\n return model;\n });\n var edgeLabelModel = self.getModel('edgeLabel'); // For option `edgeLabel` can be found by label.xxx.xxx on item mode.\n\n var fakeSeriesModel = new Model({\n label: edgeLabelModel.option\n }, edgeLabelModel.parentModel, ecModel);\n var emphasisEdgeLabelModel = self.getModel('emphasis.edgeLabel');\n var emphasisFakeSeriesModel = new Model({\n emphasis: {\n label: emphasisEdgeLabelModel.option\n }\n }, emphasisEdgeLabelModel.parentModel, ecModel);\n edgeData.wrapMethod('getItemModel', function (model) {\n model.customizeGetParent(edgeGetParent);\n return model;\n });\n\n function edgeGetParent(path) {\n path = this.parsePath(path);\n return path && path[0] === 'label' ? fakeSeriesModel : path && path[0] === 'emphasis' && path[1] === 'label' ? emphasisFakeSeriesModel : this.parentModel;\n }\n }\n },\n\n /**\n * @return {module:echarts/data/Graph}\n */\n getGraph: function () {\n return this.getData().graph;\n },\n\n /**\n * @return {module:echarts/data/List}\n */\n getEdgeData: function () {\n return this.getGraph().edgeData;\n },\n\n /**\n * @return {module:echarts/data/List}\n */\n getCategoriesData: function () {\n return this._categoriesData;\n },\n\n /**\n * @override\n */\n formatTooltip: function (dataIndex, multipleSeries, dataType) {\n if (dataType === 'edge') {\n var nodeData = this.getData();\n var params = this.getDataParams(dataIndex, dataType);\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n var sourceName = nodeData.getName(edge.node1.dataIndex);\n var targetName = nodeData.getName(edge.node2.dataIndex);\n var html = [];\n sourceName != null && html.push(sourceName);\n targetName != null && html.push(targetName);\n html = encodeHTML(html.join(' > '));\n\n if (params.value) {\n html += ' : ' + encodeHTML(params.value);\n }\n\n return html;\n } else {\n // dataType === 'node' or empty\n return GraphSeries.superApply(this, 'formatTooltip', arguments);\n }\n },\n _updateCategoriesData: function () {\n var categories = zrUtil.map(this.option.categories || [], function (category) {\n // Data must has value\n return category.value != null ? category : zrUtil.extend({\n value: 0\n }, category);\n });\n var categoriesData = new List(['value'], this);\n categoriesData.initData(categories);\n this._categoriesData = categoriesData;\n this._categoriesModels = categoriesData.mapArray(function (idx) {\n return categoriesData.getItemModel(idx, true);\n });\n },\n setZoom: function (zoom) {\n this.option.zoom = zoom;\n },\n setCenter: function (center) {\n this.option.center = center;\n },\n isAnimationEnabled: function () {\n return GraphSeries.superCall(this, 'isAnimationEnabled') // Not enable animation when do force layout\n && !(this.get('layout') === 'force' && this.get('force.layoutAnimation'));\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // Default option for all coordinate systems\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // polarIndex: 0,\n // geoIndex: 0,\n legendHoverLink: true,\n hoverAnimation: true,\n layout: null,\n focusNodeAdjacency: false,\n // Configuration of circular layout\n circular: {\n rotateLabel: false\n },\n // Configuration of force directed layout\n force: {\n initLayout: null,\n // Node repulsion. Can be an array to represent range.\n repulsion: [0, 50],\n gravity: 0.1,\n // Edge length. Can be an array to represent range.\n edgeLength: 30,\n layoutAnimation: true\n },\n left: 'center',\n top: 'center',\n // right: null,\n // bottom: null,\n // width: '80%',\n // height: '80%',\n symbol: 'circle',\n symbolSize: 10,\n edgeSymbol: ['none', 'none'],\n edgeSymbolSize: 10,\n edgeLabel: {\n position: 'middle'\n },\n draggable: false,\n roam: false,\n // Default on center of graph\n center: null,\n zoom: 1,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.6,\n // cursor: null,\n // categories: [],\n // data: []\n // Or\n // nodes: []\n //\n // links: []\n // Or\n // edges: []\n label: {\n show: false,\n formatter: '{b}'\n },\n itemStyle: {},\n lineStyle: {\n color: '#aaa',\n width: 1,\n curveness: 0,\n opacity: 0.5\n },\n emphasis: {\n label: {\n show: true\n }\n }\n }\n});\nvar _default = GraphSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1080 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar SymbolDraw = __webpack_require__(138);\n\nvar LineDraw = __webpack_require__(247);\n\nvar RoamController = __webpack_require__(143);\n\nvar roamHelper = __webpack_require__(252);\n\nvar _cursorHelper = __webpack_require__(176);\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphic = __webpack_require__(5);\n\nvar adjustEdge = __webpack_require__(1081);\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*/\nvar FOCUS_ADJACENCY = '__focusNodeAdjacency';\nvar UNFOCUS_ADJACENCY = '__unfocusNodeAdjacency';\nvar nodeOpacityPath = ['itemStyle', 'opacity'];\nvar lineOpacityPath = ['lineStyle', 'opacity'];\n\nfunction getItemOpacity(item, opacityPath) {\n return item.getVisual('opacity') || item.getModel().get(opacityPath);\n}\n\nfunction fadeOutItem(item, opacityPath, opacityRatio) {\n var el = item.getGraphicEl();\n var opacity = getItemOpacity(item, opacityPath);\n\n if (opacityRatio != null) {\n opacity == null && (opacity = 1);\n opacity *= opacityRatio;\n }\n\n el.downplay && el.downplay();\n el.traverse(function (child) {\n if (child.type !== 'group') {\n var opct = child.lineLabelOriginalOpacity;\n\n if (opct == null || opacityRatio != null) {\n opct = opacity;\n }\n\n child.setStyle('opacity', opct);\n }\n });\n}\n\nfunction fadeInItem(item, opacityPath) {\n var opacity = getItemOpacity(item, opacityPath);\n var el = item.getGraphicEl();\n el.highlight && el.highlight();\n el.traverse(function (child) {\n if (child.type !== 'group') {\n child.setStyle('opacity', opacity);\n }\n });\n}\n\nvar _default = echarts.extendChartView({\n type: 'graph',\n init: function (ecModel, api) {\n var symbolDraw = new SymbolDraw();\n var lineDraw = new LineDraw();\n var group = this.group;\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n group.add(symbolDraw.group);\n group.add(lineDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineDraw = lineDraw;\n this._firstRender = true;\n },\n render: function (seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n this._model = seriesModel;\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n var symbolDraw = this._symbolDraw;\n var lineDraw = this._lineDraw;\n var group = this.group;\n\n if (coordSys.type === 'view') {\n var groupNewProp = {\n position: coordSys.position,\n scale: coordSys.scale\n };\n\n if (this._firstRender) {\n group.attr(groupNewProp);\n } else {\n graphic.updateProps(group, groupNewProp, seriesModel);\n }\n } // Fix edge contact point with node\n\n\n adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel));\n var data = seriesModel.getData();\n symbolDraw.updateData(data);\n var edgeData = seriesModel.getEdgeData();\n lineDraw.updateData(edgeData);\n\n this._updateNodeAndLinkScale();\n\n this._updateController(seriesModel, ecModel, api);\n\n clearTimeout(this._layoutTimeout);\n var forceLayout = seriesModel.forceLayout;\n var layoutAnimation = seriesModel.get('force.layoutAnimation');\n\n if (forceLayout) {\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\n }\n\n data.eachItemGraphicEl(function (el, idx) {\n var itemModel = data.getItemModel(idx); // Update draggable\n\n el.off('drag').off('dragend');\n var draggable = itemModel.get('draggable');\n\n if (draggable) {\n el.on('drag', function () {\n if (forceLayout) {\n forceLayout.warmUp();\n !this._layouting && this._startForceLayoutIteration(forceLayout, layoutAnimation);\n forceLayout.setFixed(idx); // Write position back to layout\n\n data.setItemLayout(idx, el.position);\n }\n }, this).on('dragend', function () {\n if (forceLayout) {\n forceLayout.setUnfixed(idx);\n }\n }, this);\n }\n\n el.setDraggable(draggable && forceLayout);\n el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]);\n el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]);\n\n if (itemModel.get('focusNodeAdjacency')) {\n el.on('mouseover', el[FOCUS_ADJACENCY] = function () {\n api.dispatchAction({\n type: 'focusNodeAdjacency',\n seriesId: seriesModel.id,\n dataIndex: el.dataIndex\n });\n });\n el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {\n api.dispatchAction({\n type: 'unfocusNodeAdjacency',\n seriesId: seriesModel.id\n });\n });\n }\n }, this);\n data.graph.eachEdge(function (edge) {\n var el = edge.getGraphicEl();\n el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]);\n el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]);\n\n if (edge.getModel().get('focusNodeAdjacency')) {\n el.on('mouseover', el[FOCUS_ADJACENCY] = function () {\n api.dispatchAction({\n type: 'focusNodeAdjacency',\n seriesId: seriesModel.id,\n edgeDataIndex: edge.dataIndex\n });\n });\n el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {\n api.dispatchAction({\n type: 'unfocusNodeAdjacency',\n seriesId: seriesModel.id\n });\n });\n }\n });\n var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get('circular.rotateLabel');\n var cx = data.getLayout('cx');\n var cy = data.getLayout('cy');\n data.eachItemGraphicEl(function (el, idx) {\n var symbolPath = el.getSymbolPath();\n\n if (circularRotateLabel) {\n var pos = data.getItemLayout(idx);\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n var isLeft = pos[0] < cx;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n symbolPath.setStyle({\n textRotation: -rad,\n textPosition: textPosition,\n textOrigin: 'center'\n });\n symbolPath.hoverStyle && (symbolPath.hoverStyle.textPosition = textPosition);\n } else {\n symbolPath.setStyle({\n textRotation: 0\n });\n }\n });\n this._firstRender = false;\n },\n dispose: function () {\n this._controller && this._controller.dispose();\n this._controllerHost = {};\n },\n focusNodeAdjacency: function (seriesModel, ecModel, api, payload) {\n var data = this._model.getData();\n\n var graph = data.graph;\n var dataIndex = payload.dataIndex;\n var edgeDataIndex = payload.edgeDataIndex;\n var node = graph.getNodeByIndex(dataIndex);\n var edge = graph.getEdgeByIndex(edgeDataIndex);\n\n if (!node && !edge) {\n return;\n }\n\n graph.eachNode(function (node) {\n fadeOutItem(node, nodeOpacityPath, 0.1);\n });\n graph.eachEdge(function (edge) {\n fadeOutItem(edge, lineOpacityPath, 0.1);\n });\n\n if (node) {\n fadeInItem(node, nodeOpacityPath);\n zrUtil.each(node.edges, function (adjacentEdge) {\n if (adjacentEdge.dataIndex < 0) {\n return;\n }\n\n fadeInItem(adjacentEdge, lineOpacityPath);\n fadeInItem(adjacentEdge.node1, nodeOpacityPath);\n fadeInItem(adjacentEdge.node2, nodeOpacityPath);\n });\n }\n\n if (edge) {\n fadeInItem(edge, lineOpacityPath);\n fadeInItem(edge.node1, nodeOpacityPath);\n fadeInItem(edge.node2, nodeOpacityPath);\n }\n },\n unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) {\n var graph = this._model.getData().graph;\n\n graph.eachNode(function (node) {\n fadeOutItem(node, nodeOpacityPath);\n });\n graph.eachEdge(function (edge) {\n fadeOutItem(edge, lineOpacityPath);\n });\n },\n _startForceLayoutIteration: function (forceLayout, layoutAnimation) {\n var self = this;\n\n (function step() {\n forceLayout.step(function (stopped) {\n self.updateLayout(self._model);\n (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step());\n });\n })();\n },\n _updateController: function (seriesModel, ecModel, api) {\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n\n if (seriesModel.coordinateSystem.type !== 'view') {\n controller.disable();\n return;\n }\n\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n this._updateNodeAndLinkScale();\n\n adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel));\n\n this._lineDraw.updateLayout();\n }, this);\n },\n _updateNodeAndLinkScale: function () {\n var seriesModel = this._model;\n var data = seriesModel.getData();\n\n var nodeScale = this._getNodeGlobalScale(seriesModel);\n\n var invScale = [nodeScale, nodeScale];\n data.eachItemGraphicEl(function (el, idx) {\n el.attr('scale', invScale);\n });\n },\n _getNodeGlobalScale: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = this._nodeScaleRatio;\n var groupScale = coordSys.scale;\n var groupZoom = groupScale && groupScale[0] || 1; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n },\n updateLayout: function (seriesModel) {\n adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel));\n\n this._symbolDraw.updateLayout();\n\n this._lineDraw.updateLayout();\n },\n remove: function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove();\n this._lineDraw && this._lineDraw.remove();\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1081 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar curveTool = __webpack_require__(82);\n\nvar vec2 = __webpack_require__(17);\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*/\nvar v1 = [];\nvar v2 = [];\nvar v3 = [];\nvar quadraticAt = curveTool.quadraticAt;\nvar v2DistSquare = vec2.distSquare;\nvar mathAbs = Math.abs;\n\nfunction intersectCurveCircle(curvePoints, center, radius) {\n var p0 = curvePoints[0];\n var p1 = curvePoints[1];\n var p2 = curvePoints[2];\n var d = Infinity;\n var t;\n var radiusSquare = radius * radius;\n var interval = 0.1;\n\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\n v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\n v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\n var diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\n\n if (diff < d) {\n d = diff;\n t = _t;\n }\n } // Assume the segment is monotone,Find root through Bisection method\n // At most 32 iteration\n\n\n for (var i = 0; i < 32; i++) {\n // var prev = t - interval;\n var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\n // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\n\n v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\n v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\n v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\n v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\n var diff = v2DistSquare(v2, center) - radiusSquare;\n\n if (mathAbs(diff) < 1e-2) {\n break;\n } // var prevDiff = v2DistSquare(v1, center) - radiusSquare;\n\n\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\n interval /= 2;\n\n if (diff < 0) {\n if (nextDiff >= 0) {\n t = t + interval;\n } else {\n t = t - interval;\n }\n } else {\n if (nextDiff >= 0) {\n t = t - interval;\n } else {\n t = t + interval;\n }\n }\n }\n\n return t;\n} // Adjust edge to avoid\n\n\nfunction _default(graph, scale) {\n var tmp0 = [];\n var quadraticSubdivide = curveTool.quadraticSubdivide;\n var pts = [[], [], []];\n var pts2 = [[], []];\n var v = [];\n scale /= 2;\n\n function getSymbolSize(node) {\n var symbolSize = node.getVisual('symbolSize');\n\n if (symbolSize instanceof Array) {\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\n }\n\n return symbolSize;\n }\n\n graph.eachEdge(function (edge, idx) {\n var linePoints = edge.getLayout();\n var fromSymbol = edge.getVisual('fromSymbol');\n var toSymbol = edge.getVisual('toSymbol');\n\n if (!linePoints.__original) {\n linePoints.__original = [vec2.clone(linePoints[0]), vec2.clone(linePoints[1])];\n\n if (linePoints[2]) {\n linePoints.__original.push(vec2.clone(linePoints[2]));\n }\n }\n\n var originalPoints = linePoints.__original; // Quadratic curve\n\n if (linePoints[2] != null) {\n vec2.copy(pts[0], originalPoints[0]);\n vec2.copy(pts[1], originalPoints[2]);\n vec2.copy(pts[2], originalPoints[1]);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); // Subdivide and get the second\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[0][0] = tmp0[3];\n pts[1][0] = tmp0[4];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[0][1] = tmp0[3];\n pts[1][1] = tmp0[4];\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); // Subdivide and get the first\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[1][0] = tmp0[1];\n pts[2][0] = tmp0[2];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[1][1] = tmp0[1];\n pts[2][1] = tmp0[2];\n } // Copy back to layout\n\n\n vec2.copy(linePoints[0], pts[0]);\n vec2.copy(linePoints[1], pts[2]);\n vec2.copy(linePoints[2], pts[1]);\n } // Line\n else {\n vec2.copy(pts2[0], originalPoints[0]);\n vec2.copy(pts2[1], originalPoints[1]);\n vec2.sub(v, pts2[1], pts2[0]);\n vec2.normalize(v, v);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\n }\n\n vec2.copy(linePoints[0], pts2[0]);\n vec2.copy(linePoints[1], pts2[1]);\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1082 */\n/***/ (function(module, exports) {\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*/\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*/\nfunction _default(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (typeof category === 'number') {\n category = categoryNames[category];\n } // If in any legend component the status is not selected.\n\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n\n return true;\n });\n }, this);\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1083 */\n/***/ (function(module, exports) {\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*/\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*/\nfunction _default(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype.\n\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(name, paletteScope);\n categoriesData.setItemVisual(idx, 'color', color);\n }); // Assign category color to visual\n\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (typeof category === 'string') {\n category = categoryNameIdxMap['ec-' + category];\n }\n\n if (!data.getItemVisual(idx, 'color', true)) {\n data.setItemVisual(idx, 'color', categoriesData.getItemVisual(category, 'color'));\n }\n }\n });\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1084 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _circularLayoutHelper = __webpack_require__(356);\n\nvar circularLayout = _circularLayoutHelper.circularLayout;\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*/\nfunction _default(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n if (seriesModel.get('layout') === 'circular') {\n circularLayout(seriesModel);\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1085 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar View = __webpack_require__(257);\n\nvar _layout = __webpack_require__(16);\n\nvar getLayoutRect = _layout.getLayoutRect;\n\nvar bbox = __webpack_require__(188);\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*/\n// FIXME Where to create the simple view coordinate system\nfunction getViewRect(seriesModel, api, aspect) {\n var option = seriesModel.getBoxLayoutParams();\n option.aspect = aspect;\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction _default(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n\n if (!coordSysType || coordSysType === 'view') {\n var data = seriesModel.getData();\n var positions = data.mapArray(function (idx) {\n var itemModel = data.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max); // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n\n var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed?\n\n var viewRect = getViewRect(seriesModel, api, aspect); // Position may be NaN, use view rect instead\n\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); // Update roam info\n\n viewCoordSys.setCenter(seriesModel.get('center'));\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1086 */\n/***/ (function(module, exports) {\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*/\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*/\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nfunction _default(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var edgeData = seriesModel.getEdgeData();\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize'));\n var colorQuery = 'lineStyle.color'.split('.');\n var opacityQuery = 'lineStyle.opacity'.split('.');\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n edgeData.setVisual('color', seriesModel.get(colorQuery));\n edgeData.setVisual('opacity', seriesModel.get(opacityQuery));\n edgeData.each(function (idx) {\n var itemModel = edgeData.getItemModel(idx);\n var edge = graph.getEdgeByIndex(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual\n\n var color = itemModel.get(colorQuery);\n var opacity = itemModel.get(opacityQuery);\n\n switch (color) {\n case 'source':\n color = edge.node1.getVisual('color');\n break;\n\n case 'target':\n color = edge.node2.getVisual('color');\n break;\n }\n\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\n edge.setVisual('color', color);\n edge.setVisual('opacity', opacity);\n });\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1087 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar vec2 = __webpack_require__(17);\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*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* Some formulas were originally copied from \"d3.js\" with some\n* modifications made for this project.\n* (See more details in the comment of the method \"step\" 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*/\nvar scaleAndAdd = vec2.scaleAndAdd; // function adjacentNode(n, e) {\n// return e.n1 === n ? e.n2 : e.n1;\n// }\n\nfunction forceLayout(nodes, edges, opts) {\n var rect = opts.rect;\n var width = rect.width;\n var height = rect.height;\n var center = [rect.x + width / 2, rect.y + height / 2]; // var scale = opts.scale || 1;\n\n var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (var i = 0; i < edges.length; i++) {\n // var e = edges[i];\n // var n1 = e.n1;\n // var n2 = e.n2;\n // n1.edges = n1.edges || [];\n // n2.edges = n2.edges || [];\n // n1.edges.push(e);\n // n2.edges.push(e);\n // }\n // Init position\n\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n\n if (!n.p) {\n n.p = vec2.create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\n }\n\n n.pp = vec2.clone(n.p);\n n.edges = null;\n } // Formula in 'Graph Drawing by Force-directed Placement'\n // var k = scale * Math.sqrt(width * height / nodes.length);\n // var k2 = k * k;\n\n\n var friction = 0.6;\n return {\n warmUp: function () {\n friction = 0.5;\n },\n setFixed: function (idx) {\n nodes[idx].fixed = true;\n },\n setUnfixed: function (idx) {\n nodes[idx].fixed = false;\n },\n\n /**\n * Some formulas were originally copied from \"d3.js\"\n * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\n * with some modifications made for this project.\n * See the license statement at the head of this file.\n */\n step: function (cb) {\n var v12 = [];\n var nLen = nodes.length;\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var n1 = e.n1;\n var n2 = e.n2;\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12) - e.d;\n var w = n2.w / (n1.w + n2.w);\n\n if (isNaN(w)) {\n w = 0;\n }\n\n vec2.normalize(v12, v12);\n !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\n !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\n } // Gravity\n\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v12, center, n.p); // var d = vec2.len(v12);\n // vec2.scale(v12, v12, 1 / d);\n // var gravityFactor = gravity;\n\n scaleAndAdd(n.p, n.p, v12, gravity * friction);\n }\n } // Repulsive\n // PENDING\n\n\n for (var i = 0; i < nLen; i++) {\n var n1 = nodes[i];\n\n for (var j = i + 1; j < nLen; j++) {\n var n2 = nodes[j];\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12);\n\n if (d === 0) {\n // Random repulse\n vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\n d = 1;\n }\n\n var repFact = (n1.rep + n2.rep) / d / d;\n !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\n !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\n }\n }\n\n var v = [];\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v, n.p, n.pp);\n scaleAndAdd(n.p, n.p, v, friction);\n vec2.copy(n.pp, n.p);\n }\n }\n\n friction = friction * 0.992;\n cb && cb(nodes, edges, friction < 0.01);\n }\n };\n}\n\nexports.forceLayout = forceLayout;\n\n/***/ }),\n/* 1088 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _forceHelper = __webpack_require__(1087);\n\nvar forceLayout = _forceHelper.forceLayout;\n\nvar _simpleLayoutHelper = __webpack_require__(357);\n\nvar simpleLayout = _simpleLayoutHelper.simpleLayout;\n\nvar _circularLayoutHelper = __webpack_require__(356);\n\nvar circularLayout = _circularLayoutHelper.circularLayout;\n\nvar _number = __webpack_require__(8);\n\nvar linearMap = _number.linearMap;\n\nvar vec2 = __webpack_require__(17);\n\nvar zrUtil = __webpack_require__(0);\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*/\nfunction _default(ecModel) {\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var coordSys = graphSeries.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n if (graphSeries.get('layout') === 'force') {\n var preservedPoints = graphSeries.preservedPoints || {};\n var graph = graphSeries.getGraph();\n var nodeData = graph.data;\n var edgeData = graph.edgeData;\n var forceModel = graphSeries.getModel('force');\n var initLayout = forceModel.get('initLayout');\n\n if (graphSeries.preservedPoints) {\n nodeData.each(function (idx) {\n var id = nodeData.getId(idx);\n nodeData.setItemLayout(idx, preservedPoints[id] || [NaN, NaN]);\n });\n } else if (!initLayout || initLayout === 'none') {\n simpleLayout(graphSeries);\n } else if (initLayout === 'circular') {\n circularLayout(graphSeries);\n }\n\n var nodeDataExtent = nodeData.getDataExtent('value');\n var edgeDataExtent = edgeData.getDataExtent('value'); // var edgeDataExtent = edgeData.getDataExtent('value');\n\n var repulsion = forceModel.get('repulsion');\n var edgeLength = forceModel.get('edgeLength');\n\n if (!zrUtil.isArray(repulsion)) {\n repulsion = [repulsion, repulsion];\n }\n\n if (!zrUtil.isArray(edgeLength)) {\n edgeLength = [edgeLength, edgeLength];\n } // Larger value has smaller length\n\n\n edgeLength = [edgeLength[1], edgeLength[0]];\n var nodes = nodeData.mapArray('value', function (value, idx) {\n var point = nodeData.getItemLayout(idx);\n var rep = linearMap(value, nodeDataExtent, repulsion);\n\n if (isNaN(rep)) {\n rep = (repulsion[0] + repulsion[1]) / 2;\n }\n\n return {\n w: rep,\n rep: rep,\n fixed: nodeData.getItemModel(idx).get('fixed'),\n p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point\n };\n });\n var edges = edgeData.mapArray('value', function (value, idx) {\n var edge = graph.getEdgeByIndex(idx);\n var d = linearMap(value, edgeDataExtent, edgeLength);\n\n if (isNaN(d)) {\n d = (edgeLength[0] + edgeLength[1]) / 2;\n }\n\n return {\n n1: nodes[edge.node1.dataIndex],\n n2: nodes[edge.node2.dataIndex],\n d: d,\n curveness: edge.getModel().get('lineStyle.curveness') || 0\n };\n });\n var coordSys = graphSeries.coordinateSystem;\n var rect = coordSys.getBoundingRect();\n var forceInstance = forceLayout(nodes, edges, {\n rect: rect,\n gravity: forceModel.get('gravity')\n });\n var oldStep = forceInstance.step;\n\n forceInstance.step = function (cb) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i].fixed) {\n // Write back to layout instance\n vec2.copy(nodes[i].p, graph.getNodeByIndex(i).getLayout());\n }\n }\n\n oldStep(function (nodes, edges, stopped) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (!nodes[i].fixed) {\n graph.getNodeByIndex(i).setLayout(nodes[i].p);\n }\n\n preservedPoints[nodeData.getId(i)] = nodes[i].p;\n }\n\n for (var i = 0, l = edges.length; i < l; i++) {\n var e = edges[i];\n var edge = graph.getEdgeByIndex(i);\n var p1 = e.n1.p;\n var p2 = e.n2.p;\n var points = edge.getLayout();\n points = points ? points.slice() : [];\n points[0] = points[0] || [];\n points[1] = points[1] || [];\n vec2.copy(points[0], p1);\n vec2.copy(points[1], p2);\n\n if (+e.curveness) {\n points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness];\n }\n\n edge.setLayout(points);\n } // Update layout\n\n\n cb && cb(stopped);\n });\n };\n\n graphSeries.forceLayout = forceInstance;\n graphSeries.preservedPoints = preservedPoints; // Step to get the layout\n\n forceInstance.step();\n } else {\n // Remove prev injected forceLayout instance\n graphSeries.forceLayout = null;\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1089 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar _roamHelper = __webpack_require__(245);\n\nvar updateCenterAndZoom = _roamHelper.updateCenterAndZoom;\n\n__webpack_require__(361);\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*/\nvar actionInfo = {\n type: 'graphRoam',\n event: 'graphRoam',\n update: 'none'\n};\n/**\n * @payload\n * @property {string} name Series name\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\n\necharts.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n});\n\n/***/ }),\n/* 1090 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _util = __webpack_require__(0);\n\nvar each = _util.each;\n\nvar _simpleLayoutHelper = __webpack_require__(357);\n\nvar simpleLayout = _simpleLayoutHelper.simpleLayout;\nvar simpleLayoutEdge = _simpleLayoutHelper.simpleLayoutEdge;\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*/\nfunction _default(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data = seriesModel.getData();\n var dimensions = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions = dimensions.concat(data.mapDimension(coordDim, true));\n });\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions.length; i++) {\n var val = data.get(dimensions[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.}, not undefined to avoid if...else... statement\n data.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data.graph);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1091 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\n__webpack_require__(1093);\n\n__webpack_require__(1094);\n\n/***/ }),\n/* 1092 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\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*/\n\n/* global Uint8ClampedArray */\n\n/**\n * @file defines echarts Heatmap Chart\n * @author Ovilia (me@zhangwenli.com)\n * Inspired by https://github.com/mourner/simpleheat\n *\n * @module\n */\nvar GRADIENT_LEVELS = 256;\n/**\n * Heatmap Chart\n *\n * @class\n */\n\nfunction Heatmap() {\n var canvas = zrUtil.createCanvas();\n this.canvas = canvas;\n this.blurSize = 30;\n this.pointSize = 20;\n this.maxOpacity = 1;\n this.minOpacity = 0;\n this._gradientPixels = {};\n}\n\nHeatmap.prototype = {\n /**\n * Renders Heatmap and returns the rendered canvas\n * @param {Array} data array of data, each has x, y, value\n * @param {number} width canvas width\n * @param {number} height canvas height\n */\n update: function (data, width, height, normalize, colorFunc, isInRange) {\n var brush = this._getBrush();\n\n var gradientInRange = this._getGradient(data, colorFunc, 'inRange');\n\n var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange');\n\n var r = this.pointSize + this.blurSize;\n var canvas = this.canvas;\n var ctx = canvas.getContext('2d');\n var len = data.length;\n canvas.width = width;\n canvas.height = height;\n\n for (var i = 0; i < len; ++i) {\n var p = data[i];\n var x = p[0];\n var y = p[1];\n var value = p[2]; // calculate alpha using value\n\n var alpha = normalize(value); // draw with the circle brush with alpha\n\n ctx.globalAlpha = alpha;\n ctx.drawImage(brush, x - r, y - r);\n }\n\n if (!canvas.width || !canvas.height) {\n // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\n // 'CanvasRenderingContext2D': The source height is 0.\"\n return canvas;\n } // colorize the canvas using alpha value and set with gradient\n\n\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n var pixels = imageData.data;\n var offset = 0;\n var pixelLen = pixels.length;\n var minOpacity = this.minOpacity;\n var maxOpacity = this.maxOpacity;\n var diffOpacity = maxOpacity - minOpacity;\n\n while (offset < pixelLen) {\n var alpha = pixels[offset + 3] / 256;\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data\n\n if (alpha > 0) {\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\n\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\n pixels[offset++] = gradient[gradientOffset];\n pixels[offset++] = gradient[gradientOffset + 1];\n pixels[offset++] = gradient[gradientOffset + 2];\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\n } else {\n offset += 4;\n }\n }\n\n ctx.putImageData(imageData, 0, 0);\n return canvas;\n },\n\n /**\n * get canvas of a black circle brush used for canvas to draw later\n * @private\n * @returns {Object} circle brush canvas\n */\n _getBrush: function () {\n var brushCanvas = this._brushCanvas || (this._brushCanvas = zrUtil.createCanvas()); // set brush size\n\n var r = this.pointSize + this.blurSize;\n var d = r * 2;\n brushCanvas.width = d;\n brushCanvas.height = d;\n var ctx = brushCanvas.getContext('2d');\n ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle,\n // draw the distinct circle in an invisible place,\n // and use shadowOffset to draw shadow in the center of the canvas\n\n ctx.shadowOffsetX = d;\n ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate\n // color in color map\n\n ctx.shadowColor = '#000'; // draw circle in the left to the canvas\n\n ctx.beginPath();\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n return brushCanvas;\n },\n\n /**\n * get gradient color map\n * @private\n */\n _getGradient: function (data, colorFunc, state) {\n var gradientPixels = this._gradientPixels;\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\n var color = [0, 0, 0, 0];\n var off = 0;\n\n for (var i = 0; i < 256; i++) {\n colorFunc[state](i / 255, true, color);\n pixelsSingleState[off++] = color[0];\n pixelsSingleState[off++] = color[1];\n pixelsSingleState[off++] = color[2];\n pixelsSingleState[off++] = color[3];\n }\n\n return pixelsSingleState;\n }\n};\nvar _default = Heatmap;\nmodule.exports = _default;\n\n/***/ }),\n/* 1093 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar SeriesModel = __webpack_require__(30);\n\nvar createListFromArray = __webpack_require__(70);\n\nvar CoordinateSystem = __webpack_require__(57);\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*/\nvar _default = SeriesModel.extend({\n type: 'series.heatmap',\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this, {\n generateCoord: 'value'\n });\n },\n preventIncremental: function () {\n var coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\n\n if (coordSysCreator && coordSysCreator.dimensions) {\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\n }\n },\n defaultOption: {\n // Cartesian2D or geo\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Geo coordinate system\n geoIndex: 0,\n blurSize: 30,\n pointSize: 20,\n maxOpacity: 1,\n minOpacity: 0\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1094 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar echarts = __webpack_require__(3);\n\nvar graphic = __webpack_require__(5);\n\nvar HeatmapLayer = __webpack_require__(1092);\n\nvar zrUtil = __webpack_require__(0);\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*/\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n // Try to find in the location of the last found\n for (var i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (var i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}\n\nfunction getIsInContinuousRange(dataExtent, range) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan];\n return function (val) {\n return val >= range[0] && val <= range[1];\n };\n}\n\nfunction isGeoCoordSys(coordSys) {\n var dimensions = coordSys.dimensions; // Not use coorSys.type === 'geo' because coordSys maybe extended\n\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\n}\n\nvar _default = echarts.extendChartView({\n type: 'heatmap',\n render: function (seriesModel, ecModel, api) {\n var visualMapOfThisSeries;\n ecModel.eachComponent('visualMap', function (visualMap) {\n visualMap.eachTargetSeries(function (targetSeries) {\n if (targetSeries === seriesModel) {\n visualMapOfThisSeries = visualMap;\n }\n });\n });\n this.group.removeAll();\n this._incrementalDisplayable = null;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\n } else if (isGeoCoordSys(coordSys)) {\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\n }\n },\n incrementalPrepareRender: function (seriesModel, ecModel, api) {\n this.group.removeAll();\n },\n incrementalRender: function (params, seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys) {\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\n }\n },\n _renderOnCartesianAndCalendar: function (seriesModel, api, start, end, incremental) {\n var coordSys = seriesModel.coordinateSystem;\n var width;\n var height;\n\n if (coordSys.type === 'cartesian2d') {\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n width = xAxis.getBandWidth();\n height = yAxis.getBandWidth();\n }\n\n var group = this.group;\n var data = seriesModel.getData();\n var itemStyleQuery = 'itemStyle';\n var hoverItemStyleQuery = 'emphasis.itemStyle';\n var labelQuery = 'label';\n var hoverLabelQuery = 'emphasis.label';\n var style = seriesModel.getModel(itemStyleQuery).getItemStyle(['color']);\n var hoverStl = seriesModel.getModel(hoverItemStyleQuery).getItemStyle();\n var labelModel = seriesModel.getModel(labelQuery);\n var hoverLabelModel = seriesModel.getModel(hoverLabelQuery);\n var coordSysType = coordSys.type;\n var dataDims = coordSysType === 'cartesian2d' ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')];\n\n for (var idx = start; idx < end; idx++) {\n var rect;\n\n if (coordSysType === 'cartesian2d') {\n // Ignore empty data\n if (isNaN(data.get(dataDims[2], idx))) {\n continue;\n }\n\n var point = coordSys.dataToPoint([data.get(dataDims[0], idx), data.get(dataDims[1], idx)]);\n rect = new graphic.Rect({\n shape: {\n x: point[0] - width / 2,\n y: point[1] - height / 2,\n width: width,\n height: height\n },\n style: {\n fill: data.getItemVisual(idx, 'color'),\n opacity: data.getItemVisual(idx, 'opacity')\n }\n });\n } else {\n // Ignore empty data\n if (isNaN(data.get(dataDims[1], idx))) {\n continue;\n }\n\n rect = new graphic.Rect({\n z2: 1,\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\n style: {\n fill: data.getItemVisual(idx, 'color'),\n opacity: data.getItemVisual(idx, 'opacity')\n }\n });\n }\n\n var itemModel = data.getItemModel(idx); // Optimization for large datset\n\n if (data.hasItemOption) {\n style = itemModel.getModel(itemStyleQuery).getItemStyle(['color']);\n hoverStl = itemModel.getModel(hoverItemStyleQuery).getItemStyle();\n labelModel = itemModel.getModel(labelQuery);\n hoverLabelModel = itemModel.getModel(hoverLabelQuery);\n }\n\n var rawValue = seriesModel.getRawValue(idx);\n var defaultText = '-';\n\n if (rawValue && rawValue[2] != null) {\n defaultText = rawValue[2];\n }\n\n graphic.setLabelStyle(style, hoverStl, labelModel, hoverLabelModel, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultText: defaultText,\n isRectText: true\n });\n rect.setStyle(style);\n graphic.setHoverStyle(rect, data.hasItemOption ? hoverStl : zrUtil.extend({}, hoverStl));\n rect.incremental = incremental; // PENDING\n\n if (incremental) {\n // Rect must use hover layer if it's incremental.\n rect.useHoverLayer = true;\n }\n\n group.add(rect);\n data.setItemGraphicEl(idx, rect);\n }\n },\n _renderOnGeo: function (geo, seriesModel, visualMapModel, api) {\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) {\n // throw new Error('Data range must have color visuals');\n // }\n\n var data = seriesModel.getData();\n var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();\n hmLayer.blurSize = seriesModel.get('blurSize');\n hmLayer.pointSize = seriesModel.get('pointSize');\n hmLayer.minOpacity = seriesModel.get('minOpacity');\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\n var rect = geo.getViewRect().clone();\n var roamTransform = geo.getRoamTransform();\n rect.applyTransform(roamTransform); // Clamp on viewport\n\n var x = Math.max(rect.x, 0);\n var y = Math.max(rect.y, 0);\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\n var width = x2 - x;\n var height = y2 - y;\n var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')];\n var points = data.mapArray(dims, function (lng, lat, value) {\n var pt = geo.dataToPoint([lng, lat]);\n pt[0] -= x;\n pt[1] -= y;\n pt.push(value);\n return pt;\n });\n var dataExtent = visualMapModel.getExtent();\n var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\n inRange: inRangeVisuals.color.getColorMapper(),\n outOfRange: outOfRangeVisuals.color.getColorMapper()\n }, isInRange);\n var img = new graphic.Image({\n style: {\n width: width,\n height: height,\n x: x,\n y: y,\n image: hmLayer.canvas\n },\n silent: true\n });\n this.group.add(img);\n },\n dispose: function () {}\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1095 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar Polyline = __webpack_require__(359);\n\nvar zrUtil = __webpack_require__(0);\n\nvar EffectLine = __webpack_require__(358);\n\nvar vec2 = __webpack_require__(17);\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*/\n\n/**\n * Provide effect for line\n * @module echarts/chart/helper/EffectLine\n */\n\n/**\n * @constructor\n * @extends {module:echarts/chart/helper/EffectLine}\n * @alias {module:echarts/chart/helper/Polyline}\n */\nfunction EffectPolyline(lineData, idx, seriesScope) {\n EffectLine.call(this, lineData, idx, seriesScope);\n this._lastFrame = 0;\n this._lastFramePercent = 0;\n}\n\nvar effectPolylineProto = EffectPolyline.prototype; // Overwrite\n\neffectPolylineProto.createLine = function (lineData, idx, seriesScope) {\n return new Polyline(lineData, idx, seriesScope);\n}; // Overwrite\n\n\neffectPolylineProto.updateAnimationPoints = function (symbol, points) {\n this._points = points;\n var accLenArr = [0];\n var len = 0;\n\n for (var i = 1; i < points.length; i++) {\n var p1 = points[i - 1];\n var p2 = points[i];\n len += vec2.dist(p1, p2);\n accLenArr.push(len);\n }\n\n if (len === 0) {\n return;\n }\n\n for (var i = 0; i < accLenArr.length; i++) {\n accLenArr[i] /= len;\n }\n\n this._offsets = accLenArr;\n this._length = len;\n}; // Overwrite\n\n\neffectPolylineProto.getLineLength = function (symbol) {\n return this._length;\n}; // Overwrite\n\n\neffectPolylineProto.updateSymbolPosition = function (symbol) {\n var t = symbol.__t;\n var points = this._points;\n var offsets = this._offsets;\n var len = points.length;\n\n if (!offsets) {\n // Has length 0\n return;\n }\n\n var lastFrame = this._lastFrame;\n var frame;\n\n if (t < this._lastFramePercent) {\n // Start from the next frame\n // PENDING start from lastFrame ?\n var start = Math.min(lastFrame + 1, len - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (offsets[frame] <= t) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, len - 2);\n } else {\n for (var frame = lastFrame; frame < len; frame++) {\n if (offsets[frame] > t) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, len - 2);\n }\n\n vec2.lerp(symbol.position, points[frame], points[frame + 1], (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]));\n var tx = points[frame + 1][0] - points[frame][0];\n var ty = points[frame + 1][1] - points[frame][1];\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n this._lastFrame = frame;\n this._lastFramePercent = t;\n symbol.ignore = false;\n};\n\nzrUtil.inherits(EffectPolyline, EffectLine);\nvar _default = EffectPolyline;\nmodule.exports = _default;\n\n/***/ }),\n/* 1096 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar _symbol = __webpack_require__(50);\n\nvar createSymbol = _symbol.createSymbol;\n\nvar _graphic = __webpack_require__(5);\n\nvar Group = _graphic.Group;\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\n\nvar SymbolClz = __webpack_require__(173);\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*/\n\n/**\n * Symbol with ripple effect\n * @module echarts/chart/helper/EffectSymbol\n */\nvar EFFECT_RIPPLE_NUMBER = 3;\n\nfunction normalizeSymbolSize(symbolSize) {\n if (!zrUtil.isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return symbolSize;\n}\n\nfunction updateRipplePath(rippleGroup, effectCfg) {\n rippleGroup.eachChild(function (ripplePath) {\n ripplePath.attr({\n z: effectCfg.z,\n zlevel: effectCfg.zlevel,\n style: {\n stroke: effectCfg.brushType === 'stroke' ? effectCfg.color : null,\n fill: effectCfg.brushType === 'fill' ? effectCfg.color : null\n }\n });\n });\n}\n/**\n * @constructor\n * @param {module:echarts/data/List} data\n * @param {number} idx\n * @extends {module:zrender/graphic/Group}\n */\n\n\nfunction EffectSymbol(data, idx) {\n Group.call(this);\n var symbol = new SymbolClz(data, idx);\n var rippleGroup = new Group();\n this.add(symbol);\n this.add(rippleGroup);\n\n rippleGroup.beforeUpdate = function () {\n this.attr(symbol.getScale());\n };\n\n this.updateData(data, idx);\n}\n\nvar effectSymbolProto = EffectSymbol.prototype;\n\neffectSymbolProto.stopEffectAnimation = function () {\n this.childAt(1).removeAll();\n};\n\neffectSymbolProto.startEffectAnimation = function (effectCfg) {\n var symbolType = effectCfg.symbolType;\n var color = effectCfg.color;\n var rippleGroup = this.childAt(1);\n\n for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {\n // var ripplePath = 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 #4136.\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\n ripplePath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 99,\n silent: true,\n scale: [0.5, 0.5]\n });\n var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset; // TODO Configurable effectCfg.period\n\n ripplePath.animate('', true).when(effectCfg.period, {\n scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2]\n }).delay(delay).start();\n ripplePath.animateStyle(true).when(effectCfg.period, {\n opacity: 0\n }).delay(delay).start();\n rippleGroup.add(ripplePath);\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n};\n/**\n * Update effect symbol\n */\n\n\neffectSymbolProto.updateEffectAnimation = function (effectCfg) {\n var oldEffectCfg = this._effectCfg;\n var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed\n\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale'];\n\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\n var propName = DIFFICULT_PROPS[i];\n\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\n this.stopEffectAnimation();\n this.startEffectAnimation(effectCfg);\n return;\n }\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n};\n/**\n * Highlight symbol\n */\n\n\neffectSymbolProto.highlight = function () {\n this.trigger('emphasis');\n};\n/**\n * Downplay symbol\n */\n\n\neffectSymbolProto.downplay = function () {\n this.trigger('normal');\n};\n/**\n * Update symbol properties\n * @param {module:echarts/data/List} data\n * @param {number} idx\n */\n\n\neffectSymbolProto.updateData = function (data, idx) {\n var seriesModel = data.hostModel;\n this.childAt(0).updateData(data, idx);\n var rippleGroup = this.childAt(1);\n var itemModel = data.getItemModel(idx);\n var symbolType = data.getItemVisual(idx, 'symbol');\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var color = data.getItemVisual(idx, 'color');\n rippleGroup.attr('scale', symbolSize);\n rippleGroup.traverse(function (ripplePath) {\n ripplePath.attr({\n fill: color\n });\n });\n var symbolOffset = itemModel.getShallow('symbolOffset');\n\n if (symbolOffset) {\n var pos = rippleGroup.position;\n pos[0] = parsePercent(symbolOffset[0], symbolSize[0]);\n pos[1] = parsePercent(symbolOffset[1], symbolSize[1]);\n }\n\n rippleGroup.rotation = (itemModel.getShallow('symbolRotate') || 0) * Math.PI / 180 || 0;\n var effectCfg = {};\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\n effectCfg.rippleScale = itemModel.get('rippleEffect.scale');\n effectCfg.brushType = itemModel.get('rippleEffect.brushType');\n effectCfg.period = itemModel.get('rippleEffect.period') * 1000;\n effectCfg.effectOffset = idx / data.count();\n effectCfg.z = itemModel.getShallow('z') || 0;\n effectCfg.zlevel = itemModel.getShallow('zlevel') || 0;\n effectCfg.symbolType = symbolType;\n effectCfg.color = color;\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\n\n if (effectCfg.showEffectOn === 'render') {\n this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);\n this._effectCfg = effectCfg;\n } else {\n // Not keep old effect config\n this._effectCfg = null;\n this.stopEffectAnimation();\n var symbol = this.childAt(0);\n\n var onEmphasis = function () {\n symbol.highlight();\n\n if (effectCfg.showEffectOn !== 'render') {\n this.startEffectAnimation(effectCfg);\n }\n };\n\n var onNormal = function () {\n symbol.downplay();\n\n if (effectCfg.showEffectOn !== 'render') {\n this.stopEffectAnimation();\n }\n };\n\n this.on('mouseover', onEmphasis, this).on('mouseout', onNormal, this).on('emphasis', onEmphasis, this).on('normal', onNormal, this);\n }\n\n this._effectCfg = effectCfg;\n};\n\neffectSymbolProto.fadeOut = function (cb) {\n this.off('mouseover').off('mouseout').off('emphasis').off('normal');\n cb && cb();\n};\n\nzrUtil.inherits(EffectSymbol, Group);\nvar _default = EffectSymbol;\nmodule.exports = _default;\n\n/***/ }),\n/* 1097 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar IncrementalDisplayable = __webpack_require__(273);\n\nvar lineContain = __webpack_require__(551);\n\nvar quadraticContain = __webpack_require__(553);\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*/\n// TODO Batch by color\nvar LargeLineShape = graphic.extendShape({\n shape: {\n polyline: false,\n curveness: 0,\n segs: []\n },\n buildPath: function (path, shape) {\n var segs = shape.segs;\n var curveness = shape.curveness;\n\n if (shape.polyline) {\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n path.moveTo(segs[i++], segs[i++]);\n\n for (var k = 1; k < count; k++) {\n path.lineTo(segs[i++], segs[i++]);\n }\n }\n }\n } else {\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n path.moveTo(x0, y0);\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n path.quadraticCurveTo(x2, y2, x1, y1);\n } else {\n path.lineTo(x1, y1);\n }\n }\n }\n },\n findDataIndex: function (x, y) {\n var shape = this.shape;\n var segs = shape.segs;\n var curveness = shape.curveness;\n\n if (shape.polyline) {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n\n for (var k = 1; k < count; k++) {\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (lineContain.containStroke(x0, y0, x1, y1)) {\n return dataIndex;\n }\n }\n }\n\n dataIndex++;\n }\n } else {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n\n if (quadraticContain.containStroke(x0, y0, x2, y2, x1, y1)) {\n return dataIndex;\n }\n } else {\n if (lineContain.containStroke(x0, y0, x1, y1)) {\n return dataIndex;\n }\n }\n\n dataIndex++;\n }\n }\n\n return -1;\n }\n});\n\nfunction LargeLineDraw() {\n this.group = new graphic.Group();\n}\n\nvar largeLineProto = LargeLineDraw.prototype;\n\nlargeLineProto.isPersistent = function () {\n return !this._incremental;\n};\n/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n */\n\n\nlargeLineProto.updateData = function (data) {\n this.group.removeAll();\n var lineEl = new LargeLineShape({\n rectHover: true,\n cursor: 'default'\n });\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n\n this._setCommon(lineEl, data); // Add back\n\n\n this.group.add(lineEl);\n this._incremental = null;\n};\n/**\n * @override\n */\n\n\nlargeLineProto.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n\n this._clearIncremental();\n\n if (data.count() > 5e5) {\n if (!this._incremental) {\n this._incremental = new IncrementalDisplayable({\n silent: true\n });\n }\n\n this.group.add(this._incremental);\n } else {\n this._incremental = null;\n }\n};\n/**\n * @override\n */\n\n\nlargeLineProto.incrementalUpdate = function (taskParams, data) {\n var lineEl = new LargeLineShape();\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n\n this._setCommon(lineEl, data, !!this._incremental);\n\n if (!this._incremental) {\n lineEl.rectHover = true;\n lineEl.cursor = 'default';\n lineEl.__startIndex = taskParams.start;\n this.group.add(lineEl);\n } else {\n this._incremental.addDisplayable(lineEl, true);\n }\n};\n/**\n * @override\n */\n\n\nlargeLineProto.remove = function () {\n this._clearIncremental();\n\n this._incremental = null;\n this.group.removeAll();\n};\n\nlargeLineProto._setCommon = function (lineEl, data, isIncremental) {\n var hostModel = data.hostModel;\n lineEl.setShape({\n polyline: hostModel.get('polyline'),\n curveness: hostModel.get('lineStyle.curveness')\n });\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\n lineEl.style.strokeNoScale = true;\n var visualColor = data.getVisual('color');\n\n if (visualColor) {\n lineEl.setStyle('stroke', visualColor);\n }\n\n lineEl.setStyle('fill');\n\n if (!isIncremental) {\n // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n lineEl.seriesIndex = hostModel.seriesIndex;\n lineEl.on('mousemove', function (e) {\n lineEl.dataIndex = null;\n var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY);\n\n if (dataIndex > 0) {\n // Provide dataIndex for tooltip\n lineEl.dataIndex = dataIndex + lineEl.__startIndex;\n }\n });\n }\n};\n\nlargeLineProto._clearIncremental = function () {\n var incremental = this._incremental;\n\n if (incremental) {\n incremental.clearDisplaybles();\n }\n};\n\nvar _default = LargeLineDraw;\nmodule.exports = _default;\n\n/***/ }),\n/* 1098 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar _symbol = __webpack_require__(50);\n\nvar createSymbol = _symbol.createSymbol;\n\nvar IncrementalDisplayable = __webpack_require__(273);\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*/\n\n/* global Float32Array */\n// TODO Batch by color\nvar BOOST_SIZE_THRESHOLD = 4;\nvar LargeSymbolPath = graphic.extendShape({\n shape: {\n points: null\n },\n symbolProxy: null,\n buildPath: function (path, shape) {\n var points = shape.points;\n var size = shape.size;\n var symbolProxy = this.symbolProxy;\n var symbolProxyShape = symbolProxy.shape;\n var ctx = path.getContext ? path.getContext() : path;\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; // Do draw in afterBrush.\n\n if (canBoost) {\n return;\n }\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n symbolProxyShape.x = x - size[0] / 2;\n symbolProxyShape.y = y - size[1] / 2;\n symbolProxyShape.width = size[0];\n symbolProxyShape.height = size[1];\n symbolProxy.buildPath(path, symbolProxyShape, true);\n }\n },\n afterBrush: function (ctx) {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var canBoost = size[0] < BOOST_SIZE_THRESHOLD;\n\n if (!canBoost) {\n return;\n }\n\n this.setTransform(ctx); // PENDING If style or other canvas status changed?\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n } // fillRect is faster than building a rect path and draw.\n // And it support light globalCompositeOperation.\n\n\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n }\n\n this.restoreTransform(ctx);\n },\n findDataIndex: function (x, y) {\n // TODO ???\n // Consider transform\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = Math.max(size[0], 4);\n var h = Math.max(size[1], 4); // Not consider transform\n // Treat each element as a rect\n // top down traverse\n\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\n var i = idx * 2;\n var x0 = points[i] - w / 2;\n var y0 = points[i + 1] - h / 2;\n\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\n return idx;\n }\n }\n\n return -1;\n }\n});\n\nfunction LargeSymbolDraw() {\n this.group = new graphic.Group();\n}\n\nvar largeSymbolProto = LargeSymbolDraw.prototype;\n\nlargeSymbolProto.isPersistent = function () {\n return !this._incremental;\n};\n/**\n * Update symbols draw by new data\n * @param {module:echarts/data/List} data\n */\n\n\nlargeSymbolProto.updateData = function (data) {\n this.group.removeAll();\n var symbolEl = new LargeSymbolPath({\n rectHover: true,\n cursor: 'default'\n });\n symbolEl.setShape({\n points: data.getLayout('symbolPoints')\n });\n\n this._setCommon(symbolEl, data);\n\n this.group.add(symbolEl);\n this._incremental = null;\n};\n\nlargeSymbolProto.updateLayout = function (data) {\n if (this._incremental) {\n return;\n }\n\n var points = data.getLayout('symbolPoints');\n this.group.eachChild(function (child) {\n if (child.startIndex != null) {\n var len = (child.endIndex - child.startIndex) * 2;\n var byteOffset = child.startIndex * 4 * 2;\n points = new Float32Array(points.buffer, byteOffset, len);\n }\n\n child.setShape('points', points);\n });\n};\n\nlargeSymbolProto.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n\n this._clearIncremental(); // Only use incremental displayables when data amount is larger than 2 million.\n // PENDING Incremental data?\n\n\n if (data.count() > 2e6) {\n if (!this._incremental) {\n this._incremental = new IncrementalDisplayable({\n silent: true\n });\n }\n\n this.group.add(this._incremental);\n } else {\n this._incremental = null;\n }\n};\n\nlargeSymbolProto.incrementalUpdate = function (taskParams, data) {\n var symbolEl;\n\n if (this._incremental) {\n symbolEl = new LargeSymbolPath();\n\n this._incremental.addDisplayable(symbolEl, true);\n } else {\n symbolEl = new LargeSymbolPath({\n rectHover: true,\n cursor: 'default',\n startIndex: taskParams.start,\n endIndex: taskParams.end\n });\n symbolEl.incremental = true;\n this.group.add(symbolEl);\n }\n\n symbolEl.setShape({\n points: data.getLayout('symbolPoints')\n });\n\n this._setCommon(symbolEl, data, !!this._incremental);\n};\n\nlargeSymbolProto._setCommon = function (symbolEl, data, isIncremental) {\n var hostModel = data.hostModel; // 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 {\n\n var size = data.getVisual('symbolSize');\n symbolEl.setShape('size', size instanceof Array ? size : [size, size]); // }\n // Create symbolProxy to build path for each data\n\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); // Use symbolProxy setColor method\n\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\n symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow.\n hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\n var visualColor = data.getVisual('color');\n\n if (visualColor) {\n symbolEl.setColor(visualColor);\n }\n\n if (!isIncremental) {\n // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n symbolEl.seriesIndex = hostModel.seriesIndex;\n symbolEl.on('mousemove', function (e) {\n symbolEl.dataIndex = null;\n var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY);\n\n if (dataIndex >= 0) {\n // Provide dataIndex for tooltip\n symbolEl.dataIndex = dataIndex + (symbolEl.startIndex || 0);\n }\n });\n }\n};\n\nlargeSymbolProto.remove = function () {\n this._clearIncremental();\n\n this._incremental = null;\n this.group.removeAll();\n};\n\nlargeSymbolProto._clearIncremental = function () {\n var incremental = this._incremental;\n\n if (incremental) {\n incremental.clearDisplaybles();\n }\n};\n\nvar _default = LargeSymbolDraw;\nmodule.exports = _default;\n\n/***/ }),\n/* 1099 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar vec2 = __webpack_require__(17);\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*/\n\n/**\n * Line path for bezier and straight line draw\n */\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\n\nfunction isLine(shape) {\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\n\nvar _default = graphic.extendShape({\n type: 'ec-line',\n style: {\n stroke: '#000',\n fill: null\n },\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n percent: 1,\n cpx1: null,\n cpy1: null\n },\n buildPath: function (ctx, shape) {\n (isLine(shape) ? straightLineProto : bezierCurveProto).buildPath(ctx, shape);\n },\n pointAt: function (t) {\n return isLine(this.shape) ? straightLineProto.pointAt.call(this, t) : bezierCurveProto.pointAt.call(this, t);\n },\n tangentAt: function (t) {\n var shape = this.shape;\n var p = isLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n return vec2.normalize(p, p);\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1100 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar createListFromArray = __webpack_require__(70);\n\nvar SeriesModel = __webpack_require__(30);\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*/\nvar _default = SeriesModel.extend({\n type: 'series.line',\n dependencies: ['grid', 'polar'],\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n hoverAnimation: true,\n // stack: null\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // polarIndex: 0,\n // If clip the overflow value\n clipOverflow: true,\n // cursor: null,\n label: {\n position: 'top'\n },\n // itemStyle: {\n // },\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n // areaStyle: {\n // origin of areaStyle. Valid values:\n // `'auto'/null/undefined`: from axisLine to data\n // `'start'`: from min to data\n // `'end'`: from data to max\n // origin: 'auto'\n // },\n // false, 'start', 'end', 'middle'\n step: false,\n // Disabled if step is true\n smooth: false,\n smoothMonotone: null,\n symbol: 'emptyCircle',\n symbolSize: 4,\n symbolRotate: null,\n showSymbol: true,\n // `false`: follow the label interval strategy.\n // `true`: show all symbols.\n // `'auto'`: If possible, show all symbols, otherwise\n // follow the label interval strategy.\n showAllSymbol: 'auto',\n // Whether to connect break point.\n connectNulls: false,\n // Sampling for large data. Can be: 'average', 'max', 'min', 'sum'.\n sampling: 'none',\n animationEasing: 'linear',\n // Disable progressive\n progressive: 0,\n hoverLayerThreshold: Infinity\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1101 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = __webpack_require__(0);\n\nvar SymbolDraw = __webpack_require__(138);\n\nvar SymbolClz = __webpack_require__(173);\n\nvar lineAnimationDiff = __webpack_require__(1102);\n\nvar graphic = __webpack_require__(5);\n\nvar modelUtil = __webpack_require__(9);\n\nvar _poly = __webpack_require__(365);\n\nvar Polyline = _poly.Polyline;\nvar Polygon = _poly.Polygon;\n\nvar ChartView = __webpack_require__(65);\n\nvar _number = __webpack_require__(8);\n\nvar round = _number.round;\n\nvar _helper = __webpack_require__(364);\n\nvar prepareDataCoordInfo = _helper.prepareDataCoordInfo;\nvar getStackedOnPoint = _helper.getStackedOnPoint;\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*/\n// FIXME step not support polar\nfunction isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}\n\nfunction getSmooth(smooth) {\n return typeof smooth === 'number' ? smooth : smooth ? 0.5 : 0;\n}\n\nfunction getAxisExtentWithGap(axis) {\n var extent = axis.getGlobalExtent();\n\n if (axis.onBand) {\n // Remove extra 1px to avoid line miter in clipped edge\n var halfBandWidth = axis.getBandWidth() / 2 - 1;\n var dir = extent[1] > extent[0] ? 1 : -1;\n extent[0] += dir * halfBandWidth;\n extent[1] -= dir * halfBandWidth;\n }\n\n return extent;\n}\n/**\n * @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys\n * @param {module:echarts/data/List} data\n * @param {Object} dataCoordInfo\n * @param {Array.>} points\n */\n\n\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\n if (!dataCoordInfo.valueDim) {\n return [];\n }\n\n var points = [];\n\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n points.push(getStackedOnPoint(dataCoordInfo, coordSys, data, idx));\n }\n\n return points;\n}\n\nfunction createGridClipShape(cartesian, hasAnimation, forSymbol, seriesModel) {\n var xExtent = getAxisExtentWithGap(cartesian.getAxis('x'));\n var yExtent = getAxisExtentWithGap(cartesian.getAxis('y'));\n var isHorizontal = cartesian.getBaseAxis().isHorizontal();\n var x = Math.min(xExtent[0], xExtent[1]);\n var y = Math.min(yExtent[0], yExtent[1]);\n var width = Math.max(xExtent[0], xExtent[1]) - x;\n var height = Math.max(yExtent[0], yExtent[1]) - y; // Avoid float number rounding error for symbol on the edge of axis extent.\n // See #7913 and `test/dataZoom-clip.html`.\n\n if (forSymbol) {\n x -= 0.5;\n width += 0.5;\n y -= 0.5;\n height += 0.5;\n } else {\n var lineWidth = seriesModel.get('lineStyle.width') || 2; // Expand clip shape to avoid clipping when line value exceeds axis\n\n var expandSize = seriesModel.get('clipOverflow') ? lineWidth / 2 : Math.max(width, height);\n\n if (isHorizontal) {\n y -= expandSize;\n height += expandSize * 2;\n } else {\n x -= expandSize;\n width += expandSize * 2;\n }\n }\n\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n\n if (hasAnimation) {\n clipPath.shape[isHorizontal ? 'width' : 'height'] = 0;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createPolarClipShape(polar, hasAnimation, forSymbol, seriesModel) {\n var angleAxis = polar.getAngleAxis();\n var radiusAxis = polar.getRadiusAxis();\n var radiusExtent = radiusAxis.getExtent().slice();\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n var angleExtent = angleAxis.getExtent();\n var RADIAN = Math.PI / 180; // Avoid float number rounding error for symbol on the edge of axis extent.\n\n if (forSymbol) {\n radiusExtent[0] -= 0.5;\n radiusExtent[1] += 0.5;\n }\n\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: round(radiusExtent[0], 1),\n r: round(radiusExtent[1], 1),\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse\n }\n });\n\n if (hasAnimation) {\n clipPath.shape.endAngle = -angleExtent[0] * RADIAN;\n graphic.initProps(clipPath, {\n shape: {\n endAngle: -angleExtent[1] * RADIAN\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createClipShape(coordSys, hasAnimation, forSymbol, seriesModel) {\n return coordSys.type === 'polar' ? createPolarClipShape(coordSys, hasAnimation, forSymbol, seriesModel) : createGridClipShape(coordSys, hasAnimation, forSymbol, seriesModel);\n}\n\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt) {\n var baseAxis = coordSys.getBaseAxis();\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\n var stepPoints = [];\n\n for (var i = 0; i < points.length - 1; i++) {\n var nextPt = points[i + 1];\n var pt = points[i];\n stepPoints.push(pt);\n var stepPt = [];\n\n switch (stepTurnAt) {\n case 'end':\n stepPt[baseIndex] = nextPt[baseIndex];\n stepPt[1 - baseIndex] = pt[1 - baseIndex]; // default is start\n\n stepPoints.push(stepPt);\n break;\n\n case 'middle':\n // default is start\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\n var stepPt2 = [];\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt);\n stepPoints.push(stepPt2);\n break;\n\n default:\n stepPt[baseIndex] = pt[baseIndex];\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; // default is start\n\n stepPoints.push(stepPt);\n }\n } // Last points\n\n\n points[i] && stepPoints.push(points[i]);\n return stepPoints;\n}\n\nfunction getVisualGradient(data, coordSys) {\n var visualMetaList = data.getVisual('visualMeta');\n\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\n // When data.count() is 0, gradient range can not be calculated.\n return;\n }\n\n if (coordSys.type !== 'cartesian2d') {\n return;\n }\n\n var coordDim;\n var visualMeta;\n\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\n var dimIndex = visualMetaList[i].dimension;\n var dimName = data.dimensions[dimIndex];\n var dimInfo = data.getDimensionInfo(dimName);\n coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y\n\n if (coordDim === 'x' || coordDim === 'y') {\n visualMeta = visualMetaList[i];\n break;\n }\n }\n\n if (!visualMeta) {\n return;\n } // 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`.\n\n\n var axis = coordSys.getAxis(coordDim); // dataToCoor mapping may not be linear, but must be monotonic.\n\n var colorStops = zrUtil.map(visualMeta.stops, function (stop) {\n return {\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\n color: stop.color\n };\n });\n var stopLen = colorStops.length;\n var outerColors = visualMeta.outerColors.slice();\n\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\n colorStops.reverse();\n outerColors.reverse();\n }\n\n var tinyExtent = 10; // Arbitrary value: 10px\n\n var minCoord = colorStops[0].coord - tinyExtent;\n var maxCoord = colorStops[stopLen - 1].coord + tinyExtent;\n var coordSpan = maxCoord - minCoord;\n\n if (coordSpan < 1e-3) {\n return 'transparent';\n }\n\n zrUtil.each(colorStops, function (stop) {\n stop.offset = (stop.coord - minCoord) / coordSpan;\n });\n colorStops.push({\n offset: stopLen ? colorStops[stopLen - 1].offset : 0.5,\n color: outerColors[1] || 'transparent'\n });\n colorStops.unshift({\n // notice colorStops.length have been changed.\n offset: stopLen ? colorStops[0].offset : 0.5,\n color: outerColors[0] || 'transparent'\n }); // 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 // });\n\n var gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStops, true);\n gradient[coordDim] = minCoord;\n gradient[coordDim + '2'] = maxCoord;\n return gradient;\n}\n\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\n var showAllSymbol = seriesModel.get('showAllSymbol');\n var isAuto = showAllSymbol === 'auto';\n\n if (showAllSymbol && !isAuto) {\n return;\n }\n\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (!categoryAxis) {\n return;\n } // 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.\n\n\n if (isAuto // Simplify the logic, do not determine label overlap here.\n && canShowAllSymbolForCategory(categoryAxis, data)) {\n return;\n } // Otherwise follow the label interval strategy on category axis.\n\n\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\n var labelMap = {};\n zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\n labelMap[labelItem.tickValue] = 1;\n });\n return function (dataIndex) {\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\n };\n}\n\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\n // 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.\n var axisExtent = categoryAxis.getExtent();\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\n isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\n // Sampling some points, max 5.\n\n var dataLen = data.count();\n var step = Math.max(1, Math.round(dataLen / 5));\n\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\n if (SymbolClz.getSymbolSize(data, dataIndex // Only for cartesian, where `isHorizontal` exists.\n )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number\n * 1.5 > availSize) {\n return false;\n }\n }\n\n return true;\n}\n\nvar _default = ChartView.extend({\n type: 'line',\n init: function () {\n var lineGroup = new graphic.Group();\n var symbolDraw = new SymbolDraw();\n this.group.add(symbolDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineGroup = lineGroup;\n },\n render: function (seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var lineStyleModel = seriesModel.getModel('lineStyle');\n var areaStyleModel = seriesModel.getModel('areaStyle');\n var points = data.mapArray(data.getItemLayout);\n var isCoordSysPolar = coordSys.type === 'polar';\n var prevCoordSys = this._coordSys;\n var symbolDraw = this._symbolDraw;\n var polyline = this._polyline;\n var polygon = this._polygon;\n var lineGroup = this._lineGroup;\n var hasAnimation = seriesModel.get('animation');\n var isAreaChart = !areaStyleModel.isEmpty();\n var valueOrigin = areaStyleModel.get('origin');\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\n var stackedOnPoints = getStackedOnPoints(coordSys, data, dataCoordInfo);\n var showSymbol = seriesModel.get('showSymbol');\n var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols\n\n var oldData = this._data;\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n }); // Remove previous created symbols if showSymbol changed to false\n\n if (!showSymbol) {\n symbolDraw.remove();\n }\n\n group.add(lineGroup); // FIXME step not support polar\n\n var step = !isCoordSysPolar && seriesModel.get('step'); // Initialization animation or coordinate system changed\n\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: createClipShape(coordSys, false, true, seriesModel)\n });\n\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step);\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\n }\n\n polyline = this._newPolyline(points, coordSys, hasAnimation);\n\n if (isAreaChart) {\n polygon = this._newPolygon(points, stackedOnPoints, coordSys, hasAnimation);\n }\n\n lineGroup.setClipPath(createClipShape(coordSys, true, false, seriesModel));\n } else {\n if (isAreaChart && !polygon) {\n // If areaStyle is added\n polygon = this._newPolygon(points, stackedOnPoints, coordSys, hasAnimation);\n } else if (polygon && !isAreaChart) {\n // If areaStyle is removed\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n } // Update clipPath\n\n\n lineGroup.setClipPath(createClipShape(coordSys, false, false, seriesModel)); // Always update, or it is wrong in the case turning on legend\n // because points are not changed\n\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: createClipShape(coordSys, false, true, seriesModel)\n }); // Stop symbol animation and sync with line points\n // FIXME performance?\n\n data.eachItemGraphicEl(function (el) {\n el.stopAnimation(true);\n }); // In the case data zoom triggerred refreshing frequently\n // Data may not change if line has a category axis. So it should animate nothing\n\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) {\n if (hasAnimation) {\n this._updateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin);\n } else {\n // Not do it in update with animation\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step);\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step);\n }\n\n polyline.setShape({\n points: points\n });\n polygon && polygon.setShape({\n points: points,\n stackedOnPoints: stackedOnPoints\n });\n }\n }\n }\n\n var visualColor = getVisualGradient(data, coordSys) || data.getVisual('color');\n polyline.useStyle(zrUtil.defaults( // Use color in lineStyle first\n lineStyleModel.getLineStyle(), {\n fill: 'none',\n stroke: visualColor,\n lineJoin: 'bevel'\n }));\n var smooth = seriesModel.get('smooth');\n smooth = getSmooth(seriesModel.get('smooth'));\n polyline.setShape({\n smooth: smooth,\n smoothMonotone: seriesModel.get('smoothMonotone'),\n connectNulls: seriesModel.get('connectNulls')\n });\n\n if (polygon) {\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n var stackedOnSmooth = 0;\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: visualColor,\n opacity: 0.7,\n lineJoin: 'bevel'\n }));\n\n if (stackedOnSeries) {\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\n }\n\n polygon.setShape({\n smooth: smooth,\n stackedOnSmooth: stackedOnSmooth,\n smoothMonotone: seriesModel.get('smoothMonotone'),\n connectNulls: seriesModel.get('connectNulls')\n });\n }\n\n this._data = data; // Save the coordinate system for transition animation when data changed\n\n this._coordSys = coordSys;\n this._stackedOnPoints = stackedOnPoints;\n this._points = points;\n this._step = step;\n this._valueOrigin = valueOrigin;\n },\n dispose: function () {},\n highlight: function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (!symbol) {\n // Create a temporary symbol if it is not exists\n var pt = data.getItemLayout(dataIndex);\n\n if (!pt) {\n // Null data\n return;\n }\n\n symbol = new SymbolClz(data, dataIndex);\n symbol.position = pt;\n symbol.setZ(seriesModel.get('zlevel'), seriesModel.get('z'));\n symbol.ignore = isNaN(pt[0]) || isNaN(pt[1]);\n symbol.__temp = true;\n data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation\n\n symbol.stopSymbolAnimation(true);\n this.group.add(symbol);\n }\n\n symbol.highlight();\n } else {\n // Highlight whole series\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\n }\n },\n downplay: function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n if (dataIndex != null && dataIndex >= 0) {\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (symbol) {\n if (symbol.__temp) {\n data.setItemGraphicEl(dataIndex, null);\n this.group.remove(symbol);\n } else {\n symbol.downplay();\n }\n }\n } else {\n // FIXME\n // can not downplay completely.\n // Downplay whole series\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\n }\n },\n\n /**\n * @param {module:zrender/container/Group} group\n * @param {Array.>} points\n * @private\n */\n _newPolyline: function (points) {\n var polyline = this._polyline; // Remove previous created polyline\n\n if (polyline) {\n this._lineGroup.remove(polyline);\n }\n\n polyline = new Polyline({\n shape: {\n points: points\n },\n silent: true,\n z2: 10\n });\n\n this._lineGroup.add(polyline);\n\n this._polyline = polyline;\n return polyline;\n },\n\n /**\n * @param {module:zrender/container/Group} group\n * @param {Array.>} stackedOnPoints\n * @param {Array.>} points\n * @private\n */\n _newPolygon: function (points, stackedOnPoints) {\n var polygon = this._polygon; // Remove previous created polygon\n\n if (polygon) {\n this._lineGroup.remove(polygon);\n }\n\n polygon = new Polygon({\n shape: {\n points: points,\n stackedOnPoints: stackedOnPoints\n },\n silent: true\n });\n\n this._lineGroup.add(polygon);\n\n this._polygon = polygon;\n return polygon;\n },\n\n /**\n * @private\n */\n // FIXME Two value axis\n _updateAnimation: function (data, stackedOnPoints, coordSys, api, step, valueOrigin) {\n var polyline = this._polyline;\n var polygon = this._polygon;\n var seriesModel = data.hostModel;\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\n var current = diff.current;\n var stackedOnCurrent = diff.stackedOnCurrent;\n var next = diff.next;\n var stackedOnNext = diff.stackedOnNext;\n\n if (step) {\n // TODO If stacked series is not step\n current = turnPointsIntoStep(diff.current, coordSys, step);\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step);\n next = turnPointsIntoStep(diff.next, coordSys, step);\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);\n } // `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.\n\n\n polyline.shape.__points = diff.current;\n polyline.shape.points = current;\n graphic.updateProps(polyline, {\n shape: {\n points: next\n }\n }, seriesModel);\n\n if (polygon) {\n polygon.setShape({\n points: current,\n stackedOnPoints: stackedOnCurrent\n });\n graphic.updateProps(polygon, {\n shape: {\n points: next,\n stackedOnPoints: stackedOnNext\n }\n }, seriesModel);\n }\n\n var updatedDataInfo = [];\n var diffStatus = diff.status;\n\n for (var i = 0; i < diffStatus.length; i++) {\n var cmd = diffStatus[i].cmd;\n\n if (cmd === '=') {\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\n\n if (el) {\n updatedDataInfo.push({\n el: el,\n ptIdx: i // Index of points\n\n });\n }\n }\n }\n\n if (polyline.animators && polyline.animators.length) {\n polyline.animators[0].during(function () {\n for (var i = 0; i < updatedDataInfo.length; i++) {\n var el = updatedDataInfo[i].el;\n el.attr('position', polyline.shape.__points[updatedDataInfo[i].ptIdx]);\n }\n });\n }\n },\n remove: function (ecModel) {\n var group = this.group;\n var oldData = this._data;\n\n this._lineGroup.removeAll();\n\n this._symbolDraw.remove(true); // Remove temporary created elements when highlighting\n\n\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n });\n this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._data = null;\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1102 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _helper = __webpack_require__(364);\n\nvar prepareDataCoordInfo = _helper.prepareDataCoordInfo;\nvar getStackedOnPoint = _helper.getStackedOnPoint;\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*/\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) {\n var diffResult = [];\n newData.diff(oldData).add(function (idx) {\n diffResult.push({\n cmd: '+',\n idx: idx\n });\n }).update(function (newIdx, oldIdx) {\n diffResult.push({\n cmd: '=',\n idx: oldIdx,\n idx1: newIdx\n });\n }).remove(function (idx) {\n diffResult.push({\n cmd: '-',\n idx: idx\n });\n }).execute();\n return diffResult;\n}\n\nfunction _default(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\n 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);\n\n var currPoints = [];\n var nextPoints = []; // Points for stacking base line\n\n var currStackedPoints = [];\n var nextStackedPoints = [];\n var status = [];\n var sortedIndices = [];\n var rawIndices = [];\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);\n var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\n\n for (var i = 0; i < diff.length; i++) {\n var diffItem = diff[i];\n var pointAdded = true; // FIXME, animation is not so perfect when dataZoom window moves fast\n // Which is in case remvoing or add more than one data in the tail or head\n\n switch (diffItem.cmd) {\n case '=':\n var currentPt = oldData.getItemLayout(diffItem.idx);\n var nextPt = newData.getItemLayout(diffItem.idx1); // If previous data is NaN, use next point directly\n\n if (isNaN(currentPt[0]) || isNaN(currentPt[1])) {\n currentPt = nextPt.slice();\n }\n\n currPoints.push(currentPt);\n nextPoints.push(nextPt);\n currStackedPoints.push(oldStackedOnPoints[diffItem.idx]);\n nextStackedPoints.push(newStackedOnPoints[diffItem.idx1]);\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\n break;\n\n case '+':\n var idx = diffItem.idx;\n currPoints.push(oldCoordSys.dataToPoint([newData.get(newDataOldCoordInfo.dataDimsForPoint[0], idx), newData.get(newDataOldCoordInfo.dataDimsForPoint[1], idx)]));\n nextPoints.push(newData.getItemLayout(idx).slice());\n currStackedPoints.push(getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, idx));\n nextStackedPoints.push(newStackedOnPoints[idx]);\n rawIndices.push(newData.getRawIndex(idx));\n break;\n\n case '-':\n var idx = diffItem.idx;\n var rawIndex = oldData.getRawIndex(idx); // Data is replaced. In the case of dynamic data queue\n // FIXME FIXME FIXME\n\n if (rawIndex !== idx) {\n currPoints.push(oldData.getItemLayout(idx));\n nextPoints.push(newCoordSys.dataToPoint([oldData.get(oldDataNewCoordInfo.dataDimsForPoint[0], idx), oldData.get(oldDataNewCoordInfo.dataDimsForPoint[1], idx)]));\n currStackedPoints.push(oldStackedOnPoints[idx]);\n nextStackedPoints.push(getStackedOnPoint(oldDataNewCoordInfo, newCoordSys, oldData, idx));\n rawIndices.push(rawIndex);\n } else {\n pointAdded = false;\n }\n\n } // Original indices\n\n\n if (pointAdded) {\n status.push(diffItem);\n sortedIndices.push(sortedIndices.length);\n }\n } // Diff result may be crossed if all items are changed\n // Sort by data index\n\n\n sortedIndices.sort(function (a, b) {\n return rawIndices[a] - rawIndices[b];\n });\n var sortedCurrPoints = [];\n var sortedNextPoints = [];\n var sortedCurrStackedPoints = [];\n var sortedNextStackedPoints = [];\n var sortedStatus = [];\n\n for (var i = 0; i < sortedIndices.length; i++) {\n var idx = sortedIndices[i];\n sortedCurrPoints[i] = currPoints[idx];\n sortedNextPoints[i] = nextPoints[idx];\n sortedCurrStackedPoints[i] = currStackedPoints[idx];\n sortedNextStackedPoints[i] = nextStackedPoints[idx];\n sortedStatus[i] = status[idx];\n }\n\n return {\n current: sortedCurrPoints,\n next: sortedNextPoints,\n stackedOnCurrent: sortedCurrStackedPoints,\n stackedOnNext: sortedNextStackedPoints,\n status: sortedStatus\n };\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1103 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1104);\n\n__webpack_require__(1105);\n\nvar linesLayout = __webpack_require__(366);\n\nvar linesVisual = __webpack_require__(1106);\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*/\necharts.registerLayout(linesLayout);\necharts.registerVisual(linesVisual);\n\n/***/ }),\n/* 1104 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar SeriesModel = __webpack_require__(30);\n\nvar List = __webpack_require__(49);\n\nvar _util = __webpack_require__(0);\n\nvar concatArray = _util.concatArray;\nvar mergeAll = _util.mergeAll;\nvar map = _util.map;\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\n\nvar CoordinateSystem = __webpack_require__(57);\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*/\n\n/* global Uint32Array, Float64Array, Float32Array */\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\n\nfunction compatEc2(seriesOpt) {\n var data = seriesOpt.data;\n\n if (data && data[0] && data[0][0] && data[0][0].coord) {\n seriesOpt.data = map(data, function (itemOpt) {\n var coords = [itemOpt[0].coord, itemOpt[1].coord];\n var target = {\n coords: coords\n };\n\n if (itemOpt[0].name) {\n target.fromName = itemOpt[0].name;\n }\n\n if (itemOpt[1].name) {\n target.toName = itemOpt[1].name;\n }\n\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\n });\n }\n}\n\nvar LinesSeries = SeriesModel.extend({\n type: 'series.lines',\n dependencies: ['grid', 'polar'],\n visualColorAccessPath: 'lineStyle.color',\n init: function (option) {\n // The input data may be null/undefined.\n option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type\n\n compatEc2(option);\n\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n\n LinesSeries.superApply(this, 'init', arguments);\n },\n mergeOption: function (option) {\n // The input data may be null/undefined.\n option.data = option.data || [];\n compatEc2(option);\n\n if (option.data) {\n // Only update when have option data to merge.\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n }\n\n LinesSeries.superApply(this, 'mergeOption', arguments);\n },\n appendData: function (params) {\n var result = this._processFlatCoordsArray(params.data);\n\n if (result.flatCoords) {\n if (!this._flatCoords) {\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n } else {\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\n }\n\n params.data = new Float32Array(result.count);\n }\n\n this.getRawData().appendData(params.data);\n },\n _getCoordsFromItemModel: function (idx) {\n var itemModel = this.getData().getItemModel(idx);\n var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');\n return coords;\n },\n getLineCoordsCount: function (idx) {\n if (this._flatCoordsOffset) {\n return this._flatCoordsOffset[idx * 2 + 1];\n } else {\n return this._getCoordsFromItemModel(idx).length;\n }\n },\n getLineCoords: function (idx, out) {\n if (this._flatCoordsOffset) {\n var offset = this._flatCoordsOffset[idx * 2];\n var len = this._flatCoordsOffset[idx * 2 + 1];\n\n for (var i = 0; i < len; i++) {\n out[i] = out[i] || [];\n out[i][0] = this._flatCoords[offset + i * 2];\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\n }\n\n return len;\n } else {\n var coords = this._getCoordsFromItemModel(idx);\n\n for (var i = 0; i < coords.length; i++) {\n out[i] = out[i] || [];\n out[i][0] = coords[i][0];\n out[i][1] = coords[i][1];\n }\n\n return coords.length;\n }\n },\n _processFlatCoordsArray: function (data) {\n var startOffset = 0;\n\n if (this._flatCoords) {\n startOffset = this._flatCoords.length;\n } // Stored as a typed array. In format\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\n\n\n if (typeof data[0] === 'number') {\n var len = data.length; // Store offset and len of each segment\n\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\n var coordsStorage = new Float64Arr(len);\n var coordsCursor = 0;\n var offsetCursor = 0;\n var dataCount = 0;\n\n for (var i = 0; i < len;) {\n dataCount++;\n var count = data[i++]; // Offset\n\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len\n\n coordsOffsetAndLenStorage[offsetCursor++] = count;\n\n for (var k = 0; k < count; k++) {\n var x = data[i++];\n var y = data[i++];\n coordsStorage[coordsCursor++] = x;\n coordsStorage[coordsCursor++] = y;\n\n if (i > len) {}\n }\n }\n\n return {\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\n flatCoords: coordsStorage,\n count: dataCount\n };\n }\n\n return {\n flatCoordsOffset: null,\n flatCoords: null,\n count: data.length\n };\n },\n getInitialData: function (option, ecModel) {\n var lineData = new List(['value'], this);\n lineData.hasItemOption = false;\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\n // dataItem is simply coords\n if (dataItem instanceof Array) {\n return NaN;\n } else {\n lineData.hasItemOption = true;\n var value = dataItem.value;\n\n if (value != null) {\n return value instanceof Array ? value[dimIndex] : value;\n }\n }\n });\n return lineData;\n },\n formatTooltip: function (dataIndex) {\n var data = this.getData();\n var itemModel = data.getItemModel(dataIndex);\n var name = itemModel.get('name');\n\n if (name) {\n return name;\n }\n\n var fromName = itemModel.get('fromName');\n var toName = itemModel.get('toName');\n var html = [];\n fromName != null && html.push(fromName);\n toName != null && html.push(toName);\n return encodeHTML(html.join(' > '));\n },\n preventIncremental: function () {\n return !!this.get('effect.show');\n },\n getProgressive: function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n return this.option.large ? 1e4 : this.get('progressive');\n }\n\n return progressive;\n },\n getProgressiveThreshold: function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n },\n defaultOption: {\n coordinateSystem: 'geo',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n hoverAnimation: true,\n // Cartesian coordinate system\n xAxisIndex: 0,\n yAxisIndex: 0,\n symbol: ['none', 'none'],\n symbolSize: [10, 10],\n // Geo coordinate system\n geoIndex: 0,\n effect: {\n show: false,\n period: 4,\n // Animation delay. support callback\n // delay: 0,\n // If move with constant speed px/sec\n // period will be ignored if this property is > 0,\n constantSpeed: 0,\n symbol: 'circle',\n symbolSize: 3,\n loop: true,\n // Length of trail, 0 - 1\n trailLength: 0.2 // Same with lineStyle.color\n // color\n\n },\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n // If lines are polyline\n // polyline not support curveness, label, animation\n polyline: false,\n label: {\n show: false,\n position: 'end' // distance: 5,\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n lineStyle: {\n opacity: 0.5\n }\n }\n});\nvar _default = LinesSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1105 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar echarts = __webpack_require__(3);\n\nvar LineDraw = __webpack_require__(247);\n\nvar EffectLine = __webpack_require__(358);\n\nvar Line = __webpack_require__(246);\n\nvar Polyline = __webpack_require__(359);\n\nvar EffectPolyline = __webpack_require__(1095);\n\nvar LargeLineDraw = __webpack_require__(1097);\n\nvar linesLayout = __webpack_require__(366);\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*/\nvar _default = echarts.extendChartView({\n type: 'lines',\n init: function () {},\n render: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get('effect.trailLength');\n var zr = api.getZr(); // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n } // Config layer with motion blur\n\n\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n\n if (this._showEffect(seriesModel) && trailLength) {\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n }\n }\n\n lineDraw.updateData(data);\n this._lastZlevel = zlevel;\n this._finished = true;\n },\n incrementalPrepareRender: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n lineDraw.incrementalPrepareUpdate(data);\n\n this._clearLayer(api);\n\n this._finished = false;\n },\n incrementalRender: function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n },\n updateTransform: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count()\n }, data);\n }\n\n this._lineDraw.updateLayout();\n\n this._clearLayer(api);\n }\n },\n _updateLineDraw: function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n\n var hasEffect = this._showEffect(seriesModel);\n\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n\n this.group.add(lineDraw.group);\n return lineDraw;\n },\n _showEffect: function (seriesModel) {\n return !!seriesModel.get('effect.show');\n },\n _clearLayer: function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n },\n remove: function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null; // Clear motion when lineDraw is removed\n\n this._clearLayer(api);\n },\n dispose: function () {}\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1106 */\n/***/ (function(module, exports) {\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*/\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*/\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nvar opacityQuery = 'lineStyle.opacity'.split('.');\nvar _default = {\n seriesType: 'lines',\n reset: function (seriesModel, ecModel, api) {\n var symbolType = normalize(seriesModel.get('symbol'));\n var symbolSize = normalize(seriesModel.get('symbolSize'));\n var data = seriesModel.getData();\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\n data.setVisual('toSymbol', symbolType && symbolType[1]);\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n data.setVisual('opacity', seriesModel.get(opacityQuery));\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n var opacity = itemModel.get(opacityQuery);\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\n data.setItemVisual(idx, 'opacity', opacity);\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nmodule.exports = _default;\n\n/***/ }),\n/* 1107 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1108);\n\n__webpack_require__(1109);\n\n__webpack_require__(352);\n\n__webpack_require__(259);\n\nvar mapSymbolLayout = __webpack_require__(1112);\n\nvar mapVisual = __webpack_require__(1113);\n\nvar mapDataStatistic = __webpack_require__(1111);\n\nvar backwardCompat = __webpack_require__(1110);\n\nvar createDataSelectAction = __webpack_require__(351);\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*/\necharts.registerLayout(mapSymbolLayout);\necharts.registerVisual(mapVisual);\necharts.registerProcessor(echarts.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\necharts.registerPreprocessor(backwardCompat);\ncreateDataSelectAction('map', [{\n type: 'mapToggleSelect',\n event: 'mapselectchanged',\n method: 'toggleSelected'\n}, {\n type: 'mapSelect',\n event: 'mapselected',\n method: 'select'\n}, {\n type: 'mapUnSelect',\n event: 'mapunselected',\n method: 'unSelect'\n}]);\n\n/***/ }),\n/* 1108 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar createListSimply = __webpack_require__(115);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\nvar addCommas = _format.addCommas;\n\nvar dataSelectableMixin = __webpack_require__(253);\n\nvar _dataProvider = __webpack_require__(103);\n\nvar retrieveRawAttr = _dataProvider.retrieveRawAttr;\n\nvar geoSourceManager = __webpack_require__(178);\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*/\nvar MapSeries = SeriesModel.extend({\n type: 'series.map',\n dependencies: ['geo'],\n layoutMode: 'box',\n\n /**\n * Only first map series of same mapType will drawMap\n * @type {boolean}\n */\n needsDrawMap: false,\n\n /**\n * Group of all map series with same mapType\n * @type {boolean}\n */\n seriesGroup: [],\n getInitialData: function (option) {\n var data = createListSimply(this, ['value']);\n var valueDim = data.mapDimension('value');\n var dataNameMap = zrUtil.createHashMap();\n var selectTargetList = [];\n var toAppendNames = [];\n\n for (var i = 0, len = data.count(); i < len; i++) {\n var name = data.getName(i);\n dataNameMap.set(name, true);\n selectTargetList.push({\n name: name,\n value: data.get(valueDim, i),\n selected: retrieveRawAttr(data, i, 'selected')\n });\n }\n\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap);\n zrUtil.each(geoSource.regions, function (region) {\n var name = region.name;\n\n if (!dataNameMap.get(name)) {\n selectTargetList.push({\n name: name\n });\n toAppendNames.push(name);\n }\n });\n this.updateSelectedMap(selectTargetList); // Complete data with missing regions. The consequent processes (like visual\n // map and render) can not be performed without a \"full data\". For example,\n // find `dataIndex` by name.\n\n data.appendValues([], toAppendNames);\n return data;\n },\n\n /**\n * If no host geo model, return null, which means using a\n * inner exclusive geo model.\n */\n getHostGeoModel: function () {\n var geoIndex = this.option.geoIndex;\n return geoIndex != null ? this.dependentModels.geo[geoIndex] : null;\n },\n getMapType: function () {\n return (this.getHostGeoModel() || this).option.map;\n },\n // _fillOption: function (option, mapName) {\n // Shallow clone\n // option = zrUtil.extend({}, option);\n // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\n // return option;\n // },\n getRawValue: function (dataIndex) {\n // Use value stored in data instead because it is calculated from multiple series\n // FIXME Provide all value of multiple series ?\n var data = this.getData();\n return data.get(data.mapDimension('value'), dataIndex);\n },\n\n /**\n * Get model of region\n * @param {string} name\n * @return {module:echarts/model/Model}\n */\n getRegionModel: function (regionName) {\n var data = this.getData();\n return data.getItemModel(data.indexOfName(regionName));\n },\n\n /**\n * Map tooltip formatter\n *\n * @param {number} dataIndex\n */\n formatTooltip: function (dataIndex) {\n // FIXME orignalData and data is a bit confusing\n var data = this.getData();\n var formattedValue = addCommas(this.getRawValue(dataIndex));\n var name = data.getName(dataIndex);\n var seriesGroup = this.seriesGroup;\n var seriesNames = [];\n\n for (var i = 0; i < seriesGroup.length; i++) {\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\n var valueDim = data.mapDimension('value');\n\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\n seriesNames.push(encodeHTML(seriesGroup[i].name));\n }\n }\n\n return seriesNames.join(', ') + '
' + encodeHTML(name + ' : ' + formattedValue);\n },\n\n /**\n * @implement\n */\n getTooltipPosition: function (dataIndex) {\n if (dataIndex != null) {\n var name = this.getData().getName(dataIndex);\n var geo = this.coordinateSystem;\n var region = geo.getRegion(name);\n return region && geo.dataToPoint(region.center);\n }\n },\n setZoom: function (zoom) {\n this.option.zoom = zoom;\n },\n setCenter: function (center) {\n this.option.center = center;\n },\n defaultOption: {\n // 一级层叠\n zlevel: 0,\n // 二级层叠\n z: 2,\n coordinateSystem: 'geo',\n // map should be explicitly specified since ec3.\n map: '',\n // If `geoIndex` is not specified, a exclusive geo will be\n // created. Otherwise use the specified geo component, and\n // `map` and `mapType` are ignored.\n // geoIndex: 0,\n // 'center' | 'left' | 'right' | 'x%' | {number}\n left: 'center',\n // 'center' | 'top' | 'bottom' | 'x%' | {number}\n top: 'center',\n // right\n // bottom\n // width:\n // height\n // Aspect is width / height. Inited to be geoJson bbox aspect\n // This parameter is used for scale this aspect\n aspectScale: 0.75,\n ///// Layout with center and size\n // If you wan't to put map in a fixed size box with right aspect ratio\n // This two properties may more conveninet\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n // 数值合并方式,默认加和,可选为:\n // 'sum' | 'average' | 'max' | 'min'\n // mapValueCalculation: 'sum',\n // 地图数值计算结果小数精度\n // mapValuePrecision: 0,\n // 显示图例颜色标识(系列标识的小圆点),图例开启时有效\n showLegendSymbol: true,\n // 选择模式,默认关闭,可选single,multiple\n // selectedMode: false,\n dataRangeHoverLink: true,\n // 是否开启缩放及漫游模式\n // roam: false,\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ],\n // higher priority than center and zoom\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n label: {\n show: false,\n color: '#000'\n },\n // scaleLimit: null,\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444',\n areaColor: '#eee'\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n areaColor: 'rgba(255,215,0,0.8)'\n }\n }\n }\n});\nzrUtil.mixin(MapSeries, dataSelectableMixin);\nvar _default = MapSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1109 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar MapDraw = __webpack_require__(378);\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*/\nvar HIGH_DOWN_PROP = '__seriesMapHighDown';\nvar RECORD_VERSION_PROP = '__seriesMapCallKey';\n\nvar _default = echarts.extendChartView({\n type: 'map',\n render: function (mapModel, ecModel, api, payload) {\n // Not render if it is an toggleSelect action from self\n if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) {\n return;\n }\n\n var group = this.group;\n group.removeAll();\n\n if (mapModel.getHostGeoModel()) {\n return;\n } // Not update map if it is an roam action from self\n\n\n if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) {\n if (mapModel.needsDrawMap) {\n var mapDraw = this._mapDraw || new MapDraw(api, true);\n group.add(mapDraw.group);\n mapDraw.draw(mapModel, ecModel, api, this, payload);\n this._mapDraw = mapDraw;\n } else {\n // Remove drawed map\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n }\n } else {\n var mapDraw = this._mapDraw;\n mapDraw && group.add(mapDraw.group);\n }\n\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api);\n },\n remove: function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n this.group.removeAll();\n },\n dispose: function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n },\n _renderSymbols: function (mapModel, ecModel, api) {\n var originalData = mapModel.originalData;\n var group = this.group;\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\n if (isNaN(value)) {\n return;\n }\n\n var layout = originalData.getItemLayout(originalDataIndex);\n\n if (!layout || !layout.point) {\n // Not exists in map\n return;\n }\n\n var point = layout.point;\n var offset = layout.offset;\n var circle = new graphic.Circle({\n style: {\n // Because the special of map draw.\n // Which needs statistic of multiple series and draw on one map.\n // And each series also need a symbol with legend color\n //\n // Layout and visual are put one the different data\n fill: mapModel.getData().getVisual('color')\n },\n shape: {\n cx: point[0] + offset * 9,\n cy: point[1],\n r: 3\n },\n silent: true,\n // Do not overlap the first series, on which labels are displayed.\n z2: 8 + (!offset ? graphic.Z2_EMPHASIS_LIFT + 1 : 0)\n }); // Only the series that has the first value on the same region is in charge of rendering the label.\n // But consider the case:\n // series: [\n // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\n // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\n // ]\n // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\n // For backward compatibility, we follow the rule that render label `A` by the\n // settings on series `X` but render label `C` by the settings on series `Y`.\n\n if (!offset) {\n var fullData = mapModel.mainSeries.getData();\n var name = originalData.getName(originalDataIndex);\n var fullIndex = fullData.indexOfName(name);\n var itemModel = originalData.getItemModel(originalDataIndex);\n var labelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel('emphasis.label');\n var regionGroup = fullData.getItemGraphicEl(fullIndex); // `getFormattedLabel` needs to use `getData` inside. Here\n // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\n // FIXME\n // If this is not the `mainSeries`, the item model (like label formatter)\n // set on original data item will never get. But it has been working\n // like that from the begining, and this scenario is rarely encountered.\n // So it won't be fixed until have to.\n\n var normalText = zrUtil.retrieve2(mapModel.getFormattedLabel(fullIndex, 'normal'), name);\n var emphasisText = zrUtil.retrieve2(mapModel.getFormattedLabel(fullIndex, 'emphasis'), normalText);\n var highDownRecord = regionGroup[HIGH_DOWN_PROP];\n var recordVersion = Math.random(); // Prevent from register listeners duplicatedly when roaming.\n\n if (!highDownRecord) {\n highDownRecord = regionGroup[HIGH_DOWN_PROP] = {};\n var onEmphasis = zrUtil.curry(onRegionHighDown, true);\n var onNormal = zrUtil.curry(onRegionHighDown, false);\n regionGroup.on('mouseover', onEmphasis).on('mouseout', onNormal).on('emphasis', onEmphasis).on('normal', onNormal);\n } // Prevent removed regions effect current grapics.\n\n\n regionGroup[RECORD_VERSION_PROP] = recordVersion;\n zrUtil.extend(highDownRecord, {\n recordVersion: recordVersion,\n circle: circle,\n labelModel: labelModel,\n hoverLabelModel: hoverLabelModel,\n emphasisText: emphasisText,\n normalText: normalText\n }); // FIXME\n // Consider set option when emphasis.\n\n enterRegionHighDown(highDownRecord, false);\n }\n\n group.add(circle);\n });\n }\n});\n\nfunction onRegionHighDown(toHighOrDown) {\n var highDownRecord = this[HIGH_DOWN_PROP];\n\n if (highDownRecord && highDownRecord.recordVersion === this[RECORD_VERSION_PROP]) {\n enterRegionHighDown(highDownRecord, toHighOrDown);\n }\n}\n\nfunction enterRegionHighDown(highDownRecord, toHighOrDown) {\n var circle = highDownRecord.circle;\n var labelModel = highDownRecord.labelModel;\n var hoverLabelModel = highDownRecord.hoverLabelModel;\n var emphasisText = highDownRecord.emphasisText;\n var normalText = highDownRecord.normalText;\n\n if (toHighOrDown) {\n circle.style.extendFrom(graphic.setTextStyle({}, hoverLabelModel, {\n text: hoverLabelModel.get('show') ? emphasisText : null\n }, {\n isRectText: true,\n useInsideStyle: false\n }, true)); // Make label upper than others if overlaps.\n\n circle.__mapOriginalZ2 = circle.z2;\n circle.z2 += graphic.Z2_EMPHASIS_LIFT;\n } else {\n graphic.setTextStyle(circle.style, labelModel, {\n text: labelModel.get('show') ? normalText : null,\n textPosition: labelModel.getShallow('position') || 'bottom'\n }, {\n isRectText: true,\n useInsideStyle: false\n }); // Trigger normalize style like padding.\n\n circle.dirty(false);\n\n if (circle.__mapOriginalZ2 != null) {\n circle.z2 = circle.__mapOriginalZ2;\n circle.__mapOriginalZ2 = null;\n }\n }\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1110 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\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*/\nfunction _default(option) {\n // Save geoCoord\n var mapSeries = [];\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'map') {\n mapSeries.push(seriesOpt);\n seriesOpt.map = seriesOpt.map || seriesOpt.mapType; // Put x, y, width, height, x2, y2 in the top level\n\n zrUtil.defaults(seriesOpt, seriesOpt.mapLocation);\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1111 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\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*/\n// FIXME 公用?\n\n/**\n * @param {Array.} datas\n * @param {string} statisticType 'average' 'sum'\n * @inner\n */\nfunction dataStatistics(datas, statisticType) {\n var dataNameMap = {};\n zrUtil.each(datas, function (data) {\n data.each(data.mapDimension('value'), function (value, idx) {\n // Add prefix to avoid conflict with Object.prototype.\n var mapKey = 'ec-' + data.getName(idx);\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\n\n if (!isNaN(value)) {\n dataNameMap[mapKey].push(value);\n }\n });\n });\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\n var mapKey = 'ec-' + datas[0].getName(idx);\n var sum = 0;\n var min = Infinity;\n var max = -Infinity;\n var len = dataNameMap[mapKey].length;\n\n for (var i = 0; i < len; i++) {\n min = Math.min(min, dataNameMap[mapKey][i]);\n max = Math.max(max, dataNameMap[mapKey][i]);\n sum += dataNameMap[mapKey][i];\n }\n\n var result;\n\n if (statisticType === 'min') {\n result = min;\n } else if (statisticType === 'max') {\n result = max;\n } else if (statisticType === 'average') {\n result = sum / len;\n } else {\n result = sum;\n }\n\n return len === 0 ? NaN : result;\n });\n}\n\nfunction _default(ecModel) {\n var seriesGroups = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n var hostGeoModel = seriesModel.getHostGeoModel();\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\n });\n zrUtil.each(seriesGroups, function (seriesList, key) {\n var data = dataStatistics(zrUtil.map(seriesList, function (seriesModel) {\n return seriesModel.getData();\n }), seriesList[0].get('mapValueCalculation'));\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].originalData = seriesList[i].getData();\n } // FIXME Put where?\n\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].seriesGroup = seriesList;\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\n seriesList[i].setData(data.cloneShallow());\n seriesList[i].mainSeries = seriesList[0];\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1112 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\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*/\nfunction _default(ecModel) {\n var processedMapType = {};\n ecModel.eachSeriesByType('map', function (mapSeries) {\n var mapType = mapSeries.getMapType();\n\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\n return;\n }\n\n var mapSymbolOffsets = {};\n zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\n var geo = subMapSeries.coordinateSystem;\n var data = subMapSeries.originalData;\n\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\n data.each(data.mapDimension('value'), function (value, idx) {\n var name = data.getName(idx);\n var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44],\n // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\n // not be drawn. So here must validate if value is NaN.\n\n if (!region || isNaN(value)) {\n return;\n }\n\n var offset = mapSymbolOffsets[name] || 0;\n var point = geo.dataToPoint(region.center);\n mapSymbolOffsets[name] = offset + 1;\n data.setItemLayout(idx, {\n point: point,\n offset: offset\n });\n });\n }\n }); // Show label of those region not has legendSymbol(which is offset 0)\n\n var data = mapSeries.getData();\n data.each(function (idx) {\n var name = data.getName(idx);\n var layout = data.getItemLayout(idx) || {};\n layout.showLabel = !mapSymbolOffsets[name];\n data.setItemLayout(idx, layout);\n });\n processedMapType[mapType] = true;\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1113 */\n/***/ (function(module, exports) {\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*/\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*/\nfunction _default(ecModel) {\n ecModel.eachSeriesByType('map', function (seriesModel) {\n var colorList = seriesModel.get('color');\n var itemStyleModel = seriesModel.getModel('itemStyle');\n var areaColor = itemStyleModel.get('areaColor');\n var color = itemStyleModel.get('color') || colorList[seriesModel.seriesIndex % colorList.length];\n seriesModel.getData().setVisual({\n 'areaColor': areaColor,\n 'color': color\n });\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1114 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(384);\n\n__webpack_require__(1115);\n\n__webpack_require__(1116);\n\nvar parallelVisual = __webpack_require__(1117);\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*/\necharts.registerVisual(parallelVisual);\n\n/***/ }),\n/* 1115 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _util = __webpack_require__(0);\n\nvar each = _util.each;\nvar createHashMap = _util.createHashMap;\n\nvar SeriesModel = __webpack_require__(30);\n\nvar createListFromArray = __webpack_require__(70);\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*/\nvar _default = SeriesModel.extend({\n type: 'series.parallel',\n dependencies: ['parallel'],\n visualColorAccessPath: 'lineStyle.color',\n getInitialData: function (option, ecModel) {\n var source = this.getSource();\n setEncodeAndDimensions(source, this);\n return createListFromArray(source, this);\n },\n\n /**\n * User can get data raw indices on 'axisAreaSelected' event received.\n *\n * @public\n * @param {string} activeState 'active' or 'inactive' or 'normal'\n * @return {Array.} Raw indices\n */\n getRawIndicesByActiveState: function (activeState) {\n var coordSys = this.coordinateSystem;\n var data = this.getData();\n var indices = [];\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\n if (activeState === theActiveState) {\n indices.push(data.getRawIndex(dataIndex));\n }\n });\n return indices;\n },\n defaultOption: {\n zlevel: 0,\n // 一级层叠\n z: 2,\n // 二级层叠\n coordinateSystem: 'parallel',\n parallelIndex: 0,\n label: {\n show: false\n },\n inactiveOpacity: 0.05,\n activeOpacity: 1,\n lineStyle: {\n width: 1,\n opacity: 0.45,\n type: 'solid'\n },\n emphasis: {\n label: {\n show: false\n }\n },\n progressive: 500,\n smooth: false,\n // true | false | number\n animationEasing: 'linear'\n }\n});\n\nfunction setEncodeAndDimensions(source, seriesModel) {\n // The mapping of parallelAxis dimension to data dimension can\n // be specified in parallelAxis.option.dim. For example, if\n // parallelAxis.option.dim is 'dim3', it mapping to the third\n // dimension of data. But `data.encode` has higher priority.\n // Moreover, parallelModel.dimension should not be regarded as data\n // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\n if (source.encodeDefine) {\n return;\n }\n\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n\n if (!parallelModel) {\n return;\n }\n\n var encodeDefine = source.encodeDefine = createHashMap();\n each(parallelModel.dimensions, function (axisDim) {\n var dataDimIndex = convertDimNameToNumber(axisDim);\n encodeDefine.set(axisDim, dataDimIndex);\n });\n}\n\nfunction convertDimNameToNumber(dimName) {\n return +dimName.replace('dim', '');\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1116 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar ChartView = __webpack_require__(65);\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*/\nvar DEFAULT_SMOOTH = 0.3;\nvar ParallelView = ChartView.extend({\n type: 'parallel',\n init: function () {\n /**\n * @type {module:zrender/container/Group}\n * @private\n */\n this._dataGroup = new graphic.Group();\n this.group.add(this._dataGroup);\n /**\n * @type {module:echarts/data/List}\n */\n\n this._data;\n /**\n * @type {boolean}\n */\n\n this._initialized;\n },\n\n /**\n * @override\n */\n render: function (seriesModel, ecModel, api, payload) {\n var dataGroup = this._dataGroup;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n data.diff(oldData).add(add).update(update).remove(remove).execute();\n\n function add(newDataIndex) {\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function update(newDataIndex, oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\n data.setItemGraphicEl(newDataIndex, line);\n var animationModel = payload && payload.animation === false ? null : seriesModel;\n graphic.updateProps(line, {\n shape: {\n points: points\n }\n }, animationModel, newDataIndex);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function remove(oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n dataGroup.remove(line);\n } // First create\n\n\n if (!this._initialized) {\n this._initialized = true;\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\n // Callback will be invoked immediately if there is no animation\n setTimeout(function () {\n dataGroup.removeClipPath();\n });\n });\n dataGroup.setClipPath(clipPath);\n }\n\n this._data = data;\n },\n incrementalPrepareRender: function (seriesModel, ecModel, api) {\n this._initialized = true;\n this._data = null;\n\n this._dataGroup.removeAll();\n },\n incrementalRender: function (taskParams, seriesModel, ecModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\n line.incremental = true;\n updateElCommon(line, data, dataIndex, seriesScope);\n }\n },\n dispose: function () {},\n // _renderForProgressive: function (seriesModel) {\n // var dataGroup = this._dataGroup;\n // var data = seriesModel.getData();\n // var oldData = this._data;\n // var coordSys = seriesModel.coordinateSystem;\n // var dimensions = coordSys.dimensions;\n // var option = seriesModel.option;\n // var progressive = option.progressive;\n // var smooth = option.smooth ? SMOOTH : null;\n // // In progressive animation is disabled, so use simple data diff,\n // // which effects performance less.\n // // (Typically performance for data with length 7000+ like:\n // // simpleDiff: 60ms, addEl: 184ms,\n // // in RMBP 2.4GHz intel i7, OSX 10.9 chrome 50.0.2661.102 (64-bit))\n // if (simpleDiff(oldData, data, dimensions)) {\n // dataGroup.removeAll();\n // data.each(function (dataIndex) {\n // addEl(data, dataGroup, dataIndex, dimensions, coordSys);\n // });\n // }\n // updateElCommon(data, progressive, smooth);\n // // Consider switch between progressive and not.\n // data.__plProgressive = true;\n // this._data = data;\n // },\n\n /**\n * @override\n */\n remove: function () {\n this._dataGroup && this._dataGroup.removeAll();\n this._data = null;\n }\n});\n\nfunction createGridClipShape(coordSys, seriesModel, cb) {\n var parallelModel = coordSys.model;\n var rect = coordSys.getRect();\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\n rectEl.setShape(dim, 0);\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width,\n height: rect.height\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\n var points = [];\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimName = dimensions[i];\n var value = data.get(data.mapDimension(dimName), dataIndex);\n\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\n points.push(coordSys.dataToPoint(value, dimName));\n }\n }\n\n return points;\n}\n\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\n var line = new graphic.Polyline({\n shape: {\n points: points\n },\n silent: true,\n z2: 10\n });\n dataGroup.add(line);\n data.setItemGraphicEl(dataIndex, line);\n return line;\n}\n\nfunction makeSeriesScope(seriesModel) {\n var smooth = seriesModel.get('smooth', true);\n smooth === true && (smooth = DEFAULT_SMOOTH);\n return {\n lineStyle: seriesModel.getModel('lineStyle').getLineStyle(),\n smooth: smooth != null ? smooth : DEFAULT_SMOOTH\n };\n}\n\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\n var lineStyle = seriesScope.lineStyle;\n\n if (data.hasItemOption) {\n var lineStyleModel = data.getItemModel(dataIndex).getModel('lineStyle');\n lineStyle = lineStyleModel.getLineStyle();\n }\n\n el.useStyle(lineStyle);\n var elStyle = el.style;\n elStyle.fill = null; // lineStyle.color have been set to itemVisual in module:echarts/visual/seriesColor.\n\n elStyle.stroke = data.getItemVisual(dataIndex, 'color'); // lineStyle.opacity have been set to itemVisual in parallelVisual.\n\n elStyle.opacity = data.getItemVisual(dataIndex, 'opacity');\n seriesScope.smooth && (el.shape.smooth = seriesScope.smooth);\n} // function simpleDiff(oldData, newData, dimensions) {\n// var oldLen;\n// if (!oldData\n// || !oldData.__plProgressive\n// || (oldLen = oldData.count()) !== newData.count()\n// ) {\n// return true;\n// }\n// var dimLen = dimensions.length;\n// for (var i = 0; i < oldLen; i++) {\n// for (var j = 0; j < dimLen; j++) {\n// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\n// return true;\n// }\n// }\n// }\n// return false;\n// }\n// FIXME\n// 公用方法?\n\n\nfunction isEmptyValue(val, axisType) {\n return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value'\n}\n\nvar _default = ParallelView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1117 */\n/***/ (function(module, exports) {\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*/\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*/\nvar opacityAccessPath = ['lineStyle', 'normal', 'opacity'];\nvar _default = {\n seriesType: 'parallel',\n reset: function (seriesModel, ecModel, api) {\n var itemStyleModel = seriesModel.getModel('itemStyle');\n var lineStyleModel = seriesModel.getModel('lineStyle');\n var globalColors = ecModel.get('color');\n var color = lineStyleModel.get('color') || itemStyleModel.get('color') || globalColors[seriesModel.seriesIndex % globalColors.length];\n var inactiveOpacity = seriesModel.get('inactiveOpacity');\n var activeOpacity = seriesModel.get('activeOpacity');\n var lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var opacityMap = {\n normal: lineStyle.opacity,\n active: activeOpacity,\n inactive: inactiveOpacity\n };\n data.setVisual('color', color);\n\n function progress(params, data) {\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\n var opacity = opacityMap[activeState];\n\n if (activeState === 'normal' && data.hasItemOption) {\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);\n itemOpacity != null && (opacity = itemOpacity);\n }\n\n data.setItemVisual(dataIndex, 'opacity', opacity);\n }, params.start, params.end);\n }\n\n return {\n progress: progress\n };\n }\n};\nmodule.exports = _default;\n\n/***/ }),\n/* 1118 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\n__webpack_require__(258);\n\n__webpack_require__(1052);\n\n__webpack_require__(1053);\n\nvar _barGrid = __webpack_require__(180);\n\nvar layout = _barGrid.layout;\n\nvar visualSymbol = __webpack_require__(107);\n\n__webpack_require__(142);\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*/\n// In case developer forget to include grid component\necharts.registerLayout(zrUtil.curry(layout, 'pictorialBar'));\necharts.registerVisual(visualSymbol('pictorialBar', 'roundRect'));\n\n/***/ }),\n/* 1119 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar createListSimply = __webpack_require__(115);\n\nvar zrUtil = __webpack_require__(0);\n\nvar modelUtil = __webpack_require__(9);\n\nvar _number = __webpack_require__(8);\n\nvar getPercentWithPrecision = _number.getPercentWithPrecision;\n\nvar dataSelectableMixin = __webpack_require__(253);\n\nvar _dataProvider = __webpack_require__(103);\n\nvar retrieveRawAttr = _dataProvider.retrieveRawAttr;\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*/\nvar PieSeries = echarts.extendSeriesModel({\n type: 'series.pie',\n // Overwrite\n init: function (option) {\n 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\n\n this.legendDataProvider = function () {\n return this.getRawData();\n };\n\n this.updateSelectedMap(this._createSelectableList());\n\n this._defaultLabelLine(option);\n },\n // Overwrite\n mergeOption: function (newOption) {\n PieSeries.superCall(this, 'mergeOption', newOption);\n this.updateSelectedMap(this._createSelectableList());\n },\n getInitialData: function (option, ecModel) {\n return createListSimply(this, ['value']);\n },\n _createSelectableList: function () {\n var data = this.getRawData();\n var valueDim = data.mapDimension('value');\n var targetList = [];\n\n for (var i = 0, len = data.count(); i < len; i++) {\n targetList.push({\n name: data.getName(i),\n value: data.get(valueDim, i),\n selected: retrieveRawAttr(data, i, 'selected')\n });\n }\n\n return targetList;\n },\n // Overwrite\n getDataParams: function (dataIndex) {\n var data = this.getData();\n var params = PieSeries.superCall(this, 'getDataParams', dataIndex); // FIXME toFixed?\n\n var valueList = [];\n data.each(data.mapDimension('value'), function (value) {\n valueList.push(value);\n });\n params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision'));\n params.$vars.push('percent');\n return params;\n },\n _defaultLabelLine: function (option) {\n // Extend labelLine emphasis\n modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n hoverAnimation: true,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // 选中时扇区偏移量\n selectedOffset: 10,\n // 高亮扇区偏移量\n hoverOffset: 10,\n // If use strategy to avoid label overlapping\n avoidLabelOverlap: true,\n // 选择模式,默认关闭,可选single,multiple\n // selectedMode: false,\n // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)\n // roseType: null,\n percentPrecision: 2,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // cursor: null,\n label: {\n // If rotate around circle\n rotate: false,\n show: true,\n // 'outer', 'inside', 'center'\n position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n // 默认使用全局文本样式,详见TEXTSTYLE\n // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数\n\n },\n // Enabled when label.normal.position is 'outer'\n labelLine: {\n show: true,\n // 引导线两段中的第一段长度\n length: 15,\n // 引导线两段中的第二段长度\n length2: 15,\n smooth: false,\n lineStyle: {\n // color: 各异,\n width: 1,\n type: 'solid'\n }\n },\n itemStyle: {\n borderWidth: 1\n },\n // Animation type canbe expansion, scale\n animationType: 'expansion',\n animationEasing: 'cubicOut'\n }\n});\nzrUtil.mixin(PieSeries, dataSelectableMixin);\nvar _default = PieSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1120 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar ChartView = __webpack_require__(65);\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*/\n\n/**\n * @param {module:echarts/model/Series} seriesModel\n * @param {boolean} hasAnimation\n * @inner\n */\nfunction updateDataSelected(uid, seriesModel, hasAnimation, api) {\n var data = seriesModel.getData();\n var dataIndex = this.dataIndex;\n var name = data.getName(dataIndex);\n var selectedOffset = seriesModel.get('selectedOffset');\n api.dispatchAction({\n type: 'pieToggleSelect',\n from: uid,\n name: name,\n seriesId: seriesModel.id\n });\n data.each(function (idx) {\n toggleItemSelected(data.getItemGraphicEl(idx), data.getItemLayout(idx), seriesModel.isSelected(data.getName(idx)), selectedOffset, hasAnimation);\n });\n}\n/**\n * @param {module:zrender/graphic/Sector} el\n * @param {Object} layout\n * @param {boolean} isSelected\n * @param {number} selectedOffset\n * @param {boolean} hasAnimation\n * @inner\n */\n\n\nfunction toggleItemSelected(el, layout, isSelected, selectedOffset, hasAnimation) {\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var offset = isSelected ? selectedOffset : 0;\n var position = [dx * offset, dy * offset];\n hasAnimation // animateTo will stop revious animation like update transition\n ? el.animate().when(200, {\n position: position\n }).start('bounceOut') : el.attr('position', position);\n}\n/**\n * Piece of pie including Sector, Label, LabelLine\n * @constructor\n * @extends {module:zrender/graphic/Group}\n */\n\n\nfunction PiePiece(data, idx) {\n graphic.Group.call(this);\n var sector = new graphic.Sector({\n z2: 2\n });\n var polyline = new graphic.Polyline();\n var text = new graphic.Text();\n this.add(sector);\n this.add(polyline);\n this.add(text);\n this.updateData(data, idx, true); // Hover to change label and labelLine\n\n function onEmphasis() {\n polyline.ignore = polyline.hoverIgnore;\n text.ignore = text.hoverIgnore;\n }\n\n function onNormal() {\n polyline.ignore = polyline.normalIgnore;\n text.ignore = text.normalIgnore;\n }\n\n this.on('emphasis', onEmphasis).on('normal', onNormal).on('mouseover', onEmphasis).on('mouseout', onNormal);\n}\n\nvar piePieceProto = PiePiece.prototype;\n\npiePieceProto.updateData = function (data, idx, firstCreate) {\n var sector = this.childAt(0);\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var sectorShape = zrUtil.extend({}, layout);\n sectorShape.label = null;\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n var animationType = seriesModel.getShallow('animationType');\n\n if (animationType === 'scale') {\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, idx);\n } // Expansion\n else {\n sector.shape.endAngle = layout.startAngle;\n graphic.updateProps(sector, {\n shape: {\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n }\n } else {\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel, idx);\n } // Update common style\n\n\n var visualColor = data.getItemVisual(idx, 'color');\n sector.useStyle(zrUtil.defaults({\n lineJoin: 'bevel',\n fill: visualColor\n }, itemModel.getModel('itemStyle').getItemStyle()));\n sector.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle();\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle); // Toggle selected\n\n toggleItemSelected(this, data.getItemLayout(idx), seriesModel.isSelected(null, idx), seriesModel.get('selectedOffset'), seriesModel.get('animation'));\n\n function onEmphasis() {\n // Sector may has animation of updating data. Force to move to the last frame\n // Or it may stopped on the wrong shape\n sector.stopAnimation(true);\n sector.animateTo({\n shape: {\n r: layout.r + seriesModel.get('hoverOffset')\n }\n }, 300, 'elasticOut');\n }\n\n function onNormal() {\n sector.stopAnimation(true);\n sector.animateTo({\n shape: {\n r: layout.r\n }\n }, 300, 'elasticOut');\n }\n\n sector.off('mouseover').off('mouseout').off('emphasis').off('normal');\n\n if (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled()) {\n sector.on('mouseover', onEmphasis).on('mouseout', onNormal).on('emphasis', onEmphasis).on('normal', onNormal);\n }\n\n this._updateLabel(data, idx);\n\n graphic.setHoverStyle(this);\n};\n\npiePieceProto._updateLabel = function (data, idx) {\n var labelLine = this.childAt(1);\n var labelText = this.childAt(2);\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var labelLayout = layout.label;\n var visualColor = data.getItemVisual(idx, 'color');\n graphic.updateProps(labelLine, {\n shape: {\n points: labelLayout.linePoints || [[labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y]]\n }\n }, seriesModel, idx);\n graphic.updateProps(labelText, {\n style: {\n x: labelLayout.x,\n y: labelLayout.y\n }\n }, seriesModel, idx);\n labelText.attr({\n rotation: labelLayout.rotation,\n origin: [labelLayout.x, labelLayout.y],\n z2: 10\n });\n var labelModel = itemModel.getModel('label');\n var labelHoverModel = itemModel.getModel('emphasis.label');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineHoverModel = itemModel.getModel('emphasis.labelLine');\n var visualColor = data.getItemVisual(idx, 'color');\n graphic.setLabelStyle(labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n defaultText: data.getName(idx),\n autoColor: visualColor,\n useInsideStyle: !!labelLayout.inside\n }, {\n textAlign: labelLayout.textAlign,\n textVerticalAlign: labelLayout.verticalAlign,\n opacity: data.getItemVisual(idx, 'opacity')\n });\n labelText.ignore = labelText.normalIgnore = !labelModel.get('show');\n labelText.hoverIgnore = !labelHoverModel.get('show');\n labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show');\n labelLine.hoverIgnore = !labelLineHoverModel.get('show'); // Default use item visual color\n\n labelLine.setStyle({\n stroke: visualColor,\n opacity: data.getItemVisual(idx, 'opacity')\n });\n labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle());\n labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle();\n var smooth = labelLineModel.get('smooth');\n\n if (smooth && smooth === true) {\n smooth = 0.4;\n }\n\n labelLine.setShape({\n smooth: smooth\n });\n};\n\nzrUtil.inherits(PiePiece, graphic.Group); // Pie view\n\nvar PieView = ChartView.extend({\n type: 'pie',\n init: function () {\n var sectorGroup = new graphic.Group();\n this._sectorGroup = sectorGroup;\n },\n render: function (seriesModel, ecModel, api, payload) {\n if (payload && payload.from === this.uid) {\n return;\n }\n\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var hasAnimation = ecModel.get('animation');\n var isFirstRender = !oldData;\n var animationType = seriesModel.get('animationType');\n var onSectorClick = zrUtil.curry(updateDataSelected, this.uid, seriesModel, hasAnimation, api);\n var selectedMode = seriesModel.get('selectedMode');\n data.diff(oldData).add(function (idx) {\n var piePiece = new PiePiece(data, idx); // Default expansion animation\n\n if (isFirstRender && animationType !== 'scale') {\n piePiece.eachChild(function (child) {\n child.stopAnimation(true);\n });\n }\n\n selectedMode && piePiece.on('click', onSectorClick);\n data.setItemGraphicEl(idx, piePiece);\n group.add(piePiece);\n }).update(function (newIdx, oldIdx) {\n var piePiece = oldData.getItemGraphicEl(oldIdx);\n piePiece.updateData(data, newIdx);\n piePiece.off('click');\n selectedMode && piePiece.on('click', onSectorClick);\n group.add(piePiece);\n data.setItemGraphicEl(newIdx, piePiece);\n }).remove(function (idx) {\n var piePiece = oldData.getItemGraphicEl(idx);\n group.remove(piePiece);\n }).execute();\n\n if (hasAnimation && isFirstRender && data.count() > 0 // Default expansion animation\n && animationType !== 'scale') {\n var shape = data.getItemLayout(0);\n var r = Math.max(api.getWidth(), api.getHeight()) / 2;\n var removeClipPath = zrUtil.bind(group.removeClipPath, group);\n group.setClipPath(this._createClipPath(shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel));\n } else {\n // clipPath is used in first-time animation, so remove it when otherwise. See: #8994\n group.removeClipPath();\n }\n\n this._data = data;\n },\n dispose: function () {},\n _createClipPath: function (cx, cy, r, startAngle, clockwise, cb, seriesModel) {\n var clipPath = new graphic.Sector({\n shape: {\n cx: cx,\n cy: cy,\n r0: 0,\n r: r,\n startAngle: startAngle,\n endAngle: startAngle,\n clockwise: clockwise\n }\n });\n graphic.initProps(clipPath, {\n shape: {\n endAngle: startAngle + (clockwise ? 1 : -1) * Math.PI * 2\n }\n }, seriesModel, cb);\n return clipPath;\n },\n\n /**\n * @implement\n */\n containPoint: function (point, seriesModel) {\n var data = seriesModel.getData();\n var itemLayout = data.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n }\n});\nvar _default = PieView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1121 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar textContain = __webpack_require__(59);\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*/\n// FIXME emphasis label position is not same with normal label position\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) {\n list.sort(function (a, b) {\n return a.y - b.y;\n });\n\n function shiftDown(start, end, delta, dir) {\n for (var j = start; j < end; j++) {\n list[j].y += delta;\n\n if (j > start && j + 1 < end && list[j + 1].y > list[j].y + list[j].height) {\n shiftUp(j, delta / 2);\n return;\n }\n }\n\n shiftUp(end - 1, delta / 2);\n }\n\n function shiftUp(end, delta) {\n for (var j = end; j >= 0; j--) {\n list[j].y -= delta;\n\n if (j > 0 && list[j].y > list[j - 1].y + list[j - 1].height) {\n break;\n }\n }\n }\n\n function changeX(list, isDownList, cx, cy, r, dir) {\n 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\n\n for (var i = 0, l = list.length; i < l; i++) {\n var deltaY = Math.abs(list[i].y - cy);\n var length = list[i].len;\n var length2 = list[i].len2;\n var deltaX = deltaY < r + length ? Math.sqrt((r + length + length2) * (r + length + length2) - deltaY * deltaY) : Math.abs(list[i].x - cx);\n\n if (isDownList && deltaX >= lastDeltaX) {\n // right-down, left-down\n deltaX = lastDeltaX - 10;\n }\n\n if (!isDownList && deltaX <= lastDeltaX) {\n // right-up, left-up\n deltaX = lastDeltaX + 10;\n }\n\n list[i].x = cx + deltaX * dir;\n lastDeltaX = deltaX;\n }\n }\n\n var lastY = 0;\n var delta;\n var len = list.length;\n var upList = [];\n var downList = [];\n\n for (var i = 0; i < len; i++) {\n delta = list[i].y - lastY;\n\n if (delta < 0) {\n shiftDown(i, len, -delta, dir);\n }\n\n lastY = list[i].y + list[i].height;\n }\n\n if (viewHeight - lastY < 0) {\n shiftUp(len - 1, lastY - viewHeight);\n }\n\n for (var i = 0; i < len; i++) {\n if (list[i].y >= cy) {\n downList.push(list[i]);\n } else {\n upList.push(list[i]);\n }\n }\n\n changeX(upList, false, cx, cy, r, dir);\n changeX(downList, true, cx, cy, r, dir);\n}\n\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight) {\n var leftList = [];\n var rightList = [];\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n if (isPositionCenter(labelLayoutList[i])) {\n continue;\n }\n\n if (labelLayoutList[i].x < cx) {\n leftList.push(labelLayoutList[i]);\n } else {\n rightList.push(labelLayoutList[i]);\n }\n }\n\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight);\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight);\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n if (isPositionCenter(labelLayoutList[i])) {\n continue;\n }\n\n var linePoints = labelLayoutList[i].linePoints;\n\n if (linePoints) {\n var dist = linePoints[1][0] - linePoints[2][0];\n\n if (labelLayoutList[i].x < cx) {\n linePoints[2][0] = labelLayoutList[i].x + 3;\n } else {\n linePoints[2][0] = labelLayoutList[i].x - 3;\n }\n\n linePoints[1][1] = linePoints[2][1] = labelLayoutList[i].y;\n linePoints[1][0] = linePoints[2][0] + dist;\n }\n }\n}\n\nfunction isPositionCenter(layout) {\n // Not change x for center label\n return layout.position === 'center';\n}\n\nfunction _default(seriesModel, r, viewWidth, viewHeight) {\n var data = seriesModel.getData();\n var labelLayoutList = [];\n var cx;\n var cy;\n var hasLabelRotate = false;\n data.each(function (idx) {\n var layout = data.getItemLayout(idx);\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis\n\n var labelPosition = labelModel.get('position') || itemModel.get('emphasis.label.position');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineLen = labelLineModel.get('length');\n var labelLineLen2 = labelLineModel.get('length2');\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var textX;\n var textY;\n var linePoints;\n var textAlign;\n cx = layout.cx;\n cy = layout.cy;\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\n\n if (labelPosition === 'center') {\n textX = layout.cx;\n textY = layout.cy;\n textAlign = 'center';\n } else {\n var x1 = (isLabelInside ? (layout.r + layout.r0) / 2 * dx : layout.r * dx) + cx;\n var y1 = (isLabelInside ? (layout.r + layout.r0) / 2 * dy : layout.r * dy) + cy;\n textX = x1 + dx * 3;\n textY = y1 + dy * 3;\n\n if (!isLabelInside) {\n // For roseType\n var x2 = x1 + dx * (labelLineLen + r - layout.r);\n var y2 = y1 + dy * (labelLineLen + r - layout.r);\n var x3 = x2 + (dx < 0 ? -1 : 1) * labelLineLen2;\n var y3 = y2;\n textX = x3 + (dx < 0 ? -5 : 5);\n textY = y3;\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\n }\n\n textAlign = isLabelInside ? 'center' : dx > 0 ? 'left' : 'right';\n }\n\n var font = labelModel.getFont();\n var labelRotate = labelModel.get('rotate') ? dx < 0 ? -midAngle + Math.PI : -midAngle : 0;\n var text = seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx);\n var textRect = textContain.getBoundingRect(text, font, textAlign, 'top');\n hasLabelRotate = !!labelRotate;\n layout.label = {\n x: textX,\n y: textY,\n position: labelPosition,\n height: textRect.height,\n len: labelLineLen,\n len2: labelLineLen2,\n linePoints: linePoints,\n textAlign: textAlign,\n verticalAlign: 'middle',\n rotation: labelRotate,\n inside: isLabelInside\n }; // Not layout the inside label\n\n if (!isLabelInside) {\n labelLayoutList.push(layout.label);\n }\n });\n\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight);\n }\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1122 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\nvar linearMap = _number.linearMap;\n\nvar labelLayout = __webpack_require__(1121);\n\nvar zrUtil = __webpack_require__(0);\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*/\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\n\nfunction _default(seriesType, ecModel, api, payload) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var validDataCount = 0;\n data.each(valueDim, function (value) {\n !isNaN(value) && validDataCount++;\n });\n var sum = data.getSum(valueDim); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var clockwise = seriesModel.get('clockwise');\n var roseType = seriesModel.get('roseType');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max]\n\n var extent = data.getDataExtent(valueDim);\n extent[0] = 0; // In the case some sector angle is smaller than minAngle\n\n var restAngle = PI2;\n var valueSumLargerThanMinAngle = 0;\n var currentAngle = startAngle;\n var dir = clockwise ? 1 : -1;\n data.each(valueDim, function (value, idx) {\n var angle;\n\n if (isNaN(value)) {\n data.setItemLayout(idx, {\n angle: NaN,\n startAngle: NaN,\n endAngle: NaN,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? NaN : r\n });\n return;\n } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\n\n\n if (roseType !== 'area') {\n angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n } else {\n angle = PI2 / validDataCount;\n }\n\n if (angle < minAngle) {\n angle = minAngle;\n restAngle -= minAngle;\n } else {\n valueSumLargerThanMinAngle += value;\n }\n\n var endAngle = currentAngle + dir * angle;\n data.setItemLayout(idx, {\n angle: angle,\n startAngle: currentAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? linearMap(value, extent, [r0, r]) : r\n });\n currentAngle = endAngle;\n }); // Some sector is constrained by minAngle\n // Rest sectors needs recalculate angle\n\n if (restAngle < PI2 && validDataCount) {\n // Average the angle if rest angle is not enough after all angles is\n // Constrained by minAngle\n if (restAngle <= 1e-3) {\n var angle = PI2 / validDataCount;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout = data.getItemLayout(idx);\n layout.angle = angle;\n layout.startAngle = startAngle + dir * idx * angle;\n layout.endAngle = startAngle + dir * (idx + 1) * angle;\n }\n });\n } else {\n unitRadian = restAngle / valueSumLargerThanMinAngle;\n currentAngle = startAngle;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout = data.getItemLayout(idx);\n var angle = layout.angle === minAngle ? minAngle : value * unitRadian;\n layout.startAngle = currentAngle;\n layout.endAngle = currentAngle + dir * angle;\n currentAngle += dir * angle;\n }\n });\n }\n }\n\n labelLayout(seriesModel, r, width, height);\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1123 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1215);\n\n__webpack_require__(1124);\n\n__webpack_require__(1125);\n\nvar dataColor = __webpack_require__(184);\n\nvar visualSymbol = __webpack_require__(107);\n\nvar radarLayout = __webpack_require__(1127);\n\nvar dataFilter = __webpack_require__(149);\n\nvar backwardCompat = __webpack_require__(1126);\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*/\n// Must use radar component\necharts.registerVisual(dataColor('radar'));\necharts.registerVisual(visualSymbol('radar', 'circle'));\necharts.registerLayout(radarLayout);\necharts.registerProcessor(dataFilter('radar'));\necharts.registerPreprocessor(backwardCompat);\n\n/***/ }),\n/* 1124 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar SeriesModel = __webpack_require__(30);\n\nvar createListSimply = __webpack_require__(115);\n\nvar zrUtil = __webpack_require__(0);\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\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*/\nvar RadarSeries = SeriesModel.extend({\n type: 'series.radar',\n dependencies: ['radar'],\n // Overwrite\n init: function (option) {\n RadarSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n this.legendDataProvider = function () {\n return this.getRawData();\n };\n },\n getInitialData: function (option, ecModel) {\n return createListSimply(this, {\n generateCoord: 'indicator_',\n generateCoordCount: Infinity\n });\n },\n formatTooltip: function (dataIndex) {\n var data = this.getData();\n var coordSys = this.coordinateSystem;\n var indicatorAxes = coordSys.getIndicatorAxes();\n var name = this.getData().getName(dataIndex);\n return encodeHTML(name === '' ? this.name : name) + '
' + zrUtil.map(indicatorAxes, function (axis, idx) {\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\n return encodeHTML(axis.name + ' : ' + val);\n }).join('
');\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'radar',\n legendHoverLink: true,\n radarIndex: 0,\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n label: {\n position: 'top'\n },\n // areaStyle: {\n // },\n // itemStyle: {}\n symbol: 'emptyCircle',\n symbolSize: 4 // symbolRotate: null\n\n }\n});\nvar _default = RadarSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1125 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar graphic = __webpack_require__(5);\n\nvar zrUtil = __webpack_require__(0);\n\nvar symbolUtil = __webpack_require__(50);\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*/\nfunction normalizeSymbolSize(symbolSize) {\n if (!zrUtil.isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return symbolSize;\n}\n\nvar _default = echarts.extendChartView({\n type: 'radar',\n render: function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n var color = data.getItemVisual(idx, 'color');\n\n if (symbolType === 'none') {\n return;\n }\n\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2, color);\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scale: [symbolSize[0] / 2, symbolSize[1] / 2]\n });\n return symbolPath;\n }\n\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n\n if (oldPoints[i]) {\n symbolPath.attr('position', oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n position: newPoints[i]\n }, seriesModel, idx);\n } else {\n symbolPath.attr('position', newPoints[i]);\n }\n\n symbolGroup.add(symbolPath);\n }\n }\n }\n\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n\n if (!points) {\n return;\n }\n\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n\n if (!target.shape.points) {\n return;\n }\n\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var color = data.getItemVisual(idx, 'color');\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n polyline.hoverStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle();\n var areaStyleModel = itemModel.getModel('areaStyle');\n var hoverAreaStyleModel = itemModel.getModel('emphasis.areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n var hoverPolygonIgnore = hoverAreaStyleModel.isEmpty() && hoverAreaStyleModel.parentModel.isEmpty();\n hoverPolygonIgnore = hoverPolygonIgnore && polygonIgnore;\n polygon.ignore = polygonIgnore;\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7\n }));\n polygon.hoverStyle = hoverAreaStyleModel.getAreaStyle();\n var itemStyle = itemModel.getModel('itemStyle').getItemStyle(['color']);\n var itemHoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle();\n var labelModel = itemModel.getModel('label');\n var labelHoverModel = itemModel.getModel('emphasis.label');\n symbolGroup.eachChild(function (symbolPath) {\n symbolPath.setStyle(itemStyle);\n symbolPath.hoverStyle = zrUtil.clone(itemHoverStyle);\n graphic.setLabelStyle(symbolPath.style, symbolPath.hoverStyle, labelModel, labelHoverModel, {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: data.get(data.dimensions[symbolPath.__dimIdx], idx),\n autoColor: color,\n isRectText: true\n });\n });\n\n function onEmphasis() {\n polygon.attr('ignore', hoverPolygonIgnore);\n }\n\n function onNormal() {\n polygon.attr('ignore', polygonIgnore);\n }\n\n itemGroup.off('mouseover').off('mouseout').off('normal').off('emphasis');\n itemGroup.on('emphasis', onEmphasis).on('mouseover', onEmphasis).on('normal', onNormal).on('mouseout', onNormal);\n graphic.setHoverStyle(itemGroup);\n });\n this._data = data;\n },\n remove: function () {\n this.group.removeAll();\n this._data = null;\n },\n dispose: function () {}\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1126 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\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*/\n// Backward compat for radar chart in 2\nfunction _default(option) {\n var polarOptArr = option.polar;\n\n if (polarOptArr) {\n if (!zrUtil.isArray(polarOptArr)) {\n polarOptArr = [polarOptArr];\n }\n\n var polarNotRadar = [];\n zrUtil.each(polarOptArr, function (polarOpt, idx) {\n if (polarOpt.indicator) {\n if (polarOpt.type && !polarOpt.shape) {\n polarOpt.shape = polarOpt.type;\n }\n\n option.radar = option.radar || [];\n\n if (!zrUtil.isArray(option.radar)) {\n option.radar = [option.radar];\n }\n\n option.radar.push(polarOpt);\n } else {\n polarNotRadar.push(polarOpt);\n }\n });\n option.polar = polarNotRadar;\n }\n\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\n seriesOpt.radarIndex = seriesOpt.polarIndex;\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1127 */\n/***/ (function(module, exports) {\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*/\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*/\nfunction _default(ecModel) {\n ecModel.eachSeriesByType('radar', function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n var coordSys = seriesModel.coordinateSystem;\n\n if (!coordSys) {\n return;\n }\n\n function pointsConverter(val, idx) {\n points[idx] = points[idx] || [];\n points[idx][i] = coordSys.dataToPoint(val, i);\n }\n\n var axes = coordSys.getIndicatorAxes();\n\n for (var i = 0; i < axes.length; i++) {\n data.each(data.mapDimension(axes[i].dim), pointsConverter);\n }\n\n data.each(function (idx) {\n // Close polygon\n points[idx][0] && points[idx].push(points[idx][0].slice());\n data.setItemLayout(idx, points[idx]);\n });\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1128 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1129);\n\n__webpack_require__(1130);\n\n__webpack_require__(1131);\n\nvar sankeyLayout = __webpack_require__(1132);\n\nvar sankeyVisual = __webpack_require__(1133);\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*/\necharts.registerLayout(sankeyLayout);\necharts.registerVisual(sankeyVisual);\n\n/***/ }),\n/* 1129 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar SeriesModel = __webpack_require__(30);\n\nvar createGraphFromNodeEdge = __webpack_require__(360);\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\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*/\n\n/**\n * @file Get initial data and define sankey view's series model\n * @author Deqing Li(annong035@gmail.com)\n */\nvar SankeySeries = SeriesModel.extend({\n type: 'series.sankey',\n layoutInfo: null,\n\n /**\n * Init a graph data structure from data in option series\n *\n * @param {Object} option the object used to config echarts view\n * @return {module:echarts/data/List} storage initial data\n */\n getInitialData: function (option) {\n var links = option.edges || option.links;\n var nodes = option.data || option.nodes;\n\n if (nodes && links) {\n var graph = createGraphFromNodeEdge(nodes, links, this, true);\n return graph.data;\n }\n },\n setNodePosition: function (dataIndex, localPosition) {\n var dataItem = this.option.data[dataIndex];\n dataItem.localX = localPosition[0];\n dataItem.localY = localPosition[1];\n },\n\n /**\n * Return the graphic data structure\n *\n * @return {module:echarts/data/Graph} graphic data structure\n */\n getGraph: function () {\n return this.getData().graph;\n },\n\n /**\n * Get edge data of graphic data structure\n *\n * @return {module:echarts/data/List} data structure of list\n */\n getEdgeData: function () {\n return this.getGraph().edgeData;\n },\n\n /**\n * @override\n */\n formatTooltip: function (dataIndex, multipleSeries, dataType) {\n // dataType === 'node' or empty do not show tooltip by default\n if (dataType === 'edge') {\n var params = this.getDataParams(dataIndex, dataType);\n var rawDataOpt = params.data;\n var html = rawDataOpt.source + ' -- ' + rawDataOpt.target;\n\n if (params.value) {\n html += ' : ' + params.value;\n }\n\n return encodeHTML(html);\n }\n\n return SankeySeries.superCall(this, 'formatTooltip', dataIndex, multipleSeries);\n },\n optionUpdated: function () {\n var option = this.option;\n\n if (option.focusNodeAdjacency === true) {\n option.focusNodeAdjacency = 'allEdges';\n }\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n layout: null,\n // The position of the whole view\n left: '5%',\n top: '5%',\n right: '20%',\n bottom: '5%',\n // Value can be 'vertical'\n orient: 'horizontal',\n // The dx of the node\n nodeWidth: 20,\n // The vertical distance between two nodes\n nodeGap: 8,\n // Control if the node can move or not\n draggable: true,\n // Value can be 'inEdges', 'outEdges', 'allEdges', true (the same as 'allEdges').\n focusNodeAdjacency: false,\n // The number of iterations to change the position of the node\n layoutIterations: 32,\n label: {\n show: true,\n position: 'right',\n color: '#000',\n fontSize: 12\n },\n itemStyle: {\n borderWidth: 1,\n borderColor: '#333'\n },\n lineStyle: {\n color: '#314656',\n opacity: 0.2,\n curveness: 0.5\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n opacity: 0.6\n }\n },\n animationEasing: 'linear',\n animationDuration: 1000\n }\n});\nvar _default = SankeySeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1130 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\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*/\n\n/**\n * @file The file used to draw sankey view\n * @author Deqing Li(annong035@gmail.com)\n */\nvar nodeOpacityPath = ['itemStyle', 'opacity'];\nvar lineOpacityPath = ['lineStyle', 'opacity'];\n\nfunction getItemOpacity(item, opacityPath) {\n return item.getVisual('opacity') || item.getModel().get(opacityPath);\n}\n\nfunction fadeOutItem(item, opacityPath, opacityRatio) {\n var el = item.getGraphicEl();\n var opacity = getItemOpacity(item, opacityPath);\n\n if (opacityRatio != null) {\n opacity == null && (opacity = 1);\n opacity *= opacityRatio;\n }\n\n el.downplay && el.downplay();\n el.traverse(function (child) {\n if (child.type !== 'group') {\n child.setStyle('opacity', opacity);\n }\n });\n}\n\nfunction fadeInItem(item, opacityPath) {\n var opacity = getItemOpacity(item, opacityPath);\n var el = item.getGraphicEl();\n el.highlight && el.highlight();\n el.traverse(function (child) {\n if (child.type !== 'group') {\n child.setStyle('opacity', opacity);\n }\n });\n}\n\nvar SankeyShape = graphic.extendShape({\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n cpx1: 0,\n cpy1: 0,\n cpx2: 0,\n cpy2: 0,\n extent: 0,\n orient: ''\n },\n buildPath: function (ctx, shape) {\n var extent = shape.extent;\n var orient = shape.orient;\n\n if (orient === 'vertical') {\n ctx.moveTo(shape.x1, shape.y1);\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n ctx.lineTo(shape.x2 + extent, shape.y2);\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\n } else {\n ctx.moveTo(shape.x1, shape.y1);\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n ctx.lineTo(shape.x2, shape.y2 + extent);\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\n }\n\n ctx.closePath();\n }\n});\n\nvar _default = echarts.extendChartView({\n type: 'sankey',\n\n /**\n * @private\n * @type {module:echarts/chart/sankey/SankeySeries}\n */\n _model: null,\n\n /**\n * @private\n * @type {boolean}\n */\n _focusAdjacencyDisabled: false,\n render: function (seriesModel, ecModel, api) {\n var sankeyView = this;\n var graph = seriesModel.getGraph();\n var group = this.group;\n var layoutInfo = seriesModel.layoutInfo; // view width\n\n var width = layoutInfo.width; // view height\n\n var height = layoutInfo.height;\n var nodeData = seriesModel.getData();\n var edgeData = seriesModel.getData('edge');\n var orient = seriesModel.get('orient');\n this._model = seriesModel;\n group.removeAll();\n group.attr('position', [layoutInfo.x, layoutInfo.y]); // generate a bezire Curve for each edge\n\n graph.eachEdge(function (edge) {\n var curve = new SankeyShape();\n curve.dataIndex = edge.dataIndex;\n curve.seriesIndex = seriesModel.seriesIndex;\n curve.dataType = 'edge';\n var lineStyleModel = edge.getModel('lineStyle');\n var curvature = lineStyleModel.get('curveness');\n var n1Layout = edge.node1.getLayout();\n var node1Model = edge.node1.getModel();\n var dragX1 = node1Model.get('localX');\n var dragY1 = node1Model.get('localY');\n var n2Layout = edge.node2.getLayout();\n var node2Model = edge.node2.getModel();\n var dragX2 = node2Model.get('localX');\n var dragY2 = node2Model.get('localY');\n var edgeLayout = edge.getLayout();\n var x1;\n var y1;\n var x2;\n var y2;\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n curve.shape.extent = Math.max(1, edgeLayout.dy);\n curve.shape.orient = orient;\n\n if (orient === 'vertical') {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\n cpx1 = x1;\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\n cpx2 = x2;\n cpy2 = y1 * curvature + y2 * (1 - curvature);\n } else {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\n cpy1 = y1;\n cpx2 = x1 * curvature + x2 * (1 - curvature);\n cpy2 = y2;\n }\n\n curve.setShape({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n });\n curve.setStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color\n\n switch (curve.style.fill) {\n case 'source':\n curve.style.fill = edge.node1.getVisual('color');\n break;\n\n case 'target':\n curve.style.fill = edge.node2.getVisual('color');\n break;\n }\n\n graphic.setHoverStyle(curve, edge.getModel('emphasis.lineStyle').getItemStyle());\n group.add(curve);\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\n }); // Generate a rect for each node\n\n graph.eachNode(function (node) {\n var layout = node.getLayout();\n var itemModel = node.getModel();\n var dragX = itemModel.get('localX');\n var dragY = itemModel.get('localY');\n var labelModel = itemModel.getModel('label');\n var labelHoverModel = itemModel.getModel('emphasis.label');\n var rect = new graphic.Rect({\n shape: {\n x: dragX != null ? dragX * width : layout.x,\n y: dragY != null ? dragY * height : layout.y,\n width: layout.dx,\n height: layout.dy\n },\n style: itemModel.getModel('itemStyle').getItemStyle()\n });\n var hoverStyle = node.getModel('emphasis.itemStyle').getItemStyle();\n graphic.setLabelStyle(rect.style, hoverStyle, labelModel, labelHoverModel, {\n labelFetcher: seriesModel,\n labelDataIndex: node.dataIndex,\n defaultText: node.id,\n isRectText: true\n });\n rect.setStyle('fill', node.getVisual('color'));\n graphic.setHoverStyle(rect, hoverStyle);\n group.add(rect);\n nodeData.setItemGraphicEl(node.dataIndex, rect);\n rect.dataType = 'node';\n });\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\n var itemModel = nodeData.getItemModel(dataIndex);\n\n if (itemModel.get('draggable')) {\n el.drift = function (dx, dy) {\n sankeyView._focusAdjacencyDisabled = true;\n this.shape.x += dx;\n this.shape.y += dy;\n this.dirty();\n api.dispatchAction({\n type: 'dragNode',\n seriesId: seriesModel.id,\n dataIndex: nodeData.getRawIndex(dataIndex),\n localX: this.shape.x / width,\n localY: this.shape.y / height\n });\n };\n\n el.ondragend = function () {\n sankeyView._focusAdjacencyDisabled = false;\n };\n\n el.draggable = true;\n el.cursor = 'move';\n }\n\n if (itemModel.get('focusNodeAdjacency')) {\n el.off('mouseover').on('mouseover', function () {\n if (!sankeyView._focusAdjacencyDisabled) {\n api.dispatchAction({\n type: 'focusNodeAdjacency',\n seriesId: seriesModel.id,\n dataIndex: el.dataIndex\n });\n }\n });\n el.off('mouseout').on('mouseout', function () {\n if (!sankeyView._focusAdjacencyDisabled) {\n api.dispatchAction({\n type: 'unfocusNodeAdjacency',\n seriesId: seriesModel.id\n });\n }\n });\n }\n });\n edgeData.eachItemGraphicEl(function (el, dataIndex) {\n var edgeModel = edgeData.getItemModel(dataIndex);\n\n if (edgeModel.get('focusNodeAdjacency')) {\n el.off('mouseover').on('mouseover', function () {\n if (!sankeyView._focusAdjacencyDisabled) {\n api.dispatchAction({\n type: 'focusNodeAdjacency',\n seriesId: seriesModel.id,\n edgeDataIndex: el.dataIndex\n });\n }\n });\n el.off('mouseout').on('mouseout', function () {\n if (!sankeyView._focusAdjacencyDisabled) {\n api.dispatchAction({\n type: 'unfocusNodeAdjacency',\n seriesId: seriesModel.id\n });\n }\n });\n }\n });\n\n if (!this._data && seriesModel.get('animation')) {\n group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {\n group.removeClipPath();\n }));\n }\n\n this._data = seriesModel.getData();\n },\n dispose: function () {},\n focusNodeAdjacency: function (seriesModel, ecModel, api, payload) {\n var data = this._model.getData();\n\n var graph = data.graph;\n var dataIndex = payload.dataIndex;\n var itemModel = data.getItemModel(dataIndex);\n var edgeDataIndex = payload.edgeDataIndex;\n\n if (dataIndex == null && edgeDataIndex == null) {\n return;\n }\n\n var node = graph.getNodeByIndex(dataIndex);\n var edge = graph.getEdgeByIndex(edgeDataIndex);\n graph.eachNode(function (node) {\n fadeOutItem(node, nodeOpacityPath, 0.1);\n });\n graph.eachEdge(function (edge) {\n fadeOutItem(edge, lineOpacityPath, 0.1);\n });\n\n if (node) {\n fadeInItem(node, nodeOpacityPath);\n var focusNodeAdj = itemModel.get('focusNodeAdjacency');\n\n if (focusNodeAdj === 'outEdges') {\n zrUtil.each(node.outEdges, function (edge) {\n if (edge.dataIndex < 0) {\n return;\n }\n\n fadeInItem(edge, lineOpacityPath);\n fadeInItem(edge.node2, nodeOpacityPath);\n });\n } else if (focusNodeAdj === 'inEdges') {\n zrUtil.each(node.inEdges, function (edge) {\n if (edge.dataIndex < 0) {\n return;\n }\n\n fadeInItem(edge, lineOpacityPath);\n fadeInItem(edge.node1, nodeOpacityPath);\n });\n } else if (focusNodeAdj === 'allEdges') {\n zrUtil.each(node.edges, function (edge) {\n if (edge.dataIndex < 0) {\n return;\n }\n\n fadeInItem(edge, lineOpacityPath);\n fadeInItem(edge.node1, nodeOpacityPath);\n fadeInItem(edge.node2, nodeOpacityPath);\n });\n }\n }\n\n if (edge) {\n fadeInItem(edge, lineOpacityPath);\n fadeInItem(edge.node1, nodeOpacityPath);\n fadeInItem(edge.node2, nodeOpacityPath);\n }\n },\n unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) {\n var graph = this._model.getGraph();\n\n graph.eachNode(function (node) {\n fadeOutItem(node, nodeOpacityPath);\n });\n graph.eachEdge(function (edge) {\n fadeOutItem(edge, lineOpacityPath);\n });\n }\n}); // Add animation to the view\n\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width + 20,\n height: rect.height + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1131 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(361);\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*/\n\n/**\n * @file The interactive action of sankey view\n * @author Deqing Li(annong035@gmail.com)\n */\necharts.registerAction({\n type: 'dragNode',\n event: 'dragNode',\n // here can only use 'update' now, other value is not support in echarts.\n update: 'update'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sankey',\n query: payload\n }, function (seriesModel) {\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\n });\n});\n\n/***/ }),\n/* 1132 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar layout = __webpack_require__(16);\n\nvar zrUtil = __webpack_require__(0);\n\nvar _model = __webpack_require__(9);\n\nvar groupData = _model.groupData;\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\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*/\n\n/**\n * @file The layout algorithm of sankey view\n * @author Deqing Li(annong035@gmail.com)\n */\nfunction _default(ecModel, api, payload) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var nodeWidth = seriesModel.get('nodeWidth');\n var nodeGap = seriesModel.get('nodeGap');\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var width = layoutInfo.width;\n var height = layoutInfo.height;\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n computeNodeValues(nodes);\n var filteredNodes = zrUtil.filter(nodes, function (node) {\n return node.getLayout().value === 0;\n });\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\n var orient = seriesModel.get('orient');\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient);\n });\n}\n/**\n * Get the layout position of the whole view\n *\n * @param {module:echarts/model/Series} seriesModel the model object of sankey series\n * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call\n * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view\n */\n\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient) {\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient);\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\n computeEdgeDepths(nodes, orient);\n}\n/**\n * Compute the value of each node by summing the associated edge's value\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n */\n\n\nfunction computeNodeValues(nodes) {\n zrUtil.each(nodes, function (node) {\n var value1 = sum(node.outEdges, getEdgeValue);\n var value2 = sum(node.inEdges, getEdgeValue);\n var value = Math.max(value1, value2);\n node.setLayout({\n value: value\n }, true);\n });\n}\n/**\n * Compute the x-position for each node.\n *\n * Here we use Kahn algorithm to detect cycle when we traverse\n * the node to computer the initial x position.\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n * @param {number} nodeWidth the dx of the node\n * @param {number} width the whole width of the area to draw the view\n */\n\n\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) {\n // Used to mark whether the edge is deleted. if it is deleted,\n // the value is 0, otherwise it is 1.\n var remainEdges = []; // Storage each node's indegree.\n\n var indegreeArr = []; //Used to storage the node with indegree is equal to 0.\n\n var zeroIndegrees = [];\n var nextNode = [];\n var x = 0;\n var kx = 0;\n\n for (var i = 0; i < edges.length; i++) {\n remainEdges[i] = 1;\n }\n\n for (i = 0; i < nodes.length; i++) {\n indegreeArr[i] = nodes[i].inEdges.length;\n\n if (indegreeArr[i] === 0) {\n zeroIndegrees.push(nodes[i]);\n }\n }\n\n while (zeroIndegrees.length) {\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n var node = zeroIndegrees[idx];\n\n if (orient === 'vertical') {\n node.setLayout({\n y: x\n }, true);\n node.setLayout({\n dy: nodeWidth\n }, true);\n } else {\n node.setLayout({\n x: x\n }, true);\n node.setLayout({\n dx: nodeWidth\n }, true);\n }\n\n for (var oidx = 0; oidx < node.outEdges.length; oidx++) {\n var edge = node.outEdges[oidx];\n var indexEdge = edges.indexOf(edge);\n remainEdges[indexEdge] = 0;\n var targetNode = edge.node2;\n var nodeIndex = nodes.indexOf(targetNode);\n\n if (--indegreeArr[nodeIndex] === 0) {\n nextNode.push(targetNode);\n }\n }\n }\n\n ++x;\n zeroIndegrees = nextNode;\n nextNode = [];\n }\n\n for (i = 0; i < remainEdges.length; i++) {}\n\n moveSinksRight(nodes, x, orient);\n\n if (orient === 'vertical') {\n kx = (height - nodeWidth) / (x - 1);\n } else {\n kx = (width - nodeWidth) / (x - 1);\n }\n\n scaleNodeBreadths(nodes, kx, orient);\n}\n/**\n * All the node without outEgdes are assigned maximum x-position and\n * be aligned in the last column.\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n * @param {number} x value (x-1) use to assign to node without outEdges\n * as x-position\n */\n\n\nfunction moveSinksRight(nodes, x, orient) {\n zrUtil.each(nodes, function (node) {\n if (!node.outEdges.length) {\n if (orient === 'vertical') {\n node.setLayout({\n y: x - 1\n }, true);\n } else {\n node.setLayout({\n x: x - 1\n }, true);\n }\n }\n });\n}\n/**\n * Scale node x-position to the width\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n * @param {number} kx multiple used to scale nodes\n */\n\n\nfunction scaleNodeBreadths(nodes, kx, orient) {\n zrUtil.each(nodes, function (node) {\n if (orient === 'vertical') {\n var nodeY = node.getLayout().y * kx;\n node.setLayout({\n y: nodeY\n }, true);\n } else {\n var nodeX = node.getLayout().x * kx;\n node.setLayout({\n x: nodeX\n }, true);\n }\n });\n}\n/**\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n * @param {module:echarts/data/Graph~Edge} edges edge of sankey view\n * @param {number} height the whole height of the area to draw the view\n * @param {number} nodeGap the vertical distance between two nodes\n * in the same column.\n * @param {number} iterations the number of iterations for the algorithm\n */\n\n\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\n initializeNodeDepth(nodes, nodesByBreadth, edges, height, width, nodeGap, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n\n for (var alpha = 1; iterations > 0; iterations--) {\n // 0.99 is a experience parameter, ensure that each iterations of\n // changes as small as possible.\n alpha *= 0.99;\n relaxRightToLeft(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n relaxLeftToRight(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n }\n}\n\nfunction prepareNodesByBreadth(nodes, orient) {\n var nodesByBreadth = [];\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\n var groupResult = groupData(nodes, function (node) {\n return node.getLayout()[keyAttr];\n });\n groupResult.keys.sort(function (a, b) {\n return a - b;\n });\n zrUtil.each(groupResult.keys, function (key) {\n nodesByBreadth.push(groupResult.buckets.get(key));\n });\n return nodesByBreadth;\n}\n/**\n * Compute the original y-position for each node\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n * @param {Array.>} nodesByBreadth\n * group by the array of all sankey nodes based on the nodes x-position.\n * @param {module:echarts/data/Graph~Edge} edges edge of sankey view\n * @param {number} height the whole height of the area to draw the view\n * @param {number} nodeGap the vertical distance between two nodes\n */\n\n\nfunction initializeNodeDepth(nodes, nodesByBreadth, edges, height, width, nodeGap, orient) {\n var kyArray = [];\n zrUtil.each(nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n var ky = 0;\n zrUtil.each(nodes, function (node) {\n sum += node.getLayout().value;\n });\n\n if (orient === 'vertical') {\n ky = (width - (n - 1) * nodeGap) / sum;\n } else {\n ky = (height - (n - 1) * nodeGap) / sum;\n }\n\n kyArray.push(ky);\n });\n kyArray.sort(function (a, b) {\n return a - b;\n });\n var ky0 = kyArray[0];\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node, i) {\n var nodeDy = node.getLayout().value * ky0;\n\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n zrUtil.each(edges, function (edge) {\n var edgeDy = +edge.getValue() * ky0;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}\n/**\n * Resolve the collision of initialized depth (y-position)\n *\n * @param {Array.>} nodesByBreadth\n * group by the array of all sankey nodes based on the nodes x-position.\n * @param {number} nodeGap the vertical distance between two nodes\n * @param {number} height the whole height of the area to draw the view\n */\n\n\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n zrUtil.each(nodesByBreadth, function (nodes) {\n var node;\n var dy;\n var y0 = 0;\n var n = nodes.length;\n var i;\n\n if (orient === 'vertical') {\n var nodeX;\n nodes.sort(function (a, b) {\n return a.getLayout().x - b.getLayout().x;\n });\n\n for (i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout().x;\n\n if (dy > 0) {\n nodeX = node.getLayout().x + dy;\n node.setLayout({\n x: nodeX\n }, true);\n }\n\n y0 = node.getLayout().x + node.getLayout().dx + nodeGap;\n } // If the bottommost node goes outside the bounds, push it back up\n\n\n dy = y0 - nodeGap - width;\n\n if (dy > 0) {\n nodeX = node.getLayout().x - dy;\n node.setLayout({\n x: nodeX\n }, true);\n y0 = nodeX;\n\n for (i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout().x + node.getLayout().dx + nodeGap - y0;\n\n if (dy > 0) {\n nodeX = node.getLayout().x - dy;\n node.setLayout({\n x: nodeX\n }, true);\n }\n\n y0 = node.getLayout().x;\n }\n }\n } else {\n var nodeY;\n nodes.sort(function (a, b) {\n return a.getLayout().y - b.getLayout().y;\n });\n\n for (i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout().y;\n\n if (dy > 0) {\n nodeY = node.getLayout().y + dy;\n node.setLayout({\n y: nodeY\n }, true);\n }\n\n y0 = node.getLayout().y + node.getLayout().dy + nodeGap;\n } // If the bottommost node goes outside the bounds, push it back up\n\n\n dy = y0 - nodeGap - height;\n\n if (dy > 0) {\n nodeY = node.getLayout().y - dy;\n node.setLayout({\n y: nodeY\n }, true);\n y0 = nodeY;\n\n for (i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout().y + node.getLayout().dy + nodeGap - y0;\n\n if (dy > 0) {\n nodeY = node.getLayout().y - dy;\n node.setLayout({\n y: nodeY\n }, true);\n }\n\n y0 = node.getLayout().y;\n }\n }\n }\n });\n}\n/**\n * Change the y-position of the nodes, except most the right side nodes\n *\n * @param {Array.>} nodesByBreadth\n * group by the array of all sankey nodes based on the node x-position.\n * @param {number} alpha parameter used to adjust the nodes y-position\n */\n\n\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.outEdges.length) {\n var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue, orient);\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n\nfunction weightedTarget(edge, orient) {\n return center(edge.node2, orient) * edge.getValue();\n}\n\nfunction weightedSource(edge, orient) {\n return center(edge.node1, orient) * edge.getValue();\n}\n\nfunction center(node, orient) {\n if (orient === 'vertical') {\n return node.getLayout().x + node.getLayout().dx / 2;\n }\n\n return node.getLayout().y + node.getLayout().dy / 2;\n}\n\nfunction getEdgeValue(edge) {\n return edge.getValue();\n}\n\nfunction sum(array, f, orient) {\n var sum = 0;\n var len = array.length;\n var i = -1;\n\n while (++i < len) {\n var value = +f.call(array, array[i], orient);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n\n return sum;\n}\n/**\n * Change the y-position of the nodes, except most the left side nodes\n *\n * @param {Array.>} nodesByBreadth\n * group by the array of all sankey nodes based on the node x-position.\n * @param {number} alpha parameter used to adjust the nodes y-position\n */\n\n\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.inEdges.length) {\n var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue, orient);\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n/**\n * Compute the depth(y-position) of each edge\n *\n * @param {module:echarts/data/Graph~Node} nodes node of sankey view\n */\n\n\nfunction computeEdgeDepths(nodes, orient) {\n zrUtil.each(nodes, function (node) {\n if (orient === 'vertical') {\n node.outEdges.sort(function (a, b) {\n return a.node2.getLayout().x - b.node2.getLayout().x;\n });\n node.inEdges.sort(function (a, b) {\n return a.node1.getLayout().x - b.node1.getLayout().x;\n });\n } else {\n node.outEdges.sort(function (a, b) {\n return a.node2.getLayout().y - b.node2.getLayout().y;\n });\n node.inEdges.sort(function (a, b) {\n return a.node1.getLayout().y - b.node1.getLayout().y;\n });\n }\n });\n zrUtil.each(nodes, function (node) {\n var sy = 0;\n var ty = 0;\n zrUtil.each(node.outEdges, function (edge) {\n edge.setLayout({\n sy: sy\n }, true);\n sy += edge.getLayout().dy;\n });\n zrUtil.each(node.inEdges, function (edge) {\n edge.setLayout({\n ty: ty\n }, true);\n ty += edge.getLayout().dy;\n });\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1133 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar VisualMapping = __webpack_require__(106);\n\nvar zrUtil = __webpack_require__(0);\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*/\n\n/**\n * @file Visual encoding for sankey view\n * @author Deqing Li(annong035@gmail.com)\n */\nfunction _default(ecModel, payload) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n\n if (nodes.length) {\n var minValue = Infinity;\n var maxValue = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n\n if (nodeValue < minValue) {\n minValue = nodeValue;\n }\n\n if (nodeValue > maxValue) {\n maxValue = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue, maxValue],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n node.setVisual('color', mapValueToColor); // If set itemStyle.normal.color\n\n var itemModel = node.getModel();\n var customColor = itemModel.get('itemStyle.color');\n\n if (customColor != null) {\n node.setVisual('color', customColor);\n }\n });\n }\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1134 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1135);\n\n__webpack_require__(1136);\n\nvar visualSymbol = __webpack_require__(107);\n\nvar layoutPoints = __webpack_require__(148);\n\n__webpack_require__(142);\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*/\n// import * as zrUtil from 'zrender/src/core/util';\n// In case developer forget to include grid component\necharts.registerVisual(visualSymbol('scatter', 'circle'));\necharts.registerLayout(layoutPoints('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/***/ }),\n/* 1135 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar createListFromArray = __webpack_require__(70);\n\nvar SeriesModel = __webpack_require__(30);\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*/\nvar _default = SeriesModel.extend({\n type: 'series.scatter',\n dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'],\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n },\n brushSelector: 'point',\n getProgressive: function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n // PENDING\n return this.option.large ? 5e3 : this.get('progressive');\n }\n\n return progressive;\n },\n getProgressiveThreshold: function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n // PENDING\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n },\n defaultOption: {\n coordinateSystem: 'cartesian2d',\n zlevel: 0,\n z: 2,\n legendHoverLink: true,\n hoverAnimation: true,\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // symbol: null, // 图形类型\n symbolSize: 10,\n // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2\n // symbolRotate: null, // 图形旋转控制\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n // cursor: null,\n // label: {\n // show: false\n // distance: 5,\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为\n // 'inside'|'left'|'right'|'top'|'bottom'\n // 默认使用全局文本样式,详见TEXTSTYLE\n // },\n itemStyle: {\n opacity: 0.8 // color: 各异\n // progressive: null\n\n }\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1136 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar SymbolDraw = __webpack_require__(138);\n\nvar LargeSymbolDraw = __webpack_require__(1098);\n\nvar pointsLayout = __webpack_require__(148);\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*/\necharts.extendChartView({\n type: 'scatter',\n render: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.updateData(data);\n this._finished = true;\n },\n incrementalPrepareRender: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.incrementalPrepareUpdate(data);\n this._finished = false;\n },\n incrementalRender: function (taskParams, seriesModel, ecModel) {\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n },\n updateTransform: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared\n // PENDING\n\n this.group.dirty();\n\n if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) {\n return {\n update: true\n };\n } else {\n var res = pointsLayout().reset(seriesModel);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout(data);\n }\n },\n _updateSymbolDraw: function (data, seriesModel) {\n var symbolDraw = this._symbolDraw;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\n symbolDraw && symbolDraw.remove();\n symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n\n this.group.add(symbolDraw.group);\n return symbolDraw;\n },\n remove: function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n this._symbolDraw = null;\n },\n dispose: function () {}\n});\n\n/***/ }),\n/* 1137 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\n__webpack_require__(1139);\n\n__webpack_require__(1140);\n\n__webpack_require__(1141);\n\nvar dataColor = __webpack_require__(184);\n\nvar sunburstLayout = __webpack_require__(1142);\n\nvar dataFilter = __webpack_require__(149);\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*/\necharts.registerVisual(zrUtil.curry(dataColor, 'sunburst'));\necharts.registerLayout(zrUtil.curry(sunburstLayout, 'sunburst'));\necharts.registerProcessor(zrUtil.curry(dataFilter, 'sunburst'));\n\n/***/ }),\n/* 1138 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\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*/\nvar NodeHighlightPolicy = {\n NONE: 'none',\n // not downplay others\n DESCENDANT: 'descendant',\n ANCESTOR: 'ancestor',\n SELF: 'self'\n};\nvar DEFAULT_SECTOR_Z = 2;\nvar DEFAULT_TEXT_Z = 4;\n/**\n * Sunburstce of Sunburst including Sector, Label, LabelLine\n * @constructor\n * @extends {module:zrender/graphic/Group}\n */\n\nfunction SunburstPiece(node, seriesModel, ecModel) {\n graphic.Group.call(this);\n var sector = new graphic.Sector({\n z2: DEFAULT_SECTOR_Z\n });\n sector.seriesIndex = seriesModel.seriesIndex;\n var text = new graphic.Text({\n z2: DEFAULT_TEXT_Z,\n silent: node.getModel('label').get('silent')\n });\n this.add(sector);\n this.add(text);\n this.updateData(true, node, 'normal', seriesModel, ecModel); // Hover to change label and labelLine\n\n function onEmphasis() {\n text.ignore = text.hoverIgnore;\n }\n\n function onNormal() {\n text.ignore = text.normalIgnore;\n }\n\n this.on('emphasis', onEmphasis).on('normal', onNormal).on('mouseover', onEmphasis).on('mouseout', onNormal);\n}\n\nvar SunburstPieceProto = SunburstPiece.prototype;\n\nSunburstPieceProto.updateData = function (firstCreate, node, state, seriesModel, ecModel) {\n this.node = node;\n node.piece = this;\n seriesModel = seriesModel || this._seriesModel;\n ecModel = ecModel || this._ecModel;\n var sector = this.childAt(0);\n sector.dataIndex = node.dataIndex;\n var itemModel = node.getModel();\n var layout = node.getLayout(); // if (!layout) {\n // console.log(node.getLayout());\n // }\n\n var sectorShape = zrUtil.extend({}, layout);\n sectorShape.label = null;\n var visualColor = getNodeColor(node, seriesModel, ecModel);\n fillDefaultColor(node, seriesModel, visualColor);\n var normalStyle = itemModel.getModel('itemStyle').getItemStyle();\n var style;\n\n if (state === 'normal') {\n style = normalStyle;\n } else {\n var stateStyle = itemModel.getModel(state + '.itemStyle').getItemStyle();\n style = zrUtil.merge(stateStyle, normalStyle);\n }\n\n style = zrUtil.defaults({\n lineJoin: 'bevel',\n fill: style.fill || visualColor\n }, style);\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n sector.shape.r = layout.r0;\n graphic.updateProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, node.dataIndex);\n sector.useStyle(style);\n } else if (typeof style.fill === 'object' && style.fill.type || typeof sector.style.fill === 'object' && sector.style.fill.type) {\n // Disable animation for gradient since no interpolation method\n // is supported for gradient\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel);\n sector.useStyle(style);\n } else {\n graphic.updateProps(sector, {\n shape: sectorShape,\n style: style\n }, seriesModel);\n }\n\n this._updateLabel(seriesModel, visualColor, state);\n\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n\n if (firstCreate) {\n var highlightPolicy = seriesModel.getShallow('highlightPolicy');\n\n this._initEvents(sector, node, seriesModel, highlightPolicy);\n }\n\n this._seriesModel = seriesModel || this._seriesModel;\n this._ecModel = ecModel || this._ecModel;\n};\n\nSunburstPieceProto.onEmphasis = function (highlightPolicy) {\n var that = this;\n this.node.hostTree.root.eachNode(function (n) {\n if (n.piece) {\n if (that.node === n) {\n n.piece.updateData(false, n, 'emphasis');\n } else if (isNodeHighlighted(n, that.node, highlightPolicy)) {\n n.piece.childAt(0).trigger('highlight');\n } else if (highlightPolicy !== NodeHighlightPolicy.NONE) {\n n.piece.childAt(0).trigger('downplay');\n }\n }\n });\n};\n\nSunburstPieceProto.onNormal = function () {\n this.node.hostTree.root.eachNode(function (n) {\n if (n.piece) {\n n.piece.updateData(false, n, 'normal');\n }\n });\n};\n\nSunburstPieceProto.onHighlight = function () {\n this.updateData(false, this.node, 'highlight');\n};\n\nSunburstPieceProto.onDownplay = function () {\n this.updateData(false, this.node, 'downplay');\n};\n\nSunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) {\n var itemModel = this.node.getModel();\n var normalModel = itemModel.getModel('label');\n var labelModel = state === 'normal' || state === 'emphasis' ? normalModel : itemModel.getModel(state + '.label');\n var labelHoverModel = itemModel.getModel('emphasis.label');\n var text = zrUtil.retrieve(seriesModel.getFormattedLabel(this.node.dataIndex, 'normal', null, null, 'label'), this.node.name);\n\n if (getLabelAttr('show') === false) {\n text = '';\n }\n\n var layout = this.node.getLayout();\n var labelMinAngle = labelModel.get('minAngle');\n\n if (labelMinAngle == null) {\n labelMinAngle = normalModel.get('minAngle');\n }\n\n labelMinAngle = labelMinAngle / 180 * Math.PI;\n var angle = layout.endAngle - layout.startAngle;\n\n if (labelMinAngle != null && Math.abs(angle) < labelMinAngle) {\n // Not displaying text when angle is too small\n text = '';\n }\n\n var label = this.childAt(1);\n graphic.setLabelStyle(label.style, label.hoverStyle || {}, normalModel, labelHoverModel, {\n defaultText: labelModel.getShallow('show') ? text : null,\n autoColor: visualColor,\n useInsideStyle: true\n });\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var r;\n var labelPosition = getLabelAttr('position');\n var labelPadding = getLabelAttr('distance') || 0;\n var textAlign = getLabelAttr('align');\n\n if (labelPosition === 'outside') {\n r = layout.r + labelPadding;\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\n } else {\n if (!textAlign || textAlign === 'center') {\n r = (layout.r + layout.r0) / 2;\n textAlign = 'center';\n } else if (textAlign === 'left') {\n r = layout.r0 + labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'right';\n }\n } else if (textAlign === 'right') {\n r = layout.r - labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'left';\n }\n }\n }\n\n label.attr('style', {\n text: text,\n textAlign: textAlign,\n textVerticalAlign: getLabelAttr('verticalAlign') || 'middle',\n opacity: getLabelAttr('opacity')\n });\n var textX = r * dx + layout.cx;\n var textY = r * dy + layout.cy;\n label.attr('position', [textX, textY]);\n var rotateType = getLabelAttr('rotate');\n var rotate = 0;\n\n if (rotateType === 'radial') {\n rotate = -midAngle;\n\n if (rotate < -Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = Math.PI / 2 - midAngle;\n\n if (rotate > Math.PI / 2) {\n rotate -= Math.PI;\n } else if (rotate < -Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (typeof rotateType === 'number') {\n rotate = rotateType * Math.PI / 180;\n }\n\n label.attr('rotation', rotate);\n\n function getLabelAttr(name) {\n var stateAttr = labelModel.get(name);\n\n if (stateAttr == null) {\n return normalModel.get(name);\n } else {\n return stateAttr;\n }\n }\n};\n\nSunburstPieceProto._initEvents = function (sector, node, seriesModel, highlightPolicy) {\n sector.off('mouseover').off('mouseout').off('emphasis').off('normal');\n var that = this;\n\n var onEmphasis = function () {\n that.onEmphasis(highlightPolicy);\n };\n\n var onNormal = function () {\n that.onNormal();\n };\n\n var onDownplay = function () {\n that.onDownplay();\n };\n\n var onHighlight = function () {\n that.onHighlight();\n };\n\n if (seriesModel.isAnimationEnabled()) {\n sector.on('mouseover', onEmphasis).on('mouseout', onNormal).on('emphasis', onEmphasis).on('normal', onNormal).on('downplay', onDownplay).on('highlight', onHighlight);\n }\n};\n\nzrUtil.inherits(SunburstPiece, graphic.Group);\nvar _default = SunburstPiece;\n/**\n * Get node color\n *\n * @param {TreeNode} node the node to get color\n * @param {module:echarts/model/Series} seriesModel series\n * @param {module:echarts/model/Global} ecModel echarts defaults\n */\n\nfunction getNodeColor(node, seriesModel, ecModel) {\n // Color from visualMap\n var visualColor = node.getVisual('color');\n var visualMetaList = node.getVisual('visualMeta');\n\n if (!visualMetaList || visualMetaList.length === 0) {\n // Use first-generation color if has no visualMap\n visualColor = null;\n } // Self color or level color\n\n\n var color = node.getModel('itemStyle').get('color');\n\n if (color) {\n return color;\n } else if (visualColor) {\n // Color mapping\n return visualColor;\n } else if (node.depth === 0) {\n // Virtual root node\n return ecModel.option.color[0];\n } else {\n // First-generation color\n var length = ecModel.option.color.length;\n color = ecModel.option.color[getRootId(node) % length];\n }\n\n return color;\n}\n/**\n * Get index of root in sorted order\n *\n * @param {TreeNode} node current node\n * @return {number} index in root\n */\n\n\nfunction getRootId(node) {\n var ancestor = node;\n\n while (ancestor.depth > 1) {\n ancestor = ancestor.parentNode;\n }\n\n var virtualRoot = node.getAncestors()[0];\n return zrUtil.indexOf(virtualRoot.children, ancestor);\n}\n\nfunction isNodeHighlighted(node, activeNode, policy) {\n if (policy === NodeHighlightPolicy.NONE) {\n return false;\n } else if (policy === NodeHighlightPolicy.SELF) {\n return node === activeNode;\n } else if (policy === NodeHighlightPolicy.ANCESTOR) {\n return node === activeNode || node.isAncestorOf(activeNode);\n } else {\n return node === activeNode || node.isDescendantOf(activeNode);\n }\n} // Fix tooltip callback function params.color incorrect when pick a default color\n\n\nfunction fillDefaultColor(node, seriesModel, color) {\n var data = seriesModel.getData();\n data.setItemVisual(node.dataIndex, 'color', color);\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1139 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar Tree = __webpack_require__(262);\n\nvar _treeHelper = __webpack_require__(99);\n\nvar wrapTreePathInfo = _treeHelper.wrapTreePathInfo;\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*/\nvar _default = SeriesModel.extend({\n type: 'series.sunburst',\n\n /**\n * @type {module:echarts/data/Tree~Node}\n */\n _viewRoot: null,\n getInitialData: function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levels = option.levels || []; // levels = option.levels = setDefault(levels, ecModel);\n\n var treeOption = {};\n treeOption.levels = levels; // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n return Tree.createTree(root, this, treeOption).data;\n },\n optionUpdated: function () {\n this.resetViewRoot();\n },\n\n /*\n * @override\n */\n getDataParams: function (dataIndex) {\n var params = SeriesModel.prototype.getDataParams.apply(this, arguments);\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n percentPrecision: 2,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // Policy of highlighting pieces when hover on one\n // Valid values: 'none' (for not downplay others), 'descendant',\n // 'ancestor', 'self'\n highlightPolicy: 'descendant',\n // 'rootToNode', 'link', or false\n nodeClick: 'rootToNode',\n renderLabelForZeroData: false,\n label: {\n // could be: 'radial', 'tangential', or 'none'\n rotate: 'radial',\n show: true,\n opacity: 1,\n // 'left' is for inner side of inside, and 'right' is for outter\n // side for inside\n align: 'center',\n position: 'inside',\n distance: 5,\n silent: true,\n emphasis: {}\n },\n itemStyle: {\n borderWidth: 1,\n borderColor: 'white',\n borderType: 'solid',\n shadowBlur: 0,\n shadowColor: 'rgba(0, 0, 0, 0.2)',\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1,\n emphasis: {},\n highlight: {\n opacity: 1\n },\n downplay: {\n opacity: 0.9\n }\n },\n // Animation type canbe expansion, scale\n animationType: 'expansion',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n animationEasing: 'cubicOut',\n data: [],\n levels: [],\n\n /**\n * Sort order.\n *\n * Valid values: 'desc', 'asc', null, or callback function.\n * 'desc' and 'asc' for descend and ascendant order;\n * null for not sorting;\n * example of callback function:\n * function(nodeA, nodeB) {\n * return nodeA.getValue() - nodeB.getValue();\n * }\n */\n sort: 'desc'\n },\n getViewRoot: function () {\n return this._viewRoot;\n },\n\n /**\n * @param {module:echarts/data/Tree~Node} [viewRoot]\n */\n resetViewRoot: function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n }\n});\n/**\n * @param {Object} dataNode\n */\n\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1140 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar ChartView = __webpack_require__(65);\n\nvar SunburstPiece = __webpack_require__(1138);\n\nvar DataDiffer = __webpack_require__(102);\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*/\nvar ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\nvar SunburstView = ChartView.extend({\n type: 'sunburst',\n init: function () {},\n render: function (seriesModel, ecModel, api, payload) {\n var that = this;\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var data = seriesModel.getData();\n var virtualRoot = data.tree.root;\n var newRoot = seriesModel.getViewRoot();\n var group = this.group;\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\n var newChildren = [];\n newRoot.eachNode(function (node) {\n newChildren.push(node);\n });\n var oldChildren = this._oldChildren || [];\n dualTravel(newChildren, oldChildren);\n renderRollUp(virtualRoot, newRoot);\n\n if (payload && payload.highlight && payload.highlight.piece) {\n var highlightPolicy = seriesModel.getShallow('highlightPolicy');\n payload.highlight.piece.onEmphasis(highlightPolicy);\n } else if (payload && payload.unhighlight) {\n var piece = this.virtualPiece;\n\n if (!piece && virtualRoot.children.length) {\n piece = virtualRoot.children[0].piece;\n }\n\n if (piece) {\n piece.onNormal();\n }\n }\n\n this._initEvents();\n\n this._oldChildren = newChildren;\n\n function dualTravel(newChildren, oldChildren) {\n if (newChildren.length === 0 && oldChildren.length === 0) {\n return;\n }\n\n new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n\n function getKey(node) {\n return node.getId();\n }\n\n function processNode(newId, oldId) {\n var newNode = newId == null ? null : newChildren[newId];\n var oldNode = oldId == null ? null : oldChildren[oldId];\n doRenderNode(newNode, oldNode);\n }\n }\n\n function doRenderNode(newNode, oldNode) {\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\n // Not render data with value 0\n newNode = null;\n }\n\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\n if (oldNode && oldNode.piece) {\n if (newNode) {\n // Update\n oldNode.piece.updateData(false, newNode, 'normal', seriesModel, ecModel); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\n } else {\n // Remove\n removeNode(oldNode);\n }\n } else if (newNode) {\n // Add\n var piece = new SunburstPiece(newNode, seriesModel, ecModel);\n group.add(piece); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, piece);\n }\n }\n }\n\n function removeNode(node) {\n if (!node) {\n return;\n }\n\n if (node.piece) {\n group.remove(node.piece);\n node.piece = null;\n }\n }\n\n function renderRollUp(virtualRoot, viewRoot) {\n if (viewRoot.depth > 0) {\n // Render\n if (that.virtualPiece) {\n // Update\n that.virtualPiece.updateData(false, virtualRoot, 'normal', seriesModel, ecModel);\n } else {\n // Add\n that.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel);\n group.add(that.virtualPiece);\n }\n\n if (viewRoot.piece._onclickEvent) {\n viewRoot.piece.off('click', viewRoot.piece._onclickEvent);\n }\n\n var event = function (e) {\n that._rootToNode(viewRoot.parentNode);\n };\n\n viewRoot.piece._onclickEvent = event;\n that.virtualPiece.on('click', event);\n } else if (that.virtualPiece) {\n // Remove\n group.remove(that.virtualPiece);\n that.virtualPiece = null;\n }\n }\n },\n dispose: function () {},\n\n /**\n * @private\n */\n _initEvents: function () {\n var that = this;\n\n var event = function (e) {\n var targetFound = false;\n var viewRoot = that.seriesModel.getViewRoot();\n viewRoot.eachNode(function (node) {\n if (!targetFound && node.piece && node.piece.childAt(0) === e.target) {\n var nodeClick = node.getModel().get('nodeClick');\n\n if (nodeClick === 'rootToNode') {\n that._rootToNode(node);\n } else if (nodeClick === 'link') {\n var itemModel = node.getModel();\n var link = itemModel.get('link');\n\n if (link) {\n var linkTarget = itemModel.get('target', true) || '_blank';\n window.open(link, linkTarget);\n }\n }\n\n targetFound = true;\n }\n });\n };\n\n if (this.group._onclickEvent) {\n this.group.off('click', this.group._onclickEvent);\n }\n\n this.group.on('click', event);\n this.group._onclickEvent = event;\n },\n\n /**\n * @private\n */\n _rootToNode: function (node) {\n if (node !== this.seriesModel.getViewRoot()) {\n this.api.dispatchAction({\n type: ROOT_TO_NODE_ACTION,\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: node\n });\n }\n },\n\n /**\n * @implement\n */\n containPoint: function (point, seriesModel) {\n var treeRoot = seriesModel.getData();\n var itemLayout = treeRoot.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n }\n});\nvar _default = SunburstView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1141 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar helper = __webpack_require__(99);\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*/\n\n/**\n * @file Sunburst action\n */\nvar ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\necharts.registerAction({\n type: ROOT_TO_NODE_ACTION,\n update: 'updateView'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var targetInfo = helper.retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\n});\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\necharts.registerAction({\n type: HIGHLIGHT_ACTION,\n update: 'updateView'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleHighlight);\n\n function handleHighlight(model, index) {\n var targetInfo = helper.retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\n\n if (targetInfo) {\n payload.highlight = targetInfo.node;\n }\n }\n});\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\necharts.registerAction({\n type: UNHIGHLIGHT_ACTION,\n update: 'updateView'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleUnhighlight);\n\n function handleUnhighlight(model, index) {\n payload.unhighlight = true;\n }\n});\n\n/***/ }),\n/* 1142 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\n\nvar zrUtil = __webpack_require__(0);\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*/\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\n\nfunction _default(seriesType, ecModel, api, payload) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var virtualRoot = seriesModel.getData().tree.root;\n var treeRoot = seriesModel.getViewRoot();\n var rootDepth = treeRoot.depth;\n var sort = seriesModel.get('sort');\n\n if (sort != null) {\n initChildren(treeRoot, sort);\n }\n\n var validDataCount = 0;\n zrUtil.each(treeRoot.children, function (child) {\n !isNaN(child.getValue()) && validDataCount++;\n });\n var sum = treeRoot.getValue(); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var renderRollupNode = treeRoot.depth > 0;\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\n var rPerLevel = (r - r0) / (levels || 1);\n var clockwise = seriesModel.get('clockwise');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle\n\n var restAngle = PI2;\n var valueSumLargerThanMinAngle = 0;\n var dir = clockwise ? 1 : -1;\n /**\n * Render a tree\n * @return increased angle\n */\n\n var renderNode = function (node, startAngle) {\n if (!node) {\n return;\n }\n\n var endAngle = startAngle; // Render self\n\n if (node !== virtualRoot) {\n // Tree node is virtual, so it doesn't need to be drawn\n var value = node.getValue();\n var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n\n if (angle < minAngle) {\n angle = minAngle;\n restAngle -= minAngle;\n } else {\n valueSumLargerThanMinAngle += value;\n }\n\n endAngle = startAngle + dir * angle;\n var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);\n var rStart = r0 + rPerLevel * depth;\n var rEnd = r0 + rPerLevel * (depth + 1);\n var itemModel = node.getModel();\n\n if (itemModel.get('r0') != null) {\n rStart = parsePercent(itemModel.get('r0'), size / 2);\n }\n\n if (itemModel.get('r') != null) {\n rEnd = parsePercent(itemModel.get('r'), size / 2);\n }\n\n node.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n } // Render children\n\n\n if (node.children && node.children.length) {\n // currentAngle = startAngle;\n var siblingAngle = 0;\n zrUtil.each(node.children, function (node) {\n siblingAngle += renderNode(node, startAngle + siblingAngle);\n });\n }\n\n return endAngle - startAngle;\n }; // Virtual root node for roll up\n\n\n if (renderRollupNode) {\n var rStart = r0;\n var rEnd = r0 + rPerLevel;\n var angle = Math.PI * 2;\n virtualRoot.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: startAngle + angle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n }\n\n renderNode(treeRoot, startAngle);\n });\n}\n/**\n * Init node children by order and update visual\n *\n * @param {TreeNode} node root node\n * @param {boolean} isAsc if is in ascendant order\n */\n\n\nfunction initChildren(node, isAsc) {\n var children = node.children || [];\n node.children = sort(children, isAsc); // Init children recursively\n\n if (children.length) {\n zrUtil.each(node.children, function (child) {\n initChildren(child, isAsc);\n });\n }\n}\n/**\n * Sort children nodes\n *\n * @param {TreeNode[]} children children of node to be sorted\n * @param {string | function | null} sort sort method\n * See SunburstSeries.js for details.\n */\n\n\nfunction sort(children, sortOrder) {\n if (typeof sortOrder === 'function') {\n return children.sort(sortOrder);\n } else {\n var isAsc = sortOrder === 'asc';\n return children.sort(function (a, b) {\n var diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : -1);\n return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1) : diff;\n });\n }\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1143 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(385);\n\n__webpack_require__(1144);\n\n__webpack_require__(1145);\n\nvar themeRiverLayout = __webpack_require__(1146);\n\nvar themeRiverVisual = __webpack_require__(1147);\n\nvar dataFilter = __webpack_require__(149);\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*/\necharts.registerLayout(themeRiverLayout);\necharts.registerVisual(themeRiverVisual);\necharts.registerProcessor(dataFilter('themeRiver'));\n\n/***/ }),\n/* 1144 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar SeriesModel = __webpack_require__(30);\n\nvar createDimensions = __webpack_require__(118);\n\nvar _dimensionHelper = __webpack_require__(146);\n\nvar getDimensionTypeByAxis = _dimensionHelper.getDimensionTypeByAxis;\n\nvar List = __webpack_require__(49);\n\nvar zrUtil = __webpack_require__(0);\n\nvar _model = __webpack_require__(9);\n\nvar groupData = _model.groupData;\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\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*/\n\n/**\n * @file Define the themeRiver view's series model\n * @author Deqing Li(annong035@gmail.com)\n */\nvar DATA_NAME_INDEX = 2;\nvar ThemeRiverSeries = SeriesModel.extend({\n type: 'series.themeRiver',\n dependencies: ['singleAxis'],\n\n /**\n * @readOnly\n * @type {module:zrender/core/util#HashMap}\n */\n nameMap: null,\n\n /**\n * @override\n */\n init: function (option) {\n // eslint-disable-next-line\n ThemeRiverSeries.superApply(this, 'init', arguments); // Put this function here is for the sake of consistency of code style.\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n this.legendDataProvider = function () {\n return this.getRawData();\n };\n },\n\n /**\n * If there is no value of a certain point in the time for some event,set it value to 0.\n *\n * @param {Array} data initial data in the option\n * @return {Array}\n */\n fixData: function (data) {\n var rawDataLength = data.length; // grouped data by name\n\n var groupResult = groupData(data, function (item) {\n return item[2];\n });\n var layData = [];\n groupResult.buckets.each(function (items, key) {\n layData.push({\n name: key,\n dataList: items\n });\n });\n var layerNum = layData.length;\n var largestLayer = -1;\n var index = -1;\n\n for (var i = 0; i < layerNum; ++i) {\n var len = layData[i].dataList.length;\n\n if (len > largestLayer) {\n largestLayer = len;\n index = i;\n }\n }\n\n for (var k = 0; k < layerNum; ++k) {\n if (k === index) {\n continue;\n }\n\n var name = layData[k].name;\n\n for (var j = 0; j < largestLayer; ++j) {\n var timeValue = layData[index].dataList[j][0];\n var length = layData[k].dataList.length;\n var keyIndex = -1;\n\n for (var l = 0; l < length; ++l) {\n var value = layData[k].dataList[l][0];\n\n if (value === timeValue) {\n keyIndex = l;\n break;\n }\n }\n\n if (keyIndex === -1) {\n data[rawDataLength] = [];\n data[rawDataLength][0] = timeValue;\n data[rawDataLength][1] = 0;\n data[rawDataLength][2] = name;\n rawDataLength++;\n }\n }\n }\n\n return data;\n },\n\n /**\n * @override\n * @param {Object} option the initial option that user gived\n * @param {module:echarts/model/Model} ecModel the model object for themeRiver option\n * @return {module:echarts/data/List}\n */\n getInitialData: function (option, ecModel) {\n var singleAxisModel = ecModel.queryComponents({\n mainType: 'singleAxis',\n index: this.get('singleAxisIndex'),\n id: this.get('singleAxisId')\n })[0];\n var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined\n\n var filterData = zrUtil.filter(option.data, function (dataItem) {\n return dataItem[2] !== undefined;\n }); // ??? TODO design a stage to transfer data for themeRiver and lines?\n\n var data = this.fixData(filterData || []);\n var nameList = [];\n var nameMap = this.nameMap = zrUtil.createHashMap();\n var count = 0;\n\n for (var i = 0; i < data.length; ++i) {\n nameList.push(data[i][DATA_NAME_INDEX]);\n\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\n nameMap.set(data[i][DATA_NAME_INDEX], count);\n count++;\n }\n }\n\n var dimensionsInfo = createDimensions(data, {\n coordDimensions: ['single'],\n dimensionsDefine: [{\n name: 'time',\n type: getDimensionTypeByAxis(axisType)\n }, {\n name: 'value',\n type: 'float'\n }, {\n name: 'name',\n type: 'ordinal'\n }],\n encodeDefine: {\n single: 0,\n value: 1,\n itemName: 2\n }\n });\n var list = new List(dimensionsInfo, this);\n list.initData(data);\n return list;\n },\n\n /**\n * The raw data is divided into multiple layers and each layer\n * has same name.\n *\n * @return {Array.>}\n */\n getLayerSeries: function () {\n var data = this.getData();\n var lenCount = data.count();\n var indexArr = [];\n\n for (var i = 0; i < lenCount; ++i) {\n indexArr[i] = i;\n }\n\n var timeDim = data.mapDimension('single'); // data group by name\n\n var groupResult = groupData(indexArr, function (index) {\n return data.get('name', index);\n });\n var layerSeries = [];\n groupResult.buckets.each(function (items, key) {\n items.sort(function (index1, index2) {\n return data.get(timeDim, index1) - data.get(timeDim, index2);\n });\n layerSeries.push({\n name: key,\n indices: items\n });\n });\n return layerSeries;\n },\n\n /**\n * Get data indices for show tooltip content\n *\n * @param {Array.|string} dim single coordinate dimension\n * @param {number} value axis value\n * @param {module:echarts/coord/single/SingleAxis} baseAxis single Axis used\n * the themeRiver.\n * @return {Object} {dataIndices, nestestValue}\n */\n getAxisTooltipData: function (dim, value, baseAxis) {\n if (!zrUtil.isArray(dim)) {\n dim = dim ? [dim] : [];\n }\n\n var data = this.getData();\n var layerSeries = this.getLayerSeries();\n var indices = [];\n var layerNum = layerSeries.length;\n var nestestValue;\n\n for (var i = 0; i < layerNum; ++i) {\n var minDist = Number.MAX_VALUE;\n var nearestIdx = -1;\n var pointNum = layerSeries[i].indices.length;\n\n for (var j = 0; j < pointNum; ++j) {\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\n var dist = Math.abs(theValue - value);\n\n if (dist <= minDist) {\n nestestValue = theValue;\n minDist = dist;\n nearestIdx = layerSeries[i].indices[j];\n }\n }\n\n indices.push(nearestIdx);\n }\n\n return {\n dataIndices: indices,\n nestestValue: nestestValue\n };\n },\n\n /**\n * @override\n * @param {number} dataIndex index of data\n */\n formatTooltip: function (dataIndex) {\n var data = this.getData();\n var htmlName = data.getName(dataIndex);\n var htmlValue = data.get(data.mapDimension('value'), dataIndex);\n\n if (isNaN(htmlValue) || htmlValue == null) {\n htmlValue = '-';\n }\n\n return encodeHTML(htmlName + ' : ' + htmlValue);\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'singleAxis',\n // gap in axis's orthogonal orientation\n boundaryGap: ['10%', '10%'],\n // legendHoverLink: true,\n singleAxisIndex: 0,\n animationEasing: 'linear',\n label: {\n margin: 4,\n show: true,\n position: 'left',\n color: '#000',\n fontSize: 11\n },\n emphasis: {\n label: {\n show: true\n }\n }\n }\n});\nvar _default = ThemeRiverSeries;\nmodule.exports = _default;\n\n/***/ }),\n/* 1145 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(process) {\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\nvar echarts = __webpack_require__(3);\n\nvar _poly = __webpack_require__(365);\n\nvar Polygon = _poly.Polygon;\n\nvar graphic = __webpack_require__(5);\n\nvar _util = __webpack_require__(0);\n\nvar bind = _util.bind;\nvar extend = _util.extend;\n\nvar DataDiffer = __webpack_require__(102);\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*/\n\n/**\n * @file The file used to draw themeRiver view\n * @author Deqing Li(annong035@gmail.com)\n */\nvar _default = echarts.extendChartView({\n type: 'themeRiver',\n init: function () {\n this._layers = [];\n },\n render: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var group = this.group;\n var layerSeries = seriesModel.getLayerSeries();\n var layoutInfo = data.getLayout('layoutInfo');\n var rect = layoutInfo.rect;\n var boundaryGap = layoutInfo.boundaryGap;\n group.attr('position', [0, rect.y + boundaryGap[0]]);\n\n function keyGetter(item) {\n return item.name;\n }\n\n var dataDiffer = new DataDiffer(this._layersSeries || [], layerSeries, keyGetter, keyGetter);\n var newLayersGroups = {};\n dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute();\n\n function process(status, idx, oldIdx) {\n var oldLayersGroups = this._layers;\n\n if (status === 'remove') {\n group.remove(oldLayersGroups[idx]);\n return;\n }\n\n var points0 = [];\n var points1 = [];\n var color;\n var indices = layerSeries[idx].indices;\n\n for (var j = 0; j < indices.length; j++) {\n var layout = data.getItemLayout(indices[j]);\n var x = layout.x;\n var y0 = layout.y0;\n var y = layout.y;\n points0.push([x, y0]);\n points1.push([x, y0 + y]);\n color = data.getItemVisual(indices[j], 'color');\n }\n\n var polygon;\n var text;\n var textLayout = data.getItemLayout(indices[0]);\n var itemModel = data.getItemModel(indices[j - 1]);\n var labelModel = itemModel.getModel('label');\n var margin = labelModel.get('margin');\n\n if (status === 'add') {\n var layerGroup = newLayersGroups[idx] = new graphic.Group();\n polygon = new Polygon({\n shape: {\n points: points0,\n stackedOnPoints: points1,\n smooth: 0.4,\n stackedOnSmooth: 0.4,\n smoothConstraint: false\n },\n z2: 0\n });\n text = new graphic.Text({\n style: {\n x: textLayout.x - margin,\n y: textLayout.y0 + textLayout.y / 2\n }\n });\n layerGroup.add(polygon);\n layerGroup.add(text);\n group.add(layerGroup);\n polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\n polygon.removeClipPath();\n }));\n } else {\n var layerGroup = oldLayersGroups[oldIdx];\n polygon = layerGroup.childAt(0);\n text = layerGroup.childAt(1);\n group.add(layerGroup);\n newLayersGroups[idx] = layerGroup;\n graphic.updateProps(polygon, {\n shape: {\n points: points0,\n stackedOnPoints: points1\n }\n }, seriesModel);\n graphic.updateProps(text, {\n style: {\n x: textLayout.x - margin,\n y: textLayout.y0 + textLayout.y / 2\n }\n }, seriesModel);\n }\n\n var hoverItemStyleModel = itemModel.getModel('emphasis.itemStyle');\n var itemStyleModel = itemModel.getModel('itemStyle');\n graphic.setTextStyle(text.style, labelModel, {\n text: labelModel.get('show') ? seriesModel.getFormattedLabel(indices[j - 1], 'normal') || data.getName(indices[j - 1]) : null,\n textVerticalAlign: 'middle'\n });\n polygon.setStyle(extend({\n fill: color\n }, itemStyleModel.getItemStyle(['color'])));\n graphic.setHoverStyle(polygon, hoverItemStyleModel.getItemStyle());\n }\n\n this._layersSeries = layerSeries;\n this._layers = newLayersGroups;\n },\n dispose: function () {}\n}); // add animation to the view\n\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width + 20,\n height: rect.height + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nmodule.exports = _default;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(271)))\n\n/***/ }),\n/* 1146 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar numberUtil = __webpack_require__(8);\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*/\n\n/**\n * @file Using layout algorithm transform the raw data to layout information.\n * @author Deqing Li(annong035@gmail.com)\n */\nfunction _default(ecModel, api) {\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n var data = seriesModel.getData();\n var single = seriesModel.coordinateSystem;\n var layoutInfo = {}; // use the axis boundingRect for view\n\n var rect = single.getRect();\n layoutInfo.rect = rect;\n var boundaryGap = seriesModel.get('boundaryGap');\n var axis = single.getAxis();\n layoutInfo.boundaryGap = boundaryGap;\n\n if (axis.orient === 'horizontal') {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\n themeRiverLayout(data, seriesModel, height);\n } else {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\n themeRiverLayout(data, seriesModel, width);\n }\n\n data.setLayout('layoutInfo', layoutInfo);\n });\n}\n/**\n * The layout information about themeriver\n *\n * @param {module:echarts/data/List} data data in the series\n * @param {module:echarts/model/Series} seriesModel the model object of themeRiver series\n * @param {number} height value used to compute every series height\n */\n\n\nfunction themeRiverLayout(data, seriesModel, height) {\n if (!data.count()) {\n return;\n }\n\n var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series.\n\n var layerSeries = seriesModel.getLayerSeries(); // the points in each layer.\n\n var timeDim = data.mapDimension('single');\n var valueDim = data.mapDimension('value');\n var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\n return zrUtil.map(singleLayer.indices, function (idx) {\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\n pt[1] = data.get(valueDim, idx);\n return pt;\n });\n });\n var base = computeBaseline(layerPoints);\n var baseLine = base.y0;\n var ky = height / base.max; // set layout information for each item.\n\n var n = layerSeries.length;\n var m = layerSeries[0].indices.length;\n var baseY0;\n\n for (var j = 0; j < m; ++j) {\n baseY0 = baseLine[j] * ky;\n data.setItemLayout(layerSeries[0].indices[j], {\n layerIndex: 0,\n x: layerPoints[0][j][0],\n y0: baseY0,\n y: layerPoints[0][j][1] * ky\n });\n\n for (var i = 1; i < n; ++i) {\n baseY0 += layerPoints[i - 1][j][1] * ky;\n data.setItemLayout(layerSeries[i].indices[j], {\n layerIndex: i,\n x: layerPoints[i][j][0],\n y0: baseY0,\n y: layerPoints[i][j][1] * ky\n });\n }\n }\n}\n/**\n * Compute the baseLine of the rawdata\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\n *\n * @param {Array.} data the points in each layer\n * @return {Object}\n */\n\n\nfunction computeBaseline(data) {\n var layerNum = data.length;\n var pointNum = data[0].length;\n var sums = [];\n var y0 = [];\n var max = 0;\n var temp;\n var base = {};\n\n for (var i = 0; i < pointNum; ++i) {\n for (var j = 0, temp = 0; j < layerNum; ++j) {\n temp += data[j][i][1];\n }\n\n if (temp > max) {\n max = temp;\n }\n\n sums.push(temp);\n }\n\n for (var k = 0; k < pointNum; ++k) {\n y0[k] = (max - sums[k]) / 2;\n }\n\n max = 0;\n\n for (var l = 0; l < pointNum; ++l) {\n var sum = sums[l] + y0[l];\n\n if (sum > max) {\n max = sum;\n }\n }\n\n base.y0 = y0;\n base.max = max;\n return base;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1147 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _util = __webpack_require__(0);\n\nvar createHashMap = _util.createHashMap;\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*/\n\n/**\n * @file Visual encoding for themeRiver view\n * @author Deqing Li(annong035@gmail.com)\n */\nfunction _default(ecModel) {\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n var data = seriesModel.getData();\n var rawData = seriesModel.getRawData();\n var colorList = seriesModel.get('color');\n var idxMap = createHashMap();\n data.each(function (idx) {\n idxMap.set(data.getRawIndex(idx), idx);\n });\n rawData.each(function (rawIndex) {\n var name = rawData.getName(rawIndex);\n var color = colorList[(seriesModel.nameMap.get(name) - 1) % colorList.length];\n rawData.setItemVisual(rawIndex, 'color', color);\n var idx = idxMap.get(rawIndex);\n\n if (idx != null) {\n data.setItemVisual(idx, 'color', color);\n }\n });\n });\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1148 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1149);\n\n__webpack_require__(1150);\n\n__webpack_require__(1152);\n\nvar visualSymbol = __webpack_require__(107);\n\nvar treeLayout = __webpack_require__(1153);\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*/\necharts.registerVisual(visualSymbol('tree', 'circle'));\necharts.registerLayout(treeLayout);\n\n/***/ }),\n/* 1149 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar SeriesModel = __webpack_require__(30);\n\nvar Tree = __webpack_require__(262);\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\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*/\n\n/**\n * @file Create data struct and define tree view's series model\n * @author Deqing Li(annong035@gmail.com)\n */\nvar _default = SeriesModel.extend({\n type: 'series.tree',\n layoutInfo: null,\n // can support the position parameters 'left', 'top','right','bottom', 'width',\n // 'height' in the setOption() with 'merge' mode normal.\n layoutMode: 'box',\n\n /**\n * Init a tree data structure from data in option series\n * @param {Object} option the object used to config echarts view\n * @return {module:echarts/data/List} storage initial data\n */\n getInitialData: function (option) {\n //create an virtual root\n var root = {\n name: option.name,\n children: option.data\n };\n var leaves = option.leaves || {};\n var treeOption = {};\n treeOption.leaves = leaves;\n var tree = Tree.createTree(root, this, treeOption);\n var treeDepth = 0;\n tree.eachNode('preorder', function (node) {\n if (node.depth > treeDepth) {\n treeDepth = node.depth;\n }\n });\n var expandAndCollapse = option.expandAndCollapse;\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n tree.root.eachNode('preorder', function (node) {\n var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data.\n\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n });\n return tree.data;\n },\n\n /**\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\n * @returns {string} orient\n */\n getOrient: function () {\n var orient = this.get('orient');\n\n if (orient === 'horizontal') {\n orient = 'LR';\n } else if (orient === 'vertical') {\n orient = 'TB';\n }\n\n return orient;\n },\n setZoom: function (zoom) {\n this.option.zoom = zoom;\n },\n setCenter: function (center) {\n this.option.center = center;\n },\n\n /**\n * @override\n * @param {number} dataIndex\n */\n formatTooltip: function (dataIndex) {\n var tree = this.getData().tree;\n var realRoot = tree.root.children[0];\n var node = tree.getNodeByDataIndex(dataIndex);\n var value = node.getValue();\n var name = node.name;\n\n while (node && node !== realRoot) {\n name = node.parentNode.name + '.' + name;\n node = node.parentNode;\n }\n\n return encodeHTML(name + (isNaN(value) || value == null ? '' : ' : ' + value));\n },\n defaultOption: {\n zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // the position of the whole view\n left: '12%',\n top: '12%',\n right: '12%',\n bottom: '12%',\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n layout: 'orthogonal',\n roam: false,\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.4,\n // Default on center of graph\n center: null,\n zoom: 1,\n // The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.\n // and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.\n orient: 'LR',\n symbol: 'emptyCircle',\n symbolSize: 7,\n expandAndCollapse: true,\n initialTreeDepth: 2,\n lineStyle: {\n color: '#ccc',\n width: 1.5,\n curveness: 0.5\n },\n itemStyle: {\n color: 'lightsteelblue',\n borderColor: '#c23531',\n borderWidth: 1.5\n },\n label: {\n show: true,\n color: '#555'\n },\n leaves: {\n label: {\n show: true\n }\n },\n animationEasing: 'linear',\n animationDuration: 700,\n animationDurationUpdate: 1000\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1150 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar SymbolClz = __webpack_require__(173);\n\nvar _layoutHelper = __webpack_require__(368);\n\nvar radialCoordinate = _layoutHelper.radialCoordinate;\n\nvar echarts = __webpack_require__(3);\n\nvar bbox = __webpack_require__(188);\n\nvar View = __webpack_require__(257);\n\nvar roamHelper = __webpack_require__(252);\n\nvar RoamController = __webpack_require__(143);\n\nvar _cursorHelper = __webpack_require__(176);\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\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*/\n\n/**\n * @file This file used to draw tree view.\n * @author Deqing Li(annong035@gmail.com)\n */\nvar _default = echarts.extendChartView({\n type: 'tree',\n\n /**\n * Init the chart\n * @override\n * @param {module:echarts/model/Global} ecModel\n * @param {module:echarts/ExtensionAPI} api\n */\n init: function (ecModel, api) {\n /**\n * @private\n * @type {module:echarts/data/Tree}\n */\n this._oldTree;\n /**\n * @private\n * @type {module:zrender/container/Group}\n */\n\n this._mainGroup = new graphic.Group();\n /**\n * @private\n * @type {module:echarts/componet/helper/RoamController}\n */\n\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: this.group\n };\n this.group.add(this._mainGroup);\n },\n render: function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var layoutInfo = seriesModel.layoutInfo;\n var group = this._mainGroup;\n var layout = seriesModel.get('layout');\n\n if (layout === 'radial') {\n group.attr('position', [layoutInfo.x + layoutInfo.width / 2, layoutInfo.y + layoutInfo.height / 2]);\n } else {\n group.attr('position', [layoutInfo.x, layoutInfo.y]);\n }\n\n this._updateViewCoordSys(seriesModel);\n\n this._updateController(seriesModel, ecModel, api);\n\n var oldData = this._data;\n var seriesScope = {\n expandAndCollapse: seriesModel.get('expandAndCollapse'),\n layout: layout,\n orient: seriesModel.getOrient(),\n curvature: seriesModel.get('lineStyle.curveness'),\n symbolRotate: seriesModel.get('symbolRotate'),\n symbolOffset: seriesModel.get('symbolOffset'),\n hoverAnimation: seriesModel.get('hoverAnimation'),\n useNameLabel: true,\n fadeIn: true\n };\n data.diff(oldData).add(function (newIdx) {\n if (symbolNeedsDraw(data, newIdx)) {\n // Create node and edge\n updateNode(data, newIdx, null, group, seriesModel, seriesScope);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n\n if (!symbolNeedsDraw(data, newIdx)) {\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope);\n return;\n } // Update node and edge\n\n\n updateNode(data, newIdx, symbolEl, group, seriesModel, seriesScope);\n }).remove(function (oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed\n // node haven't been initialized with a symbol element,\n // you can't found it's symbol element through index.\n // so if we want to remove the symbol element we should insure\n // that the symbol element is not null.\n\n if (symbolEl) {\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope);\n }\n }).execute();\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n\n this._updateNodeAndLinkScale(seriesModel);\n\n if (seriesScope.expandAndCollapse === true) {\n data.eachItemGraphicEl(function (el, dataIndex) {\n el.off('click').on('click', function () {\n api.dispatchAction({\n type: 'treeExpandAndCollapse',\n seriesId: seriesModel.id,\n dataIndex: dataIndex\n });\n });\n });\n }\n\n this._data = data;\n },\n _updateViewCoordSys: function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n data.each(function (idx) {\n var layout = data.getItemLayout(idx);\n\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\n points.push([+layout.x, +layout.y]);\n }\n });\n var min = [];\n var max = [];\n bbox.fromPoints(points, min, max); // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n viewCoordSys.setCenter(seriesModel.get('center'));\n viewCoordSys.setZoom(seriesModel.get('zoom')); // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group\n\n this.group.attr({\n position: viewCoordSys.position,\n scale: viewCoordSys.scale\n });\n this._viewCoordSys = viewCoordSys;\n },\n _updateController: function (seriesModel, ecModel, api) {\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n dx: e.dx,\n dy: e.dy\n });\n }, this).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n this._updateNodeAndLinkScale(seriesModel);\n }, this);\n },\n _updateNodeAndLinkScale: function (seriesModel) {\n var data = seriesModel.getData();\n\n var nodeScale = this._getNodeGlobalScale(seriesModel);\n\n var invScale = [nodeScale, nodeScale];\n data.eachItemGraphicEl(function (el, idx) {\n el.attr('scale', invScale);\n });\n },\n _getNodeGlobalScale: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = this._nodeScaleRatio;\n var groupScale = coordSys.scale;\n var groupZoom = groupScale && groupScale[0] || 1; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n },\n dispose: function () {\n this._controller && this._controller.dispose();\n this._controllerHost = {};\n },\n remove: function () {\n this._mainGroup.removeAll();\n\n this._data = null;\n }\n});\n\nfunction symbolNeedsDraw(data, dataIndex) {\n var layout = data.getItemLayout(dataIndex);\n return layout && !isNaN(layout.x) && !isNaN(layout.y) && data.getItemVisual(dataIndex, 'symbol') !== 'none';\n}\n\nfunction getTreeNodeStyle(node, itemModel, seriesScope) {\n seriesScope.itemModel = itemModel;\n seriesScope.itemStyle = itemModel.getModel('itemStyle').getItemStyle();\n seriesScope.hoverItemStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle();\n seriesScope.lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n seriesScope.labelModel = itemModel.getModel('label');\n seriesScope.hoverLabelModel = itemModel.getModel('emphasis.label');\n\n if (node.isExpand === false && node.children.length !== 0) {\n seriesScope.symbolInnerColor = seriesScope.itemStyle.fill;\n } else {\n seriesScope.symbolInnerColor = '#fff';\n }\n\n return seriesScope;\n}\n\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) {\n var isInit = !symbolEl;\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var itemModel = node.getModel();\n var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope);\n var virtualRoot = data.tree.root;\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceLayout = source.getLayout();\n var sourceOldLayout = sourceSymbolEl ? {\n x: sourceSymbolEl.position[0],\n y: sourceSymbolEl.position[1],\n rawX: sourceSymbolEl.__radialOldRawX,\n rawY: sourceSymbolEl.__radialOldRawY\n } : sourceLayout;\n var targetLayout = node.getLayout();\n\n if (isInit) {\n symbolEl = new SymbolClz(data, dataIndex, seriesScope);\n symbolEl.attr('position', [sourceOldLayout.x, sourceOldLayout.y]);\n } else {\n symbolEl.updateData(data, dataIndex, seriesScope);\n }\n\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\n symbolEl.__radialRawX = targetLayout.rawX;\n symbolEl.__radialRawY = targetLayout.rawY;\n group.add(symbolEl);\n data.setItemGraphicEl(dataIndex, symbolEl);\n graphic.updateProps(symbolEl, {\n position: [targetLayout.x, targetLayout.y]\n }, seriesModel);\n var symbolPath = symbolEl.getSymbolPath();\n\n if (seriesScope.layout === 'radial') {\n var realRoot = virtualRoot.children[0];\n var rootLayout = realRoot.getLayout();\n var length = realRoot.children.length;\n var rad;\n var isLeft;\n\n if (targetLayout.x === rootLayout.x && node.isExpand === true) {\n var center = {};\n center.x = (realRoot.children[0].getLayout().x + realRoot.children[length - 1].getLayout().x) / 2;\n center.y = (realRoot.children[0].getLayout().y + realRoot.children[length - 1].getLayout().y) / 2;\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n isLeft = center.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {\n isLeft = targetLayout.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n isLeft = targetLayout.x > rootLayout.x;\n\n if (!isLeft) {\n rad = rad - Math.PI;\n }\n }\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n symbolPath.setStyle({\n textPosition: textPosition,\n textRotation: -rad,\n textOrigin: 'center',\n verticalAlign: 'middle'\n });\n }\n\n if (node.parentNode && node.parentNode !== virtualRoot) {\n var edge = symbolEl.__edge;\n\n if (!edge) {\n edge = symbolEl.__edge = new graphic.BezierCurve({\n shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout),\n style: zrUtil.defaults({\n opacity: 0,\n strokeNoScale: true\n }, seriesScope.lineStyle)\n });\n }\n\n graphic.updateProps(edge, {\n shape: getEdgeShape(seriesScope, sourceLayout, targetLayout),\n style: {\n opacity: 1\n }\n }, seriesModel);\n group.add(edge);\n }\n}\n\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) {\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var virtualRoot = data.tree.root;\n var itemModel = node.getModel();\n var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope);\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceLayout;\n\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\n }\n\n graphic.updateProps(symbolEl, {\n position: [sourceLayout.x + 1, sourceLayout.y + 1]\n }, seriesModel, function () {\n group.remove(symbolEl);\n data.setItemGraphicEl(dataIndex, null);\n });\n symbolEl.fadeOut(null, {\n keepLabel: true\n });\n var edge = symbolEl.__edge;\n\n if (edge) {\n graphic.updateProps(edge, {\n shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout),\n style: {\n opacity: 0\n }\n }, seriesModel, function () {\n group.remove(edge);\n });\n }\n}\n\nfunction getEdgeShape(seriesScope, sourceLayout, targetLayout) {\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n var orient = seriesScope.orient;\n var x1;\n var x2;\n var y1;\n var y2;\n\n if (seriesScope.layout === 'radial') {\n x1 = sourceLayout.rawX;\n y1 = sourceLayout.rawY;\n x2 = targetLayout.rawX;\n y2 = targetLayout.rawY;\n var radialCoor1 = radialCoordinate(x1, y1);\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * seriesScope.curvature);\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * seriesScope.curvature);\n var radialCoor4 = radialCoordinate(x2, y2);\n return {\n x1: radialCoor1.x,\n y1: radialCoor1.y,\n x2: radialCoor4.x,\n y2: radialCoor4.y,\n cpx1: radialCoor2.x,\n cpy1: radialCoor2.y,\n cpx2: radialCoor3.x,\n cpy2: radialCoor3.y\n };\n } else {\n x1 = sourceLayout.x;\n y1 = sourceLayout.y;\n x2 = targetLayout.x;\n y2 = targetLayout.y;\n\n if (orient === 'LR' || orient === 'RL') {\n cpx1 = x1 + (x2 - x1) * seriesScope.curvature;\n cpy1 = y1;\n cpx2 = x2 + (x1 - x2) * seriesScope.curvature;\n cpy2 = y2;\n }\n\n if (orient === 'TB' || orient === 'BT') {\n cpx1 = x1;\n cpy1 = y1 + (y2 - y1) * seriesScope.curvature;\n cpx2 = x2;\n cpy2 = y2 + (y1 - y2) * seriesScope.curvature;\n }\n }\n\n return {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n };\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1151 */\n/***/ (function(module, exports) {\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*/\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*/\n\n/**\n * Traverse the tree from bottom to top and do something\n * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree\n * @param {Function} callback\n */\nfunction eachAfter(root, callback, separation) {\n var nodes = [root];\n var next = [];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n next.push(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = 0; i < children.length; i++) {\n nodes.push(children[i]);\n }\n }\n }\n }\n\n while (node = next.pop()) {\n // jshint ignore:line\n callback(node, separation);\n }\n}\n/**\n * Traverse the tree from top to bottom and do something\n * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree\n * @param {Function} callback\n */\n\n\nfunction eachBefore(root, callback) {\n var nodes = [root];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n callback(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = children.length - 1; i >= 0; i--) {\n nodes.push(children[i]);\n }\n }\n }\n }\n}\n\nexports.eachAfter = eachAfter;\nexports.eachBefore = eachBefore;\n\n/***/ }),\n/* 1152 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar _roamHelper = __webpack_require__(245);\n\nvar updateCenterAndZoom = _roamHelper.updateCenterAndZoom;\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*/\n\n/**\n * @file Register the actions of the tree\n * @author Deqing Li(annong035@gmail.com)\n */\necharts.registerAction({\n type: 'treeExpandAndCollapse',\n event: 'treeExpandAndCollapse',\n update: 'update'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var dataIndex = payload.dataIndex;\n var tree = seriesModel.getData().tree;\n var node = tree.getNodeByDataIndex(dataIndex);\n node.isExpand = !node.isExpand;\n });\n});\necharts.registerAction({\n type: 'treeRoam',\n event: 'treeRoam',\n // Here we set 'none' instead of 'update', because roam action\n // just need to update the transform matrix without having to recalculate\n // the layout. So don't need to go through the whole update process, such\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n update: 'none'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\n});\n\n/***/ }),\n/* 1153 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _traversalHelper = __webpack_require__(1151);\n\nvar eachAfter = _traversalHelper.eachAfter;\nvar eachBefore = _traversalHelper.eachBefore;\n\nvar _layoutHelper = __webpack_require__(368);\n\nvar init = _layoutHelper.init;\nvar firstWalk = _layoutHelper.firstWalk;\nvar secondWalk = _layoutHelper.secondWalk;\nvar sep = _layoutHelper.separation;\nvar radialCoordinate = _layoutHelper.radialCoordinate;\nvar getViewRect = _layoutHelper.getViewRect;\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*/\nfunction _default(ecModel, api) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n commonLayout(seriesModel, api);\n });\n}\n\nfunction commonLayout(seriesModel, api) {\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var layout = seriesModel.get('layout');\n var width = 0;\n var height = 0;\n var separation = null;\n\n if (layout === 'radial') {\n width = 2 * Math.PI;\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\n separation = sep(function (node1, node2) {\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\n });\n } else {\n width = layoutInfo.width;\n height = layoutInfo.height;\n separation = sep();\n }\n\n var virtualRoot = seriesModel.getData().tree.root;\n var realRoot = virtualRoot.children[0];\n\n if (realRoot) {\n init(virtualRoot);\n eachAfter(realRoot, firstWalk, separation);\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\n eachBefore(realRoot, secondWalk);\n var left = realRoot;\n var right = realRoot;\n var bottom = realRoot;\n eachBefore(realRoot, function (node) {\n var x = node.getLayout().x;\n\n if (x < left.getLayout().x) {\n left = node;\n }\n\n if (x > right.getLayout().x) {\n right = node;\n }\n\n if (node.depth > bottom.depth) {\n bottom = node;\n }\n });\n var delta = left === right ? 1 : separation(left, right) / 2;\n var tx = delta - left.getLayout().x;\n var kx = 0;\n var ky = 0;\n var coorX = 0;\n var coorY = 0;\n\n if (layout === 'radial') {\n kx = width / (right.getLayout().x + delta + tx); // here we use (node.depth - 1), bucause the real root's depth is 1\n\n ky = height / (bottom.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX = (node.getLayout().x + tx) * kx;\n coorY = (node.depth - 1) * ky;\n var finalCoor = radialCoordinate(coorX, coorY);\n node.setLayout({\n x: finalCoor.x,\n y: finalCoor.y,\n rawX: coorX,\n rawY: coorY\n }, true);\n });\n } else {\n var orient = seriesModel.getOrient();\n\n if (orient === 'RL' || orient === 'LR') {\n ky = height / (right.getLayout().x + delta + tx);\n kx = width / (bottom.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorY = (node.getLayout().x + tx) * ky;\n coorX = orient === 'LR' ? (node.depth - 1) * kx : width - (node.depth - 1) * kx;\n node.setLayout({\n x: coorX,\n y: coorY\n }, true);\n });\n } else if (orient === 'TB' || orient === 'BT') {\n kx = width / (right.getLayout().x + delta + tx);\n ky = height / (bottom.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX = (node.getLayout().x + tx) * kx;\n coorY = orient === 'TB' ? (node.depth - 1) * ky : height - (node.depth - 1) * ky;\n node.setLayout({\n x: coorX,\n y: coorY\n }, true);\n });\n }\n }\n }\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1154 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\n__webpack_require__(1156);\n\n__webpack_require__(1157);\n\n__webpack_require__(1158);\n\nvar treemapVisual = __webpack_require__(1160);\n\nvar treemapLayout = __webpack_require__(1159);\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*/\necharts.registerVisual(treemapVisual);\necharts.registerLayout(treemapLayout);\n\n/***/ }),\n/* 1155 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar layout = __webpack_require__(16);\n\nvar zrUtil = __webpack_require__(0);\n\nvar _treeHelper = __webpack_require__(99);\n\nvar wrapTreePathInfo = _treeHelper.wrapTreePathInfo;\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*/\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\n\nfunction Breadcrumb(containerGroup) {\n /**\n * @private\n * @type {module:zrender/container/Group}\n */\n this.group = new graphic.Group();\n containerGroup.add(this.group);\n}\n\nBreadcrumb.prototype = {\n constructor: Breadcrumb,\n render: function (seriesModel, api, targetNode, onSelect) {\n var model = seriesModel.getModel('breadcrumb');\n var thisGroup = this.group;\n thisGroup.removeAll();\n\n if (!model.get('show') || !targetNode) {\n return;\n }\n\n var normalStyleModel = model.getModel('itemStyle'); // var emphasisStyleModel = model.getModel('emphasis.itemStyle');\n\n var textStyleModel = normalStyleModel.getModel('textStyle');\n var layoutParam = {\n pos: {\n left: model.get('left'),\n right: model.get('right'),\n top: model.get('top'),\n bottom: model.get('bottom')\n },\n box: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n emptyItemWidth: model.get('emptyItemWidth'),\n totalWidth: 0,\n renderList: []\n };\n\n this._prepare(targetNode, layoutParam, textStyleModel);\n\n this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect);\n\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\n },\n\n /**\n * Prepare render list and total width\n * @private\n */\n _prepare: function (targetNode, layoutParam, textStyleModel) {\n for (var node = targetNode; node; node = node.parentNode) {\n var text = node.getModel().get('name');\n var textRect = textStyleModel.getTextRect(text);\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\n layoutParam.renderList.push({\n node: node,\n text: text,\n width: itemWidth\n });\n }\n },\n\n /**\n * @private\n */\n _renderContent: function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) {\n // Start rendering.\n var lastX = 0;\n var emptyItemWidth = layoutParam.emptyItemWidth;\n var height = seriesModel.get('breadcrumb.height');\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\n var totalWidth = layoutParam.totalWidth;\n var renderList = layoutParam.renderList;\n\n for (var i = renderList.length - 1; i >= 0; i--) {\n var item = renderList[i];\n var itemNode = item.node;\n var itemWidth = item.width;\n var text = item.text; // Hdie text and shorten width if necessary.\n\n if (totalWidth > availableSize.width) {\n totalWidth -= itemWidth - emptyItemWidth;\n itemWidth = emptyItemWidth;\n text = null;\n }\n\n var el = new graphic.Polygon({\n shape: {\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n },\n style: zrUtil.defaults(normalStyleModel.getItemStyle(), {\n lineJoin: 'bevel',\n text: text,\n textFill: textStyleModel.getTextColor(),\n textFont: textStyleModel.getFont()\n }),\n z: 10,\n onclick: zrUtil.curry(onSelect, itemNode)\n });\n this.group.add(el);\n packEventData(el, seriesModel, itemNode);\n lastX += itemWidth + ITEM_GAP;\n }\n },\n\n /**\n * @override\n */\n remove: function () {\n this.group.removeAll();\n }\n};\n\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n !head && points.push([x, y + itemHeight / 2]);\n return points;\n} // Package custom mouse event.\n\n\nfunction packEventData(el, seriesModel, itemNode) {\n el.eventData = {\n componentType: 'series',\n componentSubType: 'treemap',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.componentIndex,\n seriesName: seriesModel.name,\n seriesType: 'treemap',\n selfType: 'breadcrumb',\n // Distinguish with click event on treemap node.\n nodeData: {\n dataIndex: itemNode && itemNode.dataIndex,\n name: itemNode && itemNode.name\n },\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n };\n}\n\nvar _default = Breadcrumb;\nmodule.exports = _default;\n\n/***/ }),\n/* 1156 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar SeriesModel = __webpack_require__(30);\n\nvar Tree = __webpack_require__(262);\n\nvar Model = __webpack_require__(31);\n\nvar _format = __webpack_require__(19);\n\nvar encodeHTML = _format.encodeHTML;\nvar addCommas = _format.addCommas;\n\nvar _treeHelper = __webpack_require__(99);\n\nvar wrapTreePathInfo = _treeHelper.wrapTreePathInfo;\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*/\nvar _default = SeriesModel.extend({\n type: 'series.treemap',\n layoutMode: 'box',\n dependencies: ['grid', 'polar'],\n\n /**\n * @type {module:echarts/data/Tree~Node}\n */\n _viewRoot: null,\n defaultOption: {\n // Disable progressive rendering\n progressive: 0,\n hoverLayerThreshold: Infinity,\n // center: ['50%', '50%'], // not supported in ec3.\n // size: ['80%', '80%'], // deprecated, compatible with ec2.\n left: 'center',\n top: 'middle',\n right: null,\n bottom: null,\n width: '80%',\n height: '80%',\n sort: true,\n // Can be null or false or true\n // (order by desc default, asc not supported yet (strange effect))\n clipWindow: 'origin',\n // Size of clipped window when zooming. 'origin' or 'fullscreen'\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\n // golden ratio\n leafDepth: null,\n // Nodes on depth from root are regarded as leaves.\n // Count from zero (zero represents only view root).\n drillDownIcon: '▶',\n // Use html character temporarily because it is complicated\n // to align specialized icon. ▷▶❒❐▼✚\n zoomToNodeRatio: 0.32 * 0.32,\n // Be effective when using zoomToNode. Specify the proportion of the\n // target node area in the view area.\n roam: true,\n // true, false, 'scale' or 'zoom', 'move'.\n nodeClick: 'zoomToNode',\n // Leaf node click behaviour: 'zoomToNode', 'link', false.\n // If leafDepth is set and clicking a node which has children but\n // be on left depth, the behaviour would be changing root. Otherwise\n // use behavious defined above.\n animation: true,\n animationDurationUpdate: 900,\n animationEasing: 'quinticInOut',\n breadcrumb: {\n show: true,\n height: 22,\n left: 'center',\n top: 'bottom',\n // right\n // bottom\n emptyItemWidth: 25,\n // Width of empty node.\n itemStyle: {\n color: 'rgba(0,0,0,0.7)',\n //'#5793f3',\n borderColor: 'rgba(255,255,255,0.7)',\n borderWidth: 1,\n shadowColor: 'rgba(150,150,150,1)',\n shadowBlur: 3,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n textStyle: {\n color: '#fff'\n }\n },\n emphasis: {\n textStyle: {}\n }\n },\n label: {\n show: true,\n // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\n distance: 0,\n padding: 5,\n position: 'inside',\n // Can be [5, '5%'] or position stirng like 'insideTopLeft', ...\n // formatter: null,\n color: '#fff',\n ellipsis: true // align\n // verticalAlign\n\n },\n upperLabel: {\n // Label when node is parent.\n show: false,\n position: [0, '50%'],\n height: 20,\n // formatter: null,\n color: '#fff',\n ellipsis: true,\n // align: null,\n verticalAlign: 'middle'\n },\n itemStyle: {\n color: null,\n // Can be 'none' if not necessary.\n colorAlpha: null,\n // Can be 'none' if not necessary.\n colorSaturation: null,\n // Can be 'none' if not necessary.\n borderWidth: 0,\n gapWidth: 0,\n borderColor: '#fff',\n borderColorSaturation: null // If specified, borderColor will be ineffective, and the\n // border color is evaluated by color of current node and\n // borderColorSaturation.\n\n },\n emphasis: {\n upperLabel: {\n show: true,\n position: [0, '50%'],\n color: '#fff',\n ellipsis: true,\n verticalAlign: 'middle'\n }\n },\n visualDimension: 0,\n // Can be 0, 1, 2, 3.\n visualMin: null,\n visualMax: null,\n color: [],\n // + treemapSeries.color should not be modified. Please only modified\n // level[n].color (if necessary).\n // + Specify color list of each level. level[0].color would be global\n // color list if not specified. (see method `setDefault`).\n // + But set as a empty array to forbid fetch color from global palette\n // when using nodeModel.get('color'), otherwise nodes on deep level\n // will always has color palette set and are not able to inherit color\n // from parent node.\n // + TreemapSeries.color can not be set as 'none', otherwise effect\n // legend color fetching (see seriesColor.js).\n colorAlpha: null,\n // Array. Specify color alpha range of each level, like [0.2, 0.8]\n colorSaturation: null,\n // Array. Specify color saturation of each level, like [0.2, 0.5]\n colorMappingBy: 'index',\n // 'value' or 'index' or 'id'.\n visibleMin: 10,\n // If area less than this threshold (unit: pixel^2), node will not\n // be rendered. Only works when sort is 'asc' or 'desc'.\n childrenVisibleMin: null,\n // If area of a node less than this threshold (unit: pixel^2),\n // grandchildren will not show.\n // Why grandchildren? If not grandchildren but children,\n // some siblings show children and some not,\n // the appearance may be mess and not consistent,\n levels: [] // Each item: {\n // visibleMin, itemStyle, visualDimension, label\n // }\n // data: {\n // value: [],\n // children: [],\n // link: 'http://xxx.xxx.xxx',\n // target: 'blank' or 'self'\n // }\n\n },\n\n /**\n * @override\n */\n getInitialData: function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levels = option.levels || [];\n levels = option.levels = setDefault(levels, ecModel);\n var treeOption = {};\n treeOption.levels = levels; // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n return Tree.createTree(root, this, treeOption).data;\n },\n optionUpdated: function () {\n this.resetViewRoot();\n },\n\n /**\n * @override\n * @param {number} dataIndex\n * @param {boolean} [mutipleSeries=false]\n */\n formatTooltip: function (dataIndex) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var formattedValue = zrUtil.isArray(value) ? addCommas(value[0]) : addCommas(value);\n var name = data.getName(dataIndex);\n return encodeHTML(name + ': ' + formattedValue);\n },\n\n /**\n * Add tree path to tooltip param\n *\n * @override\n * @param {number} dataIndex\n * @return {Object}\n */\n getDataParams: function (dataIndex) {\n var params = SeriesModel.prototype.getDataParams.apply(this, arguments);\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n },\n\n /**\n * @public\n * @param {Object} layoutInfo {\n * x: containerGroup x\n * y: containerGroup y\n * width: containerGroup width\n * height: containerGroup height\n * }\n */\n setLayoutInfo: function (layoutInfo) {\n /**\n * @readOnly\n * @type {Object}\n */\n this.layoutInfo = this.layoutInfo || {};\n zrUtil.extend(this.layoutInfo, layoutInfo);\n },\n\n /**\n * @param {string} id\n * @return {number} index\n */\n mapIdToIndex: function (id) {\n // A feature is implemented:\n // index is monotone increasing with the sequence of\n // input id at the first time.\n // This feature can make sure that each data item and its\n // mapped color have the same index between data list and\n // color list at the beginning, which is useful for user\n // to adjust data-color mapping.\n\n /**\n * @private\n * @type {Object}\n */\n var idIndexMap = this._idIndexMap;\n\n if (!idIndexMap) {\n idIndexMap = this._idIndexMap = zrUtil.createHashMap();\n /**\n * @private\n * @type {number}\n */\n\n this._idIndexMapCount = 0;\n }\n\n var index = idIndexMap.get(id);\n\n if (index == null) {\n idIndexMap.set(id, index = this._idIndexMapCount++);\n }\n\n return index;\n },\n getViewRoot: function () {\n return this._viewRoot;\n },\n\n /**\n * @param {module:echarts/data/Tree~Node} [viewRoot]\n */\n resetViewRoot: function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n }\n});\n/**\n * @param {Object} dataNode\n */\n\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n/**\n * set default to level configuration\n */\n\n\nfunction setDefault(levels, ecModel) {\n var globalColorList = ecModel.get('color');\n\n if (!globalColorList) {\n return;\n }\n\n levels = levels || [];\n var hasColorDefine;\n zrUtil.each(levels, function (levelDefine) {\n var model = new Model(levelDefine);\n var modelColor = model.get('color');\n\n if (model.get('itemStyle.color') || modelColor && modelColor !== 'none') {\n hasColorDefine = true;\n }\n });\n\n if (!hasColorDefine) {\n var level0 = levels[0] || (levels[0] = {});\n level0.color = globalColorList.slice();\n }\n\n return levels;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1157 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar DataDiffer = __webpack_require__(102);\n\nvar helper = __webpack_require__(99);\n\nvar Breadcrumb = __webpack_require__(1155);\n\nvar RoamController = __webpack_require__(143);\n\nvar BoundingRect = __webpack_require__(21);\n\nvar matrix = __webpack_require__(36);\n\nvar animationUtil = __webpack_require__(1307);\n\nvar makeStyleMapper = __webpack_require__(119);\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*/\nvar bind = zrUtil.bind;\nvar Group = graphic.Group;\nvar Rect = graphic.Rect;\nvar each = zrUtil.each;\nvar DRAG_THRESHOLD = 3;\nvar PATH_LABEL_NOAMAL = ['label'];\nvar PATH_LABEL_EMPHASIS = ['emphasis', 'label'];\nvar PATH_UPPERLABEL_NORMAL = ['upperLabel'];\nvar PATH_UPPERLABEL_EMPHASIS = ['emphasis', 'upperLabel'];\nvar Z_BASE = 10; // Should bigger than every z.\n\nvar Z_BG = 1;\nvar Z_CONTENT = 2;\nvar getItemStyleEmphasis = makeStyleMapper([['fill', 'color'], // `borderColor` and `borderWidth` has been occupied,\n// so use `stroke` to indicate the stroke of the rect.\n['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor']]);\n\nvar getItemStyleNormal = function (model) {\n // Normal style props should include emphasis style props.\n var itemStyle = getItemStyleEmphasis(model); // Clear styles set by emphasis.\n\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\n return itemStyle;\n};\n\nvar _default = echarts.extendChartView({\n type: 'treemap',\n\n /**\n * @override\n */\n init: function (o, api) {\n /**\n * @private\n * @type {module:zrender/container/Group}\n */\n this._containerGroup;\n /**\n * @private\n * @type {Object.>}\n */\n\n this._storage = createStorage();\n /**\n * @private\n * @type {module:echarts/data/Tree}\n */\n\n this._oldTree;\n /**\n * @private\n * @type {module:echarts/chart/treemap/Breadcrumb}\n */\n\n this._breadcrumb;\n /**\n * @private\n * @type {module:echarts/component/helper/RoamController}\n */\n\n this._controller;\n /**\n * 'ready', 'animating'\n * @private\n */\n\n this._state = 'ready';\n },\n\n /**\n * @override\n */\n render: function (seriesModel, ecModel, api, payload) {\n var models = ecModel.findComponents({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n });\n\n if (zrUtil.indexOf(models, seriesModel) < 0) {\n return;\n }\n\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var payloadType = payload && payload.type;\n var layoutInfo = seriesModel.layoutInfo;\n var isInit = !this._oldTree;\n var thisStorage = this._storage; // Mark new root when action is treemapRootToNode.\n\n var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? {\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\n direction: payload.direction\n } : null;\n\n var containerGroup = this._giveContainerGroup(layoutInfo);\n\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\n\n !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();\n\n this._resetController(api);\n\n this._renderBreadcrumb(seriesModel, api, targetInfo);\n },\n\n /**\n * @private\n */\n _giveContainerGroup: function (layoutInfo) {\n var containerGroup = this._containerGroup;\n\n if (!containerGroup) {\n // FIXME\n // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。\n containerGroup = this._containerGroup = new Group();\n\n this._initEvents(containerGroup);\n\n this.group.add(containerGroup);\n }\n\n containerGroup.attr('position', [layoutInfo.x, layoutInfo.y]);\n return containerGroup;\n },\n\n /**\n * @private\n */\n _doRender: function (containerGroup, seriesModel, reRoot) {\n var thisTree = seriesModel.getData().tree;\n var oldTree = this._oldTree; // Clear last shape records.\n\n var lastsForAnimation = createStorage();\n var thisStorage = createStorage();\n var oldStorage = this._storage;\n var willInvisibleEls = [];\n var doRenderNode = zrUtil.curry(renderNode, seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls); // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow),\n // the oldTree is actually losted, so we can not find all of the old graphic\n // elements from tree. So we use this stragegy: make element storage, move\n // from old storage to new storage, clear old storage.\n\n dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); // Process all removing.\n\n var willDeleteEls = clearStorage(oldStorage);\n this._oldTree = thisTree;\n this._storage = thisStorage;\n return {\n lastsForAnimation: lastsForAnimation,\n willDeleteEls: willDeleteEls,\n renderFinally: renderFinally\n };\n\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\n // When 'render' is triggered by action,\n // 'this' and 'old' may be the same tree,\n // we use rawIndex in that case.\n if (sameTree) {\n oldViewChildren = thisViewChildren;\n each(thisViewChildren, function (child, index) {\n !child.isRemoved() && processNode(index, index);\n });\n } // Diff hierarchically (diff only in each subtree, but not whole).\n // because, consistency of view is important.\n else {\n new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n }\n\n function getKey(node) {\n // Identify by name or raw index.\n return node.getId();\n }\n\n function processNode(newIndex, oldIndex) {\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\n }\n }\n\n function clearStorage(storage) {\n var willDeleteEls = createStorage();\n storage && each(storage, function (store, storageName) {\n var delEls = willDeleteEls[storageName];\n each(store, function (el) {\n el && (delEls.push(el), el.__tmWillDelete = 1);\n });\n });\n return willDeleteEls;\n }\n\n function renderFinally() {\n each(willDeleteEls, function (els) {\n each(els, function (el) {\n el.parent && el.parent.remove(el);\n });\n });\n each(willInvisibleEls, function (el) {\n el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty,\n // just mark as invisible.\n\n el.dirty();\n });\n }\n },\n\n /**\n * @private\n */\n _doAnimation: function (containerGroup, renderResult, seriesModel, reRoot) {\n if (!seriesModel.get('animation')) {\n return;\n }\n\n var duration = seriesModel.get('animationDurationUpdate');\n var easing = seriesModel.get('animationEasing');\n var animationWrap = animationUtil.createWrap(); // Make delete animations.\n\n each(renderResult.willDeleteEls, function (store, storageName) {\n each(store, function (el, rawIndex) {\n if (el.invisible) {\n return;\n }\n\n var parent = el.parent; // Always has parent, and parent is nodeGroup.\n\n var target;\n\n if (reRoot && reRoot.direction === 'drillDown') {\n target = parent === reRoot.rootNodeGroup // This is the content element of view root.\n // Only `content` will enter this branch, because\n // `background` and `nodeGroup` will not be deleted.\n ? {\n shape: {\n x: 0,\n y: 0,\n width: parent.__tmNodeWidth,\n height: parent.__tmNodeHeight\n },\n style: {\n opacity: 0\n } // Others.\n\n } : {\n style: {\n opacity: 0\n }\n };\n } else {\n var targetX = 0;\n var targetY = 0;\n\n if (!parent.__tmWillDelete) {\n // Let node animate to right-bottom corner, cooperating with fadeout,\n // which is appropriate for user understanding.\n // Divided by 2 for reRoot rolling up effect.\n targetX = parent.__tmNodeWidth / 2;\n targetY = parent.__tmNodeHeight / 2;\n }\n\n target = storageName === 'nodeGroup' ? {\n position: [targetX, targetY],\n style: {\n opacity: 0\n }\n } : {\n shape: {\n x: targetX,\n y: targetY,\n width: 0,\n height: 0\n },\n style: {\n opacity: 0\n }\n };\n }\n\n target && animationWrap.add(el, target, duration, easing);\n });\n }); // Make other animations\n\n each(this._storage, function (store, storageName) {\n each(store, function (el, rawIndex) {\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\n var target = {};\n\n if (!last) {\n return;\n }\n\n if (storageName === 'nodeGroup') {\n if (last.old) {\n target.position = el.position.slice();\n el.attr('position', last.old);\n }\n } else {\n if (last.old) {\n target.shape = zrUtil.extend({}, el.shape);\n el.setShape(last.old);\n }\n\n if (last.fadein) {\n el.setStyle('opacity', 0);\n target.style = {\n opacity: 1\n };\n } // When animation is stopped for succedent animation starting,\n // el.style.opacity might not be 1\n else if (el.style.opacity !== 1) {\n target.style = {\n opacity: 1\n };\n }\n }\n\n animationWrap.add(el, target, duration, easing);\n });\n }, this);\n this._state = 'animating';\n animationWrap.done(bind(function () {\n this._state = 'ready';\n renderResult.renderFinally();\n }, this)).start();\n },\n\n /**\n * @private\n */\n _resetController: function (api) {\n var controller = this._controller; // Init controller.\n\n if (!controller) {\n controller = this._controller = new RoamController(api.getZr());\n controller.enable(this.seriesModel.get('roam'));\n controller.on('pan', bind(this._onPan, this));\n controller.on('zoom', bind(this._onZoom, this));\n }\n\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\n controller.setPointerChecker(function (e, x, y) {\n return rect.contain(x, y);\n });\n },\n\n /**\n * @private\n */\n _clearController: function () {\n var controller = this._controller;\n\n if (controller) {\n controller.dispose();\n controller = null;\n }\n },\n\n /**\n * @private\n */\n _onPan: function (e) {\n if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n this.api.dispatchAction({\n type: 'treemapMove',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rootLayout.x + e.dx,\n y: rootLayout.y + e.dy,\n width: rootLayout.width,\n height: rootLayout.height\n }\n });\n }\n },\n\n /**\n * @private\n */\n _onZoom: function (e) {\n var mouseX = e.originX;\n var mouseY = e.originY;\n\n if (this._state !== 'animating') {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\n var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup.\n\n mouseX -= layoutInfo.x;\n mouseY -= layoutInfo.y; // Scale root bounding rect.\n\n var m = matrix.create();\n matrix.translate(m, m, [-mouseX, -mouseY]);\n matrix.scale(m, m, [e.scale, e.scale]);\n matrix.translate(m, m, [mouseX, mouseY]);\n rect.applyTransform(m);\n this.api.dispatchAction({\n type: 'treemapRender',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n }\n },\n\n /**\n * @private\n */\n _initEvents: function (containerGroup) {\n containerGroup.on('click', function (e) {\n if (this._state !== 'ready') {\n return;\n }\n\n var nodeClick = this.seriesModel.get('nodeClick', true);\n\n if (!nodeClick) {\n return;\n }\n\n var targetInfo = this.findTarget(e.offsetX, e.offsetY);\n\n if (!targetInfo) {\n return;\n }\n\n var node = targetInfo.node;\n\n if (node.getLayout().isLeafRoot) {\n this._rootToNode(targetInfo);\n } else {\n if (nodeClick === 'zoomToNode') {\n this._zoomToNode(targetInfo);\n } else if (nodeClick === 'link') {\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\n var link = itemModel.get('link', true);\n var linkTarget = itemModel.get('target', true) || 'blank';\n link && window.open(link, linkTarget);\n }\n }\n }, this);\n },\n\n /**\n * @private\n */\n _renderBreadcrumb: function (seriesModel, api, targetInfo) {\n if (!targetInfo) {\n targetInfo = seriesModel.get('leafDepth', true) != null ? {\n node: seriesModel.getViewRoot() // FIXME\n // better way?\n // Find breadcrumb tail on center of containerGroup.\n\n } : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\n\n if (!targetInfo) {\n targetInfo = {\n node: seriesModel.getData().tree.root\n };\n }\n }\n\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, bind(onSelect, this));\n\n function onSelect(node) {\n if (this._state !== 'animating') {\n helper.aboveViewRoot(seriesModel.getViewRoot(), node) ? this._rootToNode({\n node: node\n }) : this._zoomToNode({\n node: node\n });\n }\n }\n },\n\n /**\n * @override\n */\n remove: function () {\n this._clearController();\n\n this._containerGroup && this._containerGroup.removeAll();\n this._storage = createStorage();\n this._state = 'ready';\n this._breadcrumb && this._breadcrumb.remove();\n },\n dispose: function () {\n this._clearController();\n },\n\n /**\n * @private\n */\n _zoomToNode: function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapZoomToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n },\n\n /**\n * @private\n */\n _rootToNode: function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapRootToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n },\n\n /**\n * @public\n * @param {number} x Global coord x.\n * @param {number} y Global coord y.\n * @return {Object} info If not found, return undefined;\n * @return {number} info.node Target node.\n * @return {number} info.offsetX x refer to target node.\n * @return {number} info.offsetY y refer to target node.\n */\n findTarget: function (x, y) {\n var targetInfo;\n var viewRoot = this.seriesModel.getViewRoot();\n viewRoot.eachNode({\n attr: 'viewChildren',\n order: 'preorder'\n }, function (node) {\n var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element.\n\n\n if (bgEl) {\n var point = bgEl.transformCoordToLocal(x, y);\n var shape = bgEl.shape; // For performance consideration, dont use 'getBoundingRect'.\n\n if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {\n targetInfo = {\n node: node,\n offsetX: point[0],\n offsetY: point[1]\n };\n } else {\n return false; // Suppress visit subtree.\n }\n }\n }, this);\n return targetInfo;\n }\n});\n/**\n * @inner\n */\n\n\nfunction createStorage() {\n return {\n nodeGroup: [],\n background: [],\n content: []\n };\n}\n/**\n * @inner\n * @return Return undefined means do not travel further.\n */\n\n\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\n // Whether under viewRoot.\n if (!thisNode) {\n // Deleting nodes will be performed finally. This method just find\n // element from old storage, or create new element, set them to new\n // storage, and set styles.\n return;\n } // -------------------------------------------------------------------\n // Start of closure variables available in \"Procedures in renderNode\".\n\n\n var thisLayout = thisNode.getLayout();\n\n if (!thisLayout || !thisLayout.isInView) {\n return;\n }\n\n var thisWidth = thisLayout.width;\n var thisHeight = thisLayout.height;\n var borderWidth = thisLayout.borderWidth;\n var thisInvisible = thisLayout.invisible;\n var thisRawIndex = thisNode.getRawIndex();\n var oldRawIndex = oldNode && oldNode.getRawIndex();\n var thisViewChildren = thisNode.viewChildren;\n var upperHeight = thisLayout.upperHeight;\n var isParent = thisViewChildren && thisViewChildren.length;\n var itemStyleNormalModel = thisNode.getModel('itemStyle');\n var itemStyleEmphasisModel = thisNode.getModel('emphasis.itemStyle'); // End of closure ariables available in \"Procedures in renderNode\".\n // -----------------------------------------------------------------\n // Node group\n\n var group = giveGraphic('nodeGroup', Group);\n\n if (!group) {\n return;\n }\n\n parentGroup.add(group); // x,y are not set when el is above view root.\n\n group.attr('position', [thisLayout.x || 0, thisLayout.y || 0]);\n group.__tmNodeWidth = thisWidth;\n group.__tmNodeHeight = thisHeight;\n\n if (thisLayout.isAboveViewRoot) {\n return group;\n } // Background\n\n\n var bg = giveGraphic('background', Rect, depth, Z_BG);\n bg && renderBackground(group, bg, isParent && thisLayout.upperHeight); // No children, render content.\n\n if (!isParent) {\n var content = giveGraphic('content', Rect, depth, Z_CONTENT);\n content && renderContent(group, content);\n }\n\n return group; // ----------------------------\n // | Procedures in renderNode |\n // ----------------------------\n\n function renderBackground(group, bg, useUpperLabel) {\n // For tooltip.\n bg.dataIndex = thisNode.dataIndex;\n bg.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight\n });\n var visualBorderColor = thisNode.getVisual('borderColor', true);\n var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');\n updateStyle(bg, function () {\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);\n emphasisStyle.fill = emphasisBorderColor;\n\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText(normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n } // For old bg.\n else {\n normalStyle.text = emphasisStyle.text = null;\n }\n\n bg.setStyle(normalStyle);\n graphic.setHoverStyle(bg, emphasisStyle);\n });\n group.add(bg);\n }\n\n function renderContent(group, content) {\n // For tooltip.\n content.dataIndex = thisNode.dataIndex;\n content.seriesIndex = seriesModel.seriesIndex;\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\n content.culling = true;\n content.setShape({\n x: borderWidth,\n y: borderWidth,\n width: contentWidth,\n height: contentHeight\n });\n var visualColor = thisNode.getVisual('color', true);\n updateStyle(content, function () {\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualColor;\n var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);\n prepareText(normalStyle, emphasisStyle, visualColor, contentWidth, contentHeight);\n content.setStyle(normalStyle);\n graphic.setHoverStyle(content, emphasisStyle);\n });\n group.add(content);\n }\n\n function updateStyle(element, cb) {\n if (!thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n cb();\n\n if (!element.__tmWillVisible) {\n element.invisible = false;\n }\n } else {\n // Delay invisible setting utill animation finished,\n // avoid element vanish suddenly before animation.\n !element.invisible && willInvisibleEls.push(element);\n }\n }\n\n function prepareText(normalStyle, emphasisStyle, visualColor, width, height, upperLabelRect) {\n var nodeModel = thisNode.getModel();\n var text = zrUtil.retrieve(seriesModel.getFormattedLabel(thisNode.dataIndex, 'normal', null, null, upperLabelRect ? 'upperLabel' : 'label'), nodeModel.get('name'));\n\n if (!upperLabelRect && thisLayout.isLeafRoot) {\n var iconChar = seriesModel.get('drillDownIcon', true);\n text = iconChar ? iconChar + ' ' + text : text;\n }\n\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\n var emphasisLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_EMPHASIS : PATH_LABEL_EMPHASIS);\n var isShow = normalLabelModel.getShallow('show');\n graphic.setLabelStyle(normalStyle, emphasisStyle, normalLabelModel, emphasisLabelModel, {\n defaultText: isShow ? text : null,\n autoColor: visualColor,\n isRectText: true\n });\n upperLabelRect && (normalStyle.textRect = zrUtil.clone(upperLabelRect));\n normalStyle.truncate = isShow && normalLabelModel.get('ellipsis') ? {\n outerWidth: width,\n outerHeight: height,\n minChar: 2\n } : null;\n }\n\n function giveGraphic(storageName, Ctor, depth, z) {\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\n var lasts = lastsForAnimation[storageName];\n\n if (element) {\n // Remove from oldStorage\n oldStorage[storageName][oldRawIndex] = null;\n prepareAnimationWhenHasOld(lasts, element, storageName);\n } // If invisible and no old element, do not create new element (for optimizing).\n else if (!thisInvisible) {\n element = new Ctor({\n z: calculateZ(depth, z)\n });\n element.__tmDepth = depth;\n element.__tmStorageName = storageName;\n prepareAnimationWhenNoOld(lasts, element, storageName);\n } // Set to thisStorage\n\n\n return thisStorage[storageName][thisRawIndex] = element;\n }\n\n function prepareAnimationWhenHasOld(lasts, element, storageName) {\n var lastCfg = lasts[thisRawIndex] = {};\n lastCfg.old = storageName === 'nodeGroup' ? element.position.slice() : zrUtil.extend({}, element.shape);\n } // If a element is new, we need to find the animation start point carefully,\n // otherwise it will looks strange when 'zoomToNode'.\n\n\n function prepareAnimationWhenNoOld(lasts, element, storageName) {\n var lastCfg = lasts[thisRawIndex] = {};\n var parentNode = thisNode.parentNode;\n\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\n var parentOldX = 0;\n var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation.\n // For convenience, get old bounding rect from background.\n\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\n\n if (!reRoot && parentOldBg && parentOldBg.old) {\n parentOldX = parentOldBg.old.width;\n parentOldY = parentOldBg.old.height;\n } // When no parent old shape found, its parent is new too,\n // so we can just use {x:0, y:0}.\n\n\n lastCfg.old = storageName === 'nodeGroup' ? [0, parentOldY] : {\n x: parentOldX,\n y: parentOldY,\n width: 0,\n height: 0\n };\n } // Fade in, user can be aware that these nodes are new.\n\n\n lastCfg.fadein = storageName !== 'nodeGroup';\n }\n} // We can not set all backgroud with the same z, Because the behaviour of\n// drill down and roll up differ background creation sequence from tree\n// hierarchy sequence, which cause that lowser background element overlap\n// upper ones. So we calculate z based on depth.\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\n// treemap with large z overlaps other components.\n\n\nfunction calculateZ(depth, zInLevel) {\n var zb = depth * Z_BASE + zInLevel;\n return (zb - 1) / zb;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1158 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar helper = __webpack_require__(99);\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*/\n\n/**\n * @file Treemap action\n */\nvar noop = function () {};\n\nvar actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove'];\n\nfor (var i = 0; i < actionTypes.length; i++) {\n echarts.registerAction({\n type: actionTypes[i],\n update: 'updateView'\n }, noop);\n}\n\necharts.registerAction({\n type: 'treemapRootToNode',\n update: 'updateView'\n}, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\n});\n\n/***/ }),\n/* 1159 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar BoundingRect = __webpack_require__(21);\n\nvar _number = __webpack_require__(8);\n\nvar parsePercent = _number.parsePercent;\nvar MAX_SAFE_INTEGER = _number.MAX_SAFE_INTEGER;\n\nvar layout = __webpack_require__(16);\n\nvar helper = __webpack_require__(99);\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*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* The treemap layout implementation was originally copied from\n* \"d3.js\" with some modifications made for this project.\n* (See more details in the comment of the method \"squarify\" 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*/\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar retrieveValue = zrUtil.retrieve;\nvar each = zrUtil.each;\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\n/**\n * @public\n */\n\nvar _default = {\n seriesType: 'treemap',\n reset: function (seriesModel, ecModel, api, payload) {\n // Layout result in each node:\n // {x, y, width, height, area, borderWidth}\n var ecWidth = api.getWidth();\n var ecHeight = api.getHeight();\n var seriesOption = seriesModel.option;\n var layoutInfo = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n var size = seriesOption.size || []; // Compatible with ec2.\n\n var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), ecWidth);\n var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), ecHeight); // Fetch payload info.\n\n var payloadType = payload && payload.type;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null;\n var viewRoot = seriesModel.getViewRoot();\n var viewAbovePath = helper.getPathToRoot(viewRoot);\n\n if (payloadType !== 'treemapMove') {\n var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];\n var sort = seriesOption.sort;\n\n if (sort && sort !== 'asc' && sort !== 'desc') {\n sort = 'desc';\n }\n\n var options = {\n squareRatio: seriesOption.squareRatio,\n sort: sort,\n leafDepth: seriesOption.leafDepth\n }; // layout should be cleared because using updateView but not update.\n\n viewRoot.hostTree.clearLayouts(); // TODO\n // optimize: if out of view clip, do not layout.\n // But take care that if do not render node out of view clip,\n // how to calculate start po\n\n var viewRootLayout = {\n x: 0,\n y: 0,\n width: rootSize[0],\n height: rootSize[1],\n area: rootSize[0] * rootSize[1]\n };\n viewRoot.setLayout(viewRootLayout);\n squarify(viewRoot, options, false, 0); // Supplement layout.\n\n var viewRootLayout = viewRoot.getLayout();\n each(viewAbovePath, function (node, index) {\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\n node.setLayout(zrUtil.extend({\n dataExtent: [childValue, childValue],\n borderWidth: 0,\n upperHeight: 0\n }, viewRootLayout));\n });\n }\n\n var treeRoot = seriesModel.getData().tree.root;\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\n seriesModel.setLayoutInfo(layoutInfo); // FIXME\n // 现在没有clip功能,暂时取ec高宽。\n\n prunning(treeRoot, // Transform to base element coordinate system.\n new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\n }\n};\n/**\n * Layout treemap with squarify algorithm.\n * The original presentation of this algorithm\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\n * .\n * The implementation of this algorithm 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 *\n * @protected\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {Object} options\n * @param {string} options.sort 'asc' or 'desc'\n * @param {number} options.squareRatio\n * @param {boolean} hideChildren\n * @param {number} depth\n */\n\nfunction squarify(node, options, hideChildren, depth) {\n var width;\n var height;\n\n if (node.isRemoved()) {\n return;\n }\n\n var thisLayout = node.getLayout();\n width = thisLayout.width;\n height = thisLayout.height; // Considering border and gap\n\n var nodeModel = node.getModel();\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\n var layoutOffset = borderWidth - halfGapWidth;\n var layoutOffsetUpper = upperHeight - halfGapWidth;\n var nodeModel = node.getModel();\n node.setLayout({\n borderWidth: borderWidth,\n upperHeight: upperHeight,\n upperLabelHeight: upperLabelHeight\n }, true);\n width = mathMax(width - 2 * layoutOffset, 0);\n height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\n var totalArea = width * height;\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\n\n if (!viewChildren.length) {\n return;\n }\n\n var rect = {\n x: layoutOffset,\n y: layoutOffsetUpper,\n width: width,\n height: height\n };\n var rowFixedLength = mathMin(width, height);\n var best = Infinity; // the best row score so far\n\n var row = [];\n row.area = 0;\n\n for (var i = 0, len = viewChildren.length; i < len;) {\n var child = viewChildren[i];\n row.push(child);\n row.area += child.getLayout().area;\n var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation\n\n if (score <= best) {\n i++;\n best = score;\n } // abort, and try a different orientation\n else {\n row.area -= row.pop().getLayout().area;\n position(row, rowFixedLength, rect, halfGapWidth, false);\n rowFixedLength = mathMin(rect.width, rect.height);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n\n if (row.length) {\n position(row, rowFixedLength, rect, halfGapWidth, true);\n }\n\n if (!hideChildren) {\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\n\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\n hideChildren = true;\n }\n }\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n squarify(viewChildren[i], options, hideChildren, depth + 1);\n }\n}\n/**\n * Set area to each child, and calculate data extent for visual coding.\n */\n\n\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}\n/**\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\n */\n\n\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\n // visibleMin is not supported yet when no option.sort.\n if (!orderBy) {\n return sum;\n }\n\n var visibleMin = nodeModel.get('visibleMin');\n var len = orderedChildren.length;\n var deletePoint = len; // Always travel from little value to big value.\n\n for (var i = len - 1; i >= 0; i--) {\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\n\n if (value / sum * totalArea < visibleMin) {\n deletePoint = i;\n sum -= value;\n }\n }\n\n orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint);\n return sum;\n}\n/**\n * Sort\n */\n\n\nfunction sort(viewChildren, orderBy) {\n if (orderBy) {\n viewChildren.sort(function (a, b) {\n var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue();\n return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff;\n });\n }\n\n return viewChildren;\n}\n/**\n * Statistic\n */\n\n\nfunction statistic(nodeModel, children, orderBy) {\n // Calculate sum.\n var sum = 0;\n\n for (var i = 0, len = children.length; i < len; i++) {\n sum += children[i].getValue();\n } // Statistic data extent for latter visual coding.\n // Notice: data extent should be calculate based on raw children\n // but not filtered view children, otherwise visual mapping will not\n // be stable when zoom (where children is filtered by visibleMin).\n\n\n var dimension = nodeModel.get('visualDimension');\n var dataExtent; // The same as area dimension.\n\n if (!children || !children.length) {\n dataExtent = [NaN, NaN];\n } else if (dimension === 'value' && orderBy) {\n dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];\n orderBy === 'asc' && dataExtent.reverse();\n } // Other dimension.\n else {\n var dataExtent = [Infinity, -Infinity];\n each(children, function (child) {\n var value = child.getValue(dimension);\n value < dataExtent[0] && (dataExtent[0] = value);\n value > dataExtent[1] && (dataExtent[1] = value);\n });\n }\n\n return {\n sum: sum,\n dataExtent: dataExtent\n };\n}\n/**\n * Computes the score for the specified row,\n * as the worst aspect ratio.\n */\n\n\nfunction worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}\n/**\n * Positions the specified row of nodes. Modifies `rect`.\n */\n\n\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width.\n\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n} // Return [containerWidth, containerHeight] as defualt.\n\n\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\n // If targetInfo.node exists, we zoom to the node,\n // so estimate whold width and heigth by target node.\n var currNode = (targetInfo || {}).node;\n var defaultSize = [containerWidth, containerHeight];\n\n if (!currNode || currNode === viewRoot) {\n return defaultSize;\n }\n\n var parent;\n var viewArea = containerWidth * containerHeight;\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\n\n while (parent = currNode.parentNode) {\n // jshint ignore:line\n var sum = 0;\n var siblings = parent.children;\n\n for (var i = 0, len = siblings.length; i < len; i++) {\n sum += siblings[i].getValue();\n }\n\n var currNodeValue = currNode.getValue();\n\n if (currNodeValue === 0) {\n return defaultSize;\n }\n\n area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1.\n\n var parentModel = parent.getModel();\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel, borderWidth));\n area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\n currNode = parent;\n }\n\n area < viewArea && (area = viewArea);\n var scale = Math.pow(area / viewArea, 0.5);\n return [containerWidth * scale, containerHeight * scale];\n} // Root postion base on coord of containerGroup\n\n\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\n if (rootRect) {\n return {\n x: rootRect.x,\n y: rootRect.y\n };\n }\n\n var defaultPosition = {\n x: 0,\n y: 0\n };\n\n if (!targetInfo) {\n return defaultPosition;\n } // If targetInfo is fetched by 'retrieveTargetInfo',\n // old tree and new tree are the same tree,\n // so the node still exists and we can visit it.\n\n\n var targetNode = targetInfo.node;\n var layout = targetNode.getLayout();\n\n if (!layout) {\n return defaultPosition;\n } // Transform coord from local to container.\n\n\n var targetCenter = [layout.width / 2, layout.height / 2];\n var node = targetNode;\n\n while (node) {\n var nodeLayout = node.getLayout();\n targetCenter[0] += nodeLayout.x;\n targetCenter[1] += nodeLayout.y;\n node = node.parentNode;\n }\n\n return {\n x: layoutInfo.width / 2 - targetCenter[0],\n y: layoutInfo.height / 2 - targetCenter[1]\n };\n} // Mark nodes visible for prunning when visual coding and rendering.\n// Prunning depends on layout and root position, so we have to do it after layout.\n\n\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\n var nodeLayout = node.getLayout();\n var nodeInViewAbovePath = viewAbovePath[depth];\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\n\n if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {\n return;\n }\n\n node.setLayout({\n // isInView means: viewRoot sub tree + viewAbovePath\n isInView: true,\n // invisible only means: outside view clip so that the node can not\n // see but still layout for animation preparation but not render.\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\n isAboveViewRoot: isAboveViewRoot\n }, true); // Transform to child coordinate.\n\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\n each(node.viewChildren || [], function (child) {\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\n });\n}\n\nfunction getUpperLabelHeight(model) {\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1160 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar VisualMapping = __webpack_require__(106);\n\nvar zrColor = __webpack_require__(67);\n\nvar zrUtil = __webpack_require__(0);\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*/\nvar isArray = zrUtil.isArray;\nvar ITEM_STYLE_NORMAL = 'itemStyle';\nvar _default = {\n seriesType: 'treemap',\n reset: function (seriesModel, ecModel, api, payload) {\n var tree = seriesModel.getData().tree;\n var root = tree.root;\n var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL);\n\n if (root.isRemoved()) {\n return;\n }\n\n var levelItemStyles = zrUtil.map(tree.levelModels, function (levelModel) {\n return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null;\n });\n travelTree(root, // Visual should calculate from tree root but not view root.\n {}, levelItemStyles, seriesItemStyleModel, seriesModel.getViewRoot().getAncestors(), seriesModel);\n }\n};\n\nfunction travelTree(node, designatedVisual, levelItemStyles, seriesItemStyleModel, viewRootAncestors, seriesModel) {\n var nodeModel = node.getModel();\n var nodeLayout = node.getLayout(); // Optimize\n\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\n return;\n }\n\n var nodeItemStyleModel = node.getModel(ITEM_STYLE_NORMAL);\n var levelItemStyle = levelItemStyles[node.depth];\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel); // calculate border color\n\n var borderColor = nodeItemStyleModel.get('borderColor');\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\n var thisNodeColor;\n\n if (borderColorSaturation != null) {\n // For performance, do not always execute 'calculateColor'.\n thisNodeColor = calculateColor(visuals, node);\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\n }\n\n node.setVisual('borderColor', borderColor);\n var viewChildren = node.viewChildren;\n\n if (!viewChildren || !viewChildren.length) {\n thisNodeColor = calculateColor(visuals, node); // Apply visual to this node.\n\n node.setVisual('color', thisNodeColor);\n } else {\n var mapping = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); // Designate visual to children.\n\n zrUtil.each(viewChildren, function (child, index) {\n // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\n if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping, seriesModel);\n travelTree(child, childVisual, levelItemStyles, seriesItemStyleModel, viewRootAncestors, seriesModel);\n }\n });\n }\n}\n\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel) {\n var visuals = zrUtil.extend({}, designatedVisual);\n zrUtil.each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\n // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\n var val = nodeItemStyleModel.get(visualName, true); // Ignore parent\n\n val == null && levelItemStyle && (val = levelItemStyle[visualName]);\n val == null && (val = designatedVisual[visualName]);\n val == null && (val = seriesItemStyleModel.get(visualName));\n val != null && (visuals[visualName] = val);\n });\n return visuals;\n}\n\nfunction calculateColor(visuals) {\n var color = getValueVisualDefine(visuals, 'color');\n\n if (color) {\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\n\n if (colorSaturation) {\n color = zrColor.modifyHSL(color, null, null, colorSaturation);\n }\n\n if (colorAlpha) {\n color = zrColor.modifyAlpha(color, colorAlpha);\n }\n\n return color;\n }\n}\n\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\n return thisNodeColor != null ? zrColor.modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;\n}\n\nfunction getValueVisualDefine(visuals, name) {\n var value = visuals[name];\n\n if (value != null && value !== 'none') {\n return value;\n }\n}\n\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\n if (!viewChildren || !viewChildren.length) {\n return;\n }\n\n var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation'));\n\n if (!rangeVisual) {\n return;\n }\n\n var visualMin = nodeModel.get('visualMin');\n var visualMax = nodeModel.get('visualMax');\n var dataExtent = nodeLayout.dataExtent.slice();\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\n var colorMappingBy = nodeModel.get('colorMappingBy');\n var opt = {\n type: rangeVisual.name,\n dataExtent: dataExtent,\n visual: rangeVisual.range\n };\n\n if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\n opt.mappingMethod = 'category';\n opt.loop = true; // categories is ordinal, so do not set opt.categories.\n } else {\n opt.mappingMethod = 'linear';\n }\n\n var mapping = new VisualMapping(opt);\n mapping.__drColorMappingBy = colorMappingBy;\n return mapping;\n} // Notice: If we dont have the attribute 'colorRange', but only use\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\n// this problem will be encountered:\n// If a level-1 node dont have children, and its siblings has children,\n// and colorRange is set on level-1, then the node can not be colored.\n// So we separate 'colorRange' and 'color' to different attributes.\n\n\nfunction getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}\n\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\n var childVisuals = zrUtil.extend({}, visuals);\n\n if (mapping) {\n var mappingType = mapping.type;\n var colorMappingBy = mappingType === 'color' && mapping.__drColorMappingBy;\n var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension'));\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\n }\n\n return childVisuals;\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1161 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\n__webpack_require__(261);\n\n__webpack_require__(1168);\n\n/***/ }),\n/* 1162 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\n__webpack_require__(394);\n\n__webpack_require__(1169);\n\n/***/ }),\n/* 1163 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\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*/\nvar AxisPointerModel = echarts.extendComponentModel({\n type: 'axisPointer',\n coordSysAxesInfo: null,\n defaultOption: {\n // 'auto' means that show when triggered by tooltip or handle.\n show: 'auto',\n // 'click' | 'mousemove' | 'none'\n triggerOn: null,\n // set default in AxisPonterView.js\n zlevel: 0,\n z: 50,\n type: 'line',\n // 'line' 'shadow' 'cross' 'none'.\n // axispointer triggered by tootip determine snap automatically,\n // see `modelHelper`.\n snap: false,\n triggerTooltip: true,\n value: null,\n status: null,\n // 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}\n link: [],\n // Do not set 'auto' here, otherwise global animation: false\n // will not effect at this axispointer.\n animation: null,\n animationDurationUpdate: 200,\n lineStyle: {\n color: '#aaa',\n width: 1,\n type: 'solid'\n },\n shadowStyle: {\n color: 'rgba(150,150,150,0.3)'\n },\n label: {\n show: true,\n formatter: null,\n // string | Function\n precision: 'auto',\n // Or a number like 0, 1, 2 ...\n margin: 3,\n color: '#fff',\n padding: [5, 7, 5, 7],\n backgroundColor: 'auto',\n // default: axis line color\n borderColor: null,\n borderWidth: 0,\n shadowBlur: 3,\n shadowColor: '#aaa' // Considering applicability, common style should\n // better not have shadowOffset.\n // shadowOffsetX: 0,\n // shadowOffsetY: 2\n\n },\n handle: {\n show: false,\n\n /* eslint-disable */\n 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',\n // jshint ignore:line\n\n /* eslint-enable */\n size: 45,\n // handle margin is from symbol center to axis, which is stable when circular move.\n margin: 50,\n // color: '#1b8bbd'\n // color: '#2f4554'\n color: '#333',\n shadowBlur: 3,\n shadowColor: '#aaa',\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n // For mobile performance\n throttle: 40\n }\n }\n});\nvar _default = AxisPointerModel;\nmodule.exports = _default;\n\n/***/ }),\n/* 1164 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar globalListener = __webpack_require__(371);\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*/\nvar AxisPointerView = echarts.extendComponentView({\n type: 'axisPointer',\n render: function (globalAxisPointerModel, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n 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.\n\n globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n dispatchAction({\n type: 'updateAxisPointer',\n currTrigger: currTrigger,\n x: e && e.offsetX,\n y: e && e.offsetY\n });\n }\n });\n },\n\n /**\n * @override\n */\n remove: function (ecModel, api) {\n globalListener.unregister(api.getZr(), 'axisPointer');\n AxisPointerView.superApply(this._model, 'remove', arguments);\n },\n\n /**\n * @override\n */\n dispose: function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n AxisPointerView.superApply(this._model, 'dispose', arguments);\n }\n});\nvar _default = AxisPointerView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1165 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar formatUtil = __webpack_require__(19);\n\nvar BaseAxisPointer = __webpack_require__(249);\n\nvar graphic = __webpack_require__(5);\n\nvar viewHelper = __webpack_require__(175);\n\nvar matrix = __webpack_require__(36);\n\nvar AxisBuilder = __webpack_require__(100);\n\nvar AxisView = __webpack_require__(101);\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*/\nvar PolarAxisPointer = BaseAxisPointer.extend({\n /**\n * @override\n */\n makeElOption: function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n\n if (axis.dim === 'angle') {\n this.animationThreshold = Math.PI / 18;\n }\n\n var polar = axis.polar;\n var otherAxis = polar.getOtherAxis(axis);\n var otherExtent = otherAxis.getExtent();\n var coordValue;\n coordValue = axis['dataTo' + formatUtil.capitalFirst(axis.dim)](value);\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, polar, coordValue, otherExtent, elStyle);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var labelMargin = axisPointerModel.get('label.margin');\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\n viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\n } // Do not support handle, utill any user requires it.\n\n});\n\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\n var axis = axisModel.axis;\n var coord = axis.dataToCoord(value);\n var axisAngle = polar.getAngleAxis().getExtent()[0];\n axisAngle = axisAngle / 180 * Math.PI;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var position;\n var align;\n var verticalAlign;\n\n if (axis.dim === 'radius') {\n var transform = matrix.create();\n matrix.rotate(transform, transform, axisAngle);\n matrix.translate(transform, transform, [polar.cx, polar.cy]);\n position = graphic.applyTransform([coord, -labelMargin], transform);\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0;\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\n align = labelLayout.textAlign;\n verticalAlign = labelLayout.textVerticalAlign;\n } else {\n // angle axis\n var r = radiusExtent[1];\n position = polar.coordToPoint([r + labelMargin, coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right';\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom';\n }\n\n return {\n position: position,\n align: align,\n verticalAlign: verticalAlign\n };\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, polar, coordValue, otherExtent, elStyle) {\n return axis.dim === 'angle' ? {\n type: 'Line',\n shape: viewHelper.makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\n } : {\n type: 'Circle',\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: coordValue\n }\n };\n },\n shadow: function (axis, polar, coordValue, otherExtent, elStyle) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var radian = Math.PI / 180;\n return axis.dim === 'angle' ? {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive\n (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\n } : {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\n };\n }\n};\nAxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\nvar _default = PolarAxisPointer;\nmodule.exports = _default;\n\n/***/ }),\n/* 1166 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar graphic = __webpack_require__(5);\n\nvar BaseAxisPointer = __webpack_require__(249);\n\nvar viewHelper = __webpack_require__(175);\n\nvar singleAxisHelper = __webpack_require__(399);\n\nvar AxisView = __webpack_require__(101);\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*/\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\nvar SingleAxisPointer = BaseAxisPointer.extend({\n /**\n * @override\n */\n makeElOption: function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\n var pixelValue = coordSys.dataToPoint(value)[0];\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent, elStyle);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = singleAxisHelper.layout(axisModel);\n viewHelper.buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n },\n\n /**\n * @override\n */\n getHandleTransform: function (value, axisModel, axisPointerModel) {\n var layoutInfo = singleAxisHelper.layout(axisModel, {\n labelInside: false\n });\n layoutInfo.labelMargin = axisPointerModel.get('handle.margin');\n return {\n position: viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo),\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n },\n\n /**\n * @override\n */\n updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var dimIndex = getPointDimIndex(axis);\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\n var currPosition = transform.position;\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex];\n return {\n position: currPosition,\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: {\n verticalAlign: 'middle'\n }\n };\n }\n});\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent, elStyle) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\n graphic.subPixelOptimizeLine({\n shape: targetShape,\n style: elStyle\n });\n return {\n type: 'Line',\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent, elStyle) {\n var bandWidth = axis.getBandWidth();\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\n };\n }\n};\n\nfunction getPointDimIndex(axis) {\n return axis.isHorizontal() ? 0 : 1;\n}\n\nfunction getGlobalExtent(coordSys, dimIndex) {\n var rect = coordSys.getRect();\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\n}\n\nAxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\nvar _default = SingleAxisPointer;\nmodule.exports = _default;\n\n/***/ }),\n/* 1167 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar _model = __webpack_require__(9);\n\nvar makeInner = _model.makeInner;\n\nvar modelHelper = __webpack_require__(174);\n\nvar findPointFromSeries = __webpack_require__(370);\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*/\nvar each = zrUtil.each;\nvar curry = zrUtil.curry;\nvar inner = makeInner();\n/**\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 */\n\nfunction _default(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || zrUtil.bind(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n 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.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputFinder = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: curry(showPointer, showValueMap),\n showTooltip: curry(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputFinder);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n each(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n each(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputFinder);\n });\n updateModelActually(showValueMap, axesInfo, outputFinder);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputFinder;\n}\n\nfunction processOnAxis(axisInfo, newValue, updaters, dontSnap, outputFinder) {\n var axis = axisInfo.axis;\n\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\n return;\n }\n\n if (!axisInfo.involveSeries) {\n updaters.showPointer(axisInfo, newValue);\n return;\n } // Heavy calculation. So put it after axis.containData checking.\n\n\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n var payloadBatch = payloadInfo.payloadBatch;\n var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect.\n // By defualt use the first involved series data as a sample to connect.\n\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n zrUtil.extend(outputFinder, payloadBatch[0]);\n } // If no linkSource input, this process is for collecting link\n // target, where snap should not be accepted.\n\n\n if (!dontSnap && axisInfo.snap) {\n if (axis.containData(snapToValue) && snapToValue != null) {\n newValue = snapToValue;\n }\n }\n\n 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.\n\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\n\nfunction buildPayloadsBySeries(value, axisInfo) {\n var axis = axisInfo.axis;\n var dim = axis.dim;\n var snapToValue = value;\n var payloadBatch = [];\n var minDist = Number.MAX_VALUE;\n var minDiff = -1;\n each(axisInfo.seriesModels, function (series, idx) {\n var dataDim = series.getData().mapDimension(dim, true);\n var seriesNestestValue;\n var dataIndices;\n\n if (series.getAxisTooltipData) {\n var result = series.getAxisTooltipData(dataDim, value, axis);\n dataIndices = result.dataIndices;\n seriesNestestValue = result.nestestValue;\n } else {\n 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,\n axis.type === 'category' ? 0.5 : null);\n\n if (!dataIndices.length) {\n return;\n }\n\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n }\n\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n return;\n }\n\n var diff = value - seriesNestestValue;\n var dist = Math.abs(diff); // Consider category case\n\n if (dist <= minDist) {\n if (dist < minDist || diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n snapToValue = seriesNestestValue;\n payloadBatch.length = 0;\n }\n\n each(dataIndices, function (dataIndex) {\n payloadBatch.push({\n seriesIndex: series.seriesIndex,\n dataIndexInside: dataIndex,\n dataIndex: series.getData().getRawIndex(dataIndex)\n });\n });\n }\n });\n return {\n payloadBatch: payloadBatch,\n snapToValue: snapToValue\n };\n}\n\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n showValueMap[axisInfo.key] = {\n value: value,\n payloadBatch: payloadBatch\n };\n}\n\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n var payloadBatch = payloadInfo.payloadBatch;\n var axis = axisInfo.axis;\n var axisModel = axis.model;\n var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys,\n // whose length will be used to judge whether dispatch action.\n\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n return;\n }\n\n var coordSysModel = axisInfo.coordSys.model;\n var coordSysKey = modelHelper.makeKey(coordSysModel);\n var coordSysItem = dataByCoordSys.map[coordSysKey];\n\n if (!coordSysItem) {\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\n coordSysId: coordSysModel.id,\n coordSysIndex: coordSysModel.componentIndex,\n coordSysType: coordSysModel.type,\n coordSysMainType: coordSysModel.mainType,\n dataByAxis: []\n };\n dataByCoordSys.list.push(coordSysItem);\n }\n\n coordSysItem.dataByAxis.push({\n axisDim: axis.dim,\n axisIndex: axisModel.componentIndex,\n axisType: axisModel.type,\n axisId: axisModel.id,\n value: value,\n // 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.\n valueLabelOpt: {\n precision: axisPointerModel.get('label.precision'),\n formatter: axisPointerModel.get('label.formatter')\n },\n seriesDataIndices: payloadBatch.slice()\n });\n}\n\nfunction updateModelActually(showValueMap, axesInfo, outputFinder) {\n var outputAxesInfo = outputFinder.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n var valItem = showValueMap[key];\n\n if (valItem) {\n !axisInfo.useHandle && (option.status = 'show');\n option.value = valItem.value; // For label formatter param and highlight.\n\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n } // When always show (e.g., handle used), remain\n // original value and status.\n else {\n // If hide, value still need to be set, consider\n // click legend to toggle axis blank.\n !axisInfo.useHandle && (option.status = 'hide');\n } // If status is 'hide', should be no info in payload.\n\n\n option.status === 'show' && outputAxesInfo.push({\n axisDim: axisInfo.axis.dim,\n axisIndex: axisInfo.axis.model.componentIndex,\n value: option.value\n });\n });\n}\n\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n // Basic logic: If no showTip required, hideTip will be dispatched.\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\n dispatchAction({\n type: 'hideTip'\n });\n return;\n } // 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.\n\n\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n dispatchAction({\n type: 'showTip',\n escapeConnect: true,\n x: point[0],\n y: point[1],\n tooltipOption: payload.tooltipOption,\n position: payload.position,\n dataIndexInside: sampleItem.dataIndexInside,\n dataIndex: sampleItem.dataIndex,\n seriesIndex: sampleItem.seriesIndex,\n dataByCoordSys: dataByCoordSys.list\n });\n}\n\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n // FIXME\n // highlight status modification shoule be a stage of main process?\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\n var zr = api.getZr();\n var highDownKey = 'axisPointerLastHighlights';\n var lastHighlights = inner(zr)[highDownKey] || {};\n var newHighlights = inner(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model.\n // Build hash map and remove duplicate incidentally.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n newHighlights[key] = batchItem;\n });\n }); // Diff.\n\n var toHighlight = [];\n var toDownplay = [];\n zrUtil.each(lastHighlights, function (batchItem, key) {\n !newHighlights[key] && toDownplay.push(batchItem);\n });\n zrUtil.each(newHighlights, function (batchItem, key) {\n !lastHighlights[key] && toHighlight.push(batchItem);\n });\n toDownplay.length && api.dispatchAction({\n type: 'downplay',\n escapeConnect: true,\n batch: toDownplay\n });\n toHighlight.length && api.dispatchAction({\n type: 'highlight',\n escapeConnect: true,\n batch: toHighlight\n });\n}\n\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n var inputAxisInfo = inputAxesInfo[i];\n\n if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n return inputAxisInfo;\n }\n }\n}\n\nfunction makeMapperParam(axisInfo) {\n var axisModel = axisInfo.axis.model;\n var item = {};\n var dim = item.axisDim = axisInfo.axis.dim;\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\n return item;\n}\n\nfunction illegalPoint(point) {\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1168 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar Model = __webpack_require__(31);\n\nvar AxisView = __webpack_require__(101);\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*/\nvar elementList = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea'];\n\nfunction getAxisLineShape(polar, rExtent, angle) {\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\n var start = polar.coordToPoint([rExtent[0], angle]);\n var end = polar.coordToPoint([rExtent[1], angle]);\n return {\n x1: start[0],\n y1: start[1],\n x2: end[0],\n y2: end[1]\n };\n}\n\nfunction getRadiusIdx(polar) {\n var radiusAxis = polar.getRadiusAxis();\n return radiusAxis.inverse ? 0 : 1;\n} // Remove the last tick which will overlap the first tick\n\n\nfunction fixAngleOverlap(list) {\n var firstItem = list[0];\n var lastItem = list[list.length - 1];\n\n if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\n list.pop();\n }\n}\n\nvar _default = AxisView.extend({\n type: 'angleAxis',\n axisPointerClass: 'PolarAxisPointer',\n render: function (angleAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!angleAxisModel.get('show')) {\n return;\n }\n\n var angleAxis = angleAxisModel.axis;\n var polar = angleAxis.polar;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var ticksAngles = angleAxis.getTicksCoords();\n var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {\n var labelItem = zrUtil.clone(labelItem);\n labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);\n return labelItem;\n });\n fixAngleOverlap(labels);\n fixAngleOverlap(ticksAngles);\n zrUtil.each(elementList, function (name) {\n if (angleAxisModel.get(name + '.show') && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\n this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels);\n }\n }, this);\n },\n\n /**\n * @private\n */\n _axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {\n var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle');\n var circle = new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[getRadiusIdx(polar)]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n circle.style.fill = null;\n this.group.add(circle);\n },\n\n /**\n * @private\n */\n _axisTick: function (angleAxisModel, polar, ticksAngles, radiusExtent) {\n var tickModel = angleAxisModel.getModel('axisTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\n return new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\n });\n });\n this.group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), {\n stroke: angleAxisModel.get('axisLine.lineStyle.color')\n })\n }));\n },\n\n /**\n * @private\n */\n _axisLabel: function (angleAxisModel, polar, ticksAngles, radiusExtent, labels) {\n var rawCategoryData = angleAxisModel.getCategories(true);\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\n var labelMargin = commonLabelModel.get('margin'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping\n\n zrUtil.each(labels, function (labelItem, idx) {\n var labelModel = commonLabelModel;\n var tickValue = labelItem.tickValue;\n var r = radiusExtent[getRadiusIdx(polar)];\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right';\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom';\n\n if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) {\n labelModel = new Model(rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel);\n }\n\n var textEl = new graphic.Text({\n silent: true\n });\n this.group.add(textEl);\n graphic.setTextStyle(textEl.style, labelModel, {\n x: p[0],\n y: p[1],\n textFill: labelModel.getTextColor() || angleAxisModel.get('axisLine.lineStyle.color'),\n text: labelItem.formattedLabel,\n textAlign: labelTextAlign,\n textVerticalAlign: labelTextVerticalAlign\n });\n }, this);\n },\n\n /**\n * @private\n */\n _splitLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {\n var splitLineModel = angleAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksAngles.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n this.group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyleModel.getLineStyle()),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n }\n },\n\n /**\n * @private\n */\n _splitArea: function (angleAxisModel, polar, ticksAngles, radiusExtent) {\n if (!ticksAngles.length) {\n return;\n }\n\n var splitAreaModel = angleAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var RADIAN = Math.PI / 180;\n var prevAngle = -ticksAngles[0].coord * RADIAN;\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\n var clockwise = angleAxisModel.get('clockwise');\n\n for (var i = 1; i < ticksAngles.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: r0,\n r: r1,\n startAngle: prevAngle,\n endAngle: -ticksAngles[i].coord * RADIAN,\n clockwise: clockwise\n },\n silent: true\n }));\n prevAngle = -ticksAngles[i].coord * RADIAN;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n this.group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n});\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1169 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar AxisBuilder = __webpack_require__(100);\n\nvar AxisView = __webpack_require__(101);\n\nvar cartesianAxisHelper = __webpack_require__(395);\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*/\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine']; // function getAlignWithLabel(model, axisModel) {\n// var alignWithLabel = model.get('alignWithLabel');\n// if (alignWithLabel === 'auto') {\n// alignWithLabel = axisModel.get('axisTick.alignWithLabel');\n// }\n// return alignWithLabel;\n// }\n\nvar CartesianAxisView = AxisView.extend({\n type: 'cartesianAxis',\n axisPointerClass: 'CartesianAxisPointer',\n\n /**\n * @override\n */\n render: function (axisModel, ecModel, api, payload) {\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var gridModel = axisModel.getCoordSysModel();\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\n var axisBuilder = new AxisBuilder(axisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get(name + '.show')) {\n this['_' + name](axisModel, gridModel);\n }\n }, this);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n CartesianAxisView.superCall(this, 'render', axisModel, ecModel, api, payload);\n },\n remove: function () {\n this._splitAreaColors = null;\n },\n\n /**\n * @param {module:echarts/coord/cartesian/AxisModel} axisModel\n * @param {module:echarts/coord/cartesian/GridModel} gridModel\n * @private\n */\n _splitLine: function (axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = []; // Simple optimization\n // Batching the lines if color are the same\n\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n var tickValue = ticksCoords[i].tickValue;\n\n this._axisGroup.add(new graphic.Line(graphic.subPixelOptimizeLine({\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: zrUtil.defaults({\n stroke: lineColors[colorIndex]\n }, lineStyle),\n silent: true\n })));\n }\n },\n\n /**\n * @param {module:echarts/coord/cartesian/AxisModel} axisModel\n * @param {module:echarts/coord/cartesian/GridModel} gridModel\n * @private\n */\n _splitArea: function (axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n\n if (!ticksCoords.length) {\n return;\n } // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n\n\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = this._splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x;\n var y;\n var width;\n var height;\n\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n\n this._axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n silent: true\n }));\n\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n\n this._splitAreaColors = newSplitAreaColors;\n }\n});\nCartesianAxisView.extend({\n type: 'xAxis'\n});\nCartesianAxisView.extend({\n type: 'yAxis'\n});\n\n/***/ }),\n/* 1170 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar AxisBuilder = __webpack_require__(100);\n\nvar BrushController = __webpack_require__(251);\n\nvar brushHelper = __webpack_require__(379);\n\nvar graphic = __webpack_require__(5);\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*/\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\nvar AxisView = echarts.extendComponentView({\n type: 'parallelAxis',\n\n /**\n * @override\n */\n init: function (ecModel, api) {\n AxisView.superApply(this, 'init', arguments);\n /**\n * @type {module:echarts/component/helper/BrushController}\n */\n\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this));\n },\n\n /**\n * @override\n */\n render: function (axisModel, ecModel, api, payload) {\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\n return;\n }\n\n this.axisModel = axisModel;\n this.api = api;\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\n var coordSys = coordSysModel.coordinateSystem;\n var areaSelectStyle = axisModel.getAreaSelectStyle();\n var areaWidth = areaSelectStyle.width;\n var dim = axisModel.axis.dim;\n var axisLayout = coordSys.getAxisLayout(dim);\n var builderOpt = zrUtil.extend({\n strokeContainThreshold: areaWidth\n }, axisLayout);\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\n zrUtil.each(elementList, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\n\n var animationModel = payload && payload.animation === false ? null : axisModel;\n graphic.groupTransition(oldAxisGroup, this._axisGroup, animationModel);\n },\n // /**\n // * @override\n // */\n // updateVisual: function (axisModel, ecModel, api, payload) {\n // this._brushController && this._brushController\n // .updateCovers(getCoverInfoList(axisModel));\n // },\n _refreshBrushController: function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\n // After filtering, axis may change, select area needs to be update.\n var extent = axisModel.axis.getExtent();\n var extentLen = extent[1] - extent[0];\n var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\n // width/height might be negative, which will be\n // normalized in BoundingRect.\n\n var rect = graphic.BoundingRect.create({\n x: extent[0],\n y: -areaWidth / 2,\n width: extentLen,\n height: areaWidth\n });\n rect.x -= extra;\n rect.width += 2 * extra;\n\n this._brushController.mount({\n enableGlobalPan: true,\n rotation: builderOpt.rotation,\n position: builderOpt.position\n }).setPanels([{\n panelId: 'pl',\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\n }]).enableBrush({\n brushType: 'lineX',\n brushStyle: areaSelectStyle,\n removeOnClick: true\n }).updateCovers(getCoverInfoList(axisModel));\n },\n _onBrush: function (coverInfoList, opt) {\n // Do not cache these object, because the mey be changed.\n var axisModel = this.axisModel;\n var axis = axisModel.axis;\n var intervals = zrUtil.map(coverInfoList, function (coverInfo) {\n return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];\n }); // If realtime is true, action is not dispatched on drag end, because\n // the drag end emits the same params with the last drag move event,\n // and may have some delay when using touch pad.\n\n if (!axisModel.option.realtime === opt.isEnd || opt.removeOnClick) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'axisAreaSelect',\n parallelAxisId: axisModel.id,\n intervals: intervals\n });\n }\n },\n\n /**\n * @override\n */\n dispose: function () {\n this._brushController.dispose();\n }\n});\n\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\n return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({\n mainType: 'parallelAxis',\n query: payload\n })[0] === axisModel;\n}\n\nfunction getCoverInfoList(axisModel) {\n var axis = axisModel.axis;\n return zrUtil.map(axisModel.activeIntervals, function (interval) {\n return {\n brushType: 'lineX',\n panelId: 'pl',\n range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]\n };\n });\n}\n\nfunction getCoordSysModel(axisModel, ecModel) {\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\n}\n\nvar _default = AxisView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1171 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar graphic = __webpack_require__(5);\n\nvar AxisBuilder = __webpack_require__(100);\n\nvar AxisView = __webpack_require__(101);\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*/\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea'];\n\nvar _default = AxisView.extend({\n type: 'radiusAxis',\n axisPointerClass: 'PolarAxisPointer',\n render: function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!radiusAxisModel.get('show')) {\n return;\n }\n\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n this.group.add(axisBuilder.getGroup());\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get(name + '.show') && !radiusAxis.scale.isBlank()) {\n this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords);\n }\n }, this);\n },\n\n /**\n * @private\n */\n _splitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: ticksCoords[i].coord\n },\n silent: true\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n this.group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n\n /**\n * @private\n */\n _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n this.group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n});\n/**\n * @inner\n */\n\n\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\n\nmodule.exports = _default;\n\n/***/ }),\n/* 1172 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar zrUtil = __webpack_require__(0);\n\nvar AxisBuilder = __webpack_require__(100);\n\nvar graphic = __webpack_require__(5);\n\nvar singleAxisHelper = __webpack_require__(399);\n\nvar AxisView = __webpack_require__(101);\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*/\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttr = 'splitLine';\nvar SingleAxisView = AxisView.extend({\n type: 'singleAxis',\n axisPointerClass: 'SingleAxisPointer',\n render: function (axisModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n var layout = singleAxisHelper.layout(axisModel);\n var axisBuilder = new AxisBuilder(axisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n group.add(axisBuilder.getGroup());\n\n if (axisModel.get(selfBuilderAttr + '.show')) {\n this['_' + selfBuilderAttr](axisModel);\n }\n\n SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload);\n },\n _splitLine: function (axisModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineWidth = lineStyleModel.get('width');\n var lineColors = lineStyleModel.get('color');\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var gridRect = axisModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var splitLines = [];\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n\n for (var i = 0; i < ticksCoords.length; ++i) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line(graphic.subPixelOptimizeLine({\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: {\n lineWidth: lineWidth\n },\n silent: true\n })));\n }\n\n for (var i = 0; i < splitLines.length; ++i) {\n this.group.add(graphic.mergePath(splitLines[i], {\n style: {\n stroke: lineColors[i % lineColors.length],\n lineDash: lineStyleModel.getLineDash(lineWidth),\n lineWidth: lineWidth\n },\n silent: true\n }));\n }\n }\n});\nvar _default = SingleAxisView;\nmodule.exports = _default;\n\n/***/ }),\n/* 1173 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\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*/\n\n/**\n * @payload\n * @property {string} parallelAxisId\n * @property {Array.>} intervals\n */\nvar actionInfo = {\n type: 'axisAreaSelect',\n event: 'axisAreaSelected' // update: 'updateVisual'\n\n};\necharts.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallelAxis',\n query: payload\n }, function (parallelAxisModel) {\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\n });\n});\n/**\n * @payload\n */\n\necharts.registerAction('parallelAxisExpand', function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallel',\n query: payload\n }, function (parallelModel) {\n parallelModel.setAxisExpand(payload);\n });\n});\n\n/***/ }),\n/* 1174 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar echarts = __webpack_require__(3);\n\nvar preprocessor = __webpack_require__(1178);\n\n__webpack_require__(1180);\n\n__webpack_require__(1175);\n\n__webpack_require__(1176);\n\n__webpack_require__(1177);\n\n__webpack_require__(1231);\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*/\n\n/**\n * Brush component entry\n */\necharts.registerPreprocessor(preprocessor);\n\n/***/ }),\n/* 1175 */\n/***/ (function(module, exports, __webpack_require__) {\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*/\n\nvar _config = __webpack_require__(13);\n\nvar __DEV__ = _config.__DEV__;\n\nvar echarts = __webpack_require__(3);\n\nvar zrUtil = __webpack_require__(0);\n\nvar visualSolution = __webpack_require__(185);\n\nvar Model = __webpack_require__(31);\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*/\nvar DEFAULT_OUT_OF_BRUSH_COLOR = ['#ddd'];\nvar BrushModel = echarts.extendComponentModel({\n type: 'brush',\n dependencies: ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'],\n\n /**\n * @protected\n */\n defaultOption: {\n // inBrush: null,\n // outOfBrush: null,\n toolbox: null,\n // Default value see preprocessor.\n brushLink: null,\n // Series indices array, broadcast using dataIndex.\n // or 'all', which means all series. 'none' or null means no series.\n seriesIndex: 'all',\n // seriesIndex array, specify series controlled by this brush component.\n geoIndex: null,\n //\n xAxisIndex: null,\n yAxisIndex: null,\n brushType: 'rect',\n // Default brushType, see BrushController.\n brushMode: 'single',\n // Default brushMode, 'single' or 'multiple'\n transformable: true,\n // Default transformable.\n brushStyle: {\n // Default brushStyle\n borderWidth: 1,\n color: 'rgba(120,140,180,0.3)',\n borderColor: 'rgba(120,140,180,0.8)'\n },\n throttleType: 'fixRate',\n // Throttle in brushSelected event. 'fixRate' or 'debounce'.\n // If null, no throttle. Valid only in the first brush component\n throttleDelay: 0,\n // Unit: ms, 0 means every event will be triggered.\n // FIXME\n // 试验效果\n removeOnClick: true,\n z: 10000\n },\n\n /**\n * @readOnly\n * @type {Array.