blob: a1dff2fb91a3d3e568bb1cdde6478a3e60fcc337 [file] [log] [blame] [edit]
/*! nvd3 - v0.0.1 - 2023-09-13 */!function(){function a(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function b(a,b){return new Date(b,a+1,0).getDate()}function c(a,b,c){return function(d,e,f){var g=a(d),h=[];if(d>g&&b(g),f>1)for(;e>g;){var i=new Date(+g);c(i)%f===0&&h.push(i),b(g)}else for(;e>g;)h.push(new Date(+g)),b(g);return h}}var e=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};!function(a,b){"object"===("undefined"==typeof exports?"undefined":f(exports))&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a="undefined"!=typeof globalThis?globalThis:a||self,a.DOMPurify=b())}(void 0,function(){function b(a){return function(b){for(var c=arguments.length,d=new Array(c>1?c-1:0),e=1;c>e;e++)d[e-1]=arguments[e];return s(a,b,d)}}function c(a){return function(){for(var b=arguments.length,c=new Array(b),d=0;b>d;d++)c[d]=arguments[d];return t(a,c)}}function d(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x;k&&k(a,null);for(var d=b.length;d--;){var e=b[d];if("string"==typeof e){var f=c(e);f!==e&&(l(b)||(b[d]=f),e=f)}a[e]=!0}return a}function g(a){var b=q(null),c=!0,d=!1,f=void 0;try{for(var g,h=j(a)[Symbol.iterator]();!(c=(g=h.next()).done);c=!0){var i=g.value,k=e(i,2),l=k[0],m=k[1];b[l]=m}}catch(n){d=!0,f=n}finally{try{!c&&h["return"]&&h["return"]()}finally{if(d)throw f}}return b}function h(a,c){function d(a){return console.warn("fallback value for",a),null}for(;null!==a;){var e=n(a,c);if(e){if(e.get)return b(e.get);if("function"==typeof e.value)return b(e.value)}a=m(a)}return d}function i(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$(),c=function(a){return i(a)};if(c.version="3.0.5",c.removed=[],!b||!b.document||9!==b.document.nodeType)return c.isSupported=!1,c;var e=b.document,k=e,l=k.currentScript,m=b.DocumentFragment,n=b.HTMLTemplateElement,p=b.Node,r=b.Element,s=b.NodeFilter,t=b.NamedNodeMap,Q=void 0===t?b.NamedNodeMap||b.MozNamedAttrMap:t,R=b.HTMLFormElement,S=b.DOMParser,T=b.trustedTypes,U=r.prototype,W=h(U,"cloneNode"),X=h(U,"nextSibling"),aa=h(U,"childNodes"),ba=h(U,"parentNode");if("function"==typeof n){var ca=e.createElement("template");ca.content&&ca.content.ownerDocument&&(e=ca.content.ownerDocument)}var da=void 0,ea="",fa=e,ga=fa.implementation,ha=fa.createNodeIterator,ia=fa.createDocumentFragment,ja=fa.getElementsByTagName,ka=k.importNode,la={};c.isSupported="function"==typeof j&&"function"==typeof ba&&ga&&void 0!==ga.createHTMLDocument;var ma=Z.MUSTACHE_EXPR,na=Z.ERB_EXPR,oa=Z.TMPLIT_EXPR,pa=Z.DATA_ATTR,qa=Z.ARIA_ATTR,ra=Z.IS_SCRIPT_OR_DATA,sa=Z.ATTR_WHITESPACE,ta=Z.IS_ALLOWED_URI,ua=null,va=d({},[].concat(a(F),a(G),a(H),a(J),a(L))),wa=null,xa=d({},[].concat(a(M),a(N),a(O),a(P))),ya=Object.seal(q(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),za=null,Aa=null,Ba=!0,Ca=!0,Da=!1,Ea=!0,Fa=!1,Ga=!1,Ha=!1,Ia=!1,Ja=!1,Ka=!1,La=!1,Ma=!0,Na=!1,Oa="user-content-",Pa=!0,Qa=!1,Ra={},Sa=null,Ta=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ua=null,Va=d({},["audio","video","img","source","image","track"]),Wa=null,Xa=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ya="http://www.w3.org/1998/Math/MathML",Za="http://www.w3.org/2000/svg",$a="http://www.w3.org/1999/xhtml",_a=$a,ab=!1,bb=null,cb=d({},[Ya,Za,$a],y),db=null,eb=["application/xhtml+xml","text/html"],fb="text/html",gb=null,hb=null,ib=e.createElement("form"),jb=function(a){return a instanceof RegExp||a instanceof Function},kb=function(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!hb||hb!==b){if(b&&"object"===("undefined"==typeof b?"undefined":f(b))||(b={}),b=g(b),db=db=-1===eb.indexOf(b.PARSER_MEDIA_TYPE)?fb:b.PARSER_MEDIA_TYPE,gb="application/xhtml+xml"===db?y:x,ua="ALLOWED_TAGS"in b?d({},b.ALLOWED_TAGS,gb):va,wa="ALLOWED_ATTR"in b?d({},b.ALLOWED_ATTR,gb):xa,bb="ALLOWED_NAMESPACES"in b?d({},b.ALLOWED_NAMESPACES,y):cb,Wa="ADD_URI_SAFE_ATTR"in b?d(g(Xa),b.ADD_URI_SAFE_ATTR,gb):Xa,Ua="ADD_DATA_URI_TAGS"in b?d(g(Va),b.ADD_DATA_URI_TAGS,gb):Va,Sa="FORBID_CONTENTS"in b?d({},b.FORBID_CONTENTS,gb):Ta,za="FORBID_TAGS"in b?d({},b.FORBID_TAGS,gb):{},Aa="FORBID_ATTR"in b?d({},b.FORBID_ATTR,gb):{},Ra="USE_PROFILES"in b?b.USE_PROFILES:!1,Ba=b.ALLOW_ARIA_ATTR!==!1,Ca=b.ALLOW_DATA_ATTR!==!1,Da=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Ea=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fa=b.SAFE_FOR_TEMPLATES||!1,Ga=b.WHOLE_DOCUMENT||!1,Ja=b.RETURN_DOM||!1,Ka=b.RETURN_DOM_FRAGMENT||!1,La=b.RETURN_TRUSTED_TYPE||!1,Ia=b.FORCE_BODY||!1,Ma=b.SANITIZE_DOM!==!1,Na=b.SANITIZE_NAMED_PROPS||!1,Pa=b.KEEP_CONTENT!==!1,Qa=b.IN_PLACE||!1,ta=b.ALLOWED_URI_REGEXP||V,_a=b.NAMESPACE||$a,ya=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&jb(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ya.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&jb(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ya.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ya.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fa&&(Ca=!1),Ka&&(Ja=!0),Ra&&(ua=d({},[].concat(a(L))),wa=[],Ra.html===!0&&(d(ua,F),d(wa,M)),Ra.svg===!0&&(d(ua,G),d(wa,N),d(wa,P)),Ra.svgFilters===!0&&(d(ua,H),d(wa,N),d(wa,P)),Ra.mathMl===!0&&(d(ua,J),d(wa,O),d(wa,P))),b.ADD_TAGS&&(ua===va&&(ua=g(ua)),d(ua,b.ADD_TAGS,gb)),b.ADD_ATTR&&(wa===xa&&(wa=g(wa)),d(wa,b.ADD_ATTR,gb)),b.ADD_URI_SAFE_ATTR&&d(Wa,b.ADD_URI_SAFE_ATTR,gb),b.FORBID_CONTENTS&&(Sa===Ta&&(Sa=g(Sa)),d(Sa,b.FORBID_CONTENTS,gb)),Pa&&(ua["#text"]=!0),Ga&&d(ua,["html","head","body"]),ua.table&&(d(ua,["tbody"]),delete za.tbody),b.TRUSTED_TYPES_POLICY){if("function"!=typeof b.TRUSTED_TYPES_POLICY.createHTML)throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof b.TRUSTED_TYPES_POLICY.createScriptURL)throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');da=b.TRUSTED_TYPES_POLICY,ea=da.createHTML("")}else void 0===da&&(da=_(T,l)),null!==da&&"string"==typeof ea&&(ea=da.createHTML(""));o&&o(b),hb=b}},lb=d({},["mi","mo","mn","ms","mtext"]),mb=d({},["foreignobject","desc","title","annotation-xml"]),nb=d({},["title","style","font","a","script"]),ob=d({},G);d(ob,H),d(ob,I);var pb=d({},J);d(pb,K);var qb=function(a){var b=ba(a);b&&b.tagName||(b={namespaceURI:_a,tagName:"template"});var c=x(a.tagName),d=x(b.tagName);return bb[a.namespaceURI]?a.namespaceURI===Za?b.namespaceURI===$a?"svg"===c:b.namespaceURI===Ya?"svg"===c&&("annotation-xml"===d||lb[d]):Boolean(ob[c]):a.namespaceURI===Ya?b.namespaceURI===$a?"math"===c:b.namespaceURI===Za?"math"===c&&mb[d]:Boolean(pb[c]):a.namespaceURI===$a?(b.namespaceURI!==Za||mb[d])&&(b.namespaceURI!==Ya||lb[d])?!pb[c]&&(nb[c]||!ob[c]):!1:"application/xhtml+xml"===db&&bb[a.namespaceURI]?!0:!1:!1},rb=function(a){w(c.removed,{element:a});try{a.parentNode.removeChild(a)}catch(b){a.remove()}},sb=function(a,b){try{w(c.removed,{attribute:b.getAttributeNode(a),from:b})}catch(d){w(c.removed,{attribute:null,from:b})}if(b.removeAttribute(a),"is"===a&&!wa[a])if(Ja||Ka)try{rb(b)}catch(d){}else try{b.setAttribute(a,"")}catch(d){}},tb=function(a){var b=null,c=null;if(Ia)a="<remove></remove>"+a;else{var d=z(a,/^[\r\n\t ]+/);c=d&&d[0]}"application/xhtml+xml"===db&&_a===$a&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");var f=da?da.createHTML(a):a;if(_a===$a)try{b=(new S).parseFromString(f,db)}catch(g){}if(!b||!b.documentElement){b=ga.createDocument(_a,"template",null);try{b.documentElement.innerHTML=ab?ea:f}catch(g){}}var h=b.body||b.documentElement;return a&&c&&h.insertBefore(e.createTextNode(c),h.childNodes[0]||null),_a===$a?ja.call(b,Ga?"html":"body")[0]:Ga?b.documentElement:h},ub=function(a){return ha.call(a.ownerDocument||a,a,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null)},vb=function(a){return a instanceof R&&("string"!=typeof a.nodeName||"string"!=typeof a.textContent||"function"!=typeof a.removeChild||!(a.attributes instanceof Q)||"function"!=typeof a.removeAttribute||"function"!=typeof a.setAttribute||"string"!=typeof a.namespaceURI||"function"!=typeof a.insertBefore||"function"!=typeof a.hasChildNodes)},wb=function(a){return"function"==typeof p&&a instanceof p},xb=function(a,b,d){la[a]&&u(la[a],function(a){a.call(c,b,d,hb)})},yb=function(a){var b=null;if(xb("beforeSanitizeElements",a,null),vb(a))return rb(a),!0;var d=gb(a.nodeName);if(xb("uponSanitizeElement",a,{tagName:d,allowedTags:ua}),a.hasChildNodes()&&!wb(a.firstElementChild)&&D(/<[/\w]/g,a.innerHTML)&&D(/<[/\w]/g,a.textContent))return rb(a),!0;if(!ua[d]||za[d]){if(!za[d]&&Ab(d)){if(ya.tagNameCheck instanceof RegExp&&D(ya.tagNameCheck,d))return!1;if(ya.tagNameCheck instanceof Function&&ya.tagNameCheck(d))return!1}if(Pa&&!Sa[d]){var e=ba(a)||a.parentNode,f=aa(a)||a.childNodes;if(f&&e)for(var g=f.length,h=g-1;h>=0;--h)e.insertBefore(W(f[h],!0),X(a))}return rb(a),!0}return a instanceof r&&!qb(a)?(rb(a),!0):"noscript"!==d&&"noembed"!==d&&"noframes"!==d||!D(/<\/no(script|embed|frames)/i,a.innerHTML)?(Fa&&3===a.nodeType&&(b=a.textContent,u([ma,na,oa],function(a){b=A(b,a," ")}),a.textContent!==b&&(w(c.removed,{element:a.cloneNode()}),a.textContent=b)),xb("afterSanitizeElements",a,null),!1):(rb(a),!0)},zb=function(a,b,c){if(Ma&&("id"===b||"name"===b)&&(c in e||c in ib))return!1;if(Ca&&!Aa[b]&&D(pa,b));else if(Ba&&D(qa,b));else if(!wa[b]||Aa[b]){if(!(Ab(a)&&(ya.tagNameCheck instanceof RegExp&&D(ya.tagNameCheck,a)||ya.tagNameCheck instanceof Function&&ya.tagNameCheck(a))&&(ya.attributeNameCheck instanceof RegExp&&D(ya.attributeNameCheck,b)||ya.attributeNameCheck instanceof Function&&ya.attributeNameCheck(b))||"is"===b&&ya.allowCustomizedBuiltInElements&&(ya.tagNameCheck instanceof RegExp&&D(ya.tagNameCheck,c)||ya.tagNameCheck instanceof Function&&ya.tagNameCheck(c))))return!1}else if(Wa[b]);else if(D(ta,A(c,sa,"")));else if("src"!==b&&"xlink:href"!==b&&"href"!==b||"script"===a||0!==B(c,"data:")||!Ua[a]){if(Da&&!D(ra,A(c,sa,"")));else if(c)return!1}else;return!0},Ab=function(a){return a.indexOf("-")>0},Bb=function(a){xb("beforeSanitizeAttributes",a,null);var b=a.attributes;if(b){for(var d={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:wa},e=b.length,g=function(){var g=b[e],h=g.name,i=g.namespaceURI,j=g.value,k=gb(h),l="value"===h?j:C(j);if(d.attrName=k,d.attrValue=l,d.keepAttr=!0,d.forceKeepAttr=void 0,xb("uponSanitizeAttribute",a,d),l=d.attrValue,d.forceKeepAttr)return"continue";if(sb(h,a),!d.keepAttr)return"continue";if(!Ea&&D(/\/>/i,l))return sb(h,a),"continue";Fa&&u([ma,na,oa],function(a){l=A(l,a," ")});var m=gb(a.nodeName);if(!zb(m,k,l))return"continue";if(!Na||"id"!==k&&"name"!==k||(sb(h,a),l=Oa+l),da&&"object"===("undefined"==typeof T?"undefined":f(T))&&"function"==typeof T.getAttributeType)if(i);else switch(T.getAttributeType(m,k)){case"TrustedHTML":l=da.createHTML(l);break;case"TrustedScriptURL":l=da.createScriptURL(l)}try{i?a.setAttributeNS(i,h,l):a.setAttribute(h,l),v(c.removed)}catch(n){}};e--;){g()}xb("afterSanitizeAttributes",a,null)}},Cb=function Db(a){var b=null,c=ub(a);for(xb("beforeSanitizeShadowDOM",a,null);b=c.nextNode();)xb("uponSanitizeShadowNode",b,null),yb(b)||(b.content instanceof m&&Db(b.content),Bb(b));xb("afterSanitizeShadowDOM",a,null)};return c.sanitize=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=null,e=null,f=null,g=null;if(ab=!a,ab&&(a="<!-->"),"string"!=typeof a&&!wb(a)){if("function"!=typeof a.toString)throw E("toString is not a function");if(a=a.toString(),"string"!=typeof a)throw E("dirty is not a string, aborting")}if(!c.isSupported)return a;if(Ha||kb(b),c.removed=[],"string"==typeof a&&(Qa=!1),Qa){if(a.nodeName){var h=gb(a.nodeName);if(!ua[h]||za[h])throw E("root node is forbidden and cannot be sanitized in-place")}}else if(a instanceof p)d=tb("<!---->"),e=d.ownerDocument.importNode(a,!0),1===e.nodeType&&"BODY"===e.nodeName?d=e:"HTML"===e.nodeName?d=e:d.appendChild(e);else{if(!Ja&&!Fa&&!Ga&&-1===a.indexOf("<"))return da&&La?da.createHTML(a):a;if(d=tb(a),!d)return Ja?null:La?ea:""}d&&Ia&&rb(d.firstChild);for(var i=ub(Qa?a:d);f=i.nextNode();)yb(f)||(f.content instanceof m&&Cb(f.content),Bb(f));if(Qa)return a;if(Ja){if(Ka)for(g=ia.call(d.ownerDocument);d.firstChild;)g.appendChild(d.firstChild);else g=d;return(wa.shadowroot||wa.shadowrootmode)&&(g=ka.call(k,g,!0)),g}var j=Ga?d.outerHTML:d.innerHTML;return Ga&&ua["!doctype"]&&d.ownerDocument&&d.ownerDocument.doctype&&d.ownerDocument.doctype.name&&D(Y,d.ownerDocument.doctype.name)&&(j="<!DOCTYPE "+d.ownerDocument.doctype.name+">\n"+j),Fa&&u([ma,na,oa],function(a){j=A(j,a," ")}),da&&La?da.createHTML(j):j},c.setConfig=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};kb(a),Ha=!0},c.clearConfig=function(){hb=null,Ha=!1},c.isValidAttribute=function(a,b,c){hb||kb({});var d=gb(a),e=gb(b);return zb(d,e,c)},c.addHook=function(a,b){"function"==typeof b&&(la[a]=la[a]||[],w(la[a],b))},c.removeHook=function(a){return la[a]?v(la[a]):void 0},c.removeHooks=function(a){la[a]&&(la[a]=[])},c.removeAllHooks=function(){la={}},c}var j=Object.entries,k=Object.setPrototypeOf,l=Object.isFrozen,m=Object.getPrototypeOf,n=Object.getOwnPropertyDescriptor,o=Object.freeze,p=Object.seal,q=Object.create,r="undefined"!=typeof Reflect&&Reflect,s=r.apply,t=r.construct;o||(o=function(a){return a}),p||(p=function(a){return a}),s||(s=function(a,b,c){return a.apply(b,c)}),t||(t=function(b,c){return new(Function.prototype.bind.apply(b,[null].concat(a(c))))});var u=b(Array.prototype.forEach),v=b(Array.prototype.pop),w=b(Array.prototype.push),x=b(String.prototype.toLowerCase),y=b(String.prototype.toString),z=b(String.prototype.match),A=b(String.prototype.replace),B=b(String.prototype.indexOf),C=b(String.prototype.trim),D=b(RegExp.prototype.test),E=c(TypeError),F=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),G=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),H=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),J=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),K=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),L=o(["#text"]),M=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),O=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),P=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Q=p(/\{\{[\w\W]*|[\w\W]*\}\}/gm),R=p(/<%[\w\W]*|[\w\W]*%>/gm),S=p(/\${[\w\W]*}/gm),T=p(/^data-[\-\w.\u00B7-\uFFFF]/),U=p(/^aria-[\-\w]+$/),V=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=p(/^(?:\w+script|data):/i),X=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=p(/^html$/i),Z=Object.freeze({__proto__:null,MUSTACHE_EXPR:Q,ERB_EXPR:R,TMPLIT_EXPR:S,DATA_ATTR:T,ARIA_ATTR:U,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:X,DOCTYPE_NAME:Y}),$=function(){return"undefined"==typeof window?null:window},_=function(a,b){if("object"!==("undefined"==typeof a?"undefined":f(a))||"function"!=typeof a.createPolicy)return null;var c=null,d="data-tt-policy-suffix";b&&b.hasAttribute(d)&&(c=b.getAttribute(d));var e="dompurify"+(c?"#"+c:"");try{return a.createPolicy(e,{createHTML:function(a){return a},createScriptURL:function(a){return a}})}catch(g){return console.warn("TrustedTypes policy "+e+" could not be created."),null}},aa=i();return aa});var g=window.nv||{};g.version="1.1.15b",g.dev=!0,window.nv=g,g.tooltip=g.tooltip||{},g.utils=g.utils||{},g.models=g.models||{},g.charts={},g.graphs=[],g.logs={},g.dispatch=d3.dispatch("render_start","render_end"),g.dev&&(g.dispatch.on("render_start",function(a){g.logs.startTime=+new Date}),g.dispatch.on("render_end",function(a){g.logs.endTime=+new Date,g.logs.totalTime=g.logs.endTime-g.logs.startTime,g.log("total",g.logs.totalTime)})),g.log=function(){if(g.dev&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(g.dev&&"function"==typeof console.log&&Function.prototype.bind){var a=Function.prototype.bind.call(console.log,console);a.apply(console,arguments)}return arguments[arguments.length-1]},g.render=function(a){a=a||1,g.render.active=!0,g.dispatch.render_start(),setTimeout(function(){for(var b,c,d=0;a>d&&(c=g.render.queue[d]);d++)b=c.generate(),typeof c.callback==typeof Function&&c.callback(b),g.graphs.push(b);g.render.queue.splice(0,d),g.render.queue.length?setTimeout(arguments.callee,0):(g.dispatch.render_end(),g.render.active=!1)},0)},g.render.active=!1,g.render.queue=[],g.addGraph=function(a){typeof arguments[0]==typeof Function&&(a={generate:arguments[0],callback:arguments[1]}),g.render.queue.push(a),g.render.active||g.render()},g.identity=function(a){return a},g.strip=function(a){return a.replace(/(\s|&)/g,"")},d3.time.monthEnd=function(a){return new Date(a.getFullYear(),a.getMonth(),0)},d3.time.monthEnds=c(d3.time.monthEnd,function(a){a.setUTCDate(a.getUTCDate()+1),a.setDate(b(a.getMonth()+1,a.getFullYear()))},function(a){return a.getMonth()}),g.interactiveGuideline=function(){function a(l){l.each(function(l){function m(){var c=d3.mouse(this),d=c[0],g=c[1],i=!0,j=!1;if(k&&(d=d3.event.offsetX,g=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(i=!1),d3.event.target.className.baseVal.match("nv-legend")&&(j=!0)),i&&(d-=e.left,g-=e.top),0>d||0>g||d>o||g>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||j){if(k&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&d3.event.relatedTarget.className.match(b.nvPointerEventsClass))return;return h.elementMouseout({mouseX:d,mouseY:g}),void a.renderGuideLine(null)}var l=f.invert(d);h.elementMousemove({mouseX:d,mouseY:g,pointXValue:l}),"dblclick"===d3.event.type&&h.elementDblclick({mouseX:d,mouseY:g,pointXValue:l})}var n=d3.select(this),o=c||960,p=d||400,q=n.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([l]),r=q.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");r.append("g").attr("class","nv-interactiveGuideLine"),j&&(j.on("mousemove",m,!0).on("mouseout",m,!0).on("dblclick",m),a.renderGuideLine=function(a){if(i){var b=q.select(".nv-interactiveGuideLine").selectAll("line").data(null!=a?[g.utils.NaNtoZero(a)]:[],String);b.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",p).attr("y2",0),b.exit().remove()}})})}var b=g.models.tooltip(),c=null,d=null,e={left:0,top:0},f=d3.scale.linear(),h=(d3.scale.linear(),d3.dispatch("elementMousemove","elementMouseout","elementDblclick")),i=!0,j=null,k=-1!==navigator.userAgent.indexOf("MSIE");return a.dispatch=h,a.tooltip=b,a.margin=function(b){return arguments.length?(e.top="undefined"!=typeof b.top?b.top:e.top,e.left="undefined"!=typeof b.left?b.left:e.left,a):e},a.width=function(b){return arguments.length?(c=b,a):c},a.height=function(b){return arguments.length?(d=b,a):d},a.xScale=function(b){return arguments.length?(f=b,a):f},a.showGuideLine=function(b){return arguments.length?(i=b,a):i},a.svgContainer=function(b){return arguments.length?(j=b,a):j},a},g.interactiveBisect=function(a,b,c){if(!a instanceof Array)return null;"function"!=typeof c&&(c=function(a,b){return a.x});var d=d3.bisector(c).left,e=d3.max([0,d(a,b)-1]),f=c(a[e],e);if("undefined"==typeof f&&(f=e),f===b)return e;var g=d3.min([e+1,a.length-1]),h=c(a[g],g);return"undefined"==typeof h&&(h=g),Math.abs(h-b)>=Math.abs(f-b)?e:g},g.nearestValueIndex=function(a,b,c){var d=1/0,e=null;return a.forEach(function(a,f){var g=Math.abs(b-a);d>=g&&c>g&&(d=g,e=f)}),e},function(){window.nv.tooltip={},window.nv.models.tooltip=function(){function a(){if(l){var a=d3.select(l);"svg"!==a.node().tagName&&(a=a.select("svg"));var b=a.node()?a.attr("viewBox"):null;if(b){b=b.split(" ");var c=parseInt(a.style("width"))/b[2];n.left=n.left*c,n.top=n.top*c}}}function b(a){var b;b=l?d3.select(l):d3.select("body");var c=b.select(".nvtooltip");return null===c.node()&&(c=b.append("div").attr("class","nvtooltip "+(k?k:"xy-tooltip")).attr("id",p)),c.node().innerHTML=a,c.style("top",0).style("left",0).style("opacity",0),c.selectAll("div, table, td, tr").classed(q,!0),c.classed(q,!0),c.node()}function c(){if(o&&u(e)){a();var d=n.left,k=null!=j?j:n.top,p=b(t(e));if(m=p,l){var q=l.getElementsByTagName("svg")[0],r=(q?q.getBoundingClientRect():l.getBoundingClientRect(),{left:0,top:0});if(q){var s=q.getBoundingClientRect(),v=l.getBoundingClientRect(),w=s.top;if(0>w){var x=l.getBoundingClientRect();w=Math.abs(w)>x.height?0:w}r.top=Math.abs(w-v.top),r.left=Math.abs(s.left-v.left)}d+=l.offsetLeft+r.left-2*l.scrollLeft,k+=l.offsetTop+r.top-2*l.scrollTop}return i&&i>0&&(k=Math.floor(k/i)*i),g.tooltip.calcTooltipPosition([d,k],f,h,p),c}}var d=null,e=null,f="w",h=50,i=25,j=null,k=null,l=null,m=null,n={left:null,top:null},o=!0,p="nvtooltip-"+Math.floor(1e5*Math.random()),q="nv-pointer-events-none",r=function(a,b){return a},s=function(a){return a},t=function(a){if(null!=d)return d;if(null==a)return"";var b=d3.select(document.createElement("table")),c=b.selectAll("thead").data([a]).enter().append("thead");c.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(s(a.value));var e=b.selectAll("tbody").data([a]).enter().append("tbody"),f=e.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight});f.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),f.append("td").classed("key",!0).html(function(a){return a.key}),f.append("td").classed("value",!0).html(function(a,b){return r(a.value,b)}),f.selectAll("td").each(function(a){if(a.highlight){var b=d3.scale.linear().domain([0,1]).range(["#fff",a.color]),c=.6;d3.select(this).style("border-bottom-color",b(c)).style("border-top-color",b(c))}});var g=b.node().outerHTML;return void 0!==a.footer&&(g+="<div class='footer'>"+a.footer+"</div>"),g},u=function(a){return a&&a.series&&a.series.length>0?!0:!1};return c.nvPointerEventsClass=q,c.content=function(a){return arguments.length?(d=a,c):d},c.tooltipElem=function(){return m},c.contentGenerator=function(a){return arguments.length?("function"==typeof a&&(t=a),c):t},c.data=function(a){return arguments.length?(e=a,c):e},c.gravity=function(a){return arguments.length?(f=a,c):f},c.distance=function(a){return arguments.length?(h=a,c):h},c.snapDistance=function(a){return arguments.length?(i=a,c):i},c.classes=function(a){return arguments.length?(k=a,c):k},c.chartContainer=function(a){return arguments.length?(l=a,c):l},c.position=function(a){return arguments.length?(n.left="undefined"!=typeof a.left?a.left:n.left,n.top="undefined"!=typeof a.top?a.top:n.top,c):n},c.fixedTop=function(a){return arguments.length?(j=a,c):j},c.enabled=function(a){return arguments.length?(o=a,c):o},c.valueFormatter=function(a){return arguments.length?("function"==typeof a&&(r=a),c):r},c.headerFormatter=function(a){return arguments.length?("function"==typeof a&&(s=a),c):s},c.id=function(){return p},c},g.tooltip.show=function(a,b,c,d,e,f){var h=document.createElement("div");h.className="nvtooltip "+(f?f:"xy-tooltip");var i=e;(!e||e.tagName.match(/g|svg/i))&&(i=document.getElementsByTagName("body")[0]),h.style.left=0,h.style.top=0,h.style.opacity=0;var j=DOMPurify.sanitize(b,{RETURN_TRUSTED_TYPE:!0});h.innerHTML=j,i.appendChild(h),e&&(a[0]=a[0]-e.scrollLeft,a[1]=a[1]-e.scrollTop),g.tooltip.calcTooltipPosition(a,c,d,h)},g.tooltip.findFirstNonSVGParent=function(a){for(;null!==a.tagName.match(/^g|svg$/i);)a=a.parentNode;return a},g.tooltip.findTotalOffsetTop=function(a,b){var c=b;do isNaN(a.offsetTop)||(c+=a.offsetTop);while(a=a.offsetParent);return c},g.tooltip.findTotalOffsetLeft=function(a,b){var c=b;do isNaN(a.offsetLeft)||(c+=a.offsetLeft);while(a=a.offsetParent);return c},g.tooltip.calcTooltipPosition=function(a,b,c,d){var e,f,h=parseInt(d.offsetHeight),i=parseInt(d.offsetWidth),j=g.utils.windowSize().width,k=g.utils.windowSize().height,l=window.pageYOffset,m=window.pageXOffset;k=window.innerWidth>=document.body.scrollWidth?k:k-16,j=window.innerHeight>=document.body.scrollHeight?j:j-16,b=b||"s",c=c||20;var n=function(a){return g.tooltip.findTotalOffsetTop(a,f)},o=function(a){return g.tooltip.findTotalOffsetLeft(a,e)};switch(b){case"e":e=a[0]-i-c,f=a[1]-h/2;var p=o(d),q=n(d);m>p&&(e=a[0]+c>m?a[0]+c:m-p+e),l>q&&(f=l-q+f),q+h>l+k&&(f=l+k-q+f-h);break;case"w":e=a[0]+c,f=a[1]-h/2;var p=o(d),q=n(d);p+i>j&&(e=a[0]-i-c),l>q&&(f=l+5),q+h>l+k&&(f=l+k-q+f-h);break;case"n":e=a[0]-i/2-5,f=a[1]+c;var p=o(d),q=n(d);m>p&&(e=m+5),p+i>j&&(e=e-i/2+5),q+h>l+k&&(f=l+k-q+f-h);break;case"s":e=a[0]-i/2,f=a[1]-h-c;var p=o(d),q=n(d);m>p&&(e=m+5),p+i>j&&(e=e-i/2+5),l>q&&(f=l);break;case"none":e=a[0],f=a[1]-c;var p=o(d),q=n(d)}return d.style.left=e+"px",d.style.top=f+"px",d.style.opacity=1,d.style.position="absolute",d},g.tooltip.cleanup=function(){for(var a=document.getElementsByClassName("nvtooltip"),b=[];a.length;)b.push(a[0]),a[0].style.transitionDelay="0 !important",a[0].style.opacity=0,a[0].className="nvtooltip-pending-removal";setTimeout(function(){for(;b.length;){var a=b.pop();a.parentNode.removeChild(a)}},500)}}(),g.utils.windowSize=function(){var a={width:640,height:480};return document.body&&document.body.offsetWidth&&(a.width=document.body.offsetWidth,
a.height=document.body.offsetHeight),"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth&&(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(a.width=window.innerWidth,a.height=window.innerHeight),a},g.utils.windowResize=function(a){if(void 0!==a){var b=window.onresize;window.onresize=function(c){"function"==typeof b&&b(c),a(c)}}},g.utils.getColor=function(a){return arguments.length?"[object Array]"===Object.prototype.toString.call(a)?function(b,c){return b.color||a[c%a.length]}:a:g.utils.defaultColor()},g.utils.defaultColor=function(){var a=d3.scale.category20().range();return function(b,c){return b.color||a[c%a.length]}},g.utils.customTheme=function(a,b,c){b=b||function(a){return a.key},c=c||d3.scale.category20().range();var d=c.length;return function(e,f){var g=b(e);return d||(d=c.length),"undefined"!=typeof a[g]?"function"==typeof a[g]?a[g]():a[g]:c[--d]}},g.utils.pjax=function(a,b){function c(c){d3.html(c,function(c){var d=d3.select(b).node();d.parentNode.replaceChild(d3.select(c).select(b).node(),d),g.utils.pjax(a,b)})}d3.selectAll(a).on("click",function(){history.pushState(this.href,this.textContent,this.href),c(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&c(d3.event.state)})},g.utils.calcApproxTextWidth=function(a){if("function"==typeof a.style&&"function"==typeof a.text){var b=parseInt(a.style("font-size").replace("px","")),c=a.text().length;return c*b*.5}return 0},g.utils.NaNtoZero=function(a){return"number"!=typeof a||isNaN(a)||null===a||a===1/0?0:a},g.utils.optionsFunc=function(a){return a&&d3.map(a).forEach(function(a,b){"function"==typeof this[a]&&this[a](b)}.bind(this)),this},g.models.axis=function(){function a(e){return e.each(function(a){var e=d3.select(this),g=e.selectAll("g.nv-wrap.nv-axis").data([a]),r=g.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),s=(r.append("g"),g.select("g"));null!==o?b.ticks(o):("top"==b.orient()||"bottom"==b.orient())&&b.ticks(Math.abs(f.range()[1]-f.range()[0])/100),s.transition().call(b),q=q||b.scale();var t=b.tickFormat();null==t&&(t=q.tickFormat());var u=s.selectAll("text.nv-axislabel").data([h||null]);switch(u.exit().remove(),b.orient()){case"top":u.enter().append("text").attr("class","nv-axislabel");var v=2==f.range().length?f.range()[1]:f.range()[f.range().length-1]+(f.range()[1]-f.range()[0]);if(u.attr("text-anchor","middle").attr("y",0).attr("x",v/2),i){var w=g.selectAll("g.nv-axisMaxMin").data(f.domain());w.enter().append("g").attr("class","nv-axisMaxMin").append("text"),w.exit().remove(),w.attr("transform",function(a,b){return"translate("+f(a)+",0)"}).select("text").attr("dy","-0.5em").attr("y",-b.tickPadding()).attr("text-anchor","middle").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),w.transition().attr("transform",function(a,b){return"translate("+f.range()[b]+",0)"})}break;case"bottom":var x=36,y=30,z=s.selectAll("g").select("text");if(k%360){z.each(function(a,b){var c=this.getBBox().width;c>y&&(y=c)});var A=Math.abs(Math.sin(k*Math.PI/180)),x=(A?A*y:y)+30;z.attr("transform",function(a,b,c){return"rotate("+k+" 0,0)"}).style("text-anchor",k%360>0?"start":"end")}u.enter().append("text").attr("class","nv-axislabel");var v=2==f.range().length?f.range()[1]:f.range()[f.range().length-1]+(f.range()[1]-f.range()[0]);if(u.attr("text-anchor","middle").attr("y",x).attr("x",v/2),i){var w=g.selectAll("g.nv-axisMaxMin").data([f.domain()[0],f.domain()[f.domain().length-1]]);w.enter().append("g").attr("class","nv-axisMaxMin").append("text"),w.exit().remove(),w.attr("transform",function(a,b){return"translate("+(f(a)+(n?f.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",b.tickPadding()).attr("transform",function(a,b,c){return"rotate("+k+" 0,0)"}).style("text-anchor",k?k%360>0?"start":"end":"middle").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),w.transition().attr("transform",function(a,b){return"translate("+(f(a)+(n?f.rangeBand()/2:0))+",0)"})}m&&z.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"});break;case"right":if(u.enter().append("text").attr("class","nv-axislabel"),u.style("text-anchor",l?"middle":"begin").attr("transform",l?"rotate(90)":"").attr("y",l?-Math.max(c.right,d)+12:-10).attr("x",l?f.range()[0]/2:b.tickPadding()),i){var w=g.selectAll("g.nv-axisMaxMin").data(f.domain());w.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),w.exit().remove(),w.attr("transform",function(a,b){return"translate(0,"+f(a)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",b.tickPadding()).style("text-anchor","start").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),w.transition().attr("transform",function(a,b){return"translate(0,"+f.range()[b]+")"}).select("text").style("opacity",1)}break;case"left":if(u.enter().append("text").attr("class","nv-axislabel"),u.style("text-anchor",l?"middle":"end").attr("transform",l?"rotate(-90)":"").attr("y",l?-Math.max(c.left,d)+p:-10).attr("x",l?-f.range()[0]/2:-b.tickPadding()),i){var w=g.selectAll("g.nv-axisMaxMin").data(f.domain());w.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),w.exit().remove(),w.attr("transform",function(a,b){return"translate(0,"+q(a)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-b.tickPadding()).attr("text-anchor","end").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),w.transition().attr("transform",function(a,b){return"translate(0,"+f.range()[b]+")"}).select("text").style("opacity",1)}}if(u.text(function(a){return a}),!i||"left"!==b.orient()&&"right"!==b.orient()||(s.selectAll("g").each(function(a,b){d3.select(this).select("text").attr("opacity",1),(f(a)<f.range()[1]+10||f(a)>f.range()[0]-10)&&((a>1e-10||-1e-10>a)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),f.domain()[0]==f.domain()[1]&&0==f.domain()[0]&&g.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1})),i&&("top"===b.orient()||"bottom"===b.orient())){var B=[];g.selectAll("g.nv-axisMaxMin").each(function(a,b){try{b?B.push(f(a)-this.getBBox().width-4):B.push(f(a)+this.getBBox().width+4)}catch(c){b?B.push(f(a)-4):B.push(f(a)+4)}}),s.selectAll("g").each(function(a,b){(f(a)<B[0]||f(a)>B[1])&&(a>1e-10||-1e-10>a?d3.select(this).remove():d3.select(this).select("text").remove())})}j&&s.selectAll(".tick").filter(function(a){return!parseFloat(Math.round(1e5*a.__data__)/1e6)&&void 0!==a.__data__}).classed("zero",!0),q=f.copy()}),a}var b=d3.svg.axis(),c={top:0,right:0,bottom:0,left:0},d=75,e=60,f=d3.scale.linear(),h=null,i=!0,j=!0,k=0,l=!0,m=!1,n=!1,o=null,p=12;b.scale(f).orient("bottom").tickFormat(function(a){return a});var q;return a.axis=b,d3.rebind(a,b,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(a,f,"domain","range","rangeBand","rangeBands"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(c.top="undefined"!=typeof b.top?b.top:c.top,c.right="undefined"!=typeof b.right?b.right:c.right,c.bottom="undefined"!=typeof b.bottom?b.bottom:c.bottom,c.left="undefined"!=typeof b.left?b.left:c.left,a):c},a.width=function(b){return arguments.length?(d=b,a):d},a.ticks=function(b){return arguments.length?(o=b,a):o},a.height=function(b){return arguments.length?(e=b,a):e},a.axisLabel=function(b){return arguments.length?(h=b,a):h},a.showMaxMin=function(b){return arguments.length?(i=b,a):i},a.highlightZero=function(b){return arguments.length?(j=b,a):j},a.scale=function(c){return arguments.length?(f=c,b.scale(f),n="function"==typeof f.rangeBands,d3.rebind(a,f,"domain","range","rangeBand","rangeBands"),a):f},a.rotateYLabel=function(b){return arguments.length?(l=b,a):l},a.rotateLabels=function(b){return arguments.length?(k=b,a):k},a.staggerLabels=function(b){return arguments.length?(m=b,a):m},a.axisLabelDistance=function(b){return arguments.length?(p=b,a):p},a},g.models.historicalBar=function(){function a(v){return v.each(function(a){var v=h-f.left-f.right,w=i-f.top-f.bottom,x=d3.select(this);k.domain(b||d3.extent(a[0].values.map(m).concat(o))),q?k.range(d||[.5*v/a[0].values.length,v*(a[0].values.length-.5)/a[0].values.length]):k.range(d||[0,v]),l.domain(c||d3.extent(a[0].values.map(n).concat(p))).range(e||[w,0]),k.domain()[0]===k.domain()[1]&&(k.domain()[0]?k.domain([k.domain()[0]-.01*k.domain()[0],k.domain()[1]+.01*k.domain()[1]]):k.domain([-1,1])),l.domain()[0]===l.domain()[1]&&(l.domain()[0]?l.domain([l.domain()[0]+.01*l.domain()[0],l.domain()[1]-.01*l.domain()[1]]):l.domain([-1,1]));var y=x.selectAll("g.nv-wrap.nv-historicalBar-"+j).data([a[0].values]),z=y.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+j),A=z.append("defs"),B=z.append("g"),C=y.select("g");B.append("g").attr("class","nv-bars"),y.attr("transform","translate("+f.left+","+f.top+")"),x.on("click",function(a,b){t.chartClick({data:a,index:b,pos:d3.event,id:j})}),A.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),y.select("#nv-chart-clip-path-"+j+" rect").attr("width",v).attr("height",w),C.attr("clip-path",r?"url(#nv-chart-clip-path-"+j+")":"");var D=y.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a},function(a,b){return m(a,b)});D.exit().remove();D.enter().append("rect").attr("x",0).attr("y",function(a,b){return g.utils.NaNtoZero(l(Math.max(0,n(a,b))))}).attr("height",function(a,b){return g.utils.NaNtoZero(Math.abs(l(n(a,b))-l(0)))}).attr("transform",function(b,c){return"translate("+(k(m(b,c))-v/a[0].values.length*.45)+",0)"}).on("mouseover",function(b,c){u&&(d3.select(this).classed("hover",!0),t.elementMouseover({point:b,series:a[0],pos:[k(m(b,c)),l(n(b,c))],pointIndex:c,seriesIndex:0,e:d3.event}))}).on("mouseout",function(b,c){u&&(d3.select(this).classed("hover",!1),t.elementMouseout({point:b,series:a[0],pointIndex:c,seriesIndex:0,e:d3.event}))}).on("click",function(a,b){u&&(t.elementClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation())}).on("dblclick",function(a,b){u&&(t.elementDblClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation())});D.attr("fill",function(a,b){return s(a,b)}).attr("class",function(a,b,c){return(n(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).transition().attr("transform",function(b,c){return"translate("+(k(m(b,c))-v/a[0].values.length*.45)+",0)"}).attr("width",v/a[0].values.length*.9),D.transition().attr("y",function(a,b){var c=n(a,b)<0?l(0):l(0)-l(n(a,b))<1?l(0)-1:l(n(a,b));return g.utils.NaNtoZero(c)}).attr("height",function(a,b){return g.utils.NaNtoZero(Math.max(Math.abs(l(n(a,b))-l(0)),1))})}),a}var b,c,d,e,f={top:0,right:0,bottom:0,left:0},h=960,i=500,j=Math.floor(1e4*Math.random()),k=d3.scale.linear(),l=d3.scale.linear(),m=function(a){return a.x},n=function(a){return a.y},o=[],p=[0],q=!1,r=!0,s=g.utils.defaultColor(),t=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),u=!0;return a.highlightPoint=function(a,b){d3.select(".nv-historicalBar-"+j).select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},a.clearHighlights=function(){d3.select(".nv-historicalBar-"+j).select(".nv-bars .nv-bar.hover").classed("hover",!1)},a.dispatch=t,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(m=b,a):m},a.y=function(b){return arguments.length?(n=b,a):n},a.margin=function(b){return arguments.length?(f.top="undefined"!=typeof b.top?b.top:f.top,f.right="undefined"!=typeof b.right?b.right:f.right,f.bottom="undefined"!=typeof b.bottom?b.bottom:f.bottom,f.left="undefined"!=typeof b.left?b.left:f.left,a):f},a.width=function(b){return arguments.length?(h=b,a):h},a.height=function(b){return arguments.length?(i=b,a):i},a.xScale=function(b){return arguments.length?(k=b,a):k},a.yScale=function(b){return arguments.length?(l=b,a):l},a.xDomain=function(c){return arguments.length?(b=c,a):b},a.yDomain=function(b){return arguments.length?(c=b,a):c},a.xRange=function(b){return arguments.length?(d=b,a):d},a.yRange=function(b){return arguments.length?(e=b,a):e},a.forceX=function(b){return arguments.length?(o=b,a):o},a.forceY=function(b){return arguments.length?(p=b,a):p},a.padData=function(b){return arguments.length?(q=b,a):q},a.clipEdge=function(b){return arguments.length?(r=b,a):r},a.color=function(b){return arguments.length?(s=g.utils.getColor(b),a):s},a.id=function(b){return arguments.length?(j=b,a):j},a.interactive=function(b){return arguments.length?(u=!1,a):u},a},g.models.bullet=function(){function a(c){return c.each(function(a,c){var g=m-b.left-b.right,o=n-b.top-b.bottom,r=d3.select(this),s=e.call(this,a,c).slice().sort(d3.descending),t=f.call(this,a,c).slice().sort(d3.descending),u=h.call(this,a,c).slice().sort(d3.descending),v=i.call(this,a,c).slice(),w=j.call(this,a,c).slice(),x=k.call(this,a,c).slice(),y=d3.scale.linear().domain(d3.extent(d3.merge([l,s]))).range(d?[g,0]:[0,g]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(y.range());this.__chart__=y;var z=d3.min(s),A=d3.max(s),B=s[1],C=r.selectAll("g.nv-wrap.nv-bullet").data([a]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),E=D.append("g"),F=C.select("g");E.append("rect").attr("class","nv-range nv-rangeMax"),E.append("rect").attr("class","nv-range nv-rangeAvg"),E.append("rect").attr("class","nv-range nv-rangeMin"),E.append("rect").attr("class","nv-measure"),E.append("path").attr("class","nv-markerTriangle"),C.attr("transform","translate("+b.left+","+b.top+")");var G=function(a){return Math.abs(y(a)-y(0))},H=function(a){return y(0>a?a:0)};F.select("rect.nv-rangeMax").attr("height",o).attr("width",G(A>0?A:z)).attr("x",H(A>0?A:z)).datum(A>0?A:z),F.select("rect.nv-rangeAvg").attr("height",o).attr("width",G(B)).attr("x",H(B)).datum(B),F.select("rect.nv-rangeMin").attr("height",o).attr("width",G(A)).attr("x",H(A)).attr("width",G(A>0?z:A)).attr("x",H(A>0?z:A)).datum(A>0?z:A),F.select("rect.nv-measure").style("fill",p).attr("height",o/3).attr("y",o/3).attr("width",0>u?y(0)-y(u[0]):y(u[0])-y(0)).attr("x",H(u)).on("mouseover",function(){q.elementMouseover({value:u[0],label:x[0]||"Current",pos:[y(u[0]),o/2]})}).on("mouseout",function(){q.elementMouseout({value:u[0],label:x[0]||"Current"})});var I=o/6;t[0]?F.selectAll("path.nv-markerTriangle").attr("transform",function(a){return"translate("+y(t[0])+","+o/2+")"}).attr("d","M0,"+I+"L"+I+","+-I+" "+-I+","+-I+"Z").on("mouseover",function(){q.elementMouseover({value:t[0],label:w[0]||"Previous",pos:[y(t[0]),o/2]})}).on("mouseout",function(){q.elementMouseout({value:t[0],label:w[0]||"Previous"})}):F.selectAll("path.nv-markerTriangle").remove(),C.selectAll(".nv-range").on("mouseover",function(a,b){var c=v[b]||(b?1==b?"Mean":"Minimum":"Maximum");q.elementMouseover({value:a,label:c,pos:[y(a),o/2]})}).on("mouseout",function(a,b){var c=v[b]||(b?1==b?"Mean":"Minimum":"Maximum");q.elementMouseout({value:a,label:c})})}),a}var b={top:0,right:0,bottom:0,left:0},c="left",d=!1,e=function(a){return a.ranges},f=function(a){return a.markers},h=function(a){return a.measures},i=function(a){return a.rangeLabels?a.rangeLabels:[]},j=function(a){return a.markerLabels?a.markerLabels:[]},k=function(a){return a.measureLabels?a.measureLabels:[]},l=[0],m=380,n=30,o=null,p=g.utils.getColor(["#1f77b4"]),q=d3.dispatch("elementMouseover","elementMouseout");return a.dispatch=q,a.options=g.utils.optionsFunc.bind(a),a.orient=function(b){return arguments.length?(c=b,d="right"==c||"bottom"==c,a):c},a.ranges=function(b){return arguments.length?(e=b,a):e},a.markers=function(b){return arguments.length?(f=b,a):f},a.measures=function(b){return arguments.length?(h=b,a):h},a.forceX=function(b){return arguments.length?(l=b,a):l},a.width=function(b){return arguments.length?(m=b,a):m},a.height=function(b){return arguments.length?(n=b,a):n},a.margin=function(c){return arguments.length?(b.top="undefined"!=typeof c.top?c.top:b.top,b.right="undefined"!=typeof c.right?c.right:b.right,b.bottom="undefined"!=typeof c.bottom?c.bottom:b.bottom,b.left="undefined"!=typeof c.left?c.left:b.left,a):b},a.tickFormat=function(b){return arguments.length?(o=b,a):o},a.color=function(b){return arguments.length?(p=g.utils.getColor(b),a):p},a},g.models.bulletChart=function(){function a(c){return c.each(function(g,n){var r=d3.select(this),s=(j||parseInt(r.style("width"))||960)-e.left-e.right,t=k-e.top-e.bottom,u=this;if(a.update=function(){a(c)},a.container=this,!g||!f.call(this,g,n)){var v=r.selectAll(".nv-noData").data([o]);return v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",e.left+s/2).attr("y",18+e.top+t/2).text(function(a){return a}),a}r.selectAll(".nv-noData").remove();var w=f.call(this,g,n).slice().sort(d3.descending),x=h.call(this,g,n).slice().sort(d3.descending),y=i.call(this,g,n).slice().sort(d3.descending),z=r.selectAll("g.nv-wrap.nv-bulletChart").data([g]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),B=A.append("g"),C=z.select("g");B.append("g").attr("class","nv-bulletWrap"),B.append("g").attr("class","nv-titles"),z.attr("transform","translate("+e.left+","+e.top+")");var D=d3.scale.linear().domain([0,Math.max(w[0],x[0],y[0])]).range(d?[s,0]:[0,s]),E=this.__chart__||d3.scale.linear().domain([0,1/0]).range(D.range());this.__chart__=D;var F=B.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(k-e.top-e.bottom)/2+")");F.append("text").attr("class","nv-title").text(function(a){return a.title}),F.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),b.width(s).height(t);var G=C.select(".nv-bulletWrap");d3.transition(G).call(b);var H=l||D.tickFormat(s/100),I=C.selectAll("g.nv-tick").data(D.ticks(s/50),function(a){return this.textContent||H(a)}),J=I.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+E(a)+",0)"}).style("opacity",1e-6);J.append("line").attr("y1",t).attr("y2",7*t/6),J.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*t/6).text(H);var K=d3.transition(I).attr("transform",function(a){return"translate("+D(a)+",0)"}).style("opacity",1);K.select("line").attr("y1",t).attr("y2",7*t/6),K.select("text").attr("y",7*t/6),d3.transition(I.exit()).attr("transform",function(a){return"translate("+D(a)+",0)"}).style("opacity",1e-6).remove(),p.on("tooltipShow",function(a){a.key=g.title,m&&q(a,u.parentNode)})}),d3.timer.flush(),a}var b=g.models.bullet(),c="left",d=!1,e={top:5,right:40,bottom:20,left:120},f=function(a){return a.ranges},h=function(a){return a.markers},i=function(a){return a.measures},j=null,k=55,l=null,m=!0,n=function(a,b,c,d,e){return"<h3>"+b+"</h3><p>"+c+"</p>"},o="No Data Available.",p=d3.dispatch("tooltipShow","tooltipHide"),q=function(b,c){var d=b.pos[0]+(c.offsetLeft||0)+e.left,f=b.pos[1]+(c.offsetTop||0)+e.top,h=n(b.key,b.label,b.value,b,a);g.tooltip.show([d,f],h,b.value<0?"e":"w",null,c)};return b.dispatch.on("elementMouseover.tooltip",function(a){p.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){p.tooltipHide(a)}),p.on("tooltipHide",function(){m&&g.tooltip.cleanup()}),a.dispatch=p,a.bullet=b,d3.rebind(a,b,"color"),a.options=g.utils.optionsFunc.bind(a),a.orient=function(b){return arguments.length?(c=b,d="right"==c||"bottom"==c,a):c},a.ranges=function(b){return arguments.length?(f=b,a):f},a.markers=function(b){return arguments.length?(h=b,a):h},a.measures=function(b){return arguments.length?(i=b,a):i},a.width=function(b){return arguments.length?(j=b,a):j},a.height=function(b){return arguments.length?(k=b,a):k},a.margin=function(b){return arguments.length?(e.top="undefined"!=typeof b.top?b.top:e.top,e.right="undefined"!=typeof b.right?b.right:e.right,e.bottom="undefined"!=typeof b.bottom?b.bottom:e.bottom,e.left="undefined"!=typeof b.left?b.left:e.left,a):e},a.tickFormat=function(b){return arguments.length?(l=b,a):l},a.tooltips=function(b){return arguments.length?(m=b,a):m},a.tooltipContent=function(b){return arguments.length?(n=b,a):n},a.noData=function(b){return arguments.length?(o=b,a):o},a},g.models.cumulativeLineChart=function(){function a(x){return x.each(function(x){function I(b,c){d3.select(a.container).style("cursor","ew-resize")}function J(a,b){G.x=d3.event.x,G.i=Math.round(F.invert(G.x)),L()}function K(b,c){d3.select(a.container).style("cursor","auto"),z.index=G.i,D.stateChange(z)}function L(){da.data([G]);var b=a.transitionDuration();a.transitionDuration(0),a.update(),a.transitionDuration(b)}var M=d3.select(this).classed("nv-chart-"+y,!0),N=this,O=(n||parseInt(M.style("width"))||960)-l.left-l.right,P=(o||parseInt(M.style("height"))||400)-l.top-l.bottom;if(a.update=function(){M.transition().duration(E).call(a)},a.container=this,z.disabled=x.map(function(a){return!!a.disabled}),!A){var Q;A={};for(Q in z)z[Q]instanceof Array?A[Q]=z[Q].slice(0):A[Q]=z[Q]}var R=d3.behavior.drag().on("dragstart",I).on("drag",J).on("dragend",K);if(!(x&&x.length&&x.filter(function(a){return a.values.length}).length)){var S=M.selectAll(".nv-noData").data([B]);return S.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),S.attr("x",l.left+O/2).attr("y",l.top+P/2).text(function(a){return a}),a}if(M.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale(),w)e.yDomain(null);else{var T=x.filter(function(a){return!a.disabled}).map(function(a,b){var c=d3.extent(a.values,e.y());return c[0]<-.95&&(c[0]=-.95),[(c[0]-c[1])/(1+c[1]),(c[1]-c[0])/(1+c[0])]}),U=[d3.min(T,function(a){return a[0]}),d3.max(T,function(a){return a[1]})];e.yDomain(U)}F.domain([0,x[0].values.length-1]).range([0,O]).clamp(!0);var x=b(G.i,x),V=v?"none":"all",W=M.selectAll("g.nv-wrap.nv-cumulativeLine").data([x]),X=W.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),Y=W.select("g");if(X.append("g").attr("class","nv-interactive"),X.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),X.append("g").attr("class","nv-y nv-axis"),X.append("g").attr("class","nv-background"),X.append("g").attr("class","nv-linesWrap").style("pointer-events",V),X.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),X.append("g").attr("class","nv-legendWrap"),X.append("g").attr("class","nv-controlsWrap"),p&&(i.width(O),Y.select(".nv-legendWrap").datum(x).call(i),l.top!=i.height()&&(l.top=i.height(),P=(o||parseInt(M.style("height"))||400)-l.top-l.bottom),Y.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")),u){var Z=[{key:"Re-scale y-axis",disabled:!w}];j.width(140).color(["#444","#444","#444"]),Y.select(".nv-controlsWrap").datum(Z).attr("transform","translate(0,"+-l.top+")").call(j)}W.attr("transform","translate("+l.left+","+l.top+")"),s&&Y.select(".nv-y.nv-axis").attr("transform","translate("+O+",0)");var $=x.filter(function(a){return a.tempDisabled});W.select(".tempDisabled").remove(),$.length&&W.append("text").attr("class","tempDisabled").attr("x",O/2).attr("y","-.71em").style("text-anchor","end").text($.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),v&&(k.width(O).height(P).margin({left:l.left,top:l.top}).svgContainer(M).xScale(c),W.select(".nv-interactive").call(k)),X.select(".nv-background").append("rect"),Y.select(".nv-background rect").attr("width",O).attr("height",P),e.y(function(a){return a.display.y}).width(O).height(P).color(x.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!x[b].disabled&&!x[b].tempDisabled}));var _=Y.select(".nv-linesWrap").datum(x.filter(function(a){return!a.disabled&&!a.tempDisabled}));_.call(e),x.forEach(function(a,b){a.seriesIndex=b});var aa=x.filter(function(a){return!a.disabled&&!!C(a)}),ba=Y.select(".nv-avgLinesWrap").selectAll("line").data(aa,function(a){return a.key}),ca=function(a){var b=d(C(a));return 0>b?0:b>P?P:b};ba.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(a,b){return e.color()(a,a.seriesIndex)}).attr("x1",0).attr("x2",O).attr("y1",ca).attr("y2",ca),ba.style("stroke-opacity",function(a){var b=d(C(a));return 0>b||b>P?0:1}).attr("x1",0).attr("x2",O).attr("y1",ca).attr("y2",ca),ba.exit().remove();var da=_.selectAll(".nv-indexLine").data([G]);da.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(R),da.attr("transform",function(a){return"translate("+F(a.i)+",0)"}).attr("height",P),q&&(f.scale(c).ticks(Math.min(x[0].values.length,O/70)).tickSize(-P,0),Y.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),d3.transition(Y.select(".nv-x.nv-axis")).call(f)),r&&(h.scale(d).ticks(P/36).tickSize(-O,0),d3.transition(Y.select(".nv-y.nv-axis")).call(h)),Y.select(".nv-background rect").on("click",function(){G.x=d3.mouse(this)[0],G.i=Math.round(F.invert(G.x)),z.index=G.i,D.stateChange(z),L()}),e.dispatch.on("elementClick",function(a){G.i=a.pointIndex,G.x=F(G.i),z.index=G.i,D.stateChange(z),L()}),j.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,w=!b.disabled,z.rescaleY=w,D.stateChange(z),a.update()}),i.dispatch.on("stateChange",function(b){z.disabled=b.disabled,D.stateChange(z),a.update()}),k.dispatch.on("elementMousemove",function(b){e.clearHighlights();var c,d,i,j=[];if(x.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,h){d=g.interactiveBisect(f.values,b.pointXValue,a.x()),e.highlightPoint(h,d,!0);var k=f.values[d];"undefined"!=typeof k&&("undefined"==typeof c&&(c=k),"undefined"==typeof i&&(i=a.xScale()(a.x()(k,d))),j.push({key:f.key,value:a.y()(k,d),color:m(f,f.seriesIndex)}))}),j.length>2){var n=a.yScale().invert(b.mouseY),o=Math.abs(a.yScale().domain()[0]-a.yScale().domain()[1]),p=.03*o,q=g.nearestValueIndex(j.map(function(a){return a.value}),n,p);null!==q&&(j[q].highlight=!0)}var r=f.tickFormat()(a.x()(c,d),d);k.tooltip.position({left:i+l.left,top:b.mouseY+l.top}).chartContainer(N.parentNode).enabled(t).valueFormatter(function(a,b){return h.tickFormat()(a)}).data({value:r,series:j})(),k.renderGuideLine(i)}),k.dispatch.on("elementMouseout",function(a){D.tooltipHide(),e.clearHighlights()}),D.on("tooltipShow",function(a){t&&H(a,N.parentNode)}),D.on("changeState",function(b){"undefined"!=typeof b.disabled&&(x.forEach(function(a,c){a.disabled=b.disabled[c]}),z.disabled=b.disabled),"undefined"!=typeof b.index&&(G.i=b.index,G.x=F(G.i),z.index=b.index,da.data([G])),"undefined"!=typeof b.rescaleY&&(w=b.rescaleY),a.update()})}),a}function b(a,b){return b.map(function(b,c){if(!b.values)return b;var d=e.y()(b.values[a],a);return-.95>d?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(e.y()(a,b)-d)/(1+d)},a}),b)})}var c,d,e=g.models.line(),f=g.models.axis(),h=g.models.axis(),i=g.models.legend(),j=g.models.legend(),k=g.interactiveGuideline(),l={top:30,right:30,bottom:50,left:60},m=g.utils.defaultColor(),n=null,o=null,p=!0,q=!0,r=!0,s=!1,t=!0,u=!0,v=!1,w=!0,x=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},y=e.id(),z={index:0,rescaleY:w},A=null,B="No Data Available.",C=function(a){return a.average},D=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),E=250;f.orient("bottom").tickPadding(7),h.orient(s?"right":"left"),j.updateState(!1);var F=d3.scale.linear(),G={i:0,x:0},H=function(b,c){var d=b.pos[0]+(c.offsetLeft||0),i=b.pos[1]+(c.offsetTop||0),j=f.tickFormat()(e.x()(b.point,b.pointIndex)),k=h.tickFormat()(e.y()(b.point,b.pointIndex)),l=x(b.series.key,j,k,b,a);g.tooltip.show([d,i],l,null,null,c)};return e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+l.left,a.pos[1]+l.top],D.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){D.tooltipHide(a)}),D.on("tooltipHide",function(){t&&g.tooltip.cleanup()}),a.dispatch=D,a.lines=e,a.legend=i,a.xAxis=f,a.yAxis=h,a.interactiveLayer=k,d3.rebind(a,e,"defined","isArea","x","y","xScale","yScale","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(l.top="undefined"!=typeof b.top?b.top:l.top,l.right="undefined"!=typeof b.right?b.right:l.right,l.bottom="undefined"!=typeof b.bottom?b.bottom:l.bottom,l.left="undefined"!=typeof b.left?b.left:l.left,a):l},a.width=function(b){return arguments.length?(n=b,a):n},a.height=function(b){return arguments.length?(o=b,a):o},a.color=function(b){return arguments.length?(m=g.utils.getColor(b),i.color(m),a):m},a.rescaleY=function(b){return arguments.length?(w=b,a):w},a.showControls=function(b){return arguments.length?(u=b,a):u},a.useInteractiveGuideline=function(b){return arguments.length?(v=b,b===!0&&(a.interactive(!1),a.useVoronoi(!1)),a):v},a.showLegend=function(b){return arguments.length?(p=b,a):p},a.showXAxis=function(b){return arguments.length?(q=b,a):q},a.showYAxis=function(b){return arguments.length?(r=b,a):r},a.rightAlignYAxis=function(b){return arguments.length?(s=b,h.orient(b?"right":"left"),a):s},a.tooltips=function(b){return arguments.length?(t=b,a):t},a.tooltipContent=function(b){return arguments.length?(x=b,a):x},a.state=function(b){return arguments.length?(z=b,a):z},a.defaultState=function(b){return arguments.length?(A=b,a):A},a.noData=function(b){return arguments.length?(B=b,a):B},a.average=function(b){return arguments.length?(C=b,a):C},a.transitionDuration=function(b){return arguments.length?(E=b,a):E},a},g.models.discreteBar=function(){function a(g){return g.each(function(a){var g=j-i.left-i.right,l=k-i.top-i.bottom,w=d3.select(this);a.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var x=b&&c?[]:a.map(function(a){return a.values.map(function(a,b){return{x:o(a,b),y:p(a,b),y0:a.y0}})});m.domain(b||d3.merge(x).map(function(a){return a.x})).rangeBands(d||[0,g],.1),n.domain(c||d3.extent(d3.merge(x).map(function(a){return a.y}).concat(q))),s?n.range(e||[l-(n.domain()[0]<0?12:0),n.domain()[1]>0?12:0]):n.range(e||[l,0]),f=f||m,h=h||n.copy().range([n(0),n(0)]);var y=w.selectAll("g.nv-wrap.nv-discretebar").data([a]),z=y.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),A=z.append("g");y.select("g");A.append("g").attr("class","nv-groups"),y.attr("transform","translate("+i.left+","+i.top+")");var B=y.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),B.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),B.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),B.transition().style("stroke-opacity",1).style("fill-opacity",.75);var C=B.selectAll("g.nv-bar").data(function(a){return a.values});C.exit().remove();var D=C.enter().append("g").attr("transform",function(a,b,c){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", "+n(0)+")"}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),u.elementMouseover({value:p(b,c),point:b,series:a[b.series],pos:[m(o(b,c))+m.rangeBand()*(b.series+.5)/a.length,n(p(b,c))],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),u.elementMouseout({value:p(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){u.elementClick({value:p(b,c),point:b,series:a[b.series],pos:[m(o(b,c))+m.rangeBand()*(b.series+.5)/a.length,n(p(b,c))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){u.elementDblClick({value:p(b,c),point:b,series:a[b.series],pos:[m(o(b,c))+m.rangeBand()*(b.series+.5)/a.length,n(p(b,c))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation();
});D.append("rect").attr("height",0).attr("width",.9*m.rangeBand()/a.length),s?(D.append("text").attr("text-anchor","middle"),C.select("text").text(function(a,b){return t(p(a,b))}).transition().attr("x",.9*m.rangeBand()/2).attr("y",function(a,b){return p(a,b)<0?n(p(a,b))-n(0)+12:-4})):C.selectAll("text").remove(),C.attr("class",function(a,b){return p(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||r(a,b)}).style("stroke",function(a,b){return a.color||r(a,b)}).select("rect").attr("class",v).transition().attr("width",.9*m.rangeBand()/a.length),C.transition().attr("transform",function(a,b){var c=m(o(a,b))+.05*m.rangeBand(),d=p(a,b)<0?n(0):n(0)-n(p(a,b))<1?n(0)-1:n(p(a,b));return"translate("+c+", "+d+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(n(p(a,b))-n(c&&c[0]||0))||1)}),f=m.copy(),h=n.copy()}),a}var b,c,d,e,f,h,i={top:0,right:0,bottom:0,left:0},j=960,k=500,l=Math.floor(1e4*Math.random()),m=d3.scale.ordinal(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=[0],r=g.utils.defaultColor(),s=!1,t=d3.format(",.2f"),u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),v="discreteBar";return a.dispatch=u,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(o=b,a):o},a.y=function(b){return arguments.length?(p=b,a):p},a.margin=function(b){return arguments.length?(i.top="undefined"!=typeof b.top?b.top:i.top,i.right="undefined"!=typeof b.right?b.right:i.right,i.bottom="undefined"!=typeof b.bottom?b.bottom:i.bottom,i.left="undefined"!=typeof b.left?b.left:i.left,a):i},a.width=function(b){return arguments.length?(j=b,a):j},a.height=function(b){return arguments.length?(k=b,a):k},a.xScale=function(b){return arguments.length?(m=b,a):m},a.yScale=function(b){return arguments.length?(n=b,a):n},a.xDomain=function(c){return arguments.length?(b=c,a):b},a.yDomain=function(b){return arguments.length?(c=b,a):c},a.xRange=function(b){return arguments.length?(d=b,a):d},a.yRange=function(b){return arguments.length?(e=b,a):e},a.forceY=function(b){return arguments.length?(q=b,a):q},a.color=function(b){return arguments.length?(r=g.utils.getColor(b),a):r},a.id=function(b){return arguments.length?(l=b,a):l},a.showValues=function(b){return arguments.length?(s=b,a):s},a.valueFormat=function(b){return arguments.length?(t=b,a):t},a.rectClass=function(b){return arguments.length?(v=b,a):v},a},g.models.discreteBarChart=function(){function a(g){return g.each(function(g){var k=d3.select(this),q=this,v=(i||parseInt(k.style("width"))||960)-h.left-h.right,w=(j||parseInt(k.style("height"))||400)-h.top-h.bottom;if(a.update=function(){s.beforeUpdate(),k.transition().duration(t).call(a)},a.container=this,!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var x=k.selectAll(".nv-noData").data([r]);return x.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),x.attr("x",h.left+v/2).attr("y",h.top+w/2).text(function(a){return a}),a}k.selectAll(".nv-noData").remove(),b=d.xScale(),c=d.yScale().clamp(!0);var y=k.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([g]),z=y.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),A=z.append("defs"),B=y.select("g");z.append("g").attr("class","nv-x nv-axis"),z.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),z.append("g").attr("class","nv-barsWrap"),B.attr("transform","translate("+h.left+","+h.top+")"),n&&B.select(".nv-y.nv-axis").attr("transform","translate("+v+",0)"),d.width(v).height(w);var C=B.select(".nv-barsWrap").datum(g.filter(function(a){return!a.disabled}));if(C.transition().call(d),A.append("clipPath").attr("id","nv-x-label-clip-"+d.id()).append("rect"),B.select("#nv-x-label-clip-"+d.id()+" rect").attr("width",b.rangeBand()*(o?2:1)).attr("height",16).attr("x",-b.rangeBand()/(o?1:2)),l){e.scale(b).ticks(v/100).tickSize(-w,0),B.select(".nv-x.nv-axis").attr("transform","translate(0,"+(c.range()[0]+(d.showValues()&&c.domain()[0]<0?16:0))+")"),B.select(".nv-x.nv-axis").transition().call(e);var D=B.select(".nv-x.nv-axis").selectAll("g");o&&D.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}m&&(f.scale(c).ticks(w/36).tickSize(-v,0),B.select(".nv-y.nv-axis").transition().call(f)),B.select(".nv-zeroLine line").attr("x1",0).attr("x2",v).attr("y1",c(0)).attr("y2",c(0)),s.on("tooltipShow",function(a){p&&u(a,q.parentNode)})}),a}var b,c,d=g.models.discreteBar(),e=g.models.axis(),f=g.models.axis(),h={top:15,right:10,bottom:50,left:60},i=null,j=null,k=g.utils.getColor(),l=!0,m=!0,n=!1,o=!1,p=!0,q=function(a,b,c,d,e){return"<h3>"+b+"</h3><p>"+c+"</p>"},r="No Data Available.",s=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate"),t=250;e.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),f.orient(n?"right":"left").tickFormat(d3.format(",.1f"));var u=function(b,c){var h=b.pos[0]+(c.offsetLeft||0),i=b.pos[1]+(c.offsetTop||0),j=e.tickFormat()(d.x()(b.point,b.pointIndex)),k=f.tickFormat()(d.y()(b.point,b.pointIndex)),l=q(b.series.key,j,k,b,a);g.tooltip.show([h,i],l,b.value<0?"n":"s",null,c)};return d.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+h.left,a.pos[1]+h.top],s.tooltipShow(a)}),d.dispatch.on("elementMouseout.tooltip",function(a){s.tooltipHide(a)}),s.on("tooltipHide",function(){p&&g.tooltip.cleanup()}),a.dispatch=s,a.discretebar=d,a.xAxis=e,a.yAxis=f,d3.rebind(a,d,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","id","showValues","valueFormat"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(h.top="undefined"!=typeof b.top?b.top:h.top,h.right="undefined"!=typeof b.right?b.right:h.right,h.bottom="undefined"!=typeof b.bottom?b.bottom:h.bottom,h.left="undefined"!=typeof b.left?b.left:h.left,a):h},a.width=function(b){return arguments.length?(i=b,a):i},a.height=function(b){return arguments.length?(j=b,a):j},a.color=function(b){return arguments.length?(k=g.utils.getColor(b),d.color(k),a):k},a.showXAxis=function(b){return arguments.length?(l=b,a):l},a.showYAxis=function(b){return arguments.length?(m=b,a):m},a.rightAlignYAxis=function(b){return arguments.length?(n=b,f.orient(b?"right":"left"),a):n},a.staggerLabels=function(b){return arguments.length?(o=b,a):o},a.tooltips=function(b){return arguments.length?(p=b,a):p},a.tooltipContent=function(b){return arguments.length?(q=b,a):q},a.noData=function(b){return arguments.length?(r=b,a):r},a.transitionDuration=function(b){return arguments.length?(t=b,a):t},a},g.models.distribution=function(){function a(g){return g.each(function(a){var g=(d-("x"===f?c.left+c.right:c.top+c.bottom),"x"==f?"y":"x"),k=d3.select(this);b=b||j;var l=k.selectAll("g.nv-distribution").data([a]),m=l.enter().append("g").attr("class","nvd3 nv-distribution"),n=(m.append("g"),l.select("g"));l.attr("transform","translate("+c.left+","+c.top+")");var o=n.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});o.enter().append("g"),o.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return i(a,b)});var p=o.selectAll("line.nv-dist"+f).data(function(a){return a.values});p.enter().append("line").attr(f+"1",function(a,c){return b(h(a,c))}).attr(f+"2",function(a,c){return b(h(a,c))}),o.exit().selectAll("line.nv-dist"+f).transition().attr(f+"1",function(a,b){return j(h(a,b))}).attr(f+"2",function(a,b){return j(h(a,b))}).style("stroke-opacity",0).remove(),p.attr("class",function(a,b){return"nv-dist"+f+" nv-dist"+f+"-"+b}).attr(g+"1",0).attr(g+"2",e),p.transition().attr(f+"1",function(a,b){return j(h(a,b))}).attr(f+"2",function(a,b){return j(h(a,b))}),b=j.copy()}),a}var b,c={top:0,right:0,bottom:0,left:0},d=400,e=8,f="x",h=function(a){return a[f]},i=g.utils.defaultColor(),j=d3.scale.linear();return a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(c.top="undefined"!=typeof b.top?b.top:c.top,c.right="undefined"!=typeof b.right?b.right:c.right,c.bottom="undefined"!=typeof b.bottom?b.bottom:c.bottom,c.left="undefined"!=typeof b.left?b.left:c.left,a):c},a.width=function(b){return arguments.length?(d=b,a):d},a.axis=function(b){return arguments.length?(f=b,a):f},a.size=function(b){return arguments.length?(e=b,a):e},a.getData=function(b){return arguments.length?(h=d3.functor(b),a):h},a.scale=function(b){return arguments.length?(j=b,a):j},a.color=function(b){return arguments.length?(i=g.utils.getColor(b),a):i},a},g.models.historicalBarChart=function(){function a(g){return g.each(function(r){var y=d3.select(this),z=this,A=(k||parseInt(y.style("width"))||960)-i.left-i.right,B=(l||parseInt(y.style("height"))||400)-i.top-i.bottom;if(a.update=function(){y.transition().duration(w).call(a)},a.container=this,s.disabled=r.map(function(a){return!!a.disabled}),!t){var C;t={};for(C in s)s[C]instanceof Array?t[C]=s[C].slice(0):t[C]=s[C]}if(!(r&&r.length&&r.filter(function(a){return a.values.length}).length)){var D=y.selectAll(".nv-noData").data([u]);return D.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),D.attr("x",i.left+A/2).attr("y",i.top+B/2).text(function(a){return a}),a}y.selectAll(".nv-noData").remove(),b=d.xScale(),c=d.yScale();var E=y.selectAll("g.nv-wrap.nv-historicalBarChart").data([r]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),m&&(h.width(A),G.select(".nv-legendWrap").datum(r).call(h),i.top!=h.height()&&(i.top=h.height(),B=(l||parseInt(y.style("height"))||400)-i.top-i.bottom),E.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")")),E.attr("transform","translate("+i.left+","+i.top+")"),p&&G.select(".nv-y.nv-axis").attr("transform","translate("+A+",0)"),d.width(A).height(B).color(r.map(function(a,b){return a.color||j(a,b)}).filter(function(a,b){return!r[b].disabled}));var H=G.select(".nv-barsWrap").datum(r.filter(function(a){return!a.disabled}));H.transition().call(d),n&&(e.scale(b).tickSize(-B,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+c.range()[0]+")"),G.select(".nv-x.nv-axis").transition().call(e)),o&&(f.scale(c).ticks(B/36).tickSize(-A,0),G.select(".nv-y.nv-axis").transition().call(f)),h.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,r.filter(function(a){return!a.disabled}).length||r.map(function(a){return a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1),a}),s.disabled=r.map(function(a){return!!a.disabled}),v.stateChange(s),g.transition().call(a)}),h.dispatch.on("legendDblclick",function(b){r.forEach(function(a){a.disabled=!0}),b.disabled=!1,s.disabled=r.map(function(a){return!!a.disabled}),v.stateChange(s),a.update()}),v.on("tooltipShow",function(a){q&&x(a,z.parentNode)}),v.on("changeState",function(b){"undefined"!=typeof b.disabled&&(r.forEach(function(a,c){a.disabled=b.disabled[c]}),s.disabled=b.disabled),a.update()})}),a}var b,c,d=g.models.historicalBar(),e=g.models.axis(),f=g.models.axis(),h=g.models.legend(),i={top:30,right:90,bottom:50,left:90},j=g.utils.defaultColor(),k=null,l=null,m=!1,n=!0,o=!0,p=!1,q=!0,r=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},s={},t=null,u="No Data Available.",v=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),w=250;e.orient("bottom").tickPadding(7),f.orient(p?"right":"left");var x=function(b,c){if(c){var h=d3.select(c).select("svg"),i=h.node()?h.attr("viewBox"):null;if(i){i=i.split(" ");var j=parseInt(h.style("width"))/i[2];b.pos[0]=b.pos[0]*j,b.pos[1]=b.pos[1]*j}}var k=b.pos[0]+(c.offsetLeft||0),l=b.pos[1]+(c.offsetTop||0),m=e.tickFormat()(d.x()(b.point,b.pointIndex)),n=f.tickFormat()(d.y()(b.point,b.pointIndex)),o=r(b.series.key,m,n,b,a);g.tooltip.show([k,l],o,null,null,c)};return d.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+i.left,a.pos[1]+i.top],v.tooltipShow(a)}),d.dispatch.on("elementMouseout.tooltip",function(a){v.tooltipHide(a)}),v.on("tooltipHide",function(){q&&g.tooltip.cleanup()}),a.dispatch=v,a.bars=d,a.legend=h,a.xAxis=e,a.yAxis=f,d3.rebind(a,d,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate","highlightPoint","clearHighlights","interactive"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(i.top="undefined"!=typeof b.top?b.top:i.top,i.right="undefined"!=typeof b.right?b.right:i.right,i.bottom="undefined"!=typeof b.bottom?b.bottom:i.bottom,i.left="undefined"!=typeof b.left?b.left:i.left,a):i},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.color=function(b){return arguments.length?(j=g.utils.getColor(b),h.color(j),a):j},a.showLegend=function(b){return arguments.length?(m=b,a):m},a.showXAxis=function(b){return arguments.length?(n=b,a):n},a.showYAxis=function(b){return arguments.length?(o=b,a):o},a.rightAlignYAxis=function(b){return arguments.length?(p=b,f.orient(b?"right":"left"),a):p},a.tooltips=function(b){return arguments.length?(q=b,a):q},a.tooltipContent=function(b){return arguments.length?(r=b,a):r},a.state=function(b){return arguments.length?(s=b,a):s},a.defaultState=function(b){return arguments.length?(t=b,a):t},a.noData=function(b){return arguments.length?(u=b,a):u},a.transitionDuration=function(b){return arguments.length?(w=b,a):w},a},g.models.indentedTree=function(){function a(b){return b.each(function(b){function c(b,d,e){return d3.event.stopPropagation(),d3.event.shiftKey&&!e?(d3.event.shiftKey=!1,b.values&&b.values.forEach(function(a){(a.values||a._values)&&c(a,0,!0)}),!0):g(b)?(b.values?(b._values=b.values,b.values=null):(b.values=b._values,b._values=null),void a.update()):!0}function e(a){return a._values&&a._values.length?n:a.values&&a.values.length?o:""}function f(a){return a._values&&a._values.length}function g(a){var b=a.values||a._values;return b&&b.length}var s=1,t=d3.select(this),u=d3.layout.tree().children(function(a){return a.values}).size([d,k]);a.update=function(){t.transition().duration(600).call(a)},b[0]||(b[0]={key:j});var v=u.nodes(b[0]),w=d3.select(this).selectAll("div").data([[v]]),x=w.enter().append("div").attr("class","nvd3 nv-wrap nv-indentedtree"),y=x.append("table"),z=w.select("table").attr("width","100%").attr("class",m);if(h){var A=y.append("thead"),B=A.append("tr");l.forEach(function(a){B.append("th").attr("width",a.width?a.width:"10%").style("text-align","numeric"==a.type?"right":"left").append("span").text(a.label)})}var C=z.selectAll("tbody").data(function(a){return a});C.enter().append("tbody"),s=d3.max(v,function(a){return a.depth}),u.size([d,s*k]);var D=C.selectAll("tr").data(function(a){return a.filter(function(a){return i&&!a.children?i(a):!0})},function(a,b){return a.id||a.id||++r});D.exit().remove(),D.select("img.nv-treeicon").attr("src",e).classed("folded",f);var E=D.enter().append("tr");l.forEach(function(a,b){var d=E.append("td").style("padding-left",function(a){return(b?0:a.depth*k+12+(e(a)?0:16))+"px"},"important").style("text-align","numeric"==a.type?"right":"left");0==b&&d.append("img").classed("nv-treeicon",!0).classed("nv-folded",f).attr("src",e).style("width","14px").style("height","14px").style("padding","0 1px").style("display",function(a){return e(a)?"inline-block":"none"}).on("click",c),d.each(function(c){!b&&q(c)?d3.select(this).append("a").attr("href",q).attr("class",d3.functor(a.classes)).append("span"):d3.select(this).append("span"),d3.select(this).select("span").attr("class",d3.functor(a.classes)).text(function(b){return a.format?a.format(b):b[a.key]||"-"})}),a.showCount&&(d.append("span").attr("class","nv-childrenCount"),D.selectAll("span.nv-childrenCount").text(function(a){return a.values&&a.values.length||a._values&&a._values.length?"("+(a.values&&a.values.filter(function(a){return i?i(a):!0}).length||a._values&&a._values.filter(function(a){return i?i(a):!0}).length||0)+")":""}))}),D.order().on("click",function(a){p.elementClick({row:this,data:a,pos:[a.x,a.y]})}).on("dblclick",function(a){p.elementDblclick({row:this,data:a,pos:[a.x,a.y]})}).on("mouseover",function(a){p.elementMouseover({row:this,data:a,pos:[a.x,a.y]})}).on("mouseout",function(a){p.elementMouseout({row:this,data:a,pos:[a.x,a.y]})})}),a}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=g.utils.defaultColor(),f=Math.floor(1e4*Math.random()),h=!0,i=!1,j="No Data Available.",k=20,l=[{key:"key",label:"Name",type:"text"}],m=null,n="images/grey-plus.png",o="images/grey-minus.png",p=d3.dispatch("elementClick","elementDblclick","elementMouseover","elementMouseout"),q=function(a){return a.url},r=0;return a.options=g.utils.optionsFunc.bind(a),a.margin=function(c){return arguments.length?(b.top="undefined"!=typeof c.top?c.top:b.top,b.right="undefined"!=typeof c.right?c.right:b.right,b.bottom="undefined"!=typeof c.bottom?c.bottom:b.bottom,b.left="undefined"!=typeof c.left?c.left:b.left,a):b},a.width=function(b){return arguments.length?(c=b,a):c},a.height=function(b){return arguments.length?(d=b,a):d},a.color=function(b){return arguments.length?(e=g.utils.getColor(b),scatter.color(e),a):e},a.id=function(b){return arguments.length?(f=b,a):f},a.header=function(b){return arguments.length?(h=b,a):h},a.noData=function(b){return arguments.length?(j=b,a):j},a.filterZero=function(b){return arguments.length?(i=b,a):i},a.columns=function(b){return arguments.length?(l=b,a):l},a.tableClass=function(b){return arguments.length?(m=b,a):m},a.iconOpen=function(b){return arguments.length?(n=b,a):n},a.iconClose=function(b){return arguments.length?(o=b,a):o},a.getUrl=function(b){return arguments.length?(q=b,a):q},a},g.models.legend=function(){function a(m){return m.each(function(a){var m=c-b.left-b.right,n=d3.select(this),o=n.selectAll("g.nv-legend").data([a]),p=(o.enter().append("g").attr("class","nvd3 nv-legend").append("g"),o.select("g"));o.attr("transform","translate("+b.left+","+b.top+")");var q=p.selectAll(".nv-series").data(function(a){return a}),r=q.enter().append("g").attr("class","nv-series").on("mouseover",function(a,b){l.legendMouseover(a,b)}).on("mouseout",function(a,b){l.legendMouseout(a,b)}).on("click",function(b,c){l.legendClick(b,c),j&&(k?(a.forEach(function(a){a.disabled=!0}),b.disabled=!1):(b.disabled=!b.disabled,a.every(function(a){return a.disabled})&&a.forEach(function(a){a.disabled=!1})),l.stateChange({disabled:a.map(function(a){return!!a.disabled})}))}).on("dblclick",function(b,c){l.legendDblclick(b,c),j&&(a.forEach(function(a){a.disabled=!0}),b.disabled=!1,l.stateChange({disabled:a.map(function(a){return!!a.disabled})}))});if(r.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),r.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8"),q.classed("disabled",function(a){return a.disabled}),q.exit().remove(),q.select("circle").style("fill",function(a,b){return a.color||f(a,b)}).style("stroke",function(a,b){return a.color||f(a,b)}),q.select("text").text(e),h){var s=[];q.each(function(a,b){var c,d=d3.select(this).select("text");try{c=d.node().getComputedTextLength()}catch(e){c=g.utils.calcApproxTextWidth(d)}s.push(c+28)});for(var t=0,u=0,v=[];m>u&&t<s.length;)v[t]=s[t],u+=s[t++];for(0===t&&(t=1);u>m&&t>1;){v=[],t--;for(var w=0;w<s.length;w++)s[w]>(v[w%t]||0)&&(v[w%t]=s[w]);u=v.reduce(function(a,b,c,d){return a+b})}for(var x=[],y=0,z=0;t>y;y++)x[y]=z,z+=v[y];q.attr("transform",function(a,b){return"translate("+x[b%t]+","+(5+20*Math.floor(b/t))+")"}),i?p.attr("transform","translate("+(c-b.right-u)+","+b.top+")"):p.attr("transform","translate(0,"+b.top+")"),d=b.top+b.bottom+20*Math.ceil(s.length/t)}else{var A,B=5,C=5,D=0;q.attr("transform",function(a,d){var e=d3.select(this).select("text").node().getComputedTextLength()+28;return A=C,c<b.left+b.right+A+e&&(C=A=5,B+=20),C+=e,C>D&&(D=C),"translate("+A+","+B+")"}),p.attr("transform","translate("+(c-b.right-D)+","+b.top+")"),d=b.top+b.bottom+B+15}}),a}var b={top:5,right:0,bottom:5,left:0},c=400,d=20,e=function(a){return a.key},f=g.utils.defaultColor(),h=!0,i=!0,j=!0,k=!1,l=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange");return a.dispatch=l,a.options=g.utils.optionsFunc.bind(a),a.margin=function(c){return arguments.length?(b.top="undefined"!=typeof c.top?c.top:b.top,b.right="undefined"!=typeof c.right?c.right:b.right,b.bottom="undefined"!=typeof c.bottom?c.bottom:b.bottom,b.left="undefined"!=typeof c.left?c.left:b.left,a):b},a.width=function(b){return arguments.length?(c=b,a):c},a.height=function(b){return arguments.length?(d=b,a):d},a.key=function(b){return arguments.length?(e=b,a):e},a.color=function(b){return arguments.length?(f=g.utils.getColor(b),a):f},a.align=function(b){return arguments.length?(h=b,a):h},a.rightAlign=function(b){return arguments.length?(i=b,a):i},a.updateState=function(b){return arguments.length?(j=b,a):j},a.radioButtonMode=function(b){return arguments.length?(k=b,a):k},a},g.models.line=function(){function a(r){return r.each(function(a){var r=f-e.left-e.right,s=h-e.top-e.bottom,t=d3.select(this);b=d.xScale(),c=d.yScale(),p=p||b,q=q||c;var u=t.selectAll("g.nv-wrap.nv-line").data([a]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),w=v.append("defs"),x=v.append("g"),y=u.select("g");x.append("g").attr("class","nv-groups"),x.append("g").attr("class","nv-scatterWrap"),u.attr("transform","translate("+e.left+","+e.top+")"),d.width(r).height(s);var z=u.select(".nv-scatterWrap");z.transition().call(d),w.append("clipPath").attr("id","nv-edge-clip-"+d.id()).append("rect"),u.select("#nv-edge-clip-"+d.id()+" rect").attr("width",r).attr("height",s),y.attr("clip-path",n?"url(#nv-edge-clip-"+d.id()+")":""),z.attr("clip-path",n?"url(#nv-edge-clip-"+d.id()+")":"");var A=u.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});A.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),A.exit().remove(),A.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return i(a,b)}).style("stroke",function(a,b){return i(a,b)}),A.transition().style("stroke-opacity",1).style("fill-opacity",.5);var B=A.selectAll("path.nv-area").data(function(a){return m(a)?[a]:[]});B.enter().append("path").attr("class","nv-area").attr("d",function(a){return d3.svg.area().interpolate(o).defined(l).x(function(a,b){return g.utils.NaNtoZero(p(j(a,b)))}).y0(function(a,b){return g.utils.NaNtoZero(q(k(a,b)))}).y1(function(a,b){return q(c.domain()[0]<=0?c.domain()[1]>=0?0:c.domain()[1]:c.domain()[0])}).apply(this,[a.values])}),A.exit().selectAll("path.nv-area").remove(),B.transition().attr("d",function(a){return d3.svg.area().interpolate(o).defined(l).x(function(a,c){return g.utils.NaNtoZero(b(j(a,c)))}).y0(function(a,b){return g.utils.NaNtoZero(c(k(a,b)))}).y1(function(a,b){return c(c.domain()[0]<=0?c.domain()[1]>=0?0:c.domain()[1]:c.domain()[0])}).apply(this,[a.values])});var C=A.selectAll("path.nv-line").data(function(a){return[a.values]});C.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(o).defined(l).x(function(a,b){return g.utils.NaNtoZero(p(j(a,b)))}).y(function(a,b){return g.utils.NaNtoZero(q(k(a,b)))})),C.transition().attr("d",d3.svg.line().interpolate(o).defined(l).x(function(a,c){return g.utils.NaNtoZero(b(j(a,c)))}).y(function(a,b){return g.utils.NaNtoZero(c(k(a,b)))})),p=b.copy(),q=c.copy()}),a}var b,c,d=g.models.scatter(),e={top:0,right:0,bottom:0,left:0},f=960,h=500,i=g.utils.defaultColor(),j=function(a){return a.x},k=function(a){return a.y},l=function(a,b){return!isNaN(k(a,b))&&null!==k(a,b)},m=function(a){return a.area},n=!1,o="linear";d.size(16).sizeDomain([16,256]);var p,q;return a.dispatch=d.dispatch,a.scatter=d,d3.rebind(a,d,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","padData","highlightPoint","clearHighlights"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(e.top="undefined"!=typeof b.top?b.top:e.top,e.right="undefined"!=typeof b.right?b.right:e.right,e.bottom="undefined"!=typeof b.bottom?b.bottom:e.bottom,e.left="undefined"!=typeof b.left?b.left:e.left,a):e},a.width=function(b){return arguments.length?(f=b,a):f},a.height=function(b){return arguments.length?(h=b,a):h},a.x=function(b){return arguments.length?(j=b,d.x(b),a):j},a.y=function(b){return arguments.length?(k=b,d.y(b),a):k},a.clipEdge=function(b){return arguments.length?(n=b,a):n},a.color=function(b){return arguments.length?(i=g.utils.getColor(b),d.color(i),a):i},a.interpolate=function(b){return arguments.length?(o=b,a):o},a.defined=function(b){return arguments.length?(l=b,a):l},a.isArea=function(b){return arguments.length?(m=d3.functor(b),a):m},a},g.models.lineChart=function(){function a(t){return t.each(function(t){var A=d3.select(this),B=this,C=(l||parseInt(A.style("width"))||960)-j.left-j.right,D=(m||parseInt(A.style("height"))||400)-j.top-j.bottom;if(a.update=function(){A.transition().duration(y).call(a)},a.container=this,u.disabled=t.map(function(a){return!!a.disabled}),!v){var E;v={};for(E in u)u[E]instanceof Array?v[E]=u[E].slice(0):v[E]=u[E]}if(!(t&&t.length&&t.filter(function(a){return a.values.length}).length)){var F=A.selectAll(".nv-noData").data([w]);return F.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),F.attr("x",j.left+C/2).attr("y",j.top+D/2).text(function(a){return a}),a}A.selectAll(".nv-noData").remove(),b=d.xScale(),c=d.yScale();var G=A.selectAll("g.nv-wrap.nv-lineChart").data([t]),H=G.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),I=G.select("g");H.append("rect").style("opacity",0),H.append("g").attr("class","nv-x nv-axis"),H.append("g").attr("class","nv-y nv-axis"),H.append("g").attr("class","nv-linesWrap"),H.append("g").attr("class","nv-legendWrap"),H.append("g").attr("class","nv-interactive"),I.select("rect").attr("width",C).attr("height",D),n&&(h.width(C),I.select(".nv-legendWrap").datum(t).call(h),j.top!=h.height()&&(j.top=h.height(),D=(m||parseInt(A.style("height"))||400)-j.top-j.bottom),G.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")),G.attr("transform","translate("+j.left+","+j.top+")"),q&&I.select(".nv-y.nv-axis").attr("transform","translate("+C+",0)"),r&&(i.width(C).height(D).margin({left:j.left,top:j.top}).svgContainer(A).xScale(b),G.select(".nv-interactive").call(i)),d.width(C).height(D).color(t.map(function(a,b){return a.color||k(a,b)}).filter(function(a,b){return!t[b].disabled}));var J=I.select(".nv-linesWrap").datum(t.filter(function(a){return!a.disabled}));J.transition().call(d),o&&(e.scale(b).ticks(C/100).tickSize(-D,0),I.select(".nv-x.nv-axis").attr("transform","translate(0,"+c.range()[0]+")"),I.select(".nv-x.nv-axis").transition().call(e)),p&&(f.scale(c).ticks(D/36).tickSize(-C,0),I.select(".nv-y.nv-axis").transition().call(f)),h.dispatch.on("stateChange",function(b){u=b,x.stateChange(u),a.update()}),i.dispatch.on("elementMousemove",function(b){d.clearHighlights();var c,h,l,m=[];if(t.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e,f){h=g.interactiveBisect(e.values,b.pointXValue,a.x()),d.highlightPoint(f,h,!0);var i=e.values[h];"undefined"!=typeof i&&("undefined"==typeof c&&(c=i),"undefined"==typeof l&&(l=a.xScale()(a.x()(i,h))),m.push({key:e.key,value:a.y()(i,h),color:k(e,e.seriesIndex)}))}),m.length>2){var n=a.yScale().invert(b.mouseY),o=Math.abs(a.yScale().domain()[0]-a.yScale().domain()[1]),p=.03*o,q=g.nearestValueIndex(m.map(function(a){return a.value}),n,p);null!==q&&(m[q].highlight=!0)}var r=e.tickFormat()(a.x()(c,h));i.tooltip.position({left:l+j.left,top:b.mouseY+j.top}).chartContainer(B.parentNode).enabled(s).valueFormatter(function(a,b){return f.tickFormat()(a)}).data({value:r,series:m})(),i.renderGuideLine(l)}),i.dispatch.on("elementMouseout",function(a){x.tooltipHide(),d.clearHighlights()}),x.on("tooltipShow",function(a){s&&z(a,B.parentNode)}),x.on("changeState",function(b){"undefined"!=typeof b.disabled&&(t.forEach(function(a,c){a.disabled=b.disabled[c]}),u.disabled=b.disabled),a.update()})}),a}var b,c,d=g.models.line(),e=g.models.axis(),f=g.models.axis(),h=g.models.legend(),i=g.interactiveGuideline(),j={top:30,right:20,bottom:50,left:60},k=g.utils.defaultColor(),l=null,m=null,n=!0,o=!0,p=!0,q=!1,r=!1,s=!0,t=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},u={},v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),y=250;e.orient("bottom").tickPadding(7),f.orient(q?"right":"left");var z=function(b,c){var h=b.pos[0]+(c.offsetLeft||0),i=b.pos[1]+(c.offsetTop||0),j=e.tickFormat()(d.x()(b.point,b.pointIndex)),k=f.tickFormat()(d.y()(b.point,b.pointIndex)),l=t(b.series.key,j,k,b,a);g.tooltip.show([h,i],l,null,null,c)};return d.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],x.tooltipShow(a)}),d.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&g.tooltip.cleanup()}),a.dispatch=x,a.lines=d,a.legend=h,a.xAxis=e,a.yAxis=f,a.interactiveLayer=i,d3.rebind(a,d,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id","interpolate"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(l=b,a):l},a.height=function(b){return arguments.length?(m=b,a):m},a.color=function(b){return arguments.length?(k=g.utils.getColor(b),h.color(k),a):k},a.showLegend=function(b){return arguments.length?(n=b,a):n},a.showXAxis=function(b){return arguments.length?(o=b,a):o},a.showYAxis=function(b){return arguments.length?(p=b,a):p},a.rightAlignYAxis=function(b){return arguments.length?(q=b,f.orient(b?"right":"left"),a):q},a.useInteractiveGuideline=function(b){return arguments.length?(r=b,b===!0&&(a.interactive(!1),a.useVoronoi(!1)),a):r},a.tooltips=function(b){return arguments.length?(s=b,a):s},a.tooltipContent=function(b){return arguments.length?(t=b,a):t},a.state=function(b){return arguments.length?(u=b,a):u},a.defaultState=function(b){return arguments.length?(v=b,a):v},a.noData=function(b){return arguments.length?(w=b,a):w},a.transitionDuration=function(b){return arguments.length?(y=b,a):y},a},g.models.linePlusBarChart=function(){function a(g){return g.each(function(g){var o=d3.select(this),p=this,t=(m||parseInt(o.style("width"))||960)-l.left-l.right,z=(n||parseInt(o.style("height"))||400)-l.top-l.bottom;if(a.update=function(){o.transition().call(a)},u.disabled=g.map(function(a){return!!a.disabled}),!v){var A;v={};for(A in u)u[A]instanceof Array?v[A]=u[A].slice(0):v[A]=u[A]}if(!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var B=o.selectAll(".nv-noData").data([w]);return B.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),B.attr("x",l.left+t/2).attr("y",l.top+z/2).text(function(a){return a}),a}o.selectAll(".nv-noData").remove();var C=g.filter(function(a){return!a.disabled&&a.bar}),D=g.filter(function(a){return!a.bar});b=D.filter(function(a){return!a.disabled}).length&&D.filter(function(a){return!a.disabled})[0].values.length?e.xScale():f.xScale(),c=f.yScale(),
d=e.yScale();var E=d3.select(this).selectAll("g.nv-wrap.nv-linePlusBar").data([g]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y1 nv-axis"),F.append("g").attr("class","nv-y2 nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-linesWrap"),F.append("g").attr("class","nv-legendWrap"),r&&(k.width(t/2),G.select(".nv-legendWrap").datum(g.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?" (left axis)":" (right axis)"),a})).call(k),l.top!=k.height()&&(l.top=k.height(),z=(n||parseInt(o.style("height"))||400)-l.top-l.bottom),G.select(".nv-legendWrap").attr("transform","translate("+t/2+","+-l.top+")")),E.attr("transform","translate("+l.left+","+l.top+")"),e.width(t).height(z).color(g.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!g[b].disabled&&!g[b].bar})),f.width(t).height(z).color(g.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!g[b].disabled&&g[b].bar}));var H=G.select(".nv-barsWrap").datum(C.length?C:[{values:[]}]),I=G.select(".nv-linesWrap").datum(D[0]&&!D[0].disabled?D:[{values:[]}]);d3.transition(H).call(f),d3.transition(I).call(e),h.scale(b).ticks(t/100).tickSize(-z,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+c.range()[0]+")"),d3.transition(G.select(".nv-x.nv-axis")).call(h),i.scale(c).ticks(z/36).tickSize(-t,0),d3.transition(G.select(".nv-y1.nv-axis")).style("opacity",C.length?1:0).call(i),j.scale(d).ticks(z/36).tickSize(C.length?0:-t,0),G.select(".nv-y2.nv-axis").style("opacity",D.length?1:0).attr("transform","translate("+t+",0)"),d3.transition(G.select(".nv-y2.nv-axis")).call(j),k.dispatch.on("stateChange",function(b){u=b,x.stateChange(u),a.update()}),x.on("tooltipShow",function(a){s&&y(a,p.parentNode)}),x.on("changeState",function(b){"undefined"!=typeof b.disabled&&(g.forEach(function(a,c){a.disabled=b.disabled[c]}),u.disabled=b.disabled),a.update()})}),a}var b,c,d,e=g.models.line(),f=g.models.historicalBar(),h=g.models.axis(),i=g.models.axis(),j=g.models.axis(),k=g.models.legend(),l={top:30,right:60,bottom:50,left:60},m=null,n=null,o=function(a){return a.x},p=function(a){return a.y},q=g.utils.defaultColor(),r=!0,s=!0,t=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},u={},v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");f.padData(!0),e.clipEdge(!1).padData(!0),h.orient("bottom").tickPadding(7).highlightZero(!1),i.orient("left"),j.orient("right");var y=function(b,c){var d=b.pos[0]+(c.offsetLeft||0),f=b.pos[1]+(c.offsetTop||0),k=h.tickFormat()(e.x()(b.point,b.pointIndex)),l=(b.series.bar?i:j).tickFormat()(e.y()(b.point,b.pointIndex)),m=t(b.series.key,k,l,b,a);g.tooltip.show([d,f],m,b.value<0?"n":"s",null,c)};return e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+l.left,a.pos[1]+l.top],x.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),f.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+l.left,a.pos[1]+l.top],x.tooltipShow(a)}),f.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&g.tooltip.cleanup()}),a.dispatch=x,a.legend=k,a.lines=e,a.bars=f,a.xAxis=h,a.y1Axis=i,a.y2Axis=j,d3.rebind(a,e,"defined","size","clipVoronoi","interpolate"),a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(o=b,e.x(b),f.x(b),a):o},a.y=function(b){return arguments.length?(p=b,e.y(b),f.y(b),a):p},a.margin=function(b){return arguments.length?(l.top="undefined"!=typeof b.top?b.top:l.top,l.right="undefined"!=typeof b.right?b.right:l.right,l.bottom="undefined"!=typeof b.bottom?b.bottom:l.bottom,l.left="undefined"!=typeof b.left?b.left:l.left,a):l},a.width=function(b){return arguments.length?(m=b,a):m},a.height=function(b){return arguments.length?(n=b,a):n},a.color=function(b){return arguments.length?(q=g.utils.getColor(b),k.color(q),a):q},a.showLegend=function(b){return arguments.length?(r=b,a):r},a.tooltips=function(b){return arguments.length?(s=b,a):s},a.tooltipContent=function(b){return arguments.length?(t=b,a):t},a.state=function(b){return arguments.length?(u=b,a):u},a.defaultState=function(b){return arguments.length?(v=b,a):v},a.noData=function(b){return arguments.length?(w=b,a):w},a},g.models.lineWithFocusChart=function(){function a(g){return g.each(function(g){function x(a){var b=+("e"==a),c=b?1:-1,d=I/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function C(){n.empty()||n.extent(v),Q.data([n.empty()?d.domain():v]).each(function(a,c){var e=d(a[0])-b.range()[0],f=b.range()[1]-d(a[1]);d3.select(this).select(".left").attr("width",0>e?0:e),d3.select(this).select(".right").attr("x",d(a[1])).attr("width",0>f?0:f)})}function D(){v=n.empty()?null:n.extent();var a=n.empty()?d.domain():n.extent();if(!(Math.abs(a[0]-a[1])<=1)){z.brush({extent:a,brush:n}),C();var b=M.select(".nv-focus .nv-linesWrap").datum(g.filter(function(a){return!a.disabled}).map(function(b,c){return{key:b.key,values:b.values.filter(function(b,c){return f.x()(b,c)>=a[0]&&f.x()(b,c)<=a[1]})}}));b.transition().duration(A).call(f),M.select(".nv-focus .nv-x.nv-axis").transition().duration(A).call(i),M.select(".nv-focus .nv-y.nv-axis").transition().duration(A).call(j)}}var E=d3.select(this),F=this,G=(r||parseInt(E.style("width"))||960)-o.left-o.right,H=(s||parseInt(E.style("height"))||400)-o.top-o.bottom-t,I=t-p.top-p.bottom;if(a.update=function(){E.transition().duration(A).call(a)},a.container=this,!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var J=E.selectAll(".nv-noData").data([y]);return J.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),J.attr("x",o.left+G/2).attr("y",o.top+H/2).text(function(a){return a}),a}E.selectAll(".nv-noData").remove(),b=f.xScale(),c=f.yScale(),d=h.xScale(),e=h.yScale();var K=E.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([g]),L=K.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),M=K.select("g");L.append("g").attr("class","nv-legendWrap");var N=L.append("g").attr("class","nv-focus");N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-linesWrap");var O=L.append("g").attr("class","nv-context");O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-linesWrap"),O.append("g").attr("class","nv-brushBackground"),O.append("g").attr("class","nv-x nv-brush"),u&&(m.width(G),M.select(".nv-legendWrap").datum(g).call(m),o.top!=m.height()&&(o.top=m.height(),H=(s||parseInt(E.style("height"))||400)-o.top-o.bottom-t),M.select(".nv-legendWrap").attr("transform","translate(0,"+-o.top+")")),K.attr("transform","translate("+o.left+","+o.top+")"),f.width(G).height(H).color(g.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!g[b].disabled})),h.defined(f.defined()).width(G).height(I).color(g.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!g[b].disabled})),M.select(".nv-context").attr("transform","translate(0,"+(H+o.bottom+p.top)+")");var P=M.select(".nv-context .nv-linesWrap").datum(g.filter(function(a){return!a.disabled}));d3.transition(P).call(h),i.scale(b).ticks(G/100).tickSize(-H,0),j.scale(c).ticks(H/36).tickSize(-G,0),M.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+H+")"),n.x(d).on("brush",function(){var b=a.transitionDuration();a.transitionDuration(0),D(),a.transitionDuration(b)}),v&&n.extent(v);var Q=M.select(".nv-brushBackground").selectAll("g").data([v||n.extent()]),R=Q.enter().append("g");R.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",I),R.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",I);var S=M.select(".nv-x.nv-brush").call(n);S.selectAll("rect").attr("height",I),S.selectAll(".resize").append("path").attr("d",x),D(),k.scale(d).ticks(G/100).tickSize(-I,0),M.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),d3.transition(M.select(".nv-context .nv-x.nv-axis")).call(k),l.scale(e).ticks(I/36).tickSize(-G,0),d3.transition(M.select(".nv-context .nv-y.nv-axis")).call(l),M.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),m.dispatch.on("stateChange",function(b){a.update()}),z.on("tooltipShow",function(a){w&&B(a,F.parentNode)})}),a}var b,c,d,e,f=g.models.line(),h=g.models.line(),i=g.models.axis(),j=g.models.axis(),k=g.models.axis(),l=g.models.axis(),m=g.models.legend(),n=d3.svg.brush(),o={top:30,right:30,bottom:30,left:60},p={top:0,right:30,bottom:20,left:60},q=g.utils.defaultColor(),r=null,s=null,t=100,u=!0,v=null,w=!0,x=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},y="No Data Available.",z=d3.dispatch("tooltipShow","tooltipHide","brush"),A=250;f.clipEdge(!0),h.interactive(!1),i.orient("bottom").tickPadding(5),j.orient("left"),k.orient("bottom").tickPadding(5),l.orient("left");var B=function(b,c){var d=b.pos[0]+(c.offsetLeft||0),e=b.pos[1]+(c.offsetTop||0),h=i.tickFormat()(f.x()(b.point,b.pointIndex)),k=j.tickFormat()(f.y()(b.point,b.pointIndex)),l=x(b.series.key,h,k,b,a);g.tooltip.show([d,e],l,null,null,c)};return f.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+o.left,a.pos[1]+o.top],z.tooltipShow(a)}),f.dispatch.on("elementMouseout.tooltip",function(a){z.tooltipHide(a)}),z.on("tooltipHide",function(){w&&g.tooltip.cleanup()}),a.dispatch=z,a.legend=m,a.lines=f,a.lines2=h,a.xAxis=i,a.yAxis=j,a.x2Axis=k,a.y2Axis=l,d3.rebind(a,f,"defined","isArea","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(f.x(b),h.x(b),a):f.x},a.y=function(b){return arguments.length?(f.y(b),h.y(b),a):f.y},a.margin=function(b){return arguments.length?(o.top="undefined"!=typeof b.top?b.top:o.top,o.right="undefined"!=typeof b.right?b.right:o.right,o.bottom="undefined"!=typeof b.bottom?b.bottom:o.bottom,o.left="undefined"!=typeof b.left?b.left:o.left,a):o},a.margin2=function(b){return arguments.length?(p=b,a):p},a.width=function(b){return arguments.length?(r=b,a):r},a.height=function(b){return arguments.length?(s=b,a):s},a.height2=function(b){return arguments.length?(t=b,a):t},a.color=function(b){return arguments.length?(q=g.utils.getColor(b),m.color(q),a):q},a.showLegend=function(b){return arguments.length?(u=b,a):u},a.tooltips=function(b){return arguments.length?(w=b,a):w},a.tooltipContent=function(b){return arguments.length?(x=b,a):x},a.interpolate=function(b){return arguments.length?(f.interpolate(b),h.interpolate(b),a):f.interpolate()},a.noData=function(b){return arguments.length?(y=b,a):y},a.xTickFormat=function(b){return arguments.length?(i.tickFormat(b),k.tickFormat(b),a):i.tickFormat()},a.yTickFormat=function(b){return arguments.length?(j.tickFormat(b),l.tickFormat(b),a):j.tickFormat()},a.brushExtent=function(b){return arguments.length?(v=b,a):v},a.transitionDuration=function(b){return arguments.length?(A=b,a):A},a},g.models.linePlusBarWithFocusChart=function(){function a(g){return g.each(function(g){function G(a){var b=+("e"==a),c=b?1:-1,d=R/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function L(){u.empty()||u.extent(E),ca.data([u.empty()?d.domain():E]).each(function(a,b){var c=d(a[0])-d.range()[0],e=d.range()[1]-d(a[1]);d3.select(this).select(".left").attr("width",0>c?0:c),d3.select(this).select(".right").attr("x",d(a[1])).attr("width",0>e?0:e)})}function M(){E=u.empty()?null:u.extent(),b=u.empty()?d.domain():u.extent(),I.brush({extent:b,brush:u}),L(),l.width(P).height(Q).color(g.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!g[b].disabled&&g[b].bar})),j.width(P).height(Q).color(g.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!g[b].disabled&&!g[b].bar}));var a=Z.select(".nv-focus .nv-barsWrap").datum(T.length?T.map(function(a,c){return{key:a.key,values:a.values.filter(function(a,c){return l.x()(a,c)>=b[0]&&l.x()(a,c)<=b[1]})}}):[{values:[]}]),h=Z.select(".nv-focus .nv-linesWrap").datum(U[0].disabled?[{values:[]}]:U.map(function(a,c){return{key:a.key,values:a.values.filter(function(a,c){return j.x()(a,c)>=b[0]&&j.x()(a,c)<=b[1]})}}));c=T.length?l.xScale():j.xScale(),n.scale(c).ticks(P/100).tickSize(-Q,0),n.domain([Math.ceil(b[0]),Math.floor(b[1])]),Z.select(".nv-x.nv-axis").transition().duration(J).call(n),a.transition().duration(J).call(l),h.transition().duration(J).call(j),Z.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),p.scale(e).ticks(Q/36).tickSize(-P,0),Z.select(".nv-focus .nv-y1.nv-axis").style("opacity",T.length?1:0),q.scale(f).ticks(Q/36).tickSize(T.length?0:-P,0),Z.select(".nv-focus .nv-y2.nv-axis").style("opacity",U.length?1:0).attr("transform","translate("+c.range()[1]+",0)"),Z.select(".nv-focus .nv-y1.nv-axis").transition().duration(J).call(p),Z.select(".nv-focus .nv-y2.nv-axis").transition().duration(J).call(q)}var N=d3.select(this),O=this,P=(x||parseInt(N.style("width"))||960)-v.left-v.right,Q=(y||parseInt(N.style("height"))||400)-v.top-v.bottom-z,R=z-w.top-w.bottom;if(a.update=function(){N.transition().duration(J).call(a)},a.container=this,!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var S=N.selectAll(".nv-noData").data([H]);return S.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),S.attr("x",v.left+P/2).attr("y",v.top+Q/2).text(function(a){return a}),a}N.selectAll(".nv-noData").remove();var T=g.filter(function(a){return!a.disabled&&a.bar}),U=g.filter(function(a){return!a.bar});c=l.xScale(),d=o.scale(),e=l.yScale(),f=j.yScale(),h=m.yScale(),i=k.yScale();var V=g.filter(function(a){return!a.disabled&&a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})}),W=g.filter(function(a){return!a.disabled&&!a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})});c.range([0,P]),d.domain(d3.extent(d3.merge(V.concat(W)),function(a){return a.x})).range([0,P]);var X=N.selectAll("g.nv-wrap.nv-linePlusBar").data([g]),Y=X.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),Z=X.select("g");Y.append("g").attr("class","nv-legendWrap");var $=Y.append("g").attr("class","nv-focus");$.append("g").attr("class","nv-x nv-axis"),$.append("g").attr("class","nv-y1 nv-axis"),$.append("g").attr("class","nv-y2 nv-axis"),$.append("g").attr("class","nv-barsWrap"),$.append("g").attr("class","nv-linesWrap");var _=Y.append("g").attr("class","nv-context");_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y1 nv-axis"),_.append("g").attr("class","nv-y2 nv-axis"),_.append("g").attr("class","nv-barsWrap"),_.append("g").attr("class","nv-linesWrap"),_.append("g").attr("class","nv-brushBackground"),_.append("g").attr("class","nv-x nv-brush"),D&&(t.width(P/2),Z.select(".nv-legendWrap").datum(g.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?" (left axis)":" (right axis)"),a})).call(t),v.top!=t.height()&&(v.top=t.height(),Q=(y||parseInt(N.style("height"))||400)-v.top-v.bottom-z),Z.select(".nv-legendWrap").attr("transform","translate("+P/2+","+-v.top+")")),X.attr("transform","translate("+v.left+","+v.top+")"),m.width(P).height(R).color(g.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!g[b].disabled&&g[b].bar})),k.width(P).height(R).color(g.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!g[b].disabled&&!g[b].bar}));var aa=Z.select(".nv-context .nv-barsWrap").datum(T.length?T:[{values:[]}]),ba=Z.select(".nv-context .nv-linesWrap").datum(U[0].disabled?[{values:[]}]:U);Z.select(".nv-context").attr("transform","translate(0,"+(Q+v.bottom+w.top)+")"),aa.transition().call(m),ba.transition().call(k),u.x(d).on("brush",M),E&&u.extent(E);var ca=Z.select(".nv-brushBackground").selectAll("g").data([E||u.extent()]),da=ca.enter().append("g");da.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",R),da.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",R);var ea=Z.select(".nv-x.nv-brush").call(u);ea.selectAll("rect").attr("height",R),ea.selectAll(".resize").append("path").attr("d",G),o.ticks(P/100).tickSize(-R,0),Z.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+h.range()[0]+")"),Z.select(".nv-context .nv-x.nv-axis").transition().call(o),r.scale(h).ticks(R/36).tickSize(-P,0),Z.select(".nv-context .nv-y1.nv-axis").style("opacity",T.length?1:0).attr("transform","translate(0,"+d.range()[0]+")"),Z.select(".nv-context .nv-y1.nv-axis").transition().call(r),s.scale(i).ticks(R/36).tickSize(T.length?0:-P,0),Z.select(".nv-context .nv-y2.nv-axis").style("opacity",U.length?1:0).attr("transform","translate("+d.range()[1]+",0)"),Z.select(".nv-context .nv-y2.nv-axis").transition().call(s),t.dispatch.on("stateChange",function(b){a.update()}),I.on("tooltipShow",function(a){F&&K(a,O.parentNode)}),M()}),a}var b,c,d,e,f,h,i,j=g.models.line(),k=g.models.line(),l=g.models.historicalBar(),m=g.models.historicalBar(),n=g.models.axis(),o=g.models.axis(),p=g.models.axis(),q=g.models.axis(),r=g.models.axis(),s=g.models.axis(),t=g.models.legend(),u=d3.svg.brush(),v={top:30,right:30,bottom:30,left:60},w={top:0,right:30,bottom:20,left:60},x=null,y=null,z=100,A=function(a){return a.x},B=function(a){return a.y},C=g.utils.defaultColor(),D=!0,E=null,F=!0,G=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},H="No Data Available.",I=d3.dispatch("tooltipShow","tooltipHide","brush"),J=0;j.clipEdge(!0),k.interactive(!1),n.orient("bottom").tickPadding(5),p.orient("left"),q.orient("right"),o.orient("bottom").tickPadding(5),r.orient("left"),s.orient("right");var K=function(c,d){b&&(c.pointIndex+=Math.ceil(b[0]));var e=c.pos[0]+(d.offsetLeft||0),f=c.pos[1]+(d.offsetTop||0),h=n.tickFormat()(j.x()(c.point,c.pointIndex)),i=(c.series.bar?p:q).tickFormat()(j.y()(c.point,c.pointIndex)),k=G(c.series.key,h,i,c,a);g.tooltip.show([e,f],k,c.value<0?"n":"s",null,d)};return j.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+v.left,a.pos[1]+v.top],I.tooltipShow(a)}),j.dispatch.on("elementMouseout.tooltip",function(a){I.tooltipHide(a)}),l.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+v.left,a.pos[1]+v.top],I.tooltipShow(a)}),l.dispatch.on("elementMouseout.tooltip",function(a){I.tooltipHide(a)}),I.on("tooltipHide",function(){F&&g.tooltip.cleanup()}),a.dispatch=I,a.legend=t,a.lines=j,a.lines2=k,a.bars=l,a.bars2=m,a.xAxis=n,a.x2Axis=o,a.y1Axis=p,a.y2Axis=q,a.y3Axis=r,a.y4Axis=s,d3.rebind(a,j,"defined","size","clipVoronoi","interpolate"),a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(A=b,j.x(b),l.x(b),a):A},a.y=function(b){return arguments.length?(B=b,j.y(b),l.y(b),a):B},a.margin=function(b){return arguments.length?(v.top="undefined"!=typeof b.top?b.top:v.top,v.right="undefined"!=typeof b.right?b.right:v.right,v.bottom="undefined"!=typeof b.bottom?b.bottom:v.bottom,v.left="undefined"!=typeof b.left?b.left:v.left,a):v},a.width=function(b){return arguments.length?(x=b,a):x},a.height=function(b){return arguments.length?(y=b,a):y},a.color=function(b){return arguments.length?(C=g.utils.getColor(b),t.color(C),a):C},a.showLegend=function(b){return arguments.length?(D=b,a):D},a.tooltips=function(b){return arguments.length?(F=b,a):F},a.tooltipContent=function(b){return arguments.length?(G=b,a):G},a.noData=function(b){return arguments.length?(H=b,a):H},a.brushExtent=function(b){return arguments.length?(E=b,a):E},a},g.models.multiBar=function(){function a(g){return g.each(function(a){var g=k-j.left-j.right,B=l-j.top-j.bottom,C=d3.select(this);w&&a.length&&(w=[{values:a[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),t&&(a=d3.layout.stack().offset(u).values(function(a){return a.values}).y(q)(!a.length&&w?w:a)),a.forEach(function(a,b){a.values.forEach(function(a){a.series=b})}),t&&a[0].values.map(function(b,c){var d=0,e=0;a.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e,e-=b.size):(b.y1=b.size+d,d+=b.size)})});var D=c&&d?[]:a.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0,y1:a.y1}})});m.domain(c||d3.merge(D).map(function(a){return a.x})).rangeBands(e||[0,g],z),n.domain(d||d3.extent(d3.merge(D).map(function(a){return t?a.y>0?a.y1:a.y1+a.y:a.y}).concat(r))).range(f||[B,0]),m.domain()[0]===m.domain()[1]&&(m.domain()[0]?m.domain([m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]):m.domain([-1,1])),n.domain()[0]===n.domain()[1]&&(n.domain()[0]?n.domain([n.domain()[0]+.01*n.domain()[0],n.domain()[1]-.01*n.domain()[1]]):n.domain([-1,1])),h=h||m,i=i||n;var E=C.selectAll("g.nv-wrap.nv-multibar").data([a]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),G=F.append("defs"),H=F.append("g"),I=E.select("g");H.append("g").attr("class","nv-groups"),E.attr("transform","translate("+j.left+","+j.top+")"),G.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),E.select("#nv-edge-clip-"+o+" rect").attr("width",g).attr("height",B),I.attr("clip-path",s?"url(#nv-edge-clip-"+o+")":"");var J=E.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});J.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),J.exit().transition().selectAll("rect.nv-bar").delay(function(b,c){return c*y/a[0].values.length}).attr("y",function(a){return i(t?a.y0:0)}).attr("height",0).remove(),J.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return v(a,b)}).style("stroke",function(a,b){return v(a,b)}),J.transition().style("stroke-opacity",1).style("fill-opacity",.75);var K=J.selectAll("rect.nv-bar").data(function(b){return w&&!a.length?w.values:b.values});K.exit().remove();K.enter().append("rect").attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(b,c,d){return t?0:d*m.rangeBand()/a.length}).attr("y",function(a){return i(t?a.y0:0)}).attr("height",0).attr("width",m.rangeBand()/(t?1:a.length)).attr("transform",function(a,b){return"translate("+m(p(a,b))+",0)"});K.style("fill",function(a,b,c){return v(a,c,b)}).style("stroke",function(a,b,c){return v(a,c,b)}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),A.elementMouseover({value:q(b,c),point:b,series:a[b.series],pos:[m(p(b,c))+m.rangeBand()*(t?a.length/2:b.series+.5)/a.length,n(q(b,c)+(t?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),A.elementMouseout({value:q(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){A.elementClick({value:q(b,c),point:b,series:a[b.series],pos:[m(p(b,c))+m.rangeBand()*(t?a.length/2:b.series+.5)/a.length,n(q(b,c)+(t?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){A.elementDblClick({value:q(b,c),point:b,series:a[b.series],pos:[m(p(b,c))+m.rangeBand()*(t?a.length/2:b.series+.5)/a.length,n(q(b,c)+(t?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}),K.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).transition().attr("transform",function(a,b){return"translate("+m(p(a,b))+",0)"}),x&&(b||(b=a.map(function(){return!0})),K.style("fill",function(a,c,d){return d3.rgb(x(a,c)).darker(b.map(function(a,b){return b}).filter(function(a,c){return!b[c]})[d]).toString()}).style("stroke",function(a,c,d){return d3.rgb(x(a,c)).darker(b.map(function(a,b){return b}).filter(function(a,c){return!b[c]})[d]).toString()})),t?K.transition().delay(function(b,c){return c*y/a[0].values.length}).attr("y",function(a,b){return n(t?a.y1:0)}).attr("height",function(a,b){return Math.max(Math.abs(n(a.y+(t?a.y0:0))-n(t?a.y0:0)),1)}).attr("x",function(b,c){return t?0:b.series*m.rangeBand()/a.length}).attr("width",m.rangeBand()/(t?1:a.length)):K.transition().delay(function(b,c){return c*y/a[0].values.length}).attr("x",function(b,c){return b.series*m.rangeBand()/a.length}).attr("width",m.rangeBand()/a.length).attr("y",function(a,b){return q(a,b)<0?n(0):n(0)-n(q(a,b))<1?n(0)-1:n(q(a,b))||0}).attr("height",function(a,b){return Math.max(Math.abs(n(q(a,b))-n(0)),1)||0}),h=m.copy(),i=n.copy()}),a}var b,c,d,e,f,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=d3.scale.ordinal(),n=d3.scale.linear(),o=Math.floor(1e4*Math.random()),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=!0,t=!1,u="zero",v=g.utils.defaultColor(),w=!1,x=null,y=1200,z=.1,A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return a.dispatch=A,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(p=b,a):p},a.y=function(b){return arguments.length?(q=b,a):q},a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.xScale=function(b){return arguments.length?(m=b,a):m},a.yScale=function(b){return arguments.length?(n=b,a):n},a.xDomain=function(b){return arguments.length?(c=b,a):c},a.yDomain=function(b){return arguments.length?(d=b,a):d},a.xRange=function(b){return arguments.length?(e=b,a):e},a.yRange=function(b){return arguments.length?(f=b,a):f},a.forceY=function(b){return arguments.length?(r=b,a):r},a.stacked=function(b){return arguments.length?(t=b,a):t},a.stackOffset=function(b){return arguments.length?(u=b,a):u},a.clipEdge=function(b){return arguments.length?(s=b,a):s},a.color=function(b){return arguments.length?(v=g.utils.getColor(b),a):v},a.barColor=function(b){return arguments.length?(x=g.utils.getColor(b),a):x},a.disabled=function(c){return arguments.length?(b=c,a):b},a.id=function(b){return arguments.length?(o=b,a):o},a.hideable=function(b){return arguments.length?(w=b,a):w},a.delay=function(b){return arguments.length?(y=b,a):y},a.groupSpacing=function(b){return arguments.length?(z=b,a):z},a},g.models.multiBarChart=function(){function a(g){return g.each(function(g){var w=d3.select(this),E=this,F=(k||parseInt(w.style("width"))||960)-j.left-j.right,G=(l||parseInt(w.style("height"))||400)-j.top-j.bottom;if(a.update=function(){w.transition().duration(C).call(a)},a.container=this,x.disabled=g.map(function(a){return!!a.disabled}),!y){var H;y={};for(H in x)x[H]instanceof Array?y[H]=x[H].slice(0):y[H]=x[H]}if(!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var I=w.selectAll(".nv-noData").data([z]);return I.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),I.attr("x",j.left+F/2).attr("y",j.top+G/2).text(function(a){return a}),a}w.selectAll(".nv-noData").remove(),b=d.xScale(),c=d.yScale();var J=w.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([g]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),L=J.select("g");if(K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y nv-axis"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-legendWrap"),K.append("g").attr("class","nv-controlsWrap"),o&&(h.width(F-B()),d.barColor()&&g.forEach(function(a,b){a.color=d3.rgb("#ccc").darker(1.5*b).toString()}),L.select(".nv-legendWrap").datum(g).call(h),j.top!=h.height()&&(j.top=h.height(),G=(l||parseInt(w.style("height"))||400)-j.top-j.bottom),L.select(".nv-legendWrap").attr("transform","translate("+B()+","+-j.top+")")),n){var M=[{key:"Grouped",disabled:d.stacked()},{key:"Stacked",disabled:!d.stacked()}];i.width(B()).color(["#444","#444","#444"]),L.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-j.top+")").call(i)}J.attr("transform","translate("+j.left+","+j.top+")"),r&&L.select(".nv-y.nv-axis").attr("transform","translate("+F+",0)"),d.disabled(g.map(function(a){return a.disabled})).width(F).height(G).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled}));var N=L.select(".nv-barsWrap").datum(g.filter(function(a){return!a.disabled}));if(N.transition().call(d),p){e.scale(b).ticks(F/100).tickSize(-G,0),L.select(".nv-x.nv-axis").attr("transform","translate(0,"+c.range()[0]+")"),L.select(".nv-x.nv-axis").transition().call(e);var O=L.select(".nv-x.nv-axis > g").selectAll("g");if(O.selectAll("line, text").style("opacity",1),t){var P=function(a,b){return"translate("+a+","+b+")"},Q=5,R=17;O.selectAll("text").attr("transform",function(a,b,c){return P(0,c%2==0?Q:R)});var S=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;L.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(a,b){return P(0,0===b||S%2!==0?R:Q)})}s&&O.filter(function(a,b){return b%Math.ceil(g[0].values.length/(F/100))!==0}).selectAll("text, line").style("opacity",0),u&&O.selectAll(".tick text").attr("transform","rotate("+u+" 0,0)").style("text-anchor",u>0?"start":"end"),L.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}q&&(f.scale(c).ticks(G/36).tickSize(-F,0),L.select(".nv-y.nv-axis").transition().call(f)),h.dispatch.on("stateChange",function(b){x=b,A.stateChange(x),a.update()}),i.dispatch.on("legendClick",function(b,c){if(b.disabled){switch(M=M.map(function(a){return a.disabled=!0,a}),b.disabled=!1,b.key){case"Grouped":d.stacked(!1);break;case"Stacked":d.stacked(!0)}x.stacked=d.stacked(),A.stateChange(x),a.update()}}),A.on("tooltipShow",function(a){v&&D(a,E.parentNode)}),A.on("changeState",function(b){"undefined"!=typeof b.disabled&&(g.forEach(function(a,c){a.disabled=b.disabled[c]}),x.disabled=b.disabled),"undefined"!=typeof b.stacked&&(d.stacked(b.stacked),x.stacked=b.stacked),a.update()})}),a}var b,c,d=g.models.multiBar(),e=g.models.axis(),f=g.models.axis(),h=g.models.legend(),i=g.models.legend(),j={top:30,right:20,bottom:50,left:60},k=null,l=null,m=g.utils.defaultColor(),n=!0,o=!0,p=!0,q=!0,r=!1,s=!0,t=!1,u=0,v=!0,w=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" on "+b+"</p>"},x={stacked:!1},y=null,z="No Data Available.",A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),B=function(){return n?180:0},C=250;d.stacked(!1),e.orient("bottom").tickPadding(7).highlightZero(!0).showMaxMin(!1).tickFormat(function(a){return a}),f.orient(r?"right":"left").tickFormat(d3.format(",.1f")),i.updateState(!1);var D=function(b,c){var h=b.pos[0]+(c.offsetLeft||0),i=b.pos[1]+(c.offsetTop||0),j=e.tickFormat()(d.x()(b.point,b.pointIndex)),k=f.tickFormat()(d.y()(b.point,b.pointIndex)),l=w(b.series.key,j,k,b,a);g.tooltip.show([h,i],l,b.value<0?"n":"s",null,c)};return d.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],A.tooltipShow(a)}),d.dispatch.on("elementMouseout.tooltip",function(a){A.tooltipHide(a)}),A.on("tooltipHide",function(){v&&g.tooltip.cleanup()}),a.dispatch=A,a.multibar=d,a.legend=h,a.xAxis=e,a.yAxis=f,d3.rebind(a,d,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","stacked","stackOffset","delay","barColor","groupSpacing"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,
j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.color=function(b){return arguments.length?(m=g.utils.getColor(b),h.color(m),a):m},a.showControls=function(b){return arguments.length?(n=b,a):n},a.showLegend=function(b){return arguments.length?(o=b,a):o},a.showXAxis=function(b){return arguments.length?(p=b,a):p},a.showYAxis=function(b){return arguments.length?(q=b,a):q},a.rightAlignYAxis=function(b){return arguments.length?(r=b,f.orient(b?"right":"left"),a):r},a.reduceXTicks=function(b){return arguments.length?(s=b,a):s},a.rotateLabels=function(b){return arguments.length?(u=b,a):u},a.staggerLabels=function(b){return arguments.length?(t=b,a):t},a.tooltip=function(b){return arguments.length?(w=b,a):w},a.tooltips=function(b){return arguments.length?(v=b,a):v},a.tooltipContent=function(b){return arguments.length?(w=b,a):w},a.state=function(b){return arguments.length?(x=b,a):x},a.defaultState=function(b){return arguments.length?(y=b,a):y},a.noData=function(b){return arguments.length?(z=b,a):z},a.transitionDuration=function(b){return arguments.length?(C=b,a):C},a},g.models.multiBarHorizontal=function(){function a(g){return g.each(function(a){var g=k-j.left-j.right,m=l-j.top-j.bottom;d3.select(this);u&&(a=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(q)(a)),a.forEach(function(a,b){a.values.forEach(function(a){a.series=b})}),u&&a[0].values.map(function(b,c){var d=0,e=0;a.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e-=b.size):(b.y1=d,d+=b.size)})});var z=c&&d?[]:a.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0,y1:a.y1}})});n.domain(c||d3.merge(z).map(function(a){return a.x})).rangeBands(e||[0,m],.1),o.domain(d||d3.extent(d3.merge(z).map(function(a){return u?a.y>0?a.y1+a.y:a.y1:a.y}).concat(r))),v&&!u?o.range(f||[o.domain()[0]<0?x:0,g-(o.domain()[1]>0?x:0)]):o.range(f||[0,g]),h=h||n,i=i||d3.scale.linear().domain(o.domain()).range([o(0),o(0)]);var B=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([a]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),D=(C.append("defs"),C.append("g"));B.select("g");D.append("g").attr("class","nv-groups"),B.attr("transform","translate("+j.left+","+j.top+")");var E=B.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return s(a,b)}).style("stroke",function(a,b){return s(a,b)}),E.transition().style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data(function(a){return a.values});F.exit().remove();var G=F.enter().append("g").attr("transform",function(b,c,d){return"translate("+i(u?b.y0:0)+","+(u?0:d*n.rangeBand()/a.length+n(p(b,c)))+")"});G.append("rect").attr("width",0).attr("height",n.rangeBand()/(u?1:a.length)),F.on("mouseover",function(b,c){d3.select(this).classed("hover",!0),A.elementMouseover({value:q(b,c),point:b,series:a[b.series],pos:[o(q(b,c)+(u?b.y0:0)),n(p(b,c))+n.rangeBand()*(u?a.length/2:b.series+.5)/a.length],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),A.elementMouseout({value:q(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){A.elementClick({value:q(b,c),point:b,series:a[b.series],pos:[n(p(b,c))+n.rangeBand()*(u?a.length/2:b.series+.5)/a.length,o(q(b,c)+(u?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){A.elementDblClick({value:q(b,c),point:b,series:a[b.series],pos:[n(p(b,c))+n.rangeBand()*(u?a.length/2:b.series+.5)/a.length,o(q(b,c)+(u?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}),G.append("text"),v&&!u?(F.select("text").attr("text-anchor",function(a,b){return q(a,b)<0?"end":"start"}).attr("y",n.rangeBand()/(2*a.length)).attr("dy",".32em").text(function(a,b){return y(q(a,b))}),F.transition().select("text").attr("x",function(a,b){return q(a,b)<0?-4:o(q(a,b))-o(0)+4})):F.selectAll("text").text(""),w&&!u?(G.append("text").classed("nv-bar-label",!0),F.select("text.nv-bar-label").attr("text-anchor",function(a,b){return q(a,b)<0?"start":"end"}).attr("y",n.rangeBand()/(2*a.length)).attr("dy",".32em").text(function(a,b){return p(a,b)}),F.transition().select("text.nv-bar-label").attr("x",function(a,b){return q(a,b)<0?o(0)-o(q(a,b))+4:-4})):F.selectAll("text.nv-bar-label").text(""),F.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}),t&&(b||(b=a.map(function(){return!0})),F.style("fill",function(a,c,d){return d3.rgb(t(a,c)).darker(b.map(function(a,b){return b}).filter(function(a,c){return!b[c]})[d]).toString()}).style("stroke",function(a,c,d){return d3.rgb(t(a,c)).darker(b.map(function(a,b){return b}).filter(function(a,c){return!b[c]})[d]).toString()})),u?F.transition().attr("transform",function(a,b){return"translate("+o(a.y1)+","+n(p(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(o(q(a,b)+a.y0)-o(a.y0))}).attr("height",n.rangeBand()):F.transition().attr("transform",function(b,c){return"translate("+o(q(b,c)<0?q(b,c):0)+","+(b.series*n.rangeBand()/a.length+n(p(b,c)))+")"}).select("rect").attr("height",n.rangeBand()/a.length).attr("width",function(a,b){return Math.max(Math.abs(o(q(a,b))-o(0)),1)}),h=n.copy(),i=o.copy()}),a}var b,c,d,e,f,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=d3.scale.ordinal(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=g.utils.defaultColor(),t=null,u=!1,v=!1,w=!1,x=60,y=d3.format(",.2f"),z=1200,A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return a.dispatch=A,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(p=b,a):p},a.y=function(b){return arguments.length?(q=b,a):q},a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.xScale=function(b){return arguments.length?(n=b,a):n},a.yScale=function(b){return arguments.length?(o=b,a):o},a.xDomain=function(b){return arguments.length?(c=b,a):c},a.yDomain=function(b){return arguments.length?(d=b,a):d},a.xRange=function(b){return arguments.length?(e=b,a):e},a.yRange=function(b){return arguments.length?(f=b,a):f},a.forceY=function(b){return arguments.length?(r=b,a):r},a.stacked=function(b){return arguments.length?(u=b,a):u},a.color=function(b){return arguments.length?(s=g.utils.getColor(b),a):s},a.barColor=function(b){return arguments.length?(t=g.utils.getColor(b),a):t},a.disabled=function(c){return arguments.length?(b=c,a):b},a.id=function(b){return arguments.length?(m=b,a):m},a.delay=function(b){return arguments.length?(z=b,a):z},a.showValues=function(b){return arguments.length?(v=b,a):v},a.showBarLabels=function(b){return arguments.length?(w=b,a):w},a.valueFormat=function(b){return arguments.length?(y=b,a):y},a.valuePadding=function(b){return arguments.length?(x=b,a):x},a},g.models.multiBarHorizontalChart=function(){function a(g){return g.each(function(g){var r=d3.select(this),t=this,B=(k||parseInt(r.style("width"))||960)-j.left-j.right,C=(l||parseInt(r.style("height"))||400)-j.top-j.bottom;if(a.update=function(){r.transition().duration(z).call(a)},a.container=this,u.disabled=g.map(function(a){return!!a.disabled}),!v){var D;v={};for(D in u)u[D]instanceof Array?v[D]=u[D].slice(0):v[D]=u[D]}if(!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var E=r.selectAll(".nv-noData").data([w]);return E.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),E.attr("x",j.left+B/2).attr("y",j.top+C/2).text(function(a){return a}),a}r.selectAll(".nv-noData").remove(),b=d.xScale(),c=d.yScale();var F=r.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([g]),G=F.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),H=F.select("g");if(G.append("g").attr("class","nv-x nv-axis"),G.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),G.append("g").attr("class","nv-barsWrap"),G.append("g").attr("class","nv-legendWrap"),G.append("g").attr("class","nv-controlsWrap"),o&&(h.width(B-y()),d.barColor()&&g.forEach(function(a,b){a.color=d3.rgb("#ccc").darker(1.5*b).toString()}),H.select(".nv-legendWrap").datum(g).call(h),j.top!=h.height()&&(j.top=h.height(),C=(l||parseInt(r.style("height"))||400)-j.top-j.bottom),H.select(".nv-legendWrap").attr("transform","translate("+y()+","+-j.top+")")),n){var I=[{key:"Grouped",disabled:d.stacked()},{key:"Stacked",disabled:!d.stacked()}];i.width(y()).color(["#444","#444","#444"]),H.select(".nv-controlsWrap").datum(I).attr("transform","translate(0,"+-j.top+")").call(i)}F.attr("transform","translate("+j.left+","+j.top+")"),d.disabled(g.map(function(a){return a.disabled})).width(B).height(C).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled}));var J=H.select(".nv-barsWrap").datum(g.filter(function(a){return!a.disabled}));if(J.transition().call(d),p){e.scale(b).ticks(C/24).tickSize(-B,0),H.select(".nv-x.nv-axis").transition().call(e);var K=H.select(".nv-x.nv-axis").selectAll("g");K.selectAll("line, text")}q&&(f.scale(c).ticks(B/100).tickSize(-C,0),H.select(".nv-y.nv-axis").attr("transform","translate(0,"+C+")"),H.select(".nv-y.nv-axis").transition().call(f)),H.select(".nv-zeroLine line").attr("x1",c(0)).attr("x2",c(0)).attr("y1",0).attr("y2",-C),h.dispatch.on("stateChange",function(b){u=b,x.stateChange(u),a.update()}),i.dispatch.on("legendClick",function(b,c){if(b.disabled){switch(I=I.map(function(a){return a.disabled=!0,a}),b.disabled=!1,b.key){case"Grouped":d.stacked(!1);break;case"Stacked":d.stacked(!0)}u.stacked=d.stacked(),x.stateChange(u),a.update()}}),x.on("tooltipShow",function(a){s&&A(a,t.parentNode)}),x.on("changeState",function(b){"undefined"!=typeof b.disabled&&(g.forEach(function(a,c){a.disabled=b.disabled[c]}),u.disabled=b.disabled),"undefined"!=typeof b.stacked&&(d.stacked(b.stacked),u.stacked=b.stacked),a.update()})}),a}var b,c,d=g.models.multiBarHorizontal(),e=g.models.axis(),f=g.models.axis(),h=g.models.legend().height(30),i=g.models.legend().height(30),j={top:30,right:20,bottom:50,left:60},k=null,l=null,m=g.utils.defaultColor(),n=!0,o=!0,p=!0,q=!0,r=!1,s=!0,t=function(a,b,c,d,e){return"<h3>"+a+" - "+b+"</h3><p>"+c+"</p>"},u={stacked:r},v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),y=function(){return n?180:0},z=250;d.stacked(r),e.orient("left").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),f.orient("bottom").tickFormat(d3.format(",.1f")),i.updateState(!1);var A=function(b,c){var h=b.pos[0]+(c.offsetLeft||0),i=b.pos[1]+(c.offsetTop||0),j=e.tickFormat()(d.x()(b.point,b.pointIndex)),k=f.tickFormat()(d.y()(b.point,b.pointIndex)),l=t(b.series.key,j,k,b,a);g.tooltip.show([h,i],l,b.value<0?"e":"w",null,c)};return d.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],x.tooltipShow(a)}),d.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&g.tooltip.cleanup()}),a.dispatch=x,a.multibar=d,a.legend=h,a.xAxis=e,a.yAxis=f,d3.rebind(a,d,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","delay","showValues","showBarLabels","valueFormat","stacked","barColor"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.color=function(b){return arguments.length?(m=g.utils.getColor(b),h.color(m),a):m},a.showControls=function(b){return arguments.length?(n=b,a):n},a.showLegend=function(b){return arguments.length?(o=b,a):o},a.showXAxis=function(b){return arguments.length?(p=b,a):p},a.showYAxis=function(b){return arguments.length?(q=b,a):q},a.tooltip=function(b){return arguments.length?(t=b,a):t},a.tooltips=function(b){return arguments.length?(s=b,a):s},a.tooltipContent=function(b){return arguments.length?(t=b,a):t},a.state=function(b){return arguments.length?(u=b,a):u},a.defaultState=function(b){return arguments.length?(v=b,a):v},a.noData=function(b){return arguments.length?(w=b,a):w},a.transitionDuration=function(b){return arguments.length?(z=b,a):z},a},g.models.multiChart=function(){function a(g){return g.each(function(g){var l=d3.select(this),A=this;a.update=function(){l.transition().call(a)},a.container=this;var B=(h||parseInt(l.style("width"))||960)-e.left-e.right,C=(i||parseInt(l.style("height"))||400)-e.top-e.bottom,D=g.filter(function(a){return!a.disabled&&"line"==a.type&&1==a.yAxis}),E=g.filter(function(a){return!a.disabled&&"line"==a.type&&2==a.yAxis}),F=g.filter(function(a){return!a.disabled&&"bar"==a.type&&1==a.yAxis}),G=g.filter(function(a){return!a.disabled&&"bar"==a.type&&2==a.yAxis}),H=g.filter(function(a){return!a.disabled&&"area"==a.type&&1==a.yAxis}),I=g.filter(function(a){return!a.disabled&&"area"==a.type&&2==a.yAxis}),J=g.filter(function(a){return!a.disabled&&1==a.yAxis}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})}),K=g.filter(function(a){return!a.disabled&&2==a.yAxis}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})});b.domain(d3.extent(d3.merge(J.concat(K)),function(a){return a.x})).range([0,B]);var L=l.selectAll("g.wrap.multiChart").data([g]),M=L.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");M.append("g").attr("class","x axis"),M.append("g").attr("class","y1 axis"),M.append("g").attr("class","y2 axis"),M.append("g").attr("class","lines1Wrap"),M.append("g").attr("class","lines2Wrap"),M.append("g").attr("class","bars1Wrap"),M.append("g").attr("class","bars2Wrap"),M.append("g").attr("class","stack1Wrap"),M.append("g").attr("class","stack2Wrap"),M.append("g").attr("class","legendWrap");var N=L.select("g");j&&(x.width(B/2),N.select(".legendWrap").datum(g.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(1==a.yAxis?"":" (right axis)"),a})).call(x),e.top!=x.height()&&(e.top=x.height(),C=(i||parseInt(l.style("height"))||400)-e.top-e.bottom),N.select(".legendWrap").attr("transform","translate("+B/2+","+-e.top+")")),o.width(B).height(C).interpolate("monotone").color(g.map(function(a,b){return a.color||f[b%f.length]}).filter(function(a,b){return!g[b].disabled&&1==g[b].yAxis&&"line"==g[b].type})),p.width(B).height(C).interpolate("monotone").color(g.map(function(a,b){return a.color||f[b%f.length]}).filter(function(a,b){return!g[b].disabled&&2==g[b].yAxis&&"line"==g[b].type})),q.width(B).height(C).color(g.map(function(a,b){return a.color||f[b%f.length]}).filter(function(a,b){return!g[b].disabled&&1==g[b].yAxis&&"bar"==g[b].type})),r.width(B).height(C).color(g.map(function(a,b){return a.color||f[b%f.length]}).filter(function(a,b){return!g[b].disabled&&2==g[b].yAxis&&"bar"==g[b].type})),s.width(B).height(C).color(g.map(function(a,b){return a.color||f[b%f.length]}).filter(function(a,b){return!g[b].disabled&&1==g[b].yAxis&&"area"==g[b].type})),t.width(B).height(C).color(g.map(function(a,b){return a.color||f[b%f.length]}).filter(function(a,b){return!g[b].disabled&&2==g[b].yAxis&&"area"==g[b].type})),N.attr("transform","translate("+e.left+","+e.top+")");var O=N.select(".lines1Wrap").datum(D),P=N.select(".bars1Wrap").datum(F),Q=N.select(".stack1Wrap").datum(H),R=N.select(".lines2Wrap").datum(E),S=N.select(".bars2Wrap").datum(G),T=N.select(".stack2Wrap").datum(I),U=H.length?H.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],V=I.length?I.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];m.domain(c||d3.extent(d3.merge(J).concat(U),function(a){return a.y})).range([0,C]),n.domain(d||d3.extent(d3.merge(K).concat(V),function(a){return a.y})).range([0,C]),o.yDomain(m.domain()),q.yDomain(m.domain()),s.yDomain(m.domain()),p.yDomain(n.domain()),r.yDomain(n.domain()),t.yDomain(n.domain()),H.length&&d3.transition(Q).call(s),I.length&&d3.transition(T).call(t),F.length&&d3.transition(P).call(q),G.length&&d3.transition(S).call(r),D.length&&d3.transition(O).call(o),E.length&&d3.transition(R).call(p),u.ticks(B/100).tickSize(-C,0),N.select(".x.axis").attr("transform","translate(0,"+C+")"),d3.transition(N.select(".x.axis")).call(u),v.ticks(C/36).tickSize(-B,0),d3.transition(N.select(".y1.axis")).call(v),w.ticks(C/36).tickSize(-B,0),d3.transition(N.select(".y2.axis")).call(w),N.select(".y2.axis").style("opacity",K.length?1:0).attr("transform","translate("+b.range()[1]+",0)"),x.dispatch.on("stateChange",function(b){a.update()}),y.on("tooltipShow",function(a){k&&z(a,A.parentNode)})}),a}var b,c,d,e={top:30,right:20,bottom:50,left:60},f=d3.scale.category20().range(),h=null,i=null,j=!0,k=!0,l=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},b=d3.scale.linear(),m=d3.scale.linear(),n=d3.scale.linear(),o=g.models.line().yScale(m),p=g.models.line().yScale(n),q=g.models.multiBar().stacked(!1).yScale(m),r=g.models.multiBar().stacked(!1).yScale(n),s=g.models.stackedArea().yScale(m),t=g.models.stackedArea().yScale(n),u=g.models.axis().scale(b).orient("bottom").tickPadding(5),v=g.models.axis().scale(m).orient("left"),w=g.models.axis().scale(n).orient("right"),x=g.models.legend().height(30),y=d3.dispatch("tooltipShow","tooltipHide"),z=function(b,c){var d=b.pos[0]+(c.offsetLeft||0),e=b.pos[1]+(c.offsetTop||0),f=u.tickFormat()(o.x()(b.point,b.pointIndex)),h=(2==b.series.yAxis?w:v).tickFormat()(o.y()(b.point,b.pointIndex)),i=l(b.series.key,f,h,b,a);g.tooltip.show([d,e],i,void 0,void 0,c.offsetParent)};return o.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],y.tooltipShow(a)}),o.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),p.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],y.tooltipShow(a)}),p.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),q.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],y.tooltipShow(a)}),q.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),r.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],y.tooltipShow(a)}),r.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),s.dispatch.on("tooltipShow",function(a){return Math.round(100*s.y()(a.point))?(a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],void y.tooltipShow(a)):(setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1)}),s.dispatch.on("tooltipHide",function(a){y.tooltipHide(a)}),t.dispatch.on("tooltipShow",function(a){return Math.round(100*t.y()(a.point))?(a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],void y.tooltipShow(a)):(setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1)}),t.dispatch.on("tooltipHide",function(a){y.tooltipHide(a)}),o.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],y.tooltipShow(a)}),o.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),p.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],y.tooltipShow(a)}),p.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),y.on("tooltipHide",function(){k&&g.tooltip.cleanup()}),a.dispatch=y,a.lines1=o,a.lines2=p,a.bars1=q,a.bars2=r,a.stack1=s,a.stack2=t,a.xAxis=u,a.yAxis1=v,a.yAxis2=w,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(getX=b,o.x(b),q.x(b),a):getX},a.y=function(b){return arguments.length?(getY=b,o.y(b),q.y(b),a):getY},a.yDomain1=function(b){return arguments.length?(c=b,a):c},a.yDomain2=function(b){return arguments.length?(d=b,a):d},a.margin=function(b){return arguments.length?(e=b,a):e},a.width=function(b){return arguments.length?(h=b,a):h},a.height=function(b){return arguments.length?(i=b,a):i},a.color=function(b){return arguments.length?(f=b,x.color(b),a):f},a.showLegend=function(b){return arguments.length?(j=b,a):j},a.tooltips=function(b){return arguments.length?(k=b,a):k},a.tooltipContent=function(b){return arguments.length?(l=b,a):l},a},g.models.ohlcBar=function(){function a(g){return g.each(function(a){var g=h-f.left-f.right,w=i-f.top-f.bottom,y=d3.select(this);k.domain(b||d3.extent(a[0].values.map(m).concat(s))),u?k.range(d||[.5*g/a[0].values.length,g*(a[0].values.length-.5)/a[0].values.length]):k.range(d||[0,g]),l.domain(c||[d3.min(a[0].values.map(r).concat(t)),d3.max(a[0].values.map(q).concat(t))]).range(e||[w,0]),k.domain()[0]===k.domain()[1]&&(k.domain()[0]?k.domain([k.domain()[0]-.01*k.domain()[0],k.domain()[1]+.01*k.domain()[1]]):k.domain([-1,1])),l.domain()[0]===l.domain()[1]&&(l.domain()[0]?l.domain([l.domain()[0]+.01*l.domain()[0],l.domain()[1]-.01*l.domain()[1]]):l.domain([-1,1]));var z=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([a[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-ticks"),z.attr("transform","translate("+f.left+","+f.top+")"),y.on("click",function(a,b){x.chartClick({data:a,index:b,pos:d3.event,id:j})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),z.select("#nv-chart-clip-path-"+j+" rect").attr("width",g).attr("height",w),D.attr("clip-path",v?"url(#nv-chart-clip-path-"+j+")":"");var E=z.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});E.exit().remove();E.enter().append("path").attr("class",function(a,b,c){return(o(a,b)>p(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(b,c){var d=g/a[0].values.length*.9;return"m0,0l0,"+(l(o(b,c))-l(q(b,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(l(r(b,c))-l(o(b,c)))+"l0,"+(l(p(b,c))-l(r(b,c)))+"l"+d/2+",0l"+-d/2+",0z"}).attr("transform",function(a,b){return"translate("+k(m(a,b))+","+l(q(a,b))+")"}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),x.elementMouseover({point:b,series:a[0],pos:[k(m(b,c)),l(n(b,c))],pointIndex:c,seriesIndex:0,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),x.elementMouseout({point:b,series:a[0],pointIndex:c,seriesIndex:0,e:d3.event})}).on("click",function(a,b){x.elementClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation()}).on("dblclick",function(a,b){x.elementDblClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation()});E.attr("class",function(a,b,c){return(o(a,b)>p(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(E).attr("transform",function(a,b){return"translate("+k(m(a,b))+","+l(q(a,b))+")"}).attr("d",function(b,c){var d=g/a[0].values.length*.9;return"m0,0l0,"+(l(o(b,c))-l(q(b,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(l(r(b,c))-l(o(b,c)))+"l0,"+(l(p(b,c))-l(r(b,c)))+"l"+d/2+",0l"+-d/2+",0z"})}),a}var b,c,d,e,f={top:0,right:0,bottom:0,left:0},h=960,i=500,j=Math.floor(1e4*Math.random()),k=d3.scale.linear(),l=d3.scale.linear(),m=function(a){return a.x},n=function(a){return a.y},o=function(a){return a.open},p=function(a){return a.close},q=function(a){return a.high},r=function(a){return a.low},s=[],t=[],u=!1,v=!0,w=g.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return a.dispatch=x,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(m=b,a):m},a.y=function(b){return arguments.length?(n=b,a):n},a.open=function(b){return arguments.length?(o=b,a):o},a.close=function(b){return arguments.length?(p=b,a):p},a.high=function(b){return arguments.length?(q=b,a):q},a.low=function(b){return arguments.length?(r=b,a):r},a.margin=function(b){return arguments.length?(f.top="undefined"!=typeof b.top?b.top:f.top,f.right="undefined"!=typeof b.right?b.right:f.right,f.bottom="undefined"!=typeof b.bottom?b.bottom:f.bottom,f.left="undefined"!=typeof b.left?b.left:f.left,a):f},a.width=function(b){return arguments.length?(h=b,a):h},a.height=function(b){return arguments.length?(i=b,a):i},a.xScale=function(b){return arguments.length?(k=b,a):k},a.yScale=function(b){return arguments.length?(l=b,a):l},a.xDomain=function(c){return arguments.length?(b=c,a):b},a.yDomain=function(b){return arguments.length?(c=b,a):c},a.xRange=function(b){return arguments.length?(d=b,a):d},a.yRange=function(b){return arguments.length?(e=b,a):e},a.forceX=function(b){return arguments.length?(s=b,a):s},a.forceY=function(b){return arguments.length?(t=b,a):t},a.padData=function(b){return arguments.length?(u=b,a):u},a.clipEdge=function(b){return arguments.length?(v=b,a):v},a.color=function(b){return arguments.length?(w=g.utils.getColor(b),a):w},a.id=function(b){return arguments.length?(j=b,a):j},a},g.models.pie=function(){function a(g){return g.each(function(a){function g(a){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,r||(a.innerRadius=0);var b=d3.interpolate(this._current,a);return this._current=b(0),function(a){return E(b(a))}}var i=c-b.left-b.right,l=e-b.top-b.bottom,x=Math.min(i,l)/2,y=x-x/5,z=d3.select(this),A=z.selectAll(".nv-wrap.nv-pie").data(a),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+j),C=B.append("g"),D=A.select("g");C.append("g").attr("class","nv-pie"),C.append("g").attr("class","nv-pieLabels"),A.attr("transform","translate("+b.left+","+b.top+")"),D.select(".nv-pie").attr("transform","translate("+i/2+","+l/2+")"),D.select(".nv-pieLabels").attr("transform","translate("+i/2+","+l/2+")"),z.on("click",function(a,b){w.chartClick({data:a,index:b,pos:d3.event,id:j})});var E=d3.svg.arc().outerRadius(y);t&&E.startAngle(t),u&&E.endAngle(u),r&&E.innerRadius(x*v);var F=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:h(a)}),G=A.select(".nv-pie").selectAll(".nv-slice").data(F),H=A.select(".nv-pieLabels").selectAll(".nv-label").data(F);G.exit().remove(),H.exit().remove();var I=G.enter().append("g").attr("class","nv-slice").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),w.elementMouseover({label:f(a.data),value:h(a.data),point:a.data,pointIndex:b,pos:[d3.event.pageX,d3.event.pageY],id:j})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),w.elementMouseout({label:f(a.data),value:h(a.data),point:a.data,index:b,id:j})}).on("click",function(a,b){w.elementClick({label:f(a.data),value:h(a.data),point:a.data,index:b,pos:d3.event,id:j}),d3.event.stopPropagation()}).on("dblclick",function(a,b){w.elementDblClick({label:f(a.data),value:h(a.data),point:a.data,index:b,pos:d3.event,id:j}),d3.event.stopPropagation()});G.attr("fill",function(a,b){return k(a,b)}).attr("stroke",function(a,b){return k(a,b)});I.append("path").each(function(a){this._current=a});if(G.select("path").transition().attr("d",E).attrTween("d",g),m){var J=d3.svg.arc().innerRadius(0);n&&(J=E),o&&(J=d3.svg.arc().outerRadius(E.outerRadius())),H.enter().append("g").classed("nv-label",!0).each(function(a,b){var c=d3.select(this);c.attr("transform",function(a){if(s){a.outerRadius=y+10,a.innerRadius=y+15;var b=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?b-=90:b+=90,"translate("+J.centroid(a)+") rotate("+b+")"}return a.outerRadius=x+10,a.innerRadius=x+15,"translate("+J.centroid(a)+")"}),c.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),c.append("text").style("text-anchor",s?(a.startAngle+a.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")});var K={},L=14,M=140,N=function(a){return Math.floor(a[0]/M)*M+","+Math.floor(a[1]/L)*L};H.transition().attr("transform",function(a){if(s){a.outerRadius=y+10,a.innerRadius=y+15;var b=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?b-=90:b+=90,"translate("+J.centroid(a)+") rotate("+b+")"}a.outerRadius=x+10,a.innerRadius=x+15;var c=J.centroid(a),d=N(c);return K[d]&&(c[1]-=L),K[N(c)]=!0,"translate("+c+")"}),H.select(".nv-label text").style("text-anchor",s?(d.startAngle+d.endAngle)/2<Math.PI?"start":"end":"middle").text(function(a,b){var c=(a.endAngle-a.startAngle)/(2*Math.PI),d={key:f(a.data),value:h(a.data),percent:d3.format("%")(c)};return a.value&&c>q?d[p]:""})}}),a}var b={top:0,right:0,bottom:0,left:0},c=500,e=500,f=function(a){return a.x},h=function(a){return a.y},i=function(a){return a.description},j=Math.floor(1e4*Math.random()),k=g.utils.defaultColor(),l=d3.format(",.2f"),m=!0,n=!0,o=!1,p="key",q=.02,r=!1,s=!1,t=!1,u=!1,v=.5,w=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return a.dispatch=w,a.options=g.utils.optionsFunc.bind(a),a.margin=function(c){return arguments.length?(b.top="undefined"!=typeof c.top?c.top:b.top,b.right="undefined"!=typeof c.right?c.right:b.right,b.bottom="undefined"!=typeof c.bottom?c.bottom:b.bottom,b.left="undefined"!=typeof c.left?c.left:b.left,a):b},a.width=function(b){return arguments.length?(c=b,a):c},a.height=function(b){return arguments.length?(e=b,a):e},a.values=function(b){return g.log("pie.values() is no longer supported."),a},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(h=d3.functor(b),a):h},a.description=function(b){return arguments.length?(i=b,a):i},a.showLabels=function(b){return arguments.length?(m=b,a):m},a.labelSunbeamLayout=function(b){return arguments.length?(s=b,a):s},a.donutLabelsOutside=function(b){return arguments.length?(o=b,a):o},a.pieLabelsOutside=function(b){return arguments.length?(n=b,a):n},a.labelType=function(b){return arguments.length?(p=b,p=p||"key",a):p},a.donut=function(b){return arguments.length?(r=b,a):r},a.donutRatio=function(b){return arguments.length?(v=b,a):v},a.startAngle=function(b){return arguments.length?(t=b,a):t},a.endAngle=function(b){return arguments.length?(u=b,a):u},a.id=function(b){return arguments.length?(j=b,a):j},a.color=function(b){return arguments.length?(k=g.utils.getColor(b),a):k},a.valueFormat=function(b){return arguments.length?(l=b,a):l},a.labelThreshold=function(b){return arguments.length?(q=b,a):q},a},g.models.pieChart=function(){function a(g){return g.each(function(g){var i=d3.select(this),j=(e||parseInt(i.style("width"))||960)-d.left-d.right,k=(f||parseInt(i.style("height"))||400)-d.top-d.bottom;if(a.update=function(){i.transition().call(a)},a.container=this,l.disabled=g.map(function(a){return!!a.disabled}),!m){var p;m={};for(p in l)l[p]instanceof Array?m[p]=l[p].slice(0):m[p]=l[p]}if(!g||!g.length){var q=i.selectAll(".nv-noData").data([n]);return q.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),q.attr("x",d.left+j/2).attr("y",d.top+k/2).text(function(a){return a}),a}i.selectAll(".nv-noData").remove();var r=i.selectAll("g.nv-wrap.nv-pieChart").data([g]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),t=r.select("g");
s.append("g").attr("class","nv-pieWrap"),s.append("g").attr("class","nv-legendWrap"),h&&(c.width(j).key(b.x()),r.select(".nv-legendWrap").datum(g).call(c),d.top!=c.height()&&(d.top=c.height(),k=(f||parseInt(i.style("height"))||400)-d.top-d.bottom),r.select(".nv-legendWrap").attr("transform","translate(0,"+-d.top+")")),r.attr("transform","translate("+d.left+","+d.top+")"),b.width(j).height(k);var u=t.select(".nv-pieWrap").datum([g]);d3.transition(u).call(b),c.dispatch.on("stateChange",function(b){l=b,o.stateChange(l),a.update()}),b.dispatch.on("elementMouseout.tooltip",function(a){o.tooltipHide(a)}),o.on("changeState",function(b){"undefined"!=typeof b.disabled&&(g.forEach(function(a,c){a.disabled=b.disabled[c]}),l.disabled=b.disabled),a.update()})}),a}var b=g.models.pie(),c=g.models.legend(),d={top:30,right:20,bottom:20,left:20},e=null,f=null,h=!0,i=g.utils.defaultColor(),j=!0,k=function(a,b,c,d){return"<h3>"+a+"</h3><p>"+b+"</p>"},l={},m=null,n="No Data Available.",o=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),p=function(c,d){var e=b.description()(c.point)||b.x()(c.point),f=c.pos[0]+(d&&d.offsetLeft||0),h=c.pos[1]+(d&&d.offsetTop||0),i=b.valueFormat()(b.y()(c.point)),j=k(e,i,c,a);g.tooltip.show([f,h],j,c.value<0?"n":"s",null,d)};return b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+d.left,a.pos[1]+d.top],o.tooltipShow(a)}),o.on("tooltipShow",function(a){j&&p(a)}),o.on("tooltipHide",function(){j&&g.tooltip.cleanup()}),a.legend=c,a.dispatch=o,a.pie=b,d3.rebind(a,b,"valueFormat","values","x","y","description","id","showLabels","donutLabelsOutside","pieLabelsOutside","labelType","donut","donutRatio","labelThreshold"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(d.top="undefined"!=typeof b.top?b.top:d.top,d.right="undefined"!=typeof b.right?b.right:d.right,d.bottom="undefined"!=typeof b.bottom?b.bottom:d.bottom,d.left="undefined"!=typeof b.left?b.left:d.left,a):d},a.width=function(b){return arguments.length?(e=b,a):e},a.height=function(b){return arguments.length?(f=b,a):f},a.color=function(d){return arguments.length?(i=g.utils.getColor(d),c.color(i),b.color(i),a):i},a.showLegend=function(b){return arguments.length?(h=b,a):h},a.tooltips=function(b){return arguments.length?(j=b,a):j},a.tooltipContent=function(b){return arguments.length?(k=b,a):k},a.state=function(b){return arguments.length?(l=b,a):l},a.defaultState=function(b){return arguments.length?(m=b,a):m},a.noData=function(b){return arguments.length?(n=b,a):n},a},g.models.scatter=function(){function a(O){return O.each(function(a){function O(){if(!w)return!1;var b=d3.merge(a.map(function(a,b){return a.values.map(function(a,c){var d=o(a,c),e=p(a,c);return[l(d)+1e-7*Math.random(),m(e)+1e-7*Math.random(),b,c,a]}).filter(function(a,b){return y(a[4],b)})}));if(M===!0){if(C){var c=T.select("defs").selectAll(".nv-point-clips").data([k]).enter();c.append("clipPath").attr("class","nv-point-clips").attr("id","nv-points-clip-"+k);var d=T.select("#nv-points-clip-"+k).selectAll("circle").data(b);d.enter().append("circle").attr("r",D),d.exit().remove(),d.attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}),T.select(".nv-point-paths").attr("clip-path","url(#nv-points-clip-"+k+")")}b.length&&(b.push([l.range()[0]-20,m.range()[0]-20,null,null]),b.push([l.range()[1]+20,m.range()[1]+20,null,null]),b.push([l.range()[0]-20,m.range()[0]+20,null,null]),b.push([l.range()[1]+20,m.range()[1]-20,null,null]));var e=d3.geom.polygon([[-10,-10],[-10,i+10],[h+10,i+10],[h+10,-10]]),g=d3.geom.voronoi(b).map(function(a,c){return{data:e.clip(a),series:b[c][2],point:b[c][3]}}),j=T.select(".nv-point-paths").selectAll("path").data(g);j.enter().append("path").attr("class",function(a,b){return"nv-path-"+b}),j.exit().remove(),j.attr("d",function(a){return 0===a.data.length?"M 0 0":"M"+a.data.join("L")+"Z"});var n=function(b,c){if(N)return 0;var d=a[b.series];if("undefined"!=typeof d){var e=d.values[b.point];c({point:e,series:d,pos:[l(o(e,b.point))+f.left,m(p(e,b.point))+f.top],seriesIndex:b.series,pointIndex:b.point})}};j.on("click",function(a){n(a,L.elementClick)}).on("mouseover",function(a){n(a,L.elementMouseover)}).on("mouseout",function(a,b){n(a,L.elementMouseout)})}else T.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(b,c){if(N||!a[b.series])return 0;var d=a[b.series],e=d.values[c];L.elementClick({point:e,series:d,pos:[l(o(e,c))+f.left,m(p(e,c))+f.top],seriesIndex:b.series,pointIndex:c})}).on("mouseover",function(b,c){if(N||!a[b.series])return 0;var d=a[b.series],e=d.values[c];L.elementMouseover({point:e,series:d,pos:[l(o(e,c))+f.left,m(p(e,c))+f.top],seriesIndex:b.series,pointIndex:c})}).on("mouseout",function(b,c){if(N||!a[b.series])return 0;var d=a[b.series],e=d.values[c];L.elementMouseout({point:e,series:d,seriesIndex:b.series,pointIndex:c})});N=!1}var P=h-f.left-f.right,Q=i-f.top-f.bottom,R=d3.select(this);a.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var S=E&&F&&I?[]:d3.merge(a.map(function(a){return a.values.map(function(a,b){return{x:o(a,b),y:p(a,b),size:q(a,b)}})}));l.domain(E||d3.extent(S.map(function(a){return a.x}).concat(t))),z&&a[0]?l.range(G||[(P*A+P)/(2*a[0].values.length),P-P*(1+A)/(2*a[0].values.length)]):l.range(G||[0,P]),m.domain(F||d3.extent(S.map(function(a){return a.y}).concat(u))).range(H||[Q,0]),n.domain(I||d3.extent(S.map(function(a){return a.size}).concat(v))).range(J||[16,256]),(l.domain()[0]===l.domain()[1]||m.domain()[0]===m.domain()[1])&&(K=!0),l.domain()[0]===l.domain()[1]&&(l.domain()[0]?l.domain([l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]):l.domain([-1,1])),m.domain()[0]===m.domain()[1]&&(m.domain()[0]?m.domain([m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]):m.domain([-1,1])),isNaN(l.domain()[0])&&l.domain([-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),b=b||l,c=c||m,d=d||n;var T=R.selectAll("g.nv-wrap.nv-scatter").data([a]),U=T.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+k+(K?" nv-single-point":"")),V=U.append("defs"),W=U.append("g"),X=T.select("g");W.append("g").attr("class","nv-groups"),W.append("g").attr("class","nv-point-paths"),T.attr("transform","translate("+f.left+","+f.top+")"),V.append("clipPath").attr("id","nv-edge-clip-"+k).append("rect"),T.select("#nv-edge-clip-"+k+" rect").attr("width",P).attr("height",Q),X.attr("clip-path",B?"url(#nv-edge-clip-"+k+")":""),N=!0;var Y=T.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});if(Y.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),Y.exit().remove(),Y.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),Y.transition().style("fill",function(a,b){return j(a,b)}).style("stroke",function(a,b){return j(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5),s){var Z=Y.selectAll("circle.nv-point").data(function(a){return a.values},x);Z.enter().append("circle").style("fill",function(a,b){return a.color}).style("stroke",function(a,b){return a.color}).attr("cx",function(a,c){return g.utils.NaNtoZero(b(o(a,c)))}).attr("cy",function(a,b){return g.utils.NaNtoZero(c(p(a,b)))}).attr("r",function(a,b){return Math.sqrt(n(q(a,b))/Math.PI)}),Z.exit().remove(),Y.exit().selectAll("path.nv-point").transition().attr("cx",function(a,b){return g.utils.NaNtoZero(l(o(a,b)))}).attr("cy",function(a,b){return g.utils.NaNtoZero(m(p(a,b)))}).remove(),Z.each(function(a,b){d3.select(this).classed("nv-point",!0).classed("nv-point-"+b,!0).classed("hover",!1)}),Z.transition().attr("cx",function(a,b){return g.utils.NaNtoZero(l(o(a,b)))}).attr("cy",function(a,b){return g.utils.NaNtoZero(m(p(a,b)))}).attr("r",function(a,b){return Math.sqrt(n(q(a,b))/Math.PI)})}else{var Z=Y.selectAll("path.nv-point").data(function(a){return a.values});Z.enter().append("path").style("fill",function(a,b){return a.color}).style("stroke",function(a,b){return a.color}).attr("transform",function(a,d){return"translate("+b(o(a,d))+","+c(p(a,d))+")"}).attr("d",d3.svg.symbol().type(r).size(function(a,b){return n(q(a,b))})),Z.exit().remove(),Y.exit().selectAll("path.nv-point").transition().attr("transform",function(a,b){return"translate("+l(o(a,b))+","+m(p(a,b))+")"}).remove(),Z.each(function(a,b){d3.select(this).classed("nv-point",!0).classed("nv-point-"+b,!0).classed("hover",!1)}),Z.transition().attr("transform",function(a,b){return"translate("+l(o(a,b))+","+m(p(a,b))+")"}).attr("d",d3.svg.symbol().type(r).size(function(a,b){return n(q(a,b))}))}clearTimeout(e),e=setTimeout(O,300),b=l.copy(),c=m.copy(),d=n.copy()}),a}var b,c,d,e,f={top:0,right:0,bottom:0,left:0},h=960,i=500,j=g.utils.defaultColor(),k=Math.floor(1e5*Math.random()),l=d3.scale.linear(),m=d3.scale.linear(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=function(a){return a.size||1},r=function(a){return a.shape||"circle"},s=!0,t=[],u=[],v=[],w=!0,x=null,y=function(a){return!a.notActive},z=!1,A=.1,B=!1,C=!0,D=function(){return 25},E=null,F=null,G=null,H=null,I=null,J=null,K=!1,L=d3.dispatch("elementClick","elementMouseover","elementMouseout"),M=!0,N=!1;return a.clearHighlights=function(){d3.selectAll(".nv-chart-"+k+" .nv-point.hover").classed("hover",!1)},a.highlightPoint=function(a,b,c){d3.select(".nv-chart-"+k+" .nv-series-"+a+" .nv-point-"+b).classed("hover",c)},L.on("elementMouseover.point",function(b){w&&a.highlightPoint(b.seriesIndex,b.pointIndex,!0)}),L.on("elementMouseout.point",function(b){w&&a.highlightPoint(b.seriesIndex,b.pointIndex,!1)}),a.dispatch=L,a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(o=d3.functor(b),a):o},a.y=function(b){return arguments.length?(p=d3.functor(b),a):p},a.size=function(b){return arguments.length?(q=d3.functor(b),a):q},a.margin=function(b){return arguments.length?(f.top="undefined"!=typeof b.top?b.top:f.top,f.right="undefined"!=typeof b.right?b.right:f.right,f.bottom="undefined"!=typeof b.bottom?b.bottom:f.bottom,f.left="undefined"!=typeof b.left?b.left:f.left,a):f},a.width=function(b){return arguments.length?(h=b,a):h},a.height=function(b){return arguments.length?(i=b,a):i},a.xScale=function(b){return arguments.length?(l=b,a):l},a.yScale=function(b){return arguments.length?(m=b,a):m},a.zScale=function(b){return arguments.length?(n=b,a):n},a.xDomain=function(b){return arguments.length?(E=b,a):E},a.yDomain=function(b){return arguments.length?(F=b,a):F},a.sizeDomain=function(b){return arguments.length?(I=b,a):I},a.xRange=function(b){return arguments.length?(G=b,a):G},a.yRange=function(b){return arguments.length?(H=b,a):H},a.sizeRange=function(b){return arguments.length?(J=b,a):J},a.forceX=function(b){return arguments.length?(t=b,a):t},a.forceY=function(b){return arguments.length?(u=b,a):u},a.forceSize=function(b){return arguments.length?(v=b,a):v},a.interactive=function(b){return arguments.length?(w=b,a):w},a.pointKey=function(b){return arguments.length?(x=b,a):x},a.pointActive=function(b){return arguments.length?(y=b,a):y},a.padData=function(b){return arguments.length?(z=b,a):z},a.padDataOuter=function(b){return arguments.length?(A=b,a):A},a.clipEdge=function(b){return arguments.length?(B=b,a):B},a.clipVoronoi=function(b){return arguments.length?(C=b,a):C},a.useVoronoi=function(b){return arguments.length?(M=b,M===!1&&(C=!1),a):M},a.clipRadius=function(b){return arguments.length?(D=b,a):D},a.color=function(b){return arguments.length?(j=g.utils.getColor(b),a):j},a.shape=function(b){return arguments.length?(r=b,a):r},a.onlyCircles=function(b){return arguments.length?(s=b,a):s},a.id=function(b){return arguments.length?(k=b,a):k},a.singlePoint=function(b){return arguments.length?(K=b,a):K},a},g.models.scatterChart=function(){function a(g){return g.each(function(g){function B(){if(z)return U.select(".nv-point-paths").style("pointer-events","all"),!1;U.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);n.distortion(y).focus(a[0]),o.distortion(y).focus(a[1]),U.select(".nv-scatterWrap").call(b),u&&U.select(".nv-x.nv-axis").call(c),v&&U.select(".nv-y.nv-axis").call(d),U.select(".nv-distributionX").datum(g.filter(function(a){return!a.disabled})).call(h),U.select(".nv-distributionY").datum(g.filter(function(a){return!a.disabled})).call(i)}var C=d3.select(this),D=this,N=(k||parseInt(C.style("width"))||960)-j.left-j.right,O=(l||parseInt(C.style("height"))||400)-j.top-j.bottom;if(a.update=function(){C.transition().duration(I).call(a)},a.container=this,E.disabled=g.map(function(a){return!!a.disabled}),!F){var P;F={};for(P in E)E[P]instanceof Array?F[P]=E[P].slice(0):F[P]=E[P]}if(!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var Q=C.selectAll(".nv-noData").data([H]);return Q.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),Q.attr("x",j.left+N/2).attr("y",j.top+O/2).text(function(a){return a}),a}C.selectAll(".nv-noData").remove(),J=J||n,K=K||o;var R=C.selectAll("g.nv-wrap.nv-scatterChart").data([g]),S=R.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+b.id()),T=S.append("g"),U=R.select("g");if(T.append("rect").attr("class","nvd3 nv-background"),T.append("g").attr("class","nv-x nv-axis"),T.append("g").attr("class","nv-y nv-axis"),T.append("g").attr("class","nv-scatterWrap"),T.append("g").attr("class","nv-distWrap"),T.append("g").attr("class","nv-legendWrap"),T.append("g").attr("class","nv-controlsWrap"),t){var V=x?N/2:N;e.width(V),R.select(".nv-legendWrap").datum(g).call(e),j.top!=e.height()&&(j.top=e.height(),O=(l||parseInt(C.style("height"))||400)-j.top-j.bottom),R.select(".nv-legendWrap").attr("transform","translate("+(N-V)+","+-j.top+")")}if(x&&(f.width(180).color(["#444"]),U.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-j.top+")").call(f)),R.attr("transform","translate("+j.left+","+j.top+")"),w&&U.select(".nv-y.nv-axis").attr("transform","translate("+N+",0)"),b.width(N).height(O).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled})),0!==p&&b.xDomain(null),0!==q&&b.yDomain(null),R.select(".nv-scatterWrap").datum(g.filter(function(a){return!a.disabled})).call(b),0!==p){var W=n.domain()[1]-n.domain()[0];b.xDomain([n.domain()[0]-p*W,n.domain()[1]+p*W])}if(0!==q){var X=o.domain()[1]-o.domain()[0];b.yDomain([o.domain()[0]-q*X,o.domain()[1]+q*X])}(0!==q||0!==p)&&R.select(".nv-scatterWrap").datum(g.filter(function(a){return!a.disabled})).call(b),u&&(c.scale(n).ticks(c.ticks()&&c.ticks().length?c.ticks():N/100).tickSize(-O,0),U.select(".nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")").call(c)),v&&(d.scale(o).ticks(d.ticks()&&d.ticks().length?d.ticks():O/36).tickSize(-N,0),U.select(".nv-y.nv-axis").call(d)),r&&(h.getData(b.x()).scale(n).width(N).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled})),T.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),U.select(".nv-distributionX").attr("transform","translate(0,"+o.range()[0]+")").datum(g.filter(function(a){return!a.disabled})).call(h)),s&&(i.getData(b.y()).scale(o).width(O).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled})),T.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),U.select(".nv-distributionY").attr("transform","translate("+(w?N:-i.size())+",0)").datum(g.filter(function(a){return!a.disabled})).call(i)),d3.fisheye&&(U.select(".nv-background").attr("width",N).attr("height",O),U.select(".nv-background").on("mousemove",B),U.select(".nv-background").on("click",function(){z=!z}),b.dispatch.on("elementClick.freezeFisheye",function(){z=!z})),f.dispatch.on("legendClick",function(e,f){e.disabled=!e.disabled,y=e.disabled?0:2.5,U.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),U.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(n.distortion(y).focus(0),o.distortion(y).focus(0),U.select(".nv-scatterWrap").call(b),U.select(".nv-x.nv-axis").call(c),U.select(".nv-y.nv-axis").call(d)):z=!1,a.update()}),e.dispatch.on("stateChange",function(b){E.disabled=b.disabled,G.stateChange(E),a.update()}),b.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",function(b,c){return a.pos[1]-O}),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+h.size()),a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],G.tooltipShow(a)}),G.on("tooltipShow",function(a){A&&L(a,D.parentNode)}),G.on("changeState",function(b){"undefined"!=typeof b.disabled&&(g.forEach(function(a,c){a.disabled=b.disabled[c]}),E.disabled=b.disabled),a.update()}),J=n.copy(),K=o.copy()}),a}var b=g.models.scatter(),c=g.models.axis(),d=g.models.axis(),e=g.models.legend(),f=g.models.legend(),h=g.models.distribution(),i=g.models.distribution(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=g.utils.defaultColor(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.xScale(),o=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.yScale(),p=0,q=0,r=!1,s=!1,t=!0,u=!0,v=!0,w=!1,x=!!d3.fisheye,y=0,z=!1,A=!0,B=function(a,b,c){return"<strong>"+b+"</strong>"},C=function(a,b,c){return"<strong>"+c+"</strong>"},D=null,E={},F=null,G=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),H="No Data Available.",I=250;b.xScale(n).yScale(o),c.orient("bottom").tickPadding(10),d.orient(w?"right":"left").tickPadding(10),h.axis("x"),i.axis("y"),f.updateState(!1);var J,K,L=function(e,f){var h=e.pos[0]+(f.offsetLeft||0),i=e.pos[1]+(f.offsetTop||0),k=e.pos[0]+(f.offsetLeft||0),l=o.range()[0]+j.top+(f.offsetTop||0),m=n.range()[0]+j.left+(f.offsetLeft||0),p=e.pos[1]+(f.offsetTop||0),q=c.tickFormat()(b.x()(e.point,e.pointIndex)),r=d.tickFormat()(b.y()(e.point,e.pointIndex));null!=B&&g.tooltip.show([k,l],B(e.series.key,q,r,e,a),"n",1,f,"x-nvtooltip"),null!=C&&g.tooltip.show([m,p],C(e.series.key,q,r,e,a),"e",1,f,"y-nvtooltip"),null!=D&&g.tooltip.show([h,i],D(e.series.key,q,r,e,a),e.value<0?"n":"s",null,f)},M=[{key:"Magnify",disabled:!0}];return b.dispatch.on("elementMouseout.tooltip",function(a){G.tooltipHide(a),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",i.size())}),G.on("tooltipHide",function(){A&&g.tooltip.cleanup()}),a.dispatch=G,a.scatter=b,a.legend=e,a.controls=f,a.xAxis=c,a.yAxis=d,a.distX=h,a.distY=i,d3.rebind(a,b,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.color=function(b){return arguments.length?(m=g.utils.getColor(b),e.color(m),h.color(m),i.color(m),a):m},a.showDistX=function(b){return arguments.length?(r=b,a):r},a.showDistY=function(b){return arguments.length?(s=b,a):s},a.showControls=function(b){return arguments.length?(x=b,a):x},a.showLegend=function(b){return arguments.length?(t=b,a):t},a.showXAxis=function(b){return arguments.length?(u=b,a):u},a.showYAxis=function(b){return arguments.length?(v=b,a):v},a.rightAlignYAxis=function(b){return arguments.length?(w=b,d.orient(b?"right":"left"),a):w},a.fisheye=function(b){return arguments.length?(y=b,a):y},a.xPadding=function(b){return arguments.length?(p=b,a):p},a.yPadding=function(b){return arguments.length?(q=b,a):q},a.tooltips=function(b){return arguments.length?(A=b,a):A},a.tooltipContent=function(b){return arguments.length?(D=b,a):D},a.tooltipXContent=function(b){return arguments.length?(B=b,a):B},a.tooltipYContent=function(b){return arguments.length?(C=b,a):C},a.state=function(b){return arguments.length?(E=b,a):E},a.defaultState=function(b){return arguments.length?(F=b,a):F},a.noData=function(b){return arguments.length?(H=b,a):H},a.transitionDuration=function(b){return arguments.length?(I=b,a):I},a},g.models.scatterPlusLineChart=function(){function a(g){return g.each(function(g){function z(){if(x)return S.select(".nv-point-paths").style("pointer-events","all"),!1;S.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);n.distortion(w).focus(a[0]),o.distortion(w).focus(a[1]),S.select(".nv-scatterWrap").datum(g.filter(function(a){return!a.disabled})).call(b),s&&S.select(".nv-x.nv-axis").call(c),t&&S.select(".nv-y.nv-axis").call(d),S.select(".nv-distributionX").datum(g.filter(function(a){return!a.disabled})).call(h),S.select(".nv-distributionY").datum(g.filter(function(a){return!a.disabled})).call(i)}var A=d3.select(this),B=this,L=(k||parseInt(A.style("width"))||960)-j.left-j.right,M=(l||parseInt(A.style("height"))||400)-j.top-j.bottom;if(a.update=function(){A.transition().duration(G).call(a)},a.container=this,C.disabled=g.map(function(a){return!!a.disabled}),!D){var N;D={};for(N in C)C[N]instanceof Array?D[N]=C[N].slice(0):D[N]=C[N]}if(!(g&&g.length&&g.filter(function(a){return a.values.length}).length)){var O=A.selectAll(".nv-noData").data([F]);return O.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),O.attr("x",j.left+L/2).attr("y",j.top+M/2).text(function(a){return a}),a}A.selectAll(".nv-noData").remove(),n=b.xScale(),o=b.yScale(),H=H||n,I=I||o;var P=A.selectAll("g.nv-wrap.nv-scatterChart").data([g]),Q=P.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+b.id()),R=Q.append("g"),S=P.select("g");R.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),R.append("g").attr("class","nv-x nv-axis"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-scatterWrap"),R.append("g").attr("class","nv-regressionLinesWrap"),R.append("g").attr("class","nv-distWrap"),R.append("g").attr("class","nv-legendWrap"),R.append("g").attr("class","nv-controlsWrap"),P.attr("transform","translate("+j.left+","+j.top+")"),u&&S.select(".nv-y.nv-axis").attr("transform","translate("+L+",0)"),r&&(e.width(L/2),P.select(".nv-legendWrap").datum(g).call(e),j.top!=e.height()&&(j.top=e.height(),M=(l||parseInt(A.style("height"))||400)-j.top-j.bottom),P.select(".nv-legendWrap").attr("transform","translate("+L/2+","+-j.top+")")),v&&(f.width(180).color(["#444"]),S.select(".nv-controlsWrap").datum(K).attr("transform","translate(0,"+-j.top+")").call(f)),b.width(L).height(M).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled})),P.select(".nv-scatterWrap").datum(g.filter(function(a){return!a.disabled})).call(b),P.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+b.id()+")");var T=P.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a});T.enter().append("g").attr("class","nv-regLines");var U=T.selectAll(".nv-regLine").data(function(a){return[a]});U.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0);U.transition().attr("x1",n.range()[0]).attr("x2",n.range()[1]).attr("y1",function(a,b){return o(n.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a,b){return o(n.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return m(a,c)}).style("stroke-opacity",function(a,b){return a.disabled||"undefined"==typeof a.slope||"undefined"==typeof a.intercept?0:1}),s&&(c.scale(n).ticks(c.ticks()?c.ticks():L/100).tickSize(-M,0),S.select(".nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")").call(c)),t&&(d.scale(o).ticks(d.ticks()?d.ticks():M/36).tickSize(-L,0),S.select(".nv-y.nv-axis").call(d)),p&&(h.getData(b.x()).scale(n).width(L).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled})),R.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),S.select(".nv-distributionX").attr("transform","translate(0,"+o.range()[0]+")").datum(g.filter(function(a){return!a.disabled})).call(h)),q&&(i.getData(b.y()).scale(o).width(M).color(g.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!g[b].disabled})),R.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),S.select(".nv-distributionY").attr("transform","translate("+(u?L:-i.size())+",0)").datum(g.filter(function(a){return!a.disabled})).call(i)),d3.fisheye&&(S.select(".nv-background").attr("width",L).attr("height",M),S.select(".nv-background").on("mousemove",z),S.select(".nv-background").on("click",function(){x=!x}),b.dispatch.on("elementClick.freezeFisheye",function(){x=!x})),f.dispatch.on("legendClick",function(e,f){e.disabled=!e.disabled,w=e.disabled?0:2.5,S.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),S.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(n.distortion(w).focus(0),o.distortion(w).focus(0),S.select(".nv-scatterWrap").call(b),S.select(".nv-x.nv-axis").call(c),S.select(".nv-y.nv-axis").call(d)):x=!1,a.update()}),e.dispatch.on("stateChange",function(b){C=b,E.stateChange(C),a.update()}),b.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos[1]-M),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+h.size()),a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],E.tooltipShow(a)}),E.on("tooltipShow",function(a){y&&J(a,B.parentNode)}),E.on("changeState",function(b){"undefined"!=typeof b.disabled&&(g.forEach(function(a,c){a.disabled=b.disabled[c]}),C.disabled=b.disabled),a.update()}),H=n.copy(),I=o.copy()}),a}var b=g.models.scatter(),c=g.models.axis(),d=g.models.axis(),e=g.models.legend(),f=g.models.legend(),h=g.models.distribution(),i=g.models.distribution(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=g.utils.defaultColor(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.xScale(),o=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.yScale(),p=!1,q=!1,r=!0,s=!0,t=!0,u=!1,v=!!d3.fisheye,w=0,x=!1,y=!0,z=function(a,b,c){return"<strong>"+b+"</strong>"},A=function(a,b,c){return"<strong>"+c+"</strong>"},B=function(a,b,c,d){return"<h3>"+a+"</h3><p>"+d+"</p>"},C={},D=null,E=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),F="No Data Available.",G=250;b.xScale(n).yScale(o),c.orient("bottom").tickPadding(10),d.orient(u?"right":"left").tickPadding(10),h.axis("x"),i.axis("y"),f.updateState(!1);var H,I,J=function(e,f){var h=e.pos[0]+(f.offsetLeft||0),i=e.pos[1]+(f.offsetTop||0),k=e.pos[0]+(f.offsetLeft||0),l=o.range()[0]+j.top+(f.offsetTop||0),m=n.range()[0]+j.left+(f.offsetLeft||0),p=e.pos[1]+(f.offsetTop||0),q=c.tickFormat()(b.x()(e.point,e.pointIndex)),r=d.tickFormat()(b.y()(e.point,e.pointIndex));null!=z&&g.tooltip.show([k,l],z(e.series.key,q,r,e,a),"n",1,f,"x-nvtooltip"),null!=A&&g.tooltip.show([m,p],A(e.series.key,q,r,e,a),"e",1,f,"y-nvtooltip"),null!=B&&g.tooltip.show([h,i],B(e.series.key,q,r,e.point.tooltip,e,a),e.value<0?"n":"s",null,f)},K=[{key:"Magnify",disabled:!0}];return b.dispatch.on("elementMouseout.tooltip",function(a){E.tooltipHide(a),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",i.size())}),E.on("tooltipHide",function(){y&&g.tooltip.cleanup()}),a.dispatch=E,a.scatter=b,a.legend=e,a.controls=f,a.xAxis=c,a.yAxis=d,a.distX=h,a.distY=i,d3.rebind(a,b,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(j.top="undefined"!=typeof b.top?b.top:j.top,j.right="undefined"!=typeof b.right?b.right:j.right,j.bottom="undefined"!=typeof b.bottom?b.bottom:j.bottom,j.left="undefined"!=typeof b.left?b.left:j.left,a):j},a.width=function(b){return arguments.length?(k=b,a):k},a.height=function(b){return arguments.length?(l=b,a):l},a.color=function(b){return arguments.length?(m=g.utils.getColor(b),e.color(m),h.color(m),i.color(m),a):m},a.showDistX=function(b){return arguments.length?(p=b,a):p},a.showDistY=function(b){return arguments.length?(q=b,a):q},a.showControls=function(b){return arguments.length?(v=b,a):v},a.showLegend=function(b){return arguments.length?(r=b,a):r},a.showXAxis=function(b){return arguments.length?(s=b,a):s},a.showYAxis=function(b){return arguments.length?(t=b,a):t},a.rightAlignYAxis=function(b){return arguments.length?(u=b,d.orient(b?"right":"left"),a):u},a.fisheye=function(b){return arguments.length?(w=b,a):w},a.tooltips=function(b){return arguments.length?(y=b,a):y},a.tooltipContent=function(b){return arguments.length?(B=b,a):B},a.tooltipXContent=function(b){return arguments.length?(z=b,a):z},a.tooltipYContent=function(b){return arguments.length?(A=b,a):A},a.state=function(b){return arguments.length?(C=b,a):C},a.defaultState=function(b){return arguments.length?(D=b,a):D},a.noData=function(b){return arguments.length?(F=b,a):F},a.transitionDuration=function(b){return arguments.length?(G=b,a):G},a},g.models.sparkline=function(){function a(g){return g.each(function(a){var g=h-f.left-f.right,j=i-f.top-f.bottom,p=d3.select(this);k.domain(b||d3.extent(a,m)).range(d||[0,g]),l.domain(c||d3.extent(a,n)).range(e||[j,0]);var q=p.selectAll("g.nv-wrap.nv-sparkline").data([a]),r=q.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");r.append("g"),q.select("g");q.attr("transform","translate("+f.left+","+f.top+")");var s=q.selectAll("path").data(function(a){return[a]});s.enter().append("path"),s.exit().remove(),s.style("stroke",function(a,b){return a.color||o(a,b)}).attr("d",d3.svg.line().x(function(a,b){return k(m(a,b))}).y(function(a,b){return l(n(a,b))}));var t=q.selectAll("circle.nv-point").data(function(a){function b(b){if(-1!=b){var c=a[b];return c.pointIndex=b,c}return null}var c=a.map(function(a,b){return n(a,b)}),d=b(c.lastIndexOf(l.domain()[1])),e=b(c.indexOf(l.domain()[0])),f=b(c.length-1);return[e,d,f].filter(function(a){return null!=a})});t.enter().append("circle"),t.exit().remove(),t.attr("cx",function(a,b){return k(m(a,a.pointIndex))}).attr("cy",function(a,b){return l(n(a,a.pointIndex))}).attr("r",2).attr("class",function(a,b){return m(a,a.pointIndex)==k.domain()[1]?"nv-point nv-currentValue":n(a,a.pointIndex)==l.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),a}var b,c,d,e,f={top:2,right:0,bottom:2,left:0},h=400,i=32,j=!0,k=d3.scale.linear(),l=d3.scale.linear(),m=function(a){return a.x},n=function(a){return a.y},o=g.utils.getColor(["#000"]);return a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(f.top="undefined"!=typeof b.top?b.top:f.top,f.right="undefined"!=typeof b.right?b.right:f.right,f.bottom="undefined"!=typeof b.bottom?b.bottom:f.bottom,f.left="undefined"!=typeof b.left?b.left:f.left,a):f},a.width=function(b){return arguments.length?(h=b,a):h},a.height=function(b){return arguments.length?(i=b,a):i},a.x=function(b){return arguments.length?(m=d3.functor(b),a):m},a.y=function(b){return arguments.length?(n=d3.functor(b),a):n},a.xScale=function(b){return arguments.length?(k=b,a):k},a.yScale=function(b){return arguments.length?(l=b,a):l},a.xDomain=function(c){return arguments.length?(b=c,a):b},a.yDomain=function(b){return arguments.length?(c=b,a):c},a.xRange=function(b){return arguments.length?(d=b,a):d;
},a.yRange=function(b){return arguments.length?(e=b,a):e},a.animate=function(b){return arguments.length?(j=b,a):j},a.color=function(b){return arguments.length?(o=g.utils.getColor(b),a):o},a},g.models.sparklinePlus=function(){function a(g){return g.each(function(m){function q(){if(!j){var a=A.selectAll(".nv-hoverValue").data(i),c=a.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);a.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),a.attr("transform",function(a){return"translate("+b(d.x()(m[a],a))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),i.length&&(c.append("line").attr("x1",0).attr("y1",-e.top).attr("x2",0).attr("y2",u),c.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-e.top).attr("text-anchor","end").attr("dy",".9em"),A.select(".nv-hoverValue .nv-xValue").text(k(d.x()(m[i[0]],i[0]))),c.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-e.top).attr("text-anchor","start").attr("dy",".9em"),A.select(".nv-hoverValue .nv-yValue").text(l(d.y()(m[i[0]],i[0]))))}}function r(){function a(a,b){for(var c=Math.abs(d.x()(a[0],0)-b),e=0,f=0;f<a.length;f++)Math.abs(d.x()(a[f],f)-b)<c&&(c=Math.abs(d.x()(a[f],f)-b),e=f);return e}if(!j){var c=d3.mouse(this)[0]-e.left;i=[a(m,Math.round(b.invert(c)))],q()}}var s=d3.select(this),t=(f||parseInt(s.style("width"))||960)-e.left-e.right,u=(h||parseInt(s.style("height"))||400)-e.top-e.bottom;if(a.update=function(){a(g)},a.container=this,!m||!m.length){var v=s.selectAll(".nv-noData").data([p]);return v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",e.left+t/2).attr("y",e.top+u/2).text(function(a){return a}),a}s.selectAll(".nv-noData").remove();var w=d.y()(m[m.length-1],m.length-1);b=d.xScale(),c=d.yScale();var x=s.selectAll("g.nv-wrap.nv-sparklineplus").data([m]),y=x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),z=y.append("g"),A=x.select("g");z.append("g").attr("class","nv-sparklineWrap"),z.append("g").attr("class","nv-valueWrap"),z.append("g").attr("class","nv-hoverArea"),x.attr("transform","translate("+e.left+","+e.top+")");var B=A.select(".nv-sparklineWrap");d.width(t).height(u),B.call(d);var C=A.select(".nv-valueWrap"),D=C.selectAll(".nv-currentValue").data([w]);D.enter().append("text").attr("class","nv-currentValue").attr("dx",o?-8:8).attr("dy",".9em").style("text-anchor",o?"end":"start"),D.attr("x",t+(o?e.right:0)).attr("y",n?function(a){return c(a)}:0).style("fill",d.color()(m[m.length-1],m.length-1)).text(l(w)),z.select(".nv-hoverArea").append("rect").on("mousemove",r).on("click",function(){j=!j}).on("mouseout",function(){i=[],q()}),A.select(".nv-hoverArea rect").attr("transform",function(a){return"translate("+-e.left+","+-e.top+")"}).attr("width",t+e.left+e.right).attr("height",u+e.top)}),a}var b,c,d=g.models.sparkline(),e={top:15,right:100,bottom:10,left:50},f=null,h=null,i=[],j=!1,k=d3.format(",r"),l=d3.format(",.2f"),m=!0,n=!0,o=!1,p="No Data Available.";return a.sparkline=d,d3.rebind(a,d,"x","y","xScale","yScale","color"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(e.top="undefined"!=typeof b.top?b.top:e.top,e.right="undefined"!=typeof b.right?b.right:e.right,e.bottom="undefined"!=typeof b.bottom?b.bottom:e.bottom,e.left="undefined"!=typeof b.left?b.left:e.left,a):e},a.width=function(b){return arguments.length?(f=b,a):f},a.height=function(b){return arguments.length?(h=b,a):h},a.xTickFormat=function(b){return arguments.length?(k=b,a):k},a.yTickFormat=function(b){return arguments.length?(l=b,a):l},a.showValue=function(b){return arguments.length?(m=b,a):m},a.alignValue=function(b){return arguments.length?(n=b,a):n},a.rightAlignValue=function(b){return arguments.length?(o=b,a):o},a.noData=function(b){return arguments.length?(p=b,a):p},a},g.models.stackedArea=function(){function a(g){return g.each(function(g){var l=e-d.left-d.right,s=f-d.top-d.bottom,t=d3.select(this);b=q.xScale(),c=q.yScale();var u=g;g.forEach(function(a,b){a.seriesIndex=b,a.values=a.values.map(function(a,c){return a.index=c,a.seriesIndex=b,a})});var v=g.filter(function(a){return!a.disabled});g=d3.layout.stack().order(n).offset(m).values(function(a){return a.values}).x(j).y(k).out(function(a,b,c){var d=0===k(a)?0:c;a.display={y:d,y0:b}})(v);var w=t.selectAll("g.nv-wrap.nv-stackedarea").data([g]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),y=x.append("defs"),z=x.append("g"),A=w.select("g");z.append("g").attr("class","nv-areaWrap"),z.append("g").attr("class","nv-scatterWrap"),w.attr("transform","translate("+d.left+","+d.top+")"),q.width(l).height(s).x(j).y(function(a){return a.display.y+a.display.y0}).forceY([0]).color(g.map(function(a,b){return a.color||h(a,a.seriesIndex)}));var B=A.select(".nv-scatterWrap").datum(g);B.call(q),y.append("clipPath").attr("id","nv-edge-clip-"+i).append("rect"),w.select("#nv-edge-clip-"+i+" rect").attr("width",l).attr("height",s),A.attr("clip-path",p?"url(#nv-edge-clip-"+i+")":"");var C=d3.svg.area().x(function(a,c){return b(j(a,c))}).y0(function(a){return c(a.display.y0)}).y1(function(a){return c(a.display.y+a.display.y0)}).interpolate(o),D=d3.svg.area().x(function(a,c){return b(j(a,c))}).y0(function(a){return c(a.display.y0)}).y1(function(a){return c(a.display.y0)}),E=A.select(".nv-areaWrap").selectAll("path.nv-area").data(function(a){return a});E.enter().append("path").attr("class",function(a,b){return"nv-area nv-area-"+b}).attr("d",function(a,b){return D(a.values,a.seriesIndex)}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),r.areaMouseover({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),r.areaMouseout({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("click",function(a,b){d3.select(this).classed("hover",!1),r.areaClick({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}),E.exit().remove(),E.style("fill",function(a,b){return a.color||h(a,a.seriesIndex)}).style("stroke",function(a,b){return a.color||h(a,a.seriesIndex)}),E.transition().attr("d",function(a,b){return C(a.values,b)}),q.dispatch.on("elementMouseover.area",function(a){A.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!0)}),q.dispatch.on("elementMouseout.area",function(a){A.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!1)}),a.d3_stackedOffset_stackPercent=function(a){var b,c,d,e=a.length,f=a[0].length,g=1/e,h=[];for(c=0;f>c;++c){for(b=0,d=0;b<u.length;b++)d+=k(u[b].values[c]);if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=g}for(c=0;f>c;++c)h[c]=0;return h}}),a}var b,c,d={top:0,right:0,bottom:0,left:0},e=960,f=500,h=g.utils.defaultColor(),i=Math.floor(1e5*Math.random()),j=function(a){return a.x},k=function(a){return a.y},l="stack",m="zero",n="default",o="linear",p=!1,q=g.models.scatter(),r=d3.dispatch("tooltipShow","tooltipHide","areaClick","areaMouseover","areaMouseout");return q.size(2.2).sizeDomain([2.2,2.2]),q.dispatch.on("elementClick.area",function(a){r.areaClick(a)}),q.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+d.left,a.pos[1]+d.top],r.tooltipShow(a)}),q.dispatch.on("elementMouseout.tooltip",function(a){r.tooltipHide(a)}),a.dispatch=r,a.scatter=q,d3.rebind(a,q,"interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","highlightPoint","clearHighlights"),a.options=g.utils.optionsFunc.bind(a),a.x=function(b){return arguments.length?(j=d3.functor(b),a):j},a.y=function(b){return arguments.length?(k=d3.functor(b),a):k},a.margin=function(b){return arguments.length?(d.top="undefined"!=typeof b.top?b.top:d.top,d.right="undefined"!=typeof b.right?b.right:d.right,d.bottom="undefined"!=typeof b.bottom?b.bottom:d.bottom,d.left="undefined"!=typeof b.left?b.left:d.left,a):d},a.width=function(b){return arguments.length?(e=b,a):e},a.height=function(b){return arguments.length?(f=b,a):f},a.clipEdge=function(b){return arguments.length?(p=b,a):p},a.color=function(b){return arguments.length?(h=g.utils.getColor(b),a):h},a.offset=function(b){return arguments.length?(m=b,a):m},a.order=function(b){return arguments.length?(n=b,a):n},a.style=function(b){if(!arguments.length)return l;switch(l=b){case"stack":a.offset("zero"),a.order("default");break;case"stream":a.offset("wiggle"),a.order("inside-out");break;case"stream-center":a.offset("silhouette"),a.order("inside-out");break;case"expand":a.offset("expand"),a.order("default");break;case"stack_percent":a.offset(a.d3_stackedOffset_stackPercent),a.order("default")}return a},a.interpolate=function(b){return arguments.length?(o=b,a):o},a},g.models.stackedAreaChart=function(){function a(v){return v.each(function(v){var G=d3.select(this),H=this,I=(l||parseInt(G.style("width"))||960)-k.left-k.right,J=(m||parseInt(G.style("height"))||400)-k.top-k.bottom;if(a.update=function(){G.transition().duration(E).call(a)},a.container=this,x.disabled=v.map(function(a){return!!a.disabled}),!y){var K;y={};for(K in x)x[K]instanceof Array?y[K]=x[K].slice(0):y[K]=x[K]}if(!(v&&v.length&&v.filter(function(a){return a.values.length}).length)){var L=G.selectAll(".nv-noData").data([z]);return L.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),L.attr("x",k.left+I/2).attr("y",k.top+J/2).text(function(a){return a}),a}G.selectAll(".nv-noData").remove(),b=d.xScale(),c=d.yScale();var M=G.selectAll("g.nv-wrap.nv-stackedAreaChart").data([v]),N=M.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),O=M.select("g");if(N.append("rect").style("opacity",0),N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-stackedWrap"),N.append("g").attr("class","nv-legendWrap"),N.append("g").attr("class","nv-controlsWrap"),N.append("g").attr("class","nv-interactive"),O.select("rect").attr("width",I).attr("height",J),p){var P=o?I-B:I;h.width(P),O.select(".nv-legendWrap").datum(v).call(h),k.top!=h.height()&&(k.top=h.height(),J=(m||parseInt(G.style("height"))||400)-k.top-k.bottom),O.select(".nv-legendWrap").attr("transform","translate("+(I-P)+","+-k.top+")")}if(o){var Q=[{key:D.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=d.style(),style:"stack"},{key:D.stream||"Stream",metaKey:"Stream",disabled:"stream"!=d.style(),style:"stream"},{key:D.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=d.style(),style:"expand"},{key:D.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=d.style(),style:"stack_percent"}];B=C.length/3*260,Q=Q.filter(function(a){return-1!==C.indexOf(a.metaKey)}),i.width(B).color(["#444","#444","#444"]),O.select(".nv-controlsWrap").datum(Q).call(i),k.top!=Math.max(i.height(),h.height())&&(k.top=Math.max(i.height(),h.height()),J=(m||parseInt(G.style("height"))||400)-k.top-k.bottom),O.select(".nv-controlsWrap").attr("transform","translate(0,"+-k.top+")")}M.attr("transform","translate("+k.left+","+k.top+")"),s&&O.select(".nv-y.nv-axis").attr("transform","translate("+I+",0)"),t&&(j.width(I).height(J).margin({left:k.left,top:k.top}).svgContainer(G).xScale(b),M.select(".nv-interactive").call(j)),d.width(I).height(J);var R=O.select(".nv-stackedWrap").datum(v);R.transition().call(d),q&&(e.scale(b).ticks(I/100).tickSize(-J,0),O.select(".nv-x.nv-axis").attr("transform","translate(0,"+J+")"),O.select(".nv-x.nv-axis").transition().duration(0).call(e)),r&&(f.scale(c).ticks("wiggle"==d.offset()?0:J/36).tickSize(-I,0).setTickFormat("expand"==d.style()||"stack_percent"==d.style()?d3.format("%"):w),O.select(".nv-y.nv-axis").transition().duration(0).call(f)),d.dispatch.on("areaClick.toggle",function(b){1===v.filter(function(a){return!a.disabled}).length?v.forEach(function(a){a.disabled=!1}):v.forEach(function(a,c){a.disabled=c!=b.seriesIndex}),x.disabled=v.map(function(a){return!!a.disabled}),A.stateChange(x),a.update()}),h.dispatch.on("stateChange",function(b){x.disabled=b.disabled,A.stateChange(x),a.update()}),i.dispatch.on("legendClick",function(b,c){b.disabled&&(Q=Q.map(function(a){return a.disabled=!0,a}),b.disabled=!1,d.style(b.style),x.style=d.style(),A.stateChange(x),a.update())}),j.dispatch.on("elementMousemove",function(b){d.clearHighlights();var c,h,i,l=[];if(v.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e,f){h=g.interactiveBisect(e.values,b.pointXValue,a.x()),d.highlightPoint(f,h,!0);var j=e.values[h];if("undefined"!=typeof j){"undefined"==typeof c&&(c=j),"undefined"==typeof i&&(i=a.xScale()(a.x()(j,h)));var k="expand"==d.style()?j.display.y:a.y()(j,h);l.push({key:e.key,value:k,color:n(e,e.seriesIndex),stackedValue:j.display})}}),l.reverse(),l.length>2){var m=a.yScale().invert(b.mouseY),o=null;l.forEach(function(a,b){m=Math.abs(m);var c=Math.abs(a.stackedValue.y0),d=Math.abs(a.stackedValue.y);return m>=c&&d+c>=m?void(o=b):void 0}),null!=o&&(l[o].highlight=!0)}var p=e.tickFormat()(a.x()(c,h)),q="expand"==d.style()?function(a,b){return d3.format(".1%")(a)}:function(a,b){return f.tickFormat()(a)};j.tooltip.position({left:i+k.left,top:b.mouseY+k.top}).chartContainer(H.parentNode).enabled(u).valueFormatter(q).data({value:p,series:l})(),j.renderGuideLine(i)}),j.dispatch.on("elementMouseout",function(a){A.tooltipHide(),d.clearHighlights()}),A.on("tooltipShow",function(a){u&&F(a,H.parentNode)}),A.on("changeState",function(b){"undefined"!=typeof b.disabled&&(v.forEach(function(a,c){a.disabled=b.disabled[c]}),x.disabled=b.disabled),"undefined"!=typeof b.style&&d.style(b.style),a.update()})}),a}var b,c,d=g.models.stackedArea(),e=g.models.axis(),f=g.models.axis(),h=g.models.legend(),i=g.models.legend(),j=g.interactiveGuideline(),k={top:30,right:25,bottom:50,left:60},l=null,m=null,n=g.utils.defaultColor(),o=!0,p=!0,q=!0,r=!0,s=!1,t=!1,u=!0,v=function(a,b,c,d,e){return"<h3>"+a+"</h3><p>"+c+" on "+b+"</p>"},w=d3.format(",.2f"),x={style:d.style()},y=null,z="No Data Available.",A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),B=250,C=["Stacked","Stream","Expanded"],D={},E=250;e.orient("bottom").tickPadding(7),f.orient(s?"right":"left"),i.updateState(!1);var F=function(b,c){var h=b.pos[0]+(c.offsetLeft||0),i=b.pos[1]+(c.offsetTop||0),j=e.tickFormat()(d.x()(b.point,b.pointIndex)),k=f.tickFormat()(d.y()(b.point,b.pointIndex)),l=v(b.series.key,j,k,b,a);g.tooltip.show([h,i],l,b.value<0?"n":"s",null,c)};return d.dispatch.on("tooltipShow",function(a){a.pos=[a.pos[0]+k.left,a.pos[1]+k.top],A.tooltipShow(a)}),d.dispatch.on("tooltipHide",function(a){A.tooltipHide(a)}),A.on("tooltipHide",function(){u&&g.tooltip.cleanup()}),a.dispatch=A,a.stacked=d,a.legend=h,a.controls=i,a.xAxis=e,a.yAxis=f,a.interactiveLayer=j,d3.rebind(a,d,"x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","sizeDomain","interactive","useVoronoi","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),a.options=g.utils.optionsFunc.bind(a),a.margin=function(b){return arguments.length?(k.top="undefined"!=typeof b.top?b.top:k.top,k.right="undefined"!=typeof b.right?b.right:k.right,k.bottom="undefined"!=typeof b.bottom?b.bottom:k.bottom,k.left="undefined"!=typeof b.left?b.left:k.left,a):k},a.width=function(b){return arguments.length?(l=b,a):l},a.height=function(b){return arguments.length?(m=b,a):m},a.color=function(b){return arguments.length?(n=g.utils.getColor(b),h.color(n),d.color(n),a):n},a.showControls=function(b){return arguments.length?(o=b,a):o},a.showLegend=function(b){return arguments.length?(p=b,a):p},a.showXAxis=function(b){return arguments.length?(q=b,a):q},a.showYAxis=function(b){return arguments.length?(r=b,a):r},a.rightAlignYAxis=function(b){return arguments.length?(s=b,f.orient(b?"right":"left"),a):s},a.useInteractiveGuideline=function(b){return arguments.length?(t=b,b===!0&&(a.interactive(!1),a.useVoronoi(!1)),a):t},a.tooltip=function(b){return arguments.length?(v=b,a):v},a.tooltips=function(b){return arguments.length?(u=b,a):u},a.tooltipContent=function(b){return arguments.length?(v=b,a):v},a.state=function(b){return arguments.length?(x=b,a):x},a.defaultState=function(b){return arguments.length?(y=b,a):y},a.noData=function(b){return arguments.length?(z=b,a):z},a.transitionDuration=function(b){return arguments.length?(E=b,a):E},a.controlsData=function(b){return arguments.length?(C=b,a):C},a.controlLabels=function(b){return arguments.length?"object"!=typeof b?D:(D=b,a):D},f.setTickFormat=f.tickFormat,f.tickFormat=function(a){return arguments.length?(w=a,f):w},a}}();