ackgroundPosition: \"50%\",\n backgroundRepeat: \"no-repeat\",\n backgroundSize: \"contain\",\n fontSize: \"1em\",\n lineHeight: \"1em\",\n verticalAlign: \"middle\",\n ...styleProps\n }}\n title={title || code}\n />\n ) : (\n \n {emoji}\n \n );\n }\n}\n","var factory = require('./factory')\nmodule.exports = factory()\n","var element = require('./_element')\nvar window = require('./_window')\nvar withFauxDOM = require('./_withFauxDOM')\n\nfunction factory () {\n var Element = element()\n var Window = window()\n var ReactFauxDOM = {\n Element: Element,\n defaultView: Window,\n withFauxDOM: withFauxDOM(Element),\n createElement: function (nodeName) {\n return new Element(nodeName)\n },\n createElementNS: function (namespace, nodeName) {\n return this.createElement(nodeName)\n },\n compareDocumentPosition: function () {\n // The selector engine tries to validate with this, but we don't care.\n // 8 = DOCUMENT_POSITION_CONTAINS, so we say all nodes are in this document.\n return 8\n }\n }\n\n Element.prototype.ownerDocument = ReactFauxDOM\n return ReactFauxDOM\n}\n\nmodule.exports = factory\n","var React = require('react')\nvar styleAttr = require('style-attr')\nvar querySelectorAll = require('query-selector')\nvar camelCase = require('./utils/camelCase')\nvar isString = require('./utils/isString')\nvar isUndefined = require('./utils/isUndefined')\nvar assign = require('./utils/assign')\nvar mapValues = require('./utils/mapValues')\nvar styleCamelCase = require('./utils/styleCamelCase')\n\nfunction element () {\n function Element (nodeName, parentNode) {\n this.nodeName = nodeName\n this.parentNode = parentNode\n this.childNodes = []\n this.eventListeners = {}\n this.text = ''\n var self = this\n var props = this.props = {\n ref: function (component) {\n self.component = component\n },\n style: {\n setProperty: function (name, value) {\n props.style[styleCamelCase(name)] = value\n },\n getProperty: function (name) {\n return props.style[styleCamelCase(name)] || ''\n },\n getPropertyValue: function (name) {\n return props.style.getProperty(name)\n },\n removeProperty: function (name) {\n delete props.style[styleCamelCase(name)]\n }\n }\n }\n\n this.style = props.style\n }\n\n Element.ELEMENT_NODE = 1\n Element.DOCUMENT_POSITION_DISCONNECTED = 1\n Element.DOCUMENT_POSITION_PRECEDING = 2\n Element.DOCUMENT_POSITION_FOLLOWING = 4\n Element.DOCUMENT_POSITION_CONTAINS = 8\n Element.DOCUMENT_POSITION_CONTAINED_BY = 16\n\n Element.prototype.nodeType = 1\n\n // This was easy to do with Vim.\n // Just saying.\n Element.prototype.eventNameMappings = {\n 'blur': 'onBlur',\n 'change': 'onChange',\n 'click': 'onClick',\n 'contextmenu': 'onContextMenu',\n 'copy': 'onCopy',\n 'cut': 'onCut',\n 'doubleclick': 'onDoubleClick',\n 'drag': 'onDrag',\n 'dragend': 'onDragEnd',\n 'dragenter': 'onDragEnter',\n 'dragexit': 'onDragExit',\n 'dragleave': 'onDragLeave',\n 'dragover': 'onDragOver',\n 'dragstart': 'onDragStart',\n 'drop': 'onDrop',\n 'error': 'onError',\n 'focus': 'onFocus',\n 'input': 'onInput',\n 'keydown': 'onKeyDown',\n 'keypress': 'onKeyPress',\n 'keyup': 'onKeyUp',\n 'load': 'onLoad',\n 'mousedown': 'onMouseDown',\n 'mouseenter': 'onMouseEnter',\n 'mouseleave': 'onMouseLeave',\n 'mousemove': 'onMouseMove',\n 'mouseout': 'onMouseOut',\n 'mouseover': 'onMouseOver',\n 'mouseup': 'onMouseUp',\n 'paste': 'onPaste',\n 'scroll': 'onScroll',\n 'submit': 'onSubmit',\n 'touchcancel': 'onTouchCancel',\n 'touchend': 'onTouchEnd',\n 'touchmove': 'onTouchMove',\n 'touchstart': 'onTouchStart',\n 'wheel': 'onWheel'\n }\n\n Element.prototype.skipNameTransformationExpressions = [\n /^data-/,\n /^aria-/\n ]\n\n Element.prototype.attributeNameMappings = {\n 'class': 'className'\n }\n\n Element.prototype.attributeToPropName = function (name) {\n var skipTransformMatches = this.skipNameTransformationExpressions.map(function (expr) {\n return expr.test(name)\n })\n\n if (skipTransformMatches.some(Boolean)) {\n return name\n } else {\n return this.attributeNameMappings[name] || camelCase(name)\n }\n }\n\n Element.prototype.setAttribute = function (name, value) {\n if (name === 'style' && isString(value)) {\n var styles = styleAttr.parse(value)\n\n for (var key in styles) {\n this.style.setProperty(key, styles[key])\n }\n } else {\n this.props[this.attributeToPropName(name)] = value\n }\n }\n\n Element.prototype.getAttribute = function (name) {\n return this.props[this.attributeToPropName(name)]\n }\n\n Element.prototype.getAttributeNode = function (name) {\n var value = this.getAttribute(name)\n\n if (!isUndefined(value)) {\n return {\n value: value,\n specified: true\n }\n }\n }\n\n Element.prototype.removeAttribute = function (name) {\n delete this.props[this.attributeToPropName(name)]\n }\n\n Element.prototype.eventToPropName = function (name) {\n return this.eventNameMappings[name] || name\n }\n\n Element.prototype.addEventListener = function (name, fn) {\n var prop = this.eventToPropName(name)\n this.eventListeners[prop] = this.eventListeners[prop] || []\n this.eventListeners[prop].push(fn)\n }\n\n Element.prototype.removeEventListener = function (name, fn) {\n var listeners = this.eventListeners[this.eventToPropName(name)]\n\n if (listeners) {\n var match = listeners.indexOf(fn)\n\n if (match !== -1) {\n listeners.splice(match, 1)\n }\n }\n }\n\n Element.prototype.appendChild = function (el) {\n if (el instanceof Element) {\n el.parentNode = this\n }\n\n this.childNodes.push(el)\n return el\n }\n\n Element.prototype.insertBefore = function (el, before) {\n var index = this.childNodes.indexOf(before)\n el.parentNode = this\n\n if (index !== -1) {\n this.childNodes.splice(index, 0, el)\n } else {\n this.childNodes.push(el)\n }\n\n return el\n }\n\n Element.prototype.removeChild = function (child) {\n var target = this.childNodes.indexOf(child)\n this.childNodes.splice(target, 1)\n }\n\n Element.prototype.querySelector = function () {\n return this.querySelectorAll.apply(this, arguments)[0] || null\n }\n\n Element.prototype.querySelectorAll = function (selector) {\n if (!selector) {\n throw new Error('Not enough arguments')\n }\n\n return querySelectorAll(selector, this)\n }\n\n Element.prototype.getElementsByTagName = function (nodeName) {\n var children = this.children\n\n if (children.length === 0) {\n return []\n } else {\n var matches\n\n if (nodeName !== '*') {\n matches = children.filter(function (el) {\n return el.nodeName === nodeName\n })\n } else {\n matches = children\n }\n\n var childMatches = children.map(function (el) {\n return el.getElementsByTagName(nodeName)\n })\n\n return matches.concat.apply(matches, childMatches)\n }\n }\n\n Element.prototype.getElementById = function (id) {\n var children = this.children\n\n if (children.length === 0) {\n return null\n } else {\n var match = children.filter(function (el) {\n return el.getAttribute('id') === id\n })[0]\n\n if (match) {\n return match\n } else {\n var childMatches = children.map(function (el) {\n return el.getElementById(id)\n })\n\n return childMatches.filter(function (match) {\n return match !== null\n })[0] || null\n }\n }\n }\n\n Element.prototype.getBoundingClientRect = function () {\n if (!this.component) {\n return undefined\n }\n\n return this.component.getBoundingClientRect()\n }\n\n Element.prototype.cloneNode = function (deep) {\n // if deep is not provided, it default to true\n if (deep === undefined) {\n deep = true\n }\n var el = new Element(this.nodeName, this.parentNode)\n // copy nodeType\n if (this.nodeType) {\n el.nodeType = this.nodeType\n }\n\n var k\n\n // copy the props\n for (k in this.props) {\n if (this.props.hasOwnProperty(k) && k !== 'ref' && k !== 'style') {\n el.props[k] = this.props[k]\n }\n }\n // copy the styles\n for (k in this.style) {\n if (this.style.hasOwnProperty(k) && [\n 'setProperty',\n 'getProperty',\n 'getPropertyValue',\n 'removeProperty'\n ].indexOf(k) === -1) {\n el.style[k] = this.style[k]\n }\n }\n if (deep) {\n el.childNodes = this.childNodes.map(function (childEl) {\n if (!childEl.nodeType) {\n // It's a React element, let React clone it\n return React.cloneElement(childEl)\n }\n // either Element or true dom element\n childEl = childEl.cloneNode(true)\n // if a faux dom element, modify parentNode\n if (childEl instanceof Element) {\n childEl.parentNode = el\n }\n return childEl\n })\n }\n return el\n }\n\n Element.prototype.toReact = function (index) {\n index = index || 0\n var props = assign({}, this.props)\n props.style = assign({}, props.style)\n\n var originalElement = this\n\n function uniqueKey () {\n return 'faux-dom-' + index\n }\n\n if (isUndefined(props.key)) {\n props.key = uniqueKey()\n }\n\n delete props.style.setProperty\n delete props.style.getProperty\n delete props.style.getPropertyValue\n delete props.style.removeProperty\n\n assign(props, mapValues(this.eventListeners, function (listeners) {\n return function (syntheticEvent) {\n var event\n\n if (syntheticEvent) {\n event = syntheticEvent.nativeEvent\n event.syntheticEvent = syntheticEvent\n }\n\n mapValues(listeners, function (listener) {\n listener.call(originalElement, event)\n })\n }\n }))\n\n return React.createElement(this.nodeName, props, this.text || this.children.map(function (el, i) {\n if (el instanceof Element) {\n return el.toReact(i)\n } else {\n return el\n }\n }))\n }\n\n Element.prototype.compareDocumentPosition = function (other) {\n function getFirstNodeByOrder (nodes, nodeOne, nodeTwo) {\n return nodes.reduce(function (result, node) {\n if (result !== false) {\n return result\n } else if (node === nodeOne) {\n return nodeOne\n } else if (node === nodeTwo) {\n return nodeTwo\n } else if (node.childNodes) {\n return getFirstNodeByOrder(node.childNodes, nodeOne, nodeTwo)\n } else {\n return false\n }\n }, false)\n }\n\n function isAncestor (source, target) {\n while (target.parentNode) {\n target = target.parentNode\n if (target === source) {\n return true\n }\n }\n return false\n }\n\n function eitherContains (left, right) {\n return isAncestor(left, right)\n ? Element.DOCUMENT_POSITION_CONTAINED_BY + Element.DOCUMENT_POSITION_FOLLOWING\n : isAncestor(right, left)\n ? Element.DOCUMENT_POSITION_CONTAINS + Element.DOCUMENT_POSITION_PRECEDING\n : false\n }\n\n function getRootNode (node) {\n while (node.parentNode) {\n node = node.parentNode\n }\n return node\n }\n\n if (this === other) {\n return 0\n }\n\n var referenceRoot = getRootNode(this)\n var otherRoot = getRootNode(other)\n\n if (referenceRoot !== otherRoot) {\n return Element.DOCUMENT_POSITION_DISCONNECTED\n }\n\n var result = eitherContains(this, other)\n if (result) {\n return result\n }\n\n var first = getFirstNodeByOrder([referenceRoot], this, other)\n return first === this\n ? Element.DOCUMENT_POSITION_FOLLOWING\n : first === other\n ? Element.DOCUMENT_POSITION_PRECEDING\n : Element.DOCUMENT_POSITION_DISCONNECTED\n }\n\n Object.defineProperties(Element.prototype, {\n nextSibling: {\n get: function () {\n var siblings = this.parentNode.children\n var me = siblings.indexOf(this)\n return siblings[me + 1]\n }\n },\n previousSibling: {\n get: function () {\n var siblings = this.parentNode.children\n var me = siblings.indexOf(this)\n return siblings[me - 1]\n }\n },\n innerHTML: {\n get: function () {\n return this.text\n },\n set: function (text) {\n this.text = text\n }\n },\n textContent: {\n get: function () {\n return this.text\n },\n set: function (text) {\n this.text = text\n }\n },\n children: {\n get: function () {\n // So far nodes created by this library are all of nodeType 1 (elements),\n // but this could change in the future.\n return this.childNodes.filter(function (el) {\n if (!el.nodeType) {\n // It's a React element, we always add it\n return true\n }\n\n // It's a HTML node. We want to filter to have only nodes with type 1\n return el.nodeType === 1\n })\n }\n }\n })\n\n // These NS methods are called by things like D3 if it spots a namespace.\n // Like xlink:href. I don't care about namespaces, so these functions have NS aliases created.\n var namespaceMethods = [\n 'setAttribute',\n 'getAttribute',\n 'getAttributeNode',\n 'removeAttribute',\n 'getElementsByTagName',\n 'getElementById'\n ]\n\n namespaceMethods.forEach(function (name) {\n var fn = Element.prototype[name]\n Element.prototype[name + 'NS'] = function () {\n return fn.apply(this, Array.prototype.slice.call(arguments, 1))\n }\n })\n\n return Element\n}\n\nmodule.exports = element\n","\n\n/*:: type Attr = { [key: string]: string | number } */\n/*:: type Opts = { preserveNumbers: ?boolean } */\n\n/*\n\nstyle-attr\n====\n\nVery simple parsing and stringifying of style attributes.\n\n`parse`\n----\n\nConvert a style attribute string to an object.\n\n*/\n\n/*:: declare function parse (raw: string, opts: ?Opts): Attr */\nfunction parse(raw, opts) {\n opts = opts || {};\n\n var preserveNumbers = opts.preserveNumbers;\n var trim = function (s) {\n return s.trim();\n };\n var obj = {};\n\n getKeyValueChunks(raw).map(trim).filter(Boolean).forEach(function (item) {\n // split with `.indexOf` rather than `.split` because the value may also contain colons.\n var pos = item.indexOf(':');\n var key = item.substr(0, pos).trim();\n var val = item.substr(pos + 1).trim();\n if (preserveNumbers && isNumeric(val)) {\n val = Number(val);\n }\n\n obj[key] = val;\n });\n\n return obj;\n}\n\n/*\n\n`isNumeric`\n----\n\nCheck if a value is numeric.\nVia: https://stackoverflow.com/a/1830844/9324\n\n*/\n\n/*:: declare function isNumeric (n: any): boolean */\n\nfunction isNumeric(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/*\n\n`getKeyValueChunks`\n----\n\nSplit a string into chunks matching `: `\n\n*/\n/*:: declare function getKeyValueChunks (raw: string): Array */\nfunction getKeyValueChunks(raw) {\n var chunks = [];\n var offset = 0;\n var sep = ';';\n var hasUnclosedUrl = /url\\([^\\)]+$/;\n var chunk = '';\n var nextSplit;\n while (offset < raw.length) {\n nextSplit = raw.indexOf(sep, offset);\n if (nextSplit === -1) {\n nextSplit = raw.length;\n }\n\n chunk += raw.substring(offset, nextSplit);\n\n // data URIs can contain semicolons, so make sure we get the whole thing\n if (hasUnclosedUrl.test(chunk)) {\n chunk += ';';\n offset = nextSplit + 1;\n continue;\n }\n\n chunks.push(chunk);\n chunk = '';\n offset = nextSplit + 1;\n }\n\n return chunks;\n}\n\n/*\n\n`stringify`\n----\n\nConvert an object into an attribute string\n\n*/\n/*:: declare function stringify (obj: Attr): string */\nfunction stringify(obj) {\n return Object.keys(obj).map(function (key) {\n return key + ':' + obj[key];\n }).join(';');\n}\n\n/*\n\n`normalize`\n----\n\nNormalize an attribute string (eg. collapse duplicates)\n\n*/\n/*:: declare function normalize (str: string, opts: ?Opts): string */\nfunction normalize(str, opts) {\n return stringify(parse(str, opts));\n}\n\nmodule.exports.parse = parse;\nmodule.exports.stringify = stringify;\nmodule.exports.normalize = normalize;","module.exports = require('./lib/query-selector');","/**\n * @ignore\n * css3 selector engine for ie6-8\n * @author yiminghe@gmail.com\n */\n\nvar util = require('./query-selector/util');\nvar parser = require('./query-selector/parser');\n\nvar EXPANDO_SELECTOR_KEY = '_ks_data_selector_id_',\n caches = {},\n isContextXML,\n uuid = 0,\n subMatchesCache = {},\n getAttr = function (el, name) {\n if (isContextXML) {\n return util.getSimpleAttr(el, name);\n } else {\n return util.attr(el, name);\n }\n },\n hasSingleClass = util.hasSingleClass,\n isTag = util.isTag,\n aNPlusB = /^(([+-]?(?:\\d+)?)?n)?([+-]?\\d+)?$/;\n\n// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\nvar unescape = /\\\\([\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|.)/g,\n unescapeFn = function (_, escaped) {\n var high = '0x' + escaped - 0x10000;\n // NaN means non-codepoint\n return isNaN(high) ?\n escaped :\n // BMP codepoint\n high < 0 ?\n String.fromCharCode(high + 0x10000) :\n // Supplemental Plane codepoint (surrogate pair)\n String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);\n };\n\nvar matchExpr;\n\nvar pseudoFnExpr = {\n 'nth-child': function (el, param) {\n var ab = getAb(param),\n a = ab.a,\n b = ab.b;\n if (a === 0 && b === 0) {\n return 0;\n }\n var index = 0,\n parent = el.parentNode;\n if (parent) {\n var childNodes = parent.childNodes,\n count = 0,\n child,\n ret,\n len = childNodes.length;\n for (; count < len; count++) {\n child = childNodes[count];\n if (child.nodeType === 1) {\n index++;\n ret = matchIndexByAb(index, a, b, child === el);\n if (ret !== undefined) {\n return ret;\n }\n }\n }\n }\n return 0;\n },\n 'nth-last-child': function (el, param) {\n var ab = getAb(param),\n a = ab.a,\n b = ab.b;\n if (a === 0 && b === 0) {\n return 0;\n }\n var index = 0,\n parent = el.parentNode;\n if (parent) {\n var childNodes = parent.childNodes,\n len = childNodes.length,\n count = len - 1,\n child,\n ret;\n for (; count >= 0; count--) {\n child = childNodes[count];\n if (child.nodeType === 1) {\n index++;\n ret = matchIndexByAb(index, a, b, child === el);\n if (ret !== undefined) {\n return ret;\n }\n }\n }\n }\n return 0;\n },\n 'nth-of-type': function (el, param) {\n var ab = getAb(param),\n a = ab.a,\n b = ab.b;\n if (a === 0 && b === 0) {\n return 0;\n }\n var index = 0,\n parent = el.parentNode;\n if (parent) {\n var childNodes = parent.childNodes,\n elType = el.tagName,\n count = 0,\n child,\n ret,\n len = childNodes.length;\n for (; count < len; count++) {\n child = childNodes[count];\n if (child.tagName === elType) {\n index++;\n ret = matchIndexByAb(index, a, b, child === el);\n if (ret !== undefined) {\n return ret;\n }\n }\n }\n }\n return 0;\n },\n 'nth-last-of-type': function (el, param) {\n var ab = getAb(param),\n a = ab.a,\n b = ab.b;\n if (a === 0 && b === 0) {\n return 0;\n }\n var index = 0,\n parent = el.parentNode;\n if (parent) {\n var childNodes = parent.childNodes,\n len = childNodes.length,\n elType = el.tagName,\n count = len - 1,\n child,\n ret;\n for (; count >= 0; count--) {\n child = childNodes[count];\n if (child.tagName === elType) {\n index++;\n ret = matchIndexByAb(index, a, b, child === el);\n if (ret !== undefined) {\n return ret;\n }\n }\n }\n }\n return 0;\n },\n lang: function (el, lang) {\n var elLang;\n lang = unEscape(lang.toLowerCase());\n do {\n if ((elLang = (isContextXML ?\n el.getAttribute('xml:lang') || el.getAttribute('lang') :\n el.lang))) {\n elLang = elLang.toLowerCase();\n return elLang === lang || elLang.indexOf(lang + '-') === 0;\n }\n } while ((el = el.parentNode) && el.nodeType === 1);\n return false;\n },\n not: function (el, negationArg) {\n return !matchExpr[negationArg.t](el, negationArg.value);\n }\n};\n\nvar pseudoIdentExpr = {\n empty: function (el) {\n var childNodes = el.childNodes,\n index = 0,\n len = childNodes.length - 1,\n child,\n nodeType;\n for (; index < len; index++) {\n child = childNodes[index];\n nodeType = child.nodeType;\n // only element nodes and content nodes\n // (such as Dom [Dom-LEVEL-3-CORE] text nodes,\n // CDATA nodes, and entity references\n if (nodeType === 1 || nodeType === 3 || nodeType === 4 || nodeType === 5) {\n return 0;\n }\n }\n return 1;\n },\n root: function (el) {\n if (el.nodeType === 9) {\n return true;\n }\n return el.ownerDocument &&\n el === el.ownerDocument.documentElement;\n },\n 'first-child': function (el) {\n return pseudoFnExpr['nth-child'](el, 1);\n },\n 'last-child': function (el) {\n return pseudoFnExpr['nth-last-child'](el, 1);\n },\n 'first-of-type': function (el) {\n return pseudoFnExpr['nth-of-type'](el, 1);\n },\n 'last-of-type': function (el) {\n return pseudoFnExpr['nth-last-of-type'](el, 1);\n },\n 'only-child': function (el) {\n return pseudoIdentExpr['first-child'](el) &&\n pseudoIdentExpr['last-child'](el);\n },\n 'only-of-type': function (el) {\n return pseudoIdentExpr['first-of-type'](el) &&\n pseudoIdentExpr['last-of-type'](el);\n },\n focus: function (el) {\n var doc = el.ownerDocument;\n return doc && el === doc.activeElement &&\n (!doc.hasFocus || doc.hasFocus()) && !!(el.type || el.href || el.tabIndex >= 0);\n },\n target: function (el) {\n var hash = location.hash;\n return hash && hash.slice(1) === getAttr(el, 'id');\n },\n enabled: function (el) {\n return !el.disabled;\n },\n disabled: function (el) {\n return el.disabled;\n },\n checked: function (el) {\n var nodeName = el.nodeName.toLowerCase();\n return (nodeName === 'input' && el.checked) ||\n (nodeName === 'option' && el.selected);\n }\n};\n\nvar attributeExpr = {\n '~=': function (elValue, value) {\n if (!value || value.indexOf(' ') > -1) {\n return 0;\n }\n return (' ' + elValue + ' ').indexOf(' ' + value + ' ') !== -1;\n },\n '|=': function (elValue, value) {\n return (' ' + elValue).indexOf(' ' + value + '-') !== -1;\n },\n '^=': function (elValue, value) {\n return value && util.startsWith(elValue, value);\n },\n '$=': function (elValue, value) {\n return value && util.endsWith(elValue, value);\n },\n '*=': function (elValue, value) {\n return value && elValue.indexOf(value) !== -1;\n },\n '=': function (elValue, value) {\n return elValue === value;\n }\n};\n\nvar relativeExpr = {\n '>': {\n dir: 'parentNode',\n immediate: 1\n },\n ' ': {\n dir: 'parentNode'\n },\n '+': {\n dir: 'previousSibling',\n immediate: 1\n },\n '~': {\n dir: 'previousSibling'\n }\n};\n\nmatchExpr = {\n tag: isTag,\n cls: hasSingleClass,\n id: function (el, value) {\n return getAttr(el, 'id') === value;\n },\n attrib: function (el, value) {\n var name = value.ident;\n if (!isContextXML) {\n name = name.toLowerCase();\n }\n var elValue = getAttr(el, name);\n var match = value.match;\n if (!match && elValue !== undefined) {\n return 1;\n } else if (match) {\n if (elValue === undefined) {\n return 0;\n }\n var matchFn = attributeExpr[match];\n if (matchFn) {\n return matchFn(elValue + '', value.value + '');\n }\n }\n return 0;\n },\n pseudo: function (el, value) {\n var fn, fnStr, ident;\n if ((fnStr = value.fn)) {\n if (!(fn = pseudoFnExpr[fnStr])) {\n throw new SyntaxError('Syntax error: not support pseudo: ' + fnStr);\n }\n return fn(el, value.param);\n }\n if ((ident = value.ident)) {\n if (!pseudoIdentExpr[ident]) {\n throw new SyntaxError('Syntax error: not support pseudo: ' + ident);\n }\n return pseudoIdentExpr[ident](el);\n }\n return 0;\n }\n};\n\nfunction unEscape(str) {\n return str.replace(unescape, unescapeFn);\n}\n\nparser.lexer.yy = {\n trim: util.trim,\n unEscape: unEscape,\n unEscapeStr: function (str) {\n return this.unEscape(str.slice(1, -1));\n }\n};\n\nfunction resetStatus() {\n subMatchesCache = {};\n}\n\nfunction dir(el, direction) {\n do {\n el = el[direction];\n } while (el && el.nodeType !== 1);\n return el;\n}\n\nfunction getAb(param) {\n var a = 0,\n match,\n b = 0;\n if (typeof param === 'number') {\n b = param;\n } else if (param === 'odd') {\n a = 2;\n b = 1;\n } else if (param === 'even') {\n a = 2;\n b = 0;\n } else if ((match = param.replace(/\\s/g, '').match(aNPlusB))) {\n if (match[1]) {\n a = parseInt(match[2], 10);\n if (isNaN(a)) {\n if (match[2] === '-') {\n a = -1;\n } else {\n a = 1;\n }\n }\n } else {\n a = 0;\n }\n b = parseInt(match[3], 10) || 0;\n }\n return {\n a: a,\n b: b\n };\n}\n\nfunction matchIndexByAb(index, a, b, eq) {\n if (a === 0) {\n if (index === b) {\n return eq;\n }\n } else {\n if ((index - b) / a >= 0 && (index - b) % a === 0 && eq) {\n return 1;\n }\n }\n return undefined;\n}\n\nfunction isXML(elem) {\n var documentElement = elem && (elem.ownerDocument || elem).documentElement;\n return documentElement ? documentElement.nodeName.toLowerCase() !== 'html' : false;\n}\n\nfunction matches(str, seeds) {\n return select(str, null, seeds);\n}\n\nfunction singleMatch(el, match) {\n if (!match) {\n return true;\n }\n if (!el) {\n return false;\n }\n\n if (el.nodeType === 9) {\n return false;\n }\n\n var matched = 1,\n matchSuffix = match.suffix,\n matchSuffixLen,\n matchSuffixIndex;\n\n if (match.t === 'tag') {\n matched &= matchExpr.tag(el, match.value);\n }\n\n if (matched && matchSuffix) {\n matchSuffixLen = matchSuffix.length;\n matchSuffixIndex = 0;\n for (; matched && matchSuffixIndex < matchSuffixLen; matchSuffixIndex++) {\n var singleMatchSuffix = matchSuffix[matchSuffixIndex],\n singleMatchSuffixType = singleMatchSuffix.t;\n if (matchExpr[singleMatchSuffixType]) {\n matched &= matchExpr[singleMatchSuffixType](el, singleMatchSuffix.value);\n }\n }\n }\n\n return matched;\n}\n\n// match by adjacent immediate single selector match\nfunction matchImmediate(el, match) {\n var matched = 1,\n startEl = el,\n relativeOp,\n startMatch = match;\n\n do {\n matched &= singleMatch(el, match);\n if (matched) {\n // advance\n match = match && match.prev;\n if (!match) {\n return true;\n }\n relativeOp = relativeExpr[match.nextCombinator];\n el = dir(el, relativeOp.dir);\n if (!relativeOp.immediate) {\n return {\n // advance for non-immediate\n el: el,\n match: match\n };\n }\n } else {\n relativeOp = relativeExpr[match.nextCombinator];\n if (relativeOp.immediate) {\n // retreat but advance startEl\n return {\n el: dir(startEl, relativeExpr[startMatch.nextCombinator].dir),\n match: startMatch\n };\n } else {\n // advance (before immediate match + jump unmatched)\n return {\n el: el && dir(el, relativeOp.dir),\n match: match\n };\n }\n }\n } while (el);\n\n // only occur when match immediate\n return {\n el: dir(startEl, relativeExpr[startMatch.nextCombinator].dir),\n match: startMatch\n };\n}\n\n// find fixed part, fixed with seeds\nfunction findFixedMatchFromHead(el, head) {\n var relativeOp,\n cur = head;\n\n do {\n if (!singleMatch(el, cur)) {\n return null;\n }\n cur = cur.prev;\n if (!cur) {\n return true;\n }\n relativeOp = relativeExpr[cur.nextCombinator];\n el = dir(el, relativeOp.dir);\n } while (el && relativeOp.immediate);\n if (!el) {\n return null;\n }\n return {\n el: el,\n match: cur\n };\n}\n\nfunction genId(el) {\n var selectorId;\n\n if (isContextXML) {\n if (!(selectorId = el.getAttribute(EXPANDO_SELECTOR_KEY))) {\n el.setAttribute(EXPANDO_SELECTOR_KEY, selectorId = (+new Date() + '_' + (++uuid)));\n }\n } else {\n if (!(selectorId = el[EXPANDO_SELECTOR_KEY])) {\n selectorId = el[EXPANDO_SELECTOR_KEY] = (+new Date()) + '_' + (++uuid);\n }\n }\n\n return selectorId;\n}\n\nfunction matchSub(el, match) {\n var selectorId = genId(el),\n matchKey;\n matchKey = selectorId + '_' + (match.order || 0);\n if (matchKey in subMatchesCache) {\n return subMatchesCache[matchKey];\n }\n subMatchesCache[matchKey] = matchSubInternal(el, match);\n return subMatchesCache[matchKey];\n}\n\n// recursive match by sub selector string from right to left\n// grouped by immediate selectors\nfunction matchSubInternal(el, match) {\n var matchImmediateRet = matchImmediate(el, match);\n if (matchImmediateRet === true) {\n return true;\n } else {\n el = matchImmediateRet.el;\n match = matchImmediateRet.match;\n while (el) {\n if (matchSub(el, match)) {\n return true;\n }\n el = dir(el, relativeExpr[match.nextCombinator].dir);\n }\n return false;\n }\n}\n\nfunction select(str, context, seeds) {\n if (!caches[str]) {\n caches[str] = parser.parse(str);\n }\n\n var selector = caches[str],\n groupIndex = 0,\n groupLen = selector.length,\n contextDocument,\n group,\n ret = [];\n\n if (seeds) {\n context = context || seeds[0].ownerDocument;\n }\n\n contextDocument = context && context.ownerDocument || typeof document !== 'undefined' && document;\n\n if (context && context.nodeType === 9 && !contextDocument) {\n contextDocument = context;\n }\n\n context = context || contextDocument;\n\n isContextXML = isXML(context);\n\n for (; groupIndex < groupLen; groupIndex++) {\n resetStatus();\n\n group = selector[groupIndex];\n\n var suffix = group.suffix,\n suffixIndex,\n suffixLen,\n seedsIndex,\n mySeeds = seeds,\n seedsLen,\n id = null;\n\n if (!mySeeds) {\n if (suffix && !isContextXML) {\n suffixIndex = 0;\n suffixLen = suffix.length;\n for (; suffixIndex < suffixLen; suffixIndex++) {\n var singleSuffix = suffix[suffixIndex];\n if (singleSuffix.t === 'id') {\n id = singleSuffix.value;\n break;\n }\n }\n }\n\n if (id) {\n // http://yiminghe.github.io/lab/playground/fragment-selector/selector.html\n var doesNotHasById = !context.getElementById,\n contextInDom = util.contains(contextDocument, context),\n tmp = doesNotHasById ? (\n contextInDom ?\n contextDocument.getElementById(id) :\n null\n ) : context.getElementById(id);\n // id bug\n // https://github.com/kissyteam/kissy/issues/67\n if (!tmp && doesNotHasById || tmp && getAttr(tmp, 'id') !== id) {\n var tmps = util.getElementsByTagName('*', context),\n tmpLen = tmps.length,\n tmpI = 0;\n for (; tmpI < tmpLen; tmpI++) {\n tmp = tmps[tmpI];\n if (getAttr(tmp, 'id') === id) {\n mySeeds = [tmp];\n break;\n }\n }\n if (tmpI === tmpLen) {\n mySeeds = [];\n }\n } else {\n if (contextInDom && tmp && context !== contextDocument) {\n tmp = util.contains(context, tmp) ? tmp : null;\n }\n mySeeds = tmp ? [tmp] : [];\n }\n } else {\n mySeeds = util.getElementsByTagName(group.value || '*', context);\n }\n }\n\n seedsIndex = 0;\n seedsLen = mySeeds.length;\n\n if (!seedsLen) {\n continue;\n }\n\n for (; seedsIndex < seedsLen; seedsIndex++) {\n var seed = mySeeds[seedsIndex];\n var matchHead = findFixedMatchFromHead(seed, group);\n if (matchHead === true) {\n ret.push(seed);\n } else if (matchHead) {\n if (matchSub(matchHead.el, matchHead.match)) {\n ret.push(seed);\n }\n }\n }\n }\n\n if (groupLen > 1) {\n ret = util.unique(ret);\n }\n\n return ret;\n}\n\nmodule.exports = select;\n\nselect.parse = function (str) {\n return parser.parse(str);\n};\n\nselect.matches = matches;\n\nselect.util = util;\n\nselect.version = '@VERSION@';\n/**\n * @ignore\n * note 2013-03-28\n * - use recursive call to replace backtracking algorithm\n *\n * refer\n * - http://www.w3.org/TR/selectors/\n * - http://www.impressivewebs.com/browser-support-css3-selectors/\n * - http://blogs.msdn.com/ie/archive/2010/05/13/the-css-corner-css3-selectors.aspx\n * - http://sizzlejs.com/\n */","/**\n * attr fix for old ie\n * @author yiminghe@gmail.com\n */\nvar R_BOOLEAN = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,\n R_FOCUSABLE = /^(?:button|input|object|select|textarea)$/i,\n R_CLICKABLE = /^a(?:rea)?$/i,\n R_INVALID_CHAR = /:|^on/;\n\nvar attrFix = {},\n propFix,\n attrHooks = {\n // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n tabindex: {\n get: function (el) {\n // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set\n var attributeNode = el.getAttributeNode('tabindex');\n return attributeNode && attributeNode.specified ?\n parseInt(attributeNode.value, 10) :\n R_FOCUSABLE.test(el.nodeName) ||\n R_CLICKABLE.test(el.nodeName) && el.href ?\n 0 :\n undefined;\n }\n }\n },\n boolHook = {\n get: function (elem, name) {\n // 转发到 prop 方法\n return elem[propFix[name] || name] ?\n // 根据 w3c attribute , true 时返回属性名字符串\n name.toLowerCase() :\n undefined;\n }\n },\n attrNodeHook = {};\n\nattrHooks.style = {\n get: function (el) {\n return el.style.cssText;\n }\n};\n\npropFix = {\n hidefocus: 'hideFocus',\n tabindex: 'tabIndex',\n readonly: 'readOnly',\n 'for': 'htmlFor',\n 'class': 'className',\n maxlength: 'maxLength',\n cellspacing: 'cellSpacing',\n cellpadding: 'cellPadding',\n rowspan: 'rowSpan',\n colspan: 'colSpan',\n usemap: 'useMap',\n frameborder: 'frameBorder',\n contenteditable: 'contentEditable'\n};\n\nvar ua = typeof navigator !== 'undefined' ? navigator.userAgent : '';\nvar doc = typeof document !== 'undefined' ? document : {};\n\nfunction numberify(s) {\n var c = 0;\n // convert '1.2.3.4' to 1.234\n return parseFloat(s.replace(/\\./g, function () {\n return (c++ === 0) ? '.' : '';\n }));\n}\n\nfunction ieVersion() {\n var m, v;\n if ((m = ua.match(/MSIE ([^;]*)|Trident.*; rv(?:\\s|:)?([0-9.]+)/)) &&\n (v = (m[1] || m[2]))) {\n return doc.documentMode || numberify(v);\n }\n}\n\nfunction mix(s, t) {\n for (var p in t) {\n s[p] = t[p];\n }\n}\n\nfunction each(arr, fn) {\n var i = 0, l = arr.length;\n for (; i < l; i++) {\n if (fn(arr[i], i) === false) {\n break;\n }\n }\n}\nvar ie = ieVersion();\n\nif (ie && ie < 8) {\n attrHooks.style.set = function (el, val) {\n el.style.cssText = val;\n };\n\n // get attribute value from attribute node for ie\n mix(attrNodeHook, {\n get: function (elem, name) {\n var ret = elem.getAttributeNode(name);\n // Return undefined if attribute node specified by user\n return ret && (\n // fix #100\n ret.specified || ret.nodeValue) ?\n ret.nodeValue :\n undefined;\n }\n });\n\n // ie6,7 不区分 attribute 与 property\n mix(attrFix, propFix);\n\n // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n attrHooks.tabIndex = attrHooks.tabindex;\n\n // 不光是 href, src, 还有 rowspan 等非 mapping 属性,也需要用第 2 个参数来获取原始值\n // 注意 colSpan rowSpan 已经由 propFix 转为大写\n each(['href', 'src', 'width', 'height', 'colSpan', 'rowSpan'], function (name) {\n attrHooks[name] = {\n get: function (elem) {\n var ret = elem.getAttribute(name, 2);\n return ret === null ? undefined : ret;\n }\n };\n });\n\n attrHooks.placeholder = {\n get: function (elem, name) {\n return elem[name] || attrNodeHook.get(elem, name);\n }\n };\n}\n\nif (ie) {\n var hrefFix = attrHooks.href = attrHooks.href || {};\n hrefFix.set = function (el, val, name) {\n var childNodes = el.childNodes,\n b,\n len = childNodes.length,\n allText = len > 0;\n for (len = len - 1; len >= 0; len--) {\n if (childNodes[len].nodeType !== 3) {\n allText = 0;\n }\n }\n if (allText) {\n b = el.ownerDocument.createElement('b');\n b.style.display = 'none';\n el.appendChild(b);\n }\n el.setAttribute(name, '' + val);\n if (b) {\n el.removeChild(b);\n }\n };\n}\n\nvar RE_TRIM = /^[\\s\\xa0]+|[\\s\\xa0]+$/g,\n trim = String.prototype.trim;\nvar SPACE = ' ';\n\nvar getElementsByTagName;\ngetElementsByTagName = function (name, context) {\n return context.getElementsByTagName(name);\n};\n\nif (doc.createElement) {\n var div = doc.createElement('div');\n div.appendChild(document.createComment(''));\n if (div.getElementsByTagName('*').length) {\n getElementsByTagName = function (name, context) {\n var nodes = context.getElementsByTagName(name),\n needsFilter = name === '*';\n // \n if (needsFilter || typeof nodes.length !== 'number') {\n var ret = [],\n i = 0,\n el;\n while ((el = nodes[i++])) {\n if (!needsFilter || el.nodeType === 1) {\n ret.push(el);\n }\n }\n return ret;\n } else {\n return nodes;\n }\n };\n }\n}\n\nvar compareNodeOrder = ('sourceIndex' in (doc && doc.documentElement || {})) ? function (a, b) {\n return a.sourceIndex - b.sourceIndex;\n} : function (a, b) {\n if (!a.compareDocumentPosition || !b.compareDocumentPosition) {\n return a.compareDocumentPosition ? -1 : 1;\n }\n var bit = a.compareDocumentPosition(b) & 4;\n return bit ? -1 : 1;\n};\n\nvar util = module.exports = {\n ie: ie,\n\n unique: (function () {\n var hasDuplicate,\n baseHasDuplicate = true;\n\n // Here we check if the JavaScript engine is using some sort of\n // optimization where it does not always call our comparison\n // function. If that is the case, discard the hasDuplicate value.\n // Thus far that includes Google Chrome.\n [0, 0].sort(function () {\n baseHasDuplicate = false;\n return 0;\n });\n\n function sortOrder(a, b) {\n if (a === b) {\n hasDuplicate = true;\n return 0;\n }\n\n return compareNodeOrder(a, b);\n }\n\n // 排序去重\n return function (elements) {\n hasDuplicate = baseHasDuplicate;\n elements.sort(sortOrder);\n\n if (hasDuplicate) {\n var i = 1, len = elements.length;\n while (i < len) {\n if (elements[i] === elements[i - 1]) {\n elements.splice(i, 1);\n --len;\n } else {\n i++;\n }\n }\n }\n return elements;\n };\n })(),\n\n getElementsByTagName: getElementsByTagName,\n\n getSimpleAttr: function (el, name) {\n var ret = el && el.getAttributeNode(name);\n if (ret && ret.specified) {\n return 'value' in ret ? ret.value : ret.nodeValue;\n }\n return undefined;\n },\n\n contains: ie ? function (a, b) {\n if (a.nodeType === 9) {\n a = a.documentElement;\n }\n // !a.contains => a===document || text\n // 注意原生 contains 判断时 a===b 也返回 true\n b = b.parentNode;\n\n if (a === b) {\n return true;\n }\n\n // when b is document, a.contains(b) 不支持的接口 in ie\n if (b && b.nodeType === 1) {\n return a.contains && a.contains(b);\n } else {\n return false;\n }\n } : function (a, b) {\n return !!(a.compareDocumentPosition(b) & 16);\n },\n\n isTag: function (el, value) {\n return value === '*' || el.nodeName.toLowerCase() === value.toLowerCase();\n },\n\n hasSingleClass: function (el, cls) {\n // consider xml\n // https://github.com/kissyteam/kissy/issues/532\n var className = el && util.getSimpleAttr(el, 'class');\n return className && (className = className.replace(/[\\r\\t\\n]/g, SPACE)) &&\n (SPACE + className + SPACE).indexOf(SPACE + cls + SPACE) > -1;\n },\n\n startsWith: function (str, prefix) {\n return str.lastIndexOf(prefix, 0) === 0;\n },\n\n endsWith: function (str, suffix) {\n var ind = str.length - suffix.length;\n return ind >= 0 && str.indexOf(suffix, ind) === ind;\n },\n\n trim: trim ?\n function (str) {\n return str == null ? '' : trim.call(str);\n } :\n function (str) {\n return str == null ? '' : (str + '').replace(RE_TRIM, '');\n },\n\n attr: function (el, name) {\n var attrNormalizer, ret;\n // scrollLeft\n name = name.toLowerCase();\n // custom attrs\n name = attrFix[name] || name;\n if (R_BOOLEAN.test(name)) {\n attrNormalizer = boolHook;\n } else if (R_INVALID_CHAR.test(name)) {\n // only old ie?\n attrNormalizer = attrNodeHook;\n } else {\n attrNormalizer = attrHooks[name];\n }\n if (el && el.nodeType === 1) {\n // browsers index elements by id/name on forms, give priority to attributes.\n if (el.nodeName.toLowerCase() === 'form') {\n attrNormalizer = attrNodeHook;\n }\n if (attrNormalizer && attrNormalizer.get) {\n return attrNormalizer.get(el, name);\n }\n ret = el.getAttribute(name);\n if (ret === '') {\n var attrNode = el.getAttributeNode(name);\n if (!attrNode || !attrNode.specified) {\n return undefined;\n }\n }\n // standard browser non-existing attribute return null\n // ie<8 will return undefined , because it return property\n // so norm to undefined\n return ret === null ? undefined : ret;\n }\n }\n};","/*\n Generated by kison.*/\nvar parser = (function (undefined) {\n /*jshint quotmark:false, loopfunc:true, indent:false, unused:false, asi:true, boss:true*/\n /* Generated by kison */\n var parser = {},\n GrammarConst = {\n 'SHIFT_TYPE': 1,\n 'REDUCE_TYPE': 2,\n 'ACCEPT_TYPE': 0,\n 'TYPE_INDEX': 0,\n 'PRODUCTION_INDEX': 1,\n 'TO_INDEX': 2\n };\n /*jslint quotmark: false*/\n function mix(to, from) {\n for (var f in from) {\n to[f] = from[f];\n }\n }\n\n function isArray(obj) {\n return '[object Array]' === Object.prototype.toString.call(obj);\n }\n\n function each(object, fn, context) {\n if (object) {\n var key,\n val,\n length,\n i = 0;\n\n context = context || null;\n\n if (!isArray(object)) {\n for (key in object) {\n // can not use hasOwnProperty\n if (fn.call(context, object[key], key, object) === false) {\n break;\n }\n }\n } else {\n length = object.length;\n for (val = object[0]; i < length; val = object[++i]) {\n if (fn.call(context, val, i, object) === false) {\n break;\n }\n }\n }\n }\n }\n\n function inArray(item, arr) {\n for (var i = 0, l = arr.length; i < l; i++) {\n if (arr[i] === item) {\n return true;\n }\n }\n return false;\n }\n var Lexer = function Lexer(cfg) {\n\n var self = this;\n\n /*\n lex rules.\n @type {Object[]}\n @example\n [\n {\n regexp:'\\\\w+',\n state:['xx'],\n token:'c',\n // this => lex\n action:function(){}\n }\n ]\n */\n self.rules = [];\n\n mix(self, cfg);\n\n /*\n Input languages\n @type {String}\n */\n\n self.resetInput(self.input);\n };\n Lexer.prototype = {\n 'resetInput': function (input) {\n mix(this, {\n input: input,\n matched: '',\n stateStack: [Lexer.STATIC.INITIAL],\n match: '',\n text: '',\n firstLine: 1,\n lineNumber: 1,\n lastLine: 1,\n firstColumn: 1,\n lastColumn: 1\n });\n },\n 'getCurrentRules': function () {\n var self = this,\n currentState = self.stateStack[self.stateStack.length - 1],\n rules = [];\n //#JSCOVERAGE_IF\n if (self.mapState) {\n currentState = self.mapState(currentState);\n }\n each(self.rules, function (r) {\n var state = r.state || r[3];\n if (!state) {\n if (currentState === Lexer.STATIC.INITIAL) {\n rules.push(r);\n }\n } else if (inArray(currentState, state)) {\n rules.push(r);\n }\n });\n return rules;\n },\n 'pushState': function (state) {\n this.stateStack.push(state);\n },\n 'popState': function (num) {\n num = num || 1;\n var ret;\n while (num--) {\n ret = this.stateStack.pop();\n }\n return ret;\n },\n 'showDebugInfo': function () {\n var self = this,\n DEBUG_CONTEXT_LIMIT = Lexer.STATIC.DEBUG_CONTEXT_LIMIT,\n matched = self.matched,\n match = self.match,\n input = self.input;\n matched = matched.slice(0, matched.length - match.length);\n //#JSCOVERAGE_IF 0\n var past = (matched.length > DEBUG_CONTEXT_LIMIT ? '...' : '') +\n matched.slice(0 - DEBUG_CONTEXT_LIMIT).replace(/\\n/, ' '),\n next = match + input;\n //#JSCOVERAGE_ENDIF\n next = next.slice(0, DEBUG_CONTEXT_LIMIT) +\n (next.length > DEBUG_CONTEXT_LIMIT ? '...' : '');\n return past + next + '\\n' + new Array(past.length + 1).join('-') + '^';\n },\n 'mapSymbol': function mapSymbolForCodeGen(t) {\n return this.symbolMap[t];\n },\n 'mapReverseSymbol': function (rs) {\n var self = this,\n symbolMap = self.symbolMap,\n i,\n reverseSymbolMap = self.reverseSymbolMap;\n if (!reverseSymbolMap && symbolMap) {\n reverseSymbolMap = self.reverseSymbolMap = {};\n for (i in symbolMap) {\n reverseSymbolMap[symbolMap[i]] = i;\n }\n }\n //#JSCOVERAGE_IF\n if (reverseSymbolMap) {\n return reverseSymbolMap[rs];\n } else {\n return rs;\n }\n },\n 'lex': function () {\n var self = this,\n input = self.input,\n i,\n rule,\n m,\n ret,\n lines,\n rules = self.getCurrentRules();\n\n self.match = self.text = '';\n\n if (!input) {\n return self.mapSymbol(Lexer.STATIC.END_TAG);\n }\n\n for (i = 0; i < rules.length; i++) {\n rule = rules[i];\n //#JSCOVERAGE_IF 0\n var regexp = rule.regexp || rule[1],\n token = rule.token || rule[0],\n action = rule.action || rule[2] || undefined;\n //#JSCOVERAGE_ENDIF\n if ((m = input.match(regexp))) {\n lines = m[0].match(/\\n.*/g);\n if (lines) {\n self.lineNumber += lines.length;\n }\n mix(self, {\n firstLine: self.lastLine,\n lastLine: self.lineNumber + 1,\n firstColumn: self.lastColumn,\n lastColumn: lines ?\n lines[lines.length - 1].length - 1 : self.lastColumn + m[0].length\n });\n var match;\n // for error report\n match = self.match = m[0];\n\n // all matches\n self.matches = m;\n // may change by user\n self.text = match;\n // matched content utils now\n self.matched += match;\n ret = action && action.call(self);\n if (ret === undefined) {\n ret = token;\n } else {\n ret = self.mapSymbol(ret);\n }\n input = input.slice(match.length);\n self.input = input;\n\n if (ret) {\n return ret;\n } else {\n // ignore\n return self.lex();\n }\n }\n }\n }\n };\n Lexer.STATIC = {\n 'INITIAL': 'I',\n 'DEBUG_CONTEXT_LIMIT': 20,\n 'END_TAG': '$EOF'\n };\n var lexer = new Lexer({\n 'rules': [\n ['b', /^\\[(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['c', /^(?:[\\t\\r\\n\\f\\x20]*)\\]/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['d', /^(?:[\\t\\r\\n\\f\\x20]*)~=(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['e', /^(?:[\\t\\r\\n\\f\\x20]*)\\|=(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['f', /^(?:[\\t\\r\\n\\f\\x20]*)\\^=(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['g', /^(?:[\\t\\r\\n\\f\\x20]*)\\$=(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['h', /^(?:[\\t\\r\\n\\f\\x20]*)\\*=(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['i', /^(?:[\\t\\r\\n\\f\\x20]*)\\=(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['j', /^(?:(?:[\\w]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))(?:[\\w\\d-]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))*)\\(/,\n function () {\n this.text = this.yy.trim(this.text).slice(0, -1);\n this.pushState('fn');\n }\n ],\n ['k', /^[^\\)]*/,\n function () {\n this.popState();\n },\n ['fn']\n ],\n ['l', /^(?:[\\t\\r\\n\\f\\x20]*)\\)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['m', /^:not\\((?:[\\t\\r\\n\\f\\x20]*)/i,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['n', /^(?:(?:[\\w]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))(?:[\\w\\d-]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))*)/,\n function () {\n this.text = this.yy.unEscape(this.text);\n }\n ],\n ['o', /^\"(\\\\\"|[^\"])*\"/,\n function () {\n this.text = this.yy.unEscapeStr(this.text);\n }\n ],\n ['o', /^'(\\\\'|[^'])*'/,\n function () {\n this.text = this.yy.unEscapeStr(this.text);\n }\n ],\n ['p', /^#(?:(?:[\\w\\d-]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))+)/,\n function () {\n this.text = this.yy.unEscape(this.text.slice(1));\n }\n ],\n ['q', /^\\.(?:(?:[\\w]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))(?:[\\w\\d-]|[^\\x00-\\xa0]|(?:\\\\[^\\n\\r\\f0-9a-f]))*)/,\n function () {\n this.text = this.yy.unEscape(this.text.slice(1));\n }\n ],\n ['r', /^(?:[\\t\\r\\n\\f\\x20]*),(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['s', /^::?/, 0],\n ['t', /^(?:[\\t\\r\\n\\f\\x20]*)\\+(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['u', /^(?:[\\t\\r\\n\\f\\x20]*)>(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['v', /^(?:[\\t\\r\\n\\f\\x20]*)~(?:[\\t\\r\\n\\f\\x20]*)/,\n function () {\n this.text = this.yy.trim(this.text);\n }\n ],\n ['w', /^\\*/, 0],\n ['x', /^(?:[\\t\\r\\n\\f\\x20]+)/, 0],\n ['y', /^./, 0]\n ]\n });\n parser.lexer = lexer;\n lexer.symbolMap = {\n '$EOF': 'a',\n 'LEFT_BRACKET': 'b',\n 'RIGHT_BRACKET': 'c',\n 'INCLUDES': 'd',\n 'DASH_MATCH': 'e',\n 'PREFIX_MATCH': 'f',\n 'SUFFIX_MATCH': 'g',\n 'SUBSTRING_MATCH': 'h',\n 'ALL_MATCH': 'i',\n 'FUNCTION': 'j',\n 'PARAMETER': 'k',\n 'RIGHT_PARENTHESES': 'l',\n 'NOT': 'm',\n 'IDENT': 'n',\n 'STRING': 'o',\n 'HASH': 'p',\n 'CLASS': 'q',\n 'COMMA': 'r',\n 'COLON': 's',\n 'PLUS': 't',\n 'GREATER': 'u',\n 'TILDE': 'v',\n 'UNIVERSAL': 'w',\n 'S': 'x',\n 'INVALID': 'y',\n '$START': 'z',\n 'selectors_group': 'aa',\n 'selector': 'ab',\n 'simple_selector_sequence': 'ac',\n 'combinator': 'ad',\n 'type_selector': 'ae',\n 'id_selector': 'af',\n 'class_selector': 'ag',\n 'attrib_match': 'ah',\n 'attrib': 'ai',\n 'attrib_val': 'aj',\n 'pseudo': 'ak',\n 'negation': 'al',\n 'negation_arg': 'am',\n 'suffix_selector': 'an',\n 'suffix_selectors': 'ao'\n };\n parser.productions = [\n ['z', ['aa']],\n ['aa', ['ab'],\n function () {\n return [this.$1];\n }\n ],\n ['aa', ['aa', 'r', 'ab'],\n function () {\n this.$1.push(this.$3);\n }\n ],\n ['ab', ['ac']],\n ['ab', ['ab', 'ad', 'ac'],\n function () {\n // LinkedList\n\n this.$1.nextCombinator = this.$3.prevCombinator = this.$2;\n var order;\n order = this.$1.order = this.$1.order || 0;\n this.$3.order = order + 1;\n this.$3.prev = this.$1;\n this.$1.next = this.$3;\n return this.$3;\n }\n ],\n ['ad', ['t']],\n ['ad', ['u']],\n ['ad', ['v']],\n ['ad', ['x'],\n function () {\n return ' ';\n }\n ],\n ['ae', ['n'],\n function () {\n return {\n t: 'tag',\n value: this.$1\n };\n }\n ],\n ['ae', ['w'],\n function () {\n return {\n t: 'tag',\n value: this.$1\n };\n }\n ],\n ['af', ['p'],\n function () {\n return {\n t: 'id',\n value: this.$1\n };\n }\n ],\n ['ag', ['q'],\n function () {\n return {\n t: 'cls',\n value: this.$1\n };\n }\n ],\n ['ah', ['f']],\n ['ah', ['g']],\n ['ah', ['h']],\n ['ah', ['i']],\n ['ah', ['d']],\n ['ah', ['e']],\n ['ai', ['b', 'n', 'c'],\n function () {\n return {\n t: 'attrib',\n value: {\n ident: this.$2\n }\n };\n }\n ],\n ['aj', ['n']],\n ['aj', ['o']],\n ['ai', ['b', 'n', 'ah', 'aj', 'c'],\n function () {\n return {\n t: 'attrib',\n value: {\n ident: this.$2,\n match: this.$3,\n value: this.$4\n }\n };\n }\n ],\n ['ak', ['s', 'j', 'k', 'l'],\n function () {\n return {\n t: 'pseudo',\n value: {\n fn: this.$2.toLowerCase(),\n param: this.$3\n }\n };\n }\n ],\n ['ak', ['s', 'n'],\n function () {\n return {\n t: 'pseudo',\n value: {\n ident: this.$2.toLowerCase()\n }\n };\n }\n ],\n ['al', ['m', 'am', 'l'],\n function () {\n return {\n t: 'pseudo',\n value: {\n fn: 'not',\n param: this.$2\n }\n };\n }\n ],\n ['am', ['ae']],\n ['am', ['af']],\n ['am', ['ag']],\n ['am', ['ai']],\n ['am', ['ak']],\n ['an', ['af']],\n ['an', ['ag']],\n ['an', ['ai']],\n ['an', ['ak']],\n ['an', ['al']],\n ['ao', ['an'],\n function () {\n return [this.$1];\n }\n ],\n ['ao', ['ao', 'an'],\n function () {\n this.$1.push(this.$2);\n }\n ],\n ['ac', ['ae']],\n ['ac', ['ao'],\n function () {\n return {\n suffix: this.$1\n };\n }\n ],\n ['ac', ['ae', 'ao'],\n function () {\n return {\n t: 'tag',\n value: this.$1.value,\n suffix: this.$2\n };\n }\n ]\n ];\n parser.table = {\n 'gotos': {\n '0': {\n 'aa': 8,\n 'ab': 9,\n 'ae': 10,\n 'af': 11,\n 'ag': 12,\n 'ai': 13,\n 'ak': 14,\n 'al': 15,\n 'an': 16,\n 'ao': 17,\n 'ac': 18\n },\n '2': {\n 'ae': 20,\n 'af': 21,\n 'ag': 22,\n 'ai': 23,\n 'ak': 24,\n 'am': 25\n },\n '9': {\n 'ad': 33\n },\n '10': {\n 'af': 11,\n 'ag': 12,\n 'ai': 13,\n 'ak': 14,\n 'al': 15,\n 'an': 16,\n 'ao': 34\n },\n '17': {\n 'af': 11,\n 'ag': 12,\n 'ai': 13,\n 'ak': 14,\n 'al': 15,\n 'an': 35\n },\n '19': {\n 'ah': 43\n },\n '28': {\n 'ab': 46,\n 'ae': 10,\n 'af': 11,\n 'ag': 12,\n 'ai': 13,\n 'ak': 14,\n 'al': 15,\n 'an': 16,\n 'ao': 17,\n 'ac': 18\n },\n '33': {\n 'ae': 10,\n 'af': 11,\n 'ag': 12,\n 'ai': 13,\n 'ak': 14,\n 'al': 15,\n 'an': 16,\n 'ao': 17,\n 'ac': 47\n },\n '34': {\n 'af': 11,\n 'ag': 12,\n 'ai': 13,\n 'ak': 14,\n 'al': 15,\n 'an': 35\n },\n '43': {\n 'aj': 50\n },\n '46': {\n 'ad': 33\n }\n },\n 'action': {\n '0': {\n 'b': [1, undefined, 1],\n 'm': [1, undefined, 2],\n 'n': [1, undefined, 3],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6],\n 'w': [1, undefined, 7]\n },\n '1': {\n 'n': [1, undefined, 19]\n },\n '2': {\n 'b': [1, undefined, 1],\n 'n': [1, undefined, 3],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6],\n 'w': [1, undefined, 7]\n },\n '3': {\n 'a': [2, 9],\n 'r': [2, 9],\n 't': [2, 9],\n 'u': [2, 9],\n 'v': [2, 9],\n 'x': [2, 9],\n 'p': [2, 9],\n 'q': [2, 9],\n 'b': [2, 9],\n 's': [2, 9],\n 'm': [2, 9],\n 'l': [2, 9]\n },\n '4': {\n 'a': [2, 11],\n 'r': [2, 11],\n 't': [2, 11],\n 'u': [2, 11],\n 'v': [2, 11],\n 'x': [2, 11],\n 'p': [2, 11],\n 'q': [2, 11],\n 'b': [2, 11],\n 's': [2, 11],\n 'm': [2, 11],\n 'l': [2, 11]\n },\n '5': {\n 'a': [2, 12],\n 'r': [2, 12],\n 't': [2, 12],\n 'u': [2, 12],\n 'v': [2, 12],\n 'x': [2, 12],\n 'p': [2, 12],\n 'q': [2, 12],\n 'b': [2, 12],\n 's': [2, 12],\n 'm': [2, 12],\n 'l': [2, 12]\n },\n '6': {\n 'j': [1, undefined, 26],\n 'n': [1, undefined, 27]\n },\n '7': {\n 'a': [2, 10],\n 'r': [2, 10],\n 't': [2, 10],\n 'u': [2, 10],\n 'v': [2, 10],\n 'x': [2, 10],\n 'p': [2, 10],\n 'q': [2, 10],\n 'b': [2, 10],\n 's': [2, 10],\n 'm': [2, 10],\n 'l': [2, 10]\n },\n '8': {\n 'a': [0],\n 'r': [1, undefined, 28]\n },\n '9': {\n 'a': [2, 1],\n 'r': [2, 1],\n 't': [1, undefined, 29],\n 'u': [1, undefined, 30],\n 'v': [1, undefined, 31],\n 'x': [1, undefined, 32]\n },\n '10': {\n 'a': [2, 38],\n 'r': [2, 38],\n 't': [2, 38],\n 'u': [2, 38],\n 'v': [2, 38],\n 'x': [2, 38],\n 'b': [1, undefined, 1],\n 'm': [1, undefined, 2],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6]\n },\n '11': {\n 'a': [2, 31],\n 'r': [2, 31],\n 't': [2, 31],\n 'u': [2, 31],\n 'v': [2, 31],\n 'x': [2, 31],\n 'p': [2, 31],\n 'q': [2, 31],\n 'b': [2, 31],\n 's': [2, 31],\n 'm': [2, 31]\n },\n '12': {\n 'a': [2, 32],\n 'r': [2, 32],\n 't': [2, 32],\n 'u': [2, 32],\n 'v': [2, 32],\n 'x': [2, 32],\n 'p': [2, 32],\n 'q': [2, 32],\n 'b': [2, 32],\n 's': [2, 32],\n 'm': [2, 32]\n },\n '13': {\n 'a': [2, 33],\n 'r': [2, 33],\n 't': [2, 33],\n 'u': [2, 33],\n 'v': [2, 33],\n 'x': [2, 33],\n 'p': [2, 33],\n 'q': [2, 33],\n 'b': [2, 33],\n 's': [2, 33],\n 'm': [2, 33]\n },\n '14': {\n 'a': [2, 34],\n 'r': [2, 34],\n 't': [2, 34],\n 'u': [2, 34],\n 'v': [2, 34],\n 'x': [2, 34],\n 'p': [2, 34],\n 'q': [2, 34],\n 'b': [2, 34],\n 's': [2, 34],\n 'm': [2, 34]\n },\n '15': {\n 'a': [2, 35],\n 'r': [2, 35],\n 't': [2, 35],\n 'u': [2, 35],\n 'v': [2, 35],\n 'x': [2, 35],\n 'p': [2, 35],\n 'q': [2, 35],\n 'b': [2, 35],\n 's': [2, 35],\n 'm': [2, 35]\n },\n '16': {\n 'a': [2, 36],\n 'r': [2, 36],\n 't': [2, 36],\n 'u': [2, 36],\n 'v': [2, 36],\n 'x': [2, 36],\n 'p': [2, 36],\n 'q': [2, 36],\n 'b': [2, 36],\n 's': [2, 36],\n 'm': [2, 36]\n },\n '17': {\n 'a': [2, 39],\n 'r': [2, 39],\n 't': [2, 39],\n 'u': [2, 39],\n 'v': [2, 39],\n 'x': [2, 39],\n 'b': [1, undefined, 1],\n 'm': [1, undefined, 2],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6]\n },\n '18': {\n 'a': [2, 3],\n 'r': [2, 3],\n 't': [2, 3],\n 'u': [2, 3],\n 'v': [2, 3],\n 'x': [2, 3]\n },\n '19': {\n 'c': [1, undefined, 36],\n 'd': [1, undefined, 37],\n 'e': [1, undefined, 38],\n 'f': [1, undefined, 39],\n 'g': [1, undefined, 40],\n 'h': [1, undefined, 41],\n 'i': [1, undefined, 42]\n },\n '20': {\n 'l': [2, 26]\n },\n '21': {\n 'l': [2, 27]\n },\n '22': {\n 'l': [2, 28]\n },\n '23': {\n 'l': [2, 29]\n },\n '24': {\n 'l': [2, 30]\n },\n '25': {\n 'l': [1, undefined, 44]\n },\n '26': {\n 'k': [1, undefined, 45]\n },\n '27': {\n 'a': [2, 24],\n 'r': [2, 24],\n 't': [2, 24],\n 'u': [2, 24],\n 'v': [2, 24],\n 'x': [2, 24],\n 'p': [2, 24],\n 'q': [2, 24],\n 'b': [2, 24],\n 's': [2, 24],\n 'm': [2, 24],\n 'l': [2, 24]\n },\n '28': {\n 'b': [1, undefined, 1],\n 'm': [1, undefined, 2],\n 'n': [1, undefined, 3],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6],\n 'w': [1, undefined, 7]\n },\n '29': {\n 'n': [2, 5],\n 'w': [2, 5],\n 'p': [2, 5],\n 'q': [2, 5],\n 'b': [2, 5],\n 's': [2, 5],\n 'm': [2, 5]\n },\n '30': {\n 'n': [2, 6],\n 'w': [2, 6],\n 'p': [2, 6],\n 'q': [2, 6],\n 'b': [2, 6],\n 's': [2, 6],\n 'm': [2, 6]\n },\n '31': {\n 'n': [2, 7],\n 'w': [2, 7],\n 'p': [2, 7],\n 'q': [2, 7],\n 'b': [2, 7],\n 's': [2, 7],\n 'm': [2, 7]\n },\n '32': {\n 'n': [2, 8],\n 'w': [2, 8],\n 'p': [2, 8],\n 'q': [2, 8],\n 'b': [2, 8],\n 's': [2, 8],\n 'm': [2, 8]\n },\n '33': {\n 'b': [1, undefined, 1],\n 'm': [1, undefined, 2],\n 'n': [1, undefined, 3],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6],\n 'w': [1, undefined, 7]\n },\n '34': {\n 'a': [2, 40],\n 'r': [2, 40],\n 't': [2, 40],\n 'u': [2, 40],\n 'v': [2, 40],\n 'x': [2, 40],\n 'b': [1, undefined, 1],\n 'm': [1, undefined, 2],\n 'p': [1, undefined, 4],\n 'q': [1, undefined, 5],\n 's': [1, undefined, 6]\n },\n '35': {\n 'a': [2, 37],\n 'r': [2, 37],\n 't': [2, 37],\n 'u': [2, 37],\n 'v': [2, 37],\n 'x': [2, 37],\n 'p': [2, 37],\n 'q': [2, 37],\n 'b': [2, 37],\n 's': [2, 37],\n 'm': [2, 37]\n },\n '36': {\n 'a': [2, 19],\n 'r': [2, 19],\n 't': [2, 19],\n 'u': [2, 19],\n 'v': [2, 19],\n 'x': [2, 19],\n 'p': [2, 19],\n 'q': [2, 19],\n 'b': [2, 19],\n 's': [2, 19],\n 'm': [2, 19],\n 'l': [2, 19]\n },\n '37': {\n 'n': [2, 17],\n 'o': [2, 17]\n },\n '38': {\n 'n': [2, 18],\n 'o': [2, 18]\n },\n '39': {\n 'n': [2, 13],\n 'o': [2, 13]\n },\n '40': {\n 'n': [2, 14],\n 'o': [2, 14]\n },\n '41': {\n 'n': [2, 15],\n 'o': [2, 15]\n },\n '42': {\n 'n': [2, 16],\n 'o': [2, 16]\n },\n '43': {\n 'n': [1, undefined, 48],\n 'o': [1, undefined, 49]\n },\n '44': {\n 'a': [2, 25],\n 'r': [2, 25],\n 't': [2, 25],\n 'u': [2, 25],\n 'v': [2, 25],\n 'x': [2, 25],\n 'p': [2, 25],\n 'q': [2, 25],\n 'b': [2, 25],\n 's': [2, 25],\n 'm': [2, 25]\n },\n '45': {\n 'l': [1, undefined, 51]\n },\n '46': {\n 'a': [2, 2],\n 'r': [2, 2],\n 't': [1, undefined, 29],\n 'u': [1, undefined, 30],\n 'v': [1, undefined, 31],\n 'x': [1, undefined, 32]\n },\n '47': {\n 'a': [2, 4],\n 'r': [2, 4],\n 't': [2, 4],\n 'u': [2, 4],\n 'v': [2, 4],\n 'x': [2, 4]\n },\n '48': {\n 'c': [2, 20]\n },\n '49': {\n 'c': [2, 21]\n },\n '50': {\n 'c': [1, undefined, 52]\n },\n '51': {\n 'a': [2, 23],\n 'r': [2, 23],\n 't': [2, 23],\n 'u': [2, 23],\n 'v': [2, 23],\n 'x': [2, 23],\n 'p': [2, 23],\n 'q': [2, 23],\n 'b': [2, 23],\n 's': [2, 23],\n 'm': [2, 23],\n 'l': [2, 23]\n },\n '52': {\n 'a': [2, 22],\n 'r': [2, 22],\n 't': [2, 22],\n 'u': [2, 22],\n 'v': [2, 22],\n 'x': [2, 22],\n 'p': [2, 22],\n 'q': [2, 22],\n 'b': [2, 22],\n 's': [2, 22],\n 'm': [2, 22],\n 'l': [2, 22]\n }\n }\n };\n parser.parse = function parse(input, filename) {\n var self = this,\n lexer = self.lexer,\n state,\n symbol,\n action,\n table = self.table,\n gotos = table.gotos,\n tableAction = table.action,\n productions = self.productions,\n valueStack = [null],\n // for debug info\n prefix = filename ? ('in file: ' + filename + ' ') : '',\n stack = [0];\n\n lexer.resetInput(input);\n\n while (1) {\n // retrieve state number from top of stack\n state = stack[stack.length - 1];\n\n if (!symbol) {\n symbol = lexer.lex();\n }\n\n if (symbol) {\n // read action for current state and first input\n action = tableAction[state] && tableAction[state][symbol];\n } else {\n action = null;\n }\n\n if (!action) {\n var expected = [],\n error;\n //#JSCOVERAGE_IF\n if (tableAction[state]) {\n for (var symbolForState in tableAction[state]) {\n expected.push(self.lexer.mapReverseSymbol(symbolForState));\n }\n }\n error = prefix + 'syntax error at line ' + lexer.lineNumber +\n ':\\n' + lexer.showDebugInfo() +\n '\\n' + 'expect ' + expected.join(', ');\n throw new Error(error);\n }\n\n switch (action[GrammarConst.TYPE_INDEX]) {\n case GrammarConst.SHIFT_TYPE:\n stack.push(symbol);\n\n valueStack.push(lexer.text);\n\n // push state\n stack.push(action[GrammarConst.TO_INDEX]);\n\n // allow to read more\n symbol = null;\n\n break;\n\n case GrammarConst.REDUCE_TYPE:\n var production = productions[action[GrammarConst.PRODUCTION_INDEX]],\n reducedSymbol = production.symbol || production[0],\n reducedAction = production.action || production[2],\n reducedRhs = production.rhs || production[1],\n len = reducedRhs.length,\n i = 0,\n ret,\n $$ = valueStack[valueStack.length - len]; // default to $$ = $1\n\n ret = undefined;\n\n self.$$ = $$;\n\n for (; i < len; i++) {\n self['$' + (len - i)] = valueStack[valueStack.length - 1 - i];\n }\n\n if (reducedAction) {\n ret = reducedAction.call(self);\n }\n\n if (ret !== undefined) {\n $$ = ret;\n } else {\n $$ = self.$$;\n }\n\n stack = stack.slice(0, -1 * len * 2);\n valueStack = valueStack.slice(0, -1 * len);\n\n stack.push(reducedSymbol);\n\n valueStack.push($$);\n\n var newState = gotos[stack[stack.length - 2]][stack[stack.length - 1]];\n\n stack.push(newState);\n\n break;\n\n case GrammarConst.ACCEPT_TYPE:\n return $$;\n }\n }\n };\n return parser;\n})();\nif (typeof module !== 'undefined') {\n module.exports = parser;\n}","function isString (value) {\n return typeof value === 'string'\n}\n\nmodule.exports = isString\n","function isUndefined (value) {\n return typeof value === 'undefined'\n}\n\nmodule.exports = isUndefined\n","function assign (dest) {\n var args = arguments\n var source\n\n for (var i = 1; i < args.length; i++) {\n source = args[i]\n\n for (var key in source) {\n dest[key] = source[key]\n }\n }\n\n return dest\n}\n\nmodule.exports = assign\n","var camelCase = require('./camelCase')\n\nfunction styleCamelCase (name) {\n var camel = camelCase(name)\n\n // Detect if the style property is already camelCased\n // To not convert Webkit*, Moz* and O* to lowercase\n if (camel.charAt(0).toUpperCase() === name.charAt(0)) {\n return name.charAt(0) + camel.slice(1)\n }\n\n if (name.charAt(0) === '-') {\n return camel.indexOf('ms') === 0 ? camel\n : camel.charAt(0).toUpperCase() + camel.slice(1)\n } else {\n return camel\n }\n}\n\nmodule.exports = styleCamelCase\n","function window () {\n var Window = {\n getComputedStyle: function (node) {\n return {\n getPropertyValue: node.style.getProperty\n }\n }\n }\n\n return Window\n}\n\nmodule.exports = window\n","var React = require('react')\nvar createReactClass = require('create-react-class')\nvar mapValues = require('./utils/mapValues')\nvar hoistNonReactStatics = require('hoist-non-react-statics')\n\nfunction withFauxDOMFactory (Element) {\n function withFauxDOM (WrappedComponent) {\n var WithFauxDOM = createReactClass({\n componentWillMount: function () {\n this.connectedFauxDOM = {}\n this.animateFauxDOMUntil = 0\n },\n componentWillUnmount: function () {\n this.stopAnimatingFauxDOM()\n this.stopDrawFauxDOM()\n },\n connectFauxDOM: function (node, name, discardNode) {\n if (!this.connectedFauxDOM[name] || discardNode) {\n this.connectedFauxDOM[name] = typeof node !== 'string' ? node : new Element(node)\n this.drawFauxDOMTimeout = setTimeout(this.drawFauxDOM)\n }\n return this.connectedFauxDOM[name]\n },\n drawFauxDOM: function () {\n var virtualDOM = mapValues(this.connectedFauxDOM, function (n) {\n return n.toReact()\n })\n this.setState(virtualDOM)\n },\n animateFauxDOM: function (duration) {\n this.animateFauxDOMUntil = Math.max(Date.now() + duration, this.animateFauxDOMUntil)\n if (!this.fauxDOMAnimationInterval) {\n this.fauxDOMAnimationInterval = setInterval(function () {\n if (Date.now() < this.animateFauxDOMUntil) {\n this.drawFauxDOM()\n } else {\n this.stopAnimatingFauxDOM()\n }\n }.bind(this), 16)\n }\n },\n stopAnimatingFauxDOM: function () {\n this.fauxDOMAnimationInterval = clearInterval(this.fauxDOMAnimationInterval)\n this.animateFauxDOMUntil = 0\n },\n stopDrawFauxDOM: function () {\n this.drawFauxDOMTimeout = clearTimeout(this.drawFauxDOMTimeout)\n },\n isAnimatingFauxDOM: function () {\n return !!this.fauxDOMAnimationInterval\n },\n render: function () {\n var props = Object.assign({}, this.props, this.state, {\n connectFauxDOM: this.connectFauxDOM,\n drawFauxDOM: this.drawFauxDOM,\n animateFauxDOM: this.animateFauxDOM,\n stopAnimatingFauxDOM: this.stopAnimatingFauxDOM,\n isAnimatingFauxDOM: this.isAnimatingFauxDOM\n })\n return React.createElement(WrappedComponent, props)\n }\n })\n WithFauxDOM.displayName = 'WithFauxDOM(' + getDisplayName(WrappedComponent) + ')'\n hoistNonReactStatics(WithFauxDOM, WrappedComponent)\n return WithFauxDOM\n }\n\n return withFauxDOM\n}\n\nfunction getDisplayName (WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component'\n}\n\nmodule.exports = withFauxDOMFactory\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar React = require('react');\nvar factory = require('./factory');\n\nif (typeof React === 'undefined') {\n throw Error(\n 'create-react-class could not find the React object. If you are using script tags, ' +\n 'make sure that React is being loaded before create-react-class.'\n );\n}\n\n// Hack to grab NoopUpdateQueue from isomorphic React\nvar ReactNoopUpdateQueue = new React.Component().updater;\n\nmodule.exports = factory(\n React.Component,\n React.isValidElement,\n ReactNoopUpdateQueue\n);\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\n// -- Inlined from fbjs --\n\nvar emptyObject = {};\n\nif (process.env.NODE_ENV !== 'production') {\n Object.freeze(emptyObject);\n}\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction _invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nvar warning = function(){};\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\n// /-- Inlined from fbjs --\n\nvar MIXINS_KEY = 'mixins';\n\n// Helper function to allow the creation of anonymous functions which do not\n// have .name set to the name of the variable being assigned to.\nfunction identity(fn) {\n return fn;\n}\n\nvar ReactPropTypeLocationNames;\nif (process.env.NODE_ENV !== 'production') {\n ReactPropTypeLocationNames = {\n prop: 'prop',\n context: 'context',\n childContext: 'child context'\n };\n} else {\n ReactPropTypeLocationNames = {};\n}\n\nfunction factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {\n /**\n * Policies that describe methods in `ReactClassInterface`.\n */\n\n var injectedMixins = [];\n\n /**\n * Composite components are higher-level components that compose other composite\n * or host components.\n *\n * To create a new type of `ReactClass`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return
Hello World
;\n * }\n * });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactClassInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will be available on the prototype.\n *\n * @interface ReactClassInterface\n * @internal\n */\n var ReactClassInterface = {\n /**\n * An array of Mixin objects to include when defining your component.\n *\n * @type {array}\n * @optional\n */\n mixins: 'DEFINE_MANY',\n\n /**\n * An object containing properties and methods that should be defined on\n * the component's constructor instead of its prototype (static methods).\n *\n * @type {object}\n * @optional\n */\n statics: 'DEFINE_MANY',\n\n /**\n * Definition of prop types for this component.\n *\n * @type {object}\n * @optional\n */\n propTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types for this component.\n *\n * @type {object}\n * @optional\n */\n contextTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types this component sets for its children.\n *\n * @type {object}\n * @optional\n */\n childContextTypes: 'DEFINE_MANY',\n\n // ==== Definition methods ====\n\n /**\n * Invoked when the component is mounted. Values in the mapping will be set on\n * `this.props` if that prop is not specified (i.e. using an `in` check).\n *\n * This method is invoked before `getInitialState` and therefore cannot rely\n * on `this.state` or use `this.setState`.\n *\n * @return {object}\n * @optional\n */\n getDefaultProps: 'DEFINE_MANY_MERGED',\n\n /**\n * Invoked once before the component is mounted. The return value will be used\n * as the initial value of `this.state`.\n *\n * getInitialState: function() {\n * return {\n * isOn: false,\n * fooBaz: new BazFoo()\n * }\n * }\n *\n * @return {object}\n * @optional\n */\n getInitialState: 'DEFINE_MANY_MERGED',\n\n /**\n * @return {object}\n * @optional\n */\n getChildContext: 'DEFINE_MANY_MERGED',\n\n /**\n * Uses props from `this.props` and state from `this.state` to render the\n * structure of the component.\n *\n * No guarantees are made about when or how often this method is invoked, so\n * it must not have side effects.\n *\n * render: function() {\n * var name = this.props.name;\n * return
Hello, {name}!
;\n * }\n *\n * @return {ReactComponent}\n * @required\n */\n render: 'DEFINE_ONCE',\n\n // ==== Delegate methods ====\n\n /**\n * Invoked when the component is initially created and about to be mounted.\n * This may have side effects, but any external subscriptions or data created\n * by this method must be cleaned up in `componentWillUnmount`.\n *\n * @optional\n */\n componentWillMount: 'DEFINE_MANY',\n\n /**\n * Invoked when the component has been mounted and has a DOM representation.\n * However, there is no guarantee that the DOM node is in the document.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been mounted (initialized and rendered) for the first time.\n *\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidMount: 'DEFINE_MANY',\n\n /**\n * Invoked before the component receives new props.\n *\n * Use this as an opportunity to react to a prop transition by updating the\n * state using `this.setState`. Current props are accessed via `this.props`.\n *\n * componentWillReceiveProps: function(nextProps, nextContext) {\n * this.setState({\n * likesIncreasing: nextProps.likeCount > this.props.likeCount\n * });\n * }\n *\n * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop\n * transition may cause a state change, but the opposite is not true. If you\n * need it, you are probably looking for `componentWillUpdate`.\n *\n * @param {object} nextProps\n * @optional\n */\n componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Invoked while deciding if the component should be updated as a result of\n * receiving new props, state and/or context.\n *\n * Use this as an opportunity to `return false` when you're certain that the\n * transition to the new props/state/context will not require a component\n * update.\n *\n * shouldComponentUpdate: function(nextProps, nextState, nextContext) {\n * return !equal(nextProps, this.props) ||\n * !equal(nextState, this.state) ||\n * !equal(nextContext, this.context);\n * }\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @return {boolean} True if the component should update.\n * @optional\n */\n shouldComponentUpdate: 'DEFINE_ONCE',\n\n /**\n * Invoked when the component is about to update due to a transition from\n * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`\n * and `nextContext`.\n *\n * Use this as an opportunity to perform preparation before an update occurs.\n *\n * NOTE: You **cannot** use `this.setState()` in this method.\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @param {ReactReconcileTransaction} transaction\n * @optional\n */\n componentWillUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component's DOM representation has been updated.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been updated.\n *\n * @param {object} prevProps\n * @param {?object} prevState\n * @param {?object} prevContext\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component is about to be removed from its parent and have\n * its DOM representation destroyed.\n *\n * Use this as an opportunity to deallocate any external resources.\n *\n * NOTE: There is no `componentDidUnmount` since your component will have been\n * destroyed by that point.\n *\n * @optional\n */\n componentWillUnmount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillMount`.\n *\n * @optional\n */\n UNSAFE_componentWillMount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillReceiveProps`.\n *\n * @optional\n */\n UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillUpdate`.\n *\n * @optional\n */\n UNSAFE_componentWillUpdate: 'DEFINE_MANY',\n\n // ==== Advanced methods ====\n\n /**\n * Updates the component's currently mounted DOM representation.\n *\n * By default, this implements React's rendering and reconciliation algorithm.\n * Sophisticated clients may wish to override this.\n *\n * @param {ReactReconcileTransaction} transaction\n * @internal\n * @overridable\n */\n updateComponent: 'OVERRIDE_BASE'\n };\n\n /**\n * Similar to ReactClassInterface but for static methods.\n */\n var ReactClassStaticInterface = {\n /**\n * This method is invoked after a component is instantiated and when it\n * receives new props. Return an object to update state in response to\n * prop changes. Return null to indicate no change to state.\n *\n * If an object is returned, its keys will be merged into the existing state.\n *\n * @return {object || null}\n * @optional\n */\n getDerivedStateFromProps: 'DEFINE_MANY_MERGED'\n };\n\n /**\n * Mapping from class specification keys to special processing functions.\n *\n * Although these are declared like instance properties in the specification\n * when defining classes using `React.createClass`, they are actually static\n * and are accessible on the constructor instead of the prototype. Despite\n * being static, they must be defined outside of the \"statics\" key under\n * which all other static methods are defined.\n */\n var RESERVED_SPEC_KEYS = {\n displayName: function(Constructor, displayName) {\n Constructor.displayName = displayName;\n },\n mixins: function(Constructor, mixins) {\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n mixSpecIntoComponent(Constructor, mixins[i]);\n }\n }\n },\n childContextTypes: function(Constructor, childContextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, childContextTypes, 'childContext');\n }\n Constructor.childContextTypes = _assign(\n {},\n Constructor.childContextTypes,\n childContextTypes\n );\n },\n contextTypes: function(Constructor, contextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, contextTypes, 'context');\n }\n Constructor.contextTypes = _assign(\n {},\n Constructor.contextTypes,\n contextTypes\n );\n },\n /**\n * Special case getDefaultProps which should move into statics but requires\n * automatic merging.\n */\n getDefaultProps: function(Constructor, getDefaultProps) {\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps = createMergedResultFunction(\n Constructor.getDefaultProps,\n getDefaultProps\n );\n } else {\n Constructor.getDefaultProps = getDefaultProps;\n }\n },\n propTypes: function(Constructor, propTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, propTypes, 'prop');\n }\n Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);\n },\n statics: function(Constructor, statics) {\n mixStaticSpecIntoComponent(Constructor, statics);\n },\n autobind: function() {}\n };\n\n function validateTypeDef(Constructor, typeDef, location) {\n for (var propName in typeDef) {\n if (typeDef.hasOwnProperty(propName)) {\n // use a warning instead of an _invariant so components\n // don't show up in prod but only in __DEV__\n if (process.env.NODE_ENV !== 'production') {\n warning(\n typeof typeDef[propName] === 'function',\n '%s: %s type `%s` is invalid; it must be a function, usually from ' +\n 'React.PropTypes.',\n Constructor.displayName || 'ReactClass',\n ReactPropTypeLocationNames[location],\n propName\n );\n }\n }\n }\n }\n\n function validateMethodOverride(isAlreadyDefined, name) {\n var specPolicy = ReactClassInterface.hasOwnProperty(name)\n ? ReactClassInterface[name]\n : null;\n\n // Disallow overriding of base class methods unless explicitly allowed.\n if (ReactClassMixin.hasOwnProperty(name)) {\n _invariant(\n specPolicy === 'OVERRIDE_BASE',\n 'ReactClassInterface: You are attempting to override ' +\n '`%s` from your class specification. Ensure that your method names ' +\n 'do not overlap with React methods.',\n name\n );\n }\n\n // Disallow defining methods more than once unless explicitly allowed.\n if (isAlreadyDefined) {\n _invariant(\n specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClassInterface: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be due ' +\n 'to a mixin.',\n name\n );\n }\n }\n\n /**\n * Mixin helper which handles policy validation and reserved\n * specification keys when building React classes.\n */\n function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (process.env.NODE_ENV !== 'production') {\n var typeofSpec = typeof spec;\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n isMixinValid,\n \"%s: You're attempting to include a mixin that is either null \" +\n 'or not an object. Check the mixins included by the component, ' +\n 'as well as any mixins they include themselves. ' +\n 'Expected object but got %s.',\n Constructor.displayName || 'ReactClass',\n spec === null ? null : typeofSpec\n );\n }\n }\n\n return;\n }\n\n _invariant(\n typeof spec !== 'function',\n \"ReactClass: You're attempting to \" +\n 'use a component class or function as a mixin. Instead, just use a ' +\n 'regular object.'\n );\n _invariant(\n !isValidElement(spec),\n \"ReactClass: You're attempting to \" +\n 'use a component as a mixin. Instead, just use a regular object.'\n );\n\n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs;\n\n // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n\n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n\n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n\n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n\n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind =\n isFunction &&\n !isReactClassMethod &&\n !isAlreadyDefined &&\n spec.autobind !== false;\n\n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name];\n\n // These cases should already be caught by validateMethodOverride.\n _invariant(\n isReactClassMethod &&\n (specPolicy === 'DEFINE_MANY_MERGED' ||\n specPolicy === 'DEFINE_MANY'),\n 'ReactClass: Unexpected spec policy %s for key %s ' +\n 'when mixing in component specs.',\n specPolicy,\n name\n );\n\n // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n if (process.env.NODE_ENV !== 'production') {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }\n\n function mixStaticSpecIntoComponent(Constructor, statics) {\n if (!statics) {\n return;\n }\n\n for (var name in statics) {\n var property = statics[name];\n if (!statics.hasOwnProperty(name)) {\n continue;\n }\n\n var isReserved = name in RESERVED_SPEC_KEYS;\n _invariant(\n !isReserved,\n 'ReactClass: You are attempting to define a reserved ' +\n 'property, `%s`, that shouldn\\'t be on the \"statics\" key. Define it ' +\n 'as an instance property instead; it will still be accessible on the ' +\n 'constructor.',\n name\n );\n\n var isAlreadyDefined = name in Constructor;\n if (isAlreadyDefined) {\n var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)\n ? ReactClassStaticInterface[name]\n : null;\n\n _invariant(\n specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClass: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be ' +\n 'due to a mixin.',\n name\n );\n\n Constructor[name] = createMergedResultFunction(Constructor[name], property);\n\n return;\n }\n\n Constructor[name] = property;\n }\n }\n\n /**\n * Merge two objects, but throw if both contain the same key.\n *\n * @param {object} one The first object, which is mutated.\n * @param {object} two The second object\n * @return {object} one after it has been mutated to contain everything in two.\n */\n function mergeIntoWithNoDuplicateKeys(one, two) {\n _invariant(\n one && two && typeof one === 'object' && typeof two === 'object',\n 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'\n );\n\n for (var key in two) {\n if (two.hasOwnProperty(key)) {\n _invariant(\n one[key] === undefined,\n 'mergeIntoWithNoDuplicateKeys(): ' +\n 'Tried to merge two objects with the same key: `%s`. This conflict ' +\n 'may be due to a mixin; in particular, this may be caused by two ' +\n 'getInitialState() or getDefaultProps() methods returning objects ' +\n 'with clashing keys.',\n key\n );\n one[key] = two[key];\n }\n }\n return one;\n }\n\n /**\n * Creates a function that invokes two functions and merges their return values.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createMergedResultFunction(one, two) {\n return function mergedResult() {\n var a = one.apply(this, arguments);\n var b = two.apply(this, arguments);\n if (a == null) {\n return b;\n } else if (b == null) {\n return a;\n }\n var c = {};\n mergeIntoWithNoDuplicateKeys(c, a);\n mergeIntoWithNoDuplicateKeys(c, b);\n return c;\n };\n }\n\n /**\n * Creates a function that invokes two functions and ignores their return vales.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createChainedFunction(one, two) {\n return function chainedFunction() {\n one.apply(this, arguments);\n two.apply(this, arguments);\n };\n }\n\n /**\n * Binds a method to the component.\n *\n * @param {object} component Component whose method is going to be bound.\n * @param {function} method Method to be bound.\n * @return {function} The bound method.\n */\n function bindAutoBindMethod(component, method) {\n var boundMethod = method.bind(component);\n if (process.env.NODE_ENV !== 'production') {\n boundMethod.__reactBoundContext = component;\n boundMethod.__reactBoundMethod = method;\n boundMethod.__reactBoundArguments = null;\n var componentName = component.constructor.displayName;\n var _bind = boundMethod.bind;\n boundMethod.bind = function(newThis) {\n for (\n var _len = arguments.length,\n args = Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n // User is trying to bind() an autobound method; we effectively will\n // ignore the value of \"this\" that the user is trying to use, so\n // let's warn.\n if (newThis !== component && newThis !== null) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): React component methods may only be bound to the ' +\n 'component instance. See %s',\n componentName\n );\n }\n } else if (!args.length) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): You are binding a component method to the component. ' +\n 'React does this for you automatically in a high-performance ' +\n 'way, so you can safely remove this call. See %s',\n componentName\n );\n }\n return boundMethod;\n }\n var reboundMethod = _bind.apply(boundMethod, arguments);\n reboundMethod.__reactBoundContext = component;\n reboundMethod.__reactBoundMethod = method;\n reboundMethod.__reactBoundArguments = args;\n return reboundMethod;\n };\n }\n return boundMethod;\n }\n\n /**\n * Binds all auto-bound methods in a component.\n *\n * @param {object} component Component whose method is going to be bound.\n */\n function bindAutoBindMethods(component) {\n var pairs = component.__reactAutoBindPairs;\n for (var i = 0; i < pairs.length; i += 2) {\n var autoBindKey = pairs[i];\n var method = pairs[i + 1];\n component[autoBindKey] = bindAutoBindMethod(component, method);\n }\n }\n\n var IsMountedPreMixin = {\n componentDidMount: function() {\n this.__isMounted = true;\n }\n };\n\n var IsMountedPostMixin = {\n componentWillUnmount: function() {\n this.__isMounted = false;\n }\n };\n\n /**\n * Add more to the ReactClass base class. These are all legacy features and\n * therefore not already part of the modern ReactComponent.\n */\n var ReactClassMixin = {\n /**\n * TODO: This will be deprecated because state should always keep a consistent\n * type signature and the only use case for this, is to avoid that.\n */\n replaceState: function(newState, callback) {\n this.updater.enqueueReplaceState(this, newState, callback);\n },\n\n /**\n * Checks whether or not this composite component is mounted.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function() {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this.__didWarnIsMounted,\n '%s: isMounted is deprecated. Instead, make sure to clean up ' +\n 'subscriptions and pending requests in componentWillUnmount to ' +\n 'prevent memory leaks.',\n (this.constructor && this.constructor.displayName) ||\n this.name ||\n 'Component'\n );\n this.__didWarnIsMounted = true;\n }\n return !!this.__isMounted;\n }\n };\n\n var ReactClassComponent = function() {};\n _assign(\n ReactClassComponent.prototype,\n ReactComponent.prototype,\n ReactClassMixin\n );\n\n /**\n * Creates a composite component class given a class specification.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass\n *\n * @param {object} spec Class specification (which must define `render`).\n * @return {function} Component constructor function.\n * @public\n */\n function createClass(spec) {\n // To keep our warnings more understandable, we'll use a little hack here to\n // ensure that Constructor.name !== 'Constructor'. This makes sure we don't\n // unnecessarily identify a class without displayName as 'Constructor'.\n var Constructor = identity(function(props, context, updater) {\n // This constructor gets overridden by mocks. The argument is used\n // by mocks to assert on what gets mounted.\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this instanceof Constructor,\n 'Something is calling a React component directly. Use a factory or ' +\n 'JSX instead. See: https://fb.me/react-legacyfactory'\n );\n }\n\n // Wire up auto-binding\n if (this.__reactAutoBindPairs.length) {\n bindAutoBindMethods(this);\n }\n\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n\n this.state = null;\n\n // ReactClasses doesn't have constructors. Instead, they use the\n // getInitialState and componentWillMount methods for initialization.\n\n var initialState = this.getInitialState ? this.getInitialState() : null;\n if (process.env.NODE_ENV !== 'production') {\n // We allow auto-mocks to proceed as if they're returning null.\n if (\n initialState === undefined &&\n this.getInitialState._isMockFunction\n ) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n initialState = null;\n }\n }\n _invariant(\n typeof initialState === 'object' && !Array.isArray(initialState),\n '%s.getInitialState(): must return an object or null',\n Constructor.displayName || 'ReactCompositeComponent'\n );\n\n this.state = initialState;\n });\n Constructor.prototype = new ReactClassComponent();\n Constructor.prototype.constructor = Constructor;\n Constructor.prototype.__reactAutoBindPairs = [];\n\n injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));\n\n mixSpecIntoComponent(Constructor, IsMountedPreMixin);\n mixSpecIntoComponent(Constructor, spec);\n mixSpecIntoComponent(Constructor, IsMountedPostMixin);\n\n // Initialize the defaultProps property after all mixins have been merged.\n if (Constructor.getDefaultProps) {\n Constructor.defaultProps = Constructor.getDefaultProps();\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This is a tag to indicate that the use of these method names is ok,\n // since it's used with createClass. If it's not, then it's likely a\n // mistake so we'll warn you to use the static property, property\n // initializer or constructor respectively.\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps.isReactClassApproved = {};\n }\n if (Constructor.prototype.getInitialState) {\n Constructor.prototype.getInitialState.isReactClassApproved = {};\n }\n }\n\n _invariant(\n Constructor.prototype.render,\n 'createClass(...): Class specification must implement a `render` method.'\n );\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n !Constructor.prototype.componentShouldUpdate,\n '%s has a method called ' +\n 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +\n 'The name is phrased as a question because the function is ' +\n 'expected to return a value.',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.componentWillRecieveProps,\n '%s has a method called ' +\n 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.UNSAFE_componentWillRecieveProps,\n '%s has a method called UNSAFE_componentWillRecieveProps(). ' +\n 'Did you mean UNSAFE_componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n }\n\n // Reduce time spent doing lookups by setting these on the prototype.\n for (var methodName in ReactClassInterface) {\n if (!Constructor.prototype[methodName]) {\n Constructor.prototype[methodName] = null;\n }\n }\n\n return Constructor;\n }\n\n return createClass;\n}\n\nmodule.exports = factory;\n","module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var u=e[r]={i:r,l:!1,exports:{}};return t[r].call(u.exports,u,u.exports,n),u.l=!0,u.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var u in t)n.d(r,u,function(e){return t[e]}.bind(null,u));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=0)}([function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var r=n(1),u=i(r),o=i(n(2)),c=i(n(3));function i(t){return t&&t.__esModule?t:{default:t}}var f=function(t){var e=t.fg,n=t.bg,i=t.count,f=t.palette,l=t.string,a=t.size,d=t.getColor,s=t.padding,g=t.className,p=(0,r.useRef)(null);(0,r.useEffect)(function(){h(t)});var h=function(){var t=(0,o.default)(l),r=Math.floor(a/i),u=t.slice(0,6);if(f&&f.length){var g=Math.floor((0,c.default)(parseInt(t.slice(-3),16),0,4095,0,f.length));e=f[g]}d&&d(e||u);var h=s;p.current.width=r*i+h,p.current.height=r*i+h;var v=t.split(\"\").map(function(t){return(t=parseInt(t,16))<8?0:1}),b=[];b[0]=b[4]=v.slice(0,5),b[1]=b[3]=v.slice(5,10),b[2]=v.slice(10,15);var y=p.current.getContext(\"2d\");y.imageSmoothingEnabled=!1,y.clearRect(0,0,p.current.width,p.current.height),b.forEach(function(t,o){t.forEach(function(t,c){t?(y.fillStyle=e||\"#\"+u,y.fillRect(r*o+h,r*c+h,r-h,r-h)):(y.fillStyle=n,y.fillRect(r*o+h,r*c+h,r-h,r-h))})})};return u.default.createElement(\"canvas\",{ref:p,className:g,style:{width:a,height:a}})};f.defaultProps={className:\"identicon\",bg:\"transparent\",count:5,palette:null,fg:null,padding:0,size:400,getColor:null,string:\"\"},e.default=f},function(t,e){t.exports=require(\"react\")},function(t,e,n){\"use strict\";var r;\"function\"==typeof Symbol&&Symbol.iterator;!function(u){function o(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function c(t,e,n,r,u,c){return o(function(t,e){return t<>>32-e}(o(o(e,t),o(r,c)),u),n)}function i(t,e,n,r,u,o,i){return c(e&n|~e&r,t,e,u,o,i)}function f(t,e,n,r,u,o,i){return c(e&r|n&~r,t,e,u,o,i)}function l(t,e,n,r,u,o,i){return c(e^n^r,t,e,u,o,i)}function a(t,e,n,r,u,o,i){return c(n^(e|~r),t,e,u,o,i)}function d(t,e){t[e>>5]|=128<>>9<<4)]=e;var n,r,u,c,d,s=1732584193,g=-271733879,p=-1732584194,h=271733878;for(n=0;n>5]>>>e%32&255);return n}function g(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e>5]|=(255&t.charCodeAt(e/8))<>>4&15)+\"0123456789abcdef\".charAt(15&e);return r}function h(t){return unescape(encodeURIComponent(t))}function v(t){return function(t){return s(d(g(t),8*t.length))}(h(t))}function b(t,e){return function(t,e){var n,r,u=g(t),o=[],c=[];for(o[15]=c[15]=void 0,u.length>16&&(u=d(u,8*t.length)),n=0;n<16;n+=1)o[n]=909522486^u[n],c[n]=1549556828^u[n];return r=d(o.concat(g(e)),512+8*e.length),s(d(c.concat(r),640))}(h(t),h(e))}function y(t,e,n){return e?n?b(e,t):function(t,e){return p(b(t,e))}(e,t):n?v(t):function(t){return p(v(t))}(t)}void 0===(r=function(){return y}.call(e,n,e,t))||(t.exports=r)}()},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});e.default=function(t,e,n,r,u){return(t-e)*(u-r)/(n-e)+r}}]);","export var name = \"d3\";\nexport var version = \"5.16.0\";\nexport var description = \"Data-Driven Documents\";\nexport var keywords = [\"dom\",\"visualization\",\"svg\",\"animation\",\"canvas\"];\nexport var homepage = \"https://d3js.org\";\nexport var license = \"BSD-3-Clause\";\nexport var author = {\"name\":\"Mike Bostock\",\"url\":\"https://bost.ocks.org/mike\"};\nexport var main = \"dist/d3.node.js\";\nexport var unpkg = \"dist/d3.min.js\";\nexport var jsdelivr = \"dist/d3.min.js\";\nexport var module = \"index.js\";\nexport var repository = {\"type\":\"git\",\"url\":\"https://github.com/d3/d3.git\"};\nexport var files = [\"dist/**/*.js\",\"index.js\"];\nexport var scripts = {\"pretest\":\"rimraf dist && mkdir dist && json2module package.json > dist/package.js && rollup -c\",\"test\":\"tape 'test/**/*-test.js'\",\"prepublishOnly\":\"yarn test\",\"postpublish\":\"git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3/dist/d3.js d3.v5.js && cp ../d3/dist/d3.min.js d3.v5.min.js && git add d3.v5.js d3.v5.min.js && git commit -m \\\"d3 ${npm_package_version}\\\" && git push && cd - && cd ../d3-bower && git pull && cp ../d3/LICENSE ../d3/README.md ../d3/dist/d3.js ../d3/dist/d3.min.js . && git add -- LICENSE README.md d3.js d3.min.js && git commit -m \\\"${npm_package_version}\\\" && git tag -am \\\"${npm_package_version}\\\" v${npm_package_version} && git push && git push --tags && cd - && zip -j dist/d3.zip -- LICENSE README.md API.md CHANGES.md dist/d3.js dist/d3.min.js\"};\nexport var devDependencies = {\"json2module\":\"0.0\",\"rimraf\":\"2\",\"rollup\":\"1\",\"rollup-plugin-ascii\":\"0.0\",\"rollup-plugin-node-resolve\":\"3\",\"rollup-plugin-terser\":\"5\",\"tape\":\"4\"};\nexport var dependencies = {\"d3-array\":\"1\",\"d3-axis\":\"1\",\"d3-brush\":\"1\",\"d3-chord\":\"1\",\"d3-collection\":\"1\",\"d3-color\":\"1\",\"d3-contour\":\"1\",\"d3-dispatch\":\"1\",\"d3-drag\":\"1\",\"d3-dsv\":\"1\",\"d3-ease\":\"1\",\"d3-fetch\":\"1\",\"d3-force\":\"1\",\"d3-format\":\"1\",\"d3-geo\":\"1\",\"d3-hierarchy\":\"1\",\"d3-interpolate\":\"1\",\"d3-path\":\"1\",\"d3-polygon\":\"1\",\"d3-quadtree\":\"1\",\"d3-random\":\"1\",\"d3-scale\":\"2\",\"d3-scale-chromatic\":\"1\",\"d3-selection\":\"1\",\"d3-shape\":\"1\",\"d3-time\":\"1\",\"d3-time-format\":\"2\",\"d3-timer\":\"1\",\"d3-transition\":\"1\",\"d3-voronoi\":\"1\",\"d3-zoom\":\"1\"};\n","export default function(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","import ascending from \"./ascending\";\n\nexport default function(compare) {\n if (compare.length === 1) compare = ascendingComparator(compare);\n return {\n left: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n }\n return lo;\n },\n right: function(a, x, lo, hi) {\n if (lo == null) lo = 0;\n if (hi == null) hi = a.length;\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (compare(a[mid], x) > 0) hi = mid;\n else lo = mid + 1;\n }\n return lo;\n }\n };\n}\n\nfunction ascendingComparator(f) {\n return function(d, x) {\n return ascending(f(d), x);\n };\n}\n","import ascending from \"./ascending\";\nimport bisector from \"./bisector\";\n\nvar ascendingBisect = bisector(ascending);\nexport var bisectRight = ascendingBisect.right;\nexport var bisectLeft = ascendingBisect.left;\nexport default bisectRight;\n","import {pair} from \"./pairs\";\n\nexport default function(values0, values1, reduce) {\n var n0 = values0.length,\n n1 = values1.length,\n values = new Array(n0 * n1),\n i0,\n i1,\n i,\n value0;\n\n if (reduce == null) reduce = pair;\n\n for (i0 = i = 0; i0 < n0; ++i0) {\n for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {\n values[i] = reduce(value0, values1[i1]);\n }\n }\n\n return values;\n}\n","var array = Array.prototype;\n\nexport var slice = array.slice;\nexport var map = array.map;\n","var e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nexport default function(start, stop, count) {\n var reverse,\n i = -1,\n n,\n ticks,\n step;\n\n stop = +stop, start = +start, count = +count;\n if (start === stop && count > 0) return [start];\n if (reverse = stop < start) n = start, start = stop, stop = n;\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];\n\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array(n = Math.ceil(stop - start + 1));\n while (++i < n) ticks[i] = (start + i) * step;\n } else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array(n = Math.ceil(start - stop + 1));\n while (++i < n) ticks[i] = (start - i) / step;\n }\n\n if (reverse) ticks.reverse();\n\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log(step) / Math.LN10),\n error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n\nexport function tickStep(start, stop, count) {\n var step0 = Math.abs(stop - start) / Math.max(0, count),\n step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),\n error = step0 / step1;\n if (error >= e10) step1 *= 10;\n else if (error >= e5) step1 *= 5;\n else if (error >= e2) step1 *= 2;\n return stop < start ? -step1 : step1;\n}\n","export default function(values) {\n return Math.ceil(Math.log(values.length) / Math.LN2) + 1;\n}\n","export default function(arrays) {\n var n = arrays.length,\n m,\n i = -1,\n j = 0,\n merged,\n array;\n\n while (++i < n) j += arrays[i].length;\n merged = new Array(j);\n\n while (--n >= 0) {\n array = arrays[n];\n m = array.length;\n while (--m >= 0) {\n merged[--j] = array[m];\n }\n }\n\n return merged;\n}\n","export var slice = Array.prototype.slice;\n","var noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n","function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n","function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n","export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n","export default function(update) {\n return new Array(update.length);\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n","import {Selection} from \"./index\";\nimport {EnterNode} from \"./enter\";\nimport constant from \"../constant\";\n\nvar keyPrefix = \"$\"; // Protect against keys like “__proto__”.\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don’t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = {},\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);\n if (keyValue in nodeByKeyValue) {\n exit[i] = node;\n } else {\n nodeByKeyValue[keyValue] = node;\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = keyPrefix + key.call(parent, data[i], i, data);\n if (node = nodeByKeyValue[keyValue]) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue[keyValue] = null;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {\n exit[i] = node;\n }\n }\n}\n\nexport default function(value, key) {\n if (!value) {\n data = new Array(this.size()), j = -1;\n this.each(function(d) { data[++j] = d; });\n return data;\n }\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = value.call(parent, parent && parent.__data__, j, parents),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n","export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n","import namespaces from \"./namespaces\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;\n}\n","import namespace from \"../namespace\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n","export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n","import defaultView from \"../window\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n","function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n","function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n","function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n","function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n","function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n","function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n","import namespace from \"./namespace\";\nimport {xhtml} from \"./namespaces\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n","import creator from \"../creator\";\nimport selector from \"../selector\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n","function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n","function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n","var filterEvents = {};\n\nexport var event = null;\n\nif (typeof document !== \"undefined\") {\n var element = document.documentElement;\n if (!(\"onmouseenter\" in element)) {\n filterEvents = {mouseenter: \"mouseover\", mouseleave: \"mouseout\"};\n }\n}\n\nfunction filterContextListener(listener, index, group) {\n listener = contextListener(listener, index, group);\n return function(event) {\n var related = event.relatedTarget;\n if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {\n listener.call(this, event);\n }\n };\n}\n\nfunction contextListener(listener, index, group) {\n return function(event1) {\n var event0 = event; // Events can be reentrant (e.g., focus).\n event = event1;\n try {\n listener.call(this, this.__data__, index, group);\n } finally {\n event = event0;\n }\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, capture) {\n var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;\n return function(d, i, group) {\n var on = this.__on, o, listener = wrap(value, i, group);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.capture);\n this.addEventListener(o.type, o.listener = listener, o.capture = capture);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, capture);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, capture) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n if (capture == null) capture = false;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));\n return this;\n}\n\nexport function customEvent(event1, listener, that, args) {\n var event0 = event;\n event1.sourceEvent = event;\n event = event1;\n try {\n return listener.apply(that, args);\n } finally {\n event = event0;\n }\n}\n","import defaultView from \"../window\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n","import selection_select from \"./select\";\nimport selection_selectAll from \"./selectAll\";\nimport selection_filter from \"./filter\";\nimport selection_data from \"./data\";\nimport selection_enter from \"./enter\";\nimport selection_exit from \"./exit\";\nimport selection_join from \"./join\";\nimport selection_merge from \"./merge\";\nimport selection_order from \"./order\";\nimport selection_sort from \"./sort\";\nimport selection_call from \"./call\";\nimport selection_nodes from \"./nodes\";\nimport selection_node from \"./node\";\nimport selection_size from \"./size\";\nimport selection_empty from \"./empty\";\nimport selection_each from \"./each\";\nimport selection_attr from \"./attr\";\nimport selection_style from \"./style\";\nimport selection_property from \"./property\";\nimport selection_classed from \"./classed\";\nimport selection_text from \"./text\";\nimport selection_html from \"./html\";\nimport selection_raise from \"./raise\";\nimport selection_lower from \"./lower\";\nimport selection_append from \"./append\";\nimport selection_insert from \"./insert\";\nimport selection_remove from \"./remove\";\nimport selection_clone from \"./clone\";\nimport selection_datum from \"./datum\";\nimport selection_on from \"./on\";\nimport selection_dispatch from \"./dispatch\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch\n};\n\nexport default selection;\n","import {Selection} from \"./index\";\nimport selector from \"../selector\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","import {Selection} from \"./index\";\nimport selectorAll from \"../selectorAll\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n","import {Selection} from \"./index\";\nimport matcher from \"../matcher\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import sparse from \"./sparse\";\nimport {Selection} from \"./index\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n","export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n enter = typeof onenter === \"function\" ? onenter(enter) : enter.append(onenter + \"\");\n if (onupdate != null) update = onupdate(update);\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n","import {Selection} from \"./index\";\n\nexport default function(selection) {\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n","export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n","export default function() {\n var nodes = new Array(this.size()), i = -1;\n this.each(function() { nodes[++i] = this; });\n return nodes;\n}\n","export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n","export default function() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}\n","export default function() {\n return !this.node();\n}\n","export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n","import creator from \"../creator\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n","export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n","import {Selection, root} from \"./selection/index\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n","import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n","import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n","import decompose, {identity} from \"./decompose.js\";\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nexport function parseCss(value) {\n if (value === \"none\") return identity;\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n","var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n","import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n","import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we’re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n","import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n","import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n","import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n","import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n","import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n","import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n","function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n","import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n","import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n","function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n","function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n","import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n end: transition_end\n};\n","import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n","import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n","import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n","import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n","import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n","import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n","import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we’re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n });\n}\n","import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n return defaultTiming.time = now(), defaultTiming;\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n","export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n","import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n","import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolate} from \"d3-interpolate\";\nimport {customEvent, event, touch, mouse, select} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport BrushEvent from \"./event.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\nvar MODE_DRAG = {name: \"drag\"},\n MODE_SPACE = {name: \"space\"},\n MODE_HANDLE = {name: \"handle\"},\n MODE_CENTER = {name: \"center\"};\n\nfunction number1(e) {\n return [+e[0], +e[1]];\n}\n\nfunction number2(e) {\n return [number1(e[0]), number1(e[1])];\n}\n\nfunction toucher(identifier) {\n return function(target) {\n return touch(target, event.touches, identifier);\n };\n}\n\nvar X = {\n name: \"x\",\n handles: [\"w\", \"e\"].map(type),\n input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; },\n output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n name: \"y\",\n handles: [\"n\", \"s\"].map(type),\n input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; },\n output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n name: \"xy\",\n handles: [\"n\", \"w\", \"e\", \"s\", \"nw\", \"ne\", \"sw\", \"se\"].map(type),\n input: function(xy) { return xy == null ? null : number2(xy); },\n output: function(xy) { return xy; }\n};\n\nvar cursors = {\n overlay: \"crosshair\",\n selection: \"move\",\n n: \"ns-resize\",\n e: \"ew-resize\",\n s: \"ns-resize\",\n w: \"ew-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n se: \"nwse-resize\",\n sw: \"nesw-resize\"\n};\n\nvar flipX = {\n e: \"w\",\n w: \"e\",\n nw: \"ne\",\n ne: \"nw\",\n se: \"sw\",\n sw: \"se\"\n};\n\nvar flipY = {\n n: \"s\",\n s: \"n\",\n nw: \"sw\",\n ne: \"se\",\n se: \"ne\",\n sw: \"nw\"\n};\n\nvar signsX = {\n overlay: +1,\n selection: +1,\n n: null,\n e: +1,\n s: null,\n w: -1,\n nw: -1,\n ne: +1,\n se: +1,\n sw: -1\n};\n\nvar signsY = {\n overlay: +1,\n selection: +1,\n n: -1,\n e: null,\n s: +1,\n w: null,\n nw: -1,\n ne: -1,\n se: +1,\n sw: +1\n};\n\nfunction type(t) {\n return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter() {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultExtent() {\n var svg = this.ownerSVGElement || this;\n if (svg.hasAttribute(\"viewBox\")) {\n svg = svg.viewBox.baseVal;\n return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];\n }\n return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\n// Like d3.local, but with the name “__brush” rather than auto-generated.\nfunction local(node) {\n while (!node.__brush) if (!(node = node.parentNode)) return;\n return node.__brush;\n}\n\nfunction empty(extent) {\n return extent[0][0] === extent[1][0]\n || extent[0][1] === extent[1][1];\n}\n\nexport function brushSelection(node) {\n var state = node.__brush;\n return state ? state.dim.output(state.selection) : null;\n}\n\nexport function brushX() {\n return brush(X);\n}\n\nexport function brushY() {\n return brush(Y);\n}\n\nexport default function() {\n return brush(XY);\n}\n\nfunction brush(dim) {\n var extent = defaultExtent,\n filter = defaultFilter,\n touchable = defaultTouchable,\n keys = true,\n listeners = dispatch(\"start\", \"brush\", \"end\"),\n handleSize = 6,\n touchending;\n\n function brush(group) {\n var overlay = group\n .property(\"__brush\", initialize)\n .selectAll(\".overlay\")\n .data([type(\"overlay\")]);\n\n overlay.enter().append(\"rect\")\n .attr(\"class\", \"overlay\")\n .attr(\"pointer-events\", \"all\")\n .attr(\"cursor\", cursors.overlay)\n .merge(overlay)\n .each(function() {\n var extent = local(this).extent;\n select(this)\n .attr(\"x\", extent[0][0])\n .attr(\"y\", extent[0][1])\n .attr(\"width\", extent[1][0] - extent[0][0])\n .attr(\"height\", extent[1][1] - extent[0][1]);\n });\n\n group.selectAll(\".selection\")\n .data([type(\"selection\")])\n .enter().append(\"rect\")\n .attr(\"class\", \"selection\")\n .attr(\"cursor\", cursors.selection)\n .attr(\"fill\", \"#777\")\n .attr(\"fill-opacity\", 0.3)\n .attr(\"stroke\", \"#fff\")\n .attr(\"shape-rendering\", \"crispEdges\");\n\n var handle = group.selectAll(\".handle\")\n .data(dim.handles, function(d) { return d.type; });\n\n handle.exit().remove();\n\n handle.enter().append(\"rect\")\n .attr(\"class\", function(d) { return \"handle handle--\" + d.type; })\n .attr(\"cursor\", function(d) { return cursors[d.type]; });\n\n group\n .each(redraw)\n .attr(\"fill\", \"none\")\n .attr(\"pointer-events\", \"all\")\n .on(\"mousedown.brush\", started)\n .filter(touchable)\n .on(\"touchstart.brush\", started)\n .on(\"touchmove.brush\", touchmoved)\n .on(\"touchend.brush touchcancel.brush\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n brush.move = function(group, selection) {\n if (group.selection) {\n group\n .on(\"start.brush\", function() { emitter(this, arguments).beforestart().start(); })\n .on(\"interrupt.brush end.brush\", function() { emitter(this, arguments).end(); })\n .tween(\"brush\", function() {\n var that = this,\n state = that.__brush,\n emit = emitter(that, arguments),\n selection0 = state.selection,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(this, arguments) : selection, state.extent),\n i = interpolate(selection0, selection1);\n\n function tween(t) {\n state.selection = t === 1 && selection1 === null ? null : i(t);\n redraw.call(that);\n emit.brush();\n }\n\n return selection0 !== null && selection1 !== null ? tween : tween(1);\n });\n } else {\n group\n .each(function() {\n var that = this,\n args = arguments,\n state = that.__brush,\n selection1 = dim.input(typeof selection === \"function\" ? selection.apply(that, args) : selection, state.extent),\n emit = emitter(that, args).beforestart();\n\n interrupt(that);\n state.selection = selection1 === null ? null : selection1;\n redraw.call(that);\n emit.start().brush().end();\n });\n }\n };\n\n brush.clear = function(group) {\n brush.move(group, null);\n };\n\n function redraw() {\n var group = select(this),\n selection = local(this).selection;\n\n if (selection) {\n group.selectAll(\".selection\")\n .style(\"display\", null)\n .attr(\"x\", selection[0][0])\n .attr(\"y\", selection[0][1])\n .attr(\"width\", selection[1][0] - selection[0][0])\n .attr(\"height\", selection[1][1] - selection[0][1]);\n\n group.selectAll(\".handle\")\n .style(\"display\", null)\n .attr(\"x\", function(d) { return d.type[d.type.length - 1] === \"e\" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n .attr(\"y\", function(d) { return d.type[0] === \"s\" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n .attr(\"width\", function(d) { return d.type === \"n\" || d.type === \"s\" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n .attr(\"height\", function(d) { return d.type === \"e\" || d.type === \"w\" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n }\n\n else {\n group.selectAll(\".selection,.handle\")\n .style(\"display\", \"none\")\n .attr(\"x\", null)\n .attr(\"y\", null)\n .attr(\"width\", null)\n .attr(\"height\", null);\n }\n }\n\n function emitter(that, args, clean) {\n return (!clean && that.__brush.emitter) || new Emitter(that, args);\n }\n\n function Emitter(that, args) {\n this.that = that;\n this.args = args;\n this.state = that.__brush;\n this.active = 0;\n }\n\n Emitter.prototype = {\n beforestart: function() {\n if (++this.active === 1) this.state.emitter = this, this.starting = true;\n return this;\n },\n start: function() {\n if (this.starting) this.starting = false, this.emit(\"start\");\n else this.emit(\"brush\");\n return this;\n },\n brush: function() {\n this.emit(\"brush\");\n return this;\n },\n end: function() {\n if (--this.active === 0) delete this.state.emitter, this.emit(\"end\");\n return this;\n },\n emit: function(type) {\n customEvent(new BrushEvent(brush, type, dim.output(this.state.selection)), listeners.apply, listeners, [type, this.that, this.args]);\n }\n };\n\n function started() {\n if (touchending && !event.touches) return;\n if (!filter.apply(this, arguments)) return;\n\n var that = this,\n type = event.target.__data__.type,\n mode = (keys && event.metaKey ? type = \"overlay\" : type) === \"selection\" ? MODE_DRAG : (keys && event.altKey ? MODE_CENTER : MODE_HANDLE),\n signX = dim === Y ? null : signsX[type],\n signY = dim === X ? null : signsY[type],\n state = local(that),\n extent = state.extent,\n selection = state.selection,\n W = extent[0][0], w0, w1,\n N = extent[0][1], n0, n1,\n E = extent[1][0], e0, e1,\n S = extent[1][1], s0, s1,\n dx = 0,\n dy = 0,\n moving,\n shifting = signX && signY && keys && event.shiftKey,\n lockX,\n lockY,\n pointer = event.touches ? toucher(event.changedTouches[0].identifier) : mouse,\n point0 = pointer(that),\n point = point0,\n emit = emitter(that, arguments, true).beforestart();\n\n if (type === \"overlay\") {\n if (selection) moving = true;\n state.selection = selection = [\n [w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]],\n [e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0]\n ];\n } else {\n w0 = selection[0][0];\n n0 = selection[0][1];\n e0 = selection[1][0];\n s0 = selection[1][1];\n }\n\n w1 = w0;\n n1 = n0;\n e1 = e0;\n s1 = s0;\n\n var group = select(that)\n .attr(\"pointer-events\", \"none\");\n\n var overlay = group.selectAll(\".overlay\")\n .attr(\"cursor\", cursors[type]);\n\n if (event.touches) {\n emit.moved = moved;\n emit.ended = ended;\n } else {\n var view = select(event.view)\n .on(\"mousemove.brush\", moved, true)\n .on(\"mouseup.brush\", ended, true);\n if (keys) view\n .on(\"keydown.brush\", keydowned, true)\n .on(\"keyup.brush\", keyupped, true)\n\n dragDisable(event.view);\n }\n\n nopropagation();\n interrupt(that);\n redraw.call(that);\n emit.start();\n\n function moved() {\n var point1 = pointer(that);\n if (shifting && !lockX && !lockY) {\n if (Math.abs(point1[0] - point[0]) > Math.abs(point1[1] - point[1])) lockY = true;\n else lockX = true;\n }\n point = point1;\n moving = true;\n noevent();\n move();\n }\n\n function move() {\n var t;\n\n dx = point[0] - point0[0];\n dy = point[1] - point0[1];\n\n switch (mode) {\n case MODE_SPACE:\n case MODE_DRAG: {\n if (signX) dx = Math.max(W - w0, Math.min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n if (signY) dy = Math.max(N - n0, Math.min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n break;\n }\n case MODE_HANDLE: {\n if (signX < 0) dx = Math.max(W - w0, Math.min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n else if (signX > 0) dx = Math.max(W - e0, Math.min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n if (signY < 0) dy = Math.max(N - n0, Math.min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n else if (signY > 0) dy = Math.max(N - s0, Math.min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n break;\n }\n case MODE_CENTER: {\n if (signX) w1 = Math.max(W, Math.min(E, w0 - dx * signX)), e1 = Math.max(W, Math.min(E, e0 + dx * signX));\n if (signY) n1 = Math.max(N, Math.min(S, n0 - dy * signY)), s1 = Math.max(N, Math.min(S, s0 + dy * signY));\n break;\n }\n }\n\n if (e1 < w1) {\n signX *= -1;\n t = w0, w0 = e0, e0 = t;\n t = w1, w1 = e1, e1 = t;\n if (type in flipX) overlay.attr(\"cursor\", cursors[type = flipX[type]]);\n }\n\n if (s1 < n1) {\n signY *= -1;\n t = n0, n0 = s0, s0 = t;\n t = n1, n1 = s1, s1 = t;\n if (type in flipY) overlay.attr(\"cursor\", cursors[type = flipY[type]]);\n }\n\n if (state.selection) selection = state.selection; // May be set by brush.move!\n if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n if (selection[0][0] !== w1\n || selection[0][1] !== n1\n || selection[1][0] !== e1\n || selection[1][1] !== s1) {\n state.selection = [[w1, n1], [e1, s1]];\n redraw.call(that);\n emit.brush();\n }\n }\n\n function ended() {\n nopropagation();\n if (event.touches) {\n if (event.touches.length) return;\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n } else {\n dragEnable(event.view, moving);\n view.on(\"keydown.brush keyup.brush mousemove.brush mouseup.brush\", null);\n }\n group.attr(\"pointer-events\", \"all\");\n overlay.attr(\"cursor\", cursors.overlay);\n if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n if (empty(selection)) state.selection = null, redraw.call(that);\n emit.end();\n }\n\n function keydowned() {\n switch (event.keyCode) {\n case 16: { // SHIFT\n shifting = signX && signY;\n break;\n }\n case 18: { // ALT\n if (mode === MODE_HANDLE) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n move();\n }\n break;\n }\n case 32: { // SPACE; takes priority over ALT\n if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n mode = MODE_SPACE;\n overlay.attr(\"cursor\", cursors.selection);\n move();\n }\n break;\n }\n default: return;\n }\n noevent();\n }\n\n function keyupped() {\n switch (event.keyCode) {\n case 16: { // SHIFT\n if (shifting) {\n lockX = lockY = shifting = false;\n move();\n }\n break;\n }\n case 18: { // ALT\n if (mode === MODE_CENTER) {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n move();\n }\n break;\n }\n case 32: { // SPACE\n if (mode === MODE_SPACE) {\n if (event.altKey) {\n if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n mode = MODE_CENTER;\n } else {\n if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n mode = MODE_HANDLE;\n }\n overlay.attr(\"cursor\", cursors[type]);\n move();\n }\n break;\n }\n default: return;\n }\n noevent();\n }\n }\n\n function touchmoved() {\n emitter(this, arguments).moved();\n }\n\n function touchended() {\n emitter(this, arguments).ended();\n }\n\n function initialize() {\n var state = this.__brush || {selection: null};\n state.extent = number2(extent.apply(this, arguments));\n state.dim = dim;\n return state;\n }\n\n brush.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant(number2(_)), brush) : extent;\n };\n\n brush.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), brush) : filter;\n };\n\n brush.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), brush) : touchable;\n };\n\n brush.handleSize = function(_) {\n return arguments.length ? (handleSize = +_, brush) : handleSize;\n };\n\n brush.keyModifiers = function(_) {\n return arguments.length ? (keys = !!_, brush) : keys;\n };\n\n brush.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? brush : value;\n };\n\n return brush;\n}\n","export var cos = Math.cos;\nexport var sin = Math.sin;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var tau = pi * 2;\nexport var max = Math.max;\n","export var slice = Array.prototype.slice;\n","import {range} from \"d3-array\";\nimport {max, tau} from \"./math\";\n\nfunction compareValue(compare) {\n return function(a, b) {\n return compare(\n a.source.value + a.target.value,\n b.source.value + b.target.value\n );\n };\n}\n\nexport default function() {\n var padAngle = 0,\n sortGroups = null,\n sortSubgroups = null,\n sortChords = null;\n\n function chord(matrix) {\n var n = matrix.length,\n groupSums = [],\n groupIndex = range(n),\n subgroupIndex = [],\n chords = [],\n groups = chords.groups = new Array(n),\n subgroups = new Array(n * n),\n k,\n x,\n x0,\n dx,\n i,\n j;\n\n // Compute the sum.\n k = 0, i = -1; while (++i < n) {\n x = 0, j = -1; while (++j < n) {\n x += matrix[i][j];\n }\n groupSums.push(x);\n subgroupIndex.push(range(n));\n k += x;\n }\n\n // Sort groups…\n if (sortGroups) groupIndex.sort(function(a, b) {\n return sortGroups(groupSums[a], groupSums[b]);\n });\n\n // Sort subgroups…\n if (sortSubgroups) subgroupIndex.forEach(function(d, i) {\n d.sort(function(a, b) {\n return sortSubgroups(matrix[i][a], matrix[i][b]);\n });\n });\n\n // Convert the sum to scaling factor for [0, 2pi].\n // TODO Allow start and end angle to be specified?\n // TODO Allow padding to be specified as percentage?\n k = max(0, tau - padAngle * n) / k;\n dx = k ? padAngle : tau / n;\n\n // Compute the start and end angle for each group and subgroup.\n // Note: Opera has a bug reordering object literal properties!\n x = 0, i = -1; while (++i < n) {\n x0 = x, j = -1; while (++j < n) {\n var di = groupIndex[i],\n dj = subgroupIndex[di][j],\n v = matrix[di][dj],\n a0 = x,\n a1 = x += v * k;\n subgroups[dj * n + di] = {\n index: di,\n subindex: dj,\n startAngle: a0,\n endAngle: a1,\n value: v\n };\n }\n groups[di] = {\n index: di,\n startAngle: x0,\n endAngle: x,\n value: groupSums[di]\n };\n x += dx;\n }\n\n // Generate chords for each (non-empty) subgroup-subgroup link.\n i = -1; while (++i < n) {\n j = i - 1; while (++j < n) {\n var source = subgroups[j * n + i],\n target = subgroups[i * n + j];\n if (source.value || target.value) {\n chords.push(source.value < target.value\n ? {source: target, target: source}\n : {source: source, target: target});\n }\n }\n }\n\n return sortChords ? chords.sort(sortChords) : chords;\n }\n\n chord.padAngle = function(_) {\n return arguments.length ? (padAngle = max(0, _), chord) : padAngle;\n };\n\n chord.sortGroups = function(_) {\n return arguments.length ? (sortGroups = _, chord) : sortGroups;\n };\n\n chord.sortSubgroups = function(_) {\n return arguments.length ? (sortSubgroups = _, chord) : sortSubgroups;\n };\n\n chord.sortChords = function(_) {\n return arguments.length ? (_ == null ? sortChords = null : (sortChords = compareValue(_))._ = _, chord) : sortChords && sortChords._;\n };\n\n return chord;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","import {slice} from \"./array\";\nimport constant from \"./constant\";\nimport {cos, halfPi, sin} from \"./math\";\nimport {path} from \"d3-path\";\n\nfunction defaultSource(d) {\n return d.source;\n}\n\nfunction defaultTarget(d) {\n return d.target;\n}\n\nfunction defaultRadius(d) {\n return d.radius;\n}\n\nfunction defaultStartAngle(d) {\n return d.startAngle;\n}\n\nfunction defaultEndAngle(d) {\n return d.endAngle;\n}\n\nexport default function() {\n var source = defaultSource,\n target = defaultTarget,\n radius = defaultRadius,\n startAngle = defaultStartAngle,\n endAngle = defaultEndAngle,\n context = null;\n\n function ribbon() {\n var buffer,\n argv = slice.call(arguments),\n s = source.apply(this, argv),\n t = target.apply(this, argv),\n sr = +radius.apply(this, (argv[0] = s, argv)),\n sa0 = startAngle.apply(this, argv) - halfPi,\n sa1 = endAngle.apply(this, argv) - halfPi,\n sx0 = sr * cos(sa0),\n sy0 = sr * sin(sa0),\n tr = +radius.apply(this, (argv[0] = t, argv)),\n ta0 = startAngle.apply(this, argv) - halfPi,\n ta1 = endAngle.apply(this, argv) - halfPi;\n\n if (!context) context = buffer = path();\n\n context.moveTo(sx0, sy0);\n context.arc(0, 0, sr, sa0, sa1);\n if (sa0 !== ta0 || sa1 !== ta1) { // TODO sr !== tr?\n context.quadraticCurveTo(0, 0, tr * cos(ta0), tr * sin(ta0));\n context.arc(0, 0, tr, ta0, ta1);\n }\n context.quadraticCurveTo(0, 0, sx0, sy0);\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n ribbon.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), ribbon) : radius;\n };\n\n ribbon.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), ribbon) : startAngle;\n };\n\n ribbon.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), ribbon) : endAngle;\n };\n\n ribbon.source = function(_) {\n return arguments.length ? (source = _, ribbon) : source;\n };\n\n ribbon.target = function(_) {\n return arguments.length ? (target = _, ribbon) : target;\n };\n\n ribbon.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), ribbon) : context;\n };\n\n return ribbon;\n}\n","export var prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\nexport default map;\n","import {default as map, prefix} from \"./map\";\n\nfunction Set() {}\n\nvar proto = map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\nexport default set;\n","var array = Array.prototype;\n\nexport var slice = array.slice;\n","export default function(d) {\n var x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {map} from \"d3-collection\";\nimport {timer} from \"d3-timer\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\");\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.each(function (force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.each(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.remove(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","export default function(x) {\n return x;\n}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","// Adds floating point numbers wi