var t="http://www.w3.org/1999/xhtml";var e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(t){var n=t+="",r=n.indexOf(":");r>=0&&"xmlns"!==(n=t.slice(0,r))&&(t=t.slice(r+1));return e.hasOwnProperty(n)?{space:e[n],local:t}:t}function creatorInherit(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===t&&n.documentElement.namespaceURI===t?n.createElement(e):n.createElementNS(r,e)}}function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function creator(t){var e=namespace(t);return(e.local?creatorFixed:creatorInherit)(e)}function none(){}function selector(t){return null==t?none:function(){return this.querySelector(t)}}function selection_select(t){"function"!==typeof t&&(t=selector(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=A&&(A=w+1);while(!(g=y[A])&&++A<_);v._next=g||null}}s=new Selection(s,r);s._enter=c;s._exit=l;return s}function arraylike(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function selection_exit(){return new Selection(this._exit||this._groups.map(sparse),this._parents)}function selection_join(t,e,n){var r=this.enter(),i=this,o=this.exit();if("function"===typeof t){r=t(r);r&&(r=r.selection())}else r=r.append(t+"");if(null!=e){i=e(i);i&&(i=i.selection())}null==n?o.remove():n(o);return r&&i?r.merge(i).order():i}function selection_merge(t){var e=t.selection?t.selection():t;for(var n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),c=new Array(i),l=0;l=0;)if(r=i[o]){s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s);s=r}return this}function selection_sort(t){t||(t=ascending);function compareNode(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}for(var e=this._groups,n=e.length,r=new Array(n),i=0;ie?1:t>=e?0:NaN}function selection_call(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this}function selection_nodes(){return Array.from(this)}function selection_node(){for(var t=this._groups,e=0,n=t.length;e1?this.each((null==e?styleRemove:"function"===typeof e?styleFunction:styleConstant)(t,e,null==n?"":n)):styleValue(this.node(),t)}function styleValue(t,e){return t.style.getPropertyValue(e)||defaultView(t).getComputedStyle(t,null).getPropertyValue(e)}function propertyRemove(t){return function(){delete this[t]}}function propertyConstant(t,e){return function(){this[t]=e}}function propertyFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function selection_property(t,e){return arguments.length>1?this.each((null==e?propertyRemove:"function"===typeof e?propertyFunction:propertyConstant)(t,e)):this.node()[t]}function classArray(t){return t.trim().split(/^|\s+/)}function classList(t){return t.classList||new ClassList(t)}function ClassList(t){this._node=t;this._names=classArray(t.getAttribute("class")||"")}ClassList.prototype={add:function(t){var e=this._names.indexOf(t);if(e<0){this._names.push(t);this._node.setAttribute("class",this._names.join(" "))}},remove:function(t){var e=this._names.indexOf(t);if(e>=0){this._names.splice(e,1);this._node.setAttribute("class",this._names.join(" "))}},contains:function(t){return this._names.indexOf(t)>=0}};function classedAdd(t,e){var n=classList(t),r=-1,i=e.length;while(++r=0&&(e=t.slice(n+1),t=t.slice(0,n));return{type:t,name:e}}))}function onRemove(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;rpointer(t,e)))}function selectAll(t){return"string"===typeof t?new Selection([document.querySelectorAll(t)],[document.documentElement]):new Selection([array(t)],i)}export{create,creator,local,matcher,namespace,e as namespaces,pointer,pointers,select,selectAll,selection,selector,selectorAll,styleValue as style,defaultView as window};