- Timestamp:
- 05/20/16 13:01:12 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/wwwroot/js/app.js
r13795 r13854 10 10 };return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery),angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("collapse",["$animate",function(a){return{link:function(b,c,d){function e(){c.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),a.addClass(c,"in",{to:{height:c[0].scrollHeight+"px"}}).then(f)}function f(){c.removeClass("collapsing"),c.css({height:"auto"})}function g(){return c.hasClass("collapse")||c.hasClass("in")?(c.css({height:c[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),void a.removeClass(c,"in",{to:{height:"0"}}).then(h)):h()}function h(){c.css({height:"0"}),c.removeClass("collapsing"),c.addClass("collapse")}b.$watch(d.collapse,function(a){a?g():e()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",controllerAs:"accordion",transclude:!0,replace:!1,templateUrl:function(a,b){return b.templateUrl||"template/accordion/accordion.html"}}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"template/accordion/accordion-group.html"},scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass,a.$watch("isOpen",function(c){b.toggleClass(a.openClass,c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.find("span").html(""),b.find("span").append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable=!!b.close,this.close=a.close}]).directive("alert",function(){return{controller:"AlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}).directive("dismissOnTimeout",["$timeout",function(a){return{require:"alert",link:function(b,c,d,e){a(function(){e.close()},parseInt(d.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).value("$bindHtmlUnsafeSuppressDeprecated",!1).directive("bindHtmlUnsafe",["$log","$bindHtmlUnsafeSuppressDeprecated",function(a,b){return function(c,d,e){b||a.warn("bindHtmlUnsafe is now deprecated. Use ngBindHtml instead"),d.addClass("ng-binding").data("$binding",e.bindHtmlUnsafe),c.$watch(e.bindHtmlUnsafe,function(a){d.html(a||"")})}}]),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",controllerAs:"buttons",link:function(a,b,c,d){var e=d[0],f=d[1];b.find("input").css({display:"none"}),f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){if(!c.disabled){var d=b.hasClass(e.activeClass);d&&!angular.isDefined(c.uncheckable)||a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})}})}}}).directive("btnCheckbox",["$document",function(a){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",controllerAs:"button",link:function(b,c,d,e){function f(){return h(d.btnCheckboxTrue,!0)}function g(){return h(d.btnCheckboxFalse,!1)}function h(a,c){var d=b.$eval(a);return angular.isDefined(d)?d:c}var i=e[0],j=e[1];c.find("input").css({display:"none"}),j.$render=function(){c.toggleClass(i.activeClass,angular.equals(j.$modelValue,f()))},c.bind(i.toggleEvent,function(){d.disabled||b.$apply(function(){j.$setViewValue(c.hasClass(i.activeClass)?g():f()),j.$render()})}),c.on("keypress",function(e){d.disabled||32!==e.which||a[0].activeElement!==c[0]||b.$apply(function(){j.$setViewValue(c.hasClass(i.activeClass)?g():f()),j.$render()})})}}}]),angular.module("ui.bootstrap.carousel",[]).controller("CarouselController",["$scope","$element","$interval","$animate",function(a,b,c,d){ 11 11 function e(b,c,e){r||(angular.extend(b,{direction:e,active:!0}),angular.extend(l.currentSlide||{},{direction:e,active:!1}),d.enabled()&&!a.noTransition&&!a.$currentTransition&&b.$element&&l.slides.length>1&&(b.$element.data(p,b.direction),l.currentSlide&&l.currentSlide.$element&&l.currentSlide.$element.data(p,b.direction),a.$currentTransition=!0,n?d.on("addClass",b.$element,function(b,c){"close"===c&&(a.$currentTransition=null,d.off("addClass",b))}):b.$element.one("$animate:close",function(){a.$currentTransition=null})),l.currentSlide=b,q=c,g())}function f(a){if(angular.isUndefined(m[a].index))return m[a];var b;m.length;for(b=0;b<m.length;++b)if(m[b].index==a)return m[b]}function g(){h();var b=+a.interval;!isNaN(b)&&b>0&&(j=c(i,b))}function h(){j&&(c.cancel(j),j=null)}function i(){var b=+a.interval;k&&!isNaN(b)&&b>0&&m.length?a.next():a.pause()}var j,k,l=this,m=l.slides=a.slides=[],n=angular.version.minor>=4,o="uib-noTransition",p="uib-slideDirection",q=-1;l.currentSlide=null;var r=!1;l.select=a.select=function(b,c){var d=a.indexOfSlide(b);void 0===c&&(c=d>l.getCurrentIndex()?"next":"prev"),b&&b!==l.currentSlide&&!a.$currentTransition&&e(b,d,c)},a.$on("$destroy",function(){r=!0}),l.getCurrentIndex=function(){return l.currentSlide&&angular.isDefined(l.currentSlide.index)?+l.currentSlide.index:q},a.indexOfSlide=function(a){return angular.isDefined(a.index)?+a.index:m.indexOf(a)},a.next=function(){var b=(l.getCurrentIndex()+1)%m.length;return 0===b&&a.noWrap()?void a.pause():l.select(f(b),"next")},a.prev=function(){var b=l.getCurrentIndex()-1<0?m.length-1:l.getCurrentIndex()-1;return a.noWrap()&&b===m.length-1?void a.pause():l.select(f(b),"prev")},a.isActive=function(a){return l.currentSlide===a},a.$watch("interval",g),a.$on("$destroy",h),a.play=function(){k||(k=!0,g())},a.pause=function(){a.noPause||(k=!1,h())},l.addSlide=function(b,c){b.$element=c,m.push(b),1===m.length||b.active?(l.select(m[m.length-1]),1==m.length&&a.play()):b.active=!1},l.removeSlide=function(a){angular.isDefined(a.index)&&m.sort(function(a,b){return+a.index>+b.index});var b=m.indexOf(a);m.splice(b,1),m.length>0&&a.active?b>=m.length?l.select(m[b-1]):l.select(m[b]):q>b&&q--,0===m.length&&(l.currentSlide=null)},a.$watch("noTransition",function(a){b.data(o,a)})}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",controllerAs:"carousel",require:"carousel",templateUrl:function(a,b){return b.templateUrl||"template/carousel/carousel.html"},scope:{interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"template/carousel/slide.html"},scope:{active:"=?",actual:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}).animation(".item",["$injector","$animate",function(a,b){function c(a,b,c){a.removeClass(b),c&&c()}var d="uib-noTransition",e="uib-slideDirection",f=null;return a.has("$animateCss")&&(f=a.get("$animateCss")),{beforeAddClass:function(a,g,h){if("active"==g&&a.parent()&&!a.parent().data(d)){var i=!1,j=a.data(e),k="next"==j?"left":"right",l=c.bind(this,a,k+" "+j,h);return a.addClass(j),f?f(a,{addClass:k}).start().done(l):b.addClass(a,k).then(function(){i||l(),h()}),function(){i=!0}}h()},beforeRemoveClass:function(a,g,h){if("active"===g&&a.parent()&&!a.parent().data(d)){var i=!1,j=a.data(e),k="next"==j?"left":"right",l=c.bind(this,a,k,h);return f?f(a,{addClass:k}).start().done(l):b.addClass(a,k).then(function(){i||l(),h()}),function(){i=!0}}h()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$log","$locale","orderByFilter",function(a,b,c){function d(a){var b=[],d=a.split("");return angular.forEach(g,function(c,e){var f=a.indexOf(e);if(f>-1){a=a.split(""),d[f]="("+c.regex+")",a[f]="$";for(var g=f+1,h=f+e.length;h>g;g++)d[g]="",a[g]="$";a=a.join(""),b.push({index:f,apply:c.apply})}}),{regex:new RegExp("^"+d.join("")+"$"),map:c(b,"index")}}function e(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}var f=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.parsers={};var g={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)}},MMM:{regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:b.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:b.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a}},hh:{regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a}},H:{regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a}},h:{regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a}},mm:{regex:"[0-5][0-9]",apply:function(a){this.minutes=+a}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a}},sss:{regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a}},ss:{regex:"[0-5][0-9]",apply:function(a){this.seconds=+a}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a}},a:{regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)}}};this.parse=function(c,g,h){if(!angular.isString(c)||!g)return c;g=b.DATETIME_FORMATS[g]||g,g=g.replace(f,"\\$&"),this.parsers[g]||(this.parsers[g]=d(g));var i=this.parsers[g],j=i.regex,k=i.map,l=c.match(j);if(l&&l.length){var m,n;angular.isDate(h)&&!isNaN(h.getTime())?m={year:h.getFullYear(),month:h.getMonth(),date:h.getDate(),hours:h.getHours(),minutes:h.getMinutes(),seconds:h.getSeconds(),milliseconds:h.getMilliseconds()}:(h&&a.warn("dateparser:","baseDate is not a valid date"),m={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var o=1,p=l.length;p>o;o++){var q=k[o-1];q.apply&&q.apply.call(m,l[o])}return e(m.year,m.month,m.date)&&(n=new Date(m.year,m.month,m.date,m.hours,m.minutes,m.seconds,m.milliseconds||0)),n}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).value("$datepickerSuppressError",!1).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$log","dateFilter","datepickerConfig","$datepickerSuppressError",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","showWeeks","startingDay","yearRange","shortcutPropagation"],function(c,e){i[c]=angular.isDefined(b[c])?6>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):g[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=g[d]?new Date(g[d]):null}),angular.forEach(["minMode","maxMode"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(c){i[d]=angular.isDefined(c)?c:b[d],a[d]=i[d],("minMode"==d&&i.modes.indexOf(a.datepickerMode)<i.modes.indexOf(i[d])||"maxMode"==d&&i.modes.indexOf(a.datepickerMode)>i.modes.indexOf(i[d]))&&(a.datepickerMode=i[d])}):(i[d]=g[d]||null,a[d]=i[d])}),a.datepickerMode=a.datepickerMode||g.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined(b.initDate)?(this.activeDate=a.$parent.$eval(b.initDate)||new Date,a.$parent.$watch(b.initDate,function(a){a&&(j.$isEmpty(j.$modelValue)||j.$invalid)&&(i.activeDate=a,i.refreshView())})):this.activeDate=new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$viewValue){var a=new Date(j.$viewValue),b=!isNaN(a);b?this.activeDate=a:h||e.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$viewValue?new Date(j.$viewValue):null;j.$setValidity("dateDisabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$viewValue?new Date(j.$viewValue):null;return{date:a,label:f(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date),customClass:this.customClass(a)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},this.fixTimeZone=function(a){var b=a.getHours();a.setHours(23===b?b+2:0)},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$viewValue?new Date(j.$viewValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){i.element[0].focus()};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),i.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:function(a,b){return b.templateUrl||"template/datepicker/datepicker.html"},scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["datepicker","^ngModel"],controller:"DatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){for(var c,d=new Array(b),f=new Date(a),g=0;b>g;)c=new Date(f),e.fixTimeZone(c),d[g++]=c,f.setDate(f.getDate()+1);return d}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=(11-e.startingDay)%7,p=b.rows.length,q=0;p>q;q++)b.weekNumbers.push(h(b.rows[q][o].date))}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a,b){var c=e.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var d=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(d,1),c=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(c)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c,d=new Array(12),f=e.activeDate.getFullYear(),g=0;12>g;g++)c=new Date(f,g,1),e.fixTimeZone(c),d[g]=angular.extend(e.createDateObject(c,e.formatMonth),{uid:b.uniqueId+"-"+g});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(d,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a,b){var c=e.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);e.activeDate.setMonth(c)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b,c=new Array(f),g=0,h=e(d.activeDate.getFullYear());f>g;g++)b=new Date(h+g,0,1),d.fixTimeZone(b),c[g]=angular.extend(d.createDateObject(b,d.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=d.split(c,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a,b){var c=d.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=5:"right"===a?c+=1:"down"===a?c+=5:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*d.step.years:"home"===a?c=e(d.activeDate.getFullYear()):"end"===a&&(c=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(c)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"template/datepicker/popup.html",datepickerTemplateUrl:"template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0,onOpenFocus:!0}).directive("datepickerPopup",["$compile","$parse","$document","$rootScope","$position","dateFilter","dateParser","datepickerPopupConfig","$timeout",function(a,b,c,d,e,f,g,h,i){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(j,k,l,m){function n(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function o(a){angular.isNumber(a)&&(a=new Date(a));{if(!a)return null;if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=g.parse(a,q,j.date);return isNaN(b)?void 0:b}}}function p(a,b){var c=a||b;if(!l.ngRequired&&!c)return!0;if(angular.isNumber(c)&&(c=new Date(c)),c){if(angular.isDate(c)&&!isNaN(c))return!0;if(angular.isString(c)){var d=g.parse(c,q);return!isNaN(d)}return!1}return!0}var q,r=angular.isDefined(l.closeOnDateSelection)?j.$parent.$eval(l.closeOnDateSelection):h.closeOnDateSelection,s=angular.isDefined(l.datepickerAppendToBody)?j.$parent.$eval(l.datepickerAppendToBody):h.appendToBody,t=angular.isDefined(l.onOpenFocus)?j.$parent.$eval(l.onOpenFocus):h.onOpenFocus,u=angular.isDefined(l.datepickerPopupTemplateUrl)?l.datepickerPopupTemplateUrl:h.datepickerPopupTemplateUrl,v=angular.isDefined(l.datepickerTemplateUrl)?l.datepickerTemplateUrl:h.datepickerTemplateUrl,w={};j.showButtonBar=angular.isDefined(l.showButtonBar)?j.$parent.$eval(l.showButtonBar):h.showButtonBar,j.getText=function(a){return j[a+"Text"]||h[a+"Text"]},j.isDisabled=function(a){return"today"===a&&(a=new Date),j.watchData.minDate&&j.compare(a,w.minDate)<0||j.watchData.maxDate&&j.compare(a,w.maxDate)>0},j.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())};var x=!1;if(h.html5Types[l.type]?(q=h.html5Types[l.type],x=!0):(q=l.datepickerPopup||h.datepickerPopup,l.$observe("datepickerPopup",function(a,b){var c=a||h.datepickerPopup;if(c!==q&&(q=c,m.$modelValue=null,!q))throw new Error("datepickerPopup must have a date format specified.")})),!q)throw new Error("datepickerPopup must have a date format specified.");if(x&&l.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");var y=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");y.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":u});var z=angular.element(y.children()[0]);if(z.attr("template-url",v),x&&"month"===l.type&&(z.attr("datepicker-mode",'"month"'),z.attr("min-mode","month")),l.datepickerOptions){var A=j.$parent.$eval(l.datepickerOptions);A&&A.initDate&&(j.initDate=A.initDate,z.attr("init-date","initDate"),delete A.initDate),angular.forEach(A,function(a,b){z.attr(n(b),a)})}j.watchData={},angular.forEach(["minMode","maxMode","minDate","maxDate","datepickerMode","initDate","shortcutPropagation"],function(a){if(l[a]){var c=b(l[a]);if(j.$parent.$watch(c,function(b){j.watchData[a]=b,"minDate"!==a&&"maxDate"!==a||(w[a]=new Date(b))}),z.attr(n(a),"watchData."+a),"datepickerMode"===a){var d=c.assign;j.$watch("watchData."+a,function(a,b){angular.isFunction(d)&&a!==b&&d(j.$parent,a)})}}}),l.dateDisabled&&z.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),l.showWeeks&&z.attr("show-weeks",l.showWeeks),l.customClass&&z.attr("custom-class","customClass({ date: date, mode: mode })"),x?m.$formatters.push(function(a){return j.date=a,a}):(m.$$parserName="date",m.$validators.date=p,m.$parsers.unshift(o),m.$formatters.push(function(a){return j.date=a,m.$isEmpty(a)?a:f(a,q)})),j.dateSelection=function(a){angular.isDefined(a)&&(j.date=a);var b=j.date?f(j.date,q):null;k.val(b),m.$setViewValue(b),r&&(j.isOpen=!1,k[0].focus())},m.$viewChangeListeners.push(function(){j.date=g.parse(m.$viewValue,q,j.date)});var B=function(a){!j.isOpen||k[0].contains(a.target)||y[0].contains(a.target)||j.$apply(function(){j.isOpen=!1})},C=function(a){27===a.which&&j.isOpen?(a.preventDefault(),a.stopPropagation(),j.$apply(function(){j.isOpen=!1}),k[0].focus()):40!==a.which||j.isOpen||(a.preventDefault(),a.stopPropagation(),j.$apply(function(){j.isOpen=!0}))};k.bind("keydown",C),j.keydown=function(a){27===a.which&&(j.isOpen=!1,k[0].focus())},j.$watch("isOpen",function(a){a?(j.position=s?e.offset(k):e.position(k),j.position.top=j.position.top+k.prop("offsetHeight"),i(function(){t&&j.$broadcast("datepicker.focus"),c.bind("click",B)},0,!1)):c.unbind("click",B)}),j.select=function(a){if("today"===a){var b=new Date;angular.isDate(j.date)?(a=new Date(j.date),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}j.dateSelection(a)},j.close=function(){j.isOpen=!1,k[0].focus()};var D=a(y)(j);y.remove(),s?c.find("body").append(D):k.after(D),j.$on("$destroy",function(){j.isOpen===!0&&(d.$$phase||j.$apply(function(){j.isOpen=!1})),D.remove(),k.unbind("keydown",C),c.unbind("click",B)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/datepicker/popup.html"}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b){c||(a.bind("click",d),a.bind("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b){c===b&&(c=null,a.unbind("click",d),a.unbind("keydown",e))};var d=function(a){if(c&&(!a||"disabled"!==c.getAutoClose())){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(c.focusToggleElement(),d()):c.isKeynavEnabled()&&/(38|40)/.test(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate","$position","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j){var k,l,m=this,n=a.$new(),o=d.openClass,p=angular.noop,q=b.onToggle?c(b.onToggle):angular.noop,r=!1,s=!1,t=h.find("body");this.init=function(d){m.$element=d,b.isOpen&&(l=c(b.isOpen),p=l.assign,a.$watch(l,function(a){n.isOpen=!!a})),r=angular.isDefined(b.dropdownAppendToBody),s=angular.isDefined(b.keyboardNav),r&&m.dropdownMenu&&(t.append(m.dropdownMenu),t.addClass("dropdown"),d.on("$destroy",function(){m.dropdownMenu.remove()}))},this.toggle=function(a){return n.isOpen=arguments.length?!!a:!n.isOpen},this.isOpen=function(){return n.isOpen},n.getToggleElement=function(){return m.toggleElement},n.getAutoClose=function(){return b.autoClose||"always"},n.getElement=function(){return m.$element},n.isKeynavEnabled=function(){return s},n.focusDropdownEntry=function(a){var b=m.dropdownMenu?angular.element(m.dropdownMenu).find("a"):angular.element(m.$element).find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(m.selectedOption)?m.selectedOption=m.selectedOption===b.length-1?m.selectedOption:m.selectedOption+1:m.selectedOption=0;break;case 38:angular.isNumber(m.selectedOption)?m.selectedOption=0===m.selectedOption?0:m.selectedOption-1:m.selectedOption=b.length-1}b[m.selectedOption].focus()},n.getDropdownElement=function(){return m.dropdownMenu},n.focusToggleElement=function(){m.toggleElement&&m.toggleElement[0].focus()},n.$watch("isOpen",function(b,c){if(r&&m.dropdownMenu){var d=g.positionElements(m.$element,m.dropdownMenu,"bottom-left",!0),h={top:d.top+"px",display:b?"block":"none"},l=m.dropdownMenu.hasClass("dropdown-menu-right");l?(h.left="auto",h.right=window.innerWidth-(d.left+m.$element.prop("offsetWidth"))+"px"):(h.left=d.left+"px",h.right="auto"),m.dropdownMenu.css(h)}var s=r?t:m.$element;if(f[b?"addClass":"removeClass"](s,o).then(function(){angular.isDefined(b)&&b!==c&&q(a,{open:!!b})}),b)m.dropdownMenuTemplateUrl&&j(m.dropdownMenuTemplateUrl).then(function(a){k=n.$new(),i(a.trim())(k,function(a){var b=a;m.dropdownMenu.replaceWith(b),m.dropdownMenu=b})}),n.focusToggleElement(),e.open(n);else{if(m.dropdownMenuTemplateUrl){k&&k.$destroy();var u=angular.element('<ul class="dropdown-menu"></ul>');m.dropdownMenu.replaceWith(u),m.dropdownMenu=u}e.close(n),m.selectedOption=null}angular.isFunction(p)&&p(a,b)}),a.$on("$locationChangeSuccess",function(){"disabled"!==n.getAutoClose()&&(n.isOpen=!1)});var u=a.$on("$destroy",function(){n.$destroy()});n.$on("$destroy",u)}]).directive("dropdown",function(){return{controller:"DropdownController",link:function(a,b,c,d){d.init(b),b.addClass("dropdown")}}}).directive("dropdownMenu",function(){return{restrict:"AC",require:"?^dropdown",link:function(a,b,c,d){if(d){var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("keyboardNav",function(){return{restrict:"A",require:"?^dropdown",link:function(a,b,c,d){b.bind("keydown",function(a){if(-1!==[38,40].indexOf(a.which)){a.preventDefault(),a.stopPropagation();var b=d.dropdownMenu.find("a");switch(a.which){case 40:angular.isNumber(d.selectedOption)?d.selectedOption=d.selectedOption===b.length-1?d.selectedOption:d.selectedOption+1:d.selectedOption=0;break;case 38:angular.isNumber(d.selectedOption)?d.selectedOption=0===d.selectedOption?0:d.selectedOption-1:d.selectedOption=b.length-1}b[d.selectedOption].focus()}})}}}).directive("dropdownToggle",function(){return{require:"?^dropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}).directive("modalBackdrop",["$animate","$injector","$modalStack",function(a,b,c){function d(b,d,f){f.modalInClass&&(e?e(d,{addClass:f.modalInClass}).start():a.addClass(d,f.modalInClass),b.$on(c.NOW_CLOSING_EVENT,function(b,c){var g=c();e?e(d,{removeClass:f.modalInClass}).start().then(g):a.removeClass(d,f.modalInClass).then(g)}))}var e=null;return b.has("$animateCss")&&(e=b.get("$animateCss")),{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(a,b){return a.addClass(b.backdropClass),d}}}]).directive("modalWindow",["$modalStack","$q","$animate","$injector",function(a,b,c,d){var e=null;return d.has("$animateCss")&&(e=d.get("$animateCss")),{restrict:"EA",scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(d,f,g){f.addClass(g.windowClass||""),d.size=g.size,d.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!==c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},d.$isRendered=!0;var h=b.defer();g.$observe("modalRender",function(a){"true"==a&&h.resolve()}),h.promise.then(function(){var h=null;g.modalInClass&&(h=e?e(f,{addClass:g.modalInClass}).start():c.addClass(f,g.modalInClass),d.$on(a.NOW_CLOSING_EVENT,function(a,b){var d=b();e?e(f,{removeClass:g.modalInClass}).start().then(d):c.removeClass(f,g.modalInClass).then(d)})),b.when(h).then(function(){var a=f[0].querySelectorAll("[autofocus]");a.length?a[0].focus():f[0].focus()});var i=a.getTop();i&&a.modalRendered(i.key)})}}}]).directive("modalAnimationClass",[function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.modalAnimationClass)}}}]).directive("modalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$modalStack",["$animate","$timeout","$document","$compile","$rootScope","$q","$injector","$$multiMap","$$stackedMap",function(a,b,c,d,e,f,g,h,i){function j(){for(var a=-1,b=t.keys(),c=0;c<b.length;c++)t.get(b[c]).value.backdrop&&(a=c);return a}function k(a,b){var d=c.find("body").eq(0),e=t.get(a).value;t.remove(a),m(e.modalDomEl,e.modalScope,function(){var b=e.openedClass||s;u.remove(b,a),d.toggleClass(b,u.hasKey(b))}),l(),b&&b.focus?b.focus():d.focus()}function l(){if(p&&-1==j()){var a=q;m(p,q,function(){a=null}),p=void 0,q=void 0}}function m(b,c,d){function e(){e.done||(e.done=!0,o?o(b,{event:"leave"}).start().then(function(){b.remove()}):a.leave(b),c.$destroy(),d&&d())}var g,h=null,i=function(){return g||(g=f.defer(),h=g.promise),function(){g.resolve()}};return c.$broadcast(v.NOW_CLOSING_EVENT,i),f.when(h).then(e)}function n(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var o=null;g.has("$animateCss")&&(o=g.get("$animateCss"));var p,q,r,s="modal-open",t=i.createNew(),u=h.createNew(),v={NOW_CLOSING_EVENT:"modal.stack.now-closing"},w=0,x="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(j,function(a){q&&(q.index=a)}),c.bind("keydown",function(a){if(a.isDefaultPrevented())return a;var b=t.top();if(b&&b.value.keyboard)switch(a.which){case 27:a.preventDefault(),e.$apply(function(){v.dismiss(b.key,"escape key press")});break;case 9:v.loadFocusElementList(b);var c=!1;a.shiftKey?v.isFocusInFirstItem(a)&&(c=v.focusLastFocusableElement()):v.isFocusInLastItem(a)&&(c=v.focusFirstFocusableElement()),c&&(a.preventDefault(),a.stopPropagation())}}),v.open=function(a,b){var f=c[0].activeElement,g=b.openedClass||s;t.add(a,{deferred:b.deferred,renderDeferred:b.renderDeferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard,openedClass:b.openedClass}),u.put(g,a);var h=c.find("body").eq(0),i=j();if(i>=0&&!p){q=e.$new(!0),q.index=i;var k=angular.element('<div modal-backdrop="modal-backdrop"></div>');k.attr("backdrop-class",b.backdropClass),b.animation&&k.attr("modal-animation","true"),p=d(k)(q),h.append(p)}var l=angular.element('<div modal-window="modal-window"></div>');l.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:t.length()-1,animate:"animate"}).html(b.content),b.animation&&l.attr("modal-animation","true");var m=d(l)(b.scope);t.top().value.modalDomEl=m,t.top().value.modalOpener=f,h.append(m),h.addClass(g), 12 v.clearFocusListCache()},v.close=function(a,b){var c=t.get(a);return c&&n(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),k(a,c.value.modalOpener),!0):!c},v.dismiss=function(a,b){var c=t.get(a);return c&&n(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),k(a,c.value.modalOpener),!0):!c},v.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},v.getTop=function(){return t.top()},v.modalRendered=function(a){var b=t.get(a);b&&b.value.renderDeferred.resolve()},v.focusFirstFocusableElement=function(){return r.length>0?(r[0].focus(),!0):!1},v.focusLastFocusableElement=function(){return r.length>0?(r[r.length-1].focus(),!0):!1},v.isFocusInFirstItem=function(a){return r.length>0?(a.target||a.srcElement)==r[0]:!1},v.isFocusInLastItem=function(a){return r.length>0?(a.target||a.srcElement)==r[r.length-1]:!1},v.clearFocusListCache=function(){r=[],w=0},v.loadFocusElementList=function(a){if((void 0===r||!r.length0)&&a){var b=a.value.modalDomEl;b&&b.length&&(r=b[0].querySelectorAll(x))}},v}]).provider("$modal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$modalStack",function(b,c,d,e,f,g){function h(a){return a.template?d.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}function i(a){var c=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?c.push(d.when(b.invoke(a))):angular.isString(a)?c.push(d.when(b.get(a))):c.push(d.when(a))}),c}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(b){var e=d.defer(),j=d.defer(),l=d.defer(),m={result:e.promise,opened:j.promise,rendered:l.promise,close:function(a){return g.close(m,a)},dismiss:function(a){return g.dismiss(m,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var n,o=d.all([h(b)].concat(i(b.resolve)));return n=k=d.all([k]).then(function(){return o},function(){return o}).then(function(a){var d=(b.scope||c).$new();d.$close=m.close,d.$dismiss=m.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var h,i={},k=1;b.controller&&(i.$scope=d,i.$modalInstance=m,angular.forEach(b.resolve,function(b,c){i[c]=a[k++]}),h=f(b.controller,i),b.controllerAs&&(b.bindToController&&angular.extend(h,d),d[b.controllerAs]=h)),g.open(m,{scope:d,deferred:e,renderDeferred:l,content:a[0],animation:b.animation,backdrop:b.backdrop,keyboard:b.keyboard,backdropClass:b.backdropClass,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size,openedClass:b.openedClass}),j.resolve(!0)},function(a){j.reject(a),e.reject(a)})["finally"](function(){k===n&&(k=null)}),m},j}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(g,h){e=g,this.config=h,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=h.itemsPerPage,a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b,c){c&&c.preventDefault();var d=!a.ngDisabled||!c;d&&a.page!==b&&b>0&&b<=a.totalPages&&(c&&c.target&&c.target.blur(),e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages}}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["pagination","?ngModel"],controller:"PaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"template/pagination/pagination.html"},replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["pager","?ngModel"],controller:"PaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"template/pagination/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate","$rootScope","$parse",function(e,f,g,h,i,j,k,l){return function(e,m,n,o){function p(a){var b=(a||o.trigger||n).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}o=angular.extend({},b,d,o);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup title="'+r+"title"+s+'" '+(o.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';return{restrict:"EA",compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){I.isOpen?q():n()}function n(){H&&!a.$eval(d[m+"Enable"])||(v(),I.popupDelay?D||(D=g(r,I.popupDelay,!1)):r())}function q(){s(),k.$$phase||k.$digest()}function r(){return D=null,C&&(g.cancel(C),C=null),(o.useContentExp?I.contentExp():I.content)?(t(),I.isOpen=!0,K&&K.assign(I.origScope,I.isOpen),k.$$phase||I.$apply(),A.css({display:"block"}),void L()):angular.noop}function s(){I.isOpen=!1,K&&K.assign(I.origScope,I.isOpen),g.cancel(D),D=null,g.cancel(E),E=null,I.animation?C||(C=g(u,500)):u()}function t(){A&&u(),B=I.$new(),A=c(B,function(a){F?h.find("body").append(a):b.after(a)}),o.useContentExp&&(B.$watch("contentExp()",function(a){!a&&I.isOpen&&s()}),B.$watch(function(){J||(J=!0,B.$$postDigest(function(){J=!1,I.isOpen&&L()}))}))}function u(){C=null,A&&(A.remove(),A=null),B&&(B.$destroy(),B=null)}function v(){w(),x(),y()}function w(){I.popupClass=d[m+"Class"]}function x(){var a=d[m+"Placement"];I.placement=angular.isDefined(a)?a:o.placement}function y(){var a=d[m+"PopupDelay"],b=parseInt(a,10);I.popupDelay=isNaN(b)?o.popupDelay:b}function z(){var a=d[m+"Trigger"];M(),G=p(a),"none"!==G.show&&G.show.forEach(function(a,c){a===G.hide[c]?b[0].addEventListener(a,j):a&&(b[0].addEventListener(a,n),b[0].addEventListener(G.hide[c],q))})}var A,B,C,D,E,F=angular.isDefined(o.appendToBody)?o.appendToBody:!1,G=p(void 0),H=angular.isDefined(d[m+"Enable"]),I=a.$new(!0),J=!1,K=angular.isDefined(d[m+"IsOpen"])?l(d[m+"IsOpen"]):!1,L=function(){A&&(E||(E=g(function(){A.css({top:0,left:0,width:"auto",height:"auto"});var a=i.position(A),c=i.positionElements(b,A,I.placement,F);c.top+="px",c.left+="px",c.width=a.width+"px",c.height=a.height+"px",A.css(c),E=null},0,!1)))};I.origScope=a,I.isOpen=!1,I.contentExp=function(){return a.$eval(d[e])},o.useContentExp||d.$observe(e,function(a){I.content=a,!a&&I.isOpen?s():L()}),d.$observe("disabled",function(a){D&&a&&(g.cancel(D),D=null),a&&I.isOpen&&s()}),d.$observe(m+"Title",function(a){I.title=a,L()}),d.$observe(m+"Placement",function(){I.isOpen&&(x(),L())}),K&&a.$watch(K,function(a){a!==I.isOpen&&j()});var M=function(){G.show.forEach(function(a){b.unbind(a,n)}),G.hide.forEach(function(a){b.unbind(a,q)})};z();var N=a.$eval(d[m+"Animation"]);I.animation=angular.isDefined(N)?!!N:o.animation;var O=a.$eval(d[m+"AppendToBody"]);F=angular.isDefined(O)?O:F,F&&a.$on("$locationChangeSuccess",function(){I.isOpen&&s()}),a.$on("$destroy",function(){g.cancel(C),g.cancel(D),g.cancel(E),M(),u(),I=null})}}}}}]}).directive("tooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("tooltipClasses",function(){return{restrict:"A",link:function(a,b,c){a.placement&&b.addClass(a.placement),a.popupClass&&b.addClass(a.popupClass),a.animation()&&b.addClass(c.tooltipAnimationClass)}}}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/tooltip/tooltip-template-popup.html"}}).directive("tooltipTemplate",["$tooltip",function(a){return a("tooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlPopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-popup.html"}}).directive("tooltipHtml",["$tooltip",function(a){return a("tooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).value("tooltipHtmlUnsafeSuppressDeprecated",!1).directive("tooltipHtmlUnsafe",["$tooltip","tooltipHtmlUnsafeSuppressDeprecated","$log",function(a,b,c){return b||c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."),a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/popover/popover-template.html"}}).directive("popoverTemplate",["$tooltip",function(a){return a("popoverTemplate","popover","click",{useContentExp:!0})}]).directive("popoverHtmlPopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",title:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover-html.html"}}).directive("popoverHtml",["$tooltip",function(a){return a("popoverHtml","popover","click",{useContentExp:!0})}]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).value("$progressSuppressWarning",!1).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(a.max)?a.max:c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.max=a.max,b.$watch("value",function(a){b.recalculatePercentage()}),b.recalculatePercentage=function(){b.percent=+(100*b.value/b.max).toFixed(2);var a=d.bars.reduce(function(a,b){return a+b.percent},0);a>100&&(b.percent-=a-100)},b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)},a.$watch("max",function(b){d.bars.forEach(function(b){b.max=a.max,b.recalculatePercentage()})})}]).directive("uibProgress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"uibProgress",scope:{max:"=?"},templateUrl:"template/progressbar/progress.html"}}).directive("progress",["$log","$progressSuppressWarning",function(a,b){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{max:"=?"},templateUrl:"template/progressbar/progress.html",link:function(){b&&a.warn("progress is now deprecated. Use uib-progress instead")}}}]).directive("uibBar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("bar",["$log","$progressSuppressWarning",function(a,b){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(c,d,e,f){b&&a.warn("bar is now deprecated. Use uib-bar instead"),f.addBar(c,d)}}}]).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null,titles:["one","two","three","four","five"]}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(d.$viewValue===b?0:b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect(),a.selectCalled=!1)}),a.active=!0,a.selectCalled||(a.onSelect(),a.selectCalled=!0)},b.addTab=function(a){c.push(a),1===c.length&&a.active!==!1?a.active=!0:a.active?b.select(a):a.active=!1},b.removeTab=function(a){var e=c.indexOf(a);if(a.active&&c.length>1&&!d){var f=e==c.length-1?e-1:e+1;b.select(c[f])}c.splice(e,1)};var d;a.$on("$destroy",function(){d=!0})}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse","$log",function(a,b){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},link:function(c,d,e,f,g){c.$watch("active",function(a){a&&f.select(c)}),c.disabled=!1,e.disable&&c.$parent.$watch(a(e.disable),function(a){c.disabled=!!a}),e.disabled&&(b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'),c.$parent.$watch(a(e.disabled),function(a){c.disabled=!!a})),c.select=function(){c.disabled||(c.active=!0)},f.addTab(c),c.$on("$destroy",function(){f.removeTab(c)}),c.$transcludeFn=g}}}]).directive("tabHeadingTransclude",function(){return{restrict:"A",require:"^tab",link:function(a,b,c,d){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||a.hasAttribute("x-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase()||"x-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===q[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a.toString()}function j(a){k(),p.$setViewValue(new Date(o)),l(a)}function k(){p.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=o.getHours(),d=o.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),"m"!==b&&(a.minutes=i(d)),a.meridian=o.getHours()<12?q[0]:q[1]}function m(a,b){var c=new Date(a.getTime()+6e4*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes()),d}function n(a){o=m(o,a),j()}var o=new Date,p={$setViewValue:angular.noop},q=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){p=c,p.$render=this.render,p.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g);var i=angular.isDefined(b.arrowkeys)?a.$parent.$eval(b.arrowkeys):f.arrowkeys;i&&this.setupArrowkeyEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var r=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){r=parseInt(a,10)});var s=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){s=parseInt(a,10)});var t;a.$parent.$watch(c(b.min),function(a){var b=new Date(a);t=isNaN(b)?void 0:b});var u;a.$parent.$watch(c(b.max),function(a){var b=new Date(a);u=isNaN(b)?void 0:b}),a.noIncrementHours=function(){var a=m(o,60*r);return a>u||o>a&&t>a},a.noDecrementHours=function(){var a=m(o,60*-r);return t>a||a>o&&a>u},a.noIncrementMinutes=function(){var a=m(o,s);return a>u||o>a&&t>a},a.noDecrementMinutes=function(){var a=m(o,-s);return t>a||a>o&&a>u},a.noToggleMeridian=function(){return o.getHours()<13?m(o,720)>u:m(o,-720)<t},a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,p.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(o.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c){b.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply())}),c.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply())})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){p.$setViewValue(null),p.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g(),b=h();angular.isDefined(a)&&angular.isDefined(b)?(o.setHours(a),t>o||o>u?d(!0):j("h")):d(!0)},b.bind("blur",function(b){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h(),b=g();angular.isDefined(a)&&angular.isDefined(b)?(o.setMinutes(a),t>o||o>u?d(void 0,!0):j("m")):d(void 0,!0)},c.bind("blur",function(b){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var b=p.$viewValue;isNaN(b)?(p.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(o=b),t>o||o>u?(p.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):k(),l())},a.showSpinners=angular.isDefined(b.showSpinners)?a.$parent.$eval(b.showSpinners):f.showSpinners,a.incrementHours=function(){a.noIncrementHours()||n(60*r)},a.decrementHours=function(){a.noDecrementHours()||n(60*-r)},a.incrementMinutes=function(){a.noIncrementMinutes()||n(s)},a.decrementMinutes=function(){a.noDecrementMinutes()||n(-s)},a.toggleMeridian=function(){a.noToggleMeridian()||n(720*(o.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(a,b){return b.templateUrl||"template/timepicker/timepicker.html"},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.transition",[]).value("$transitionSuppressDeprecated",!1).factory("$transition",["$q","$timeout","$rootScope","$log","$transitionSuppressDeprecated",function(a,b,c,d,e){function f(a){for(var b in a)if(void 0!==h.style[b])return a[b]}e||d.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");var g=function(d,e,f){f=f||{};var h=a.defer(),i=g[f.animation?"animationEndEventName":"transitionEndEventName"],j=function(a){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(e)?d.addClass(e):angular.isFunction(e)?e(d):angular.isObject(e)&&d.css(e),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},h=document.createElement("trans"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},j={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return g.transitionEndEventName=f(i),g.animationEndEventName=f(j),g}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$window","$rootScope","$position","typeaheadParser",function(a,b,c,d,e,f,g,h,i){var j=[9,13,27,38,40],k=200;return{require:["ngModel","^?ngModelOptions"],link:function(l,m,n,o){function p(){K.moveInProgress||(K.moveInProgress=!0,K.$digest()),S&&d.cancel(S),S=d(function(){K.matches.length&&q(),K.moveInProgress=!1,K.$digest()},k)}function q(){K.position=D?h.offset(m):h.position(m),K.position.top+=m.prop("offsetHeight")}var r=o[0],s=o[1],t=l.$eval(n.typeaheadMinLength);t||0===t||(t=1);var u,v,w=l.$eval(n.typeaheadWaitMs)||0,x=l.$eval(n.typeaheadEditable)!==!1,y=b(n.typeaheadLoading).assign||angular.noop,z=b(n.typeaheadOnSelect),A=angular.isDefined(n.typeaheadSelectOnBlur)?l.$eval(n.typeaheadSelectOnBlur):!1,B=b(n.typeaheadNoResults).assign||angular.noop,C=n.typeaheadInputFormatter?b(n.typeaheadInputFormatter):void 0,D=n.typeaheadAppendToBody?l.$eval(n.typeaheadAppendToBody):!1,E=l.$eval(n.typeaheadFocusFirst)!==!1,F=n.typeaheadSelectOnExact?l.$eval(n.typeaheadSelectOnExact):!1,G=b(n.ngModel),H=b(n.ngModel+"($$$p)"),I=function(a,b){return angular.isFunction(G(l))&&s&&s.$options&&s.$options.getterSetter?H(a,{$$$p:b}):G.assign(a,b)},J=i.parse(n.typeahead),K=l.$new(),L=l.$on("$destroy",function(){K.$destroy()});K.$on("$destroy",L);var M="typeahead-"+K.$id+"-"+Math.floor(1e4*Math.random());m.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":M});var N=angular.element("<div typeahead-popup></div>");N.attr({id:M,matches:"matches",active:"activeIdx",select:"select(activeIdx)","move-in-progress":"moveInProgress",query:"query",position:"position"}),angular.isDefined(n.typeaheadTemplateUrl)&&N.attr("template-url",n.typeaheadTemplateUrl),angular.isDefined(n.typeaheadPopupTemplateUrl)&&N.attr("popup-template-url",n.typeaheadPopupTemplateUrl);var O=function(){K.matches=[],K.activeIdx=-1,m.attr("aria-expanded",!1)},P=function(a){return M+"-option-"+a};K.$watch("activeIdx",function(a){0>a?m.removeAttr("aria-activedescendant"):m.attr("aria-activedescendant",P(a))});var Q=function(a,b){return K.matches.length>b&&a?a.toUpperCase()===K.matches[b].label.toUpperCase():!1},R=function(a){var b={$viewValue:a};y(l,!0),B(l,!1),c.when(J.source(l,b)).then(function(c){var d=a===r.$viewValue;if(d&&u)if(c&&c.length>0){K.activeIdx=E?0:-1,B(l,!1),K.matches.length=0;for(var e=0;e<c.length;e++)b[J.itemName]=c[e],K.matches.push({id:P(e),label:J.viewMapper(K,b),model:c[e]});K.query=a,q(),m.attr("aria-expanded",!0),F&&1===K.matches.length&&Q(a,0)&&K.select(0)}else O(),B(l,!0);d&&y(l,!1)},function(){O(),y(l,!1),B(l,!0)})};D&&(angular.element(f).bind("resize",p),e.find("body").bind("scroll",p));var S;K.moveInProgress=!1,O(),K.query=void 0;var T,U=function(a){T=d(function(){R(a)},w)},V=function(){T&&d.cancel(T)};r.$parsers.unshift(function(a){return u=!0,0===t||a&&a.length>=t?w>0?(V(),U(a)):R(a):(y(l,!1),V(),O()),x?a:a?void r.$setValidity("editable",!1):(r.$setValidity("editable",!0),null)}),r.$formatters.push(function(a){var b,c,d={};return x||r.$setValidity("editable",!0),C?(d.$model=a,C(l,d)):(d[J.itemName]=a,b=J.viewMapper(l,d),d[J.itemName]=void 0,c=J.viewMapper(l,d),b!==c?b:a)}),K.select=function(a){var b,c,e={};v=!0,e[J.itemName]=c=K.matches[a].model,b=J.modelMapper(l,e),I(l,b),r.$setValidity("editable",!0),r.$setValidity("parse",!0),z(l,{$item:c,$model:b,$label:J.viewMapper(l,e)}),O(),K.$eval(n.typeaheadFocusOnSelect)!==!1&&d(function(){m[0].focus()},0,!1)},m.bind("keydown",function(a){if(0!==K.matches.length&&-1!==j.indexOf(a.which)){if(-1===K.activeIdx&&(9===a.which||13===a.which))return O(),void K.$digest();a.preventDefault(),40===a.which?(K.activeIdx=(K.activeIdx+1)%K.matches.length,K.$digest()):38===a.which?(K.activeIdx=(K.activeIdx>0?K.activeIdx:K.matches.length)-1,K.$digest()):13===a.which||9===a.which?K.$apply(function(){K.select(K.activeIdx)}):27===a.which&&(a.stopPropagation(),O(),K.$digest())}}),m.bind("blur",function(){A&&K.matches.length&&-1!==K.activeIdx&&!v&&(v=!0,K.$apply(function(){K.select(K.activeIdx)})),u=!1,v=!1});var W=function(a){m[0]!==a.target&&3!==a.which&&0!==K.matches.length&&(O(),g.$$phase||K.$digest())};e.bind("click",W),l.$on("$destroy",function(){e.unbind("click",W),D&&X.remove(),N.remove()});var X=a(N)(K);D?e.find("body").append(X):m.after(X)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"template/typeahead/typeahead-popup.html"},link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"template/typeahead/typeahead-match.html";a(g).then(function(a){b(a.trim())(d,function(a){e.replaceWith(a)})})}}}]).filter("typeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),!function(){function a(a){return a&&(a.ownerDocument||a.document||a).documentElement}function b(a){return a&&(a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView); 13 }function c(a,b){return b>a?-1:a>b?1:a>=b?0:NaN}function d(a){return null===a?NaN:+a}function e(a){return!isNaN(a)}function f(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function g(a){return a.length}function h(a){for(var b=1;a*b%1;)b*=10;return b}function i(a,b){for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}function j(){this._=Object.create(null)}function k(a){return(a+="")===og||a[0]===pg?pg+a:a}function l(a){return(a+="")[0]===pg?a.slice(1):a}function m(a){return k(a)in this._}function n(a){return(a=k(a))in this._&&delete this._[a]}function o(){var a=[];for(var b in this._)a.push(l(b));return a}function p(){var a=0;for(var b in this._)++a;return a}function q(){for(var a in this._)return!1;return!0}function r(){this._=Object.create(null)}function s(a){return a}function t(a,b,c){return function(){var d=c.apply(b,arguments);return d===b?a:d}}function u(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(var c=0,d=qg.length;d>c;++c){var e=qg[c]+b;if(e in a)return e}}function v(){}function w(){}function x(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new j;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function y(){bg.event.preventDefault()}function z(){for(var a,b=bg.event;a=b.sourceEvent;)b=a;return b}function A(a){for(var b=new w,c=0,d=arguments.length;++c<d;)b[arguments[c]]=x(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=bg.event;e.target=a,bg.event=e,b[e.type].apply(c,d)}finally{bg.event=f}}},b}function B(a){return sg(a,wg),a}function C(a){return"function"==typeof a?a:function(){return tg(a,this)}}function D(a){return"function"==typeof a?a:function(){return ug(a,this)}}function E(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=bg.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function F(a){return a.trim().replace(/\s+/g," ")}function G(a){return new RegExp("(?:^|\\s+)"+bg.requote(a)+"(?:\\s+|$)","g")}function H(a){return(a+"").trim().split(/^|\s+/)}function I(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=H(a).map(J);var e=a.length;return"function"==typeof b?d:c}function J(a){var b=G(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",F(e+" "+a))):c.setAttribute("class",F(e.replace(b," ")))}}function K(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function L(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function M(a){function b(){var b=this.ownerDocument,c=this.namespaceURI;return c?b.createElementNS(c,a):b.createElement(a)}function c(){return this.ownerDocument.createElementNS(a.space,a.local)}return"function"==typeof a?a:(a=bg.ns.qualify(a)).local?c:b}function N(){var a=this.parentNode;a&&a.removeChild(this)}function O(a){return{__data__:a}}function P(a){return function(){return vg(this,a)}}function Q(a){return arguments.length||(a=c),function(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}}function R(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function S(a){return sg(a,yg),a}function T(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function U(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=i(b,dg(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+bg.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),i=V;h>0&&(a=a.slice(0,h));var j=zg.get(a);return j&&(a=j,i=W),h?b?e:d:b?v:f}function V(a,b){return function(c){var d=bg.event;bg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{bg.event=d}}}function W(a,b){var c=V(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function X(c){var d=".dragsuppress-"+ ++Bg,e="click"+d,f=bg.select(b(c)).on("touchmove"+d,y).on("dragstart"+d,y).on("selectstart"+d,y);if(null==Ag&&(Ag="onselectstart"in c?!1:u(c.style,"userSelect")),Ag){var g=a(c).style,h=g[Ag];g[Ag]="none"}return function(a){if(f.on(d,null),Ag&&(g[Ag]=h),a){var b=function(){f.on(e,null)};f.on(e,function(){y(),b()},!0),setTimeout(b,0)}}}function Y(a,c){c.changedTouches&&(c=c.changedTouches[0]);var d=a.ownerSVGElement||a;if(d.createSVGPoint){var e=d.createSVGPoint();if(0>Cg){var f=b(a);if(f.scrollX||f.scrollY){d=bg.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var g=d[0][0].getScreenCTM();Cg=!(g.f||g.e),d.remove()}}return Cg?(e.x=c.pageX,e.y=c.pageY):(e.x=c.clientX,e.y=c.clientY),e=e.matrixTransform(a.getScreenCTM().inverse()),[e.x,e.y]}var h=a.getBoundingClientRect();return[c.clientX-h.left-a.clientLeft,c.clientY-h.top-a.clientTop]}function Z(){return bg.event.changedTouches[0].identifier}function $(a){return a>0?1:0>a?-1:0}function _(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function aa(a){return a>1?0:-1>a?Fg:Math.acos(a)}function ba(a){return a>1?Ig:-1>a?-Ig:Math.asin(a)}function ca(a){return((a=Math.exp(a))-1/a)/2}function da(a){return((a=Math.exp(a))+1/a)/2}function ea(a){return((a=Math.exp(2*a))-1)/(a+1)}function fa(a){return(a=Math.sin(a/2))*a}function ga(){}function ha(a,b,c){return this instanceof ha?(this.h=+a,this.s=+b,void(this.l=+c)):arguments.length<2?a instanceof ha?new ha(a.h,a.s,a.l):va(""+a,wa,ha):new ha(a,b,c)}function ia(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a=isNaN(a)?0:(a%=360)<0?a+360:a,b=isNaN(b)?0:0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,new ra(e(a+120),e(a),e(a-120))}function ja(a,b,c){return this instanceof ja?(this.h=+a,this.c=+b,void(this.l=+c)):arguments.length<2?a instanceof ja?new ja(a.h,a.c,a.l):a instanceof la?na(a.l,a.a,a.b):na((a=xa((a=bg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new ja(a,b,c)}function ka(a,b,c){return isNaN(a)&&(a=0),isNaN(b)&&(b=0),new la(c,Math.cos(a*=Jg)*b,Math.sin(a)*b)}function la(a,b,c){return this instanceof la?(this.l=+a,this.a=+b,void(this.b=+c)):arguments.length<2?a instanceof la?new la(a.l,a.a,a.b):a instanceof ja?ka(a.h,a.c,a.l):xa((a=ra(a)).r,a.g,a.b):new la(a,b,c)}function ma(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=oa(e)*Ug,d=oa(d)*Vg,f=oa(f)*Wg,new ra(qa(3.2404542*e-1.5371385*d-.4985314*f),qa(-.969266*e+1.8760108*d+.041556*f),qa(.0556434*e-.2040259*d+1.0572252*f))}function na(a,b,c){return a>0?new ja(Math.atan2(c,b)*Kg,Math.sqrt(b*b+c*c),a):new ja(NaN,NaN,a)}function oa(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function pa(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function qa(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function ra(a,b,c){return this instanceof ra?(this.r=~~a,this.g=~~b,void(this.b=~~c)):arguments.length<2?a instanceof ra?new ra(a.r,a.g,a.b):va(""+a,ra,ia):new ra(a,b,c)}function sa(a){return new ra(a>>16,a>>8&255,255&a)}function ta(a){return sa(a)+""}function ua(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function va(a,b,c){a=a.toLowerCase();var d,e,f,g=0,h=0,i=0;if(d=/([a-z]+)\((.*)\)/.exec(a))switch(e=d[2].split(","),d[1]){case"hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return b(za(e[0]),za(e[1]),za(e[2]))}return(f=Zg.get(a))?b(f.r,f.g,f.b):(null==a||"#"!==a.charAt(0)||isNaN(f=parseInt(a.slice(1),16))||(4===a.length?(g=(3840&f)>>4,g=g>>4|g,h=240&f,h=h>>4|h,i=15&f,i=i<<4|i):7===a.length&&(g=(16711680&f)>>16,h=(65280&f)>>8,i=255&f)),b(g,h,i))}function wa(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):(d=NaN,e=i>0&&1>i?0:d),new ha(d,e,i)}function xa(a,b,c){a=ya(a),b=ya(b),c=ya(c);var d=pa((.4124564*a+.3575761*b+.1804375*c)/Ug),e=pa((.2126729*a+.7151522*b+.072175*c)/Vg),f=pa((.0193339*a+.119192*b+.9503041*c)/Wg);return la(116*e-16,500*(d-e),200*(e-f))}function ya(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function za(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function Aa(a){return"function"==typeof a?a:function(){return a}}function Ba(a){return function(b,c,d){return 2===arguments.length&&"function"==typeof c&&(d=c,c=null),Ca(b,c,a,d)}}function Ca(a,b,c,d){function e(){var a,b=i.status;if(!b&&Ea(i)||b>=200&&300>b||304===b){try{a=c.call(f,i)}catch(d){return void g.error.call(f,d)}g.load.call(f,a)}else g.error.call(f,i)}var f={},g=bg.dispatch("beforesend","progress","load","error"),h={},i=new XMLHttpRequest,j=null;return!this.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(a)||(i=new XDomainRequest),"onload"in i?i.onload=i.onerror=e:i.onreadystatechange=function(){i.readyState>3&&e()},i.onprogress=function(a){var b=bg.event;bg.event=a;try{g.progress.call(f,i)}finally{bg.event=b}},f.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(null==b?delete h[a]:h[a]=b+"",f)},f.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",f):b},f.responseType=function(a){return arguments.length?(j=a,f):j},f.response=function(a){return c=a,f},["get","post"].forEach(function(a){f[a]=function(){return f.send.apply(f,[a].concat(dg(arguments)))}}),f.send=function(c,d,e){if(2===arguments.length&&"function"==typeof d&&(e=d,d=null),i.open(c,a,!0),null==b||"accept"in h||(h.accept=b+",*/*"),i.setRequestHeader)for(var k in h)i.setRequestHeader(k,h[k]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=j&&(i.responseType=j),null!=e&&f.on("error",e).on("load",function(a){e(null,a)}),g.beforesend.call(f,i),i.send(null==d?null:d),f},f.abort=function(){return i.abort(),f},bg.rebind(f,g,"on"),null==d?f:f.get(Da(d))}function Da(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function Ea(a){var b=a.responseType;return b&&"text"!==b?a.response:a.responseText}function Fa(){var a=Ga(),b=Ha()-a;b>24?(isFinite(b)&&(clearTimeout(bh),bh=setTimeout(Fa,b)),ah=0):(ah=1,dh(Fa))}function Ga(){var a=Date.now();for(ch=$g;ch;)a>=ch.t&&(ch.f=ch.c(a-ch.t)),ch=ch.n;return a}function Ha(){for(var a,b=$g,c=1/0;b;)b.f?b=a?a.n=b.n:$g=b.n:(b.t<c&&(c=b.t),b=(a=b).n);return _g=a,c}function Ia(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function Ja(a,b){var c=Math.pow(10,3*ng(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function Ka(a){var b=a.decimal,c=a.thousands,d=a.grouping,e=a.currency,f=d&&c?function(a,b){for(var e=a.length,f=[],g=0,h=d[0],i=0;e>0&&h>0&&(i+h+1>b&&(h=Math.max(1,b-i)),f.push(a.substring(e-=h,e+h)),!((i+=h+1)>b));)h=d[g=(g+1)%d.length];return f.reverse().join(c)}:s;return function(a){var c=fh.exec(a),d=c[1]||" ",g=c[2]||">",h=c[3]||"-",i=c[4]||"",j=c[5],k=+c[6],l=c[7],m=c[8],n=c[9],o=1,p="",q="",r=!1,s=!0;switch(m&&(m=+m.substring(1)),(j||"0"===d&&"="===g)&&(j=d="0",g="="),n){case"n":l=!0,n="g";break;case"%":o=100,q="%",n="f";break;case"p":o=100,q="%",n="r";break;case"b":case"o":case"x":case"X":"#"===i&&(p="0"+n.toLowerCase());case"c":s=!1;case"d":r=!0,m=0;break;case"s":o=-1,n="r"}"$"===i&&(p=e[0],q=e[1]),"r"!=n||m||(n="g"),null!=m&&("g"==n?m=Math.max(1,Math.min(21,m)):"e"!=n&&"f"!=n||(m=Math.max(0,Math.min(20,m)))),n=gh.get(n)||La;var t=j&&l;return function(a){var c=q;if(r&&a%1)return"";var e=0>a||0===a&&0>1/a?(a=-a,"-"):"-"===h?"":h;if(0>o){var i=bg.formatPrefix(a,m);a=i.scale(a),c=i.symbol+q}else a*=o;a=n(a,m);var u,v,w=a.lastIndexOf(".");if(0>w){var x=s?a.lastIndexOf("e"):-1;0>x?(u=a,v=""):(u=a.substring(0,x),v=a.substring(x))}else u=a.substring(0,w),v=b+a.substring(w+1);!j&&l&&(u=f(u,1/0));var y=p.length+u.length+v.length+(t?0:e.length),z=k>y?new Array(y=k-y+1).join(d):"";return t&&(u=f(z+u,z.length?k-v.length:1/0)),e+=p,a=u+v,("<"===g?e+a+z:">"===g?z+e+a:"^"===g?z.substring(0,y>>=1)+e+a+z.substring(y):e+(t?a:z+a))+c}}}function La(a){return a+""}function Ma(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Na(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new ih(c-1)),1),c}function f(a,c){return b(a=new ih(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{ih=Ma;var d=new Ma;return d._=a,g(d,b,c)}finally{ih=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=Oa(a);return i.floor=i,i.round=Oa(d),i.ceil=Oa(e),i.offset=Oa(f),i.range=h,a}function Oa(a){return function(b,c){try{ih=Ma;var d=new Ma;return d._=b,a(d,c)._}finally{ih=Date}}}function Pa(a){function b(a){function b(b){for(var c,e,f,g=[],h=-1,i=0;++h<d;)37===a.charCodeAt(h)&&(g.push(a.slice(i,h)),null!=(e=kh[c=a.charAt(++h)])&&(c=a.charAt(++h)),(f=C[c])&&(c=f(b,null==e?"e"===c?" ":"0":e)),g.push(c),i=h+1);return g.push(a.slice(i,h)),g.join("")}var d=a.length;return b.parse=function(b){var d={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},e=c(d,a,b,0);if(e!=b.length)return null;"p"in d&&(d.H=d.H%12+12*d.p);var f=null!=d.Z&&ih!==Ma,g=new(f?Ma:ih);return"j"in d?g.setFullYear(d.y,0,d.j):"w"in d&&("W"in d||"U"in d)?(g.setFullYear(d.y,0,1),g.setFullYear(d.y,0,"W"in d?(d.w+6)%7+7*d.W-(g.getDay()+5)%7:d.w+7*d.U-(g.getDay()+6)%7)):g.setFullYear(d.y,d.m,d.d),g.setHours(d.H+(d.Z/100|0),d.M+d.Z%100,d.S,d.L),f?g._:g},b.toString=function(){return a},b}function c(a,b,c,d){for(var e,f,g,h=0,i=b.length,j=c.length;i>h;){if(d>=j)return-1;if(e=b.charCodeAt(h++),37===e){if(g=b.charAt(h++),f=D[g in kh?b.charAt(h++):g],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function d(a,b,c){w.lastIndex=0;var d=w.exec(b.slice(c));return d?(a.w=x.get(d[0].toLowerCase()),c+d[0].length):-1}function e(a,b,c){u.lastIndex=0;var d=u.exec(b.slice(c));return d?(a.w=v.get(d[0].toLowerCase()),c+d[0].length):-1}function f(a,b,c){A.lastIndex=0;var d=A.exec(b.slice(c));return d?(a.m=B.get(d[0].toLowerCase()),c+d[0].length):-1}function g(a,b,c){y.lastIndex=0;var d=y.exec(b.slice(c));return d?(a.m=z.get(d[0].toLowerCase()),c+d[0].length):-1}function h(a,b,d){return c(a,C.c.toString(),b,d)}function i(a,b,d){return c(a,C.x.toString(),b,d)}function j(a,b,d){return c(a,C.X.toString(),b,d)}function k(a,b,c){var d=t.get(b.slice(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}var l=a.dateTime,m=a.date,n=a.time,o=a.periods,p=a.days,q=a.shortDays,r=a.months,s=a.shortMonths;b.utc=function(a){function c(a){try{ih=Ma;var b=new ih;return b._=a,d(b)}finally{ih=Date}}var d=b(a);return c.parse=function(a){try{ih=Ma;var b=d.parse(a);return b&&b._}finally{ih=Date}},c.toString=d.toString,c},b.multi=b.utc.multi=hb;var t=bg.map(),u=Ra(p),v=Sa(p),w=Ra(q),x=Sa(q),y=Ra(r),z=Sa(r),A=Ra(s),B=Sa(s);o.forEach(function(a,b){t.set(a.toLowerCase(),b)});var C={a:function(a){return q[a.getDay()]},A:function(a){return p[a.getDay()]},b:function(a){return s[a.getMonth()]},B:function(a){return r[a.getMonth()]},c:b(l),d:function(a,b){return Qa(a.getDate(),b,2)},e:function(a,b){return Qa(a.getDate(),b,2)},H:function(a,b){return Qa(a.getHours(),b,2)},I:function(a,b){return Qa(a.getHours()%12||12,b,2)},j:function(a,b){return Qa(1+hh.dayOfYear(a),b,3)},L:function(a,b){return Qa(a.getMilliseconds(),b,3)},m:function(a,b){return Qa(a.getMonth()+1,b,2)},M:function(a,b){return Qa(a.getMinutes(),b,2)},p:function(a){return o[+(a.getHours()>=12)]},S:function(a,b){return Qa(a.getSeconds(),b,2)},U:function(a,b){return Qa(hh.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return Qa(hh.mondayOfYear(a),b,2)},x:b(m),X:b(n),y:function(a,b){return Qa(a.getFullYear()%100,b,2)},Y:function(a,b){return Qa(a.getFullYear()%1e4,b,4)},Z:fb,"%":function(){return"%"}},D={a:d,A:e,b:f,B:g,c:h,d:_a,e:_a,H:bb,I:bb,j:ab,L:eb,m:$a,M:cb,p:k,S:db,U:Ua,w:Ta,W:Va,x:i,X:j,y:Xa,Y:Wa,Z:Ya,"%":gb};return b}function Qa(a,b,c){var d=0>a?"-":"",e=(d?-a:a)+"",f=e.length;return d+(c>f?new Array(c-f+1).join(b)+e:e)}function Ra(a){return new RegExp("^(?:"+a.map(bg.requote).join("|")+")","i")}function Sa(a){for(var b=new j,c=-1,d=a.length;++c<d;)b.set(a[c].toLowerCase(),c);return b}function Ta(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+1));return d?(a.w=+d[0],c+d[0].length):-1}function Ua(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c));return d?(a.U=+d[0],c+d[0].length):-1}function Va(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c));return d?(a.W=+d[0],c+d[0].length):-1}function Wa(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+4));return d?(a.y=+d[0],c+d[0].length):-1}function Xa(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.y=Za(+d[0]),c+d[0].length):-1}function Ya(a,b,c){return/^[+-]\d{4}$/.test(b=b.slice(c,c+5))?(a.Z=-b,c+5):-1}function Za(a){return a+(a>68?1900:2e3)}function $a(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function _a(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function ab(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+3));return d?(a.j=+d[0],c+d[0].length):-1}function bb(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function cb(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function db(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function eb(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function fb(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=ng(b)/60|0,e=ng(b)%60;return c+Qa(d,"0",2)+Qa(e,"0",2)}function gb(a,b,c){mh.lastIndex=0;var d=mh.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function hb(a){for(var b=a.length,c=-1;++c<b;)a[c][0]=this(a[c][0]);return function(b){for(var c=0,d=a[c];!d[1](b);)d=a[++c];return d[0](b)}}function ib(){}function jb(a,b,c){var d=c.s=a+b,e=d-a,f=d-e;c.t=a-f+(b-e)}function kb(a,b){a&&qh.hasOwnProperty(a.type)&&qh[a.type](a,b)}function lb(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++e<f;)d=a[e],b.point(d[0],d[1],d[2]);b.lineEnd()}function mb(a,b){var c=-1,d=a.length;for(b.polygonStart();++c<d;)lb(a[c],b,1);b.polygonEnd()}function nb(){function a(a,b){a*=Jg,b=b*Jg/2+Fg/4;var c=a-d,g=c>=0?1:-1,h=g*c,i=Math.cos(b),j=Math.sin(b),k=f*j,l=e*i+k*Math.cos(h),m=k*g*Math.sin(h);sh.add(Math.atan2(m,l)),d=a,e=i,f=j}var b,c,d,e,f;th.point=function(g,h){th.point=a,d=(b=g)*Jg,e=Math.cos(h=(c=h)*Jg/2+Fg/4),f=Math.sin(h)},th.lineEnd=function(){a(b,c)}}function ob(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function pb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function qb(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function rb(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function sb(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function tb(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function ub(a){return[Math.atan2(a[1],a[0]),ba(a[2])]}function vb(a,b){return ng(a[0]-b[0])<Dg&&ng(a[1]-b[1])<Dg}function wb(a,b){a*=Jg;var c=Math.cos(b*=Jg);xb(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function xb(a,b,c){++uh,wh+=(a-wh)/uh,xh+=(b-xh)/uh,yh+=(c-yh)/uh}function yb(){function a(a,e){a*=Jg;var f=Math.cos(e*=Jg),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);vh+=j,zh+=j*(b+(b=g)),Ah+=j*(c+(c=h)),Bh+=j*(d+(d=i)),xb(b,c,d)}var b,c,d;Fh.point=function(e,f){e*=Jg;var g=Math.cos(f*=Jg);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),Fh.point=a,xb(b,c,d)}}function zb(){Fh.point=wb}function Ab(){function a(a,b){a*=Jg;var c=Math.cos(b*=Jg),g=c*Math.cos(a),h=c*Math.sin(a),i=Math.sin(b),j=e*i-f*h,k=f*g-d*i,l=d*h-e*g,m=Math.sqrt(j*j+k*k+l*l),n=d*g+e*h+f*i,o=m&&-aa(n)/m,p=Math.atan2(m,n);Ch+=o*j,Dh+=o*k,Eh+=o*l,vh+=p,zh+=p*(d+(d=g)),Ah+=p*(e+(e=h)),Bh+=p*(f+(f=i)),xb(d,e,f)}var b,c,d,e,f;Fh.point=function(g,h){b=g,c=h,Fh.point=a,g*=Jg;var i=Math.cos(h*=Jg);d=i*Math.cos(g),e=i*Math.sin(g),f=Math.sin(h),xb(d,e,f)},Fh.lineEnd=function(){a(b,c),Fh.lineEnd=zb,Fh.point=wb}}function Bb(a,b){function c(c,d){return c=a(c,d),b(c[0],c[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=b.invert(c,d),c&&a.invert(c[0],c[1])}),c}function Cb(){return!0}function Db(a,b,c,d,e){var f=[],g=[];if(a.forEach(function(a){if(!((b=a.length-1)<=0)){var b,c=a[0],d=a[b];if(vb(c,d)){e.lineStart();for(var h=0;b>h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i=new Fb(c,a,null,!0),j=new Fb(c,null,i,!1);i.o=j,f.push(i),g.push(j),i=new Fb(d,a,null,!1),j=new Fb(d,null,i,!0),i.o=j,f.push(i),g.push(j)}}),g.sort(b),Eb(f),Eb(g),f.length){for(var h=0,i=c,j=g.length;j>h;++h)g[h].e=i=!i;for(var k,l,m=f[0];;){for(var n=m,o=!0;n.v;)if((n=n.n)===m)return;k=n.z,e.lineStart();do{if(n.v=n.o.v=!0,n.e){if(o)for(var h=0,j=k.length;j>h;++h)e.point((l=k[h])[0],l[1]);else d(n.x,n.n.x,1,e);n=n.n}else{if(o){k=n.p.z;for(var h=k.length-1;h>=0;--h)e.point((l=k[h])[0],l[1])}else d(n.x,n.p.x,-1,e);n=n.p}n=n.o,k=n.z,o=!o}while(!n.v);e.lineEnd()}}}function Eb(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d<b;)e.n=c=a[d],c.p=e,e=c;e.n=c=a[0],c.p=e}}function Fb(a,b,c,d){this.x=a,this.z=b,this.o=c,this.e=d,this.v=!1,this.n=this.p=null}function Gb(a,b,c,d){return function(e,f){function g(b,c){var d=e(b,c);a(b=d[0],c=d[1])&&f.point(b,c)}function h(a,b){var c=e(a,b);q.point(c[0],c[1])}function i(){s.point=h,q.lineStart()}function j(){s.point=g,q.lineEnd()}function k(a,b){p.push([a,b]);var c=e(a,b);u.point(c[0],c[1])}function l(){u.lineStart(),p=[]}function m(){k(p[0][0],p[0][1]),u.lineEnd();var a,b=u.clean(),c=t.buffer(),d=c.length;if(p.pop(),o.push(p),p=null,d)if(1&b){a=c[0];var e,d=a.length-1,g=-1;if(d>0){for(v||(f.polygonStart(),v=!0),f.lineStart();++g<d;)f.point((e=a[g])[0],e[1]);f.lineEnd()}}else d>1&&2&b&&c.push(c.pop().concat(c.shift())),n.push(c.filter(Hb))}var n,o,p,q=b(f),r=e.invert(d[0],d[1]),s={point:g,lineStart:i,lineEnd:j,polygonStart:function(){s.point=k,s.lineStart=l,s.lineEnd=m,n=[],o=[]},polygonEnd:function(){s.point=g,s.lineStart=i,s.lineEnd=j,n=bg.merge(n);var a=Nb(r,o);n.length?(v||(f.polygonStart(),v=!0),Db(n,Jb,a,c,f)):a&&(v||(f.polygonStart(),v=!0),f.lineStart(),c(null,null,1,f),f.lineEnd()),v&&(f.polygonEnd(),v=!1),n=o=null},sphere:function(){f.polygonStart(),f.lineStart(),c(null,null,1,f),f.lineEnd(),f.polygonEnd()}},t=Ib(),u=b(t),v=!1;return s}}function Hb(a){return a.length>1}function Ib(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){a.push([b,c])},lineEnd:v,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function Jb(a,b){return((a=a.x)[0]<0?a[1]-Ig-Dg:Ig-a[1])-((b=b.x)[0]<0?b[1]-Ig-Dg:Ig-b[1])}function Kb(a){var b,c=NaN,d=NaN,e=NaN;return{lineStart:function(){a.lineStart(),b=1},point:function(f,g){var h=f>0?Fg:-Fg,i=ng(f-c);ng(i-Fg)<Dg?(a.point(c,d=(d+g)/2>0?Ig:-Ig),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Fg&&(ng(c-e)<Dg&&(c-=e*Dg),ng(f-h)<Dg&&(f-=h*Dg),d=Lb(c,d,f,g),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),b=0),a.point(c=f,d=g),e=h},lineEnd:function(){a.lineEnd(),c=d=NaN},clean:function(){return 2-b}}}function Lb(a,b,c,d){var e,f,g=Math.sin(a-c);return ng(g)>Dg?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function Mb(a,b,c,d){var e;if(null==a)e=c*Ig,d.point(-Fg,e),d.point(0,e),d.point(Fg,e),d.point(Fg,0),d.point(Fg,-e),d.point(0,-e),d.point(-Fg,-e),d.point(-Fg,0),d.point(-Fg,e);else if(ng(a[0]-b[0])>Dg){var f=a[0]<b[0]?Fg:-Fg;e=c*f/2,d.point(-f,e),d.point(0,e),d.point(f,e)}else d.point(b[0],b[1])}function Nb(a,b){var c=a[0],d=a[1],e=[Math.sin(c),-Math.cos(c),0],f=0,g=0;sh.reset();for(var h=0,i=b.length;i>h;++h){var j=b[h],k=j.length;if(k)for(var l=j[0],m=l[0],n=l[1]/2+Fg/4,o=Math.sin(n),p=Math.cos(n),q=1;;){q===k&&(q=0),a=j[q];var r=a[0],s=a[1]/2+Fg/4,t=Math.sin(s),u=Math.cos(s),v=r-m,w=v>=0?1:-1,x=w*v,y=x>Fg,z=o*t;if(sh.add(Math.atan2(z*w*Math.sin(x),p*u+z*Math.cos(x))),f+=y?v+w*Gg:v,y^m>=c^r>=c){var A=qb(ob(l),ob(a));tb(A);var B=qb(e,A);tb(B);var C=(y^v>=0?-1:1)*ba(B[2]);(d>C||d===C&&(A[0]||A[1]))&&(g+=y^v>=0?1:-1)}if(!q++)break;m=r,o=t,p=u,l=a}}return(-Dg>f||Dg>f&&0>sh)^1&g}function Ob(a){function b(a,b){return Math.cos(a)*Math.cos(b)>f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Fg:-Fg),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(vb(c,n)||vb(o,n))&&(o[0]+=Dg,o[1]+=Dg,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&vb(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=ob(a),e=ob(b),g=[1,0,0],h=qb(d,e),i=pb(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=qb(g,h),o=sb(g,l),p=sb(h,m);rb(o,p);var q=n,r=pb(o,q),s=pb(q,q),t=r*r-s*(pb(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=sb(q,(-r-u)/s);if(rb(v,o),v=ub(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=ng(B-Fg)<Dg,D=C||Dg>B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(ng(v[0]-x)<Dg?z:A):z<=v[1]&&v[1]<=A:B>Fg^(x<=v[0]&&v[0]<=y)){var E=sb(q,(-r+u)/s);return rb(E,o),[v,ub(E)]}}}function e(b,c){var d=g?a:Fg-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=ng(f)>Dg,i=nc(a,6*Jg);return Gb(b,c,i,g?[0,-a]:[-Fg,a-Fg])}function Pb(a,b,c,d){return function(e){var f,g=e.a,h=e.b,i=g.x,j=g.y,k=h.x,l=h.y,m=0,n=1,o=k-i,p=l-j;if(f=a-i,o||!(f>0)){if(f/=o,0>o){if(m>f)return;n>f&&(n=f)}else if(o>0){if(f>n)return;f>m&&(m=f)}if(f=c-i,o||!(0>f)){if(f/=o,0>o){if(f>n)return;f>m&&(m=f)}else if(o>0){if(m>f)return;n>f&&(n=f)}if(f=b-j,p||!(f>0)){if(f/=p,0>p){if(m>f)return;n>f&&(n=f)}else if(p>0){if(f>n)return;f>m&&(m=f)}if(f=d-j,p||!(0>f)){if(f/=p,0>p){if(f>n)return;f>m&&(m=f)}else if(p>0){if(m>f)return;n>f&&(n=f)}return m>0&&(e.a={x:i+m*o,y:j+m*p}),1>n&&(e.b={x:i+n*o,y:j+n*p}),e}}}}}}function Qb(a,b,c,d){function e(d,e){return ng(d[0]-a)<Dg?e>0?0:3:ng(d[0]-c)<Dg?e>0?2:1:ng(d[1]-b)<Dg?e>0?1:0:e>0?3:2}function f(a,b){return g(a.x,b.x)}function g(a,b){var c=e(a,1),d=e(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}return function(h){function i(a){for(var b=0,c=q.length,d=a[1],e=0;c>e;++e)for(var f,g=1,h=q[e],i=h.length,j=h[0];i>g;++g)f=h[g],j[1]<=d?f[1]>d&&_(j,f,a)>0&&++b:f[1]<=d&&_(j,f,a)<0&&--b,j=f;return 0!==b}function j(f,h,i,j){var k=0,l=0;if(null==f||(k=e(f,i))!==(l=e(h,i))||g(f,h)<0^i>0){do j.point(0===k||3===k?a:c,k>1?d:b);while((k=(k+i+4)%4)!==l)}else j.point(h[0],h[1])}function k(e,f){return e>=a&&c>=e&&f>=b&&d>=f}function l(a,b){k(a,b)&&h.point(a,b)}function m(){D.point=o,q&&q.push(r=[]),y=!0,x=!1,v=w=NaN}function n(){p&&(o(s,t),u&&x&&B.rejoin(),p.push(B.buffer())),D.point=l,x&&h.lineEnd()}function o(a,b){a=Math.max(-Hh,Math.min(Hh,a)),b=Math.max(-Hh,Math.min(Hh,b));var c=k(a,b);if(q&&r.push([a,b]),y)s=a,t=b,u=c,y=!1,c&&(h.lineStart(),h.point(a,b));else if(c&&x)h.point(a,b);else{var d={a:{x:v,y:w},b:{x:a,y:b}};C(d)?(x||(h.lineStart(),h.point(d.a.x,d.a.y)),h.point(d.b.x,d.b.y),c||h.lineEnd(),z=!1):c&&(h.lineStart(),h.point(a,b),z=!1)}v=a,w=b,x=c}var p,q,r,s,t,u,v,w,x,y,z,A=h,B=Ib(),C=Pb(a,b,c,d),D={point:l,lineStart:m,lineEnd:n,polygonStart:function(){h=B,p=[],q=[],z=!0},polygonEnd:function(){h=A,p=bg.merge(p);var b=i([a,d]),c=z&&b,e=p.length;(c||e)&&(h.polygonStart(),c&&(h.lineStart(),j(null,null,1,h),h.lineEnd()),e&&Db(p,f,b,j,h),h.polygonEnd()),p=q=r=null}};return D}}function Rb(a){var b=0,c=Fg/3,d=fc(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Fg/180,c=a[1]*Fg/180):[b/Fg*180,c/Fg*180]},e}function Sb(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,ba((f-(a*a+c*c)*e*e)/(2*e))]},c}function Tb(){function a(a,b){Jh+=e*a-d*b,d=a,e=b}var b,c,d,e;Oh.point=function(f,g){Oh.point=a,b=d=f,c=e=g},Oh.lineEnd=function(){a(b,c)}}function Ub(a,b){Kh>a&&(Kh=a),a>Mh&&(Mh=a),Lh>b&&(Lh=b),b>Nh&&(Nh=b)}function Vb(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Wb(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d,h.point=a},pointRadius:function(a){return f=Wb(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function Wb(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function Xb(a,b){wh+=a,xh+=b,++yh}function Yb(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);zh+=g*(b+a)/2,Ah+=g*(c+d)/2,Bh+=g,Xb(b=a,c=d)}var b,c;Qh.point=function(d,e){Qh.point=a,Xb(b=d,c=e)}}function Zb(){Qh.point=Xb}function $b(){function a(a,b){var c=a-d,f=b-e,g=Math.sqrt(c*c+f*f);zh+=g*(d+a)/2,Ah+=g*(e+b)/2,Bh+=g,g=e*a-d*b,Ch+=g*(d+a),Dh+=g*(e+b),Eh+=3*g,Xb(d=a,e=b)}var b,c,d,e;Qh.point=function(f,g){Qh.point=a,Xb(b=d=f,c=e=g)},Qh.lineEnd=function(){a(b,c)}}function _b(a){function b(b,c){a.moveTo(b+g,c),a.arc(b,c,g,0,Gg)}function c(b,c){a.moveTo(b,c),h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e,h.point=b},pointRadius:function(a){return g=a,h},result:v};return h}function ac(a){function b(a){return(h?d:c)(a)}function c(b){return dc(b,function(c,d){c=a(c,d),b.point(c[0],c[1])})}function d(b){function c(c,d){c=a(c,d),b.point(c[0],c[1])}function d(){t=NaN,y.point=f,b.lineStart()}function f(c,d){var f=ob([c,d]),g=a(c,d);e(t,u,s,v,w,x,t=g[0],u=g[1],s=c,v=f[0],w=f[1],x=f[2],h,b),b.point(t,u)}function g(){y.point=c,b.lineEnd()}function i(){d(),y.point=j,y.lineEnd=k}function j(a,b){f(l=a,m=b),n=t,o=u,p=v,q=w,r=x,y.point=f}function k(){e(t,u,s,v,w,x,n,o,l,p,q,r,h,b),y.lineEnd=g,g()}var l,m,n,o,p,q,r,s,t,u,v,w,x,y={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart(),y.lineStart=i},polygonEnd:function(){b.polygonEnd(),y.lineStart=d}};return y}function e(b,c,d,h,i,j,k,l,m,n,o,p,q,r){var s=k-b,t=l-c,u=s*s+t*t;if(u>4*f&&q--){ 14 var v=h+n,w=i+o,x=j+p,y=Math.sqrt(v*v+w*w+x*x),z=Math.asin(x/=y),A=ng(ng(x)-1)<Dg||ng(d-m)<Dg?(d+m)/2:Math.atan2(w,v),B=a(A,z),C=B[0],D=B[1],E=C-b,F=D-c,G=t*E-s*F;(G*G/u>f||ng((s*E+t*F)/u-.5)>.3||g>h*n+i*o+j*p)&&(e(b,c,d,h,i,j,C,D,A,v/=y,w/=y,x,q,r),r.point(C,D),e(C,D,A,v,w,x,k,l,m,n,o,p,q,r))}}var f=.5,g=Math.cos(30*Jg),h=16;return b.precision=function(a){return arguments.length?(h=(f=a*a)>0&&16,b):Math.sqrt(f)},b}function bc(a){var b=ac(function(b,c){return a([b*Kg,c*Kg])});return function(a){return gc(b(a))}}function cc(a){this.stream=a}function dc(a,b){return{point:b,sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}function ec(a){return fc(function(){return a})()}function fc(a){function b(a){return a=h(a[0]*Jg,a[1]*Jg),[a[0]*m+i,j-a[1]*m]}function c(a){return a=h.invert((a[0]-i)/m,(j-a[1])/m),a&&[a[0]*Kg,a[1]*Kg]}function d(){h=Bb(g=jc(r,t,u),f);var a=f(p,q);return i=n-a[0]*m,j=o+a[1]*m,e()}function e(){return k&&(k.valid=!1,k=null),b}var f,g,h,i,j,k,l=ac(function(a,b){return a=f(a,b),[a[0]*m+i,j-a[1]*m]}),m=150,n=480,o=250,p=0,q=0,r=0,t=0,u=0,v=Gh,w=s,x=null,y=null;return b.stream=function(a){return k&&(k.valid=!1),k=gc(v(g,l(w(a)))),k.valid=!0,k},b.clipAngle=function(a){return arguments.length?(v=null==a?(x=a,Gh):Ob((x=+a)*Jg),e()):x},b.clipExtent=function(a){return arguments.length?(y=a,w=a?Qb(a[0][0],a[0][1],a[1][0],a[1][1]):s,e()):y},b.scale=function(a){return arguments.length?(m=+a,d()):m},b.translate=function(a){return arguments.length?(n=+a[0],o=+a[1],d()):[n,o]},b.center=function(a){return arguments.length?(p=a[0]%360*Jg,q=a[1]%360*Jg,d()):[p*Kg,q*Kg]},b.rotate=function(a){return arguments.length?(r=a[0]%360*Jg,t=a[1]%360*Jg,u=a.length>2?a[2]%360*Jg:0,d()):[r*Kg,t*Kg,u*Kg]},bg.rebind(b,l,"precision"),function(){return f=a.apply(this,arguments),b.invert=f.invert&&c,d()}}function gc(a){return dc(a,function(b,c){a.point(b*Jg,c*Jg)})}function hc(a,b){return[a,b]}function ic(a,b){return[a>Fg?a-Gg:-Fg>a?a+Gg:a,b]}function jc(a,b,c){return a?b||c?Bb(lc(a),mc(b,c)):lc(a):b||c?mc(b,c):ic}function kc(a){return function(b,c){return b+=a,[b>Fg?b-Gg:-Fg>b?b+Gg:b,c]}}function lc(a){var b=kc(a);return b.invert=kc(-a),b}function mc(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),ba(k*f+i*g)]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),ba(k*d-h*e)]},c}function nc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var i=g*b;null!=e?(e=oc(c,e),f=oc(c,f),(g>0?f>e:e>f)&&(e+=g*Gg)):(e=a+g*Gg,f=a-.5*i);for(var j,k=e;g>0?k>f:f>k;k-=i)h.point((j=ub([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],j[1])}}function oc(a,b){var c=ob(b);c[0]-=a,tb(c);var d=aa(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Dg)%(2*Math.PI)}function pc(a,b,c){var d=bg.range(a,b-Dg,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function qc(a,b,c){var d=bg.range(a,b-Dg,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function rc(a){return a.source}function sc(a){return a.target}function tc(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(fa(d-b)+e*g*fa(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Kg,Math.atan2(g,Math.sqrt(d*d+e*e))*Kg]}:function(){return[a*Kg,b*Kg]};return o.distance=m,o}function uc(){function a(a,e){var f=Math.sin(e*=Jg),g=Math.cos(e),h=ng((a*=Jg)-b),i=Math.cos(h);Rh+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;Sh.point=function(e,f){b=e*Jg,c=Math.sin(f*=Jg),d=Math.cos(f),Sh.point=a},Sh.lineEnd=function(){Sh.point=Sh.lineEnd=v}}function vc(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function wc(a,b){function c(a,b){g>0?-Ig+Dg>b&&(b=-Ig+Dg):b>Ig-Dg&&(b=Ig-Dg);var c=g/Math.pow(e(b),f);return[c*Math.sin(f*a),g-c*Math.cos(f*a)]}var d=Math.cos(a),e=function(a){return Math.tan(Fg/4+a/2)},f=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(e(b)/e(a)),g=d*Math.pow(e(a),f)/f;return f?(c.invert=function(a,b){var c=g-b,d=$(f)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/f,2*Math.atan(Math.pow(g/d,1/f))-Ig]},c):yc}function xc(a,b){function c(a,b){var c=f-b;return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;return ng(e)<Dg?hc:(c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-$(e)*Math.sqrt(a*a+c*c)]},c)}function yc(a,b){return[a,Math.log(Math.tan(Fg/4+b/2))]}function zc(a){var b,c=ec(a),d=c.scale,e=c.translate,f=c.clipExtent;return c.scale=function(){var a=d.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.translate=function(){var a=e.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.clipExtent=function(a){var g=f.apply(c,arguments);if(g===c){if(b=null==a){var h=Fg*d(),i=e();f([[i[0]-h,i[1]-h],[i[0]+h,i[1]+h]])}}else b&&(g=null);return g},c.clipExtent(null)}function Ac(a,b){return[Math.log(Math.tan(Fg/4+b/2)),-a]}function Bc(a){return a[0]}function Cc(a){return a[1]}function Dc(a){for(var b=a.length,c=[0,1],d=2,e=2;b>e;e++){for(;d>1&&_(a[c[d-2]],a[c[d-1]],a[e])<=0;)--d;c[d++]=e}return c.slice(0,d)}function Ec(a,b){return a[0]-b[0]||a[1]-b[1]}function Fc(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Gc(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function Hc(a){var b=a[0],c=a[a.length-1];return!(b[0]-c[0]||b[1]-c[1])}function Ic(){bd(this),this.edge=this.site=this.circle=null}function Jc(a){var b=ci.pop()||new Ic;return b.site=a,b}function Kc(a){Uc(a),_h.remove(a),ci.push(a),bd(a)}function Lc(a){var b=a.circle,c=b.x,d=b.cy,e={x:c,y:d},f=a.P,g=a.N,h=[a];Kc(a);for(var i=f;i.circle&&ng(c-i.circle.x)<Dg&&ng(d-i.circle.cy)<Dg;)f=i.P,h.unshift(i),Kc(i),i=f;h.unshift(i),Uc(i);for(var j=g;j.circle&&ng(c-j.circle.x)<Dg&&ng(d-j.circle.cy)<Dg;)g=j.N,h.push(j),Kc(j),j=g;h.push(j),Uc(j);var k,l=h.length;for(k=1;l>k;++k)j=h[k],i=h[k-1],$c(j.edge,i.site,j.site,e);i=h[0],j=h[l-1],j.edge=Yc(i.site,j.site,null,e),Tc(i),Tc(j)}function Mc(a){for(var b,c,d,e,f=a.x,g=a.y,h=_h._;h;)if(d=Nc(h,g)-f,d>Dg)h=h.L;else{if(e=f-Oc(h,g),!(e>Dg)){d>-Dg?(b=h.P,c=h):e>-Dg?(b=h,c=h.N):b=c=h;break}if(!h.R){b=h;break}h=h.R}var i=Jc(a);if(_h.insert(b,i),b||c){if(b===c)return Uc(b),c=Jc(b.site),_h.insert(i,c),i.edge=c.edge=Yc(b.site,i.site),Tc(b),void Tc(c);if(!c)return void(i.edge=Yc(b.site,i.site));Uc(b),Uc(c);var j=b.site,k=j.x,l=j.y,m=a.x-k,n=a.y-l,o=c.site,p=o.x-k,q=o.y-l,r=2*(m*q-n*p),s=m*m+n*n,t=p*p+q*q,u={x:(q*s-n*t)/r+k,y:(m*t-p*s)/r+l};$c(c.edge,j,o,u),i.edge=Yc(j,a,null,u),c.edge=Yc(a,o,null,u),Tc(b),Tc(c)}}function Nc(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d;var g=a.P;if(!g)return-(1/0);c=g.site;var h=c.x,i=c.y,j=i-b;if(!j)return h;var k=h-d,l=1/f-1/j,m=k/j;return l?(-m+Math.sqrt(m*m-2*l*(k*k/(-2*j)-i+j/2+e-f/2)))/l+d:(d+h)/2}function Oc(a,b){var c=a.N;if(c)return Nc(c,b);var d=a.site;return d.y===b?d.x:1/0}function Pc(a){this.site=a,this.edges=[]}function Qc(a){for(var b,c,d,e,f,g,h,i,j,k,l=a[0][0],m=a[1][0],n=a[0][1],o=a[1][1],p=$h,q=p.length;q--;)if(f=p[q],f&&f.prepare())for(h=f.edges,i=h.length,g=0;i>g;)k=h[g].end(),d=k.x,e=k.y,j=h[++g%i].start(),b=j.x,c=j.y,(ng(d-b)>Dg||ng(e-c)>Dg)&&(h.splice(g,0,new _c(Zc(f.site,k,ng(d-l)<Dg&&o-e>Dg?{x:l,y:ng(b-l)<Dg?c:o}:ng(e-o)<Dg&&m-d>Dg?{x:ng(c-o)<Dg?b:m,y:o}:ng(d-m)<Dg&&e-n>Dg?{x:m,y:ng(b-m)<Dg?c:n}:ng(e-n)<Dg&&d-l>Dg?{x:ng(c-n)<Dg?b:l,y:n}:null),f.site,null)),++i)}function Rc(a,b){return b.angle-a.angle}function Sc(){bd(this),this.x=this.y=this.arc=this.site=this.cy=null}function Tc(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,e=a.site,f=c.site;if(d!==f){var g=e.x,h=e.y,i=d.x-g,j=d.y-h,k=f.x-g,l=f.y-h,m=2*(i*l-j*k);if(!(m>=-Eg)){var n=i*i+j*j,o=k*k+l*l,p=(l*n-j*o)/m,q=(i*o-k*n)/m,l=q+h,r=di.pop()||new Sc;r.arc=a,r.site=e,r.x=p+g,r.y=l+Math.sqrt(p*p+q*q),r.cy=l,a.circle=r;for(var s=null,t=bi._;t;)if(r.y<t.y||r.y===t.y&&r.x<=t.x){if(!t.L){s=t.P;break}t=t.L}else{if(!t.R){s=t;break}t=t.R}bi.insert(s,r),s||(ai=r)}}}}function Uc(a){var b=a.circle;b&&(b.P||(ai=b.N),bi.remove(b),di.push(b),bd(b),a.circle=null)}function Vc(a){for(var b,c=Zh,d=Pb(a[0][0],a[0][1],a[1][0],a[1][1]),e=c.length;e--;)b=c[e],(!Wc(b,a)||!d(b)||ng(b.a.x-b.b.x)<Dg&&ng(b.a.y-b.b.y)<Dg)&&(b.a=b.b=null,c.splice(e,1))}function Wc(a,b){var c=a.b;if(c)return!0;var d,e,f=a.a,g=b[0][0],h=b[1][0],i=b[0][1],j=b[1][1],k=a.l,l=a.r,m=k.x,n=k.y,o=l.x,p=l.y,q=(m+o)/2,r=(n+p)/2;if(p===n){if(g>q||q>=h)return;if(m>o){if(f){if(f.y>=j)return}else f={x:q,y:i};c={x:q,y:j}}else{if(f){if(f.y<i)return}else f={x:q,y:j};c={x:q,y:i}}}else if(d=(m-o)/(p-n),e=r-d*q,-1>d||d>1)if(m>o){if(f){if(f.y>=j)return}else f={x:(i-e)/d,y:i};c={x:(j-e)/d,y:j}}else{if(f){if(f.y<i)return}else f={x:(j-e)/d,y:j};c={x:(i-e)/d,y:i}}else if(p>n){if(f){if(f.x>=h)return}else f={x:g,y:d*g+e};c={x:h,y:d*h+e}}else{if(f){if(f.x<g)return}else f={x:h,y:d*h+e};c={x:g,y:d*g+e}}return a.a=f,a.b=c,!0}function Xc(a,b){this.l=a,this.r=b,this.a=this.b=null}function Yc(a,b,c,d){var e=new Xc(a,b);return Zh.push(e),c&&$c(e,a,b,c),d&&$c(e,b,a,d),$h[a.i].edges.push(new _c(e,a,b)),$h[b.i].edges.push(new _c(e,b,a)),e}function Zc(a,b,c){var d=new Xc(a,null);return d.a=b,d.b=c,Zh.push(d),d}function $c(a,b,c,d){a.a||a.b?a.l===c?a.b=d:a.a=d:(a.a=d,a.l=b,a.r=c)}function _c(a,b,c){var d=a.a,e=a.b;this.edge=a,this.site=b,this.angle=c?Math.atan2(c.y-b.y,c.x-b.x):a.l===b?Math.atan2(e.x-d.x,d.y-e.y):Math.atan2(d.x-e.x,e.y-d.y)}function ad(){this._=null}function bd(a){a.U=a.C=a.L=a.R=a.P=a.N=null}function cd(a,b){var c=b,d=b.R,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.R=d.L,c.R&&(c.R.U=c),d.L=c}function dd(a,b){var c=b,d=b.L,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.L=d.R,c.L&&(c.L.U=c),d.R=c}function ed(a){for(;a.L;)a=a.L;return a}function fd(a,b){var c,d,e,f=a.sort(gd).pop();for(Zh=[],$h=new Array(a.length),_h=new ad,bi=new ad;;)if(e=ai,f&&(!e||f.y<e.y||f.y===e.y&&f.x<e.x))f.x===c&&f.y===d||($h[f.i]=new Pc(f),Mc(f),c=f.x,d=f.y),f=a.pop();else{if(!e)break;Lc(e.arc)}b&&(Vc(b),Qc(b));var g={cells:$h,edges:Zh};return _h=bi=Zh=$h=null,g}function gd(a,b){return b.y-a.y||b.x-a.x}function hd(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}function id(a){return a.x}function jd(a){return a.y}function kd(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function ld(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&ld(a,i[0],c,d,g,h),i[1]&&ld(a,i[1],g,d,e,h),i[2]&&ld(a,i[2],c,h,g,f),i[3]&&ld(a,i[3],g,h,e,f)}}function md(a,b,c,d,e,f,g){var h,i=1/0;return function j(a,k,l,m,n){if(!(k>f||l>g||d>m||e>n)){if(o=a.point){var o,p=b-a.x,q=c-a.y,r=p*p+q*q;if(i>r){var s=Math.sqrt(i=r);d=b-s,e=c-s,f=b+s,g=c+s,h=o}}for(var t=a.nodes,u=.5*(k+m),v=.5*(l+n),w=b>=u,x=c>=v,y=x<<1|w,z=y+4;z>y;++y)if(a=t[3&y])switch(3&y){case 0:j(a,k,l,u,v);break;case 1:j(a,u,l,m,v);break;case 2:j(a,k,v,u,n);break;case 3:j(a,u,v,m,n)}}}(a,d,e,f,g),h}function nd(a,b){a=bg.rgb(a),b=bg.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+ua(Math.round(c+f*a))+ua(Math.round(d+g*a))+ua(Math.round(e+h*a))}}function od(a,b){var c,d={},e={};for(c in a)c in b?d[c]=rd(a[c],b[c]):e[c]=a[c];for(c in b)c in a||(e[c]=b[c]);return function(a){for(c in d)e[c]=d[c](a);return e}}function pd(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}}function qd(a,b){var c,d,e,f=fi.lastIndex=gi.lastIndex=0,g=-1,h=[],i=[];for(a+="",b+="";(c=fi.exec(a))&&(d=gi.exec(b));)(e=d.index)>f&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:pd(c,d)})),f=gi.lastIndex;return f<b.length&&(e=b.slice(f),h[g]?h[g]+=e:h[++g]=e),h.length<2?i[0]?(b=i[0].x,function(a){return b(a)+""}):function(){return b}:(b=i.length,function(a){for(var c,d=0;b>d;++d)h[(c=i[d]).i]=c.x(a);return h.join("")})}function rd(a,b){for(var c,d=bg.interpolators.length;--d>=0&&!(c=bg.interpolators[d](a,b)););return c}function sd(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(rd(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}}function td(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function ud(a){return function(b){return 1-a(1-b)}}function vd(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function wd(a){return a*a}function xd(a){return a*a*a}function yd(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function zd(a){return function(b){return Math.pow(b,a)}}function Ad(a){return 1-Math.cos(a*Ig)}function Bd(a){return Math.pow(2,10*(a-1))}function Cd(a){return 1-Math.sqrt(1-a*a)}function Dd(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/Gg*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*Gg/b)}}function Ed(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Fd(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Gd(a,b){a=bg.hcl(a),b=bg.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.c:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ka(c+f*a,d+g*a,e+h*a)+""}}function Hd(a,b){a=bg.hsl(a),b=bg.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.s:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ia(c+f*a,d+g*a,e+h*a)+""}}function Id(a,b){a=bg.lab(a),b=bg.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return ma(c+f*a,d+g*a,e+h*a)+""}}function Jd(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function Kd(a){var b=[a.a,a.b],c=[a.c,a.d],d=Md(b),e=Ld(b,c),f=Md(Nd(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*Kg,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*Kg:0}function Ld(a,b){return a[0]*b[0]+a[1]*b[1]}function Md(a){var b=Math.sqrt(Ld(a,a));return b&&(a[0]/=b,a[1]/=b),b}function Nd(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function Od(a,b){var c,d=[],e=[],f=bg.transform(a),g=bg.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(d.push("translate(",null,",",null,")"),e.push({i:1,x:pd(h[0],i[0])},{i:3,x:pd(h[1],i[1])})):i[0]||i[1]?d.push("translate("+i+")"):d.push(""),j!=k?(j-k>180?k+=360:k-j>180&&(j+=360),e.push({i:d.push(d.pop()+"rotate(",null,")")-2,x:pd(j,k)})):k&&d.push(d.pop()+"rotate("+k+")"),l!=m?e.push({i:d.push(d.pop()+"skewX(",null,")")-2,x:pd(l,m)}):m&&d.push(d.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(c=d.push(d.pop()+"scale(",null,",",null,")"),e.push({i:c-4,x:pd(n[0],o[0])},{i:c-2,x:pd(n[1],o[1])})):1==o[0]&&1==o[1]||d.push(d.pop()+"scale("+o+")"),c=e.length,function(a){for(var b,f=-1;++f<c;)d[(b=e[f]).i]=b.x(a);return d.join("")}}function Pd(a,b){return b=(b-=a=+a)||1/b,function(c){return(c-a)/b}}function Qd(a,b){return b=(b-=a=+a)||1/b,function(c){return Math.max(0,Math.min(1,(c-a)/b))}}function Rd(a){for(var b=a.source,c=a.target,d=Td(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function Sd(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function Td(a,b){if(a===b)return a;for(var c=Sd(a),d=Sd(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function Ud(a){a.fixed|=2}function Vd(a){a.fixed&=-7}function Wd(a){a.fixed|=4,a.px=a.x,a.py=a.y}function Xd(a){a.fixed&=-5}function Yd(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++i<h;)f=g[i],null!=f&&(Yd(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function Zd(a,b){return bg.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=de,a}function $d(a,b){for(var c=[a];null!=(a=c.pop());)if(b(a),(e=a.children)&&(d=e.length))for(var d,e;--d>=0;)c.push(e[d])}function _d(a,b){for(var c=[a],d=[];null!=(a=c.pop());)if(d.push(a),(f=a.children)&&(e=f.length))for(var e,f,g=-1;++g<e;)c.push(f[g]);for(;null!=(a=d.pop());)b(a)}function ae(a){return a.children}function be(a){return a.value}function ce(a,b){return b.value-a.value}function de(a){return bg.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function ee(a){return a.x}function fe(a){return a.y}function ge(a,b,c){a.y0=b,a.y=c}function he(a){return bg.range(a.length)}function ie(a){for(var b=-1,c=a[0].length,d=[];++b<c;)d[b]=0;return d}function je(a){for(var b,c=1,d=0,e=a[0][1],f=a.length;f>c;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function ke(a){return a.reduce(le,0)}function le(a,b){return a+b[1]}function me(a,b){return ne(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ne(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function oe(a){return[bg.min(a),bg.max(a)]}function pe(a,b){return a.value-b.value}function qe(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function re(a,b){a._pack_next=b,b._pack_prev=a}function se(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function te(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-(1/0),m=1/0,n=-(1/0);if(c.forEach(ue),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],xe(d,e,f),b(f),qe(d,f),d._pack_prev=f,qe(f,e),e=d._pack_next,g=3;j>g;g++){xe(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(se(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!se(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.r<d.r?re(d,e=h):re(d=i,e),g--):(qe(d,f),e=f,b(f))}var r=(k+l)/2,s=(m+n)/2,t=0;for(g=0;j>g;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(ve)}}function ue(a){a._pack_next=a._pack_prev=a}function ve(a){delete a._pack_next,delete a._pack_prev}function we(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e)for(var f=-1,g=e.length;++f<g;)we(e[f],b,c,d)}function xe(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f;g*=g,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function ye(a,b){return a.parent==b.parent?1:2}function ze(a){var b=a.children;return b.length?b[0]:a.t}function Ae(a){var b,c=a.children;return(b=c.length)?c[b-1]:a.t}function Be(a,b,c){var d=c/(b.i-a.i);b.c-=d,b.s+=c,a.c+=d,b.z+=c,b.m+=c}function Ce(a){for(var b,c=0,d=0,e=a.children,f=e.length;--f>=0;)b=e[f],b.z+=c,b.m+=c,c+=b.s+(d+=b.c)}function De(a,b,c){return a.a.parent===b.parent?a.a:c}function Ee(a){return 1+bg.max(a,function(a){return a.y})}function Fe(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function Ge(a){var b=a.children;return b&&b.length?Ge(b[0]):a}function He(a){var b,c=a.children;return c&&(b=c.length)?He(c[b-1]):a}function Ie(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function Je(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return 0>e&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function Ke(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function Le(a){return a.rangeExtent?a.rangeExtent():Ke(a.range())}function Me(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function Ne(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),a[d]=b.floor(f),a[e]=b.ceil(g),a}function Oe(a){return a?{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}:ri}function Pe(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());++g<=h;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=bg.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function Qe(a,b,c,d){function e(){var e=Math.min(a.length,b.length)>2?Pe:Me,i=d?Qd:Pd;return g=e(a,b,i,c),h=e(b,a,i,rd),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(Jd)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?(c=a,e()):c},f.ticks=function(b){return Ue(a,b)},f.tickFormat=function(b,c){return Ve(a,b,c)},f.nice=function(b){return Se(a,b),e()},f.copy=function(){return Qe(a,b,c,d)},e()}function Re(a,b){return bg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function Se(a,b){return Ne(a,Oe(Te(a,b)[2]))}function Te(a,b){null==b&&(b=10);var c=Ke(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function Ue(a,b){return bg.range.apply(bg,Te(a,b))}function Ve(a,b,c){var d=Te(a,b);if(c){var e=fh.exec(c);if(e.shift(),"s"===e[8]){var f=bg.formatPrefix(Math.max(ng(d[0]),ng(d[1])));return e[7]||(e[7]="."+We(f.scale(d[2]))),e[8]="f",c=bg.format(e.join("")),function(a){return c(f.scale(a))+f.symbol}}e[7]||(e[7]="."+Xe(e[8],d)),c=e.join("")}else c=",."+We(d[2])+"f";return bg.format(c)}function We(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function Xe(a,b){var c=We(b[2]);return a in si?Math.abs(c-We(Math.max(ng(b[0]),ng(b[1]))))+ +("e"!==a):c-2*("%"===a)}function Ye(a,b,c,d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(a>0?0:-a))/Math.log(b)}function f(a){return c?Math.pow(b,a):-Math.pow(b,-a)}function g(b){return a(e(b))}return g.invert=function(b){return f(a.invert(b))},g.domain=function(b){return arguments.length?(c=b[0]>=0,a.domain((d=b.map(Number)).map(e)),g):d},g.base=function(c){return arguments.length?(b=+c,a.domain(d.map(e)),g):b},g.nice=function(){var b=Ne(d.map(e),c?Math:ui);return a.domain(b),d=b.map(f),g},g.ticks=function(){var a=Ke(d),g=[],h=a[0],i=a[1],j=Math.floor(e(h)),k=Math.ceil(e(i)),l=b%1?2:b;if(isFinite(k-j)){if(c){for(;k>j;j++)for(var m=1;l>m;m++)g.push(f(j)*m);g.push(f(j))}else for(g.push(f(j));j++<k;)for(var m=l-1;m>0;m--)g.push(f(j)*m);for(j=0;g[j]<h;j++);for(k=g.length;g[k-1]>i;k--);g=g.slice(j,k)}return g},g.tickFormat=function(a,b){if(!arguments.length)return ti;arguments.length<2?b=ti:"function"!=typeof b&&(b=bg.format(b));var d,h=Math.max(.1,a/g.ticks().length),i=c?(d=1e-12,Math.ceil):(d=-1e-12,Math.floor);return function(a){return a/f(i(e(a)+d))<=h?b(a):""}},g.copy=function(){return Ye(a.copy(),b,c,d)},Re(g,a)}function Ze(a,b,c){function d(b){return a(e(b))}var e=$e(b),f=$e(1/b);return d.invert=function(b){return f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain((c=b.map(Number)).map(e)),d):c},d.ticks=function(a){return Ue(c,a)},d.tickFormat=function(a,b){return Ve(c,a,b)},d.nice=function(a){return d.domain(Se(c,a))},d.exponent=function(g){return arguments.length?(e=$e(b=g),f=$e(1/b),a.domain(c.map(e)),d):b},d.copy=function(){return Ze(a.copy(),b,c)},Re(d,a)}function $e(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function _e(a,b){function c(c){return f[((e.get(c)||("range"===b.t?e.set(c,a.push(c)):NaN))-1)%f.length]}function d(b,c){return bg.range(a.length).map(function(a){return b+c*a})}var e,f,g;return c.domain=function(d){if(!arguments.length)return a;a=[],e=new j;for(var f,g=-1,h=d.length;++g<h;)e.has(f=d[g])||e.set(f,a.push(f));return c[b.t].apply(c,b.a)},c.range=function(a){return arguments.length?(f=a,g=0,b={t:"range",a:arguments},c):f},c.rangePoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=(i+j)/2,0):(j-i)/(a.length-1+h);return f=d(i+k*h/2,k),g=0,b={t:"rangePoints",a:arguments},c},c.rangeRoundPoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=j=Math.round((i+j)/2),0):(j-i)/(a.length-1+h)|0;return f=d(i+Math.round(k*h/2+(j-i-(a.length-1+h)*k)/2),k),g=0,b={t:"rangeRoundPoints",a:arguments},c},c.rangeBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=(l-k)/(a.length-h+2*i);return f=d(k+m*i,m),j&&f.reverse(),g=m*(1-h),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-h+2*i));return f=d(k+Math.round((l-k-(a.length-h)*m)/2),m),j&&f.reverse(),g=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return g},c.rangeExtent=function(){return Ke(b.a[0])},c.copy=function(){return _e(a,b)},c.domain(a)}function af(a,b){function f(){var c=0,d=b.length;for(h=[];++c<d;)h[c-1]=bg.quantile(a,c/d);return g}function g(a){return isNaN(a=+a)?void 0:b[bg.bisect(h,a)]}var h;return g.domain=function(b){return arguments.length?(a=b.map(d).filter(e).sort(c),f()):a},g.range=function(a){return arguments.length?(b=a,f()):b},g.quantiles=function(){return h},g.invertExtent=function(c){return c=b.indexOf(c),0>c?[NaN,NaN]:[c>0?h[c-1]:a[0],c<h.length?h[c]:a[a.length-1]]},g.copy=function(){return af(a,b)},f()}function bf(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.invertExtent=function(b){return b=c.indexOf(b),b=0>b?NaN:b/f+a,[b,b+1/f]},d.copy=function(){return bf(a,b,c)},e()}function cf(a,b){function c(c){return c>=c?b[bg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return cf(a,b)},c}function df(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return Ue(a,b)},b.tickFormat=function(b,c){return Ve(a,b,c)},b.copy=function(){return df(a)},b}function ef(){return 0}function ff(a){return a.innerRadius}function gf(a){return a.outerRadius}function hf(a){return a.startAngle}function jf(a){return a.endAngle}function kf(a){return a&&a.padAngle}function lf(a,b,c,d){return(a-c)*b-(b-d)*a>0?0:1}function mf(a,b,c,d,e){var f=a[0]-b[0],g=a[1]-b[1],h=(e?d:-d)/Math.sqrt(f*f+g*g),i=h*g,j=-h*f,k=a[0]+i,l=a[1]+j,m=b[0]+i,n=b[1]+j,o=(k+m)/2,p=(l+n)/2,q=m-k,r=n-l,s=q*q+r*r,t=c-d,u=k*n-m*l,v=(0>r?-1:1)*Math.sqrt(t*t*s-u*u),w=(u*r-q*v)/s,x=(-u*q-r*v)/s,y=(u*r+q*v)/s,z=(-u*q+r*v)/s,A=w-o,B=x-p,C=y-o,D=z-p;return A*A+B*B>C*C+D*D&&(w=y,x=z),[[w-i,x-j],[w*c/t,x*c/t]]}function nf(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=Aa(c),o=Aa(d);++l<m;)e.call(this,i=b[l],l)?k.push([+n.call(this,i,l),+o.call(this,i,l)]):k.length&&(g(),k=[]);return k.length&&g(),j.length?j.join(""):null}var c=Bc,d=Cc,e=Cb,f=of,g=f.key,h=.7;return b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b.defined=function(a){return arguments.length?(e=a,b):e},b.interpolate=function(a){return arguments.length?(g="function"==typeof a?f=a:(f=Ai.get(a)||of).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function of(a){return a.join("L")}function pf(a){return of(a)+"Z"}function qf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d[0]+(d=a[b])[0])/2,"V",d[1]);return c>1&&e.push("H",d[0]),e.join("")}function rf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function sf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function tf(a,b){return a.length<4?of(a):a[1]+wf(a.slice(1,-1),xf(a,b))}function uf(a,b){return a.length<3?of(a):a[0]+wf((a.push(a[0]),a),xf([a[a.length-2]].concat(a,[a[1]]),b))}function vf(a,b){return a.length<3?of(a):a[0]+wf(a,xf(a,b))}function wf(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return of(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],i=2),b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+k[0]+","+k[1]}return d}function xf(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,i=a.length;++h<i;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function yf(a){if(a.length<3)return of(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f,"L",Cf(Di,g),",",Cf(Di,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Df(i,g,h);return a.pop(),i.push("L",d),i.join("")}function zf(a){if(a.length<4)return of(a);for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];++d<3;)b=a[d],f.push(b[0]),g.push(b[1]);for(c.push(Cf(Di,f)+","+Cf(Di,g)),--d;++d<e;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),Df(c,f,g);return c.join("")}function Af(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];++d<4;)c=a[d%e],g.push(c[0]),h.push(c[1]);for(b=[Cf(Di,g),",",Cf(Di,h)],--d;++d<f;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),Df(b,g,h);return b.join("")}function Bf(a,b){var c=a.length-1;if(c)for(var d,e,f=a[0][0],g=a[0][1],h=a[c][0]-f,i=a[c][1]-g,j=-1;++j<=c;)d=a[j],e=j/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*i);return yf(a)}function Cf(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Df(a,b,c){a.push("C",Cf(Bi,b),",",Cf(Bi,c),",",Cf(Ci,b),",",Cf(Ci,c),",",Cf(Di,b),",",Cf(Di,c))}function Ef(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Ff(a){for(var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=Ef(e,f);++b<c;)d[b]=(g+(g=Ef(e=f,f=a[b+1])))/2;return d[b]=g,d}function Gf(a){for(var b,c,d,e,f=[],g=Ff(a),h=-1,i=a.length-1;++h<i;)b=Ef(a[h],a[h+1]),ng(b)<Dg?g[h]=g[h+1]=0:(c=g[h]/b,d=g[h+1]/b,e=c*c+d*d,e>9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Hf(a){return a.length<3?of(a):a[0]+wf(a,Gf(a))}function If(a){for(var b,c,d,e=-1,f=a.length;++e<f;)b=a[e],c=b[0],d=b[1]-Ig,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function Jf(a){function b(b){function i(){p.push("M",h(a(r),l),k,j(a(q.reverse()),l),"Z")}for(var m,n,o,p=[],q=[],r=[],s=-1,t=b.length,u=Aa(c),v=Aa(e),w=c===d?function(){return n}:Aa(d),x=e===f?function(){return o}:Aa(f);++s<t;)g.call(this,m=b[s],s)?(q.push([n=+u.call(this,m,s),o=+v.call(this,m,s)]),r.push([+w.call(this,m,s),+x.call(this,m,s)])):q.length&&(i(),q=[],r=[]);return q.length&&i(),p.length?p.join(""):null}var c=Bc,d=Bc,e=0,f=Cc,g=Cb,h=of,i=h.key,j=h,k="L",l=.7;return b.x=function(a){return arguments.length?(c=d=a,b):d},b.x0=function(a){return arguments.length?(c=a,b):c},b.x1=function(a){return arguments.length?(d=a,b):d},b.y=function(a){return arguments.length?(e=f=a,b):f},b.y0=function(a){return arguments.length?(e=a,b):e; 15 },b.y1=function(a){return arguments.length?(f=a,b):f},b.defined=function(a){return arguments.length?(g=a,b):g},b.interpolate=function(a){return arguments.length?(i="function"==typeof a?h=a:(h=Ai.get(a)||of).key,j=h.reverse||h,k=h.closed?"M":"L",b):i},b.tension=function(a){return arguments.length?(l=a,b):l},b}function Kf(a){return a.radius}function Lf(a){return[a.x,a.y]}function Mf(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]-Ig;return[c*Math.cos(d),c*Math.sin(d)]}}function Nf(){return 64}function Of(){return"circle"}function Pf(a){var b=Math.sqrt(a/Fg);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+-b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function Qf(a){return function(){var b,c;(b=this[a])&&(c=b[b.active])&&(--b.count?delete b[b.active]:delete this[a],b.active+=.5,c.event&&c.event.interrupt.call(this,this.__data__,c.index))}}function Rf(a,b,c){return sg(a,Ki),a.namespace=b,a.id=c,a}function Sf(a,b,c,d){var e=a.id,f=a.namespace;return R(a,"function"==typeof c?function(a,g,h){a[f][e].tween.set(b,d(c.call(a,a.__data__,g,h)))}:(c=d(c),function(a){a[f][e].tween.set(b,c)}))}function Tf(a){return null==a&&(a=""),function(){this.textContent=a}}function Uf(a){return null==a?"__transition__":"__transition_"+a+"__"}function Vf(a,b,c,d,e){var f=a[c]||(a[c]={active:0,count:0}),g=f[d];if(!g){var h=e.time;g=f[d]={tween:new j,time:h,delay:e.delay,duration:e.duration,ease:e.ease,index:b},e=null,++f.count,bg.timer(function(e){function i(c){if(f.active>d)return k();var e=f[f.active];e&&(--f.count,delete f[f.active],e.event&&e.event.interrupt.call(a,a.__data__,e.index)),f.active=d,g.event&&g.event.start.call(a,a.__data__,b),g.tween.forEach(function(c,d){(d=d.call(a,a.__data__,b))&&p.push(d)}),m=g.ease,l=g.duration,bg.timer(function(){return o.c=j(c||1)?Cb:j,1},0,h)}function j(c){if(f.active!==d)return 1;for(var e=c/l,h=m(e),i=p.length;i>0;)p[--i].call(a,h);return e>=1?(g.event&&g.event.end.call(a,a.__data__,b),k()):void 0}function k(){return--f.count?delete f[d]:delete a[c],1}var l,m,n=g.delay,o=ch,p=[];return o.t=n+h,e>=n?i(e-n):void(o.c=i)},0,h)}}function Wf(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate("+(isFinite(d)?d:c(a))+",0)"})}function Xf(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate(0,"+(isFinite(d)?d:c(a))+")"})}function Yf(a){return a.toISOString()}function Zf(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=bg.bisect(Ti,e);return f==Ti.length?[b.year,Te(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/Ti[f-1]<Ti[f]/e?f-1:f]:[Wi,Te(a,c)[2]]}return d.invert=function(b){return $f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map($f)},d.nice=function(a,b){function c(c){return!isNaN(c)&&!a.range(c,$f(+c+1),b).length}var f=d.domain(),g=Ke(f),h=null==a?e(g,10):"number"==typeof a&&e(g,a);return h&&(a=h[0],b=h[1]),d.domain(Ne(f,b>1?{floor:function(b){for(;c(b=a.floor(b));)b=$f(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=$f(+b+1);return b}}:a))},d.ticks=function(a,b){var c=Ke(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],$f(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return Zf(a.copy(),b,c)},Re(d,a)}function $f(a){return new Date(a)}function _f(a){return JSON.parse(a.responseText)}function ag(a){var b=eg.createRange();return b.selectNode(eg.body),b.createContextualFragment(a.responseText)}var bg={version:"3.5.6"},cg=[].slice,dg=function(a){return cg.call(a)},eg=this.document;if(eg)try{dg(eg.documentElement.childNodes)[0].nodeType}catch(fg){dg=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}if(Date.now||(Date.now=function(){return+new Date}),eg)try{eg.createElement("DIV").style.setProperty("opacity",0,"")}catch(gg){var hg=this.Element.prototype,ig=hg.setAttribute,jg=hg.setAttributeNS,kg=this.CSSStyleDeclaration.prototype,lg=kg.setProperty;hg.setAttribute=function(a,b){ig.call(this,a,b+"")},hg.setAttributeNS=function(a,b,c){jg.call(this,a,b,c+"")},kg.setProperty=function(a,b,c){lg.call(this,a,b+"",c)}}bg.ascending=c,bg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:NaN},bg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c},bg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c},bg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f<g;)if(null!=(d=a[f])&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;++f<g;)if(null!=(d=b.call(a,a[f],f))&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]},bg.sum=function(a,b){var c,d=0,f=a.length,g=-1;if(1===arguments.length)for(;++g<f;)e(c=+a[g])&&(d+=c);else for(;++g<f;)e(c=+b.call(a,a[g],g))&&(d+=c);return d},bg.mean=function(a,b){var c,f=0,g=a.length,h=-1,i=g;if(1===arguments.length)for(;++h<g;)e(c=d(a[h]))?f+=c:--i;else for(;++h<g;)e(c=d(b.call(a,a[h],h)))?f+=c:--i;return i?f/i:void 0},bg.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1],f=c-d;return f?e+f*(a[d]-e):e},bg.median=function(a,b){var f,g=[],h=a.length,i=-1;if(1===arguments.length)for(;++i<h;)e(f=d(a[i]))&&g.push(f);else for(;++i<h;)e(f=d(b.call(a,a[i],i)))&&g.push(f);return g.length?bg.quantile(g.sort(c),.5):void 0},bg.variance=function(a,b){var c,f,g=a.length,h=0,i=0,j=-1,k=0;if(1===arguments.length)for(;++j<g;)e(c=d(a[j]))&&(f=c-h,h+=f/++k,i+=f*(c-h));else for(;++j<g;)e(c=d(b.call(a,a[j],j)))&&(f=c-h,h+=f/++k,i+=f*(c-h));return k>1?i/(k-1):void 0},bg.deviation=function(){var a=bg.variance.apply(this,arguments);return a?Math.sqrt(a):a};var mg=f(c);bg.bisectLeft=mg.left,bg.bisect=bg.bisectRight=mg.right,bg.bisector=function(a){return f(1===a.length?function(b,d){return c(a(b),d)}:a)},bg.shuffle=function(a,b,c){(f=arguments.length)<3&&(c=a.length,2>f&&(b=0));for(var d,e,f=c-b;f;)e=Math.random()*f--|0,d=a[f+b],a[f+b]=a[e+b],a[e+b]=d;return a},bg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},bg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},bg.zip=function(){if(!(d=arguments.length))return[];for(var a=-1,b=bg.min(arguments,g),c=new Array(b);++a<b;)for(var d,e=-1,f=c[a]=new Array(d);++e<d;)f[e]=arguments[e][a];return c},bg.transpose=function(a){return bg.zip.apply(bg,a)},bg.keys=function(a){var b=[];for(var c in a)b.push(c);return b},bg.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},bg.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},bg.merge=function(a){for(var b,c,d,e=a.length,f=-1,g=0;++f<e;)g+=a[f].length;for(c=new Array(g);--e>=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var ng=Math.abs;bg.range=function(a,b,c){if(arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0)),(b-a)/c===1/0)throw new Error("infinite range");var d,e=[],f=h(ng(c)),g=-1;if(a*=f,b*=f,c*=f,0>c)for(;(d=a+c*++g)>b;)e.push(d/f);else for(;(d=a+c*++g)<b;)e.push(d/f);return e},bg.map=function(a,b){var c=new j;if(a instanceof j)a.forEach(function(a,b){c.set(a,b)});else if(Array.isArray(a)){var d,e=-1,f=a.length;if(1===arguments.length)for(;++e<f;)c.set(e,a[e]);else for(;++e<f;)c.set(b.call(a,d=a[e],e),d)}else for(var g in a)c.set(g,a[g]);return c};var og="__proto__",pg="\x00";i(j,{has:m,get:function(a){return this._[k(a)]},set:function(a,b){return this._[k(a)]=b},remove:n,keys:o,values:function(){var a=[];for(var b in this._)a.push(this._[b]);return a},entries:function(){var a=[];for(var b in this._)a.push({key:l(b),value:this._[b]});return a},size:p,empty:q,forEach:function(a){for(var b in this._)a.call(this,l(b),this._[b])}}),bg.nest=function(){function a(b,g,h){if(h>=f.length)return d?d.call(e,g):c?g.sort(c):g;for(var i,k,l,m,n=-1,o=g.length,p=f[h++],q=new j;++n<o;)(m=q.get(i=p(k=g[n])))?m.push(k):q.set(i,[k]);return b?(k=b(),l=function(c,d){k.set(c,a(b,d,h))}):(k={},l=function(c,d){k[c]=a(b,d,h)}),q.forEach(l),k}function b(a,c){if(c>=f.length)return a;var d=[],e=g[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},f=[],g=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(bg.map,c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return g[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},bg.set=function(a){var b=new r;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},i(r,{has:m,add:function(a){return this._[k(a+="")]=!0,a},remove:n,values:o,size:p,empty:q,forEach:function(a){for(var b in this._)a.call(this,l(b))}}),bg.behavior={},bg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d<e;)a[c=arguments[d]]=t(a,b,b[c]);return a};var qg=["webkit","ms","moz","Moz","o","O"];bg.dispatch=function(){for(var a=new w,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=x(a);return a},w.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.slice(c+1),a=a.slice(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},bg.event=null,bg.requote=function(a){return a.replace(rg,"\\$&")};var rg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sg={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},tg=function(a,b){return b.querySelector(a)},ug=function(a,b){return b.querySelectorAll(a)},vg=function(a,b){var c=a.matches||a[u(a,"matchesSelector")];return(vg=function(a,b){return c.call(a,b)})(a,b)};"function"==typeof Sizzle&&(tg=function(a,b){return Sizzle(a,b)[0]||null},ug=Sizzle,vg=Sizzle.matchesSelector),bg.selection=function(){return bg.select(eg.documentElement)};var wg=bg.selection.prototype=[];wg.select=function(a){var b,c,d,e,f=[];a=C(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=-1,j=d.length;++i<j;)(e=d[i])?(b.push(c=a.call(e,e.__data__,i,g)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return B(f)},wg.selectAll=function(a){var b,c,d=[];a=D(a);for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)(c=g[h])&&(d.push(b=dg(a.call(c,c.__data__,h,e))),b.parentNode=c);return B(d)};var xg={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};bg.ns={prefix:xg,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.slice(0,b),a=a.slice(b+1)),xg.hasOwnProperty(c)?{space:xg[c],local:a}:a}},wg.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=bg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(E(b,a[b]));return this}return this.each(E(a,b))},wg.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=H(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!G(a[e]).test(b))return!1;return!0}for(b in a)this.each(I(b,a[b]));return this}return this.each(I(a,b))},wg.style=function(a,c,d){var e=arguments.length;if(3>e){if("string"!=typeof a){2>e&&(c="");for(d in a)this.each(K(d,a[d],c));return this}if(2>e){var f=this.node();return b(f).getComputedStyle(f,null).getPropertyValue(a)}d=""}return this.each(K(a,c,d))},wg.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(L(b,a[b]));return this}return this.each(L(a,b))},wg.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},wg.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},wg.append=function(a){return a=M(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},wg.insert=function(a,b){return a=M(a),b=C(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},wg.remove=function(){return this.each(N)},wg.data=function(a,b){function c(a,c){var d,e,f,g=a.length,l=c.length,m=Math.min(g,l),n=new Array(l),o=new Array(l),p=new Array(g);if(b){var q,r=new j,s=new Array(g);for(d=-1;++d<g;)r.has(q=b.call(e=a[d],e.__data__,d))?p[d]=e:r.set(q,e),s[d]=q;for(d=-1;++d<l;)(e=r.get(q=b.call(c,f=c[d],d)))?e!==!0&&(n[d]=e,e.__data__=f):o[d]=O(f),r.set(q,!0);for(d=-1;++d<g;)r.get(s[d])!==!0&&(p[d]=a[d])}else{for(d=-1;++d<m;)e=a[d],f=c[d],e?(e.__data__=f,n[d]=e):o[d]=O(f);for(;l>d;++d)o[d]=O(c[d]);for(;g>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,h.push(o),i.push(n),k.push(p)}var d,e,f=-1,g=this.length;if(!arguments.length){for(a=new Array(g=(d=this[0]).length);++f<g;)(e=d[f])&&(a[f]=e.__data__);return a}var h=S([]),i=B([]),k=B([]);if("function"==typeof a)for(;++f<g;)c(d=this[f],a.call(d,d.parentNode.__data__,f));else for(;++f<g;)c(d=this[f],a);return i.enter=function(){return h},i.exit=function(){return k},i},wg.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},wg.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=P(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return B(e)},wg.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},wg.sort=function(a){a=Q.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},wg.each=function(a){return R(this,function(b,c,d){a.call(b,b.__data__,c,d)})},wg.call=function(a){var b=dg(arguments);return a.apply(b[0]=this,b),this},wg.empty=function(){return!this.node()},wg.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},wg.size=function(){var a=0;return R(this,function(){++a}),a};var yg=[];bg.selection.enter=S,bg.selection.enter.prototype=yg,yg.append=wg.append,yg.empty=wg.empty,yg.node=wg.node,yg.call=wg.call,yg.size=wg.size,yg.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++h<i;){d=(e=this[h]).update,g.push(b=[]),b.parentNode=e.parentNode;for(var j=-1,k=e.length;++j<k;)(f=e[j])?(b.push(d[j]=c=a.call(e.parentNode,f.__data__,j,h)),c.__data__=f.__data__):b.push(null)}return B(g)},yg.insert=function(a,b){return arguments.length<2&&(b=T(this)),wg.insert.call(this,a,b)},bg.select=function(b){var c;return"string"==typeof b?(c=[tg(b,eg)],c.parentNode=eg.documentElement):(c=[b],c.parentNode=a(b)),B([c])},bg.selectAll=function(a){var b;return"string"==typeof a?(b=dg(ug(a,eg)),b.parentNode=eg.documentElement):(b=a,b.parentNode=null),B([b])},wg.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(U(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(U(a,b,c))};var zg=bg.map({mouseenter:"mouseover",mouseleave:"mouseout"});eg&&zg.forEach(function(a){"on"+a in eg&&zg.remove(a)});var Ag,Bg=0;bg.mouse=function(a){return Y(a,z())};var Cg=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;bg.touch=function(a,b,c){if(arguments.length<3&&(c=b,b=z().changedTouches),b)for(var d,e=0,f=b.length;f>e;++e)if((d=b[e]).identifier===c)return Y(a,d)},bg.behavior.drag=function(){function a(){this.on("mousedown.drag",f).on("touchstart.drag",g)}function c(a,b,c,f,g){return function(){function h(){var a,c,d=b(m,p);d&&(a=d[0]-t[0],c=d[1]-t[1],o|=a|c,t=d,n({type:"drag",x:d[0]+j[0],y:d[1]+j[1],dx:a,dy:c}))}function i(){b(m,p)&&(r.on(f+q,null).on(g+q,null),s(o&&bg.event.target===l),n({type:"dragend"}))}var j,k=this,l=bg.event.target,m=k.parentNode,n=d.of(k,arguments),o=0,p=a(),q=".drag"+(null==p?"":"-"+p),r=bg.select(c(l)).on(f+q,h).on(g+q,i),s=X(l),t=b(m,p);e?(j=e.apply(k,arguments),j=[j.x-t[0],j.y-t[1]]):j=[0,0],n({type:"dragstart"})}}var d=A(a,"drag","dragstart","dragend"),e=null,f=c(v,bg.mouse,b,"mousemove","mouseup"),g=c(Z,bg.touch,s,"touchmove","touchend");return a.origin=function(b){return arguments.length?(e=b,a):e},bg.rebind(a,d,"on")},bg.touches=function(a,b){return arguments.length<2&&(b=z().touches),b?dg(b).map(function(b){var c=Y(a,b);return c.identifier=b.identifier,c}):[]};var Dg=1e-6,Eg=Dg*Dg,Fg=Math.PI,Gg=2*Fg,Hg=Gg-Dg,Ig=Fg/2,Jg=Fg/180,Kg=180/Fg,Lg=Math.SQRT2,Mg=2,Ng=4;bg.interpolateZoom=function(a,b){function c(a){var b=a*s;if(r){var c=da(p),g=f/(Mg*m)*(c*ea(Lg*b+p)-ca(p));return[d+g*j,e+g*k,f*c/da(Lg*b+p)]}return[d+a*j,e+a*k,f*Math.exp(Lg*b)]}var d=a[0],e=a[1],f=a[2],g=b[0],h=b[1],i=b[2],j=g-d,k=h-e,l=j*j+k*k,m=Math.sqrt(l),n=(i*i-f*f+Ng*l)/(2*f*Mg*m),o=(i*i-f*f-Ng*l)/(2*i*Mg*m),p=Math.log(Math.sqrt(n*n+1)-n),q=Math.log(Math.sqrt(o*o+1)-o),r=q-p,s=(r||Math.log(i/f))/Lg;return c.duration=1e3*s,c},bg.behavior.zoom=function(){function a(a){a.on(F,l).on(Pg+".zoom",n).on("dblclick.zoom",o).on(I,m)}function c(a){return[(a[0]-z.x)/z.k,(a[1]-z.y)/z.k]}function d(a){return[a[0]*z.k+z.x,a[1]*z.k+z.y]}function e(a){z.k=Math.max(C[0],Math.min(C[1],a))}function f(a,b){b=d(b),z.x+=a[0]-b[0],z.y+=a[1]-b[1]}function g(b,c,d,g){b.__chart__={x:z.x,y:z.y,k:z.k},e(Math.pow(2,g)),f(q=c,d),b=bg.select(b),D>0&&(b=b.transition().duration(D)),b.call(a.event)}function h(){v&&v.domain(u.range().map(function(a){return(a-z.x)/z.k}).map(u.invert)),x&&x.domain(w.range().map(function(a){return(a-z.y)/z.k}).map(w.invert))}function i(a){E++||a({type:"zoomstart"})}function j(a){h(),a({type:"zoom",scale:z.k,translate:[z.x,z.y]})}function k(a){--E||(a({type:"zoomend"}),q=null)}function l(){function a(){l=1,f(bg.mouse(e),n),j(h)}function d(){m.on(G,null).on(H,null),o(l&&bg.event.target===g),k(h)}var e=this,g=bg.event.target,h=J.of(e,arguments),l=0,m=bg.select(b(e)).on(G,a).on(H,d),n=c(bg.mouse(e)),o=X(e);Ji.call(e),i(h)}function m(){function a(){var a=bg.touches(o);return n=z.k,a.forEach(function(a){a.identifier in q&&(q[a.identifier]=c(a))}),a}function b(){var b=bg.event.target;bg.select(b).on(u,d).on(v,h),w.push(b);for(var c=bg.event.changedTouches,e=0,f=c.length;f>e;++e)q[c[e].identifier]=null;var i=a(),j=Date.now();if(1===i.length){if(500>j-t){var k=i[0];g(o,k,q[k.identifier],Math.floor(Math.log(z.k)/Math.LN2)+1),y()}t=j}else if(i.length>1){var k=i[0],l=i[1],m=k[0]-l[0],n=k[1]-l[1];r=m*m+n*n}}function d(){var a,b,c,d,g=bg.touches(o);Ji.call(o);for(var h=0,i=g.length;i>h;++h,d=null)if(c=g[h],d=q[c.identifier]){if(b)break;a=c,b=d}if(d){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=r&&Math.sqrt(k/r);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+d[0])/2,(b[1]+d[1])/2],e(l*n)}t=null,f(a,b),j(p)}function h(){if(bg.event.touches.length){for(var b=bg.event.changedTouches,c=0,d=b.length;d>c;++c)delete q[b[c].identifier];for(var e in q)return void a()}bg.selectAll(w).on(s,null),x.on(F,l).on(I,m),A(),k(p)}var n,o=this,p=J.of(o,arguments),q={},r=0,s=".zoom-"+bg.event.changedTouches[0].identifier,u="touchmove"+s,v="touchend"+s,w=[],x=bg.select(o),A=X(o);b(),i(p),x.on(F,null).on(I,b)}function n(){var a=J.of(this,arguments);s?clearTimeout(s):(Ji.call(this),p=c(q=r||bg.mouse(this)),i(a)),s=setTimeout(function(){s=null,k(a)},50),y(),e(Math.pow(2,.002*Og())*z.k),f(q,p),j(a)}function o(){var a=bg.mouse(this),b=Math.log(z.k)/Math.LN2;g(this,a,c(a),bg.event.shiftKey?Math.ceil(b)-1:Math.floor(b)+1)}var p,q,r,s,t,u,v,w,x,z={x:0,y:0,k:1},B=[960,500],C=Qg,D=250,E=0,F="mousedown.zoom",G="mousemove.zoom",H="mouseup.zoom",I="touchstart.zoom",J=A(a,"zoomstart","zoom","zoomend");return Pg||(Pg="onwheel"in eg?(Og=function(){return-bg.event.deltaY*(bg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in eg?(Og=function(){return bg.event.wheelDelta},"mousewheel"):(Og=function(){return-bg.event.detail},"MozMousePixelScroll")),a.event=function(a){a.each(function(){var a=J.of(this,arguments),b=z;Hi?bg.select(this).transition().each("start.zoom",function(){z=this.__chart__||{x:0,y:0,k:1},i(a)}).tween("zoom:zoom",function(){var c=B[0],d=B[1],e=q?q[0]:c/2,f=q?q[1]:d/2,g=bg.interpolateZoom([(e-z.x)/z.k,(f-z.y)/z.k,c/z.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),h=c/d[2];this.__chart__=z={x:e-d[0]*h,y:f-d[1]*h,k:h},j(a)}}).each("interrupt.zoom",function(){k(a)}).each("end.zoom",function(){k(a)}):(this.__chart__=z,i(a),j(a),k(a))})},a.translate=function(b){return arguments.length?(z={x:+b[0],y:+b[1],k:z.k},h(),a):[z.x,z.y]},a.scale=function(b){return arguments.length?(z={x:z.x,y:z.y,k:+b},h(),a):z.k},a.scaleExtent=function(b){return arguments.length?(C=null==b?Qg:[+b[0],+b[1]],a):C},a.center=function(b){return arguments.length?(r=b&&[+b[0],+b[1]],a):r},a.size=function(b){return arguments.length?(B=b&&[+b[0],+b[1]],a):B},a.duration=function(b){return arguments.length?(D=+b,a):D},a.x=function(b){return arguments.length?(v=b,u=b.copy(),z={x:0,y:0,k:1},a):v},a.y=function(b){return arguments.length?(x=b,w=b.copy(),z={x:0,y:0,k:1},a):x},bg.rebind(a,J,"on")};var Og,Pg,Qg=[0,1/0];bg.color=ga,ga.prototype.toString=function(){return this.rgb()+""},bg.hsl=ha;var Rg=ha.prototype=new ga;Rg.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new ha(this.h,this.s,this.l/a)},Rg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ha(this.h,this.s,a*this.l)},Rg.rgb=function(){return ia(this.h,this.s,this.l)},bg.hcl=ja;var Sg=ja.prototype=new ga;Sg.brighter=function(a){return new ja(this.h,this.c,Math.min(100,this.l+Tg*(arguments.length?a:1)))},Sg.darker=function(a){return new ja(this.h,this.c,Math.max(0,this.l-Tg*(arguments.length?a:1)))},Sg.rgb=function(){return ka(this.h,this.c,this.l).rgb()},bg.lab=la;var Tg=18,Ug=.95047,Vg=1,Wg=1.08883,Xg=la.prototype=new ga;Xg.brighter=function(a){return new la(Math.min(100,this.l+Tg*(arguments.length?a:1)),this.a,this.b)},Xg.darker=function(a){return new la(Math.max(0,this.l-Tg*(arguments.length?a:1)),this.a,this.b)},Xg.rgb=function(){return ma(this.l,this.a,this.b)},bg.rgb=ra;var Yg=ra.prototype=new ga;Yg.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),new ra(Math.min(255,b/a),Math.min(255,c/a),Math.min(255,d/a))):new ra(e,e,e)},Yg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ra(a*this.r,a*this.g,a*this.b)},Yg.hsl=function(){return wa(this.r,this.g,this.b)},Yg.toString=function(){return"#"+ua(this.r)+ua(this.g)+ua(this.b)};var Zg=bg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Zg.forEach(function(a,b){Zg.set(a,sa(b))}),bg.functor=Aa,bg.xhr=Ba(s),bg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=Ca(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),i=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=j)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++<j;)if(34===a.charCodeAt(c)){if(34!==a.charCodeAt(c+1))break;++c}k=c+2;var d=a.charCodeAt(c+1);return 13===d?(e=!0,10===a.charCodeAt(c+2)&&++k):10===d&&(e=!0),a.slice(b+1,c).replace(/""/g,'"')}for(;j>k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==i)continue;return a.slice(b,k-h)}return a.slice(b)}for(var d,e,f={},g={},h=[],j=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();b&&null==(m=b(m,l++))||h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new r,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(g).join(a)].concat(b.map(function(b){return e.map(function(a){return g(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c},bg.csv=bg.dsv(",","text/csv"),bg.tsv=bg.dsv(" ","text/tab-separated-values");var $g,_g,ah,bh,ch,dh=this[u(this,"requestAnimationFrame")]||function(a){setTimeout(a,17)};bg.timer=function(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,f:!1,n:null};_g?_g.n=f:$g=f,_g=f,ah||(bh=clearTimeout(bh),ah=1,dh(Fa))},bg.timer.flush=function(){Ga(),Ha()},bg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var eh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ja);bg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=bg.round(a,Ia(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c-1)/3)))),eh[8+c/3]};var fh=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,gh=bg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=bg.round(a,Ia(a,b))).toFixed(Math.max(0,Math.min(20,Ia(a*(1+1e-15),b))))}}),hh=bg.time={},ih=Date;Ma.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){jh.setUTCDate.apply(this._,arguments)},setDay:function(){jh.setUTCDay.apply(this._,arguments)},setFullYear:function(){jh.setUTCFullYear.apply(this._,arguments)},setHours:function(){jh.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){jh.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){jh.setUTCMinutes.apply(this._,arguments)},setMonth:function(){jh.setUTCMonth.apply(this._,arguments)},setSeconds:function(){jh.setUTCSeconds.apply(this._,arguments)},setTime:function(){jh.setTime.apply(this._,arguments)}};var jh=Date.prototype;hh.year=Na(function(a){return a=hh.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),hh.years=hh.year.range,hh.years.utc=hh.year.utc.range,hh.day=Na(function(a){var b=new ih(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),hh.days=hh.day.range,hh.days.utc=hh.day.utc.range,hh.dayOfYear=function(a){var b=hh.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(a,b){b=7-b;var c=hh[a]=Na(function(a){return(a=hh.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=hh.year(a).getDay();return Math.floor((hh.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});hh[a+"s"]=c.range,hh[a+"s"].utc=c.utc.range,hh[a+"OfYear"]=function(a){var c=hh.year(a).getDay();return Math.floor((hh.dayOfYear(a)+(c+b)%7)/7)}}),hh.week=hh.sunday,hh.weeks=hh.sunday.range,hh.weeks.utc=hh.sunday.utc.range,hh.weekOfYear=hh.sundayOfYear;var kh={"-":"",_:" ",0:"0"},lh=/^\s*\d+/,mh=/^%/;bg.locale=function(a){return{numberFormat:Ka(a),timeFormat:Pa(a)}};var nh=bg.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});bg.format=nh.numberFormat,bg.geo={},ib.prototype={s:0,t:0,add:function(a){jb(a,this.t,oh),jb(oh.s,this.s,this),this.s?this.t+=oh.t:this.s=oh.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var oh=new ib;bg.geo.stream=function(a,b){ 16 a&&ph.hasOwnProperty(a.type)?ph[a.type](a,b):kb(a,b)};var ph={Feature:function(a,b){kb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++d<e;)kb(c[d].geometry,b)}},qh={Sphere:function(a,b){b.sphere()},Point:function(a,b){a=a.coordinates,b.point(a[0],a[1],a[2])},MultiPoint:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)a=c[d],b.point(a[0],a[1],a[2])},LineString:function(a,b){lb(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)lb(c[d],b,0)},Polygon:function(a,b){mb(a.coordinates,b)},MultiPolygon:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)mb(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;++d<e;)kb(c[d],b)}};bg.geo.area=function(a){return rh=0,bg.geo.stream(a,th),rh};var rh,sh=new ib,th={sphere:function(){rh+=4*Fg},point:v,lineStart:v,lineEnd:v,polygonStart:function(){sh.reset(),th.lineStart=nb},polygonEnd:function(){var a=2*sh;rh+=0>a?4*Fg+a:a,th.lineStart=th.lineEnd=th.point=v}};bg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=ob([b*Jg,c*Jg]);if(r){var e=qb(r,d),f=[e[1],-e[0],0],g=qb(f,e);tb(g),g=ub(g);var i=b-o,j=i>0?1:-1,p=g[0]*Kg*j,q=ng(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Kg;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Kg;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=ng(d)>180?d+(d>0?360:-360):d}else p=a,q=c;th.point(a,c),b(a,c)}function f(){th.lineStart()}function g(){e(p,q),th.lineEnd(),ng(s)>Dg&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a<b[0]||b[1]<a}var k,l,m,n,o,p,q,r,s,t,u,v={point:a,lineStart:c,lineEnd:d,polygonStart:function(){v.point=e,v.lineStart=f,v.lineEnd=g,s=0,th.polygonStart()},polygonEnd:function(){th.polygonEnd(),v.point=a,v.lineStart=c,v.lineEnd=d,0>sh?(k=-(m=180),l=-(n=90)):s>Dg?n=90:-Dg>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],bg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-(1/0),b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,k===1/0||l===1/0?[[NaN,NaN],[NaN,NaN]]:[[k,l],[m,n]]}}(),bg.geo.centroid=function(a){uh=vh=wh=xh=yh=zh=Ah=Bh=Ch=Dh=Eh=0,bg.geo.stream(a,Fh);var b=Ch,c=Dh,d=Eh,e=b*b+c*c+d*d;return Eg>e&&(b=zh,c=Ah,d=Bh,Dg>vh&&(b=wh,c=xh,d=yh),e=b*b+c*c+d*d,Eg>e)?[NaN,NaN]:[Math.atan2(c,b)*Kg,ba(d/Math.sqrt(e))*Kg]};var uh,vh,wh,xh,yh,zh,Ah,Bh,Ch,Dh,Eh,Fh={sphere:v,point:wb,lineStart:yb,lineEnd:zb,polygonStart:function(){Fh.lineStart=Ab},polygonEnd:function(){Fh.lineStart=yb}},Gh=Gb(Cb,Kb,Mb,[-Fg,-Fg/2]),Hh=1e9;bg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=Qb(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(bg.geo.conicEqualArea=function(){return Rb(Sb)}).raw=Sb,bg.geo.albers=function(){return bg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},bg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=bg.geo.albers(),g=bg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=bg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Dg,l+.12*j+Dg],[k-.214*j-Dg,l+.234*j-Dg]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Dg,l+.166*j+Dg],[k-.115*j-Dg,l+.234*j-Dg]]).stream(i).point,a},a.scale(1070)};var Ih,Jh,Kh,Lh,Mh,Nh,Oh={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Jh=0,Oh.lineStart=Tb},polygonEnd:function(){Oh.lineStart=Oh.lineEnd=Oh.point=v,Ih+=ng(Jh/2)}},Ph={point:Ub,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},Qh={point:Xb,lineStart:Yb,lineEnd:Zb,polygonStart:function(){Qh.lineStart=$b},polygonEnd:function(){Qh.point=Xb,Qh.lineStart=Yb,Qh.lineEnd=Zb}};bg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),bg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Ih=0,bg.geo.stream(a,e(Oh)),Ih},a.centroid=function(a){return wh=xh=yh=zh=Ah=Bh=Ch=Dh=Eh=0,bg.geo.stream(a,e(Qh)),Eh?[Ch/Eh,Dh/Eh]:Bh?[zh/Bh,Ah/Bh]:yh?[wh/yh,xh/yh]:[NaN,NaN]},a.bounds=function(a){return Mh=Nh=-(Kh=Lh=1/0),bg.geo.stream(a,e(Ph)),[[Kh,Lh],[Mh,Nh]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||bc(a):s,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new Vb:new _b(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(bg.geo.albersUsa()).context(null)},bg.geo.transform=function(a){return{stream:function(b){var c=new cc(b);for(var d in a)c[d]=a[d];return c}}},cc.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},bg.geo.projection=ec,bg.geo.projectionMutator=fc,(bg.geo.equirectangular=function(){return ec(hc)}).raw=hc.invert=hc,bg.geo.rotation=function(a){function b(b){return b=a(b[0]*Jg,b[1]*Jg),b[0]*=Kg,b[1]*=Kg,b}return a=jc(a[0]%360*Jg,a[1]*Jg,a.length>2?a[2]*Jg:0),b.invert=function(b){return b=a.invert(b[0]*Jg,b[1]*Jg),b[0]*=Kg,b[1]*=Kg,b},b},ic.invert=hc,bg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=jc(-a[0]*Jg,-a[1]*Jg,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Kg,a[1]*=Kg}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=nc((b=+d)*Jg,e*Jg),a):b},a.precision=function(d){return arguments.length?(c=nc(b*Jg,(e=+d)*Jg),a):e},a.angle(90)},bg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Jg,e=a[1]*Jg,f=b[1]*Jg,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},bg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return bg.range(Math.ceil(f/q)*q,e,q).map(m).concat(bg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(bg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return ng(a%q)>Dg}).map(k)).concat(bg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return ng(a%r)>Dg}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=pc(h,g,90),l=qc(d,c,s),m=pc(j,i,90),n=qc(f,e,s),a):s},a.majorExtent([[-180,-90+Dg],[180,90-Dg]]).minorExtent([[-180,-80-Dg],[180,80+Dg]])},bg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=rc,e=sc;return a.distance=function(){return bg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},bg.geo.interpolate=function(a,b){return tc(a[0]*Jg,a[1]*Jg,b[0]*Jg,b[1]*Jg)},bg.geo.length=function(a){return Rh=0,bg.geo.stream(a,Sh),Rh};var Rh,Sh={sphere:v,point:v,lineStart:uc,lineEnd:v,polygonStart:v,polygonEnd:v},Th=vc(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(bg.geo.azimuthalEqualArea=function(){return ec(Th)}).raw=Th;var Uh=vc(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},s);(bg.geo.azimuthalEquidistant=function(){return ec(Uh)}).raw=Uh,(bg.geo.conicConformal=function(){return Rb(wc)}).raw=wc,(bg.geo.conicEquidistant=function(){return Rb(xc)}).raw=xc;var Vh=vc(function(a){return 1/a},Math.atan);(bg.geo.gnomonic=function(){return ec(Vh)}).raw=Vh,yc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Ig]},(bg.geo.mercator=function(){return zc(yc)}).raw=yc;var Wh=vc(function(){return 1},Math.asin);(bg.geo.orthographic=function(){return ec(Wh)}).raw=Wh;var Xh=vc(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(bg.geo.stereographic=function(){return ec(Xh)}).raw=Xh,Ac.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Ig]},(bg.geo.transverseMercator=function(){var a=zc(Ac),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[a[1],-a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},c([0,0,90])}).raw=Ac,bg.geom={},bg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e=Aa(c),f=Aa(d),g=a.length,h=[],i=[];for(b=0;g>b;b++)h.push([+e.call(this,a[b],b),+f.call(this,a[b],b),b]);for(h.sort(Ec),b=0;g>b;b++)i.push([h[b][0],-h[b][1]]);var j=Dc(h),k=Dc(i),l=k[0]===j[0],m=k[k.length-1]===j[j.length-1],n=[];for(b=j.length-1;b>=0;--b)n.push(a[h[j[b]][2]]);for(b=+l;b<k.length-m;++b)n.push(a[h[k[b]][2]]);return n}var c=Bc,d=Cc;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},bg.geom.polygon=function(a){return sg(a,Yh),a};var Yh=bg.geom.polygon.prototype=[];Yh.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b<c;)a=d,d=this[b],e+=a[1]*d[0]-a[0]*d[1];return.5*e},Yh.centroid=function(a){var b,c,d=-1,e=this.length,f=0,g=0,h=this[e-1];for(arguments.length||(a=-1/(6*this.area()));++d<e;)b=h,h=this[d],c=b[0]*h[1]-h[0]*b[1],f+=(b[0]+h[0])*c,g+=(b[1]+h[1])*c;return[f*a,g*a]},Yh.clip=function(a){for(var b,c,d,e,f,g,h=Hc(a),i=-1,j=this.length-Hc(this),k=this[j-1];++i<j;){for(b=a.slice(),a.length=0,e=this[i],f=b[(d=b.length-h)-1],c=-1;++c<d;)g=b[c],Fc(g,k,e)?(Fc(f,k,e)||a.push(Gc(f,g,k,e)),a.push(g)):Fc(f,k,e)&&a.push(Gc(f,g,k,e)),f=g;h&&a.push(a[0]),k=e}return a};var Zh,$h,_h,ai,bi,ci=[],di=[];Pc.prototype.prepare=function(){for(var a,b=this.edges,c=b.length;c--;)a=b[c].edge,a.b&&a.a||b.splice(c,1);return b.sort(Rc),b.length},_c.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},ad.prototype={insert:function(a,b){var c,d,e;if(a){if(b.P=a,b.N=a.N,a.N&&(a.N.P=b),a.N=b,a.R){for(a=a.R;a.L;)a=a.L;a.L=b}else a.R=b;c=a}else this._?(a=ed(this._),b.P=null,b.N=a,a.P=a.L=b,c=a):(b.P=b.N=null,this._=b,c=null);for(b.L=b.R=null,b.U=c,b.C=!0,a=b;c&&c.C;)d=c.U,c===d.L?(e=d.R,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.R&&(cd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,dd(this,d))):(e=d.L,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.L&&(dd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,cd(this,d))),c=a.U;this._.C=!1},remove:function(a){a.N&&(a.N.P=a.P),a.P&&(a.P.N=a.N),a.N=a.P=null;var b,c,d,e=a.U,f=a.L,g=a.R;if(c=f?g?ed(g):f:g,e?e.L===a?e.L=c:e.R=c:this._=c,f&&g?(d=c.C,c.C=a.C,c.L=f,f.U=c,c!==g?(e=c.U,c.U=a.U,a=c.R,e.L=a,c.R=g,g.U=c):(c.U=e,e=c,a=c.R)):(d=a.C,a=c),a&&(a.U=e),!d){if(a&&a.C)return void(a.C=!1);do{if(a===this._)break;if(a===e.L){if(b=e.R,b.C&&(b.C=!1,e.C=!0,cd(this,e),b=e.R),b.L&&b.L.C||b.R&&b.R.C){b.R&&b.R.C||(b.L.C=!1,b.C=!0,dd(this,b),b=e.R),b.C=e.C,e.C=b.R.C=!1,cd(this,e),a=this._;break}}else if(b=e.L,b.C&&(b.C=!1,e.C=!0,dd(this,e),b=e.L),b.L&&b.L.C||b.R&&b.R.C){b.L&&b.L.C||(b.R.C=!1,b.C=!0,cd(this,b),b=e.L),b.C=e.C,e.C=b.L.C=!1,dd(this,e),a=this._;break}b.C=!0,a=e,e=e.U}while(!a.C);a&&(a.C=!1)}}},bg.geom.voronoi=function(a){function b(a){var b=new Array(a.length),d=h[0][0],e=h[0][1],f=h[1][0],g=h[1][1];return fd(c(a),h).cells.forEach(function(c,h){var i=c.edges,j=c.site,k=b[h]=i.length?i.map(function(a){var b=a.start();return[b.x,b.y]}):j.x>=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Dg)*Dg,y:Math.round(g(a,b)/Dg)*Dg,i:b}})}var d=Bc,e=Cc,f=d,g=e,h=ei;return a?b(a):(b.links=function(a){return fd(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return fd(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(Rc),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i<j;)e=k,f=l,k=h[i].edge,l=k.l===g?k.r:k.l,d<f.i&&d<l.i&&hd(g,f,l)<0&&b.push([a[d],a[f.i],a[l.i]])}),b},b.x=function(a){return arguments.length?(f=Aa(d=a),b):d},b.y=function(a){return arguments.length?(g=Aa(e=a),b):e},b.clipExtent=function(a){return arguments.length?(h=null==a?ei:a,b):h===ei?null:h},b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===ei?null:h&&h[1]},b)};var ei=[[-1e6,-1e6],[1e6,1e6]];bg.geom.delaunay=function(a){return bg.geom.voronoi().triangles(a)},bg.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,f,g,h){if(!isNaN(c)&&!isNaN(d))if(a.leaf){var i=a.x,k=a.y;if(null!=i)if(ng(i-c)+ng(k-d)<.01)j(a,b,c,d,e,f,g,h);else{var l=a.point;a.x=a.y=a.point=null,j(a,l,i,k,e,f,g,h),j(a,b,c,d,e,f,g,h)}else a.x=c,a.y=d,a.point=b}else j(a,b,c,d,e,f,g,h)}function j(a,b,c,d,e,g,h,i){var j=.5*(e+h),k=.5*(g+i),l=c>=j,m=d>=k,n=m<<1|l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=kd()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=Aa(h),u=Aa(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.x<p&&(p=k.x),k.y<q&&(q=k.y),k.x>r&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=kd();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){ld(a,z,p,q,r,s)},z.find=function(a){return md(z,a[0],a[1],p,q,r,s)},n=-1,null==b){for(;++n<o;)f(z,a[n],l[n],m[n],p,q,r,s);--n}else a.forEach(z.add);return l=m=a=k=null,z}var g,h=Bc,i=Cc;return(g=arguments.length)?(h=id,i=jd,3===g&&(e=c,d=b,c=b=0),f(a)):(f.x=function(a){return arguments.length?(h=a,f):h},f.y=function(a){return arguments.length?(i=a,f):i},f.extent=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=+a[0][0],c=+a[0][1],d=+a[1][0],e=+a[1][1]),f):null==b?null:[[b,c],[d,e]]},f.size=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=c=0,d=+a[0],e=+a[1]),f):null==b?null:[d-b,e-c]},f)},bg.interpolateRgb=nd,bg.interpolateObject=od,bg.interpolateNumber=pd,bg.interpolateString=qd;var fi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gi=new RegExp(fi.source,"g");bg.interpolate=rd,bg.interpolators=[function(a,b){var c=typeof b;return("string"===c?Zg.has(b.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(b)?nd:qd:b instanceof ga?nd:Array.isArray(b)?sd:"object"===c&&isNaN(b)?od:pd)(a,b)}],bg.interpolateArray=sd;var hi=function(){return s},ii=bg.map({linear:hi,poly:zd,quad:function(){return wd},cubic:function(){return xd},sin:function(){return Ad},exp:function(){return Bd},circle:function(){return Cd},elastic:Dd,back:Ed,bounce:function(){return Fd}}),ji=bg.map({"in":s,out:ud,"in-out":vd,"out-in":function(a){return vd(ud(a))}});bg.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.slice(0,b):a,d=b>=0?a.slice(b+1):"in";return c=ii.get(c)||hi,d=ji.get(d)||s,td(d(c.apply(null,cg.call(arguments,1))))},bg.interpolateHcl=Gd,bg.interpolateHsl=Hd,bg.interpolateLab=Id,bg.interpolateRound=Jd,bg.transform=function(a){var b=eg.createElementNS(bg.ns.prefix.svg,"g");return(bg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Kd(c?c.matrix:ki)})(a)},Kd.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ki={a:1,b:0,c:0,d:1,e:0,f:0};bg.interpolateTransform=Od,bg.layout={},bg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c<d;)b.push(Rd(a[c]));return b}},bg.layout.chord=function(){function a(){var a,j,l,m,n,o={},p=[],q=bg.range(f),r=[];for(c=[],d=[],a=0,m=-1;++m<f;){for(j=0,n=-1;++n<f;)j+=e[m][n];p.push(j),r.push(bg.range(f)),a+=j}for(g&&q.sort(function(a,b){return g(p[a],p[b])}),h&&r.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})}),a=(Gg-k*f)/a,j=0,m=-1;++m<f;){for(l=j,n=-1;++n<f;){var s=q[m],t=r[s][n],u=e[s][t],v=j,w=j+=u*a;o[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}d[s]={index:s,startAngle:l,endAngle:j,value:(j-l)/a},j+=k}for(m=-1;++m<f;)for(n=m-1;++n<f;){var x=o[m+"-"+n],y=o[n+"-"+m];(x.value||y.value)&&c.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}i&&b()}function b(){c.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var c,d,e,f,g,h,i,j={},k=0;return j.matrix=function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,j):e},j.padding=function(a){return arguments.length?(k=a,c=d=null,j):k},j.sortGroups=function(a){return arguments.length?(g=a,c=d=null,j):g},j.sortSubgroups=function(a){return arguments.length?(h=a,c=null,j):h},j.sortChords=function(a){return arguments.length?(i=a,c&&b(),j):i},j.chords=function(){return c||a(),c},j.groups=function(){return d||a(),d},j},bg.layout.force=function(){function a(a){return function(b,c,d,e){if(b.point!==a){var f=b.cx-a.x,g=b.cy-a.y,h=e-c,i=f*f+g*g;if(i>h*h/q){if(o>i){var j=b.charge/i;a.px-=f*j,a.py-=g*j}return!0}if(b.point&&i&&o>i){var j=b.pointCharge/i;a.px-=f*j,a.py-=g*j}}return!b.charge}}function b(a){a.px=bg.event.x,a.py=bg.event.y,h.resume()}var c,d,e,f,g,h={},i=bg.dispatch("start","tick","end"),j=[1,1],k=.9,l=li,m=mi,n=-30,o=ni,p=.1,q=.64,r=[],t=[];return h.tick=function(){if((d*=.99)<.005)return i.end({type:"end",alpha:d=0}),!0;var b,c,h,l,m,o,q,s,u,v=r.length,w=t.length;for(c=0;w>c;++c)h=t[c],l=h.source,m=h.target,s=m.x-l.x,u=m.y-l.y,(o=s*s+u*u)&&(o=d*f[c]*((o=Math.sqrt(o))-e[c])/o,s*=o,u*=o,m.x-=s*(q=l.weight/(m.weight+l.weight)),m.y-=u*q,l.x+=s*(q=1-q),l.y+=u*q);if((q=d*p)&&(s=j[0]/2,u=j[1]/2,c=-1,q))for(;++c<v;)h=r[c],h.x+=(s-h.x)*q,h.y+=(u-h.y)*q;if(n)for(Yd(b=bg.geom.quadtree(r),d,g),c=-1;++c<v;)(h=r[c]).fixed||b.visit(a(h));for(c=-1;++c<v;)h=r[c],h.fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*k,h.y-=(h.py-(h.py=h.y))*k);i.tick({type:"tick",alpha:d})},h.nodes=function(a){return arguments.length?(r=a,h):r},h.links=function(a){return arguments.length?(t=a,h):t},h.size=function(a){return arguments.length?(j=a,h):j},h.linkDistance=function(a){return arguments.length?(l="function"==typeof a?a:+a,h):l},h.distance=h.linkDistance,h.linkStrength=function(a){return arguments.length?(m="function"==typeof a?a:+a,h):m},h.friction=function(a){return arguments.length?(k=+a,h):k},h.charge=function(a){return arguments.length?(n="function"==typeof a?a:+a,h):n},h.chargeDistance=function(a){return arguments.length?(o=a*a,h):Math.sqrt(o)},h.gravity=function(a){return arguments.length?(p=+a,h):p},h.theta=function(a){return arguments.length?(q=a*a,h):Math.sqrt(q)},h.alpha=function(a){return arguments.length?(a=+a,d?d=a>0?a:0:a>0&&(i.start({type:"start",alpha:d=a}),bg.timer(h.tick)),h):d},h.start=function(){function a(a,d){if(!c){for(c=new Array(i),h=0;i>h;++h)c[h]=[];for(h=0;k>h;++h){var e=t[h];c[e.source.index].push(e.target),c[e.target.index].push(e.source)}}for(var f,g=c[b],h=-1,j=g.length;++h<j;)if(!isNaN(f=g[h][a]))return f;return Math.random()*d}var b,c,d,i=r.length,k=t.length,o=j[0],p=j[1];for(b=0;i>b;++b)(d=r[b]).index=b,d.weight=0;for(b=0;k>b;++b)d=t[b],"number"==typeof d.source&&(d.source=r[d.source]),"number"==typeof d.target&&(d.target=r[d.target]),++d.source.weight,++d.target.weight;for(b=0;i>b;++b)d=r[b],isNaN(d.x)&&(d.x=a("x",o)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(e=[],"function"==typeof l)for(b=0;k>b;++b)e[b]=+l.call(this,t[b],b);else for(b=0;k>b;++b)e[b]=l;if(f=[],"function"==typeof m)for(b=0;k>b;++b)f[b]=+m.call(this,t[b],b);else for(b=0;k>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;i>b;++b)g[b]=+n.call(this,r[b],b);else for(b=0;i>b;++b)g[b]=n;return h.resume()},h.resume=function(){return h.alpha(.1)},h.stop=function(){return h.alpha(0)},h.drag=function(){return c||(c=bg.behavior.drag().origin(s).on("dragstart.force",Ud).on("drag.force",b).on("dragend.force",Vd)),arguments.length?void this.on("mouseover.force",Wd).on("mouseout.force",Xd).call(c):c},bg.rebind(h,i,"on")};var li=20,mi=1,ni=1/0;bg.layout.hierarchy=function(){function a(e){var f,g=[e],h=[];for(e.depth=0;null!=(f=g.pop());)if(h.push(f),(j=c.call(a,f,f.depth))&&(i=j.length)){for(var i,j,k;--i>=0;)g.push(k=j[i]),k.parent=f,k.depth=f.depth+1;d&&(f.value=0),f.children=j}else d&&(f.value=+d.call(a,f,f.depth)||0),delete f.children;return _d(e,function(a){var c,e;b&&(c=a.children)&&c.sort(b),d&&(e=a.parent)&&(e.value+=a.value)}),h}var b=ce,c=ae,d=be;return a.sort=function(c){return arguments.length?(b=c,a):b},a.children=function(b){return arguments.length?(c=b,a):c},a.value=function(b){return arguments.length?(d=b,a):d},a.revalue=function(b){return d&&($d(b,function(a){a.children&&(a.value=0)}),_d(b,function(b){var c;b.children||(b.value=+d.call(a,b,b.depth)||0),(c=b.parent)&&(c.value+=b.value)})),b},a},bg.layout.partition=function(){function a(b,c,d,e){var f=b.children;if(b.x=c,b.y=b.depth*e,b.dx=d,b.dy=e,f&&(g=f.length)){var g,h,i,j=-1;for(d=b.value?d/b.value:0;++j<g;)a(h=f[j],c,i=h.value*d,e),c+=i}}function b(a){var c=a.children,d=0;if(c&&(e=c.length))for(var e,f=-1;++f<e;)d=Math.max(d,b(c[f]));return 1+d}function c(c,f){var g=d.call(this,c,f);return a(g[0],0,e[0],e[1]/b(g[0])),g}var d=bg.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},Zd(c,d)},bg.layout.pie=function(){function a(g){var h,i=g.length,j=g.map(function(c,d){return+b.call(a,c,d)}),k=+("function"==typeof d?d.apply(this,arguments):d),l=("function"==typeof e?e.apply(this,arguments):e)-k,m=Math.min(Math.abs(l)/i,+("function"==typeof f?f.apply(this,arguments):f)),n=m*(0>l?-1:1),o=(l-i*n)/bg.sum(j),p=bg.range(i),q=[];return null!=c&&p.sort(c===oi?function(a,b){return j[b]-j[a]}:function(a,b){return c(g[a],g[b])}),p.forEach(function(a){q[a]={data:g[a],value:h=j[a],startAngle:k,endAngle:k+=h*o+n,padAngle:m}}),q}var b=Number,c=oi,d=0,e=Gg,f=0;return a.value=function(c){return arguments.length?(b=c,a):b},a.sort=function(b){return arguments.length?(c=b,a):c},a.startAngle=function(b){return arguments.length?(d=b,a):d},a.endAngle=function(b){return arguments.length?(e=b,a):e},a.padAngle=function(b){return arguments.length?(f=b,a):f},a};var oi={};bg.layout.stack=function(){function a(h,i){if(!(m=h.length))return h;var j=h.map(function(c,d){return b.call(a,c,d)}),k=j.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,b,c)]})}),l=c.call(a,k,i);j=bg.permute(j,l),k=bg.permute(k,l);var m,n,o,p,q=d.call(a,k,i),r=j[0].length;for(o=0;r>o;++o)for(e.call(a,j[0][o],p=q[o],k[0][o][1]),n=1;m>n;++n)e.call(a,j[n][o],p+=k[n-1][o][1],k[n][o][1]);return h}var b=s,c=he,d=ie,e=ge,f=ee,g=fe;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:pi.get(b)||he,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:qi.get(b)||ie,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var pi=bg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(je),f=a.map(ke),g=bg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return bg.range(a.length).reverse()},"default":he}),qi=bg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand: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;e>b;b++)d+=a[b][c][1];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},zero:ie});bg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f<n;)g=i[f]=[],g.dx=l[f+1]-(g.x=l[f]),g.y=0;if(n>0)for(f=-1;++f<m;)h=j[f],h>=k[0]&&h<=k[1]&&(g=i[bg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=oe,e=me;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Aa(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return ne(a,b)}:Aa(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},bg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,_d(h,function(a){a.r=+k(a.value)}),_d(h,te),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;_d(h,function(a){a.r+=l}),_d(h,te),_d(h,function(a){a.r-=l})}return we(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=bg.layout.hierarchy().sort(pe),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},Zd(a,c)},bg.layout.tree=function(){function a(a,e){var k=g.call(this,a,e),l=k[0],m=b(l);if(_d(m,c),m.parent.m=-m.z,$d(m,d),j)$d(l,f);else{var n=l,o=l,p=l;$d(l,function(a){a.x<n.x&&(n=a),a.x>o.x&&(o=a),a.depth>p.depth&&(p=a)});var q=h(n,o)/2-n.x,r=i[0]/(o.x+h(o,n)/2+q),s=i[1]/(p.depth||1);$d(l,function(a){a.x=(a.x+q)*r,a.y=a.depth*s})}return k}function b(a){for(var b,c={A:null,children:[a]},d=[c];null!=(b=d.pop());)for(var e,f=b.children,g=0,h=f.length;h>g;++g)d.push((f[g]=e={_:f[g],parent:b,children:(e=f[g].children)&&e.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:g}).a=e);return c.children[0]}function c(a){var b=a.children,c=a.parent.children,d=a.i?c[a.i-1]:null;if(b.length){Ce(a);var f=(b[0].z+b[b.length-1].z)/2;d?(a.z=d.z+h(a._,d._),a.m=a.z-f):a.z=f}else d&&(a.z=d.z+h(a._,d._));a.parent.A=e(a,d,a.parent.A||c[0])}function d(a){a._.x=a.z+a.parent.m,a.m+=a.parent.m}function e(a,b,c){if(b){for(var d,e=a,f=a,g=b,i=e.parent.children[0],j=e.m,k=f.m,l=g.m,m=i.m;g=Ae(g),e=ze(e),g&&e;)i=ze(i),f=Ae(f),f.a=a,d=g.z+l-e.z-j+h(g._,e._),d>0&&(Be(De(g,a,c),a,d),j+=d,k+=d),l+=g.m,j+=e.m,m+=i.m,k+=f.m;g&&!Ae(f)&&(f.t=g,f.m+=l-k),e&&!ze(i)&&(i.t=e,i.m+=j-m,c=a)}return c}function f(a){a.x*=i[0],a.y=a.depth*i[1]}var g=bg.layout.hierarchy().sort(null).value(null),h=ye,i=[1,1],j=null;return a.separation=function(b){return arguments.length?(h=b,a):h},a.size=function(b){return arguments.length?(j=null==(i=b)?f:null,a):j?null:i},a.nodeSize=function(b){return arguments.length?(j=null==(i=b)?null:f,a):j?i:null},Zd(a,g)},bg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;_d(i,function(a){var b=a.children;b&&b.length?(a.x=Fe(b),a.y=Ee(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Ge(i),l=He(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return _d(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=bg.layout.hierarchy().sort(null).value(null),c=ye,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},Zd(a,b)},bg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++e<f;)d=(c=a[e]).value*(0>b?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++g<h;)(c=a[g].area)&&(f>c&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++f<g;)e=a[f],e.x=h,e.y=j,e.dy=k,h+=e.dx=Math.min(c.x+c.dx-h,k?i(e.area/k):0);e.z=!0,e.dx+=c.x+c.dx-h,c.y+=k,c.dy-=k}else{for((d||k>c.dx)&&(k=c.dx);++f<g;)e=a[f],e.x=h,e.y=j,e.dx=k,j+=e.dy=Math.min(c.y+c.dy-j,k?i(e.area/k):0);e.z=!1,e.dy+=c.y+c.dy-j,c.x+=k,c.dx-=k}}function f(d){var e=g||h(d),f=e[0];return f.x=0,f.y=0,f.dx=j[0],f.dy=j[1],g&&h.revalue(f),a([f],f.dx*f.dy/f.value),(g?c:b)(f),m&&(g=e),e}var g,h=bg.layout.hierarchy(),i=Math.round,j=[1,1],k=null,l=Ie,m=!1,n="squarify",o=.5*(1+Math.sqrt(5));return f.size=function(a){ 17 return arguments.length?(j=a,f):j},f.padding=function(a){function b(b){var c=a.call(f,b,b.depth);return null==c?Ie(b):Je(b,"number"==typeof c?[c,c,c,c]:c)}function c(b){return Je(b,a)}if(!arguments.length)return k;var d;return l=null==(k=a)?Ie:"function"==(d=typeof a)?b:"number"===d?(a=[a,a,a,a],c):c,f},f.round=function(a){return arguments.length?(i=a?Math.round:Number,f):i!=Number},f.sticky=function(a){return arguments.length?(m=a,g=null,f):m},f.ratio=function(a){return arguments.length?(o=a,f):o},f.mode=function(a){return arguments.length?(n=a+"",f):n},Zd(f,h)},bg.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=bg.random.normal.apply(bg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=bg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},bg.scale={};var ri={floor:s,ceil:s};bg.scale.linear=function(){return Qe([0,1],[0,1],rd,!1)};var si={s:1,g:1,p:1,r:1,e:1};bg.scale.log=function(){return Ye(bg.scale.linear().domain([0,1]),10,!0,[1,10])};var ti=bg.format(".0e"),ui={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};bg.scale.pow=function(){return Ze(bg.scale.linear(),1,[0,1])},bg.scale.sqrt=function(){return bg.scale.pow().exponent(.5)},bg.scale.ordinal=function(){return _e([],{t:"range",a:[[]]})},bg.scale.category10=function(){return bg.scale.ordinal().range(vi)},bg.scale.category20=function(){return bg.scale.ordinal().range(wi)},bg.scale.category20b=function(){return bg.scale.ordinal().range(xi)},bg.scale.category20c=function(){return bg.scale.ordinal().range(yi)};var vi=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ta),wi=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ta),xi=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ta),yi=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ta);bg.scale.quantile=function(){return af([],[])},bg.scale.quantize=function(){return bf(0,1,[0,1])},bg.scale.threshold=function(){return cf([.5],[0,1])},bg.scale.identity=function(){return df([0,1])},bg.svg={},bg.svg.arc=function(){function a(){var a=Math.max(0,+c.apply(this,arguments)),j=Math.max(0,+d.apply(this,arguments)),k=g.apply(this,arguments)-Ig,l=h.apply(this,arguments)-Ig,m=Math.abs(l-k),n=k>l?0:1;if(a>j&&(o=j,j=a,a=o),m>=Hg)return b(j,n)+(a?b(a,1-n):"")+"Z";var o,p,q,r,s,t,u,v,w,x,y,z,A=0,B=0,C=[];if((r=(+i.apply(this,arguments)||0)/2)&&(q=f===zi?Math.sqrt(a*a+j*j):+f.apply(this,arguments),n||(B*=-1),j&&(B=ba(q/j*Math.sin(r))),a&&(A=ba(q/a*Math.sin(r)))),j){s=j*Math.cos(k+B),t=j*Math.sin(k+B),u=j*Math.cos(l-B),v=j*Math.sin(l-B);var D=Math.abs(l-k-2*B)<=Fg?0:1;if(B&&lf(s,t,u,v)===n^D){var E=(k+l)/2;s=j*Math.cos(E),t=j*Math.sin(E),u=v=null}}else s=t=0;if(a){w=a*Math.cos(l-A),x=a*Math.sin(l-A),y=a*Math.cos(k+A),z=a*Math.sin(k+A);var F=Math.abs(k-l+2*A)<=Fg?0:1;if(A&&lf(w,x,y,z)===1-n^F){var G=(k+l)/2;w=a*Math.cos(G),x=a*Math.sin(G),y=z=null}}else w=x=0;if((o=Math.min(Math.abs(j-a)/2,+e.apply(this,arguments)))>.001){p=j>a^n?0:1;var H=null==y?[w,x]:null==u?[s,t]:Gc([s,t],[y,z],[u,v],[w,x]),I=s-H[0],J=t-H[1],K=u-H[0],L=v-H[1],M=1/Math.sin(Math.acos((I*K+J*L)/(Math.sqrt(I*I+J*J)*Math.sqrt(K*K+L*L)))/2),N=Math.sqrt(H[0]*H[0]+H[1]*H[1]);if(null!=u){var O=Math.min(o,(j-N)/(M+1)),P=mf(null==y?[w,x]:[y,z],[s,t],j,O,n),Q=mf([u,v],[w,x],j,O,n);o===O?C.push("M",P[0],"A",O,",",O," 0 0,",p," ",P[1],"A",j,",",j," 0 ",1-n^lf(P[1][0],P[1][1],Q[1][0],Q[1][1]),",",n," ",Q[1],"A",O,",",O," 0 0,",p," ",Q[0]):C.push("M",P[0],"A",O,",",O," 0 1,",p," ",Q[0])}else C.push("M",s,",",t);if(null!=y){var R=Math.min(o,(a-N)/(M-1)),S=mf([s,t],[y,z],a,-R,n),T=mf([w,x],null==u?[s,t]:[u,v],a,-R,n);o===R?C.push("L",T[0],"A",R,",",R," 0 0,",p," ",T[1],"A",a,",",a," 0 ",n^lf(T[1][0],T[1][1],S[1][0],S[1][1]),",",1-n," ",S[1],"A",R,",",R," 0 0,",p," ",S[0]):C.push("L",T[0],"A",R,",",R," 0 0,",p," ",S[0])}else C.push("L",w,",",x)}else C.push("M",s,",",t),null!=u&&C.push("A",j,",",j," 0 ",D,",",n," ",u,",",v),C.push("L",w,",",x),null!=y&&C.push("A",a,",",a," 0 ",F,",",1-n," ",y,",",z);return C.push("Z"),C.join("")}function b(a,b){return"M0,"+a+"A"+a+","+a+" 0 1,"+b+" 0,"+-a+"A"+a+","+a+" 0 1,"+b+" 0,"+a}var c=ff,d=gf,e=ef,f=zi,g=hf,h=jf,i=kf;return a.innerRadius=function(b){return arguments.length?(c=Aa(b),a):c},a.outerRadius=function(b){return arguments.length?(d=Aa(b),a):d},a.cornerRadius=function(b){return arguments.length?(e=Aa(b),a):e},a.padRadius=function(b){return arguments.length?(f=b==zi?zi:Aa(b),a):f},a.startAngle=function(b){return arguments.length?(g=Aa(b),a):g},a.endAngle=function(b){return arguments.length?(h=Aa(b),a):h},a.padAngle=function(b){return arguments.length?(i=Aa(b),a):i},a.centroid=function(){var a=(+c.apply(this,arguments)+ +d.apply(this,arguments))/2,b=(+g.apply(this,arguments)+ +h.apply(this,arguments))/2-Ig;return[Math.cos(b)*a,Math.sin(b)*a]},a};var zi="auto";bg.svg.line=function(){return nf(s)};var Ai=bg.map({linear:of,"linear-closed":pf,step:qf,"step-before":rf,"step-after":sf,basis:yf,"basis-open":zf,"basis-closed":Af,bundle:Bf,cardinal:vf,"cardinal-open":tf,"cardinal-closed":uf,monotone:Hf});Ai.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var Bi=[0,2/3,1/3,0],Ci=[0,1/3,2/3,0],Di=[0,1/6,2/3,1/6];bg.svg.line.radial=function(){var a=nf(If);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},rf.reverse=sf,sf.reverse=rf,bg.svg.area=function(){return Jf(s)},bg.svg.area.radial=function(){var a=Jf(If);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},bg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)-Ig,k=j.call(a,e,d)-Ig;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Fg)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=rc,g=sc,h=Kf,i=hf,j=jf;return a.radius=function(b){return arguments.length?(h=Aa(b),a):h},a.source=function(b){return arguments.length?(f=Aa(b),a):f},a.target=function(b){return arguments.length?(g=Aa(b),a):g},a.startAngle=function(b){return arguments.length?(i=Aa(b),a):i},a.endAngle=function(b){return arguments.length?(j=Aa(b),a):j},a},bg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=rc,c=sc,d=Lf;return a.source=function(c){return arguments.length?(b=Aa(c),a):b},a.target=function(b){return arguments.length?(c=Aa(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},bg.svg.diagonal.radial=function(){var a=bg.svg.diagonal(),b=Lf,c=a.projection;return a.projection=function(a){return arguments.length?c(Mf(b=a)):b},a},bg.svg.symbol=function(){function a(a,d){return(Ei.get(b.call(this,a,d))||Pf)(c.call(this,a,d))}var b=Of,c=Nf;return a.type=function(c){return arguments.length?(b=Aa(c),a):b},a.size=function(b){return arguments.length?(c=Aa(b),a):c},a};var Ei=bg.map({circle:Pf,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Gi)),c=b*Gi;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Fi),c=b*Fi/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Fi),c=b*Fi/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});bg.svg.symbolTypes=Ei.keys();var Fi=Math.sqrt(3),Gi=Math.tan(30*Jg);wg.transition=function(a){for(var b,c,d=Hi||++Li,e=Uf(a),f=[],g=Ii||{time:Date.now(),ease:yd,delay:0,duration:250},h=-1,i=this.length;++h<i;){f.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(c=j[k])&&Vf(c,k,e,d,g),b.push(c)}return Rf(f,e,d)},wg.interrupt=function(a){return this.each(null==a?Ji:Qf(Uf(a)))};var Hi,Ii,Ji=Qf(Uf()),Ki=[],Li=0;Ki.call=wg.call,Ki.empty=wg.empty,Ki.node=wg.node,Ki.size=wg.size,bg.transition=function(a,b){return a&&a.transition?Hi?a.transition(b):a:bg.selection().transition(a)},bg.transition.prototype=Ki,Ki.select=function(a){var b,c,d,e=this.id,f=this.namespace,g=[];a=C(a);for(var h=-1,i=this.length;++h<i;){g.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(d=j[k])&&(c=a.call(d,d.__data__,k,h))?("__data__"in d&&(c.__data__=d.__data__),Vf(c,k,f,e,d[f][e]),b.push(c)):b.push(null)}return Rf(g,f,e)},Ki.selectAll=function(a){var b,c,d,e,f,g=this.id,h=this.namespace,i=[];a=D(a);for(var j=-1,k=this.length;++j<k;)for(var l=this[j],m=-1,n=l.length;++m<n;)if(d=l[m]){f=d[h][g],c=a.call(d,d.__data__,m,j),i.push(b=[]);for(var o=-1,p=c.length;++o<p;)(e=c[o])&&Vf(e,o,h,g,f),b.push(e)}return Rf(i,h,g)},Ki.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=P(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return Rf(e,this.namespace,this.id)},Ki.tween=function(a,b){var c=this.id,d=this.namespace;return arguments.length<2?this.node()[d][c].tween.get(a):R(this,null==b?function(b){b[d][c].tween.remove(a)}:function(e){e[d][c].tween.set(a,b)})},Ki.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?Od:rd,h=bg.ns.qualify(a);return Sf(this,"attr."+a,b,h.local?f:e)},Ki.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=bg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Ki.style=function(a,c,d){function e(){this.style.removeProperty(a)}function f(c){return null==c?e:(c+="",function(){var e,f=b(this).getComputedStyle(this,null).getPropertyValue(a);return f!==c&&(e=rd(f,c),function(b){this.style.setProperty(a,e(b),d)})})}var g=arguments.length;if(3>g){if("string"!=typeof a){2>g&&(c="");for(d in a)this.style(d,a[d],c);return this}d=""}return Sf(this,"style."+a,c,f)},Ki.styleTween=function(a,c,d){function e(e,f){var g=c.call(this,e,f,b(this).getComputedStyle(this,null).getPropertyValue(a));return g&&function(b){this.style.setProperty(a,g(b),d)}}return arguments.length<3&&(d=""),this.tween("style."+a,e)},Ki.text=function(a){return Sf(this,"text",a,Tf)},Ki.remove=function(){var a=this.namespace;return this.each("end.transition",function(){var b;this[a].count<2&&(b=this.parentNode)&&b.removeChild(this)})},Ki.ease=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].ease:("function"!=typeof a&&(a=bg.ease.apply(bg,arguments)),R(this,function(d){d[c][b].ease=a}))},Ki.delay=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].delay:R(this,"function"==typeof a?function(d,e,f){d[c][b].delay=+a.call(d,d.__data__,e,f)}:(a=+a,function(d){d[c][b].delay=a}))},Ki.duration=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].duration:R(this,"function"==typeof a?function(d,e,f){d[c][b].duration=Math.max(1,a.call(d,d.__data__,e,f))}:(a=Math.max(1,a),function(d){d[c][b].duration=a}))},Ki.each=function(a,b){var c=this.id,d=this.namespace;if(arguments.length<2){var e=Ii,f=Hi;try{Hi=c,R(this,function(b,e,f){Ii=b[d][c],a.call(b,b.__data__,e,f)})}finally{Ii=e,Hi=f}}else R(this,function(e){var f=e[d][c];(f.event||(f.event=bg.dispatch("start","end","interrupt"))).on(a,b)});return this},Ki.transition=function(){for(var a,b,c,d,e=this.id,f=++Li,g=this.namespace,h=[],i=0,j=this.length;j>i;i++){h.push(a=[]);for(var b=this[i],k=0,l=b.length;l>k;k++)(c=b[k])&&(d=c[g][e],Vf(c,k,g,f,{time:d.time,ease:d.ease,delay:d.delay+d.duration,duration:d.duration})),a.push(c)}return Rf(h,g,f)},bg.svg.axis=function(){function a(a){a.each(function(){var a,j=bg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):s:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Dg),q=bg.transition(o.exit()).style("opacity",Dg).remove(),r=bg.transition(o.order()).style("opacity",1),t=Math.max(e,0)+g,u=Le(l),v=j.selectAll(".domain").data([0]),w=(v.enter().append("path").attr("class","domain"),bg.transition(v));p.append("line"),p.append("text");var x,y,z,A,B=p.select("line"),C=r.select("line"),D=o.select("text").text(n),E=p.select("text"),F=r.select("text"),G="top"===d||"left"===d?-1:1;if("bottom"===d||"top"===d?(a=Wf,x="x",z="y",y="x2",A="y2",D.attr("dy",0>G?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+u[0]+","+G*f+"V0H"+u[1]+"V"+G*f)):(a=Xf,x="y",z="x",y="y2",A="x2",D.attr("dy",".32em").style("text-anchor",0>G?"end":"start"),w.attr("d","M"+G*f+","+u[0]+"H0V"+u[1]+"H"+G*f)),B.attr(A,G*e),E.attr(z,G*t),C.attr(y,0).attr(A,G*e),F.attr(x,0).attr(z,G*t),l.rangeBand){var H=l,I=H.rangeBand()/2;k=l=function(a){return H(a)+I}}else k.rangeBand?k=l:q.call(a,l,k);p.call(a,k,l),r.call(a,l,l)})}var b,c=bg.scale.linear(),d=Mi,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Ni?b+"":Mi,a):d},a.ticks=function(){return arguments.length?(h=arguments,a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Mi="bottom",Ni={top:1,right:1,bottom:1,left:1};bg.svg.brush=function(){function a(b){b.each(function(){var b=bg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",f).on("touchstart.brush",f),g=b.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),b.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=b.selectAll(".resize").data(p,s);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Oi[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var i,l=bg.transition(b),m=bg.transition(g);j&&(i=Le(j),m.attr("x",i[0]).attr("width",i[1]-i[0]),d(l)),k&&(i=Le(k),m.attr("y",i[0]).attr("height",i[1]-i[0]),e(l)),c(l)})}function c(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+l[+/e$/.test(a)]+","+m[+/^s/.test(a)]+")"})}function d(a){a.select(".extent").attr("x",l[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function e(a){a.select(".extent").attr("y",m[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function f(){function f(){32==bg.event.keyCode&&(D||(t=null,F[0]-=l[1],F[1]-=m[1],D=2),y())}function p(){32==bg.event.keyCode&&2==D&&(F[0]+=l[1],F[1]+=m[1],D=0,y())}function q(){var a=bg.mouse(v),b=!1;u&&(a[0]+=u[0],a[1]+=u[1]),D||(bg.event.altKey?(t||(t=[(l[0]+l[1])/2,(m[0]+m[1])/2]),F[0]=l[+(a[0]<t[0])],F[1]=m[+(a[1]<t[1])]):t=null),B&&r(a,j,0)&&(d(z),b=!0),C&&r(a,k,1)&&(e(z),b=!0),b&&(c(z),x({type:"brush",mode:D?"move":"resize"}))}function r(a,b,c){var d,e,f=Le(b),i=f[0],j=f[1],k=F[c],p=c?m:l,q=p[1]-p[0];return D&&(i-=k,j-=q+k),d=(c?o:n)?Math.max(i,Math.min(j,a[c])):a[c],D?e=(d+=k)+q:(t&&(k=Math.max(i,Math.min(j,2*t[c]-d))),d>k?(e=d,d=k):e=k),p[0]!=d||p[1]!=e?(c?h=null:g=null,p[0]=d,p[1]=e,!0):void 0}function s(){q(),z.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),bg.select("body").style("cursor",null),G.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),E(),x({type:"brushend"})}var t,u,v=this,w=bg.select(bg.event.target),x=i.of(v,arguments),z=bg.select(v),A=w.datum(),B=!/^(n|s)$/.test(A)&&j,C=!/^(e|w)$/.test(A)&&k,D=w.classed("extent"),E=X(v),F=bg.mouse(v),G=bg.select(b(v)).on("keydown.brush",f).on("keyup.brush",p);if(bg.event.changedTouches?G.on("touchmove.brush",q).on("touchend.brush",s):G.on("mousemove.brush",q).on("mouseup.brush",s),z.interrupt().selectAll("*").interrupt(),D)F[0]=l[0]-F[0],F[1]=m[0]-F[1];else if(A){var H=+/w$/.test(A),I=+/^n/.test(A);u=[l[1-H]-F[0],m[1-I]-F[1]],F[0]=l[H],F[1]=m[I]}else bg.event.altKey&&(t=F.slice());z.style("pointer-events","none").selectAll(".resize").style("display",null),bg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),q()}var g,h,i=A(a,"brushstart","brush","brushend"),j=null,k=null,l=[0,0],m=[0,0],n=!0,o=!0,p=Pi[0];return a.event=function(a){a.each(function(){var a=i.of(this,arguments),b={x:l,y:m,i:g,j:h},c=this.__chart__||b;this.__chart__=b,Hi?bg.select(this).transition().each("start.brush",function(){g=c.i,h=c.j,l=c.x,m=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=sd(l,b.x),d=sd(m,b.y);return g=h=null,function(e){l=b.x=c(e),m=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){g=b.i,h=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(j=b,p=Pi[!j<<1|!k],a):j},a.y=function(b){return arguments.length?(k=b,p=Pi[!j<<1|!k],a):k},a.clamp=function(b){return arguments.length?(j&&k?(n=!!b[0],o=!!b[1]):j?n=!!b:k&&(o=!!b),a):j&&k?[n,o]:j?n:k?o:null},a.extent=function(b){var c,d,e,f,i;return arguments.length?(j&&(c=b[0],d=b[1],k&&(c=c[0],d=d[0]),g=[c,d],j.invert&&(c=j(c),d=j(d)),c>d&&(i=c,c=d,d=i),c==l[0]&&d==l[1]||(l=[c,d])),k&&(e=b[0],f=b[1],j&&(e=e[1],f=f[1]),h=[e,f],k.invert&&(e=k(e),f=k(f)),e>f&&(i=e,e=f,f=i),e==m[0]&&f==m[1]||(m=[e,f])),a):(j&&(g?(c=g[0],d=g[1]):(c=l[0],d=l[1],j.invert&&(c=j.invert(c),d=j.invert(d)),c>d&&(i=c,c=d,d=i))),k&&(h?(e=h[0],f=h[1]):(e=m[0],f=m[1],k.invert&&(e=k.invert(e),f=k.invert(f)),e>f&&(i=e,e=f,f=i))),j&&k?[[c,e],[d,f]]:j?[c,d]:k&&[e,f])},a.clear=function(){return a.empty()||(l=[0,0],m=[0,0],g=h=null),a},a.empty=function(){return!!j&&l[0]==l[1]||!!k&&m[0]==m[1]},bg.rebind(a,i,"on")};var Oi={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Pi=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Qi=hh.format=nh.timeFormat,Ri=Qi.utc,Si=Ri("%Y-%m-%dT%H:%M:%S.%LZ");Qi.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Yf:Si,Yf.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Yf.toString=Si.toString,hh.second=Na(function(a){return new ih(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),hh.seconds=hh.second.range,hh.seconds.utc=hh.second.utc.range,hh.minute=Na(function(a){return new ih(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),hh.minutes=hh.minute.range,hh.minutes.utc=hh.minute.utc.range,hh.hour=Na(function(a){var b=a.getTimezoneOffset()/60;return new ih(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),hh.hours=hh.hour.range,hh.hours.utc=hh.hour.utc.range,hh.month=Na(function(a){return a=hh.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),hh.months=hh.month.range,hh.months.utc=hh.month.utc.range;var Ti=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ui=[[hh.second,1],[hh.second,5],[hh.second,15],[hh.second,30],[hh.minute,1],[hh.minute,5],[hh.minute,15],[hh.minute,30],[hh.hour,1],[hh.hour,3],[hh.hour,6],[hh.hour,12],[hh.day,1],[hh.day,2],[hh.week,1],[hh.month,1],[hh.month,3],[hh.year,1]],Vi=Qi.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Cb]]),Wi={range:function(a,b,c){return bg.range(Math.ceil(a/c)*c,+b,c).map($f)},floor:s,ceil:s};Ui.year=hh.year,hh.scale=function(){return Zf(bg.scale.linear(),Ui,Vi)};var Xi=Ui.map(function(a){return[a[0].utc,a[1]]}),Yi=Ri.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Cb]]);Xi.year=hh.year.utc,hh.scale.utc=function(){return Zf(bg.scale.linear(),Xi,Yi)},bg.text=Ba(function(a){return a.responseText}),bg.json=function(a,b){return Ca(a,"application/json",_f,b)},bg.html=function(a,b){return Ca(a,"text/html",ag,b)},bg.xml=Ba(function(a){return a.responseXML}),"function"==typeof define&&define.amd?define(bg):"object"==typeof module&&module.exports&&(module.exports=bg),this.d3=bg}(),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Hc.apply(null,arguments)}function b(a){Hc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ca(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a);a._isValid=!(isNaN(a._d.getTime())||!(b.overflow<0)||b.empty||b.invalidMonth||b.invalidWeekday||b.nullInput||b.invalidFormat||b.userInvalidated),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=j(b)),"undefined"!=typeof b._locale&&(a._locale=b._locale),Jc.length>0)for(c in Jc)d=Jc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Kc===!1&&(Kc=!0,a.updateOffset(this),Kc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f<a.length;){for(e=t(a[f]).split("-"),b=e.length,c=t(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Lc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ic._abbr,require("./locale/"+a),w(b)}catch(c){}return Lc[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Ic=c)),Ic._abbr}function x(a,b){return null!==b?(b.abbr=a,Lc[a]=Lc[a]||new s,Lc[a].set(b),w(a),Lc[a]):(delete Lc[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ic;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Mc[c]=Mc[c+"s"]=Mc[b]=a}function A(a){return"string"==typeof a?Mc[a]||Mc[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Qc[a]=e),b&&(Qc[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Qc[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Nc);for(b=0,c=d.length;c>b;b++)Qc[d[b]]?d[b]=Qc[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Pc[b]=Pc[b]||J(b),Pc[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Oc.lastIndex=0;d>=0&&Oc.test(a);)a=a.replace(Oc,c),Oc.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){dd[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(dd,a)?dd[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;c<a.length;c++)ed[a[c]]=d}function R(a,b){Q(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function S(a,b,c){null!=b&&f(ed,a)&&ed[a](b,c._a,c,a)}function T(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function U(a){return this._months[a.month()]}function V(a){return this._monthsShort[a.month()]}function W(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[gd]<0||c[gd]>11?gd:c[hd]<1||c[hd]>T(c[fd],c[gd])?hd:c[id]<0||c[id]>24||24===c[id]&&(0!==c[jd]||0!==c[kd]||0!==c[ld])?id:c[jd]<0||c[jd]>59?jd:c[kd]<0||c[kd]>59?kd:c[ld]<0||c[ld]>999?ld:-1,j(a)._overflowDayOfYear&&(fd>b||b>hd)&&(b=hd),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){od[a]||(_(b),od[a]=!0)}function ca(a){var b,c,d=a._i,e=pd.exec(d);if(e){for(j(a).iso=!0,b=0,c=qd.length;c>b;b++)if(qd[b][1].exec(d)){a._f=qd[b][0];break}for(b=0,c=rd.length;c>b;b++)if(rd[b][1].exec(d)){a._f+=(e[6]||" ")+rd[b][0];break}d.match(ad)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=sd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[hd]&&null==a._a[gd]&&ua(a),a._dayOfYear&&(e=ra(a._a[fd],d[fd]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[gd]=c.getUTCMonth(),a._a[hd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b]; 18 24===a._a[id]&&0===a._a[jd]&&0===a._a[kd]&&0===a._a[ld]&&(a._nextDay=!0,a._a[id]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[id]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[fd],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[fd],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[fd]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Nc)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(O(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Qc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[id]<=12&&b._a[id]>0&&(j(b).bigHour=void 0),b._a[id]=wa(b._locale,b._a[id],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=m({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],va(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}function Fa(){var a=[].slice.call(arguments,0);return Ea("isBefore",a)}function Ga(){var a=[].slice.call(arguments,0);return Ea("isAfter",a)}function Ha(a){var b=B(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=y(),this._bubble()}function Ia(a){return a instanceof Ha}function Ja(a,b){H(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(ad)||[],c=b[b.length-1]||[],d=(c+"").match(xd)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=yd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[hd])*c,h:q(h[id])*c,m:q(h[jd])*c,s:q(h[kd])*c,ms:q(h[ld])*c}):(h=zd.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)<c)}function gb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function hb(a,b){var c;return b=A(b||"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this===+a):(c=+Da(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))}function ib(a,b,c){var d,e,f=La(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=A(b),"year"===b||"month"===b||"quarter"===b?(e=jb(this,f),"quarter"===b?e/=3:"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:p(e)}function jb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():K(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):K(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function mb(b){var c=K(this,b||a.defaultFormat);return this.localeData().postformat(c)}function nb(a,b){return this.isValid()?Ya({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ob(a){return this.from(Da(),a)}function pb(a,b){return this.isValid()?Ya({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function qb(a){return this.to(Da(),a)}function rb(a){var b;return void 0===a?this._locale._abbr:(b=y(a),null!=b&&(this._locale=b),this)}function sb(){return this._locale}function tb(a){switch(a=A(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function ub(a){return a=A(a),void 0===a||"millisecond"===a?this:this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")}function vb(){return+this._d-6e4*(this._offset||0)}function wb(){return Math.floor(+this/1e3)}function xb(){return this._offset?new Date(+this):this._d}function yb(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function zb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Ab(){return k(this)}function Bb(){return g({},j(this))}function Cb(){return j(this).overflow}function Db(a,b){H(0,[a,a.length],0,b)}function Eb(a,b,c){return ja(Da([a,11,31+b-c]),b,c).week}function Fb(a){var b=ja(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")}function Gb(a){var b=ja(this,1,4).year;return null==a?b:this.add(a-b,"y")}function Hb(){return Eb(this.year(),1,4)}function Ib(){var a=this.localeData()._week;return Eb(this.year(),a.dow,a.doy)}function Jb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Kb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Lb(a){return this._weekdays[a.day()]}function Mb(a){return this._weekdaysShort[a.day()]}function Nb(a){return this._weekdaysMin[a.day()]}function Ob(a){var b,c,d;for(this._weekdaysParse=this._weekdaysParse||[],b=0;7>b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[ld]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=Wd(this._milliseconds),this._days=Wd(this._days),this._months=Wd(this._months),a.milliseconds=Wd(a.milliseconds),a.seconds=Wd(a.seconds),a.minutes=Wd(a.minutes),a.hours=Wd(a.hours),a.months=Wd(a.months),a.years=Wd(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=ke(d.as("s")),f=ke(d.as("m")),g=ke(d.as("h")),h=ke(d.as("d")),i=ke(d.as("M")),j=ke(d.as("y")),k=e<le.s&&["s",e]||1===f&&["m"]||f<le.m&&["mm",f]||1===g&&["h"]||g<le.h&&["hh",g]||1===h&&["d"]||h<le.d&&["dd",h]||1===i&&["M"]||i<le.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===le[a]?!1:void 0===b?le[a]:(le[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=me(this._milliseconds)/1e3,e=me(this._days),f=me(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Hc,Ic,Jc=a.momentProperties=[],Kc=!1,Lc={},Mc={},Nc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pc={},Qc={},Rc=/\d/,Sc=/\d\d/,Tc=/\d{3}/,Uc=/\d{4}/,Vc=/[+-]?\d{6}/,Wc=/\d\d?/,Xc=/\d{1,3}/,Yc=/\d{1,4}/,Zc=/[+-]?\d{1,6}/,$c=/\d+/,_c=/[+-]?\d+/,ad=/Z|[+-]\d\d:?\d\d/gi,bd=/[+-]?\d+(\.\d{1,3})?/,cd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,dd={},ed={},fd=0,gd=1,hd=2,id=3,jd=4,kd=5,ld=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",Wc),N("MM",Wc,Sc),N("MMM",cd),N("MMMM",cd),Q(["M","MM"],function(a,b){b[gd]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[gd]=e:j(c).invalidMonth=a});var md="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),nd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),od={};a.suppressDeprecationWarnings=!1;var pd=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],rd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],sd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",_c),N("YY",Wc,Sc),N("YYYY",Yc,Uc),N("YYYYY",Zc,Vc),N("YYYYYY",Zc,Vc),Q(["YYYYY","YYYYYY"],fd),Q("YYYY",function(b,c){c[fd]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[fd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var td=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",Wc),N("ww",Wc,Sc),N("W",Wc),N("WW",Wc,Sc),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ud={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",Xc),N("DDDD",Tc),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var vd=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),wd=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",ad),N("ZZ",ad),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var xd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var yd=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,zd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Ad=ab(1,"add"),Bd=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Cd=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",_c),N("g",_c),N("GG",Wc,Sc),N("gg",Wc,Sc),N("GGGG",Yc,Uc),N("gggg",Yc,Uc),N("GGGGG",Zc,Vc),N("ggggg",Zc,Vc),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Rc),Q("Q",function(a,b){b[gd]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",Wc),N("DD",Wc,Sc),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],hd),Q("Do",function(a,b){b[hd]=q(a.match(Wc)[0],10)});var Dd=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",Wc),N("e",Wc),N("E",Wc),N("dd",cd),N("ddd",cd),N("dddd",cd),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Ed="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",Wc),N("h",Wc),N("HH",Wc,Sc),N("hh",Wc,Sc),Q(["H","HH"],id),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[id]=q(a),j(c).bigHour=!0});var Hd=/[ap]\.?m?\.?/i,Id=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",Wc),N("mm",Wc,Sc),Q(["m","mm"],jd);var Jd=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",Wc),N("ss",Wc,Sc),Q(["s","ss"],kd);var Kd=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",Xc,Rc),N("SS",Xc,Sc),N("SSS",Xc,Tc);var Ld;for(Ld="SSSS";Ld.length<=9;Ld+="S")N(Ld,$c);for(Ld="S";Ld.length<=9;Ld+="S")Q(Ld,Wb);var Md=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Nd=n.prototype;Nd.add=Ad,Nd.calendar=cb,Nd.clone=db,Nd.diff=ib,Nd.endOf=ub,Nd.format=mb,Nd.from=nb,Nd.fromNow=ob,Nd.to=pb,Nd.toNow=qb,Nd.get=F,Nd.invalidAt=Cb,Nd.isAfter=eb,Nd.isBefore=fb,Nd.isBetween=gb,Nd.isSame=hb,Nd.isValid=Ab,Nd.lang=Cd,Nd.locale=rb,Nd.localeData=sb,Nd.max=wd,Nd.min=vd,Nd.parsingFlags=Bb,Nd.set=F,Nd.startOf=tb,Nd.subtract=Bd,Nd.toArray=yb,Nd.toObject=zb,Nd.toDate=xb,Nd.toISOString=lb,Nd.toJSON=lb,Nd.toString=kb,Nd.unix=wb,Nd.valueOf=vb,Nd.year=td,Nd.isLeapYear=ia,Nd.weekYear=Fb,Nd.isoWeekYear=Gb,Nd.quarter=Nd.quarters=Jb,Nd.month=Y,Nd.daysInMonth=Z,Nd.week=Nd.weeks=na,Nd.isoWeek=Nd.isoWeeks=oa,Nd.weeksInYear=Ib,Nd.isoWeeksInYear=Hb,Nd.date=Dd,Nd.day=Nd.days=Pb,Nd.weekday=Qb,Nd.isoWeekday=Rb,Nd.dayOfYear=qa,Nd.hour=Nd.hours=Id,Nd.minute=Nd.minutes=Jd,Nd.second=Nd.seconds=Kd,Nd.millisecond=Nd.milliseconds=Md,Nd.utcOffset=Na,Nd.utc=Pa,Nd.local=Qa,Nd.parseZone=Ra,Nd.hasAlignedHourOffset=Sa,Nd.isDST=Ta,Nd.isDSTShifted=Ua,Nd.isLocal=Va,Nd.isUtcOffset=Wa,Nd.isUtc=Xa,Nd.isUTC=Xa,Nd.zoneAbbr=Xb,Nd.zoneName=Yb,Nd.dates=aa("dates accessor is deprecated. Use date instead.",Dd),Nd.months=aa("months accessor is deprecated. Use month instead",Y),Nd.years=aa("years accessor is deprecated. Use year instead",td),Nd.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Od=Nd,Pd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Qd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Rd="Invalid date",Sd="%d",Td=/\d{1,2}/,Ud={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Vd=s.prototype;Vd._calendar=Pd,Vd.calendar=_b,Vd._longDateFormat=Qd,Vd.longDateFormat=ac,Vd._invalidDate=Rd,Vd.invalidDate=bc,Vd._ordinal=Sd,Vd.ordinal=cc,Vd._ordinalParse=Td,Vd.preparse=dc,Vd.postformat=dc,Vd._relativeTime=Ud,Vd.relativeTime=ec,Vd.pastFuture=fc,Vd.set=gc,Vd.months=U,Vd._months=md,Vd.monthsShort=V,Vd._monthsShort=nd,Vd.monthsParse=W,Vd.week=ka,Vd._week=ud,Vd.firstDayOfYear=ma,Vd.firstDayOfWeek=la,Vd.weekdays=Lb,Vd._weekdays=Ed,Vd.weekdaysMin=Nb,Vd._weekdaysMin=Gd,Vd.weekdaysShort=Mb,Vd._weekdaysShort=Fd,Vd.weekdaysParse=Ob,Vd.isPM=Ub,Vd._meridiemParse=Hd,Vd.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var Wd=Math.abs,Xd=yc("ms"),Yd=yc("s"),Zd=yc("m"),$d=yc("h"),_d=yc("d"),ae=yc("w"),be=yc("M"),ce=yc("y"),de=Ac("milliseconds"),ee=Ac("seconds"),fe=Ac("minutes"),ge=Ac("hours"),he=Ac("days"),ie=Ac("months"),je=Ac("years"),ke=Math.round,le={s:45,m:45,h:22,d:26,M:11},me=Math.abs,ne=Ha.prototype;ne.abs=oc,ne.add=qc,ne.subtract=rc,ne.as=wc,ne.asMilliseconds=Xd,ne.asSeconds=Yd,ne.asMinutes=Zd,ne.asHours=$d,ne.asDays=_d,ne.asWeeks=ae,ne.asMonths=be,ne.asYears=ce,ne.valueOf=xc,ne._bubble=tc,ne.get=zc,ne.milliseconds=de,ne.seconds=ee,ne.minutes=fe,ne.hours=ge,ne.days=he,ne.weeks=Bc,ne.months=ie,ne.years=je,ne.humanize=Fc,ne.toISOString=Gc,ne.toString=Gc,ne.toJSON=Gc,ne.locale=rb,ne.localeData=sb,ne.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),ne.lang=Cd,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",_c),N("X",bd),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}),a.version="2.10.6",b(Da),a.fn=Od,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var oe=a;return oe}),function(a){"function"==typeof define&&define.amd?define(["jquery","moment"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("moment")):a(jQuery,moment)}(function(a,b){function c(a){return Q(a,Oa)}function d(b){var c,d={views:b.views||{}};return a.each(b,function(b,e){"views"!=b&&(a.isPlainObject(e)&&!/(time|duration|interval)$/i.test(b)&&-1==a.inArray(b,Oa)?(c=null,a.each(e,function(a,e){/^(month|week|day|default|basic(Week|Day)?|agenda(Week|Day)?)$/.test(a)?(d.views[a]||(d.views[a]={}),d.views[a][b]=e):(c||(c={}),c[a]=e)}),c&&(d[b]=c)):d[b]=e)}),d}function e(a,b){b.left&&a.css({"border-left-width":1,"margin-left":b.left-1}),b.right&&a.css({"border-right-width":1,"margin-right":b.right-1})}function f(a){a.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function g(){a("body").addClass("fc-not-allowed")}function h(){a("body").removeClass("fc-not-allowed")}function i(b,c,d){var e=Math.floor(c/b.length),f=Math.floor(c-e*(b.length-1)),g=[],h=[],i=[],k=0;j(b),b.each(function(c,d){var j=c===b.length-1?f:e,l=a(d).outerHeight(!0);j>l?(g.push(d),h.push(l),i.push(a(d).height())):k+=l}),d&&(c-=k,e=Math.floor(c/g.length),f=Math.floor(c-e*(g.length-1))),a(g).each(function(b,c){var d=b===g.length-1?f:e,j=h[b],k=i[b],l=d-(j-k);d>j&&a(c).height(l)})}function j(a){a.height("")}function k(b){var c=0;return b.find("> *").each(function(b,d){var e=a(d).outerWidth();e>c&&(c=e)}),c++,b.width(c),c}function l(a,b){return a.height(b).addClass("fc-scroller"),a[0].scrollHeight-1>a[0].clientHeight?!0:(m(a),!1)}function m(a){a.height("").removeClass("fc-scroller")}function n(b){var c=b.css("position"),d=b.parents().filter(function(){var b=a(this);return/(auto|scroll)/.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&d.length?d:a(b[0].ownerDocument||document)}function o(a){var b=a.offset();return{left:b.left,right:b.left+a.outerWidth(),top:b.top,bottom:b.top+a.outerHeight()}}function p(a){var b=a.offset(),c=r(a),d=b.left+u(a,"border-left-width")+c.left,e=b.top+u(a,"border-top-width")+c.top;return{left:d,right:d+a[0].clientWidth,top:e,bottom:e+a[0].clientHeight}}function q(a){var b=a.offset(),c=b.left+u(a,"border-left-width")+u(a,"padding-left"),d=b.top+u(a,"border-top-width")+u(a,"padding-top");return{left:c,right:c+a.width(),top:d,bottom:d+a.height()}}function r(a){var b=a.innerWidth()-a[0].clientWidth,c={left:0,right:0,top:0,bottom:a.innerHeight()-a[0].clientHeight};return s()&&"rtl"==a.css("direction")?c.left=b:c.right=b,c}function s(){return null===Pa&&(Pa=t()),Pa}function t(){var b=a("<div><div/></div>").css({position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}).appendTo("body"),c=b.children(),d=c.offset().left>b.offset().left;return b.remove(),d}function u(a,b){return parseFloat(a.css(b))||0}function v(a){return 1==a.which&&!a.ctrlKey}function w(a,b){var c={left:Math.max(a.left,b.left),right:Math.min(a.right,b.right),top:Math.max(a.top,b.top),bottom:Math.min(a.bottom,b.bottom)};return c.left<c.right&&c.top<c.bottom?c:!1}function x(a,b){return{left:Math.min(Math.max(a.left,b.left),b.right),top:Math.min(Math.max(a.top,b.top),b.bottom)}}function y(a){return{left:(a.left+a.right)/2,top:(a.top+a.bottom)/2}}function z(a,b){return{left:a.left-b.left,top:a.top-b.top}}function A(b){var c,d,e=[],f=[];for("string"==typeof b?f=b.split(/\s*,\s*/):"function"==typeof b?f=[b]:a.isArray(b)&&(f=b),c=0;c<f.length;c++)d=f[c],"string"==typeof d?e.push("-"==d.charAt(0)?{field:d.substring(1),order:-1}:{field:d,order:1}):"function"==typeof d&&e.push({func:d});return e}function B(a,b,c){var d,e;for(d=0;d<c.length;d++)if(e=C(a,b,c[d]))return e;return 0}function C(a,b,c){return c.func?c.func(a,b):D(a[c.field],b[c.field])*(c.order||1)}function D(b,c){return b||c?null==c?-1:null==b?1:"string"===a.type(b)||"string"===a.type(c)?String(b).localeCompare(String(c)):b-c:0}function E(a,b){var c,d,e,f,g=a.start,h=a.end,i=b.start,j=b.end;return h>i&&j>g?(g>=i?(c=g.clone(),e=!0):(c=i.clone(),e=!1),j>=h?(d=h.clone(),f=!0):(d=j.clone(),f=!1),{start:c,end:d,isStart:e,isEnd:f}):void 0}function F(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),"days"),ms:a.time()-c.time()})}function G(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),"days")})}function H(a,c,d){return b.duration(Math.round(a.diff(c,d,!0)),d)}function I(a,b){var c,d,e;for(c=0;c<Ra.length&&(d=Ra[c],e=J(d,a,b),!(e>=1&&ba(e)));c++);return d}function J(a,c,d){return null!=d?d.diff(c,a,!0):b.isDuration(c)?c.as(a):c.end.diff(c.start,a,!0)}function K(a,b,c){var d;return N(c)?(b-a)/c:(d=c.asMonths(),Math.abs(d)>=1&&ba(d)?b.diff(a,"months",!0)/d:b.diff(a,"days",!0)/c.asDays())}function L(a,b){var c,d;return N(a)||N(b)?a/b:(c=a.asMonths(),d=b.asMonths(),Math.abs(c)>=1&&ba(c)&&Math.abs(d)>=1&&ba(d)?c/d:a.asDays()/b.asDays())}function M(a,c){var d;return N(a)?b.duration(a*c):(d=a.asMonths(),Math.abs(d)>=1&&ba(d)?b.duration({months:d*c}):b.duration({days:a.asDays()*c}))}function N(a){return Boolean(a.hours()||a.minutes()||a.seconds()||a.milliseconds())}function O(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function P(a){return/^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(a)}function Q(a,b){var c,d,e,f,g,h,i={};if(b)for(c=0;c<b.length;c++){for(d=b[c],e=[],f=a.length-1;f>=0;f--)if(g=a[f][d],"object"==typeof g)e.unshift(g);else if(void 0!==g){i[d]=g;break}e.length&&(i[d]=Q(e))}for(c=a.length-1;c>=0;c--){h=a[c];for(d in h)d in i||(i[d]=h[d])}return i}function R(a){var b=function(){};return b.prototype=a,new b}function S(a,b){for(var c in a)U(a,c)&&(b[c]=a[c])}function T(a,b){var c,d,e=["constructor","toString","valueOf"];for(c=0;c<e.length;c++)d=e[c],a[d]!==Object.prototype[d]&&(b[d]=a[d])}function U(a,b){return Va.call(a,b); 19 }function V(b){return/undefined|null|boolean|number|string/.test(a.type(b))}function W(b,c,d){if(a.isFunction(b)&&(b=[b]),b){var e,f;for(e=0;e<b.length;e++)f=b[e].apply(c,d)||f;return f}}function X(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]}function Y(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function Z(a){return a.replace(/&.*?;/g,"")}function $(b){var c=[];return a.each(b,function(a,b){null!=b&&c.push(a+":"+b)}),c.join(";")}function _(a){return a.charAt(0).toUpperCase()+a.slice(1)}function aa(a,b){return a-b}function ba(a){return a%1===0}function ca(a,b){var c=a[b];return function(){return c.apply(a,arguments)}}function da(a,b){var c,d,e,f,g=function(){var h=+new Date-f;b>h&&h>0?c=setTimeout(g,b-h):(c=null,a.apply(e,d),c||(e=d=null))};return function(){e=this,d=arguments,f=+new Date,c||(c=setTimeout(g,b))}}function ea(c,d,e){var f,g,h,i,j=c[0],k=1==c.length&&"string"==typeof j;return b.isMoment(j)?(i=b.apply(null,c),ga(j,i)):O(j)||void 0===j?i=b.apply(null,c):(f=!1,g=!1,k?Wa.test(j)?(j+="-01",c=[j],f=!0,g=!0):(h=Xa.exec(j))&&(f=!h[5],g=!0):a.isArray(j)&&(g=!0),i=d||f?b.utc.apply(b,c):b.apply(null,c),f?(i._ambigTime=!0,i._ambigZone=!0):e&&(g?i._ambigZone=!0:k&&(i.utcOffset?i.utcOffset(j):i.zone(j)))),i._fullCalendar=!0,i}function fa(a,c){var d,e,f=!1,g=!1,h=a.length,i=[];for(d=0;h>d;d++)e=a[d],b.isMoment(e)||(e=Ma.moment.parseZone(e)),f=f||e._ambigTime,g=g||e._ambigZone,i.push(e);for(d=0;h>d;d++)e=i[d],c||!f||e._ambigTime?g&&!e._ambigZone&&(i[d]=e.clone().stripZone()):i[d]=e.clone().stripTime();return i}function ga(a,b){a._ambigTime?b._ambigTime=!0:b._ambigTime&&(b._ambigTime=!1),a._ambigZone?b._ambigZone=!0:b._ambigZone&&(b._ambigZone=!1)}function ha(a,b){a.year(b[0]||0).month(b[1]||0).date(b[2]||0).hours(b[3]||0).minutes(b[4]||0).seconds(b[5]||0).milliseconds(b[6]||0)}function ia(a,b){return Za.format.call(a,b)}function ja(a,b){return ka(a,pa(b))}function ka(a,b){var c,d="";for(c=0;c<b.length;c++)d+=la(a,b[c]);return d}function la(a,b){var c,d;return"string"==typeof b?b:(c=b.token)?$a[c]?$a[c](a):ia(a,c):b.maybe&&(d=ka(a,b.maybe),d.match(/[1-9]/))?d:""}function ma(a,b,c,d,e){var f;return a=Ma.moment.parseZone(a),b=Ma.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||" - ",na(a,b,pa(c),d,e)}function na(a,b,c,d,e){var f,g,h,i,j="",k="",l="",m="",n="";for(g=0;g<c.length&&(f=oa(a,b,c[g]),f!==!1);g++)j+=f;for(h=c.length-1;h>g&&(f=oa(a,b,c[h]),f!==!1);h--)k=f+k;for(i=g;h>=i;i++)l+=la(a,c[i]),m+=la(b,c[i]);return(l||m)&&(n=e?m+d+l:l+d+m),j+n+k}function oa(a,b,c){var d,e;return"string"==typeof c?c:(d=c.token)&&(e=_a[d.charAt(0)],e&&a.isSame(b,e))?ia(a,d):!1}function pa(a){return a in ab?ab[a]:ab[a]=qa(a)}function qa(a){for(var b,c=[],d=/\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g;b=d.exec(a);)b[1]?c.push(b[1]):b[2]?c.push({maybe:qa(b[2])}):b[3]?c.push({token:b[3]}):b[5]&&c.push(b[5]);return c}function ra(){}function sa(a,b){return a||b?a&&b?a.grid===b.grid&&a.row===b.row&&a.col===b.col:!1:!0}function ta(a){var b=va(a);return"background"===b||"inverse-background"===b}function ua(a){return"inverse-background"===va(a)}function va(a){return X((a.source||{}).rendering,a.rendering)}function wa(a){var b,c,d={};for(b=0;b<a.length;b++)c=a[b],(d[c._id]||(d[c._id]=[])).push(c);return d}function xa(a,b){return a.eventStartMS-b.eventStartMS}function ya(c){var d,e,f,g,h=Ma.dataAttrPrefix;return h&&(h+="-"),d=c.data(h+"event")||null,d&&(d="object"==typeof d?a.extend({},d):{},e=d.start,null==e&&(e=d.time),f=d.duration,g=d.stick,delete d.start,delete d.time,delete d.duration,delete d.stick),null==e&&(e=c.data(h+"start")),null==e&&(e=c.data(h+"time")),null==f&&(f=c.data(h+"duration")),null==g&&(g=c.data(h+"stick")),e=null!=e?b.duration(e):null,f=null!=f?b.duration(f):null,g=Boolean(g),{eventProps:d,startTime:e,duration:f,stick:g}}function za(a,b){var c,d;for(c=0;c<b.length;c++)if(d=b[c],d.leftCol<=a.rightCol&&d.rightCol>=a.leftCol)return!0;return!1}function Aa(a,b){return a.leftCol-b.leftCol}function Ba(a){var b,c,d,e=[];for(b=0;b<a.length;b++){for(c=a[b],d=0;d<e.length&&Ea(c,e[d]).length;d++);c.level=d,(e[d]||(e[d]=[])).push(c)}return e}function Ca(a){var b,c,d,e,f;for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)for(e=c[d],e.forwardSegs=[],f=b+1;f<a.length;f++)Ea(e,a[f],e.forwardSegs)}function Da(a){var b,c,d=a.forwardSegs,e=0;if(void 0===a.forwardPressure){for(b=0;b<d.length;b++)c=d[b],Da(c),e=Math.max(e,1+c.forwardPressure);a.forwardPressure=e}}function Ea(a,b,c){c=c||[];for(var d=0;d<b.length;d++)Fa(a,b[d])&&c.push(b[d]);return c}function Fa(a,b){return a.bottom>b.top&&a.top<b.bottom}function Ga(c,d){function e(){U?h()&&(k(),i()):f()}function f(){V=O.theme?"ui":"fc",c.addClass("fc"),O.isRTL?c.addClass("fc-rtl"):c.addClass("fc-ltr"),O.theme?c.addClass("ui-widget"):c.addClass("fc-unthemed"),U=a("<div class='fc-view-container'/>").prependTo(c),S=N.header=new Ja(N,O),T=S.render(),T&&c.prepend(T),i(O.defaultView),O.handleWindowResize&&(Y=da(m,O.windowResizeDelay),a(window).resize(Y))}function g(){W&&W.removeElement(),S.removeElement(),U.remove(),c.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget"),Y&&a(window).unbind("resize",Y)}function h(){return c.is(":visible")}function i(b){ca++,W&&b&&W.type!==b&&(S.deactivateButton(W.type),H(),W.removeElement(),W=N.view=null),!W&&b&&(W=N.view=ba[b]||(ba[b]=N.instantiateView(b)),W.setElement(a("<div class='fc-view fc-"+b+"-view' />").appendTo(U)),S.activateButton(b)),W&&(Z=W.massageCurrentDate(Z),W.displaying&&Z.isWithin(W.intervalStart,W.intervalEnd)||h()&&(H(),W.display(Z),I(),u(),v(),q())),I(),ca--}function j(a){return h()?(a&&l(),ca++,W.updateSize(!0),ca--,!0):void 0}function k(){h()&&l()}function l(){X="number"==typeof O.contentHeight?O.contentHeight:"number"==typeof O.height?O.height-(T?T.outerHeight(!0):0):Math.round(U.width()/Math.max(O.aspectRatio,.5))}function m(a){!ca&&a.target===window&&W.start&&j(!0)&&W.trigger("windowResize",aa)}function n(){p(),r()}function o(){h()&&(H(),W.displayEvents(ea),I())}function p(){H(),W.clearEvents(),I()}function q(){!O.lazyFetching||$(W.start,W.end)?r():o()}function r(){_(W.start,W.end)}function s(a){ea=a,o()}function t(){o()}function u(){S.updateTitle(W.title)}function v(){var a=N.getNow();a.isWithin(W.intervalStart,W.intervalEnd)?S.disableButton("today"):S.enableButton("today")}function w(a,b){W.select(N.buildSelectRange.apply(N,arguments))}function x(){W&&W.unselect()}function y(){Z=W.computePrevDate(Z),i()}function z(){Z=W.computeNextDate(Z),i()}function A(){Z.add(-1,"years"),i()}function B(){Z.add(1,"years"),i()}function C(){Z=N.getNow(),i()}function D(a){Z=N.moment(a),i()}function E(a){Z.add(b.duration(a)),i()}function F(a,b){var c;b=b||"day",c=N.getViewSpec(b)||N.getUnitViewSpec(b),Z=a,i(c?c.type:null)}function G(){return Z.clone()}function H(){U.css({width:"100%",height:U.height(),overflow:"hidden"})}function I(){U.css({width:"",height:"",overflow:""})}function J(){return N}function K(){return W}function L(a,b){return void 0===b?O[a]:void("height"!=a&&"contentHeight"!=a&&"aspectRatio"!=a||(O[a]=b,j(!0)))}function M(a,b){var c=Array.prototype.slice.call(arguments,2);return b=b||aa,this.triggerWith(a,b,c),O[a]?O[a].apply(b,c):void 0}var N=this;N.initOptions(d||{});var O=this.options;N.render=e,N.destroy=g,N.refetchEvents=n,N.reportEvents=s,N.reportEventChange=t,N.rerenderEvents=o,N.changeView=i,N.select=w,N.unselect=x,N.prev=y,N.next=z,N.prevYear=A,N.nextYear=B,N.today=C,N.gotoDate=D,N.incrementDate=E,N.zoomTo=F,N.getDate=G,N.getCalendar=J,N.getView=K,N.option=L,N.trigger=M;var P=R(Ia(O.lang));if(O.monthNames&&(P._months=O.monthNames),O.monthNamesShort&&(P._monthsShort=O.monthNamesShort),O.dayNames&&(P._weekdays=O.dayNames),O.dayNamesShort&&(P._weekdaysShort=O.dayNamesShort),null!=O.firstDay){var Q=R(P._week);Q.dow=O.firstDay,P._week=Q}P._fullCalendar_weekCalc=function(a){return"function"==typeof a?a:"local"===a?a:"iso"===a||"ISO"===a?"ISO":void 0}(O.weekNumberCalculation),N.defaultAllDayEventDuration=b.duration(O.defaultAllDayEventDuration),N.defaultTimedEventDuration=b.duration(O.defaultTimedEventDuration),N.moment=function(){var a;return"local"===O.timezone?(a=Ma.moment.apply(null,arguments),a.hasTime()&&a.local()):a="UTC"===O.timezone?Ma.moment.utc.apply(null,arguments):Ma.moment.parseZone.apply(null,arguments),"_locale"in a?a._locale=P:a._lang=P,a},N.getIsAmbigTimezone=function(){return"local"!==O.timezone&&"UTC"!==O.timezone},N.rezoneDate=function(a){return N.moment(a.toArray())},N.getNow=function(){var a=O.now;return"function"==typeof a&&(a=a()),N.moment(a)},N.getEventEnd=function(a){return a.end?a.end.clone():N.getDefaultEventEnd(a.allDay,a.start)},N.getDefaultEventEnd=function(a,b){var c=b.clone();return a?c.stripTime().add(N.defaultAllDayEventDuration):c.add(N.defaultTimedEventDuration),N.getIsAmbigTimezone()&&c.stripZone(),c},N.humanizeDuration=function(a){return(a.locale||a.lang).call(a,O.lang).humanize()},Ka.call(N,O);var S,T,U,V,W,X,Y,Z,$=N.isFetchNeeded,_=N.fetchEvents,aa=c[0],ba={},ca=0,ea=[];Z=null!=O.defaultDate?N.moment(O.defaultDate):N.getNow(),N.getSuggestedViewHeight=function(){return void 0===X&&k(),X},N.isHeightAuto=function(){return"auto"===O.contentHeight||"auto"===O.height},N.initialize()}function Ha(b){a.each(rb,function(a,c){null==b[a]&&(b[a]=c(b))})}function Ia(a){var c=b.localeData||b.langData;return c.call(b,a)||c.call(b,"en")}function Ja(b,c){function d(){var b=c.header;return n=c.theme?"ui":"fc",b?o=a("<div class='fc-toolbar'/>").append(f("left")).append(f("right")).append(f("center")).append('<div class="fc-clear"/>'):void 0}function e(){o.remove(),o=a()}function f(d){var e=a('<div class="fc-'+d+'"/>'),f=c.header[d];return f&&a.each(f.split(" "),function(d){var f,g=a(),h=!0;a.each(this.split(","),function(d,e){var f,i,j,k,l,m,o,q,r,s;"title"==e?(g=g.add(a("<h2> </h2>")),h=!1):((f=(b.options.customButtons||{})[e])?(j=function(a){f.click&&f.click.call(s[0],a)},k="",l=f.text):(i=b.getViewSpec(e))?(j=function(){b.changeView(e)},p.push(e),k=i.buttonTextOverride,l=i.buttonTextDefault):b[e]&&(j=function(){b[e]()},k=(b.overrides.buttonText||{})[e],l=c.buttonText[e]),j&&(m=f?f.themeIcon:c.themeButtonIcons[e],o=f?f.icon:c.buttonIcons[e],q=k?Y(k):m&&c.theme?"<span class='ui-icon ui-icon-"+m+"'></span>":o&&!c.theme?"<span class='fc-icon fc-icon-"+o+"'></span>":Y(l),r=["fc-"+e+"-button",n+"-button",n+"-state-default"],s=a('<button type="button" class="'+r.join(" ")+'">'+q+"</button>").click(function(a){s.hasClass(n+"-state-disabled")||(j(a),(s.hasClass(n+"-state-active")||s.hasClass(n+"-state-disabled"))&&s.removeClass(n+"-state-hover"))}).mousedown(function(){s.not("."+n+"-state-active").not("."+n+"-state-disabled").addClass(n+"-state-down")}).mouseup(function(){s.removeClass(n+"-state-down")}).hover(function(){s.not("."+n+"-state-active").not("."+n+"-state-disabled").addClass(n+"-state-hover")},function(){s.removeClass(n+"-state-hover").removeClass(n+"-state-down")}),g=g.add(s)))}),h&&g.first().addClass(n+"-corner-left").end().last().addClass(n+"-corner-right").end(),g.length>1?(f=a("<div/>"),h&&f.addClass("fc-button-group"),f.append(g),e.append(f)):e.append(g)}),e}function g(a){o.find("h2").text(a)}function h(a){o.find(".fc-"+a+"-button").addClass(n+"-state-active")}function i(a){o.find(".fc-"+a+"-button").removeClass(n+"-state-active")}function j(a){o.find(".fc-"+a+"-button").attr("disabled","disabled").addClass(n+"-state-disabled")}function k(a){o.find(".fc-"+a+"-button").removeAttr("disabled").removeClass(n+"-state-disabled")}function l(){return p}var m=this;m.render=d,m.removeElement=e,m.updateTitle=g,m.activateButton=h,m.deactivateButton=i,m.disableButton=j,m.enableButton=k,m.getViewsWithButtons=l;var n,o=a(),p=[]}function Ka(c){function d(a,b){return!M||a.clone().stripZone()<M.clone().stripZone()||b.clone().stripZone()>N.clone().stripZone()}function e(a,b){M=a,N=b,U=[];var c=++S,d=R.length;T=d;for(var e=0;d>e;e++)f(R[e],c)}function f(b,c){g(b,function(d){var e,f,g,h=a.isArray(b.events);if(c==S){if(d)for(e=0;e<d.length;e++)f=d[e],g=h?f:s(f,b),g&&U.push.apply(U,x(g));T--,T||O(U)}})}function g(b,d){var e,f,h=Ma.sourceFetchers;for(e=0;e<h.length;e++){if(f=h[e].call(L,b,M.clone(),N.clone(),c.timezone,d),f===!0)return;if("object"==typeof f)return void g(f,d)}var i=b.events;if(i)a.isFunction(i)?(L.pushLoading(),i.call(L,M.clone(),N.clone(),c.timezone,function(a){d(a),L.popLoading()})):a.isArray(i)?d(i):d();else{var j=b.url;if(j){var k,l=b.success,m=b.error,n=b.complete;k=a.isFunction(b.data)?b.data():b.data;var o=a.extend({},k||{}),p=X(b.startParam,c.startParam),q=X(b.endParam,c.endParam),r=X(b.timezoneParam,c.timezoneParam);p&&(o[p]=M.format()),q&&(o[q]=N.format()),c.timezone&&"local"!=c.timezone&&(o[r]=c.timezone),L.pushLoading(),a.ajax(a.extend({},sb,b,{data:o,success:function(b){b=b||[];var c=W(l,this,arguments);a.isArray(c)&&(b=c),d(b)},error:function(){W(m,this,arguments),d()},complete:function(){W(n,this,arguments),L.popLoading()}}))}else d()}}function h(a){var b=i(a);b&&(R.push(b),T++,f(b,S))}function i(b){var c,d,e=Ma.sourceNormalizers;if(a.isFunction(b)||a.isArray(b)?c={events:b}:"string"==typeof b?c={url:b}:"object"==typeof b&&(c=a.extend({},b)),c){for(c.className?"string"==typeof c.className&&(c.className=c.className.split(/\s+/)):c.className=[],a.isArray(c.events)&&(c.origArray=c.events,c.events=a.map(c.events,function(a){return s(a,c)})),d=0;d<e.length;d++)e[d].call(L,c);return c}}function j(b){R=a.grep(R,function(a){return!k(a,b)}),U=a.grep(U,function(a){return!k(a.source,b)}),O(U)}function k(a,b){return a&&b&&l(a)==l(b)}function l(a){return("object"==typeof a?a.origArray||a.googleCalendarId||a.url||a.events:null)||a}function m(a){a.start=L.moment(a.start),a.end?a.end=L.moment(a.end):a.end=null,y(a,n(a)),O(U)}function n(b){var c={};return a.each(b,function(a,b){o(a)&&void 0!==b&&V(b)&&(c[a]=b)}),c}function o(a){return!/^_|^(id|allDay|start|end)$/.test(a)}function p(a,b){var c,d,e,f=s(a);if(f){for(c=x(f),d=0;d<c.length;d++)e=c[d],e.source||(b&&(Q.events.push(e),e.source=Q),U.push(e));return O(U),c}return[]}function q(b){var c,d;for(null==b?b=function(){return!0}:a.isFunction(b)||(c=b+"",b=function(a){return a._id==c}),U=a.grep(U,b,!0),d=0;d<R.length;d++)a.isArray(R[d].events)&&(R[d].events=a.grep(R[d].events,b,!0));O(U)}function r(b){return a.isFunction(b)?a.grep(U,b):null!=b?(b+="",a.grep(U,function(a){return a._id==b})):U}function s(d,e){var f,g,h,i={};if(c.eventDataTransform&&(d=c.eventDataTransform(d)),e&&e.eventDataTransform&&(d=e.eventDataTransform(d)),a.extend(i,d),e&&(i.source=e),i._id=d._id||(void 0===d.id?"_fc"+tb++:d.id+""),d.className?"string"==typeof d.className?i.className=d.className.split(/\s+/):i.className=d.className:i.className=[],f=d.start||d.date,g=d.end,P(f)&&(f=b.duration(f)),P(g)&&(g=b.duration(g)),d.dow||b.isDuration(f)||b.isDuration(g))i.start=f?b.duration(f):null,i.end=g?b.duration(g):null,i._recurring=!0;else{if(f&&(f=L.moment(f),!f.isValid()))return!1;g&&(g=L.moment(g),g.isValid()||(g=null)),h=d.allDay,void 0===h&&(h=X(e?e.allDayDefault:void 0,c.allDayDefault)),t(f,g,h,i)}return i}function t(a,b,c,d){d.start=a,d.end=b,d.allDay=c,u(d),La(d)}function u(a){v(a),a.end&&!a.end.isAfter(a.start)&&(a.end=null),a.end||(c.forceEventDuration?a.end=L.getDefaultEventEnd(a.allDay,a.start):a.end=null)}function v(a){null==a.allDay&&(a.allDay=!(a.start.hasTime()||a.end&&a.end.hasTime())),a.allDay?(a.start.stripTime(),a.end&&a.end.stripTime()):(a.start.hasTime()||(a.start=L.rezoneDate(a.start)),a.end&&!a.end.hasTime()&&(a.end=L.rezoneDate(a.end)))}function w(b){var c;return b.end||(c=b.allDay,null==c&&(c=!b.start.hasTime()),b=a.extend({},b),b.end=L.getDefaultEventEnd(c,b.start)),b}function x(b,c,d){var e,f,g,h,i,j,k,l,m,n=[];if(c=c||M,d=d||N,b)if(b._recurring){if(f=b.dow)for(e={},g=0;g<f.length;g++)e[f[g]]=!0;for(h=c.clone().stripTime();h.isBefore(d);)e&&!e[h.day()]||(i=b.start,j=b.end,k=h.clone(),l=null,i&&(k=k.time(i)),j&&(l=h.clone().time(j)),m=a.extend({},b),t(k,l,!i&&!j,m),n.push(m)),h.add(1,"days")}else n.push(b);return n}function y(b,c,d){function e(a,b){return d?H(a,b,d):c.allDay?G(a,b):F(a,b)}var f,g,h,i,j,k,l={};return c=c||{},c.start||(c.start=b.start.clone()),void 0===c.end&&(c.end=b.end?b.end.clone():null),null==c.allDay&&(c.allDay=b.allDay),u(c),f={start:b._start.clone(),end:b._end?b._end.clone():L.getDefaultEventEnd(b._allDay,b._start),allDay:c.allDay},u(f),g=null!==b._end&&null===c.end,h=e(c.start,f.start),c.end?(i=e(c.end,f.end),j=i.subtract(h)):j=null,a.each(c,function(a,b){o(a)&&void 0!==b&&(l[a]=b)}),k=z(r(b._id),g,c.allDay,h,j,l),{dateDelta:h,durationDelta:j,undo:k}}function z(b,c,d,e,f,g){var h=L.getIsAmbigTimezone(),i=[];return e&&!e.valueOf()&&(e=null),f&&!f.valueOf()&&(f=null),a.each(b,function(b,j){var k,l;k={start:j.start.clone(),end:j.end?j.end.clone():null,allDay:j.allDay},a.each(g,function(a){k[a]=j[a]}),l={start:j._start,end:j._end,allDay:d},u(l),c?l.end=null:f&&!l.end&&(l.end=L.getDefaultEventEnd(l.allDay,l.start)),e&&(l.start.add(e),l.end&&l.end.add(e)),f&&l.end.add(f),h&&!l.allDay&&(e||f)&&(l.start.stripZone(),l.end&&l.end.stripZone()),a.extend(j,g,l),La(j),i.push(function(){a.extend(j,k),La(j)})}),function(){for(var a=0;a<i.length;a++)i[a]()}}function A(b){var d,e=c.businessHours,f={className:"fc-nonbusiness",start:"09:00",end:"17:00",dow:[1,2,3,4,5],rendering:"inverse-background"},g=L.getView();return e&&(d=a.extend({},f,"object"==typeof e?e:{})),d?(b&&(d.start=null,d.end=null),x(s(d),g.start,g.end)):[]}function B(a,b){var d=b.source||{},e=X(b.constraint,d.constraint,c.eventConstraint),f=X(b.overlap,d.overlap,c.eventOverlap);return a=w(a),E(a,e,f,b)}function C(a){return E(a,c.selectConstraint,c.selectOverlap)}function D(b,c){var d,e;return c&&(d=a.extend({},c,b),e=x(s(d))[0]),e?B(b,e):(b=w(b),C(b))}function E(b,c,d,e){var f,g,h,i,j,k;if(b=a.extend({},b),b.start=b.start.clone().stripZone(),b.end=b.end.clone().stripZone(),null!=c){for(f=I(c),g=!1,i=0;i<f.length;i++)if(J(f[i],b)){g=!0;break}if(!g)return!1}for(h=L.getPeerEvents(e,b),i=0;i<h.length;i++)if(j=h[i],K(j,b)){if(d===!1)return!1;if("function"==typeof d&&!d(j,e))return!1;if(e){if(k=X(j.overlap,(j.source||{}).overlap),k===!1)return!1;if("function"==typeof k&&!k(e,j))return!1}}return!0}function I(a){return"businessHours"===a?A():"object"==typeof a?x(s(a)):r(a)}function J(a,b){var c=a.start.clone().stripZone(),d=L.getEventEnd(a).stripZone();return b.start>=c&&b.end<=d}function K(a,b){var c=a.start.clone().stripZone(),d=L.getEventEnd(a).stripZone();return b.start<d&&b.end>c}var L=this;L.isFetchNeeded=d,L.fetchEvents=e,L.addEventSource=h,L.removeEventSource=j,L.updateEvent=m,L.renderEvent=p,L.removeEvents=q,L.clientEvents=r,L.mutateEvent=y,L.normalizeEventRange=u,L.normalizeEventRangeTimes=v,L.ensureVisibleEventRange=w;var M,N,O=L.reportEvents,Q={events:[]},R=[Q],S=0,T=0,U=[];a.each((c.events?[c.events]:[]).concat(c.eventSources||[]),function(a,b){var c=i(b);c&&R.push(c)}),L.getBusinessHoursEvents=A,L.isEventRangeAllowed=B,L.isSelectionRangeAllowed=C,L.isExternalDropRangeAllowed=D,L.getEventCache=function(){return U}}function La(a){a._allDay=a.allDay,a._start=a.start.clone(),a._end=a.end?a.end.clone():null}var Ma=a.fullCalendar={version:"2.4.0"},Na=Ma.views={};a.fn.fullCalendar=function(b){var c=Array.prototype.slice.call(arguments,1),d=this;return this.each(function(e,f){var g,h=a(f),i=h.data("fullCalendar");"string"==typeof b?i&&a.isFunction(i[b])&&(g=i[b].apply(i,c),e||(d=g),"destroy"===b&&h.removeData("fullCalendar")):i||(i=new nb(h,b),h.data("fullCalendar",i),i.render())}),d};var Oa=["header","buttonText","buttonIcons","themeButtonIcons"];Ma.intersectionToSeg=E,Ma.applyAll=W,Ma.debounce=da,Ma.isInt=ba,Ma.htmlEscape=Y,Ma.cssToStr=$,Ma.proxy=ca,Ma.capitaliseFirstLetter=_,Ma.getClientRect=p,Ma.getContentRect=q,Ma.getScrollbarWidths=r;var Pa=null;Ma.intersectRects=w,Ma.parseFieldSpecs=A,Ma.compareByFieldSpecs=B,Ma.compareByFieldSpec=C,Ma.flexibleCompare=D,Ma.computeIntervalUnit=I,Ma.divideRangeByDuration=K,Ma.divideDurationByDuration=L,Ma.multiplyDuration=M,Ma.durationHasTime=N;var Qa=["sun","mon","tue","wed","thu","fri","sat"],Ra=["year","month","week","day","hour","minute","second","millisecond"];Ma.log=function(){var a=window.console;return a&&a.log?a.log.apply(a,arguments):void 0},Ma.warn=function(){var a=window.console;return a&&a.warn?a.warn.apply(a,arguments):Ma.log.apply(Ma,arguments)};var Sa,Ta,Ua,Va={}.hasOwnProperty,Wa=/^\s*\d{4}-\d\d$/,Xa=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/,Ya=b.fn,Za=a.extend({},Ya);Ma.moment=function(){return ea(arguments)},Ma.moment.utc=function(){var a=ea(arguments,!0);return a.hasTime()&&a.utc(),a},Ma.moment.parseZone=function(){return ea(arguments,!0,!0)},Ya.clone=function(){var a=Za.clone.apply(this,arguments);return ga(this,a),this._fullCalendar&&(a._fullCalendar=!0),a},Ya.week=Ya.weeks=function(a){var b=(this._locale||this._lang)._fullCalendar_weekCalc;return null==a&&"function"==typeof b?b(this):"ISO"===b?Za.isoWeek.apply(this,arguments):Za.week.apply(this,arguments)},Ya.time=function(a){if(!this._fullCalendar)return Za.time.apply(this,arguments);if(null==a)return b.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});this._ambigTime=!1,b.isDuration(a)||b.isMoment(a)||(a=b.duration(a));var c=0;return b.isDuration(a)&&(c=24*Math.floor(a.asDays())),this.hours(c+a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds())},Ya.stripTime=function(){var a;return this._ambigTime||(a=this.toArray(),this.utc(),Ta(this,a.slice(0,3)),this._ambigTime=!0,this._ambigZone=!0),this},Ya.hasTime=function(){return!this._ambigTime},Ya.stripZone=function(){var a,b;return this._ambigZone||(a=this.toArray(),b=this._ambigTime,this.utc(),Ta(this,a),this._ambigTime=b||!1,this._ambigZone=!0),this},Ya.hasZone=function(){return!this._ambigZone},Ya.local=function(){var a=this.toArray(),b=this._ambigZone;return Za.local.apply(this,arguments),this._ambigTime=!1,this._ambigZone=!1,b&&Ua(this,a),this},Ya.utc=function(){return Za.utc.apply(this,arguments),this._ambigTime=!1,this._ambigZone=!1,this},a.each(["zone","utcOffset"],function(a,b){Za[b]&&(Ya[b]=function(a){return null!=a&&(this._ambigTime=!1,this._ambigZone=!1),Za[b].apply(this,arguments)})}),Ya.format=function(){return this._fullCalendar&&arguments[0]?ja(this,arguments[0]):this._ambigTime?ia(this,"YYYY-MM-DD"):this._ambigZone?ia(this,"YYYY-MM-DD[T]HH:mm:ss"):Za.format.apply(this,arguments)},Ya.toISOString=function(){return this._ambigTime?ia(this,"YYYY-MM-DD"):this._ambigZone?ia(this,"YYYY-MM-DD[T]HH:mm:ss"):Za.toISOString.apply(this,arguments)},Ya.isWithin=function(a,b){var c=fa([this,a,b]);return c[0]>=c[1]&&c[0]<c[2]},Ya.isSame=function(a,b){var c;return this._fullCalendar?b?(c=fa([this,a],!0),Za.isSame.call(c[0],c[1],b)):(a=Ma.moment.parseZone(a),Za.isSame.call(this,a)&&Boolean(this._ambigTime)===Boolean(a._ambigTime)&&Boolean(this._ambigZone)===Boolean(a._ambigZone)):Za.isSame.apply(this,arguments)},a.each(["isBefore","isAfter"],function(a,b){Ya[b]=function(a,c){var d;return this._fullCalendar?(d=fa([this,a]),Za[b].call(d[0],d[1],c)):Za[b].apply(this,arguments)}}),Sa="_d"in b()&&"updateOffset"in b,Ta=Sa?function(a,c){a._d.setTime(Date.UTC.apply(Date,c)),b.updateOffset(a,!1)}:ha,Ua=Sa?function(a,c){a._d.setTime(+new Date(c[0]||0,c[1]||0,c[2]||0,c[3]||0,c[4]||0,c[5]||0,c[6]||0)),b.updateOffset(a,!1)}:ha;var $a={t:function(a){return ia(a,"a").charAt(0)},T:function(a){return ia(a,"A").charAt(0)}};Ma.formatRange=ma;var _a={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"},ab={};Ma.Class=ra,ra.extend=function(a){var b,c=this;return a=a||{},U(a,"constructor")&&(b=a.constructor),"function"!=typeof b&&(b=a.constructor=function(){c.apply(this,arguments)}),b.prototype=R(c.prototype),S(a,b.prototype),T(a,b.prototype),S(c,b),b},ra.mixin=function(a){S(a.prototype||a,this.prototype)};var bb=Ma.Emitter=ra.extend({callbackHash:null,on:function(a,b){return this.getCallbacks(a).add(b),this},off:function(a,b){return this.getCallbacks(a).remove(b),this},trigger:function(a){var b=Array.prototype.slice.call(arguments,1);return this.triggerWith(a,this,b),this},triggerWith:function(a,b,c){var d=this.getCallbacks(a);return d.fireWith(b,c),this},getCallbacks:function(b){var c;return this.callbackHash||(this.callbackHash={}),c=this.callbackHash[b],c||(c=this.callbackHash[b]=a.Callbacks()),c}}),cb=ra.extend({isHidden:!0,options:null,el:null,documentMousedownProxy:null,margin:10,constructor:function(a){this.options=a||{}},show:function(){this.isHidden&&(this.el||this.render(),this.el.show(),this.position(),this.isHidden=!1,this.trigger("show"))},hide:function(){this.isHidden||(this.el.hide(),this.isHidden=!0,this.trigger("hide"))},render:function(){var b=this,c=this.options;this.el=a('<div class="fc-popover"/>').addClass(c.className||"").css({top:0,left:0}).append(c.content).appendTo(c.parentEl),this.el.on("click",".fc-close",function(){b.hide()}),c.autoHide&&a(document).on("mousedown",this.documentMousedownProxy=ca(this,"documentMousedown"))},documentMousedown:function(b){this.el&&!a(b.target).closest(this.el).length&&this.hide()},removeElement:function(){this.hide(),this.el&&(this.el.remove(),this.el=null),a(document).off("mousedown",this.documentMousedownProxy)},position:function(){var b,c,d,e,f,g=this.options,h=this.el.offsetParent().offset(),i=this.el.outerWidth(),j=this.el.outerHeight(),k=a(window),l=n(this.el);e=g.top||0,f=void 0!==g.left?g.left:void 0!==g.right?g.right-i:0,l.is(window)||l.is(document)?(l=k,b=0,c=0):(d=l.offset(),b=d.top,c=d.left),b+=k.scrollTop(),c+=k.scrollLeft(),g.viewportConstrain!==!1&&(e=Math.min(e,b+l.outerHeight()-j-this.margin),e=Math.max(e,b+this.margin),f=Math.min(f,c+l.outerWidth()-i-this.margin),f=Math.max(f,c+this.margin)),this.el.css({top:e-h.top,left:f-h.left})},trigger:function(a){this.options[a]&&this.options[a].apply(this,Array.prototype.slice.call(arguments,1))}}),db=ra.extend({grid:null,rowCoords:null,colCoords:null,containerEl:null,bounds:null,constructor:function(a){this.grid=a},build:function(){this.grid.build(),this.rowCoords=this.grid.computeRowCoords(),this.colCoords=this.grid.computeColCoords(),this.computeBounds()},clear:function(){this.grid.clear(),this.rowCoords=null,this.colCoords=null},getCell:function(b,c){var d,e,f,g=this.rowCoords,h=g.length,i=this.colCoords,j=i.length,k=null,l=null;if(this.inBounds(b,c)){for(d=0;h>d;d++)if(e=g[d],c>=e.top&&c<e.bottom){k=d;break}for(d=0;j>d;d++)if(e=i[d],b>=e.left&&b<e.right){l=d;break}if(null!==k&&null!==l)return f=this.grid.getCell(k,l),f.grid=this.grid,a.extend(f,g[k],i[l]),f}return null},computeBounds:function(){this.bounds=this.containerEl?p(this.containerEl):null},inBounds:function(a,b){var c=this.bounds;return c?a>=c.left&&a<c.right&&b>=c.top&&b<c.bottom:!0}}),eb=ra.extend({coordMaps:null,constructor:function(a){this.coordMaps=a},build:function(){var a,b=this.coordMaps;for(a=0;a<b.length;a++)b[a].build()},getCell:function(a,b){var c,d=this.coordMaps,e=null;for(c=0;c<d.length&&!e;c++)e=d[c].getCell(a,b);return e},clear:function(){var a,b=this.coordMaps;for(a=0;a<b.length;a++)b[a].clear()}}),fb=Ma.DragListener=ra.extend({options:null,isListening:!1,isDragging:!1,originX:null,originY:null,mousemoveProxy:null,mouseupProxy:null,subjectEl:null,subjectHref:null,scrollEl:null,scrollBounds:null,scrollTopVel:null,scrollLeftVel:null,scrollIntervalId:null,scrollHandlerProxy:null,scrollSensitivity:30,scrollSpeed:200,scrollIntervalMs:50,constructor:function(a){a=a||{},this.options=a,this.subjectEl=a.subjectEl},mousedown:function(a){v(a)&&(a.preventDefault(),this.startListening(a),this.options.distance||this.startDrag(a))},startListening:function(b){var c;this.isListening||(b&&this.options.scroll&&(c=n(a(b.target)),c.is(window)||c.is(document)||(this.scrollEl=c,this.scrollHandlerProxy=da(ca(this,"scrollHandler"),100),this.scrollEl.on("scroll",this.scrollHandlerProxy))),a(document).on("mousemove",this.mousemoveProxy=ca(this,"mousemove")).on("mouseup",this.mouseupProxy=ca(this,"mouseup")).on("selectstart",this.preventDefault),b?(this.originX=b.pageX,this.originY=b.pageY):(this.originX=0,this.originY=0),this.isListening=!0,this.listenStart(b))},listenStart:function(a){this.trigger("listenStart",a)},mousemove:function(a){var b,c,d=a.pageX-this.originX,e=a.pageY-this.originY;this.isDragging||(b=this.options.distance||1,c=d*d+e*e,c>=b*b&&this.startDrag(a)),this.isDragging&&this.drag(d,e,a)},startDrag:function(a){this.isListening||this.startListening(),this.isDragging||(this.isDragging=!0,this.dragStart(a))},dragStart:function(a){var b=this.subjectEl;this.trigger("dragStart",a),(this.subjectHref=b?b.attr("href"):null)&&b.removeAttr("href")},drag:function(a,b,c){this.trigger("drag",a,b,c),this.updateScroll(c)},mouseup:function(a){this.stopListening(a)},stopDrag:function(a){this.isDragging&&(this.stopScrolling(),this.dragStop(a),this.isDragging=!1)},dragStop:function(a){var b=this;this.trigger("dragStop",a),setTimeout(function(){b.subjectHref&&b.subjectEl.attr("href",b.subjectHref)},0)},stopListening:function(b){this.stopDrag(b),this.isListening&&(this.scrollEl&&(this.scrollEl.off("scroll",this.scrollHandlerProxy),this.scrollHandlerProxy=null),a(document).off("mousemove",this.mousemoveProxy).off("mouseup",this.mouseupProxy).off("selectstart",this.preventDefault),this.mousemoveProxy=null,this.mouseupProxy=null,this.isListening=!1,this.listenStop(b))},listenStop:function(a){this.trigger("listenStop",a)},trigger:function(a){this.options[a]&&this.options[a].apply(this,Array.prototype.slice.call(arguments,1))},preventDefault:function(a){a.preventDefault()},computeScrollBounds:function(){var a=this.scrollEl;this.scrollBounds=a?o(a):null},updateScroll:function(a){var b,c,d,e,f=this.scrollSensitivity,g=this.scrollBounds,h=0,i=0;g&&(b=(f-(a.pageY-g.top))/f,c=(f-(g.bottom-a.pageY))/f,d=(f-(a.pageX-g.left))/f,e=(f-(g.right-a.pageX))/f,b>=0&&1>=b?h=b*this.scrollSpeed*-1:c>=0&&1>=c&&(h=c*this.scrollSpeed),d>=0&&1>=d?i=d*this.scrollSpeed*-1:e>=0&&1>=e&&(i=e*this.scrollSpeed)),this.setScrollVel(h,i)},setScrollVel:function(a,b){this.scrollTopVel=a,this.scrollLeftVel=b,this.constrainScrollVel(),!this.scrollTopVel&&!this.scrollLeftVel||this.scrollIntervalId||(this.scrollIntervalId=setInterval(ca(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var a=this.scrollEl;this.scrollTopVel<0?a.scrollTop()<=0&&(this.scrollTopVel=0):this.scrollTopVel>0&&a.scrollTop()+a[0].clientHeight>=a[0].scrollHeight&&(this.scrollTopVel=0),this.scrollLeftVel<0?a.scrollLeft()<=0&&(this.scrollLeftVel=0):this.scrollLeftVel>0&&a.scrollLeft()+a[0].clientWidth>=a[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var a=this.scrollEl,b=this.scrollIntervalMs/1e3;this.scrollTopVel&&a.scrollTop(a.scrollTop()+this.scrollTopVel*b),this.scrollLeftVel&&a.scrollLeft(a.scrollLeft()+this.scrollLeftVel*b),this.constrainScrollVel(),this.scrollTopVel||this.scrollLeftVel||this.stopScrolling()},stopScrolling:function(){this.scrollIntervalId&&(clearInterval(this.scrollIntervalId),this.scrollIntervalId=null,this.scrollStop())},scrollHandler:function(){this.scrollIntervalId||this.scrollStop()},scrollStop:function(){}}),gb=fb.extend({coordMap:null,origCell:null,cell:null,coordAdjust:null,constructor:function(a,b){fb.prototype.constructor.call(this,b),this.coordMap=a},listenStart:function(a){var b,c,d,e=this.subjectEl;fb.prototype.listenStart.apply(this,arguments),this.computeCoords(),a?(c={left:a.pageX,top:a.pageY},d=c,e&&(b=o(e),d=x(d,b)),this.origCell=this.getCell(d.left,d.top),e&&this.options.subjectCenter&&(this.origCell&&(b=w(this.origCell,b)||b),d=y(b)),this.coordAdjust=z(d,c)):(this.origCell=null,this.coordAdjust=null)},computeCoords:function(){this.coordMap.build(), 20 this.computeScrollBounds()},dragStart:function(a){var b;fb.prototype.dragStart.apply(this,arguments),b=this.getCell(a.pageX,a.pageY),b&&this.cellOver(b)},drag:function(a,b,c){var d;fb.prototype.drag.apply(this,arguments),d=this.getCell(c.pageX,c.pageY),sa(d,this.cell)||(this.cell&&this.cellOut(),d&&this.cellOver(d))},dragStop:function(){this.cellDone(),fb.prototype.dragStop.apply(this,arguments)},cellOver:function(a){this.cell=a,this.trigger("cellOver",a,sa(a,this.origCell),this.origCell)},cellOut:function(){this.cell&&(this.trigger("cellOut",this.cell),this.cellDone(),this.cell=null)},cellDone:function(){this.cell&&this.trigger("cellDone",this.cell)},listenStop:function(){fb.prototype.listenStop.apply(this,arguments),this.origCell=this.cell=null,this.coordMap.clear()},scrollStop:function(){fb.prototype.scrollStop.apply(this,arguments),this.computeCoords()},getCell:function(a,b){return this.coordAdjust&&(a+=this.coordAdjust.left,b+=this.coordAdjust.top),this.coordMap.getCell(a,b)}}),hb=ra.extend({options:null,sourceEl:null,el:null,parentEl:null,top0:null,left0:null,mouseY0:null,mouseX0:null,topDelta:null,leftDelta:null,mousemoveProxy:null,isFollowing:!1,isHidden:!1,isAnimating:!1,constructor:function(b,c){this.options=c=c||{},this.sourceEl=b,this.parentEl=c.parentEl?a(c.parentEl):b.parent()},start:function(b){this.isFollowing||(this.isFollowing=!0,this.mouseY0=b.pageY,this.mouseX0=b.pageX,this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),a(document).on("mousemove",this.mousemoveProxy=ca(this,"mousemove")))},stop:function(b,c){function d(){this.isAnimating=!1,e.removeElement(),this.top0=this.left0=null,c&&c()}var e=this,f=this.options.revertDuration;this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,a(document).off("mousemove",this.mousemoveProxy),b&&f&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:f,complete:d})):d())},getEl:function(){var a=this.el;return a||(this.sourceEl.width(),a=this.el=this.sourceEl.clone().css({position:"absolute",visibility:"",display:this.isHidden?"none":"",margin:0,right:"auto",bottom:"auto",width:this.sourceEl.width(),height:this.sourceEl.height(),opacity:this.options.opacity||"",zIndex:this.options.zIndex}).appendTo(this.parentEl)),a},removeElement:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var a,b;this.getEl(),null===this.top0&&(this.sourceEl.width(),a=this.sourceEl.offset(),b=this.el.offsetParent().offset(),this.top0=a.top-b.top,this.left0=a.left-b.left),this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},mousemove:function(a){this.topDelta=a.pageY-this.mouseY0,this.leftDelta=a.pageX-this.mouseX0,this.isHidden||this.updatePosition()},hide:function(){this.isHidden||(this.isHidden=!0,this.el&&this.el.hide())},show:function(){this.isHidden&&(this.isHidden=!1,this.updatePosition(),this.getEl().show())}}),ib=ra.extend({view:null,isRTL:null,cellHtml:"<td/>",constructor:function(a){this.view=a,this.isRTL=a.opt("isRTL")},rowHtml:function(a,b){var c,d,e=this.getHtmlRenderer("cell",a),f="";for(b=b||0,c=0;c<this.colCnt;c++)d=this.getCell(b,c),f+=e(d);return f=this.bookendCells(f,a,b),"<tr>"+f+"</tr>"},bookendCells:function(a,b,c){var d=this.getHtmlRenderer("intro",b)(c||0),e=this.getHtmlRenderer("outro",b)(c||0),f=this.isRTL?e:d,g=this.isRTL?d:e;return"string"==typeof a?f+a+g:a.prepend(f).append(g)},getHtmlRenderer:function(a,b){var c,d,e,f,g=this.view;return c=a+"Html",b&&(d=b+_(a)+"Html"),d&&(f=g[d])?e=g:d&&(f=this[d])?e=this:(f=g[c])?e=g:(f=this[c])&&(e=this),"function"==typeof f?function(){return f.apply(e,arguments)||""}:function(){return f||""}}}),jb=Ma.Grid=ib.extend({start:null,end:null,rowCnt:0,colCnt:0,el:null,coordMap:null,elsByFill:null,externalDragStartProxy:null,colHeadFormat:null,eventTimeFormat:null,displayEventTime:null,displayEventEnd:null,cellDuration:null,largeUnit:null,constructor:function(){ib.apply(this,arguments),this.coordMap=new db(this),this.elsByFill={},this.externalDragStartProxy=ca(this,"externalDragStart")},computeColHeadFormat:function(){},computeEventTimeFormat:function(){return this.view.opt("smallTimeFormat")},computeDisplayEventTime:function(){return!0},computeDisplayEventEnd:function(){return!0},setRange:function(a){this.start=a.start.clone(),this.end=a.end.clone(),this.rangeUpdated(),this.processRangeOptions()},rangeUpdated:function(){},processRangeOptions:function(){var a,b,c=this.view;this.colHeadFormat=c.opt("columnFormat")||this.computeColHeadFormat(),this.eventTimeFormat=c.opt("eventTimeFormat")||c.opt("timeFormat")||this.computeEventTimeFormat(),a=c.opt("displayEventTime"),null==a&&(a=this.computeDisplayEventTime()),b=c.opt("displayEventEnd"),null==b&&(b=this.computeDisplayEventEnd()),this.displayEventTime=a,this.displayEventEnd=b},build:function(){},clear:function(){},rangeToSegs:function(a){},diffDates:function(a,b){return this.largeUnit?H(a,b,this.largeUnit):F(a,b)},getCell:function(b,c){var d;return null==c&&("number"==typeof b?(c=b%this.colCnt,b=Math.floor(b/this.colCnt)):(c=b.col,b=b.row)),d={row:b,col:c},a.extend(d,this.getRowData(b),this.getColData(c)),a.extend(d,this.computeCellRange(d)),d},computeCellRange:function(a){var b=this.computeCellDate(a);return{start:b,end:b.clone().add(this.cellDuration)}},computeCellDate:function(a){},getRowData:function(a){return{}},getColData:function(a){return{}},getRowEl:function(a){},getColEl:function(a){},getCellDayEl:function(a){return this.getColEl(a.col)||this.getRowEl(a.row)},computeRowCoords:function(){var a,b,c,d=[];for(a=0;a<this.rowCnt;a++)b=this.getRowEl(a),c=b.offset().top,d.push({top:c,bottom:c+b.outerHeight()});return d},computeColCoords:function(){var a,b,c,d=[];for(a=0;a<this.colCnt;a++)b=this.getColEl(a),c=b.offset().left,d.push({left:c,right:c+b.outerWidth()});return d},setElement:function(b){var c=this;this.el=b,b.on("mousedown",function(b){a(b.target).is(".fc-event-container *, .fc-more")||a(b.target).closest(".fc-popover").length||c.dayMousedown(b)}),this.bindSegHandlers(),this.bindGlobalHandlers()},removeElement:function(){this.unbindGlobalHandlers(),this.el.remove()},renderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},bindGlobalHandlers:function(){a(document).on("dragstart sortstart",this.externalDragStartProxy)},unbindGlobalHandlers:function(){a(document).off("dragstart sortstart",this.externalDragStartProxy)},dayMousedown:function(a){var b,c,d=this,e=this.view,f=e.opt("selectable"),i=new gb(this.coordMap,{scroll:e.opt("dragScroll"),dragStart:function(){e.unselect()},cellOver:function(a,e,h){h&&(b=e?a:null,f&&(c=d.computeSelection(h,a),c?d.renderSelection(c):g()))},cellOut:function(a){b=null,c=null,d.unrenderSelection(),h()},listenStop:function(a){b&&e.triggerDayClick(b,d.getCellDayEl(b),a),c&&e.reportSelection(c,a),h()}});i.mousedown(a)},renderRangeHelper:function(a,b){var c=this.fabricateHelperEvent(a,b);this.renderHelper(c,b)},fabricateHelperEvent:function(a,b){var c=b?R(b.event):{};return c.start=a.start.clone(),c.end=a.end?a.end.clone():null,c.allDay=null,this.view.calendar.normalizeEventRange(c),c.className=(c.className||[]).concat("fc-helper"),b||(c.editable=!1),c},renderHelper:function(a,b){},unrenderHelper:function(){},renderSelection:function(a){this.renderHighlight(this.selectionRangeToSegs(a))},unrenderSelection:function(){this.unrenderHighlight()},computeSelection:function(a,b){var c,d=[a.start,a.end,b.start,b.end];return d.sort(aa),c={start:d[0].clone(),end:d[3].clone()},this.view.calendar.isSelectionRangeAllowed(c)?c:null},selectionRangeToSegs:function(a){return this.rangeToSegs(a)},renderHighlight:function(a){this.renderFill("highlight",a)},unrenderHighlight:function(){this.unrenderFill("highlight")},highlightSegClasses:function(){return["fc-highlight"]},renderFill:function(a,b){},unrenderFill:function(a){var b=this.elsByFill[a];b&&(b.remove(),delete this.elsByFill[a])},renderFillSegEls:function(b,c){var d,e=this,f=this[b+"SegEl"],g="",h=[];if(c.length){for(d=0;d<c.length;d++)g+=this.fillSegHtml(b,c[d]);a(g).each(function(b,d){var g=c[b],i=a(d);f&&(i=f.call(e,g,i)),i&&(i=a(i),i.is(e.fillSegTag)&&(g.el=i,h.push(g)))})}return h},fillSegTag:"div",fillSegHtml:function(a,b){var c=this[a+"SegClasses"],d=this[a+"SegCss"],e=c?c.call(this,b):[],f=$(d?d.call(this,b):{});return"<"+this.fillSegTag+(e.length?' class="'+e.join(" ")+'"':"")+(f?' style="'+f+'"':"")+" />"},headHtml:function(){return'<div class="fc-row '+this.view.widgetHeaderClass+'"><table><thead>'+this.rowHtml("head")+"</thead></table></div>"},headCellHtml:function(a){var b=this.view,c=a.start;return'<th class="fc-day-header '+b.widgetHeaderClass+" fc-"+Qa[c.day()]+'">'+Y(c.format(this.colHeadFormat))+"</th>"},bgCellHtml:function(a){var b=this.view,c=a.start,d=this.getDayClasses(c);return d.unshift("fc-day",b.widgetContentClass),'<td class="'+d.join(" ")+'" data-date="'+c.format("YYYY-MM-DD")+'"></td>'},getDayClasses:function(a){var b=this.view,c=b.calendar.getNow().stripTime(),d=["fc-"+Qa[a.day()]];return 1==b.intervalDuration.as("months")&&a.month()!=b.intervalStart.month()&&d.push("fc-other-month"),a.isSame(c,"day")?d.push("fc-today",b.highlightStateClass):c>a?d.push("fc-past"):d.push("fc-future"),d}});jb.mixin({mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,isDraggingExternal:!1,segs:null,renderEvents:function(a){var b,c,d=this.eventsToSegs(a),e=[],f=[];for(b=0;b<d.length;b++)c=d[b],ta(c.event)?e.push(c):f.push(c);e=this.renderBgSegs(e)||e,f=this.renderFgSegs(f)||f,this.segs=e.concat(f)},unrenderEvents:function(){this.triggerSegMouseout(),this.unrenderFgSegs(),this.unrenderBgSegs(),this.segs=null},getEventSegs:function(){return this.segs||[]},renderFgSegs:function(a){},unrenderFgSegs:function(){},renderFgSegEls:function(b,c){var d,e=this.view,f="",g=[];if(b.length){for(d=0;d<b.length;d++)f+=this.fgSegHtml(b[d],c);a(f).each(function(c,d){var f=b[c],h=e.resolveEventEl(f.event,a(d));h&&(h.data("fc-seg",f),f.el=h,g.push(f))})}return g},fgSegHtml:function(a,b){},renderBgSegs:function(a){return this.renderFill("bgEvent",a)},unrenderBgSegs:function(){this.unrenderFill("bgEvent")},bgEventSegEl:function(a,b){return this.view.resolveEventEl(a.event,b)},bgEventSegClasses:function(a){var b=a.event,c=b.source||{};return["fc-bgevent"].concat(b.className,c.className||[])},bgEventSegCss:function(a){var b=this.view,c=a.event,d=c.source||{};return{"background-color":c.backgroundColor||c.color||d.backgroundColor||d.color||b.opt("eventBackgroundColor")||b.opt("eventColor")}},businessHoursSegClasses:function(a){return["fc-nonbusiness","fc-bgevent"]},bindSegHandlers:function(){var b=this,c=this.view;a.each({mouseenter:function(a,c){b.triggerSegMouseover(a,c)},mouseleave:function(a,c){b.triggerSegMouseout(a,c)},click:function(a,b){return c.trigger("eventClick",this,a.event,b)},mousedown:function(d,e){a(e.target).is(".fc-resizer")&&c.isEventResizable(d.event)?b.segResizeMousedown(d,e,a(e.target).is(".fc-start-resizer")):c.isEventDraggable(d.event)&&b.segDragMousedown(d,e)}},function(c,d){b.el.on(c,".fc-event-container > *",function(c){var e=a(this).data("fc-seg");return!e||b.isDraggingSeg||b.isResizingSeg?void 0:d.call(this,e,c)})})},triggerSegMouseover:function(a,b){this.mousedOverSeg||(this.mousedOverSeg=a,this.view.trigger("eventMouseover",a.el[0],a.event,b))},triggerSegMouseout:function(a,b){b=b||{},this.mousedOverSeg&&(a=a||this.mousedOverSeg,this.mousedOverSeg=null,this.view.trigger("eventMouseout",a.el[0],a.event,b))},segDragMousedown:function(a,b){var c,d=this,e=this.view,f=e.calendar,i=a.el,j=a.event,k=new hb(a.el,{parentEl:e.el,opacity:e.opt("dragOpacity"),revertDuration:e.opt("dragRevertDuration"),zIndex:2}),l=new gb(e.coordMap,{distance:5,scroll:e.opt("dragScroll"),subjectEl:i,subjectCenter:!0,listenStart:function(a){k.hide(),k.start(a)},dragStart:function(b){d.triggerSegMouseout(a,b),d.segDragStart(a,b),e.hideEvent(j)},cellOver:function(b,h,i){a.cell&&(i=a.cell),c=d.computeEventDrop(i,b,j),c&&!f.isEventRangeAllowed(c,j)&&(g(),c=null),c&&e.renderDrag(c,a)?k.hide():k.show(),h&&(c=null)},cellOut:function(){e.unrenderDrag(),k.show(),c=null},cellDone:function(){h()},dragStop:function(b){k.stop(!c,function(){e.unrenderDrag(),e.showEvent(j),d.segDragStop(a,b),c&&e.reportEventDrop(j,c,this.largeUnit,i,b)})},listenStop:function(){k.stop()}});l.mousedown(b)},segDragStart:function(a,b){this.isDraggingSeg=!0,this.view.trigger("eventDragStart",a.el[0],a.event,b,{})},segDragStop:function(a,b){this.isDraggingSeg=!1,this.view.trigger("eventDragStop",a.el[0],a.event,b,{})},computeEventDrop:function(a,b,c){var d,e,f=this.view.calendar,g=a.start,h=b.start;return g.hasTime()===h.hasTime()?(d=this.diffDates(h,g),c.allDay&&N(d)?(e={start:c.start.clone(),end:f.getEventEnd(c),allDay:!1},f.normalizeEventRangeTimes(e)):e={start:c.start.clone(),end:c.end?c.end.clone():null,allDay:c.allDay},e.start.add(d),e.end&&e.end.add(d)):e={start:h.clone(),end:null,allDay:!h.hasTime()},e},applyDragOpacity:function(a){var b=this.view.opt("dragOpacity");null!=b&&a.each(function(a,c){c.style.opacity=b})},externalDragStart:function(b,c){var d,e,f=this.view;f.opt("droppable")&&(d=a((c?c.item:null)||b.target),e=f.opt("dropAccept"),(a.isFunction(e)?e.call(d[0],d):d.is(e))&&(this.isDraggingExternal||this.listenToExternalDrag(d,b,c)))},listenToExternalDrag:function(a,b,c){var d,e,f=this,i=ya(a);d=new gb(this.coordMap,{listenStart:function(){f.isDraggingExternal=!0},cellOver:function(a){e=f.computeExternalDrop(a,i),e?f.renderDrag(e):g()},cellOut:function(){e=null,f.unrenderDrag(),h()},dragStop:function(){f.unrenderDrag(),h(),e&&f.view.reportExternalDrop(i,e,a,b,c)},listenStop:function(){f.isDraggingExternal=!1}}),d.startDrag(b)},computeExternalDrop:function(a,b){var c={start:a.start.clone(),end:null};return b.startTime&&!c.start.hasTime()&&c.start.time(b.startTime),b.duration&&(c.end=c.start.clone().add(b.duration)),this.view.calendar.isExternalDropRangeAllowed(c,b.eventProps)?c:null},renderDrag:function(a,b){},unrenderDrag:function(){},segResizeMousedown:function(a,b,c){var d,e,f=this,i=this.view,j=i.calendar,k=a.el,l=a.event,m=j.getEventEnd(l);d=new gb(this.coordMap,{distance:5,scroll:i.opt("dragScroll"),subjectEl:k,dragStart:function(b){f.triggerSegMouseout(a,b),f.segResizeStart(a,b)},cellOver:function(b,d,h){e=c?f.computeEventStartResize(h,b,l):f.computeEventEndResize(h,b,l),e&&(j.isEventRangeAllowed(e,l)?e.start.isSame(l.start)&&e.end.isSame(m)&&(e=null):(g(),e=null)),e&&(i.hideEvent(l),f.renderEventResize(e,a))},cellOut:function(){e=null},cellDone:function(){f.unrenderEventResize(),i.showEvent(l),h()},dragStop:function(b){f.segResizeStop(a,b),e&&i.reportEventResize(l,e,this.largeUnit,k,b)}}),d.mousedown(b)},segResizeStart:function(a,b){this.isResizingSeg=!0,this.view.trigger("eventResizeStart",a.el[0],a.event,b,{})},segResizeStop:function(a,b){this.isResizingSeg=!1,this.view.trigger("eventResizeStop",a.el[0],a.event,b,{})},computeEventStartResize:function(a,b,c){return this.computeEventResize("start",a,b,c)},computeEventEndResize:function(a,b,c){return this.computeEventResize("end",a,b,c)},computeEventResize:function(a,b,c,d){var e,f,g=this.view.calendar,h=this.diffDates(c[a],b[a]);return e={start:d.start.clone(),end:g.getEventEnd(d),allDay:d.allDay},e.allDay&&N(h)&&(e.allDay=!1,g.normalizeEventRangeTimes(e)),e[a].add(h),e.start.isBefore(e.end)||(f=d.allDay?g.defaultAllDayEventDuration:g.defaultTimedEventDuration,this.cellDuration&&this.cellDuration<f&&(f=this.cellDuration),"start"==a?e.start=e.end.clone().subtract(f):e.end=e.start.clone().add(f)),e},renderEventResize:function(a,b){},unrenderEventResize:function(){},getEventTimeText:function(a,b,c){return null==b&&(b=this.eventTimeFormat),null==c&&(c=this.displayEventEnd),this.displayEventTime&&a.start.hasTime()?c&&a.end?this.view.formatRange(a,b):a.start.format(b):""},getSegClasses:function(a,b,c){var d=a.event,e=["fc-event",a.isStart?"fc-start":"fc-not-start",a.isEnd?"fc-end":"fc-not-end"].concat(d.className,d.source?d.source.className:[]);return b&&e.push("fc-draggable"),c&&e.push("fc-resizable"),e},getEventSkinCss:function(a){var b=this.view,c=a.source||{},d=a.color,e=c.color,f=b.opt("eventColor");return{"background-color":a.backgroundColor||d||c.backgroundColor||e||b.opt("eventBackgroundColor")||f,"border-color":a.borderColor||d||c.borderColor||e||b.opt("eventBorderColor")||f,color:a.textColor||c.textColor||b.opt("eventTextColor")}},eventsToSegs:function(a,b){var c,d=this.eventsToRanges(a),e=[];for(c=0;c<d.length;c++)e.push.apply(e,this.eventRangeToSegs(d[c],b));return e},eventsToRanges:function(b){var c=this,d=wa(b),e=[];return a.each(d,function(a,b){b.length&&e.push.apply(e,ua(b[0])?c.eventsToInverseRanges(b):c.eventsToNormalRanges(b))}),e},eventsToNormalRanges:function(a){var b,c,d,e,f=this.view.calendar,g=[];for(b=0;b<a.length;b++)c=a[b],d=c.start.clone().stripZone(),e=f.getEventEnd(c).stripZone(),g.push({event:c,start:d,end:e,eventStartMS:+d,eventDurationMS:e-d});return g},eventsToInverseRanges:function(a){var b,c,d=this.view,e=d.start.clone().stripZone(),f=d.end.clone().stripZone(),g=this.eventsToNormalRanges(a),h=[],i=a[0],j=e;for(g.sort(xa),b=0;b<g.length;b++)c=g[b],c.start>j&&h.push({event:i,start:j,end:c.start}),j=c.end;return f>j&&h.push({event:i,start:j,end:f}),h},eventRangeToSegs:function(a,b){var c,d,e;for(a=this.view.calendar.ensureVisibleEventRange(a),c=b?b(a):this.rangeToSegs(a),d=0;d<c.length;d++)e=c[d],e.event=a.event,e.eventStartMS=a.eventStartMS,e.eventDurationMS=a.eventDurationMS;return c},sortSegs:function(a){a.sort(ca(this,"compareSegs"))},compareSegs:function(a,b){return a.eventStartMS-b.eventStartMS||b.eventDurationMS-a.eventDurationMS||b.event.allDay-a.event.allDay||B(a.event,b.event,this.view.eventOrderSpecs)}}),Ma.dataAttrPrefix="";var kb=jb.extend({numbersVisible:!1,bottomCoordPadding:0,breakOnWeeks:null,cellDates:null,dayToCellOffsets:null,rowEls:null,dayEls:null,helperEls:null,constructor:function(){jb.apply(this,arguments),this.cellDuration=b.duration(1,"day")},renderDates:function(a){var b,c,d,e=this.view,f=this.rowCnt,g=this.colCnt,h=f*g,i="";for(b=0;f>b;b++)i+=this.dayRowHtml(b,a);for(this.el.html(i),this.rowEls=this.el.find(".fc-row"),this.dayEls=this.el.find(".fc-day"),c=0;h>c;c++)d=this.getCell(c),e.trigger("dayRender",null,d.start,this.dayEls.eq(c))},unrenderDates:function(){this.removeSegPopover()},renderBusinessHours:function(){var a=this.view.calendar.getBusinessHoursEvents(!0),b=this.eventsToSegs(a);this.renderFill("businessHours",b,"bgevent")},dayRowHtml:function(a,b){var c=this.view,d=["fc-row","fc-week",c.widgetContentClass];return b&&d.push("fc-rigid"),'<div class="'+d.join(" ")+'"><div class="fc-bg"><table>'+this.rowHtml("day",a)+'</table></div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.rowHtml("number",a)+"</thead>":"")+"</table></div></div>"},dayCellHtml:function(a){return this.bgCellHtml(a)},computeColHeadFormat:function(){return this.rowCnt>1?"ddd":this.colCnt>1?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("extraSmallTimeFormat")},computeDisplayEventEnd:function(){return 1==this.colCnt},rangeUpdated:function(){var a,b,c,d;if(this.updateCellDates(),a=this.cellDates,this.breakOnWeeks){for(b=a[0].day(),d=1;d<a.length&&a[d].day()!=b;d++);c=Math.ceil(a.length/d)}else c=1,d=a.length;this.rowCnt=c,this.colCnt=d},updateCellDates:function(){for(var a=this.view,b=this.start.clone(),c=[],d=-1,e=[];b.isBefore(this.end);)a.isHiddenDay(b)?e.push(d+.5):(d++,e.push(d),c.push(b.clone())),b.add(1,"days");this.cellDates=c,this.dayToCellOffsets=e},computeCellDate:function(a){var b=this.colCnt,c=a.row*b+(this.isRTL?b-a.col-1:a.col);return this.cellDates[c].clone()},getRowEl:function(a){return this.rowEls.eq(a)},getColEl:function(a){return this.dayEls.eq(a)},getCellDayEl:function(a){return this.dayEls.eq(a.row*this.colCnt+a.col)},computeRowCoords:function(){var a=jb.prototype.computeRowCoords.call(this);return a[a.length-1].bottom+=this.bottomCoordPadding,a},rangeToSegs:function(a){var b,c,d,e,f,g,h,i,j,k,l=this.isRTL,m=this.rowCnt,n=this.colCnt,o=[];for(a=this.view.computeDayRange(a),b=this.dateToCellOffset(a.start),c=this.dateToCellOffset(a.end.subtract(1,"days")),d=0;m>d;d++)e=d*n,f=e+n-1,i=Math.max(e,b),j=Math.min(f,c),i=Math.ceil(i),j=Math.floor(j),j>=i&&(g=i===b,h=j===c,i-=e,j-=e,k={row:d,isStart:g,isEnd:h},l?(k.leftCol=n-j-1,k.rightCol=n-i-1):(k.leftCol=i,k.rightCol=j),o.push(k));return o},dateToCellOffset:function(a){var b=this.dayToCellOffsets,c=a.diff(this.start,"days");return 0>c?b[0]-1:c>=b.length?b[b.length-1]+1:b[c]},renderDrag:function(a,b){return this.renderHighlight(this.eventRangeToSegs(a)),b&&!b.el.closest(this.el).length?(this.renderRangeHelper(a,b),this.applyDragOpacity(this.helperEls),!0):void 0},unrenderDrag:function(){this.unrenderHighlight(),this.unrenderHelper()},renderEventResize:function(a,b){this.renderHighlight(this.eventRangeToSegs(a)),this.renderRangeHelper(a,b)},unrenderEventResize:function(){this.unrenderHighlight(),this.unrenderHelper()},renderHelper:function(b,c){var d,e=[],f=this.eventsToSegs([b]);f=this.renderFgSegEls(f),d=this.renderSegRows(f),this.rowEls.each(function(b,f){var g,h=a(f),i=a('<div class="fc-helper-skeleton"><table/></div>');g=c&&c.row===b?c.el.position().top:h.find(".fc-content-skeleton tbody").position().top,i.css("top",g).find("table").append(d[b].tbodyEl),h.append(i),e.push(i[0])}),this.helperEls=a(e)},unrenderHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},fillSegTag:"td",renderFill:function(b,c,d){var e,f,g,h=[];for(c=this.renderFillSegEls(b,c),e=0;e<c.length;e++)f=c[e],g=this.renderFillRow(b,f,d),this.rowEls.eq(f.row).append(g),h.push(g[0]);return this.elsByFill[b]=a(h),c},renderFillRow:function(b,c,d){var e,f,g=this.colCnt,h=c.leftCol,i=c.rightCol+1;return d=d||b.toLowerCase(),e=a('<div class="fc-'+d+'-skeleton"><table><tr/></table></div>'),f=e.find("tr"),h>0&&f.append('<td colspan="'+h+'"/>'),f.append(c.el.attr("colspan",i-h)),g>i&&f.append('<td colspan="'+(g-i)+'"/>'),this.bookendCells(f,b),e}});kb.mixin({rowStructs:null,unrenderEvents:function(){this.removeSegPopover(),jb.prototype.unrenderEvents.apply(this,arguments)},getEventSegs:function(){return jb.prototype.getEventSegs.call(this).concat(this.popoverSegs||[])},renderBgSegs:function(b){var c=a.grep(b,function(a){return a.event.allDay});return jb.prototype.renderBgSegs.call(this,c)},renderFgSegs:function(b){var c;return b=this.renderFgSegEls(b),c=this.rowStructs=this.renderSegRows(b),this.rowEls.each(function(b,d){a(d).find(".fc-content-skeleton > table").append(c[b].tbodyEl)}),b},unrenderFgSegs:function(){for(var a,b=this.rowStructs||[];a=b.pop();)a.tbodyEl.remove();this.rowStructs=null},renderSegRows:function(a){var b,c,d=[];for(b=this.groupSegRows(a),c=0;c<b.length;c++)d.push(this.renderSegRow(c,b[c]));return d},fgSegHtml:function(a,b){var c,d,e=this.view,f=a.event,g=e.isEventDraggable(f),h=!b&&f.allDay&&a.isStart&&e.isEventResizableFromStart(f),i=!b&&f.allDay&&a.isEnd&&e.isEventResizableFromEnd(f),j=this.getSegClasses(a,g,h||i),k=$(this.getEventSkinCss(f)),l="";return j.unshift("fc-day-grid-event","fc-h-event"),a.isStart&&(c=this.getEventTimeText(f),c&&(l='<span class="fc-time">'+Y(c)+"</span>")),d='<span class="fc-title">'+(Y(f.title||"")||" ")+"</span>",'<a class="'+j.join(" ")+'"'+(f.url?' href="'+Y(f.url)+'"':"")+(k?' style="'+k+'"':"")+'><div class="fc-content">'+(this.isRTL?d+" "+l:l+" "+d)+"</div>"+(h?'<div class="fc-resizer fc-start-resizer" />':"")+(i?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},renderSegRow:function(b,c){function d(b){for(;b>g;)k=(r[e-1]||[])[g],k?k.attr("rowspan",parseInt(k.attr("rowspan")||1,10)+1):(k=a("<td/>"),h.append(k)),q[e][g]=k,r[e][g]=k,g++}var e,f,g,h,i,j,k,l=this.colCnt,m=this.buildSegLevels(c),n=Math.max(1,m.length),o=a("<tbody/>"),p=[],q=[],r=[];for(e=0;n>e;e++){if(f=m[e],g=0,h=a("<tr/>"),p.push([]),q.push([]),r.push([]),f)for(i=0;i<f.length;i++){for(j=f[i],d(j.leftCol),k=a('<td class="fc-event-container"/>').append(j.el),j.leftCol!=j.rightCol?k.attr("colspan",j.rightCol-j.leftCol+1):r[e][g]=k;g<=j.rightCol;)q[e][g]=k,p[e][g]=j,g++;h.append(k)}d(l),this.bookendCells(h,"eventSkeleton"),o.append(h)}return{row:b,tbodyEl:o,cellMatrix:q,segMatrix:p,segLevels:m,segs:c}},buildSegLevels:function(a){var b,c,d,e=[];for(this.sortSegs(a),b=0;b<a.length;b++){for(c=a[b],d=0;d<e.length&&za(c,e[d]);d++);c.level=d,(e[d]||(e[d]=[])).push(c)}for(d=0;d<e.length;d++)e[d].sort(Aa);return e},groupSegRows:function(a){var b,c=[];for(b=0;b<this.rowCnt;b++)c.push([]);for(b=0;b<a.length;b++)c[a[b].row].push(a[b]);return c}}),kb.mixin({segPopover:null,popoverSegs:null,removeSegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(a){var b,c,d=this.rowStructs||[];for(b=0;b<d.length;b++)this.unlimitRow(b),c=a?"number"==typeof a?a:this.computeRowLevelLimit(b):!1,c!==!1&&this.limitRow(b,c)},computeRowLevelLimit:function(b){function c(b,c){f=Math.max(f,a(c).outerHeight())}var d,e,f,g=this.rowEls.eq(b),h=g.height(),i=this.rowStructs[b].tbodyEl.children();for(d=0;d<i.length;d++)if(e=i.eq(d).removeClass("fc-limited"),f=0,e.find("> td > :first-child").each(c),e.position().top+f>h)return d;return!1},limitRow:function(b,c){function d(d){for(;d>x;)e=u.getCell(b,x),k=u.getCellSegs(e,c),k.length&&(n=g[c-1][x],t=u.renderMoreLink(e,k),s=a("<div/>").append(t),n.append(s),w.push(s[0])),x++}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=this,v=this.rowStructs[b],w=[],x=0;if(c&&c<v.segLevels.length){for(f=v.segLevels[c-1],g=v.cellMatrix,h=v.tbodyEl.children().slice(c).addClass("fc-limited").get(),i=0;i<f.length;i++){for(j=f[i],d(j.leftCol),m=[],l=0;x<=j.rightCol;)e=this.getCell(b,x),k=this.getCellSegs(e,c),m.push(k),l+=k.length,x++;if(l){for(n=g[c-1][j.leftCol],o=n.attr("rowspan")||1,p=[],q=0;q<m.length;q++)r=a('<td class="fc-more-cell"/>').attr("rowspan",o),k=m[q],e=this.getCell(b,j.leftCol+q),t=this.renderMoreLink(e,[j].concat(k)),s=a("<div/>").append(t),r.append(s),p.push(r[0]),w.push(r[0]);n.addClass("fc-limited").after(a(p)),h.push(n[0])}}d(this.colCnt),v.moreEls=a(w),v.limitedEls=a(h)}},unlimitRow:function(a){var b=this.rowStructs[a];b.moreEls&&(b.moreEls.remove(),b.moreEls=null),b.limitedEls&&(b.limitedEls.removeClass("fc-limited"),b.limitedEls=null)},renderMoreLink:function(b,c){var d=this,e=this.view;return a('<a class="fc-more"/>').text(this.getMoreLinkText(c.length)).on("click",function(f){var g=e.opt("eventLimitClick"),h=b.start,i=a(this),j=d.getCellDayEl(b),k=d.getCellSegs(b),l=d.resliceDaySegs(k,h),m=d.resliceDaySegs(c,h);"function"==typeof g&&(g=e.trigger("eventLimitClick",null,{date:h,dayEl:j,moreEl:i,segs:l,hiddenSegs:m},f)),"popover"===g?d.showSegPopover(b,i,l):"string"==typeof g&&e.calendar.zoomTo(h,g)})},showSegPopover:function(a,b,c){var d,e,f=this,g=this.view,h=b.parent();d=1==this.rowCnt?g.el:this.rowEls.eq(a.row),e={className:"fc-more-popover",content:this.renderSegPopoverContent(a,c),parentEl:this.el,top:d.offset().top,autoHide:!0,viewportConstrain:g.opt("popoverViewportConstrain"),hide:function(){f.segPopover.removeElement(),f.segPopover=null,f.popoverSegs=null}},this.isRTL?e.right=h.offset().left+h.outerWidth()+1:e.left=h.offset().left-1,this.segPopover=new cb(e),this.segPopover.show()},renderSegPopoverContent:function(b,c){var d,e=this.view,f=e.opt("theme"),g=b.start.format(e.opt("dayPopoverFormat")),h=a('<div class="fc-header '+e.widgetHeaderClass+'"><span class="fc-close '+(f?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"></span><span class="fc-title">'+Y(g)+'</span><div class="fc-clear"/></div><div class="fc-body '+e.widgetContentClass+'"><div class="fc-event-container"></div></div>'),i=h.find(".fc-event-container");for(c=this.renderFgSegEls(c,!0),this.popoverSegs=c,d=0;d<c.length;d++)c[d].cell=b,i.append(c[d].el);return h},resliceDaySegs:function(b,c){var d=a.map(b,function(a){return a.event}),e=c.clone().stripTime(),f=e.clone().add(1,"days"),g={start:e,end:f};return b=this.eventsToSegs(d,function(a){var b=E(a,g);return b?[b]:[]}),this.sortSegs(b),b},getMoreLinkText:function(a){var b=this.view.opt("eventLimitText");return"function"==typeof b?b(a):"+"+a+" "+b},getCellSegs:function(a,b){for(var c,d=this.rowStructs[a.row].segMatrix,e=b||0,f=[];e<d.length;)c=d[e][a.col],c&&f.push(c),e++;return f}});var lb=jb.extend({slotDuration:null,snapDuration:null,minTime:null,maxTime:null,colDates:null,labelFormat:null,labelInterval:null,dayEls:null,slatEls:null,slatTops:null,helperEl:null,businessHourSegs:null,constructor:function(){jb.apply(this,arguments),this.processOptions()},renderDates:function(){this.el.html(this.renderHtml()),this.dayEls=this.el.find(".fc-day"),this.slatEls=this.el.find(".fc-slats tr")},renderBusinessHours:function(){var a=this.view.calendar.getBusinessHoursEvents();this.businessHourSegs=this.renderFill("businessHours",this.eventsToSegs(a),"bgevent")},renderHtml:function(){return'<div class="fc-bg"><table>'+this.rowHtml("slotBg")+'</table></div><div class="fc-slats"><table>'+this.slatRowHtml()+"</table></div>"},slotBgCellHtml:function(a){return this.bgCellHtml(a)},slatRowHtml:function(){for(var a,c,d,e=this.view,f=this.isRTL,g="",h=b.duration(+this.minTime);h<this.maxTime;)a=this.start.clone().time(h),c=ba(L(h,this.labelInterval)),d='<td class="fc-axis fc-time '+e.widgetContentClass+'" '+e.axisStyleAttr()+">"+(c?"<span>"+Y(a.format(this.labelFormat))+"</span>":"")+"</td>",g+="<tr "+(c?"":'class="fc-minor"')+">"+(f?"":d)+'<td class="'+e.widgetContentClass+'"/>'+(f?d:"")+"</tr>",h.add(this.slotDuration);return g},processOptions:function(){var c,d=this.view,e=d.opt("slotDuration"),f=d.opt("snapDuration");e=b.duration(e),f=f?b.duration(f):e,this.slotDuration=e,this.snapDuration=f,this.cellDuration=f,this.minTime=b.duration(d.opt("minTime")),this.maxTime=b.duration(d.opt("maxTime")),c=d.opt("slotLabelFormat"),a.isArray(c)&&(c=c[c.length-1]),this.labelFormat=c||d.opt("axisFormat")||d.opt("smallTimeFormat"),c=d.opt("slotLabelInterval"),this.labelInterval=c?b.duration(c):this.computeLabelInterval(e)},computeLabelInterval:function(a){var c,d,e;for(c=yb.length-1;c>=0;c--)if(d=b.duration(yb[c]),e=L(d,a),ba(e)&&e>1)return d;return b.duration(a)},computeColHeadFormat:function(){return this.colCnt>1?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("noMeridiemTimeFormat")},computeDisplayEventEnd:function(){return!0},rangeUpdated:function(){var a,b=this.view,c=[];for(a=this.start.clone();a.isBefore(this.end);)c.push(a.clone()),a.add(1,"day"),a=b.skipHiddenDays(a);this.isRTL&&c.reverse(),this.colDates=c,this.colCnt=c.length,this.rowCnt=Math.ceil((this.maxTime-this.minTime)/this.snapDuration)},computeCellDate:function(a){var b=this.colDates[a.col],c=this.computeSnapTime(a.row);return b=this.view.calendar.rezoneDate(b),b.time(c),b},getColEl:function(a){return this.dayEls.eq(a)},computeSnapTime:function(a){return b.duration(this.minTime+this.snapDuration*a)},rangeToSegs:function(a){var b,c,d,e,f=this.colCnt,g=[];for(a={start:a.start.clone().stripZone(),end:a.end.clone().stripZone()},c=0;f>c;c++)d=this.colDates[c],e={start:d.clone().time(this.minTime),end:d.clone().time(this.maxTime)},b=E(a,e),b&&(b.col=c,g.push(b));return g},updateSize:function(a){this.computeSlatTops(),a&&this.updateSegVerticals()},computeRowCoords:function(){var a,b,c=this.el.offset().top,d=[];for(a=0;a<this.rowCnt;a++)b={top:c+this.computeTimeTop(this.computeSnapTime(a))},a>0&&(d[a-1].bottom=b.top),d.push(b);return b.bottom=b.top+this.computeTimeTop(this.computeSnapTime(a)),d},computeDateTop:function(a,c){return this.computeTimeTop(b.duration(a.clone().stripZone()-c.clone().stripTime()))},computeTimeTop:function(a){var b,c,d,e,f=(a-this.minTime)/this.slotDuration;return f=Math.max(0,f),f=Math.min(this.slatEls.length,f),b=Math.floor(f),c=f-b,d=this.slatTops[b],c?(e=this.slatTops[b+1],d+(e-d)*c):d},computeSlatTops:function(){var b,c=[];this.slatEls.each(function(d,e){b=a(e).position().top, 21 c.push(b)}),c.push(b+this.slatEls.last().outerHeight()),this.slatTops=c},renderDrag:function(a,b){return b?(this.renderRangeHelper(a,b),this.applyDragOpacity(this.helperEl),!0):void this.renderHighlight(this.eventRangeToSegs(a))},unrenderDrag:function(){this.unrenderHelper(),this.unrenderHighlight()},renderEventResize:function(a,b){this.renderRangeHelper(a,b)},unrenderEventResize:function(){this.unrenderHelper()},renderHelper:function(b,c){var d,e,f,g,h=this.eventsToSegs([b]);for(h=this.renderFgSegEls(h),d=this.renderSegTable(h),e=0;e<h.length;e++)f=h[e],c&&c.col===f.col&&(g=c.el,f.el.css({left:g.css("left"),right:g.css("right"),"margin-left":g.css("margin-left"),"margin-right":g.css("margin-right")}));this.helperEl=a('<div class="fc-helper-skeleton"/>').append(d).appendTo(this.el)},unrenderHelper:function(){this.helperEl&&(this.helperEl.remove(),this.helperEl=null)},renderSelection:function(a){this.view.opt("selectHelper")?this.renderRangeHelper(a):this.renderHighlight(this.selectionRangeToSegs(a))},unrenderSelection:function(){this.unrenderHelper(),this.unrenderHighlight()},renderFill:function(b,c,d){var e,f,g,h,i,j,k,l,m,n;if(c.length){for(c=this.renderFillSegEls(b,c),e=this.groupSegCols(c),d=d||b.toLowerCase(),f=a('<div class="fc-'+d+'-skeleton"><table><tr/></table></div>'),g=f.find("tr"),h=0;h<e.length;h++)if(i=e[h],j=a("<td/>").appendTo(g),i.length)for(k=a('<div class="fc-'+d+'-container"/>').appendTo(j),l=this.colDates[h],m=0;m<i.length;m++)n=i[m],k.append(n.el.css({top:this.computeDateTop(n.start,l),bottom:-this.computeDateTop(n.end,l)}));this.bookendCells(g,b),this.el.append(f),this.elsByFill[b]=f}return c}});lb.mixin({eventSkeletonEl:null,renderFgSegs:function(b){return b=this.renderFgSegEls(b),this.el.append(this.eventSkeletonEl=a('<div class="fc-content-skeleton"/>').append(this.renderSegTable(b))),b},unrenderFgSegs:function(a){this.eventSkeletonEl&&(this.eventSkeletonEl.remove(),this.eventSkeletonEl=null)},renderSegTable:function(b){var c,d,e,f,g,h,i=a("<table><tr/></table>"),j=i.find("tr");for(c=this.groupSegCols(b),this.computeSegVerticals(b),f=0;f<c.length;f++){for(g=c[f],this.placeSlotSegs(g),h=a('<div class="fc-event-container"/>'),d=0;d<g.length;d++)e=g[d],e.el.css(this.generateSegPositionCss(e)),e.bottom-e.top<30&&e.el.addClass("fc-short"),h.append(e.el);j.append(a("<td/>").append(h))}return this.bookendCells(j,"eventSkeleton"),i},placeSlotSegs:function(a){var b,c,d;if(this.sortSegs(a),b=Ba(a),Ca(b),c=b[0]){for(d=0;d<c.length;d++)Da(c[d]);for(d=0;d<c.length;d++)this.computeSlotSegCoords(c[d],0,0)}},computeSlotSegCoords:function(a,b,c){var d,e=a.forwardSegs;if(void 0===a.forwardCoord)for(e.length?(this.sortForwardSlotSegs(e),this.computeSlotSegCoords(e[0],b+1,c),a.forwardCoord=e[0].backwardCoord):a.forwardCoord=1,a.backwardCoord=a.forwardCoord-(a.forwardCoord-c)/(b+1),d=0;d<e.length;d++)this.computeSlotSegCoords(e[d],0,a.forwardCoord)},updateSegVerticals:function(){var a,b=(this.segs||[]).concat(this.businessHourSegs||[]);for(this.computeSegVerticals(b),a=0;a<b.length;a++)b[a].el.css(this.generateSegVerticalCss(b[a]))},computeSegVerticals:function(a){var b,c;for(b=0;b<a.length;b++)c=a[b],c.top=this.computeDateTop(c.start,c.start),c.bottom=this.computeDateTop(c.end,c.start)},fgSegHtml:function(a,b){var c,d,e,f=this.view,g=a.event,h=f.isEventDraggable(g),i=!b&&a.isStart&&f.isEventResizableFromStart(g),j=!b&&a.isEnd&&f.isEventResizableFromEnd(g),k=this.getSegClasses(a,h,i||j),l=$(this.getEventSkinCss(g));return k.unshift("fc-time-grid-event","fc-v-event"),f.isMultiDayEvent(g)?(a.isStart||a.isEnd)&&(c=this.getEventTimeText(a),d=this.getEventTimeText(a,"LT"),e=this.getEventTimeText(a,null,!1)):(c=this.getEventTimeText(g),d=this.getEventTimeText(g,"LT"),e=this.getEventTimeText(g,null,!1)),'<a class="'+k.join(" ")+'"'+(g.url?' href="'+Y(g.url)+'"':"")+(l?' style="'+l+'"':"")+'><div class="fc-content">'+(c?'<div class="fc-time" data-start="'+Y(e)+'" data-full="'+Y(d)+'"><span>'+Y(c)+"</span></div>":"")+(g.title?'<div class="fc-title">'+Y(g.title)+"</div>":"")+'</div><div class="fc-bg"/>'+(j?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},generateSegPositionCss:function(a){var b,c,d=this.view.opt("slotEventOverlap"),e=a.backwardCoord,f=a.forwardCoord,g=this.generateSegVerticalCss(a);return d&&(f=Math.min(1,e+2*(f-e))),this.isRTL?(b=1-f,c=e):(b=e,c=1-f),g.zIndex=a.level+1,g.left=100*b+"%",g.right=100*c+"%",d&&a.forwardPressure&&(g[this.isRTL?"marginLeft":"marginRight"]=20),g},generateSegVerticalCss:function(a){return{top:a.top,bottom:-a.bottom}},groupSegCols:function(a){var b,c=[];for(b=0;b<this.colCnt;b++)c.push([]);for(b=0;b<a.length;b++)c[a[b].col].push(a[b]);return c},sortForwardSlotSegs:function(a){a.sort(ca(this,"compareForwardSlotSegs"))},compareForwardSlotSegs:function(a,b){return b.forwardPressure-a.forwardPressure||(a.backwardCoord||0)-(b.backwardCoord||0)||this.compareSegs(a,b)}});var mb=Ma.View=ra.extend({type:null,name:null,title:null,calendar:null,options:null,coordMap:null,el:null,displaying:null,isSkeletonRendered:!1,isEventsRendered:!1,start:null,end:null,intervalStart:null,intervalEnd:null,intervalDuration:null,intervalUnit:null,isRTL:!1,isSelected:!1,eventOrderSpecs:null,scrollerEl:null,scrollTop:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,nextDayThreshold:null,isHiddenDayHash:null,documentMousedownProxy:null,constructor:function(a,c,d,e){this.calendar=a,this.type=this.name=c,this.options=d,this.intervalDuration=e||b.duration(1,"day"),this.nextDayThreshold=b.duration(this.opt("nextDayThreshold")),this.initThemingProps(),this.initHiddenDays(),this.isRTL=this.opt("isRTL"),this.eventOrderSpecs=A(this.opt("eventOrder")),this.documentMousedownProxy=ca(this,"documentMousedown"),this.initialize()},initialize:function(){},opt:function(a){return this.options[a]},trigger:function(a,b){var c=this.calendar;return c.trigger.apply(c,[a,b||this].concat(Array.prototype.slice.call(arguments,2),[this]))},setDate:function(a){this.setRange(this.computeRange(a))},setRange:function(b){a.extend(this,b),this.updateTitle()},computeRange:function(a){var b,c,d=I(this.intervalDuration),e=a.clone().startOf(d),f=e.clone().add(this.intervalDuration);return/year|month|week|day/.test(d)?(e.stripTime(),f.stripTime()):(e.hasTime()||(e=this.calendar.rezoneDate(e)),f.hasTime()||(f=this.calendar.rezoneDate(f))),b=e.clone(),b=this.skipHiddenDays(b),c=f.clone(),c=this.skipHiddenDays(c,-1,!0),{intervalUnit:d,intervalStart:e,intervalEnd:f,start:b,end:c}},computePrevDate:function(a){return this.massageCurrentDate(a.clone().startOf(this.intervalUnit).subtract(this.intervalDuration),-1)},computeNextDate:function(a){return this.massageCurrentDate(a.clone().startOf(this.intervalUnit).add(this.intervalDuration))},massageCurrentDate:function(a,b){return this.intervalDuration.as("days")<=1&&this.isHiddenDay(a)&&(a=this.skipHiddenDays(a,b),a.startOf("day")),a},updateTitle:function(){this.title=this.computeTitle()},computeTitle:function(){return this.formatRange({start:this.intervalStart,end:this.intervalEnd},this.opt("titleFormat")||this.computeTitleFormat(),this.opt("titleRangeSeparator"))},computeTitleFormat:function(){return"year"==this.intervalUnit?"YYYY":"month"==this.intervalUnit?this.opt("monthYearFormat"):this.intervalDuration.as("days")>1?"ll":"LL"},formatRange:function(a,b,c){var d=a.end;return d.hasTime()||(d=d.clone().subtract(1)),ma(a.start,d,b,c,this.opt("isRTL"))},setElement:function(a){this.el=a,this.bindGlobalHandlers()},removeElement:function(){this.clear(),this.isSkeletonRendered&&(this.unrenderSkeleton(),this.isSkeletonRendered=!1),this.unbindGlobalHandlers(),this.el.remove()},display:function(b){var c=this,d=null;return this.displaying&&(d=this.queryScroll()),this.clear().then(function(){return c.displaying=a.when(c.displayView(b)).then(function(){c.forceScroll(c.computeInitialScroll(d)),c.triggerRender()})})},clear:function(){var b=this,c=this.displaying;return c?c.then(function(){return b.displaying=null,b.clearEvents(),b.clearView()}):a.when()},displayView:function(a){this.isSkeletonRendered||(this.renderSkeleton(),this.isSkeletonRendered=!0),this.setDate(a),this.render&&this.render(),this.renderDates(),this.updateSize(),this.renderBusinessHours()},clearView:function(){this.unselect(),this.triggerUnrender(),this.unrenderBusinessHours(),this.unrenderDates(),this.destroy&&this.destroy()},renderSkeleton:function(){},unrenderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},renderBusinessHours:function(){},unrenderBusinessHours:function(){},triggerRender:function(){this.trigger("viewRender",this,this,this.el)},triggerUnrender:function(){this.trigger("viewDestroy",this,this,this.el)},bindGlobalHandlers:function(){a(document).on("mousedown",this.documentMousedownProxy)},unbindGlobalHandlers:function(){a(document).off("mousedown",this.documentMousedownProxy)},initThemingProps:function(){var a=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=a+"-widget-header",this.widgetContentClass=a+"-widget-content",this.highlightStateClass=a+"-state-highlight"},updateSize:function(a){var b;a&&(b=this.queryScroll()),this.updateHeight(a),this.updateWidth(a),a&&this.setScroll(b)},updateWidth:function(a){},updateHeight:function(a){var b=this.calendar;this.setHeight(b.getSuggestedViewHeight(),b.isHeightAuto())},setHeight:function(a,b){},computeScrollerHeight:function(a){var b,c,d=this.scrollerEl;return b=this.el.add(d),b.css({position:"relative",left:-1}),c=this.el.outerHeight()-d.height(),b.css({position:"",left:""}),a-c},computeInitialScroll:function(a){return 0},queryScroll:function(){return this.scrollerEl?this.scrollerEl.scrollTop():void 0},setScroll:function(a){return this.scrollerEl?this.scrollerEl.scrollTop(a):void 0},forceScroll:function(a){var b=this;this.setScroll(a),setTimeout(function(){b.setScroll(a)},0)},displayEvents:function(a){var b=this.queryScroll();this.clearEvents(),this.renderEvents(a),this.isEventsRendered=!0,this.setScroll(b),this.triggerEventRender()},clearEvents:function(){this.isEventsRendered&&(this.triggerEventUnrender(),this.destroyEvents&&this.destroyEvents(),this.unrenderEvents(),this.isEventsRendered=!1)},renderEvents:function(a){},unrenderEvents:function(){},triggerEventRender:function(){this.renderedEventSegEach(function(a){this.trigger("eventAfterRender",a.event,a.event,a.el)}),this.trigger("eventAfterAllRender")},triggerEventUnrender:function(){this.renderedEventSegEach(function(a){this.trigger("eventDestroy",a.event,a.event,a.el)})},resolveEventEl:function(b,c){var d=this.trigger("eventRender",b,b,c);return d===!1?c=null:d&&d!==!0&&(c=a(d)),c},showEvent:function(a){this.renderedEventSegEach(function(a){a.el.css("visibility","")},a)},hideEvent:function(a){this.renderedEventSegEach(function(a){a.el.css("visibility","hidden")},a)},renderedEventSegEach:function(a,b){var c,d=this.getEventSegs();for(c=0;c<d.length;c++)b&&d[c].event._id!==b._id||d[c].el&&a.call(this,d[c])},getEventSegs:function(){return[]},isEventDraggable:function(a){var b=a.source||{};return X(a.startEditable,b.startEditable,this.opt("eventStartEditable"),a.editable,b.editable,this.opt("editable"))},reportEventDrop:function(a,b,c,d,e){var f=this.calendar,g=f.mutateEvent(a,b,c),h=function(){g.undo(),f.reportEventChange()};this.triggerEventDrop(a,g.dateDelta,h,d,e),f.reportEventChange()},triggerEventDrop:function(a,b,c,d,e){this.trigger("eventDrop",d[0],a,b,c,e,{})},reportExternalDrop:function(b,c,d,e,f){var g,h,i=b.eventProps;i&&(g=a.extend({},i,c),h=this.calendar.renderEvent(g,b.stick)[0]),this.triggerExternalDrop(h,c,d,e,f)},triggerExternalDrop:function(a,b,c,d,e){this.trigger("drop",c[0],b.start,d,e),a&&this.trigger("eventReceive",null,a)},renderDrag:function(a,b){},unrenderDrag:function(){},isEventResizableFromStart:function(a){return this.opt("eventResizableFromStart")&&this.isEventResizable(a)},isEventResizableFromEnd:function(a){return this.isEventResizable(a)},isEventResizable:function(a){var b=a.source||{};return X(a.durationEditable,b.durationEditable,this.opt("eventDurationEditable"),a.editable,b.editable,this.opt("editable"))},reportEventResize:function(a,b,c,d,e){var f=this.calendar,g=f.mutateEvent(a,b,c),h=function(){g.undo(),f.reportEventChange()};this.triggerEventResize(a,g.durationDelta,h,d,e),f.reportEventChange()},triggerEventResize:function(a,b,c,d,e){this.trigger("eventResize",d[0],a,b,c,e,{})},select:function(a,b){this.unselect(b),this.renderSelection(a),this.reportSelection(a,b)},renderSelection:function(a){},reportSelection:function(a,b){this.isSelected=!0,this.triggerSelect(a,b)},triggerSelect:function(a,b){this.trigger("select",null,a.start,a.end,b)},unselect:function(a){this.isSelected&&(this.isSelected=!1,this.destroySelection&&this.destroySelection(),this.unrenderSelection(),this.trigger("unselect",null,a))},unrenderSelection:function(){},documentMousedown:function(b){var c;this.isSelected&&this.opt("unselectAuto")&&v(b)&&(c=this.opt("unselectCancel"),c&&a(b.target).closest(c).length||this.unselect(b))},triggerDayClick:function(a,b,c){this.trigger("dayClick",b,a.start,c)},initHiddenDays:function(){var b,c=this.opt("hiddenDays")||[],d=[],e=0;for(this.opt("weekends")===!1&&c.push(0,6),b=0;7>b;b++)(d[b]=-1!==a.inArray(b,c))||e++;if(!e)throw"invalid hiddenDays";this.isHiddenDayHash=d},isHiddenDay:function(a){return b.isMoment(a)&&(a=a.day()),this.isHiddenDayHash[a]},skipHiddenDays:function(a,b,c){var d=a.clone();for(b=b||1;this.isHiddenDayHash[(d.day()+(c?b:0)+7)%7];)d.add(b,"days");return d},computeDayRange:function(a){var b,c=a.start.clone().stripTime(),d=a.end,e=null;return d&&(e=d.clone().stripTime(),b=+d.time(),b&&b>=this.nextDayThreshold&&e.add(1,"days")),(!d||c>=e)&&(e=c.clone().add(1,"days")),{start:c,end:e}},isMultiDayEvent:function(a){var b=this.computeDayRange(a);return b.end.diff(b.start,"days")>1}}),nb=Ma.Calendar=ra.extend({dirDefaults:null,langDefaults:null,overrides:null,options:null,viewSpecCache:null,view:null,header:null,loadingLevel:0,constructor:Ga,initialize:function(){},initOptions:function(a){var b,e,f,g;a=d(a),b=a.lang,e=ob[b],e||(b=nb.defaults.lang,e=ob[b]||{}),f=X(a.isRTL,e.isRTL,nb.defaults.isRTL),g=f?nb.rtlDefaults:{},this.dirDefaults=g,this.langDefaults=e,this.overrides=a,this.options=c([nb.defaults,g,e,a]),Ha(this.options),this.viewSpecCache={}},getViewSpec:function(a){var b=this.viewSpecCache;return b[a]||(b[a]=this.buildViewSpec(a))},getUnitViewSpec:function(b){var c,d,e;if(-1!=a.inArray(b,Ra))for(c=this.header.getViewsWithButtons(),a.each(Ma.views,function(a){c.push(a)}),d=0;d<c.length;d++)if(e=this.getViewSpec(c[d]),e&&e.singleUnit==b)return e},buildViewSpec:function(a){for(var d,e,f,g,h=this.overrides.views||{},i=[],j=[],k=[],l=a;l;)d=Na[l],e=h[l],l=null,"function"==typeof d&&(d={"class":d}),d&&(i.unshift(d),j.unshift(d.defaults||{}),f=f||d.duration,l=l||d.type),e&&(k.unshift(e),f=f||e.duration,l=l||e.type);return d=Q(i),d.type=a,d["class"]?(f&&(f=b.duration(f),f.valueOf()&&(d.duration=f,g=I(f),1===f.as(g)&&(d.singleUnit=g,k.unshift(h[g]||{})))),d.defaults=c(j),d.overrides=c(k),this.buildViewSpecOptions(d),this.buildViewSpecButtonText(d,a),d):!1},buildViewSpecOptions:function(a){a.options=c([nb.defaults,a.defaults,this.dirDefaults,this.langDefaults,this.overrides,a.overrides]),Ha(a.options)},buildViewSpecButtonText:function(a,b){function c(c){var d=c.buttonText||{};return d[b]||(a.singleUnit?d[a.singleUnit]:null)}a.buttonTextOverride=c(this.overrides)||a.overrides.buttonText,a.buttonTextDefault=c(this.langDefaults)||c(this.dirDefaults)||a.defaults.buttonText||c(nb.defaults)||(a.duration?this.humanizeDuration(a.duration):null)||b},instantiateView:function(a){var b=this.getViewSpec(a);return new b["class"](this,a,b.options,b.duration)},isValidViewType:function(a){return Boolean(this.getViewSpec(a))},pushLoading:function(){this.loadingLevel++||this.trigger("loading",null,!0,this.view)},popLoading:function(){--this.loadingLevel||this.trigger("loading",null,!1,this.view)},buildSelectRange:function(a,b){return a=this.moment(a),b=b?this.moment(b):a.hasTime()?a.clone().add(this.defaultTimedEventDuration):a.clone().add(this.defaultAllDayEventDuration),{start:a,end:b}}});nb.mixin(bb),nb.defaults={titleRangeSeparator:" â ",monthYearFormat:"MMMM YYYY",defaultTimedEventDuration:"02:00:00",defaultAllDayEventDuration:{days:1},forceEventDuration:!1,nextDayThreshold:"09:00:00",defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberTitle:"W",weekNumberCalculation:"local",scrollTime:"06:00:00",lazyFetching:!0,startParam:"start",endParam:"end",timezoneParam:"timezone",timezone:!1,isRTL:!1,buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day"},buttonIcons:{prev:"left-single-arrow",next:"right-single-arrow",prevYear:"left-double-arrow",nextYear:"right-double-arrow"},theme:!1,themeButtonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e",prevYear:"seek-prev",nextYear:"seek-next"},dragOpacity:.75,dragRevertDuration:500,dragScroll:!0,unselectAuto:!0,dropAccept:"*",eventOrder:"title",eventLimit:!1,eventLimitText:"more",eventLimitClick:"popover",dayPopoverFormat:"LL",handleWindowResize:!0,windowResizeDelay:200},nb.englishDefaults={dayPopoverFormat:"dddd, MMMM D"},nb.rtlDefaults={header:{left:"next,prev today",center:"",right:"title"},buttonIcons:{prev:"right-single-arrow",next:"left-single-arrow",prevYear:"right-double-arrow",nextYear:"left-double-arrow"},themeButtonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w",nextYear:"seek-prev",prevYear:"seek-next"}};var ob=Ma.langs={};Ma.datepickerLang=function(b,c,d){var e=ob[b]||(ob[b]={});e.isRTL=d.isRTL,e.weekNumberTitle=d.weekHeader,a.each(pb,function(a,b){e[a]=b(d)}),a.datepicker&&(a.datepicker.regional[c]=a.datepicker.regional[b]=d,a.datepicker.regional.en=a.datepicker.regional[""],a.datepicker.setDefaults(d))},Ma.lang=function(b,d){var e,f;e=ob[b]||(ob[b]={}),d&&(e=ob[b]=c([e,d])),f=Ia(b),a.each(qb,function(a,b){null==e[a]&&(e[a]=b(f,e))}),nb.defaults.lang=b};var pb={buttonText:function(a){return{prev:Z(a.prevText),next:Z(a.nextText),today:Z(a.currentText)}},monthYearFormat:function(a){return a.showMonthAfterYear?"YYYY["+a.yearSuffix+"] MMMM":"MMMM YYYY["+a.yearSuffix+"]"}},qb={dayOfMonthFormat:function(a,b){var c=a.longDateFormat("l");return c=c.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),b.isRTL?c+=" ddd":c="ddd "+c,c},mediumTimeFormat:function(a){return a.longDateFormat("LT").replace(/\s*a$/i,"a")},smallTimeFormat:function(a){return a.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")},extraSmallTimeFormat:function(a){return a.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")},hourFormat:function(a){return a.longDateFormat("LT").replace(":mm","").replace(/(\Wmm)$/,"").replace(/\s*a$/i,"a")},noMeridiemTimeFormat:function(a){return a.longDateFormat("LT").replace(/\s*a$/i,"")}},rb={smallDayDateFormat:function(a){return a.isRTL?"D dd":"dd D"},weekFormat:function(a){return a.isRTL?"w[ "+a.weekNumberTitle+"]":"["+a.weekNumberTitle+" ]w"},smallWeekFormat:function(a){return a.isRTL?"w["+a.weekNumberTitle+"]":"["+a.weekNumberTitle+"]w"}};Ma.lang("en",nb.englishDefaults),Ma.sourceNormalizers=[],Ma.sourceFetchers=[];var sb={dataType:"json",cache:!1},tb=1;nb.prototype.getPeerEvents=function(a,b){var c,d,e=this.getEventCache(),f=[];for(c=0;c<e.length;c++)d=e[c],a&&a._id===d._id||f.push(d);return f};var ub=mb.extend({dayGrid:null,dayNumbersVisible:!1,weekNumbersVisible:!1,weekNumberWidth:null,headRowEl:null,initialize:function(){this.dayGrid=new kb(this),this.coordMap=this.dayGrid.coordMap},setRange:function(a){mb.prototype.setRange.call(this,a),this.dayGrid.breakOnWeeks=/year|month|week/.test(this.intervalUnit),this.dayGrid.setRange(a)},computeRange:function(a){var b=mb.prototype.computeRange.call(this,a);return/year|month/.test(b.intervalUnit)&&(b.start.startOf("week"),b.start=this.skipHiddenDays(b.start),b.end.weekday()&&(b.end.add(1,"week").startOf("week"),b.end=this.skipHiddenDays(b.end,-1,!0))),b},renderDates:function(){this.dayNumbersVisible=this.dayGrid.rowCnt>1,this.weekNumbersVisible=this.opt("weekNumbers"),this.dayGrid.numbersVisible=this.dayNumbersVisible||this.weekNumbersVisible,this.el.addClass("fc-basic-view").html(this.renderHtml()),this.headRowEl=this.el.find("thead .fc-row"),this.scrollerEl=this.el.find(".fc-day-grid-container"),this.dayGrid.coordMap.containerEl=this.scrollerEl,this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(this.hasRigidRows())},unrenderDates:function(){this.dayGrid.unrenderDates(),this.dayGrid.removeElement()},renderBusinessHours:function(){this.dayGrid.renderBusinessHours()},renderHtml:function(){return'<table><thead class="fc-head"><tr><td class="'+this.widgetHeaderClass+'">'+this.dayGrid.headHtml()+'</td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'"><div class="fc-day-grid-container"><div class="fc-day-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){return this.weekNumbersVisible?'<th class="fc-week-number '+this.widgetHeaderClass+'" '+this.weekNumberStyleAttr()+"><span>"+Y(this.opt("weekNumberTitle"))+"</span></th>":void 0},numberIntroHtml:function(a){return this.weekNumbersVisible?'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"><span>"+this.dayGrid.getCell(a,0).start.format("w")+"</span></td>":void 0},dayIntroHtml:function(){return this.weekNumbersVisible?'<td class="fc-week-number '+this.widgetContentClass+'" '+this.weekNumberStyleAttr()+"></td>":void 0},introHtml:function(){return this.weekNumbersVisible?'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"></td>":void 0},numberCellHtml:function(a){var b,c=a.start;return this.dayNumbersVisible?(b=this.dayGrid.getDayClasses(c),b.unshift("fc-day-number"),'<td class="'+b.join(" ")+'" data-date="'+c.format()+'">'+c.date()+"</td>"):"<td/>"},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var a=this.opt("eventLimit");return a&&"number"!=typeof a},updateWidth:function(){this.weekNumbersVisible&&(this.weekNumberWidth=k(this.el.find(".fc-week-number")))},setHeight:function(a,b){var c,d=this.opt("eventLimit");m(this.scrollerEl),f(this.headRowEl),this.dayGrid.removeSegPopover(),d&&"number"==typeof d&&this.dayGrid.limitRows(d),c=this.computeScrollerHeight(a),this.setGridHeight(c,b),d&&"number"!=typeof d&&this.dayGrid.limitRows(d),!b&&l(this.scrollerEl,c)&&(e(this.headRowEl,r(this.scrollerEl)),c=this.computeScrollerHeight(a),this.scrollerEl.height(c))},setGridHeight:function(a,b){b?j(this.dayGrid.rowEls):i(this.dayGrid.rowEls,a,!0)},renderEvents:function(a){this.dayGrid.renderEvents(a),this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},unrenderEvents:function(){this.dayGrid.unrenderEvents()},renderDrag:function(a,b){return this.dayGrid.renderDrag(a,b)},unrenderDrag:function(){this.dayGrid.unrenderDrag()},renderSelection:function(a){this.dayGrid.renderSelection(a)},unrenderSelection:function(){this.dayGrid.unrenderSelection()}}),vb=ub.extend({computeRange:function(a){var b,c=ub.prototype.computeRange.call(this,a);return this.isFixedWeeks()&&(b=Math.ceil(c.end.diff(c.start,"weeks",!0)),c.end.add(6-b,"weeks")),c},setGridHeight:function(a,b){b=b||"variable"===this.opt("weekMode"),b&&(a*=this.rowCnt/6),i(this.dayGrid.rowEls,a,!b)},isFixedWeeks:function(){var a=this.opt("weekMode");return a?"fixed"===a:this.opt("fixedWeekCount")}});Na.basic={"class":ub},Na.basicDay={type:"basic",duration:{days:1}},Na.basicWeek={type:"basic",duration:{weeks:1}},Na.month={"class":vb,duration:{months:1},defaults:{fixedWeekCount:!0}};var wb=mb.extend({timeGrid:null,dayGrid:null,axisWidth:null,noScrollRowEls:null,bottomRuleEl:null,bottomRuleHeight:null,initialize:function(){this.timeGrid=new lb(this),this.opt("allDaySlot")?(this.dayGrid=new kb(this),this.coordMap=new eb([this.dayGrid.coordMap,this.timeGrid.coordMap])):this.coordMap=this.timeGrid.coordMap},setRange:function(a){mb.prototype.setRange.call(this,a),this.timeGrid.setRange(a),this.dayGrid&&this.dayGrid.setRange(a)},renderDates:function(){this.el.addClass("fc-agenda-view").html(this.renderHtml()),this.scrollerEl=this.el.find(".fc-time-grid-container"),this.timeGrid.coordMap.containerEl=this.scrollerEl,this.timeGrid.setElement(this.el.find(".fc-time-grid")),this.timeGrid.renderDates(),this.bottomRuleEl=a('<hr class="fc-divider '+this.widgetHeaderClass+'"/>').appendTo(this.timeGrid.el),this.dayGrid&&(this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(),this.dayGrid.bottomCoordPadding=this.dayGrid.el.next("hr").outerHeight()),this.noScrollRowEls=this.el.find(".fc-row:not(.fc-scroller *)")},unrenderDates:function(){this.timeGrid.unrenderDates(),this.timeGrid.removeElement(),this.dayGrid&&(this.dayGrid.unrenderDates(),this.dayGrid.removeElement())},renderBusinessHours:function(){this.timeGrid.renderBusinessHours(),this.dayGrid&&this.dayGrid.renderBusinessHours()},renderHtml:function(){return'<table><thead class="fc-head"><tr><td class="'+this.widgetHeaderClass+'">'+this.timeGrid.headHtml()+'</td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'">'+(this.dayGrid?'<div class="fc-day-grid"/><hr class="fc-divider '+this.widgetHeaderClass+'"/>':"")+'<div class="fc-time-grid-container"><div class="fc-time-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){var a,b;return this.opt("weekNumbers")?(a=this.timeGrid.getCell(0).start,b=a.format(this.opt("smallWeekFormat")),'<th class="fc-axis fc-week-number '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"><span>"+Y(b)+"</span></th>"):'<th class="fc-axis '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"></th>"},dayIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"><span>"+(this.opt("allDayHtml")||Y(this.opt("allDayText")))+"</span></td>"},slotBgIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"></td>"},introHtml:function(){return'<td class="fc-axis" '+this.axisStyleAttr()+"></td>"},axisStyleAttr:function(){return null!==this.axisWidth?'style="width:'+this.axisWidth+'px"':""},updateSize:function(a){this.timeGrid.updateSize(a),mb.prototype.updateSize.call(this,a)},updateWidth:function(){this.axisWidth=k(this.el.find(".fc-axis"))},setHeight:function(a,b){var c,d;null===this.bottomRuleHeight&&(this.bottomRuleHeight=this.bottomRuleEl.outerHeight()),this.bottomRuleEl.hide(),this.scrollerEl.css("overflow",""),m(this.scrollerEl),f(this.noScrollRowEls),this.dayGrid&&(this.dayGrid.removeSegPopover(),c=this.opt("eventLimit"),c&&"number"!=typeof c&&(c=xb),c&&this.dayGrid.limitRows(c)),b||(d=this.computeScrollerHeight(a),l(this.scrollerEl,d)?(e(this.noScrollRowEls,r(this.scrollerEl)),d=this.computeScrollerHeight(a),this.scrollerEl.height(d)):(this.scrollerEl.height(d).css("overflow","hidden"),this.bottomRuleEl.show()))},computeInitialScroll:function(){var a=b.duration(this.opt("scrollTime")),c=this.timeGrid.computeTimeTop(a);return c=Math.ceil(c),c&&c++,c},renderEvents:function(a){var b,c,d=[],e=[],f=[];for(c=0;c<a.length;c++)a[c].allDay?d.push(a[c]):e.push(a[c]);b=this.timeGrid.renderEvents(e),this.dayGrid&&(f=this.dayGrid.renderEvents(d)),this.updateHeight()},getEventSegs:function(){return this.timeGrid.getEventSegs().concat(this.dayGrid?this.dayGrid.getEventSegs():[])},unrenderEvents:function(){this.timeGrid.unrenderEvents(),this.dayGrid&&this.dayGrid.unrenderEvents()},renderDrag:function(a,b){return a.start.hasTime()?this.timeGrid.renderDrag(a,b):this.dayGrid?this.dayGrid.renderDrag(a,b):void 0},unrenderDrag:function(){this.timeGrid.unrenderDrag(),this.dayGrid&&this.dayGrid.unrenderDrag()},renderSelection:function(a){a.start.hasTime()||a.end.hasTime()?this.timeGrid.renderSelection(a):this.dayGrid&&this.dayGrid.renderSelection(a)},unrenderSelection:function(){this.timeGrid.unrenderSelection(),this.dayGrid&&this.dayGrid.unrenderSelection()}}),xb=5,yb=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];return Na.agenda={"class":wb,defaults:{allDaySlot:!0,allDayText:"all-day",slotDuration:"00:30:00",minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0}},Na.agendaDay={type:"agenda",duration:{days:1}},Na.agendaWeek={type:"agenda",duration:{weeks:1}},Ma}),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function b(b,g,h,i,j){function k(c,d){var f=d||[{message:c}];(b.googleCalendarError||a.noop).apply(j,f),(j.options.googleCalendarError||a.noop).apply(j,f),e.warn.apply(null,[c].concat(d||[]))}var l,m,n=d+"/"+encodeURIComponent(b.googleCalendarId)+"/events?callback=?",o=b.googleCalendarApiKey||j.options.googleCalendarApiKey,p=b.success;return o?(g.hasZone()||(g=g.clone().utc().add(-1,"day")),h.hasZone()||(h=h.clone().utc().add(1,"day")),i&&"local"!=i&&(m=i.replace(" ","_")),l=a.extend({},b.data||{},{key:o,timeMin:g.format(),timeMax:h.format(),timeZone:m,singleEvents:!0,maxResults:9999}),a.extend({},b,{googleCalendarId:null,url:n,data:l,startParam:!1,endParam:!1,timezoneParam:!1,success:function(b){var d,e,g=[];if(b.error)k("Google Calendar API: "+b.error.message,b.error.errors);else if(b.items&&(a.each(b.items,function(a,b){var d=b.htmlLink;m&&(d=c(d,"ctz="+m)),g.push({id:b.id,title:b.summary,start:b.start.dateTime||b.start.date,end:b.end.dateTime||b.end.date,url:d,location:b.location,description:b.description})}),d=[g].concat(Array.prototype.slice.call(arguments,1)),e=f(p,this,d),a.isArray(e)))return e;return g}})):(k("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/"),{})}function c(a,b){return a.replace(/(\?.*?)?(#|$)/,function(a,c,d){return(c?c+"&":"?")+b+d})}var d="https://www.googleapis.com/calendar/v3/calendars",e=a.fullCalendar,f=e.applyAll;e.sourceNormalizers.push(function(a){var b,c=a.googleCalendarId,d=a.url;!c&&d&&(/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(d)?c=d:((b=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(d))||(b=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(d)))&&(c=decodeURIComponent(b[1])),c&&(a.googleCalendarId=c)),c&&(null==a.editable&&(a.editable=!1),a.url=c)}),e.sourceFetchers.push(function(a,c,d,e){return a.googleCalendarId?b(a,c,d,e,this):void 0})}),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style); 22 this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery),d3.gantt=function(){function a(c){w(c),x();var d=d3.tip().attr("class","d3-tip").html(function(a){var b=new Date(a.startDate),c=new Date(a.endDate),d=a.status;return a.last?d+" <br/> "+b.toUTCString()+" to now":d+" <br/> "+b.toUTCString()+" to "+c.toUTCString()}),h=d3.select(g).append("svg").attr("class","chart").attr("width","100%").attr("height",m+e.top+e.bottom),i=h.append("g").attr("class","gantt-chart").attr("width","100%").attr("height",m+e.top+e.bottom).attr("transform","translate("+e.left+", "+e.top+")").call(d);return i.selectAll(".chart").data(c,p).enter().append("rect").attr("rx",5).attr("ry",5).attr("class",function(a){return null==l[a.status]?"bar":l[a.status]}).attr("y",0).attr("transform",r).attr("height",function(a){return t.rangeBand()}).attr("width",function(a){return s(a.endDate-q)-s(a.startDate-q)}).on("mouseover",d.show).on("mouseout",d.hide),i.append("g").attr("class","x axis").attr("transform","translate(0, "+(m-e.top-e.bottom)+")").transition().call(u),f&&i.append("g").attr("class","y axis").transition().call(v),h.on("mousedown",function(){var b=d3.mouse(this),d=n;d=b[0]/d,a.zoom(c,d,this)}).on("contextmenu",function(d,e){b=null,d3.event.preventDefault(),a.redraw(c,this)}),a}var b,c,d="fit",e={top:20,right:40,bottom:20,left:70},f=!0,g="body",h=d3.time.day.offset(new Date,-3),i=d3.time.hour.offset(new Date,3),j=d,k=[],l=[],m=document.body.clientHeight-e.top-e.bottom-5,n=document.body.clientWidth-e.right-e.left-5,o="%H:%M",p=function(a){return a.startDate+a.taskName+a.endDate},q=36e5,r=function(a){return"translate("+s(a.startDate-q)+","+t(a.taskName)+")"},s=d3.time.scale().domain([h,i]).range([0,n]).clamp(!0),t=d3.scale.ordinal().domain(k).rangeRoundBands([0,m-e.top-e.bottom],.1),u=d3.svg.axis().scale(s).orient("bottom").tickFormat(d3.time.format(o)).tickSubdivide(!0).tickSize(8).tickPadding(8),v=d3.svg.axis().scale(t).orient("left").tickSize(0),w=function(a){if(j===d){if(void 0===a||a.length<1)return h=d3.time.day.offset(new Date,-3),void(i=d3.time.hour.offset(new Date,3));a.sort(function(a,b){return a.endDate-b.endDate}),i=a[a.length-1].endDate,a.sort(function(a,b){return a.startDate-b.startDate}),h=a[0].startDate}},x=function(){s=d3.time.scale().domain([h-q,i-q]).range([0,n]).clamp(!0),t=d3.scale.ordinal().domain(k).rangeRoundBands([0,m-e.top-e.bottom],.1),u=new Date(h).toDateString()!=new Date(i).toDateString()?d3.svg.axis().scale(s).orient("bottom").tickFormat(null).tickSubdivide(!0).tickSize(8).tickPadding(8):d3.svg.axis().scale(s).orient("bottom").tickFormat(d3.time.format(o)).tickSubdivide(!0).tickSize(8).tickPadding(8),v=d3.svg.axis().scale(t).orient("left").tickSize(0)};return a.zoom=function(d,e,f){w(d),null==b&&(b=h,c=i);var g=c-b,j=g*e+b,k=g/1.5,l=j-k/2;k/=2,b>l?k+=b-l:b=l;var m=j+k;m>c?b-=m-c:c=m,h=b,i=c,a.redrawInner(d,f)},a.redraw=function(b,c){w(b),a.redrawInner(b,c)},a.redrawInner=function(b,c){x();var d=d3.select(c),e=d.select(".gantt-chart"),f=e.selectAll("rect").data(b,p);return f.enter().insert("rect",":first-child").attr("rx",5).attr("ry",5).attr("class",function(a){return null==l[a.status]?"bar":l[a.status]}).transition().attr("y",0).attr("transform",r).attr("height",function(a){return t.rangeBand()}).attr("width",function(a){return s(a.endDate-q)-s(a.startDate-q)}),f.transition().attr("transform",r).attr("height",function(a){return t.rangeBand()}).attr("width",function(a){return s(a.endDate-q)-s(a.startDate-q)}),f.exit().remove(),d.select(".x").transition().call(u),d.select(".y").transition().call(v),a},a.margin=function(b){return arguments.length?(e=b,a):e},a.drawytitles=function(b){return arguments.length?(f=b,a):f},a.timeDomain=function(b){return arguments.length?(h=+b[0],i=+b[1],a):[h,i]},a.timeDomainMode=function(b){return arguments.length?(j=b,a):j},a.taskTypes=function(b){return arguments.length?(k=b,a):k},a.taskStatus=function(b){return arguments.length?(l=b,a):l},a.width=function(b){return arguments.length?(n=+b,a):n},a.height=function(b){return arguments.length?(m=+b,a):m},a.tickFormat=function(b){return arguments.length?(o=b,a):o},a.selector=function(b){return arguments.length?(g=b,a):g},a},function(a,b){"function"==typeof define&&define.amd?define(["d3"],b):"object"==typeof module&&module.exports?module.exports=function(a){return a.tip=b(a),a.tip}:a.d3.tip=b(a.d3)}(this,function(a){return function(){function b(a){v=o(a),w=v.createSVGPoint(),document.body.appendChild(u)}function c(){return"n"}function d(){return[0,0]}function e(){return" "}function f(){var a=q();return{top:a.n.y-u.offsetHeight,left:a.n.x-u.offsetWidth/2}}function g(){var a=q();return{top:a.s.y,left:a.s.x-u.offsetWidth/2}}function h(){var a=q();return{top:a.e.y-u.offsetHeight/2,left:a.e.x}}function i(){var a=q();return{top:a.w.y-u.offsetHeight/2,left:a.w.x-u.offsetWidth}}function j(){var a=q();return{top:a.nw.y-u.offsetHeight,left:a.nw.x-u.offsetWidth}}function k(){var a=q();return{top:a.ne.y-u.offsetHeight,left:a.ne.x}}function l(){var a=q();return{top:a.sw.y,left:a.sw.x-u.offsetWidth}}function m(){var a=q();return{top:a.se.y,left:a.e.x}}function n(){var b=a.select(document.createElement("div"));return b.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),b.node()}function o(a){return a=a.node(),"svg"===a.tagName.toLowerCase()?a:a.ownerSVGElement}function p(){return null===u&&(u=n(),document.body.appendChild(u)),a.select(u)}function q(){for(var b=x||a.event.target;"undefined"==typeof b.getScreenCTM&&"undefined"===b.parentNode;)b=b.parentNode;var c={},d=b.getScreenCTM(),e=b.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return w.x=h,w.y=i,c.nw=w.matrixTransform(d),w.x+=f,c.ne=w.matrixTransform(d),w.y+=g,c.se=w.matrixTransform(d),w.x-=f,c.sw=w.matrixTransform(d),w.y-=g/2,c.w=w.matrixTransform(d),w.x+=f,c.e=w.matrixTransform(d),w.x-=f/2,w.y-=g/2,c.n=w.matrixTransform(d),w.y+=g,c.s=w.matrixTransform(d),c}var r=c,s=d,t=e,u=n(),v=null,w=null,x=null;b.show=function(){var a=Array.prototype.slice.call(arguments);a[a.length-1]instanceof SVGElement&&(x=a.pop());var c,d=t.apply(this,a),e=s.apply(this,a),f=r.apply(this,a),g=p(),h=z.length,i=document.documentElement.scrollTop||document.body.scrollTop,j=document.documentElement.scrollLeft||document.body.scrollLeft;for(g.html(d).style({opacity:1,"pointer-events":"all"});h--;)g.classed(z[h],!1);return c=y.get(f).apply(this),g.classed(f,!0).style({top:c.top+e[0]+i+"px",left:c.left+e[1]+j+"px"}),b},b.hide=function(){var a=p();return a.style({opacity:0,"pointer-events":"none"}),b},b.attr=function(c,d){if(arguments.length<2&&"string"==typeof c)return p().attr(c);var e=Array.prototype.slice.call(arguments);return a.selection.prototype.attr.apply(p(),e),b},b.style=function(c,d){if(arguments.length<2&&"string"==typeof c)return p().style(c);var e=Array.prototype.slice.call(arguments);return a.selection.prototype.style.apply(p(),e),b},b.direction=function(c){return arguments.length?(r=null==c?c:a.functor(c),b):r},b.offset=function(c){return arguments.length?(s=null==c?c:a.functor(c),b):s},b.html=function(c){return arguments.length?(t=null==c?c:a.functor(c),b):t},b.destroy=function(){return u&&(p().remove(),u=null),b};var y=a.map({n:f,s:g,e:h,w:i,nw:j,ne:k,sw:l,se:m}),z=y.keys();return b}}),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(b,d){var e,f,g,h=b.nodeName.toLowerCase();return"area"===h?(e=b.parentNode,f=e.name,b.href&&f&&"map"===e.nodeName.toLowerCase()?(g=a("img[usemap='#"+f+"']")[0],!!g&&c(g)):!1):(/input|select|textarea|button|object/.test(h)?!b.disabled:"a"===h?b.href||d:d)&&c(b)}function c(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(b){var c=this.css("position"),d="absolute"===c,e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);return d&&"static"===b.css("position")?!1:e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:a(this[0].ownerDocument||document)},uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(c){return b(c,!isNaN(a.attr(c,"tabindex")))},tabbable:function(c){var d=a.attr(c,"tabindex"),e=isNaN(d);return(e||d>=0)&&b(c,!e)}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(b,c){function d(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),f&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var e="Width"===c?["Left","Right"]:["Top","Bottom"],f=c.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+c]=function(b){return void 0===b?g["inner"+c].call(this):this.each(function(){a(this).css(f,d(this,b)+"px")})},a.fn["outer"+c]=function(b,e){return"number"!=typeof b?g["outer"+c].call(this,b):this.each(function(){a(this).css(f,d(this,b,!0,e)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),disableSelection:function(){var a="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(b){if(void 0!==b)return this.css("zIndex",b);if(this.length)for(var c,d,e=a(this[0]);e.length&&e[0]!==document;){if(c=e.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(d=parseInt(e.css("zIndex"),10),!isNaN(d)&&0!==d))return d;e=e.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;f.length>e;e++)a.options[f[e][0]]&&f[e][1].apply(a.element,c)}}}),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b=0,c=Array.prototype.slice;return a.cleanData=function(b){return function(c){var d,e,f;for(f=0;null!=(e=c[f]);f++)try{d=a._data(e,"events"),d&&d.remove&&a(e).triggerHandler("remove")}catch(g){}b(c)}}(a.cleanData),a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];return b=b.split(".")[1],e=j+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e.toLowerCase()]=function(b){return!!a.data(b,e)},a[j]=a[j]||{},f=a[j][b],g=a[j][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new g(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,d){return a.isFunction(d)?void(i[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},e=function(a){return c.prototype[b].apply(this,a)};return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(i[b]=d)}),g.prototype=a.widget.extend(h,{widgetEventPrefix:f?h.widgetEventPrefix||b:b},i,{constructor:g,namespace:j,widgetName:b,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g),g},a.widget.extend=function(b){for(var d,e,f=c.call(arguments,1),g=0,h=f.length;h>g;g++)for(d in f[g])e=f[g][d],f[g].hasOwnProperty(d)&&void 0!==e&&(b[d]=a.isPlainObject(e)?a.isPlainObject(b[d])?a.widget.extend({},b[d],e):a.widget.extend({},e):e);return b},a.widget.bridge=function(b,d){var e=d.prototype.widgetFullName||b;a.fn[b]=function(f){var g="string"==typeof f,h=c.call(arguments,1),i=this;return f=!g&&h.length?a.widget.extend.apply(null,[f].concat(h)):f,g?this.each(function(){var c,d=a.data(this,e);return"instance"===f?(i=d,!1):d?a.isFunction(d[f])&&"_"!==f.charAt(0)?(c=d[f].apply(d,h),c!==d&&void 0!==c?(i=c&&c.jquery?i.pushStack(c.get()):c,!1):void 0):a.error("no such method '"+f+"' for "+b+" widget instance"):a.error("cannot call methods on "+b+" prior to initialization; attempted to call method '"+f+"'")}):this.each(function(){var b=a.data(this,e);b?(b.option(f||{}),b._init&&b._init()):a.data(this,e,new d(f,this))}),i}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(c,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=b++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this.options=a.widget.extend({},this.options,this._getCreateOptions(),c),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(b,c){var d,e,f,g=b;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof b)if(g={},d=b.split("."),b=d.shift(),d.length){for(e=g[b]=a.widget.extend({},this.options[b]),f=0;d.length-1>f;f++)e[d[f]]=e[d[f]]||{},e=e[d[f]];if(b=d.pop(),1===arguments.length)return void 0===e[b]?null:e[b];e[b]=c}else{if(1===arguments.length)return void 0===this.options[b]?null:this.options[b];g[b]=c}return this._setOptions(g),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!b),b&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(b,c,d){var e,f=this;"boolean"!=typeof b&&(d=c,c=b,b=!1),d?(c=e=a(c),this.bindings=this.bindings.add(c)):(d=c,c=this.element,e=this.widget()),a.each(d,function(d,g){function h(){return b||f.options.disabled!==!0&&!a(this).hasClass("ui-state-disabled")?("string"==typeof g?f[g]:g).apply(f,arguments):void 0}"string"!=typeof g&&(h.guid=g.guid=g.guid||h.guid||a.guid++);var i=d.match(/^([\w:-]*)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];k?e.delegate(k,j,h):c.bind(j,h)})},_off:function(b,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,b.unbind(c).undelegate(c),this.bindings=a(this.bindings.not(b).get()),this.focusable=a(this.focusable.not(b).get()),this.hoverable=a(this.hoverable.not(b).get())},_delay:function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={effect:e});var g,h=e?e===!0||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}}),a.widget}),function(a){"function"==typeof define&&define.amd?define(["jquery","./widget"],a):a(jQuery)}(function(a){var b=!1;return a(document).mouseup(function(){b=!1}),a.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){return!0===a.data(c.target,b.widgetName+".preventClickEvent")?(a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(c){if(!b){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var d=this,e=1===c.which,f="string"==typeof this.options.cancel&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:!1;return e&&!f&&this._mouseCapture(c)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(c)!==!1,!this._mouseStarted)?(c.preventDefault(),!0):(!0===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),b=!0,!0)):!0}},_mouseMove:function(b){if(this._mouseMoved){if(a.ui.ie&&(!document.documentMode||9>document.documentMode)&&!b.button)return this._mouseUp(b);if(!b.which)return this._mouseUp(b)}return(b.which||b.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted)},_mouseUp:function(c){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target===this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),b=!1,!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}),function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],a):a(jQuery)}(function(a){return a.widget("ui.draggable",a.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(a,b){this._super(a,b),"handle"===a&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(b){var c=this.options;return this._blurActiveElement(b),this.helper||c.disabled||a(b.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(b),this.handle?(this._blockFrames(c.iframeFix===!0?"iframe":c.iframeFix),!0):!1)},_blockFrames:function(b){this.iframeBlocks=this.document.find(b).map(function(){var b=a(this);return a("<div>").css("position","absolute").appendTo(b.parent()).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()).offset(b.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(b){var c=this.document[0];if(this.handleElement.is(b.target))try{c.activeElement&&"body"!==c.activeElement.nodeName.toLowerCase()&&a(c.activeElement).blur()}catch(d){}},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===a(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(b),this.originalPosition=this.position=this._generatePosition(b,!1),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._normalizeRightBottom(),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top}},_mouseDrag:function(b,c){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(b,!0),this.positionAbs=this._convertPositionTo("absolute"),!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=this,d=!1;return a.ui.ddmanager&&!this.options.dropBehaviour&&(d=a.ui.ddmanager.drop(this,b)),this.dropped&&(d=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!d||"valid"===this.options.revert&&d||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)?a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",b)!==!1&&c._clear()}):this._trigger("stop",b)!==!1&&this._clear(),!1},_mouseUp:function(b){return this._unblockFrames(),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),this.handleElement.is(b.target)&&this.element.focus(),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){return this.options.handle?!!a(b.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper),e=d?a(c.helper.apply(this.element[0],[b])):"clone"===c.helper?this.element.clone().removeAttr("id"):this.element;return e.parents("body").length||e.appendTo("parent"===c.appendTo?this.element[0].parentNode:c.appendTo),d&&e[0]===this.element[0]&&this._setPositionRelative(),e[0]===this.element[0]||/(fixed|absolute)/.test(e.css("position"))||e.css("position","absolute"),e},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_isRootNode:function(a){return/(html|body)/i.test(a.tagName)||a===this.document[0]},_getParentOffset:function(){var b=this.offsetParent.offset(),c=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==c&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var a=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+(b?0:this.scrollParent.scrollTop()),left:a.left-(parseInt(this.helper.css("left"),10)||0)+(b?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b,c,d,e=this.options,f=this.document[0];return this.relativeContainer=null,e.containment?"window"===e.containment?void(this.containment=[a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,a(window).scrollLeft()+a(window).width()-this.helperProportions.width-this.margins.left,a(window).scrollTop()+(a(window).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===e.containment?void(this.containment=[0,0,a(f).width()-this.helperProportions.width-this.margins.left,(a(f).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):e.containment.constructor===Array?void(this.containment=e.containment):("parent"===e.containment&&(e.containment=this.helper[0].parentNode),c=a(e.containment),d=c[0],void(d&&(b=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(b?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(a,b){b||(b=this.position);var c="absolute"===a?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:b.top+this.offset.relative.top*c+this.offset.parent.top*c-("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top)*c,left:b.left+this.offset.relative.left*c+this.offset.parent.left*c-("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)*c}},_generatePosition:function(a,b){var c,d,e,f,g=this.options,h=this._isRootNode(this.scrollParent[0]),i=a.pageX,j=a.pageY; 23 return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),b&&(this.containment&&(this.relativeContainer?(d=this.relativeContainer.offset(),c=[this.containment[0]+d.left,this.containment[1]+d.top,this.containment[2]+d.left,this.containment[3]+d.top]):c=this.containment,a.pageX-this.offset.click.left<c[0]&&(i=c[0]+this.offset.click.left),a.pageY-this.offset.click.top<c[1]&&(j=c[1]+this.offset.click.top),a.pageX-this.offset.click.left>c[2]&&(i=c[2]+this.offset.click.left),a.pageY-this.offset.click.top>c[3]&&(j=c[3]+this.offset.click.top)),g.grid&&(e=g.grid[1]?this.originalPageY+Math.round((j-this.originalPageY)/g.grid[1])*g.grid[1]:this.originalPageY,j=c?e-this.offset.click.top>=c[1]||e-this.offset.click.top>c[3]?e:e-this.offset.click.top>=c[1]?e-g.grid[1]:e+g.grid[1]:e,f=g.grid[0]?this.originalPageX+Math.round((i-this.originalPageX)/g.grid[0])*g.grid[0]:this.originalPageX,i=c?f-this.offset.click.left>=c[0]||f-this.offset.click.left>c[2]?f:f-this.offset.click.left>=c[0]?f-g.grid[0]:f+g.grid[0]:f),"y"===g.axis&&(i=this.originalPageX),"x"===g.axis&&(j=this.originalPageY)),{top:j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d,this],!0),/^(drag|start|stop)/.test(b)&&(this.positionAbs=this._convertPositionTo("absolute"),d.offset=this.positionAbs),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c,d){var e=a.extend({},c,{item:d.element});d.sortables=[],a(d.options.connectToSortable).each(function(){var c=a(this).sortable("instance");c&&!c.options.disabled&&(d.sortables.push(c),c.refreshPositions(),c._trigger("activate",b,e))})},stop:function(b,c,d){var e=a.extend({},c,{item:d.element});d.cancelHelperRemoval=!1,a.each(d.sortables,function(){var a=this;a.isOver?(a.isOver=0,d.cancelHelperRemoval=!0,a.cancelHelperRemoval=!1,a._storedCSS={position:a.placeholder.css("position"),top:a.placeholder.css("top"),left:a.placeholder.css("left")},a._mouseStop(b),a.options.helper=a.options._helper):(a.cancelHelperRemoval=!0,a._trigger("deactivate",b,e))})},drag:function(b,c,d){a.each(d.sortables,function(){var e=!1,f=this;f.positionAbs=d.positionAbs,f.helperProportions=d.helperProportions,f.offset.click=d.offset.click,f._intersectsWith(f.containerCache)&&(e=!0,a.each(d.sortables,function(){return this.positionAbs=d.positionAbs,this.helperProportions=d.helperProportions,this.offset.click=d.offset.click,this!==f&&this._intersectsWith(this.containerCache)&&a.contains(f.element[0],this.element[0])&&(e=!1),e})),e?(f.isOver||(f.isOver=1,f.currentItem=c.helper.appendTo(f.element).data("ui-sortable-item",!0),f.options._helper=f.options.helper,f.options.helper=function(){return c.helper[0]},b.target=f.currentItem[0],f._mouseCapture(b,!0),f._mouseStart(b,!0,!0),f.offset.click.top=d.offset.click.top,f.offset.click.left=d.offset.click.left,f.offset.parent.left-=d.offset.parent.left-f.offset.parent.left,f.offset.parent.top-=d.offset.parent.top-f.offset.parent.top,d._trigger("toSortable",b),d.dropped=f.element,a.each(d.sortables,function(){this.refreshPositions()}),d.currentItem=d.element,f.fromOutside=d),f.currentItem&&(f._mouseDrag(b),c.position=f.position)):f.isOver&&(f.isOver=0,f.cancelHelperRemoval=!0,f.options._revert=f.options.revert,f.options.revert=!1,f._trigger("out",b,f._uiHash(f)),f._mouseStop(b,!0),f.options.revert=f.options._revert,f.options.helper=f.options._helper,f.placeholder&&f.placeholder.remove(),d._refreshOffsets(b),c.position=d._generatePosition(b,!0),d._trigger("fromSortable",b),d.dropped=!1,a.each(d.sortables,function(){this.refreshPositions()}))})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c,d){var e=a("body"),f=d.options;e.css("cursor")&&(f._cursor=e.css("cursor")),e.css("cursor",f.cursor)},stop:function(b,c,d){var e=d.options;e._cursor&&a("body").css("cursor",e._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("opacity")&&(f._opacity=e.css("opacity")),e.css("opacity",f.opacity)},stop:function(b,c,d){var e=d.options;e._opacity&&a(c.helper).css("opacity",e._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(a,b,c){c.scrollParentNotHidden||(c.scrollParentNotHidden=c.helper.scrollParent(!1)),c.scrollParentNotHidden[0]!==c.document[0]&&"HTML"!==c.scrollParentNotHidden[0].tagName&&(c.overflowOffset=c.scrollParentNotHidden.offset())},drag:function(b,c,d){var e=d.options,f=!1,g=d.scrollParentNotHidden[0],h=d.document[0];g!==h&&"HTML"!==g.tagName?(e.axis&&"x"===e.axis||(d.overflowOffset.top+g.offsetHeight-b.pageY<e.scrollSensitivity?g.scrollTop=f=g.scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(g.scrollTop=f=g.scrollTop-e.scrollSpeed)),e.axis&&"y"===e.axis||(d.overflowOffset.left+g.offsetWidth-b.pageX<e.scrollSensitivity?g.scrollLeft=f=g.scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(g.scrollLeft=f=g.scrollLeft-e.scrollSpeed))):(e.axis&&"x"===e.axis||(b.pageY-a(h).scrollTop()<e.scrollSensitivity?f=a(h).scrollTop(a(h).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(h).scrollTop())<e.scrollSensitivity&&(f=a(h).scrollTop(a(h).scrollTop()+e.scrollSpeed))),e.axis&&"y"===e.axis||(b.pageX-a(h).scrollLeft()<e.scrollSensitivity?f=a(h).scrollLeft(a(h).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(h).scrollLeft())<e.scrollSensitivity&&(f=a(h).scrollLeft(a(h).scrollLeft()+e.scrollSpeed)))),f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c,d){var e=d.options;d.snapElements=[],a(e.snap.constructor!==String?e.snap.items||":data(ui-draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!==d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o=d.options,p=o.snapTolerance,q=c.offset.left,r=q+d.helperProportions.width,s=c.offset.top,t=s+d.helperProportions.height;for(m=d.snapElements.length-1;m>=0;m--)i=d.snapElements[m].left-d.margins.left,j=i+d.snapElements[m].width,k=d.snapElements[m].top-d.margins.top,l=k+d.snapElements[m].height,i-p>r||q>j+p||k-p>t||s>l+p||!a.contains(d.snapElements[m].item.ownerDocument,d.snapElements[m].item)?(d.snapElements[m].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=!1):("inner"!==o.snapMode&&(e=p>=Math.abs(k-t),f=p>=Math.abs(l-s),g=p>=Math.abs(i-r),h=p>=Math.abs(j-q),e&&(c.position.top=d._convertPositionTo("relative",{top:k-d.helperProportions.height,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i-d.helperProportions.width}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j}).left)),n=e||f||g||h,"outer"!==o.snapMode&&(e=p>=Math.abs(k-s),f=p>=Math.abs(l-t),g=p>=Math.abs(i-q),h=p>=Math.abs(j-r),e&&(c.position.top=d._convertPositionTo("relative",{top:k,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l-d.helperProportions.height,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j-d.helperProportions.width}).left)),!d.snapElements[m].snapping&&(e||f||g||h||n)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=e||f||g||h||n)}}),a.ui.plugin.add("draggable","stack",{start:function(b,c,d){var e,f=d.options,g=a.makeArray(a(f.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});g.length&&(e=parseInt(a(g[0]).css("zIndex"),10)||0,a(g).each(function(b){a(this).css("zIndex",e+b)}),this.css("zIndex",e+g.length))}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("zIndex")&&(f._zIndex=e.css("zIndex")),e.css("zIndex",f.zIndex)},stop:function(b,c,d){var e=d.options;e._zIndex&&a(c.helper).css("zIndex",e._zIndex)}}),a.ui.draggable}),function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Plotly=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d=a("../src/plotly"),e={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var f in e){var g=f.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");d.Lib.addStyleRule(g,e[f])}},{"../src/plotly":366}],2:[function(a,b,c){"use strict";b.exports={undo:{width:857.1,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",ascent:850,descent:-150},home:{width:928.6,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",ascent:850,descent:-150},"camera-retro":{width:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",ascent:850,descent:-150},zoombox:{width:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",ascent:850,descent:-150},pan:{width:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",ascent:850,descent:-150},zoom_plus:{width:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",ascent:850,descent:-150},plotlylogo:{width:1542,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",ascent:850,descent:-150},"z-axis":{width:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",ascent:850,descent:-150},"3d_rotate":{width:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",ascent:850,descent:-150},camera:{width:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",ascent:850,descent:-150},movie:{width:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",ascent:850,descent:-150},question:{width:857.1,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",ascent:850,descent:-150},disk:{width:857.1,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",ascent:850,descent:-150},lasso:{width:1031,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",ascent:850,descent:-150},selectbox:{width:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",ascent:850,descent:-150}}},{}],3:[function(a,b,c){b.exports=a("../src/traces/bar")},{"../src/traces/bar":429}],4:[function(a,b,c){b.exports=a("../src/traces/box")},{"../src/traces/box":440}],5:[function(a,b,c){b.exports=a("../src/traces/choropleth")},{"../src/traces/choropleth":448}],6:[function(a,b,c){b.exports=a("../src/traces/contour")},{"../src/traces/contour":455}],7:[function(a,b,c){b.exports=a("../src/core")},{"../src/core":339}],8:[function(a,b,c){b.exports=a("../src/traces/heatmap")},{"../src/traces/heatmap":466}],9:[function(a,b,c){b.exports=a("../src/traces/histogram")},{"../src/traces/histogram":477}],10:[function(a,b,c){b.exports=a("../src/traces/histogram2d")},{"../src/traces/histogram2d":482}],11:[function(a,b,c){b.exports=a("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":486}],12:[function(a,b,c){"use strict";var d=a("./core");d.register([a("./bar"),a("./box"),a("./heatmap"),a("./histogram"),a("./histogram2d"),a("./histogram2dcontour"),a("./pie"),a("./contour"),a("./scatter3d"),a("./surface"),a("./mesh3d"),a("./scattergeo"),a("./choropleth"),a("./scattergl")]),b.exports=d},{"./bar":3,"./box":4,"./choropleth":5,"./contour":6,"./core":7,"./heatmap":8,"./histogram":9,"./histogram2d":10,"./histogram2dcontour":11,"./mesh3d":13,"./pie":14,"./scatter3d":15,"./scattergeo":16,"./scattergl":17,"./surface":18}],13:[function(a,b,c){b.exports=a("../src/traces/mesh3d")},{"../src/traces/mesh3d":490}],14:[function(a,b,c){b.exports=a("../src/traces/pie")},{"../src/traces/pie":495}],15:[function(a,b,c){b.exports=a("../src/traces/scatter3d")},{"../src/traces/scatter3d":528}],16:[function(a,b,c){b.exports=a("../src/traces/scattergeo")},{"../src/traces/scattergeo":532}],17:[function(a,b,c){b.exports=a("../src/traces/scattergl")},{"../src/traces/scattergl":537}],18:[function(a,b,c){b.exports=a("../src/traces/surface")},{"../src/traces/surface":542}],19:[function(a,b,c){"use strict";function d(a,b,c){return Math.min(b,Math.max(a,c))}function e(a,b,c){this.dimension=a.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var d=0;d<this.dimension;++d)this.bounds[0][d]=-(1/0),this.bounds[1][d]=1/0;this._state=a.slice().reverse(),this._velocity=b.slice().reverse(),this._time=[c],this._scratch=[a.slice(),a.slice(),a.slice(),a.slice(),a.slice()]}function f(a){for(var b=new Array(a),c=0;a>c;++c)b[c]=0;return b}function g(a,b,c){switch(arguments.length){case 0:return new e([0],[0],0);case 1:if("number"==typeof a){var d=f(a);return new e(d,d,0)}return new e(a,f(a.length),0);case 2:if("number"==typeof b){var d=f(a.length);return new e(a,d,+b)}c=0;case 3:if(a.length!==b.length)throw new Error("state and velocity lengths must match");return new e(a,b,c)}}b.exports=g;var h=a("cubic-hermite"),i=a("binary-search-bounds"),j=e.prototype;j.flush=function(a){var b=i.gt(this._time,a)-1;0>=b||(this._time.splice(0,b),this._state.splice(0,b*this.dimension),this._velocity.splice(0,b*this.dimension))},j.curve=function(a){var b=this._time,c=b.length,e=i.le(b,a),f=this._scratch[0],g=this._state,j=this._velocity,k=this.dimension,l=this.bounds;if(0>e)for(var m=k-1,n=0;k>n;++n,--m)f[n]=g[m];else if(e>=c-1)for(var m=g.length-1,o=a-b[c-1],n=0;k>n;++n,--m)f[n]=g[m]+o*j[m];else{for(var m=k*(e+1)-1,p=b[e],q=b[e+1],r=q-p||1,s=this._scratch[1],t=this._scratch[2],u=this._scratch[3],v=this._scratch[4],w=!0,n=0;k>n;++n,--m)s[n]=g[m],u[n]=j[m]*r,t[n]=g[m+k],v[n]=j[m+k]*r,w=w&&s[n]===t[n]&&u[n]===v[n]&&0===u[n];if(w)for(var n=0;k>n;++n)f[n]=s[n];else h(s,u,t,v,(a-p)/r,f)}for(var x=l[0],y=l[1],n=0;k>n;++n)f[n]=d(x[n],y[n],f[n]);return f},j.dcurve=function(a){var b=this._time,c=b.length,d=i.le(b,a),e=this._scratch[0],f=this._state,g=this._velocity,j=this.dimension;if(d>=c-1)for(var k=f.length-1,l=(a-b[c-1],0);j>l;++l,--k)e[l]=g[k];else{for(var k=j*(d+1)-1,m=b[d],n=b[d+1],o=n-m||1,p=this._scratch[1],q=this._scratch[2],r=this._scratch[3],s=this._scratch[4],t=!0,l=0;j>l;++l,--k)p[l]=f[k],r[l]=g[k]*o,q[l]=f[k+j],s[l]=g[k+j]*o,t=t&&p[l]===q[l]&&r[l]===s[l]&&0===r[l];if(t)for(var l=0;j>l;++l)e[l]=0;else{h.derivative(p,r,q,s,(a-m)/o,e);for(var l=0;j>l;++l)e[l]/=o}}return e},j.lastT=function(){var a=this._time;return a[a.length-1]},j.stable=function(){for(var a=this._velocity,b=a.length,c=this.dimension-1;c>=0;--c)if(a[--b])return!1;return!0},j.jump=function(a){var b=this.lastT(),c=this.dimension;if(!(b>a||arguments.length!==c+1)){var e=this._state,f=this._velocity,g=e.length-this.dimension,h=this.bounds,i=h[0],j=h[1];this._time.push(b,a);for(var k=0;2>k;++k)for(var l=0;c>l;++l)e.push(e[g++]),f.push(0);this._time.push(a);for(var l=c;l>0;--l)e.push(d(i[l-1],j[l-1],arguments[l])),f.push(0)}},j.push=function(a){var b=this.lastT(),c=this.dimension;if(!(b>a||arguments.length!==c+1)){var e=this._state,f=this._velocity,g=e.length-this.dimension,h=a-b,i=this.bounds,j=i[0],k=i[1],l=h>1e-6?1/h:0;this._time.push(a);for(var m=c;m>0;--m){var n=d(j[m-1],k[m-1],arguments[m]);e.push(n),f.push((n-e[g++])*l)}}},j.set=function(a){var b=this.dimension;if(!(a<this.lastT()||arguments.length!==b+1)){var c=this._state,e=this._velocity,f=this.bounds,g=f[0],h=f[1];this._time.push(a);for(var i=b;i>0;--i)c.push(d(g[i-1],h[i-1],arguments[i])),e.push(0)}},j.move=function(a){var b=this.lastT(),c=this.dimension;if(!(b>=a||arguments.length!==c+1)){var e=this._state,f=this._velocity,g=e.length-this.dimension,h=this.bounds,i=h[0],j=h[1],k=a-b,l=k>1e-6?1/k:0;this._time.push(a);for(var m=c;m>0;--m){var n=arguments[m];e.push(d(i[m-1],j[m-1],e[g++]+n)),f.push(n*l)}}},j.idle=function(a){var b=this.lastT();if(!(b>a)){var c=this.dimension,e=this._state,f=this._velocity,g=e.length-c,h=this.bounds,i=h[0],j=h[1],k=a-b;this._time.push(a);for(var l=c-1;l>=0;--l)e.push(d(i[l],j[l],e[g]+k*f[g])),f.push(0),g+=1}}},{"binary-search-bounds":20,"cubic-hermite":21}],20:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){var g=["function ",a,"(a,l,h,",d.join(","),"){",f?"":"var i=",c?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",e?".get(m)":"[m]"];return f?b.indexOf("c")<0?g.push(";if(x===y){return m}else if(x<=y){"):g.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):g.push(";if(",b,"){i=m;"),c?g.push("l=m+1}else{h=m-1}"):g.push("h=m-1}else{l=m+1}"),g.push("}"),f?g.push("return -1};"):g.push("return i};"),g.join("")}function e(a,b,c,e){var f=new Function([d("A","x"+a+"y",b,["y"],!1,e),d("B","x"+a+"y",b,["y"],!0,e),d("P","c(x,y)"+a+"0",b,["y","c"],!1,e),d("Q","c(x,y)"+a+"0",b,["y","c"],!0,e),"function dispatchBsearch",c,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",c].join(""));return f()}b.exports={ge:e(">=",!1,"GE"),gt:e(">",!1,"GT"),lt:e("<",!0,"LT"),le:e("<=",!0,"LE"),eq:e("-",!0,"EQ",!0)}},{}],21:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){var g=6*e*e-6*e,h=3*e*e-4*e+1,i=-6*e*e+6*e,j=3*e*e-2*e;if(a.length){f||(f=new Array(a.length));for(var k=a.length-1;k>=0;--k)f[k]=g*a[k]+h*b[k]+i*c[k]+j*d[k];return f}return g*a+h*b+i*c[k]+j*d}function e(a,b,c,d,e,f){var g=e-1,h=e*e,i=g*g,j=(1+2*e)*i,k=e*i,l=h*(3-2*e),m=h*g;if(a.length){f||(f=new Array(a.length));for(var n=a.length-1;n>=0;--n)f[n]=j*a[n]+k*b[n]+l*c[n]+m*d[n];return f}return j*a+k*b+l*c+m*d}b.exports=e,b.exports.derivative=d},{}],22:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2];return a[0]=e*i-f*h,a[1]=f*g-d*i,a[2]=d*h-e*g,a}b.exports=d},{}],23:[function(a,b,c){function d(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}b.exports=d},{}],24:[function(a,b,c){function d(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)}b.exports=d},{}],25:[function(a,b,c){function d(a,b,c,d){var e=b[0],f=b[1],g=b[2];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a}b.exports=d},{}],26:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=c*c+d*d+e*e;return f>0&&(f=1/Math.sqrt(f),a[0]=b[0]*f,a[1]=b[1]*f,a[2]=b[2]*f),a}b.exports=d},{}],27:[function(a,b,c){"use strict";function d(a){this._components=a.slice(),this._time=[0],this.prevMatrix=a.slice(),this.nextMatrix=a.slice(),this.computedMatrix=a.slice(),this.computedInverse=a.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function e(a){a=a||{};var b=a.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new d(b)}var f=a("binary-search-bounds"),g=a("mat4-interpolate"),h=a("gl-mat4/invert"),i=a("gl-mat4/rotateX"),j=a("gl-mat4/rotateY"),k=a("gl-mat4/rotateZ"),l=a("gl-mat4/lookAt"),m=a("gl-mat4/translate"),n=(a("gl-mat4/scale"),a("gl-vec3/normalize")),o=[0,0,0];b.exports=e;var p=d.prototype;p.recalcMatrix=function(a){var b=this._time,c=f.le(b,a),d=this.computedMatrix;if(!(0>c)){var e=this._components;if(c===b.length-1)for(var i=16*c,j=0;16>j;++j)d[j]=e[i++];else{for(var k=b[c+1]-b[c],i=16*c,l=this.prevMatrix,m=!0,j=0;16>j;++j)l[j]=e[i++];for(var o=this.nextMatrix,j=0;16>j;++j)o[j]=e[i++],m=m&&l[j]===o[j];if(1e-6>k||m)for(var j=0;16>j;++j)d[j]=l[j];else g(d,l,o,(a-b[c])/k)}var p=this.computedUp;p[0]=d[1],p[1]=d[5],p[2]=d[6],n(p,p);var q=this.computedInverse;h(q,d);var r=this.computedEye,s=q[15];r[0]=q[12]/s,r[1]=q[13]/s,r[2]=q[14]/s;for(var t=this.computedCenter,u=Math.exp(this.computedRadius[0]),j=0;3>j;++j)t[j]=r[j]-d[2+4*j]*u}},p.idle=function(a){if(!(a<this.lastT())){for(var b=this._components,c=b.length-16,d=0;16>d;++d)b.push(b[c++]);this._time.push(a)}},p.flush=function(a){var b=f.gt(this._time,a)-2;0>b||(this._time.slice(0,b),this._components.slice(0,16*b))},p.lastT=function(){return this._time[this._time.length-1]},p.lookAt=function(a,b,c,d){this.recalcMatrix(a),b=b||this.computedEye,c=c||o,d=d||this.computedUp,this.setMatrix(a,l(this.computedMatrix,b,c,d));for(var e=0,f=0;3>f;++f)e+=Math.pow(c[f]-b[f],2);e=Math.log(Math.sqrt(e)),this.computedRadius[0]=e},p.rotate=function(a,b,c,d){this.recalcMatrix(a);var e=this.computedInverse;b&&j(e,e,b),c&&i(e,e,c),d&&k(e,e,d),this.setMatrix(a,h(this.computedMatrix,e))};var q=[0,0,0];p.pan=function(a,b,c,d){q[0]=-(b||0),q[1]=-(c||0),q[2]=-(d||0),this.recalcMatrix(a);var e=this.computedInverse;m(e,e,q),this.setMatrix(a,h(e,e))},p.translate=function(a,b,c,d){q[0]=b||0,q[1]=c||0,q[2]=d||0,this.recalcMatrix(a);var e=this.computedMatrix;m(e,e,q),this.setMatrix(a,e)},p.setMatrix=function(a,b){if(!(a<this.lastT())){this._time.push(a);for(var c=0;16>c;++c)this._components.push(b[c])}},p.setDistance=function(a,b){this.computedRadius[0]=b},p.setDistanceLimits=function(a,b){var c=this._limits;c[0]=a,c[1]=b},p.getDistanceLimits=function(a){var b=this._limits;return a?(a[0]=b[0],a[1]=b[1],a):b}},{"binary-search-bounds":28,"gl-mat4/invert":94,"gl-mat4/lookAt":95,"gl-mat4/rotateX":99,"gl-mat4/rotateY":100,"gl-mat4/rotateZ":101,"gl-mat4/scale":102,"gl-mat4/translate":103,"gl-vec3/normalize":26,"mat4-interpolate":29}],28:[function(a,b,c){arguments[4][20][0].apply(c,arguments); 24 },{dup:20}],29:[function(a,b,c){function d(a,b,c,d){if(0===k(b)||0===k(c))return!1;var e=j(b,m.translate,m.scale,m.skew,m.perspective,m.quaternion),f=j(c,n.translate,n.scale,n.skew,n.perspective,n.quaternion);return e&&f?(h(o.translate,m.translate,n.translate,d),h(o.skew,m.skew,n.skew,d),h(o.scale,m.scale,n.scale,d),h(o.perspective,m.perspective,n.perspective,d),l(o.quaternion,m.quaternion,n.quaternion,d),i(a,o.translate,o.scale,o.skew,o.perspective,o.quaternion),!0):!1}function e(){return{translate:f(),scale:f(1),skew:f(),perspective:g(),quaternion:g()}}function f(a){return[a||0,a||0,a||0]}function g(){return[0,0,0,1]}var h=a("gl-vec3/lerp"),i=a("mat4-recompose"),j=a("mat4-decompose"),k=a("gl-mat4/determinant"),l=a("quat-slerp"),m=e(),n=e(),o=e();b.exports=d},{"gl-mat4/determinant":90,"gl-vec3/lerp":25,"mat4-decompose":30,"mat4-recompose":32,"quat-slerp":33}],30:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a}function e(a,b){a[0][0]=b[0],a[0][1]=b[1],a[0][2]=b[2],a[1][0]=b[4],a[1][1]=b[5],a[1][2]=b[6],a[2][0]=b[8],a[2][1]=b[9],a[2][2]=b[10]}function f(a,b,c,d,e){a[0]=b[0]*d+c[0]*e,a[1]=b[1]*d+c[1]*e,a[2]=b[2]*d+c[2]*e}var g=a("./normalize"),h=a("gl-mat4/create"),i=a("gl-mat4/clone"),j=a("gl-mat4/determinant"),k=a("gl-mat4/invert"),l=a("gl-mat4/transpose"),m={length:a("gl-vec3/length"),normalize:a("gl-vec3/normalize"),dot:a("gl-vec3/dot"),cross:a("gl-vec3/cross")},n=h(),o=h(),p=[0,0,0,0],q=[[0,0,0],[0,0,0],[0,0,0]],r=[0,0,0];b.exports=function(a,b,c,h,s,t){if(b||(b=[0,0,0]),c||(c=[0,0,0]),h||(h=[0,0,0]),s||(s=[0,0,0,1]),t||(t=[0,0,0,1]),!g(n,a))return!1;if(i(o,n),o[3]=0,o[7]=0,o[11]=0,o[15]=1,Math.abs(j(o)<1e-8))return!1;var u=n[3],v=n[7],w=n[11],x=n[12],y=n[13],z=n[14],A=n[15];if(0!==u||0!==v||0!==w){p[0]=u,p[1]=v,p[2]=w,p[3]=A;var B=k(o,o);if(!B)return!1;l(o,o),d(s,p,o)}else s[0]=s[1]=s[2]=0,s[3]=1;if(b[0]=x,b[1]=y,b[2]=z,e(q,n),c[0]=m.length(q[0]),m.normalize(q[0],q[0]),h[0]=m.dot(q[0],q[1]),f(q[1],q[1],q[0],1,-h[0]),c[1]=m.length(q[1]),m.normalize(q[1],q[1]),h[0]/=c[1],h[1]=m.dot(q[0],q[2]),f(q[2],q[2],q[0],1,-h[1]),h[2]=m.dot(q[1],q[2]),f(q[2],q[2],q[1],1,-h[2]),c[2]=m.length(q[2]),m.normalize(q[2],q[2]),h[1]/=c[2],h[2]/=c[2],m.cross(r,q[1],q[2]),m.dot(q[0],r)<0)for(var C=0;3>C;C++)c[C]*=-1,q[C][0]*=-1,q[C][1]*=-1,q[C][2]*=-1;return t[0]=.5*Math.sqrt(Math.max(1+q[0][0]-q[1][1]-q[2][2],0)),t[1]=.5*Math.sqrt(Math.max(1-q[0][0]+q[1][1]-q[2][2],0)),t[2]=.5*Math.sqrt(Math.max(1-q[0][0]-q[1][1]+q[2][2],0)),t[3]=.5*Math.sqrt(Math.max(1+q[0][0]+q[1][1]+q[2][2],0)),q[2][1]>q[1][2]&&(t[0]=-t[0]),q[0][2]>q[2][0]&&(t[1]=-t[1]),q[1][0]>q[0][1]&&(t[2]=-t[2]),!0}},{"./normalize":31,"gl-mat4/clone":88,"gl-mat4/create":89,"gl-mat4/determinant":90,"gl-mat4/invert":94,"gl-mat4/transpose":104,"gl-vec3/cross":22,"gl-vec3/dot":23,"gl-vec3/length":24,"gl-vec3/normalize":26}],31:[function(a,b,c){b.exports=function(a,b){var c=b[15];if(0===c)return!1;for(var d=1/c,e=0;16>e;e++)a[e]=b[e]*d;return!0}},{}],32:[function(a,b,c){var d={identity:a("gl-mat4/identity"),translate:a("gl-mat4/translate"),multiply:a("gl-mat4/multiply"),create:a("gl-mat4/create"),scale:a("gl-mat4/scale"),fromRotationTranslation:a("gl-mat4/fromRotationTranslation")},e=(d.create(),d.create());b.exports=function(a,b,c,f,g,h){return d.identity(a),d.fromRotationTranslation(a,h,b),a[3]=g[0],a[7]=g[1],a[11]=g[2],a[15]=g[3],d.identity(e),0!==f[2]&&(e[9]=f[2],d.multiply(a,a,e)),0!==f[1]&&(e[9]=0,e[8]=f[1],d.multiply(a,a,e)),0!==f[0]&&(e[8]=0,e[4]=f[0],d.multiply(a,a,e)),d.scale(a,a,c),a}},{"gl-mat4/create":89,"gl-mat4/fromRotationTranslation":92,"gl-mat4/identity":93,"gl-mat4/multiply":96,"gl-mat4/scale":102,"gl-mat4/translate":103}],33:[function(a,b,c){b.exports=a("gl-quat/slerp")},{"gl-quat/slerp":34}],34:[function(a,b,c){function d(a,b,c,d){var e,f,g,h,i,j=b[0],k=b[1],l=b[2],m=b[3],n=c[0],o=c[1],p=c[2],q=c[3];return f=j*n+k*o+l*p+m*q,0>f&&(f=-f,n=-n,o=-o,p=-p,q=-q),1-f>1e-6?(e=Math.acos(f),g=Math.sin(e),h=Math.sin((1-d)*e)/g,i=Math.sin(d*e)/g):(h=1-d,i=d),a[0]=h*j+i*n,a[1]=h*k+i*o,a[2]=h*l+i*p,a[3]=h*m+i*q,a}b.exports=d},{}],35:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h,i,j){var k=b+f+j;if(l>0){var l=Math.sqrt(k+1);a[0]=.5*(g-i)/l,a[1]=.5*(h-d)/l,a[2]=.5*(c-f)/l,a[3]=.5*l}else{var m=Math.max(b,f,j),l=Math.sqrt(2*m-k+1);b>=m?(a[0]=.5*l,a[1]=.5*(e+c)/l,a[2]=.5*(h+d)/l,a[3]=.5*(g-i)/l):f>=m?(a[0]=.5*(c+e)/l,a[1]=.5*l,a[2]=.5*(i+g)/l,a[3]=.5*(h-d)/l):(a[0]=.5*(d+h)/l,a[1]=.5*(g+i)/l,a[2]=.5*l,a[3]=.5*(c-e)/l)}return a}b.exports=d},{}],36:[function(a,b,c){"use strict";function d(a,b,c){return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2))}function e(a,b,c,d){return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2)+Math.pow(d,2))}function f(a,b){var c=b[0],d=b[1],f=b[2],g=b[3],h=e(c,d,f,g);h>1e-6?(a[0]=c/h,a[1]=d/h,a[2]=f/h,a[3]=g/h):(a[0]=a[1]=a[2]=0,a[3]=1)}function g(a,b,c){this.radius=i([c]),this.center=i(b),this.rotation=i(a),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function h(a){a=a||{};var b=a.center||[0,0,0],c=a.rotation||[0,0,0,1],d=a.radius||1;b=[].slice.call(b,0,3),c=[].slice.call(c,0,4),f(c,c);var e=new g(c,b,Math.log(d));return e.setDistanceLimits(a.zoomMin,a.zoomMax),("eye"in a||"up"in a)&&e.lookAt(0,a.eye,a.center,a.up),e}b.exports=h;var i=a("filtered-vector"),j=a("gl-mat4/lookAt"),k=a("gl-mat4/fromQuat"),l=a("gl-mat4/invert"),m=a("./lib/quatFromFrame"),n=g.prototype;n.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},n.recalcMatrix=function(a){this.radius.curve(a),this.center.curve(a),this.rotation.curve(a);var b=this.computedRotation;f(b,b);var c=this.computedMatrix;k(c,b);var d=this.computedCenter,e=this.computedEye,g=this.computedUp,h=Math.exp(this.computedRadius[0]);e[0]=d[0]+h*c[2],e[1]=d[1]+h*c[6],e[2]=d[2]+h*c[10],g[0]=c[1],g[1]=c[5],g[2]=c[9];for(var i=0;3>i;++i){for(var j=0,l=0;3>l;++l)j+=c[i+4*l]*e[l];c[12+i]=-j}},n.getMatrix=function(a,b){this.recalcMatrix(a);var c=this.computedMatrix;if(b){for(var d=0;16>d;++d)b[d]=c[d];return b}return c},n.idle=function(a){this.center.idle(a),this.radius.idle(a),this.rotation.idle(a)},n.flush=function(a){this.center.flush(a),this.radius.flush(a),this.rotation.flush(a)},n.pan=function(a,b,c,e){b=b||0,c=c||0,e=e||0,this.recalcMatrix(a);var f=this.computedMatrix,g=f[1],h=f[5],i=f[9],j=d(g,h,i);g/=j,h/=j,i/=j;var k=f[0],l=f[4],m=f[8],n=k*g+l*h+m*i;k-=g*n,l-=h*n,m-=i*n;var o=d(k,l,m);k/=o,l/=o,m/=o;var p=f[2],q=f[6],r=f[10],s=p*g+q*h+r*i,t=p*k+q*l+r*m;p-=s*g+t*k,q-=s*h+t*l,r-=s*i+t*m;var u=d(p,q,r);p/=u,q/=u,r/=u;var v=k*b+g*c,w=l*b+h*c,x=m*b+i*c;this.center.move(a,v,w,x);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+e),this.radius.set(a,Math.log(y))},n.rotate=function(a,b,c,f){this.recalcMatrix(a),b=b||0,c=c||0;var g=this.computedMatrix,h=g[0],i=g[4],j=g[8],k=g[1],l=g[5],m=g[9],n=g[2],o=g[6],p=g[10],q=b*h+c*k,r=b*i+c*l,s=b*j+c*m,t=-(o*s-p*r),u=-(p*q-n*s),v=-(n*r-o*q),w=Math.sqrt(Math.max(0,1-Math.pow(t,2)-Math.pow(u,2)-Math.pow(v,2))),x=e(t,u,v,w);x>1e-6?(t/=x,u/=x,v/=x,w/=x):(t=u=v=0,w=1);var y=this.computedRotation,z=y[0],A=y[1],B=y[2],C=y[3],D=z*w+C*t+A*v-B*u,E=A*w+C*u+B*t-z*v,F=B*w+C*v+z*u-A*t,G=C*w-z*t-A*u-B*v;if(f){t=n,u=o,v=p;var H=Math.sin(f)/d(t,u,v);t*=H,u*=H,v*=H,w=Math.cos(b),D=D*w+G*t+E*v-F*u,E=E*w+G*u+F*t-D*v,F=F*w+G*v+D*u-E*t,G=G*w-D*t-E*u-F*v}var I=e(D,E,F,G);I>1e-6?(D/=I,E/=I,F/=I,G/=I):(D=E=F=0,G=1),this.rotation.set(a,D,E,F,G)},n.lookAt=function(a,b,c,d){this.recalcMatrix(a),c=c||this.computedCenter,b=b||this.computedEye,d=d||this.computedUp;var e=this.computedMatrix;j(e,b,c,d);var g=this.computedRotation;m(g,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),f(g,g),this.rotation.set(a,g[0],g[1],g[2],g[3]);for(var h=0,i=0;3>i;++i)h+=Math.pow(c[i]-b[i],2);this.radius.set(a,.5*Math.log(Math.max(h,1e-6))),this.center.set(a,c[0],c[1],c[2])},n.translate=function(a,b,c,d){this.center.move(a,b||0,c||0,d||0)},n.setMatrix=function(a,b){var c=this.computedRotation;m(c,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),f(c,c),this.rotation.set(a,c[0],c[1],c[2],c[3]);var d=this.computedMatrix;l(d,b);var e=d[15];if(Math.abs(e)>1e-6){var g=d[12]/e,h=d[13]/e,i=d[14]/e;this.recalcMatrix(a);var j=Math.exp(this.computedRadius[0]);this.center.set(a,g-d[2]*j,h-d[6]*j,i-d[10]*j),this.radius.idle(a)}else this.center.idle(a),this.radius.idle(a)},n.setDistance=function(a,b){b>0&&this.radius.set(a,Math.log(b))},n.setDistanceLimits=function(a,b){a=a>0?Math.log(a):-(1/0),b=b>0?Math.log(b):1/0,b=Math.max(b,a),this.radius.bounds[0][0]=a,this.radius.bounds[1][0]=b},n.getDistanceLimits=function(a){var b=this.radius.bounds;return a?(a[0]=Math.exp(b[0][0]),a[1]=Math.exp(b[1][0]),a):[Math.exp(b[0][0]),Math.exp(b[1][0])]},n.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},n.fromJSON=function(a){var b=this.lastT(),c=a.center;c&&this.center.set(b,c[0],c[1],c[2]);var d=a.rotation;d&&this.rotation.set(b,d[0],d[1],d[2],d[3]);var e=a.distance;e&&e>0&&this.radius.set(b,Math.log(e)),this.setDistanceLimits(a.zoomMin,a.zoomMax)}},{"./lib/quatFromFrame":35,"filtered-vector":19,"gl-mat4/fromQuat":91,"gl-mat4/invert":94,"gl-mat4/lookAt":95}],37:[function(a,b,c){"use strict";function d(a,b,c){return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2))}function e(a){return Math.min(1,Math.max(-1,a))}function f(a){var b=Math.abs(a[0]),c=Math.abs(a[1]),d=Math.abs(a[2]),e=[0,0,0];b>Math.max(c,d)?e[2]=1:c>Math.max(b,d)?e[0]=1:e[1]=1;for(var f=0,g=0,h=0;3>h;++h)f+=a[h]*a[h],g+=e[h]*a[h];for(var h=0;3>h;++h)e[h]-=g/f*a[h];return m(e,e),e}function g(a,b,c,d,e,f,g,h){this.center=i(c),this.up=i(d),this.right=i(e),this.radius=i([f]),this.angle=i([g,h]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(a,b),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var j=0;16>j;++j)this.computedMatrix[j]=.5;this.recalcMatrix(0)}function h(a){a=a||{};var b=a.center||[0,0,0],c=a.up||[0,1,0],e=a.right||f(c),h=a.radius||1,i=a.theta||0,j=a.phi||0;if(b=[].slice.call(b,0,3),c=[].slice.call(c,0,3),m(c,c),e=[].slice.call(e,0,3),m(e,e),"eye"in a){var k=a.eye,o=[k[0]-b[0],k[1]-b[1],k[2]-b[2]];l(e,o,c),d(e[0],e[1],e[2])<1e-6?e=f(c):m(e,e),h=d(o[0],o[1],o[2]);var p=n(c,o)/h,q=n(e,o)/h;j=Math.acos(p),i=Math.acos(q)}return h=Math.log(h),new g(a.zoomMin,a.zoomMax,b,c,e,h,i,j)}b.exports=h;var i=a("filtered-vector"),j=a("gl-mat4/invert"),k=a("gl-mat4/rotate"),l=a("gl-vec3/cross"),m=a("gl-vec3/normalize"),n=a("gl-vec3/dot"),o=g.prototype;o.setDistanceLimits=function(a,b){a=a>0?Math.log(a):-(1/0),b=b>0?Math.log(b):1/0,b=Math.max(b,a),this.radius.bounds[0][0]=a,this.radius.bounds[1][0]=b},o.getDistanceLimits=function(a){var b=this.radius.bounds[0];return a?(a[0]=Math.exp(b[0][0]),a[1]=Math.exp(b[1][0]),a):[Math.exp(b[0][0]),Math.exp(b[1][0])]},o.recalcMatrix=function(a){this.center.curve(a),this.up.curve(a),this.right.curve(a),this.radius.curve(a),this.angle.curve(a);for(var b=this.computedUp,c=this.computedRight,e=0,f=0,g=0;3>g;++g)f+=b[g]*c[g],e+=b[g]*b[g];for(var h=Math.sqrt(e),i=0,g=0;3>g;++g)c[g]-=b[g]*f/e,i+=c[g]*c[g],b[g]/=h;for(var j=Math.sqrt(i),g=0;3>g;++g)c[g]/=j;var k=this.computedToward;l(k,b,c),m(k,k);for(var n=Math.exp(this.computedRadius[0]),o=this.computedAngle[0],p=this.computedAngle[1],q=Math.cos(o),r=Math.sin(o),s=Math.cos(p),t=Math.sin(p),u=this.computedCenter,v=q*s,w=r*s,x=t,y=-q*t,z=-r*t,A=s,B=this.computedEye,C=this.computedMatrix,g=0;3>g;++g){var D=v*c[g]+w*k[g]+x*b[g];C[4*g+1]=y*c[g]+z*k[g]+A*b[g],C[4*g+2]=D,C[4*g+3]=0}var E=C[1],F=C[5],G=C[9],H=C[2],I=C[6],J=C[10],K=F*J-G*I,L=G*H-E*J,M=E*I-F*H,N=d(K,L,M);K/=N,L/=N,M/=N,C[0]=K,C[4]=L,C[8]=M;for(var g=0;3>g;++g)B[g]=u[g]+C[2+4*g]*n;for(var g=0;3>g;++g){for(var i=0,O=0;3>O;++O)i+=C[g+4*O]*B[O];C[12+g]=-i}C[15]=1},o.getMatrix=function(a,b){this.recalcMatrix(a);var c=this.computedMatrix;if(b){for(var d=0;16>d;++d)b[d]=c[d];return b}return c};var p=[0,0,0];o.rotate=function(a,b,c,d){if(this.angle.move(a,b,c),d){this.recalcMatrix(a);var e=this.computedMatrix;p[0]=e[2],p[1]=e[6],p[2]=e[10];for(var f=this.computedUp,g=this.computedRight,h=this.computedToward,i=0;3>i;++i)e[4*i]=f[i],e[4*i+1]=g[i],e[4*i+2]=h[i];k(e,e,d,p);for(var i=0;3>i;++i)f[i]=e[4*i],g[i]=e[4*i+1];this.up.set(a,f[0],f[1],f[2]),this.right.set(a,g[0],g[1],g[2])}},o.pan=function(a,b,c,e){b=b||0,c=c||0,e=e||0,this.recalcMatrix(a);var f=this.computedMatrix,g=(Math.exp(this.computedRadius[0]),f[1]),h=f[5],i=f[9],j=d(g,h,i);g/=j,h/=j,i/=j;var k=f[0],l=f[4],m=f[8],n=k*g+l*h+m*i;k-=g*n,l-=h*n,m-=i*n;var o=d(k,l,m);k/=o,l/=o,m/=o;var p=k*b+g*c,q=l*b+h*c,r=m*b+i*c;this.center.move(a,p,q,r);var s=Math.exp(this.computedRadius[0]);s=Math.max(1e-4,s+e),this.radius.set(a,Math.log(s))},o.translate=function(a,b,c,d){this.center.move(a,b||0,c||0,d||0)},o.setMatrix=function(a,b,c,f){var g=1;"number"==typeof c&&(g=0|c),(0>g||g>3)&&(g=1);var h=(g+2)%3;b||(this.recalcMatrix(a),b=this.computedMatrix);var i=b[g],k=b[g+4],l=b[g+8];if(f){var m=Math.abs(i),n=Math.abs(k),o=Math.abs(l),p=Math.max(m,n,o);m===p?(i=0>i?-1:1,k=l=0):o===p?(l=0>l?-1:1,i=k=0):(k=0>k?-1:1,i=l=0)}else{var q=d(i,k,l);i/=q,k/=q,l/=q}var r=b[h],s=b[h+4],t=b[h+8],u=r*i+s*k+t*l;r-=i*u,s-=k*u,t-=l*u;var v=d(r,s,t);r/=v,s/=v,t/=v;var w=k*t-l*s,x=l*r-i*t,y=i*s-k*r,z=d(w,x,y);w/=z,x/=z,y/=z,this.center.jump(a,S,T,U),this.radius.idle(a),this.up.jump(a,i,k,l),this.right.jump(a,r,s,t);var A,B;if(2===g){var C=b[1],D=b[5],E=b[9],F=C*r+D*s+E*t,G=C*w+D*x+E*y;A=0>K?-Math.PI/2:Math.PI/2,B=Math.atan2(G,F)}else{var H=b[2],I=b[6],J=b[10],K=H*i+I*k+J*l,L=H*r+I*s+J*t,M=H*w+I*x+J*y;A=Math.asin(e(K)),B=Math.atan2(M,L)}this.angle.jump(a,B,A),this.recalcMatrix(a);var N=b[2],O=b[6],P=b[10],Q=this.computedMatrix;j(Q,b);var R=Q[15],S=Q[12]/R,T=Q[13]/R,U=Q[14]/R,V=Math.exp(this.computedRadius[0]);this.center.jump(a,S-N*V,T-O*V,U-P*V)},o.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},o.idle=function(a){this.center.idle(a),this.up.idle(a),this.right.idle(a),this.radius.idle(a),this.angle.idle(a)},o.flush=function(a){this.center.flush(a),this.up.flush(a),this.right.flush(a),this.radius.flush(a),this.angle.flush(a)},o.setDistance=function(a,b){b>0&&this.radius.set(a,Math.log(b))},o.lookAt=function(a,b,c,f){this.recalcMatrix(a),b=b||this.computedEye,c=c||this.computedCenter,f=f||this.computedUp;var g=f[0],h=f[1],i=f[2],j=d(g,h,i);if(!(1e-6>j)){g/=j,h/=j,i/=j;var k=b[0]-c[0],l=b[1]-c[1],m=b[2]-c[2],n=d(k,l,m);if(!(1e-6>n)){k/=n,l/=n,m/=n;var o=this.computedRight,p=o[0],q=o[1],r=o[2],s=g*p+h*q+i*r;p-=s*g,q-=s*h,r-=s*i;var t=d(p,q,r);if(!(.01>t&&(p=h*m-i*l,q=i*k-g*m,r=g*l-h*k,t=d(p,q,r),1e-6>t))){p/=t,q/=t,r/=t,this.up.set(a,g,h,i),this.right.set(a,p,q,r),this.center.set(a,c[0],c[1],c[2]),this.radius.set(a,Math.log(n));var u=h*r-i*q,v=i*p-g*r,w=g*q-h*p,x=d(u,v,w);u/=x,v/=x,w/=x;var y=g*k+h*l+i*m,z=p*k+q*l+r*m,A=u*k+v*l+w*m,B=Math.asin(e(y)),C=Math.atan2(A,z),D=this.angle._state,E=D[D.length-1],F=D[D.length-2];E%=2*Math.PI;var G=Math.abs(E+2*Math.PI-C),H=Math.abs(E-C),I=Math.abs(E-2*Math.PI-C);H>G&&(E+=2*Math.PI),H>I&&(E-=2*Math.PI),this.angle.jump(this.angle.lastT(),E,F),this.angle.set(a,C,B)}}}}},{"filtered-vector":19,"gl-mat4/invert":94,"gl-mat4/rotate":98,"gl-vec3/cross":22,"gl-vec3/dot":23,"gl-vec3/normalize":26}],38:[function(a,b,c){"use strict";function d(a,b){this._controllerNames=Object.keys(a),this._controllerList=this._controllerNames.map(function(b){return a[b]}),this._mode=b,this._active=a[b],this._active||(this._mode="turntable",this._active=a.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function e(a){a=a||{};var b=a.eye||[0,0,1],c=a.center||[0,0,0],e=a.up||[0,1,0],i=a.distanceLimits||[0,1/0],j=a.mode||"turntable",k=f(),l=g(),m=h();return k.setDistanceLimits(i[0],i[1]),k.lookAt(0,b,c,e),l.setDistanceLimits(i[0],i[1]),l.lookAt(0,b,c,e),m.setDistanceLimits(i[0],i[1]),m.lookAt(0,b,c,e),new d({turntable:k,orbit:l,matrix:m},j)}b.exports=e;var f=a("turntable-camera-controller"),g=a("orbit-camera-controller"),h=a("matrix-camera-controller"),i=d.prototype,j=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];j.forEach(function(a){for(var b=a[0],c=[],d=0;d<a[1];++d)c.push("a"+d);var e="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+a[0]+"("+c.join()+")}";i[b]=Function.apply(null,c.concat(e))}),i.recalcMatrix=function(a){this._active.recalcMatrix(a)},i.getDistance=function(a){return this._active.getDistance(a)},i.getDistanceLimits=function(a){return this._active.getDistanceLimits(a)},i.lastT=function(){return this._active.lastT()},i.setMode=function(a){if(a!==this._mode){var b=this._controllerNames.indexOf(a);if(!(0>b)){var c=this._active,d=this._controllerList[b],e=Math.max(c.lastT(),d.lastT());c.recalcMatrix(e),d.setMatrix(e,c.computedMatrix),this._active=d,this._mode=a,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},i.getMode=function(){return this._mode}},{"matrix-camera-controller":27,"orbit-camera-controller":36,"turntable-camera-controller":37}],39:[function(a,b,c){function d(a,b){return f(e(a,b))}b.exports=d;var e=a("alpha-complex"),f=a("simplicial-complex-boundary")},{"alpha-complex":40,"simplicial-complex-boundary":43}],40:[function(a,b,c){"use strict";function d(a,b){return e(b).filter(function(c){for(var d=new Array(c.length),e=0;e<c.length;++e)d[e]=b[c[e]];return f(d)*a<1})}b.exports=d;var e=a("delaunay-triangulate"),f=a("circumradius")},{circumradius:41,"delaunay-triangulate":71}],41:[function(a,b,c){function d(a){for(var b=e(a),c=0,d=0;d<a.length;++d)for(var f=a[d],g=0;g<b.length;++g)c+=Math.pow(f[g]-b[g],2);return Math.sqrt(c/a.length)}b.exports=d;var e=a("circumcenter")},{circumcenter:42}],42:[function(a,b,c){"use strict";function d(a,b){for(var c=0,d=a.length,e=0;d>e;++e)c+=a[e]*b[e];return c}function e(a){var b=a.length;if(0===b)return[];var c=(a[0].length,g([a.length+1,a.length+1],1)),e=g([a.length+1],1);c[b][b]=0;for(var f=0;b>f;++f){for(var i=0;f>=i;++i)c[i][f]=c[f][i]=2*d(a[f],a[i]);e[f]=d(a[f],a[f])}for(var j=h(c,e),k=0,l=j[b+1],f=0;f<l.length;++f)k+=l[f];for(var m=new Array(b),f=0;b>f;++f){for(var l=j[f],n=0,i=0;i<l.length;++i)n+=l[i];m[f]=n/k}return m}function f(a){if(0===a.length)return[];for(var b=a[0].length,c=g([b]),d=e(a),f=0;f<a.length;++f)for(var h=0;b>h;++h)c[h]+=a[f][h]*d[f];return c}var g=a("dup"),h=a("robust-linear-solve");f.barycenetric=e,b.exports=f},{dup:72,"robust-linear-solve":211}],43:[function(a,b,c){"use strict";function d(a){return f(e(a))}b.exports=d;var e=a("boundary-cells"),f=a("reduce-simplicial-complex")},{"boundary-cells":44,"reduce-simplicial-complex":47}],44:[function(a,b,c){"use strict";function d(a){for(var b=a.length,c=0,d=0;b>d;++d)c+=a[d].length;for(var e=new Array(c),f=0,d=0;b>d;++d)for(var g=a[d],h=g.length,i=0;h>i;++i)for(var j=e[f++]=new Array(h-1),k=1;h>k;++k)j[k-1]=g[(i+k)%h];return e}b.exports=d},{}],45:[function(a,b,c){"use strict";function d(a){for(var b=1,c=1;c<a.length;++c)for(var d=0;c>d;++d)if(a[c]<a[d])b=-b;else if(a[d]===a[c])return 0;return b}b.exports=d},{}],46:[function(a,b,c){"use strict";function d(a,b){return e(a,b)||f(a)-f(b)}var e=a("compare-cell"),f=a("cell-orientation");b.exports=d},{"cell-orientation":45,"compare-cell":59}],47:[function(a,b,c){"use strict";function d(a){a.sort(f);for(var b=a.length,c=0,d=0;b>d;++d){var h=a[d],i=g(h);if(0!==i){if(c>0){var j=a[c-1];if(0===e(h,j)&&g(j)!==i){c-=1;continue}}a[c++]=h}}return a.length=c,a}var e=a("compare-cell"),f=a("compare-oriented-cell"),g=a("cell-orientation");b.exports=d},{"cell-orientation":45,"compare-cell":59,"compare-oriented-cell":46}],48:[function(a,b,c){"use strict";var d=function(){function a(a){return!Array.isArray(a)&&null!==a&&"object"==typeof a}function b(a,b,c){for(var d=(b-a)/Math.max(c-1,1),e=[],f=0;c>f;f++)e.push(a+f*d);return e}function c(){for(var a=[].slice.call(arguments),b=a.map(function(a){return a.length}),c=Math.min.apply(null,b),d=[],e=0;c>e;e++){d[e]=[];for(var f=0;f<a.length;++f)d[e][f]=a[f][e]}return d}function d(a,b,c){for(var d=Math.min.apply(null,[a.length,b.length,c.length]),e=[],f=0;d>f;f++)e.push([a[f],b[f],c[f]]);return e}function e(a){function b(a){for(var d=0;d<a.length;d++)Array.isArray(a[d])?b(a[d],c):c+=a[d]}var c=0;return b(a,c),c}function f(a){for(var b=[],c=0;c<a.length;++c){b[c]=[];for(var d=0;d<a[c].length;++d)b[c][d]=a[c][d]}return b}function g(a){for(var b=[],c=0;c<a.length;++c)b[c]=a[c];return b}function h(a,b){if(a.length!==b.length)return!1;for(var c=a.length;c--;)if(a[c]!==b[c])return!1;return!0}function i(a,b){var c,d;if("string"!=typeof a)return a;if(c=[],"#"===a[0]?(a=a.substr(1),3===a.length&&(a+=a),d=parseInt(a,16),c[0]=d>>16&255,c[1]=d>>8&255,c[2]=255&d):l.test(a)&&(d=a.match(m),c[0]=parseInt(d[1]),c[1]=parseInt(d[2]),c[2]=parseInt(d[3])),!b)for(var e=0;3>e;++e)c[e]=c[e]/255;return c}function j(a,b){var c,d;if("string"!=typeof a)return a;if(c=[],"#"===a[0]?(a=a.substr(1),3===a.length&&(a+=a),d=parseInt(a,16),c[0]=d>>16&255,c[1]=d>>8&255,c[2]=255&d):l.test(a)&&(d=a.match(m),c[0]=parseInt(d[1]),c[1]=parseInt(d[2]),c[2]=parseInt(d[3]),d[4]?c[3]=parseFloat(d[4]):c[3]=1),!b)for(var e=0;3>e;++e)c[e]=c[e]/255;return c}var k={},l=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,m=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return k.isPlainObject=a,k.linspace=b,k.zip3=d,k.sum=e,k.zip=c,k.isEqual=h,k.copy2D=f,k.copy1D=g,k.str2RgbArray=i,k.str2RgbaArray=j,k};b.exports=d()},{}],49:[function(a,b,c){"use strict";"use restrict";function d(a){var b=32;return a&=-a,a&&b--,65535&a&&(b-=16),16711935&a&&(b-=8),252645135&a&&(b-=4),858993459&a&&(b-=2),1431655765&a&&(b-=1),b}var e=32;c.INT_BITS=e,c.INT_MAX=2147483647,c.INT_MIN=-1<<e-1,c.sign=function(a){return(a>0)-(0>a)},c.abs=function(a){var b=a>>e-1;return(a^b)-b},c.min=function(a,b){return b^(a^b)&-(b>a)},c.max=function(a,b){return a^(a^b)&-(b>a)},c.isPow2=function(a){return!(a&a-1||!a)},c.log2=function(a){var b,c;return b=(a>65535)<<4,a>>>=b,c=(a>255)<<3,a>>>=c,b|=c,c=(a>15)<<2,a>>>=c,b|=c,c=(a>3)<<1,a>>>=c,b|=c,b|a>>1},c.log10=function(a){return a>=1e9?9:a>=1e8?8:a>=1e7?7:a>=1e6?6:a>=1e5?5:a>=1e4?4:a>=1e3?3:a>=100?2:a>=10?1:0},c.popCount=function(a){return a-=a>>>1&1431655765,a=(858993459&a)+(a>>>2&858993459),16843009*(a+(a>>>4)&252645135)>>>24},c.countTrailingZeros=d,c.nextPow2=function(a){return a+=0===a,--a,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a+1},c.prevPow2=function(a){return a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a-(a>>>1)},c.parity=function(a){return a^=a>>>16,a^=a>>>8,a^=a>>>4,a&=15,27030>>>a&1};var f=new Array(256);!function(a){for(var b=0;256>b;++b){var c=b,d=b,e=7;for(c>>>=1;c;c>>>=1)d<<=1,d|=1&c,--e;a[b]=d<<e&255}}(f),c.reverse=function(a){return f[255&a]<<24|f[a>>>8&255]<<16|f[a>>>16&255]<<8|f[a>>>24&255]},c.interleave2=function(a,b){return a&=65535,a=16711935&(a|a<<8),a=252645135&(a|a<<4),a=858993459&(a|a<<2),a=1431655765&(a|a<<1),b&=65535,b=16711935&(b|b<<8),b=252645135&(b|b<<4),b=858993459&(b|b<<2),b=1431655765&(b|b<<1),a|b<<1},c.deinterleave2=function(a,b){return a=a>>>b&1431655765,a=858993459&(a|a>>>1),a=252645135&(a|a>>>2),a=16711935&(a|a>>>4),a=65535&(a|a>>>16),a<<16>>16},c.interleave3=function(a,b,c){return a&=1023,a=4278190335&(a|a<<16),a=251719695&(a|a<<8),a=3272356035&(a|a<<4),a=1227133513&(a|a<<2),b&=1023,b=4278190335&(b|b<<16),b=251719695&(b|b<<8),b=3272356035&(b|b<<4),b=1227133513&(b|b<<2),a|=b<<1,c&=1023,c=4278190335&(c|c<<16),c=251719695&(c|c<<8),c=3272356035&(c|c<<4),c=1227133513&(c|c<<2),a|c<<2},c.deinterleave3=function(a,b){return a=a>>>b&1227133513,a=3272356035&(a|a>>>2),a=251719695&(a|a>>>4),a=4278190335&(a|a>>>8),a=1023&(a|a>>>16),a<<22>>22},c.nextCombination=function(a){var b=a|a-1;return b+1|(~b&-~b)-1>>>d(a)+1}},{}],50:[function(a,b,c){(function(b){"use strict";function d(){try{var a=new Uint8Array(1);return a.foo=function(){return 42},42===a.foo()&&"function"==typeof a.subarray&&0===a.subarray(1,1).byteLength}catch(b){return!1}}function e(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a){return this instanceof f?(f.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof a?g(this,a):"string"==typeof a?h(this,a,arguments.length>1?arguments[1]:"utf8"):i(this,a)):arguments.length>1?new f(a,arguments[1]):new f(a)}function g(a,b){if(a=p(a,0>b?0:0|q(b)),!f.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function h(a,b,c){"string"==typeof c&&""!==c||(c="utf8");var d=0|s(b,c);return a=p(a,d),a.write(b,c),a}function i(a,b){if(f.isBuffer(b))return j(a,b);if(Y(b))return k(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return l(a,b);if(b instanceof ArrayBuffer)return m(a,b)}return b.length?n(a,b):o(a,b)}function j(a,b){var c=0|q(b.length);return a=p(a,c),b.copy(a,0,0,c),a}function k(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function m(a,b){return b.byteLength,f.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=f.prototype):a=l(a,new Uint8Array(b)),a}function n(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function o(a,b){var c,d=0;"Buffer"===b.type&&Y(b.data)&&(c=b.data,d=0|q(c.length)),a=p(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function p(a,b){f.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=f.prototype):a.length=b;var c=0!==b&&b<=f.poolSize>>>1;return c&&(a.parent=Z),a}function q(a){if(a>=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function r(a,b){if(!(this instanceof r))return new r(a,b);var c=new f(a,b);return delete c.parent,c}function s(a,b){"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":return R(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return U(a).length;default:if(d)return R(a).length;b=(""+b).toLowerCase(),d=!0}}function t(a,b,c){var d=!1;if(b=0|b,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),0>b&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function v(a,b,c,d){return V(R(b,a.length-c),a,c,d)}function w(a,b,c,d){return V(S(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return V(U(b),a,c,d)}function z(a,b,c,d){return V(T(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;c>e;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(c>=e+h){var i,j,k,l;switch(h){case 1:128>f&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(55296>l||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&1114112>l&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if($>=b)return String.fromCharCode.apply(String,a);for(var c="",d=0;b>d;)c+=String.fromCharCode.apply(String,a.slice(d,d+=$));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=Q(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!==0||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,g){if(!f.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>e||g>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range")}function J(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function K(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function L(a,b,c,d,e,f){if(b>e||f>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(0>c)throw new RangeError("index out of range")}function M(a,b,c,d,e){return e||L(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function N(a,b,c,d,e){return e||L(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function O(a){if(a=P(a).replace(_,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function P(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Q(a){return 16>a?"0"+a.toString(16):a.toString(16)}function R(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(1114112>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function S(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function T(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);g++)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function U(a){return W.toByteArray(O(a))}function V(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}var W=a("base64-js"),X=a("ieee754"),Y=a("isarray");c.Buffer=f,c.SlowBuffer=r,c.INSPECT_MAX_BYTES=50,f.poolSize=8192;var Z={};f.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(), 25 f.TYPED_ARRAY_SUPPORT?(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array):(f.prototype.length=void 0,f.prototype.parent=void 0),f.isBuffer=function(a){return!(null==a||!a._isBuffer)},f.compare=function(a,b){if(!f.isBuffer(a)||!f.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,g=Math.min(c,d);g>e&&a[e]===b[e];)++e;return e!==g&&(c=a[e],d=b[e]),d>c?-1:c>d?1:0},f.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(a,b){if(!Y(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new f(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;c++)b+=a[c].length;var d=new f(b),e=0;for(c=0;c<a.length;c++){var g=a[c];g.copy(d,e),e+=g.length}return d},f.byteLength=s,f.prototype._isBuffer=!0,f.prototype.toString=function(){var a=0|this.length;return 0===a?"":0===arguments.length?B(this,0,a):t.apply(this,arguments)},f.prototype.equals=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===f.compare(this,a)},f.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},f.prototype.compare=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:f.compare(this,a)},f.prototype.indexOf=function(a,b){function c(a,b,c){for(var d=-1,e=0;c+e<a.length;e++)if(a[c+e]===b[-1===d?0:e-d]){if(-1===d&&(d=e),e-d+1===b.length)return c+d}else d=-1;return-1}if(b>2147483647?b=2147483647:-2147483648>b&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(0>b&&(b=Math.max(this.length+b,0)),"string"==typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(f.isBuffer(a))return c(this,a,b);if("number"==typeof a)return f.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):c(this,[a],b);throw new TypeError("val must be string, number or Buffer")},f.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");d||(d="utf8");for(var g=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;f.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c),0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c),a>b&&(b=a);var d;if(f.TYPED_ARRAY_SUPPORT)d=this.subarray(a,b),d.__proto__=f.prototype;else{var e=b-a;d=new f(e,void 0);for(var g=0;e>g;g++)d[g]=this[g+a]}return d.length&&(d.parent=this.parent||this),d},f.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},f.prototype.readUIntBE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},f.prototype.readUInt8=function(a,b){return b||H(a,1,this.length),this[a]},f.prototype.readUInt16LE=function(a,b){return b||H(a,2,this.length),this[a]|this[a+1]<<8},f.prototype.readUInt16BE=function(a,b){return b||H(a,2,this.length),this[a]<<8|this[a+1]},f.prototype.readUInt32LE=function(a,b){return b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},f.prototype.readUInt32BE=function(a,b){return b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},f.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},f.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},f.prototype.readInt8=function(a,b){return b||H(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},f.prototype.readInt16LE=function(a,b){b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt16BE=function(a,b){b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt32LE=function(a,b){return b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},f.prototype.readInt32BE=function(a,b){return b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},f.prototype.readFloatLE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!0,23,4)},f.prototype.readFloatBE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!1,23,4)},f.prototype.readDoubleLE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!0,52,8)},f.prototype.readDoubleBE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!1,52,8)},f.prototype.writeUIntLE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f<c&&(e*=256);)this[b+f]=a/e&255;return b+c},f.prototype.writeUIntBE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=c-1,f=1;for(this[b+e]=255&a;--e>=0&&(f*=256);)this[b+e]=a/f&255;return b+c},f.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,1,255,0),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},f.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):K(this,a,b,!0),b+4},f.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0>a?1:0;for(this[b]=255&a;++f<c&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0>a?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,1,127,-128),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),0>a&&(a=255+a+1),this[b]=255&a,b+1},f.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):K(this,a,b,!0),b+4},f.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,2147483647,-2147483648),0>a&&(a=4294967295+a+1),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeFloatLE=function(a,b,c){return M(this,a,b,!0,c)},f.prototype.writeFloatBE=function(a,b,c){return M(this,a,b,!1,c)},f.prototype.writeDoubleLE=function(a,b,c){return N(this,a,b,!0,c)},f.prototype.writeDoubleBE=function(a,b,c){return N(this,a,b,!1,c)},f.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&c>d&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,g=d-c;if(this===a&&b>c&&d>b)for(e=g-1;e>=0;e--)a[e+b]=this[e+c];else if(1e3>g||!f.TYPED_ARRAY_SUPPORT)for(e=0;g>e;e++)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+g),b);return g},f.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),b>c)throw new RangeError("end < start");if(c!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");if(0>c||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;c>d;d++)this[d]=a;else{var e=R(a.toString()),f=e.length;for(d=b;c>d;d++)this[d]=e[d%f]}return this}};var _=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":51,ieee754:52,isarray:53}],51:[function(a,b,c){!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===g||b===l?62:b===h||b===m?63:i>b?-1:i+10>b?b-i+26+26:k+26>b?b-k:j+26>b?b-j+26:void 0}function c(a){function c(a){j[l++]=a}var d,e,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;g>d;d+=4,e+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function d(a){function b(a){return e.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var d,f,g,h=a.length%3,i="";for(d=0,g=a.length-h;g>d;d+=3)f=(a[d]<<16)+(a[d+1]<<8)+a[d+2],i+=c(f);switch(h){case 1:f=a[a.length-1],i+=b(f>>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=d}("undefined"==typeof c?this.base64js={}:c)},{}],52:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],53:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],54:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||0>a||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:f=Array.prototype.slice.call(arguments,1),c.apply(this,f)}else if(g(c))for(f=Array.prototype.slice.call(arguments,1),j=c.slice(),d=j.length,i=0;d>i;i++)j[i].apply(this,f);return!0},d.prototype.addListener=function(a,b){var c;if(!e(b))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,e(b.listener)?b.listener:b),this._events[a]?g(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,g(this._events[a])&&!this._events[a].warned&&(c=h(this._maxListeners)?d.defaultMaxListeners:this._maxListeners,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())),this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(0>d)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.prototype.listenerCount=function(a){if(this._events){var b=this._events[a];if(e(b))return 1;if(b)return b.length}return 0},d.listenerCount=function(a,b){return a.listenerCount(b)}},{}],55:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h&&h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],56:[function(a,b,c){b.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}]}},{}],57:[function(a,b,c){"use strict";function d(a){for(var b,c="#",d=0;3>d;++d)b=a[d],b=b.toString(16),c+=("00"+b).substr(b.length);return c}function e(a){return"rgba("+a.join(",")+")"}var f=a("arraytools"),g=a("clone"),h=a("./colorScales");b.exports=function(a){var b,c,i,j,k,l,m,n,o,p,q,r,s,t=[],u=[],v=[],w=[];if(f.isPlainObject(a)||(a={}),o=a.nshades||72,n=a.format||"hex",m=a.colormap,m||(m="jet"),"string"==typeof m){if(m=m.toLowerCase(),!h[m])throw Error(m+" not a supported colorscale");l=g(h[m])}else{if(!Array.isArray(m))throw Error("unsupported colormap option",m);l=g(m)}if(l.length>o)throw new Error(m+" map requires nshades to be at least size "+l.length);for(q=Array.isArray(a.alpha)?2!==a.alpha.length?[1,1]:g(a.alpha):"number"==typeof a.alpha?[a.alpha,a.alpha]:[1,1],b=l.map(function(a){return Math.round(a.index*o)}),q[0]<0&&(q[0]=0),q[1]<0&&(q[0]=0),q[0]>1&&(q[0]=1),q[1]>1&&(q[0]=1),s=0;s<b.length;++s)r=l[s].index,c=l[s].rgb,4===c.length&&c[3]>=0&&c[3]<=1||(c[3]=q[0]+(q[1]-q[0])*r);for(s=0;s<b.length-1;++s)k=b[s+1]-b[s],i=l[s].rgb,j=l[s+1].rgb,t=t.concat(f.linspace(i[0],j[0],k)),u=u.concat(f.linspace(i[1],j[1],k)),v=v.concat(f.linspace(i[2],j[2],k)),w=w.concat(f.linspace(i[3],j[3],k));return t=t.map(Math.round),u=u.map(Math.round),v=v.map(Math.round),p=f.zip(t,u,v,w),"hex"===n&&(p=p.map(d)),"rgbaString"===n&&(p=p.map(e)),p}},{"./colorScales":56,arraytools:48,clone:58}],58:[function(a,b,c){(function(a){var c=function(){"use strict";function b(c,d,e,f){function h(c,e){if(null===c)return null;if(0==e)return c;var i,m;if("object"!=typeof c)return c;if(b.__isArray(c))i=[];else if(b.__isRegExp(c))i=new RegExp(c.source,g(c)),c.lastIndex&&(i.lastIndex=c.lastIndex);else if(b.__isDate(c))i=new Date(c.getTime());else{if(l&&a.isBuffer(c))return i=new a(c.length),c.copy(i),i;"undefined"==typeof f?(m=Object.getPrototypeOf(c),i=Object.create(m)):(i=Object.create(f),m=f)}if(d){var n=j.indexOf(c);if(-1!=n)return k[n];j.push(c),k.push(i)}for(var o in c){var p;m&&(p=Object.getOwnPropertyDescriptor(m,o)),p&&null==p.set||(i[o]=h(c[o],e-1))}return i}var i;"object"==typeof d&&(e=d.depth,f=d.prototype,i=d.filter,d=d.circular);var j=[],k=[],l="undefined"!=typeof a;return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=1/0),h(c,e)}function c(a){return Object.prototype.toString.call(a)}function d(a){return"object"==typeof a&&"[object Date]"===c(a)}function e(a){return"object"==typeof a&&"[object Array]"===c(a)}function f(a){return"object"==typeof a&&"[object RegExp]"===c(a)}function g(a){var b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),b}return b.clonePrototype=function(a){if(null===a)return null;var b=function(){};return b.prototype=a,new b},b.__objToStr=c,b.__isDate=d,b.__isArray=e,b.__isRegExp=f,b.__getRegExpFlags=g,b}();"object"==typeof b&&b.exports&&(b.exports=c)}).call(this,a("buffer").Buffer)},{buffer:50}],59:[function(a,b,c){function d(a,b){return a-b}function e(a,b){var c=a.length,e=a.length-b.length;if(e)return e;switch(c){case 0:return 0;case 1:return a[0]-b[0];case 2:return a[0]+a[1]-b[0]-b[1]||f(a[0],a[1])-f(b[0],b[1]);case 3:var g=a[0]+a[1],h=b[0]+b[1];if(e=g+a[2]-(h+b[2]))return e;var i=f(a[0],a[1]),j=f(b[0],b[1]);return f(i,a[2])-f(j,b[2])||f(i+a[2],g)-f(j+b[2],h);case 4:var k=a[0],l=a[1],m=a[2],n=a[3],o=b[0],p=b[1],q=b[2],r=b[3];return k+l+m+n-(o+p+q+r)||f(k,l,m,n)-f(o,p,q,r,o)||f(k+l,k+m,k+n,l+m,l+n,m+n)-f(o+p,o+q,o+r,p+q,p+r,q+r)||f(k+l+m,k+l+n,k+m+n,l+m+n)-f(o+p+q,o+p+r,o+q+r,p+q+r);default:for(var s=a.slice().sort(d),t=b.slice().sort(d),u=0;c>u;++u)if(e=s[u]-t[u])return e;return 0}}b.exports=e;var f=Math.min},{}],60:[function(a,b,c){"use strict";function d(a){var b=a.length;if(0===b)return[];if(1===b)return[[0]];var c=a[0].length;return 0===c?[]:1===c?e(a):2===c?f(a):g(a,c)}var e=a("./lib/ch1d"),f=a("./lib/ch2d"),g=a("./lib/chnd");b.exports=d},{"./lib/ch1d":61,"./lib/ch2d":62,"./lib/chnd":63}],61:[function(a,b,c){"use strict";function d(a){for(var b=0,c=0,d=1;d<a.length;++d)a[d][0]<a[b][0]&&(b=d),a[d][0]>a[c][0]&&(c=d);return c>b?[[b],[c]]:b>c?[[c],[b]]:[[b]]}b.exports=d},{}],62:[function(a,b,c){"use strict";function d(a){var b=e(a),c=b.length;if(2>=c)return[];for(var d=new Array(c),f=b[c-1],g=0;c>g;++g){var h=b[g];d[g]=[f,h],f=h}return d}b.exports=d;var e=a("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":65}],63:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),e=0;e<b.length;++e)d[e]=a[b[e]];for(var f=b.length,e=0;c>e;++e)b.indexOf(e)<0&&(d[f++]=a[e]);return d}function e(a,b){for(var c=a.length,d=b.length,e=0;c>e;++e)for(var f=a[e],g=0;g<f.length;++g){var h=f[g];if(d>h)f[g]=b[h];else{h-=d;for(var i=0;d>i;++i)h>=b[i]&&(h+=1);f[g]=h}}return a}function f(a,b){try{return g(a,!0)}catch(c){var f=h(a);if(f.length<=b)return[];var i=d(a,f),j=g(i,!0);return e(j,f)}}b.exports=f;var g=a("incremental-convex-hull"),h=a("affine-hull")},{"affine-hull":64,"incremental-convex-hull":191}],64:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(b+1),d=0;d<a.length;++d)c[d]=a[d];for(var d=0;d<=a.length;++d){for(var e=a.length;b>=e;++e){for(var g=new Array(b),h=0;b>h;++h)g[h]=Math.pow(e+1-d,h);c[e]=g}var i=f.apply(void 0,c);if(i)return!0}return!1}function e(a){var b=a.length;if(0===b)return[];if(1===b)return[0];for(var c=a[0].length,e=[a[0]],f=[0],g=1;b>g;++g)if(e.push(a[g]),d(e,c)){if(f.push(g),f.length===c+1)return f}else e.pop();return f}b.exports=e;var f=a("robust-orientation")},{"robust-orientation":214}],65:[function(a,b,c){"use strict";function d(a){var b=a.length;if(3>b){for(var c=new Array(b),d=0;b>d;++d)c[d]=d;return 2===b&&a[0][0]===a[1][0]&&a[0][1]===a[1][1]?[0]:c}for(var f=new Array(b),d=0;b>d;++d)f[d]=d;f.sort(function(b,c){var d=a[b][0]-a[c][0];return d?d:a[b][1]-a[c][1]});for(var g=[f[0],f[1]],h=[f[0],f[1]],d=2;b>d;++d){for(var i=f[d],j=a[i],k=g.length;k>1&&e(a[g[k-2]],a[g[k-1]],j)<=0;)k-=1,g.pop();for(g.push(i),k=h.length;k>1&&e(a[h[k-2]],a[h[k-1]],j)>=0;)k-=1,h.pop();h.push(i)}for(var c=new Array(h.length+g.length-2),l=0,d=0,m=g.length;m>d;++d)c[l++]=g[d];for(var n=h.length-2;n>0;--n)c[l++]=h[n];return c}b.exports=d;var e=a("robust-orientation")[3]},{"robust-orientation":214}],66:[function(a,b,c){"use strict";function d(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function e(a){var b=new d;b.pre=a.pre,b.body=a.body,b.post=a.post;var c=a.args.slice(0);b.argTypes=c;for(var e=0;e<c.length;++e){var g=c[e];if("array"===g||"object"==typeof g&&g.blockIndices){if(b.argTypes[e]="array",b.arrayArgs.push(e),b.arrayBlockIndices.push(g.blockIndices?g.blockIndices:0),b.shimArgs.push("array"+e),e<b.pre.args.length&&b.pre.args[e].count>0)throw new Error("cwise: pre() block may not reference array args");if(e<b.post.args.length&&b.post.args[e].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===g)b.scalarArgs.push(e),b.shimArgs.push("scalar"+e);else if("index"===g){if(b.indexArgs.push(e),e<b.pre.args.length&&b.pre.args[e].count>0)throw new Error("cwise: pre() block may not reference array index");if(e<b.body.args.length&&b.body.args[e].lvalue)throw new Error("cwise: body() block may not write to array index");if(e<b.post.args.length&&b.post.args[e].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===g){if(b.shapeArgs.push(e),e<b.pre.args.length&&b.pre.args[e].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(e<b.body.args.length&&b.body.args[e].lvalue)throw new Error("cwise: body() block may not write to array shape");if(e<b.post.args.length&&b.post.args[e].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof g||!g.offset)throw new Error("cwise: Unknown argument type "+c[e]);b.argTypes[e]="offset",b.offsetArgs.push({array:g.array,offset:g.offset}),b.offsetArgIndex.push(e)}}if(b.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(b.pre.args.length>c.length)throw new Error("cwise: Too many arguments in pre() block");if(b.body.args.length>c.length)throw new Error("cwise: Too many arguments in body() block");if(b.post.args.length>c.length)throw new Error("cwise: Too many arguments in post() block");return b.debug=!!a.printCode||!!a.debug,b.funcName=a.funcName||"cwise",b.blockSize=a.blockSize||64,f(b)}var f=a("./lib/thunk.js");b.exports=e},{"./lib/thunk.js":68}],67:[function(a,b,c){"use strict";function d(a,b,c){var d,e,f=a.length,g=b.arrayArgs.length,h=b.indexArgs.length>0,i=[],j=[],k=0,l=0;for(d=0;f>d;++d)j.push(["i",d,"=0"].join(""));for(e=0;g>e;++e)for(d=0;f>d;++d)l=k,k=a[d],0===d?j.push(["d",e,"s",d,"=t",e,"p",k].join("")):j.push(["d",e,"s",d,"=(t",e,"p",k,"-s",l,"*t",e,"p",l,")"].join(""));for(i.push("var "+j.join(",")),d=f-1;d>=0;--d)k=a[d],i.push(["for(i",d,"=0;i",d,"<s",k,";++i",d,"){"].join(""));for(i.push(c),d=0;f>d;++d){for(l=k,k=a[d],e=0;g>e;++e)i.push(["p",e,"+=d",e,"s",d].join(""));h&&(d>0&&i.push(["index[",l,"]-=s",l].join("")),i.push(["++index[",k,"]"].join(""))),i.push("}")}return i.join("\n")}function e(a,b,c,e){for(var f=b.length,g=c.arrayArgs.length,h=c.blockSize,i=c.indexArgs.length>0,j=[],k=0;g>k;++k)j.push(["var offset",k,"=p",k].join(""));for(var k=a;f>k;++k)j.push(["for(var j"+k+"=SS[",b[k],"]|0;j",k,">0;){"].join("")),j.push(["if(j",k,"<",h,"){"].join("")),j.push(["s",b[k],"=j",k].join("")),j.push(["j",k,"=0"].join("")),j.push(["}else{s",b[k],"=",h].join("")),j.push(["j",k,"-=",h,"}"].join("")),i&&j.push(["index[",b[k],"]=j",k].join(""));for(var k=0;g>k;++k){for(var l=["offset"+k],m=a;f>m;++m)l.push(["j",m,"*t",k,"p",b[m]].join(""));j.push(["p",k,"=(",l.join("+"),")"].join(""))}j.push(d(b,c,e));for(var k=a;f>k;++k)j.push("}");return j.join("\n")}function f(a){for(var b=0,c=a[0].length;c>b;){for(var d=1;d<a.length;++d)if(a[d][b]!==a[0][b])return b;++b}return b}function g(a,b,c){for(var d=a.body,e=[],f=[],g=0;g<a.args.length;++g){var h=a.args[g];if(!(h.count<=0)){var i=new RegExp(h.name,"g"),j="",k=b.arrayArgs.indexOf(g);switch(b.argTypes[g]){case"offset":var l=b.offsetArgIndex.indexOf(g),m=b.offsetArgs[l];k=m.array,j="+q"+l;case"array":j="p"+k+j;var n="l"+g,o="a"+k;if(0===b.arrayBlockIndices[k])1===h.count?"generic"===c[k]?h.lvalue?(e.push(["var ",n,"=",o,".get(",j,")"].join("")),d=d.replace(i,n),f.push([o,".set(",j,",",n,")"].join(""))):d=d.replace(i,[o,".get(",j,")"].join("")):d=d.replace(i,[o,"[",j,"]"].join("")):"generic"===c[k]?(e.push(["var ",n,"=",o,".get(",j,")"].join("")),d=d.replace(i,n),h.lvalue&&f.push([o,".set(",j,",",n,")"].join(""))):(e.push(["var ",n,"=",o,"[",j,"]"].join("")),d=d.replace(i,n),h.lvalue&&f.push([o,"[",j,"]=",n].join("")));else{for(var p=[h.name],q=[j],r=0;r<Math.abs(b.arrayBlockIndices[k]);r++)p.push("\\s*\\[([^\\]]+)\\]"),q.push("$"+(r+1)+"*t"+k+"b"+r);if(i=new RegExp(p.join(""),"g"),j=q.join("+"),"generic"===c[k])throw new Error("cwise: Generic arrays not supported in combination with blocks!");d=d.replace(i,[o,"[",j,"]"].join(""))}break;case"scalar":d=d.replace(i,"Y"+b.scalarArgs.indexOf(g));break;case"index":d=d.replace(i,"index");break;case"shape":d=d.replace(i,"shape")}}}return[e.join("\n"),d,f.join("\n")].join("\n").trim()}function h(a){for(var b=new Array(a.length),c=!0,d=0;d<a.length;++d){var e=a[d],f=e.match(/\d+/);f=f?f[0]:"",0===e.charAt(0)?b[d]="u"+e.charAt(1)+f:b[d]=e.charAt(0)+f,d>0&&(c=c&&b[d]===b[d-1])}return c?b[0]:b.join("")}function i(a,b){for(var c=b[1].length-Math.abs(a.arrayBlockIndices[0])|0,i=new Array(a.arrayArgs.length),k=new Array(a.arrayArgs.length),l=0;l<a.arrayArgs.length;++l)k[l]=b[2*l],i[l]=b[2*l+1];for(var m=[],n=[],o=[],p=[],q=[],l=0;l<a.arrayArgs.length;++l){a.arrayBlockIndices[l]<0?(o.push(0),p.push(c),m.push(c),n.push(c+a.arrayBlockIndices[l])):(o.push(a.arrayBlockIndices[l]),p.push(a.arrayBlockIndices[l]+c),m.push(0), 26 n.push(a.arrayBlockIndices[l]));for(var r=[],s=0;s<i[l].length;s++)o[l]<=i[l][s]&&i[l][s]<p[l]&&r.push(i[l][s]-o[l]);q.push(r)}for(var t=["SS"],u=["'use strict'"],v=[],s=0;c>s;++s)v.push(["s",s,"=SS[",s,"]"].join(""));for(var l=0;l<a.arrayArgs.length;++l){t.push("a"+l),t.push("t"+l),t.push("p"+l);for(var s=0;c>s;++s)v.push(["t",l,"p",s,"=t",l,"[",o[l]+s,"]"].join(""));for(var s=0;s<Math.abs(a.arrayBlockIndices[l]);++s)v.push(["t",l,"b",s,"=t",l,"[",m[l]+s,"]"].join(""))}for(var l=0;l<a.scalarArgs.length;++l)t.push("Y"+l);if(a.shapeArgs.length>0&&v.push("shape=SS.slice(0)"),a.indexArgs.length>0){for(var w=new Array(c),l=0;c>l;++l)w[l]="0";v.push(["index=[",w.join(","),"]"].join(""))}for(var l=0;l<a.offsetArgs.length;++l){for(var x=a.offsetArgs[l],y=[],s=0;s<x.offset.length;++s)0!==x.offset[s]&&(1===x.offset[s]?y.push(["t",x.array,"p",s].join("")):y.push([x.offset[s],"*t",x.array,"p",s].join("")));0===y.length?v.push("q"+l+"=0"):v.push(["q",l,"=",y.join("+")].join(""))}var z=j([].concat(a.pre.thisVars).concat(a.body.thisVars).concat(a.post.thisVars));v=v.concat(z),u.push("var "+v.join(","));for(var l=0;l<a.arrayArgs.length;++l)u.push("p"+l+"|=0");a.pre.body.length>3&&u.push(g(a.pre,a,k));var A=g(a.body,a,k),B=f(q);c>B?u.push(e(B,q[0],a,A)):u.push(d(q[0],a,A)),a.post.body.length>3&&u.push(g(a.post,a,k)),a.debug&&console.log("-----Generated cwise routine for ",b,":\n"+u.join("\n")+"\n----------");var C=[a.funcName||"unnamed","_cwise_loop_",i[0].join("s"),"m",B,h(k)].join(""),D=new Function(["function ",C,"(",t.join(","),"){",u.join("\n"),"} return ",C].join(""));return D()}var j=a("uniq");b.exports=i},{uniq:234}],68:[function(a,b,c){"use strict";function d(a){var b=["'use strict'","var CACHED={}"],c=[],d=a.funcName+"_cwise_thunk";b.push(["return function ",d,"(",a.shimArgs.join(","),"){"].join(""));for(var f=[],g=[],h=[["array",a.arrayArgs[0],".shape.slice(",Math.max(0,a.arrayBlockIndices[0]),a.arrayBlockIndices[0]<0?","+a.arrayBlockIndices[0]+")":")"].join("")],i=[],j=[],k=0;k<a.arrayArgs.length;++k){var l=a.arrayArgs[k];c.push(["t",l,"=array",l,".dtype,","r",l,"=array",l,".order"].join("")),f.push("t"+l),f.push("r"+l),g.push("t"+l),g.push("r"+l+".join()"),h.push("array"+l+".data"),h.push("array"+l+".stride"),h.push("array"+l+".offset|0"),k>0&&(i.push("array"+a.arrayArgs[0]+".shape.length===array"+l+".shape.length+"+(Math.abs(a.arrayBlockIndices[0])-Math.abs(a.arrayBlockIndices[k]))),j.push("array"+a.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,a.arrayBlockIndices[0])+"]===array"+l+".shape[shapeIndex+"+Math.max(0,a.arrayBlockIndices[k])+"]"))}a.arrayArgs.length>1&&(b.push("if (!("+i.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),b.push("for(var shapeIndex=array"+a.arrayArgs[0]+".shape.length-"+Math.abs(a.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),b.push("if (!("+j.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),b.push("}"));for(var k=0;k<a.scalarArgs.length;++k)h.push("scalar"+a.scalarArgs[k]);c.push(["type=[",g.join(","),"].join()"].join("")),c.push("proc=CACHED[type]"),b.push("var "+c.join(",")),b.push(["if(!proc){","CACHED[type]=proc=compile([",f.join(","),"])}","return proc(",h.join(","),")}"].join("")),a.debug&&console.log("-----Generated thunk:\n"+b.join("\n")+"\n----------");var m=new Function("compile",b.join("\n"));return m(e.bind(void 0,a))}var e=a("./compile.js");b.exports=d},{"./compile.js":67}],69:[function(a,b,c){b.exports=a("cwise-compiler")},{"cwise-compiler":66}],70:[function(b,c,d){!function(){function b(a){return a&&(a.ownerDocument||a.document||a).documentElement}function d(a){return a&&(a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView)}function e(a,b){return b>a?-1:a>b?1:a>=b?0:NaN}function f(a){return null===a?NaN:+a}function g(a){return!isNaN(a)}function h(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function i(a){return a.length}function j(a){for(var b=1;a*b%1;)b*=10;return b}function k(a,b){for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}function l(){this._=Object.create(null)}function m(a){return(a+="")===wg||a[0]===xg?xg+a:a}function n(a){return(a+="")[0]===xg?a.slice(1):a}function o(a){return m(a)in this._}function p(a){return(a=m(a))in this._&&delete this._[a]}function q(){var a=[];for(var b in this._)a.push(n(b));return a}function r(){var a=0;for(var b in this._)++a;return a}function s(){for(var a in this._)return!1;return!0}function t(){this._=Object.create(null)}function u(a){return a}function v(a,b,c){return function(){var d=c.apply(b,arguments);return d===b?a:d}}function w(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(var c=0,d=yg.length;d>c;++c){var e=yg[c]+b;if(e in a)return e}}function x(){}function y(){}function z(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new l;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function A(){jg.event.preventDefault()}function B(){for(var a,b=jg.event;a=b.sourceEvent;)b=a;return b}function C(a){for(var b=new y,c=0,d=arguments.length;++c<d;)b[arguments[c]]=z(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=jg.event;e.target=a,jg.event=e,b[e.type].apply(c,d)}finally{jg.event=f}}},b}function D(a){return Ag(a,Eg),a}function E(a){return"function"==typeof a?a:function(){return Bg(a,this)}}function F(a){return"function"==typeof a?a:function(){return Cg(a,this)}}function G(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=jg.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function H(a){return a.trim().replace(/\s+/g," ")}function I(a){return new RegExp("(?:^|\\s+)"+jg.requote(a)+"(?:\\s+|$)","g")}function J(a){return(a+"").trim().split(/^|\s+/)}function K(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=J(a).map(L);var e=a.length;return"function"==typeof b?d:c}function L(a){var b=I(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",H(e+" "+a))):c.setAttribute("class",H(e.replace(b," ")))}}function M(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function N(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function O(a){function b(){var b=this.ownerDocument,c=this.namespaceURI;return c?b.createElementNS(c,a):b.createElement(a)}function c(){return this.ownerDocument.createElementNS(a.space,a.local)}return"function"==typeof a?a:(a=jg.ns.qualify(a)).local?c:b}function P(){var a=this.parentNode;a&&a.removeChild(this)}function Q(a){return{__data__:a}}function R(a){return function(){return Dg(this,a)}}function S(a){return arguments.length||(a=e),function(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}}function T(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function U(a){return Ag(a,Gg),a}function V(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function W(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=i(b,lg(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+jg.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),i=X;h>0&&(a=a.slice(0,h));var j=Hg.get(a);return j&&(a=j,i=Y),h?b?e:d:b?x:f}function X(a,b){return function(c){var d=jg.event;jg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{jg.event=d}}}function Y(a,b){var c=X(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function Z(a){var c=".dragsuppress-"+ ++Jg,e="click"+c,f=jg.select(d(a)).on("touchmove"+c,A).on("dragstart"+c,A).on("selectstart"+c,A);if(null==Ig&&(Ig="onselectstart"in a?!1:w(a.style,"userSelect")),Ig){var g=b(a).style,h=g[Ig];g[Ig]="none"}return function(a){if(f.on(c,null),Ig&&(g[Ig]=h),a){var b=function(){f.on(e,null)};f.on(e,function(){A(),b()},!0),setTimeout(b,0)}}}function $(a,b){b.changedTouches&&(b=b.changedTouches[0]);var c=a.ownerSVGElement||a;if(c.createSVGPoint){var e=c.createSVGPoint();if(0>Kg){var f=d(a);if(f.scrollX||f.scrollY){c=jg.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var g=c[0][0].getScreenCTM();Kg=!(g.f||g.e),c.remove()}}return Kg?(e.x=b.pageX,e.y=b.pageY):(e.x=b.clientX,e.y=b.clientY),e=e.matrixTransform(a.getScreenCTM().inverse()),[e.x,e.y]}var h=a.getBoundingClientRect();return[b.clientX-h.left-a.clientLeft,b.clientY-h.top-a.clientTop]}function _(){return jg.event.changedTouches[0].identifier}function aa(a){return a>0?1:0>a?-1:0}function ba(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function ca(a){return a>1?0:-1>a?Ng:Math.acos(a)}function da(a){return a>1?Qg:-1>a?-Qg:Math.asin(a)}function ea(a){return((a=Math.exp(a))-1/a)/2}function fa(a){return((a=Math.exp(a))+1/a)/2}function ga(a){return((a=Math.exp(2*a))-1)/(a+1)}function ha(a){return(a=Math.sin(a/2))*a}function ia(){}function ja(a,b,c){return this instanceof ja?(this.h=+a,this.s=+b,void(this.l=+c)):arguments.length<2?a instanceof ja?new ja(a.h,a.s,a.l):xa(""+a,ya,ja):new ja(a,b,c)}function ka(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a=isNaN(a)?0:(a%=360)<0?a+360:a,b=isNaN(b)?0:0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,new ta(e(a+120),e(a),e(a-120))}function la(a,b,c){return this instanceof la?(this.h=+a,this.c=+b,void(this.l=+c)):arguments.length<2?a instanceof la?new la(a.h,a.c,a.l):a instanceof na?pa(a.l,a.a,a.b):pa((a=za((a=jg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new la(a,b,c)}function ma(a,b,c){return isNaN(a)&&(a=0),isNaN(b)&&(b=0),new na(c,Math.cos(a*=Rg)*b,Math.sin(a)*b)}function na(a,b,c){return this instanceof na?(this.l=+a,this.a=+b,void(this.b=+c)):arguments.length<2?a instanceof na?new na(a.l,a.a,a.b):a instanceof la?ma(a.h,a.c,a.l):za((a=ta(a)).r,a.g,a.b):new na(a,b,c)}function oa(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=qa(e)*ah,d=qa(d)*bh,f=qa(f)*ch,new ta(sa(3.2404542*e-1.5371385*d-.4985314*f),sa(-.969266*e+1.8760108*d+.041556*f),sa(.0556434*e-.2040259*d+1.0572252*f))}function pa(a,b,c){return a>0?new la(Math.atan2(c,b)*Sg,Math.sqrt(b*b+c*c),a):new la(NaN,NaN,a)}function qa(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function ra(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function sa(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function ta(a,b,c){return this instanceof ta?(this.r=~~a,this.g=~~b,void(this.b=~~c)):arguments.length<2?a instanceof ta?new ta(a.r,a.g,a.b):xa(""+a,ta,ka):new ta(a,b,c)}function ua(a){return new ta(a>>16,a>>8&255,255&a)}function va(a){return ua(a)+""}function wa(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function xa(a,b,c){var d,e,f,g=0,h=0,i=0;if(d=/([a-z]+)\((.*)\)/.exec(a=a.toLowerCase()))switch(e=d[2].split(","),d[1]){case"hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return b(Ba(e[0]),Ba(e[1]),Ba(e[2]))}return(f=fh.get(a))?b(f.r,f.g,f.b):(null==a||"#"!==a.charAt(0)||isNaN(f=parseInt(a.slice(1),16))||(4===a.length?(g=(3840&f)>>4,g=g>>4|g,h=240&f,h=h>>4|h,i=15&f,i=i<<4|i):7===a.length&&(g=(16711680&f)>>16,h=(65280&f)>>8,i=255&f)),b(g,h,i))}function ya(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):(d=NaN,e=i>0&&1>i?0:d),new ja(d,e,i)}function za(a,b,c){a=Aa(a),b=Aa(b),c=Aa(c);var d=ra((.4124564*a+.3575761*b+.1804375*c)/ah),e=ra((.2126729*a+.7151522*b+.072175*c)/bh),f=ra((.0193339*a+.119192*b+.9503041*c)/ch);return na(116*e-16,500*(d-e),200*(e-f))}function Aa(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Ba(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function Ca(a){return"function"==typeof a?a:function(){return a}}function Da(a){return function(b,c,d){return 2===arguments.length&&"function"==typeof c&&(d=c,c=null),Ea(b,c,a,d)}}function Ea(a,b,c,d){function e(){var a,b=i.status;if(!b&&Ga(i)||b>=200&&300>b||304===b){try{a=c.call(f,i)}catch(d){return void g.error.call(f,d)}g.load.call(f,a)}else g.error.call(f,i)}var f={},g=jg.dispatch("beforesend","progress","load","error"),h={},i=new XMLHttpRequest,j=null;return!this.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(a)||(i=new XDomainRequest),"onload"in i?i.onload=i.onerror=e:i.onreadystatechange=function(){i.readyState>3&&e()},i.onprogress=function(a){var b=jg.event;jg.event=a;try{g.progress.call(f,i)}finally{jg.event=b}},f.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(null==b?delete h[a]:h[a]=b+"",f)},f.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",f):b},f.responseType=function(a){return arguments.length?(j=a,f):j},f.response=function(a){return c=a,f},["get","post"].forEach(function(a){f[a]=function(){return f.send.apply(f,[a].concat(lg(arguments)))}}),f.send=function(c,d,e){if(2===arguments.length&&"function"==typeof d&&(e=d,d=null),i.open(c,a,!0),null==b||"accept"in h||(h.accept=b+",*/*"),i.setRequestHeader)for(var k in h)i.setRequestHeader(k,h[k]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=j&&(i.responseType=j),null!=e&&f.on("error",e).on("load",function(a){e(null,a)}),g.beforesend.call(f,i),i.send(null==d?null:d),f},f.abort=function(){return i.abort(),f},jg.rebind(f,g,"on"),null==d?f:f.get(Fa(d))}function Fa(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function Ga(a){var b=a.responseType;return b&&"text"!==b?a.response:a.responseText}function Ha(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,n:null};return hh?hh.n=f:gh=f,hh=f,ih||(jh=clearTimeout(jh),ih=1,kh(Ia)),f}function Ia(){var a=Ja(),b=Ka()-a;b>24?(isFinite(b)&&(clearTimeout(jh),jh=setTimeout(Ia,b)),ih=0):(ih=1,kh(Ia))}function Ja(){for(var a=Date.now(),b=gh;b;)a>=b.t&&b.c(a-b.t)&&(b.c=null),b=b.n;return a}function Ka(){for(var a,b=gh,c=1/0;b;)b.c?(b.t<c&&(c=b.t),b=(a=b).n):b=a?a.n=b.n:gh=b.n;return hh=a,c}function La(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function Ma(a,b){var c=Math.pow(10,3*vg(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function Na(a){var b=a.decimal,c=a.thousands,d=a.grouping,e=a.currency,f=d&&c?function(a,b){for(var e=a.length,f=[],g=0,h=d[0],i=0;e>0&&h>0&&(i+h+1>b&&(h=Math.max(1,b-i)),f.push(a.substring(e-=h,e+h)),!((i+=h+1)>b));)h=d[g=(g+1)%d.length];return f.reverse().join(c)}:u;return function(a){var c=mh.exec(a),d=c[1]||" ",g=c[2]||">",h=c[3]||"-",i=c[4]||"",j=c[5],k=+c[6],l=c[7],m=c[8],n=c[9],o=1,p="",q="",r=!1,s=!0;switch(m&&(m=+m.substring(1)),(j||"0"===d&&"="===g)&&(j=d="0",g="="),n){case"n":l=!0,n="g";break;case"%":o=100,q="%",n="f";break;case"p":o=100,q="%",n="r";break;case"b":case"o":case"x":case"X":"#"===i&&(p="0"+n.toLowerCase());case"c":s=!1;case"d":r=!0,m=0;break;case"s":o=-1,n="r"}"$"===i&&(p=e[0],q=e[1]),"r"!=n||m||(n="g"),null!=m&&("g"==n?m=Math.max(1,Math.min(21,m)):"e"!=n&&"f"!=n||(m=Math.max(0,Math.min(20,m)))),n=nh.get(n)||Oa;var t=j&&l;return function(a){var c=q;if(r&&a%1)return"";var e=0>a||0===a&&0>1/a?(a=-a,"-"):"-"===h?"":h;if(0>o){var i=jg.formatPrefix(a,m);a=i.scale(a),c=i.symbol+q}else a*=o;a=n(a,m);var u,v,w=a.lastIndexOf(".");if(0>w){var x=s?a.lastIndexOf("e"):-1;0>x?(u=a,v=""):(u=a.substring(0,x),v=a.substring(x))}else u=a.substring(0,w),v=b+a.substring(w+1);!j&&l&&(u=f(u,1/0));var y=p.length+u.length+v.length+(t?0:e.length),z=k>y?new Array(y=k-y+1).join(d):"";return t&&(u=f(z+u,z.length?k-v.length:1/0)),e+=p,a=u+v,("<"===g?e+a+z:">"===g?z+e+a:"^"===g?z.substring(0,y>>=1)+e+a+z.substring(y):e+(t?a:z+a))+c}}}function Oa(a){return a+""}function Pa(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Qa(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new ph(c-1)),1),c}function f(a,c){return b(a=new ph(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{ph=Pa;var d=new Pa;return d._=a,g(d,b,c)}finally{ph=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=Ra(a);return i.floor=i,i.round=Ra(d),i.ceil=Ra(e),i.offset=Ra(f),i.range=h,a}function Ra(a){return function(b,c){try{ph=Pa;var d=new Pa;return d._=b,a(d,c)._}finally{ph=Date}}}function Sa(a){function b(a){function b(b){for(var c,e,f,g=[],h=-1,i=0;++h<d;)37===a.charCodeAt(h)&&(g.push(a.slice(i,h)),null!=(e=rh[c=a.charAt(++h)])&&(c=a.charAt(++h)),(f=C[c])&&(c=f(b,null==e?"e"===c?" ":"0":e)),g.push(c),i=h+1);return g.push(a.slice(i,h)),g.join("")}var d=a.length;return b.parse=function(b){var d={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},e=c(d,a,b,0);if(e!=b.length)return null;"p"in d&&(d.H=d.H%12+12*d.p);var f=null!=d.Z&&ph!==Pa,g=new(f?Pa:ph);return"j"in d?g.setFullYear(d.y,0,d.j):"W"in d||"U"in d?("w"in d||(d.w="W"in d?1:0),g.setFullYear(d.y,0,1),g.setFullYear(d.y,0,"W"in d?(d.w+6)%7+7*d.W-(g.getDay()+5)%7:d.w+7*d.U-(g.getDay()+6)%7)):g.setFullYear(d.y,d.m,d.d),g.setHours(d.H+(d.Z/100|0),d.M+d.Z%100,d.S,d.L),f?g._:g},b.toString=function(){return a},b}function c(a,b,c,d){for(var e,f,g,h=0,i=b.length,j=c.length;i>h;){if(d>=j)return-1;if(e=b.charCodeAt(h++),37===e){if(g=b.charAt(h++),f=D[g in rh?b.charAt(h++):g],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function d(a,b,c){w.lastIndex=0;var d=w.exec(b.slice(c));return d?(a.w=x.get(d[0].toLowerCase()),c+d[0].length):-1}function e(a,b,c){u.lastIndex=0;var d=u.exec(b.slice(c));return d?(a.w=v.get(d[0].toLowerCase()),c+d[0].length):-1}function f(a,b,c){A.lastIndex=0;var d=A.exec(b.slice(c));return d?(a.m=B.get(d[0].toLowerCase()),c+d[0].length):-1}function g(a,b,c){y.lastIndex=0;var d=y.exec(b.slice(c));return d?(a.m=z.get(d[0].toLowerCase()),c+d[0].length):-1}function h(a,b,d){return c(a,C.c.toString(),b,d)}function i(a,b,d){return c(a,C.x.toString(),b,d)}function j(a,b,d){return c(a,C.X.toString(),b,d)}function k(a,b,c){var d=t.get(b.slice(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}var l=a.dateTime,m=a.date,n=a.time,o=a.periods,p=a.days,q=a.shortDays,r=a.months,s=a.shortMonths;b.utc=function(a){function c(a){try{ph=Pa;var b=new ph;return b._=a,d(b)}finally{ph=Date}}var d=b(a);return c.parse=function(a){try{ph=Pa;var b=d.parse(a);return b&&b._}finally{ph=Date}},c.toString=d.toString,c},b.multi=b.utc.multi=kb;var t=jg.map(),u=Ua(p),v=Va(p),w=Ua(q),x=Va(q),y=Ua(r),z=Va(r),A=Ua(s),B=Va(s);o.forEach(function(a,b){t.set(a.toLowerCase(),b)});var C={a:function(a){return q[a.getDay()]},A:function(a){return p[a.getDay()]},b:function(a){return s[a.getMonth()]},B:function(a){return r[a.getMonth()]},c:b(l),d:function(a,b){return Ta(a.getDate(),b,2)},e:function(a,b){return Ta(a.getDate(),b,2)},H:function(a,b){return Ta(a.getHours(),b,2)},I:function(a,b){return Ta(a.getHours()%12||12,b,2)},j:function(a,b){return Ta(1+oh.dayOfYear(a),b,3)},L:function(a,b){return Ta(a.getMilliseconds(),b,3)},m:function(a,b){return Ta(a.getMonth()+1,b,2)},M:function(a,b){return Ta(a.getMinutes(),b,2)},p:function(a){return o[+(a.getHours()>=12)]},S:function(a,b){return Ta(a.getSeconds(),b,2)},U:function(a,b){return Ta(oh.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return Ta(oh.mondayOfYear(a),b,2)},x:b(m),X:b(n),y:function(a,b){return Ta(a.getFullYear()%100,b,2)},Y:function(a,b){return Ta(a.getFullYear()%1e4,b,4)},Z:ib,"%":function(){return"%"}},D={a:d,A:e,b:f,B:g,c:h,d:cb,e:cb,H:eb,I:eb,j:db,L:hb,m:bb,M:fb,p:k,S:gb,U:Xa,w:Wa,W:Ya,x:i,X:j,y:$a,Y:Za,Z:_a,"%":jb};return b}function Ta(a,b,c){var d=0>a?"-":"",e=(d?-a:a)+"",f=e.length;return d+(c>f?new Array(c-f+1).join(b)+e:e)}function Ua(a){return new RegExp("^(?:"+a.map(jg.requote).join("|")+")","i")}function Va(a){for(var b=new l,c=-1,d=a.length;++c<d;)b.set(a[c].toLowerCase(),c);return b}function Wa(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+1));return d?(a.w=+d[0],c+d[0].length):-1}function Xa(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c));return d?(a.U=+d[0],c+d[0].length):-1}function Ya(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c));return d?(a.W=+d[0],c+d[0].length):-1}function Za(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+4));return d?(a.y=+d[0],c+d[0].length):-1}function $a(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.y=ab(+d[0]),c+d[0].length):-1}function _a(a,b,c){return/^[+-]\d{4}$/.test(b=b.slice(c,c+5))?(a.Z=-b,c+5):-1}function ab(a){return a+(a>68?1900:2e3)}function bb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function cb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function db(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+3));return d?(a.j=+d[0],c+d[0].length):-1}function eb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function fb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function gb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function hb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function ib(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=vg(b)/60|0,e=vg(b)%60;return c+Ta(d,"0",2)+Ta(e,"0",2)}function jb(a,b,c){th.lastIndex=0;var d=th.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function kb(a){for(var b=a.length,c=-1;++c<b;)a[c][0]=this(a[c][0]);return function(b){for(var c=0,d=a[c];!d[1](b);)d=a[++c];return d[0](b)}}function lb(){}function mb(a,b,c){var d=c.s=a+b,e=d-a,f=d-e;c.t=a-f+(b-e)}function nb(a,b){a&&xh.hasOwnProperty(a.type)&&xh[a.type](a,b)}function ob(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++e<f;)d=a[e],b.point(d[0],d[1],d[2]);b.lineEnd()}function pb(a,b){var c=-1,d=a.length;for(b.polygonStart();++c<d;)ob(a[c],b,1);b.polygonEnd()}function qb(){function a(a,b){a*=Rg,b=b*Rg/2+Ng/4;var c=a-d,g=c>=0?1:-1,h=g*c,i=Math.cos(b),j=Math.sin(b),k=f*j,l=e*i+k*Math.cos(h),m=k*g*Math.sin(h);zh.add(Math.atan2(m,l)),d=a,e=i,f=j}var b,c,d,e,f;Ah.point=function(g,h){Ah.point=a,d=(b=g)*Rg,e=Math.cos(h=(c=h)*Rg/2+Ng/4),f=Math.sin(h)},Ah.lineEnd=function(){a(b,c)}}function rb(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function sb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function tb(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function ub(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function vb(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function wb(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function xb(a){return[Math.atan2(a[1],a[0]),da(a[2])]}function yb(a,b){return vg(a[0]-b[0])<Lg&&vg(a[1]-b[1])<Lg}function zb(a,b){a*=Rg;var c=Math.cos(b*=Rg);Ab(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function Ab(a,b,c){++Bh,Dh+=(a-Dh)/Bh,Eh+=(b-Eh)/Bh,Fh+=(c-Fh)/Bh}function Bb(){function a(a,e){a*=Rg;var f=Math.cos(e*=Rg),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);Ch+=j,Gh+=j*(b+(b=g)),Hh+=j*(c+(c=h)),Ih+=j*(d+(d=i)),Ab(b,c,d)}var b,c,d;Mh.point=function(e,f){e*=Rg;var g=Math.cos(f*=Rg);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),Mh.point=a,Ab(b,c,d)}}function Cb(){Mh.point=zb}function Db(){function a(a,b){a*=Rg;var c=Math.cos(b*=Rg),g=c*Math.cos(a),h=c*Math.sin(a),i=Math.sin(b),j=e*i-f*h,k=f*g-d*i,l=d*h-e*g,m=Math.sqrt(j*j+k*k+l*l),n=d*g+e*h+f*i,o=m&&-ca(n)/m,p=Math.atan2(m,n);Jh+=o*j,Kh+=o*k,Lh+=o*l,Ch+=p,Gh+=p*(d+(d=g)),Hh+=p*(e+(e=h)),Ih+=p*(f+(f=i)),Ab(d,e,f)}var b,c,d,e,f;Mh.point=function(g,h){b=g,c=h,Mh.point=a,g*=Rg;var i=Math.cos(h*=Rg);d=i*Math.cos(g),e=i*Math.sin(g),f=Math.sin(h),Ab(d,e,f)},Mh.lineEnd=function(){a(b,c),Mh.lineEnd=Cb,Mh.point=zb}}function Eb(a,b){function c(c,d){return c=a(c,d),b(c[0],c[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=b.invert(c,d),c&&a.invert(c[0],c[1])}),c}function Fb(){return!0}function Gb(a,b,c,d,e){var f=[],g=[];if(a.forEach(function(a){if(!((b=a.length-1)<=0)){var b,c=a[0],d=a[b];if(yb(c,d)){e.lineStart();for(var h=0;b>h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i=new Ib(c,a,null,!0),j=new Ib(c,null,i,!1);i.o=j,f.push(i),g.push(j),i=new Ib(d,a,null,!1),j=new Ib(d,null,i,!0),i.o=j,f.push(i),g.push(j)}}),g.sort(b),Hb(f),Hb(g),f.length){for(var h=0,i=c,j=g.length;j>h;++h)g[h].e=i=!i;for(var k,l,m=f[0];;){for(var n=m,o=!0;n.v;)if((n=n.n)===m)return;k=n.z,e.lineStart();do{if(n.v=n.o.v=!0,n.e){if(o)for(var h=0,j=k.length;j>h;++h)e.point((l=k[h])[0],l[1]);else d(n.x,n.n.x,1,e);n=n.n}else{if(o){k=n.p.z;for(var h=k.length-1;h>=0;--h)e.point((l=k[h])[0],l[1])}else d(n.x,n.p.x,-1,e);n=n.p}n=n.o,k=n.z,o=!o}while(!n.v);e.lineEnd()}}}function Hb(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d<b;)e.n=c=a[d],c.p=e,e=c;e.n=c=a[0],c.p=e}}function Ib(a,b,c,d){this.x=a,this.z=b,this.o=c,this.e=d,this.v=!1,this.n=this.p=null}function Jb(a,b,c,d){return function(e,f){function g(b,c){var d=e(b,c);a(b=d[0],c=d[1])&&f.point(b,c)}function h(a,b){var c=e(a,b);q.point(c[0],c[1])}function i(){s.point=h,q.lineStart()}function j(){s.point=g,q.lineEnd()}function k(a,b){p.push([a,b]);var c=e(a,b);u.point(c[0],c[1])}function l(){u.lineStart(),p=[]}function m(){k(p[0][0],p[0][1]),u.lineEnd();var a,b=u.clean(),c=t.buffer(),d=c.length;if(p.pop(),o.push(p),p=null,d)if(1&b){a=c[0];var e,d=a.length-1,g=-1;if(d>0){for(v||(f.polygonStart(),v=!0),f.lineStart();++g<d;)f.point((e=a[g])[0],e[1]);f.lineEnd()}}else d>1&&2&b&&c.push(c.pop().concat(c.shift())),n.push(c.filter(Kb))}var n,o,p,q=b(f),r=e.invert(d[0],d[1]),s={point:g,lineStart:i,lineEnd:j,polygonStart:function(){s.point=k,s.lineStart=l,s.lineEnd=m,n=[],o=[]},polygonEnd:function(){s.point=g,s.lineStart=i,s.lineEnd=j,n=jg.merge(n);var a=Qb(r,o);n.length?(v||(f.polygonStart(),v=!0),Gb(n,Mb,a,c,f)):a&&(v||(f.polygonStart(),v=!0),f.lineStart(),c(null,null,1,f),f.lineEnd()),v&&(f.polygonEnd(),v=!1),n=o=null},sphere:function(){f.polygonStart(),f.lineStart(),c(null,null,1,f),f.lineEnd(),f.polygonEnd()}},t=Lb(),u=b(t),v=!1;return s}}function Kb(a){return a.length>1}function Lb(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){a.push([b,c])},lineEnd:x,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function Mb(a,b){return((a=a.x)[0]<0?a[1]-Qg-Lg:Qg-a[1])-((b=b.x)[0]<0?b[1]-Qg-Lg:Qg-b[1])}function Nb(a){var b,c=NaN,d=NaN,e=NaN;return{lineStart:function(){a.lineStart(),b=1},point:function(f,g){var h=f>0?Ng:-Ng,i=vg(f-c);vg(i-Ng)<Lg?(a.point(c,d=(d+g)/2>0?Qg:-Qg),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Ng&&(vg(c-e)<Lg&&(c-=e*Lg),vg(f-h)<Lg&&(f-=h*Lg),d=Ob(c,d,f,g),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),b=0),a.point(c=f,d=g),e=h},lineEnd:function(){a.lineEnd(),c=d=NaN},clean:function(){return 2-b}}}function Ob(a,b,c,d){var e,f,g=Math.sin(a-c);return vg(g)>Lg?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function Pb(a,b,c,d){var e;if(null==a)e=c*Qg,d.point(-Ng,e),d.point(0,e),d.point(Ng,e),d.point(Ng,0),d.point(Ng,-e),d.point(0,-e),d.point(-Ng,-e),d.point(-Ng,0),d.point(-Ng,e);else if(vg(a[0]-b[0])>Lg){var f=a[0]<b[0]?Ng:-Ng;e=c*f/2,d.point(-f,e),d.point(0,e),d.point(f,e)}else d.point(b[0],b[1])}function Qb(a,b){var c=a[0],d=a[1],e=[Math.sin(c),-Math.cos(c),0],f=0,g=0;zh.reset();for(var h=0,i=b.length;i>h;++h){var j=b[h],k=j.length;if(k)for(var l=j[0],m=l[0],n=l[1]/2+Ng/4,o=Math.sin(n),p=Math.cos(n),q=1;;){q===k&&(q=0),a=j[q];var r=a[0],s=a[1]/2+Ng/4,t=Math.sin(s),u=Math.cos(s),v=r-m,w=v>=0?1:-1,x=w*v,y=x>Ng,z=o*t;if(zh.add(Math.atan2(z*w*Math.sin(x),p*u+z*Math.cos(x))),f+=y?v+w*Og:v,y^m>=c^r>=c){var A=tb(rb(l),rb(a));wb(A);var B=tb(e,A);wb(B);var C=(y^v>=0?-1:1)*da(B[2]);(d>C||d===C&&(A[0]||A[1]))&&(g+=y^v>=0?1:-1)}if(!q++)break;m=r,o=t,p=u,l=a}}return(-Lg>f||Lg>f&&0>zh)^1&g}function Rb(a){function b(a,b){return Math.cos(a)*Math.cos(b)>f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Ng:-Ng),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(yb(c,n)||yb(o,n))&&(o[0]+=Lg,o[1]+=Lg,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&yb(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=rb(a),e=rb(b),g=[1,0,0],h=tb(d,e),i=sb(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=tb(g,h),o=vb(g,l),p=vb(h,m);ub(o,p);var q=n,r=sb(o,q),s=sb(q,q),t=r*r-s*(sb(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=vb(q,(-r-u)/s);if(ub(v,o),v=xb(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=vg(B-Ng)<Lg,D=C||Lg>B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(vg(v[0]-x)<Lg?z:A):z<=v[1]&&v[1]<=A:B>Ng^(x<=v[0]&&v[0]<=y)){var E=vb(q,(-r+u)/s);return ub(E,o),[v,xb(E)]}}}function e(b,c){var d=g?a:Ng-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=vg(f)>Lg,i=qc(a,6*Rg);return Jb(b,c,i,g?[0,-a]:[-Ng,a-Ng])}function Sb(a,b,c,d){return function(e){var f,g=e.a,h=e.b,i=g.x,j=g.y,k=h.x,l=h.y,m=0,n=1,o=k-i,p=l-j;if(f=a-i,o||!(f>0)){if(f/=o,0>o){if(m>f)return;n>f&&(n=f)}else if(o>0){if(f>n)return;f>m&&(m=f)}if(f=c-i,o||!(0>f)){if(f/=o,0>o){if(f>n)return;f>m&&(m=f)}else if(o>0){if(m>f)return;n>f&&(n=f)}if(f=b-j,p||!(f>0)){if(f/=p,0>p){if(m>f)return;n>f&&(n=f)}else if(p>0){if(f>n)return;f>m&&(m=f)}if(f=d-j,p||!(0>f)){if(f/=p,0>p){if(f>n)return;f>m&&(m=f)}else if(p>0){if(m>f)return;n>f&&(n=f)}return m>0&&(e.a={x:i+m*o,y:j+m*p}),1>n&&(e.b={x:i+n*o,y:j+n*p}),e}}}}}}function Tb(a,b,c,d){function e(d,e){return vg(d[0]-a)<Lg?e>0?0:3:vg(d[0]-c)<Lg?e>0?2:1:vg(d[1]-b)<Lg?e>0?1:0:e>0?3:2}function f(a,b){return g(a.x,b.x)}function g(a,b){var c=e(a,1),d=e(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}return function(h){function i(a){for(var b=0,c=q.length,d=a[1],e=0;c>e;++e)for(var f,g=1,h=q[e],i=h.length,j=h[0];i>g;++g)f=h[g],j[1]<=d?f[1]>d&&ba(j,f,a)>0&&++b:f[1]<=d&&ba(j,f,a)<0&&--b,j=f;return 0!==b; 27 }function j(f,h,i,j){var k=0,l=0;if(null==f||(k=e(f,i))!==(l=e(h,i))||g(f,h)<0^i>0){do j.point(0===k||3===k?a:c,k>1?d:b);while((k=(k+i+4)%4)!==l)}else j.point(h[0],h[1])}function k(e,f){return e>=a&&c>=e&&f>=b&&d>=f}function l(a,b){k(a,b)&&h.point(a,b)}function m(){D.point=o,q&&q.push(r=[]),y=!0,x=!1,v=w=NaN}function n(){p&&(o(s,t),u&&x&&B.rejoin(),p.push(B.buffer())),D.point=l,x&&h.lineEnd()}function o(a,b){a=Math.max(-Oh,Math.min(Oh,a)),b=Math.max(-Oh,Math.min(Oh,b));var c=k(a,b);if(q&&r.push([a,b]),y)s=a,t=b,u=c,y=!1,c&&(h.lineStart(),h.point(a,b));else if(c&&x)h.point(a,b);else{var d={a:{x:v,y:w},b:{x:a,y:b}};C(d)?(x||(h.lineStart(),h.point(d.a.x,d.a.y)),h.point(d.b.x,d.b.y),c||h.lineEnd(),z=!1):c&&(h.lineStart(),h.point(a,b),z=!1)}v=a,w=b,x=c}var p,q,r,s,t,u,v,w,x,y,z,A=h,B=Lb(),C=Sb(a,b,c,d),D={point:l,lineStart:m,lineEnd:n,polygonStart:function(){h=B,p=[],q=[],z=!0},polygonEnd:function(){h=A,p=jg.merge(p);var b=i([a,d]),c=z&&b,e=p.length;(c||e)&&(h.polygonStart(),c&&(h.lineStart(),j(null,null,1,h),h.lineEnd()),e&&Gb(p,f,b,j,h),h.polygonEnd()),p=q=r=null}};return D}}function Ub(a){var b=0,c=Ng/3,d=ic(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Ng/180,c=a[1]*Ng/180):[b/Ng*180,c/Ng*180]},e}function Vb(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,da((f-(a*a+c*c)*e*e)/(2*e))]},c}function Wb(){function a(a,b){Qh+=e*a-d*b,d=a,e=b}var b,c,d,e;Vh.point=function(f,g){Vh.point=a,b=d=f,c=e=g},Vh.lineEnd=function(){a(b,c)}}function Xb(a,b){Rh>a&&(Rh=a),a>Th&&(Th=a),Sh>b&&(Sh=b),b>Uh&&(Uh=b)}function Yb(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Zb(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d,h.point=a},pointRadius:function(a){return f=Zb(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function Zb(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function $b(a,b){Dh+=a,Eh+=b,++Fh}function _b(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);Gh+=g*(b+a)/2,Hh+=g*(c+d)/2,Ih+=g,$b(b=a,c=d)}var b,c;Xh.point=function(d,e){Xh.point=a,$b(b=d,c=e)}}function ac(){Xh.point=$b}function bc(){function a(a,b){var c=a-d,f=b-e,g=Math.sqrt(c*c+f*f);Gh+=g*(d+a)/2,Hh+=g*(e+b)/2,Ih+=g,g=e*a-d*b,Jh+=g*(d+a),Kh+=g*(e+b),Lh+=3*g,$b(d=a,e=b)}var b,c,d,e;Xh.point=function(f,g){Xh.point=a,$b(b=d=f,c=e=g)},Xh.lineEnd=function(){a(b,c)}}function cc(a){function b(b,c){a.moveTo(b+g,c),a.arc(b,c,g,0,Og)}function c(b,c){a.moveTo(b,c),h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e,h.point=b},pointRadius:function(a){return g=a,h},result:x};return h}function dc(a){function b(a){return(h?d:c)(a)}function c(b){return gc(b,function(c,d){c=a(c,d),b.point(c[0],c[1])})}function d(b){function c(c,d){c=a(c,d),b.point(c[0],c[1])}function d(){t=NaN,y.point=f,b.lineStart()}function f(c,d){var f=rb([c,d]),g=a(c,d);e(t,u,s,v,w,x,t=g[0],u=g[1],s=c,v=f[0],w=f[1],x=f[2],h,b),b.point(t,u)}function g(){y.point=c,b.lineEnd()}function i(){d(),y.point=j,y.lineEnd=k}function j(a,b){f(l=a,m=b),n=t,o=u,p=v,q=w,r=x,y.point=f}function k(){e(t,u,s,v,w,x,n,o,l,p,q,r,h,b),y.lineEnd=g,g()}var l,m,n,o,p,q,r,s,t,u,v,w,x,y={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart(),y.lineStart=i},polygonEnd:function(){b.polygonEnd(),y.lineStart=d}};return y}function e(b,c,d,h,i,j,k,l,m,n,o,p,q,r){var s=k-b,t=l-c,u=s*s+t*t;if(u>4*f&&q--){var v=h+n,w=i+o,x=j+p,y=Math.sqrt(v*v+w*w+x*x),z=Math.asin(x/=y),A=vg(vg(x)-1)<Lg||vg(d-m)<Lg?(d+m)/2:Math.atan2(w,v),B=a(A,z),C=B[0],D=B[1],E=C-b,F=D-c,G=t*E-s*F;(G*G/u>f||vg((s*E+t*F)/u-.5)>.3||g>h*n+i*o+j*p)&&(e(b,c,d,h,i,j,C,D,A,v/=y,w/=y,x,q,r),r.point(C,D),e(C,D,A,v,w,x,k,l,m,n,o,p,q,r))}}var f=.5,g=Math.cos(30*Rg),h=16;return b.precision=function(a){return arguments.length?(h=(f=a*a)>0&&16,b):Math.sqrt(f)},b}function ec(a){var b=dc(function(b,c){return a([b*Sg,c*Sg])});return function(a){return jc(b(a))}}function fc(a){this.stream=a}function gc(a,b){return{point:b,sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}function hc(a){return ic(function(){return a})()}function ic(a){function b(a){return a=h(a[0]*Rg,a[1]*Rg),[a[0]*m+i,j-a[1]*m]}function c(a){return a=h.invert((a[0]-i)/m,(j-a[1])/m),a&&[a[0]*Sg,a[1]*Sg]}function d(){h=Eb(g=mc(r,s,t),f);var a=f(p,q);return i=n-a[0]*m,j=o+a[1]*m,e()}function e(){return k&&(k.valid=!1,k=null),b}var f,g,h,i,j,k,l=dc(function(a,b){return a=f(a,b),[a[0]*m+i,j-a[1]*m]}),m=150,n=480,o=250,p=0,q=0,r=0,s=0,t=0,v=Nh,w=u,x=null,y=null;return b.stream=function(a){return k&&(k.valid=!1),k=jc(v(g,l(w(a)))),k.valid=!0,k},b.clipAngle=function(a){return arguments.length?(v=null==a?(x=a,Nh):Rb((x=+a)*Rg),e()):x},b.clipExtent=function(a){return arguments.length?(y=a,w=a?Tb(a[0][0],a[0][1],a[1][0],a[1][1]):u,e()):y},b.scale=function(a){return arguments.length?(m=+a,d()):m},b.translate=function(a){return arguments.length?(n=+a[0],o=+a[1],d()):[n,o]},b.center=function(a){return arguments.length?(p=a[0]%360*Rg,q=a[1]%360*Rg,d()):[p*Sg,q*Sg]},b.rotate=function(a){return arguments.length?(r=a[0]%360*Rg,s=a[1]%360*Rg,t=a.length>2?a[2]%360*Rg:0,d()):[r*Sg,s*Sg,t*Sg]},jg.rebind(b,l,"precision"),function(){return f=a.apply(this,arguments),b.invert=f.invert&&c,d()}}function jc(a){return gc(a,function(b,c){a.point(b*Rg,c*Rg)})}function kc(a,b){return[a,b]}function lc(a,b){return[a>Ng?a-Og:-Ng>a?a+Og:a,b]}function mc(a,b,c){return a?b||c?Eb(oc(a),pc(b,c)):oc(a):b||c?pc(b,c):lc}function nc(a){return function(b,c){return b+=a,[b>Ng?b-Og:-Ng>b?b+Og:b,c]}}function oc(a){var b=nc(a);return b.invert=nc(-a),b}function pc(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),da(k*f+i*g)]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),da(k*d-h*e)]},c}function qc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var i=g*b;null!=e?(e=rc(c,e),f=rc(c,f),(g>0?f>e:e>f)&&(e+=g*Og)):(e=a+g*Og,f=a-.5*i);for(var j,k=e;g>0?k>f:f>k;k-=i)h.point((j=xb([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],j[1])}}function rc(a,b){var c=rb(b);c[0]-=a,wb(c);var d=ca(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Lg)%(2*Math.PI)}function sc(a,b,c){var d=jg.range(a,b-Lg,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function tc(a,b,c){var d=jg.range(a,b-Lg,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function uc(a){return a.source}function vc(a){return a.target}function wc(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(ha(d-b)+e*g*ha(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Sg,Math.atan2(g,Math.sqrt(d*d+e*e))*Sg]}:function(){return[a*Sg,b*Sg]};return o.distance=m,o}function xc(){function a(a,e){var f=Math.sin(e*=Rg),g=Math.cos(e),h=vg((a*=Rg)-b),i=Math.cos(h);Yh+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;Zh.point=function(e,f){b=e*Rg,c=Math.sin(f*=Rg),d=Math.cos(f),Zh.point=a},Zh.lineEnd=function(){Zh.point=Zh.lineEnd=x}}function yc(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function zc(a,b){function c(a,b){g>0?-Qg+Lg>b&&(b=-Qg+Lg):b>Qg-Lg&&(b=Qg-Lg);var c=g/Math.pow(e(b),f);return[c*Math.sin(f*a),g-c*Math.cos(f*a)]}var d=Math.cos(a),e=function(a){return Math.tan(Ng/4+a/2)},f=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(e(b)/e(a)),g=d*Math.pow(e(a),f)/f;return f?(c.invert=function(a,b){var c=g-b,d=aa(f)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/f,2*Math.atan(Math.pow(g/d,1/f))-Qg]},c):Bc}function Ac(a,b){function c(a,b){var c=f-b;return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;return vg(e)<Lg?kc:(c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-aa(e)*Math.sqrt(a*a+c*c)]},c)}function Bc(a,b){return[a,Math.log(Math.tan(Ng/4+b/2))]}function Cc(a){var b,c=hc(a),d=c.scale,e=c.translate,f=c.clipExtent;return c.scale=function(){var a=d.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.translate=function(){var a=e.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.clipExtent=function(a){var g=f.apply(c,arguments);if(g===c){if(b=null==a){var h=Ng*d(),i=e();f([[i[0]-h,i[1]-h],[i[0]+h,i[1]+h]])}}else b&&(g=null);return g},c.clipExtent(null)}function Dc(a,b){return[Math.log(Math.tan(Ng/4+b/2)),-a]}function Ec(a){return a[0]}function Fc(a){return a[1]}function Gc(a){for(var b=a.length,c=[0,1],d=2,e=2;b>e;e++){for(;d>1&&ba(a[c[d-2]],a[c[d-1]],a[e])<=0;)--d;c[d++]=e}return c.slice(0,d)}function Hc(a,b){return a[0]-b[0]||a[1]-b[1]}function Ic(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Jc(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function Kc(a){var b=a[0],c=a[a.length-1];return!(b[0]-c[0]||b[1]-c[1])}function Lc(){ed(this),this.edge=this.site=this.circle=null}function Mc(a){var b=ji.pop()||new Lc;return b.site=a,b}function Nc(a){Xc(a),gi.remove(a),ji.push(a),ed(a)}function Oc(a){var b=a.circle,c=b.x,d=b.cy,e={x:c,y:d},f=a.P,g=a.N,h=[a];Nc(a);for(var i=f;i.circle&&vg(c-i.circle.x)<Lg&&vg(d-i.circle.cy)<Lg;)f=i.P,h.unshift(i),Nc(i),i=f;h.unshift(i),Xc(i);for(var j=g;j.circle&&vg(c-j.circle.x)<Lg&&vg(d-j.circle.cy)<Lg;)g=j.N,h.push(j),Nc(j),j=g;h.push(j),Xc(j);var k,l=h.length;for(k=1;l>k;++k)j=h[k],i=h[k-1],bd(j.edge,i.site,j.site,e);i=h[0],j=h[l-1],j.edge=_c(i.site,j.site,null,e),Wc(i),Wc(j)}function Pc(a){for(var b,c,d,e,f=a.x,g=a.y,h=gi._;h;)if(d=Qc(h,g)-f,d>Lg)h=h.L;else{if(e=f-Rc(h,g),!(e>Lg)){d>-Lg?(b=h.P,c=h):e>-Lg?(b=h,c=h.N):b=c=h;break}if(!h.R){b=h;break}h=h.R}var i=Mc(a);if(gi.insert(b,i),b||c){if(b===c)return Xc(b),c=Mc(b.site),gi.insert(i,c),i.edge=c.edge=_c(b.site,i.site),Wc(b),void Wc(c);if(!c)return void(i.edge=_c(b.site,i.site));Xc(b),Xc(c);var j=b.site,k=j.x,l=j.y,m=a.x-k,n=a.y-l,o=c.site,p=o.x-k,q=o.y-l,r=2*(m*q-n*p),s=m*m+n*n,t=p*p+q*q,u={x:(q*s-n*t)/r+k,y:(m*t-p*s)/r+l};bd(c.edge,j,o,u),i.edge=_c(j,a,null,u),c.edge=_c(a,o,null,u),Wc(b),Wc(c)}}function Qc(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d;var g=a.P;if(!g)return-(1/0);c=g.site;var h=c.x,i=c.y,j=i-b;if(!j)return h;var k=h-d,l=1/f-1/j,m=k/j;return l?(-m+Math.sqrt(m*m-2*l*(k*k/(-2*j)-i+j/2+e-f/2)))/l+d:(d+h)/2}function Rc(a,b){var c=a.N;if(c)return Qc(c,b);var d=a.site;return d.y===b?d.x:1/0}function Sc(a){this.site=a,this.edges=[]}function Tc(a){for(var b,c,d,e,f,g,h,i,j,k,l=a[0][0],m=a[1][0],n=a[0][1],o=a[1][1],p=fi,q=p.length;q--;)if(f=p[q],f&&f.prepare())for(h=f.edges,i=h.length,g=0;i>g;)k=h[g].end(),d=k.x,e=k.y,j=h[++g%i].start(),b=j.x,c=j.y,(vg(d-b)>Lg||vg(e-c)>Lg)&&(h.splice(g,0,new cd(ad(f.site,k,vg(d-l)<Lg&&o-e>Lg?{x:l,y:vg(b-l)<Lg?c:o}:vg(e-o)<Lg&&m-d>Lg?{x:vg(c-o)<Lg?b:m,y:o}:vg(d-m)<Lg&&e-n>Lg?{x:m,y:vg(b-m)<Lg?c:n}:vg(e-n)<Lg&&d-l>Lg?{x:vg(c-n)<Lg?b:l,y:n}:null),f.site,null)),++i)}function Uc(a,b){return b.angle-a.angle}function Vc(){ed(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wc(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,e=a.site,f=c.site;if(d!==f){var g=e.x,h=e.y,i=d.x-g,j=d.y-h,k=f.x-g,l=f.y-h,m=2*(i*l-j*k);if(!(m>=-Mg)){var n=i*i+j*j,o=k*k+l*l,p=(l*n-j*o)/m,q=(i*o-k*n)/m,l=q+h,r=ki.pop()||new Vc;r.arc=a,r.site=e,r.x=p+g,r.y=l+Math.sqrt(p*p+q*q),r.cy=l,a.circle=r;for(var s=null,t=ii._;t;)if(r.y<t.y||r.y===t.y&&r.x<=t.x){if(!t.L){s=t.P;break}t=t.L}else{if(!t.R){s=t;break}t=t.R}ii.insert(s,r),s||(hi=r)}}}}function Xc(a){var b=a.circle;b&&(b.P||(hi=b.N),ii.remove(b),ki.push(b),ed(b),a.circle=null)}function Yc(a){for(var b,c=ei,d=Sb(a[0][0],a[0][1],a[1][0],a[1][1]),e=c.length;e--;)b=c[e],(!Zc(b,a)||!d(b)||vg(b.a.x-b.b.x)<Lg&&vg(b.a.y-b.b.y)<Lg)&&(b.a=b.b=null,c.splice(e,1))}function Zc(a,b){var c=a.b;if(c)return!0;var d,e,f=a.a,g=b[0][0],h=b[1][0],i=b[0][1],j=b[1][1],k=a.l,l=a.r,m=k.x,n=k.y,o=l.x,p=l.y,q=(m+o)/2,r=(n+p)/2;if(p===n){if(g>q||q>=h)return;if(m>o){if(f){if(f.y>=j)return}else f={x:q,y:i};c={x:q,y:j}}else{if(f){if(f.y<i)return}else f={x:q,y:j};c={x:q,y:i}}}else if(d=(m-o)/(p-n),e=r-d*q,-1>d||d>1)if(m>o){if(f){if(f.y>=j)return}else f={x:(i-e)/d,y:i};c={x:(j-e)/d,y:j}}else{if(f){if(f.y<i)return}else f={x:(j-e)/d,y:j};c={x:(i-e)/d,y:i}}else if(p>n){if(f){if(f.x>=h)return}else f={x:g,y:d*g+e};c={x:h,y:d*h+e}}else{if(f){if(f.x<g)return}else f={x:h,y:d*h+e};c={x:g,y:d*g+e}}return a.a=f,a.b=c,!0}function $c(a,b){this.l=a,this.r=b,this.a=this.b=null}function _c(a,b,c,d){var e=new $c(a,b);return ei.push(e),c&&bd(e,a,b,c),d&&bd(e,b,a,d),fi[a.i].edges.push(new cd(e,a,b)),fi[b.i].edges.push(new cd(e,b,a)),e}function ad(a,b,c){var d=new $c(a,null);return d.a=b,d.b=c,ei.push(d),d}function bd(a,b,c,d){a.a||a.b?a.l===c?a.b=d:a.a=d:(a.a=d,a.l=b,a.r=c)}function cd(a,b,c){var d=a.a,e=a.b;this.edge=a,this.site=b,this.angle=c?Math.atan2(c.y-b.y,c.x-b.x):a.l===b?Math.atan2(e.x-d.x,d.y-e.y):Math.atan2(d.x-e.x,e.y-d.y)}function dd(){this._=null}function ed(a){a.U=a.C=a.L=a.R=a.P=a.N=null}function fd(a,b){var c=b,d=b.R,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.R=d.L,c.R&&(c.R.U=c),d.L=c}function gd(a,b){var c=b,d=b.L,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.L=d.R,c.L&&(c.L.U=c),d.R=c}function hd(a){for(;a.L;)a=a.L;return a}function id(a,b){var c,d,e,f=a.sort(jd).pop();for(ei=[],fi=new Array(a.length),gi=new dd,ii=new dd;;)if(e=hi,f&&(!e||f.y<e.y||f.y===e.y&&f.x<e.x))f.x===c&&f.y===d||(fi[f.i]=new Sc(f),Pc(f),c=f.x,d=f.y),f=a.pop();else{if(!e)break;Oc(e.arc)}b&&(Yc(b),Tc(b));var g={cells:fi,edges:ei};return gi=ii=ei=fi=null,g}function jd(a,b){return b.y-a.y||b.x-a.x}function kd(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}function ld(a){return a.x}function md(a){return a.y}function nd(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function od(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&od(a,i[0],c,d,g,h),i[1]&&od(a,i[1],g,d,e,h),i[2]&&od(a,i[2],c,h,g,f),i[3]&&od(a,i[3],g,h,e,f)}}function pd(a,b,c,d,e,f,g){var h,i=1/0;return function j(a,k,l,m,n){if(!(k>f||l>g||d>m||e>n)){if(o=a.point){var o,p=b-a.x,q=c-a.y,r=p*p+q*q;if(i>r){var s=Math.sqrt(i=r);d=b-s,e=c-s,f=b+s,g=c+s,h=o}}for(var t=a.nodes,u=.5*(k+m),v=.5*(l+n),w=b>=u,x=c>=v,y=x<<1|w,z=y+4;z>y;++y)if(a=t[3&y])switch(3&y){case 0:j(a,k,l,u,v);break;case 1:j(a,u,l,m,v);break;case 2:j(a,k,v,u,n);break;case 3:j(a,u,v,m,n)}}}(a,d,e,f,g),h}function qd(a,b){a=jg.rgb(a),b=jg.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+wa(Math.round(c+f*a))+wa(Math.round(d+g*a))+wa(Math.round(e+h*a))}}function rd(a,b){var c,d={},e={};for(c in a)c in b?d[c]=ud(a[c],b[c]):e[c]=a[c];for(c in b)c in a||(e[c]=b[c]);return function(a){for(c in d)e[c]=d[c](a);return e}}function sd(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}}function td(a,b){var c,d,e,f=mi.lastIndex=ni.lastIndex=0,g=-1,h=[],i=[];for(a+="",b+="";(c=mi.exec(a))&&(d=ni.exec(b));)(e=d.index)>f&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:sd(c,d)})),f=ni.lastIndex;return f<b.length&&(e=b.slice(f),h[g]?h[g]+=e:h[++g]=e),h.length<2?i[0]?(b=i[0].x,function(a){return b(a)+""}):function(){return b}:(b=i.length,function(a){for(var c,d=0;b>d;++d)h[(c=i[d]).i]=c.x(a);return h.join("")})}function ud(a,b){for(var c,d=jg.interpolators.length;--d>=0&&!(c=jg.interpolators[d](a,b)););return c}function vd(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(ud(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}}function wd(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function xd(a){return function(b){return 1-a(1-b)}}function yd(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function zd(a){return a*a}function Ad(a){return a*a*a}function Bd(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function Cd(a){return function(b){return Math.pow(b,a)}}function Dd(a){return 1-Math.cos(a*Qg)}function Ed(a){return Math.pow(2,10*(a-1))}function Fd(a){return 1-Math.sqrt(1-a*a)}function Gd(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/Og*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*Og/b)}}function Hd(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Id(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Jd(a,b){a=jg.hcl(a),b=jg.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.c:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ma(c+f*a,d+g*a,e+h*a)+""}}function Kd(a,b){a=jg.hsl(a),b=jg.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.s:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ka(c+f*a,d+g*a,e+h*a)+""}}function Ld(a,b){a=jg.lab(a),b=jg.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return oa(c+f*a,d+g*a,e+h*a)+""}}function Md(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function Nd(a){var b=[a.a,a.b],c=[a.c,a.d],d=Pd(b),e=Od(b,c),f=Pd(Qd(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*Sg,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*Sg:0}function Od(a,b){return a[0]*b[0]+a[1]*b[1]}function Pd(a){var b=Math.sqrt(Od(a,a));return b&&(a[0]/=b,a[1]/=b),b}function Qd(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function Rd(a){return a.length?a.pop()+",":""}function Sd(a,b,c,d){if(a[0]!==b[0]||a[1]!==b[1]){var e=c.push("translate(",null,",",null,")");d.push({i:e-4,x:sd(a[0],b[0])},{i:e-2,x:sd(a[1],b[1])})}else(b[0]||b[1])&&c.push("translate("+b+")")}function Td(a,b,c,d){a!==b?(a-b>180?b+=360:b-a>180&&(a+=360),d.push({i:c.push(Rd(c)+"rotate(",null,")")-2,x:sd(a,b)})):b&&c.push(Rd(c)+"rotate("+b+")")}function Ud(a,b,c,d){a!==b?d.push({i:c.push(Rd(c)+"skewX(",null,")")-2,x:sd(a,b)}):b&&c.push(Rd(c)+"skewX("+b+")")}function Vd(a,b,c,d){if(a[0]!==b[0]||a[1]!==b[1]){var e=c.push(Rd(c)+"scale(",null,",",null,")");d.push({i:e-4,x:sd(a[0],b[0])},{i:e-2,x:sd(a[1],b[1])})}else 1===b[0]&&1===b[1]||c.push(Rd(c)+"scale("+b+")")}function Wd(a,b){var c=[],d=[];return a=jg.transform(a),b=jg.transform(b),Sd(a.translate,b.translate,c,d),Td(a.rotate,b.rotate,c,d),Ud(a.skew,b.skew,c,d),Vd(a.scale,b.scale,c,d),a=b=null,function(a){for(var b,e=-1,f=d.length;++e<f;)c[(b=d[e]).i]=b.x(a);return c.join("")}}function Xd(a,b){return b=(b-=a=+a)||1/b,function(c){return(c-a)/b}}function Yd(a,b){return b=(b-=a=+a)||1/b,function(c){return Math.max(0,Math.min(1,(c-a)/b))}}function Zd(a){for(var b=a.source,c=a.target,d=_d(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function $d(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function _d(a,b){if(a===b)return a;for(var c=$d(a),d=$d(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function ae(a){a.fixed|=2}function be(a){a.fixed&=-7}function ce(a){a.fixed|=4,a.px=a.x,a.py=a.y}function de(a){a.fixed&=-5}function ee(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++i<h;)f=g[i],null!=f&&(ee(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function fe(a,b){return jg.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=le,a}function ge(a,b){for(var c=[a];null!=(a=c.pop());)if(b(a),(e=a.children)&&(d=e.length))for(var d,e;--d>=0;)c.push(e[d])}function he(a,b){for(var c=[a],d=[];null!=(a=c.pop());)if(d.push(a),(f=a.children)&&(e=f.length))for(var e,f,g=-1;++g<e;)c.push(f[g]);for(;null!=(a=d.pop());)b(a)}function ie(a){return a.children}function je(a){return a.value}function ke(a,b){return b.value-a.value}function le(a){return jg.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function me(a){return a.x}function ne(a){return a.y}function oe(a,b,c){a.y0=b,a.y=c}function pe(a){return jg.range(a.length)}function qe(a){for(var b=-1,c=a[0].length,d=[];++b<c;)d[b]=0;return d}function re(a){for(var b,c=1,d=0,e=a[0][1],f=a.length;f>c;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function se(a){return a.reduce(te,0)}function te(a,b){return a+b[1]}function ue(a,b){return ve(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ve(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function we(a){return[jg.min(a),jg.max(a)]}function xe(a,b){return a.value-b.value}function ye(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function ze(a,b){a._pack_next=b,b._pack_prev=a}function Ae(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function Be(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-(1/0),m=1/0,n=-(1/0);if(c.forEach(Ce),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],Fe(d,e,f),b(f),ye(d,f),d._pack_prev=f,ye(f,e),e=d._pack_next,g=3;j>g;g++){Fe(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(Ae(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!Ae(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.r<d.r?ze(d,e=h):ze(d=i,e),g--):(ye(d,f),e=f,b(f))}var r=(k+l)/2,s=(m+n)/2,t=0;for(g=0;j>g;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(De)}}function Ce(a){a._pack_next=a._pack_prev=a}function De(a){delete a._pack_next,delete a._pack_prev}function Ee(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e)for(var f=-1,g=e.length;++f<g;)Ee(e[f],b,c,d)}function Fe(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f;g*=g,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function Ge(a,b){return a.parent==b.parent?1:2}function He(a){var b=a.children;return b.length?b[0]:a.t}function Ie(a){var b,c=a.children;return(b=c.length)?c[b-1]:a.t}function Je(a,b,c){var d=c/(b.i-a.i);b.c-=d,b.s+=c,a.c+=d,b.z+=c,b.m+=c}function Ke(a){for(var b,c=0,d=0,e=a.children,f=e.length;--f>=0;)b=e[f],b.z+=c,b.m+=c,c+=b.s+(d+=b.c)}function Le(a,b,c){return a.a.parent===b.parent?a.a:c}function Me(a){return 1+jg.max(a,function(a){return a.y})}function Ne(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function Oe(a){var b=a.children;return b&&b.length?Oe(b[0]):a}function Pe(a){var b,c=a.children;return c&&(b=c.length)?Pe(c[b-1]):a}function Qe(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function Re(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return 0>e&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function Se(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function Te(a){return a.rangeExtent?a.rangeExtent():Se(a.range())}function Ue(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function Ve(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),a[d]=b.floor(f),a[e]=b.ceil(g),a}function We(a){return a?{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}:yi}function Xe(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());++g<=h;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=jg.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function Ye(a,b,c,d){function e(){var e=Math.min(a.length,b.length)>2?Xe:Ue,i=d?Yd:Xd;return g=e(a,b,i,c),h=e(b,a,i,ud),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(Md)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?(c=a,e()):c},f.ticks=function(b){return af(a,b)},f.tickFormat=function(b,c){return bf(a,b,c)},f.nice=function(b){return $e(a,b),e()},f.copy=function(){return Ye(a,b,c,d)},e()}function Ze(a,b){return jg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function $e(a,b){return Ve(a,We(_e(a,b)[2])),Ve(a,We(_e(a,b)[2])),a}function _e(a,b){null==b&&(b=10);var c=Se(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function af(a,b){return jg.range.apply(jg,_e(a,b))}function bf(a,b,c){var d=_e(a,b);if(c){var e=mh.exec(c);if(e.shift(),"s"===e[8]){var f=jg.formatPrefix(Math.max(vg(d[0]),vg(d[1])));return e[7]||(e[7]="."+cf(f.scale(d[2]))),e[8]="f",c=jg.format(e.join("")),function(a){return c(f.scale(a))+f.symbol}}e[7]||(e[7]="."+df(e[8],d)),c=e.join("")}else c=",."+cf(d[2])+"f";return jg.format(c)}function cf(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function df(a,b){var c=cf(b[2]);return a in zi?Math.abs(c-cf(Math.max(vg(b[0]),vg(b[1]))))+ +("e"!==a):c-2*("%"===a)}function ef(a,b,c,d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(a>0?0:-a))/Math.log(b)}function f(a){return c?Math.pow(b,a):-Math.pow(b,-a)}function g(b){return a(e(b))}return g.invert=function(b){return f(a.invert(b))},g.domain=function(b){return arguments.length?(c=b[0]>=0,a.domain((d=b.map(Number)).map(e)),g):d},g.base=function(c){return arguments.length?(b=+c,a.domain(d.map(e)),g):b},g.nice=function(){var b=Ve(d.map(e),c?Math:Bi);return a.domain(b),d=b.map(f),g},g.ticks=function(){var a=Se(d),g=[],h=a[0],i=a[1],j=Math.floor(e(h)),k=Math.ceil(e(i)),l=b%1?2:b;if(isFinite(k-j)){if(c){for(;k>j;j++)for(var m=1;l>m;m++)g.push(f(j)*m);g.push(f(j))}else for(g.push(f(j));j++<k;)for(var m=l-1;m>0;m--)g.push(f(j)*m);for(j=0;g[j]<h;j++);for(k=g.length;g[k-1]>i;k--);g=g.slice(j,k)}return g},g.tickFormat=function(a,c){if(!arguments.length)return Ai;arguments.length<2?c=Ai:"function"!=typeof c&&(c=jg.format(c));var d=Math.max(1,b*a/g.ticks().length);return function(a){var g=a/f(Math.round(e(a)));return b-.5>g*b&&(g*=b),d>=g?c(a):""}},g.copy=function(){return ef(a.copy(),b,c,d)},Ze(g,a)}function ff(a,b,c){function d(b){return a(e(b))}var e=gf(b),f=gf(1/b);return d.invert=function(b){return f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain((c=b.map(Number)).map(e)),d):c},d.ticks=function(a){return af(c,a)},d.tickFormat=function(a,b){return bf(c,a,b)},d.nice=function(a){return d.domain($e(c,a))},d.exponent=function(g){return arguments.length?(e=gf(b=g),f=gf(1/b),a.domain(c.map(e)),d):b},d.copy=function(){return ff(a.copy(),b,c)},Ze(d,a)}function gf(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function hf(a,b){function c(c){return f[((e.get(c)||("range"===b.t?e.set(c,a.push(c)):NaN))-1)%f.length]}function d(b,c){return jg.range(a.length).map(function(a){return b+c*a})}var e,f,g;return c.domain=function(d){if(!arguments.length)return a;a=[],e=new l;for(var f,g=-1,h=d.length;++g<h;)e.has(f=d[g])||e.set(f,a.push(f));return c[b.t].apply(c,b.a)},c.range=function(a){return arguments.length?(f=a,g=0,b={t:"range",a:arguments},c):f},c.rangePoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=(i+j)/2,0):(j-i)/(a.length-1+h);return f=d(i+k*h/2,k),g=0,b={t:"rangePoints",a:arguments},c},c.rangeRoundPoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=j=Math.round((i+j)/2),0):(j-i)/(a.length-1+h)|0;return f=d(i+Math.round(k*h/2+(j-i-(a.length-1+h)*k)/2),k),g=0,b={t:"rangeRoundPoints",a:arguments},c},c.rangeBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=(l-k)/(a.length-h+2*i);return f=d(k+m*i,m),j&&f.reverse(),g=m*(1-h),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-h+2*i));return f=d(k+Math.round((l-k-(a.length-h)*m)/2),m),j&&f.reverse(),g=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return g},c.rangeExtent=function(){return Se(b.a[0])},c.copy=function(){return hf(a,b)},c.domain(a)}function jf(a,b){function c(){var c=0,e=b.length;for(h=[];++c<e;)h[c-1]=jg.quantile(a,c/e);return d}function d(a){return isNaN(a=+a)?void 0:b[jg.bisect(h,a)]}var h;return d.domain=function(b){return arguments.length?(a=b.map(f).filter(g).sort(e),c()):a},d.range=function(a){return arguments.length?(b=a,c()):b},d.quantiles=function(){return h},d.invertExtent=function(c){return c=b.indexOf(c),0>c?[NaN,NaN]:[c>0?h[c-1]:a[0],c<h.length?h[c]:a[a.length-1]]},d.copy=function(){return jf(a,b)},c()}function kf(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.invertExtent=function(b){return b=c.indexOf(b),b=0>b?NaN:b/f+a,[b,b+1/f]},d.copy=function(){return kf(a,b,c)},e()}function lf(a,b){function c(c){return c>=c?b[jg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return lf(a,b)},c}function mf(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return af(a,b)},b.tickFormat=function(b,c){return bf(a,b,c)},b.copy=function(){return mf(a)},b}function nf(){return 0}function of(a){return a.innerRadius}function pf(a){return a.outerRadius}function qf(a){return a.startAngle}function rf(a){return a.endAngle}function sf(a){return a&&a.padAngle}function tf(a,b,c,d){return(a-c)*b-(b-d)*a>0?0:1}function uf(a,b,c,d,e){var f=a[0]-b[0],g=a[1]-b[1],h=(e?d:-d)/Math.sqrt(f*f+g*g),i=h*g,j=-h*f,k=a[0]+i,l=a[1]+j,m=b[0]+i,n=b[1]+j,o=(k+m)/2,p=(l+n)/2,q=m-k,r=n-l,s=q*q+r*r,t=c-d,u=k*n-m*l,v=(0>r?-1:1)*Math.sqrt(Math.max(0,t*t*s-u*u)),w=(u*r-q*v)/s,x=(-u*q-r*v)/s,y=(u*r+q*v)/s,z=(-u*q+r*v)/s,A=w-o,B=x-p,C=y-o,D=z-p;return A*A+B*B>C*C+D*D&&(w=y,x=z),[[w-i,x-j],[w*c/t,x*c/t]]}function vf(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=Ca(c),o=Ca(d);++l<m;)e.call(this,i=b[l],l)?k.push([+n.call(this,i,l),+o.call(this,i,l)]):k.length&&(g(),k=[]);return k.length&&g(),j.length?j.join(""):null}var c=Ec,d=Fc,e=Fb,f=wf,g=f.key,h=.7;return b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d; 28 },b.defined=function(a){return arguments.length?(e=a,b):e},b.interpolate=function(a){return arguments.length?(g="function"==typeof a?f=a:(f=Hi.get(a)||wf).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function wf(a){return a.length>1?a.join("L"):a+"Z"}function xf(a){return a.join("L")+"Z"}function yf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d[0]+(d=a[b])[0])/2,"V",d[1]);return c>1&&e.push("H",d[0]),e.join("")}function zf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function Af(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function Bf(a,b){return a.length<4?wf(a):a[1]+Ef(a.slice(1,-1),Ff(a,b))}function Cf(a,b){return a.length<3?xf(a):a[0]+Ef((a.push(a[0]),a),Ff([a[a.length-2]].concat(a,[a[1]]),b))}function Df(a,b){return a.length<3?wf(a):a[0]+Ef(a,Ff(a,b))}function Ef(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return wf(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],i=2),b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+k[0]+","+k[1]}return d}function Ff(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,i=a.length;++h<i;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function Gf(a){if(a.length<3)return wf(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f,"L",Kf(Ki,g),",",Kf(Ki,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Lf(i,g,h);return a.pop(),i.push("L",d),i.join("")}function Hf(a){if(a.length<4)return wf(a);for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];++d<3;)b=a[d],f.push(b[0]),g.push(b[1]);for(c.push(Kf(Ki,f)+","+Kf(Ki,g)),--d;++d<e;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),Lf(c,f,g);return c.join("")}function If(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];++d<4;)c=a[d%e],g.push(c[0]),h.push(c[1]);for(b=[Kf(Ki,g),",",Kf(Ki,h)],--d;++d<f;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),Lf(b,g,h);return b.join("")}function Jf(a,b){var c=a.length-1;if(c)for(var d,e,f=a[0][0],g=a[0][1],h=a[c][0]-f,i=a[c][1]-g,j=-1;++j<=c;)d=a[j],e=j/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*i);return Gf(a)}function Kf(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Lf(a,b,c){a.push("C",Kf(Ii,b),",",Kf(Ii,c),",",Kf(Ji,b),",",Kf(Ji,c),",",Kf(Ki,b),",",Kf(Ki,c))}function Mf(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Nf(a){for(var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=Mf(e,f);++b<c;)d[b]=(g+(g=Mf(e=f,f=a[b+1])))/2;return d[b]=g,d}function Of(a){for(var b,c,d,e,f=[],g=Nf(a),h=-1,i=a.length-1;++h<i;)b=Mf(a[h],a[h+1]),vg(b)<Lg?g[h]=g[h+1]=0:(c=g[h]/b,d=g[h+1]/b,e=c*c+d*d,e>9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Pf(a){return a.length<3?wf(a):a[0]+Ef(a,Of(a))}function Qf(a){for(var b,c,d,e=-1,f=a.length;++e<f;)b=a[e],c=b[0],d=b[1]-Qg,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function Rf(a){function b(b){function i(){p.push("M",h(a(r),l),k,j(a(q.reverse()),l),"Z")}for(var m,n,o,p=[],q=[],r=[],s=-1,t=b.length,u=Ca(c),v=Ca(e),w=c===d?function(){return n}:Ca(d),x=e===f?function(){return o}:Ca(f);++s<t;)g.call(this,m=b[s],s)?(q.push([n=+u.call(this,m,s),o=+v.call(this,m,s)]),r.push([+w.call(this,m,s),+x.call(this,m,s)])):q.length&&(i(),q=[],r=[]);return q.length&&i(),p.length?p.join(""):null}var c=Ec,d=Ec,e=0,f=Fc,g=Fb,h=wf,i=h.key,j=h,k="L",l=.7;return b.x=function(a){return arguments.length?(c=d=a,b):d},b.x0=function(a){return arguments.length?(c=a,b):c},b.x1=function(a){return arguments.length?(d=a,b):d},b.y=function(a){return arguments.length?(e=f=a,b):f},b.y0=function(a){return arguments.length?(e=a,b):e},b.y1=function(a){return arguments.length?(f=a,b):f},b.defined=function(a){return arguments.length?(g=a,b):g},b.interpolate=function(a){return arguments.length?(i="function"==typeof a?h=a:(h=Hi.get(a)||wf).key,j=h.reverse||h,k=h.closed?"M":"L",b):i},b.tension=function(a){return arguments.length?(l=a,b):l},b}function Sf(a){return a.radius}function Tf(a){return[a.x,a.y]}function Uf(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]-Qg;return[c*Math.cos(d),c*Math.sin(d)]}}function Vf(){return 64}function Wf(){return"circle"}function Xf(a){var b=Math.sqrt(a/Ng);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+-b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function Yf(a){return function(){var b,c,d;(b=this[a])&&(d=b[c=b.active])&&(d.timer.c=null,d.timer.t=NaN,--b.count?delete b[c]:delete this[a],b.active+=.5,d.event&&d.event.interrupt.call(this,this.__data__,d.index))}}function Zf(a,b,c){return Ag(a,Ri),a.namespace=b,a.id=c,a}function $f(a,b,c,d){var e=a.id,f=a.namespace;return T(a,"function"==typeof c?function(a,g,h){a[f][e].tween.set(b,d(c.call(a,a.__data__,g,h)))}:(c=d(c),function(a){a[f][e].tween.set(b,c)}))}function _f(a){return null==a&&(a=""),function(){this.textContent=a}}function ag(a){return null==a?"__transition__":"__transition_"+a+"__"}function bg(a,b,c,d,e){function f(a){var b=p.delay;return j.t=b+i,a>=b?g(a-b):void(j.c=g)}function g(c){var e=o.active,f=o[e];f&&(f.timer.c=null,f.timer.t=NaN,--o.count,delete o[e],f.event&&f.event.interrupt.call(a,a.__data__,f.index));for(var g in o)if(d>+g){var l=o[g];l.timer.c=null,l.timer.t=NaN,--o.count,delete o[g]}j.c=h,Ha(function(){return j.c&&h(c||1)&&(j.c=null,j.t=NaN),1},0,i),o.active=d,p.event&&p.event.start.call(a,a.__data__,b),n=[],p.tween.forEach(function(c,d){(d=d.call(a,a.__data__,b))&&n.push(d)}),m=p.ease,k=p.duration}function h(e){for(var f=e/k,g=m(f),h=n.length;h>0;)n[--h].call(a,g);return f>=1?(p.event&&p.event.end.call(a,a.__data__,b),--o.count?delete o[d]:delete a[c],1):void 0}var i,j,k,m,n,o=a[c]||(a[c]={active:0,count:0}),p=o[d];p||(i=e.time,j=Ha(f,0,i),p=o[d]={tween:new l,time:i,timer:j,delay:e.delay,duration:e.duration,ease:e.ease,index:b},e=null,++o.count)}function cg(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate("+(isFinite(d)?d:c(a))+",0)"})}function dg(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate(0,"+(isFinite(d)?d:c(a))+")"})}function eg(a){return a.toISOString()}function fg(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=jg.bisect($i,e);return f==$i.length?[b.year,_e(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/$i[f-1]<$i[f]/e?f-1:f]:[bj,_e(a,c)[2]]}return d.invert=function(b){return gg(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(gg)},d.nice=function(a,b){function c(c){return!isNaN(c)&&!a.range(c,gg(+c+1),b).length}var f=d.domain(),g=Se(f),h=null==a?e(g,10):"number"==typeof a&&e(g,a);return h&&(a=h[0],b=h[1]),d.domain(Ve(f,b>1?{floor:function(b){for(;c(b=a.floor(b));)b=gg(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=gg(+b+1);return b}}:a))},d.ticks=function(a,b){var c=Se(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],gg(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return fg(a.copy(),b,c)},Ze(d,a)}function gg(a){return new Date(a)}function hg(a){return JSON.parse(a.responseText)}function ig(a){var b=mg.createRange();return b.selectNode(mg.body),b.createContextualFragment(a.responseText)}var jg={version:"3.5.13"},kg=[].slice,lg=function(a){return kg.call(a)},mg=this.document;if(mg)try{lg(mg.documentElement.childNodes)[0].nodeType}catch(ng){lg=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}if(Date.now||(Date.now=function(){return+new Date}),mg)try{mg.createElement("DIV").style.setProperty("opacity",0,"")}catch(og){var pg=this.Element.prototype,qg=pg.setAttribute,rg=pg.setAttributeNS,sg=this.CSSStyleDeclaration.prototype,tg=sg.setProperty;pg.setAttribute=function(a,b){qg.call(this,a,b+"")},pg.setAttributeNS=function(a,b,c){rg.call(this,a,b,c+"")},sg.setProperty=function(a,b,c){tg.call(this,a,b+"",c)}}jg.ascending=e,jg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:NaN},jg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c},jg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c},jg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f<g;)if(null!=(d=a[f])&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;++f<g;)if(null!=(d=b.call(a,a[f],f))&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]},jg.sum=function(a,b){var c,d=0,e=a.length,f=-1;if(1===arguments.length)for(;++f<e;)g(c=+a[f])&&(d+=c);else for(;++f<e;)g(c=+b.call(a,a[f],f))&&(d+=c);return d},jg.mean=function(a,b){var c,d=0,e=a.length,h=-1,i=e;if(1===arguments.length)for(;++h<e;)g(c=f(a[h]))?d+=c:--i;else for(;++h<e;)g(c=f(b.call(a,a[h],h)))?d+=c:--i;return i?d/i:void 0},jg.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1],f=c-d;return f?e+f*(a[d]-e):e},jg.median=function(a,b){var c,d=[],h=a.length,i=-1;if(1===arguments.length)for(;++i<h;)g(c=f(a[i]))&&d.push(c);else for(;++i<h;)g(c=f(b.call(a,a[i],i)))&&d.push(c);return d.length?jg.quantile(d.sort(e),.5):void 0},jg.variance=function(a,b){var c,d,e=a.length,h=0,i=0,j=-1,k=0;if(1===arguments.length)for(;++j<e;)g(c=f(a[j]))&&(d=c-h,h+=d/++k,i+=d*(c-h));else for(;++j<e;)g(c=f(b.call(a,a[j],j)))&&(d=c-h,h+=d/++k,i+=d*(c-h));return k>1?i/(k-1):void 0},jg.deviation=function(){var a=jg.variance.apply(this,arguments);return a?Math.sqrt(a):a};var ug=h(e);jg.bisectLeft=ug.left,jg.bisect=jg.bisectRight=ug.right,jg.bisector=function(a){return h(1===a.length?function(b,c){return e(a(b),c)}:a)},jg.shuffle=function(a,b,c){(f=arguments.length)<3&&(c=a.length,2>f&&(b=0));for(var d,e,f=c-b;f;)e=Math.random()*f--|0,d=a[f+b],a[f+b]=a[e+b],a[e+b]=d;return a},jg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},jg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},jg.zip=function(){if(!(d=arguments.length))return[];for(var a=-1,b=jg.min(arguments,i),c=new Array(b);++a<b;)for(var d,e=-1,f=c[a]=new Array(d);++e<d;)f[e]=arguments[e][a];return c},jg.transpose=function(a){return jg.zip.apply(jg,a)},jg.keys=function(a){var b=[];for(var c in a)b.push(c);return b},jg.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},jg.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},jg.merge=function(a){for(var b,c,d,e=a.length,f=-1,g=0;++f<e;)g+=a[f].length;for(c=new Array(g);--e>=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var vg=Math.abs;jg.range=function(a,b,c){if(arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0)),(b-a)/c===1/0)throw new Error("infinite range");var d,e=[],f=j(vg(c)),g=-1;if(a*=f,b*=f,c*=f,0>c)for(;(d=a+c*++g)>b;)e.push(d/f);else for(;(d=a+c*++g)<b;)e.push(d/f);return e},jg.map=function(a,b){var c=new l;if(a instanceof l)a.forEach(function(a,b){c.set(a,b)});else if(Array.isArray(a)){var d,e=-1,f=a.length;if(1===arguments.length)for(;++e<f;)c.set(e,a[e]);else for(;++e<f;)c.set(b.call(a,d=a[e],e),d)}else for(var g in a)c.set(g,a[g]);return c};var wg="__proto__",xg="\x00";k(l,{has:o,get:function(a){return this._[m(a)]},set:function(a,b){return this._[m(a)]=b},remove:p,keys:q,values:function(){var a=[];for(var b in this._)a.push(this._[b]);return a},entries:function(){var a=[];for(var b in this._)a.push({key:n(b),value:this._[b]});return a},size:r,empty:s,forEach:function(a){for(var b in this._)a.call(this,n(b),this._[b])}}),jg.nest=function(){function a(b,g,h){if(h>=f.length)return d?d.call(e,g):c?g.sort(c):g;for(var i,j,k,m,n=-1,o=g.length,p=f[h++],q=new l;++n<o;)(m=q.get(i=p(j=g[n])))?m.push(j):q.set(i,[j]);return b?(j=b(),k=function(c,d){j.set(c,a(b,d,h))}):(j={},k=function(c,d){j[c]=a(b,d,h)}),q.forEach(k),j}function b(a,c){if(c>=f.length)return a;var d=[],e=g[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},f=[],g=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(jg.map,c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return g[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},jg.set=function(a){var b=new t;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},k(t,{has:o,add:function(a){return this._[m(a+="")]=!0,a},remove:p,values:q,size:r,empty:s,forEach:function(a){for(var b in this._)a.call(this,n(b))}}),jg.behavior={},jg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d<e;)a[c=arguments[d]]=v(a,b,b[c]);return a};var yg=["webkit","ms","moz","Moz","o","O"];jg.dispatch=function(){for(var a=new y,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=z(a);return a},y.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.slice(c+1),a=a.slice(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},jg.event=null,jg.requote=function(a){return a.replace(zg,"\\$&")};var zg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ag={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},Bg=function(a,b){return b.querySelector(a)},Cg=function(a,b){return b.querySelectorAll(a)},Dg=function(a,b){var c=a.matches||a[w(a,"matchesSelector")];return(Dg=function(a,b){return c.call(a,b)})(a,b)};"function"==typeof Sizzle&&(Bg=function(a,b){return Sizzle(a,b)[0]||null},Cg=Sizzle,Dg=Sizzle.matchesSelector),jg.selection=function(){return jg.select(mg.documentElement)};var Eg=jg.selection.prototype=[];Eg.select=function(a){var b,c,d,e,f=[];a=E(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=-1,j=d.length;++i<j;)(e=d[i])?(b.push(c=a.call(e,e.__data__,i,g)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return D(f)},Eg.selectAll=function(a){var b,c,d=[];a=F(a);for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)(c=g[h])&&(d.push(b=lg(a.call(c,c.__data__,h,e))),b.parentNode=c);return D(d)};var Fg={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};jg.ns={prefix:Fg,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&"xmlns"!==(c=a.slice(0,b))&&(a=a.slice(b+1)),Fg.hasOwnProperty(c)?{space:Fg[c],local:a}:a}},Eg.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=jg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(G(b,a[b]));return this}return this.each(G(a,b))},Eg.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=J(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!I(a[e]).test(b))return!1;return!0}for(b in a)this.each(K(b,a[b]));return this}return this.each(K(a,b))},Eg.style=function(a,b,c){var e=arguments.length;if(3>e){if("string"!=typeof a){2>e&&(b="");for(c in a)this.each(M(c,a[c],b));return this}if(2>e){var f=this.node();return d(f).getComputedStyle(f,null).getPropertyValue(a)}c=""}return this.each(M(a,b,c))},Eg.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(N(b,a[b]));return this}return this.each(N(a,b))},Eg.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},Eg.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},Eg.append=function(a){return a=O(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},Eg.insert=function(a,b){return a=O(a),b=E(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},Eg.remove=function(){return this.each(P)},Eg.data=function(a,b){function c(a,c){var d,e,f,g=a.length,k=c.length,m=Math.min(g,k),n=new Array(k),o=new Array(k),p=new Array(g);if(b){var q,r=new l,s=new Array(g);for(d=-1;++d<g;)(e=a[d])&&(r.has(q=b.call(e,e.__data__,d))?p[d]=e:r.set(q,e),s[d]=q);for(d=-1;++d<k;)(e=r.get(q=b.call(c,f=c[d],d)))?e!==!0&&(n[d]=e,e.__data__=f):o[d]=Q(f),r.set(q,!0);for(d=-1;++d<g;)d in s&&r.get(s[d])!==!0&&(p[d]=a[d])}else{for(d=-1;++d<m;)e=a[d],f=c[d],e?(e.__data__=f,n[d]=e):o[d]=Q(f);for(;k>d;++d)o[d]=Q(c[d]);for(;g>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,h.push(o),i.push(n),j.push(p)}var d,e,f=-1,g=this.length;if(!arguments.length){for(a=new Array(g=(d=this[0]).length);++f<g;)(e=d[f])&&(a[f]=e.__data__);return a}var h=U([]),i=D([]),j=D([]);if("function"==typeof a)for(;++f<g;)c(d=this[f],a.call(d,d.parentNode.__data__,f));else for(;++f<g;)c(d=this[f],a);return i.enter=function(){return h},i.exit=function(){return j},i},Eg.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},Eg.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=R(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return D(e)},Eg.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},Eg.sort=function(a){a=S.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},Eg.each=function(a){return T(this,function(b,c,d){a.call(b,b.__data__,c,d)})},Eg.call=function(a){var b=lg(arguments);return a.apply(b[0]=this,b),this},Eg.empty=function(){return!this.node()},Eg.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},Eg.size=function(){var a=0;return T(this,function(){++a}),a};var Gg=[];jg.selection.enter=U,jg.selection.enter.prototype=Gg,Gg.append=Eg.append,Gg.empty=Eg.empty,Gg.node=Eg.node,Gg.call=Eg.call,Gg.size=Eg.size,Gg.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++h<i;){d=(e=this[h]).update,g.push(b=[]),b.parentNode=e.parentNode;for(var j=-1,k=e.length;++j<k;)(f=e[j])?(b.push(d[j]=c=a.call(e.parentNode,f.__data__,j,h)),c.__data__=f.__data__):b.push(null)}return D(g)},Gg.insert=function(a,b){return arguments.length<2&&(b=V(this)),Eg.insert.call(this,a,b)},jg.select=function(a){var c;return"string"==typeof a?(c=[Bg(a,mg)],c.parentNode=mg.documentElement):(c=[a],c.parentNode=b(a)),D([c])},jg.selectAll=function(a){var b;return"string"==typeof a?(b=lg(Cg(a,mg)),b.parentNode=mg.documentElement):(b=lg(a),b.parentNode=null),D([b])},Eg.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(W(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(W(a,b,c))};var Hg=jg.map({mouseenter:"mouseover",mouseleave:"mouseout"});mg&&Hg.forEach(function(a){"on"+a in mg&&Hg.remove(a)});var Ig,Jg=0;jg.mouse=function(a){return $(a,B())};var Kg=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;jg.touch=function(a,b,c){if(arguments.length<3&&(c=b,b=B().changedTouches),b)for(var d,e=0,f=b.length;f>e;++e)if((d=b[e]).identifier===c)return $(a,d)},jg.behavior.drag=function(){function a(){this.on("mousedown.drag",f).on("touchstart.drag",g)}function b(a,b,d,f,g){return function(){function h(){var a,c,d=b(m,p);d&&(a=d[0]-t[0],c=d[1]-t[1],o|=a|c,t=d,n({type:"drag",x:d[0]+j[0],y:d[1]+j[1],dx:a,dy:c}))}function i(){b(m,p)&&(r.on(f+q,null).on(g+q,null),s(o),n({type:"dragend"}))}var j,k=this,l=jg.event.target,m=k.parentNode,n=c.of(k,arguments),o=0,p=a(),q=".drag"+(null==p?"":"-"+p),r=jg.select(d(l)).on(f+q,h).on(g+q,i),s=Z(l),t=b(m,p);e?(j=e.apply(k,arguments),j=[j.x-t[0],j.y-t[1]]):j=[0,0],n({type:"dragstart"})}}var c=C(a,"drag","dragstart","dragend"),e=null,f=b(x,jg.mouse,d,"mousemove","mouseup"),g=b(_,jg.touch,u,"touchmove","touchend");return a.origin=function(b){return arguments.length?(e=b,a):e},jg.rebind(a,c,"on")},jg.touches=function(a,b){return arguments.length<2&&(b=B().touches),b?lg(b).map(function(b){var c=$(a,b);return c.identifier=b.identifier,c}):[]};var Lg=1e-6,Mg=Lg*Lg,Ng=Math.PI,Og=2*Ng,Pg=Og-Lg,Qg=Ng/2,Rg=Ng/180,Sg=180/Ng,Tg=Math.SQRT2,Ug=2,Vg=4;jg.interpolateZoom=function(a,b){var c,d,e=a[0],f=a[1],g=a[2],h=b[0],i=b[1],j=b[2],k=h-e,l=i-f,m=k*k+l*l;if(Mg>m)d=Math.log(j/g)/Tg,c=function(a){return[e+a*k,f+a*l,g*Math.exp(Tg*a*d)]};else{var n=Math.sqrt(m),o=(j*j-g*g+Vg*m)/(2*g*Ug*n),p=(j*j-g*g-Vg*m)/(2*j*Ug*n),q=Math.log(Math.sqrt(o*o+1)-o),r=Math.log(Math.sqrt(p*p+1)-p);d=(r-q)/Tg,c=function(a){var b=a*d,c=fa(q),h=g/(Ug*n)*(c*ga(Tg*b+q)-ea(q));return[e+h*k,f+h*l,g*c/fa(Tg*b+q)]}}return c.duration=1e3*d,c},jg.behavior.zoom=function(){function a(a){a.on(F,l).on(Xg+".zoom",n).on("dblclick.zoom",o).on(I,m)}function b(a){return[(a[0]-y.x)/y.k,(a[1]-y.y)/y.k]}function c(a){return[a[0]*y.k+y.x,a[1]*y.k+y.y]}function e(a){y.k=Math.max(B[0],Math.min(B[1],a))}function f(a,b){b=c(b),y.x+=a[0]-b[0],y.y+=a[1]-b[1]}function g(b,c,d,g){b.__chart__={x:y.x,y:y.y,k:y.k},e(Math.pow(2,g)),f(q=c,d),b=jg.select(b),D>0&&(b=b.transition().duration(D)),b.call(a.event)}function h(){v&&v.domain(u.range().map(function(a){return(a-y.x)/y.k}).map(u.invert)),x&&x.domain(w.range().map(function(a){return(a-y.y)/y.k}).map(w.invert))}function i(a){E++||a({type:"zoomstart"})}function j(a){h(),a({type:"zoom",scale:y.k,translate:[y.x,y.y]})}function k(a){--E||(a({type:"zoomend"}),q=null)}function l(){function a(){h=1,f(jg.mouse(e),m),j(g)}function c(){l.on(G,null).on(H,null),n(h),k(g)}var e=this,g=J.of(e,arguments),h=0,l=jg.select(d(e)).on(G,a).on(H,c),m=b(jg.mouse(e)),n=Z(e);Qi.call(e),i(g)}function m(){function a(){var a=jg.touches(o);return n=y.k,a.forEach(function(a){a.identifier in q&&(q[a.identifier]=b(a))}),a}function c(){var b=jg.event.target;jg.select(b).on(u,d).on(v,h),w.push(b);for(var c=jg.event.changedTouches,e=0,f=c.length;f>e;++e)q[c[e].identifier]=null;var i=a(),j=Date.now();if(1===i.length){if(500>j-t){var k=i[0];g(o,k,q[k.identifier],Math.floor(Math.log(y.k)/Math.LN2)+1),A()}t=j}else if(i.length>1){var k=i[0],l=i[1],m=k[0]-l[0],n=k[1]-l[1];r=m*m+n*n}}function d(){var a,b,c,d,g=jg.touches(o);Qi.call(o);for(var h=0,i=g.length;i>h;++h,d=null)if(c=g[h],d=q[c.identifier]){if(b)break;a=c,b=d}if(d){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=r&&Math.sqrt(k/r);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+d[0])/2,(b[1]+d[1])/2],e(l*n)}t=null,f(a,b),j(p)}function h(){if(jg.event.touches.length){for(var b=jg.event.changedTouches,c=0,d=b.length;d>c;++c)delete q[b[c].identifier];for(var e in q)return void a()}jg.selectAll(w).on(s,null),x.on(F,l).on(I,m),z(),k(p)}var n,o=this,p=J.of(o,arguments),q={},r=0,s=".zoom-"+jg.event.changedTouches[0].identifier,u="touchmove"+s,v="touchend"+s,w=[],x=jg.select(o),z=Z(o);c(),i(p),x.on(F,null).on(I,c)}function n(){var a=J.of(this,arguments);s?clearTimeout(s):(Qi.call(this),p=b(q=r||jg.mouse(this)),i(a)),s=setTimeout(function(){s=null,k(a)},50),A(),e(Math.pow(2,.002*Wg())*y.k),f(q,p),j(a)}function o(){var a=jg.mouse(this),c=Math.log(y.k)/Math.LN2;g(this,a,b(a),jg.event.shiftKey?Math.ceil(c)-1:Math.floor(c)+1)}var p,q,r,s,t,u,v,w,x,y={x:0,y:0,k:1},z=[960,500],B=Yg,D=250,E=0,F="mousedown.zoom",G="mousemove.zoom",H="mouseup.zoom",I="touchstart.zoom",J=C(a,"zoomstart","zoom","zoomend");return Xg||(Xg="onwheel"in mg?(Wg=function(){return-jg.event.deltaY*(jg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in mg?(Wg=function(){return jg.event.wheelDelta},"mousewheel"):(Wg=function(){return-jg.event.detail},"MozMousePixelScroll")),a.event=function(a){a.each(function(){var a=J.of(this,arguments),b=y;Oi?jg.select(this).transition().each("start.zoom",function(){y=this.__chart__||{x:0,y:0,k:1},i(a)}).tween("zoom:zoom",function(){var c=z[0],d=z[1],e=q?q[0]:c/2,f=q?q[1]:d/2,g=jg.interpolateZoom([(e-y.x)/y.k,(f-y.y)/y.k,c/y.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),h=c/d[2];this.__chart__=y={x:e-d[0]*h,y:f-d[1]*h,k:h},j(a)}}).each("interrupt.zoom",function(){k(a)}).each("end.zoom",function(){k(a)}):(this.__chart__=y,i(a),j(a),k(a))})},a.translate=function(b){return arguments.length?(y={x:+b[0],y:+b[1],k:y.k},h(),a):[y.x,y.y]},a.scale=function(b){return arguments.length?(y={x:y.x,y:y.y,k:null},e(+b),h(),a):y.k},a.scaleExtent=function(b){return arguments.length?(B=null==b?Yg:[+b[0],+b[1]],a):B},a.center=function(b){return arguments.length?(r=b&&[+b[0],+b[1]],a):r},a.size=function(b){return arguments.length?(z=b&&[+b[0],+b[1]],a):z},a.duration=function(b){return arguments.length?(D=+b,a):D},a.x=function(b){return arguments.length?(v=b,u=b.copy(),y={x:0,y:0,k:1},a):v},a.y=function(b){return arguments.length?(x=b,w=b.copy(),y={x:0,y:0,k:1},a):x},jg.rebind(a,J,"on")};var Wg,Xg,Yg=[0,1/0];jg.color=ia,ia.prototype.toString=function(){return this.rgb()+""},jg.hsl=ja;var Zg=ja.prototype=new ia;Zg.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new ja(this.h,this.s,this.l/a)},Zg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ja(this.h,this.s,a*this.l)},Zg.rgb=function(){return ka(this.h,this.s,this.l)},jg.hcl=la;var $g=la.prototype=new ia;$g.brighter=function(a){return new la(this.h,this.c,Math.min(100,this.l+_g*(arguments.length?a:1)))},$g.darker=function(a){return new la(this.h,this.c,Math.max(0,this.l-_g*(arguments.length?a:1)))},$g.rgb=function(){return ma(this.h,this.c,this.l).rgb()},jg.lab=na;var _g=18,ah=.95047,bh=1,ch=1.08883,dh=na.prototype=new ia;dh.brighter=function(a){return new na(Math.min(100,this.l+_g*(arguments.length?a:1)),this.a,this.b)},dh.darker=function(a){return new na(Math.max(0,this.l-_g*(arguments.length?a:1)),this.a,this.b)},dh.rgb=function(){return oa(this.l,this.a,this.b)},jg.rgb=ta;var eh=ta.prototype=new ia;eh.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),new ta(Math.min(255,b/a),Math.min(255,c/a),Math.min(255,d/a))):new ta(e,e,e)},eh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ta(a*this.r,a*this.g,a*this.b)},eh.hsl=function(){return ya(this.r,this.g,this.b)},eh.toString=function(){return"#"+wa(this.r)+wa(this.g)+wa(this.b)};var fh=jg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});fh.forEach(function(a,b){fh.set(a,ua(b))}),jg.functor=Ca,jg.xhr=Da(u),jg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=Ea(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),i=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=j)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++<j;)if(34===a.charCodeAt(c)){if(34!==a.charCodeAt(c+1))break;++c}k=c+2;var d=a.charCodeAt(c+1);return 13===d?(e=!0,10===a.charCodeAt(c+2)&&++k):10===d&&(e=!0),a.slice(b+1,c).replace(/""/g,'"')}for(;j>k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==i)continue;return a.slice(b,k-h)}return a.slice(b)}for(var d,e,f={},g={},h=[],j=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();b&&null==(m=b(m,l++))||h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new t,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(g).join(a)].concat(b.map(function(b){return e.map(function(a){return g(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c},jg.csv=jg.dsv(",","text/csv"),jg.tsv=jg.dsv(" ","text/tab-separated-values");var gh,hh,ih,jh,kh=this[w(this,"requestAnimationFrame")]||function(a){setTimeout(a,17)};jg.timer=function(){ 29 Ha.apply(this,arguments)},jg.timer.flush=function(){Ja(),Ka()},jg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var lh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ma);jg.formatPrefix=function(a,b){var c=0;return(a=+a)&&(0>a&&(a*=-1),b&&(a=jg.round(a,La(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c-1)/3)))),lh[8+c/3]};var mh=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,nh=jg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=jg.round(a,La(a,b))).toFixed(Math.max(0,Math.min(20,La(a*(1+1e-15),b))))}}),oh=jg.time={},ph=Date;Pa.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){qh.setUTCDate.apply(this._,arguments)},setDay:function(){qh.setUTCDay.apply(this._,arguments)},setFullYear:function(){qh.setUTCFullYear.apply(this._,arguments)},setHours:function(){qh.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){qh.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){qh.setUTCMinutes.apply(this._,arguments)},setMonth:function(){qh.setUTCMonth.apply(this._,arguments)},setSeconds:function(){qh.setUTCSeconds.apply(this._,arguments)},setTime:function(){qh.setTime.apply(this._,arguments)}};var qh=Date.prototype;oh.year=Qa(function(a){return a=oh.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),oh.years=oh.year.range,oh.years.utc=oh.year.utc.range,oh.day=Qa(function(a){var b=new ph(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),oh.days=oh.day.range,oh.days.utc=oh.day.utc.range,oh.dayOfYear=function(a){var b=oh.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(a,b){b=7-b;var c=oh[a]=Qa(function(a){return(a=oh.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=oh.year(a).getDay();return Math.floor((oh.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});oh[a+"s"]=c.range,oh[a+"s"].utc=c.utc.range,oh[a+"OfYear"]=function(a){var c=oh.year(a).getDay();return Math.floor((oh.dayOfYear(a)+(c+b)%7)/7)}}),oh.week=oh.sunday,oh.weeks=oh.sunday.range,oh.weeks.utc=oh.sunday.utc.range,oh.weekOfYear=oh.sundayOfYear;var rh={"-":"",_:" ",0:"0"},sh=/^\s*\d+/,th=/^%/;jg.locale=function(a){return{numberFormat:Na(a),timeFormat:Sa(a)}};var uh=jg.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});jg.format=uh.numberFormat,jg.geo={},lb.prototype={s:0,t:0,add:function(a){mb(a,this.t,vh),mb(vh.s,this.s,this),this.s?this.t+=vh.t:this.s=vh.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vh=new lb;jg.geo.stream=function(a,b){a&&wh.hasOwnProperty(a.type)?wh[a.type](a,b):nb(a,b)};var wh={Feature:function(a,b){nb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++d<e;)nb(c[d].geometry,b)}},xh={Sphere:function(a,b){b.sphere()},Point:function(a,b){a=a.coordinates,b.point(a[0],a[1],a[2])},MultiPoint:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)a=c[d],b.point(a[0],a[1],a[2])},LineString:function(a,b){ob(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)ob(c[d],b,0)},Polygon:function(a,b){pb(a.coordinates,b)},MultiPolygon:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)pb(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;++d<e;)nb(c[d],b)}};jg.geo.area=function(a){return yh=0,jg.geo.stream(a,Ah),yh};var yh,zh=new lb,Ah={sphere:function(){yh+=4*Ng},point:x,lineStart:x,lineEnd:x,polygonStart:function(){zh.reset(),Ah.lineStart=qb},polygonEnd:function(){var a=2*zh;yh+=0>a?4*Ng+a:a,Ah.lineStart=Ah.lineEnd=Ah.point=x}};jg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=rb([b*Rg,c*Rg]);if(r){var e=tb(r,d),f=[e[1],-e[0],0],g=tb(f,e);wb(g),g=xb(g);var i=b-o,j=i>0?1:-1,p=g[0]*Sg*j,q=vg(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Sg;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Sg;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=vg(d)>180?d+(d>0?360:-360):d}else p=a,q=c;Ah.point(a,c),b(a,c)}function f(){Ah.lineStart()}function g(){e(p,q),Ah.lineEnd(),vg(s)>Lg&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a<b[0]||b[1]<a}var k,l,m,n,o,p,q,r,s,t,u,v={point:a,lineStart:c,lineEnd:d,polygonStart:function(){v.point=e,v.lineStart=f,v.lineEnd=g,s=0,Ah.polygonStart()},polygonEnd:function(){Ah.polygonEnd(),v.point=a,v.lineStart=c,v.lineEnd=d,0>zh?(k=-(m=180),l=-(n=90)):s>Lg?n=90:-Lg>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],jg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-(1/0),b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,k===1/0||l===1/0?[[NaN,NaN],[NaN,NaN]]:[[k,l],[m,n]]}}(),jg.geo.centroid=function(a){Bh=Ch=Dh=Eh=Fh=Gh=Hh=Ih=Jh=Kh=Lh=0,jg.geo.stream(a,Mh);var b=Jh,c=Kh,d=Lh,e=b*b+c*c+d*d;return Mg>e&&(b=Gh,c=Hh,d=Ih,Lg>Ch&&(b=Dh,c=Eh,d=Fh),e=b*b+c*c+d*d,Mg>e)?[NaN,NaN]:[Math.atan2(c,b)*Sg,da(d/Math.sqrt(e))*Sg]};var Bh,Ch,Dh,Eh,Fh,Gh,Hh,Ih,Jh,Kh,Lh,Mh={sphere:x,point:zb,lineStart:Bb,lineEnd:Cb,polygonStart:function(){Mh.lineStart=Db},polygonEnd:function(){Mh.lineStart=Bb}},Nh=Jb(Fb,Nb,Pb,[-Ng,-Ng/2]),Oh=1e9;jg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=Tb(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(jg.geo.conicEqualArea=function(){return Ub(Vb)}).raw=Vb,jg.geo.albers=function(){return jg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},jg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=jg.geo.albers(),g=jg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=jg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Lg,l+.12*j+Lg],[k-.214*j-Lg,l+.234*j-Lg]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Lg,l+.166*j+Lg],[k-.115*j-Lg,l+.234*j-Lg]]).stream(i).point,a},a.scale(1070)};var Ph,Qh,Rh,Sh,Th,Uh,Vh={point:x,lineStart:x,lineEnd:x,polygonStart:function(){Qh=0,Vh.lineStart=Wb},polygonEnd:function(){Vh.lineStart=Vh.lineEnd=Vh.point=x,Ph+=vg(Qh/2)}},Wh={point:Xb,lineStart:x,lineEnd:x,polygonStart:x,polygonEnd:x},Xh={point:$b,lineStart:_b,lineEnd:ac,polygonStart:function(){Xh.lineStart=bc},polygonEnd:function(){Xh.point=$b,Xh.lineStart=_b,Xh.lineEnd=ac}};jg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),jg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Ph=0,jg.geo.stream(a,e(Vh)),Ph},a.centroid=function(a){return Dh=Eh=Fh=Gh=Hh=Ih=Jh=Kh=Lh=0,jg.geo.stream(a,e(Xh)),Lh?[Jh/Lh,Kh/Lh]:Ih?[Gh/Ih,Hh/Ih]:Fh?[Dh/Fh,Eh/Fh]:[NaN,NaN]},a.bounds=function(a){return Th=Uh=-(Rh=Sh=1/0),jg.geo.stream(a,e(Wh)),[[Rh,Sh],[Th,Uh]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||ec(a):u,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new Yb:new cc(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(jg.geo.albersUsa()).context(null)},jg.geo.transform=function(a){return{stream:function(b){var c=new fc(b);for(var d in a)c[d]=a[d];return c}}},fc.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},jg.geo.projection=hc,jg.geo.projectionMutator=ic,(jg.geo.equirectangular=function(){return hc(kc)}).raw=kc.invert=kc,jg.geo.rotation=function(a){function b(b){return b=a(b[0]*Rg,b[1]*Rg),b[0]*=Sg,b[1]*=Sg,b}return a=mc(a[0]%360*Rg,a[1]*Rg,a.length>2?a[2]*Rg:0),b.invert=function(b){return b=a.invert(b[0]*Rg,b[1]*Rg),b[0]*=Sg,b[1]*=Sg,b},b},lc.invert=kc,jg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=mc(-a[0]*Rg,-a[1]*Rg,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Sg,a[1]*=Sg}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=qc((b=+d)*Rg,e*Rg),a):b},a.precision=function(d){return arguments.length?(c=qc(b*Rg,(e=+d)*Rg),a):e},a.angle(90)},jg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Rg,e=a[1]*Rg,f=b[1]*Rg,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},jg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return jg.range(Math.ceil(f/q)*q,e,q).map(m).concat(jg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(jg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return vg(a%q)>Lg}).map(k)).concat(jg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return vg(a%r)>Lg}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=sc(h,g,90),l=tc(d,c,s),m=sc(j,i,90),n=tc(f,e,s),a):s},a.majorExtent([[-180,-90+Lg],[180,90-Lg]]).minorExtent([[-180,-80-Lg],[180,80+Lg]])},jg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=uc,e=vc;return a.distance=function(){return jg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},jg.geo.interpolate=function(a,b){return wc(a[0]*Rg,a[1]*Rg,b[0]*Rg,b[1]*Rg)},jg.geo.length=function(a){return Yh=0,jg.geo.stream(a,Zh),Yh};var Yh,Zh={sphere:x,point:x,lineStart:xc,lineEnd:x,polygonStart:x,polygonEnd:x},$h=yc(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(jg.geo.azimuthalEqualArea=function(){return hc($h)}).raw=$h;var _h=yc(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},u);(jg.geo.azimuthalEquidistant=function(){return hc(_h)}).raw=_h,(jg.geo.conicConformal=function(){return Ub(zc)}).raw=zc,(jg.geo.conicEquidistant=function(){return Ub(Ac)}).raw=Ac;var ai=yc(function(a){return 1/a},Math.atan);(jg.geo.gnomonic=function(){return hc(ai)}).raw=ai,Bc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Qg]},(jg.geo.mercator=function(){return Cc(Bc)}).raw=Bc;var bi=yc(function(){return 1},Math.asin);(jg.geo.orthographic=function(){return hc(bi)}).raw=bi;var ci=yc(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(jg.geo.stereographic=function(){return hc(ci)}).raw=ci,Dc.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Qg]},(jg.geo.transverseMercator=function(){var a=Cc(Dc),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[a[1],-a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},c([0,0,90])}).raw=Dc,jg.geom={},jg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e=Ca(c),f=Ca(d),g=a.length,h=[],i=[];for(b=0;g>b;b++)h.push([+e.call(this,a[b],b),+f.call(this,a[b],b),b]);for(h.sort(Hc),b=0;g>b;b++)i.push([h[b][0],-h[b][1]]);var j=Gc(h),k=Gc(i),l=k[0]===j[0],m=k[k.length-1]===j[j.length-1],n=[];for(b=j.length-1;b>=0;--b)n.push(a[h[j[b]][2]]);for(b=+l;b<k.length-m;++b)n.push(a[h[k[b]][2]]);return n}var c=Ec,d=Fc;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},jg.geom.polygon=function(a){return Ag(a,di),a};var di=jg.geom.polygon.prototype=[];di.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b<c;)a=d,d=this[b],e+=a[1]*d[0]-a[0]*d[1];return.5*e},di.centroid=function(a){var b,c,d=-1,e=this.length,f=0,g=0,h=this[e-1];for(arguments.length||(a=-1/(6*this.area()));++d<e;)b=h,h=this[d],c=b[0]*h[1]-h[0]*b[1],f+=(b[0]+h[0])*c,g+=(b[1]+h[1])*c;return[f*a,g*a]},di.clip=function(a){for(var b,c,d,e,f,g,h=Kc(a),i=-1,j=this.length-Kc(this),k=this[j-1];++i<j;){for(b=a.slice(),a.length=0,e=this[i],f=b[(d=b.length-h)-1],c=-1;++c<d;)g=b[c],Ic(g,k,e)?(Ic(f,k,e)||a.push(Jc(f,g,k,e)),a.push(g)):Ic(f,k,e)&&a.push(Jc(f,g,k,e)),f=g;h&&a.push(a[0]),k=e}return a};var ei,fi,gi,hi,ii,ji=[],ki=[];Sc.prototype.prepare=function(){for(var a,b=this.edges,c=b.length;c--;)a=b[c].edge,a.b&&a.a||b.splice(c,1);return b.sort(Uc),b.length},cd.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},dd.prototype={insert:function(a,b){var c,d,e;if(a){if(b.P=a,b.N=a.N,a.N&&(a.N.P=b),a.N=b,a.R){for(a=a.R;a.L;)a=a.L;a.L=b}else a.R=b;c=a}else this._?(a=hd(this._),b.P=null,b.N=a,a.P=a.L=b,c=a):(b.P=b.N=null,this._=b,c=null);for(b.L=b.R=null,b.U=c,b.C=!0,a=b;c&&c.C;)d=c.U,c===d.L?(e=d.R,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.R&&(fd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,gd(this,d))):(e=d.L,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.L&&(gd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,fd(this,d))),c=a.U;this._.C=!1},remove:function(a){a.N&&(a.N.P=a.P),a.P&&(a.P.N=a.N),a.N=a.P=null;var b,c,d,e=a.U,f=a.L,g=a.R;if(c=f?g?hd(g):f:g,e?e.L===a?e.L=c:e.R=c:this._=c,f&&g?(d=c.C,c.C=a.C,c.L=f,f.U=c,c!==g?(e=c.U,c.U=a.U,a=c.R,e.L=a,c.R=g,g.U=c):(c.U=e,e=c,a=c.R)):(d=a.C,a=c),a&&(a.U=e),!d){if(a&&a.C)return void(a.C=!1);do{if(a===this._)break;if(a===e.L){if(b=e.R,b.C&&(b.C=!1,e.C=!0,fd(this,e),b=e.R),b.L&&b.L.C||b.R&&b.R.C){b.R&&b.R.C||(b.L.C=!1,b.C=!0,gd(this,b),b=e.R),b.C=e.C,e.C=b.R.C=!1,fd(this,e),a=this._;break}}else if(b=e.L,b.C&&(b.C=!1,e.C=!0,gd(this,e),b=e.L),b.L&&b.L.C||b.R&&b.R.C){b.L&&b.L.C||(b.R.C=!1,b.C=!0,fd(this,b),b=e.L),b.C=e.C,e.C=b.L.C=!1,gd(this,e),a=this._;break}b.C=!0,a=e,e=e.U}while(!a.C);a&&(a.C=!1)}}},jg.geom.voronoi=function(a){function b(a){var b=new Array(a.length),d=h[0][0],e=h[0][1],f=h[1][0],g=h[1][1];return id(c(a),h).cells.forEach(function(c,h){var i=c.edges,j=c.site,k=b[h]=i.length?i.map(function(a){var b=a.start();return[b.x,b.y]}):j.x>=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Lg)*Lg,y:Math.round(g(a,b)/Lg)*Lg,i:b}})}var d=Ec,e=Fc,f=d,g=e,h=li;return a?b(a):(b.links=function(a){return id(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return id(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(Uc),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i<j;)e=k,f=l,k=h[i].edge,l=k.l===g?k.r:k.l,d<f.i&&d<l.i&&kd(g,f,l)<0&&b.push([a[d],a[f.i],a[l.i]])}),b},b.x=function(a){return arguments.length?(f=Ca(d=a),b):d},b.y=function(a){return arguments.length?(g=Ca(e=a),b):e},b.clipExtent=function(a){return arguments.length?(h=null==a?li:a,b):h===li?null:h},b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===li?null:h&&h[1]},b)};var li=[[-1e6,-1e6],[1e6,1e6]];jg.geom.delaunay=function(a){return jg.geom.voronoi().triangles(a)},jg.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,f,g,h){if(!isNaN(c)&&!isNaN(d))if(a.leaf){var i=a.x,k=a.y;if(null!=i)if(vg(i-c)+vg(k-d)<.01)j(a,b,c,d,e,f,g,h);else{var l=a.point;a.x=a.y=a.point=null,j(a,l,i,k,e,f,g,h),j(a,b,c,d,e,f,g,h)}else a.x=c,a.y=d,a.point=b}else j(a,b,c,d,e,f,g,h)}function j(a,b,c,d,e,g,h,i){var j=.5*(e+h),k=.5*(g+i),l=c>=j,m=d>=k,n=m<<1|l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=nd()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=Ca(h),u=Ca(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.x<p&&(p=k.x),k.y<q&&(q=k.y),k.x>r&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=nd();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){od(a,z,p,q,r,s)},z.find=function(a){return pd(z,a[0],a[1],p,q,r,s)},n=-1,null==b){for(;++n<o;)f(z,a[n],l[n],m[n],p,q,r,s);--n}else a.forEach(z.add);return l=m=a=k=null,z}var g,h=Ec,i=Fc;return(g=arguments.length)?(h=ld,i=md,3===g&&(e=c,d=b,c=b=0),f(a)):(f.x=function(a){return arguments.length?(h=a,f):h},f.y=function(a){return arguments.length?(i=a,f):i},f.extent=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=+a[0][0],c=+a[0][1],d=+a[1][0],e=+a[1][1]),f):null==b?null:[[b,c],[d,e]]},f.size=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=c=0,d=+a[0],e=+a[1]),f):null==b?null:[d-b,e-c]},f)},jg.interpolateRgb=qd,jg.interpolateObject=rd,jg.interpolateNumber=sd,jg.interpolateString=td;var mi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ni=new RegExp(mi.source,"g");jg.interpolate=ud,jg.interpolators=[function(a,b){var c=typeof b;return("string"===c?fh.has(b.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(b)?qd:td:b instanceof ia?qd:Array.isArray(b)?vd:"object"===c&&isNaN(b)?rd:sd)(a,b)}],jg.interpolateArray=vd;var oi=function(){return u},pi=jg.map({linear:oi,poly:Cd,quad:function(){return zd},cubic:function(){return Ad},sin:function(){return Dd},exp:function(){return Ed},circle:function(){return Fd},elastic:Gd,back:Hd,bounce:function(){return Id}}),qi=jg.map({"in":u,out:xd,"in-out":yd,"out-in":function(a){return yd(xd(a))}});jg.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.slice(0,b):a,d=b>=0?a.slice(b+1):"in";return c=pi.get(c)||oi,d=qi.get(d)||u,wd(d(c.apply(null,kg.call(arguments,1))))},jg.interpolateHcl=Jd,jg.interpolateHsl=Kd,jg.interpolateLab=Ld,jg.interpolateRound=Md,jg.transform=function(a){var b=mg.createElementNS(jg.ns.prefix.svg,"g");return(jg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Nd(c?c.matrix:ri)})(a)},Nd.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ri={a:1,b:0,c:0,d:1,e:0,f:0};jg.interpolateTransform=Wd,jg.layout={},jg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c<d;)b.push(Zd(a[c]));return b}},jg.layout.chord=function(){function a(){var a,j,l,m,n,o={},p=[],q=jg.range(f),r=[];for(c=[],d=[],a=0,m=-1;++m<f;){for(j=0,n=-1;++n<f;)j+=e[m][n];p.push(j),r.push(jg.range(f)),a+=j}for(g&&q.sort(function(a,b){return g(p[a],p[b])}),h&&r.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})}),a=(Og-k*f)/a,j=0,m=-1;++m<f;){for(l=j,n=-1;++n<f;){var s=q[m],t=r[s][n],u=e[s][t],v=j,w=j+=u*a;o[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}d[s]={index:s,startAngle:l,endAngle:j,value:p[s]},j+=k}for(m=-1;++m<f;)for(n=m-1;++n<f;){var x=o[m+"-"+n],y=o[n+"-"+m];(x.value||y.value)&&c.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}i&&b()}function b(){c.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var c,d,e,f,g,h,i,j={},k=0;return j.matrix=function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,j):e},j.padding=function(a){return arguments.length?(k=a,c=d=null,j):k},j.sortGroups=function(a){return arguments.length?(g=a,c=d=null,j):g},j.sortSubgroups=function(a){return arguments.length?(h=a,c=null,j):h},j.sortChords=function(a){return arguments.length?(i=a,c&&b(),j):i},j.chords=function(){return c||a(),c},j.groups=function(){return d||a(),d},j},jg.layout.force=function(){function a(a){return function(b,c,d,e){if(b.point!==a){var f=b.cx-a.x,g=b.cy-a.y,h=e-c,i=f*f+g*g;if(i>h*h/r){if(p>i){var j=b.charge/i;a.px-=f*j,a.py-=g*j}return!0}if(b.point&&i&&p>i){var j=b.pointCharge/i;a.px-=f*j,a.py-=g*j}}return!b.charge}}function b(a){a.px=jg.event.x,a.py=jg.event.y,i.resume()}var c,d,e,f,g,h,i={},j=jg.dispatch("start","tick","end"),k=[1,1],l=.9,m=si,n=ti,o=-30,p=ui,q=.1,r=.64,s=[],t=[];return i.tick=function(){if((e*=.99)<.005)return c=null,j.end({type:"end",alpha:e=0}),!0;var b,d,i,m,n,p,r,u,v,w=s.length,x=t.length;for(d=0;x>d;++d)i=t[d],m=i.source,n=i.target,u=n.x-m.x,v=n.y-m.y,(p=u*u+v*v)&&(p=e*g[d]*((p=Math.sqrt(p))-f[d])/p,u*=p,v*=p,n.x-=u*(r=m.weight+n.weight?m.weight/(m.weight+n.weight):.5),n.y-=v*r,m.x+=u*(r=1-r),m.y+=v*r);if((r=e*q)&&(u=k[0]/2,v=k[1]/2,d=-1,r))for(;++d<w;)i=s[d],i.x+=(u-i.x)*r,i.y+=(v-i.y)*r;if(o)for(ee(b=jg.geom.quadtree(s),e,h),d=-1;++d<w;)(i=s[d]).fixed||b.visit(a(i));for(d=-1;++d<w;)i=s[d],i.fixed?(i.x=i.px,i.y=i.py):(i.x-=(i.px-(i.px=i.x))*l,i.y-=(i.py-(i.py=i.y))*l);j.tick({type:"tick",alpha:e})},i.nodes=function(a){return arguments.length?(s=a,i):s},i.links=function(a){return arguments.length?(t=a,i):t},i.size=function(a){return arguments.length?(k=a,i):k},i.linkDistance=function(a){return arguments.length?(m="function"==typeof a?a:+a,i):m},i.distance=i.linkDistance,i.linkStrength=function(a){return arguments.length?(n="function"==typeof a?a:+a,i):n},i.friction=function(a){return arguments.length?(l=+a,i):l},i.charge=function(a){return arguments.length?(o="function"==typeof a?a:+a,i):o},i.chargeDistance=function(a){return arguments.length?(p=a*a,i):Math.sqrt(p)},i.gravity=function(a){return arguments.length?(q=+a,i):q},i.theta=function(a){return arguments.length?(r=a*a,i):Math.sqrt(r)},i.alpha=function(a){return arguments.length?(a=+a,e?a>0?e=a:(c.c=null,c.t=NaN,c=null,j.end({type:"end",alpha:e=0})):a>0&&(j.start({type:"start",alpha:e=a}),c=Ha(i.tick)),i):e},i.start=function(){function a(a,d){if(!c){for(c=new Array(e),i=0;e>i;++i)c[i]=[];for(i=0;j>i;++i){var f=t[i];c[f.source.index].push(f.target),c[f.target.index].push(f.source)}}for(var g,h=c[b],i=-1,k=h.length;++i<k;)if(!isNaN(g=h[i][a]))return g;return Math.random()*d}var b,c,d,e=s.length,j=t.length,l=k[0],p=k[1];for(b=0;e>b;++b)(d=s[b]).index=b,d.weight=0;for(b=0;j>b;++b)d=t[b],"number"==typeof d.source&&(d.source=s[d.source]),"number"==typeof d.target&&(d.target=s[d.target]),++d.source.weight,++d.target.weight;for(b=0;e>b;++b)d=s[b],isNaN(d.x)&&(d.x=a("x",l)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(f=[],"function"==typeof m)for(b=0;j>b;++b)f[b]=+m.call(this,t[b],b);else for(b=0;j>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;j>b;++b)g[b]=+n.call(this,t[b],b);else for(b=0;j>b;++b)g[b]=n;if(h=[],"function"==typeof o)for(b=0;e>b;++b)h[b]=+o.call(this,s[b],b);else for(b=0;e>b;++b)h[b]=o;return i.resume()},i.resume=function(){return i.alpha(.1)},i.stop=function(){return i.alpha(0)},i.drag=function(){return d||(d=jg.behavior.drag().origin(u).on("dragstart.force",ae).on("drag.force",b).on("dragend.force",be)),arguments.length?void this.on("mouseover.force",ce).on("mouseout.force",de).call(d):d},jg.rebind(i,j,"on")};var si=20,ti=1,ui=1/0;jg.layout.hierarchy=function(){function a(e){var f,g=[e],h=[];for(e.depth=0;null!=(f=g.pop());)if(h.push(f),(j=c.call(a,f,f.depth))&&(i=j.length)){for(var i,j,k;--i>=0;)g.push(k=j[i]),k.parent=f,k.depth=f.depth+1;d&&(f.value=0),f.children=j}else d&&(f.value=+d.call(a,f,f.depth)||0),delete f.children;return he(e,function(a){var c,e;b&&(c=a.children)&&c.sort(b),d&&(e=a.parent)&&(e.value+=a.value)}),h}var b=ke,c=ie,d=je;return a.sort=function(c){return arguments.length?(b=c,a):b},a.children=function(b){return arguments.length?(c=b,a):c},a.value=function(b){return arguments.length?(d=b,a):d},a.revalue=function(b){return d&&(ge(b,function(a){a.children&&(a.value=0)}),he(b,function(b){var c;b.children||(b.value=+d.call(a,b,b.depth)||0),(c=b.parent)&&(c.value+=b.value)})),b},a},jg.layout.partition=function(){function a(b,c,d,e){var f=b.children;if(b.x=c,b.y=b.depth*e,b.dx=d,b.dy=e,f&&(g=f.length)){var g,h,i,j=-1;for(d=b.value?d/b.value:0;++j<g;)a(h=f[j],c,i=h.value*d,e),c+=i}}function b(a){var c=a.children,d=0;if(c&&(e=c.length))for(var e,f=-1;++f<e;)d=Math.max(d,b(c[f]));return 1+d}function c(c,f){var g=d.call(this,c,f);return a(g[0],0,e[0],e[1]/b(g[0])),g}var d=jg.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},fe(c,d)},jg.layout.pie=function(){function a(g){var h,i=g.length,j=g.map(function(c,d){return+b.call(a,c,d)}),k=+("function"==typeof d?d.apply(this,arguments):d),l=("function"==typeof e?e.apply(this,arguments):e)-k,m=Math.min(Math.abs(l)/i,+("function"==typeof f?f.apply(this,arguments):f)),n=m*(0>l?-1:1),o=jg.sum(j),p=o?(l-i*n)/o:0,q=jg.range(i),r=[];return null!=c&&q.sort(c===vi?function(a,b){return j[b]-j[a]}:function(a,b){return c(g[a],g[b])}),q.forEach(function(a){r[a]={data:g[a],value:h=j[a],startAngle:k,endAngle:k+=h*p+n,padAngle:m}}),r}var b=Number,c=vi,d=0,e=Og,f=0;return a.value=function(c){return arguments.length?(b=c,a):b},a.sort=function(b){return arguments.length?(c=b,a):c},a.startAngle=function(b){return arguments.length?(d=b,a):d},a.endAngle=function(b){return arguments.length?(e=b,a):e},a.padAngle=function(b){return arguments.length?(f=b,a):f},a};var vi={};jg.layout.stack=function(){function a(h,i){if(!(m=h.length))return h;var j=h.map(function(c,d){return b.call(a,c,d)}),k=j.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,b,c)]})}),l=c.call(a,k,i);j=jg.permute(j,l),k=jg.permute(k,l);var m,n,o,p,q=d.call(a,k,i),r=j[0].length;for(o=0;r>o;++o)for(e.call(a,j[0][o],p=q[o],k[0][o][1]),n=1;m>n;++n)e.call(a,j[n][o],p+=k[n-1][o][1],k[n][o][1]);return h}var b=u,c=pe,d=qe,e=oe,f=me,g=ne;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:wi.get(b)||pe,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:xi.get(b)||qe,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var wi=jg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(re),f=a.map(se),g=jg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return jg.range(a.length).reverse()},"default":pe}),xi=jg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand: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;e>b;b++)d+=a[b][c][1];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},zero:qe});jg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f<n;)g=i[f]=[],g.dx=l[f+1]-(g.x=l[f]),g.y=0;if(n>0)for(f=-1;++f<m;)h=j[f],h>=k[0]&&h<=k[1]&&(g=i[jg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=we,e=ue;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Ca(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return ve(a,b)}:Ca(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},jg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,he(h,function(a){a.r=+k(a.value)}),he(h,Be), 30 d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;he(h,function(a){a.r+=l}),he(h,Be),he(h,function(a){a.r-=l})}return Ee(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=jg.layout.hierarchy().sort(xe),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},fe(a,c)},jg.layout.tree=function(){function a(a,e){var k=g.call(this,a,e),l=k[0],m=b(l);if(he(m,c),m.parent.m=-m.z,ge(m,d),j)ge(l,f);else{var n=l,o=l,p=l;ge(l,function(a){a.x<n.x&&(n=a),a.x>o.x&&(o=a),a.depth>p.depth&&(p=a)});var q=h(n,o)/2-n.x,r=i[0]/(o.x+h(o,n)/2+q),s=i[1]/(p.depth||1);ge(l,function(a){a.x=(a.x+q)*r,a.y=a.depth*s})}return k}function b(a){for(var b,c={A:null,children:[a]},d=[c];null!=(b=d.pop());)for(var e,f=b.children,g=0,h=f.length;h>g;++g)d.push((f[g]=e={_:f[g],parent:b,children:(e=f[g].children)&&e.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:g}).a=e);return c.children[0]}function c(a){var b=a.children,c=a.parent.children,d=a.i?c[a.i-1]:null;if(b.length){Ke(a);var f=(b[0].z+b[b.length-1].z)/2;d?(a.z=d.z+h(a._,d._),a.m=a.z-f):a.z=f}else d&&(a.z=d.z+h(a._,d._));a.parent.A=e(a,d,a.parent.A||c[0])}function d(a){a._.x=a.z+a.parent.m,a.m+=a.parent.m}function e(a,b,c){if(b){for(var d,e=a,f=a,g=b,i=e.parent.children[0],j=e.m,k=f.m,l=g.m,m=i.m;g=Ie(g),e=He(e),g&&e;)i=He(i),f=Ie(f),f.a=a,d=g.z+l-e.z-j+h(g._,e._),d>0&&(Je(Le(g,a,c),a,d),j+=d,k+=d),l+=g.m,j+=e.m,m+=i.m,k+=f.m;g&&!Ie(f)&&(f.t=g,f.m+=l-k),e&&!He(i)&&(i.t=e,i.m+=j-m,c=a)}return c}function f(a){a.x*=i[0],a.y=a.depth*i[1]}var g=jg.layout.hierarchy().sort(null).value(null),h=Ge,i=[1,1],j=null;return a.separation=function(b){return arguments.length?(h=b,a):h},a.size=function(b){return arguments.length?(j=null==(i=b)?f:null,a):j?null:i},a.nodeSize=function(b){return arguments.length?(j=null==(i=b)?null:f,a):j?i:null},fe(a,g)},jg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;he(i,function(a){var b=a.children;b&&b.length?(a.x=Ne(b),a.y=Me(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Oe(i),l=Pe(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return he(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=jg.layout.hierarchy().sort(null).value(null),c=Ge,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},fe(a,b)},jg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++e<f;)d=(c=a[e]).value*(0>b?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++g<h;)(c=a[g].area)&&(f>c&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++f<g;)e=a[f],e.x=h,e.y=j,e.dy=k,h+=e.dx=Math.min(c.x+c.dx-h,k?i(e.area/k):0);e.z=!0,e.dx+=c.x+c.dx-h,c.y+=k,c.dy-=k}else{for((d||k>c.dx)&&(k=c.dx);++f<g;)e=a[f],e.x=h,e.y=j,e.dx=k,j+=e.dy=Math.min(c.y+c.dy-j,k?i(e.area/k):0);e.z=!1,e.dy+=c.y+c.dy-j,c.x+=k,c.dx-=k}}function f(d){var e=g||h(d),f=e[0];return f.x=f.y=0,f.value?(f.dx=j[0],f.dy=j[1]):f.dx=f.dy=0,g&&h.revalue(f),a([f],f.dx*f.dy/f.value),(g?c:b)(f),m&&(g=e),e}var g,h=jg.layout.hierarchy(),i=Math.round,j=[1,1],k=null,l=Qe,m=!1,n="squarify",o=.5*(1+Math.sqrt(5));return f.size=function(a){return arguments.length?(j=a,f):j},f.padding=function(a){function b(b){var c=a.call(f,b,b.depth);return null==c?Qe(b):Re(b,"number"==typeof c?[c,c,c,c]:c)}function c(b){return Re(b,a)}if(!arguments.length)return k;var d;return l=null==(k=a)?Qe:"function"==(d=typeof a)?b:"number"===d?(a=[a,a,a,a],c):c,f},f.round=function(a){return arguments.length?(i=a?Math.round:Number,f):i!=Number},f.sticky=function(a){return arguments.length?(m=a,g=null,f):m},f.ratio=function(a){return arguments.length?(o=a,f):o},f.mode=function(a){return arguments.length?(n=a+"",f):n},fe(f,h)},jg.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=jg.random.normal.apply(jg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=jg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},jg.scale={};var yi={floor:u,ceil:u};jg.scale.linear=function(){return Ye([0,1],[0,1],ud,!1)};var zi={s:1,g:1,p:1,r:1,e:1};jg.scale.log=function(){return ef(jg.scale.linear().domain([0,1]),10,!0,[1,10])};var Ai=jg.format(".0e"),Bi={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};jg.scale.pow=function(){return ff(jg.scale.linear(),1,[0,1])},jg.scale.sqrt=function(){return jg.scale.pow().exponent(.5)},jg.scale.ordinal=function(){return hf([],{t:"range",a:[[]]})},jg.scale.category10=function(){return jg.scale.ordinal().range(Ci)},jg.scale.category20=function(){return jg.scale.ordinal().range(Di)},jg.scale.category20b=function(){return jg.scale.ordinal().range(Ei)},jg.scale.category20c=function(){return jg.scale.ordinal().range(Fi)};var Ci=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(va),Di=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(va),Ei=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(va),Fi=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(va);jg.scale.quantile=function(){return jf([],[])},jg.scale.quantize=function(){return kf(0,1,[0,1])},jg.scale.threshold=function(){return lf([.5],[0,1])},jg.scale.identity=function(){return mf([0,1])},jg.svg={},jg.svg.arc=function(){function a(){var a=Math.max(0,+c.apply(this,arguments)),j=Math.max(0,+d.apply(this,arguments)),k=g.apply(this,arguments)-Qg,l=h.apply(this,arguments)-Qg,m=Math.abs(l-k),n=k>l?0:1;if(a>j&&(o=j,j=a,a=o),m>=Pg)return b(j,n)+(a?b(a,1-n):"")+"Z";var o,p,q,r,s,t,u,v,w,x,y,z,A=0,B=0,C=[];if((r=(+i.apply(this,arguments)||0)/2)&&(q=f===Gi?Math.sqrt(a*a+j*j):+f.apply(this,arguments),n||(B*=-1),j&&(B=da(q/j*Math.sin(r))),a&&(A=da(q/a*Math.sin(r)))),j){s=j*Math.cos(k+B),t=j*Math.sin(k+B),u=j*Math.cos(l-B),v=j*Math.sin(l-B);var D=Math.abs(l-k-2*B)<=Ng?0:1;if(B&&tf(s,t,u,v)===n^D){var E=(k+l)/2;s=j*Math.cos(E),t=j*Math.sin(E),u=v=null}}else s=t=0;if(a){w=a*Math.cos(l-A),x=a*Math.sin(l-A),y=a*Math.cos(k+A),z=a*Math.sin(k+A);var F=Math.abs(k-l+2*A)<=Ng?0:1;if(A&&tf(w,x,y,z)===1-n^F){var G=(k+l)/2;w=a*Math.cos(G),x=a*Math.sin(G),y=z=null}}else w=x=0;if(m>Lg&&(o=Math.min(Math.abs(j-a)/2,+e.apply(this,arguments)))>.001){p=j>a^n?0:1;var H=o,I=o;if(Ng>m){var J=null==y?[w,x]:null==u?[s,t]:Jc([s,t],[y,z],[u,v],[w,x]),K=s-J[0],L=t-J[1],M=u-J[0],N=v-J[1],O=1/Math.sin(Math.acos((K*M+L*N)/(Math.sqrt(K*K+L*L)*Math.sqrt(M*M+N*N)))/2),P=Math.sqrt(J[0]*J[0]+J[1]*J[1]);I=Math.min(o,(a-P)/(O-1)),H=Math.min(o,(j-P)/(O+1))}if(null!=u){var Q=uf(null==y?[w,x]:[y,z],[s,t],j,H,n),R=uf([u,v],[w,x],j,H,n);o===H?C.push("M",Q[0],"A",H,",",H," 0 0,",p," ",Q[1],"A",j,",",j," 0 ",1-n^tf(Q[1][0],Q[1][1],R[1][0],R[1][1]),",",n," ",R[1],"A",H,",",H," 0 0,",p," ",R[0]):C.push("M",Q[0],"A",H,",",H," 0 1,",p," ",R[0])}else C.push("M",s,",",t);if(null!=y){var S=uf([s,t],[y,z],a,-I,n),T=uf([w,x],null==u?[s,t]:[u,v],a,-I,n);o===I?C.push("L",T[0],"A",I,",",I," 0 0,",p," ",T[1],"A",a,",",a," 0 ",n^tf(T[1][0],T[1][1],S[1][0],S[1][1]),",",1-n," ",S[1],"A",I,",",I," 0 0,",p," ",S[0]):C.push("L",T[0],"A",I,",",I," 0 0,",p," ",S[0])}else C.push("L",w,",",x)}else C.push("M",s,",",t),null!=u&&C.push("A",j,",",j," 0 ",D,",",n," ",u,",",v),C.push("L",w,",",x),null!=y&&C.push("A",a,",",a," 0 ",F,",",1-n," ",y,",",z);return C.push("Z"),C.join("")}function b(a,b){return"M0,"+a+"A"+a+","+a+" 0 1,"+b+" 0,"+-a+"A"+a+","+a+" 0 1,"+b+" 0,"+a}var c=of,d=pf,e=nf,f=Gi,g=qf,h=rf,i=sf;return a.innerRadius=function(b){return arguments.length?(c=Ca(b),a):c},a.outerRadius=function(b){return arguments.length?(d=Ca(b),a):d},a.cornerRadius=function(b){return arguments.length?(e=Ca(b),a):e},a.padRadius=function(b){return arguments.length?(f=b==Gi?Gi:Ca(b),a):f},a.startAngle=function(b){return arguments.length?(g=Ca(b),a):g},a.endAngle=function(b){return arguments.length?(h=Ca(b),a):h},a.padAngle=function(b){return arguments.length?(i=Ca(b),a):i},a.centroid=function(){var a=(+c.apply(this,arguments)+ +d.apply(this,arguments))/2,b=(+g.apply(this,arguments)+ +h.apply(this,arguments))/2-Qg;return[Math.cos(b)*a,Math.sin(b)*a]},a};var Gi="auto";jg.svg.line=function(){return vf(u)};var Hi=jg.map({linear:wf,"linear-closed":xf,step:yf,"step-before":zf,"step-after":Af,basis:Gf,"basis-open":Hf,"basis-closed":If,bundle:Jf,cardinal:Df,"cardinal-open":Bf,"cardinal-closed":Cf,monotone:Pf});Hi.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var Ii=[0,2/3,1/3,0],Ji=[0,1/3,2/3,0],Ki=[0,1/6,2/3,1/6];jg.svg.line.radial=function(){var a=vf(Qf);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},zf.reverse=Af,Af.reverse=zf,jg.svg.area=function(){return Rf(u)},jg.svg.area.radial=function(){var a=Rf(Qf);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},jg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)-Qg,k=j.call(a,e,d)-Qg;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Ng)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=uc,g=vc,h=Sf,i=qf,j=rf;return a.radius=function(b){return arguments.length?(h=Ca(b),a):h},a.source=function(b){return arguments.length?(f=Ca(b),a):f},a.target=function(b){return arguments.length?(g=Ca(b),a):g},a.startAngle=function(b){return arguments.length?(i=Ca(b),a):i},a.endAngle=function(b){return arguments.length?(j=Ca(b),a):j},a},jg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=uc,c=vc,d=Tf;return a.source=function(c){return arguments.length?(b=Ca(c),a):b},a.target=function(b){return arguments.length?(c=Ca(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},jg.svg.diagonal.radial=function(){var a=jg.svg.diagonal(),b=Tf,c=a.projection;return a.projection=function(a){return arguments.length?c(Uf(b=a)):b},a},jg.svg.symbol=function(){function a(a,d){return(Li.get(b.call(this,a,d))||Xf)(c.call(this,a,d))}var b=Wf,c=Vf;return a.type=function(c){return arguments.length?(b=Ca(c),a):b},a.size=function(b){return arguments.length?(c=Ca(b),a):c},a};var Li=jg.map({circle:Xf,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Ni)),c=b*Ni;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Mi),c=b*Mi/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Mi),c=b*Mi/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});jg.svg.symbolTypes=Li.keys();var Mi=Math.sqrt(3),Ni=Math.tan(30*Rg);Eg.transition=function(a){for(var b,c,d=Oi||++Si,e=ag(a),f=[],g=Pi||{time:Date.now(),ease:Bd,delay:0,duration:250},h=-1,i=this.length;++h<i;){f.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(c=j[k])&&bg(c,k,e,d,g),b.push(c)}return Zf(f,e,d)},Eg.interrupt=function(a){return this.each(null==a?Qi:Yf(ag(a)))};var Oi,Pi,Qi=Yf(ag()),Ri=[],Si=0;Ri.call=Eg.call,Ri.empty=Eg.empty,Ri.node=Eg.node,Ri.size=Eg.size,jg.transition=function(a,b){return a&&a.transition?Oi?a.transition(b):a:jg.selection().transition(a)},jg.transition.prototype=Ri,Ri.select=function(a){var b,c,d,e=this.id,f=this.namespace,g=[];a=E(a);for(var h=-1,i=this.length;++h<i;){g.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(d=j[k])&&(c=a.call(d,d.__data__,k,h))?("__data__"in d&&(c.__data__=d.__data__),bg(c,k,f,e,d[f][e]),b.push(c)):b.push(null)}return Zf(g,f,e)},Ri.selectAll=function(a){var b,c,d,e,f,g=this.id,h=this.namespace,i=[];a=F(a);for(var j=-1,k=this.length;++j<k;)for(var l=this[j],m=-1,n=l.length;++m<n;)if(d=l[m]){f=d[h][g],c=a.call(d,d.__data__,m,j),i.push(b=[]);for(var o=-1,p=c.length;++o<p;)(e=c[o])&&bg(e,o,h,g,f),b.push(e)}return Zf(i,h,g)},Ri.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=R(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return Zf(e,this.namespace,this.id)},Ri.tween=function(a,b){var c=this.id,d=this.namespace;return arguments.length<2?this.node()[d][c].tween.get(a):T(this,null==b?function(b){b[d][c].tween.remove(a)}:function(e){e[d][c].tween.set(a,b)})},Ri.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?Wd:ud,h=jg.ns.qualify(a);return $f(this,"attr."+a,b,h.local?f:e)},Ri.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=jg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Ri.style=function(a,b,c){function e(){this.style.removeProperty(a)}function f(b){return null==b?e:(b+="",function(){var e,f=d(this).getComputedStyle(this,null).getPropertyValue(a);return f!==b&&(e=ud(f,b),function(b){this.style.setProperty(a,e(b),c)})})}var g=arguments.length;if(3>g){if("string"!=typeof a){2>g&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return $f(this,"style."+a,b,f)},Ri.styleTween=function(a,b,c){function e(e,f){var g=b.call(this,e,f,d(this).getComputedStyle(this,null).getPropertyValue(a));return g&&function(b){this.style.setProperty(a,g(b),c)}}return arguments.length<3&&(c=""),this.tween("style."+a,e)},Ri.text=function(a){return $f(this,"text",a,_f)},Ri.remove=function(){var a=this.namespace;return this.each("end.transition",function(){var b;this[a].count<2&&(b=this.parentNode)&&b.removeChild(this)})},Ri.ease=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].ease:("function"!=typeof a&&(a=jg.ease.apply(jg,arguments)),T(this,function(d){d[c][b].ease=a}))},Ri.delay=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].delay:T(this,"function"==typeof a?function(d,e,f){d[c][b].delay=+a.call(d,d.__data__,e,f)}:(a=+a,function(d){d[c][b].delay=a}))},Ri.duration=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].duration:T(this,"function"==typeof a?function(d,e,f){d[c][b].duration=Math.max(1,a.call(d,d.__data__,e,f))}:(a=Math.max(1,a),function(d){d[c][b].duration=a}))},Ri.each=function(a,b){var c=this.id,d=this.namespace;if(arguments.length<2){var e=Pi,f=Oi;try{Oi=c,T(this,function(b,e,f){Pi=b[d][c],a.call(b,b.__data__,e,f)})}finally{Pi=e,Oi=f}}else T(this,function(e){var f=e[d][c];(f.event||(f.event=jg.dispatch("start","end","interrupt"))).on(a,b)});return this},Ri.transition=function(){for(var a,b,c,d,e=this.id,f=++Si,g=this.namespace,h=[],i=0,j=this.length;j>i;i++){h.push(a=[]);for(var b=this[i],k=0,l=b.length;l>k;k++)(c=b[k])&&(d=c[g][e],bg(c,k,g,f,{time:d.time,ease:d.ease,delay:d.delay+d.duration,duration:d.duration})),a.push(c)}return Zf(h,g,f)},jg.svg.axis=function(){function a(a){a.each(function(){var a,j=jg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):u:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Lg),q=jg.transition(o.exit()).style("opacity",Lg).remove(),r=jg.transition(o.order()).style("opacity",1),s=Math.max(e,0)+g,t=Te(l),v=j.selectAll(".domain").data([0]),w=(v.enter().append("path").attr("class","domain"),jg.transition(v));p.append("line"),p.append("text");var x,y,z,A,B=p.select("line"),C=r.select("line"),D=o.select("text").text(n),E=p.select("text"),F=r.select("text"),G="top"===d||"left"===d?-1:1;if("bottom"===d||"top"===d?(a=cg,x="x",z="y",y="x2",A="y2",D.attr("dy",0>G?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+t[0]+","+G*f+"V0H"+t[1]+"V"+G*f)):(a=dg,x="y",z="x",y="y2",A="x2",D.attr("dy",".32em").style("text-anchor",0>G?"end":"start"),w.attr("d","M"+G*f+","+t[0]+"H0V"+t[1]+"H"+G*f)),B.attr(A,G*e),E.attr(z,G*s),C.attr(y,0).attr(A,G*e),F.attr(x,0).attr(z,G*s),l.rangeBand){var H=l,I=H.rangeBand()/2;k=l=function(a){return H(a)+I}}else k.rangeBand?k=l:q.call(a,l,k);p.call(a,k,l),r.call(a,l,l)})}var b,c=jg.scale.linear(),d=Ti,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Ui?b+"":Ti,a):d},a.ticks=function(){return arguments.length?(h=lg(arguments),a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Ti="bottom",Ui={top:1,right:1,bottom:1,left:1};jg.svg.brush=function(){function a(d){d.each(function(){var d=jg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",f).on("touchstart.brush",f),g=d.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),d.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=d.selectAll(".resize").data(p,u);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Vi[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var i,l=jg.transition(d),m=jg.transition(g);j&&(i=Te(j),m.attr("x",i[0]).attr("width",i[1]-i[0]),c(l)),k&&(i=Te(k),m.attr("y",i[0]).attr("height",i[1]-i[0]),e(l)),b(l)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+l[+/e$/.test(a)]+","+m[+/^s/.test(a)]+")"})}function c(a){a.select(".extent").attr("x",l[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function e(a){a.select(".extent").attr("y",m[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function f(){function f(){32==jg.event.keyCode&&(D||(t=null,F[0]-=l[1],F[1]-=m[1],D=2),A())}function p(){32==jg.event.keyCode&&2==D&&(F[0]+=l[1],F[1]+=m[1],D=0,A())}function q(){var a=jg.mouse(v),d=!1;u&&(a[0]+=u[0],a[1]+=u[1]),D||(jg.event.altKey?(t||(t=[(l[0]+l[1])/2,(m[0]+m[1])/2]),F[0]=l[+(a[0]<t[0])],F[1]=m[+(a[1]<t[1])]):t=null),B&&r(a,j,0)&&(c(y),d=!0),C&&r(a,k,1)&&(e(y),d=!0),d&&(b(y),x({type:"brush",mode:D?"move":"resize"}))}function r(a,b,c){var d,e,f=Te(b),i=f[0],j=f[1],k=F[c],p=c?m:l,q=p[1]-p[0];return D&&(i-=k,j-=q+k),d=(c?o:n)?Math.max(i,Math.min(j,a[c])):a[c],D?e=(d+=k)+q:(t&&(k=Math.max(i,Math.min(j,2*t[c]-d))),d>k?(e=d,d=k):e=k),p[0]!=d||p[1]!=e?(c?h=null:g=null,p[0]=d,p[1]=e,!0):void 0}function s(){q(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),jg.select("body").style("cursor",null),G.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),E(),x({type:"brushend"})}var t,u,v=this,w=jg.select(jg.event.target),x=i.of(v,arguments),y=jg.select(v),z=w.datum(),B=!/^(n|s)$/.test(z)&&j,C=!/^(e|w)$/.test(z)&&k,D=w.classed("extent"),E=Z(v),F=jg.mouse(v),G=jg.select(d(v)).on("keydown.brush",f).on("keyup.brush",p);if(jg.event.changedTouches?G.on("touchmove.brush",q).on("touchend.brush",s):G.on("mousemove.brush",q).on("mouseup.brush",s),y.interrupt().selectAll("*").interrupt(),D)F[0]=l[0]-F[0],F[1]=m[0]-F[1];else if(z){var H=+/w$/.test(z),I=+/^n/.test(z);u=[l[1-H]-F[0],m[1-I]-F[1]],F[0]=l[H],F[1]=m[I]}else jg.event.altKey&&(t=F.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),jg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),q()}var g,h,i=C(a,"brushstart","brush","brushend"),j=null,k=null,l=[0,0],m=[0,0],n=!0,o=!0,p=Wi[0];return a.event=function(a){a.each(function(){var a=i.of(this,arguments),b={x:l,y:m,i:g,j:h},c=this.__chart__||b;this.__chart__=b,Oi?jg.select(this).transition().each("start.brush",function(){g=c.i,h=c.j,l=c.x,m=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=vd(l,b.x),d=vd(m,b.y);return g=h=null,function(e){l=b.x=c(e),m=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){g=b.i,h=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(j=b,p=Wi[!j<<1|!k],a):j},a.y=function(b){return arguments.length?(k=b,p=Wi[!j<<1|!k],a):k},a.clamp=function(b){return arguments.length?(j&&k?(n=!!b[0],o=!!b[1]):j?n=!!b:k&&(o=!!b),a):j&&k?[n,o]:j?n:k?o:null},a.extent=function(b){var c,d,e,f,i;return arguments.length?(j&&(c=b[0],d=b[1],k&&(c=c[0],d=d[0]),g=[c,d],j.invert&&(c=j(c),d=j(d)),c>d&&(i=c,c=d,d=i),c==l[0]&&d==l[1]||(l=[c,d])),k&&(e=b[0],f=b[1],j&&(e=e[1],f=f[1]),h=[e,f],k.invert&&(e=k(e),f=k(f)),e>f&&(i=e,e=f,f=i),e==m[0]&&f==m[1]||(m=[e,f])),a):(j&&(g?(c=g[0],d=g[1]):(c=l[0],d=l[1],j.invert&&(c=j.invert(c),d=j.invert(d)),c>d&&(i=c,c=d,d=i))),k&&(h?(e=h[0],f=h[1]):(e=m[0],f=m[1],k.invert&&(e=k.invert(e),f=k.invert(f)),e>f&&(i=e,e=f,f=i))),j&&k?[[c,e],[d,f]]:j?[c,d]:k&&[e,f])},a.clear=function(){return a.empty()||(l=[0,0],m=[0,0],g=h=null),a},a.empty=function(){return!!j&&l[0]==l[1]||!!k&&m[0]==m[1]},jg.rebind(a,i,"on")};var Vi={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Wi=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xi=oh.format=uh.timeFormat,Yi=Xi.utc,Zi=Yi("%Y-%m-%dT%H:%M:%S.%LZ");Xi.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eg:Zi,eg.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},eg.toString=Zi.toString,oh.second=Qa(function(a){return new ph(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),oh.seconds=oh.second.range,oh.seconds.utc=oh.second.utc.range,oh.minute=Qa(function(a){return new ph(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),oh.minutes=oh.minute.range,oh.minutes.utc=oh.minute.utc.range,oh.hour=Qa(function(a){var b=a.getTimezoneOffset()/60;return new ph(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),oh.hours=oh.hour.range,oh.hours.utc=oh.hour.utc.range,oh.month=Qa(function(a){return a=oh.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),oh.months=oh.month.range,oh.months.utc=oh.month.utc.range;var $i=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],_i=[[oh.second,1],[oh.second,5],[oh.second,15],[oh.second,30],[oh.minute,1],[oh.minute,5],[oh.minute,15],[oh.minute,30],[oh.hour,1],[oh.hour,3],[oh.hour,6],[oh.hour,12],[oh.day,1],[oh.day,2],[oh.week,1],[oh.month,1],[oh.month,3],[oh.year,1]],aj=Xi.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Fb]]),bj={range:function(a,b,c){return jg.range(Math.ceil(a/c)*c,+b,c).map(gg)},floor:u,ceil:u};_i.year=oh.year,oh.scale=function(){return fg(jg.scale.linear(),_i,aj)};var cj=_i.map(function(a){return[a[0].utc,a[1]]}),dj=Yi.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Fb]]);cj.year=oh.year.utc,oh.scale.utc=function(){return fg(jg.scale.linear(),cj,dj)},jg.text=Da(function(a){return a.responseText}),jg.json=function(a,b){return Ea(a,"application/json",hg,b)},jg.html=function(a,b){return Ea(a,"text/html",ig,b)},jg.xml=Da(function(a){return a.responseXML}),"function"==typeof a&&a.amd?(this.d3=jg,a(jg)):"object"==typeof c&&c.exports?c.exports=jg:this.d3=jg}()},{}],71:[function(a,b,c){"use strict";function d(a,b){this.point=a,this.index=b}function e(a,b){for(var c=a.point,d=b.point,e=c.length,f=0;e>f;++f){var g=d[f]-c[f];if(g)return g}return 0}function f(a,b,c){if(1===a)return c?[[-1,0]]:[];var d=b.map(function(a,b){return[a[0],b]});d.sort(function(a,b){return a[0]-b[0]});for(var e=new Array(a-1),f=1;a>f;++f){var g=d[f-1],h=d[f];e[f-1]=[g[1],h[1]]}return c&&e.push([-1,e[0][1]],[e[a-1][1],-1]),e}function g(a,b){var c=a.length;if(0===c)return[];var g=a[0].length;if(1>g)return[];if(1===g)return f(c,a,b);for(var j=new Array(c),k=1,l=0;c>l;++l){for(var m=a[l],n=new Array(g+1),o=0,p=0;g>p;++p){var q=m[p];n[p]=q,o+=q*q}n[g]=o,j[l]=new d(n,l),k=Math.max(o,k)}i(j,e),c=j.length;for(var r=new Array(c+g+1),s=new Array(c+g+1),t=(g+1)*(g+1)*k,u=new Array(g+1),l=0;g>=l;++l)u[l]=0;u[g]=t,r[0]=u.slice(),s[0]=-1;for(var l=0;g>=l;++l){var n=u.slice();n[l]=1,r[l+1]=n,s[l+1]=-1}for(var l=0;c>l;++l){var v=j[l];r[l+g+1]=v.point,s[l+g+1]=v.index}var w=h(r,!1);if(w=b?w.filter(function(a){for(var b=0,c=0;g>=c;++c){var d=s[a[c]];if(0>d&&++b>=2)return!1;a[c]=d}return!0}):w.filter(function(a){for(var b=0;g>=b;++b){var c=s[a[b]];if(0>c)return!1;a[b]=c}return!0}),1&g)for(var l=0;l<w.length;++l){var v=w[l],n=v[0];v[0]=v[1],v[1]=n}return w}var h=a("incremental-convex-hull"),i=a("uniq");b.exports=g},{"incremental-convex-hull":191,uniq:234}],72:[function(a,b,c){"use strict";function d(a,b,c){var e=0|a[c];if(0>=e)return[];var f,g=new Array(e);if(c===a.length-1)for(f=0;e>f;++f)g[f]=b;else for(f=0;e>f;++f)g[f]=d(a,b,c+1);return g}function e(a,b){var c,d;for(c=new Array(a),d=0;a>d;++d)c[d]=b;return c}function f(a,b){switch("undefined"==typeof b&&(b=0),typeof a){case"number":if(a>0)return e(0|a,b);break;case"object":if("number"==typeof a.length)return d(a,b,0)}return[]}b.exports=f},{}],73:[function(b,c,d){(function(d,e){(function(){"use strict";function f(a){return"function"==typeof a||"object"==typeof a&&null!==a}function g(a){return"function"==typeof a}function h(a){return"object"==typeof a&&null!==a}function i(a){U=a}function j(a){Y=a}function k(){return function(){d.nextTick(p)}}function l(){return function(){T(p)}}function m(){var a=0,b=new _(p),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function n(){var a=new MessageChannel;return a.port1.onmessage=p,function(){a.port2.postMessage(0)}}function o(){return function(){setTimeout(p,1)}}function p(){for(var a=0;X>a;a+=2){var b=ca[a],c=ca[a+1];b(c),ca[a]=void 0,ca[a+1]=void 0}X=0}function q(){try{var a=b,c=a("vertx");return T=c.runOnLoop||c.runOnContext,l()}catch(d){return o()}}function r(){}function s(){return new TypeError("You cannot resolve a promise with itself")}function t(){return new TypeError("A promises callback cannot return that same promise.")}function u(a){try{return a.then}catch(b){return ga.error=b,ga}}function v(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function w(a,b,c){Y(function(a){var d=!1,e=v(c,b,function(c){d||(d=!0,b!==c?z(a,c):B(a,c))},function(b){d||(d=!0,C(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,C(a,e))},a)}function x(a,b){b._state===ea?B(a,b._result):b._state===fa?C(a,b._result):D(b,void 0,function(b){z(a,b)},function(b){C(a,b)})}function y(a,b){if(b.constructor===a.constructor)x(a,b);else{var c=u(b);c===ga?C(a,ga.error):void 0===c?B(a,b):g(c)?w(a,b,c):B(a,b)}}function z(a,b){a===b?C(a,s()):f(b)?y(a,b):B(a,b)}function A(a){a._onerror&&a._onerror(a._result),E(a)}function B(a,b){a._state===da&&(a._result=b,a._state=ea,0!==a._subscribers.length&&Y(E,a))}function C(a,b){a._state===da&&(a._state=fa,a._result=b,Y(A,a))}function D(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+ea]=c,e[f+fa]=d,0===f&&a._state&&Y(E,a)}function E(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?H(c,d,e,f):e(f);a._subscribers.length=0}}function F(){this.error=null}function G(a,b){try{return a(b)}catch(c){return ha.error=c,ha}}function H(a,b,c,d){var e,f,h,i,j=g(c);if(j){if(e=G(c,d),e===ha?(i=!0,f=e.error,e=null):h=!0,b===e)return void C(b,t())}else e=d,h=!0;b._state!==da||(j&&h?z(b,e):i?C(b,f):a===ea?B(b,e):a===fa&&C(b,e))}function I(a,b){try{b(function(b){z(a,b)},function(b){C(a,b)})}catch(c){C(a,c)}}function J(a,b){var c=this;c._instanceConstructor=a,c.promise=new a(r),c._validateInput(b)?(c._input=b,c.length=b.length,c._remaining=b.length,c._init(),0===c.length?B(c.promise,c._result):(c.length=c.length||0,c._enumerate(),0===c._remaining&&B(c.promise,c._result))):C(c.promise,c._validationError())}function K(a){return new ia(this,a).promise}function L(a){function b(a){z(e,a)}function c(a){C(e,a)}var d=this,e=new d(r);if(!W(a))return C(e,new TypeError("You must pass an array to race.")),e;for(var f=a.length,g=0;e._state===da&&f>g;g++)D(d.resolve(a[g]),void 0,b,c); 31 return e}function M(a){var b=this;if(a&&"object"==typeof a&&a.constructor===b)return a;var c=new b(r);return z(c,a),c}function N(a){var b=this,c=new b(r);return C(c,a),c}function O(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function P(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function Q(a){this._id=na++,this._state=void 0,this._result=void 0,this._subscribers=[],r!==a&&(g(a)||O(),this instanceof Q||P(),I(this,a))}function R(){var a;if("undefined"!=typeof e)a=e;else if("undefined"!=typeof self)a=self;else try{a=Function("return this")()}catch(b){throw new Error("polyfill failed because global object is unavailable in this environment")}var c=a.Promise;c&&"[object Promise]"===Object.prototype.toString.call(c.resolve())&&!c.cast||(a.Promise=oa)}var S;S=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var T,U,V,W=S,X=0,Y=({}.toString,function(a,b){ca[X]=a,ca[X+1]=b,X+=2,2===X&&(U?U(p):V())}),Z="undefined"!=typeof window?window:void 0,$=Z||{},_=$.MutationObserver||$.WebKitMutationObserver,aa="undefined"!=typeof d&&"[object process]"==={}.toString.call(d),ba="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ca=new Array(1e3);V=aa?k():_?m():ba?n():void 0===Z&&"function"==typeof b?q():o();var da=void 0,ea=1,fa=2,ga=new F,ha=new F;J.prototype._validateInput=function(a){return W(a)},J.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},J.prototype._init=function(){this._result=new Array(this.length)};var ia=J;J.prototype._enumerate=function(){for(var a=this,b=a.length,c=a.promise,d=a._input,e=0;c._state===da&&b>e;e++)a._eachEntry(d[e],e)},J.prototype._eachEntry=function(a,b){var c=this,d=c._instanceConstructor;h(a)?a.constructor===d&&a._state!==da?(a._onerror=null,c._settledAt(a._state,b,a._result)):c._willSettleAt(d.resolve(a),b):(c._remaining--,c._result[b]=a)},J.prototype._settledAt=function(a,b,c){var d=this,e=d.promise;e._state===da&&(d._remaining--,a===fa?C(e,c):d._result[b]=c),0===d._remaining&&B(e,d._result)},J.prototype._willSettleAt=function(a,b){var c=this;D(a,void 0,function(a){c._settledAt(ea,b,a)},function(a){c._settledAt(fa,b,a)})};var ja=K,ka=L,la=M,ma=N,na=0,oa=Q;Q.all=ja,Q.race=ka,Q.resolve=la,Q.reject=ma,Q._setScheduler=i,Q._setAsap=j,Q._asap=Y,Q.prototype={constructor:Q,then:function(a,b){var c=this,d=c._state;if(d===ea&&!a||d===fa&&!b)return this;var e=new this.constructor(r),f=c._result;if(d){var g=arguments[d-1];Y(function(){H(d,e,g,f)})}else D(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var pa=R,qa={Promise:oa,polyfill:pa};"function"==typeof a&&a.amd?a(function(){return qa}):"undefined"!=typeof c&&c.exports?c.exports=qa:"undefined"!=typeof this&&(this.ES6Promise=qa),pa()}).call(this)}).call(this,b("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:55}],74:[function(a,b,c){"use strict";function d(a){for(var b,c=a.length,d=0;c>d;d++)if(b=a.charCodeAt(d),(9>b||b>13)&&32!==b&&133!==b&&160!==b&&5760!==b&&6158!==b&&(8192>b||b>8205)&&8232!==b&&8233!==b&&8239!==b&&8287!==b&&8288!==b&&12288!==b&&65279!==b)return!1;return!0}b.exports=function(a){var b=typeof a;if("string"===b){var c=a;if(a=+a,0===a&&d(c))return!1}else if("number"!==b)return!1;return 1>a-a}},{}],75:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.gl=a,this.type=b,this.handle=c,this.length=d,this.usage=e}function e(a,b,c,d,e,f){var g=e.length*e.BYTES_PER_ELEMENT;if(0>f)return a.bufferData(b,e,d),g;if(g+f>c)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return a.bufferSubData(b,f,e),c}function f(a,b){for(var c=i.malloc(a.length,b),d=a.length,e=0;d>e;++e)c[e]=a[e];return c}function g(a,b){for(var c=1,d=b.length-1;d>=0;--d){if(b[d]!==c)return!1;c*=a[d]}return!0}function h(a,b,c,e){if(c=c||a.ARRAY_BUFFER,e=e||a.DYNAMIC_DRAW,c!==a.ARRAY_BUFFER&&c!==a.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(e!==a.DYNAMIC_DRAW&&e!==a.STATIC_DRAW&&e!==a.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var f=a.createBuffer(),g=new d(a,c,f,0,e);return g.update(b),g}var i=a("typedarray-pool"),j=a("ndarray-ops"),k=a("ndarray"),l=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],m=d.prototype;m.bind=function(){this.gl.bindBuffer(this.type,this.handle)},m.unbind=function(){this.gl.bindBuffer(this.type,null)},m.dispose=function(){this.gl.deleteBuffer(this.handle)},m.update=function(a,b){if("number"!=typeof b&&(b=-1),this.bind(),"object"==typeof a&&"undefined"!=typeof a.shape){var c=a.dtype;if(l.indexOf(c)<0&&(c="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var d=gl.getExtension("OES_element_index_uint");c=d&&"uint16"!==c?"uint32":"uint16"}if(c===a.dtype&&g(a.shape,a.stride))0===a.offset&&a.data.length===a.shape[0]?this.length=e(this.gl,this.type,this.length,this.usage,a.data,b):this.length=e(this.gl,this.type,this.length,this.usage,a.data.subarray(a.offset,a.shape[0]),b);else{var h=i.malloc(a.size,c),m=k(h,a.shape);j.assign(m,a),0>b?this.length=e(this.gl,this.type,this.length,this.usage,h,b):this.length=e(this.gl,this.type,this.length,this.usage,h.subarray(0,a.size),b),i.free(h)}}else if(Array.isArray(a)){var n;n=this.type===this.gl.ELEMENT_ARRAY_BUFFER?f(a,"uint16"):f(a,"float32"),0>b?this.length=e(this.gl,this.type,this.length,this.usage,n,b):this.length=e(this.gl,this.type,this.length,this.usage,n.subarray(0,a.length),b),i.free(n)}else if("object"==typeof a&&"number"==typeof a.length)this.length=e(this.gl,this.type,this.length,this.usage,a,b);else{if("number"!=typeof a&&void 0!==a)throw new Error("gl-buffer: Invalid data type");if(b>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");a=0|a,0>=a&&(a=1),this.gl.bufferData(this.type,0|a,this.usage),this.length=a}},b.exports=h},{ndarray:208,"ndarray-ops":207,"typedarray-pool":233}],76:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.shader=b,this.buffer=c,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.color=[0,0,0,1]}function e(a,b){var c=f(a.gl,i.vertex,i.fragment),e=g(a.gl),h=new d(a,c,e);return h.update(b),a.addObject(h),h}var f=a("gl-shader"),g=a("gl-buffer"),h=a("typedarray-pool"),i=a("./lib/shaders");b.exports=e;var j=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],k=d.prototype;k.draw=function(){var a=[1,0,0,0,1,0,0,0,1],b=[1,1];return function(){var c=this.plot,d=this.shader,e=this.buffer,f=this.bounds,g=this.numPoints,h=(this.color,c.gl),i=c.dataBox,k=c.viewBox,l=c.pixelRatio,m=f[2]-f[0],n=f[3]-f[1],o=i[2]-i[0],p=i[3]-i[1];a[0]=2*m/o,a[4]=2*n/p,a[6]=2*(f[0]-i[0])/o-1,a[7]=2*(f[1]-i[1])/p-1;var q=k[2]-k[0],r=k[3]-k[1];b[0]=2*l/q,b[1]=2*l/r,e.bind(),d.bind(),d.uniforms.viewTransform=a,d.uniforms.pixelScale=b,d.uniforms.color=this.color,d.attributes.position.pointer(h.FLOAT,!1,16,0),d.attributes.pixelOffset.pointer(h.FLOAT,!1,16,8),h.drawArrays(h.TRIANGLES,0,g*j.length)}}(),k.drawPick=function(a){return a},k.pick=function(a,b){return null},k.update=function(a){a=a||{};var b=a.positions||[],c=a.errors||[],d=1;"lineWidth"in a&&(d=+a.lineWidth);var e=5;"capSize"in a&&(e=+a.capSize),this.color=(a.color||[0,0,0,1]).slice();for(var f=this.bounds=[1/0,1/0,-(1/0),-(1/0)],g=this.numPoints=b.length>>1,i=0;g>i;++i){var k=b[2*i],l=b[2*i+1];f[0]=Math.min(k,f[0]),f[1]=Math.min(l,f[1]),f[2]=Math.max(k,f[2]),f[3]=Math.max(l,f[3])}f[2]===f[0]&&(f[2]+=1),f[3]===f[1]&&(f[3]+=1);for(var m=1/(f[2]-f[0]),n=1/(f[3]-f[1]),o=f[0],p=f[1],q=h.mallocFloat32(g*j.length*4),r=0,i=0;g>i;++i)for(var k=b[2*i],l=b[2*i+1],s=c[4*i],t=c[4*i+1],u=c[4*i+2],v=c[4*i+3],w=0;w<j.length;++w){var x=j[w],y=x[0],z=x[1];0>y?y*=s:y>0&&(y*=t),0>z?z*=u:z>0&&(z*=v),q[r++]=m*(k-o+y),q[r++]=n*(l-p+z),q[r++]=d*x[2]+(e+d)*x[4],q[r++]=d*x[3]+(e+d)*x[5]}this.buffer.update(q),h.free(q)},k.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.buffer.dispose()}},{"./lib/shaders":77,"gl-buffer":75,"gl-shader":154,"typedarray-pool":233}],77:[function(a,b,c){b.exports={vertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 pixelOffset;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvoid main() {\n vec3 scrPosition = viewTransform * vec3(position, 1);\n gl_Position = vec4(\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\n 0,\n scrPosition.z);\n}\n",fragment:"#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"}},{}],78:[function(a,b,c){"use strict";function d(a,b,c,d){this.gl=a,this.shader=d,this.buffer=b,this.vao=c,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function e(a,b){for(var c=0;3>c;++c)a[0][c]=Math.min(a[0][c],b[c]),a[1][c]=Math.max(a[1][c],b[c])}function f(a,b,c,d){for(var e=m[d],f=0;f<e.length;++f){var g=e[f];a.push(b[0],b[1],b[2],c[0],c[1],c[2],c[3],g[0],g[1],g[2])}return e.length}function g(a){var b=a.gl,c=h(b),e=i(b,[{buffer:c,type:b.FLOAT,size:3,offset:0,stride:40},{buffer:c,type:b.FLOAT,size:4,offset:12,stride:40},{buffer:c,type:b.FLOAT,size:3,offset:28,stride:40}]),f=j(b);f.attributes.position.location=0,f.attributes.color.location=1,f.attributes.offset.location=2;var g=new d(b,c,e,f);return g.update(a),g}b.exports=g;var h=a("gl-buffer"),i=a("gl-vao"),j=a("./shaders/index"),k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=d.prototype;l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.drawTransparent=l.draw=function(a){var b=this.gl,c=this.shader.uniforms;this.shader.bind();var d=c.view=a.view||k,e=c.projection=a.projection||k;c.model=a.model||k,c.clipBounds=this.clipBounds,c.opacity=this.opacity;var f=d[12],g=d[13],h=d[14],i=d[15],j=this.pixelRatio*(e[3]*f+e[7]*g+e[11]*h+e[15]*i)/b.drawingBufferHeight;this.vao.bind();for(var l=0;3>l;++l)b.lineWidth(this.lineWidth[l]),c.capSize=this.capSize[l]*j,b.drawArrays(b.LINES,this.lineOffset[l],this.lineCount[l]);this.vao.unbind()};var m=function(){for(var a=new Array(3),b=0;3>b;++b){for(var c=[],d=1;2>=d;++d)for(var e=-1;1>=e;e+=2){var f=(d+b)%3,g=[0,0,0];g[f]=e,c.push(g)}a[b]=c}return a}();l.update=function(a){a=a||{},"lineWidth"in a&&(this.lineWidth=a.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in a&&(this.capSize=a.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in a&&(this.opacity=a.opacity);var b=a.color||[[0,0,0],[0,0,0],[0,0,0]],c=a.position,d=a.error;if(Array.isArray(b[0])||(b=[b,b,b]),c&&d){var g=[],h=c.length,i=0;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.lineCount=[0,0,0];for(var j=0;3>j;++j){this.lineOffset[j]=i;a:for(var k=0;h>k;++k){for(var l=c[k],m=0;3>m;++m)if(isNaN(l[m])||!isFinite(l[m]))continue a;var n=d[k],o=b[j];if(Array.isArray(o[0])&&(o=b[k]),3===o.length&&(o=[o[0],o[1],o[2],1]),!isNaN(n[0][j])&&!isNaN(n[1][j])){if(n[0][j]<0){var p=l.slice();p[j]+=n[0][j],g.push(l[0],l[1],l[2],o[0],o[1],o[2],o[3],0,0,0,p[0],p[1],p[2],o[0],o[1],o[2],o[3],0,0,0),e(this.bounds,p),i+=2+f(g,p,o,j)}if(n[1][j]>0){var p=l.slice();p[j]+=n[1][j],g.push(l[0],l[1],l[2],o[0],o[1],o[2],o[3],0,0,0,p[0],p[1],p[2],o[0],o[1],o[2],o[3],0,0,0),e(this.bounds,p),i+=2+f(g,p,o,j)}}}this.lineCount[j]=i-this.lineOffset[j]}this.buffer.update(g)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":79,"gl-buffer":75,"gl-vao":189}],79:[function(a,b,c){"use strict";var d=a("gl-shader"),e="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}",f="#define GLSLIFY 1\nprecision mediump float;\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = opacity * fragColor;\n}";b.exports=function(a){return d(a,e,f,null,[{name:"position",type:"vec3"},{name:"offset",type:"vec3"},{name:"color",type:"vec4"}])}},{"gl-shader":154}],80:[function(a,b,c){"use strict";function d(a){var b=a.getParameter(a.FRAMEBUFFER_BINDING),c=a.getParameter(a.RENDERBUFFER_BINDING),d=a.getParameter(a.TEXTURE_BINDING_2D);return[b,c,d]}function e(a,b){a.bindFramebuffer(a.FRAMEBUFFER,b[0]),a.bindRenderbuffer(a.RENDERBUFFER,b[1]),a.bindTexture(a.TEXTURE_2D,b[2])}function f(a,b){var c=a.getParameter(b.MAX_COLOR_ATTACHMENTS_WEBGL);s=new Array(c+1);for(var d=0;c>=d;++d){for(var e=new Array(c),f=0;d>f;++f)e[f]=a.COLOR_ATTACHMENT0+f;for(var f=d;c>f;++f)e[f]=a.NONE;s[d]=e}}function g(a){switch(a){case o:throw new Error("gl-fbo: Framebuffer unsupported");case p:throw new Error("gl-fbo: Framebuffer incomplete attachment");case q:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case r:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(a,b,c,d,e,f){if(!d)return null;var g=n(a,b,c,e,d);return g.magFilter=a.NEAREST,g.minFilter=a.NEAREST,g.mipSamples=1,g.bind(),a.framebufferTexture2D(a.FRAMEBUFFER,f,a.TEXTURE_2D,g.handle,0),g}function i(a,b,c,d,e){var f=a.createRenderbuffer();return a.bindRenderbuffer(a.RENDERBUFFER,f),a.renderbufferStorage(a.RENDERBUFFER,d,b,c),a.framebufferRenderbuffer(a.FRAMEBUFFER,e,a.RENDERBUFFER,f),f}function j(a){var b=d(a.gl),c=a.gl,f=a.handle=c.createFramebuffer(),j=a._shape[0],k=a._shape[1],l=a.color.length,m=a._ext,n=a._useStencil,o=a._useDepth,p=a._colorType;c.bindFramebuffer(c.FRAMEBUFFER,f);for(var q=0;l>q;++q)a.color[q]=h(c,j,k,p,c.RGBA,c.COLOR_ATTACHMENT0+q);0===l?(a._color_rb=i(c,j,k,c.RGBA4,c.COLOR_ATTACHMENT0),m&&m.drawBuffersWEBGL(s[0])):l>1&&m.drawBuffersWEBGL(s[l]);var r=c.getExtension("WEBGL_depth_texture");r?n?a.depth=h(c,j,k,r.UNSIGNED_INT_24_8_WEBGL,c.DEPTH_STENCIL,c.DEPTH_STENCIL_ATTACHMENT):o&&(a.depth=h(c,j,k,c.UNSIGNED_SHORT,c.DEPTH_COMPONENT,c.DEPTH_ATTACHMENT)):o&&n?a._depth_rb=i(c,j,k,c.DEPTH_STENCIL,c.DEPTH_STENCIL_ATTACHMENT):o?a._depth_rb=i(c,j,k,c.DEPTH_COMPONENT16,c.DEPTH_ATTACHMENT):n&&(a._depth_rb=i(c,j,k,c.STENCIL_INDEX,c.STENCIL_ATTACHMENT));var t=c.checkFramebufferStatus(c.FRAMEBUFFER);if(t!==c.FRAMEBUFFER_COMPLETE){a._destroyed=!0,c.bindFramebuffer(c.FRAMEBUFFER,null),c.deleteFramebuffer(a.handle),a.handle=null,a.depth&&(a.depth.dispose(),a.depth=null),a._depth_rb&&(c.deleteRenderbuffer(a._depth_rb),a._depth_rb=null);for(var q=0;q<a.color.length;++q)a.color[q].dispose(),a.color[q]=null;a._color_rb&&(c.deleteRenderbuffer(a._color_rb),a._color_rb=null),e(c,b),g(t)}e(c,b)}function k(a,b,c,d,e,f,g,h){this.gl=a,this._shape=[0|b,0|c],this._destroyed=!1,this._ext=h,this.color=new Array(e);for(var i=0;e>i;++i)this.color[i]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=d,this._useDepth=f,this._useStencil=g;var k=this,l=[0|b,0|c];Object.defineProperties(l,{0:{get:function(){return k._shape[0]},set:function(a){return k.width=a}},1:{get:function(){return k._shape[1]},set:function(a){return k.height=a}}}),this._shapeVector=l,j(this)}function l(a,b,c){if(a._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(a._shape[0]!==b||a._shape[1]!==c){var f=a.gl,h=f.getParameter(f.MAX_RENDERBUFFER_SIZE);if(0>b||b>h||0>c||c>h)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");a._shape[0]=b,a._shape[1]=c;for(var i=d(f),j=0;j<a.color.length;++j)a.color[j].shape=a._shape;a._color_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,a._color_rb),f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,a._shape[0],a._shape[1])),a.depth&&(a.depth.shape=a._shape),a._depth_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,a._depth_rb),a._useDepth&&a._useStencil?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,a._shape[0],a._shape[1]):a._useDepth?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,a._shape[0],a._shape[1]):a._useStencil&&f.renderbufferStorage(f.RENDERBUFFER,f.STENCIL_INDEX,a._shape[0],a._shape[1])),f.bindFramebuffer(f.FRAMEBUFFER,a.handle);var k=f.checkFramebufferStatus(f.FRAMEBUFFER);k!==f.FRAMEBUFFER_COMPLETE&&(a.dispose(),e(f,i),g(k)),e(f,i)}}function m(a,b,c,d){o||(o=a.FRAMEBUFFER_UNSUPPORTED,p=a.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,q=a.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,r=a.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var e=a.getExtension("WEBGL_draw_buffers");if(!s&&e&&f(a,e),Array.isArray(b)&&(d=c,c=0|b[1],b=0|b[0]),"number"!=typeof b)throw new Error("gl-fbo: Missing shape parameter");var g=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(0>b||b>g||0>c||c>g)throw new Error("gl-fbo: Parameters are too large for FBO");d=d||{};var h=1;if("color"in d){if(h=Math.max(0|d.color,0),0>h)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!e)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>a.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var i=a.UNSIGNED_BYTE,j=a.getExtension("OES_texture_float");if(d["float"]&&h>0){if(!j)throw new Error("gl-fbo: Context does not support floating point textures");i=a.FLOAT}else d.preferFloat&&h>0&&j&&(i=a.FLOAT);var l=!0;"depth"in d&&(l=!!d.depth);var m=!1;return"stencil"in d&&(m=!!d.stencil),new k(a,b,c,i,h,l,m,e)}var n=a("gl-texture2d");b.exports=m;var o,p,q,r,s=null,t=k.prototype;Object.defineProperties(t,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(a){if(Array.isArray(a)||(a=[0|a,0|a]),2!==a.length)throw new Error("gl-fbo: Shape vector must be length 2");var b=0|a[0],c=0|a[1];return l(this,b,c),[b,c]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(a){return a=0|a,l(this,a,this._shape[1]),a},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(a){return a=0|a,l(this,this._shape[0],a),a},enumerable:!1}}),t.bind=function(){if(!this._destroyed){var a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,this.handle),a.viewport(0,0,this._shape[0],this._shape[1])}},t.dispose=function(){if(!this._destroyed){this._destroyed=!0;var a=this.gl;a.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(a.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var b=0;b<this.color.length;++b)this.color[b].dispose(),this.color[b]=null;this._color_rb&&(a.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":185}],81:[function(a,b,c){c.lineVertex="#define GLSLIFY 1\nprecision mediump float;\n\nfloat inverse_1_0(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse_1_0(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse_1_0(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse_1_0(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\n\n\nattribute vec2 a, d;\n\nuniform mat3 matrix;\nuniform vec2 screenShape;\nuniform float width;\n\nvarying vec2 direction;\n\nvoid main() {\n vec2 dir = (matrix * vec3(d, 0)).xy;\n vec3 base = matrix * vec3(a, 1);\n vec2 n = 0.5 * width *\n normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\n vec2 tangent = normalize(screenShape.xy * dir);\n if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\n direction = -tangent;\n } else {\n direction = tangent;\n }\n gl_Position = vec4(base.xy/base.z + n, 0, 1);\n}\n",c.lineFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\nuniform vec2 screenShape;\nuniform sampler2D dashPattern;\nuniform float dashLength;\n\nvarying vec2 direction;\n\nvoid main() {\n float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\n vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\n gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\n}\n",c.mitreVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 p;\n\nuniform mat3 matrix;\nuniform vec2 screenShape;\nuniform float radius;\n\nvoid main() {\n vec3 pp = matrix * vec3(p, 1);\n gl_Position = vec4(pp.xy, 0, pp.z);\n gl_PointSize = radius;\n}\n",c.mitreFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n if(length(gl_PointCoord.xy - 0.5) > 0.25) {\n discard;\n }\n gl_FragColor = vec4(color.rgb, color.a);\n}\n",c.pickVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 a, d;\nattribute vec4 pick0, pick1;\n\nuniform mat3 matrix;\nuniform vec2 screenShape;\nuniform float width;\n\nvarying vec4 pickA, pickB;\n\nfloat inverse_1_0(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse_1_0(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse_1_0(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse_1_0(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\n\n\nvoid main() {\n vec3 base = matrix * vec3(a, 1);\n vec2 n = width *\n normalize(screenShape.yx * vec2(d.y, -d.x)) / screenShape.xy;\n gl_Position = vec4(base.xy/base.z + n, 0, 1);\n pickA = pick0;\n pickB = pick1;\n}\n",c.pickFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 pickOffset;\n\nvarying vec4 pickA, pickB;\n\nvoid main() {\n vec4 fragId = vec4(pickA.xyz, 0.0);\n if(pickB.w > pickA.w) {\n fragId.xyz = pickB.xyz;\n }\n\n fragId += pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n gl_FragColor = fragId / 255.0;\n}\n",c.fillVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 a, d;\n\nuniform mat3 matrix;\nuniform vec2 projectAxis;\nuniform float projectValue;\nuniform float depth;\n\nvoid main() {\n vec3 base = matrix * vec3(a, 1);\n vec2 p = base.xy / base.z;\n if(d.y < 0.0 || (d.y == 0.0 && d.x < 0.0)) {\n if(dot(p, projectAxis) < projectValue) {\n p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\n }\n }\n gl_Position = vec4(p, depth, 1);\n}\n",c.fillFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"},{}],82:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h){this.plot=a,this.dashPattern=b,this.lineBuffer=c,this.pickBuffer=d,this.lineShader=e,this.mitreShader=f,this.fillShader=g,this.pickShader=h,this.usingDashes=!1,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0,this.lodBuffer=[]}function e(a){return a.map(function(a){return a.slice()})}function f(a,b){var c=a.gl,e=h(c),f=h(c),j=i(c,[1,1]),k=g(c,l.lineVertex,l.lineFragment),m=g(c,l.mitreVertex,l.mitreFragment),n=g(c,l.fillVertex,l.fillFragment),o=g(c,l.pickVertex,l.pickFragment),p=new d(a,j,e,f,k,m,n,o);return a.addObject(p),p.update(b),p}b.exports=f;var g=a("gl-shader"),h=a("gl-buffer"),i=a("gl-texture2d"),j=a("ndarray"),k=a("typedarray-pool"),l=a("./lib/shaders"),m=d.prototype;m.draw=function(){var a=[1,0,0,0,1,0,0,0,1],b=[0,0],c=[1,0],d=[-1,0],e=[0,1],f=[0,-1];return function(){var g=this.plot,h=this.color,i=this.width,j=(this.numPoints,this.bounds),k=this.vertCount,l=g.gl,m=g.viewBox,n=g.dataBox,o=g.pixelRatio,p=j[2]-j[0],q=j[3]-j[1],r=n[2]-n[0],s=n[3]-n[1],t=m[2]-m[0],u=m[3]-m[1];a[0]=2*p/r,a[4]=2*q/s,a[6]=2*(j[0]-n[0])/r-1,a[7]=2*(j[1]-n[1])/s-1,b[0]=t,b[1]=u;var v=this.lineBuffer;v.bind();var w=this.fill;if(w[0]||w[1]||w[2]||w[3]){var x=this.fillShader;x.bind();var y=x.uniforms;y.matrix=a,y.depth=g.nextDepthValue();var z=x.attributes;z.a.pointer(l.FLOAT,!1,16,0),z.d.pointer(l.FLOAT,!1,16,8),l.depthMask(!0),l.enable(l.DEPTH_TEST);var A=this.fillColor;w[0]&&(y.color=A[0],y.projectAxis=d,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),w[1]&&(y.color=A[1],y.projectAxis=f,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),w[2]&&(y.color=A[2],y.projectAxis=c,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),w[3]&&(y.color=A[3],y.projectAxis=e,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),l.depthMask(!1),l.disable(l.DEPTH_TEST)}var B=this.lineShader;B.bind();var C=B.uniforms;C.matrix=a,C.color=h,C.width=i*o,C.screenShape=b,C.dashPattern=this.dashPattern.bind(),C.dashLength=this.dashLength*o;var D=B.attributes;if(D.a.pointer(l.FLOAT,!1,16,0),D.d.pointer(l.FLOAT,!1,16,8),l.drawArrays(l.TRIANGLES,0,k),i>2&&!this.usingDashes){var E=this.mitreShader;E.bind();var F=E.uniforms;F.matrix=a,F.color=h,F.screenShape=b,F.radius=i*o,E.attributes.p.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,k/3|0)}}}(),m.drawPick=function(){var a=[1,0,0,0,1,0,0,0,1],b=[0,0],c=[0,0,0,0];return function(d){var e=this.plot,f=this.pickShader,g=this.lineBuffer,h=this.pickBuffer,i=this.width,j=this.numPoints,k=this.bounds,l=this.vertCount,m=e.gl,n=e.viewBox,o=e.dataBox,p=e.pickPixelRatio,q=k[2]-k[0],r=k[3]-k[1],s=o[2]-o[0],t=o[3]-o[1],u=n[2]-n[0],v=n[3]-n[1];this.pickOffset=d,a[0]=2*q/s,a[4]=2*r/t,a[6]=2*(k[0]-o[0])/s-1,a[7]=2*(k[1]-o[1])/t-1,b[0]=u,b[1]=v,c[0]=255&d,c[1]=d>>>8&255,c[2]=d>>>16&255,c[3]=d>>>24,f.bind();var w=f.uniforms;w.matrix=a,w.width=i*p,w.pickOffset=c,w.screenShape=b;var x=f.attributes;return g.bind(),x.a.pointer(m.FLOAT,!1,16,0),x.d.pointer(m.FLOAT,!1,16,8),h.bind(),x.pick0.pointer(m.UNSIGNED_BYTE,!1,8,0),x.pick1.pointer(m.UNSIGNED_BYTE,!1,8,4),m.drawArrays(m.TRIANGLES,0,l),d+j}}(),m.pick=function(a,b,c){var d=this.pickOffset,e=this.numPoints;if(d>c||c>=d+e)return null;var f=c-d,g=this.data;return{object:this,pointId:f,dataCoord:[g[2*f],g[2*f+1]]}},m.update=function(a){a=a||{};var b=this.plot.gl;this.color=(a.color||[0,0,1,1]).slice(),this.width=+(a.width||1),this.fill=(a.fill||[!1,!1,!1,!1]).slice(),this.fillColor=e(a.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);for(var c=a.dashes||[1],d=0,f=0;f<c.length;++f)d+=c[f];for(var g=k.mallocUint8(d),h=0,l=255,f=0;f<c.length;++f){for(var m=0;m<c[f];++m)g[h++]=l;l^=255}this.dashPattern.dispose(),this.usingDashes=c.length>1,this.dashPattern=i(b,j(g,[d,1,4],[1,0,0])),this.dashPattern.minFilter=b.NEAREST,this.dashPattern.magFilter=b.NEAREST,this.dashLength=d,k.free(g);var n=a.positions;this.data=n;var o=this.bounds;o[0]=o[1]=1/0,o[2]=o[3]=-(1/0);var p=this.numPoints=n.length>>>1;if(0!==p){for(var f=0;p>f;++f){var q=n[2*f],r=n[2*f+1];o[0]=Math.min(o[0],q),o[1]=Math.min(o[1],r),o[2]=Math.max(o[2],q), 32 o[3]=Math.max(o[3],r)}o[0]===o[2]&&(o[2]+=1),o[3]===o[1]&&(o[3]+=1);var s=k.mallocFloat32(24*(p-1)),t=k.mallocUint32(12*(p-1)),u=s.length,v=t.length,h=p;for(this.vertCount=6*(p-1);h>1;){var w=--h,q=n[2*h],r=n[2*h+1];q=(q-o[0])/(o[2]-o[0]),r=(r-o[1])/(o[3]-o[1]);var x=w-1,y=n[2*x],z=n[2*x+1];y=(y-o[0])/(o[2]-o[0]),z=(z-o[1])/(o[3]-o[1]);var A=y-q,B=z-r,C=w|1<<24,D=w-1,E=w,F=w-1|1<<24;s[--u]=-B,s[--u]=-A,s[--u]=r,s[--u]=q,t[--v]=C,t[--v]=D,s[--u]=B,s[--u]=A,s[--u]=z,s[--u]=y,t[--v]=E,t[--v]=F,s[--u]=-B,s[--u]=-A,s[--u]=z,s[--u]=y,t[--v]=E,t[--v]=F,s[--u]=B,s[--u]=A,s[--u]=z,s[--u]=y,t[--v]=E,t[--v]=F,s[--u]=-B,s[--u]=-A,s[--u]=r,s[--u]=q,t[--v]=C,t[--v]=D,s[--u]=B,s[--u]=A,s[--u]=r,s[--u]=q,t[--v]=C,t[--v]=D}this.lineBuffer.update(s),this.pickBuffer.update(t),k.free(s),k.free(t)}},m.dispose=function(){this.plot.removeObject(this),this.lineBuffer.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{"./lib/shaders":81,"gl-buffer":75,"gl-shader":154,"gl-texture2d":185,ndarray:208,"typedarray-pool":233}],83:[function(a,b,c){var d=a("gl-shader"),e="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvoid main() {\n vec4 projected = projection * view * model * vec4(position, 1.0);\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\n vec2 tangent = normalize(screenShape * tangentClip.xy);\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\n\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n",f="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n",g="#define GLSLIFY 1\nprecision mediump float;\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1_0(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",h=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];c.createShader=function(a){return d(a,e,f,null,h)},c.createPickShader=function(a){return d(a,e,g,null,h)}},{"gl-shader":154}],84:[function(a,b,c){"use strict";function d(a,b){for(var c=0,d=0;3>d;++d){var e=a[d]-b[d];c+=e*e}return Math.sqrt(c)}function e(a){for(var b=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],c=0;3>c;++c)b[0][c]=Math.max(a[0][c],b[0][c]),b[1][c]=Math.min(a[1][c],b[1][c]);return b}function f(a,b,c,d){this.arcLength=a,this.position=b,this.index=c,this.dataCoordinate=d}function g(a,b,c,d,e,f){this.gl=a,this.shader=b,this.pickShader=c,this.buffer=d,this.vao=e,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=f,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function h(a){var b=a.gl||a.scene&&a.scene.gl,c=p(b);c.attributes.position.location=0,c.attributes.nextPosition.location=1,c.attributes.arcLength.location=2,c.attributes.lineWidth.location=3,c.attributes.color.location=4;var d=q(b);d.attributes.position.location=0,d.attributes.nextPosition.location=1,d.attributes.arcLength.location=2,d.attributes.lineWidth.location=3,d.attributes.color.location=4;for(var e=i(b),f=j(b,[{buffer:e,size:3,offset:0,stride:48},{buffer:e,size:3,offset:12,stride:48},{buffer:e,size:1,offset:24,stride:48},{buffer:e,size:1,offset:28,stride:48},{buffer:e,size:4,offset:32,stride:48}]),h=n(new Array(1024),[256,1,4]),l=0;1024>l;++l)h.data[l]=255;var m=k(b,h);m.wrap=b.REPEAT;var o=new g(b,c,d,e,f,m);return o.update(a),o}b.exports=h;var i=a("gl-buffer"),j=a("gl-vao"),k=a("gl-texture2d"),l=a("glsl-read-float"),m=a("binary-search-bounds"),n=a("ndarray"),o=a("./lib/shaders"),p=o.createShader,q=o.createPickShader,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s=g.prototype;s.isTransparent=function(){return this.opacity<1},s.isOpaque=function(){return this.opacity>=1},s.pickSlots=1,s.setPickBase=function(a){this.pickId=a},s.drawTransparent=s.draw=function(a){var b=this.gl,c=this.shader,d=this.vao;c.bind(),c.uniforms={model:a.model||r,view:a.view||r,projection:a.projection||r,clipBounds:e(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[b.drawingBufferWidth,b.drawingBufferHeight],pixelRatio:this.pixelRatio},d.bind(),d.draw(b.TRIANGLE_STRIP,this.vertexCount)},s.drawPick=function(a){var b=this.gl,c=this.pickShader,d=this.vao;c.bind(),c.uniforms={model:a.model||r,view:a.view||r,projection:a.projection||r,pickId:this.pickId,clipBounds:e(this.clipBounds),screenShape:[b.drawingBufferWidth,b.drawingBufferHeight],pixelRatio:this.pixelRatio},d.bind(),d.draw(b.TRIANGLE_STRIP,this.vertexCount)},s.update=function(a){this.dirty=!0,"dashScale"in a&&(this.dashScale=a.dashScale),"opacity"in a&&(this.opacity=+a.opacity);var b=a.position||a.positions;if(b){var c=a.color||a.colors||[0,0,0,1],e=a.lineWidth||1,f=[],g=[],h=[],i=0,j=0,k=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];a:for(var l=1;l<b.length;++l){var o=b[l-1],p=b[l];g.push(i),h.push(o.slice());for(var q=0;3>q;++q){if(isNaN(o[q])||isNaN(p[q])||!isFinite(o[q])||!isFinite(p[q]))continue a;k[0][q]=Math.min(k[0][q],o[q],p[q]),k[1][q]=Math.max(k[1][q],o[q],p[q])}var r,s;Array.isArray(c[0])?(r=c[l-1],s=c[l]):r=s=c,3===r.length&&(r=[r[0],r[1],r[2],1]),3===s.length&&(s=[s[0],s[1],s[2],1]);var t,u;Array.isArray(e)?(t=e[l-1],u=lineWidht[l]):t=u=e;var v=i;i+=d(o,p),f.push(o[0],o[1],o[2],p[0],p[1],p[2],v,t,r[0],r[1],r[2],r[3],o[0],o[1],o[2],p[0],p[1],p[2],v,-t,r[0],r[1],r[2],r[3],p[0],p[1],p[2],o[0],o[1],o[2],i,-t,s[0],s[1],s[2],s[3],p[0],p[1],p[2],o[0],o[1],o[2],i,t,s[0],s[1],s[2],s[3]),j+=4}if(this.buffer.update(f),g.push(i),h.push(b[b.length-1].slice()),this.bounds=k,this.vertexCount=j,this.points=h,this.arcLength=g,"dashes"in a){var w=a.dashes,x=w.slice();x.unshift(0);for(var l=1;l<x.length;++l)x[l]=x[l-1]+x[l];for(var y=n(new Array(1024),[256,1,4]),l=0;256>l;++l){for(var q=0;4>q;++q)y.set(l,0,q,0);1&m.le(x,x[x.length-1]*l/255)?y.set(l,0,0,0):y.set(l,0,0,255)}this.texture.setPixels(y)}}},s.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},s.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;var b=l(a.value[0],a.value[1],a.value[2],0),c=m.le(this.arcLength,b);if(0>c)return null;if(c===this.arcLength.length-1)return new f(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),c);for(var d=this.points[c],e=this.points[Math.min(c+1,this.points.length-1)],g=(b-this.arcLength[c])/(this.arcLength[c+1]-this.arcLength[c]),h=1-g,i=[0,0,0],j=0;3>j;++j)i[j]=h*d[j]+g*e[j];var k=Math.min(.5>g?c:c+1,this.points.length-1);return new f(b,i,k,this.points[k])}},{"./lib/shaders":83,"binary-search-bounds":85,"gl-buffer":75,"gl-texture2d":185,"gl-vao":189,"glsl-read-float":86,ndarray:208}],85:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],86:[function(a,b,c){function d(a,b,c,d){return e[0]=d,e[1]=c,e[2]=b,e[3]=a,f[0]}b.exports=d;var e=new Uint8Array(4),f=new Float32Array(e.buffer)},{}],87:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=k*g-h*j,m=-k*f+h*i,n=j*f-g*i,o=c*l+d*m+e*n;return o?(o=1/o,a[0]=l*o,a[1]=(-k*d+e*j)*o,a[2]=(h*d-e*g)*o,a[3]=m*o,a[4]=(k*c-e*i)*o,a[5]=(-h*c+e*f)*o,a[6]=n*o,a[7]=(-j*c+d*i)*o,a[8]=(g*c-d*f)*o,a):null}b.exports=d},{}],88:[function(a,b,c){function d(a){var b=new Float32Array(16);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15],b}b.exports=d},{}],89:[function(a,b,c){function d(){var a=new Float32Array(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}b.exports=d},{}],90:[function(a,b,c){function d(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15],r=b*g-c*f,s=b*h-d*f,t=b*i-e*f,u=c*h-d*g,v=c*i-e*g,w=d*i-e*h,x=j*o-k*n,y=j*p-l*n,z=j*q-m*n,A=k*p-l*o,B=k*q-m*o,C=l*q-m*p;return r*C-s*B+t*A+u*z-v*y+w*x}b.exports=d},{}],91:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,h=d+d,i=e+e,j=c*g,k=d*g,l=d*h,m=e*g,n=e*h,o=e*i,p=f*g,q=f*h,r=f*i;return a[0]=1-l-o,a[1]=k+r,a[2]=m-q,a[3]=0,a[4]=k-r,a[5]=1-j-o,a[6]=n+p,a[7]=0,a[8]=m+q,a[9]=n-p,a[10]=1-j-l,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}b.exports=d},{}],92:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=d+d,i=e+e,j=f+f,k=d*h,l=d*i,m=d*j,n=e*i,o=e*j,p=f*j,q=g*h,r=g*i,s=g*j;return a[0]=1-(n+p),a[1]=l+s,a[2]=m-r,a[3]=0,a[4]=l-s,a[5]=1-(k+p),a[6]=o+q,a[7]=0,a[8]=m+r,a[9]=o-q,a[10]=1-(k+n),a[11]=0,a[12]=c[0],a[13]=c[1],a[14]=c[2],a[15]=1,a}b.exports=d},{}],93:[function(a,b,c){function d(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}b.exports=d},{}],94:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y;return E?(E=1/E,a[0]=(h*D-i*C+j*B)*E,a[1]=(e*C-d*D-f*B)*E,a[2]=(p*x-q*w+r*v)*E,a[3]=(m*w-l*x-n*v)*E,a[4]=(i*A-g*D-j*z)*E,a[5]=(c*D-e*A+f*z)*E,a[6]=(q*u-o*x-r*t)*E,a[7]=(k*x-m*u+n*t)*E,a[8]=(g*C-h*A+j*y)*E,a[9]=(d*A-c*C-f*y)*E,a[10]=(o*w-p*u+r*s)*E,a[11]=(l*u-k*w-n*s)*E,a[12]=(h*z-g*B-i*y)*E,a[13]=(c*B-d*z+e*y)*E,a[14]=(p*t-o*v-q*s)*E,a[15]=(k*v-l*t+m*s)*E,a):null}b.exports=d},{}],95:[function(a,b,c){function d(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,p=b[0],q=b[1],r=b[2],s=d[0],t=d[1],u=d[2],v=c[0],w=c[1],x=c[2];return Math.abs(p-v)<1e-6&&Math.abs(q-w)<1e-6&&Math.abs(r-x)<1e-6?e(a):(l=p-v,m=q-w,n=r-x,o=1/Math.sqrt(l*l+m*m+n*n),l*=o,m*=o,n*=o,f=t*n-u*m,g=u*l-s*n,h=s*m-t*l,o=Math.sqrt(f*f+g*g+h*h),o?(o=1/o,f*=o,g*=o,h*=o):(f=0,g=0,h=0),i=m*h-n*g,j=n*f-l*h,k=l*g-m*f,o=Math.sqrt(i*i+j*j+k*k),o?(o=1/o,i*=o,j*=o,k*=o):(i=0,j=0,k=0),a[0]=f,a[1]=i,a[2]=l,a[3]=0,a[4]=g,a[5]=j,a[6]=m,a[7]=0,a[8]=h,a[9]=k,a[10]=n,a[11]=0,a[12]=-(f*p+g*q+h*r),a[13]=-(i*p+j*q+k*r),a[14]=-(l*p+m*q+n*r),a[15]=1,a)}var e=a("./identity");b.exports=d},{"./identity":93}],96:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],p=b[12],q=b[13],r=b[14],s=b[15],t=c[0],u=c[1],v=c[2],w=c[3];return a[0]=t*d+u*h+v*l+w*p,a[1]=t*e+u*i+v*m+w*q,a[2]=t*f+u*j+v*n+w*r,a[3]=t*g+u*k+v*o+w*s,t=c[4],u=c[5],v=c[6],w=c[7],a[4]=t*d+u*h+v*l+w*p,a[5]=t*e+u*i+v*m+w*q,a[6]=t*f+u*j+v*n+w*r,a[7]=t*g+u*k+v*o+w*s,t=c[8],u=c[9],v=c[10],w=c[11],a[8]=t*d+u*h+v*l+w*p,a[9]=t*e+u*i+v*m+w*q,a[10]=t*f+u*j+v*n+w*r,a[11]=t*g+u*k+v*o+w*s,t=c[12],u=c[13],v=c[14],w=c[15],a[12]=t*d+u*h+v*l+w*p,a[13]=t*e+u*i+v*m+w*q,a[14]=t*f+u*j+v*n+w*r,a[15]=t*g+u*k+v*o+w*s,a}b.exports=d},{}],97:[function(a,b,c){function d(a,b,c,d,e){var f=1/Math.tan(b/2),g=1/(d-e);return a[0]=f/c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=f,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(e+d)*g,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*e*d*g,a[15]=0,a}b.exports=d},{}],98:[function(a,b,c){function d(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C=d[0],D=d[1],E=d[2],F=Math.sqrt(C*C+D*D+E*E);return Math.abs(F)<1e-6?null:(F=1/F,C*=F,D*=F,E*=F,e=Math.sin(c),f=Math.cos(c),g=1-f,h=b[0],i=b[1],j=b[2],k=b[3],l=b[4],m=b[5],n=b[6],o=b[7],p=b[8],q=b[9],r=b[10],s=b[11],t=C*C*g+f,u=D*C*g+E*e,v=E*C*g-D*e,w=C*D*g-E*e,x=D*D*g+f,y=E*D*g+C*e,z=C*E*g+D*e,A=D*E*g-C*e,B=E*E*g+f,a[0]=h*t+l*u+p*v,a[1]=i*t+m*u+q*v,a[2]=j*t+n*u+r*v,a[3]=k*t+o*u+s*v,a[4]=h*w+l*x+p*y,a[5]=i*w+m*x+q*y,a[6]=j*w+n*x+r*y,a[7]=k*w+o*x+s*y,a[8]=h*z+l*A+p*B,a[9]=i*z+m*A+q*B,a[10]=j*z+n*A+r*B,a[11]=k*z+o*A+s*B,b!==a&&(a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a)}b.exports=d},{}],99:[function(a,b,c){function d(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[4],g=b[5],h=b[6],i=b[7],j=b[8],k=b[9],l=b[10],m=b[11];return b!==a&&(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[4]=f*e+j*d,a[5]=g*e+k*d,a[6]=h*e+l*d,a[7]=i*e+m*d,a[8]=j*e-f*d,a[9]=k*e-g*d,a[10]=l*e-h*d,a[11]=m*e-i*d,a}b.exports=d},{}],100:[function(a,b,c){function d(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[0],g=b[1],h=b[2],i=b[3],j=b[8],k=b[9],l=b[10],m=b[11];return b!==a&&(a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[0]=f*e-j*d,a[1]=g*e-k*d,a[2]=h*e-l*d,a[3]=i*e-m*d,a[8]=f*d+j*e,a[9]=g*d+k*e,a[10]=h*d+l*e,a[11]=i*d+m*e,a}b.exports=d},{}],101:[function(a,b,c){function d(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[0],g=b[1],h=b[2],i=b[3],j=b[4],k=b[5],l=b[6],m=b[7];return b!==a&&(a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[0]=f*e+j*d,a[1]=g*e+k*d,a[2]=h*e+l*d,a[3]=i*e+m*d,a[4]=j*e-f*d,a[5]=k*e-g*d,a[6]=l*e-h*d,a[7]=m*e-i*d,a}b.exports=d},{}],102:[function(a,b,c){function d(a,b,c){var d=c[0],e=c[1],f=c[2];return a[0]=b[0]*d,a[1]=b[1]*d,a[2]=b[2]*d,a[3]=b[3]*d,a[4]=b[4]*e,a[5]=b[5]*e,a[6]=b[6]*e,a[7]=b[7]*e,a[8]=b[8]*f,a[9]=b[9]*f,a[10]=b[10]*f,a[11]=b[11]*f,a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15],a}b.exports=d},{}],103:[function(a,b,c){function d(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p=c[0],q=c[1],r=c[2];return b===a?(a[12]=b[0]*p+b[4]*q+b[8]*r+b[12],a[13]=b[1]*p+b[5]*q+b[9]*r+b[13],a[14]=b[2]*p+b[6]*q+b[10]*r+b[14],a[15]=b[3]*p+b[7]*q+b[11]*r+b[15]):(d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],a[0]=d,a[1]=e,a[2]=f,a[3]=g,a[4]=h,a[5]=i,a[6]=j,a[7]=k,a[8]=l,a[9]=m,a[10]=n,a[11]=o,a[12]=d*p+h*q+l*r+b[12],a[13]=e*p+i*q+m*r+b[13],a[14]=f*p+j*q+n*r+b[14],a[15]=g*p+k*q+o*r+b[15]),a}b.exports=d},{}],104:[function(a,b,c){function d(a,b){if(a===b){var c=b[1],d=b[2],e=b[3],f=b[6],g=b[7],h=b[11];a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=c,a[6]=b[9],a[7]=b[13],a[8]=d,a[9]=f,a[11]=b[14],a[12]=e,a[13]=g,a[14]=h}else a[0]=b[0],a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=b[1],a[5]=b[5],a[6]=b[9],a[7]=b[13],a[8]=b[2],a[9]=b[6],a[10]=b[10],a[11]=b[14],a[12]=b[3],a[13]=b[7],a[14]=b[11],a[15]=b[15];return a}b.exports=d},{}],105:[function(a,b,c){"use strict";function d(a,b){for(var c=[0,0,0,0],d=0;4>d;++d)for(var e=0;4>e;++e)c[e]+=a[4*d+e]*b[d];return c}function e(a,b,c,e,f){for(var g=d(e,d(c,d(b,[a[0],a[1],a[2],1]))),h=0;3>h;++h)g[h]/=g[3];return[.5*f[0]*(1+g[0]),.5*f[1]*(1-g[1])]}function f(a,b){if(2===a.length){for(var c=0,d=0,e=0;2>e;++e)c+=Math.pow(b[e]-a[0][e],2),d+=Math.pow(b[e]-a[1][e],2);return c=Math.sqrt(c),d=Math.sqrt(d),1e-6>c+d?[1,0]:[d/(c+d),c/(d+c)]}if(3===a.length){var f=[0,0];return j(a[0],a[1],a[2],b,f),i(a,f)}return[]}function g(a,b){for(var c=[0,0,0],d=0;d<a.length;++d)for(var e=a[d],f=b[d],g=0;3>g;++g)c[g]+=f*e[g];return c}function h(a,b,c,d,h,i){if(1===a.length)return[0,a[0].slice()];for(var j=new Array(a.length),k=0;k<a.length;++k)j[k]=e(a[k],c,d,h,i);for(var l=0,m=1/0,k=0;k<j.length;++k){for(var n=0,o=0;2>o;++o)n+=Math.pow(j[k][o]-b[o],2);m>n&&(m=n,l=k)}for(var p=f(j,b),q=0,k=0;3>k;++k){if(p[k]<-.001||p[k]>1.0001)return null;q+=p[k]}return Math.abs(q-1)>.001?null:[l,g(a,p),p]}var i=a("barycentric"),j=a("polytope-closest-point/lib/closest_point_2d.js");b.exports=h},{barycentric:108,"polytope-closest-point/lib/closest_point_2d.js":110}],106:[function(a,b,c){var d="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",e="#define GLSLIFY 1\nprecision mediump float;\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",f="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",g="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",h="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",i="#define GLSLIFY 1\nprecision mediump float;\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",j="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",k="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}",l="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",m="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",n="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n";c.meshShader={vertex:d,fragment:e,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},c.wireShader={vertex:f,fragment:g,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},c.pointShader={vertex:h,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},c.pickShader={vertex:j,fragment:k,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},c.pointPickShader={vertex:l,fragment:k,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},c.contourShader={vertex:m,fragment:n,attributes:[{name:"position",type:"vec3"}]}},{}],107:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A){this.gl=a,this.cells=[],this.positions=[],this.intensity=[],this.texture=b,this.dirty=!0,this.triShader=c,this.lineShader=d,this.pointShader=e,this.pickShader=f,this.pointPickShader=g,this.contourShader=h,this.trianglePositions=i,this.triangleColors=k,this.triangleNormals=m,this.triangleUVs=l,this.triangleIds=j,this.triangleVAO=n,this.triangleCount=0,this.lineWidth=1,this.edgePositions=o,this.edgeColors=q,this.edgeUVs=r,this.edgeIds=p,this.edgeVAO=s,this.edgeCount=0,this.pointPositions=t,this.pointColors=v,this.pointUVs=w,this.pointSizes=x,this.pointIds=u,this.pointVAO=y,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=z,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=H,this._view=H,this._projection=H,this._resolution=[1,1]}function e(a){for(var b=w({colormap:a,nshades:256,format:"rgba"}),c=new Uint8Array(1024),d=0;256>d;++d){for(var e=b[d],f=0;3>f;++f)c[4*d+f]=e[f];c[4*d+3]=255*e[3]}return v(c,[256,256,4],[4,0,1])}function f(a,b,c){for(var d=new Array(b),e=0;b>e;++e)d[e]=0;for(var f=a.length,e=0;f>e;++e)for(var g=a[e],h=0;h<g.length;++h)d[g[h]]=c[e];return d}function g(a){for(var b=a.length,c=new Array(b),d=0;b>d;++d)c[d]=a[d][2];return c}function h(a){var b=o(a,B);return b.attributes.position.location=0,b.attributes.color.location=2,b.attributes.uv.location=3,b.attributes.normal.location=4,b}function i(a){var b=o(a,C);return b.attributes.position.location=0,b.attributes.color.location=2,b.attributes.uv.location=3,b}function j(a){var b=o(a,D);return b.attributes.position.location=0,b.attributes.color.location=2,b.attributes.uv.location=3,b.attributes.pointSize.location=4,b}function k(a){var b=o(a,E);return b.attributes.position.location=0,b.attributes.id.location=1,b}function l(a){var b=o(a,F);return b.attributes.position.location=0,b.attributes.id.location=1,b.attributes.pointSize.location=4,b}function m(a){var b=o(a,G);return b.attributes.position.location=0,b}function n(a){var b=a.gl,c=h(b),e=i(b),f=j(b),g=k(b),n=l(b),o=m(b),s=r(b,v(new Uint8Array([255,255,255,255]),[1,1,4]));s.generateMipmap(),s.minFilter=b.LINEAR_MIPMAP_LINEAR,s.magFilter=b.LINEAR;var t=p(b),u=p(b),w=p(b),x=p(b),y=p(b),z=q(b,[{buffer:t,type:b.FLOAT,size:3},{buffer:y,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:u,type:b.FLOAT,size:4},{buffer:w,type:b.FLOAT,size:2},{buffer:x,type:b.FLOAT,size:3}]),A=p(b),B=p(b),C=p(b),D=p(b),E=q(b,[{buffer:A,type:b.FLOAT,size:3},{buffer:D,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:b.FLOAT,size:4},{buffer:C,type:b.FLOAT,size:2}]),F=p(b),G=p(b),H=p(b),I=p(b),J=p(b),K=q(b,[{buffer:F,type:b.FLOAT,size:3},{buffer:J,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:G,type:b.FLOAT,size:4},{buffer:H,type:b.FLOAT,size:2},{buffer:I,type:b.FLOAT,size:1}]),L=p(b),M=q(b,[{buffer:L,type:b.FLOAT,size:3}]),N=new d(b,s,c,e,f,g,n,o,t,y,u,w,x,z,A,D,B,C,E,F,J,G,H,I,K,L,M);return N.update(a),N}var o=a("gl-shader"),p=a("gl-buffer"),q=a("gl-vao"),r=a("gl-texture2d"),s=a("normals"),t=a("gl-mat4/multiply"),u=a("gl-mat4/invert"),v=a("ndarray"),w=a("colormap"),x=a("simplicial-complex-contour"),y=a("typedarray-pool"),z=a("./lib/shaders"),A=a("./lib/closest-point"),B=z.meshShader,C=z.wireShader,D=z.pointShader,E=z.pickShader,F=z.pointPickShader,G=z.contourShader,H=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],I=d.prototype;I.isOpaque=function(){return this.opacity>=1},I.isTransparent=function(){return this.opacity<1},I.pickSlots=1,I.setPickBase=function(a){this.pickId=a},I.highlight=function(a){if(!a||!this.contourEnable)return void(this.contourCount=0);for(var b=x(this.cells,this.intensity,a.intensity),c=b.cells,d=b.vertexIds,e=b.vertexWeights,f=c.length,g=y.mallocFloat32(6*f),h=0,i=0;f>i;++i)for(var j=c[i],k=0;2>k;++k){var l=j[0];2===j.length&&(l=j[k]);for(var m=d[l][0],n=d[l][1],o=e[l],p=1-o,q=this.positions[m],r=this.positions[n],s=0;3>s;++s)g[h++]=o*q[s]+p*r[s]}this.contourCount=h/3|0,this.contourPositions.update(g.subarray(0,h)),y.free(g)},I.update=function(a){a=a||{};var b=this.gl;this.dirty=!0,"contourEnable"in a&&(this.contourEnable=a.contourEnable),"contourColor"in a&&(this.contourColor=a.contourColor),"lineWidth"in a&&(this.lineWidth=a.lineWidth),"opacity"in a&&(this.opacity=a.opacity),a.texture?(this.texture.dispose(),this.texture=r(b,a.texture)):a.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=b.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=b.LINEAR,this.texture.setPixels(e(a.colormap)),this.texture.generateMipmap());var c=a.cells,d=a.positions;if(d&&c){var h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=[],p=[],q=[],t=[],u=[],v=[],w=[];this.cells=c,this.positions=d;var x=a.vertexNormals,y=a.cellNormals;a.useFacetNormals&&!y&&(y=s.faceNormals(c,d)),y||x||(x=s.vertexNormals(c,d));var z=a.vertexColors,A=a.cellColors,B=a.meshColor||[1,1,1,1],C=a.vertexUVs,D=a.vertexIntensity,E=a.cellUVs,F=a.cellIntensity,G=1/0,H=-(1/0);if(!C&&!E)if(D)for(var I=0;I<D.length;++I){var J=D[I];G=Math.min(G,J),H=Math.max(H,J)}else if(F)for(var I=0;I<F.length;++I){var J=F[I];G=Math.min(G,J),H=Math.max(H,J)}else for(var I=0;I<d.length;++I){var J=d[I][2];G=Math.min(G,J),H=Math.max(H,J)}D?this.intensity=D:F?this.intensity=f(c,d.length,F):this.intensity=g(d);var K=a.pointSizes,L=a.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(var I=0;I<d.length;++I)for(var M=d[I],N=0;3>N;++N)!isNaN(M[N])&&isFinite(M[N])&&(this.bounds[0][N]=Math.min(this.bounds[0][N],M[N]),this.bounds[1][N]=Math.max(this.bounds[1][N],M[N]));var O=0,P=0,Q=0;a:for(var I=0;I<c.length;++I){var R=c[I];switch(R.length){case 1:for(var S=R[0],M=d[S],N=0;3>N;++N)if(isNaN(M[N])||!isFinite(M[N]))continue a;q.push(M[0],M[1],M[2]);var T;T=z?z[S]:A?A[I]:B,3===T.length?t.push(T[0],T[1],T[2],1):t.push(T[0],T[1],T[2],T[3]);var U;U=C?C[S]:D?[(D[S]-G)/(H-G),0]:E?E[I]:F?[(F[I]-G)/(H-G),0]:[(M[2]-G)/(H-G),0],u.push(U[0],U[1]),K?v.push(K[S]):v.push(L),w.push(I),Q+=1;break;case 2:for(var N=0;2>N;++N)for(var S=R[N],M=d[S],V=0;3>V;++V)if(isNaN(M[V])||!isFinite(M[V]))continue a;for(var N=0;2>N;++N){var S=R[N],M=d[S];m.push(M[0],M[1],M[2]);var T;T=z?z[S]:A?A[I]:B,3===T.length?n.push(T[0],T[1],T[2],1):n.push(T[0],T[1],T[2],T[3]);var U;U=C?C[S]:D?[(D[S]-G)/(H-G),0]:E?E[I]:F?[(F[I]-G)/(H-G),0]:[(M[2]-G)/(H-G),0],o.push(U[0],U[1]),p.push(I)}P+=1;break;case 3:for(var N=0;3>N;++N)for(var S=R[N],M=d[S],V=0;3>V;++V)if(isNaN(M[V])||!isFinite(M[V]))continue a;for(var N=0;3>N;++N){var S=R[N],M=d[S];h.push(M[0],M[1],M[2]);var T;T=z?z[S]:A?A[I]:B,3===T.length?i.push(T[0],T[1],T[2],1):i.push(T[0],T[1],T[2],T[3]);var U;U=C?C[S]:D?[(D[S]-G)/(H-G),0]:E?E[I]:F?[(F[I]-G)/(H-G),0]:[(M[2]-G)/(H-G),0],k.push(U[0],U[1]);var W;W=x?x[S]:y[I],j.push(W[0],W[1],W[2]),l.push(I)}O+=1}}this.pointCount=Q,this.edgeCount=P,this.triangleCount=O,this.pointPositions.update(q),this.pointColors.update(t),this.pointUVs.update(u),this.pointSizes.update(v),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(m),this.edgeColors.update(n),this.edgeUVs.update(o),this.edgeIds.update(new Uint32Array(p)),this.trianglePositions.update(h), 33 this.triangleColors.update(i),this.triangleUVs.update(k),this.triangleNormals.update(j),this.triangleIds.update(new Uint32Array(l))}},I.drawTransparent=I.draw=function(a){a=a||{};for(var b=this.gl,c=a.model||H,d=a.view||H,e=a.projection||H,f=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],g=0;3>g;++g)f[0][g]=Math.max(f[0][g],this.clipBounds[0][g]),f[1][g]=Math.min(f[1][g],this.clipBounds[1][g]);var h={model:c,view:d,projection:e,clipBounds:f,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var i=new Array(16);t(i,h.view,h.model),t(i,h.projection,i),u(i,i);for(var g=0;3>g;++g)h.eyePosition[g]=i[12+g]/i[15];for(var j=i[15],g=0;3>g;++g)j+=this.lightPosition[g]*i[4*g+3];for(var g=0;3>g;++g){for(var k=i[12+g],l=0;3>l;++l)k+=i[4*l+g]*this.lightPosition[l];h.lightPosition[g]=k/j}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=h,this.triangleVAO.bind(),b.drawArrays(b.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var m=this.lineShader;m.bind(),m.uniforms=h,this.edgeVAO.bind(),b.lineWidth(this.lineWidth),b.drawArrays(b.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var m=this.pointShader;m.bind(),m.uniforms=h,this.pointVAO.bind(),b.drawArrays(b.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var m=this.contourShader;m.bind(),m.uniforms=h,this.contourVAO.bind(),b.drawArrays(b.LINES,0,this.contourCount),this.contourVAO.unbind()}},I.drawPick=function(a){a=a||{};for(var b=this.gl,c=a.model||H,d=a.view||H,e=a.projection||H,f=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],g=0;3>g;++g)f[0][g]=Math.max(f[0][g],this.clipBounds[0][g]),f[1][g]=Math.min(f[1][g],this.clipBounds[1][g]);this._model=[].slice.call(c),this._view=[].slice.call(d),this._projection=[].slice.call(e),this._resolution=[b.drawingBufferWidth,b.drawingBufferHeight];var h={model:c,view:d,projection:e,clipBounds:f,pickId:this.pickId/255},i=this.pickShader;if(i.bind(),i.uniforms=h,this.triangleCount>0&&(this.triangleVAO.bind(),b.drawArrays(b.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),b.lineWidth(this.lineWidth),b.drawArrays(b.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var i=this.pointPickShader;i.bind(),i.uniforms=h,this.pointVAO.bind(),b.drawArrays(b.POINTS,0,this.pointCount),this.pointVAO.unbind()}},I.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;for(var b=a.value[0]+256*a.value[1]+65536*a.value[2],c=this.cells[b],d=this.positions,e=new Array(c.length),f=0;f<c.length;++f)e[f]=d[c[f]];var g=A(e,[a.coord[0],this._resolution[1]-a.coord[1]],this._model,this._view,this._projection,this._resolution);if(!g)return null;for(var h=g[2],i=0,f=0;f<c.length;++f)i+=h[f]*this.intensity[c[f]];return{position:g[1],index:c[g[0]],cell:c,cellId:b,intensity:i,dataCoordinate:this.positions[c[g[0]]]}},I.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},b.exports=n},{"./lib/closest-point":105,"./lib/shaders":106,colormap:57,"gl-buffer":75,"gl-mat4/invert":94,"gl-mat4/multiply":96,"gl-shader":154,"gl-texture2d":185,"gl-vao":189,ndarray:208,normals:109,"simplicial-complex-contour":111,"typedarray-pool":233}],108:[function(a,b,c){"use strict";function d(a){for(var b=0,c=0;c<a.length;++c)b+=a[c];return b}function e(a,b){for(var c=b.length,e=new Array(c+1),g=0;c>g;++g){for(var h=new Array(c+1),i=0;c>=i;++i)h[i]=a[i][g];e[g]=h}e[c]=new Array(c+1);for(var g=0;c>=g;++g)e[c][g]=1;for(var j=new Array(c+1),g=0;c>g;++g)j[g]=b[g];j[c]=1;var k=f(e,j),l=d(k[c+1]);0===l&&(l=1);for(var m=new Array(c+1),g=0;c>=g;++g)m[g]=d(k[g])/l;return m}b.exports=e;var f=a("robust-linear-solve")},{"robust-linear-solve":211}],109:[function(a,b,c){var d=1e-6;c.vertexNormals=function(a,b){for(var c=b.length,e=new Array(c),f=0;c>f;++f)e[f]=[0,0,0];for(var f=0;f<a.length;++f)for(var g=a[f],h=0,i=g[g.length-1],j=g[0],k=0;k<g.length;++k){h=i,i=j,j=g[(k+1)%g.length];for(var l=b[h],m=b[i],n=b[j],o=new Array(3),p=0,q=new Array(3),r=0,s=0;3>s;++s)o[s]=l[s]-m[s],p+=o[s]*o[s],q[s]=n[s]-m[s],r+=q[s]*q[s];if(p*r>d)for(var t=e[i],u=1/Math.sqrt(p*r),s=0;3>s;++s){var v=(s+1)%3,w=(s+2)%3;t[s]+=u*(q[v]*o[w]-q[w]*o[v])}}for(var f=0;c>f;++f){for(var t=e[f],x=0,s=0;3>s;++s)x+=t[s]*t[s];if(x>d)for(var u=1/Math.sqrt(x),s=0;3>s;++s)t[s]*=u;else for(var s=0;3>s;++s)t[s]=0}return e},c.faceNormals=function(a,b){for(var c=a.length,e=new Array(c),f=0;c>f;++f){for(var g=a[f],h=new Array(3),i=0;3>i;++i)h[i]=b[g[i]];for(var j=new Array(3),k=new Array(3),i=0;3>i;++i)j[i]=h[1][i]-h[0][i],k[i]=h[2][i]-h[0][i];for(var l=new Array(3),m=0,i=0;3>i;++i){var n=(i+1)%3,o=(i+2)%3;l[i]=j[n]*k[o]-j[o]*k[n],m+=l[i]*l[i]}m=m>d?1/Math.sqrt(m):0;for(var i=0;3>i;++i)l[i]*=m;e[f]=l}return e}},{}],110:[function(a,b,c){"use strict";function d(a,b,c,d,h){e.length<d.length&&(e=new Float64Array(d.length),f=new Float64Array(d.length),g=new Float64Array(d.length));for(var i=0;i<d.length;++i)e[i]=a[i]-d[i],f[i]=b[i]-a[i],g[i]=c[i]-a[i];for(var j=0,k=0,l=0,m=0,n=0,o=0,i=0;i<d.length;++i){var p=f[i],q=g[i],r=e[i];j+=p*p,k+=p*q,l+=q*q,m+=r*p,n+=r*q,o+=r*r}var s,t=Math.abs(j*l-k*k),u=k*n-l*m,v=k*m-j*n;if(t>=u+v)if(0>u)0>v&&0>m?(v=0,-m>=j?(u=1,s=j+2*m+o):(u=-m/j,s=m*u+o)):(u=0,n>=0?(v=0,s=o):-n>=l?(v=1,s=l+2*n+o):(v=-n/l,s=n*v+o));else if(0>v)v=0,m>=0?(u=0,s=o):-m>=j?(u=1,s=j+2*m+o):(u=-m/j,s=m*u+o);else{var w=1/t;u*=w,v*=w,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o}else{var x,y,z,A;0>u?(x=k+m,y=l+n,y>x?(z=y-x,A=j-2*k+l,z>=A?(u=1,v=0,s=j+2*m+o):(u=z/A,v=1-u,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o)):(u=0,0>=y?(v=1,s=l+2*n+o):n>=0?(v=0,s=o):(v=-n/l,s=n*v+o))):0>v?(x=k+n,y=j+m,y>x?(z=y-x,A=j-2*k+l,z>=A?(v=1,u=0,s=l+2*n+o):(v=z/A,u=1-v,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o)):(v=0,0>=y?(u=1,s=j+2*m+o):m>=0?(u=0,s=o):(u=-m/j,s=m*u+o))):(z=l+n-k-m,0>=z?(u=0,v=1,s=l+2*n+o):(A=j-2*k+l,z>=A?(u=1,v=0,s=j+2*m+o):(u=z/A,v=1-u,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o)))}for(var B=1-u-v,i=0;i<d.length;++i)h[i]=B*a[i]+u*b[i]+v*c[i];return 0>s?0:s}var e=new Float64Array(4),f=new Float64Array(4),g=new Float64Array(4);b.exports=d},{}],111:[function(a,b,c){"use strict";function d(a){for(var b=a.length,c=0,d=0;b>d;++d)c=0|Math.max(c,a[d].length);return c-1}function e(a,b){for(var c=a.length,d=l.mallocUint8(c),e=0;c>e;++e)d[e]=a[e]<b|0;return d}function f(a,b){for(var c=a.length,d=b*(b+1)/2*c|0,e=l.mallocUint32(2*d),f=0,g=0;c>g;++g)for(var h=a[g],b=h.length,i=0;b>i;++i)for(var j=0;i>j;++j){var n=h[j],o=h[i];e[f++]=0|Math.min(n,o),e[f++]=0|Math.max(n,o)}var p=f/2|0;m(k(e,[p,2]));for(var q=2,g=2;f>g;g+=2)e[g-2]===e[g]&&e[g-1]===e[g+1]||(e[q++]=e[g],e[q++]=e[g+1]);return k(e,[q/2|0,2])}function g(a,b,c,d){for(var e=a.data,f=a.shape[0],g=l.mallocDouble(f),h=0,i=0;f>i;++i){var j=e[2*i],m=e[2*i+1];if(c[j]!==c[m]){var n=b[j],o=b[m];e[2*h]=j,e[2*h+1]=m,g[h++]=(o-d)/(o-n)}}return a.shape[0]=h,k(g,[h])}function h(a,b){var c=l.mallocInt32(2*b),d=a.shape[0],e=a.data;c[0]=0;for(var f=0,g=0;d>g;++g){var h=e[2*g];if(h!==f){for(c[2*f+1]=g;++f<h;)c[2*f]=g,c[2*f+1]=g;c[2*f]=g}}for(c[2*f+1]=d;++f<b;)c[2*f]=c[2*f+1]=d;return c}function i(a){for(var b=0|a.shape[0],c=a.data,d=new Array(b),e=0;b>e;++e)d[e]=[c[2*e],c[2*e+1]];return d}function j(a,b,c,j){c=c||0,"undefined"==typeof j&&(j=d(a));var k=a.length;if(0===k||1>j)return{cells:[],vertexIds:[],vertexWeights:[]};var m=e(b,+c),o=f(a,j),p=g(o,b,m,+c),q=h(o,0|b.length),r=n(j)(a,o.data,q,m),s=i(o),t=[].slice.call(p.data,0,p.shape[0]);return l.free(m),l.free(o.data),l.free(p.data),l.free(q),{cells:r,vertexIds:s,vertexWeights:t}}b.exports=j;var k=a("ndarray"),l=a("typedarray-pool"),m=a("ndarray-sort"),n=a("./lib/codegen")},{"./lib/codegen":112,ndarray:208,"ndarray-sort":115,"typedarray-pool":233}],112:[function(a,b,c){"use strict";function d(a){function b(a){if(!(a.length<=0)){j.push("R.push(");for(var b=0;b<a.length;++b){var c=a[b];b>0&&j.push(","),j.push("[");for(var d=0;d<c.length;++d){var e=c[d];d>0&&j.push(","),j.push("B(C,E,c[",e[0],"],c[",e[1],"])")}j.push("]")}j.push(");")}}var c=0,d=new Array(a+1);d[0]=[[]];for(var e=1;a>=e;++e)for(var h=d[e]=g(e),i=0;i<h.length;++i)c=Math.max(c,h[e].length);for(var j=["function B(C,E,i,j){","var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];","while(l<h){","var m=(l+h)>>1,v=E[2*m+1];","if(v===b){return m}","if(b<v){h=m}else{l=m+1}","}","return l;","};","function getContour",a,"d(F,E,C,S){","var n=F.length,R=[];","for(var i=0;i<n;++i){var c=F[i],l=c.length;"],e=a+1;e>1;--e){a+1>e&&j.push("else "),j.push("if(l===",e,"){");for(var k=[],i=0;e>i;++i)k.push("(S[c["+i+"]]<<"+i+")");j.push("var M=",k.join("+"),";if(M===0||M===",(1<<e)-1,"){continue}switch(M){");for(var h=d[e-1],i=0;i<h.length;++i)j.push("case ",i,":"),b(h[i]),j.push("break;");j.push("}}")}j.push("}return R;};return getContour",a,"d");var l=new Function("pool",j.join(""));return l(f)}function e(a){var b=h[a];return b||(b=h[a]=d(a)),b}b.exports=e;var f=a("typedarray-pool"),g=a("marching-simplex-table"),h={}},{"marching-simplex-table":113,"typedarray-pool":233}],113:[function(a,b,c){"use strict";function d(a,b,c){for(var d=new Array(a),e=0;a>e;++e)d[e]=0,e===b&&(d[e]+=.5),e===c&&(d[e]+=.5);return d}function e(a,b){if(0===b||b===(1<<a+1)-1)return[];for(var c=[],e=[],f=0;a>=f;++f)if(b&1<<f){c.push(d(a,f-1,f-1)),e.push(null);for(var h=0;a>=h;++h)~b&1<<h&&(c.push(d(a,f-1,h-1)),e.push([f,h]))}var i=g(c),j=[];a:for(var f=0;f<i.length;++f){for(var k=i[f],l=[],h=0;h<k.length;++h){if(!e[k[h]])continue a;l.push(e[k[h]].slice())}j.push(l)}return j}function f(a){for(var b=1<<a+1,c=new Array(b),d=0;b>d;++d)c[d]=e(a,d);return c}b.exports=f;var g=a("convex-hull")},{"convex-hull":60}],114:[function(a,b,c){"use strict";function d(a){switch(a){case"uint8":return[i.mallocUint8,i.freeUint8];case"uint16":return[i.mallocUint16,i.freeUint16];case"uint32":return[i.mallocUint32,i.freeUint32];case"int8":return[i.mallocInt8,i.freeInt8];case"int16":return[i.mallocInt16,i.freeInt16];case"int32":return[i.mallocInt32,i.freeInt32];case"float32":return[i.mallocFloat,i.freeFloat];case"float64":return[i.mallocDouble,i.freeDouble];default:return null}}function e(a){for(var b=[],c=0;a>c;++c)b.push("s"+c);for(var c=0;a>c;++c)b.push("n"+c);for(var c=1;a>c;++c)b.push("d"+c);for(var c=1;a>c;++c)b.push("e"+c);for(var c=1;a>c;++c)b.push("f"+c);return b}function f(a,b){function c(a){return"generic"===b?["data.get(",a,")"].join(""):["data[",a,"]"].join("")}function f(a,c){return"generic"===b?["data.set(",a,",",c,")"].join(""):["data[",a,"]=",c].join("")}var g=["'use strict'"],h=["ndarrayInsertionSort",a.join("d"),b].join(""),i=["left","right","data","offset"].concat(e(a.length)),j=d(b),k=["i,j,cptr,ptr=left*s0+offset"];if(a.length>1){for(var l=[],m=1;m<a.length;++m)k.push("i"+m),l.push("n"+m);j?k.push("scratch=malloc("+l.join("*")+")"):k.push("scratch=new Array("+l.join("*")+")"),k.push("dptr","sptr","a","b")}else k.push("scratch");if(g.push(["function ",h,"(",i.join(","),"){var ",k.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),a.length>1){g.push("dptr=0;sptr=ptr");for(var m=a.length-1;m>=0;--m){var n=a[m];0!==n&&g.push(["for(i",n,"=0;i",n,"<n",n,";++i",n,"){"].join(""))}g.push("scratch[dptr++]=",c("sptr"));for(var m=0;m<a.length;++m){var n=a[m];0!==n&&g.push("sptr+=d"+n,"}")}g.push("__g:while(j-->left){","dptr=0","sptr=cptr-s0");for(var m=1;m<a.length;++m)1===m&&g.push("__l:"),g.push(["for(i",m,"=0;i",m,"<n",m,";++i",m,"){"].join(""));g.push(["a=",c("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join(""));for(var m=a.length-1;m>=1;--m)g.push("sptr+=e"+m,"dptr+=f"+m,"}");g.push("dptr=cptr;sptr=cptr-s0");for(var m=a.length-1;m>=0;--m){var n=a[m];0!==n&&g.push(["for(i",n,"=0;i",n,"<n",n,";++i",n,"){"].join(""))}g.push(f("dptr",c("sptr")));for(var m=0;m<a.length;++m){var n=a[m];0!==n&&g.push(["dptr+=d",n,";sptr+=d",n].join(""),"}")}g.push("cptr-=s0\n}"),g.push("dptr=cptr;sptr=0");for(var m=a.length-1;m>=0;--m){var n=a[m];0!==n&&g.push(["for(i",n,"=0;i",n,"<n",n,";++i",n,"){"].join(""))}g.push(f("dptr","scratch[sptr++]"));for(var m=0;m<a.length;++m){var n=a[m];0!==n&&g.push("dptr+=d"+n,"}")}}else g.push("scratch="+c("ptr"),"while((j-->left)&&("+c("cptr-s0")+">scratch)){",f("cptr",c("cptr-s0")),"cptr-=s0","}",f("cptr","scratch"));if(g.push("}"),a.length>1&&j&&g.push("free(scratch)"),g.push("} return "+h),j){var o=new Function("malloc","free",g.join("\n"));return o(j[0],j[1])}var o=new Function(g.join("\n"));return o()}function g(a,b,c){function f(a){return["(offset+",a,"*s0)"].join("")}function g(a){return"generic"===b?["data.get(",a,")"].join(""):["data[",a,"]"].join("")}function h(a,c){return"generic"===b?["data.set(",a,",",c,")"].join(""):["data[",a,"]=",c].join("")}function i(b,c,d){if(1===b.length)v.push("ptr0="+f(b[0]));else for(var e=0;e<b.length;++e)v.push(["b_ptr",e,"=s0*",b[e]].join(""));c&&v.push("pivot_ptr=0"),v.push("ptr_shift=offset");for(var e=a.length-1;e>=0;--e){var g=a[e];0!==g&&v.push(["for(i",g,"=0;i",g,"<n",g,";++i",g,"){"].join(""))}if(b.length>1)for(var e=0;e<b.length;++e)v.push(["ptr",e,"=b_ptr",e,"+ptr_shift"].join(""));v.push(d),c&&v.push("++pivot_ptr");for(var e=0;e<a.length;++e){var g=a[e];0!==g&&(b.length>1?v.push("ptr_shift+=d"+g):v.push("ptr0+=d"+g),v.push("}"))}}function k(b,c,d,e){if(1===c.length)v.push("ptr0="+f(c[0]));else{for(var g=0;g<c.length;++g)v.push(["b_ptr",g,"=s0*",c[g]].join(""));v.push("ptr_shift=offset")}d&&v.push("pivot_ptr=0"),b&&v.push(b+":");for(var g=1;g<a.length;++g)v.push(["for(i",g,"=0;i",g,"<n",g,";++i",g,"){"].join(""));if(c.length>1)for(var g=0;g<c.length;++g)v.push(["ptr",g,"=b_ptr",g,"+ptr_shift"].join(""));v.push(e);for(var g=a.length-1;g>=1;--g)d&&v.push("pivot_ptr+=f"+g),c.length>1?v.push("ptr_shift+=e"+g):v.push("ptr0+=e"+g),v.push("}")}function l(){a.length>1&&y&&v.push("free(pivot1)","free(pivot2)")}function m(b,c){var d="el"+b,e="el"+c;if(a.length>1){var h="__l"+ ++z;k(h,[d,e],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",d,";",d,"=",e,";",e,"=tmp0;break ",h,"}\n","if(comp<0){break ",h,"}"].join(""))}else v.push(["if(",g(f(d)),">",g(f(e)),"){tmp0=",d,";",d,"=",e,";",e,"=tmp0}"].join(""))}function n(b,c){a.length>1?i([b,c],!1,h("ptr0",g("ptr1"))):v.push(h(f(b),g(f(c))))}function o(b,c,d){if(a.length>1){var e="__l"+ ++z;k(e,[c],!0,[b,"=",g("ptr0"),"-pivot",d,"[pivot_ptr]\n","if(",b,"!==0){break ",e,"}"].join(""))}else v.push([b,"=",g(f(c)),"-pivot",d].join(""))}function p(b,c){a.length>1?i([b,c],!1,["tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1","tmp")].join("")):v.push(["ptr0=",f(b),"\n","ptr1=",f(c),"\n","tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1","tmp")].join(""))}function q(b,c,d){a.length>1?(i([b,c,d],!1,["tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1",g("ptr2")),"\n",h("ptr2","tmp")].join("")),v.push("++"+c,"--"+d)):v.push(["ptr0=",f(b),"\n","ptr1=",f(c),"\n","ptr2=",f(d),"\n","++",c,"\n","--",d,"\n","tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1",g("ptr2")),"\n",h("ptr2","tmp")].join(""))}function r(a,b){p(a,b),v.push("--"+b)}function s(b,c,d){a.length>1?i([b,c],!0,[h("ptr0",g("ptr1")),"\n",h("ptr1",["pivot",d,"[pivot_ptr]"].join(""))].join("")):v.push(h(f(b),g(f(c))),h(f(c),"pivot"+d))}function t(b,c){v.push(["if((",c,"-",b,")<=",j,"){\n","insertionSort(",b,",",c,",data,offset,",e(a.length).join(","),")\n","}else{\n",w,"(",b,",",c,",data,offset,",e(a.length).join(","),")\n","}"].join(""))}function u(b,c,d){a.length>1?(v.push(["__l",++z,":while(true){"].join("")),i([b],!0,["if(",g("ptr0"),"!==pivot",c,"[pivot_ptr]){break __l",z,"}"].join("")),v.push(d,"}")):v.push(["while(",g(f(b)),"===pivot",c,"){",d,"}"].join(""))}var v=["'use strict'"],w=["ndarrayQuickSort",a.join("d"),b].join(""),x=["left","right","data","offset"].concat(e(a.length)),y=d(b),z=0;v.push(["function ",w,"(",x.join(","),"){"].join(""));var A=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(a.length>1){for(var B=[],C=1;C<a.length;++C)B.push("n"+C),A.push("i"+C);for(var C=0;8>C;++C)A.push("b_ptr"+C);A.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+B.join("*")),y?A.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):A.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else A.push("pivot1","pivot2");if(v.push("var "+A.join(",")),m(1,2),m(4,5),m(1,3),m(2,3),m(1,4),m(3,4),m(2,5),m(2,3),m(4,5),a.length>1?i(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",h("ptr5","x"),"\n",h("ptr6","y"),"\n",h("ptr7","z")].join("")):v.push(["pivot1=",g(f("el2")),"\n","pivot2=",g(f("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(f("el1")),"\n","y=",g(f("el3")),"\n","z=",g(f("el5")),"\n",h(f("index1"),"x"),"\n",h(f("index3"),"y"),"\n",h(f("index5"),"z")].join("")),n("index2","left"),n("index4","right"),v.push("if(pivots_are_equal){"),v.push("for(k=less;k<=great;++k){"),o("comp","k",1),v.push("if(comp===0){continue}"),v.push("if(comp<0){"),v.push("if(k!==less){"),p("k","less"),v.push("}"),v.push("++less"),v.push("}else{"),v.push("while(true){"),o("comp","great",1),v.push("if(comp>0){"),v.push("great--"),v.push("}else if(comp<0){"),q("k","less","great"),v.push("break"),v.push("}else{"),r("k","great"),v.push("break"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}else{"),v.push("for(k=less;k<=great;++k){"),o("comp_pivot1","k",1),v.push("if(comp_pivot1<0){"),v.push("if(k!==less){"),p("k","less"),v.push("}"),v.push("++less"),v.push("}else{"),o("comp_pivot2","k",2),v.push("if(comp_pivot2>0){"),v.push("while(true){"),o("comp","great",2),v.push("if(comp>0){"),v.push("if(--great<k){break}"),v.push("continue"),v.push("}else{"),o("comp","great",1),v.push("if(comp<0){"),q("k","less","great"),v.push("}else{"),r("k","great"),v.push("}"),v.push("break"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),s("left","(less-1)",1),s("right","(great+1)",2),t("left","(less-2)"),t("(great+2)","right"),v.push("if(pivots_are_equal){"),l(),v.push("return"),v.push("}"),v.push("if(less<index1&&great>index5){"),u("less",1,"++less"),u("great",2,"--great"),v.push("for(k=less;k<=great;++k){"),o("comp_pivot1","k",1),v.push("if(comp_pivot1===0){"),v.push("if(k!==less){"),p("k","less"),v.push("}"),v.push("++less"),v.push("}else{"),o("comp_pivot2","k",2),v.push("if(comp_pivot2===0){"),v.push("while(true){"),o("comp","great",2),v.push("if(comp===0){"),v.push("if(--great<k){break}"),v.push("continue"),v.push("}else{"),o("comp","great",1),v.push("if(comp<0){"),q("k","less","great"),v.push("}else{"),r("k","great"),v.push("}"),v.push("break"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),l(),t("less","great"),v.push("}return "+w),a.length>1&&y){var D=new Function("insertionSort","malloc","free",v.join("\n"));return D(c,y[0],y[1])}var D=new Function("insertionSort",v.join("\n"));return D(c)}function h(a,b){var c=["'use strict'"],d=["ndarraySortWrapper",a.join("d"),b].join(""),h=["array"];c.push(["function ",d,"(",h.join(","),"){"].join(""));for(var i=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],k=0;k<a.length;++k)i.push(["s",k,"=stride[",k,"]|0,n",k,"=shape[",k,"]|0"].join(""));for(var l=new Array(a.length),m=[],k=0;k<a.length;++k){var n=a[k];0!==n&&(0===m.length?l[n]="1":l[n]=m.join("*"),m.push("n"+n))}for(var o=-1,p=-1,k=0;k<a.length;++k){var q=a[k];0!==q&&(o>0?i.push(["d",q,"=s",q,"-d",o,"*n",o].join("")):i.push(["d",q,"=s",q].join("")),o=q);var n=a.length-1-k;0!==n&&(p>0?i.push(["e",n,"=s",n,"-e",p,"*n",p,",f",n,"=",l[n],"-f",p,"*n",p].join("")):i.push(["e",n,"=s",n,",f",n,"=",l[n]].join("")),p=n)}c.push("var "+i.join(","));var r=["0","n0-1","data","offset"].concat(e(a.length));c.push(["if(n0<=",j,"){","insertionSort(",r.join(","),")}else{","quickSort(",r.join(","),")}"].join("")),c.push("}return "+d);var s=new Function("insertionSort","quickSort",c.join("\n")),t=f(a,b),u=g(a,b,t);return s(t,u)}var i=a("typedarray-pool"),j=32;b.exports=h},{"typedarray-pool":233}],115:[function(a,b,c){"use strict";function d(a){var b=a.order,c=a.dtype,d=[b,c],g=d.join(":"),h=f[g];return h||(f[g]=h=e(b,c)),h(a),a}var e=a("./lib/compile_sort.js"),f={};b.exports=d},{"./lib/compile_sort.js":114}],116:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.vbo=b,this.shader=c}function e(a){var b=a.gl,c=f(b,[0,0,0,1,1,0,1,1]),e=g(b,h.boxVert,h.lineFrag);return new d(a,c,e)}b.exports=e;var f=a("gl-buffer"),g=a("gl-shader"),h=a("./shaders"),i=d.prototype;i.bind=function(){var a=this.shader;this.vbo.bind(),this.shader.bind(),a.attributes.coord.pointer(),a.uniforms.screenBox=this.plot.screenBox},i.drawBox=function(){var a=[0,0],b=[0,0];return function(c,d,e,f,g){var h=this.plot,i=this.shader,j=h.gl;a[0]=c,a[1]=d,b[0]=e,b[1]=f,i.uniforms.lo=a,i.uniforms.hi=b,i.uniforms.color=g,j.drawArrays(j.TRIANGLE_STRIP,0,4)}}(),i.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":119,"gl-buffer":75,"gl-shader":154}],117:[function(a,b,c){"use strict";function d(a,b,c,d){this.plot=a,this.vbo=b,this.shader=c,this.tickShader=d,this.ticks=[[],[]]}function e(a,b){return a-b}function f(a){var b=a.gl,c=g(b),e=h(b,j.gridVert,j.gridFrag),f=h(b,j.tickVert,j.gridFrag),i=new d(a,c,e,f);return i}b.exports=f;var g=a("gl-buffer"),h=a("gl-shader"),i=a("binary-search-bounds"),j=a("./shaders"),k=d.prototype;k.draw=function(){var a=[0,0],b=[0,0],c=[0,0];return function(){for(var d=this.plot,e=this.vbo,f=this.shader,g=this.ticks,h=d.gl,i=d._tickBounds,j=d.dataBox,k=d.viewBox,l=d.gridLineWidth,m=d.gridLineColor,n=d.gridLineEnable,o=d.pixelRatio,p=0;2>p;++p){var q=i[p],r=i[p+2],s=r-q,t=.5*(j[p+2]+j[p]),u=j[p+2]-j[p];b[p]=2*s/u,a[p]=2*(q-t)/u}f.bind(),e.bind(),f.attributes.dataCoord.pointer(),f.uniforms.dataShift=a,f.uniforms.dataScale=b;for(var v=0,p=0;2>p;++p){c[0]=c[1]=0,c[p]=1,f.uniforms.dataAxis=c,f.uniforms.lineWidth=l[p]/(k[p+2]-k[p])*o,f.uniforms.color=m[p];var w=6*g[p].length;n[p]&&h.drawArrays(h.TRIANGLES,v,w),v+=w}}}(),k.drawTickMarks=function(){var a=[0,0],b=[0,0],c=[1,0],d=[0,1],f=[0,0],g=[0,0];return function(){for(var h=this.plot,j=this.vbo,k=this.tickShader,l=this.ticks,m=h.gl,n=h._tickBounds,o=h.dataBox,p=h.viewBox,q=h.pixelRatio,r=h.screenBox,s=r[2]-r[0],t=r[3]-r[1],u=p[2]-p[0],v=p[3]-p[1],w=0;2>w;++w){var x=n[w],y=n[w+2],z=y-x,A=.5*(o[w+2]+o[w]),B=o[w+2]-o[w];b[w]=2*z/B,a[w]=2*(x-A)/B}b[0]*=u/s,a[0]*=u/s,b[1]*=v/t,a[1]*=v/t,k.bind(),j.bind(),k.attributes.dataCoord.pointer();var C=k.uniforms;C.dataShift=a,C.dataScale=b;var D=h.tickMarkLength,E=h.tickMarkWidth,F=h.tickMarkColor,G=0,H=6*l[0].length,I=Math.min(i.ge(l[0],(o[0]-n[0])/(n[2]-n[0]),e),l[0].length),J=Math.min(i.gt(l[0],(o[2]-n[0])/(n[2]-n[0]),e),l[0].length),K=G+6*I,L=6*Math.max(0,J-I),M=Math.min(i.ge(l[1],(o[1]-n[1])/(n[3]-n[1]),e),l[1].length),N=Math.min(i.gt(l[1],(o[3]-n[1])/(n[3]-n[1]),e),l[1].length),O=H+6*M,P=6*Math.max(0,N-M);f[0]=2*(p[0]-D[1])/s-1,f[1]=(p[3]+p[1])/t-1,g[0]=D[1]*q/s,g[1]=E[1]*q/t,C.color=F[1],C.tickScale=g,C.dataAxis=d,C.screenOffset=f,m.drawArrays(m.TRIANGLES,O,P),f[0]=(p[2]+p[0])/s-1,f[1]=2*(p[1]-D[0])/t-1,g[0]=E[0]*q/s,g[1]=D[0]*q/t,C.color=F[0],C.tickScale=g,C.dataAxis=c,C.screenOffset=f,m.drawArrays(m.TRIANGLES,K,L),f[0]=2*(p[2]+D[3])/s-1,f[1]=(p[3]+p[1])/t-1,g[0]=D[3]*q/s,g[1]=E[3]*q/t,C.color=F[3],C.tickScale=g,C.dataAxis=d,C.screenOffset=f,m.drawArrays(m.TRIANGLES,O,P),f[0]=(p[2]+p[0])/s-1,f[1]=2*(p[3]+D[2])/t-1,g[0]=E[2]*q/s,g[1]=D[2]*q/t,C.color=F[2],C.tickScale=g,C.dataAxis=c,C.screenOffset=f,m.drawArrays(m.TRIANGLES,K,L)}}(),k.update=function(){var a=[1,1,-1,-1,1,-1],b=[1,-1,1,1,-1,-1];return function(c){for(var d=c.ticks,e=c.bounds,f=new Float32Array(18*(d[0].length+d[1].length)),g=(this.plot.zeroLineEnable,0),h=[[],[]],i=0;2>i;++i)for(var j=h[i],k=d[i],l=e[i],m=e[i+2],n=0;n<k.length;++n){var o=(k[n].x-l)/(m-l);j.push(o);for(var p=0;6>p;++p)f[g++]=o,f[g++]=a[p],f[g++]=b[p]}this.ticks=h,this.vbo.update(f)}}(),k.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":119,"binary-search-bounds":121,"gl-buffer":75,"gl-shader":154}],118:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.vbo=b,this.shader=c}function e(a){var b=a.gl,c=f(b,[-1,-1,-1,1,1,-1,1,1]),e=g(b,h.lineVert,h.lineFrag),i=new d(a,c,e);return i}b.exports=e;var f=a("gl-buffer"),g=a("gl-shader"),h=a("./shaders"),i=d.prototype;i.bind=function(){var a=this.shader;this.vbo.bind(),this.shader.bind(),a.attributes.coord.pointer(),a.uniforms.screenBox=this.plot.screenBox},i.drawLine=function(){var a=[0,0],b=[0,0];return function(c,d,e,f,g,h){var i=this.plot,j=this.shader,k=i.gl;a[0]=c,a[1]=d,b[0]=e,b[1]=f,j.uniforms.start=a,j.uniforms.end=b,j.uniforms.width=g*i.pixelRatio,j.uniforms.color=h,k.drawArrays(k.TRIANGLE_STRIP,0,4)}}(),i.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":119,"gl-buffer":75,"gl-shader":154}],119:[function(a,b,c){"use strict";var d="#define GLSLIFY 1\nprecision lowp float;\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n";b.exports={lineVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n",lineFrag:d,textVert:"#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n",textFrag:d,gridVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n",gridFrag:d,boxVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n",tickVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"}},{}],120:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.vbo=b,this.shader=c,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function e(a){var b=a.gl,c=f(b),e=g(b,j.textVert,j.textFrag),h=new d(a,c,e);return h}b.exports=e;var f=a("gl-buffer"),g=a("gl-shader"),h=a("text-cache"),i=a("binary-search-bounds"),j=a("./shaders"),k=d.prototype;k.drawTicks=function(){var a=[0,0],b=[0,0],c=[0,0];return function(d){var e=this.plot,f=this.shader,g=this.tickX[d],h=this.tickOffset[d],j=e.gl,k=e.viewBox,l=e.dataBox,m=e.screenBox,n=e.pixelRatio,o=e.tickEnable,p=e.tickPad,q=e.tickColor,r=e.tickAngle,s=(e.tickMarkLength,e.labelEnable),t=e.labelPad,u=e.labelColor,v=e.labelAngle,w=this.labelOffset[d],x=this.labelCount[d],y=i.lt(g,l[d]),z=i.le(g,l[d+2]);a[0]=a[1]=0,a[d]=1,b[d]=(k[2+d]+k[d])/(m[2+d]-m[d])-1;var A=2/m[2+(1^d)]-m[1^d];b[1^d]=A*k[1^d]-1,o[d]&&(b[1^d]-=A*n*p[d],z>y&&(f.uniforms.dataAxis=a,f.uniforms.screenOffset=b,f.uniforms.color=q[d],f.uniforms.angle=r[d],j.drawArrays(j.TRIANGLES,h[y],h[z]-h[y]))),s[d]&&(b[1^d]-=A*n*t[d],f.uniforms.dataAxis=c,f.uniforms.screenOffset=b,f.uniforms.color=u[d],f.uniforms.angle=v[d],j.drawArrays(j.TRIANGLES,w,x)),b[1^d]=A*k[2+(1^d)]-1,o[d+2]&&(b[1^d]+=A*n*p[d+2],z>y&&(f.uniforms.dataAxis=a,f.uniforms.screenOffset=b,f.uniforms.color=q[d+2],f.uniforms.angle=r[d+2],j.drawArrays(j.TRIANGLES,h[y],h[z]-h[y]))),s[d+2]&&(b[1^d]+=A*n*t[d+2],f.uniforms.dataAxis=c,f.uniforms.screenOffset=b,f.uniforms.color=u[d+2],f.uniforms.angle=v[d+2],j.drawArrays(j.TRIANGLES,w,x))}}(),k.drawTitle=function(){var a=[0,0],b=[0,0];return function(){for(var c=this.plot,d=this.shader,e=c.gl,f=c.screenBox,g=c.titleCenter,h=c.titleAngle,i=c.titleColor,g=c.titleCenter,j=c.pixelRatio,k=0;2>k;++k)b[k]=2*(g[k]*j-f[k])/(f[2+k]-f[k])-1;d.bind(),d.uniforms.dataAxis=a,d.uniforms.screenOffset=b,d.uniforms.angle=h,d.uniforms.color=i,e.drawArrays(e.TRIANGLES,this.titleOffset,this.titleCount)}}(),k.bind=function(){var a=[0,0],b=[0,0],c=[0,0];return function(){var d=this.plot,e=this.shader,f=d._tickBounds,g=d.dataBox,h=d.screenBox,i=d.viewBox;e.bind();for(var j=0;2>j;++j){var k=f[j],l=f[j+2],m=l-k,n=.5*(g[j+2]+g[j]),o=g[j+2]-g[j],p=i[j],q=i[j+2],r=q-p,s=h[j],t=h[j+2],u=t-s;b[j]=2*m/o*r/u,a[j]=2*(k-n)/o*r/u}c[1]=2*d.pixelRatio/(h[3]-h[1]),c[0]=c[1]*(h[3]-h[1])/(h[2]-h[0]),e.uniforms.dataScale=b,e.uniforms.dataShift=a,e.uniforms.textScale=c,this.vbo.bind(),e.attributes.textCoordinate.pointer()}}(),k.update=function(a){for(var b=[],c=a.ticks,d=a.bounds,e=0;2>e;++e){for(var f=[Math.floor(b.length/3)],g=[-(1/0)],i=c[e],j=0;j<i.length;++j){for(var k=i[j],l=k.x,m=k.text,n=k.font||"sans-serif",o=k.fontSize||12,p=h(n,m).data,q=1/(d[e+2]-d[e]),r=d[e],s=0;s<p.length;s+=2)b.push(p[s]*o,-p[s+1]*o,(l-r)*q);f.push(Math.floor(b.length/3)),g.push(l)}this.tickOffset[e]=f,this.tickX[e]=g}for(var e=0;2>e;++e){this.labelOffset[e]=Math.floor(b.length/3);for(var p=h(a.labelFont[e],a.labels[e]).data,o=a.labelSize[e],j=0;j<p.length;j+=2)b.push(p[j]*o,-p[j+1]*o,0);this.labelCount[e]=Math.floor(b.length/3)-this.labelOffset[e]}this.titleOffset=Math.floor(b.length/3);for(var p=h(a.titleFont,a.title).data,o=a.titleSize,j=0;j<p.length;j+=2)b.push(p[j]*o,-p[j+1]*o,0);this.titleCount=Math.floor(b.length/3)-this.titleOffset,this.vbo.update(b)},k.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":119,"binary-search-bounds":121,"gl-buffer":75,"gl-shader":154,"text-cache":228}],121:[function(a,b,c){"use strict";function d(a,b,c,d,e){var f=["function ",a,"(a,l,h,",d.join(","),"){",e?"":"var i=",c?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"]; 34 return e?b.indexOf("c")<0?f.push(";if(x===y){return m}else if(x<=y){"):f.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):f.push(";if(",b,"){i=m;"),c?f.push("l=m+1}else{h=m-1}"):f.push("h=m-1}else{l=m+1}"),f.push("}"),e?f.push("return -1};"):f.push("return i};"),f.join("")}function e(a,b,c,e){var f=new Function([d("A","x"+a+"y",b,["y"],e),d("P","c(x,y)"+a+"0",b,["y","c"],e),"function dispatchBsearch",c,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",c].join(""));return f()}b.exports={ge:e(">=",!1,"GE"),gt:e(">",!1,"GT"),lt:e("<",!0,"LT"),le:e("<=",!0,"LE"),eq:e("-",!0,"EQ",!0)}},{}],122:[function(a,b,c){"use strict";function d(a,b){this.gl=a,this.pickBuffer=b,this.screenBox=[0,0,a.drawingBufferWidth,a.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-(1/0),-(1/0)],this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function e(a){for(var b=a.slice(),c=0;c<b.length;++c)b[c]=b[c].slice();return b}function f(a,b){return a.x-b.x}function g(a){var b=a.gl,c=h(b,[b.drawingBufferWidth,b.drawingBufferHeight]),e=new d(b,c);return e.grid=i(e),e.text=j(e),e.line=k(e),e.box=l(e),e.update(a),e}b.exports=g;var h=a("gl-select-static"),i=a("./lib/grid"),j=a("./lib/text"),k=a("./lib/line"),l=a("./lib/box"),m=d.prototype;m.setDirty=function(){this.dirty=this.pickDirty=!0},m.setOverlayDirty=function(){this.dirty=!0},m.nextDepthValue=function(){return this._depthCounter++/65536},m.draw=function(){return function(){var a=this.gl,b=this.screenBox,c=this.viewBox,d=this.dataBox,e=this.pixelRatio,f=this.grid,g=this.line,h=this.text,i=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,a.bindFramebuffer(a.FRAMEBUFFER,null),a.enable(a.SCISSOR_TEST),a.disable(a.DEPTH_TEST),a.depthFunc(a.LESS),a.depthMask(!1),a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD,a.FUNC_ADD),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.scissor(b[0],b[1],b[2]-b[0],b[3]-b[1]);var j=this.borderColor;a.clearColor(j[0]*j[3],j[1]*j[3],j[2]*j[3],j[3]),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),a.scissor(c[0],c[1],c[2]-c[0],c[3]-c[1]),a.viewport(c[0],c[1],c[2]-c[0],c[3]-c[1]);var k=this.backgroundColor;a.clearColor(k[0]*k[3],k[1]*k[3],k[2]*k[3],k[3]),a.clear(a.COLOR_BUFFER_BIT),f.draw();var l=this.zeroLineEnable,m=this.zeroLineColor,n=this.zeroLineWidth;if(l[0]||l[1]){g.bind();for(var o=0;2>o;++o)if(l[o]&&d[o]<=0&&d[o+2]>=0){var p=b[o]-d[o]*(b[o+2]-b[o])/(d[o+2]-d[o]);0===o?g.drawLine(p,b[1],p,b[3],n[o],m[o]):g.drawLine(b[0],p,b[2],p,n[o],m[o])}}for(var o=0;o<i.length;++o)i[o].draw();a.viewport(b[0],b[1],b[2]-b[0],b[3]-b[1]),a.scissor(b[0],b[1],b[2]-b[0],b[3]-b[1]),this.grid.drawTickMarks(),g.bind();var q=this.borderLineEnable,r=this.borderLineWidth,s=this.borderLineColor;q[1]&&g.drawLine(c[0],c[1]-.5*r[1]*e,c[0],c[3]+.5*r[3]*e,r[1],s[1]),q[0]&&g.drawLine(c[0]-.5*r[0]*e,c[1],c[2]+.5*r[2]*e,c[1],r[0],s[0]),q[3]&&g.drawLine(c[2],c[1]-.5*r[1]*e,c[2],c[3]+.5*r[3]*e,r[3],s[3]),q[2]&&g.drawLine(c[0]-.5*r[0]*e,c[3],c[2]+.5*r[2]*e,c[3],r[2],s[2]),h.bind();for(var o=0;2>o;++o)h.drawTicks(o);this.titleEnable&&h.drawTitle();for(var t=this.overlays,o=0;o<t.length;++o)t[o].draw();a.disable(a.SCISSOR_TEST),a.disable(a.BLEND),a.depthMask(!0)}}}(),m.drawPick=function(){return function(){var a=this.pickBuffer;this.gl;this._pickTimeout=null,a.begin();for(var b=1,c=this.objects,d=0;d<c.length;++d)b=c[d].drawPick(b);a.end()}}(),m.pick=function(){return function(a,b){var c=this.pixelRatio,d=this.pickPixelRatio,e=this.viewBox,f=0|Math.round((a-e[0]/c)*d),g=0|Math.round((b-e[1]/c)*d),h=this.pickBuffer.query(f,g,this.pickRadius);if(!h)return null;for(var i=h.id+(h.value[0]<<8)+(h.value[1]<<16)+(h.value[2]<<24),j=this.objects,k=0;k<j.length;++k){var l=j[k].pick(f,g,i);if(l)return l}return null}}(),m.setScreenBox=function(a){var b=this.screenBox,c=this.pixelRatio;b[0]=0|Math.round(a[0]*c),b[1]=0|Math.round(a[1]*c),b[2]=0|Math.round(a[2]*c),b[3]=0|Math.round(a[3]*c),this.setDirty()},m.setDataBox=function(a){var b=this.dataBox,c=b[0]!==a[0]||b[1]!==a[1]||b[2]!==a[2]||b[3]!==a[3];c&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],this.setDirty())},m.setViewBox=function(a){var b=this.pixelRatio,c=this.viewBox;c[0]=0|Math.round(a[0]*b),c[1]=0|Math.round(a[1]*b),c[2]=0|Math.round(a[2]*b),c[3]=0|Math.round(a[3]*b);var d=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((a[2]-a[0])*d),0|Math.round((a[3]-a[1])*d)],this.setDirty()},m.update=function(a){a=a||{};var b=this.gl;this.pixelRatio=a.pixelRatio||1;var c=this.pixelRatio;this.pickPixelRatio=Math.max(c,1),this.setScreenBox(a.screenBox||[0,0,b.drawingBufferWidth/c,b.drawingBufferHeight/c]);this.screenBox;this.setViewBox(a.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/c,.125*(this.screenBox[3]-this.screenBox[1])/c,.875*(this.screenBox[2]-this.screenBox[0])/c,.875*(this.screenBox[3]-this.screenBox[1])/c]);var d=this.viewBox,g=(d[2]-d[0])/(d[3]-d[1]);this.setDataBox(a.dataBox||[-10,-10/g,10,10/g]),this.borderColor=(a.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(a.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(a.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(a.gridLineWidth||[1,1]).slice(),this.gridLineColor=e(a.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(a.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(a.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=e(a.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(a.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(a.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=e(a.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(a.titleCenter||[.5*(d[0]+d[2])/c,(d[3]+120)/c]).slice(),this.titleEnable=!("titleEnable"in a&&!a.titleEnable),this.titleAngle=a.titleAngle||0,this.titleColor=(a.titleColor||[0,0,0,1]).slice(),this.labelPad=(a.labelPad||[15,15,15,15]).slice(),this.labelAngle=(a.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(a.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=e(a.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(a.tickPad||[15,15,15,15]).slice(),this.tickAngle=(a.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(a.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=e(a.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(a.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(a.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=e(a.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=a.ticks||[[],[]],i=this._tickBounds;i[0]=i[1]=1/0,i[2]=i[3]=-(1/0);for(var j=0;2>j;++j){var k=h[j].slice(0);0!==k.length&&(k.sort(f),i[j]=Math.min(i[j],k[0].x),i[j+2]=Math.max(i[j+2],k[k.length-1].x))}this.grid.update({bounds:i,ticks:h}),this.text.update({bounds:i,ticks:h,labels:a.labels||["x","y"],labelSize:a.labelSize||[12,12],labelFont:a.labelFont||["sans-serif","sans-serif"],title:a.title||"",titleSize:a.titleSize||18,titleFont:a.titleFont||"sans-serif"}),this.setDirty()},m.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var a=this.objects.length-1;a>=0;--a)this.objects[a].dispose();this.objects.length=0;for(var a=this.overlays.length-1;a>=0;--a)this.overlays[a].dispose();this.overlays.length=0,this.gl=null},m.addObject=function(a){this.objects.indexOf(a)<0&&(this.objects.push(a),this.setDirty())},m.removeObject=function(a){for(var b=this.objects,c=0;c<b.length;++c)if(b[c]===a){b.splice(c,1),this.setDirty();break}},m.addOverlay=function(a){this.overlays.indexOf(a)<0&&(this.overlays.push(a),this.setOverlayDirty())},m.removeOverlay=function(a){for(var b=this.overlays,c=0;c<b.length;++c)if(b[c]===a){b.splice(c,1),this.setOverlayDirty();break}}},{"./lib/box":116,"./lib/grid":117,"./lib/line":118,"./lib/text":120,"gl-select-static":153}],123:[function(a,b,c){var d=a("gl-shader"),e="precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}",f="precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}";b.exports=function(a){return d(a,e,f,null,[{name:"position",type:"vec2"}])}},{"gl-shader":154}],124:[function(a,b,c){"use strict";function d(a,b){a=a||document.body,b=b||{};var c=[.01,1/0];"distanceLimits"in b&&(c[0]=b.distanceLimits[0],c[1]=b.distanceLimits[1]),"zoomMin"in b&&(c[0]=b.zoomMin),"zoomMax"in b&&(c[1]=b.zoomMax);var d=f({center:b.center||[0,0,0],up:b.up||[0,1,0],eye:b.eye||[0,0,10],mode:b.mode||"orbit",distanceLimits:c}),i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=0,k=a.clientWidth,l=a.clientHeight,m={view:d,element:a,delay:b.delay||16,rotateSpeed:b.rotateSpeed||1,zoomSpeed:b.zoomSpeed||1,translateSpeed:b.translateSpeed||1,flipX:!!b.flipX,flipY:!!b.flipY,modes:d.modes,tick:function(){var b=e(),c=this.delay;d.idle(b-c),d.flush(b-(100+2*c));var f=b-2*c;d.recalcMatrix(f);for(var g=!0,h=d.computedMatrix,m=0;16>m;++m)g=g&&i[m]===h[m],i[m]=h[m];var n=a.clientWidth===k&&a.clientHeight===l;return k=a.clientWidth,l=a.clientHeight,g?!n:(j=Math.exp(d.computedRadius[0]),!0)},lookAt:function(a,b,c){d.lookAt(d.lastT(),a,b,c)},rotate:function(a,b,c){d.rotate(d.lastT(),a,b,c)},pan:function(a,b,c){d.pan(d.lastT(),a,b,c)},translate:function(a,b,c){d.translate(d.lastT(),a,b,c)}};Object.defineProperties(m,{matrix:{get:function(){return d.computedMatrix},set:function(a){return d.setMatrix(d.lastT(),a),d.computedMatrix},enumerable:!0},mode:{get:function(){return d.getMode()},set:function(a){return d.setMode(a),d.getMode()},enumerable:!0},center:{get:function(){return d.computedCenter},set:function(a){return d.lookAt(d.lastT(),a),d.computedCenter},enumerable:!0},eye:{get:function(){return d.computedEye},set:function(a){return d.lookAt(d.lastT(),null,a),d.computedEye},enumerable:!0},up:{get:function(){return d.computedUp},set:function(a){return d.lookAt(d.lastT(),null,null,a),d.computedUp},enumerable:!0},distance:{get:function(){return j},set:function(a){return d.setDistance(d.lastT(),a),a},enumerable:!0},distanceLimits:{get:function(){return d.getDistanceLimits(c)},set:function(a){return d.setDistanceLimits(a),a},enumerable:!0}}),a.addEventListener("contextmenu",function(a){return a.preventDefault(),!1});var n=0,o=0;return g(a,function(b,c,f,g){var h=1/a.clientHeight,i=h*(c-n),k=h*(f-o),l=m.flipX?1:-1,p=m.flipY?1:-1,q=Math.PI*m.rotateSpeed,r=e();if(1&b)g.shift?d.rotate(r,0,0,-i*q):d.rotate(r,l*q*i,-p*q*k,0);else if(2&b)d.pan(r,-m.translateSpeed*i*j,m.translateSpeed*k*j,0);else if(4&b){var s=m.zoomSpeed*k/window.innerHeight*(r-d.lastT())*50;d.pan(r,0,0,j*(Math.exp(s)-1))}n=c,o=f}),h(a,function(a,b,c){var f=m.flipX?1:-1,g=m.flipY?1:-1,h=e();if(Math.abs(a)>Math.abs(b))d.rotate(h,0,0,-a*f*Math.PI*m.rotateSpeed/window.innerWidth);else{var i=m.zoomSpeed*g*b/window.innerHeight*(h-d.lastT())/100;d.pan(h,0,0,j*(Math.exp(i)-1))}},!0),m}b.exports=d;var e=a("right-now"),f=a("3d-view"),g=a("mouse-change"),h=a("mouse-wheel")},{"3d-view":38,"mouse-change":196,"mouse-wheel":200,"right-now":210}],125:[function(a,b,c){!function(){"use strict";function a(b){b.permitHostObjects___&&b.permitHostObjects___(a)}function c(a){return!(a.substr(0,n.length)==n&&"___"===a.substr(a.length-3))}function d(a){if(a!==Object(a))throw new TypeError("Not an object: "+a);var b=a[o];if(b&&b.key===a)return b;if(m(a)){b={key:a};try{return l(a,o,{value:b,writable:!1,enumerable:!1,configurable:!1}),b}catch(c){return}}}function e(a){return a.prototype=null,Object.freeze(a)}function f(){s||"undefined"==typeof console||(s=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=a);var g=!1;if("function"==typeof WeakMap){var h=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var i=new h,j=Object.freeze({});if(i.set(j,1),1===i.get(j))return void(b.exports=WeakMap);g=!0}}var k=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),l=Object.defineProperty,m=Object.isExtensible,n="weakmap:",o=n+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var p=new ArrayBuffer(25),q=new Uint8Array(p);crypto.getRandomValues(q),o=n+"rand:"+Array.prototype.map.call(q,function(a){return(a%36).toString(36)}).join("")+"___"}if(l(Object,"getOwnPropertyNames",{value:function(a){return k(a).filter(c)}}),"getPropertyNames"in Object){var r=Object.getPropertyNames;l(Object,"getPropertyNames",{value:function(a){return r(a).filter(c)}})}!function(){var a=Object.freeze;l(Object,"freeze",{value:function(b){return d(b),a(b)}});var b=Object.seal;l(Object,"seal",{value:function(a){return d(a),b(a)}});var c=Object.preventExtensions;l(Object,"preventExtensions",{value:function(a){return d(a),c(a)}})}();var s=!1,t=0,u=function(){function a(a,b){var c,e=d(a);return e?j in e?e[j]:b:(c=h.indexOf(a),c>=0?i[c]:b)}function b(a){var b=d(a);return b?j in b:h.indexOf(a)>=0}function c(a,b){var c,e=d(a);return e?e[j]=b:(c=h.indexOf(a),c>=0?i[c]=b:(c=h.length,i[c]=b,h[c]=a)),this}function g(a){var b,c,e=d(a);return e?j in e&&delete e[j]:(b=h.indexOf(a),0>b?!1:(c=h.length-1,h[b]=void 0,i[b]=i[c],h[b]=h[c],h.length=c,i.length=c,!0))}this instanceof u||f();var h=[],i=[],j=t++;return Object.create(u.prototype,{get___:{value:e(a)},has___:{value:e(b)},set___:{value:e(c)},delete___:{value:e(g)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(a,b){return this.get___(a,b)},writable:!0,configurable:!0},has:{value:function(a){return this.has___(a)},writable:!0,configurable:!0},set:{value:function(a,b){return this.set___(a,b)},writable:!0,configurable:!0},"delete":{value:function(a){return this.delete___(a)},writable:!0,configurable:!0}}),"function"==typeof h?!function(){function c(){function b(a,b){return k?j.has(a)?j.get(a):k.get___(a,b):j.get(a,b)}function c(a){return j.has(a)||(k?k.has___(a):!1)}function d(a){var b=!!j["delete"](a);return k?k.delete___(a)||b:b}this instanceof u||f();var i,j=new h,k=void 0,l=!1;return i=g?function(a,b){return j.set(a,b),j.has(a)||(k||(k=new u),k.set(a,b)),this}:function(a,b){if(l)try{j.set(a,b)}catch(c){k||(k=new u),k.set___(a,b)}else j.set(a,b);return this},Object.create(u.prototype,{get___:{value:e(b)},has___:{value:e(c)},set___:{value:e(i)},delete___:{value:e(d)},permitHostObjects___:{value:e(function(b){if(b!==a)throw new Error("bogus call to permitHostObjects___");l=!0})}})}g&&"undefined"!=typeof Proxy&&(Proxy=void 0),c.prototype=u.prototype,b.exports=c,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),b.exports=u)}}()},{}],126:[function(a,b,c){"use strict";function d(a){var b=h.get(a);if(!b||!a.isBuffer(b._triangleBuffer.buffer)){var c=f(a,new Float32Array([-1,-1,-1,4,4,-1]));b=g(a,[{buffer:c,type:a.FLOAT,size:2}]),b._triangleBuffer=c,h.set(a,b)}b.bind(),a.drawArrays(a.TRIANGLES,0,3),b.unbind()}var e="undefined"==typeof WeakMap?a("weak-map"):WeakMap,f=a("gl-buffer"),g=a("gl-vao"),h=new e;b.exports=d},{"gl-buffer":75,"gl-vao":189,"weak-map":125}],127:[function(a,b,c){"use strict";function d(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a}function e(a){this.gl=a,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=k(a)}function f(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function g(a,b,c,d,e){for(var f=a.primalOffset,g=a.primalMinor,h=a.mirrorOffset,i=a.mirrorMinor,j=d[b],k=0;3>k;++k)if(b!==k){var l=f,m=h,n=g,o=i;j&1<<k&&(l=h,m=f,n=i,o=g),l[k]=c[0][k],m[k]=c[1][k],e[k]>0?(n[k]=-1,o[k]=0):(n[k]=0,o[k]=1)}}function h(a,b){var c=new e(a);return c.update(b),c}b.exports=h;var i=a("./lib/text.js"),j=a("./lib/lines.js"),k=a("./lib/background.js"),l=a("./lib/cube.js"),m=a("./lib/ticks.js"),n=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o=e.prototype;o.update=function(a){function b(b,c,d){if(d in a){var e,f=a[d],g=this[d];(b?Array.isArray(f)&&Array.isArray(f[0]):Array.isArray(f))?this[d]=e=[c(f[0]),c(f[1]),c(f[2])]:this[d]=e=[c(f),c(f),c(f)];for(var h=0;3>h;++h)if(e[h]!==g[h])return!0}return!1}a=a||{};var c,d=b.bind(this,!1,Number),e=b.bind(this,!1,Boolean),f=b.bind(this,!1,String),g=b.bind(this,!0,function(a){if(Array.isArray(a)){if(3===a.length)return[+a[0],+a[1],+a[2],1];if(4===a.length)return[+a[0],+a[1],+a[2],+a[3]]}return[0,0,0,1]}),h=!1,k=!1;if("bounds"in a)for(var l=a.bounds,n=0;2>n;++n)for(var o=0;3>o;++o)l[n][o]!==this.bounds[n][o]&&(k=!0),this.bounds[n][o]=l[n][o];if("ticks"in a){c=a.ticks,h=!0,this.autoTicks=!1;for(var n=0;3>n;++n)this.tickSpacing[n]=0}else d("tickSpacing")&&(this.autoTicks=!0,k=!0);if(this._firstInit&&("ticks"in a||"tickSpacing"in a||(this.autoTicks=!0),k=!0,h=!0,this._firstInit=!1),k&&this.autoTicks&&(c=m.create(this.bounds,this.tickSpacing),h=!0),h){for(var n=0;3>n;++n)c[n].sort(function(a,b){return a.x-b.x});m.equal(c,this.ticks)?h=!1:this.ticks=c}e("tickEnable"),f("tickFont")&&(h=!0),d("tickSize"),d("tickAngle"),d("tickPad"),g("tickColor");var p=f("labels");f("labelFont")&&(p=!0),e("labelEnable"),d("labelSize"),d("labelPad"),g("labelColor"),e("lineEnable"),e("lineMirror"),d("lineWidth"),g("lineColor"),e("lineTickEnable"),e("lineTickMirror"),d("lineTickLength"),d("lineTickWidth"),g("lineTickColor"),e("gridEnable"),d("gridWidth"),g("gridColor"),e("zeroEnable"),g("zeroLineColor"),d("zeroLineWidth"),e("backgroundEnable"),g("backgroundColor"),this._text?this._text&&(p||h)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=i(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&h&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=j(this.gl,this.bounds,this.ticks))};var p=[new f,new f,new f],q=[0,0,0],r={model:n,view:n,projection:n};o.isOpaque=function(){return!0},o.isTransparent=function(){return!1},o.drawTransparent=function(a){};var s=[0,0,0],t=[0,0,0],u=[0,0,0];o.draw=function(a){a=a||r;for(var b=this.gl,c=a.model||n,e=a.view||n,f=a.projection||n,h=this.bounds,i=l(c,e,f,h),j=i.cubeEdges,k=i.axis,m=e[12],o=e[13],v=e[14],w=e[15],x=this.pixelRatio*(f[3]*m+f[7]*o+f[11]*v+f[15]*w)/b.drawingBufferHeight,y=0;3>y;++y)this.lastCubeProps.cubeEdges[y]=j[y],this.lastCubeProps.axis[y]=k[y];for(var z=p,y=0;3>y;++y)g(p[y],y,this.bounds,j,k);for(var b=this.gl,A=q,y=0;3>y;++y)this.backgroundEnable[y]?A[y]=k[y]:A[y]=0;this._background.draw(c,e,f,h,A,this.backgroundColor),this._lines.bind(c,e,f,this);for(var y=0;3>y;++y){var B=[0,0,0];k[y]>0?B[y]=h[1][y]:B[y]=h[0][y];for(var C=0;2>C;++C){var D=(y+1+C)%3,E=(y+1+(1^C))%3;this.gridEnable[D]&&this._lines.drawGrid(D,E,this.bounds,B,this.gridColor[D],this.gridWidth[D]*this.pixelRatio)}for(var C=0;2>C;++C){var D=(y+1+C)%3,E=(y+1+(1^C))%3;this.zeroEnable[E]&&h[0][E]<=0&&h[1][E]>=0&&this._lines.drawZero(D,E,this.bounds,B,this.zeroLineColor[E],this.zeroLineWidth[E]*this.pixelRatio)}}for(var y=0;3>y;++y){this.lineEnable[y]&&this._lines.drawAxisLine(y,this.bounds,z[y].primalOffset,this.lineColor[y],this.lineWidth[y]*this.pixelRatio),this.lineMirror[y]&&this._lines.drawAxisLine(y,this.bounds,z[y].mirrorOffset,this.lineColor[y],this.lineWidth[y]*this.pixelRatio);for(var F=d(s,z[y].primalMinor),G=d(t,z[y].mirrorMinor),H=this.lineTickLength,C=0;3>C;++C){var I=x/c[5*C];F[C]*=H[C]*I,G[C]*=H[C]*I}this.lineTickEnable[y]&&this._lines.drawAxisTicks(y,z[y].primalOffset,F,this.lineTickColor[y],this.lineTickWidth[y]*this.pixelRatio),this.lineTickMirror[y]&&this._lines.drawAxisTicks(y,z[y].mirrorOffset,G,this.lineTickColor[y],this.lineTickWidth[y]*this.pixelRatio)}this._text.bind(c,e,f,this.pixelRatio);for(var y=0;3>y;++y){for(var J=z[y].primalMinor,K=d(u,z[y].primalOffset),C=0;3>C;++C)this.lineTickEnable[y]&&(K[C]+=x*J[C]*Math.max(this.lineTickLength[C],0)/c[5*C]);if(this.tickEnable[y]){for(var C=0;3>C;++C)K[C]+=x*J[C]*this.tickPad[C]/c[5*C];this._text.drawTicks(y,this.tickSize[y],this.tickAngle[y],K,this.tickColor[y])}if(this.labelEnable[y]){for(var C=0;3>C;++C)K[C]+=x*J[C]*this.labelPad[C]/c[5*C];K[y]+=.5*(h[0][y]+h[1][y]),this._text.drawLabel(y,this.labelSize[y],this.labelAngle[y],K,this.labelColor[y])}}},o.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":128,"./lib/cube.js":129,"./lib/lines.js":130,"./lib/text.js":132,"./lib/ticks.js":133}],128:[function(a,b,c){"use strict";function d(a,b,c,d){this.gl=a,this.buffer=b,this.vao=c,this.shader=d}function e(a){for(var b=[],c=[],e=0,i=0;3>i;++i)for(var j=(i+1)%3,k=(i+2)%3,l=[0,0,0],m=[0,0,0],n=-1;1>=n;n+=2){c.push(e,e+2,e+1,e+1,e+2,e+3),l[i]=n,m[i]=n;for(var o=-1;1>=o;o+=2){l[j]=o;for(var p=-1;1>=p;p+=2)l[k]=p,b.push(l[0],l[1],l[2],m[0],m[1],m[2]),e+=1}var q=j;j=k,k=q}var r=f(a,new Float32Array(b)),s=f(a,new Uint16Array(c),a.ELEMENT_ARRAY_BUFFER),t=g(a,[{buffer:r,type:a.FLOAT,size:3,offset:0,stride:24},{buffer:r,type:a.FLOAT,size:3,offset:12,stride:24}],s),u=h(a);return u.attributes.position.location=0,u.attributes.normal.location=1,new d(a,r,t,u)}b.exports=e;var f=a("gl-buffer"),g=a("gl-vao"),h=a("./shaders").bg,i=d.prototype;i.draw=function(a,b,c,d,e,f){for(var g=!1,h=0;3>h;++h)g=g||e[h];if(g){var i=this.gl;i.enable(i.POLYGON_OFFSET_FILL),i.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:a,view:b,projection:c,bounds:d,enable:e,colors:f},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),i.disable(i.POLYGON_OFFSET_FILL)}},i.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":131,"gl-buffer":75,"gl-vao":189}],129:[function(a,b,c){"use strict";function d(a,b,c){for(var d=0;4>d;++d){a[d]=c[12+d];for(var e=0;3>e;++e)a[d]+=b[e]*c[4*e+d]}}function e(a){for(var b=0;b<p.length;++b)if(a=i.positive(a,p[b]),a.length<3)return 0;for(var c=a[0],d=c[0]/c[3],e=c[1]/c[3],f=0,b=1;b+1<a.length;++b){var g=a[b],h=a[b+1],j=g[0]/g[3],k=g[1]/g[3],l=h[0]/h[3],m=h[1]/h[3],n=j-d,o=k-e,q=l-d,r=m-e;f+=Math.abs(n*r-o*q)}return f}function f(a,b,c,f){h(k,b,a),h(k,c,k);for(var i=0,p=0;2>p;++p){n[2]=f[p][2];for(var t=0;2>t;++t){n[1]=f[t][1];for(var u=0;2>u;++u)n[0]=f[u][0],d(l[i],n,k),i+=1}}for(var v=-1,p=0;8>p;++p){for(var w=l[p][3],x=0;3>x;++x)m[p][x]=l[p][x]/w;0>w&&(0>v?v=p:m[p][2]<m[v][2]&&(v=p))}if(0>v){v=0;for(var y=0;3>y;++y){for(var z=(y+2)%3,A=(y+1)%3,B=-1,C=-1,D=0;2>D;++D){var E=D<<y,F=E+(D<<z)+(1-D<<A),G=E+(1-D<<z)+(D<<A);j(m[E],m[F],m[G],o)<0||(D?B=1:C=1)}if(0>B||0>C)C>B&&(v|=1<<y);else{for(var D=0;2>D;++D){var E=D<<y,F=E+(D<<z)+(1-D<<A),G=E+(1-D<<z)+(D<<A),H=e([l[E],l[F],l[G],l[E+(1<<z)+(1<<A)]]);D?B=H:C=H}C>B&&(v|=1<<y)}}}for(var I=7^v,J=-1,p=0;8>p;++p)p!==v&&p!==I&&(0>J?J=p:m[J][1]>m[p][1]&&(J=p));for(var K=-1,p=0;3>p;++p){var L=J^1<<p;if(L!==v&&L!==I){0>K&&(K=L);var A=m[L];A[0]<m[K][0]&&(K=L)}}for(var M=-1,p=0;3>p;++p){var L=J^1<<p;if(L!==v&&L!==I&&L!==K){0>M&&(M=L);var A=m[L];A[0]>m[M][0]&&(M=L)}}var N=q;N[0]=N[1]=N[2]=0,N[g.log2(K^J)]=J&K,N[g.log2(J^M)]=J&M;var O=7^M;O===v||O===I?(O=7^K,N[g.log2(M^O)]=O&M):N[g.log2(K^O)]=O&K;for(var P=r,Q=v,y=0;3>y;++y)Q&1<<y?P[y]=-1:P[y]=1;return s}b.exports=f;var g=a("bit-twiddle"),h=a("gl-mat4/multiply"),i=(a("gl-mat4/invert"),a("split-polygon")),j=a("robust-orientation"),k=new Array(16),l=(new Array(16),new Array(8)),m=new Array(8),n=new Array(3),o=[0,0,0];!function(){for(var a=0;8>a;++a)l[a]=[1,1,1,1],m[a]=[1,1,1]}();var p=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],q=[1,1,1],r=[0,0,0],s={cubeEdges:q,axis:r}},{"bit-twiddle":49,"gl-mat4/invert":94,"gl-mat4/multiply":96,"robust-orientation":214,"split-polygon":135}],130:[function(a,b,c){"use strict";function d(a){return a[0]=a[1]=a[2]=0,a}function e(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a}function f(a,b,c,d,e,f,g,h){this.gl=a,this.vertBuffer=b,this.vao=c,this.shader=d,this.tickCount=e,this.tickOffset=f,this.gridCount=g,this.gridOffset=h}function g(a,b,c){var d=[],e=[0,0,0],g=[0,0,0],k=[0,0,0],l=[0,0,0];d.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var m=0;3>m;++m){for(var n=d.length/3|0,o=0;o<c[m].length;++o){var p=+c[m][o].x;d.push(p,0,1,p,1,1,p,0,-1,p,0,-1,p,1,1,p,1,-1)}var q=d.length/3|0;e[m]=n,g[m]=q-n;for(var n=d.length/3|0,r=0;r<c[m].length;++r){var p=+c[m][r].x;d.push(p,0,1,p,1,1,p,0,-1,p,0,-1,p,1,1,p,1,-1)}var q=d.length/3|0;k[m]=n,l[m]=q-n}var s=h(a,new Float32Array(d)),t=i(a,[{buffer:s,type:a.FLOAT,size:3,stride:0,offset:0}]),u=j(a);return u.attributes.position.location=0,new f(a,s,t,u,g,e,l,k)}b.exports=g;var h=a("gl-buffer"),i=a("gl-vao"),j=a("./shaders").line,k=[0,0,0],l=[0,0,0],m=[0,0,0],n=[0,0,0],o=[1,1],p=f.prototype;p.bind=function(a,b,c){this.shader.bind(),this.shader.uniforms.model=a,this.shader.uniforms.view=b,this.shader.uniforms.projection=c,o[0]=this.gl.drawingBufferWidth,o[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=o,this.vao.bind()},p.drawAxisLine=function(a,b,c,f,g){var h=d(l);this.shader.uniforms.majorAxis=l,h[a]=b[1][a]-b[0][a],this.shader.uniforms.minorAxis=h;var i=e(n,c);i[a]+=b[0][a],this.shader.uniforms.offset=i,this.shader.uniforms.lineWidth=g,this.shader.uniforms.color=f;var j=d(m);j[(a+2)%3]=1,this.shader.uniforms.screenAxis=j,this.vao.draw(this.gl.TRIANGLES,6);var j=d(m);j[(a+1)%3]=1,this.shader.uniforms.screenAxis=j,this.vao.draw(this.gl.TRIANGLES,6)},p.drawAxisTicks=function(a,b,c,e,f){var g=d(k);g[a]=1,this.shader.uniforms.majorAxis=g,this.shader.uniforms.offset=b,this.shader.uniforms.minorAxis=c,this.shader.uniforms.color=e,this.shader.uniforms.lineWidth=f;var h=d(m);h[a]=1,this.shader.uniforms.screenAxis=h,this.vao.draw(this.gl.TRIANGLES,this.tickCount[a],this.tickOffset[a])},p.drawGrid=function(a,b,c,f,g,h){var i=d(l);i[b]=c[1][b]-c[0][b],this.shader.uniforms.minorAxis=i;var j=e(n,f);j[b]+=c[0][b],this.shader.uniforms.offset=j;var o=d(k);o[a]=1,this.shader.uniforms.majorAxis=o;var p=d(m);p[a]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=g,this.vao.draw(this.gl.TRIANGLES,this.gridCount[a],this.gridOffset[a])},p.drawZero=function(a,b,c,f,g,h){var i=d(l);this.shader.uniforms.majorAxis=i,i[a]=c[1][a]-c[0][a],this.shader.uniforms.minorAxis=i;var j=e(n,f);j[a]+=c[0][a],this.shader.uniforms.offset=j;var k=d(m);k[b]=1,this.shader.uniforms.screenAxis=k,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=g,this.vao.draw(this.gl.TRIANGLES,6)},p.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":131,"gl-buffer":75,"gl-vao":189}],131:[function(a,b,c){"use strict";var d=a("gl-shader"),e="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * view * model * vec4(p, 1.0);\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n",f="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";c.line=function(a){return d(a,e,f,null,[{name:"position",type:"vec3"}])};var g="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvoid main() { \n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\n -sin(angle), cos(angle));\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n vec4 worldPosition = model * vec4(dataPosition, 1);\n \n //Compute clip position\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n //Apply text offset in clip coordinates\n clipPosition += vec4(viewOffset, 0, 0);\n\n //Done\n gl_Position = clipPosition;\n}",h="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";c.text=function(a){return d(a,g,h,null,[{name:"position",type:"vec3"}])};var i="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n if(dot(normal, enable) > 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}",j="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"; 35 c.bg=function(a){return d(a,i,j,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":154}],132:[function(a,b,c){(function(c){"use strict";function d(a,b,c,d){this.gl=a,this.shader=b,this.buffer=c,this.vao=d,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function e(a,b){try{return i(a,b)}catch(c){return console.warn("error vectorizing text:",c),{cells:[],positions:[]}}}function f(a,b,c,e,f,i){var k=g(a),l=h(a,[{buffer:k,size:3}]),m=j(a);m.attributes.position.location=0;var n=new d(a,m,k,l);return n.update(b,c,e,f,i),n}b.exports=f;var g=a("gl-buffer"),h=a("gl-vao"),i=a("vectorize-text"),j=a("./shaders").text,k=window||c.global||{},l=k.__TEXT_CACHE||{};k.__TEXT_CACHE={};var m=3,n=d.prototype,o=[0,0];n.bind=function(a,b,c,d){this.vao.bind(),this.shader.bind();var e=this.shader.uniforms;e.model=a,e.view=b,e.projection=c,e.pixelScale=d,o[0]=this.gl.drawingBufferWidth,o[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=o},n.update=function(a,b,c,d,f){function g(a,b,c,d){var f=l[c];f||(f=l[c]={});var g=f[b];g||(g=f[b]=e(b,{triangles:!0,font:c,textAlign:"center",textBaseline:"middle"}));for(var i=(d||12)/12,j=g.positions,k=g.cells,m=0,n=k.length;n>m;++m)for(var o=k[m],p=2;p>=0;--p){var q=j[o[p]];h.push(i*q[0],-i*q[1],a)}}for(var h=(this.gl,[]),i=[0,0,0],j=[0,0,0],k=[0,0,0],n=[0,0,0],o=0;3>o;++o){k[o]=h.length/m|0,g(.5*(a[0][o]+a[1][o]),b[o],c),n[o]=(h.length/m|0)-k[o],i[o]=h.length/m|0;for(var p=0;p<d[o].length;++p)d[o][p].text&&g(d[o][p].x,d[o][p].text,d[o][p].font||f,d[o][p].fontSize||12);j[o]=(h.length/m|0)-i[o]}this.buffer.update(h),this.tickOffset=i,this.tickCount=j,this.labelOffset=k,this.labelCount=n};var p=[0,0,0];n.drawTicks=function(a,b,c,d,e){var f=p;f[0]=f[1]=f[2]=0,f[a]=1,this.shader.uniforms.axis=f,this.shader.uniforms.color=e,this.shader.uniforms.angle=c,this.shader.uniforms.scale=b,this.shader.uniforms.offset=d,this.vao.draw(this.gl.TRIANGLES,this.tickCount[a],this.tickOffset[a])};var q=[0,0,0];n.drawLabel=function(a,b,c,d,e){this.shader.uniforms.axis=q,this.shader.uniforms.color=e,this.shader.uniforms.angle=c,this.shader.uniforms.scale=b,this.shader.uniforms.offset=d,this.vao.draw(this.gl.TRIANGLES,this.labelCount[a],this.labelOffset[a])},n.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,a("_process"))},{"./shaders":131,_process:55,"gl-buffer":75,"gl-vao":189,"vectorize-text":235}],133:[function(a,b,c){"use strict";function d(a,b){var c=a+"",d=c.indexOf("."),e=0;d>=0&&(e=c.length-d-1);var f=Math.pow(10,e),g=Math.round(a*b*f),h=g+"";if(h.indexOf("e")>=0)return h;var i=g/f,j=g%f;0>g?(i=0|-Math.ceil(i),j=0|-j):(i=0|Math.floor(i),j=0|j);var k=""+i;if(0>g&&(k="-"+k),e){for(var l=""+j;l.length<e;)l="0"+l;return k+"."+l}return k}function e(a,b){for(var c=[],e=0;3>e;++e){for(var f=[],g=(.5*(a[0][e]+a[1][e]),0);g*b[e]<=a[1][e];++g)f.push({x:g*b[e],text:d(b[e],g)});for(var g=-1;g*b[e]>=a[0][e];--g)f.push({x:g*b[e],text:d(b[e],g)});c.push(f)}return c}function f(a,b){for(var c=0;3>c;++c){if(a[c].length!==b[c].length)return!1;for(var d=0;d<a[c].length;++d){var e=a[c][d],f=b[c][d];if(e.x!==f.x||e.text!==f.text)return!1}}return!0}c.create=e,c.equal=f},{}],134:[function(a,b,c){"use strict";function d(a,b,c){var d=b||0,e=c||1;return[[a[12]+a[0],a[13]+a[1],a[14]+a[2],a[15]+a[3]],[a[12]-a[0],a[13]-a[1],a[14]-a[2],a[15]-a[3]],[a[12]+a[4],a[13]+a[5],a[14]+a[6],a[15]+a[7]],[a[12]-a[4],a[13]-a[5],a[14]-a[6],a[15]-a[7]],[d*a[12]+a[8],d*a[13]+a[9],d*a[14]+a[10],d*a[15]+a[11]],[e*a[12]-a[8],e*a[13]-a[9],e*a[14]-a[10],e*a[15]-a[11]]]}b.exports=d},{}],135:[function(a,b,c){"use strict";function d(a,b){var c=j(i(a,b),[b[b.length-1]]);return c[c.length-1]}function e(a,b,c,d){var e=d-b,f=-b/e;0>f?f=0:f>1&&(f=1);for(var g=1-f,h=a.length,i=new Array(h),j=0;h>j;++j)i[j]=f*a[j]+g*c[j];return i}function f(a,b){for(var c=[],f=[],g=d(a[a.length-1],b),h=a[a.length-1],i=a[0],j=0;j<a.length;++j,h=i){i=a[j];var k=d(i,b);if(0>g&&k>0||g>0&&0>k){var l=e(h,k,i,g);c.push(l),f.push(l.slice())}0>k?f.push(i.slice()):k>0?c.push(i.slice()):(c.push(i.slice()),f.push(i.slice())),g=k}return{positive:c,negative:f}}function g(a,b){for(var c=[],f=d(a[a.length-1],b),g=a[a.length-1],h=a[0],i=0;i<a.length;++i,g=h){h=a[i];var j=d(h,b);(0>f&&j>0||f>0&&0>j)&&c.push(e(g,j,h,f)),j>=0&&c.push(h.slice()),f=j}return c}function h(a,b){for(var c=[],f=d(a[a.length-1],b),g=a[a.length-1],h=a[0],i=0;i<a.length;++i,g=h){h=a[i];var j=d(h,b);(0>f&&j>0||f>0&&0>j)&&c.push(e(g,j,h,f)),0>=j&&c.push(h.slice()),f=j}return c}var i=a("robust-dot-product"),j=a("robust-sum");b.exports=f,b.exports.positive=g,b.exports.negative=h},{"robust-dot-product":136,"robust-sum":217}],136:[function(a,b,c){"use strict";function d(a,b){for(var c=e(a[0],b[0]),d=1;d<a.length;++d)c=f(c,e(a[d],b[d]));return c}var e=a("two-product"),f=a("robust-sum");b.exports=d},{"robust-sum":217,"two-product":231}],137:[function(a,b,c){"use strict";function d(a,b,c){this.lo=a,this.hi=b,this.pixelsPerDataUnit=c}function e(a,b,c,d,e){for(var f=0;3>f;++f){for(var g=o,h=p,i=0;3>i;++i)h[i]=g[i]=c[i];h[3]=g[3]=1,h[f]+=1,l(h,h,b),h[3]<0&&(a[f]=1/0),g[f]-=1,l(g,g,b),g[3]<0&&(a[f]=1/0);var j=(g[0]/g[3]-h[0]/h[3])*d,k=(g[1]/g[3]-h[1]/h[3])*e;a[f]=.25*Math.sqrt(j*j+k*k)}return a}function f(a,b,c,d,f){var l=b.model||m,o=b.view||m,p=b.projection||m,s=a.bounds,f=f||i(l,o,p,s),t=f.axis;f.edges;j(n,o,l),j(n,p,n);for(var u=q,v=0;3>v;++v)u[v].lo=1/0,u[v].hi=-(1/0),u[v].pixelsPerDataUnit=1/0;var w=g(k(n,n));k(n,n);for(var x=0;3>x;++x){var y=(x+1)%3,z=(x+2)%3,A=r;a:for(var v=0;2>v;++v){var B=[];if(t[x]<0!=!!v){A[x]=s[v][x];for(var C=0;2>C;++C){A[y]=s[C^v][y];for(var D=0;2>D;++D)A[z]=s[D^C^v][z],B.push(A.slice())}for(var C=0;C<w.length;++C){if(0===B.length)continue a;B=h.positive(B,w[C])}for(var C=0;C<B.length;++C)for(var z=B[C],E=e(r,n,z,c,d),D=0;3>D;++D)u[D].lo=Math.min(u[D].lo,z[D]),u[D].hi=Math.max(u[D].hi,z[D]),D!==x&&(u[D].pixelsPerDataUnit=Math.min(u[D].pixelsPerDataUnit,Math.abs(E[D])))}}}return u}b.exports=f;var g=a("extract-frustum-planes"),h=a("split-polygon"),i=a("./lib/cube.js"),j=a("gl-mat4/multiply"),k=a("gl-mat4/transpose"),l=a("gl-vec4/transformMat4"),m=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n=new Float32Array(16),o=[0,0,0,1],p=[0,0,0,1],q=[new d(1/0,-(1/0),1/0),new d(1/0,-(1/0),1/0),new d(1/0,-(1/0),1/0)],r=[0,0,0]},{"./lib/cube.js":129,"extract-frustum-planes":134,"gl-mat4/multiply":96,"gl-mat4/transpose":104,"gl-vec4/transformMat4":190,"split-polygon":135}],138:[function(a,b,c){"use strict";var d=a("gl-shader"),e="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n",f="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}";b.exports=function(a){return d(a,e,f,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":154}],139:[function(a,b,c){"use strict";function d(a,b,c,d){this.gl=a,this.buffer=b,this.vao=c,this.shader=d,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function e(a,b){function c(a,b,c,d,f,g){var h=[a,b,c,0,0,0,1];h[d+3]=1,h[d]=f,e.push.apply(e,h),h[6]=-1,e.push.apply(e,h),h[d]=g,e.push.apply(e,h),e.push.apply(e,h),h[6]=1,e.push.apply(e,h),h[d]=f,e.push.apply(e,h)}var e=[];c(0,0,0,0,0,1),c(0,0,0,1,0,1),c(0,0,0,2,0,1),c(1,0,0,1,-1,1),c(1,0,0,2,-1,1),c(0,1,0,0,-1,1),c(0,1,0,2,-1,1),c(0,0,1,0,-1,1),c(0,0,1,1,-1,1);var i=f(a,e),j=g(a,[{type:a.FLOAT,buffer:i,size:3,offset:0,stride:28},{type:a.FLOAT,buffer:i,size:3,offset:12,stride:28},{type:a.FLOAT,buffer:i,size:1,offset:24,stride:28}]),k=h(a);k.attributes.position.location=0,k.attributes.color.location=1,k.attributes.weight.location=2;var l=new d(a,i,j,k);return l.update(b),l}var f=a("gl-buffer"),g=a("gl-vao"),h=a("./shaders/index");b.exports=e;var i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],j=d.prototype,k=[0,0,0],l=[0,0,0],m=[0,0];j.isTransparent=function(){return!1},j.drawTransparent=function(a){},j.draw=function(a){var b=this.gl,c=this.vao,d=this.shader;c.bind(),d.bind();var e,f=a.model||i,g=a.view||i,h=a.projection||i;this.axes&&(e=this.axes.lastCubeProps.axis);for(var j=k,n=l,o=0;3>o;++o)e&&e[o]<0?(j[o]=this.bounds[0][o],n[o]=this.bounds[1][o]):(j[o]=this.bounds[1][o],n[o]=this.bounds[0][o]);m[0]=b.drawingBufferWidth,m[1]=b.drawingBufferHeight,d.uniforms.model=f,d.uniforms.view=g,d.uniforms.projection=h,d.uniforms.coordinates=[this.position,j,n],d.uniforms.colors=this.colors,d.uniforms.screenShape=m;for(var o=0;3>o;++o)d.uniforms.lineWidth=this.lineWidth[o]*this.pixelRatio,this.enabled[o]&&(c.draw(b.TRIANGLES,6,6*o),this.drawSides[o]&&c.draw(b.TRIANGLES,12,18+12*o));c.unbind()},j.update=function(a){a&&("bounds"in a&&(this.bounds=a.bounds),"position"in a&&(this.position=a.position),"lineWidth"in a&&(this.lineWidth=a.lineWidth),"colors"in a&&(this.colors=a.colors),"enabled"in a&&(this.enabled=a.enabled),"drawSides"in a&&(this.drawSides=a.drawSides))},j.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":138,"gl-buffer":75,"gl-vao":189}],140:[function(a,b,c){"use strict";function d(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function e(a,b){var c=null;try{c=a.getContext("webgl",b),c||(c=a.getContext("experimental-webgl",b))}catch(d){return null}return c}function f(a){var b=Math.round(Math.log(Math.abs(a))/Math.log(10));if(0>b){var c=Math.round(Math.pow(10,-b));return Math.ceil(a*c)/c}if(b>0){var c=Math.round(Math.pow(10,b));return Math.ceil(a/c)*c}return Math.ceil(a)}function g(a){return"boolean"==typeof a?a:!0}function h(a){function b(){if(!v&&S.autoResize){var a=w.parentNode,b=1,c=1;a&&a!==document.body?(b=a.clientWidth,c=a.clientHeight):(b=window.innerWidth,c=window.innerHeight);var d=0|Math.ceil(b*S.pixelRatio),e=0|Math.ceil(c*S.pixelRatio);if(d!==w.width||e!==w.height){w.width=d,w.height=e;var f=w.style;f.position=f.position||"absolute",f.left="0px",f.top="0px",f.width=b+"px",f.height=c+"px",M=!0}}}function c(){for(var a=I.length,b=L.length,c=0;b>c;++c)K[c]=0;a:for(var c=0;a>c;++c){var d=I[c],e=d.pickSlots;if(e){for(var f=0;b>f;++f)if(K[f]+e<255){J[c]=f,d.setPickBase(K[f]+1),K[f]+=e;continue a}var g=m(y,R);J[c]=b,L.push(g),K.push(e),d.setPickBase(1),b+=1}else J[c]=-1}for(;b>0&&0===K[b-1];)K.pop(),L.pop().dispose()}function h(){return S.contextLost?!0:void(y.isContextLost()&&(S.contextLost=!0,S.mouseListener.enabled=!1,S.selection.object=null,S.oncontextloss&&S.oncontextloss()))}function s(){if(!h()){y.colorMask(!0,!0,!0,!0),y.depthMask(!0),y.disable(y.BLEND),y.enable(y.DEPTH_TEST);for(var a=I.length,b=L.length,c=0;b>c;++c){var d=L[c];d.shape=T,d.begin();for(var e=0;a>e;++e)if(J[e]===c){var f=I[e];f.drawPick&&(f.pixelRatio=1,f.drawPick(Q))}d.end()}}}function t(){if(!h()){b();var a=S.camera.tick();Q.view=S.camera.matrix,M=M||a,N=N||a,F.pixelRatio=S.pixelRatio,H.pixelRatio=S.pixelRatio;var c=I.length,d=W[0],e=W[1];d[0]=d[1]=d[2]=1/0,e[0]=e[1]=e[2]=-(1/0);for(var g=0;c>g;++g){var i=I[g];i.pixelRatio=S.pixelRatio,i.axes=S.axes,M=M||!!i.dirty,N=N||!!i.dirty;var j=i.bounds;if(j)for(var l=j[0],m=j[1],n=0;3>n;++n)d[n]=Math.min(d[n],l[n]),e[n]=Math.max(e[n],m[n])}var p=S.bounds;if(S.autoBounds)for(var n=0;3>n;++n){if(e[n]<d[n])d[n]=-1,e[n]=1;else{d[n]===e[n]&&(d[n]-=1,e[n]+=1);var r=.05*(e[n]-d[n]);d[n]=d[n]-r,e[n]=e[n]+r}p[0][n]=d[n],p[1][n]=e[n]}for(var t=!1,n=0;3>n;++n)t=t||X[0][n]!==p[0][n]||X[1][n]!==p[1][n],X[0][n]=p[0][n],X[1][n]=p[1][n];if(t){for(var u=[0,0,0],g=0;3>g;++g)u[g]=f((p[1][g]-p[0][g])/10);F.autoTicks?F.update({bounds:p,tickSpacing:u}):F.update({bounds:p})}N=N||t,M=M||t;var v=y.drawingBufferWidth,w=y.drawingBufferHeight;R[0]=v,R[1]=w,T[0]=0|Math.max(v/S.pixelRatio,1),T[1]=0|Math.max(w/S.pixelRatio,1),q(O,S.fovy,v/w,S.zNear,S.zFar);for(var g=0;16>g;++g)P[g]=0;P[15]=1;for(var x=0,g=0;3>g;++g)x=Math.max(x,p[1][g]-p[0][g]);for(var g=0;3>g;++g)S.autoScale?P[5*g]=S.aspect[g]/(p[1][g]-p[0][g]):P[5*g]=1/x,S.autoCenter&&(P[12+g]=.5*-P[5*g]*(p[0][g]+p[1][g]));for(var g=0;c>g;++g){var i=I[g];i.axesBounds=p,S.clipToBounds&&(i.clipBounds=p)}if(A.object&&(S.snapToData?H.position=A.dataCoordinate:H.position=A.dataPosition,H.bounds=p),N&&(N=!1,s()),M){S.axesPixels=k(S.axes,Q,v,w),S.onrender&&S.onrender(),y.bindFramebuffer(y.FRAMEBUFFER,null),y.viewport(0,0,v,w);var z=S.clearColor;y.clearColor(z[0],z[1],z[2],z[3]),y.clear(y.COLOR_BUFFER_BIT|y.DEPTH_BUFFER_BIT),y.depthMask(!0),y.colorMask(!0,!0,!0,!0),y.enable(y.DEPTH_TEST),y.depthFunc(y.LEQUAL),y.disable(y.BLEND),y.disable(y.CULL_FACE);var D=!1;F.enable&&(D=D||F.isTransparent(),F.draw(Q)),H.axes=F,A.object&&H.draw(Q),y.disable(y.CULL_FACE);for(var g=0;c>g;++g){var i=I[g];i.axes=F,i.pixelRatio=S.pixelRatio,i.isOpaque&&i.isOpaque()&&i.draw(Q),i.isTransparent&&i.isTransparent()&&(D=!0)}if(D){B.shape=R,B.bind(),y.clear(y.DEPTH_BUFFER_BIT),y.colorMask(!1,!1,!1,!1),y.depthMask(!0),y.depthFunc(y.LESS),F.enable&&F.isTransparent()&&F.drawTransparent(Q);for(var g=0;c>g;++g){var i=I[g];i.isOpaque&&i.isOpaque()&&i.draw(Q)}y.enable(y.BLEND),y.blendEquation(y.FUNC_ADD),y.blendFunc(y.ONE,y.ONE_MINUS_SRC_ALPHA),y.colorMask(!0,!0,!0,!0),y.depthMask(!1),y.clearColor(0,0,0,0),y.clear(y.COLOR_BUFFER_BIT),F.isTransparent()&&F.drawTransparent(Q);for(var g=0;c>g;++g){var i=I[g];i.isTransparent&&i.isTransparent()&&i.drawTransparent(Q)}y.bindFramebuffer(y.FRAMEBUFFER,null),y.blendFunc(y.ONE,y.ONE_MINUS_SRC_ALPHA),y.disable(y.DEPTH_TEST),C.bind(),B.color[0].bind(0),C.uniforms.accumBuffer=0,o(y),y.disable(y.BLEND)}M=!1;for(var g=0;c>g;++g)I[g].dirty=!1}}}function u(){v||S.contextLost||(requestAnimationFrame(u),t())}a=a||{};var v=!1,w=(a.pixelRatio||parseFloat(window.devicePixelRatio),a.canvas);if(!w)if(w=document.createElement("canvas"),a.container){var x=a.container;x.appendChild(w)}else document.body.appendChild(w);var y=a.gl;if(y||(y=e(w,a.glOptions||{premultipliedAlpha:!0,antialias:!0})),!y)throw new Error("webgl not supported");var z=a.bounds||[[-10,-10,-10],[10,10,10]],A=new d,B=n(y,[y.drawingBufferWidth,y.drawingBufferHeight],{preferFloat:!0}),C=r(y),D=a.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},E=a.axes||{},F=j(y,E);F.enable=!E.disable;var G=a.spikes||{},H=l(y,G),I=[],J=[],K=[],L=[],M=!0,N=!0,O=new Array(16),P=new Array(16),Q={view:null,projection:O,model:P},N=!0,R=[y.drawingBufferWidth,y.drawingBufferHeight],S={gl:y,contextLost:!1,pixelRatio:a.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:A,camera:i(w,D),axes:F,axesPixels:null,spikes:H,bounds:z,objects:I,shape:R,aspect:a.aspectRatio||[1,1,1],pickRadius:a.pickRadius||10,zNear:a.zNear||.01,zFar:a.zFar||1e3,fovy:a.fovy||Math.PI/4,clearColor:a.clearColor||[0,0,0,0],autoResize:g(a.autoResize),autoBounds:g(a.autoBounds),autoScale:!!a.autoScale,autoCenter:g(a.autoCenter),clipToBounds:g(a.clipToBounds),snapToData:!!a.snapToData,onselect:a.onselect||null,onrender:a.onrender||null,onclick:a.onclick||null,cameraParams:Q,oncontextloss:null,mouseListener:null},T=[y.drawingBufferWidth/S.pixelRatio|0,y.drawingBufferHeight/S.pixelRatio|0];S.autoResize&&b(),window.addEventListener("resize",b),S.update=function(a){v||(a=a||{},M=!0,N=!0)},S.add=function(a){v||(a.axes=F,I.push(a),J.push(-1),M=!0,N=!0,c())},S.remove=function(a){if(!v){var b=I.indexOf(a);0>b||(I.splice(b,1),J.pop(),M=!0,N=!0,c())}},S.dispose=function(){if(!v&&(v=!0,window.removeEventListener("resize",b),w.removeEventListener("webglcontextlost",h),S.mouseListener.enabled=!1,!S.contextLost)){F.dispose(),H.dispose();for(var a=0;a<I.length;++a)I[a].dispose();B.dispose();for(var a=0;a<L.length;++a)L[a].dispose();C.dispose(),y=null,F=null,H=null,I=[]}};var U=!1,V=0;S.mouseListener=p(w,function(a,b,c){if(!v){var d=L.length,e=I.length,f=A.object;A.distance=1/0,A.mouse[0]=b,A.mouse[1]=c,A.object=null,A.screen=null,A.dataCoordinate=A.dataPosition=null;var g=!1;if(a&&V)U=!0;else{U&&(N=!0),U=!1;for(var h=0;d>h;++h){var i=L[h].query(b,T[1]-c-1,S.pickRadius);if(i){if(i.distance>A.distance)continue;for(var j=0;e>j;++j){var k=I[j];if(J[j]===h){var l=k.pick(i);l&&(A.buttons=a,A.screen=i.coord,A.distance=i.distance,A.object=k,A.index=l.distance,A.dataPosition=l.position,A.dataCoordinate=l.dataCoordinate,A.data=l,g=!0)}}}}}f&&f!==A.object&&(f.highlight&&f.highlight(null),M=!0),A.object&&(A.object.highlight&&A.object.highlight(A.data),M=!0),g=g||A.object!==f,g&&S.onselect&&S.onselect(A),1&a&&!(1&V)&&S.onclick&&S.onclick(A),V=a}}),w.addEventListener("webglcontextlost",h);var W=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],X=[W[0].slice(),W[1].slice()];return u(),S.redraw=function(){v||(M=!0,t())},S}b.exports=h;var i=a("3d-view-controls"),j=a("gl-axes3d"),k=a("gl-axes3d/properties"),l=a("gl-spikes3d"),m=a("gl-select-static"),n=a("gl-fbo"),o=a("a-big-triangle"),p=a("mouse-change"),q=a("gl-mat4/perspective"),r=a("./lib/shader")},{"./lib/shader":123,"3d-view-controls":124,"a-big-triangle":126,"gl-axes3d":127,"gl-axes3d/properties":137,"gl-fbo":80,"gl-mat4/perspective":97,"gl-select-static":153,"gl-spikes3d":139,"mouse-change":196}],141:[function(a,b,c){"use strict";b.exports={vertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 color;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n fragColor = color;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",fragment:"#define GLSLIFY 1\nprecision lowp float;\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",pickVertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 id;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\nuniform vec4 pickOffset;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",pickFragment:"#define GLSLIFY 1\nprecision lowp float;\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],142:[function(a,b,c){"use strict";function d(a){if(a in m)return m[a];var b=k(a,{polygons:!0,font:"sans-serif",textAlign:"left",textBaseline:"alphabetic"}),c=[],d=[];b.forEach(function(a){a.forEach(function(a){for(var b=0;b<a.length;++b){var e=a[(b+a.length-1)%a.length],f=a[b],g=a[(b+1)%a.length],h=a[(b+2)%a.length],i=f[0]-e[0],j=f[1]-e[1],k=Math.sqrt(i*i+j*j);i/=k,j/=k,c.push(e[0],e[1]+1.4),d.push(j,-i),c.push(e[0],e[1]+1.4),d.push(-j,i),c.push(f[0],f[1]+1.4),d.push(-j,i),c.push(f[0],f[1]+1.4),d.push(-j,i),c.push(e[0],e[1]+1.4),d.push(j,-i),c.push(f[0],f[1]+1.4),d.push(j,-i);var l=h[0]-g[0],m=h[1]-g[1],n=Math.sqrt(l*l+m*m);l/=n,m/=n,c.push(f[0],f[1]+1.4),d.push(j,-i),c.push(f[0],f[1]+1.4),d.push(-j,i),c.push(g[0],g[1]+1.4),d.push(-m,l),c.push(g[0],g[1]+1.4),d.push(-m,l),c.push(f[0],f[1]+1.4),d.push(m,-l),c.push(g[0],g[1]+1.4),d.push(m,-l)}})});for(var e=[1/0,1/0,-(1/0),-(1/0)],f=0;f<c.length;f+=2)for(var g=0;2>g;++g)e[g]=Math.min(e[g],c[f+g]),e[2+g]=Math.max(e[2+g],c[f+g]);return m[a]={coords:c,normals:d,bounds:e}}function e(a,b,c,d,e,f,g){this.plot=a,this.shader=b,this.pickShader=c,this.positionBuffer=d,this.offsetBuffer=e,this.colorBuffer=f,this.idBuffer=g,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function f(a,b){var c=a.gl,d=g(c,l.vertex,l.fragment),f=g(c,l.pickVertex,l.pickFragment),i=h(c),j=h(c),k=h(c),m=h(c),n=new e(a,d,f,i,j,k,m);return n.update(b),a.addObject(n),n}b.exports=f;var g=a("gl-shader"),h=a("gl-buffer"),i=a("text-cache"),j=a("typedarray-pool"),k=a("vectorize-text"),l=a("./lib/shaders"),m={},n=e.prototype;!function(){function a(){var a=this.plot,d=this.bounds,e=a.viewBox,f=a.dataBox,g=a.pixelRatio,h=d[2]-d[0],i=d[3]-d[1],j=f[2]-f[0],k=f[3]-f[1];b[0]=2*h/j,b[4]=2*i/k,b[6]=2*(d[0]-f[0])/j-1,b[7]=2*(d[1]-f[1])/k-1;var l=e[2]-e[0],m=e[3]-e[1];c[0]=2*g/l,c[1]=2*g/m}var b=[1,0,0,0,1,0,0,0,1],c=[1,1];n.draw=function(){var d=this.plot,e=this.shader,f=this.numVertices,g=d.gl;a.call(this),e.bind(),e.uniforms.pixelScale=c,e.uniforms.viewTransform=b,this.positionBuffer.bind(),e.attributes.position.pointer(),this.offsetBuffer.bind(),e.attributes.offset.pointer(),this.colorBuffer.bind(),e.attributes.color.pointer(g.UNSIGNED_BYTE,!0),g.drawArrays(g.TRIANGLES,0,f)};var d=[0,0,0,0];n.drawPick=function(e){var f=this.plot,g=this.pickShader,h=this.numVertices,i=f.gl;this.pickOffset=e;for(var j=0;4>j;++j)d[j]=e>>8*j&255;return a.call(this),g.bind(),g.uniforms.pixelScale=c,g.uniforms.viewTransform=b,g.uniforms.pickOffset=d,this.positionBuffer.bind(),g.attributes.position.pointer(),this.offsetBuffer.bind(),g.attributes.offset.pointer(),this.idBuffer.bind(),g.attributes.id.pointer(i.UNSIGNED_BYTE,!1),i.drawArrays(i.TRIANGLES,0,h),e+this.numPoints}}(),n.pick=function(a,b,c){var d=this.pickOffset,e=this.numPoints;if(d>c||c>=d+e)return null;var f=c-d,g=this.points;return{object:this,pointId:f,dataCoord:[g[2*f],g[2*f+1]]}},n.update=function(a){a=a||{};var b=a.positions||[],c=a.colors||[],e=a.glyphs||[],f=a.sizes||[],g=a.borderWidths||[],h=a.borderColors||[];this.points=b;for(var k=this.bounds=[1/0,1/0,-(1/0),-(1/0)],l=0,m=0;m<e.length;++m){l+=i("sans-serif",e[m]).data.length+d(e[m]).coords.length>>1;for(var n=0;2>n;++n)k[n]=Math.min(k[n],b[2*m+n]),k[2+n]=Math.max(k[2+n],b[2*m+n])}k[0]===k[2]&&(k[2]+=1),k[3]===k[1]&&(k[3]+=1);for(var o=1/(k[2]-k[0]),p=1/(k[3]-k[1]),q=k[0],r=k[1],s=j.mallocFloat32(2*l),t=j.mallocFloat32(2*l),u=j.mallocUint8(4*l),v=j.mallocUint32(l),w=0,m=0;m<e.length;++m){for(var x=i("sans-serif",e[m]),y=d(e[m]),z=o*(b[2*m]-q),A=p*(b[2*m+1]-r),B=f[m],C=255*c[4*m],D=255*c[4*m+1],E=255*c[4*m+2],F=255*c[4*m+3],G=.5*(y.bounds[0]+y.bounds[2]),H=.5*(y.bounds[1]+y.bounds[3]),n=0;n<x.data.length;n+=2)s[2*w]=z,s[2*w+1]=A,t[2*w]=-B*(x.data[n]-G),t[2*w+1]=-B*(x.data[n+1]-H),u[4*w]=C,u[4*w+1]=D,u[4*w+2]=E,u[4*w+3]=F,v[w]=m,w+=1;var I=g[m];C=255*h[4*m],D=255*h[4*m+1],E=255*h[4*m+2],F=255*h[4*m+3];for(var n=0;n<y.coords.length;n+=2)s[2*w]=z,s[2*w+1]=A,t[2*w]=-(B*(y.coords[n]-G)+I*y.normals[n]),t[2*w+1]=-(B*(y.coords[n+1]-H)+I*y.normals[n+1]),u[4*w]=C,u[4*w+1]=D,u[4*w+2]=E,u[4*w+3]=F,v[w]=m,w+=1}this.numPoints=e.length,this.numVertices=l,this.positionBuffer.update(s),this.offsetBuffer.update(t),this.colorBuffer.update(u),this.idBuffer.update(v),j.free(s),j.free(t),j.free(u),j.free(v)},n.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.offsetBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":141,"gl-buffer":75,"gl-shader":154,"text-cache":228,"typedarray-pool":233,"vectorize-text":235}],143:[function(a,b,c){c.pointVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute float weight;\n\nuniform mat3 matrix;\nuniform float pointSize, useWeight;\n\nvarying float fragWeight;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n fragWeight = mix(1.0, weight, useWeight);\n}\n",c.pointFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\n\nvarying float fragWeight;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float radius = length(2.0*gl_PointCoord.xy-1.0);\n if(radius > 1.0) {\n discard;\n }\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n",c.pickVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n",c.pickFragment="#define GLSLIFY 1\nprecision mediump float;\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0*gl_PointCoord.xy-1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"},{}],144:[function(a,b,c){arguments[4][121][0].apply(c,arguments)},{dup:121}],145:[function(a,b,c){"use strict";function d(a,b,c,d,f){4*m>=f?e(0,f-1,a,b,c,d):l(0,f-1,a,b,c,d)}function e(a,b,c,d,e,f){for(var g=a+1;b>=g;++g){for(var h=c[g],i=d[2*g],j=d[2*g+1],k=e[g],l=f[g],m=g;m>a;){var n=c[m-1],o=d[2*(m-1)];if((n-h||i-o)>=0)break;c[m]=n,d[2*m]=o,d[2*m+1]=d[2*m-1],e[m]=e[m-1],f[m]=f[m-1],m-=1}c[m]=h,d[2*m]=i,d[2*m+1]=j,e[m]=k,f[m]=l}}function f(a,b,c,d,e,f){var g=c[a],h=d[2*a],i=d[2*a+1],j=e[a],k=f[a];c[a]=c[b],d[2*a]=d[2*b],d[2*a+1]=d[2*b+1],e[a]=e[b],f[a]=f[b],c[b]=g,d[2*b]=h,d[2*b+1]=i,e[b]=j,f[b]=k}function g(a,b,c,d,e,f){c[a]=c[b],d[2*a]=d[2*b],d[2*a+1]=d[2*b+1],e[a]=e[b],f[a]=f[b]}function h(a,b,c,d,e,f,g){var h=d[a],i=e[2*a],j=e[2*a+1],k=f[a],l=g[a];d[a]=d[b],e[2*a]=e[2*b],e[2*a+1]=e[2*b+1],f[a]=f[b],g[a]=g[b],d[b]=d[c],e[2*b]=e[2*c],e[2*b+1]=e[2*c+1],f[b]=f[c],g[b]=g[c],d[c]=h,e[2*c]=i,e[2*c+1]=j,f[c]=k,g[c]=l}function i(a,b,c,d,e,f,g,h,i,j,k){h[a]=h[b],i[2*a]=i[2*b],i[2*a+1]=i[2*b+1],j[a]=j[b],k[a]=k[b],h[b]=c,i[2*b]=d,i[2*b+1]=e,j[b]=f,k[b]=g}function j(a,b,c,d,e){return(c[a]-c[b]||d[2*b]-d[2*a]||e[a]-e[b])<0}function k(a,b,c,d,e,f,g,h){return(b-f[a]||g[2*a]-c||e-h[a])<0}function l(a,b,c,d,n,o){var p=(b-a+1)/6|0,q=a+p,r=b-p,s=a+b>>1,t=s-p,u=s+p,v=q,w=t,x=s,y=u,z=r,A=a+1,B=b-1,C=0;j(v,w,c,d,n,o)&&(C=v,v=w,w=C),j(y,z,c,d,n,o)&&(C=y,y=z,z=C),j(v,x,c,d,n,o)&&(C=v,v=x,x=C),j(w,x,c,d,n,o)&&(C=w,w=x,x=C),j(v,y,c,d,n,o)&&(C=v,v=y,y=C),j(x,y,c,d,n,o)&&(C=x,x=y,y=C),j(w,z,c,d,n,o)&&(C=w,w=z,z=C),j(w,x,c,d,n,o)&&(C=w,w=x,x=C),j(y,z,c,d,n,o)&&(C=y,y=z,z=C);var D=c[w],E=d[2*w],F=d[2*w+1],G=n[w],H=o[w],I=c[y],J=d[2*y],K=d[2*y+1],L=n[y],M=o[y],N=v,O=x,P=z,Q=q,R=s,S=r,T=c[N],U=c[O],V=c[P];c[Q]=T,c[R]=U,c[S]=V;for(var W=0;2>W;++W){var X=d[2*N+W],Y=d[2*O+W],Z=d[2*P+W];d[2*Q+W]=X,d[2*R+W]=Y,d[2*S+W]=Z}var $=n[N],_=n[O],aa=n[P];n[Q]=$,n[R]=_,n[S]=aa;var ba=o[N],ca=o[O],da=o[P];o[Q]=ba,o[R]=ca,o[S]=da,g(t,a,c,d,n,o),g(u,b,c,d,n,o);for(var ea=A;B>=ea;++ea)if(k(ea,D,E,F,G,c,d,n))ea!==A&&f(ea,A,c,d,n,o),++A;else if(!k(ea,I,J,K,L,c,d,n))for(;;){if(k(B,I,J,K,L,c,d,n)){k(B,D,E,F,G,c,d,n)?(h(ea,A,B,c,d,n,o),++A,--B):(f(ea,B,c,d,n,o),--B);break}if(--B<ea)break}i(a,A-1,D,E,F,G,H,c,d,n,o),i(b,B+1,I,J,K,L,M,c,d,n,o),m>=A-2-a?e(a,A-2,c,d,n,o):l(a,A-2,c,d,n,o),m>=b-(B+2)?e(B+2,b,c,d,n,o):l(B+2,b,c,d,n,o),m>=B-A?e(A,B,c,d,n,o):l(A,B,c,d,n,o)}b.exports=d;var m=32},{}],146:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h){for(var i=c,j=c;d>j;++j){var k=a[2*j],l=a[2*j+1],m=b[j];k>=e&&g>=k&&l>=f&&h>=l&&(j===i?i+=1:(a[2*j]=a[2*i],a[2*j+1]=a[2*i+1],b[j]=b[i],a[2*i]=k,a[2*i+1]=l,b[i]=m,i+=1))}return i}function e(a,b,c){this.pixelSize=a,this.offset=b,this.count=c}function f(a,b,c,f){function i(e,f,g,h,j,k){var l=.5*g,m=h+1,n=j-h;c[v]=n,u[v++]=k;for(var o=0;2>o;++o)for(var p=0;2>p;++p){var q=e+o*l,r=f+p*l,s=d(a,b,m,j,q,r,q+l,r+l);if(s!==m){if(s-m>=Math.max(.9*n,32)){var t=j+h>>>1;i(q,r,l,m,t,k+1),m=t}i(q,r,l,m,s,k+1),m=s}}}var j=a.length>>>1;if(1>j)return[];for(var k=1/0,l=1/0,m=-(1/0),n=-(1/0),o=0;j>o;++o){var p=a[2*o],q=a[2*o+1];k=Math.min(k,p),m=Math.max(m,p),l=Math.min(l,q),n=Math.max(n,q),b[o]=o}k===m&&(m+=1+Math.abs(m)),l===n&&(n+=1+Math.abs(m));var r=1/(m-k),s=1/(n-l),t=Math.max(m-k,n-l);f=f||[0,0,0,0],f[0]=k,f[1]=l,f[2]=m,f[3]=n;var u=g.mallocInt32(j),v=0;i(k,l,t,0,j,0),h(u,a,b,c,j);for(var w=[],x=0,y=j,v=j-1;v>=0;--v){a[2*v]=(a[2*v]-k)*r,a[2*v+1]=(a[2*v+1]-l)*s;var z=u[v];z!==x&&(w.push(new e(t*Math.pow(.5,z),v+1,y-(v+1))),y=v+1,x=z)}return w.push(new e(t*Math.pow(.5,z+1),0,y)),g.free(u),w}var g=a("typedarray-pool"),h=a("./lib/sort");b.exports=f},{"./lib/sort":145,"typedarray-pool":233}],147:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this.plot=a,this.offsetBuffer=b,this.pickBuffer=c,this.weightBuffer=d,this.shader=e,this.pickShader=f,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0,this.points=null,this.xCoords=null}function e(a,b){var c=a.gl,e=g(c),h=g(c),i=g(c),j=f(c,k.pointVertex,k.pointFragment),l=f(c,k.pickVertex,k.pickFragment),m=new d(a,e,h,i,j,l);return m.update(b),a.addObject(m),m}var f=a("gl-shader"),g=a("gl-buffer"),h=a("binary-search-bounds"),i=a("snap-points-2d"),j=a("typedarray-pool"),k=a("./lib/shader");b.exports=e;var l=d.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.xCoords&&j.free(this.xCoords),this.plot.removeObject(this)},l.update=function(a){function b(b,c){return b in a?a[b]:c}a=a||{},this.size=b("size",12),this.color=b("color",[1,0,0,1]).slice(),this.borderSize=b("borderSize",1),this.borderColor=b("borderColor",[0,0,0,1]).slice(),this.xCoords&&j.free(this.xCoords);var c=a.positions,d=j.mallocFloat32(c.length),e=j.mallocInt32(c.length>>>1);d.set(c);var f=j.mallocFloat32(c.length);this.points=c,this.scales=i(d,e,f,this.bounds),this.offsetBuffer.update(d),this.pickBuffer.update(e),this.weightBuffer.update(f);for(var g=j.mallocFloat32(c.length>>>1),h=0,k=0;h<c.length;h+=2,++k)g[k]=d[h];j.free(e),j.free(d),j.free(f),this.xCoords=g,this.pointCount=c.length>>>1,this.pickOffset=0},l.drawPick=function(){var a=[1,0,0,0,1,0,0,0,1],b=[0,0,0,0];return function(c){var d=this.plot,e=this.pickShader,f=this.scales,g=this.offsetBuffer,i=this.pickBuffer,j=this.bounds,k=this.size,l=this.borderSize,m=d.gl,n=d.pickPixelRatio,o=d.viewBox,p=d.dataBox;if(0===this.pointCount)return c;var q=j[2]-j[0],r=j[3]-j[1],s=p[2]-p[0],t=p[3]-p[1],u=(o[2]-o[0])*n/d.pixelRatio,v=(o[3]-o[1])*n/d.pixelRatio,w=Math.min(s/u,t/v); 36 a[0]=2*q/s,a[4]=2*r/t,a[6]=2*(j[0]-p[0])/s-1,a[7]=2*(j[1]-p[1])/t-1,this.pickOffset=c,b[0]=255&c,b[1]=c>>8&255,b[2]=c>>16&255,b[3]=c>>24&255,e.bind(),e.uniforms.matrix=a,e.uniforms.color=this.color,e.uniforms.borderColor=this.borderColor,e.uniforms.pointSize=n*(k+l),e.uniforms.pickOffset=b,0===this.borderSize?e.uniforms.centerFraction=2:e.uniforms.centerFraction=k/(k+l+1.25),g.bind(),e.attributes.position.pointer(),i.bind(),e.attributes.pickId.pointer(m.UNSIGNED_BYTE);for(var x=this.xCoords,y=(p[0]-j[0]-w*k*n)/q,z=(p[2]-j[0]+w*k*n)/q,A=f.length-1;A>=0;--A){var B=f[A];if(!(B.pixelSize<w&&A>1)){var C=B.offset,D=B.count+C,E=h.ge(x,y,C,D-1),F=h.lt(x,z,E,D-1)+1;m.drawArrays(m.POINTS,E,F-E)}}return c+this.pointCount}}(),l.draw=function(){var a=[1,0,0,0,1,0,0,0,1];return function(){var b=this.plot,c=this.shader,d=this.scales,e=this.offsetBuffer,f=this.bounds,g=this.size,i=this.borderSize,j=b.gl,k=b.pixelRatio,l=b.viewBox,m=b.dataBox;if(0!==this.pointCount){var n=f[2]-f[0],o=f[3]-f[1],p=m[2]-m[0],q=m[3]-m[1],r=l[2]-l[0],s=l[3]-l[1],t=Math.min(p/r,q/s);a[0]=2*n/p,a[4]=2*o/q,a[6]=2*(f[0]-m[0])/p-1,a[7]=2*(f[1]-m[1])/q-1,c.bind(),c.uniforms.matrix=a,c.uniforms.color=this.color,c.uniforms.borderColor=this.borderColor,c.uniforms.pointSize=k*(g+i),c.uniforms.useWeight=1,0===this.borderSize?c.uniforms.centerFraction=2:c.uniforms.centerFraction=g/(g+i+1.25),e.bind(),c.attributes.position.pointer(),this.weightBuffer.bind(),c.attributes.weight.pointer();for(var u=this.xCoords,v=(m[0]-f[0]-t*g*k)/n,w=(m[2]-f[0]+t*g*k)/n,x=!0,y=d.length-1;y>=0;--y){var z=d[y];if(!(z.pixelSize<t&&y>1)){var A=z.offset,B=z.count+A,C=h.ge(u,v,A,B-1),D=h.lt(u,w,C,B-1)+1;j.drawArrays(j.POINTS,C,D-C),x&&(x=!1,c.uniforms.useWeight=0)}}}}}(),l.pick=function(a,b,c){var d=this.pickOffset,e=this.pointCount;if(d>c||c>=d+e)return null;var f=c-d,g=this.points;return{object:this,pointId:f,dataCoord:[g[2*f],g[2*f+1]]}}},{"./lib/shader":143,"binary-search-bounds":144,"gl-buffer":75,"gl-shader":154,"snap-points-2d":146,"typedarray-pool":233}],148:[function(a,b,c){"use strict";function d(a,b){var c=f[b];if(c||(c=f[b]={}),a in c)return c[a];for(var d=e(a,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:b}),g=e(a,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:b}),h=[[1/0,1/0],[-(1/0),-(1/0)]],i=0;i<d.positions.length;++i)for(var j=d.positions[i],k=0;2>k;++k)h[0][k]=Math.min(h[0][k],j[k]),h[1][k]=Math.max(h[1][k],j[k]);return c[a]=[g,d,h]}var e=a("vectorize-text");b.exports=d;var f={}},{"vectorize-text":235}],149:[function(a,b,c){function d(a,b){var c=e(a,b),d=c.attributes;return d.position.location=0,d.color.location=1,d.glyph.location=2,d.id.location=3,c}var e=a("gl-shader"),f="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n \n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",g="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n \n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",h="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) ||\n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n",i="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = interpColor * opacity;\n }\n}\n",j="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n }\n}",k=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],l={vertex:f,fragment:i,attributes:k},m={vertex:g,fragment:i,attributes:k},n={vertex:h,fragment:i,attributes:k},o={vertex:f,fragment:j,attributes:k},p={vertex:g,fragment:j,attributes:k},q={vertex:h,fragment:j,attributes:k};c.createPerspective=function(a){return d(a,l)},c.createOrtho=function(a){return d(a,m)},c.createProject=function(a){return d(a,n)},c.createPickPerspective=function(a){return d(a,o)},c.createPickOrtho=function(a){return d(a,p)},c.createPickProject=function(a){return d(a,q)}},{"gl-shader":154}],150:[function(a,b,c){"use strict";function d(a,b){var c=a[0],d=a[1],e=a[2],f=a[3];return a[0]=b[0]*c+b[4]*d+b[8]*e+b[12]*f,a[1]=b[1]*c+b[5]*d+b[9]*e+b[13]*f,a[2]=b[2]*c+b[6]*d+b[10]*e+b[14]*f,a[3]=b[3]*c+b[7]*d+b[11]*e+b[15]*f,a}function e(a,b,c,e){return d(e,e,c),d(e,e,b),d(e,e,a)}function f(a,b){this.index=a,this.dataCoordinate=this.position=b}function g(a,b,c,d,e,g,h,i,j,k,l,m){this.gl=a,this.pixelRatio=1,this.shader=b,this.orthoShader=c,this.projectShader=d,this.pointBuffer=e,this.colorBuffer=g,this.glyphBuffer=h,this.idBuffer=i,this.vao=j,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=k,this.pickOrthoShader=l,this.pickProjectShader=m,this.points=[],this._selectResult=new f(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function h(a){return a[0]=a[1]=a[2]=0,a}function i(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=1,a}function j(a,b,c,d){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[c]=d,a}function k(a){for(var b=D,c=0;2>c;++c)for(var d=0;3>d;++d)b[c][d]=Math.max(Math.min(a[c][d],1e8),-1e8);return b}function l(a,b,c,d,f){var g,l=b.axesProject,m=b.gl,n=a.uniforms,o=c.model||u,p=c.view||u,q=c.projection||u,s=b.axesBounds,t=k(b.clipBounds);g=b.axes?b.axes.lastCubeProps.axis:[1,1,1],w[0]=2/m.drawingBufferWidth,w[1]=2/m.drawingBufferHeight,a.bind(),n.view=p,n.projection=q,n.screenSize=w,n.highlightId=b.highlightId,n.highlightScale=b.highlightScale,n.clipBounds=t,n.pickGroup=b.pickId/255,n.pixelRatio=b.pixelRatio;for(var v=0;3>v;++v)if(l[v]&&b.projectOpacity[v]<1===d){n.scale=b.projectScale[v],n.opacity=b.projectOpacity[v];for(var D=B,E=0;16>E;++E)D[E]=0;for(var E=0;4>E;++E)D[5*E]=1;D[5*v]=0,g[v]<0?D[12+v]=s[0][v]:D[12+v]=s[1][v],r(D,o,D),n.model=D;var F=(v+1)%3,G=(v+2)%3,H=h(x),I=h(y);H[F]=1,I[G]=1;var J=e(q,p,o,i(z,H)),K=e(q,p,o,i(A,I));if(Math.abs(J[1])>Math.abs(K[1])){var L=J;J=K,K=L,L=H,H=I,I=L;var M=F;F=G,G=M}J[0]<0&&(H[F]=-1),K[1]>0&&(I[G]=-1);for(var N=0,O=0,E=0;4>E;++E)N+=Math.pow(o[4*F+E],2),O+=Math.pow(o[4*G+E],2);H[F]/=Math.sqrt(N),I[G]/=Math.sqrt(O),n.axes[0]=H,n.axes[1]=I,n.fragClipBounds[0]=j(C,t[0],v,-1e8),n.fragClipBounds[1]=j(C,t[1],v,1e8),b.vao.draw(m.TRIANGLES,b.vertexCount),b.lineWidth>0&&(m.lineWidth(b.lineWidth),b.vao.draw(m.LINES,b.lineVertexCount,b.vertexCount))}}function m(a,b,c,d,e,f){var g=c.gl;if(c.vao.bind(),e===c.opacity<1||f){a.bind();var h=a.uniforms;h.model=d.model||u,h.view=d.view||u,h.projection=d.projection||u,w[0]=2/g.drawingBufferWidth,w[1]=2/g.drawingBufferHeight,h.screenSize=w,h.highlightId=c.highlightId,h.highlightScale=c.highlightScale,h.fragClipBounds=G,h.clipBounds=c.axes.bounds,h.opacity=c.opacity,h.pickGroup=c.pickId/255,h.pixelRatio=c.pixelRatio,c.vao.draw(g.TRIANGLES,c.vertexCount),c.lineWidth>0&&(g.lineWidth(c.lineWidth),c.vao.draw(g.LINES,c.lineVertexCount,c.vertexCount))}l(b,c,d,e,f),c.vao.unbind()}function n(a){var b=a.gl,c=s.createPerspective(b),d=s.createOrtho(b),e=s.createProject(b),f=s.createPickPerspective(b),h=s.createPickOrtho(b),i=s.createPickProject(b),j=o(b),k=o(b),l=o(b),m=o(b),n=p(b,[{buffer:j,size:3,type:b.FLOAT},{buffer:k,size:4,type:b.FLOAT},{buffer:l,size:2,type:b.FLOAT},{buffer:m,size:4,type:b.UNSIGNED_BYTE,normalized:!0}]),q=new g(b,c,d,e,j,k,l,m,n,f,h,i);return q.update(a),q}var o=a("gl-buffer"),p=a("gl-vao"),q=a("typedarray-pool"),r=a("gl-mat4/multiply"),s=a("./lib/shaders"),t=a("./lib/glyphs"),u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];b.exports=n;var v=g.prototype;v.pickSlots=1,v.setPickBase=function(a){this.pickId=a},v.isTransparent=function(){if(this.opacity<1)return!0;for(var a=0;3>a;++a)if(this.axesProject[a]&&this.projectOpacity[a]<1)return!0;return!1},v.isOpaque=function(){if(this.opacity>=1)return!0;for(var a=0;3>a;++a)if(this.axesProject[a]&&this.projectOpacity[a]>=1)return!0;return!1};var w=[0,0],x=[0,0,0],y=[0,0,0],z=[0,0,0,1],A=[0,0,0,1],B=u.slice(),C=[0,0,0],D=[[0,0,0],[0,0,0]],E=[-1e8,-1e8,-1e8],F=[1e8,1e8,1e8],G=[E,F];v.draw=function(a){var b=this.useOrtho?this.orthoShader:this.shader;m(b,this.projectShader,this,a,!1,!1)},v.drawTransparent=function(a){var b=this.useOrtho?this.orthoShader:this.shader;m(b,this.projectShader,this,a,!0,!1)},v.drawPick=function(a){var b=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;m(b,this.pickProjectShader,this,a,!1,!0)},v.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;var b=a.value[2]+(a.value[1]<<8)+(a.value[0]<<16);if(b>=this.pointCount||0>b)return null;var c=this.points[b],d=this._selectResult;d.index=b;for(var e=0;3>e;++e)d.position[e]=d.dataCoordinate[e]=c[e];return d},v.highlight=function(a){if(a){var b=a.index,c=255&b,d=b>>8&255,e=b>>16&255;this.highlightId=[c/255,d/255,e/255,0]}else this.highlightId=[1,1,1,1]},v.update=function(a){if(a=a||{},"perspective"in a&&(this.useOrtho=!a.perspective),"orthographic"in a&&(this.useOrtho=!!a.orthographic),"lineWidth"in a&&(this.lineWidth=a.lineWidth),"project"in a)if(Array.isArray(a.project))this.axesProject=a.project;else{var b=!!a.project;this.axesProject=[b,b,b]}if("projectScale"in a)if(Array.isArray(a.projectScale))this.projectScale=a.projectScale.slice();else{var c=+a.projectScale;this.projectScale=[c,c,c]}if("projectOpacity"in a)if(Array.isArray(a.projectOpacity))this.projectOpacity=a.projectOpacity.slice();else{var c=+a.projectOpacity;this.projectOpacity=[c,c,c]}"opacity"in a&&(this.opacity=a.opacity),this.dirty=!0;var d=a.position;if(d){var e=a.font||"normal",f=a.alignment||[0,0],g=[1/0,1/0,1/0],h=[-(1/0),-(1/0),-(1/0)],i=a.glyph,j=a.color,k=a.size,l=a.angle,m=a.lineColor,n=0,o=0,p=0,r=d.length;a:for(var s=0;r>s;++s){for(var u=d[s],v=0;3>v;++v)if(isNaN(u[v])||!isFinite(u[v]))continue a;var w;w=Array.isArray(i)?t(i[s],e):i?t(i,e):t("â",e);var x=w[0],y=w[1],z=w[2];o+=3*x.cells.length,p+=2*y.edges.length}var A=o+p,B=q.mallocFloat(3*A),C=q.mallocFloat(4*A),D=q.mallocFloat(2*A),E=q.mallocUint32(A),F=[0,f[1]],G=0,H=o,I=[0,0,0,1],J=[0,0,0,1],K=Array.isArray(j)&&Array.isArray(j[0]),L=Array.isArray(m)&&Array.isArray(m[0]);a:for(var s=0;r>s;++s){for(var u=d[s],v=0;3>v;++v){if(isNaN(u[v])||!isFinite(u[v])){n+=1;continue a}h[v]=Math.max(h[v],u[v]),g[v]=Math.min(g[v],u[v])}var w;w=Array.isArray(i)?t(i[s],e):i?t(i,e):t("â",e);var x=w[0],y=w[1],z=w[2];if(Array.isArray(j)){var M;if(M=K?j[s]:j,3===M.length){for(var v=0;3>v;++v)I[v]=M[v];I[3]=1}else if(4===M.length)for(var v=0;4>v;++v)I[v]=M[v]}else I[0]=I[1]=I[2]=0,I[3]=1;if(Array.isArray(m)){var M;if(M=L?m[s]:m,3===M.length){for(var v=0;3>v;++v)J[v]=M[v];J[v]=1}else if(4===M.length)for(var v=0;4>v;++v)J[v]=M[v]}else J[0]=J[1]=J[2]=0,J[3]=1;var N=.5;Array.isArray(k)?N=+k[s]:k?N=+k:this.useOrtho&&(N=12);var O=0;Array.isArray(l)?O=+l[s]:l&&(O=+l);for(var P=Math.cos(O),Q=Math.sin(O),u=d[s],v=0;3>v;++v)h[v]=Math.max(h[v],u[v]),g[v]=Math.min(g[v],u[v]);f[0]<0?F[0]=f[0]*(1+z[1][0]):f[0]>0&&(F[0]=-f[0]*(1+z[0][0]));for(var R=x.cells,S=x.positions,v=0;v<R.length;++v)for(var T=R[v],U=0;3>U;++U){for(var V=0;3>V;++V)B[3*G+V]=u[V];for(var V=0;4>V;++V)C[4*G+V]=I[V];E[G]=n;var W=S[T[U]];D[2*G]=N*(P*W[0]-Q*W[1]+F[0]),D[2*G+1]=N*(Q*W[0]+P*W[1]+F[1]),G+=1}for(var R=y.edges,S=y.positions,v=0;v<R.length;++v)for(var T=R[v],U=0;2>U;++U){for(var V=0;3>V;++V)B[3*H+V]=u[V];for(var V=0;4>V;++V)C[4*H+V]=J[V];E[H]=n;var W=S[T[U]];D[2*H]=N*(P*W[0]-Q*W[1]+F[0]),D[2*H+1]=N*(Q*W[0]+P*W[1]+F[1]),H+=1}n+=1}this.vertexCount=o,this.lineVertexCount=p,this.pointBuffer.update(B),this.colorBuffer.update(C),this.glyphBuffer.update(D),this.idBuffer.update(new Uint32Array(E)),q.free(B),q.free(C),q.free(D),q.free(E),this.bounds=[g,h],this.points=d,this.pointCount=d.length}},v.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":148,"./lib/shaders":149,"gl-buffer":75,"gl-mat4/multiply":96,"gl-vao":189,"typedarray-pool":233}],151:[function(a,b,c){"use strict";c.boxVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",c.boxFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"},{}],152:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.boxBuffer=b,this.boxShader=c,this.enabled=!0,this.selectBox=[1/0,1/0,-(1/0),-(1/0)],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function e(a,b){var c=a.gl,e=g(c,[0,0,0,1,1,0,1,1]),i=f(c,h.boxVertex,h.boxFragment),j=new d(a,e,i);return j.update(b),a.addOverlay(j),j}var f=a("gl-shader"),g=a("gl-buffer"),h=a("./lib/shaders");b.exports=e;var i=d.prototype;i.draw=function(){if(this.enabled){var a=this.plot,b=this.selectBox,c=this.borderWidth,d=(this.innerFill,this.innerColor),e=(this.outerFill,this.outerColor),f=this.borderColor,g=a.box,h=a.screenBox,i=a.dataBox,j=a.viewBox,k=a.pixelRatio,l=(b[0]-i[0])*(j[2]-j[0])/(i[2]-i[0])+j[0],m=(b[1]-i[1])*(j[3]-j[1])/(i[3]-i[1])+j[1],n=(b[2]-i[0])*(j[2]-j[0])/(i[2]-i[0])+j[0],o=(b[3]-i[1])*(j[3]-j[1])/(i[3]-i[1])+j[1];if(l=Math.max(l,j[0]),m=Math.max(m,j[1]),n=Math.min(n,j[2]),o=Math.min(o,j[3]),!(l>n||m>o)){g.bind();var p=h[2]-h[0],q=h[3]-h[1];if(this.outerFill&&(g.drawBox(0,0,p,m,e),g.drawBox(0,m,l,o,e),g.drawBox(0,o,p,q,e),g.drawBox(n,m,p,o,e)),this.innerFill&&g.drawBox(l,m,n,o,d),c>0){var r=c*k;g.drawBox(l-r,m-r,n+r,m+r,f),g.drawBox(l-r,o-r,n+r,o+r,f),g.drawBox(l-r,m-r,l+r,o+r,f),g.drawBox(n-r,m-r,n+r,o+r,f)}}}},i.update=function(a){a=a||{},this.innerFill=!!a.innerFill,this.outerFill=!!a.outerFill,this.innerColor=(a.innerColor||[0,0,0,.5]).slice(),this.outerColor=(a.outerColor||[0,0,0,.5]).slice(),this.borderColor=(a.borderColor||[0,0,0,1]).slice(),this.borderWidth=a.borderWidth||0,this.selectBox=(a.selectBox||this.selectBox).slice()},i.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":151,"gl-buffer":75,"gl-shader":154}],153:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.coord=[a,b],this.id=c,this.value=d,this.distance=e}function e(a,b,c){this.gl=a,this.fbo=b,this.buffer=c,this._readTimeout=null;var d=this;this._readCallback=function(){d.gl&&(b.bind(),a.readPixels(0,0,b.shape[0],b.shape[1],a.RGBA,a.UNSIGNED_BYTE,d.buffer),d._readTimeout=null)}}function f(a,b){var c=g(a,b),d=h.mallocUint8(b[0]*b[1]*4);return new e(a,c,d)}b.exports=f;var g=a("gl-fbo"),h=a("typedarray-pool"),i=a("ndarray"),j=a("bit-twiddle").nextPow2,k=a("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(255>_inline_31_arg0_||255>_inline_31_arg1_||255>_inline_31_arg2_||255>_inline_31_arg3_){var _inline_31_l=_inline_31_arg4_-_inline_31_arg6_[0],_inline_31_a=_inline_31_arg5_-_inline_31_arg6_[1],_inline_31_f=_inline_31_l*_inline_31_l+_inline_31_a*_inline_31_a;_inline_31_f<this_closestD2&&(this_closestD2=_inline_31_f,this_closestX=_inline_31_arg6_[0],this_closestY=_inline_31_arg6_[1])}}",args:[{name:"_inline_31_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg4_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_31_a","_inline_31_f","_inline_31_l"]},post:{body:"{return[this_closestX,this_closestY,this_closestD2]}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},debug:!1,funcName:"cwise",blockSize:64}),l=e.prototype;Object.defineProperty(l,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(a){if(this.gl){this.fbo.shape=a;var b=this.fbo.shape[0],c=this.fbo.shape[1];if(c*b*4>this.buffer.length){h.free(this.buffer);for(var d=this.buffer=h.mallocUint8(j(c*b*4)),e=0;c*b*4>e;++e)d[e]=255}return a}}}),l.begin=function(){var a=this.gl;this.shape;a&&(this.fbo.bind(),a.clearColor(1,1,1,1),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT))},l.end=function(){var a=this.gl;a&&(a.bindFramebuffer(a.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},l.query=function(a,b,c){if(!this.gl)return null;var e=this.fbo.shape.slice();a=0|a,b=0|b,"number"!=typeof c&&(c=1);var f=0|Math.min(Math.max(a-c,0),e[0]),g=0|Math.min(Math.max(a+c,0),e[0]),h=0|Math.min(Math.max(b-c,0),e[1]),j=0|Math.min(Math.max(b+c,0),e[1]);if(f>=g||h>=j)return null;var l=[g-f,j-h],m=i(this.buffer,[l[0],l[1],4],[4,4*e[0],1],4*(f+e[0]*h)),n=k(m.hi(l[0],l[1],1),c,c),o=n[0],p=n[1];if(0>o||Math.pow(this.radius,2)<n[2])return null;var q=m.get(o,p,0),r=m.get(o,p,1),s=m.get(o,p,2),t=m.get(o,p,3);return new d(o+f|0,p+h|0,q,[r,s,t],Math.sqrt(n[2]))},l.dispose=function(){this.gl&&(this.fbo.dispose(),h.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":49,"cwise/lib/wrapper":69,"gl-fbo":80,ndarray:208,"typedarray-pool":233}],154:[function(a,b,c){"use strict";function d(a){this.gl=a,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function e(a,b){return a.name<b.name?-1:1}function f(a,b,c,e,f){var g=new d(a);return g.update(b,c,e,f),g}var g=a("./lib/create-uniforms"),h=a("./lib/create-attributes"),i=a("./lib/reflect"),j=a("./lib/shader-cache"),k=a("./lib/runtime-reflect"),l=a("./lib/GLError"),m=d.prototype;m.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},m.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},m.update=function(a,b,c,d){function f(){n.program=j.program(o,n._vref,n._fref,u,v);for(var a=0;a<c.length;++a)C[a]=o.getUniformLocation(n.program,c[a].name)}if(!b||1===arguments.length){var m=a;a=m.vertex,b=m.fragment,c=m.uniforms,d=m.attributes}var n=this,o=n.gl,p=n._vref;n._vref=j.shader(o,o.VERTEX_SHADER,a),p&&p.dispose(),n.vertShader=n._vref.shader;var q=this._fref;if(n._fref=j.shader(o,o.FRAGMENT_SHADER,b),q&&q.dispose(),n.fragShader=n._fref.shader,!c||!d){var r=o.createProgram();if(o.attachShader(r,n.fragShader),o.attachShader(r,n.vertShader),o.linkProgram(r),!o.getProgramParameter(r,o.LINK_STATUS)){var s=o.getProgramInfoLog(r);throw new l(s,"Error linking program:"+s)}c=c||k.uniforms(o,r),d=d||k.attributes(o,r),o.deleteProgram(r)}d=d.slice(),d.sort(e);for(var t=[],u=[],v=[],w=0;w<d.length;++w){var x=d[w];if(x.type.indexOf("mat")>=0){for(var y=0|x.type.charAt(x.type.length-1),z=new Array(y),A=0;y>A;++A)z[A]=v.length,u.push(x.name+"["+A+"]"),"number"==typeof x.location?v.push(x.location+A):Array.isArray(x.location)&&x.location.length===y&&"number"==typeof x.location[A]?v.push(0|x.location[A]):v.push(-1);t.push({name:x.name,type:x.type,locations:z})}else t.push({name:x.name,type:x.type,locations:[v.length]}),u.push(x.name),"number"==typeof x.location?v.push(0|x.location):v.push(-1)}for(var B=0,w=0;w<v.length;++w)if(v[w]<0){for(;v.indexOf(B)>=0;)B+=1;v[w]=B}var C=new Array(c.length);f(),n._relink=f,n.types={uniforms:i(c),attributes:i(d)},n.attributes=h(o,n,t,v),Object.defineProperty(n,"uniforms",g(o,n,c,C))},b.exports=f},{"./lib/GLError":155,"./lib/create-attributes":156,"./lib/create-uniforms":157,"./lib/reflect":158,"./lib/runtime-reflect":159,"./lib/shader-cache":160}],155:[function(a,b,c){function d(a,b,c){this.shortMessage=b||"",this.longMessage=c||"",this.rawError=a||"",this.message="gl-shader: "+(b||a||"")+(c?"\n"+c:""),this.stack=(new Error).stack}d.prototype=new Error,d.prototype.name="GLError",d.prototype.constructor=d,b.exports=d},{}],156:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this._gl=a,this._wrapper=b,this._index=c,this._locations=d,this._dimension=e,this._constFunc=f}function e(a,b,c,e,f,g,h){for(var i=["gl","v"],j=[],k=0;f>k;++k)i.push("x"+k),j.push("x"+k);i.push("if(x0.length===void 0){return gl.vertexAttrib"+f+"f(v,"+j.join()+")}else{return gl.vertexAttrib"+f+"fv(v,x0)}");var l=Function.apply(null,i),m=new d(a,b,c,e,f,l);Object.defineProperty(g,h,{set:function(b){return a.disableVertexAttribArray(e[c]),l(a,e[c],b),b},get:function(){return m},enumerable:!0})}function f(a,b,c,d,f,g,h){for(var i=new Array(f),j=new Array(f),k=0;f>k;++k)e(a,b,c[k],d,f,i,k),j[k]=i[k];Object.defineProperty(i,"location",{set:function(a){if(Array.isArray(a))for(var b=0;f>b;++b)j[b].location=a[b];else for(var b=0;f>b;++b)j[b].location=a+b;return a},get:function(){for(var a=new Array(f),b=0;f>b;++b)a[b]=d[c[b]];return a},enumerable:!0}),i.pointer=function(b,e,g,h){b=b||a.FLOAT,e=!!e,g=g||f*f,h=h||0;for(var i=0;f>i;++i){var j=d[c[i]];a.vertexAttribPointer(j,f,b,e,g,h+i*f),a.enableVertexAttribArray(j)}};var l=new Array(f),m=a["vertexAttrib"+f+"fv"];Object.defineProperty(g,h,{set:function(b){for(var e=0;f>e;++e){var g=d[c[e]];if(a.disableVertexAttribArray(g),Array.isArray(b[0]))m.call(a,g,b[e]);else{for(var h=0;f>h;++h)l[h]=b[f*e+h];m.call(a,g,l)}}return b},get:function(){return i},enumerable:!0})}function g(a,b,c,d){for(var g={},i=0,j=c.length;j>i;++i){var k=c[i],l=k.name,m=k.type,n=k.locations;switch(m){case"bool":case"int":case"float":e(a,b,n[0],d,1,g,l);break;default:if(m.indexOf("vec")>=0){var o=m.charCodeAt(m.length-1)-48;if(2>o||o>4)throw new h("","Invalid data type for attribute "+l+": "+m);e(a,b,n[0],d,o,g,l)}else{if(!(m.indexOf("mat")>=0))throw new h("","Unknown data type for attribute "+l+": "+m);var o=m.charCodeAt(m.length-1)-48;if(2>o||o>4)throw new h("","Invalid data type for attribute "+l+": "+m);f(a,b,n,d,o,g,l)}}}return g}b.exports=g;var h=a("./GLError"),i=d.prototype;i.pointer=function(a,b,c,d){var e=this,f=e._gl,g=e._locations[e._index];f.vertexAttribPointer(g,e._dimension,a||f.FLOAT,!!b,c||0,d||0),f.enableVertexAttribArray(g)},i.set=function(a,b,c,d){return this._constFunc(this._locations[this._index],a,b,c,d)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(a){return a!==this._locations[this._index]&&(this._locations[this._index]=0|a,this._wrapper.program=null),0|a}})},{"./GLError":155}],157:[function(a,b,c){"use strict";function d(a){var b=new Function("y","return function(){return y}");return b(a)}function e(a,b){for(var c=new Array(a),d=0;a>d;++d)c[d]=b;return c}function f(a,b,c,f){function i(c){var d=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+c+"])}");return d(a,b,f)}function j(a,b,c){switch(c){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+b+"],obj"+a+")";case"float":return"gl.uniform1f(locations["+b+"],obj"+a+")";default:var d=c.indexOf("vec");if(!(d>=0&&1>=d&&c.length===4+d)){if(0===c.indexOf("mat")&&4===c.length){var e=c.charCodeAt(c.length-1)-48;if(2>e||e>4)throw new h("","Invalid uniform dimension type for matrix "+name+": "+c);return"gl.uniformMatrix"+e+"fv(locations["+b+"],false,obj"+a+")"}throw new h("","Unknown uniform data type for "+name+": "+c)}var e=c.charCodeAt(c.length-1)-48;if(2>e||e>4)throw new h("","Invalid data type");switch(c.charAt(0)){case"b":case"i":return"gl.uniform"+e+"iv(locations["+b+"],obj"+a+")";case"v":return"gl.uniform"+e+"fv(locations["+b+"],obj"+a+")";default:throw new h("","Unrecognized data type for vector "+name+": "+c)}}}function k(a,b){if("object"!=typeof b)return[[a,b]];var c=[];for(var d in b){var e=b[d],f=a;f+=parseInt(d)+""===d?"["+d+"]":"."+d,"object"==typeof e?c.push.apply(c,k(f,e)):c.push([f,e])}return c}function l(b){for(var d=["return function updateProperty(obj){"],e=k("",b),g=0;g<e.length;++g){var h=e[g],i=h[0],l=h[1];f[l]&&d.push(j(i,l,c[l].type))}d.push("return obj}");var m=new Function("gl","locations",d.join("\n"));return m(a,f)}function m(a){switch(a){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var b=a.indexOf("vec");if(b>=0&&1>=b&&a.length===4+b){var c=a.charCodeAt(a.length-1)-48;if(2>c||c>4)throw new h("","Invalid data type");return"b"===a.charAt(0)?e(c,!1):e(c,0)}if(0===a.indexOf("mat")&&4===a.length){var c=a.charCodeAt(a.length-1)-48;if(2>c||c>4)throw new h("","Invalid uniform dimension type for matrix "+name+": "+a);return e(c*c,0)}throw new h("","Unknown uniform data type for "+name+": "+a)}}function n(a,b,e){if("object"==typeof e){var g=o(e);Object.defineProperty(a,b,{get:d(g),set:l(e),enumerable:!0,configurable:!1})}else f[e]?Object.defineProperty(a,b,{get:i(e),set:l(e),enumerable:!0,configurable:!1}):a[b]=m(c[e].type)}function o(a){var b;if(Array.isArray(a)){b=new Array(a.length);for(var c=0;c<a.length;++c)n(b,c,a[c])}else{b={};for(var d in a)n(b,d,a[d])}return b}var p=g(c,!0);return{get:d(o(p)),set:l(p),enumerable:!0,configurable:!0}}var g=a("./reflect"),h=a("./GLError");b.exports=f},{"./GLError":155,"./reflect":158}],158:[function(a,b,c){"use strict";function d(a,b){for(var c={},d=0;d<a.length;++d)for(var e=a[d].name,f=e.split("."),g=c,h=0;h<f.length;++h){var i=f[h].split("[");if(i.length>1){i[0]in g||(g[i[0]]=[]),g=g[i[0]];for(var j=1;j<i.length;++j){var k=parseInt(i[j]);j<i.length-1||h<f.length-1?(k in g||(j<i.length-1?g[k]=[]:g[k]={}),g=g[k]):b?g[k]=d:g[k]=a[d].type}}else h<f.length-1?(i[0]in g||(g[i[0]]={}),g=g[i[0]]):b?g[i[0]]=d:g[i[0]]=a[d].type}return c}b.exports=d},{}],159:[function(a,b,c){"use strict";function d(a,b){if(!h){var c=Object.keys(g);h={};for(var d=0;d<c.length;++d){var e=c[d];h[a[e]]=g[e]}}return h[b]}function e(a,b){for(var c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS),e=[],f=0;c>f;++f){var g=a.getActiveUniform(b,f);if(g){var h=d(a,g.type);if(g.size>1)for(var i=0;i<g.size;++i)e.push({name:g.name.replace("[0]","["+i+"]"),type:h});else e.push({name:g.name,type:h})}}return e}function f(a,b){for(var c=a.getProgramParameter(b,a.ACTIVE_ATTRIBUTES),e=[],f=0;c>f;++f){var g=a.getActiveAttrib(b,f);g&&e.push({name:g.name,type:d(a,g.type)})}return e}c.uniforms=e,c.attributes=f;var g={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},h=null},{}],160:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g){this.id=a,this.src=b,this.type=c,this.shader=d,this.count=f,this.programs=[],this.cache=g}function e(a){this.gl=a,this.shaders=[{},{}],this.programs={}}function f(a,b,c){var d=a.createShader(b);if(a.shaderSource(d,c),a.compileShader(d),!a.getShaderParameter(d,a.COMPILE_STATUS)){var e=a.getShaderInfoLog(d);try{var f=l(e,c,b)}catch(g){throw console.warn("Failed to format compiler error: "+g),new k(e,"Error compiling shader:\n"+e)}throw new k(e,f["short"],f["long"])}return d}function g(a,b,c,d,e){var f=a.createProgram();a.attachShader(f,b),a.attachShader(f,c);for(var g=0;g<d.length;++g)a.bindAttribLocation(f,e[g],d[g]);if(a.linkProgram(f),!a.getProgramParameter(f,a.LINK_STATUS)){var h=a.getProgramInfoLog(f);throw new k(h,"Error linking program: "+h)}return f}function h(a){var b=n.get(a);return b||(b=new e(a),n.set(a,b)),b}function i(a,b,c){return h(a).getShaderReference(b,c)}function j(a,b,c,d,e){return h(a).getProgram(b,c,d,e)}c.shader=i,c.program=j;var k=a("./GLError"),l=a("gl-format-compiler-error"),m="undefined"==typeof WeakMap?a("weakmap-shim"):WeakMap,n=new m,o=0;d.prototype.dispose=function(){if(0===--this.count){for(var a=this.cache,b=a.gl,c=this.programs,d=0,e=c.length;e>d;++d){var f=a.programs[c[d]];f&&(delete a.programs[d],b.deleteProgram(f))}b.deleteShader(this.shader),delete a.shaders[this.type===b.FRAGMENT_SHADER|0][this.src]}};var p=e.prototype;p.getShaderReference=function(a,b){var c=this.gl,e=this.shaders[a===c.FRAGMENT_SHADER|0],g=e[b];if(g&&c.isShader(g.shader))g.count+=1;else{var h=f(c,a,b);g=e[b]=new d(o++,b,a,h,[],1,this)}return g},p.getProgram=function(a,b,c,d){ 37 var e=[a.id,b.id,c.join(":"),d.join(":")].join("@"),f=this.programs[e];return f&&this.gl.isProgram(f)||(this.programs[e]=f=g(this.gl,a.shader,b.shader,c,d),a.programs.push(e),b.programs.push(e)),f}},{"./GLError":155,"gl-format-compiler-error":161,"weakmap-shim":177}],161:[function(a,b,c){function d(a,b,c){"use strict";var d=g(b)||"of unknown name (see npm glsl-shader-name)",i="unknown type";void 0!==c&&(i=c===f.FRAGMENT_SHADER?"fragment":"vertex");for(var j=e("Error compiling %s shader %s:\n",i,d),k=e("%s%s",j,a),l=a.split("\n"),m={},n=0;n<l.length;n++){var o=l[n];if(""!==o){var p=parseInt(o.split(":")[2]);if(isNaN(p))throw new Error(e("Could not parse error: %s",o));m[p]=o}}for(var q=h(b).split("\n"),n=0;n<q.length;n++)if(m[n+3]||m[n+2]||m[n+1]){var r=q[n];if(j+=r+"\n",m[n+1]){var s=m[n+1];s=s.substr(s.split(":",3).join(":").length+1).trim(),j+=e("^^^ %s\n\n",s)}}return{"long":j.trim(),"short":k.trim()}}var e=a("sprintf-js").sprintf,f=a("gl-constants/lookup"),g=a("glsl-shader-name"),h=a("add-line-numbers");b.exports=d},{"add-line-numbers":162,"gl-constants/lookup":166,"glsl-shader-name":167,"sprintf-js":174}],162:[function(a,b,c){function d(a,b,c){b="number"==typeof b?b:1,c=c||": ";var d=a.split(/\r?\n/),f=String(d.length+b-1).length;return d.map(function(a,d){var g=d+b,h=String(g).length,i=e(g,f-h);return i+c+a}).join("\n")}var e=a("pad-left");b.exports=d},{"pad-left":163}],163:[function(a,b,c){"use strict";var d=a("repeat-string");b.exports=function(a,b,c){return c="undefined"!=typeof c?c+"":" ",d(c,b)+a}},{"repeat-string":164}],164:[function(a,b,c){"use strict";function d(a,b){if("string"!=typeof a)throw new TypeError("repeat-string expects a string.");if(1===b)return a;if(2===b)return a+a;var c=a.length*b;for(e===a&&"undefined"!=typeof e||(e=a,f="");c>f.length&&b>0&&(1&b&&(f+=a),b>>=1);)a+=a;return f.substr(0,c)}b.exports=d;var e,f=""},{}],165:[function(a,b,c){b.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],166:[function(a,b,c){var d=a("./1.0/numbers");b.exports=function(a){return d[a]}},{"./1.0/numbers":165}],167:[function(a,b,c){function d(a){for(var b=Array.isArray(a)?a:e(a),c=0;c<b.length;c++){var d=b[c];if("preprocessor"===d.type){var g=d.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(g&&g[2]){var h=g[1],i=g[2];return(h?f(i):i).trim()}}}}var e=a("glsl-tokenizer"),f=a("atob-lite");b.exports=d},{"atob-lite":168,"glsl-tokenizer":173}],168:[function(a,b,c){b.exports=function(a){return atob(a)}},{}],169:[function(a,b,c){function d(){function a(a){a.length&&N.push({type:v[L],data:a,position:Q,line:O,column:P})}function b(a){J=0,T+=a,I=T.length;for(var b;G=T[J],I>J;){switch(b=J,L){case j:J=z();break;case k:J=y();break;case l:J=x();break;case m:J=A();break;case n:J=D();break;case u:J=C();break;case o:J=E();break;case i:J=F();break;case s:J=w();break;case h:J=d()}if(b!==J)switch(T[b]){case"\n":P=0,++O;break;default:++P}}return K+=J,T=T.slice(J),N}function c(b){return M.length&&a(M.join("")),L=t,a("(eof)"),N}function d(){return M=M.length?[]:M,"/"===H&&"*"===G?(Q=K+J-1,L=j,H=G,J+1):"/"===H&&"/"===G?(Q=K+J-1,L=k,H=G,J+1):"#"===G?(L=l,Q=K+J,J):/\s/.test(G)?(L=s,Q=K+J,J):(R=/\d/.test(G),S=/[^\w_]/.test(G),Q=K+J,L=R?n:S?m:i,J)}function w(){return/[^\s]/g.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function x(){return"\n"===G&&"\\"!==H?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function y(){return x()}function z(){return"/"===G&&"*"===H?(M.push(G),a(M.join("")),L=h,J+1):(M.push(G),H=G,J+1)}function A(){if("."===H&&/\d/.test(G))return L=o,J;if("/"===H&&"*"===G)return L=j,J;if("/"===H&&"/"===G)return L=k,J;if("."===G&&M.length){for(;B(M););return L=o,J}if(";"===G||")"===G||"("===G){if(M.length)for(;B(M););return a(G),L=h,J+1}var b=2===M.length&&"="!==G;if(/[\w_\d\s]/.test(G)||b){for(;B(M););return L=h,J}return M.push(G),H=G,J+1}function B(b){for(var c,d,e=0;;){if(c=f.indexOf(b.slice(0,b.length+e).join("")),d=f[c],-1===c){if(e--+b.length>0)continue;d=b.slice(0,1).join("")}return a(d),Q+=d.length,M=M.slice(d.length),M.length}}function C(){return/[^a-fA-F0-9]/.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function D(){return"."===G?(M.push(G),L=o,H=G,J+1):/[eE]/.test(G)?(M.push(G),L=o,H=G,J+1):"x"===G&&1===M.length&&"0"===M[0]?(L=u,M.push(G),H=G,J+1):/[^\d]/.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function E(){return"f"===G&&(M.push(G),H=G,J+=1),/[eE]/.test(G)?(M.push(G),H=G,J+1):/[^\d]/.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function F(){if(/[^\d\w_]/.test(G)){var b=M.join("");return L=e.indexOf(b)>-1?r:g.indexOf(b)>-1?q:p,a(M.join("")),L=h,J}return M.push(G),H=G,J+1}var G,H,I,J=0,K=0,L=h,M=[],N=[],O=1,P=0,Q=0,R=!1,S=!1,T="";return function(a){return N=[],null!==a?b(a):c()}}b.exports=d;var e=a("./lib/literals"),f=a("./lib/operators"),g=a("./lib/builtins"),h=999,i=9999,j=0,k=1,l=2,m=3,n=4,o=5,p=6,q=7,r=8,s=9,t=10,u=11,v=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":170,"./lib/literals":171,"./lib/operators":172}],170:[function(a,b,c){b.exports=["gl_Position","gl_PointSize","gl_ClipVertex","gl_FragCoord","gl_FrontFacing","gl_FragColor","gl_FragData","gl_FragDepth","gl_Color","gl_SecondaryColor","gl_Normal","gl_Vertex","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_FogCoord","gl_MaxLights","gl_MaxClipPlanes","gl_MaxTextureUnits","gl_MaxTextureCoords","gl_MaxVertexAttribs","gl_MaxVertexUniformComponents","gl_MaxVaryingFloats","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformComponents","gl_MaxDrawBuffers","gl_ModelViewMatrix","gl_ProjectionMatrix","gl_ModelViewProjectionMatrix","gl_TextureMatrix","gl_NormalMatrix","gl_ModelViewMatrixInverse","gl_ProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverse","gl_TextureMatrixInverse","gl_ModelViewMatrixTranspose","gl_ProjectionMatrixTranspose","gl_ModelViewProjectionMatrixTranspose","gl_TextureMatrixTranspose","gl_ModelViewMatrixInverseTranspose","gl_ProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixInverseTranspose","gl_TextureMatrixInverseTranspose","gl_NormalScale","gl_DepthRangeParameters","gl_DepthRange","gl_ClipPlane","gl_PointParameters","gl_Point","gl_MaterialParameters","gl_FrontMaterial","gl_BackMaterial","gl_LightSourceParameters","gl_LightSource","gl_LightModelParameters","gl_LightModel","gl_LightModelProducts","gl_FrontLightModelProduct","gl_BackLightModelProduct","gl_LightProducts","gl_FrontLightProduct","gl_BackLightProduct","gl_FogParameters","gl_Fog","gl_TextureEnvColor","gl_EyePlaneS","gl_EyePlaneT","gl_EyePlaneR","gl_EyePlaneQ","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_ObjectPlaneR","gl_ObjectPlaneQ","gl_FrontColor","gl_BackColor","gl_FrontSecondaryColor","gl_BackSecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_Color","gl_SecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_PointCoord","radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","faceforward","reflect","refract","matrixCompMult","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture2D","texture2DProj","texture2DLod","texture2DProjLod","textureCube","textureCubeLod","dFdx","dFdy"]},{}],171:[function(a,b,c){b.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],172:[function(a,b,c){b.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],173:[function(a,b,c){function d(a){var b=e(),c=[];return c=c.concat(b(a)),c=c.concat(b(null))}var e=a("./index");b.exports=d},{"./index":169}],174:[function(b,c,d){!function(b){function c(){var a=arguments[0],b=c.cache;return b[a]&&b.hasOwnProperty(a)||(b[a]=c.parse(a)),c.format.call(null,b[a],arguments)}function e(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function f(a,b){return Array(b+1).join(a)}var g={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};c.format=function(a,b){var d,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=e(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(d=b[n],i=0;i<j[2].length;i++){if(!d.hasOwnProperty(j[2][i]))throw new Error(c("[sprintf] property '%s' does not exist",j[2][i]));d=d[j[2][i]]}else d=j[1]?b[j[1]]:b[n++];if("function"==e(d)&&(d=d()),g.not_string.test(j[8])&&g.not_json.test(j[8])&&"number"!=e(d)&&isNaN(d))throw new TypeError(c("[sprintf] expecting number but found %s",e(d)));switch(g.number.test(j[8])&&(r=d>=0),j[8]){case"b":d=d.toString(2);break;case"c":d=String.fromCharCode(d);break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,j[6]?parseInt(j[6]):0);break;case"e":d=j[7]?d.toExponential(j[7]):d.toExponential();break;case"f":d=j[7]?parseFloat(d).toFixed(j[7]):parseFloat(d);break;case"g":d=j[7]?parseFloat(d).toPrecision(j[7]):parseFloat(d);break;case"o":d=d.toString(8);break;case"s":d=(d=String(d))&&j[7]?d.substring(0,j[7]):d;break;case"u":d>>>=0;break;case"x":d=d.toString(16);break;case"X":d=d.toString(16).toUpperCase()}g.json.test(j[8])?q[q.length]=d:(!g.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",d=d.toString().replace(g.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+d).length,k=j[6]&&m>0?f(l,m):"",q[q.length]=j[5]?s+d+k:"0"===l?s+k+d:k+s+d)}return q.join("")},c.cache={},c.parse=function(a){for(var b=a,c=[],d=[],e=0;b;){if(null!==(c=g.text.exec(b)))d[d.length]=c[0];else if(null!==(c=g.modulo.exec(b)))d[d.length]="%";else{if(null===(c=g.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){e|=1;var f=[],h=c[2],i=[];if(null===(i=g.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(f[f.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=g.key_access.exec(h)))f[f.length]=i[1];else{if(null===(i=g.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");f[f.length]=i[1]}c[2]=f}else e|=2;if(3===e)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var h=function(a,b,d){return d=(b||[]).slice(0),d.splice(0,0,a),c.apply(null,d)};"undefined"!=typeof d?(d.sprintf=c,d.vsprintf=h):(b.sprintf=c,b.vsprintf=h,"function"==typeof a&&a.amd&&a(function(){return{sprintf:c,vsprintf:h}}))}("undefined"==typeof window?this:window)},{}],175:[function(a,b,c){function d(){var a={};return function(b){if(("object"!=typeof b||null===b)&&"function"!=typeof b)throw new Error("Weakmap-shim: Key must be object");var c=b.valueOf(a);return c&&c.identity===a?c:e(b,a)}}var e=a("./hidden-store.js");b.exports=d},{"./hidden-store.js":176}],176:[function(a,b,c){function d(a,b){var c={identity:b},d=a.valueOf;return Object.defineProperty(a,"valueOf",{value:function(a){return a!==b?d.apply(this,arguments):c},writable:!0}),c}b.exports=d},{}],177:[function(a,b,c){function d(){var a=e();return{get:function(b,c){var d=a(b);return d.hasOwnProperty("value")?d.value:c},set:function(b,c){a(b).value=c},has:function(b){return"value"in a(b)},"delete":function(b){return delete a(b).value}}}var e=a("./create-store.js");b.exports=d},{"./create-store.js":175}],178:[function(a,b,c){"use strict";function d(a){this.plot=a,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function e(a,b){var c=new d(a);return c.update(b),a.addOverlay(c),c}b.exports=e;var f=d.prototype;f.update=function(a){a=a||{},this.enable=(a.enable||[!0,!0,!1,!1]).slice(),this.width=(a.width||[1,1,1,1]).slice(),this.color=(a.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(a){return a.slice()}),this.center=(a.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},f.draw=function(){var a=this.enable,b=this.width,c=this.color,d=this.center,e=this.plot,f=e.line,g=e.dataBox,h=e.viewBox;if(f.bind(),g[0]<=d[0]&&d[0]<=g[2]&&g[1]<=d[1]&&d[1]<=g[3]){var i=h[0]+(d[0]-g[0])/(g[2]-g[0])*(h[2]-h[0]),j=h[1]+(d[1]-g[1])/(g[3]-g[1])*(h[3]-h[1]);a[0]&&f.drawLine(i,j,h[0],j,b[0],c[0]),a[1]&&f.drawLine(i,j,i,h[1],b[1],c[1]),a[2]&&f.drawLine(i,j,h[2],j,b[2],c[2]),a[3]&&f.drawLine(i,j,i,h[3],b[3],c[3])}},f.dispose=function(){this.plot.removeOverlay(this)}},{}],179:[function(a,b,c){var d=a("gl-shader"),e="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec4 uv;\nattribute vec2 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n value = f.x;\n kill = f.y;\n planeCoordinate = uv.xy;\n \n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}",f="#define GLSLIFY 1\nprecision mediump float;\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = beckmannSpecular_1_1(L, V, N, roughness);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n float interpValue = (value - lowerBound.z) / (upperBound.z - lowerBound.z);\n vec4 surfaceColor = texture2D(colormap, vec2(interpValue, interpValue));\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",g="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec4 uv;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = dataCoordinate.z;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",h="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 || \n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}";c.createShader=function(a){var b=d(a,e,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec2"},{name:"normal",type:"vec3"}]);return b.attributes.uv.location=0,b.attributes.f.location=1,b.attributes.normal.location=2,b},c.createPickShader=function(a){var b=d(a,e,h,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec2"},{name:"normal",type:"vec3"}]);return b.attributes.uv.location=0,b.attributes.f.location=1,b.attributes.normal.location=2,b},c.createContourShader=function(a){var b=d(a,g,f,null,[{name:"uv",type:"vec4"}]);return b.attributes.uv.location=0,b},c.createPickContourShader=function(a){var b=d(a,g,h,null,[{name:"uv",type:"vec4"}]);return b.attributes.uv.location=0,b}},{"gl-shader":154}],180:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],181:[function(a,b,c){"use strict";function d(a){if(a in i)return i[a];for(var b=[],c=0;a>c;++c)b.push("out",c,"s=0.5*(inp",c,"l-inp",c,"r);");for(var d=["array"],e=["junk"],c=0;a>c;++c){d.push("array"),e.push("out"+c+"s");var f=g(a);f[c]=-1,d.push({array:0,offset:f.slice()}),f[c]=1,d.push({array:0,offset:f.slice()}),e.push("inp"+c+"l","inp"+c+"r")}return i[a]=h({args:d,pre:k,post:k,body:{body:b.join(""),args:e.map(function(a){return{name:a,lvalue:0===a.indexOf("out"),rvalue:0===a.indexOf("inp"),count:"junk"!==a|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+a})}function e(a){function b(b){for(var c=f-b.length,d=[],e=[],h=[],i=0;f>i;++i)b.indexOf(i+1)>=0?h.push("0"):b.indexOf(-(i+1))>=0?h.push("s["+i+"]-1"):(h.push("-1"),d.push("1"),e.push("s["+i+"]-2"));var j=".lo("+d.join()+").hi("+e.join()+")";if(0===d.length&&(j=""),c>0){g.push("if(1");for(var i=0;f>i;++i)b.indexOf(i+1)>=0||b.indexOf(-(i+1))>=0||g.push("&&s[",i,"]>2");g.push("){grad",c,"(src.pick(",h.join(),")",j);for(var i=0;f>i;++i)b.indexOf(i+1)>=0||b.indexOf(-(i+1))>=0||g.push(",dst.pick(",h.join(),",",i,")",j);g.push(");")}for(var i=0;i<b.length;++i){var k=Math.abs(b[i])-1,l="dst.pick("+h.join()+","+k+")"+j;switch(a[k]){case"clamp":var m=h.slice(),n=h.slice();b[i]<0?m[k]="s["+k+"]-2":n[k]="1",0===c?g.push("if(s[",k,"]>1){dst.set(",h.join(),",",k,",0.5*(src.get(",m.join(),")-src.get(",n.join(),")))}else{dst.set(",h.join(),",",k,",0)};"):g.push("if(s[",k,"]>1){diff(",l,",src.pick(",m.join(),")",j,",src.pick(",n.join(),")",j,");}else{zero(",l,");};");break;case"mirror":0===c?g.push("dst.set(",h.join(),",",k,",0);"):g.push("zero(",l,");");break;case"wrap":var o=h.slice(),p=h.slice();b[i]<0?(o[k]="s["+k+"]-2",p[k]="0"):(o[k]="s["+k+"]-1",p[k]="1"),0===c?g.push("if(s[",k,"]>2){dst.set(",h.join(),",",k,",0.5*(src.get(",o.join(),")-src.get(",p.join(),")))}else{dst.set(",h.join(),",",k,",0)};"):g.push("if(s[",k,"]>2){diff(",l,",src.pick(",o.join(),")",j,",src.pick(",p.join(),")",j,");}else{zero(",l,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}c>0&&g.push("};")}var c=a.join(),e=j[c];if(e)return e;for(var f=a.length,g=["function gradient(dst,src){var s=src.shape.slice();"],h=0;1<<f>h;++h){for(var k=[],n=0;f>n;++n)h&1<<n&&k.push(n+1);for(var o=0;o<1<<k.length;++o){for(var p=k.slice(),n=0;n<k.length;++n)o&1<<n&&(p[n]=-p[n]);b(p)}}g.push("return dst;};return gradient");for(var q=["diff","zero"],r=[l,m],h=1;f>=h;++h)q.push("grad"+h),r.push(d(h));q.push(g.join(""));var s=Function.apply(void 0,q),e=s.apply(void 0,r);return i[c]=e,e}function f(a,b,c){if(Array.isArray(c)){if(c.length!==b.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else c="string"==typeof c?g(b.dimension,c):g(b.dimension,"clamp");if(a.dimension!==b.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(a.shape[b.dimension]!==b.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var d=0;d<b.dimension;++d)if(a.shape[d]!==b.shape[d])throw new Error("ndarray-gradient: shape mismatch");if(0===b.size)return a;if(b.dimension<=0)return a.set(0),a;var f=e(c);return f(a,b)}b.exports=f;var g=a("dup"),h=a("cwise-compiler"),i={},j={},k={body:"",args:[],thisVars:[],localVars:[]},l=h({args:["array","array","array"],pre:k,post:k,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1},{name:"left",lvalue:!1,rvalue:!0,count:1},{name:"right",lvalue:!1,rvalue:!0,count:1}],body:"out=0.5*(left-right)",thisVars:[],localVars:[]},funcName:"cdiff"}),m=h({args:["array"],pre:k,post:k,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"})},{"cwise-compiler":66,dup:72}],182:[function(a,b,c){"use strict";var d=a("ndarray"),e=a("./doConvert.js");b.exports=function(a,b){for(var c=[],f=a,g=1;f instanceof Array;)c.push(f.length),g*=f.length,f=f[0];return 0===c.length?d():(b||(b=d(new Float64Array(g),c)),e(b,a),b)}},{"./doConvert.js":183,ndarray:208}],183:[function(a,b,c){b.exports=a("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":66}],184:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.position=a,this.index=b,this.uv=c,this.level=d,this.dataCoordinate=e}function e(a){var b=u([s({colormap:a,nshades:K,format:"rgba"}).map(function(a){return[a[0],a[1],a[2],255*a[3]]})]);return t.divseq(b,255),b}function f(a,b,c,e,f,g,h,i,j,k,l,m,n,o){this.gl=a,this.shape=b,this.bounds=c,this._shader=e,this._pickShader=f,this._coordinateBuffer=g,this._vao=h,this._colorMap=i,this._contourShader=j,this._contourPickShader=k,this._contourBuffer=l,this._contourVAO=m,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new d([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=n,this._dynamicVAO=o,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[v(r.mallocFloat(1024),[0,0]),v(r.mallocFloat(1024),[0,0]),v(r.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0], 38 this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.dirty=!0}function g(a,b){for(var c=b.axes&&b.axes.lastCubeProps.axis||M,d=b.showSurface,e=b.showContour,f=0;3>f;++f){d=d||b.surfaceProject[f];for(var g=0;3>g;++g)e=e||b.contourProject[f][g]}for(var f=0;3>f;++f){for(var h=N.projections[f],g=0;16>g;++g)h[g]=0;for(var g=0;4>g;++g)h[5*g]=1;h[5*f]=0,h[12+f]=b.axesBounds[+(c[f]>0)][f],x(h,a.model,h);for(var i=N.clipBounds[f],j=0;2>j;++j)for(var g=0;3>g;++g)i[j][g]=a.clipBounds[j][g];i[0][f]=-1e8,i[1][f]=1e8}return N.showSurface=d,N.showContour=e,N}function h(a,b){a=a||{};var c=this.gl;c.disable(c.CULL_FACE),this._colorMap.bind(0);var d=O;d.model=a.model||H,d.view=a.view||H,d.projection=a.projection||H,d.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],d.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],d.contourColor=this.contourColor[0],d.inverseModel=y(d.inverseModel,d.model);for(var e=0;2>e;++e)for(var f=d.clipBounds[e],h=0;3>h;++h)f[h]=Math.min(Math.max(this.clipBounds[e][h],-1e8),1e8);d.kambient=this.ambientLight,d.kdiffuse=this.diffuseLight,d.kspecular=this.specularLight,d.shape=d.roughness=this.roughness,d.fresnel=this.fresnel,d.opacity=this.opacity,d.height=0,d.permutation=Q;var i=P;x(i,d.view,d.model),x(i,d.projection,i),y(i,i);for(var e=0;3>e;++e)d.eyePosition[e]=i[12+e]/i[15];for(var j=i[15],e=0;3>e;++e)j+=this.lightPosition[e]*i[4*e+3];for(var e=0;3>e;++e){for(var k=i[12+e],h=0;3>h;++h)k+=i[4*h+e]*this.lightPosition[h];d.lightPosition[e]=k/j}var l=g(d,this);if(l.showSurface&&b===this.opacity<1){this._shader.bind(),this._shader.uniforms=d,this._vao.bind(),this.showSurface&&this._vao.draw(c.TRIANGLES,this._vertexCount);for(var e=0;3>e;++e)this.surfaceProject[e]&&(this._shader.uniforms.model=l.projections[e],this._shader.uniforms.clipBounds=l.clipBounds[e],this._vao.draw(c.TRIANGLES,this._vertexCount));this._vao.unbind()}if(l.showContour&&!b){var m=this._contourShader;d.kambient=1,d.kdiffuse=0,d.kspecular=0,d.opacity=1,m.bind(),m.uniforms=d;var n=this._contourVAO;n.bind();for(var e=0;3>e;++e){m.uniforms.permutation=J[e],c.lineWidth(this.contourWidth[e]);for(var h=0;h<this.contourLevels[e].length;++h)h===this.highlightLevel[e]?(m.uniforms.contourColor=this.highlightColor[e],m.uniforms.contourTint=this.highlightTint[e]):0!==h&&h-1!==this.highlightLevel[e]||(m.uniforms.contourColor=this.contourColor[e],m.uniforms.contourTint=this.contourTint[e]),m.uniforms.height=this.contourLevels[e][h],n.draw(c.LINES,this._contourCounts[e][h],this._contourOffsets[e][h])}for(var e=0;3>e;++e){m.uniforms.model=l.projections[e],m.uniforms.clipBounds=l.clipBounds[e];for(var h=0;3>h;++h)if(this.contourProject[e][h]){m.uniforms.permutation=J[h],c.lineWidth(this.contourWidth[h]);for(var o=0;o<this.contourLevels[h].length;++o)o===this.highlightLevel[h]?(m.uniforms.contourColor=this.highlightColor[h],m.uniforms.contourTint=this.highlightTint[h]):0!==o&&o-1!==this.highlightLevel[h]||(m.uniforms.contourColor=this.contourColor[h],m.uniforms.contourTint=this.contourTint[h]),m.uniforms.height=this.contourLevels[h][o],n.draw(c.LINES,this._contourCounts[h][o],this._contourOffsets[h][o])}}n=this._dynamicVAO,n.bind();for(var e=0;3>e;++e)if(0!==this._dynamicCounts[e]){m.uniforms.model=d.model,m.uniforms.clipBounds=d.clipBounds,m.uniforms.permutation=J[e],c.lineWidth(this.dynamicWidth[e]),m.uniforms.contourColor=this.dynamicColor[e],m.uniforms.contourTint=this.dynamicTint[e],m.uniforms.height=this.dynamicLevel[e],n.draw(c.LINES,this._dynamicCounts[e],this._dynamicOffsets[e]);for(var h=0;3>h;++h)this.contourProject[h][e]&&(m.uniforms.model=l.projections[h],m.uniforms.clipBounds=l.clipBounds[h],n.draw(c.LINES,this._dynamicCounts[e],this._dynamicOffsets[e]))}n.unbind()}}function i(a,b){var c=b.shape.slice(),d=a.shape.slice();t.assign(a.lo(1,1).hi(c[0],c[1]),b),t.assign(a.lo(1).hi(c[0],1),b.hi(c[0],1)),t.assign(a.lo(1,d[1]-1).hi(c[0],1),b.lo(0,c[1]-1).hi(c[0],1)),t.assign(a.lo(0,1).hi(1,c[1]),b.hi(1)),t.assign(a.lo(d[0]-1,1).hi(1,c[1]),b.lo(c[0]-1)),a.set(0,0,b.get(0,0)),a.set(0,d[1]-1,b.get(0,c[1]-1)),a.set(d[0]-1,0,b.get(c[0]-1,0)),a.set(d[0]-1,d[1]-1,b.get(c[0]-1,c[1]-1))}function j(a,b){return Array.isArray(a)?[b(a[0]),b(a[1]),b(a[2])]:[b(a),b(a),b(a)]}function k(a){return Array.isArray(a)?3===a.length?[a[0],a[1],a[2],1]:[a[0],a[1],a[2],a[3]]:[0,0,0,1]}function l(a){if(Array.isArray(a)){if(Array.isArray(a))return[k(a[0]),k(a[1]),k(a[2])];var b=k(a);return[b.slice(),b.slice(),b.slice()]}}function m(a){var b=a.gl,c=(a.field||a.coords&&a.coords[2]||v([],[0,0]),C(b)),d=E(b),e=D(b),g=F(b),h=o(b),i=p(b,[{buffer:h,size:4,stride:G,offset:0},{buffer:h,size:2,stride:G,offset:16},{buffer:h,size:3,stride:G,offset:24}]),j=o(b),k=p(b,[{buffer:j,size:4}]),l=o(b),m=p(b,[{buffer:l,size:2,type:b.FLOAT}]),n=q(b,1,K,b.RGBA,b.UNSIGNED_BYTE);n.minFilter=b.LINEAR,n.magFilter=b.LINEAR;var r=new f(b,[0,0],[[0,0,0],[0,0,0]],c,d,h,i,n,e,g,j,k,l,m),s={levels:[[],[],[]]};for(var t in a)s[t]=a[t];return s.colormap=s.colormap||"jet",r.update(s),r}b.exports=m;var n=a("bit-twiddle"),o=a("gl-buffer"),p=a("gl-vao"),q=a("gl-texture2d"),r=a("typedarray-pool"),s=a("colormap"),t=a("ndarray-ops"),u=a("ndarray-pack"),v=a("ndarray"),w=a("surface-nets"),x=a("gl-mat4/multiply"),y=a("gl-mat4/invert"),z=a("binary-search-bounds"),A=a("ndarray-gradient"),v=a("ndarray"),B=a("./lib/shaders"),C=B.createShader,D=B.createContourShader,E=B.createPickShader,F=B.createPickContourShader,G=36,H=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],I=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],J=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var a=0;3>a;++a){var b=J[a],c=(a+1)%3,d=(a+2)%3;b[c+0]=1,b[d+3]=1,b[a+6]=1}}();var K=265,L=f.prototype;L.isTransparent=function(){return this.opacity<1},L.isOpaque=function(){if(this.opacity>=1)return!0;for(var a=0;3>a;++a)if(this._contourCounts[a].length>0||this._dynamicCounts[a]>0)return!0;return!1},L.pickSlots=1,L.setPickBase=function(a){this.pickId=a};var M=[0,0,0],N={showSurface:!1,showContour:!1,projections:[H.slice(),H.slice(),H.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},O={model:H,view:H,projection:H,inverseModel:H.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1},P=H.slice(),Q=[1,0,0,0,1,0,0,0,1];L.draw=function(a){return h.call(this,a,!1)},L.drawTransparent=function(a){return h.call(this,a,!0)};var R={model:H,view:H,projection:H,inverseModel:H,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};L.drawPick=function(a){a=a||{};var b=this.gl;b.disable(b.CULL_FACE);var c=R;c.model=a.model||H,c.view=a.view||H,c.projection=a.projection||H,c.shape=this._field[2].shape,c.pickId=this.pickId/255,c.lowerBound=this.bounds[0],c.upperBound=this.bounds[1],c.permutation=Q;for(var d=0;2>d;++d)for(var e=c.clipBounds[d],f=0;3>f;++f)e[f]=Math.min(Math.max(this.clipBounds[d][f],-1e8),1e8);var h=g(c,this);if(h.showSurface){this._pickShader.bind(),this._pickShader.uniforms=c,this._vao.bind(),this._vao.draw(b.TRIANGLES,this._vertexCount);for(var d=0;3>d;++d)this.surfaceProject[d]&&(this._pickShader.uniforms.model=h.projections[d],this._pickShader.uniforms.clipBounds=h.clipBounds[d],this._vao.draw(b.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour){var i=this._contourPickShader;i.bind(),i.uniforms=c;var j=this._contourVAO;j.bind();for(var f=0;3>f;++f){b.lineWidth(this.contourWidth[f]),i.uniforms.permutation=J[f];for(var d=0;d<this.contourLevels[f].length;++d)i.uniforms.height=this.contourLevels[f][d],j.draw(b.LINES,this._contourCounts[f][d],this._contourOffsets[f][d])}for(var d=0;3>d;++d){i.uniforms.model=h.projections[d],i.uniforms.clipBounds=h.clipBounds[d];for(var f=0;3>f;++f)if(this.contourProject[d][f]){i.uniforms.permutation=J[f],b.lineWidth(this.contourWidth[f]);for(var k=0;k<this.contourLevels[f].length;++k)i.uniforms.height=this.contourLevels[f][k],j.draw(b.LINES,this._contourCounts[f][k],this._contourOffsets[f][k])}}j.unbind()}},L.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;var b=this._field[2].shape,c=this._pickResult,d=b[0]*(a.value[0]+(a.value[2]>>4)/16)/255,e=Math.floor(d),f=d-e,g=b[1]*(a.value[1]+(15&a.value[2])/16)/255,h=Math.floor(g),i=g-h;e+=1,h+=1;var j=c.position;j[0]=j[1]=j[2]=0;for(var k=0;2>k;++k)for(var l=k?f:1-f,m=0;2>m;++m)for(var n=m?i:1-i,o=e+k,p=h+m,q=l*n,r=0;3>r;++r)j[r]+=this._field[r].get(o,p)*q;for(var s=this._pickResult.level,t=0;3>t;++t)if(s[t]=z.le(this.contourLevels[t],j[t]),s[t]<0)this.contourLevels[t].length>0&&(s[t]=0);else if(s[t]<this.contourLevels[t].length-1){var u=this.contourLevels[t][s[t]],v=this.contourLevels[t][s[t]+1];Math.abs(u-j[t])>Math.abs(v-j[t])&&(s[t]+=1)}c.index[0]=.5>f?e:e+1,c.index[1]=.5>i?h:h+1,c.uv[0]=d/b[0],c.uv[1]=g/b[1];for(var r=0;3>r;++r)c.dataCoordinate[r]=this._field[r].get(c.index[0],c.index[1]);return c},L.update=function(a){a=a||{},this.dirty=!0,"contourWidth"in a&&(this.contourWidth=j(a.contourWidth,Number)),"showContour"in a&&(this.showContour=j(a.showContour,Boolean)),"showSurface"in a&&(this.showSurface=!!a.showSurface),"contourTint"in a&&(this.contourTint=j(a.contourTint,Boolean)),"contourColor"in a&&(this.contourColor=l(a.contourColor)),"contourProject"in a&&(this.contourProject=j(a.contourProject,function(a){return j(a,Boolean)})),"surfaceProject"in a&&(this.surfaceProject=a.surfaceProject),"dynamicColor"in a&&(this.dynamicColor=l(a.dynamicColor)),"dynamicTint"in a&&(this.dynamicTint=j(a.dynamicTint,Number)),"dynamicWidth"in a&&(this.dynamicWidth=j(a.dynamicWidth,Number)),"opacity"in a&&(this.opacity=a.opacity),"colorBounds"in a&&(this.colorBounds=a.colorBounds);var b=a.field||a.coords&&a.coords[2]||null;if(b||(b=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in a||"coords"in a){var c=(b.shape[0]+2)*(b.shape[1]+2);c>this._field[2].data.length&&(r.freeFloat(this._field[2].data),this._field[2].data=r.mallocFloat(n.nextPow2(c))),this._field[2]=v(this._field[2].data,[b.shape[0]+2,b.shape[1]+2]),i(this._field[2],b),this.shape=b.shape.slice();for(var d=this.shape,f=0;2>f;++f)this._field[2].size>this._field[f].data.length&&(r.freeFloat(this._field[f].data),this._field[f].data=r.mallocFloat(this._field[2].size)),this._field[f]=v(this._field[f].data,[d[0]+2,d[1]+2]);if(a.coords){var g=a.coords;if(!Array.isArray(g)||3!==g.length)throw new Error("gl-surface: invalid coordinates for x/y");for(var f=0;2>f;++f){for(var h=g[f],k=0;2>k;++k)if(h.shape[k]!==d[k])throw new Error("gl-surface: coords have incorrect shape");i(this._field[f],h)}}else if(a.ticks){var m=a.ticks;if(!Array.isArray(m)||2!==m.length)throw new Error("gl-surface: invalid ticks");for(var f=0;2>f;++f){var o=m[f];if((Array.isArray(o)||o.length)&&(o=v(o)),o.shape[0]!==d[f])throw new Error("gl-surface: invalid tick length");var p=v(o.data,d);p.stride[f]=o.stride[0],p.stride[1^f]=0,i(this._field[f],p)}}else{for(var f=0;2>f;++f){var q=[0,0];q[f]=1,this._field[f]=v(this._field[f].data,[d[0]+2,d[1]+2],q,0)}this._field[0].set(0,0,0);for(var k=0;k<d[0];++k)this._field[0].set(k+1,0,k);this._field[0].set(d[0]+1,0,d[0]-1),this._field[1].set(0,0,0);for(var k=0;k<d[1];++k)this._field[1].set(0,k+1,k);this._field[1].set(0,d[1]+1,d[1]-1)}for(var s=this._field,t=(s[2].size,v(r.mallocFloat(3*s[2].size*2),[3,d[0]+2,d[1]+2,2])),f=0;3>f;++f)A(t.pick(f),s[f],"mirror");for(var u=v(r.mallocFloat(3*s[2].size),[d[0]+2,d[1]+2,3]),f=0;f<d[0]+2;++f)for(var k=0;k<d[1]+2;++k){var x=t.get(0,f,k,0),y=t.get(0,f,k,1),z=t.get(1,f,k,0),B=t.get(1,f,k,1),C=t.get(2,f,k,0),D=t.get(2,f,k,1),E=z*D-B*C,F=C*y-D*x,G=x*B-y*z,H=Math.sqrt(E*E+F*F+G*G);1e-8>H?(H=Math.max(Math.abs(E),Math.abs(F),Math.abs(G)),1e-8>H?(G=1,F=E=0,H=1):H=1/H):H=1/Math.sqrt(H),u.set(f,k,0,E*H),u.set(f,k,1,F*H),u.set(f,k,2,G*H)}r.free(t.data);for(var J=[1/0,1/0,1/0],K=[-(1/0),-(1/0),-(1/0)],L=(d[0]-1)*(d[1]-1)*6,M=r.mallocFloat(n.nextPow2(9*L)),N=0,O=0,f=0;f<d[0]-1;++f)a:for(var k=0;k<d[1]-1;++k){for(var P=0;2>P;++P)for(var Q=0;2>Q;++Q)for(var R=0;3>R;++R){var S=this._field[R].get(1+f+P,1+k+Q);if(isNaN(S)||!isFinite(S))continue a}for(var R=0;6>R;++R){var T=f+I[R][0],U=k+I[R][1],V=this._field[0].get(T+1,U+1),W=this._field[1].get(T+1,U+1),S=this._field[2].get(T+1,U+1),E=u.get(T+1,U+1,0),F=u.get(T+1,U+1,1),G=u.get(T+1,U+1,2);M[N++]=T,M[N++]=U,M[N++]=V,M[N++]=W,M[N++]=S,M[N++]=0,M[N++]=E,M[N++]=F,M[N++]=G,J[0]=Math.min(J[0],V),J[1]=Math.min(J[1],W),J[2]=Math.min(J[2],S),K[0]=Math.max(K[0],V),K[1]=Math.max(K[1],W),K[2]=Math.max(K[2],S),O+=1}}this._vertexCount=O,this._coordinateBuffer.update(M.subarray(0,N)),r.freeFloat(M),r.free(u.data),this.bounds=[J,K]}var X=!1;if("levels"in a){var Y=a.levels;Y=Array.isArray(Y[0])?Y.slice():[[],[],Y];for(var f=0;3>f;++f)Y[f]=Y[f].slice(),Y.sort(function(a,b){return a-b});a:for(var f=0;3>f;++f){if(Y[f].length!==this.contourLevels[f].length){X=!0;break}for(var k=0;k<Y[f].length;++k)if(Y[f][k]!==this.contourLevels[f][k]){X=!0;break a}}this.contourLevels=Y}if(X){for(var s=this._field,d=this.shape,Z=[],$=0;3>$;++$){for(var Y=this.contourLevels[$],_=[],aa=[],ba=[0,0],f=0;f<Y.length;++f){var ca=w(this._field[$],Y[f]);_.push(Z.length/4|0);var O=0;a:for(var k=0;k<ca.cells.length;++k)for(var da=ca.cells[k],R=0;2>R;++R){var ea=ca.positions[da[R]],fa=ea[0],ga=0|Math.floor(fa),ha=fa-ga,ia=ea[1],ja=0|Math.floor(ia),ka=ia-ja,la=!1;b:for(var ma=0;2>ma;++ma){ba[ma]=0;for(var na=($+ma+1)%3,P=0;2>P;++P)for(var oa=P?ha:1-ha,T=0|Math.min(Math.max(ga+P,0),d[0]),Q=0;2>Q;++Q){var pa=Q?ka:1-ka,U=0|Math.min(Math.max(ja+Q,0),d[1]),S=this._field[na].get(T,U);if(!isFinite(S)||isNaN(S)){la=!0;break b}var qa=oa*pa;ba[ma]+=qa*S}}if(la){if(R>0){for(var ra=0;4>ra;++ra)Z.pop();O-=1}continue a}Z.push(ba[0],ba[1],ea[0],ea[1]),O+=1}aa.push(O)}this._contourOffsets[$]=_,this._contourCounts[$]=aa}for(var sa=r.mallocFloat(Z.length),f=0;f<Z.length;++f)sa[f]=Z[f];this._contourBuffer.update(sa),r.freeFloat(sa)}a.colormap&&this._colorMap.setPixels(e(a.colormap))},L.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var a=0;3>a;++a)r.freeFloat(this._field[a].data)},L.highlight=function(a){if(!a)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var b=0;3>b;++b)this.enableHighlight[b]?this.highlightLevel[b]=a.level[b]:this.highlightLevel[b]=-1;var c;if(c=this.snapToData?a.dataCoordinate:a.position,this.enableDynamic[0]&&c[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&c[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&c[2]!==this.dynamicLevel[2]){for(var d=0,e=this.shape,f=r.mallocFloat(12*e[0]*e[1]),g=0;3>g;++g)if(this.enableDynamic[g]){this.dynamicLevel[g]=c[g];var h=(g+1)%3,i=(g+2)%3,j=this._field[g],k=this._field[h],l=this._field[i],m=w(j,c[g]),n=m.cells,o=m.positions;this._dynamicOffsets[g]=d;for(var b=0;b<n.length;++b)for(var p=n[b],q=0;2>q;++q){var s=o[p[q]],t=+s[0],u=0|t,v=0|Math.min(u+1,e[0]),x=t-u,y=1-x,z=+s[1],A=0|z,B=0|Math.min(A+1,e[1]),C=z-A,D=1-C,E=y*D,F=y*C,G=x*D,H=x*C,I=E*k.get(u,A)+F*k.get(u,B)+G*k.get(v,A)+H*k.get(v,B),J=E*l.get(u,A)+F*l.get(u,B)+G*l.get(v,A)+H*l.get(v,B);if(isNaN(I)||isNaN(J)){q&&(d-=1);break}f[2*d+0]=I,f[2*d+1]=J,d+=1}this._dynamicCounts[g]=d-this._dynamicOffsets[g]}else this.dynamicLevel[g]=NaN,this._dynamicCounts[g]=0;this._dynamicBuffer.update(f.subarray(0,2*d)),r.freeFloat(f)}}},{"./lib/shaders":179,"binary-search-bounds":180,"bit-twiddle":49,colormap:57,"gl-buffer":75,"gl-mat4/invert":94,"gl-mat4/multiply":96,"gl-texture2d":185,"gl-vao":189,ndarray:208,"ndarray-gradient":181,"ndarray-ops":207,"ndarray-pack":182,"surface-nets":227,"typedarray-pool":233}],185:[function(a,b,c){"use strict";function d(a){q=[a.LINEAR,a.NEAREST_MIPMAP_LINEAR,a.LINEAR_MIPMAP_NEAREST,a.LINEAR_MIPMAP_NEAREST],r=[a.NEAREST,a.LINEAR,a.NEAREST_MIPMAP_NEAREST,a.NEAREST_MIPMAP_LINEAR,a.LINEAR_MIPMAP_NEAREST,a.LINEAR_MIPMAP_LINEAR],s=[a.REPEAT,a.CLAMP_TO_EDGE,a.MIRRORED_REPEAT]}function e(a,b,c){var d=a.gl,e=d.getParameter(d.MAX_TEXTURE_SIZE);if(0>b||b>e||0>c||c>e)throw new Error("gl-texture2d: Invalid texture size");return a._shape=[b,c],a.bind(),d.texImage2D(d.TEXTURE_2D,0,a.format,b,c,0,a.format,a.type,null),a._mipLevels=[0],a}function f(a,b,c,d,e,f){this.gl=a,this.handle=b,this.format=e,this.type=f,this._shape=[c,d],this._mipLevels=[0],this._magFilter=a.NEAREST,this._minFilter=a.NEAREST,this._wrapS=a.CLAMP_TO_EDGE,this._wrapT=a.CLAMP_TO_EDGE,this._anisoSamples=1;var g=this,h=[this._wrapS,this._wrapT];Object.defineProperties(h,[{get:function(){return g._wrapS},set:function(a){return g.wrapS=a}},{get:function(){return g._wrapT},set:function(a){return g.wrapT=a}}]),this._wrapVector=h;var i=[this._shape[0],this._shape[1]];Object.defineProperties(i,[{get:function(){return g._shape[0]},set:function(a){return g.width=a}},{get:function(){return g._shape[1]},set:function(a){return g.height=a}}]),this._shapeVector=i}function g(a,b){return 3===a.length?1===b[2]&&b[1]===a[0]*a[2]&&b[0]===a[2]:1===b[0]&&b[1]===a[0]}function h(a,b,c,d,e,f,h,i){var j=i.dtype,k=i.shape.slice();if(k.length<2||k.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var l=0,m=0,q=g(k,i.stride.slice());"float32"===j?l=a.FLOAT:"float64"===j?(l=a.FLOAT,q=!1,j="float32"):"uint8"===j?l=a.UNSIGNED_BYTE:(l=a.UNSIGNED_BYTE,q=!1,j="uint8");var r=1;if(2===k.length)m=a.LUMINANCE,k=[k[0],k[1],1],i=n(i.data,k,[i.stride[0],i.stride[1],1],i.offset);else{if(3!==k.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===k[2])m=a.ALPHA;else if(2===k[2])m=a.LUMINANCE_ALPHA;else if(3===k[2])m=a.RGB;else{if(4!==k[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=a.RGBA}r=k[2]}if(m!==a.LUMINANCE&&m!==a.ALPHA||e!==a.LUMINANCE&&e!==a.ALPHA||(m=e),m!==e)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var s=i.size,u=h.indexOf(d)<0;if(u&&h.push(d),l===f&&q)0===i.offset&&i.data.length===s?u?a.texImage2D(a.TEXTURE_2D,d,e,k[0],k[1],0,e,f,i.data):a.texSubImage2D(a.TEXTURE_2D,d,b,c,k[0],k[1],e,f,i.data):u?a.texImage2D(a.TEXTURE_2D,d,e,k[0],k[1],0,e,f,i.data.subarray(i.offset,i.offset+s)):a.texSubImage2D(a.TEXTURE_2D,d,b,c,k[0],k[1],e,f,i.data.subarray(i.offset,i.offset+s));else{var v;v=f===a.FLOAT?p.mallocFloat32(s):p.mallocUint8(s);var w=n(v,k,[k[2],k[2]*k[0],1]);l===a.FLOAT&&f===a.UNSIGNED_BYTE?t(w,i):o.assign(w,i),u?a.texImage2D(a.TEXTURE_2D,d,e,k[0],k[1],0,e,f,v.subarray(0,s)):a.texSubImage2D(a.TEXTURE_2D,d,b,c,k[0],k[1],e,f,v.subarray(0,s)),f===a.FLOAT?p.freeFloat32(v):p.freeUint8(v)}}function i(a){var b=a.createTexture();return a.bindTexture(a.TEXTURE_2D,b),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),b}function j(a,b,c,d,e){var g=a.getParameter(a.MAX_TEXTURE_SIZE);if(0>b||b>g||0>c||c>g)throw new Error("gl-texture2d: Invalid texture shape");if(e===a.FLOAT&&!a.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var h=i(a);return a.texImage2D(a.TEXTURE_2D,0,d,b,c,0,d,e,null),new f(a,h,b,c,d,e)}function k(a,b,c,d){var e=i(a);return a.texImage2D(a.TEXTURE_2D,0,c,c,d,b),new f(a,e,0|b.width,0|b.height,c,d)}function l(a,b){var c=b.dtype,d=b.shape.slice(),e=a.getParameter(a.MAX_TEXTURE_SIZE);if(d[0]<0||d[0]>e||d[1]<0||d[1]>e)throw new Error("gl-texture2d: Invalid texture size");var h=g(d,b.stride.slice()),j=0;"float32"===c?j=a.FLOAT:"float64"===c?(j=a.FLOAT,h=!1,c="float32"):"uint8"===c?j=a.UNSIGNED_BYTE:(j=a.UNSIGNED_BYTE,h=!1,c="uint8");var k=0;if(2===d.length)k=a.LUMINANCE,d=[d[0],d[1],1],b=n(b.data,d,[b.stride[0],b.stride[1],1],b.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])k=a.ALPHA;else if(2===d[2])k=a.LUMINANCE_ALPHA;else if(3===d[2])k=a.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");k=a.RGBA}}j!==a.FLOAT||a.getExtension("OES_texture_float")||(j=a.UNSIGNED_BYTE,h=!1);var l,m,q=b.size;if(h)l=0===b.offset&&b.data.length===q?b.data:b.data.subarray(b.offset,b.offset+q);else{var r=[d[2],d[2]*d[0],1];m=p.malloc(q,c);var s=n(m,d,r,0);"float32"!==c&&"float64"!==c||j!==a.UNSIGNED_BYTE?o.assign(s,b):t(s,b),l=m.subarray(0,q)}var u=i(a);return a.texImage2D(a.TEXTURE_2D,0,k,d[0],d[1],0,k,j,l),h||p.free(m),new f(a,u,d[0],d[1],k,j)}function m(a){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(q||d(a),"number"==typeof arguments[1])return j(a,arguments[1],arguments[2],arguments[3]||a.RGBA,arguments[4]||a.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return j(a,0|arguments[1][0],0|arguments[1][1],arguments[2]||a.RGBA,arguments[3]||a.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var b=arguments[1];if(b instanceof HTMLCanvasElement||b instanceof HTMLImageElement||b instanceof HTMLVideoElement||b instanceof ImageData)return k(a,b,arguments[2]||a.RGBA,arguments[3]||a.UNSIGNED_BYTE);if(b.shape&&b.data&&b.stride)return l(a,b)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var n=a("ndarray"),o=a("ndarray-ops"),p=a("typedarray-pool");b.exports=m;var q=null,r=null,s=null,t=function(a,b){o.muls(a,b,255)},u=f.prototype;Object.defineProperties(u,{minFilter:{get:function(){return this._minFilter},set:function(a){this.bind();var b=this.gl;if(this.type===b.FLOAT&&q.indexOf(a)>=0&&(b.getExtension("OES_texture_float_linear")||(a=b.NEAREST)),r.indexOf(a)<0)throw new Error("gl-texture2d: Unknown filter mode "+a);return b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,a),this._minFilter=a}},magFilter:{get:function(){return this._magFilter},set:function(a){this.bind();var b=this.gl;if(this.type===b.FLOAT&&q.indexOf(a)>=0&&(b.getExtension("OES_texture_float_linear")||(a=b.NEAREST)),r.indexOf(a)<0)throw new Error("gl-texture2d: Unknown filter mode "+a);return b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a),this._magFilter=a}},mipSamples:{get:function(){return this._anisoSamples},set:function(a){var b=this._anisoSamples;if(this._anisoSamples=0|Math.max(a,1),b!==this._anisoSamples){var c=gl.getExtension("EXT_texture_filter_anisotropic");c&&this.gl.texParameterf(this.gl.TEXTURE_2D,c.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(a){if(this.bind(),s.indexOf(a)<0)throw new Error("gl-texture2d: Unknown wrap mode "+a);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,a),this._wrapS=a}},wrapT:{get:function(){return this._wrapT},set:function(a){if(this.bind(),s.indexOf(a)<0)throw new Error("gl-texture2d: Unknown wrap mode "+a);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,a),this._wrapT=a}},wrap:{get:function(){return this._wrapVector},set:function(a){if(Array.isArray(a)||(a=[a,a]),2!==a.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var b=0;2>b;++b)if(s.indexOf(a[b])<0)throw new Error("gl-texture2d: Unknown wrap mode "+a);this._wrapS=a[0],this._wrapT=a[1];var c=this.gl;return this.bind(),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,this._wrapS),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,this._wrapT),a}},shape:{get:function(){return this._shapeVector},set:function(a){if(Array.isArray(a)){if(2!==a.length)throw new Error("gl-texture2d: Invalid texture shape")}else a=[0|a,0|a];return e(this,0|a[0],0|a[1]),[0|a[0],0|a[1]]}},width:{get:function(){return this._shape[0]},set:function(a){return a=0|a,e(this,a,this._shape[1]),a}},height:{get:function(){return this._shape[1]},set:function(a){return a=0|a,e(this,this._shape[0],a),a}}}),u.bind=function(a){var b=this.gl;return void 0!==a&&b.activeTexture(b.TEXTURE0+(0|a)),b.bindTexture(b.TEXTURE_2D,this.handle),void 0!==a?0|a:b.getParameter(b.ACTIVE_TEXTURE)-b.TEXTURE0},u.dispose=function(){this.gl.deleteTexture(this.handle)},u.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var a=Math.min(this._shape[0],this._shape[1]),b=0;a>0;++b,a>>>=1)this._mipLevels.indexOf(b)<0&&this._mipLevels.push(b)},u.setPixels=function(a,b,c,d){var e=this.gl;if(this.bind(),Array.isArray(b)?(d=c,c=0|b[1],b=0|b[0]):(b=b||0,c=c||0),d=d||0,a instanceof HTMLCanvasElement||a instanceof ImageData||a instanceof HTMLImageElement||a instanceof HTMLVideoElement){var f=this._mipLevels.indexOf(d)<0;f?(e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,a),this._mipLevels.push(d)):e.texSubImage2D(e.TEXTURE_2D,d,b,c,this.format,this.type,a)}else{if(!(a.shape&&a.stride&&a.data))throw new Error("gl-texture2d: Unsupported data type");if(a.shape.length<2||b+a.shape[1]>this._shape[1]>>>d||c+a.shape[0]>this._shape[0]>>>d||0>b||0>c)throw new Error("gl-texture2d: Texture dimensions are out of bounds");h(e,b,c,d,this.format,this.type,this._mipLevels,a)}}},{ndarray:208,"ndarray-ops":207,"typedarray-pool":233}],186:[function(a,b,c){"use strict";function d(a,b,c){b?b.bind():a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null);var d=0|a.getParameter(a.MAX_VERTEX_ATTRIBS);if(c){if(c.length>d)throw new Error("gl-vao: Too many vertex attributes");for(var e=0;e<c.length;++e){var f=c[e];if(f.buffer){var g=f.buffer,h=f.size||4,i=f.type||a.FLOAT,j=!!f.normalized,k=f.stride||0,l=f.offset||0;g.bind(),a.enableVertexAttribArray(e),a.vertexAttribPointer(e,h,i,j,k,l)}else{if("number"==typeof f)a.vertexAttrib1f(e,f);else if(1===f.length)a.vertexAttrib1f(e,f[0]);else if(2===f.length)a.vertexAttrib2f(e,f[0],f[1]);else if(3===f.length)a.vertexAttrib3f(e,f[0],f[1],f[2]);else{if(4!==f.length)throw new Error("gl-vao: Invalid vertex attribute");a.vertexAttrib4f(e,f[0],f[1],f[2],f[3])}a.disableVertexAttribArray(e)}}for(;d>e;++e)a.disableVertexAttribArray(e)}else{a.bindBuffer(a.ARRAY_BUFFER,null);for(var e=0;d>e;++e)a.disableVertexAttribArray(e)}}b.exports=d},{}],187:[function(a,b,c){"use strict";function d(a){this.gl=a,this._elements=null,this._attributes=null,this._elementsType=a.UNSIGNED_SHORT}function e(a){return new d(a)}var f=a("./do-bind.js");d.prototype.bind=function(){f(this.gl,this._elements,this._attributes)},d.prototype.update=function(a,b,c){this._elements=b,this._attributes=a,this._elementsType=c||this.gl.UNSIGNED_SHORT},d.prototype.dispose=function(){},d.prototype.unbind=function(){},d.prototype.draw=function(a,b,c){c=c||0;var d=this.gl;this._elements?d.drawElements(a,b,this._elementsType,c):d.drawArrays(a,c,b)},b.exports=e},{"./do-bind.js":186}],188:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this.location=a,this.dimension=b,this.a=c,this.b=d,this.c=e,this.d=f}function e(a,b,c){this.gl=a,this._ext=b,this.handle=c,this._attribs=[],this._useElements=!1,this._elementsType=a.UNSIGNED_SHORT}function f(a,b){return new e(a,b,b.createVertexArrayOES())}var g=a("./do-bind.js");d.prototype.bind=function(a){switch(this.dimension){case 1:a.vertexAttrib1f(this.location,this.a);break;case 2:a.vertexAttrib2f(this.location,this.a,this.b);break;case 3:a.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:a.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},e.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var a=0;a<this._attribs.length;++a)this._attribs[a].bind(this.gl)},e.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},e.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},e.prototype.update=function(a,b,c){if(this.bind(),g(this.gl,b,a),this.unbind(),this._attribs.length=0,a)for(var e=0;e<a.length;++e){var f=a[e];"number"==typeof f?this._attribs.push(new d(e,1,f)):Array.isArray(f)&&this._attribs.push(new d(e,f.length,f[0],f[1],f[2],f[3]))}this._useElements=!!b,this._elementsType=c||this.gl.UNSIGNED_SHORT},e.prototype.draw=function(a,b,c){c=c||0;var d=this.gl;this._useElements?d.drawElements(a,b,this._elementsType,c):d.drawArrays(a,c,b)},b.exports=f},{"./do-bind.js":186}],189:[function(a,b,c){"use strict";function d(a,b,c,d){var g,h=a.getExtension("OES_vertex_array_object");return g=h?e(a,h):f(a),g.update(b,c,d),g}var e=a("./lib/vao-native.js"),f=a("./lib/vao-emulated.js");b.exports=d},{"./lib/vao-emulated.js":187,"./lib/vao-native.js":188}],190:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a}b.exports=d},{}],191:[function(a,b,c){"use strict";function d(a,b,c){this.vertices=a,this.adjacent=b,this.boundary=c,this.lastVisited=-1}function e(a,b,c){this.vertices=a,this.cell=b,this.index=c}function f(a,b){return k(a.vertices,b.vertices)}function g(a){for(var b=["function orient(){var tuple=this.tuple;return test("],c=0;a>=c;++c)c>0&&b.push(","),b.push("tuple[",c,"]");b.push(")}return orient");var d=new Function("test",b.join("")),e=j[a+1];return e||(e=j),d(e)}function h(a,b,c){this.dimension=a,this.vertices=b,this.simplices=c,this.interior=c.filter(function(a){return!a.boundary}),this.tuple=new Array(a+1);for(var d=0;a>=d;++d)this.tuple[d]=this.vertices[d];var e=l[a];e||(e=l[a]=g(a)),this.orient=e}function i(a,b){var c=a.length;if(0===c)throw new Error("Must have at least d+1 points");var e=a[0].length;if(e>=c)throw new Error("Must input at least d+1 points");var f=a.slice(0,e+1),g=j.apply(void 0,f);if(0===g)throw new Error("Input not in general position");for(var i=new Array(e+1),k=0;e>=k;++k)i[k]=k;0>g&&(i[0]=1,i[1]=0);for(var l=new d(i,new Array(e+1),!1),m=l.adjacent,n=new Array(e+2),k=0;e>=k;++k){for(var o=i.slice(),p=0;e>=p;++p)p===k&&(o[p]=-1);var q=o[0];o[0]=o[1],o[1]=q;var r=new d(o,new Array(e+1),!0);m[k]=r,n[k]=r}n[e+1]=l;for(var k=0;e>=k;++k)for(var o=m[k].vertices,s=m[k].adjacent,p=0;e>=p;++p){var t=o[p];if(0>t)s[p]=l;else for(var u=0;e>=u;++u)m[u].vertices.indexOf(t)<0&&(s[p]=m[u])}for(var v=new h(e,f,n),w=!!b,k=e+1;c>k;++k)v.insert(a[k],w);return v.boundary()}b.exports=i;var j=a("robust-orientation"),k=a("simplicial-complex").compareCells;d.prototype.flip=function(){var a=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=a;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};var l=[],m=h.prototype;m.handleBoundaryDegeneracy=function(a,b){var c=this.dimension,d=this.vertices.length-1,e=this.tuple,f=this.vertices,g=[a];for(a.lastVisited=-d;g.length>0;){a=g.pop();for(var h=(a.vertices,a.adjacent),i=0;c>=i;++i){var j=h[i];if(j.boundary&&!(j.lastVisited<=-d)){for(var k=j.vertices,l=0;c>=l;++l){var m=k[l];0>m?e[l]=b:e[l]=f[m]}var n=this.orient();if(n>0)return j;j.lastVisited=-d,0===n&&g.push(j)}}}return null},m.walk=function(a,b){var c=this.vertices.length-1,d=this.dimension,e=this.vertices,f=this.tuple,g=b?this.interior.length*Math.random()|0:this.interior.length-1,h=this.interior[g];a:for(;!h.boundary;){for(var i=h.vertices,j=h.adjacent,k=0;d>=k;++k)f[k]=e[i[k]];h.lastVisited=c;for(var k=0;d>=k;++k){var l=j[k];if(!(l.lastVisited>=c)){var m=f[k];f[k]=a;var n=this.orient();if(f[k]=m,0>n){h=l;continue a}l.boundary?l.lastVisited=-c:l.lastVisited=c}}return}return h},m.addPeaks=function(a,b){var c=this.vertices.length-1,g=this.dimension,h=this.vertices,i=this.tuple,j=this.interior,k=this.simplices,l=[b];b.lastVisited=c,b.vertices[b.vertices.indexOf(-1)]=c,b.boundary=!1,j.push(b);for(var m=[];l.length>0;){var b=l.pop(),n=b.vertices,o=b.adjacent,p=n.indexOf(c); 39 if(!(0>p))for(var q=0;g>=q;++q)if(q!==p){var r=o[q];if(r.boundary&&!(r.lastVisited>=c)){var s=r.vertices;if(r.lastVisited!==-c){for(var t=0,u=0;g>=u;++u)s[u]<0?(t=u,i[u]=a):i[u]=h[s[u]];var v=this.orient();if(v>0){s[t]=c,r.boundary=!1,j.push(r),l.push(r),r.lastVisited=c;continue}r.lastVisited=-c}var w=r.adjacent,x=n.slice(),y=o.slice(),z=new d(x,y,!0);k.push(z);var A=w.indexOf(b);if(!(0>A)){w[A]=z,y[p]=r,x[q]=-1,y[q]=b,o[q]=z,z.flip();for(var u=0;g>=u;++u){var B=x[u];if(!(0>B||B===c)){for(var C=new Array(g-1),D=0,E=0;g>=E;++E){var F=x[E];0>F||E===u||(C[D++]=F)}m.push(new e(C,z,u))}}}}}}m.sort(f);for(var q=0;q+1<m.length;q+=2){var G=m[q],H=m[q+1],I=G.index,J=H.index;0>I||0>J||(G.cell.adjacent[G.index]=H.cell,H.cell.adjacent[H.index]=G.cell)}},m.insert=function(a,b){var c=this.vertices;c.push(a);var d=this.walk(a,b);if(d){for(var e=this.dimension,f=this.tuple,g=0;e>=g;++g){var h=d.vertices[g];0>h?f[g]=a:f[g]=c[h]}var i=this.orient(f);0>i||(0!==i||(d=this.handleBoundaryDegeneracy(d,a)))&&this.addPeaks(a,d)}},m.boundary=function(){for(var a=this.dimension,b=[],c=this.simplices,d=c.length,e=0;d>e;++e){var f=c[e];if(f.boundary){for(var g=new Array(a),h=f.vertices,i=0,j=0,k=0;a>=k;++k)h[k]>=0?g[i++]=h[k]:j=1&k;if(j===(1&a)){var l=g[0];g[0]=g[1],g[1]=l}b.push(g)}}return b}},{"robust-orientation":214,"simplicial-complex":194}],192:[function(a,b,c){arguments[4][49][0].apply(c,arguments)},{dup:49}],193:[function(a,b,c){"use strict";"use restrict";function d(a){this.roots=new Array(a),this.ranks=new Array(a);for(var b=0;a>b;++b)this.roots[b]=b,this.ranks[b]=0}b.exports=d;var e=d.prototype;Object.defineProperty(e,"length",{get:function(){return this.roots.length}}),e.makeSet=function(){var a=this.roots.length;return this.roots.push(a),this.ranks.push(0),a},e.find=function(a){for(var b=a,c=this.roots;c[a]!==a;)a=c[a];for(;c[b]!==a;){var d=c[b];c[b]=a,b=d}return a},e.link=function(a,b){var c=this.find(a),d=this.find(b);if(c!==d){var e=this.ranks,f=this.roots,g=e[c],h=e[d];h>g?f[c]=d:g>h?f[d]=c:(f[d]=c,++e[c])}}},{}],194:[function(a,b,c){"use strict";"use restrict";function d(a){for(var b=0,c=Math.max,d=0,e=a.length;e>d;++d)b=c(b,a[d].length);return b-1}function e(a){for(var b=-1,c=Math.max,d=0,e=a.length;e>d;++d)for(var f=a[d],g=0,h=f.length;h>g;++g)b=c(b,f[g]);return b+1}function f(a){for(var b=new Array(a.length),c=0,d=a.length;d>c;++c)b[c]=a[c].slice(0);return b}function g(a,b){var c=a.length,d=a.length-b.length,e=Math.min;if(d)return d;switch(c){case 0:return 0;case 1:return a[0]-b[0];case 2:var f=a[0]+a[1]-b[0]-b[1];return f?f:e(a[0],a[1])-e(b[0],b[1]);case 3:var g=a[0]+a[1],h=b[0]+b[1];if(f=g+a[2]-(h+b[2]))return f;var i=e(a[0],a[1]),j=e(b[0],b[1]),f=e(i,a[2])-e(j,b[2]);return f?f:e(i+a[2],g)-e(j+b[2],h);default:var k=a.slice(0);k.sort();var l=b.slice(0);l.sort();for(var m=0;c>m;++m)if(d=k[m]-l[m])return d;return 0}}function h(a,b){return g(a[0],b[0])}function i(a,b){if(b){for(var c=a.length,d=new Array(c),e=0;c>e;++e)d[e]=[a[e],b[e]];d.sort(h);for(var e=0;c>e;++e)a[e]=d[e][0],b[e]=d[e][1];return a}return a.sort(g),a}function j(a){if(0===a.length)return[];for(var b=1,c=a.length,d=1;c>d;++d){var e=a[d];if(g(e,a[d-1])){if(d===b){b++;continue}a[b++]=e}}return a.length=b,a}function k(a,b){for(var c=0,d=a.length-1,e=-1;d>=c;){var f=c+d>>1,h=g(a[f],b);0>=h?(0===h&&(e=f),c=f+1):h>0&&(d=f-1)}return e}function l(a,b){for(var c=new Array(a.length),d=0,e=c.length;e>d;++d)c[d]=[];for(var f=[],d=0,h=b.length;h>d;++d)for(var i=b[d],j=i.length,l=1,m=1<<j;m>l;++l){f.length=t.popCount(l);for(var n=0,o=0;j>o;++o)l&1<<o&&(f[n++]=i[o]);var p=k(a,f);if(!(0>p))for(;;)if(c[p++].push(d),p>=a.length||0!==g(a[p],f))break}return c}function m(a,b){if(!b)return l(j(o(a,0)),a,0);for(var c=new Array(b),d=0;b>d;++d)c[d]=[];for(var d=0,e=a.length;e>d;++d)for(var f=a[d],g=0,h=f.length;h>g;++g)c[f[g]].push(d);return c}function n(a){for(var b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0|e.length,g=1,h=1<<f;h>g;++g){for(var j=[],k=0;f>k;++k)g>>>k&1&&j.push(e[k]);b.push(j)}return i(b)}function o(a,b){if(0>b)return[];for(var c=[],d=(1<<b+1)-1,e=0;e<a.length;++e)for(var f=a[e],g=d;g<1<<f.length;g=t.nextCombination(g)){for(var h=new Array(b+1),j=0,k=0;k<f.length;++k)g&1<<k&&(h[j++]=f[k]);c.push(h)}return i(c)}function p(a){for(var b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;++f){for(var h=new Array(e.length-1),j=0,k=0;g>j;++j)j!==f&&(h[k++]=e[j]);b.push(h)}return i(b)}function q(a,b){for(var c=new u(b),d=0;d<a.length;++d)for(var e=a[d],f=0;f<e.length;++f)for(var g=f+1;g<e.length;++g)c.link(e[f],e[g]);for(var h=[],i=c.ranks,d=0;d<i.length;++d)i[d]=-1;for(var d=0;d<a.length;++d){var j=c.find(a[d][0]);i[j]<0?(i[j]=h.length,h.push([a[d].slice(0)])):h[i[j]].push(a[d].slice(0))}return h}function r(a){for(var b=j(i(o(a,0))),c=new u(b.length),d=0;d<a.length;++d)for(var e=a[d],f=0;f<e.length;++f)for(var g=k(b,[e[f]]),h=f+1;h<e.length;++h)c.link(g,k(b,[e[h]]));for(var l=[],m=c.ranks,d=0;d<m.length;++d)m[d]=-1;for(var d=0;d<a.length;++d){var n=c.find(k(b,[a[d][0]]));m[n]<0?(m[n]=l.length,l.push([a[d].slice(0)])):l[m[n]].push(a[d].slice(0))}return l}function s(a,b){return b?q(a,b):r(a)}var t=a("bit-twiddle"),u=a("union-find");c.dimension=d,c.countVertices=e,c.cloneCells=f,c.compareCells=g,c.normalize=i,c.unique=j,c.findCell=k,c.incidence=l,c.dual=m,c.explode=n,c.skeleton=o,c.boundary=p,c.connectedComponents=s},{"bit-twiddle":192,"union-find":193}],195:[function(a,b,c){"use strict";function d(a){for(var b=new Array(a),c=0;a>c;++c)b[c]=c;return b}b.exports=d},{}],196:[function(a,b,c){"use strict";function d(a,b){function c(a){var b=!1;return"altKey"in a&&(b=b||a.altKey!==p.alt,p.alt=!!a.altKey),"shiftKey"in a&&(b=b||a.shiftKey!==p.shift,p.shift=!!a.shiftKey),"ctrlKey"in a&&(b=b||a.ctrlKey!==p.control,p.control=!!a.ctrlKey),"metaKey"in a&&(b=b||a.metaKey!==p.meta,p.meta=!!a.metaKey),b}function d(a,d){var f=e.x(d),g=e.y(d);"buttons"in d&&(a=0|d.buttons),(a!==m||f!==n||g!==o||c(d))&&(m=0|a,n=f||0,o=g||0,b(m,n,o,p))}function f(a){d(0,a)}function g(){(m||n||o||p.shift||p.alt||p.meta||p.control)&&(n=o=0,m=0,p.shift=p.alt=p.control=p.meta=!1,b(0,0,0,p))}function h(a){c(a)&&b(m,n,o,p)}function i(a){0===e.buttons(a)?d(0,a):d(m,a)}function j(a){d(m|e.buttons(a),a)}function k(a){d(m&~e.buttons(a),a)}function l(){q||(q=!0,a.addEventListener("mousemove",i),a.addEventListener("mousedown",j),a.addEventListener("mouseup",k),a.addEventListener("mouseleave",f),a.addEventListener("mouseenter",f),a.addEventListener("mouseout",f),a.addEventListener("mouseover",f),a.addEventListener("blur",g),a.addEventListener("keyup",h),a.addEventListener("keydown",h),a.addEventListener("keypress",h),a!==window&&(window.addEventListener("blur",g),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}b||(b=a,a=window);var m=0,n=0,o=0,p={shift:!1,alt:!1,control:!1,meta:!1},q=!1;l();var r={element:a};return Object.defineProperties(r,{enabled:{get:function(){return q},set:function(a){a&&l()},enumerable:!0},buttons:{get:function(){return m},enumerable:!0},x:{get:function(){return n},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return p},enumerable:!0}}),r}b.exports=d;var e=a("mouse-event")},{"mouse-event":197}],197:[function(a,b,c){"use strict";function d(a){if("object"==typeof a){if("buttons"in a)return a.buttons;if("which"in a){var b=a.which;if(2===b)return 4;if(3===b)return 2;if(b>0)return 1<<b-1}else if("button"in a){var b=a.button;if(1===b)return 4;if(2===b)return 2;if(b>=0)return 1<<b}}return 0}function e(a){return a.target||a.srcElement||window}function f(a){if("object"==typeof a){if("offsetX"in a)return a.offsetX;var b=e(a),c=b.getBoundingClientRect();return a.clientX-c.left}return 0}function g(a){if("object"==typeof a){if("offsetY"in a)return a.offsetY;var b=e(a),c=b.getBoundingClientRect();return a.clientY-c.top}return 0}c.buttons=d,c.element=e,c.x=f,c.y=g},{}],198:[function(a,b,c){b.exports=function(a,b){b||(b=[0,""]),a=String(a);var c=parseFloat(a,10);return b[0]=c,b[1]=a.match(/[\d.\-\+]*\s*(.*)/)[1]||"",b}},{}],199:[function(a,b,c){"use strict";function d(a,b){var c=g(getComputedStyle(a).getPropertyValue(b));return c[0]*f(c[1],a)}function e(a,b){var c=document.createElement("div");c.style["font-size"]="128"+a,b.appendChild(c);var e=d(c,"font-size")/128;return b.removeChild(c),e}function f(a,b){switch(b=b||document.body,a=(a||"px").trim().toLowerCase(),b!==window&&b!==document||(b=document.body),a){case"%":return b.clientHeight/100;case"ch":case"ex":return e(a,b);case"em":return d(b,"font-size");case"rem":return d(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return h;case"cm":return h/2.54;case"mm":return h/25.4;case"pt":return h/72;case"pc":return h/6}return 1}var g=a("parse-unit");b.exports=f;var h=96},{"parse-unit":198}],200:[function(a,b,c){"use strict";function d(a,b,c){"function"==typeof a&&(c=!!b,b=a,a=window);var d=e("ex",a);a.addEventListener("wheel",function(a){c&&a.preventDefault();var e=a.deltaX||0,f=a.deltaY||0,g=a.deltaZ||0,h=a.deltaMode,i=1;switch(h){case 1:i=d;break;case 2:i=window.innerHeight}return e*=i,f*=i,g*=i,e||f||g?b(e,f,g):void 0})}var e=a("to-px");b.exports=d},{"to-px":199}],201:[function(a,b,c){"use strict";var d=a("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});b.exports=function(a,b){return d(a,b),a}},{"cwise/lib/wrapper":69}],202:[function(a,b,c){"use strict";function d(a,b){switch(b.length){case 0:break;case 1:a[0]=1/b[0];break;case 4:e(a,b);break;case 9:f(a,b);break;case 16:g(a,b);break;default:throw new Error("currently supports matrices up to 4x4")}return a}b.exports=d;var e=a("gl-mat2/invert"),f=a("gl-mat3/invert"),g=a("gl-mat4/invert")},{"gl-mat2/invert":203,"gl-mat3/invert":87,"gl-mat4/invert":94}],203:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*f-e*d;return g?(g=1/g,a[0]=f*g,a[1]=-d*g,a[2]=-e*g,a[3]=c*g,a):null}b.exports=d},{}],204:[function(a,b,c){"use strict";function d(a,b){var c=Math.floor(b),d=b-c,e=c>=0&&c<a.shape[0],f=c+1>=0&&c+1<a.shape[0],g=e?+a.get(c):0,h=f?+a.get(c+1):0;return(1-d)*g+d*h}function e(a,b,c){var d=Math.floor(b),e=b-d,f=d>=0&&d<a.shape[0],g=d+1>=0&&d+1<a.shape[0],h=Math.floor(c),i=c-h,j=h>=0&&h<a.shape[1],k=h+1>=0&&h+1<a.shape[1],l=f&&j?a.get(d,h):0,m=f&&k?a.get(d,h+1):0,n=g&&j?a.get(d+1,h):0,o=g&&k?a.get(d+1,h+1):0;return(1-i)*((1-e)*l+e*n)+i*((1-e)*m+e*o)}function f(a,b,c,d){var e=Math.floor(b),f=b-e,g=e>=0&&e<a.shape[0],h=e+1>=0&&e+1<a.shape[0],i=Math.floor(c),j=c-i,k=i>=0&&i<a.shape[1],l=i+1>=0&&i+1<a.shape[1],m=Math.floor(d),n=d-m,o=m>=0&&m<a.shape[2],p=m+1>=0&&m+1<a.shape[2],q=g&&k&&o?a.get(e,i,m):0,r=g&&l&&o?a.get(e,i+1,m):0,s=h&&k&&o?a.get(e+1,i,m):0,t=h&&l&&o?a.get(e+1,i+1,m):0,u=g&&k&&p?a.get(e,i,m+1):0,v=g&&l&&p?a.get(e,i+1,m+1):0,w=h&&k&&p?a.get(e+1,i,m+1):0,x=h&&l&&p?a.get(e+1,i+1,m+1):0;return(1-n)*((1-j)*((1-f)*q+f*s)+j*((1-f)*r+f*t))+n*((1-j)*((1-f)*u+f*w)+j*((1-f)*v+f*x))}function g(a){var b,c,d=0|a.shape.length,e=new Array(d),f=new Array(d),g=new Array(d),h=new Array(d);for(b=0;d>b;++b)c=+arguments[b+1],e[b]=Math.floor(c),f[b]=c-e[b],g[b]=0<=e[b]&&e[b]<a.shape[b],h[b]=0<=e[b]+1&&e[b]+1<a.shape[b];var i,j,k,l=0;a:for(b=0;1<<d>b;++b){for(j=1,k=a.offset,i=0;d>i;++i)if(b&1<<i){if(!h[i])continue a;j*=f[i],k+=a.stride[i]*(e[i]+1)}else{if(!g[i])continue a;j*=1-f[i],k+=a.stride[i]*e[i]}l+=j*a.data[k]}return l}function h(a,b,c,h){switch(a.shape.length){case 0:return 0;case 1:return d(a,b);case 2:return e(a,b,c);case 3:return f(a,b,c,h);default:return g.apply(void 0,arguments)}}b.exports=h,b.exports.d1=d,b.exports.d2=e,b.exports.d3=f},{}],205:[function(a,b,c){"use strict";var d=a("ndarray-linear-interpolate"),e=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_6_arg4_)}",args:[{name:"_inline_6_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),f=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),g=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),h=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});b.exports=function(a,b,c){switch(b.shape.length){case 1:f(a,c,d.d1,b);break;case 2:g(a,c,d.d2,b);break;case 3:h(a,c,d.d3,b);break;default:e(a,c,d.bind(void 0,b),b.shape.length)}return a}},{"cwise/lib/wrapper":69,"ndarray-linear-interpolate":204}],206:[function(a,b,c){"use strict";function d(a,b,c){var d=b.dimension,g=f([],c);return e(a,b,function(a,b){for(var c=0;d>c;++c){a[c]=g[(d+1)*d+c];for(var e=0;d>e;++e)a[c]+=g[(d+1)*e+c]*b[e]}for(var f=g[(d+1)*(d+1)-1],e=0;d>e;++e)f+=g[(d+1)*e+d]*b[e];for(var h=1/f,c=0;d>c;++c)a[c]*=h;return a}),a}var e=a("ndarray-warp"),f=a("gl-matrix-invert");b.exports=d},{"gl-matrix-invert":202,"ndarray-warp":205}],207:[function(a,b,c){"use strict";function d(a){if(!a)return h;for(var b=0;b<a.args.length;++b){var c=a.args[b];0===b?a.args[b]={name:c,lvalue:!0,rvalue:!!a.rvalue,count:a.count||1}:a.args[b]={name:c,lvalue:!1,rvalue:!0,count:1}}return a.thisVars||(a.thisVars=[]),a.localVars||(a.localVars=[]),a}function e(a){return g({args:a.args,pre:d(a.pre),body:d(a.body),post:d(a.proc),funcName:a.funcName})}function f(a){for(var b=[],c=0;c<a.args.length;++c)b.push("a"+c);var d=new Function("P",["return function ",a.funcName,"_ndarrayops(",b.join(","),") {P(",b.join(","),");return a0}"].join(""));return d(e(a))}var g=a("cwise-compiler"),h={body:"",args:[],thisVars:[],localVars:[]},i={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var a in i){var b=i[a];c[a]=f({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+b+"c"},funcName:a}),c[a+"eq"]=f({args:["array","array"],body:{args:["a","b"],body:"a"+b+"=b"},rvalue:!0,funcName:a+"eq"}),c[a+"s"]=f({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+b+"s"},funcName:a+"s"}),c[a+"seq"]=f({args:["array","scalar"],body:{args:["a","s"],body:"a"+b+"=s"},rvalue:!0,funcName:a+"seq"})}}();var j={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var a in j){var b=j[a];c[a]=f({args:["array","array"],body:{args:["a","b"],body:"a="+b+"b"},funcName:a}),c[a+"eq"]=f({args:["array"],body:{args:["a"],body:"a="+b+"a"},rvalue:!0,count:2,funcName:a+"eq"})}}();var k={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var a in k){var b=k[a];c[a]=f({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+b+"c"},funcName:a}),c[a+"s"]=f({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+b+"s"},funcName:a+"s"}),c[a+"eq"]=f({args:["array","array"],body:{args:["a","b"],body:"a=a"+b+"b"},rvalue:!0,count:2,funcName:a+"eq"}),c[a+"seq"]=f({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+b+"s"},rvalue:!0,count:2,funcName:a+"seq"})}}();var l=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var a=0;a<l.length;++a){var b=l[a];c[b]=f({args:["array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:b}),c[b+"eq"]=f({args:["array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"eq"})}}();var m=["max","min","atan2","pow"];!function(){for(var a=0;a<m.length;++a){var b=m[a];c[b]=f({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:b}),c[b+"s"]=f({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:b+"s"}),c[b+"eq"]=f({args:["array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"eq"}),c[b+"seq"]=f({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"seq"})}}();var n=["atan2","pow"];!function(){for(var a=0;a<n.length;++a){var b=n[a];c[b+"op"]=f({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:b+"op"}),c[b+"ops"]=f({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:b+"ops"}),c[b+"opeq"]=f({args:["array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"opeq"}),c[b+"opseq"]=f({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"opseq"})}}(),c.any=g({args:["array"],pre:h,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),c.all=g({args:["array"],pre:h,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),c.sum=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),c.prod=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),c.norm2squared=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),c.norm2=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),c.norminf=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),c.norm1=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),c.sup=g({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),c.inf=g({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),c.argmin=g({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),c.argmax=g({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),c.random=f({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),c.assign=f({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),c.assigns=f({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),c.equals=g({args:["array","array"],pre:h,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":66}],208:[function(a,b,c){function d(a,b){return a[0]-b[0]}function e(){var a,b=this.stride,c=new Array(b.length);for(a=0;a<c.length;++a)c[a]=[Math.abs(b[a]),a];c.sort(d);var e=new Array(c.length);for(a=0;a<e.length;++a)e[a]=c[a][1];return e}function f(a,b){var c=["View",b,"d",a].join("");0>b&&(c="View_Nil"+a);var d="generic"===a;if(-1===b){var f="function "+c+"(a){this.data=a;};var proto="+c+".prototype;proto.dtype='"+a+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+c+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+c+"(a){return new "+c+"(a);}",g=new Function(f);return g()}if(0===b){var f="function "+c+"(a,d) {this.data = a;this.offset = d};var proto="+c+".prototype;proto.dtype='"+a+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+c+"_copy() {return new "+c+"(this.data,this.offset)};proto.pick=function "+c+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+c+"_get(){return "+(d?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+c+"_set(v){return "+(d?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+c+"(a,b,c,d){return new "+c+"(a,d)}",g=new Function("TrivialArray",f);return g(l[a][0])}var f=["'use strict'"],h=i(b),j=h.map(function(a){return"i"+a}),k="this.offset+"+h.map(function(a){return"this.stride["+a+"]*i"+a}).join("+"),m=h.map(function(a){return"b"+a}).join(","),n=h.map(function(a){return"c"+a}).join(",");f.push("function "+c+"(a,"+m+","+n+",d){this.data=a","this.shape=["+m+"]","this.stride=["+n+"]","this.offset=d|0}","var proto="+c+".prototype","proto.dtype='"+a+"'","proto.dimension="+b),f.push("Object.defineProperty(proto,'size',{get:function "+c+"_size(){return "+h.map(function(a){return"this.shape["+a+"]"}).join("*"),"}})"),1===b?f.push("proto.order=[0]"):(f.push("Object.defineProperty(proto,'order',{get:"),4>b?(f.push("function "+c+"_order(){"),2===b?f.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===b&&f.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):f.push("ORDER})")),f.push("proto.set=function "+c+"_set("+j.join(",")+",v){"),d?f.push("return this.data.set("+k+",v)}"):f.push("return this.data["+k+"]=v}"),f.push("proto.get=function "+c+"_get("+j.join(",")+"){"),d?f.push("return this.data.get("+k+")}"):f.push("return this.data["+k+"]}"),f.push("proto.index=function "+c+"_index(",j.join(),"){return "+k+"}"),f.push("proto.hi=function "+c+"_hi("+j.join(",")+"){return new "+c+"(this.data,"+h.map(function(a){return["(typeof i",a,"!=='number'||i",a,"<0)?this.shape[",a,"]:i",a,"|0"].join("")}).join(",")+","+h.map(function(a){return"this.stride["+a+"]"}).join(",")+",this.offset)}");var o=h.map(function(a){return"a"+a+"=this.shape["+a+"]"}),p=h.map(function(a){return"c"+a+"=this.stride["+a+"]"});f.push("proto.lo=function "+c+"_lo("+j.join(",")+"){var b=this.offset,d=0,"+o.join(",")+","+p.join(","));for(var q=0;b>q;++q)f.push("if(typeof i"+q+"==='number'&&i"+q+">=0){d=i"+q+"|0;b+=c"+q+"*d;a"+q+"-=d}");f.push("return new "+c+"(this.data,"+h.map(function(a){return"a"+a}).join(",")+","+h.map(function(a){return"c"+a}).join(",")+",b)}"),f.push("proto.step=function "+c+"_step("+j.join(",")+"){var "+h.map(function(a){return"a"+a+"=this.shape["+a+"]"}).join(",")+","+h.map(function(a){return"b"+a+"=this.stride["+a+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var q=0;b>q;++q)f.push("if(typeof i"+q+"==='number'){d=i"+q+"|0;if(d<0){c+=b"+q+"*(a"+q+"-1);a"+q+"=ceil(-a"+q+"/d)}else{a"+q+"=ceil(a"+q+"/d)}b"+q+"*=d}");f.push("return new "+c+"(this.data,"+h.map(function(a){return"a"+a}).join(",")+","+h.map(function(a){return"b"+a}).join(",")+",c)}");for(var r=new Array(b),s=new Array(b),q=0;b>q;++q)r[q]="a[i"+q+"]",s[q]="b[i"+q+"]";f.push("proto.transpose=function "+c+"_transpose("+j+"){"+j.map(function(a,b){return a+"=("+a+"===undefined?"+b+":"+a+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+c+"(this.data,"+r.join(",")+","+s.join(",")+",this.offset)}"),f.push("proto.pick=function "+c+"_pick("+j+"){var a=[],b=[],c=this.offset");for(var q=0;b>q;++q)f.push("if(typeof i"+q+"==='number'&&i"+q+">=0){c=(c+this.stride["+q+"]*i"+q+")|0}else{a.push(this.shape["+q+"]);b.push(this.stride["+q+"])}");f.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),f.push("return function construct_"+c+"(data,shape,stride,offset){return new "+c+"(data,"+h.map(function(a){return"shape["+a+"]"}).join(",")+","+h.map(function(a){return"stride["+a+"]"}).join(",")+",offset)}");var g=new Function("CTOR_LIST","ORDER",f.join("\n"));return g(l[a],e)}function g(a){if(j(a))return"buffer";if(k)switch(Object.prototype.toString.call(a)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(a)?"array":"generic"}function h(a,b,c,d){if(void 0===a){var e=l.array[0];return e([])}"number"==typeof a&&(a=[a]),void 0===b&&(b=[a.length]);var h=b.length;if(void 0===c){c=new Array(h);for(var i=h-1,j=1;i>=0;--i)c[i]=j,j*=b[i]}if(void 0===d){d=0;for(var i=0;h>i;++i)c[i]<0&&(d-=(b[i]-1)*c[i])}for(var k=g(a),m=l[k];m.length<=h+1;)m.push(f(k,m.length-1));var e=m[h+1];return e(a,b,c,d)}var i=a("iota-array"),j=a("is-buffer"),k="undefined"!=typeof Float64Array,l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};b.exports=h},{"iota-array":195,"is-buffer":209}],209:[function(a,b,c){b.exports=function(a){return!(null==a||!(a._isBuffer||a.constructor&&"function"==typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)))}},{}],210:[function(a,b,c){(function(a){b.exports=a.performance&&a.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],211:[function(a,b,c){"use strict";function d(a){for(var b="robustLinearSolve"+a+"d",c=["function ",b,"(A,b){return ["],d=0;a>d;++d){c.push("det([");for(var e=0;a>e;++e){e>0&&c.push(","),c.push("[");for(var f=0;a>f;++f)f>0&&c.push(","),f===d?c.push("+b[",e,"]"):c.push("+A[",e,"][",f,"]"); 40 c.push("]")}c.push("]),")}c.push("det(A)]}return ",b);var g=new Function("det",c.join(""));return g(6>a?h[a]:h)}function e(){return[0]}function f(a,b){return[[b[0]],[a[0][0]]]}function g(){for(;j.length<i;)j.push(d(j.length));for(var a=[],c=["function dispatchLinearSolve(A,b){switch(A.length){"],e=0;i>e;++e)a.push("s"+e),c.push("case ",e,":return s",e,"(A,b);");c.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),a.push("CACHE","g",c.join(""));var f=Function.apply(void 0,a);b.exports=f.apply(void 0,j.concat([j,d]));for(var e=0;i>e;++e)b.exports[e]=j[e]}var h=a("robust-determinant"),i=6,j=[e,f];g()},{"robust-determinant":213}],212:[function(a,b,c){"use strict";function d(a){for(var b=a.length,c=a[a.length-1],d=b,e=b-2;e>=0;--e){var f=c,g=a[e];c=f+g;var h=c-f,i=g-h;i&&(a[--d]=c,c=i)}for(var j=0,e=d;b>e;++e){var f=a[e],g=c;c=f+g;var h=c-f,i=g-h;i&&(a[j++]=i)}return a[j++]=c,a.length=j,a}b.exports=d},{}],213:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m[",c,"][",d,"]"].join("")}return b}function f(a){return 1&a?"-":""}function g(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",g(a.slice(0,b)),",",g(a.slice(b)),")"].join("")}function h(a){if(2===a.length)return["sum(prod(",a[0][0],",",a[1][1],"),prod(-",a[0][1],",",a[1][0],"))"].join("");for(var b=[],c=0;c<a.length;++c)b.push(["scale(",h(d(a,c)),",",f(c),a[0][c],")"].join(""));return g(b)}function i(a){var b=new Function("sum","scale","prod","compress",["function robustDeterminant",a,"(m){return compress(",h(e(a)),")};return robustDeterminant",a].join(""));return b(l,m,k,n)}function j(){for(;p.length<o;)p.push(i(p.length));for(var a=[],c=["function robustDeterminant(m){switch(m.length){"],d=0;o>d;++d)a.push("det"+d),c.push("case ",d,":return det",d,"(m);");c.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),a.push("CACHE","gen",c.join(""));var e=Function.apply(void 0,a);b.exports=e.apply(void 0,p.concat([p,i]));for(var d=0;d<p.length;++d)b.exports[d]=p[d]}var k=a("two-product"),l=a("robust-sum"),m=a("robust-scale"),n=a("robust-compress"),o=6,p=[function(){return[0]},function(a){return[a[0][0]]}];j()},{"robust-compress":212,"robust-scale":215,"robust-sum":217,"two-product":231}],214:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m",d,"[",a-c-1,"]"].join("")}return b}function f(a){return 1&a?"-":""}function g(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",g(a.slice(0,b)),",",g(a.slice(b)),")"].join("")}function h(a){if(2===a.length)return[["sum(prod(",a[0][0],",",a[1][1],"),prod(-",a[0][1],",",a[1][0],"))"].join("")];for(var b=[],c=0;c<a.length;++c)b.push(["scale(",g(h(d(a,c))),",",f(c),a[0][c],")"].join(""));return b}function i(a){for(var b=[],c=[],f=e(a),i=[],j=0;a>j;++j)0===(1&j)?b.push.apply(b,h(d(f,j))):c.push.apply(c,h(d(f,j))),i.push("m"+j);var k=g(b),p=g(c),q="orientation"+a+"Exact",r=["function ",q,"(",i.join(),"){var p=",k,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",q].join(""),s=new Function("sum","prod","scale","sub",r);return s(m,l,n,o)}function j(a){var b=v[a.length];return b||(b=v[a.length]=i(a.length)),b.apply(void 0,a)}function k(){for(;v.length<=p;)v.push(i(v.length));for(var a=[],c=["slow"],d=0;p>=d;++d)a.push("a"+d),c.push("o"+d);for(var e=["function getOrientation(",a.join(),"){switch(arguments.length){case 0:case 1:return 0;"],d=2;p>=d;++d)e.push("case ",d,":return o",d,"(",a.slice(0,d).join(),");");e.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),c.push(e.join(""));var f=Function.apply(void 0,c);b.exports=f.apply(void 0,[j].concat(v));for(var d=0;p>=d;++d)b.exports[d]=v[d]}var l=a("two-product"),m=a("robust-sum"),n=a("robust-scale"),o=a("robust-subtract"),p=5,q=1.1102230246251565e-16,r=(3+16*q)*q,s=(7+56*q)*q,t=i(3),u=i(4),v=[function(){return 0},function(){return 0},function(a,b){return b[0]-a[0]},function(a,b,c){var d,e=(a[1]-c[1])*(b[0]-c[0]),f=(a[0]-c[0])*(b[1]-c[1]),g=e-f;if(e>0){if(0>=f)return g;d=e+f}else{if(!(0>e))return g;if(f>=0)return g;d=-(e+f)}var h=r*d;return g>=h||-h>=g?g:t(a,b,c)},function(a,b,c,d){var e=a[0]-d[0],f=b[0]-d[0],g=c[0]-d[0],h=a[1]-d[1],i=b[1]-d[1],j=c[1]-d[1],k=a[2]-d[2],l=b[2]-d[2],m=c[2]-d[2],n=f*j,o=g*i,p=g*h,q=e*j,r=e*i,t=f*h,v=k*(n-o)+l*(p-q)+m*(r-t),w=(Math.abs(n)+Math.abs(o))*Math.abs(k)+(Math.abs(p)+Math.abs(q))*Math.abs(l)+(Math.abs(r)+Math.abs(t))*Math.abs(m),x=s*w;return v>x||-v>x?v:u(a,b,c,d)}];k()},{"robust-scale":215,"robust-subtract":216,"robust-sum":217,"two-product":231}],215:[function(a,b,c){"use strict";function d(a,b){var c=a.length;if(1===c){var d=e(a[0],b);return d[0]?d:[d[1]]}var g=new Array(2*c),h=[.1,.1],i=[.1,.1],j=0;e(a[0],b,h),h[0]&&(g[j++]=h[0]);for(var k=1;c>k;++k){e(a[k],b,i);var l=h[1];f(l,i[0],h),h[0]&&(g[j++]=h[0]);var m=i[1],n=h[1],o=m+n,p=o-m,q=n-p;h[1]=o,q&&(g[j++]=q)}return h[1]&&(g[j++]=h[1]),0===j&&(g[j++]=0),g.length=j,g}var e=a("two-product"),f=a("two-sum");b.exports=d},{"two-product":231,"two-sum":232}],216:[function(a,b,c){"use strict";function d(a,b){var c=a+b,d=c-a,e=c-d,f=b-d,g=a-e,h=g+f;return h?[h,c]:[c]}function e(a,b){var c=0|a.length,e=0|b.length;if(1===c&&1===e)return d(a[0],-b[0]);var f,g,h=c+e,i=new Array(h),j=0,k=0,l=0,m=Math.abs,n=a[k],o=m(n),p=-b[l],q=m(p);q>o?(g=n,k+=1,c>k&&(n=a[k],o=m(n))):(g=p,l+=1,e>l&&(p=-b[l],q=m(p))),c>k&&q>o||l>=e?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=-b[l],q=m(p)));for(var r,s,t,u,v,w=f+g,x=w-f,y=g-x,z=y,A=w;c>k&&e>l;)q>o?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=-b[l],q=m(p))),g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r;for(;c>k;)f=n,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,k+=1,c>k&&(n=a[k]);for(;e>l;)f=p,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,l+=1,e>l&&(p=-b[l]);return z&&(i[j++]=z),A&&(i[j++]=A),j||(i[j++]=0),i.length=j,i}b.exports=e},{}],217:[function(a,b,c){"use strict";function d(a,b){var c=a+b,d=c-a,e=c-d,f=b-d,g=a-e,h=g+f;return h?[h,c]:[c]}function e(a,b){var c=0|a.length,e=0|b.length;if(1===c&&1===e)return d(a[0],b[0]);var f,g,h=c+e,i=new Array(h),j=0,k=0,l=0,m=Math.abs,n=a[k],o=m(n),p=b[l],q=m(p);q>o?(g=n,k+=1,c>k&&(n=a[k],o=m(n))):(g=p,l+=1,e>l&&(p=b[l],q=m(p))),c>k&&q>o||l>=e?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=b[l],q=m(p)));for(var r,s,t,u,v,w=f+g,x=w-f,y=g-x,z=y,A=w;c>k&&e>l;)q>o?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=b[l],q=m(p))),g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r;for(;c>k;)f=n,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,k+=1,c>k&&(n=a[k]);for(;e>l;)f=p,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,l+=1,e>l&&(p=b[l]);return z&&(i[j++]=z),A&&(i[j++]=A),j||(i[j++]=0),i.length=j,i}b.exports=e},{}],218:[function(a,b,c){"use strict";function d(a){return a.split("").map(function(a){return a in e?e[a]:""}).join("")}b.exports=d;var e={" ":" ",0:"â°",1:"¹",2:"²",3:"³",4:"âŽ",5:"âµ",6:"â¶",7:"â·",8:"âž",9:"â¹","+":"âº","-":"â»",a:"áµ",b:"áµ",c:"á¶",d:"áµ",e:"áµ",f:"ᶠ",g:"áµ",h:"Ê°",i:"â±",j:"ʲ",k:"áµ",l:"Ë¡",m:"áµ",n:"â¿",o:"áµ",p:"áµ",r:"ʳ",s:"Ë¢",t:"áµ",u:"áµ",v:"áµ",w:"Ê·",x:"Ë£",y:"Êž",z:"ᶻ"}},{}],219:[function(a,b,c){"use strict";function d(a){return"a"+a}function e(a){return"d"+a}function f(a,b){return"c"+a+"_"+b}function g(a){return"s"+a}function h(a,b){return"t"+a+"_"+b}function i(a){return"o"+a}function j(a){return"x"+a}function k(a){return"p"+a}function l(a,b){return"d"+a+"_"+b}function m(a){return"i"+a}function n(a,b){return"u"+a+"_"+b}function o(a){return"b"+a}function p(a){return"y"+a}function q(a){return"e"+a}function r(a){return"v"+a}function s(a,b,c){for(var d=0,e=0;a>e;++e)b&1<<e&&(d|=1<<c[e]);return d}function t(a,b,c,t,u,C){function D(a,b){M.push("for(",m(u[a]),"=",b,";",m(u[a]),"<",g(u[a]),";","++",m(u[a]),"){")}function E(a){for(var b=0;J>b;++b)M.push(k(b),"+=",n(b,u[a]),";");M.push("}")}function F(a){for(var b=a-1;b>=0;--b)D(b,0);for(var c=[],b=0;J>b;++b)C[b]?c.push(e(b)+".get("+k(b)+")"):c.push(e(b)+"["+k(b)+"]");for(var b=0;t>b;++b)c.push(j(b));M.push(x,"[",A,"++]=phase(",c.join(),");");for(var b=0;a>b;++b)E(b);for(var d=0;J>d;++d)M.push(k(d),"+=",n(d,u[a]),";")}function G(a){for(var b=0;J>b;++b)C[b]?M.push(f(b,0),"=",e(b),".get(",k(b),");"):M.push(f(b,0),"=",e(b),"[",k(b),"];");for(var c=[],b=0;J>b;++b)c.push(f(b,0));for(var b=0;t>b;++b)c.push(j(b));M.push(o(0),"=",x,"[",A,"]=phase(",c.join(),");");for(var d=1;1<<K>d;++d)M.push(o(d),"=",x,"[",A,"+",q(d),"];");for(var g=[],d=1;1<<K>d;++d)g.push("("+o(0)+"!=="+o(d)+")");M.push("if(",g.join("||"),"){");for(var h=[],b=0;K>b;++b)h.push(m(b));for(var b=0;J>b;++b){h.push(f(b,0));for(var d=1;1<<K>d;++d)C[b]?M.push(f(b,d),"=",e(b),".get(",k(b),"+",l(b,d),");"):M.push(f(b,d),"=",e(b),"[",k(b),"+",l(b,d),"];"),h.push(f(b,d))}for(var b=0;1<<K>b;++b)h.push(o(b));for(var b=0;t>b;++b)h.push(j(b));M.push("vertex(",h.join(),");",r(0),"=",w,"[",A,"]=",y,"++;");for(var i=(1<<K)-1,n=o(i),d=0;K>d;++d)if(0===(a&~(1<<d))){for(var p=i^1<<d,s=o(p),u=[],v=p;v>0;v=v-1&p)u.push(w+"["+A+"+"+q(v)+"]");u.push(r(0));for(var v=0;J>v;++v)1&d?u.push(f(v,i),f(v,p)):u.push(f(v,p),f(v,i));1&d?u.push(n,s):u.push(s,n);for(var v=0;t>v;++v)u.push(j(v));M.push("if(",n,"!==",s,"){","face(",u.join(),")}")}M.push("}",A,"+=1;")}function H(){for(var a=1;1<<K>a;++a)M.push(B,"=",q(a),";",q(a),"=",p(a),";",p(a),"=",B,";")}function I(a,b){if(0>a)return void G(b);F(a),M.push("if(",g(u[a]),">0){",m(u[a]),"=1;"),I(a-1,b|1<<u[a]);for(var c=0;J>c;++c)M.push(k(c),"+=",n(c,u[a]),";");a===K-1&&(M.push(A,"=0;"),H()),D(a,2),I(a-1,b),a===K-1&&(M.push("if(",m(u[K-1]),"&1){",A,"=0;}"),H()),E(a),M.push("}")}var J=C.length,K=u.length;if(2>K)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var L="extractContour"+u.join("_"),M=[],N=[],O=[],P=0;J>P;++P)O.push(d(P));for(var P=0;t>P;++P)O.push(j(P));for(var P=0;K>P;++P)N.push(g(P)+"="+d(0)+".shape["+P+"]|0");for(var P=0;J>P;++P){N.push(e(P)+"="+d(P)+".data",i(P)+"="+d(P)+".offset|0");for(var Q=0;K>Q;++Q)N.push(h(P,Q)+"="+d(P)+".stride["+Q+"]|0")}for(var P=0;J>P;++P){N.push(k(P)+"="+i(P)),N.push(f(P,0));for(var Q=1;1<<K>Q;++Q){for(var R=[],S=0;K>S;++S)Q&1<<S&&R.push("-"+h(P,S));N.push(l(P,Q)+"=("+R.join("")+")|0"),N.push(f(P,Q)+"=0")}}for(var P=0;J>P;++P)for(var Q=0;K>Q;++Q){var T=[h(P,u[Q])];Q>0&&T.push(h(P,u[Q-1])+"*"+g(u[Q-1])),N.push(n(P,u[Q])+"=("+T.join("-")+")|0")}for(var P=0;K>P;++P)N.push(m(P)+"=0");N.push(y+"=0");for(var U=["2"],P=K-2;P>=0;--P)U.push(g(u[P]));N.push(z+"=("+U.join("*")+")|0",x+"=mallocUint32("+z+")",w+"=mallocUint32("+z+")",A+"=0"),N.push(o(0)+"=0");for(var Q=1;1<<K>Q;++Q){for(var V=[],W=[],S=0;K>S;++S)Q&1<<S&&(0===W.length?V.push("1"):V.unshift(W.join("*"))),W.push(g(u[S]));var X="";V[0].indexOf(g(u[K-2]))<0&&(X="-");var Y=s(K,Q,u);N.push(q(Y)+"=(-"+V.join("-")+")|0",p(Y)+"=("+X+V.join("-")+")|0",o(Y)+"=0")}N.push(r(0)+"=0",B+"=0"),I(K-1,0),M.push("freeUint32(",w,");freeUint32(",x,");");var Z=["'use strict';","function ",L,"(",O.join(),"){","var ",N.join(),";",M.join(""),"}","return ",L].join(""),$=new Function("vertex","face","phase","mallocUint32","freeUint32",Z);return $(a,b,c,v.mallocUint32,v.freeUint32)}function u(a){function b(a){throw new Error("ndarray-extract-contour: "+a)}"object"!=typeof a&&b("Must specify arguments");var c=a.order;Array.isArray(c)||b("Must specify order");var d=a.arrayArguments||1;1>d&&b("Must have at least one array argument");var e=a.scalarArguments||0;0>e&&b("Scalar arg count must be > 0"),"function"!=typeof a.vertex&&b("Must specify vertex creation function"),"function"!=typeof a.cell&&b("Must specify cell creation function"),"function"!=typeof a.phase&&b("Must specify phase function");for(var f=a.getters||[],g=new Array(d),h=0;d>h;++h)f.indexOf(h)>=0?g[h]=!0:g[h]=!1;return t(a.vertex,a.cell,a.phase,e,c,g)}var v=a("typedarray-pool");b.exports=u;var w="V",x="P",y="N",z="Q",A="X",B="T"},{"typedarray-pool":233}],220:[function(a,b,c){function d(a){if(0>a)return Number("0/0");for(var b=h[0],c=h.length-1;c>0;--c)b+=h[c]/(a+c);var d=a+g+.5;return.5*Math.log(2*Math.PI)+(a+.5)*Math.log(d)-d+Math.log(b)-Math.log(a)}var e=7,f=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],g=607/128,h=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];b.exports=function i(a){if(.5>a)return Math.PI/(Math.sin(Math.PI*a)*i(1-a));if(a>100)return Math.exp(d(a));a-=1;for(var b=f[0],c=1;e+2>c;c++)b+=f[c]/(a+c);var g=a+e+.5;return Math.sqrt(2*Math.PI)*Math.pow(g,a+.5)*Math.exp(-g)*b},b.exports.log=d},{}],221:[function(a,b,c){"use strict";function d(a){var b=a.length;if(e>b){for(var c=1,d=0;b>d;++d)for(var g=0;d>g;++g)if(a[d]<a[g])c=-c;else if(a[d]===a[g])return 0;return c}for(var h=f.mallocUint8(b),d=0;b>d;++d)h[d]=0;for(var c=1,d=0;b>d;++d)if(!h[d]){var i=1;h[d]=1;for(var g=a[d];g!==d;g=a[g]){if(h[g])return f.freeUint8(h),0;i+=1,h[g]=1}1&i||(c=-c)}return f.freeUint8(h),c}b.exports=d;var e=32,f=a("typedarray-pool")},{"typedarray-pool":233}],222:[function(a,b,c){"use strict";function d(a){var b=a.length;switch(b){case 0:case 1:return 0;case 2:return a[1]}var c,d,e,h=f.mallocUint32(b),i=f.mallocUint32(b),j=0;for(g(a,i),e=0;b>e;++e)h[e]=a[e];for(e=b-1;e>0;--e)d=i[e],c=h[e],h[e]=h[d],h[d]=c,i[e]=i[c],i[c]=d,j=(j+c)*e;return f.freeUint32(i),f.freeUint32(h),j}function e(a,b,c){switch(a){case 0:return c?c:[];case 1:return c?(c[0]=0,c):[0];case 2:return c?(b?(c[0]=0,c[1]=1):(c[0]=1,c[1]=0),c):b?[0,1]:[1,0]}c=c||new Array(a);var d,e,f,g=1;for(c[0]=0,f=1;a>f;++f)c[f]=f,g=g*f|0;for(f=a-1;f>0;--f)d=b/g|0,b=b-d*g|0,g=g/f|0,e=0|c[f],c[f]=0|c[d],c[d]=0|e;return c}var f=a("typedarray-pool"),g=a("invert-permutation");c.rank=d,c.unrank=e},{"invert-permutation":223,"typedarray-pool":233}],223:[function(a,b,c){"use strict";function d(a,b){b=b||new Array(a.length);for(var c=0;c<a.length;++c)b[a[c]]=c;return b}b.exports=d},{}],224:[function(a,b,c){"use strict";function d(a){if(0>a)return[];if(0===a)return[[0]];for(var b=0|Math.round(g(a+1)),c=[],d=0;b>d;++d){for(var h=e.unrank(a,d),i=[0],j=0,k=0;k<h.length;++k)j+=1<<h[k],i.push(j);f(h)<1&&(i[0]=j,i[a]=0),c.push(i)}return c}b.exports=d;var e=a("permutation-rank"),f=a("permutation-parity"),g=a("gamma")},{gamma:220,"permutation-parity":221,"permutation-rank":222}],225:[function(a,b,c){b.exports=a("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":66}],226:[function(a,b,c){"use strict";function d(a,b){var c=[];return b=+b||0,e(a.hi(a.shape[0]-1),c,b),c}b.exports=d;var e=a("./lib/zc-core")},{"./lib/zc-core":225}],227:[function(a,b,c){"use strict";function d(a,b){var c=a.length,d=["'use strict';"],e="surfaceNets"+a.join("_")+"d"+b;d.push("var contour=genContour({","order:[",a.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===b&&d.push("getters:[0],");for(var f=[],i=[],j=0;c>j;++j)f.push("d"+j),i.push("d"+j);for(var j=0;1<<c>j;++j)f.push("v"+j),i.push("v"+j);for(var j=0;1<<c>j;++j)f.push("p"+j),i.push("p"+j);f.push("a","b","c"),i.push("a","c"),d.push("vertex:function vertexFunc(",f.join(),"){");for(var k=[],j=0;1<<c>j;++j)k.push("(p"+j+"<<"+j+")");d.push("var m=(",k.join("+"),")|0;if(m===0||m===",(1<<(1<<c))-1,"){return}");var l=[],m=[];128>=1<<(1<<c)?(d.push("switch(m){"),m=d):d.push("switch(m>>>7){");for(var j=0;1<<(1<<c)>j;++j){if(1<<(1<<c)>128&&j%128===0){l.length>0&&m.push("}}");var n="vExtra"+l.length;d.push("case ",j>>>7,":",n,"(m&0x7f,",i.join(),");break;"),m=["function ",n,"(m,",i.join(),"){switch(m){"],l.push(m)}m.push("case ",127&j,":");for(var o=new Array(c),p=new Array(c),q=new Array(c),r=new Array(c),s=0,t=0;c>t;++t)o[t]=[],p[t]=[],q[t]=0,r[t]=0;for(var t=0;1<<c>t;++t)for(var u=0;c>u;++u){var v=t^1<<u;if(!(v>t)&&!(j&1<<v)!=!(j&1<<t)){var w=1;j&1<<v?p[u].push("v"+v+"-v"+t):(p[u].push("v"+t+"-v"+v),w=-w),0>w?(o[u].push("-v"+t+"-v"+v),q[u]+=2):(o[u].push("v"+t+"+v"+v),q[u]-=2),s+=1;for(var x=0;c>x;++x)x!==u&&(v&1<<x?r[x]+=1:r[x]-=1)}}for(var y=[],u=0;c>u;++u)if(0===o[u].length)y.push("d"+u+"-0.5");else{var z="";q[u]<0?z=q[u]+"*c":q[u]>0&&(z="+"+q[u]+"*c");var A=.5*(o[u].length/s),B=.5+.5*(r[u]/s);y.push("d"+u+"-"+B+"-"+A+"*("+o[u].join("+")+z+")/("+p[u].join("+")+")")}m.push("a.push([",y.join(),"]);","break;")}d.push("}},"),l.length>0&&m.push("}}");for(var C=[],j=0;1<<c-1>j;++j)C.push("v"+j);C.push("c0","c1","p0","p1","a","b","c"),d.push("cell:function cellFunc(",C.join(),"){");var D=h(c-1);d.push("if(p0){b.push(",D.map(function(a){return"["+a.map(function(a){return"v"+a})+"]"}).join(),")}else{b.push(",D.map(function(a){var b=a.slice();return b.reverse(),"["+b.map(function(a){return"v"+a})+"]"}).join(),")}}});function ",e,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",e,";");for(var j=0;j<l.length;++j)d.push(l[j].join(""));var E=new Function("genContour",d.join(""));return E(g)}function e(a,b){for(var c=i(a,b),d=c.length,e=new Array(d),f=new Array(d),g=0;d>g;++g)e[g]=[c[g]],f[g]=[g];return{positions:e,cells:f}}function f(a,b){if(a.dimension<=0)return{positions:[],cells:[]};if(1===a.dimension)return e(a,b);var c=a.order.join()+"-"+a.dtype,f=j[c],b=+b||0;return f||(f=j[c]=d(a.order,a.dtype)),f(a,b)}b.exports=f;var g=a("ndarray-extract-contour"),h=a("triangulate-hypercube"),i=a("zero-crossings"),j={}},{"ndarray-extract-contour":219,"triangulate-hypercube":224,"zero-crossings":226}],228:[function(a,b,c){(function(c){"use strict";function d(a){for(var b=a.cells,c=a.positions,d=new Float32Array(6*b.length),e=0,f=0,g=0;g<b.length;++g)for(var h=b[g],i=0;3>i;++i){var j=c[h[i]];d[e++]=j[0],d[e++]=j[1]+1.4,f=Math.max(j[0],f)}return{data:d,shape:f}}function e(a,b){var c=h[a];c||(c=h[a]={" ":{data:new Float32Array(0),shape:.2}});var g=c[b];if(!g)if(b.length<=1||!/\d/.test(b))g=c[b]=d(f(b,{triangles:!0,font:a,textAlign:"left",textBaseline:"alphabetic"}));else{for(var i=b.split(/(\d|\s)/),j=new Array(i.length),k=0,l=0,m=0;m<i.length;++m)j[m]=e(a,i[m]),k+=j[m].data.length,l+=j[m].shape,m>0&&(l+=.02);for(var n=new Float32Array(k),o=0,p=-.5*l,m=0;m<j.length;++m){for(var q=j[m].data,r=0;r<q.length;r+=2)n[o++]=q[r]+p,n[o++]=q[r+1];p+=j[m].shape+.02}g=c[b]={data:n,shape:l}}return g}b.exports=e;var f=a("vectorize-text"),g=window||c.global||{},h=g.__TEXT_CACHE||{};g.__TEXT_CACHE={}}).call(this,a("_process"))},{_process:55,"vectorize-text":235}],229:[function(b,c,d){!function(){function b(a,c){if(a=a?a:"",c=c||{},a instanceof b)return a;if(!(this instanceof b))return new b(a,c);var e=d(a);this._originalInput=a,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=P(100*this._a)/100,this._format=c.format||e.format,this._gradientType=c.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=e.ok,this._tc_id=N++}function d(a){var b={r:0,g:0,b:0},c=1,d=!1,f=!1;return"string"==typeof a&&(a=J(a)),"object"==typeof a&&(a.hasOwnProperty("r")&&a.hasOwnProperty("g")&&a.hasOwnProperty("b")?(b=e(a.r,a.g,a.b),d=!0,f="%"===String(a.r).substr(-1)?"prgb":"rgb"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("v")?(a.s=G(a.s),a.v=G(a.v),b=i(a.h,a.s,a.v),d=!0,f="hsv"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("l")&&(a.s=G(a.s),a.l=G(a.l),b=g(a.h,a.s,a.l),d=!0,f="hsl"),a.hasOwnProperty("a")&&(c=a.a)),c=z(c),{ok:d,format:a.format||f,r:Q(255,R(b.r,0)),g:Q(255,R(b.g,0)),b:Q(255,R(b.b,0)),a:c}}function e(a,b,c){return{r:255*A(a,255),g:255*A(b,255),b:255*A(c,255)}}function f(a,b,c){a=A(a,255),b=A(b,255),c=A(c,255);var d,e,f=R(a,b,c),g=Q(a,b,c),h=(f+g)/2;if(f==g)d=e=0;else{var i=f-g;switch(e=h>.5?i/(2-f-g):i/(f+g),f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,l:h}}function g(a,b,c){function d(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+(b-a)*(2/3-c)*6:a}var e,f,g;if(a=A(a,360),b=A(b,100),c=A(c,100),0===b)e=f=g=c;else{var h=.5>c?c*(1+b):c+b-c*b,i=2*c-h;e=d(i,h,a+1/3),f=d(i,h,a),g=d(i,h,a-1/3)}return{r:255*e,g:255*f,b:255*g}}function h(a,b,c){a=A(a,255),b=A(b,255),c=A(c,255);var d,e,f=R(a,b,c),g=Q(a,b,c),h=f,i=f-g;if(e=0===f?0:i/f,f==g)d=0;else{switch(f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,v:h}}function i(a,b,c){a=6*A(a,360),b=A(b,100),c=A(c,100);var d=O.floor(a),e=a-d,f=c*(1-b),g=c*(1-e*b),h=c*(1-(1-e)*b),i=d%6,j=[c,g,f,f,h,c][i],k=[h,c,c,g,f,f][i],l=[f,f,h,c,c,g][i];return{r:255*j,g:255*k,b:255*l}}function j(a,b,c,d){var e=[F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16))];return d&&e[0].charAt(0)==e[0].charAt(1)&&e[1].charAt(0)==e[1].charAt(1)&&e[2].charAt(0)==e[2].charAt(1)?e[0].charAt(0)+e[1].charAt(0)+e[2].charAt(0):e.join("")}function k(a,b,c,d){var e=[F(H(d)),F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16))];return e.join("")}function l(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s-=c/100,d.s=B(d.s),b(d)}function m(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s+=c/100,d.s=B(d.s),b(d)}function n(a){return b(a).desaturate(100)}function o(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l+=c/100,d.l=B(d.l),b(d)}function p(a,c){c=0===c?0:c||10;var d=b(a).toRgb();return d.r=R(0,Q(255,d.r-P(255*-(c/100)))),d.g=R(0,Q(255,d.g-P(255*-(c/100)))),d.b=R(0,Q(255,d.b-P(255*-(c/100)))),b(d)}function q(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l-=c/100,d.l=B(d.l),b(d)}function r(a,c){var d=b(a).toHsl(),e=(P(d.h)+c)%360;return d.h=0>e?360+e:e,b(d)}function s(a){var c=b(a).toHsl();return c.h=(c.h+180)%360,b(c)}function t(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+120)%360,s:c.s,l:c.l}),b({h:(d+240)%360,s:c.s,l:c.l})]}function u(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+90)%360,s:c.s,l:c.l}),b({h:(d+180)%360,s:c.s,l:c.l}),b({h:(d+270)%360,s:c.s,l:c.l})]}function v(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+72)%360,s:c.s,l:c.l}),b({h:(d+216)%360,s:c.s,l:c.l})]}function w(a,c,d){c=c||6,d=d||30;var e=b(a).toHsl(),f=360/d,g=[b(a)];for(e.h=(e.h-(f*c>>1)+720)%360;--c;)e.h=(e.h+f)%360,g.push(b(e));return g}function x(a,c){c=c||6;for(var d=b(a).toHsv(),e=d.h,f=d.s,g=d.v,h=[],i=1/c;c--;)h.push(b({h:e,s:f,v:g})),g=(g+i)%1;return h}function y(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}function z(a){return a=parseFloat(a),(isNaN(a)||0>a||a>1)&&(a=1),a}function A(a,b){D(a)&&(a="100%");var c=E(a);return a=Q(b,R(0,parseFloat(a))),c&&(a=parseInt(a*b,10)/100),O.abs(a-b)<1e-6?1:a%b/parseFloat(b)}function B(a){return Q(1,R(0,a))}function C(a){return parseInt(a,16)}function D(a){return"string"==typeof a&&-1!=a.indexOf(".")&&1===parseFloat(a)}function E(a){return"string"==typeof a&&-1!=a.indexOf("%")}function F(a){return 1==a.length?"0"+a:""+a}function G(a){return 1>=a&&(a=100*a+"%"),a}function H(a){return Math.round(255*parseFloat(a)).toString(16)}function I(a){return C(a)/255}function J(a){a=a.replace(L,"").replace(M,"").toLowerCase();var b=!1;if(T[a])a=T[a],b=!0;else if("transparent"==a)return{r:0,g:0,b:0,a:0,format:"name"};var c;return(c=V.rgb.exec(a))?{r:c[1],g:c[2],b:c[3]}:(c=V.rgba.exec(a))?{r:c[1],g:c[2],b:c[3],a:c[4]}:(c=V.hsl.exec(a))?{h:c[1],s:c[2],l:c[3]}:(c=V.hsla.exec(a))?{h:c[1],s:c[2],l:c[3],a:c[4]}:(c=V.hsv.exec(a))?{h:c[1],s:c[2],v:c[3]}:(c=V.hsva.exec(a))?{h:c[1],s:c[2],v:c[3],a:c[4]}:(c=V.hex8.exec(a))?{a:I(c[1]),r:C(c[2]),g:C(c[3]),b:C(c[4]),format:b?"name":"hex8"}:(c=V.hex6.exec(a))?{r:C(c[1]),g:C(c[2]),b:C(c[3]),format:b?"name":"hex"}:(c=V.hex3.exec(a))?{r:C(c[1]+""+c[1]),g:C(c[2]+""+c[2]),b:C(c[3]+""+c[3]),format:b?"name":"hex"}:!1}function K(a){var b,c;return a=a||{level:"AA",size:"small"},b=(a.level||"AA").toUpperCase(),c=(a.size||"small").toLowerCase(),"AA"!==b&&"AAA"!==b&&(b="AA"),"small"!==c&&"large"!==c&&(c="small"),{level:b,size:c}}var L=/^\s+/,M=/\s+$/,N=0,O=Math,P=O.round,Q=O.min,R=O.max,S=O.random;b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var a=this.toRgb();return(299*a.r+587*a.g+114*a.b)/1e3},getLuminance:function(){var a,b,c,d,e,f,g=this.toRgb();return a=g.r/255,b=g.g/255,c=g.b/255,d=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),e=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),f=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*d+.7152*e+.0722*f},setAlpha:function(a){return this._a=z(a),this._roundA=P(100*this._a)/100,this},toHsv:function(){var a=h(this._r,this._g,this._b);return{h:360*a.h,s:a.s,v:a.v,a:this._a}},toHsvString:function(){var a=h(this._r,this._g,this._b),b=P(360*a.h),c=P(100*a.s),d=P(100*a.v);return 1==this._a?"hsv("+b+", "+c+"%, "+d+"%)":"hsva("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHsl:function(){var a=f(this._r,this._g,this._b);return{h:360*a.h,s:a.s,l:a.l,a:this._a}},toHslString:function(){var a=f(this._r,this._g,this._b),b=P(360*a.h),c=P(100*a.s),d=P(100*a.l);return 1==this._a?"hsl("+b+", "+c+"%, "+d+"%)":"hsla("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHex:function(a){return j(this._r,this._g,this._b,a)},toHexString:function(a){return"#"+this.toHex(a)},toHex8:function(){return k(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(100*A(this._r,255))+"%",g:P(100*A(this._g,255))+"%",b:P(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+P(100*A(this._r,255))+"%, "+P(100*A(this._g,255))+"%, "+P(100*A(this._b,255))+"%)":"rgba("+P(100*A(this._r,255))+"%, "+P(100*A(this._g,255))+"%, "+P(100*A(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:U[j(this._r,this._g,this._b,!0)]||!1},toFilter:function(a){var c="#"+k(this._r,this._g,this._b,this._a),d=c,e=this._gradientType?"GradientType = 1, ":"";if(a){var f=b(a);d=f.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+e+"startColorstr="+c+",endColorstr="+d+")"},toString:function(a){var b=!!a;a=a||this._format;var c=!1,d=this._a<1&&this._a>=0,e=!b&&d&&("hex"===a||"hex6"===a||"hex3"===a||"name"===a);return e?"name"===a&&0===this._a?this.toName():this.toRgbString():("rgb"===a&&(c=this.toRgbString()),"prgb"===a&&(c=this.toPercentageRgbString()),"hex"!==a&&"hex6"!==a||(c=this.toHexString()),"hex3"===a&&(c=this.toHexString(!0)),"hex8"===a&&(c=this.toHex8String()),"name"===a&&(c=this.toName()),"hsl"===a&&(c=this.toHslString()),"hsv"===a&&(c=this.toHsvString()),c||this.toHexString())},clone:function(){return b(this.toString())},_applyModification:function(a,b){var c=a.apply(null,[this].concat([].slice.call(b)));return this._r=c._r,this._g=c._g,this._b=c._b,this.setAlpha(c._a),this},lighten:function(){return this._applyModification(o,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(q,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(n,arguments)},spin:function(){return this._applyModification(r,arguments)},_applyCombination:function(a,b){return a.apply(null,[this].concat([].slice.call(b)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(s,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(t,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},b.fromRatio=function(a,c){if("object"==typeof a){var d={};for(var e in a)a.hasOwnProperty(e)&&("a"===e?d[e]=a[e]:d[e]=G(a[e]));a=d}return b(a,c)},b.equals=function(a,c){return a&&c?b(a).toRgbString()==b(c).toRgbString():!1},b.random=function(){return b.fromRatio({r:S(),g:S(),b:S()})},b.mix=function(a,c,d){d=0===d?0:d||50;var e,f=b(a).toRgb(),g=b(c).toRgb(),h=d/100,i=2*h-1,j=g.a-f.a;e=i*j==-1?i:(i+j)/(1+i*j),e=(e+1)/2;var k=1-e,l={r:g.r*e+f.r*k,g:g.g*e+f.g*k,b:g.b*e+f.b*k,a:g.a*h+f.a*(1-h)};return b(l)},b.readability=function(a,c){var d=b(a),e=b(c);return(Math.max(d.getLuminance(),e.getLuminance())+.05)/(Math.min(d.getLuminance(),e.getLuminance())+.05)},b.isReadable=function(a,c,d){var e,f,g=b.readability(a,c);switch(f=!1,e=K(d),e.level+e.size){case"AAsmall":case"AAAlarge":f=g>=4.5;break;case"AAlarge":f=g>=3;break;case"AAAsmall":f=g>=7}return f},b.mostReadable=function(a,c,d){var e,f,g,h,i=null,j=0;d=d||{},f=d.includeFallbackColors,g=d.level,h=d.size;for(var k=0;k<c.length;k++)e=b.readability(a,c[k]),e>j&&(j=e,i=b(c[k]));return b.isReadable(a,i,{level:g,size:h})||!f?i:(d.includeFallbackColors=!1,b.mostReadable(a,["#fff","#000"],d))};var T=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000", 41 greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=b.hexNames=y(T),V=function(){var a="[-\\+]?\\d+%?",b="[-\\+]?\\d*\\.\\d+%?",c="(?:"+b+")|(?:"+a+")",d="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?",e="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?";return{rgb:new RegExp("rgb"+d),rgba:new RegExp("rgba"+e),hsl:new RegExp("hsl"+d),hsla:new RegExp("hsla"+e),hsv:new RegExp("hsv"+d),hsva:new RegExp("hsva"+e),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof c&&c.exports?c.exports=b:"function"==typeof a&&a.amd?a(function(){return b}):window.tinycolor=b}()},{}],230:[function(b,c,d){!function(){function b(a,b){function c(b){var c,d=a.arcs[0>b?~b:b],e=d[0];return a.transform?(c=[0,0],d.forEach(function(a){c[0]+=a[0],c[1]+=a[1]})):c=d[d.length-1],0>b?[c,e]:[e,c]}function d(a,b){for(var c in a){var d=a[c];delete b[d.start],delete d.start,delete d.end,d.forEach(function(a){e[0>a?~a:a]=1}),h.push(d)}}var e={},f={},g={},h=[],i=-1;return b.forEach(function(c,d){var e,f=a.arcs[0>c?~c:c];f.length<3&&!f[1][0]&&!f[1][1]&&(e=b[++i],b[i]=c,b[d]=e)}),b.forEach(function(a){var b,d,e=c(a),h=e[0],i=e[1];if(b=g[h])if(delete g[b.end],b.push(a),b.end=i,d=f[i]){delete f[d.start];var j=d===b?b:b.concat(d);f[j.start=b.start]=g[j.end=d.end]=j}else f[b.start]=g[b.end]=b;else if(b=f[i])if(delete f[b.start],b.unshift(a),b.start=h,d=g[h]){delete g[d.end];var k=d===b?b:d.concat(b);f[k.start=d.start]=g[k.end=b.end]=k}else f[b.start]=g[b.end]=b;else b=[a],f[b.start=h]=g[b.end=i]=b}),d(g,f),d(f,g),b.forEach(function(a){e[0>a?~a:a]||h.push([a])}),h}function d(a,c,d){function e(a){var b=0>a?~a:a;(k[b]||(k[b]=[])).push({i:a,g:j})}function f(a){a.forEach(e)}function g(a){a.forEach(f)}function h(a){"GeometryCollection"===a.type?a.geometries.forEach(h):a.type in l&&(j=a,l[a.type](a.arcs))}var i=[];if(arguments.length>1){var j,k=[],l={LineString:f,MultiLineString:g,Polygon:g,MultiPolygon:function(a){a.forEach(g)}};h(c),k.forEach(arguments.length<3?function(a){i.push(a[0].i)}:function(a){d(a[0].g,a[a.length-1].g)&&i.push(a[0].i)})}else for(var m=0,n=a.arcs.length;n>m;++m)i.push(m);return{type:"MultiLineString",arcs:b(a,i)}}function e(a,c){function d(a){a.forEach(function(b){b.forEach(function(b){(f[b=0>b?~b:b]||(f[b]=[])).push(a)})}),g.push(a)}function e(b){return m(h(a,{type:"Polygon",arcs:[b]}).coordinates[0])>0}var f={},g=[],i=[];return c.forEach(function(a){"Polygon"===a.type?d(a.arcs):"MultiPolygon"===a.type&&a.arcs.forEach(d)}),g.forEach(function(a){if(!a._){var b=[],c=[a];for(a._=1,i.push(b);a=c.pop();)b.push(a),a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].forEach(function(a){a._||(a._=1,c.push(a))})})})}}),g.forEach(function(a){delete a._}),{type:"MultiPolygon",arcs:i.map(function(c){var d,g=[];if(c.forEach(function(a){a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].length<2&&g.push(a)})})}),g=b(a,g),(d=g.length)>1)for(var h,i=e(c[0][0]),j=0;d>j;++j)if(i===e(g[j])){h=g[0],g[0]=g[j],g[j]=h;break}return g})}}function f(a,b){return"GeometryCollection"===b.type?{type:"FeatureCollection",features:b.geometries.map(function(b){return g(a,b)})}:g(a,b)}function g(a,b){var c={type:"Feature",id:b.id,properties:b.properties||{},geometry:h(a,b)};return null==b.id&&delete c.id,c}function h(a,b){function c(a,b){b.length&&b.pop();for(var c,d=k[0>a?~a:a],e=0,f=d.length;f>e;++e)b.push(c=d[e].slice()),j(c,e);0>a&&i(b,f)}function d(a){return a=a.slice(),j(a,0),a}function e(a){for(var b=[],d=0,e=a.length;e>d;++d)c(a[d],b);return b.length<2&&b.push(b[0].slice()),b}function f(a){for(var b=e(a);b.length<4;)b.push(b[0].slice());return b}function g(a){return a.map(f)}function h(a){var b=a.type;return"GeometryCollection"===b?{type:b,geometries:a.geometries.map(h)}:b in l?{type:b,coordinates:l[b](a)}:null}var j=q(a.transform),k=a.arcs,l={Point:function(a){return d(a.coordinates)},MultiPoint:function(a){return a.coordinates.map(d)},LineString:function(a){return e(a.arcs)},MultiLineString:function(a){return a.arcs.map(e)},Polygon:function(a){return g(a.arcs)},MultiPolygon:function(a){return a.arcs.map(g)}};return h(b)}function i(a,b){for(var c,d=a.length,e=d-b;e<--d;)c=a[e],a[e++]=a[d],a[d]=c}function j(a,b){for(var c=0,d=a.length;d>c;){var e=c+d>>>1;a[e]<b?c=e+1:d=e}return c}function k(a){function b(a,b){a.forEach(function(a){0>a&&(a=~a);var c=e[a];c?c.push(b):e[a]=[b]})}function c(a,c){a.forEach(function(a){b(a,c)})}function d(a,b){"GeometryCollection"===a.type?a.geometries.forEach(function(a){d(a,b)}):a.type in g&&g[a.type](a.arcs,b)}var e={},f=a.map(function(){return[]}),g={LineString:b,MultiLineString:c,Polygon:c,MultiPolygon:function(a,b){a.forEach(function(a){c(a,b)})}};a.forEach(d);for(var h in e)for(var i=e[h],k=i.length,l=0;k>l;++l)for(var m=l+1;k>m;++m){var n,o=i[l],p=i[m];(n=f[o])[h=j(n,p)]!==p&&n.splice(h,0,p),(n=f[p])[h=j(n,o)]!==o&&n.splice(h,0,o)}return f}function l(a,b){function c(a){f.remove(a),a[1][2]=b(a),f.push(a)}var d=q(a.transform),e=r(a.transform),f=p();return b||(b=n),a.arcs.forEach(function(a){for(var g,h,i=[],j=0,k=0,l=a.length;l>k;++k)h=a[k],d(a[k]=[h[0],h[1],1/0],k);for(var k=1,l=a.length-1;l>k;++k)g=a.slice(k-1,k+2),g[1][2]=b(g),i.push(g),f.push(g);for(var k=0,l=i.length;l>k;++k)g=i[k],g.previous=i[k-1],g.next=i[k+1];for(;g=f.pop();){var m=g.previous,n=g.next;g[1][2]<j?g[1][2]=j:j=g[1][2],m&&(m.next=n,m[2]=g[2],c(m)),n&&(n.previous=m,n[0]=g[0],c(n))}a.forEach(e)}),a}function m(a){for(var b,c=-1,d=a.length,e=a[d-1],f=0;++c<d;)b=e,e=a[c],f+=b[0]*e[1]-b[1]*e[0];return f/2}function n(a){var b=a[0],c=a[1],d=a[2];return Math.abs((b[0]-d[0])*(c[1]-b[1])-(b[0]-c[0])*(d[1]-b[1]))}function o(a,b){return a[1][2]-b[1][2]}function p(){function a(a,b){for(;b>0;){var c=(b+1>>1)-1,e=d[c];if(o(a,e)>=0)break;d[e._=b]=e,d[a._=b=c]=a}}function b(a,b){for(;;){var c=b+1<<1,f=c-1,g=b,h=d[g];if(e>f&&o(d[f],h)<0&&(h=d[g=f]),e>c&&o(d[c],h)<0&&(h=d[g=c]),g===b)break;d[h._=b]=h,d[a._=b=g]=a}}var c={},d=[],e=0;return c.push=function(b){return a(d[b._=e]=b,e++),e},c.pop=function(){if(!(0>=e)){var a,c=d[0];return--e>0&&(a=d[e],b(d[a._=0]=a,0)),c}},c.remove=function(c){var f,g=c._;if(d[g]===c)return g!==--e&&(f=d[e],(o(f,c)<0?a:b)(d[f._=g]=f,g)),g},c}function q(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0),a[0]=(b+=a[0])*d+f,a[1]=(c+=a[1])*e+g}}function r(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0);var i=(a[0]-f)/d|0,j=(a[1]-g)/e|0;a[0]=i-b,a[1]=j-c,b=i,c=j}}function s(){}var t={version:"1.6.20",mesh:function(a){return h(a,d.apply(this,arguments))},meshArcs:d,merge:function(a){return h(a,e.apply(this,arguments))},mergeArcs:e,feature:f,neighbors:k,presimplify:l};"function"==typeof a&&a.amd?a(t):"object"==typeof c&&c.exports?c.exports=t:this.topojson=t}()},{}],231:[function(a,b,c){"use strict";function d(a,b,c){var d=a*b,f=e*a,g=f-a,h=f-g,i=a-h,j=e*b,k=j-b,l=j-k,m=b-l,n=d-h*l,o=n-i*l,p=o-h*m,q=i*m-p;return c?(c[0]=q,c[1]=d,c):[q,d]}b.exports=d;var e=+(Math.pow(2,27)+1)},{}],232:[function(a,b,c){"use strict";function d(a,b,c){var d=a+b,e=d-a,f=d-e,g=b-e,h=a-f;return c?(c[0]=h+g,c[1]=d,c):[h+g,d]}b.exports=d},{}],233:[function(a,b,c){(function(b,d){"use strict";function e(a){if(a){var b=a.length||a.byteLength,c=s.log2(b);w[c].push(a)}}function f(a){e(a.buffer)}function g(a){var a=s.nextPow2(a),b=s.log2(a),c=w[b];return c.length>0?c.pop():new ArrayBuffer(a)}function h(a){return new Uint8Array(g(a),0,a)}function i(a){return new Uint16Array(g(2*a),0,a)}function j(a){return new Uint32Array(g(4*a),0,a)}function k(a){return new Int8Array(g(a),0,a)}function l(a){return new Int16Array(g(2*a),0,a)}function m(a){return new Int32Array(g(4*a),0,a)}function n(a){return new Float32Array(g(4*a),0,a)}function o(a){return new Float64Array(g(8*a),0,a)}function p(a){return u?new Uint8ClampedArray(g(a),0,a):h(a)}function q(a){return new DataView(g(a),0,a)}function r(a){a=s.nextPow2(a);var b=s.log2(a),c=x[b];return c.length>0?c.pop():new d(a)}var s=a("bit-twiddle"),t=a("dup");b.__TYPEDARRAY_POOL||(b.__TYPEDARRAY_POOL={UINT8:t([32,0]),UINT16:t([32,0]),UINT32:t([32,0]),INT8:t([32,0]),INT16:t([32,0]),INT32:t([32,0]),FLOAT:t([32,0]),DOUBLE:t([32,0]),DATA:t([32,0]),UINT8C:t([32,0]),BUFFER:t([32,0])});var u="undefined"!=typeof Uint8ClampedArray,v=b.__TYPEDARRAY_POOL;v.UINT8C||(v.UINT8C=t([32,0])),v.BUFFER||(v.BUFFER=t([32,0]));var w=v.DATA,x=v.BUFFER;c.free=function(a){if(d.isBuffer(a))x[s.log2(a.length)].push(a);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(a)&&(a=a.buffer),!a)return;var b=a.length||a.byteLength,c=0|s.log2(b);w[c].push(a)}},c.freeUint8=c.freeUint16=c.freeUint32=c.freeInt8=c.freeInt16=c.freeInt32=c.freeFloat32=c.freeFloat=c.freeFloat64=c.freeDouble=c.freeUint8Clamped=c.freeDataView=f,c.freeArrayBuffer=e,c.freeBuffer=function(a){x[s.log2(a.length)].push(a)},c.malloc=function(a,b){if(void 0===b||"arraybuffer"===b)return g(a);switch(b){case"uint8":return h(a);case"uint16":return i(a);case"uint32":return j(a);case"int8":return k(a);case"int16":return l(a);case"int32":return m(a);case"float":case"float32":return n(a);case"double":case"float64":return o(a);case"uint8_clamped":return p(a);case"buffer":return r(a);case"data":case"dataview":return q(a);default:return null}return null},c.mallocArrayBuffer=g,c.mallocUint8=h,c.mallocUint16=i,c.mallocUint32=j,c.mallocInt8=k,c.mallocInt16=l,c.mallocInt32=m,c.mallocFloat32=c.mallocFloat=n,c.mallocFloat64=c.mallocDouble=o,c.mallocUint8Clamped=p,c.mallocDataView=q,c.mallocBuffer=r,c.clearCache=function(){for(var a=0;32>a;++a)v.UINT8[a].length=0,v.UINT16[a].length=0,v.UINT32[a].length=0,v.INT8[a].length=0,v.INT16[a].length=0,v.INT32[a].length=0,v.FLOAT[a].length=0,v.DOUBLE[a].length=0,v.UINT8C[a].length=0,w[a].length=0,x[a].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"bit-twiddle":49,buffer:50,dup:72}],234:[function(a,b,c){"use strict";function d(a,b){for(var c=1,d=a.length,e=a[0],f=a[0],g=1;d>g;++g)if(f=e,e=a[g],b(e,f)){if(g===c){c++;continue}a[c++]=e}return a.length=c,a}function e(a){for(var b=1,c=a.length,d=a[0],e=a[0],f=1;c>f;++f,e=d)if(e=d,d=a[f],d!==e){if(f===b){b++;continue}a[b++]=d}return a.length=b,a}function f(a,b,c){return 0===a.length?a:b?(c||a.sort(b),d(a,b)):(c||a.sort(),e(a))}b.exports=f},{}],235:[function(a,b,c){"use strict";function d(a,b){return"object"==typeof b&&null!==b||(b={}),e(a,b.canvas||f,b.context||g,b)}b.exports=d;var e=a("./lib/vtext"),f=null,g=null;"undefined"!=typeof document&&(f=document.createElement("canvas"),f.width=8192,f.height=1024,g=f.getContext("2d"))},{"./lib/vtext":236}],236:[function(a,b,c){"use strict";function d(a,b,c){for(var d=b.textAlign||"start",e=b.textBaseline||"alphabetic",f=[1<<30,1<<30],g=[0,0],h=a.length,i=0;h>i;++i)for(var j=a[i],k=0;2>k;++k)f[k]=0|Math.min(f[k],j[k]),g[k]=0|Math.max(g[k],j[k]);var l=0;switch(d){case"center":l=-.5*(f[0]+g[0]);break;case"right":case"end":l=-g[0];break;case"left":case"start":l=-f[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+d+"'")}var m=0;switch(e){case"hanging":case"top":m=-f[1];break;case"middle":m=-.5*(f[1]+g[1]);break;case"alphabetic":case"ideographic":m=-3*c;break;case"bottom":m=-g[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+e+"'")}var n=1/c;return"lineHeight"in b?n*=+b.lineHeight:"width"in b?n=b.width/(g[0]-f[0]):"height"in b&&(n=b.height/(g[1]-f[1])),a.map(function(a){return[n*(a[0]+l),n*(a[1]+m)]})}function e(a,b,c,d){var e=0|Math.ceil(b.measureText(c).width+2*d);if(e>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var f=3*d;a.height<f&&(a.height=f),b.fillStyle="#000",b.fillRect(0,0,a.width,a.height),b.fillStyle="#fff",b.fillText(c,d,2*d);var g=b.getImageData(0,0,e,f),h=k(g.data,[f,e,4]);return h.pick(-1,-1,0).transpose(1,0)}function f(a,b){var c=j(a,128);return b?l(c.cells,c.positions,.25):{edges:c.cells,positions:c.positions}}function g(a,b,c,e){var g=f(a,e),h=d(g.positions,b,c),i=g.edges,j="ccw"===b.orientation;if(m(h,i),b.polygons||b.polygon||b.polyline){for(var k=o(i,h),l=new Array(k.length),p=0;p<k.length;++p){for(var q=k[p],r=new Array(q.length),s=0;s<q.length;++s){for(var t=q[s],u=new Array(t.length),v=0;v<t.length;++v)u[v]=h[t[v]].slice();j&&u.reverse(),r[s]=u}l[p]=r}return l}return b.triangles||b.triangulate||b.triangle?{cells:n(h,i,{delaunay:!1,exterior:!1,interior:!0}),positions:h}:{edges:i,positions:h}}function h(a,b,c){try{return g(a,b,c,!0)}catch(d){}try{return g(a,b,c,!1)}catch(d){}return b.polygons||b.polyline||b.polygon?[]:b.triangles||b.triangulate||b.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function i(a,b,c,d){var f=d.size||64,g=d.font||"normal";c.font=f+"px "+g,c.textAlign="start",c.textBaseline="alphabetic",c.direction="ltr";var i=e(b,c,a,f);return h(i,d,f)}b.exports=i,b.exports.processPixels=h;var j=a("surface-nets"),k=a("ndarray"),l=a("simplify-planar-graph"),m=a("clean-pslg"),n=a("cdt2d"),o=a("planar-graph-to-polyline")},{cdt2d:237,"clean-pslg":244,ndarray:208,"planar-graph-to-polyline":290,"simplify-planar-graph":294,"surface-nets":227}],237:[function(a,b,c){"use strict";function d(a){return[Math.min(a[0],a[1]),Math.max(a[0],a[1])]}function e(a,b){return a[0]-b[0]||a[1]-b[1]}function f(a){return a.map(d).sort(e)}function g(a,b,c){return b in a?a[b]:c}function h(a,b,c){Array.isArray(b)?(c=c||{},b=b||[]):(c=b||{},b=[]);var d=!!g(c,"delaunay",!0),e=!!g(c,"interior",!0),h=!!g(c,"exterior",!0),m=!!g(c,"infinity",!1);if(!e&&!h||0===a.length)return[];var n=i(a,b);if(d||e!==h||m){for(var o=j(a.length,f(b)),p=0;p<n.length;++p){var q=n[p];o.addTriangle(q[0],q[1],q[2])}return d&&k(a,o),h?e?m?l(o,0,m):o.cells():l(o,1,m):l(o,-1)}return n}var i=a("./lib/monotone"),j=a("./lib/triangulation"),k=a("./lib/delaunay"),l=a("./lib/filter");b.exports=h},{"./lib/delaunay":238,"./lib/filter":239,"./lib/monotone":240,"./lib/triangulation":241}],238:[function(a,b,c){"use strict";function d(a,b,c,d,e,g){var h=b.opposite(d,e);if(!(0>h)){if(d>e){var i=d;d=e,e=i,i=g,g=h,h=i}b.isConstraint(d,e)||f(a[d],a[e],a[g],a[h])<0&&c.push(d,e)}}function e(a,b){for(var c=[],e=a.length,g=b.stars,h=0;e>h;++h)for(var i=g[h],j=1;j<i.length;j+=2){var k=i[j];if(!(h>k||b.isConstraint(h,k))){for(var l=i[j-1],m=-1,n=1;n<i.length;n+=2)if(i[n-1]===k){m=i[n];break}0>m||f(a[h],a[k],a[l],a[m])<0&&c.push(h,k)}}for(;c.length>0;){for(var k=c.pop(),h=c.pop(),l=-1,m=-1,i=g[h],o=1;o<i.length;o+=2){var p=i[o-1],q=i[o];p===k?m=q:q===k&&(l=p)}0>l||0>m||f(a[h],a[k],a[l],a[m])>=0||(b.flip(h,k),d(a,b,c,l,h,m),d(a,b,c,h,m,l),d(a,b,c,m,k,l),d(a,b,c,k,l,m))}}var f=a("robust-in-sphere")[4];a("binary-search-bounds");b.exports=e},{"binary-search-bounds":242,"robust-in-sphere":243}],239:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g){this.cells=a,this.neighbor=b,this.flags=d,this.constraint=c,this.active=e,this.next=f,this.boundary=g}function e(a,b){return a[0]-b[0]||a[1]-b[1]||a[2]-b[2]}function f(a,b){for(var c=a.cells(),f=c.length,g=0;f>g;++g){var h=c[g],i=h[0],j=h[1],k=h[2];k>j?i>j&&(h[0]=j,h[1]=k,h[2]=i):i>k&&(h[0]=k,h[1]=i,h[2]=j)}c.sort(e);for(var l=new Array(f),g=0;g<l.length;++g)l[g]=0;var m=[],n=[],o=new Array(3*f),p=new Array(3*f),q=null;b&&(q=[]);for(var r=new d(c,o,p,l,m,n,q),g=0;f>g;++g)for(var h=c[g],s=0;3>s;++s){var i=h[s],j=h[(s+1)%3],t=o[3*g+s]=r.locate(j,i,a.opposite(j,i)),u=p[3*g+s]=a.isConstraint(i,j);0>t&&(u?n.push(g):(m.push(g),l[g]=1),b&&q.push([j,i,-1]))}return r}function g(a,b,c){for(var d=0,e=0;e<a.length;++e)b[e]===c&&(a[d++]=a[e]);return a.length=d,a}function h(a,b,c){var d=f(a,c);if(0===b)return c?d.cells.concat(d.boundary):d.cells;for(var e=1,h=d.active,i=d.next,j=d.flags,k=d.cells,l=d.constraint,m=d.neighbor;h.length>0||i.length>0;){for(;h.length>0;){var n=h.pop();if(j[n]!==-e){j[n]=e;for(var o=(k[n],0);3>o;++o){var p=m[3*n+o];p>=0&&0===j[p]&&(l[3*n+o]?i.push(p):(h.push(p),j[p]=e))}}}var q=i;i=h,h=q,i.length=0,e=-e}var r=g(k,j,b);return c?r.concat(d.boundary):r}var i=a("binary-search-bounds");b.exports=h;var j=d.prototype;j.locate=function(){var a=[0,0,0];return function(b,c,d){var f=b,g=c,h=d;return d>c?b>c&&(f=c,g=d,h=b):b>d&&(f=d,g=b,h=c),0>f?-1:(a[0]=f,a[1]=g,a[2]=h,i.eq(this.cells,a,e))}}()},{"binary-search-bounds":242}],240:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.a=a,this.b=b,this.idx=c,this.lowerIds=d,this.upperIds=e}function e(a,b,c,d){this.a=a,this.b=b,this.type=c,this.idx=d}function f(a,b){var c=a.a[0]-b.a[0]||a.a[1]-b.a[1]||a.type-b.type;return c?c:a.type!==o&&(c=n(a.a,a.b,b.b))?c:a.idx-b.idx}function g(a,b){return n(a.a,a.b,b)}function h(a,b,c,d,e){for(var f=m.lt(b,d,g),h=m.gt(b,d,g),i=f;h>i;++i){for(var j=b[i],k=j.lowerIds,l=k.length;l>1&&n(c[k[l-2]],c[k[l-1]],d)>0;)a.push([k[l-1],k[l-2],e]),l-=1;k.length=l,k.push(e);for(var o=j.upperIds,l=o.length;l>1&&n(c[o[l-2]],c[o[l-1]],d)<0;)a.push([o[l-2],o[l-1],e]),l-=1;o.length=l,o.push(e)}}function i(a,b){var c;return(c=a.a[0]<b.a[0]?n(a.a,a.b,b.a):n(b.b,b.a,a.a))?c:(c=b.b[0]<a.b[0]?n(a.a,a.b,b.b):n(b.b,b.a,a.b),c||a.idx-b.idx)}function j(a,b,c){var e=m.le(a,c,i),f=a[e],g=f.upperIds,h=g[g.length-1];f.upperIds=[h],a.splice(e+1,0,new d(c.a,c.b,c.idx,[h],g))}function k(a,b,c){var d=c.a;c.a=c.b,c.b=d;var e=m.eq(a,c,i),f=a[e],g=a[e-1];g.upperIds=f.upperIds,a.splice(e,1)}function l(a,b){for(var c=a.length,g=b.length,i=[],l=0;c>l;++l)i.push(new e(a[l],null,o,l));for(var l=0;g>l;++l){var m=b[l],n=a[m[0]],r=a[m[1]];n[0]<r[0]?i.push(new e(n,r,q,l),new e(r,n,p,l)):n[0]>r[0]&&i.push(new e(r,n,q,l),new e(n,r,p,l))}i.sort(f);for(var s=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),t=[new d([s,1],[s,0],-1,[],[],[],[])],u=[],l=0,v=i.length;v>l;++l){var w=i[l],x=w.type;x===o?h(u,t,a,w.a,w.idx):x===q?j(t,a,w):k(t,a,w)}return u}var m=a("binary-search-bounds"),n=a("robust-orientation")[3],o=0,p=1,q=2;b.exports=l},{"binary-search-bounds":242,"robust-orientation":214}],241:[function(a,b,c){"use strict";function d(a,b){this.stars=a,this.edges=b}function e(a,b,c){for(var d=1,e=a.length;e>d;d+=2)if(a[d-1]===b&&a[d]===c)return a[d-1]=a[e-2],a[d]=a[e-1],void(a.length=e-2)}function f(a,b){for(var c=new Array(a),e=0;a>e;++e)c[e]=[];return new d(c,b)}var g=a("binary-search-bounds");b.exports=f;var h=d.prototype;h.isConstraint=function(){function a(a,b){return a[0]-b[0]||a[1]-b[1]}var b=[0,0];return function(c,d){return b[0]=Math.min(c,d),b[1]=Math.max(c,d),g.eq(this.edges,b,a)>=0}}(),h.removeTriangle=function(a,b,c){var d=this.stars;e(d[a],b,c),e(d[b],c,a),e(d[c],a,b)},h.addTriangle=function(a,b,c){var d=this.stars;d[a].push(b,c),d[b].push(c,a),d[c].push(a,b)},h.opposite=function(a,b){for(var c=this.stars[b],d=1,e=c.length;e>d;d+=2)if(c[d]===a)return c[d-1];return-1},h.flip=function(a,b){var c=this.opposite(a,b),d=this.opposite(b,a);this.removeTriangle(a,b,c),this.removeTriangle(b,a,d),this.addTriangle(a,d,c),this.addTriangle(b,c,d)},h.edges=function(){for(var a=this.stars,b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;f+=2)b.push([e[f],e[f+1]]);return b},h.cells=function(){for(var a=this.stars,b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;f+=2){var h=e[f],i=e[f+1];c<Math.min(h,i)&&b.push([c,h,i])}return b}},{"binary-search-bounds":242}],242:[function(a,b,c){arguments[4][121][0].apply(c,arguments)},{dup:121}],243:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m",d,"[",a-c-2,"]"].join("")}return b}function f(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",f(a.slice(0,b)),",",f(a.slice(b)),")"].join("")}function g(a,b){if("m"===a.charAt(0)){if("w"===b.charAt(0)){var c=a.split("[");return["w",b.substr(1),"m",c[0].substr(1)].join("")}return["prod(",a,",",b,")"].join("")}return g(b,a)}function h(a){return a&!0?"-":""}function i(a){if(2===a.length)return[["diff(",g(a[0][0],a[1][1]),",",g(a[1][0],a[0][1]),")"].join("")];for(var b=[],c=0;c<a.length;++c)b.push(["scale(",f(i(d(a,c))),",",h(c),a[0][c],")"].join(""));return b}function j(a,b){for(var c=[],d=0;b-2>d;++d)c.push(["prod(m",a,"[",d,"],m",a,"[",d,"])"].join(""));return f(c)}function k(a){for(var b=[],c=[],g=e(a),h=0;a>h;++h)g[0][h]="1",g[a-1][h]="w"+h;for(var h=0;a>h;++h)0===(1&h)?b.push.apply(b,i(d(g,h))):c.push.apply(c,i(d(g,h)));for(var k=f(b),l=f(c),m="exactInSphere"+a,n=[],h=0;a>h;++h)n.push("m"+h);for(var o=["function ",m,"(",n.join(),"){"],h=0;a>h;++h){o.push("var w",h,"=",j(h,a),";");for(var p=0;a>p;++p)p!==h&&o.push("var w",h,"m",p,"=scale(w",h,",m",p,"[0]);")}o.push("var p=",k,",n=",l,",d=diff(p,n);return d[d.length-1];}return ",m);var u=new Function("sum","diff","prod","scale",o.join(""));return u(r,s,q,t)}function l(){return 0}function m(){return 0}function n(){return 0}function o(a){var b=v[a.length];return b||(b=v[a.length]=k(a.length)),b.apply(void 0,a)}function p(){for(;v.length<=u;)v.push(k(v.length));for(var a=[],c=["slow"],d=0;u>=d;++d)a.push("a"+d),c.push("o"+d);for(var e=["function testInSphere(",a.join(),"){switch(arguments.length){case 0:case 1:return 0;"],d=2;u>=d;++d)e.push("case ",d,":return o",d,"(",a.slice(0,d).join(),");");e.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),c.push(e.join(""));var f=Function.apply(void 0,c);b.exports=f.apply(void 0,[o].concat(v));for(var d=0;u>=d;++d)b.exports[d]=v[d]}var q=a("two-product"),r=a("robust-sum"),s=a("robust-subtract"),t=a("robust-scale"),u=6,v=[l,m,n];p()},{"robust-scale":215,"robust-subtract":216,"robust-sum":217,"two-product":231}],244:[function(a,b,c){"use strict";function d(a){var b=u(a),c=t(s(b),a);return 0>c?[b,w(b,1/0)]:c>0?[w(b,-(1/0)),b]:[b,b]}function e(a,b){for(var c=new Array(b.length),d=0;d<b.length;++d){var e=b[d],f=a[e[0]],g=a[e[1]];c[d]=[Math.min(f[0],g[0]),Math.min(f[1],g[1]),Math.max(f[0],g[0]),Math.max(f[1],g[1])]}return c}function f(a){for(var b=new Array(a.length),c=0;c<a.length;++c){var d=a[c];b[c]=[d[0],d[1],d[0],d[1]]}return b}function g(a,b,c){var d=[];return q(c,function(c,e){var f=b[c],g=b[e];if(f[0]!==g[0]&&f[0]!==g[1]&&f[1]!==g[0]&&f[1]!==g[1]){var h=a[f[0]],i=a[f[1]],j=a[g[0]],k=a[g[1]];r(h,i,j,k)&&d.push([c,e])}}),d}function h(a,b,c,d){var e=[];return q(c,d,function(c,d){var f=b[c];if(f[0]!==d&&f[1]!==d){var g=a[d],h=a[f[0]],i=a[f[1]];r(h,i,g,g)&&e.push([c,d])}}),e}function i(a,b,c,d,e){function f(b){if(b>=a.length)return g[b-a.length];var c=a[b];return[s(c[0]),s(c[1])]}for(var g=[],h=0;h<c.length;++h){var i=c[h],j=i[0],k=i[1],l=b[j],m=b[k],n=x(v(a[l[0]]),v(a[l[1]]),v(a[m[0]]),v(a[m[1]]));if(n){var o=g.length+a.length;g.push(n),d.push([j,o],[k,o])}}d.sort(function(a,b){if(a[0]!==b[0])return a[0]-b[0];var c=f(a[1]),d=f(b[1]);return t(c[0],d[0])||t(c[1],d[1])});for(var h=d.length-1;h>=0;--h){var p=d[h],j=p[0],q=b[j],r=q[0],u=q[1],w=a[r],y=a[u];if((w[0]-y[0]||w[1]-y[1])<0){var z=r;r=u,u=z}q[0]=r;var A,B=q[1]=p[1];for(e&&(A=q[2]);h>0&&d[h-1][0]===j;){var p=d[--h],C=p[1];e?b.push([B,C,A]):b.push([B,C]),B=C}e?b.push([B,u,A]):b.push([B,u])}return g}function j(a,b,c){for(var e=a.length+b.length,f=new p(e),g=c,h=0;h<b.length;++h){var i=b[h],j=d(i[0]),k=d(i[1]);g.push([j[0],k[0],j[1],k[1]]),a.push([u(i[0]),u(i[1])])}q(g,function(a,b){f.link(a,b)});for(var l=0,m=!0,n=new Array(e),h=0;e>h;++h){var o=f.find(h);o===h?(n[h]=l,a[l++]=a[h]):(m=!1,n[h]=-1)}if(a.length=l,m)return null;for(var h=0;e>h;++h)n[h]<0&&(n[h]=n[f.find(h)]);return n}function k(a,b){return a[0]-b[0]||a[1]-b[1]}function l(a,b){var c=a[0]-b[0]||a[1]-b[1];return c?c:a[2]<b[2]?-1:a[2]>b[2]?1:0}function m(a,b,c){if(0!==a.length){if(b)for(var d=0;d<a.length;++d){var e=a[d],f=b[e[0]],g=b[e[1]];e[0]=Math.min(f,g),e[1]=Math.max(f,g)}else for(var d=0;d<a.length;++d){var e=a[d],f=e[0],g=e[1];e[0]=Math.min(f,g),e[1]=Math.max(f,g)}c?a.sort(l):a.sort(k);for(var h=1,d=1;d<a.length;++d){var i=a[d-1],j=a[d];(j[0]!==i[0]||j[1]!==i[1]||c&&j[2]!==i[2])&&(a[h++]=j)}a.length=h}}function n(a,b,c){var d=e(a,b),k=g(a,b,d),l=f(a),n=h(a,b,d,l),o=i(a,b,k,n,c),p=j(a,o,l);return m(b,p,c),p?!0:k.length>0||n.length>0}function o(a,b,c){var d,e=!1;if(c){d=b;for(var f=new Array(b.length),g=0;g<b.length;++g){var h=b[g];f[g]=[h[0],h[1],c[g]]}b=f}for(;n(a,b,!!c);)e=!0;if(c&&e){d.length=0,c.length=0;for(var g=0;g<b.length;++g){var h=b[g];d.push([h[0],h[1]]),c.push(h[2])}}return e}b.exports=o;var p=a("union-find"),q=a("box-intersect"),r=(a("compare-cell"),a("robust-segment-intersect")),s=a("big-rat"),t=a("big-rat/cmp"),u=a("big-rat/to-float"),v=a("rat-vec"),w=a("nextafter"),x=a("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":245,"big-rat":249,"big-rat/cmp":247,"big-rat/to-float":262,"box-intersect":263,"compare-cell":59,nextafter:271,"rat-vec":273,"robust-segment-intersect":276,"union-find":277}],245:[function(a,b,c){"use strict";function d(a,b){return h(f(a[0],b[1]),f(a[1],b[0]))}function e(a,b,c,e){var f=j(b,a),h=j(e,c),m=d(f,h);if(0===i(m))return null;var n=j(a,c),o=d(h,n),p=g(o,m);return k(a,l(f,p))}b.exports=e;var f=a("big-rat/mul"),g=a("big-rat/div"),h=a("big-rat/sub"),i=a("big-rat/sign"),j=a("rat-vec/sub"),k=a("rat-vec/add"),l=a("rat-vec/muls");a("big-rat/to-float")},{"big-rat/div":248,"big-rat/mul":258,"big-rat/sign":260,"big-rat/sub":261,"big-rat/to-float":262,"rat-vec/add":272,"rat-vec/muls":274,"rat-vec/sub":275}],246:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[1]).add(b[0].mul(a[1])),a[1].mul(b[1]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],247:[function(a,b,c){"use strict";function d(a,b){return a[0].mul(b[1]).cmp(b[0].mul(a[1]))}b.exports=d},{}],248:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[1]),a[1].mul(b[0]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],249:[function(a,b,c){"use strict";function d(a,b){if(e(a))return b?j(a,d(b)):[a[0].clone(),a[1].clone()];var c,k,l=0;if(f(a))c=a.clone();else if("string"==typeof a)c=h(a);else{if(0===a)return[g(0),g(1)];if(a===Math.floor(a))c=g(a);else{for(;a!==Math.floor(a);)a*=Math.pow(2,256),l-=256;c=g(a)}}if(e(b))c.mul(b[1]),k=b[0].clone();else if(f(b))k=b.clone();else if("string"==typeof b)k=h(b);else if(b)if(b===Math.floor(b))k=g(b);else{for(;b!==Math.floor(b);)b*=Math.pow(2,256),l+=256;k=g(b)}else k=g(1);return l>0?c=c.shln(l):0>l&&(k=k.shln(-l)),i(c,k)}var e=a("./is-rat"),f=a("./lib/is-bn"),g=a("./lib/num-to-bn"),h=a("./lib/str-to-bn"),i=a("./lib/rationalize"),j=a("./div");b.exports=d},{"./div":248,"./is-rat":250,"./lib/is-bn":254,"./lib/num-to-bn":255,"./lib/rationalize":256,"./lib/str-to-bn":257}],250:[function(a,b,c){"use strict";function d(a){return Array.isArray(a)&&2===a.length&&e(a[0])&&e(a[1])}var e=a("./lib/is-bn");b.exports=d},{"./lib/is-bn":254}],251:[function(a,b,c){"use strict";function d(a){return a.cmp(new e(0))}var e=a("bn.js");b.exports=d},{"bn.js":259}],252:[function(a,b,c){"use strict";function d(a){var b=a.length,c=a.words,d=0;if(1===b)d=c[0];else if(2===b)d=c[0]+67108864*c[1];else for(var d=0,e=0;b>e;e++){var f=c[e];d+=f*Math.pow(67108864,e)}return a.sign?-d:d}b.exports=d},{}],253:[function(a,b,c){"use strict";function d(a){var b=f(e.lo(a));if(32>b)return b;var c=f(e.hi(a));return c>20?52:c+32}var e=a("double-bits"),f=a("bit-twiddle").countTrailingZeros;b.exports=d},{"bit-twiddle":49,"double-bits":270}],254:[function(a,b,c){"use strict";function d(a){return a&&"object"==typeof a&&Boolean(a.words)}a("bn.js");b.exports=d},{"bn.js":259}],255:[function(a,b,c){"use strict";function d(a){var b=f.exponent(a);return 52>b?new e(a):new e(a*Math.pow(2,52-b)).shln(b-52)}var e=a("bn.js"),f=a("double-bits");b.exports=d},{"bn.js":259,"double-bits":270}],256:[function(a,b,c){"use strict";function d(a,b){var c=f(a),d=f(b);if(0===c)return[e(0),e(1)];if(0===d)return[e(0),e(0)];0>d&&(a=a.neg(),b=b.neg());var g=a.gcd(b);return g.cmpn(1)?[a.div(g),b.div(g)]:[a,b]}var e=a("./num-to-bn"),f=a("./bn-sign");b.exports=d},{"./bn-sign":251,"./num-to-bn":255}],257:[function(a,b,c){"use strict";function d(a){return new e(a)}var e=a("bn.js");b.exports=d},{"bn.js":259}],258:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[0]),a[1].mul(b[1]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],259:[function(a,b,c){!function(a,b){"use strict";function c(a,b){if(!a)throw new Error(b||"Assertion failed")}function d(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}function e(a,b,c){return null!==a&&"object"==typeof a&&Array.isArray(a.words)?a:(this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==b&&"be"!==b||(c=b,b=10),void(null!==a&&this._init(a||0,b||10,c||"be")))}function f(a,b,c){for(var d=0,e=Math.min(a.length,c),f=b;e>f;f++){var g=a.charCodeAt(f)-48;d<<=4,d|=g>=49&&54>=g?g-49+10:g>=17&&22>=g?g-17+10:15&g}return d}function g(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;f>g;g++){var h=a.charCodeAt(g)-48;e*=d,e+=h>=49?h-49+10:h>=17?h-17+10:h}return e}function h(a,b){this.name=a,this.p=new e(b,16),this.n=this.p.bitLength(),this.k=new e(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function i(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function l(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function m(a){if("string"==typeof a){var b=e._prime(a);this.m=b.p,this.prime=b}else this.m=a,this.prime=null}function n(a){m.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new e(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof a?a.exports=e:b.BN=e, 42 e.BN=e,e.wordSize=26,e.prototype._init=function(a,b,d){if("number"==typeof a)return this._initNumber(a,b,d);if("object"==typeof a)return this._initArray(a,b,d);"hex"===b&&(b=16),c(b===(0|b)&&b>=2&&36>=b),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.sign=!0),this.strip(),"le"===d&&this._initArray(this.toArray(),b,d)},e.prototype._initNumber=function(a,b,d){0>a&&(this.sign=!0,a=-a),67108864>a?(this.words=[67108863&a],this.length=1):4503599627370496>a?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(c(9007199254740992>a),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===d&&this._initArray(this.toArray(),b,d)},e.prototype._initArray=function(a,b,d){if(c("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var f=0;if("be"===d)for(var e=a.length-1,g=0;e>=0;e-=3){var h=a[e]|a[e-1]<<8|a[e-2]<<16;this.words[g]|=h<<f&67108863,this.words[g+1]=h>>>26-f&67108863,f+=24,f>=26&&(f-=26,g++)}else if("le"===d)for(var e=0,g=0;e<a.length;e+=3){var h=a[e]|a[e+1]<<8|a[e+2]<<16;this.words[g]|=h<<f&67108863,this.words[g+1]=h>>>26-f&67108863,f+=24,f>=26&&(f-=26,g++)}return this.strip()},e.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;for(var d=0,c=a.length-6,e=0;c>=b;c-=6){var g=f(a,c,c+6);this.words[e]|=g<<d&67108863,this.words[e+1]|=g>>>26-d&4194303,d+=24,d>=26&&(d-=26,e++)}if(c+6!==b){var g=f(a,b,c+6);this.words[e]|=g<<d&67108863,this.words[e+1]|=g>>>26-d&4194303}this.strip()},e.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;67108863>=e;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,h=f%d,i=Math.min(f,f-h)+c,j=0,k=c;i>k;k+=d)j=g(a,k,k+d,b),this.imuln(e),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j);if(0!==h){for(var l=1,j=g(a,k,a.length,b),k=0;h>k;k++)l*=b;this.imuln(l),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j)}},e.prototype.copy=function(a){a.words=new Array(this.length);for(var b=0;b<this.length;b++)a.words[b]=this.words[b];a.length=this.length,a.sign=this.sign,a.red=this.red},e.prototype.clone=function(){var a=new e(null);return this.copy(a),a},e.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},e.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var o=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];e.prototype.toString=function(a,b){if(a=a||10,16===a||"hex"===a){for(var d="",e=0,b=0|b||1,f=0,g=0;g<this.length;g++){var h=this.words[g],i=(16777215&(h<<e|f)).toString(16);f=h>>>24-e&16777215,d=0!==f||g!==this.length-1?o[6-i.length]+i+d:i+d,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(d=f.toString(16)+d);d.length%b!==0;)d="0"+d;return this.sign&&(d="-"+d),d}if(a===(0|a)&&a>=2&&36>=a){var j=p[a],k=q[a],d="",l=this.clone();for(l.sign=!1;0!==l.cmpn(0);){var m=l.modn(k).toString(a);l=l.idivn(k),d=0!==l.cmpn(0)?o[j-m.length]+m+d:m+d}return 0===this.cmpn(0)&&(d="0"+d),this.sign&&(d="-"+d),d}c(!1,"Base should be between 2 and 36")},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toArray=function(a){this.strip();var b=new Array(this.byteLength());b[0]=0;var c=this.clone();if("le"!==a)for(var d=0;0!==c.cmpn(0);d++){var e=c.andln(255);c.ishrn(8),b[b.length-d-1]=e}else for(var d=0;0!==c.cmpn(0);d++){var e=c.andln(255);c.ishrn(8),b[d]=e}return b},Math.clz32?e.prototype._countBits=function(a){return 32-Math.clz32(a)}:e.prototype._countBits=function(a){var b=a,c=0;return b>=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},e.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},e.prototype.bitLength=function(){var a=0,b=this.words[this.length-1],a=this._countBits(b);return 26*(this.length-1)+a},e.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var a=0,b=0;b<this.length;b++){var c=this._zeroBits(this.words[b]);if(a+=c,26!==c)break}return a},e.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},e.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var a=this.clone();return a.sign=!this.sign,a},e.prototype.ior=function(a){for(this.sign=this.sign||a.sign;this.length<a.length;)this.words[this.length++]=0;for(var b=0;b<a.length;b++)this.words[b]=this.words[b]|a.words[b];return this.strip()},e.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},e.prototype.iand=function(a){this.sign=this.sign&&a.sign;var b;b=this.length>a.length?a:this;for(var c=0;c<b.length;c++)this.words[c]=this.words[c]&a.words[c];return this.length=b.length,this.strip()},e.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},e.prototype.ixor=function(a){this.sign=this.sign||a.sign;var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;d<c.length;d++)this.words[d]=b.words[d]^c.words[d];if(this!==b)for(;d<b.length;d++)this.words[d]=b.words[d];return this.length=b.length,this.strip()},e.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},e.prototype.setn=function(a,b){c("number"==typeof a&&a>=0);for(var d=a/26|0,e=a%26;this.length<=d;)this.words[this.length++]=0;return b?this.words[d]=this.words[d]|1<<e:this.words[d]=this.words[d]&~(1<<e),this.strip()},e.prototype.iadd=function(a){if(this.sign&&!a.sign){this.sign=!1;var b=this.isub(a);return this.sign=!this.sign,this._normSign()}if(!this.sign&&a.sign){a.sign=!1;var b=this.isub(a);return a.sign=!0,b._normSign()}var c,d;this.length>a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f<d.length;f++){var b=c.words[f]+d.words[f]+e;this.words[f]=67108863&b,e=b>>>26}for(;0!==e&&f<c.length;f++){var b=c.words[f]+e;this.words[f]=67108863&b,e=b>>>26}if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;f<c.length;f++)this.words[f]=c.words[f];return this},e.prototype.add=function(a){if(a.sign&&!this.sign){a.sign=!1;var b=this.sub(a);return a.sign=!0,b}if(!a.sign&&this.sign){this.sign=!1;var b=a.sub(this);return this.sign=!0,b}return this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},e.prototype.isub=function(a){if(a.sign){a.sign=!1;var b=this.iadd(a);return a.sign=!0,b._normSign()}if(this.sign)return this.sign=!1,this.iadd(a),this.sign=!0,this._normSign();var c=this.cmp(a);if(0===c)return this.sign=!1,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g<e.length;g++){var b=d.words[g]-e.words[g]+f;f=b>>26,this.words[g]=67108863&b}for(;0!==f&&g<d.length;g++){var b=d.words[g]+f;f=b>>26,this.words[g]=67108863&b}if(0===f&&g<d.length&&d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this.length=Math.max(this.length,g),d!==this&&(this.sign=!0),this.strip()},e.prototype.sub=function(a){return this.clone().isub(a)},e.prototype._smallMulTo=function(a,b){b.sign=a.sign!==this.sign,b.length=this.length+a.length;for(var c=0,d=0;d<b.length-1;d++){for(var e=c>>>26,f=67108863&c,g=Math.min(d,a.length-1),h=Math.max(0,d-this.length+1);g>=h;h++){var i=d-h,j=0|this.words[i],k=0|a.words[h],l=j*k,m=67108863&l;e=e+(l/67108864|0)|0,m=m+f|0,f=67108863&m,e=e+(m>>>26)|0}b.words[d]=f,c=e}return 0!==c?b.words[d]=c:b.length--,b.strip()},e.prototype._bigMulTo=function(a,b){b.sign=a.sign!==this.sign,b.length=this.length+a.length;for(var c=0,d=0,e=0;e<b.length-1;e++){var f=d;d=0;for(var g=67108863&c,h=Math.min(e,a.length-1),i=Math.max(0,e-this.length+1);h>=i;i++){var j=e-i,k=0|this.words[j],l=0|a.words[i],m=k*l,n=67108863&m;f=f+(m/67108864|0)|0,n=n+g|0,g=67108863&n,f=f+(n>>>26)|0,d+=f>>>26,f&=67108863}b.words[e]=g,c=f,f=d}return 0!==c?b.words[e]=c:b.length--,b.strip()},e.prototype.mulTo=function(a,b){var c;return c=this.length+a.length<63?this._smallMulTo(a,b):this._bigMulTo(a,b)},e.prototype.mul=function(a){var b=new e(null);return b.words=new Array(this.length+a.length),this.mulTo(a,b)},e.prototype.imul=function(a){if(0===this.cmpn(0)||0===a.cmpn(0))return this.words[0]=0,this.length=1,this;var b=this.length,c=a.length;this.sign=a.sign!==this.sign,this.length=this.length+a.length,this.words[this.length-1]=0;for(var d=this.length-2;d>=0;d--){for(var e=0,f=0,g=Math.min(d,c-1),h=Math.max(0,d-b+1);g>=h;h++){var i=d-h,j=this.words[i],k=a.words[h],l=j*k,m=67108863&l;e+=l/67108864|0,m+=f,f=67108863&m,e+=m>>>26}this.words[d]=f,this.words[d+1]+=e,e=0}for(var e=0,i=1;i<this.length;i++){var n=this.words[i]+e;this.words[i]=67108863&n,e=n>>>26}return this.strip()},e.prototype.imuln=function(a){c("number"==typeof a);for(var b=0,d=0;d<this.length;d++){var e=this.words[d]*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[d]=67108863&f}return 0!==b&&(this.words[d]=b,this.length++),this},e.prototype.muln=function(a){return this.clone().imuln(a)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.mul(this)},e.prototype.ishln=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26,e=67108863>>>26-b<<26-b;if(0!==b){for(var f=0,g=0;g<this.length;g++){var h=this.words[g]&e,i=this.words[g]-h<<b;this.words[g]=i|f,f=h>>>26-b}f&&(this.words[g]=f,this.length++)}if(0!==d){for(var g=this.length-1;g>=0;g--)this.words[g+d]=this.words[g];for(var g=0;d>g;g++)this.words[g]=0;this.length+=d}return this.strip()},e.prototype.ishrn=function(a,b,d){c("number"==typeof a&&a>=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=d;if(e-=g,e=Math.max(0,e),i){for(var j=0;g>j;j++)i.words[j]=this.words[j];i.length=g}if(0===g);else if(this.length>g){this.length-=g;for(var j=0;j<this.length;j++)this.words[j]=this.words[j+g]}else this.words[0]=0,this.length=1;for(var k=0,j=this.length-1;j>=0&&(0!==k||j>=e);j--){var l=this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},e.prototype.shln=function(a){return this.clone().ishln(a)},e.prototype.shrn=function(a){return this.clone().ishrn(a)},e.prototype.testn=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26,e=1<<b;if(this.length<=d)return!1;var f=this.words[d];return!!(f&e)},e.prototype.imaskn=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26;if(c(!this.sign,"imaskn works only with positive numbers"),0!==b&&d++,this.length=Math.min(d,this.length),0!==b){var e=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}return this.strip()},e.prototype.maskn=function(a){return this.clone().imaskn(a)},e.prototype.iaddn=function(a){return c("number"==typeof a),0>a?this.isubn(-a):this.sign?1===this.length&&this.words[0]<a?(this.words[0]=a-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(a),this.sign=!0,this):this._iaddn(a)},e.prototype._iaddn=function(a){this.words[0]+=a;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},e.prototype.isubn=function(a){if(c("number"==typeof a),0>a)return this.iaddn(-a);if(this.sign)return this.sign=!1,this.iaddn(a),this.sign=!0,this;this.words[0]-=a;for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},e.prototype.addn=function(a){return this.clone().iaddn(a)},e.prototype.subn=function(a){return this.clone().isubn(a)},e.prototype.iabs=function(){return this.sign=!1,this},e.prototype.abs=function(){return this.clone().iabs()},e.prototype._ishlnsubmul=function(a,b,d){var e,f=a.length+d;if(this.words.length<f){for(var g=new Array(f),e=0;e<this.length;e++)g[e]=this.words[e];this.words=g}else e=this.length;for(this.length=Math.max(this.length,f);e<this.length;e++)this.words[e]=0;for(var h=0,e=0;e<a.length;e++){var i=this.words[e+d]+h,j=a.words[e]*b;i-=67108863&j,h=(i>>26)-(j/67108864|0),this.words[e+d]=67108863&i}for(;e<this.length-d;e++){var i=this.words[e+d]+h;h=i>>26,this.words[e+d]=67108863&i}if(0===h)return this.strip();c(-1===h),h=0;for(var e=0;e<this.length;e++){var i=-this.words[e]+h;h=i>>26,this.words[e]=67108863&i}return this.sign=!0,this.strip()},e.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),f=a,g=f.words[f.length-1],h=this._countBits(g);c=26-h,0!==c&&(f=f.shln(c),d.ishln(c),g=f.words[f.length-1]);var i,j=d.length-f.length;if("mod"!==b){i=new e(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k<i.length;k++)i.words[k]=0}var l=d.clone()._ishlnsubmul(f,1,j);l.sign||(d=l,i&&(i.words[j]=1));for(var m=j-1;m>=0;m--){var n=67108864*d.words[f.length+m]+d.words[f.length+m-1];for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(f,n,m);d.sign;)n--,d.sign=!1,d._ishlnsubmul(f,1,m),0!==d.cmpn(0)&&(d.sign=!d.sign);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.ishrn(c),{div:i?i:null,mod:d}},e.prototype.divmod=function(a,b){if(c(0!==a.cmpn(0)),this.sign&&!a.sign){var d,f,g=this.neg().divmod(a,b);return"mod"!==b&&(d=g.div.neg()),"div"!==b&&(f=0===g.mod.cmpn(0)?g.mod:a.sub(g.mod)),{div:d,mod:f}}if(!this.sign&&a.sign){var d,g=this.divmod(a.neg(),b);return"mod"!==b&&(d=g.div.neg()),{div:d,mod:g.mod}}return this.sign&&a.sign?this.neg().divmod(a.neg(),b):a.length>this.length||this.cmp(a)<0?{div:new e(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new e(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new e(this.modn(a.words[0]))}:this._wordDiv(a,b)},e.prototype.div=function(a){return this.divmod(a,"div").div},e.prototype.mod=function(a){return this.divmod(a,"mod").mod},e.prototype.divRound=function(a){var b=this.divmod(a);if(0===b.mod.cmpn(0))return b.div;var c=b.div.sign?b.mod.isub(a):b.mod,d=a.shrn(1),e=a.andln(1),f=c.cmp(d);return 0>f||1===e&&0===f?b.div:b.div.sign?b.div.isubn(1):b.div.iaddn(1)},e.prototype.modn=function(a){c(67108863>=a);for(var b=(1<<26)%a,d=0,e=this.length-1;e>=0;e--)d=(b*d+this.words[e])%a;return d},e.prototype.idivn=function(a){c(67108863>=a);for(var b=0,d=this.length-1;d>=0;d--){var e=this.words[d]+67108864*b;this.words[d]=e/a|0,b=e%a}return this.strip()},e.prototype.divn=function(a){return this.clone().idivn(a)},e.prototype.egcd=function(a){c(!a.sign),c(0!==a.cmpn(0));var b=this,d=a.clone();b=b.sign?b.mod(a):b.clone();for(var f=new e(1),g=new e(0),h=new e(0),i=new e(1),j=0;b.isEven()&&d.isEven();)b.ishrn(1),d.ishrn(1),++j;for(var k=d.clone(),l=b.clone();0!==b.cmpn(0);){for(;b.isEven();)b.ishrn(1),f.isEven()&&g.isEven()?(f.ishrn(1),g.ishrn(1)):(f.iadd(k).ishrn(1),g.isub(l).ishrn(1));for(;d.isEven();)d.ishrn(1),h.isEven()&&i.isEven()?(h.ishrn(1),i.ishrn(1)):(h.iadd(k).ishrn(1),i.isub(l).ishrn(1));b.cmp(d)>=0?(b.isub(d),f.isub(h),g.isub(i)):(d.isub(b),h.isub(f),i.isub(g))}return{a:h,b:i,gcd:d.ishln(j)}},e.prototype._invmp=function(a){c(!a.sign),c(0!==a.cmpn(0));var b=this,d=a.clone();b=b.sign?b.mod(a):b.clone();for(var f=new e(1),g=new e(0),h=d.clone();b.cmpn(1)>0&&d.cmpn(1)>0;){for(;b.isEven();)b.ishrn(1),f.isEven()?f.ishrn(1):f.iadd(h).ishrn(1);for(;d.isEven();)d.ishrn(1),g.isEven()?g.ishrn(1):g.iadd(h).ishrn(1);b.cmp(d)>=0?(b.isub(d),f.isub(g)):(d.isub(b),g.isub(f))}return 0===b.cmpn(1)?f:g},e.prototype.gcd=function(a){if(0===this.cmpn(0))return a.clone();if(0===a.cmpn(0))return this.clone();var b=this.clone(),c=a.clone();b.sign=!1,c.sign=!1;for(var d=0;b.isEven()&&c.isEven();d++)b.ishrn(1),c.ishrn(1);for(;;){for(;b.isEven();)b.ishrn(1);for(;c.isEven();)c.ishrn(1);var e=b.cmp(c);if(0>e){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.ishln(d)},e.prototype.invm=function(a){return this.egcd(a).a.mod(a)},e.prototype.isEven=function(){return 0===(1&this.words[0])},e.prototype.isOdd=function(){return 1===(1&this.words[0])},e.prototype.andln=function(a){return this.words[0]&a},e.prototype.bincn=function(a){c("number"==typeof a);var b=a%26,d=(a-b)/26,e=1<<b;if(this.length<=d){for(var f=this.length;d+1>f;f++)this.words[f]=0;return this.words[d]|=e,this.length=d+1,this}for(var g=e,f=d;0!==g&&f<this.length;f++){var h=this.words[f];h+=g,g=h>>>26,h&=67108863,this.words[f]=h}return 0!==g&&(this.words[f]=g,this.length++),this},e.prototype.cmpn=function(a){var b=0>a;if(b&&(a=-a),this.sign&&!b)return-1;if(!this.sign&&b)return 1;a&=67108863,this.strip();var c;if(this.length>1)c=1;else{var d=this.words[0];c=d===a?0:a>d?-1:1}return this.sign&&(c=-c),c},e.prototype.cmp=function(a){if(this.sign&&!a.sign)return-1;if(!this.sign&&a.sign)return 1;var b=this.ucmp(a);return this.sign?-b:b},e.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var b=0,c=this.length-1;c>=0;c--){var d=this.words[c],e=a.words[c];if(d!==e){e>d?b=-1:d>e&&(b=1);break}}return b},e.red=function(a){return new m(a)},e.prototype.toRed=function(a){return c(!this.red,"Already a number in reduction context"),c(!this.sign,"red works only with positives"),a.convertTo(this)._forceRed(a)},e.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(a){return this.red=a,this},e.prototype.forceRed=function(a){return c(!this.red,"Already a number in reduction context"),this._forceRed(a)},e.prototype.redAdd=function(a){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},e.prototype.redIAdd=function(a){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},e.prototype.redSub=function(a){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},e.prototype.redISub=function(a){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},e.prototype.redShl=function(a){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},e.prototype.redMul=function(a){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},e.prototype.redIMul=function(a){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},e.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(a){return c(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var r={k256:null,p224:null,p192:null,p25519:null};h.prototype._tmp=function(){var a=new e(null);return a.words=new Array(Math.ceil(this.n/13)),a},h.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b<this.n?-1:c.ucmp(this.p);return 0===d?(c.words[0]=0,c.length=1):d>0?c.isub(this.p):c.strip(),c},h.prototype.split=function(a,b){a.ishrn(this.n,0,b)},h.prototype.imulK=function(a){return a.imul(this.k)},d(i,h),i.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;d>e;e++)b.words[e]=a.words[e];if(b.length=d,a.length<=9)return a.words[0]=0,void(a.length=1);var f=a.words[9];b.words[b.length++]=f&c;for(var e=10;e<a.length;e++){var g=a.words[e];a.words[e-10]=(g&c)<<4|f>>>22,f=g}a.words[e-10]=f>>>22,a.length-=9},i.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b,c=0,d=0;d<a.length;d++){var e=a.words[d];b=64*e,c+=977*e,b+=c/67108864|0,c&=67108863,a.words[d]=c,c=b}return 0===a.words[a.length-1]&&(a.length--,0===a.words[a.length-1]&&a.length--),a},d(j,h),d(k,h),d(l,h),l.prototype.imulK=function(a){for(var b=0,c=0;c<a.length;c++){var d=19*a.words[c]+b,e=67108863&d;d>>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},e._prime=function s(a){if(r[a])return r[a];var s;if("k256"===a)s=new i;else if("p224"===a)s=new j;else if("p192"===a)s=new k;else{if("p25519"!==a)throw new Error("Unknown prime "+a);s=new l}return r[a]=s,s},m.prototype._verify1=function(a){c(!a.sign,"red works only with positives"),c(a.red,"red works only with red numbers")},m.prototype._verify2=function(a,b){c(!a.sign&&!b.sign,"red works only with positives"),c(a.red&&a.red===b.red,"red works only with red numbers")},m.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.mod(this.m)._forceRed(this)},m.prototype.neg=function(a){var b=a.clone();return b.sign=!b.sign,b.iadd(this.m)._forceRed(this)},m.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},m.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},m.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},m.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},m.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.shln(b))},m.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},m.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},m.prototype.isqr=function(a){return this.imul(a,a)},m.prototype.sqr=function(a){return this.mul(a,a)},m.prototype.sqrt=function(a){if(0===a.cmpn(0))return a.clone();var b=this.m.andln(3);if(c(b%2===1),3===b){var d=this.m.add(new e(1)).ishrn(2),f=this.pow(a,d);return f}for(var g=this.m.subn(1),h=0;0!==g.cmpn(0)&&0===g.andln(1);)h++,g.ishrn(1);c(0!==g.cmpn(0));var i=new e(1).toRed(this),j=i.redNeg(),k=this.m.subn(1).ishrn(1),l=this.m.bitLength();for(l=new e(2*l*l).toRed(this);0!==this.pow(l,k).cmp(j);)l.redIAdd(j);for(var m=this.pow(l,g),f=this.pow(a,g.addn(1).ishrn(1)),n=this.pow(a,g),o=h;0!==n.cmp(i);){for(var p=n,q=0;0!==p.cmp(i);q++)p=p.redSqr();c(o>q);var r=this.pow(m,new e(1).ishln(o-q-1));f=f.redMul(r),m=r.redSqr(),n=n.redMul(m),o=q}return f},m.prototype.invm=function(a){var b=a._invmp(this.m);return b.sign?(b.sign=!1,this.imod(b).redNeg()):this.imod(b)},m.prototype.pow=function(a,b){var c=[];if(0===b.cmpn(0))return new e(1);for(var d=b.clone();0!==d.cmpn(0);)c.push(d.andln(1)),d.ishrn(1);for(var f=a,g=0;g<c.length&&0===c[g];g++,f=this.sqr(f));if(++g<c.length)for(var d=this.sqr(f);g<c.length;g++,d=this.sqr(d))0!==c[g]&&(f=this.mul(f,d));return f},m.prototype.convertTo=function(a){var b=a.mod(this.m);return b===a?b.clone():b},m.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},e.mont=function(a){return new n(a)},d(n,m),n.prototype.convertTo=function(a){return this.imod(a.shln(this.shift))},n.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},n.prototype.imul=function(a,b){if(0===a.cmpn(0)||0===b.cmpn(0))return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).ishrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},n.prototype.mul=function(a,b){if(0===a.cmpn(0)||0===b.cmpn(0))return new e(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=c.isub(d).ishrn(this.shift),g=f;return f.cmp(this.m)>=0?g=f.isub(this.m):f.cmpn(0)<0&&(g=f.iadd(this.m)),g._forceRed(this)},n.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{}],260:[function(a,b,c){"use strict";function d(a){return e(a[0])*e(a[1])}var e=a("./lib/bn-sign");b.exports=d},{"./lib/bn-sign":251}],261:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[1]).sub(a[1].mul(b[0])),a[1].mul(b[1]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],262:[function(a,b,c){"use strict";function d(a){var b=a[0],c=a[1];if(0===b.cmpn(0))return 0;var d=b.divmod(c),g=d.div,h=e(g),i=d.mod;if(0===i.cmpn(0))return h;if(h){var j=f(h)+4,k=e(i.shln(j).divRound(c));return 0>h&&(k=-k),h+k*Math.pow(2,-j)}var l=c.bitLength()-i.bitLength()+53,k=e(i.shln(l).divRound(c));return 1023>l?k*Math.pow(2,-l):(k*=Math.pow(2,-1023),k*Math.pow(2,1023-l))}var e=a("./lib/bn-to-num"),f=a("./lib/ctz");b.exports=d},{"./lib/bn-to-num":252,"./lib/ctz":253}],263:[function(a,b,c){"use strict";function d(a,b){for(var c=0;a>c;++c)if(!(b[c]<=b[c+a]))return!0;return!1}function e(a,b,c,e){for(var f=0,g=0,h=0,i=a.length;i>h;++h){var j=a[h];if(!d(b,j)){for(var k=0;2*b>k;++k)c[f++]=j[k];e[g++]=h}}return g}function f(a,b,c,d){var f=a.length,g=b.length;if(!(0>=f||0>=g)){var h=a[0].length>>>1;if(!(0>=h)){var i,j=l.mallocDouble(2*h*f),k=l.mallocInt32(f);if(f=e(a,h,j,k),f>0){if(1===h&&d)m.init(f),i=m.sweepComplete(h,c,0,f,j,k,0,f,j,k);else{var o=l.mallocDouble(2*h*g),p=l.mallocInt32(g);g=e(b,h,o,p),g>0&&(m.init(f+g),i=1===h?m.sweepBipartite(h,c,0,f,j,k,0,g,o,p):n(h,c,d,f,j,k,g,o,p),l.free(o),l.free(p))}l.free(j),l.free(k)}return i}}}function g(a,b){k.push([a,b])}function h(a){return k=[],f(a,a,g,!0),k}function i(a,b){return k=[],f(a,b,g,!1),k}function j(a,b,c){switch(arguments.length){case 1:return h(a);case 2:return"function"==typeof b?f(a,a,b,!0):i(a,b);case 3:return f(a,b,c,!1);default:throw new Error("box-intersect: Invalid arguments")}}b.exports=j;var k,l=a("typedarray-pool"),m=a("./lib/sweep"),n=a("./lib/intersect")},{"./lib/intersect":265,"./lib/sweep":269,"typedarray-pool":233}],264:[function(a,b,c){"use strict";function d(a,b,c){var d="bruteForce"+(a?"Red":"Blue")+(b?"Flip":"")+(c?"Full":""),e=["function ",d,"(",w.join(),"){","var ",j,"=2*",f,";"],i="for(var i="+k+","+o+"="+j+"*"+k+";i<"+l+";++i,"+o+"+="+j+"){var x0="+m+"["+g+"+"+o+"],x1="+m+"["+g+"+"+o+"+"+f+"],xi="+n+"[i];",x="for(var j="+p+","+t+"="+j+"*"+p+";j<"+q+";++j,"+t+"+="+j+"){var y0="+r+"["+g+"+"+t+"],"+(c?"y1="+r+"["+g+"+"+t+"+"+f+"],":"")+"yi="+s+"[j];";return a?e.push(i,v,":",x):e.push(x,v,":",i),c?e.push("if(y1<x0||x1<y0)continue;"):b?e.push("if(y0<=x0||x1<y0)continue;"):e.push("if(y0<x0||x1<y0)continue;"),e.push("for(var k="+g+"+1;k<"+f+";++k){var r0="+m+"[k+"+o+"],r1="+m+"[k+"+f+"+"+o+"],b0="+r+"[k+"+t+"],b1="+r+"[k+"+f+"+"+t+"];if(r1<b0||b1<r0)continue "+v+";}var "+u+"="+h+"("),b?e.push("yi,xi"):e.push("xi,yi"),e.push(");if("+u+"!==void 0)return "+u+";}}}"),{name:d,code:e.join("")}}function e(a){function b(b,c){var f=d(b,c,a);e.push(f.code),g.push("return "+f.name+"("+w.join()+");")}var c="bruteForce"+(a?"Full":"Partial"),e=[],f=w.slice();a||f.splice(3,0,i);var g=["function "+c+"("+f.join()+"){"];g.push("if("+l+"-"+k+">"+q+"-"+p+"){"),a?(b(!0,!1),g.push("}else{"),b(!1,!1)):(g.push("if("+i+"){"),b(!0,!0),g.push("}else{"),b(!0,!1),g.push("}}else{if("+i+"){"),b(!1,!0),g.push("}else{"),b(!1,!1),g.push("}")),g.push("}}return "+c);var h=e.join("")+g.join(""),j=new Function(h);return j()}var f="d",g="ax",h="vv",i="fp",j="es",k="rs",l="re",m="rb",n="ri",o="rp",p="bs",q="be",r="bb",s="bi",t="bp",u="rv",v="Q",w=[f,g,h,k,l,m,n,p,q,r,s];c.partial=e(!1),c.full=e(!0)},{}],265:[function(a,b,c){"use strict";function d(a,b){var c=8*j.log2(b+1)*(a+1)|0,d=j.nextPow2(z*c);C.length<d&&(i.free(C),C=i.mallocInt32(d));var e=j.nextPow2(A*c);e>D&&(i.free(D),D=i.mallocDouble(e))}function e(a,b,c,d,e,f,g,h,i){var j=z*a;C[j]=b,C[j+1]=c,C[j+2]=d,C[j+3]=e,C[j+4]=f,C[j+5]=g;var k=A*a;D[k]=h,D[k+1]=i}function f(a,b,c,d,e,f,g,h,i,j,k){var l=2*a,m=i*l,n=j[m+b];a:for(var o=e,p=e*l;f>o;++o,p+=l){var q=g[p+b],r=g[p+b+a];if(!(q>n||n>r||d&&n===q)){for(var s=h[o],t=b+1;a>t;++t){var q=g[p+t],r=g[p+t+a],u=j[m+t],v=j[m+t+a];if(u>r||q>v)continue a}var w;if(w=d?c(k,s):c(s,k),void 0!==w)return w}}}function g(a,b,c,d,e,f,g,h,i,j){var k=2*a,l=h*k,m=i[l+b];a:for(var n=d,o=d*k;e>n;++n,o+=k){var p=g[n];if(p!==j){var q=f[o+b],r=f[o+b+a];if(!(q>m||m>r)){for(var s=b+1;a>s;++s){var q=f[o+s],r=f[o+s+a],t=i[l+s],u=i[l+s+a];if(t>r||q>u)continue a}var v=c(p,j);if(void 0!==v)return v}}}}function h(a,b,c,h,i,j,k,p,B){d(a,h+k);var E,F=0,G=2*a;for(e(F++,0,0,h,0,k,c?16:0,-(1/0),1/0),c||e(F++,0,0,k,0,h,1,-(1/0),1/0);F>0;){F-=1;var H=F*z,I=C[H],J=C[H+1],K=C[H+2],L=C[H+3],M=C[H+4],N=C[H+5],O=F*A,P=D[O],Q=D[O+1],R=1&N,S=!!(16&N),T=i,U=j,V=p,W=B;if(R&&(T=p,U=B,V=i,W=j),!(2&N&&(K=v(a,I,J,K,T,U,Q),J>=K)||4&N&&(J=w(a,I,J,K,T,U,P),J>=K))){var X=K-J,Y=M-L;if(S){if(s>a*X*(X+Y)){if(E=n.scanComplete(a,I,b,J,K,T,U,L,M,V,W),void 0!==E)return E;continue}}else{if(a*Math.min(X,Y)<q){if(E=l(a,I,b,R,J,K,T,U,L,M,V,W),void 0!==E)return E;continue}if(r>a*X*Y){if(E=n.scanBipartite(a,I,b,R,J,K,T,U,L,M,V,W),void 0!==E)return E;continue}}var Z=t(a,I,J,K,T,U,P,Q);if(Z>J)if(q>a*(Z-J)){if(E=m(a,I+1,b,J,Z,T,U,L,M,V,W),void 0!==E)return E}else if(I===a-2){if(E=R?n.sweepBipartite(a,b,L,M,V,W,J,Z,T,U):n.sweepBipartite(a,b,J,Z,T,U,L,M,V,W),void 0!==E)return E}else e(F++,I+1,J,Z,L,M,R,-(1/0),1/0),e(F++,I+1,L,M,J,Z,1^R,-(1/0),1/0);if(K>Z){var $=o(a,I,L,M,V,W),_=V[G*$+I],aa=u(a,I,$,M,V,W,_);if(M>aa&&e(F++,I,Z,K,aa,M,(4|R)+(S?16:0),_,Q),$>L&&e(F++,I,Z,K,L,$,(2|R)+(S?16:0),P,_),$+1===aa){if(E=S?g(a,I,b,Z,K,T,U,$,V,W[$]):f(a,I,b,R,Z,K,T,U,$,V,W[$]),void 0!==E)return E}else if(aa>$){var ba;if(S){if(ba=x(a,I,Z,K,T,U,_),ba>Z){var ca=u(a,I,Z,ba,T,U,_);if(I===a-2){if(ca>Z&&(E=n.sweepComplete(a,b,Z,ca,T,U,$,aa,V,W),void 0!==E))return E;if(ba>ca&&(E=n.sweepBipartite(a,b,ca,ba,T,U,$,aa,V,W),void 0!==E))return E}else ca>Z&&e(F++,I+1,Z,ca,$,aa,16,-(1/0),1/0),ba>ca&&(e(F++,I+1,ca,ba,$,aa,0,-(1/0),1/0),e(F++,I+1,$,aa,ca,ba,1,-(1/0),1/0))}}else ba=R?y(a,I,Z,K,T,U,_):x(a,I,Z,K,T,U,_),ba>Z&&(I===a-2?E=R?n.sweepBipartite(a,b,$,aa,V,W,Z,ba,T,U):n.sweepBipartite(a,b,Z,ba,T,U,$,aa,V,W):(e(F++,I+1,Z,ba,$,aa,R,-(1/0),1/0),e(F++,I+1,$,aa,Z,ba,1^R,-(1/0),1/0)))}}}}}b.exports=h;var i=a("typedarray-pool"),j=a("bit-twiddle"),k=a("./brute"),l=k.partial,m=k.full,n=a("./sweep"),o=a("./median"),p=a("./partition"),q=128,r=1<<22,s=1<<22,t=p("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),u=p("lo===p0",["p0"]),v=p("lo<p0",["p0"]),w=p("hi<=p0",["p0"]),x=p("lo<=p0&&p0<=hi",["p0"]),y=p("lo<p0&&p0<=hi",["p0"]),z=6,A=2,B=1024,C=i.mallocInt32(B),D=i.mallocDouble(B)},{"./brute":264,"./median":266,"./partition":267,"./sweep":269,"bit-twiddle":49,"typedarray-pool":233}],266:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){for(var g=2*a,h=g*(c+1)+b,i=c+1;d>i;++i,h+=g)for(var j=e[h],k=i,l=g*(i-1);k>c&&e[l+b]>j;--k,l-=g){for(var m=l,n=l+g,o=0;g>o;++o,++m,++n){var p=e[m];e[m]=e[n],e[n]=p}var q=f[k];f[k]=f[k-1],f[k-1]=q}}function e(a,b,c,e,f,i){if(c+1>=e)return c;for(var j=c,k=e,l=e+c>>>1,m=2*a,n=l,o=f[m*l+b];k>j;){if(h>k-j){d(a,b,j,k,f,i),o=f[m*l+b];break}var p=k-j,q=Math.random()*p+j|0,r=f[m*q+b],s=Math.random()*p+j|0,t=f[m*s+b],u=Math.random()*p+j|0,v=f[m*u+b]; 43 t>=r?v>=t?(n=s,o=t):r>=v?(n=q,o=r):(n=u,o=v):t>=v?(n=s,o=t):v>=r?(n=q,o=r):(n=u,o=v);for(var w=m*(k-1),x=m*n,y=0;m>y;++y,++w,++x){var z=f[w];f[w]=f[x],f[x]=z}var A=i[k-1];i[k-1]=i[n],i[n]=A,n=g(a,b,j,k-1,f,i,o);for(var w=m*(k-1),x=m*n,y=0;m>y;++y,++w,++x){var z=f[w];f[w]=f[x],f[x]=z}var A=i[k-1];if(i[k-1]=i[n],i[n]=A,n>l){for(k=n-1;k>j&&f[m*(k-1)+b]===o;)k-=1;k+=1}else{if(!(l>n))break;for(j=n+1;k>j&&f[m*j+b]===o;)j+=1}}return g(a,b,c,l,f,i,f[m*l+b])}b.exports=e;var f=a("./partition"),g=f("lo<p0",["p0"]),h=8},{"./partition":267}],267:[function(a,b,c){"use strict";function d(a,b){var c="abcdef".split("").concat(b),d=[];return a.indexOf("lo")>=0&&d.push("lo=e[k+n]"),a.indexOf("hi")>=0&&d.push("hi=e[k+o]"),c.push(e.replace("_",d.join()).replace("$",a)),Function.apply(void 0,c)}b.exports=d;var e="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],268:[function(a,b,c){"use strict";function d(a,b){4*m>=b?e(0,b-1,a):l(0,b-1,a)}function e(a,b,c){for(var d=2*(a+1),e=a+1;b>=e;++e){for(var f=c[d++],g=c[d++],h=e,i=d-2;h-- >a;){var j=c[i-2],k=c[i-1];if(f>j)break;if(j===f&&g>k)break;c[i]=j,c[i+1]=k,i-=2}c[i]=f,c[i+1]=g}}function f(a,b,c){a*=2,b*=2;var d=c[a],e=c[a+1];c[a]=c[b],c[a+1]=c[b+1],c[b]=d,c[b+1]=e}function g(a,b,c){a*=2,b*=2,c[a]=c[b],c[a+1]=c[b+1]}function h(a,b,c,d){a*=2,b*=2,c*=2;var e=d[a],f=d[a+1];d[a]=d[b],d[a+1]=d[b+1],d[b]=d[c],d[b+1]=d[c+1],d[c]=e,d[c+1]=f}function i(a,b,c,d,e){a*=2,b*=2,e[a]=e[b],e[b]=c,e[a+1]=e[b+1],e[b+1]=d}function j(a,b,c){a*=2,b*=2;var d=c[a],e=c[b];return e>d?!1:d===e?c[a+1]>c[b+1]:!0}function k(a,b,c,d){a*=2;var e=d[a];return b>e?!0:e===b?d[a+1]<c:!1}function l(a,b,c){var d=(b-a+1)/6|0,n=a+d,o=b-d,p=a+b>>1,q=p-d,r=p+d,s=n,t=q,u=p,v=r,w=o,x=a+1,y=b-1,z=0;j(s,t,c)&&(z=s,s=t,t=z),j(v,w,c)&&(z=v,v=w,w=z),j(s,u,c)&&(z=s,s=u,u=z),j(t,u,c)&&(z=t,t=u,u=z),j(s,v,c)&&(z=s,s=v,v=z),j(u,v,c)&&(z=u,u=v,v=z),j(t,w,c)&&(z=t,t=w,w=z),j(t,u,c)&&(z=t,t=u,u=z),j(v,w,c)&&(z=v,v=w,w=z);for(var A=c[2*t],B=c[2*t+1],C=c[2*v],D=c[2*v+1],E=2*s,F=2*u,G=2*w,H=2*n,I=2*p,J=2*o,K=0;2>K;++K){var L=c[E+K],M=c[F+K],N=c[G+K];c[H+K]=L,c[I+K]=M,c[J+K]=N}g(q,a,c),g(r,b,c);for(var O=x;y>=O;++O)if(k(O,A,B,c))O!==x&&f(O,x,c),++x;else if(!k(O,C,D,c))for(;;){if(k(y,C,D,c)){k(y,A,B,c)?(h(O,x,y,c),++x,--y):(f(O,y,c),--y);break}if(--y<O)break}i(a,x-1,A,B,c),i(b,y+1,C,D,c),m>=x-2-a?e(a,x-2,c):l(a,x-2,c),m>=b-(y+2)?e(y+2,b,c):l(y+2,b,c),m>=y-x?e(x,y,c):l(x,y,c)}b.exports=d;var m=32},{}],269:[function(a,b,c){"use strict";function d(a){var b=l.nextPow2(a);p.length<b&&(k.free(p),p=k.mallocInt32(b)),q.length<b&&(k.free(q),q=k.mallocInt32(b)),r.length<b&&(k.free(r),r=k.mallocInt32(b)),s.length<b&&(k.free(s),s=k.mallocInt32(b)),t.length<b&&(k.free(t),t=k.mallocInt32(b)),u.length<b&&(k.free(u),u=k.mallocInt32(b));var c=8*b;v.length<c&&(k.free(v),v=k.mallocDouble(c))}function e(a,b,c,d){var e=b[d],f=a[c-1];a[e]=f,b[f]=e}function f(a,b,c,d){a[c]=d,b[d]=c}function g(a,b,c,d,g,h,i,j,k,l){for(var o=0,t=2*a,u=a-1,w=t-1,x=c;d>x;++x){var y=h[x],z=t*x;v[o++]=g[z+u],v[o++]=-(y+1),v[o++]=g[z+w],v[o++]=y}for(var x=i;j>x;++x){var y=l[x]+n,A=t*x;v[o++]=k[A+u],v[o++]=-y,v[o++]=k[A+w],v[o++]=y}var B=o>>>1;m(v,B);for(var C=0,D=0,x=0;B>x;++x){var E=0|v[2*x+1];if(E>=n)E=E-n|0,e(r,s,D--,E);else if(E>=0)e(p,q,C--,E);else if(-n>=E){E=-E-n|0;for(var F=0;C>F;++F){var G=b(p[F],E);if(void 0!==G)return G}f(r,s,D++,E)}else{E=-E-1|0;for(var F=0;D>F;++F){var G=b(E,r[F]);if(void 0!==G)return G}f(p,q,C++,E)}}}function h(a,b,c,d,g,h,i,j,k,l){for(var n=0,o=2*a,w=a-1,x=o-1,y=c;d>y;++y){var z=h[y]+1<<1,A=o*y;v[n++]=g[A+w],v[n++]=-z,v[n++]=g[A+x],v[n++]=z}for(var y=i;j>y;++y){var z=l[y]+1<<1,B=o*y;v[n++]=k[B+w],v[n++]=1|-z,v[n++]=k[B+x],v[n++]=1|z}var C=n>>>1;m(v,C);for(var D=0,E=0,F=0,y=0;C>y;++y){var G=0|v[2*y+1],H=1&G;if(C-1>y&&G>>1===v[2*y+3]>>1&&(H=2,y+=1),0>G){for(var I=-(G>>1)-1,J=0;F>J;++J){var K=b(t[J],I);if(void 0!==K)return K}if(0!==H)for(var J=0;D>J;++J){var K=b(p[J],I);if(void 0!==K)return K}if(1!==H)for(var J=0;E>J;++J){var K=b(r[J],I);if(void 0!==K)return K}0===H?f(p,q,D++,I):1===H?f(r,s,E++,I):2===H&&f(t,u,F++,I)}else{var I=(G>>1)-1;0===H?e(p,q,D--,I):1===H?e(r,s,E--,I):2===H&&e(t,u,F--,I)}}}function i(a,b,c,d,g,h,i,j,k,l,o,r){var s=0,t=2*a,u=b,w=b+a,x=1,y=1;d?y=n:x=n;for(var z=g;h>z;++z){var A=z+x,B=t*z;v[s++]=i[B+u],v[s++]=-A,v[s++]=i[B+w],v[s++]=A}for(var z=k;l>z;++z){var A=z+y,C=t*z;v[s++]=o[C+u],v[s++]=-A}var D=s>>>1;m(v,D);for(var E=0,z=0;D>z;++z){var F=0|v[2*z+1];if(0>F){var A=-F,G=!1;if(A>=n?(G=!d,A-=n):(G=!!d,A-=1),G)f(p,q,E++,A);else{var H=r[A],I=t*A,J=o[I+b+1],K=o[I+b+1+a];a:for(var L=0;E>L;++L){var M=p[L],N=t*M;if(!(K<i[N+b+1]||i[N+b+1+a]<J)){for(var O=b+2;a>O;++O)if(o[I+O+a]<i[N+O]||i[N+O+a]<o[I+O])continue a;var P,Q=j[M];if(P=d?c(H,Q):c(Q,H),void 0!==P)return P}}}}else e(p,q,E--,F-x)}}function j(a,b,c,d,e,f,g,h,i,j,k){for(var l=0,o=2*a,q=b,r=b+a,s=d;e>s;++s){var t=s+n,u=o*s;v[l++]=f[u+q],v[l++]=-t,v[l++]=f[u+r],v[l++]=t}for(var s=h;i>s;++s){var t=s+1,w=o*s;v[l++]=j[w+q],v[l++]=-t}var x=l>>>1;m(v,x);for(var y=0,s=0;x>s;++s){var z=0|v[2*s+1];if(0>z){var t=-z;if(t>=n)p[y++]=t-n;else{t-=1;var A=k[t],B=o*t,C=j[B+b+1],D=j[B+b+1+a];a:for(var E=0;y>E;++E){var F=p[E],G=g[F];if(G===A)break;var H=o*F;if(!(D<f[H+b+1]||f[H+b+1+a]<C)){for(var I=b+2;a>I;++I)if(j[B+I+a]<f[H+I]||f[H+I+a]<j[B+I])continue a;var J=c(G,A);if(void 0!==J)return J}}}}else{for(var t=z-n,E=y-1;E>=0;--E)if(p[E]===t){for(var I=E+1;y>I;++I)p[I-1]=p[I];break}--y}}}b.exports={init:d,sweepBipartite:g,sweepComplete:h,scanBipartite:i,scanComplete:j};var k=a("typedarray-pool"),l=a("bit-twiddle"),m=a("./sort"),n=1<<28,o=1024,p=k.mallocInt32(o),q=k.mallocInt32(o),r=k.mallocInt32(o),s=k.mallocInt32(o),t=k.mallocInt32(o),u=k.mallocInt32(o),v=k.mallocDouble(8*o)},{"./sort":268,"bit-twiddle":49,"typedarray-pool":233}],270:[function(a,b,c){(function(a){function c(a,b){return n[0]=a,n[1]=b,m[0]}function d(a){return m[0]=a,n[0]}function e(a){return m[0]=a,n[1]}function f(a,b){return n[1]=a,n[0]=b,m[0]}function g(a){return m[0]=a,n[1]}function h(a){return m[0]=a,n[0]}function i(a,b){return o.writeUInt32LE(a,0,!0),o.writeUInt32LE(b,4,!0),o.readDoubleLE(0,!0)}function j(a){return o.writeDoubleLE(a,0,!0),o.readUInt32LE(0,!0)}function k(a){return o.writeDoubleLE(a,0,!0),o.readUInt32LE(4,!0)}var l=!1;if("undefined"!=typeof Float64Array){var m=new Float64Array(1),n=new Uint32Array(m.buffer);m[0]=1,l=!0,1072693248===n[1]?(b.exports=function(a){return m[0]=a,[n[0],n[1]]},b.exports.pack=c,b.exports.lo=d,b.exports.hi=e):1072693248===n[0]?(b.exports=function(a){return m[0]=a,[n[1],n[0]]},b.exports.pack=f,b.exports.lo=g,b.exports.hi=h):l=!1}if(!l){var o=new a(8);b.exports=function(a){return o.writeDoubleLE(a,0,!0),[o.readUInt32LE(0,!0),o.readUInt32LE(4,!0)]},b.exports.pack=i,b.exports.lo=j,b.exports.hi=k}b.exports.sign=function(a){return b.exports.hi(a)>>>31},b.exports.exponent=function(a){var c=b.exports.hi(a);return(c<<1>>>21)-1023},b.exports.fraction=function(a){var c=b.exports.lo(a),d=b.exports.hi(a),e=1048575&d;return 2146435072&d&&(e+=1<<20),[c,e]},b.exports.denormalized=function(a){var c=b.exports.hi(a);return!(2146435072&c)}}).call(this,a("buffer").Buffer)},{buffer:50}],271:[function(a,b,c){"use strict";function d(a,b){if(isNaN(a)||isNaN(b))return NaN;if(a===b)return a;if(0===a)return 0>b?-f:f;var c=e.hi(a),d=e.lo(a);return b>a==a>0?d===g?(c+=1,d=0):d+=1:0===d?(d=g,c-=1):d-=1,e.pack(d,c)}var e=a("double-bits"),f=Math.pow(2,-1074),g=-1>>>0;b.exports=d},{"double-bits":270}],272:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),f=0;c>f;++f)d[f]=e(a[f],b[f]);return d}var e=a("big-rat/add");b.exports=d},{"big-rat/add":246}],273:[function(a,b,c){"use strict";function d(a){for(var b=new Array(a.length),c=0;c<a.length;++c)b[c]=e(a[c]);return b}b.exports=d;var e=a("big-rat")},{"big-rat":249}],274:[function(a,b,c){"use strict";function d(a,b){for(var c=e(b),d=a.length,g=new Array(d),h=0;d>h;++h)g[h]=f(a[h],c);return g}var e=a("big-rat"),f=a("big-rat/mul");b.exports=d},{"big-rat":249,"big-rat/mul":258}],275:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),f=0;c>f;++f)d[f]=e(a[f],b[f]);return d}var e=a("big-rat/sub");b.exports=d},{"big-rat/sub":261}],276:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=0;2>e;++e){var f=a[e],g=b[e],h=Math.min(f,g),i=Math.max(f,g),j=c[e],k=d[e],l=Math.min(j,k),m=Math.max(j,k);if(h>m||l>i)return!1}return!0}function e(a,b,c,e){var g=f(a,c,e),h=f(b,c,e);if(g>0&&h>0||0>g&&0>h)return!1;var i=f(c,a,b),j=f(e,a,b);return i>0&&j>0||0>i&&0>j?!1:0===g&&0===h&&0===i&&0===j?d(a,b,c,e):!0}b.exports=e;var f=a("robust-orientation")[3]},{"robust-orientation":214}],277:[function(a,b,c){arguments[4][193][0].apply(c,arguments)},{dup:193}],278:[function(a,b,c){"use strict";function d(a,b){for(var c=e(a,b.length),d=new Array(b.length),f=new Array(b.length),g=[],h=0;h<b.length;++h){var i=c[h].length;f[h]=i,d[h]=!0,1>=i&&g.push(h)}for(;g.length>0;){var j=g.pop();d[j]=!1;for(var k=c[j],h=0;h<k.length;++h){var l=k[h];0===--f[l]&&g.push(l)}}for(var m=new Array(b.length),n=[],h=0;h<b.length;++h)if(d[h]){var j=n.length;m[h]=j,n.push(b[h])}else m[h]=-1;for(var o=[],h=0;h<a.length;++h){var p=a[h];d[p[0]]&&d[p[1]]&&o.push([m[p[0]],m[p[1]]])}return[o,n]}b.exports=d;var e=a("edges-to-adjacency-list")},{"edges-to-adjacency-list":279}],279:[function(a,b,c){"use strict";function d(a,b){var c=a.length;if("number"!=typeof b){b=0;for(var d=0;c>d;++d){var f=a[d];b=Math.max(b,f[0],f[1])}b=(0|b)+1}b=0|b;for(var g=new Array(b),d=0;b>d;++d)g[d]=[];for(var d=0;c>d;++d){var f=a[d];g[f[0]].push(f[1]),g[f[1]].push(f[0])}for(var h=0;b>h;++h)e(g[h],function(a,b){return a-b});return g}b.exports=d;var e=a("uniq")},{uniq:234}],280:[function(a,b,c){"use strict";function d(a,b){function c(a,b){var c=j[b][a[b]];c.splice(c.indexOf(a),1)}function d(a,d,f){for(var g,h,i,k=0;2>k;++k)if(j[k][d].length>0){g=j[k][d][0],i=k;break}h=g[1^i];for(var l=0;2>l;++l)for(var m=j[l][d],n=0;n<m.length;++n){var o=m[n],p=o[1^l],q=e(b[a],b[d],b[h],b[p]);q>0&&(g=o,h=p,i=l)}return f?h:(g&&c(g,i),h)}function f(a,f){var g=j[f][a][0],h=[a];c(g,f);for(var i=g[1^f];;){for(;i!==a;)h.push(i),i=d(h[h.length-2],i,!1);if(j[0][a].length+j[1][a].length===0)break;var k=h[h.length-1],l=a,m=h[1],n=d(k,l,!0);if(e(b[k],b[l],b[m],b[n])<0)break;h.push(a),i=d(k,l)}return h}function g(a,b){return b[1]===b[b.length-1]}for(var h=0|b.length,i=a.length,j=[new Array(h),new Array(h)],k=0;h>k;++k)j[0][k]=[],j[1][k]=[];for(var k=0;i>k;++k){var l=a[k];j[0][l[0]].push(l),j[1][l[1]].push(l)}for(var m=[],k=0;h>k;++k)j[0][k].length+j[1][k].length===0&&m.push([k]);for(var k=0;h>k;++k)for(var n=0;2>n;++n){for(var o=[];j[n][k].length>0;){var p=(j[0][k].length,f(k,n));g(o,p)?o.push.apply(o,p):(o.length>0&&m.push(o),o=p)}o.length>0&&m.push(o)}return m}b.exports=d;var e=a("compare-angle")},{"compare-angle":281}],281:[function(a,b,c){"use strict";function d(a,b,c){var d=h(a[0],-b[0]),e=h(a[1],-b[1]),f=h(c[0],-b[0]),g=h(c[1],-b[1]),k=j(i(d,f),i(e,g));return k[k.length-1]>=0}function e(a,b,c,e){var h=f(b,c,e);if(0===h){var i=g(f(a,b,c)),j=g(f(a,b,e));if(i===j){if(0===i){var k=d(a,b,c),l=d(a,b,e);return k===l?0:k?1:-1}return 0}return 0===j?i>0?-1:d(a,b,e)?-1:1:0===i?j>0?1:d(a,b,c)?1:-1:g(j-i)}var m=f(a,b,c);if(m>0)return h>0&&f(a,b,e)>0?1:-1;if(0>m)return h>0||f(a,b,e)>0?1:-1;var n=f(a,b,e);return n>0?1:d(a,b,c)?1:-1}b.exports=e;var f=a("robust-orientation"),g=a("signum"),h=a("two-sum"),i=a("robust-product"),j=a("robust-sum")},{"robust-orientation":214,"robust-product":282,"robust-sum":217,signum:283,"two-sum":232}],282:[function(a,b,c){"use strict";function d(a,b){if(1===a.length)return f(b,a[0]);if(1===b.length)return f(a,b[0]);if(0===a.length||0===b.length)return[0];var c=[0];if(a.length<b.length)for(var d=0;d<a.length;++d)c=e(c,f(b,a[d]));else for(var d=0;d<b.length;++d)c=e(c,f(a,b[d]));return c}var e=a("robust-sum"),f=a("robust-scale");b.exports=d},{"robust-scale":215,"robust-sum":217}],283:[function(a,b,c){"use strict";b.exports=function(a){return 0>a?-1:a>0?1:0}},{}],284:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],285:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.mid=a,this.left=b,this.right=c,this.leftPoints=d,this.rightPoints=e,this.count=(b?b.count:0)+(c?c.count:0)+d.length}function e(a,b){a.mid=b.mid,a.left=b.left,a.right=b.right,a.leftPoints=b.leftPoints,a.rightPoints=b.rightPoints,a.count=b.count}function f(a,b){var c=o(b);a.mid=c.mid,a.left=c.left,a.right=c.right,a.leftPoints=c.leftPoints,a.rightPoints=c.rightPoints,a.count=c.count}function g(a,b){var c=a.intervals([]);c.push(b),f(a,c)}function h(a,b){var c=a.intervals([]),d=c.indexOf(b);return 0>d?s:(c.splice(d,1),f(a,c),t)}function i(a,b,c){for(var d=0;d<a.length&&a[d][0]<=b;++d){var e=c(a[d]);if(e)return e}}function j(a,b,c){for(var d=a.length-1;d>=0&&a[d][1]>=b;--d){var e=c(a[d]);if(e)return e}}function k(a,b){for(var c=0;c<a.length;++c){var d=b(a[c]);if(d)return d}}function l(a,b){return a-b}function m(a,b){var c=a[0]-b[0];return c?c:a[1]-b[1]}function n(a,b){var c=a[1]-b[1];return c?c:a[0]-b[0]}function o(a){if(0===a.length)return null;for(var b=[],c=0;c<a.length;++c)b.push(a[c][0],a[c][1]);b.sort(l);for(var e=b[b.length>>1],f=[],g=[],h=[],c=0;c<a.length;++c){var i=a[c];i[1]<e?f.push(i):e<i[0]?g.push(i):h.push(i)}var j=h,k=h.slice();return j.sort(m),k.sort(n),new d(e,o(f),o(g),j,k)}function p(a){this.root=a}function q(a){return new p(a&&0!==a.length?o(a):null)}var r=a("binary-search-bounds"),s=0,t=1,u=2;b.exports=q;var v=d.prototype;v.intervals=function(a){return a.push.apply(a,this.leftPoints),this.left&&this.left.intervals(a),this.right&&this.right.intervals(a),a},v.insert=function(a){var b=this.count-this.leftPoints.length;if(this.count+=1,a[1]<this.mid)this.left?4*(this.left.count+1)>3*(b+1)?g(this,a):this.left.insert(a):this.left=o([a]);else if(a[0]>this.mid)this.right?4*(this.right.count+1)>3*(b+1)?g(this,a):this.right.insert(a):this.right=o([a]);else{var c=r.ge(this.leftPoints,a,m),d=r.ge(this.rightPoints,a,n);this.leftPoints.splice(c,0,a),this.rightPoints.splice(d,0,a)}},v.remove=function(a){var b=this.count-this.leftPoints;if(a[1]<this.mid){if(!this.left)return s;var c=this.right?this.right.count:0;if(4*c>3*(b-1))return h(this,a);var d=this.left.remove(a);return d===u?(this.left=null,this.count-=1,t):(d===t&&(this.count-=1),d)}if(a[0]>this.mid){if(!this.right)return s;var f=this.left?this.left.count:0;if(4*f>3*(b-1))return h(this,a);var d=this.right.remove(a);return d===u?(this.right=null,this.count-=1,t):(d===t&&(this.count-=1),d)}if(1===this.count)return this.leftPoints[0]===a?u:s;if(1===this.leftPoints.length&&this.leftPoints[0]===a){if(this.left&&this.right){for(var g=this,i=this.left;i.right;)g=i,i=i.right;if(g===this)i.right=this.right;else{var j=this.left,d=this.right;g.count-=i.count,g.right=i.left,i.left=j,i.right=d}e(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?e(this,this.left):e(this,this.right);return t}for(var j=r.ge(this.leftPoints,a,m);j<this.leftPoints.length&&this.leftPoints[j][0]===a[0];++j)if(this.leftPoints[j]===a){this.count-=1,this.leftPoints.splice(j,1);for(var d=r.ge(this.rightPoints,a,n);d<this.rightPoints.length&&this.rightPoints[d][1]===a[1];++d)if(this.rightPoints[d]===a)return this.rightPoints.splice(d,1),t}return s},v.queryPoint=function(a,b){if(a<this.mid){if(this.left){var c=this.left.queryPoint(a,b);if(c)return c}return i(this.leftPoints,a,b)}if(a>this.mid){if(this.right){var c=this.right.queryPoint(a,b);if(c)return c}return j(this.rightPoints,a,b)}return k(this.leftPoints,b)},v.queryInterval=function(a,b,c){if(a<this.mid&&this.left){var d=this.left.queryInterval(a,b,c);if(d)return d}if(b>this.mid&&this.right){var d=this.right.queryInterval(a,b,c);if(d)return d}return b<this.mid?i(this.leftPoints,b,c):a>this.mid?j(this.rightPoints,a,c):k(this.leftPoints,c)};var w=p.prototype;w.insert=function(a){this.root?this.root.insert(a):this.root=new d(a[0],null,null,[a],[a])},w.remove=function(a){if(this.root){var b=this.root.remove(a);return b===u&&(this.root=null),b!==s}return!1},w.queryPoint=function(a,b){return this.root?this.root.queryPoint(a,b):void 0},w.queryInterval=function(a,b,c){return b>=a&&this.root?this.root.queryInterval(a,b,c):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":284}],286:[function(a,b,c){"use strict";function d(a,b){var c,d;if(b[0][0]<b[1][0])c=b[0],d=b[1];else{if(!(b[0][0]>b[1][0])){var e=Math.min(a[0][1],a[1][1]),g=Math.max(a[0][1],a[1][1]),h=Math.min(b[0][1],b[1][1]),i=Math.max(b[0][1],b[1][1]);return h>g?g-h:e>i?e-i:g-i}c=b[1],d=b[0]}var j,k;a[0][1]<a[1][1]?(j=a[0],k=a[1]):(j=a[1],k=a[0]);var l=f(d,c,j);return l?l:(l=f(d,c,k),l?l:k-d)}function e(a,b){var c,e;if(b[0][0]<b[1][0])c=b[0],e=b[1];else{if(!(b[0][0]>b[1][0]))return d(b,a);c=b[1],e=b[0]}var g,h;if(a[0][0]<a[1][0])g=a[0],h=a[1];else{if(!(a[0][0]>a[1][0]))return-d(a,b);g=a[1],h=a[0]}var i=f(c,e,h),j=f(c,e,g);if(0>i){if(0>=j)return i}else if(i>0){if(j>=0)return i}else if(j)return j;if(i=f(h,g,e),j=f(h,g,c),0>i){if(0>=j)return i}else if(i>0){if(j>=0)return i}else if(j)return j;return e[0]-h[0]}b.exports=e;var f=a("robust-orientation")},{"robust-orientation":214}],287:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this._color=a,this.key=b,this.value=c,this.left=d,this.right=e,this._count=f}function e(a){return new d(a._color,a.key,a.value,a.left,a.right,a._count)}function f(a,b){return new d(a,b.key,b.value,b.left,b.right,b._count)}function g(a){a._count=1+(a.left?a.left._count:0)+(a.right?a.right._count:0)}function h(a,b){this._compare=a,this.root=b}function i(a,b){if(b.left){var c=i(a,b.left);if(c)return c}var c=a(b.key,b.value);return c?c:b.right?i(a,b.right):void 0}function j(a,b,c,d){var e=b(a,d.key);if(0>=e){if(d.left){var f=j(a,b,c,d.left);if(f)return f}var f=c(d.key,d.value);if(f)return f}return d.right?j(a,b,c,d.right):void 0}function k(a,b,c,d,e){var f,g=c(a,e.key),h=c(b,e.key);if(0>=g){if(e.left&&(f=k(a,b,c,d,e.left)))return f;if(h>0&&(f=d(e.key,e.value)))return f}return h>0&&e.right?k(a,b,c,d,e.right):void 0}function l(a,b){this.tree=a,this._stack=b}function m(a,b){a.key=b.key,a.value=b.value,a.left=b.left,a.right=b.right,a._color=b._color,a._count=b._count}function n(a){for(var b,c,d,h,i=a.length-1;i>=0;--i){if(b=a[i],0===i)return void(b._color=r);if(c=a[i-1],c.left===b){if(d=c.right,d.right&&d.right._color===q){if(d=c.right=e(d),h=d.right=e(d.right),c.right=d.left,d.left=c,d.right=h,d._color=c._color,b._color=r,c._color=r,h._color=r,g(c),g(d),i>1){var j=a[i-2];j.left===c?j.left=d:j.right=d}return void(a[i-1]=d)}if(d.left&&d.left._color===q){if(d=c.right=e(d),h=d.left=e(d.left),c.right=h.left,d.left=h.right,h.left=c,h.right=d,h._color=c._color,c._color=r,d._color=r,b._color=r,g(c),g(d),g(h),i>1){var j=a[i-2];j.left===c?j.left=h:j.right=h}return void(a[i-1]=h)}if(d._color===r){if(c._color===q)return c._color=r,void(c.right=f(q,d));c.right=f(q,d);continue}if(d=e(d),c.right=d.left,d.left=c,d._color=c._color,c._color=q,g(c),g(d),i>1){var j=a[i-2];j.left===c?j.left=d:j.right=d}a[i-1]=d,a[i]=c,i+1<a.length?a[i+1]=b:a.push(b),i+=2}else{if(d=c.left,d.left&&d.left._color===q){if(d=c.left=e(d),h=d.left=e(d.left),c.left=d.right,d.right=c,d.left=h,d._color=c._color,b._color=r,c._color=r,h._color=r,g(c),g(d),i>1){var j=a[i-2];j.right===c?j.right=d:j.left=d}return void(a[i-1]=d)}if(d.right&&d.right._color===q){if(d=c.left=e(d),h=d.right=e(d.right),c.left=h.right,d.right=h.left,h.right=c,h.left=d,h._color=c._color,c._color=r,d._color=r,b._color=r,g(c),g(d),g(h),i>1){var j=a[i-2];j.right===c?j.right=h:j.left=h}return void(a[i-1]=h)}if(d._color===r){if(c._color===q)return c._color=r,void(c.left=f(q,d));c.left=f(q,d);continue}if(d=e(d),c.left=d.right,d.right=c,d._color=c._color,c._color=q,g(c),g(d),i>1){var j=a[i-2];j.right===c?j.right=d:j.left=d}a[i-1]=d,a[i]=c,i+1<a.length?a[i+1]=b:a.push(b),i+=2}}}function o(a,b){return b>a?-1:a>b?1:0}function p(a){return new h(a||o,null)}b.exports=p;var q=0,r=1,s=h.prototype;Object.defineProperty(s,"keys",{get:function(){var a=[];return this.forEach(function(b,c){a.push(b)}),a}}),Object.defineProperty(s,"values",{get:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a}}),Object.defineProperty(s,"length",{get:function(){return this.root?this.root._count:0}}),s.insert=function(a,b){for(var c=this._compare,e=this.root,i=[],j=[];e;){var k=c(a,e.key);i.push(e),j.push(k),e=0>=k?e.left:e.right}i.push(new d(q,a,b,null,null,1));for(var l=i.length-2;l>=0;--l){var e=i[l];j[l]<=0?i[l]=new d(e._color,e.key,e.value,i[l+1],e.right,e._count+1):i[l]=new d(e._color,e.key,e.value,e.left,i[l+1],e._count+1)}for(var l=i.length-1;l>1;--l){var m=i[l-1],e=i[l];if(m._color===r||e._color===r)break;var n=i[l-2];if(n.left===m)if(m.left===e){var o=n.right;if(!o||o._color!==q){if(n._color=q,n.left=m.right,m._color=r,m.right=n,i[l-2]=m,i[l-1]=e,g(n),g(m),l>=3){var p=i[l-3];p.left===n?p.left=m:p.right=m}break}m._color=r,n.right=f(r,o),n._color=q,l-=1}else{var o=n.right;if(!o||o._color!==q){if(m.right=e.left,n._color=q,n.left=e.right,e._color=r,e.left=m,e.right=n,i[l-2]=e,i[l-1]=m,g(n),g(m),g(e),l>=3){var p=i[l-3];p.left===n?p.left=e:p.right=e}break}m._color=r,n.right=f(r,o),n._color=q,l-=1}else if(m.right===e){var o=n.left;if(!o||o._color!==q){if(n._color=q,n.right=m.left,m._color=r,m.left=n,i[l-2]=m,i[l-1]=e,g(n),g(m),l>=3){var p=i[l-3];p.right===n?p.right=m:p.left=m}break}m._color=r,n.left=f(r,o),n._color=q,l-=1}else{var o=n.left;if(!o||o._color!==q){if(m.left=e.right,n._color=q,n.right=e.left,e._color=r,e.right=m,e.left=n,i[l-2]=e,i[l-1]=m,g(n),g(m),g(e),l>=3){var p=i[l-3];p.right===n?p.right=e:p.left=e}break}m._color=r,n.left=f(r,o),n._color=q,l-=1}}return i[0]._color=r,new h(c,i[0])},s.forEach=function(a,b,c){if(this.root)switch(arguments.length){case 1:return i(a,this.root);case 2:return j(b,this._compare,a,this.root);case 3:if(this._compare(b,c)>=0)return;return k(b,c,this._compare,a,this.root)}},Object.defineProperty(s,"begin",{get:function(){for(var a=[],b=this.root;b;)a.push(b),b=b.left;return new l(this,a)}}),Object.defineProperty(s,"end",{get:function(){for(var a=[],b=this.root;b;)a.push(b),b=b.right;return new l(this,a)}}),s.at=function(a){if(0>a)return new l(this,[]);for(var b=this.root,c=[];;){if(c.push(b),b.left){if(a<b.left._count){b=b.left;continue}a-=b.left._count}if(!a)return new l(this,c);if(a-=1,!b.right)break;if(a>=b.right._count)break;b=b.right}return new l(this,[])},s.ge=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),0>=f&&(e=d.length),c=0>=f?c.left:c.right}return d.length=e,new l(this,d)},s.gt=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),0>f&&(e=d.length),c=0>f?c.left:c.right}return d.length=e,new l(this,d)},s.lt=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),f>0&&(e=d.length),c=0>=f?c.left:c.right}return d.length=e,new l(this,d)},s.le=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),f>=0&&(e=d.length),c=0>f?c.left:c.right}return d.length=e,new l(this,d)},s.find=function(a){for(var b=this._compare,c=this.root,d=[];c;){var e=b(a,c.key);if(d.push(c),0===e)return new l(this,d);c=0>=e?c.left:c.right}return new l(this,[])},s.remove=function(a){var b=this.find(a);return b?b.remove():this},s.get=function(a){for(var b=this._compare,c=this.root;c;){var d=b(a,c.key);if(0===d)return c.value;c=0>=d?c.left:c.right}};var t=l.prototype;Object.defineProperty(t,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(t,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),t.clone=function(){return new l(this.tree,this._stack.slice())},t.remove=function(){var a=this._stack;if(0===a.length)return this.tree;var b=new Array(a.length),c=a[a.length-1];b[b.length-1]=new d(c._color,c.key,c.value,c.left,c.right,c._count);for(var e=a.length-2;e>=0;--e){var c=a[e];c.left===a[e+1]?b[e]=new d(c._color,c.key,c.value,b[e+1],c.right,c._count):b[e]=new d(c._color,c.key,c.value,c.left,b[e+1],c._count)}if(c=b[b.length-1],c.left&&c.right){var f=b.length;for(c=c.left;c.right;)b.push(c),c=c.right;var g=b[f-1];b.push(new d(c._color,g.key,g.value,c.left,c.right,c._count)),b[f-1].key=c.key,b[f-1].value=c.value;for(var e=b.length-2;e>=f;--e)c=b[e],b[e]=new d(c._color,c.key,c.value,c.left,b[e+1],c._count);b[f-1].left=b[f]}if(c=b[b.length-1],c._color===q){var i=b[b.length-2];i.left===c?i.left=null:i.right===c&&(i.right=null),b.pop();for(var e=0;e<b.length;++e)b[e]._count--;return new h(this.tree._compare,b[0])}if(c.left||c.right){c.left?m(c,c.left):c.right&&m(c,c.right),c._color=r;for(var e=0;e<b.length-1;++e)b[e]._count--;return new h(this.tree._compare,b[0])}if(1===b.length)return new h(this.tree._compare,null);for(var e=0;e<b.length;++e)b[e]._count--;var j=b[b.length-2];return n(b),j.left===c?j.left=null:j.right=null,new h(this.tree._compare,b[0])},Object.defineProperty(t,"key",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(t,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},enumerable:!0}),Object.defineProperty(t,"index",{get:function(){var a=0,b=this._stack;if(0===b.length){var c=this.tree.root;return c?c._count:0}b[b.length-1].left&&(a=b[b.length-1].left._count);for(var d=b.length-2;d>=0;--d)b[d+1]===b[d].right&&(++a,b[d].left&&(a+=b[d].left._count));return a},enumerable:!0}),t.next=function(){var a=this._stack;if(0!==a.length){var b=a[a.length-1];if(b.right)for(b=b.right;b;)a.push(b),b=b.left;else for(a.pop();a.length>0&&a[a.length-1].right===b;)b=a[a.length-1],a.pop()}},Object.defineProperty(t,"hasNext",{get:function(){var a=this._stack;if(0===a.length)return!1;if(a[a.length-1].right)return!0;for(var b=a.length-1;b>0;--b)if(a[b-1].left===a[b])return!0;return!1}}),t.update=function(a){var b=this._stack;if(0===b.length)throw new Error("Can't update empty node!");var c=new Array(b.length),e=b[b.length-1];c[c.length-1]=new d(e._color,e.key,a,e.left,e.right,e._count);for(var f=b.length-2;f>=0;--f)e=b[f],e.left===b[f+1]?c[f]=new d(e._color,e.key,e.value,c[f+1],e.right,e._count):c[f]=new d(e._color,e.key,e.value,e.left,c[f+1],e._count);return new h(this.tree._compare,c[0])},t.prev=function(){var a=this._stack;if(0!==a.length){var b=a[a.length-1];if(b.left)for(b=b.left;b;)a.push(b),b=b.right;else for(a.pop();a.length>0&&a[a.length-1].left===b;)b=a[a.length-1],a.pop()}},Object.defineProperty(t,"hasPrev",{get:function(){var a=this._stack;if(0===a.length)return!1;if(a[a.length-1].left)return!0;for(var b=a.length-1;b>0;--b)if(a[b-1].right===a[b])return!0;return!1}})},{}],288:[function(a,b,c){"use strict";function d(a,b,c){this.slabs=a,this.coordinates=b,this.horizontal=c}function e(a,b){return a.y-b}function f(a,b){for(var c=null;a;){var d,e,g=a.key;g[0][0]<g[1][0]?(d=g[0],e=g[1]):(d=g[1],e=g[0]);var h=l(d,e,b);if(0>h)a=a.left;else if(h>0)if(b[0]!==g[1][0])c=a,a=a.right;else{var i=f(a.right,b);if(i)return i;a=a.left}else{if(b[0]!==g[1][0])return a;var i=f(a.right,b);if(i)return i;a=a.left}}return c}function g(a,b,c,d){this.y=a,this.index=b,this.start=c,this.closed=d}function h(a,b,c,d){this.x=a,this.segment=b,this.create=c,this.index=d}function i(a){for(var b=a.length,c=2*b,e=new Array(c),f=0;b>f;++f){var i=a[f],j=i[0][0]<i[1][0];e[2*f]=new h(i[0][0],i,j,f),e[2*f+1]=new h(i[1][0],i,!j,f)}e.sort(function(a,b){var c=a.x-b.x;return c?c:(c=a.create-b.create,c?c:Math.min(a.segment[0][1],a.segment[1][1])-Math.min(b.segment[0][1],b.segment[1][1]))});for(var l=k(m),n=[],o=[],p=[],f=0;c>f;){for(var q=e[f].x,r=[];c>f;){var s=e[f];if(s.x!==q)break;f+=1,s.segment[0][0]===s.x&&s.segment[1][0]===s.x?s.create&&(s.segment[0][1]<s.segment[1][1]?(r.push(new g(s.segment[0][1],s.index,!0,!0)),r.push(new g(s.segment[1][1],s.index,!1,!1))):(r.push(new g(s.segment[1][1],s.index,!0,!1)),r.push(new g(s.segment[0][1],s.index,!1,!0)))):l=s.create?l.insert(s.segment,s.index):l.remove(s.segment)}n.push(l.root),o.push(q),p.push(r)}return new d(n,o,p)}b.exports=i;var j=a("binary-search-bounds"),k=a("functional-red-black-tree"),l=a("robust-orientation"),m=a("./lib/order-segments"),n=d.prototype;n.castUp=function(a){var b=j.le(this.coordinates,a[0]);if(0>b)return-1;var c=(this.slabs[b],f(this.slabs[b],a)),d=-1;if(c&&(d=c.value),this.coordinates[b]===a[0]){var g=null;if(c&&(g=c.key),b>0){var h=f(this.slabs[b-1],a);h&&(g?m(h.key,g)>0&&(g=h.key,d=h.value):(d=h.value,g=h.key))}var i=this.horizontal[b];if(i.length>0){var k=j.ge(i,a[1],e);if(k<i.length){var n=i[k];if(a[1]===n.y){if(n.closed)return n.index;for(;k<i.length-1&&i[k+1].y===a[1];)if(k+=1,n=i[k],n.closed)return n.index;if(n.y===a[1]&&!n.start){if(k+=1,k>=i.length)return d;n=i[k]}}if(n.start)if(g){var o=l(g[0],g[1],[a[0],n.y]);g[0][0]>g[1][0]&&(o=-o),o>0&&(d=n.index)}else d=n.index;else n.y!==a[1]&&(d=n.index)}}}return d}},{"./lib/order-segments":286,"binary-search-bounds":284,"functional-red-black-tree":287,"robust-orientation":214}],289:[function(a,b,c){function d(){return!0}function e(a){return function(b,c){var e=a[b];return e?!!e.queryPoint(c,d):!1}}function f(a){for(var b={},c=0;c<a.length;++c){var d=a[c],f=d[0][0],g=d[0][1],h=d[1][1],i=[Math.min(g,h),Math.max(g,h)];f in b?b[f].push(i):b[f]=[i]}for(var j={},k=Object.keys(b),c=0;c<k.length;++c){var l=b[k[c]];j[k[c]]=n(l)}return e(j)}function g(a,b){return function(c){var d=o.le(b,c[0]);if(0>d)return 1;var e=a[d];if(!e){if(!(d>0&&b[d]===c[0]))return 1;e=a[d-1]}for(var f=1;e;){var g=e.key,h=l(c,g[0],g[1]);if(g[0][0]<g[1][0])if(0>h)e=e.left;else{if(!(h>0))return 0;f=-1,e=e.right}else if(h>0)e=e.left;else{if(!(0>h))return 0;f=1,e=e.right}}return f}}function h(a){return 1}function i(a){return function(b){return a(b[0],b[1])?0:1}}function j(a,b){return function(c){return a(c[0],c[1])?0:b(c)}}function k(a){for(var b=a.length,c=[],d=[],e=0;b>e;++e)for(var k=a[e],l=k.length,n=l-1,o=0;l>o;n=o++){var p=k[n],q=k[o];p[0]===q[0]?d.push([p,q]):c.push([p,q])}if(0===c.length)return 0===d.length?h:i(f(d));var r=m(c),s=g(r.slabs,r.coordinates);return 0===d.length?s:j(f(d),s)}b.exports=k;var l=a("robust-orientation")[3],m=a("slab-decomposition"),n=a("interval-tree-1d"),o=a("binary-search-bounds")},{"binary-search-bounds":284,"interval-tree-1d":285,"robust-orientation":214,"slab-decomposition":288}],290:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a),d=0;a>d;++d)c[d]=b;return c}function e(a){for(var b=new Array(a),c=0;a>c;++c)b[c]=[];return b}function f(a,b){function c(a){for(var c=a.length,d=[0],e=0;c>e;++e){var f=b[a[e]],g=b[a[(e+1)%c]],h=j(-f[0],f[1]),i=j(-f[0],g[1]),l=j(g[0],f[1]),m=j(g[0],g[1]);d=k(d,k(k(h,i),k(l,m)))}return d[d.length-1]>0}function f(a){for(var b=a.length,c=0;b>c;++c)if(!I[a[c]])return!1;return!0}var n=m(a,b);a=n[0],b=n[1];for(var o=b.length,p=(a.length,g(a,b.length)),q=0;o>q;++q)if(p[q].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var r=h(a,b);r=r.filter(c);for(var s=r.length,t=new Array(s),u=new Array(s),q=0;s>q;++q){t[q]=q;var v=new Array(s),w=r[q].map(function(a){return b[a]}),x=i([w]),y=0;a:for(var z=0;s>z;++z)if(v[z]=0,q!==z){for(var A=r[z],B=A.length,C=0;B>C;++C){var D=x(b[A[C]]);if(0!==D){0>D&&(v[z]=1,y+=1);continue a}}v[z]=1,y+=1}u[q]=[y,q,v]}u.sort(function(a,b){return b[0]-a[0]});for(var q=0;s>q;++q)for(var v=u[q],E=v[1],F=v[2],z=0;s>z;++z)F[z]&&(t[z]=E);for(var G=e(s),q=0;s>q;++q)G[q].push(t[q]),G[t[q]].push(q);for(var H={},I=d(o,!1),q=0;s>q;++q)for(var A=r[q],B=A.length,z=0;B>z;++z){var J=A[z],K=A[(z+1)%B],L=Math.min(J,K)+":"+Math.max(J,K);if(L in H){var M=H[L];G[M].push(q),G[q].push(M),I[J]=I[K]=!0}else H[L]=q; 44 }for(var N=[],O=d(s,-1),q=0;s>q;++q)t[q]!==q||f(r[q])?O[q]=-1:(N.push(q),O[q]=0);for(var n=[];N.length>0;){var P=N.pop(),Q=G[P];l(Q,function(a,b){return a-b});var R,S=Q.length,T=O[P];if(0===T){var A=r[P];R=[A]}for(var q=0;S>q;++q){var U=Q[q];if(!(O[U]>=0)&&(O[U]=1^T,N.push(U),0===T)){var A=r[U];f(A)||(A.reverse(),R.push(A))}}0===T&&n.push(R)}return n}b.exports=f;var g=a("edges-to-adjacency-list"),h=a("planar-dual"),i=a("point-in-big-polygon"),j=a("two-product"),k=a("robust-sum"),l=a("uniq"),m=a("./lib/trim-leaves")},{"./lib/trim-leaves":278,"edges-to-adjacency-list":279,"planar-dual":280,"point-in-big-polygon":289,"robust-sum":217,"two-product":231,uniq:234}],291:[function(a,b,c){arguments[4][49][0].apply(c,arguments)},{dup:49}],292:[function(a,b,c){"use strict";"use restrict";function d(a){this.roots=new Array(a),this.ranks=new Array(a);for(var b=0;a>b;++b)this.roots[b]=b,this.ranks[b]=0}b.exports=d,d.prototype.length=function(){return this.roots.length},d.prototype.makeSet=function(){var a=this.roots.length;return this.roots.push(a),this.ranks.push(0),a},d.prototype.find=function(a){for(var b=this.roots;b[a]!==a;){var c=b[a];b[a]=b[c],a=c}return a},d.prototype.link=function(a,b){var c=this.find(a),d=this.find(b);if(c!==d){var e=this.ranks,f=this.roots,g=e[c],h=e[d];h>g?f[c]=d:g>h?f[d]=c:(f[d]=c,++e[c])}}},{}],293:[function(a,b,c){arguments[4][194][0].apply(c,arguments)},{"bit-twiddle":291,dup:194,"union-find":292}],294:[function(a,b,c){"use strict";function d(a,b,c){var d=Math.abs(f(a,b,c)),e=Math.sqrt(Math.pow(b[0]-c[0],2)+Math.pow(b[1]-c[1],2));return d/e}function e(a,b,c){function e(a){if(u[a])return 1/0;var c=r[a],e=s[a];return 0>c||0>e?1/0:d(b[a],b[c],b[e])}function f(a,b){var c=z[a],d=z[b];z[a]=d,z[b]=c,A[c]=b,A[d]=a}function h(a){return t[z[a]]}function i(a){return 1&a?a-1>>1:(a>>1)-1}function j(a){for(var b=h(a);;){var c=b,d=2*a+1,e=2*(a+1),g=a;if(C>d){var i=h(d);c>i&&(g=d,c=i)}if(C>e){var j=h(e);c>j&&(g=e)}if(g===a)return a;f(a,g),a=g}}function k(a){for(var b=h(a);a>0;){var c=i(a);if(c>=0){var d=h(c);if(d>b){f(a,c),a=c;continue}}return a}}function l(){if(C>0){var a=z[0];return f(0,C-1),C-=1,j(0),a}return-1}function m(a,b){var c=z[a];return t[c]===b?a:(t[c]=-(1/0),k(a),l(),t[c]=b,C+=1,k(C-1))}function n(a){if(!u[a]){u[a]=!0;var b=r[a],c=s[a];r[c]>=0&&(r[c]=b),s[b]>=0&&(s[b]=c),A[b]>=0&&m(A[b],e(b)),A[c]>=0&&m(A[c],e(c))}}function o(a,b){if(a[b]<0)return b;var c=b,d=b;do{var e=a[d];if(!u[d]||0>e||e===d)break;if(d=e,e=a[d],!u[d]||0>e||e===d)break;d=e,c=a[c]}while(c!==d);for(var f=b;f!==d;f=a[f])a[f]=d;return d}for(var p=b.length,q=a.length,r=new Array(p),s=new Array(p),t=new Array(p),u=new Array(p),v=0;p>v;++v)r[v]=s[v]=-1,t[v]=1/0,u[v]=!1;for(var v=0;q>v;++v){var w=a[v];if(2!==w.length)throw new Error("Input must be a graph");var x=w[1],y=w[0];-1!==s[y]?s[y]=-2:s[y]=x,-1!==r[x]?r[x]=-2:r[x]=y}for(var z=[],A=new Array(p),v=0;p>v;++v){var B=t[v]=e(v);1/0>B?(A[v]=z.length,z.push(v)):A[v]=-1}for(var C=z.length,v=C>>1;v>=0;--v)j(v);for(;;){var D=l();if(0>D||t[D]>c)break;n(D)}for(var E=[],v=0;p>v;++v)u[v]||(A[v]=E.length,E.push(b[v].slice()));var F=(E.length,[]);return a.forEach(function(a){var b=o(r,a[0]),c=o(s,a[1]);if(b>=0&&c>=0&&b!==c){var d=A[b],e=A[c];d!==e&&F.push([d,e])}}),g.unique(g.normalize(F)),{positions:E,edges:F}}b.exports=e;var f=a("robust-orientation"),g=a("simplicial-complex")},{"robust-orientation":214,"simplicial-complex":293}],295:[function(a,b,c){"use strict";b.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],296:[function(a,b,c){"use strict";var d=a("./arrow_paths"),e=a("../../plots/cartesian"),f=a("../../plots/font_attributes"),g=a("../../lib/extend").extendFlat;b.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:g({},f,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:d.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",e.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",e.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":345,"../../plots/cartesian":375,"../../plots/font_attributes":383,"./arrow_paths":295}],297:[function(a,b,c){"use strict";function d(a,b){function c(b,c){return g.Lib.coerce(a,d,j.layoutAttributes,b,c)}var d={};c("opacity"),c("align"),c("bgcolor");var e=c("bordercolor"),f=g.Color.opacity(e);c("borderpad");var h=c("borderwidth"),i=c("showarrow");i&&(c("arrowcolor",f?d.bordercolor:g.Color.defaultLine),c("arrowhead"),c("arrowsize"),c("arrowwidth",2*(f&&h||1)),c("ax"),c("ay"),g.Lib.noneOrAll(a,d,["ax","ay"])),c("text",i?" ":"new text"),c("textangle"),g.Lib.coerceFont(c,"font",b.font);for(var k=["x","y"],l=0;2>l;l++){var m=k[l],n={_fullLayout:b},o=g.Axes.coerceRef(a,d,n,m),p=.5;if("paper"!==o){var q=g.Axes.getFromId(n,o);if(p=q.range[0]+p*(q.range[1]-q.range[0]),-1!==["date","category"].indexOf(q.type)&&"string"==typeof a[m]){var r;"date"===q.type?(r=g.Lib.dateTime2ms(a[m]),r!==!1&&(a[m]=r)):(q._categories||[]).length&&(r=q._categories.indexOf(a[m]),-1!==r&&(a[m]=r))}}c(m,p),i||c(m+"anchor")}return g.Lib.noneOrAll(a,d,["x","y"]),d}function e(a){var b=a._fullLayout;b.annotations.forEach(function(b){var c=g.Axes.getFromId(a,b.xref),d=g.Axes.getFromId(a,b.yref);if(c||d){var e=(b._xsize||0)/2,f=b._xshift||0,h=(b._ysize||0)/2,i=b._yshift||0,j=e-f,k=e+f,l=h-i,m=h+i;if(b.showarrow){var n=3*b.arrowsize*b.arrowwidth;j=Math.max(j,n),k=Math.max(k,n),l=Math.max(l,n),m=Math.max(m,n)}c&&c.autorange&&g.Axes.expand(c,[c.l2c(b.x)],{ppadplus:k,ppadminus:j}),d&&d.autorange&&g.Axes.expand(d,[d.l2c(b.y)],{ppadplus:m,ppadminus:l})}})}function f(a,b,c,d,e,f,g,h){var i=c-a,j=e-a,k=g-e,l=d-b,m=f-b,n=h-f,o=i*n-k*l;if(0===o)return null;var p=(j*n-k*m)/o,q=(j*l-i*m)/o;return 0>q||q>1||0>p||p>1?null:{x:a+i*p,y:b+l*p}}var g=a("../../plotly"),h=a("d3"),i=a("fast-isnumeric"),j=b.exports={};j.ARROWPATHS=a("./arrow_paths"),j.layoutAttributes=a("./attributes"),j.supplyLayoutDefaults=function(a,b){for(var c=a.annotations||[],e=b.annotations=[],f=0;f<c.length;f++)e.push(d(c[f]||{},b))},j.drawAll=function(a){var b=a._fullLayout;b._infolayer.selectAll(".annotation").remove();for(var c=0;c<b.annotations.length;c++)j.draw(a,c);return g.Plots.previousPromises(a)},j.add=function(a){var b=a._fullLayout.annotations.length;g.relayout(a,"annotations["+b+"]","add")},j.draw=function(a,b,c,e){function k(a){return a.call(g.Drawing.font,U).attr({"text-anchor":{left:"start",right:"end"}[I.align]||"middle"}),g.util.convertToTspans(a,l),a}function l(){function c(a,b){return"auto"===b&&(b=1/3>a?"left":a>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[b]}V.selectAll("tspan.line").attr({y:0,x:0});var d=P.select(".annotation-math-group"),e=!d.empty(),i=g.Drawing.bBox((e?d:V).node()),k=i.width,l=i.height,m=Math.round(k+2*S),n=Math.round(l+2*S);I._w=k,I._h=l;var p=!1;if(["x","y"].forEach(function(b){var d,e=g.Axes.getFromId(a,I[b+"ref"]||b),f=(M+("x"===b?0:90))*Math.PI/180,h=m*Math.abs(Math.cos(f))+n*Math.abs(Math.sin(f)),i=I[b+"anchor"];if(e){if(!e.autorange&&(I[b]-e.range[0])*(I[b]-e.range[1])>0)return void(p=!0);L[b]=e._offset+e.l2p(I[b]),d=.5}else d=I[b],"y"===b&&(d=1-d),L[b]="x"===b?w.l+w.w*d:w.t+w.h*d;var j=0;j=I.showarrow?I["a"+b]:h*c(d,i),L[b]+=j,I["_"+b+"type"]=e&&e.type,I["_"+b+"size"]=h,I["_"+b+"shift"]=j}),p)return void P.remove();var q,r;I.showarrow&&(q=g.Lib.constrain(L.x-I.ax,1,o.width-1),r=g.Lib.constrain(L.y-I.ay,1,o.height-1)),L.x=g.Lib.constrain(L.x,1,o.width-1),L.y=g.Lib.constrain(L.y,1,o.height-1);var s=S-i.top,t=S-i.left;e?d.select("svg").attr({x:S-1,y:S}):(V.attr({x:t,y:s}),V.selectAll("tspan.line").attr({y:s,x:t})),T.call(g.Drawing.setRect,Q/2,Q/2,m-Q,n-Q),P.call(g.Drawing.setRect,Math.round(L.x-m/2),Math.round(L.y-n/2),m,n);var u="annotations["+b+"]",v=function(c,d){h.select(a).selectAll('.annotation-arrow-g[data-index="'+b+'"]').remove();var e=L.x+c,i=L.y+d,k=g.Lib.rotationXYMatrix(M,e,i),l=g.Lib.apply2DTransform(k),m=g.Lib.apply2DTransform2(k),n=T.attr("width")/2,o=T.attr("height")/2,p=[[e-n,i-o,e-n,i+o],[e-n,i+o,e+n,i+o],[e+n,i+o,e+n,i-o],[e+n,i-o,e-n,i-o]].map(m);if(!p.reduce(function(a,b){return a^!!f(q,r,q+1e6,r+1e6,b[0],b[1],b[2],b[3])},!1)){p.forEach(function(a){var b=f(e,i,q,r,a[0],a[1],a[2],a[3]);b&&(e=b.x,i=b.y)});var s=I.arrowwidth,t=I.arrowcolor,v=N.append("g").style({opacity:g.Color.opacity(t)}).classed("annotation-arrow-g",!0).attr("data-index",String(b)),x=v.append("path").attr("d","M"+e+","+i+"L"+q+","+r).style("stroke-width",s+"px").call(g.Color.stroke,g.Color.rgb(t));j.arrowhead(x,I.arrowhead,"end",I.arrowsize);var y=v.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(b),d:"M3,3H-3V-3H3ZM0,0L"+(e-q)+","+(i-r),transform:"translate("+q+","+r+")"}).style("stroke-width",s+6+"px").call(g.Color.stroke,"rgba(0,0,0,0)").call(g.Color.fill,"rgba(0,0,0,0)");if(a._context.editable){var z,A,B;g.Fx.dragElement({element:y.node(),prepFn:function(){A=Number(P.attr("x")),B=Number(P.attr("y")),z={},J&&J.autorange&&(z[J._name+".autorange"]=!0),K&&K.autorange&&(z[K._name+".autorange"]=!0)},moveFn:function(a,b){v.attr("transform","translate("+a+","+b+")");var c=l(A,B),d=c[0]+a,e=c[1]+b;P.call(g.Drawing.setPosition,d,e),z[u+".x"]=J?I.x+a/J._m:(q+a-w.l)/w.w,z[u+".y"]=K?I.y+b/K._m:1-(r+b-w.t)/w.h,O.attr({transform:"rotate("+M+","+d+","+e+")"})},doneFn:function(b){if(b){g.relayout(a,z);var c=document.querySelector(".js-notes-box-panel");c&&c.redraw(c.selectedObj)}}})}}};I.showarrow&&v(0,0);var x=g.Lib.rotationXYMatrix(M,L.x,L.y),y=g.Lib.apply2DTransform(x);if(a._context.editable){var z,A,B;g.Fx.dragElement({element:P.node(),prepFn:function(){z=Number(P.attr("x")),A=Number(P.attr("y")),B={}},moveFn:function(a,b){P.call(g.Drawing.setPosition,z+a,A+b);var c="pointer";if(I.showarrow)B[u+".ax"]=I.ax+a,B[u+".ay"]=I.ay+b,v(a,b);else{if(J)B[u+".x"]=I.x+a/J._m;else{var d=I._xsize/w.w,e=I.x+I._xshift/w.w-d/2;B[u+".x"]=g.Fx.dragAlign(e+a/w.w,d,0,1,I.xanchor)}if(K)B[u+".y"]=I.y+b/K._m;else{var f=I._ysize/w.h,h=I.y-I._yshift/w.h-f/2;B[u+".y"]=g.Fx.dragAlign(h-b/w.h,f,0,1,I.yanchor)}J&&K||(c=g.Fx.dragCursors(J?.5:B[u+".x"],K?.5:B[u+".y"],I.xanchor,I.yanchor))}var i=y(z,A),j=i[0]+a,k=i[1]+b;P.call(g.Drawing.setPosition,j,k),O.attr({transform:"rotate("+M+","+j+","+k+")"}),g.Fx.setCursor(P,c)},doneFn:function(b){if(g.Fx.setCursor(P),b){g.relayout(a,B);var c=document.querySelector(".js-notes-box-panel");c&&c.redraw(c.selectedObj)}}})}}var m,n=a.layout,o=a._fullLayout;if(!i(b)||-1===b){if(!b&&Array.isArray(e))return n.annotations=e,j.supplyLayoutDefaults(n,o),void j.drawAll(a);if("remove"===e)return delete n.annotations,o.annotations=[],void j.drawAll(a);if(c&&"add"!==e){for(m=0;m<o.annotations.length;m++)j.draw(a,m,c,e);return}b=o.annotations.length,o.annotations.push({})}if(!c&&e){if("remove"===e){for(o._infolayer.selectAll('.annotation[data-index="'+b+'"]').remove(),o.annotations.splice(b,1),n.annotations.splice(b,1),m=b;m<o.annotations.length;m++)o._infolayer.selectAll('.annotation[data-index="'+(m+1)+'"]').attr("data-index",String(m)),j.draw(a,m);return}if("add"===e||g.Lib.isPlainObject(e)){o.annotations.splice(b,0,{});var p=g.Lib.isPlainObject(e)?g.Lib.extendFlat({},e):{text:"New text"};for(n.annotations?n.annotations.splice(b,0,p):n.annotations=[p],m=o.annotations.length-1;m>b;m--)o._infolayer.selectAll('.annotation[data-index="'+(m-1)+'"]').attr("data-index",String(m)),j.draw(a,m)}}o._infolayer.selectAll('.annotation[data-index="'+b+'"]').remove();var q=n.annotations[b],r=o.annotations[b];if(q){var s={xref:q.xref,yref:q.yref},t={};"string"==typeof c&&c?t[c]=e:g.Lib.isPlainObject(c)&&(t=c);var u=Object.keys(t);for(m=0;m<u.length;m++){var v=u[m];g.Lib.nestedProperty(q,v).set(t[v])}var w=o._size,x=["x","y"];for(m=0;2>m;m++){var y=x[m];if(void 0===t[y]&&void 0!==q[y]){var z=g.Axes.getFromId(a,g.Axes.coerceRef(s,{},a,y)),A=g.Axes.getFromId(a,g.Axes.coerceRef(q,{},a,y)),B=q[y],C=r["_"+y+"type"];if(void 0!==t[y+"ref"]){var D="auto"===q[y+"anchor"],E="x"===y?w.w:w.h,F=(r["_"+y+"size"]||0)/(2*E);if(z&&A)B=(B-z.range[0])/(z.range[1]-z.range[0]),B=A.range[0]+B*(A.range[1]-A.range[0]);else if(z){if(B=(B-z.range[0])/(z.range[1]-z.range[0]),B=z.domain[0]+B*(z.domain[1]-z.domain[0]),D){var G=B+F,H=B-F;2/3>B+H?B=H:B+G>4/3&&(B=G)}}else A&&(D&&(1/3>B?B+=F:B>2/3&&(B-=F)),B=(B-A.domain[0])/(A.domain[1]-A.domain[0]),B=A.range[0]+B*(A.range[1]-A.range[0]))}A&&A===z&&C&&("log"===C&&"log"!==A.type?B=Math.pow(10,B):"log"!==C&&"log"===A.type&&(B=B>0?Math.log(B)/Math.LN10:void 0)),q[y]=B}}var I=d(q,o);o.annotations[b]=I;var J=g.Axes.getFromId(a,I.xref),K=g.Axes.getFromId(a,I.yref),L={x:0,y:0},M=+I.textangle||0,N=o._infolayer.append("g").classed("annotation",!0).attr("data-index",String(b)).style("opacity",I.opacity).on("click",function(){a._dragging=!1,a.emit("plotly_clickannotation",{index:b,annotation:q,fullAnnotation:I})}),O=N.append("g").classed("annotation-text-g",!0).attr("data-index",String(b)),P=O.append("svg").call(g.Drawing.setPosition,0,0),Q=I.borderwidth,R=I.borderpad,S=Q+R,T=P.append("rect").attr("class","bg").style("stroke-width",Q+"px").call(g.Color.stroke,I.bordercolor).call(g.Color.fill,I.bgcolor),U=I.font,V=P.append("text").classed("annotation",!0).attr("data-unformatted",I.text).text(I.text);a._context.editable?V.call(g.util.makeEditable,P).call(k).on("edit",function(c){I.text=c,this.attr({"data-unformatted":I.text}),this.call(k);var d={};d["annotations["+b+"].text"]=I.text,J&&J.autorange&&(d[J._name+".autorange"]=!0),K&&K.autorange&&(d[K._name+".autorange"]=!0),g.relayout(a,d)}):V.call(k),O.attr({transform:"rotate("+M+","+L.x+","+L.y+")"}).call(g.Drawing.setPosition,L.x,L.y)}},j.arrowhead=function(a,b,c,d){i(d)||(d=1);var e=a.node(),f=j.ARROWPATHS[b||0];if(f){"string"==typeof c&&c||(c="end");var k,l,m,n,o=(g.Drawing.getPx(a,"stroke-width")||1)*d,p=a.style("stroke")||g.Color.defaultLine,q=a.style("stroke-opacity")||1,r=c.indexOf("start")>=0,s=c.indexOf("end")>=0,t=f.backoff*o;if("line"===e.nodeName){if(k={x:+a.attr("x1"),y:+a.attr("y1")},l={x:+a.attr("x2"),y:+a.attr("y2")},m=Math.atan2(k.y-l.y,k.x-l.x),n=m+Math.PI,t){var u=t*Math.cos(m),v=t*Math.sin(m);r&&(k.x-=u,k.y-=v,a.attr({x1:k.x,y1:k.y})),s&&(l.x+=u,l.y+=v,a.attr({x2:l.x,y2:l.y}))}}else if("path"===e.nodeName){var w=e.getTotalLength(),x="";if(r){var y=e.getPointAtLength(0),z=e.getPointAtLength(.1);m=Math.atan2(y.y-z.y,y.x-z.x),k=e.getPointAtLength(Math.min(t,w)),t&&(x="0px,"+t+"px,")}if(s){var A=e.getPointAtLength(w),B=e.getPointAtLength(w-.1);if(n=Math.atan2(A.y-B.y,A.x-B.x),l=e.getPointAtLength(Math.max(0,w-t)),t){var C=x?2*t:t;x+=w-C+"px,"+w+"px"}}else x&&(x+=w+"px");x&&a.style("stroke-dasharray",x)}var D=function(c,d){b>5&&(d=0),h.select(e.parentElement).append("path").attr({"class":a.attr("class"),d:f.path,transform:"translate("+c.x+","+c.y+")rotate("+180*d/Math.PI+")scale("+o+")"}).style({fill:p,opacity:q,"stroke-width":0})};r&&D(k,m),s&&D(l,n)}},j.calcAutorange=function(a){var b=a._fullLayout,c=b.annotations;if(c.length&&a._fullData.length){var d={};c.forEach(function(a){d[a.xref]=!0,d[a.yref]=!0});var f=g.Axes.list(a).filter(function(a){return a.autorange&&d[a._id]});if(f.length)return g.Lib.syncOrAsync([j.drawAll,e],a)}}},{"../../plotly":366,"./arrow_paths":295,"./attributes":296,d3:70,"fast-isnumeric":74}],298:[function(a,b,c){"use strict";c.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],c.defaultLine="#444",c.lightLine="#eee",c.background="#fff"},{}],299:[function(a,b,c){"use strict";function d(a){if(f(a)||"string"!=typeof a)return a;var b=a.trim();if("rgb"!==b.substr(0,3))return a;var c=b.match(/^rgba?\s*\(([^()]*)\)$/);if(!c)return a;var d=c[1].trim().split(/\s*[\s,]\s*/),e="a"===b.charAt(3)&&4===d.length;if(!e&&3!==d.length)return a;for(var g=0;g<d.length;g++){if(!d[g].length)return a;if(d[g]=Number(d[g]),!(d[g]>=0))return a;if(3===g)d[g]>1&&(d[g]=1);else if(d[g]>=1)return a}var h=Math.round(255*d[0])+", "+Math.round(255*d[1])+", "+Math.round(255*d[2]);return e?"rgba("+h+", "+d[3]+")":"rgb("+h+")"}var e=a("tinycolor2"),f=a("fast-isnumeric"),g=b.exports={},h=a("./attributes");g.defaults=h.defaults,g.defaultLine=h.defaultLine,g.lightLine=h.lightLine,g.background=h.background,g.tinyRGB=function(a){var b=a.toRgb();return"rgb("+Math.round(b.r)+", "+Math.round(b.g)+", "+Math.round(b.b)+")"},g.rgb=function(a){return g.tinyRGB(e(a))},g.opacity=function(a){return a?e(a).getAlpha():0},g.addOpacity=function(a,b){var c=e(a).toRgb();return"rgba("+Math.round(c.r)+", "+Math.round(c.g)+", "+Math.round(c.b)+", "+b+")"},g.combine=function(a,b){var c=e(a).toRgb();if(1===c.a)return e(a).toRgbString();var d=e(b||g.background).toRgb(),f=1===d.a?d:{r:255*(1-d.a)+d.r*d.a,g:255*(1-d.a)+d.g*d.a,b:255*(1-d.a)+d.b*d.a},h={r:f.r*(1-c.a)+c.r*c.a,g:f.g*(1-c.a)+c.g*c.a,b:f.b*(1-c.a)+c.b*c.a};return e(h).toRgbString()},g.stroke=function(a,b){var c=e(b);a.style({stroke:g.tinyRGB(c),"stroke-opacity":c.getAlpha()})},g.fill=function(a,b){var c=e(b);a.style({fill:g.tinyRGB(c),"fill-opacity":c.getAlpha()})},g.clean=function(a){if(a&&"object"==typeof a){var b,c,e,f,h=Object.keys(a);for(b=0;b<h.length;b++)if(e=h[b],f=a[e],"color"===e.substr(e.length-5))if(Array.isArray(f))for(c=0;c<f.length;c++)f[c]=d(f[c]);else a[e]=d(f);else if("colorscale"===e.substr(e.length-10)&&Array.isArray(f))for(c=0;c<f.length;c++)Array.isArray(f[c])&&(f[c][1]=d(f[c][1]));else if(Array.isArray(f)){var i=f[0];if(!Array.isArray(i)&&i&&"object"==typeof i)for(c=0;c<f.length;c++)g.clean(f[c])}else f&&"object"==typeof f&&g.clean(f)}}},{"./attributes":298,"fast-isnumeric":74,tinycolor2:229}],300:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/layout_attributes"),e=a("../../plots/font_attributes"),f=a("../../lib/extend").extendFlat;b.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:d.linecolor,outlinewidth:d.linewidth,bordercolor:d.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:d.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:f({},d.ticks,{dflt:""}),ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,showticklabels:d.showticklabels,tickfont:d.tickfont,tickangle:d.tickangle,tickformat:d.tickformat,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,exponentformat:d.exponentformat,showexponent:d.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:f({},e,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":345,"../../plots/cartesian/layout_attributes":376,"../../plots/font_attributes":383}],301:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../plots/cartesian/tick_value_defaults"),f=a("../../plots/cartesian/tick_defaults"),g=a("./attributes");b.exports=function(a,b,c){function h(a,b){return d.coerce(j,i,g,a,b)}var i=b.colorbar={},j=a.colorbar||{},k=h("thicknessmode");h("thickness","fraction"===k?30/(c.width-c.margin.l-c.margin.r):30);var l=h("lenmode");h("len","fraction"===l?1:c.height-c.margin.t-c.margin.b),h("x"),h("xanchor"),h("xpad"),h("y"),h("yanchor"),h("ypad"),d.noneOrAll(j,i,["x","y"]),h("outlinecolor"),h("outlinewidth"),h("bordercolor"),h("borderwidth"),h("bgcolor"),e(j,i,h,"linear"),f(j,i,h,"linear",{outerTicks:!1,font:c.font,noHover:!0}),h("title"),d.coerceFont(h,"titlefont",c.font),h("titleside")}},{"../../lib":349,"../../plots/cartesian/tick_defaults":381,"../../plots/cartesian/tick_value_defaults":382,"./attributes":300}],302:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../plotly"),f=a("../../plots/plots"),g=a("../../plots/cartesian/axes"),h=a("../../plots/cartesian/graph_interact"),i=a("../../lib"),j=a("../drawing"),k=a("../color"),l=a("../titles"),m=a("../../plots/cartesian/axis_defaults"),n=a("../../plots/cartesian/position_defaults"),o=a("../../plots/cartesian/layout_attributes"),p=a("./attributes");b.exports=function(a,b){function c(){function p(a,b){return i.coerce(T,U,o,a,b)}function r(){if(-1!==["top","bottom"].indexOf(q.titleside)){var b=$.select(".cbtitle"),c=b.select("text"),e=[-q.outlinewidth/2,q.outlinewidth/2],f=b.select(".h"+U._id+"title-math-group").node(),h=15.6;if(c.node()&&(h=1.3*parseInt(c.style("font-size"),10)),f?(aa=j.bBox(f).height,aa>h&&(e[1]-=(aa-h)/2)):c.node()&&!c.classed("js-placeholder")&&(aa=j.bBox(b.node()).height),aa){if(aa+=5,"top"===q.titleside)U.domain[1]-=aa/t._size.h,e[1]*=-1;else{U.domain[0]+=aa/t._size.h;var i=Math.max(1,c.selectAll("tspan.line").size());e[1]+=(1-i)*h}b.attr("transform","translate("+e+")"),U.setScale()}}$.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(t._size.h*(1-U.domain[1]))+")");var k=$.select(".cbfills").selectAll("rect.cbfill").data(x);k.enter().append("rect").classed("cbfill",!0).style("stroke","none"),k.exit().remove(),k.each(function(a,b){var c=[0===b?v[0]:(x[b]+x[b-1])/2,b===x.length-1?v[1]:(x[b]+x[b+1])/2].map(U.c2p).map(Math.round);b!==x.length-1&&(c[1]+=c[1]>c[0]?1:-1),d.select(this).attr({x:O,width:Math.max(H,2),y:d.min(c),height:Math.max(d.max(c)-d.min(c),2)}).style("fill",z(a))});var l=$.select(".cblines").selectAll("path.cbline").data(q.line.color&&q.line.width?w:[]);return l.enter().append("path").classed("cbline",!0),l.exit().remove(),l.each(function(a){d.select(this).attr("d","M"+O+","+(Math.round(U.c2p(a))+q.line.width/2%1)+"h"+H).call(j.lineGroupStyle,q.line.width,y(a),q.line.dash)}),U._axislayer.selectAll("g."+U._id+"tick,path").remove(),U._pos=O+H+(q.outlinewidth||0)/2-("outside"===q.ticks?1:0),U.side="right",g.doTicks(a,U)}function s(){var c=H+q.outlinewidth/2+j.bBox(U._axislayer.node()).width;if(E=_.select("text"),E.node()&&!E.classed("js-placeholder")){var d,e=_.select(".h"+U._id+"title-math-group").node();d=e&&-1!==["top","bottom"].indexOf(q.titleside)?j.bBox(e).width:j.bBox(_.node()).right-O-t._size.l,c=Math.max(c,d)}var g=2*q.xpad+c+q.borderwidth+q.outlinewidth/2,h=R-S;$.select(".cbbg").attr({x:O-q.xpad-(q.borderwidth+q.outlinewidth)/2,y:S-M,width:Math.max(g,2),height:Math.max(h+2*M,2)}).call(k.fill,q.bgcolor).call(k.stroke,q.bordercolor).style({"stroke-width":q.borderwidth}),$.selectAll(".cboutline").attr({x:O,y:S+q.ypad+("top"===q.titleside?aa:0),width:Math.max(H,2),height:Math.max(h-2*q.ypad-aa,2)}).call(k.stroke,q.outlinecolor).style({fill:"None","stroke-width":q.outlinewidth});var i=({center:.5,right:1}[q.xanchor]||0)*g;$.attr("transform","translate("+(t._size.l-i)+","+t._size.t+")"),f.autoMargin(a,b,{x:q.x,y:q.y,l:g*({right:1,center:.5}[q.xanchor]||0),r:g*({left:1,center:.5}[q.xanchor]||0),t:h*({bottom:1,middle:.5}[q.yanchor]||0),b:h*({top:1,middle:.5}[q.yanchor]||0)})}var t=a._fullLayout;if("function"!=typeof q.fillcolor&&"function"!=typeof q.line.color)return void t._infolayer.selectAll("g."+b).remove();var u,v=d.extent(("function"==typeof q.fillcolor?q.fillcolor:q.line.color).domain()),w=[],x=[],y="function"==typeof q.line.color?q.line.color:function(){return q.line.color},z="function"==typeof q.fillcolor?q.fillcolor:function(){return q.fillcolor},A=q.levels.end+q.levels.size/100,B=q.levels.size,C=1.001*v[0]-.001*v[1],D=1.001*v[1]-.001*v[0];for(u=q.levels.start;0>(u-A)*B;u+=B)u>C&&D>u&&w.push(u);if("function"==typeof q.fillcolor)if(q.filllevels)for(A=q.filllevels.end+q.filllevels.size/100,B=q.filllevels.size,u=q.filllevels.start;0>(u-A)*B;u+=B)u>v[0]&&u<v[1]&&x.push(u);else x=w.map(function(a){return a-q.levels.size/2}),x.push(x[x.length-1]+q.levels.size);else q.fillcolor&&"string"==typeof q.fillcolor&&(x=[0]);q.levels.size<0&&(w.reverse(),x.reverse());var E,F=t.height-t.margin.t-t.margin.b,G=t.width-t.margin.l-t.margin.r,H=Math.round(q.thickness*("fraction"===q.thicknessmode?G:1)),I=H/t._size.w,J=Math.round(q.len*("fraction"===q.lenmode?F:1)),K=J/t._size.h,L=q.xpad/t._size.w,M=(q.borderwidth+q.outlinewidth)/2,N=q.ypad/t._size.h,O=Math.round(q.x*t._size.w+q.xpad),P=q.x-I*({middle:.5,right:1}[q.xanchor]||0),Q=q.y+K*(({top:-.5,bottom:.5}[q.yanchor]||0)-.5),R=Math.round(t._size.h*(1-Q)),S=R-J,T={type:"linear",range:v,tickmode:q.tickmode,nticks:q.nticks,tick0:q.tick0,dtick:q.dtick,tickvals:q.tickvals,ticktext:q.ticktext,ticks:q.ticks,ticklen:q.ticklen,tickwidth:q.tickwidth,tickcolor:q.tickcolor,showticklabels:q.showticklabels,tickfont:q.tickfont,tickangle:q.tickangle,tickformat:q.tickformat,exponentformat:q.exponentformat,showexponent:q.showexponent,showtickprefix:q.showtickprefix,tickprefix:q.tickprefix,showticksuffix:q.showticksuffix,ticksuffix:q.ticksuffix,title:q.title,titlefont:q.titlefont,anchor:"free",position:1},U={},V={letter:"y",font:t.font,noHover:!0};if(m(T,U,p,V),n(T,U,p,V),U._id="y"+b,U._td=a,U.position=q.x+L+I,c.axis=U,-1!==["top","bottom"].indexOf(q.titleside)&&(U.titleside=q.titleside,U.titlex=q.x+L,U.titley=Q+("top"===q.titleside?K-N:N)),q.line.color&&"auto"===q.tickmode){U.tickmode="linear",U.tick0=q.levels.start;var W=q.levels.size,X=i.constrain((R-S)/50,4,15)+1,Y=(v[1]-v[0])/((q.nticks||X)*W);if(Y>1){var Z=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));W*=Z*i.roundUp(Y/Z,[2,5,10]),(Math.abs(q.levels.start)/q.levels.size+1e-6)%1<2e-6&&(U.tick0=0)}U.dtick=W}U.domain=[Q+N,Q+K-N],U.setScale();var $=t._infolayer.selectAll("g."+b).data([0]);$.enter().append("g").classed(b,!0).each(function(){var a=d.select(this);a.append("rect").classed("cbbg",!0),a.append("g").classed("cbfills",!0),a.append("g").classed("cblines",!0),a.append("g").classed("cbaxis",!0).classed("crisp",!0),a.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),a.append("rect").classed("cboutline",!0)}),$.attr("transform","translate("+Math.round(t._size.l)+","+Math.round(t._size.t)+")");var _=$.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(t._size.l)+",-"+Math.round(t._size.t)+")");U._axislayer=$.select(".cbaxis");var aa=0;-1!==["top","bottom"].indexOf(q.titleside)&&l.draw(a,U._id+"title");var ba=i.syncOrAsync([f.previousPromises,r,f.previousPromises,s],a);if(ba&&ba.then&&(a._promises||[]).push(ba),a._context.editable){var ca,da,ea;h.dragElement({element:$.node(),prepFn:function(){ca=$.attr("transform"),h.setCursor($)},moveFn:function(b,c){var d=a._fullLayout._size;$.attr("transform",ca+" translate("+b+","+c+")"),da=h.dragAlign(P+b/d.w,I,0,1,q.xanchor),ea=h.dragAlign(Q-c/d.h,K,0,1,q.yanchor);var e=h.dragCursors(da,ea,q.xanchor,q.yanchor);h.setCursor($,e)},doneFn:function(c){if(h.setCursor($),c&&void 0!==da&&void 0!==ea){var d,f=b.substr(2);a._fullData.some(function(a){return a.uid===f?(d=a.index,!0):void 0}),e.restyle(a,{"colorbar.x":da,"colorbar.y":ea},d)}}})}return ba}var q={};return Object.keys(p).forEach(function(a){q[a]=null}),q.fillcolor=null,q.line={color:null,width:null,dash:null},q.levels={start:null,end:null,size:null},q.filllevels=null,Object.keys(q).forEach(function(a){c[a]=function(b){return arguments.length?(q[a]=i.isPlainObject(q[a])?i.extendFlat(q[a],b):b,c):q[a]}}),c.options=function(a){return Object.keys(a).forEach(function(b){"function"==typeof c[b]&&c[b](a[b])}),c},c._opts=q,c}},{"../../lib":349,"../../plotly":366,"../../plots/cartesian/axes":369,"../../plots/cartesian/axis_defaults":370,"../../plots/cartesian/graph_interact":374,"../../plots/cartesian/layout_attributes":376,"../../plots/cartesian/position_defaults":378,"../../plots/plots":413,"../color":299,"../drawing":317,"../titles":332,"./attributes":300,d3:70}],303:[function(a,b,c){"use strict";b.exports=function(a){return"object"==typeof a.colorbar&&null!==a.colorbar}},{}],304:[function(a,b,c){"use strict";c.attributes=a("./attributes"),c.supplyDefaults=a("./defaults"),c.draw=a("./draw"),c.hasColorbar=a("./has_colorbar")},{"./attributes":300,"./defaults":301,"./draw":302,"./has_colorbar":303}],305:[function(a,b,c){"use strict";b.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0},_deprecated:{scl:{valType:"colorscale"},reversescl:{valType:"boolean"}}}},{}],306:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./scales"),f=a("./flip_scale");b.exports=function(a,b,c,g){var h,i;c?(h=d.nestedProperty(a,c).get(),i=d.nestedProperty(a._input,c).get()):(h=a,i=a._input);var j=h[g+"auto"],k=h[g+"min"],l=h[g+"max"],m=h.colorscale;j===!1&&void 0!==k||(k=d.aggNums(Math.min,null,b)),j===!1&&void 0!==l||(l=d.aggNums(Math.max,null,b)),k===l&&(k-=.5,l+=.5),h[g+"min"]=k,h[g+"max"]=l,i[g+"min"]=k,i[g+"max"]=l,h.autocolorscale&&(m=0>k*l?e.RdBu:k>=0?e.Reds:e.Blues,i.colorscale=m,h.reversescale&&(m=f(m)),h.colorscale=m)}},{"../../lib":349,"./flip_scale":309,"./scales":316}],307:[function(a,b,c){"use strict";var d=a("./scales");b.exports=d.RdBu},{"./scales":316}],308:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("../colorbar/has_colorbar"),g=a("../colorbar/defaults"),h=a("./is_valid_scale"),i=a("./flip_scale");b.exports=function(a,b,c,j,k){var l=k.prefix,m=k.cLetter,n=l.slice(0,l.length-1),o=l?e.nestedProperty(a,n).get()||{}:a,p=l?e.nestedProperty(b,n).get()||{}:b,q=o[m+"min"],r=o[m+"max"],s=o.colorscale,t=d(q)&&d(r)&&r>q;j(l+m+"auto",!t),j(l+m+"min"),j(l+m+"max");var u;void 0!==s&&(u=!h(s)),j(l+"autocolorscale",u);var v=j(l+"colorscale"),w=j(l+"reversescale");if(w&&(p.colorscale=i(v)),"marker.line."!==l){var x;l&&(x=f(o));var y=j(l+"showscale",x);y&&g(o,p,c)}}},{"../../lib":349,"../colorbar/defaults":301,"../colorbar/has_colorbar":303,"./flip_scale":309,"./is_valid_scale":313,"fast-isnumeric":74}],309:[function(a,b,c){"use strict";b.exports=function(a){for(var b,c=a.length,d=new Array(c),e=c-1,f=0;e>=0;e--,f++)b=a[e],d[f]=[1-b[0],b[1]];return d}},{}],310:[function(a,b,c){"use strict";var d=a("./scales"),e=a("./default_scale"),f=a("./is_valid_scale_array");b.exports=function(a,b){function c(){try{a=d[a]||JSON.parse(a)}catch(c){a=b}}return b||(b=e),a?("string"==typeof a&&(c(),"string"==typeof a&&c()),f(a)?a:b):b}},{"./default_scale":307,"./is_valid_scale_array":314,"./scales":316}],311:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("./is_valid_scale");b.exports=function(a,b){var c=b?e.nestedProperty(a,b).get()||{}:a,g=c.color,h=!1;if(Array.isArray(g))for(var i=0;i<g.length;i++)if(d(g[i])){h=!0;break}return"object"==typeof c&&null!==c&&(h||c.showscale===!0||d(c.cmin)&&d(c.cmax)||f(c.colorscale)||"object"==typeof c.colorbar&&null!==c.colorbar); 45 }},{"../../lib":349,"./is_valid_scale":313,"fast-isnumeric":74}],312:[function(a,b,c){"use strict";c.scales=a("./scales"),c.defaultScale=a("./default_scale"),c.attributes=a("./attributes"),c.handleDefaults=a("./defaults"),c.calc=a("./calc"),c.hasColorscale=a("./has_colorscale"),c.isValidScale=a("./is_valid_scale"),c.getScale=a("./get_scale"),c.flipScale=a("./flip_scale"),c.makeScaleFunction=a("./make_scale_function")},{"./attributes":305,"./calc":306,"./default_scale":307,"./defaults":308,"./flip_scale":309,"./get_scale":310,"./has_colorscale":311,"./is_valid_scale":313,"./make_scale_function":315,"./scales":316}],313:[function(a,b,c){"use strict";var d=a("./scales"),e=a("./is_valid_scale_array");b.exports=function(a){return void 0!==d[a]?!0:e(a)}},{"./is_valid_scale_array":314,"./scales":316}],314:[function(a,b,c){"use strict";var d=a("tinycolor2");b.exports=function(a){var b,c=!0,e=0;if(Array.isArray(a)){if(0!==+a[0][0]||1!==+a[a.length-1][0])return!1;for(var f=0;f<a.length;f++){if(b=a[f],2!==b.length||+b[0]<e||!d(b[1]).isValid()){c=!1;break}e=+b[0]}return c}return!1}},{tinycolor2:229}],315:[function(a,b,c){"use strict";var d=a("d3"),e=a("tinycolor2"),f=a("fast-isnumeric"),g=a("../color");b.exports=function(a,b,c){for(var h,i=a.length,j=new Array(i),k=new Array(i),l=0;i>l;l++)h=a[l],j[l]=b+h[0]*(c-b),k[l]=h[1];var m=d.scale.linear().domain(j).interpolate(d.interpolateRgb).range(k);return function(a){return f(a)?m(a):e(a).isValid()?a:g.defaultLine}}},{"../color":299,d3:70,"fast-isnumeric":74,tinycolor2:229}],316:[function(a,b,c){"use strict";b.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],317:[function(a,b,c){"use strict";function d(a,b,c,d){var e=a[0]-b[0],g=a[1]-b[1],h=c[0]-b[0],i=c[1]-b[1],j=Math.pow(e*e+g*g,q/2),k=Math.pow(h*h+i*i,q/2),l=(k*k*e-j*j*h)*d,m=(k*k*g-j*j*i)*d,n=3*k*(j+k),o=3*j*(j+k);return[[f.round(b[0]+(n&&l/n),2),f.round(b[1]+(n&&m/n),2)],[f.round(b[0]-(o&&l/o),2),f.round(b[1]-(o&&m/o),2)]]}var e=a("../../plotly"),f=a("d3"),g=a("fast-isnumeric"),h=a("../../constants/xmlns_namespaces"),i=a("../../traces/scatter/subtypes"),j=a("../../traces/scatter/make_bubble_size_func"),k=b.exports={};k.font=function(a,b,c,d){b&&b.family&&(d=b.color,c=b.size,b=b.family),b&&a.style("font-family",b),c+1&&a.style("font-size",c+"px"),d&&a.call(e.Color.fill,d)},k.setPosition=function(a,b,c){a.attr("x",b).attr("y",c)},k.setSize=function(a,b,c){a.attr("width",b).attr("height",c)},k.setRect=function(a,b,c,d,e){a.call(k.setPosition,b,c).call(k.setSize,d,e)},k.translatePoints=function(a,b,c){a.each(function(a){var d=a.xp||b.c2p(a.x),e=a.yp||c.c2p(a.y),h=f.select(this);g(d)&&g(e)?"text"===this.nodeName?h.attr("x",d).attr("y",e):h.attr("transform","translate("+d+","+e+")"):h.remove()})},k.getPx=function(a,b){return Number(a.style(b).replace(/px$/,""))},k.crispRound=function(a,b,c){return b&&g(b)?a._context.staticPlot?b:1>b?1:Math.round(b):c||0},k.lineGroupStyle=function(a,b,c,d){a.style("fill","none").each(function(a){var g=(((a||[])[0]||{}).trace||{}).line||{},h=b||g.width||0,i=d||g.dash||"";f.select(this).call(e.Color.stroke,c||g.color).call(k.dashLine,i,h)})},k.dashLine=function(a,b,c){var d=Math.max(c,3);"solid"===b?b="":"dot"===b?b=d+"px,"+d+"px":"dash"===b?b=3*d+"px,"+3*d+"px":"longdash"===b?b=5*d+"px,"+5*d+"px":"dashdot"===b?b=3*d+"px,"+d+"px,"+d+"px,"+d+"px":"longdashdot"===b&&(b=5*d+"px,"+2*d+"px,"+d+"px,"+2*d+"px"),a.style({"stroke-dasharray":b,"stroke-width":c+"px"})},k.fillGroupStyle=function(a){a.style("stroke-width",0).each(function(b){var c=f.select(this);try{c.call(e.Color.fill,b[0].trace.fillcolor)}catch(d){console.log(d,a),c.remove()}})};var l=a("./symbol_defs");k.symbolNames=[],k.symbolFuncs=[],k.symbolNeedLines={},k.symbolNoDot={},k.symbolList=[],Object.keys(l).forEach(function(a){var b=l[a];k.symbolList=k.symbolList.concat([b.n,a,b.n+100,a+"-open"]),k.symbolNames[b.n]=a,k.symbolFuncs[b.n]=b.f,b.needLine&&(k.symbolNeedLines[b.n]=!0),b.noDot?k.symbolNoDot[b.n]=!0:k.symbolList=k.symbolList.concat([b.n+200,a+"-dot",b.n+300,a+"-open-dot"])});var m=k.symbolNames.length,n="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";k.symbolNumber=function(a){if("string"==typeof a){var b=0;a.indexOf("-open")>0&&(b=100,a=a.replace("-open","")),a.indexOf("-dot")>0&&(b+=200,a=a.replace("-dot","")),a=k.symbolNames.indexOf(a),a>=0&&(a+=b)}return a%100>=m||a>=400?0:Math.floor(Math.max(a,0))},k.pointStyle=function(a,b){if(a.size()){var c=b.marker,d=c.line;if(e.Plots.traceIs(b,"symbols")){var g=j(b);a.attr("d",function(a){var d;d="various"===a.ms||"various"===c.size?3:i.isBubble(b)?g(a.ms):(c.size||6)/2,a.mrc=d;var e=k.symbolNumber(a.mx||c.symbol)||0,f=e%100;return a.om=e%200>=100,k.symbolFuncs[f](d)+(e>=200?n:"")}).style("opacity",function(a){return(a.mo+1||c.opacity+1)-1})}var h=(b._input||{}).marker||{},l=k.tryColorscale(c,h,""),m=k.tryColorscale(c,h,"line.");a.each(function(a){var b,g,h;a.so?(h=d.outlierwidth,g=d.outliercolor,b=c.outliercolor):(h=(a.mlw+1||d.width+1||(a.trace?a.trace.marker.line.width:0)+1)-1,g="mlc"in a?a.mlcc=m(a.mlc):Array.isArray(d.color)?e.Color.defaultLine:d.color,b="mc"in a?a.mcc=l(a.mc):Array.isArray(c.color)?e.Color.defaultLine:c.color||"rgba(0,0,0,0)");var i=f.select(this);a.om?i.call(e.Color.stroke,b).style({"stroke-width":(h||1)+"px",fill:"none"}):(i.style("stroke-width",h+"px").call(e.Color.fill,b),h&&i.call(e.Color.stroke,g))})}},k.tryColorscale=function(a,b,c){var d=e.Lib.nestedProperty(a,c+"color").get(),f=e.Lib.nestedProperty(a,c+"colorscale").get(),h=e.Lib.nestedProperty(a,c+"cauto").get(),i=e.Lib.nestedProperty(a,c+"cmin"),j=e.Lib.nestedProperty(a,c+"cmax"),k=i.get(),l=j.get();return f&&Array.isArray(d)?(!h&&g(k)&&g(l)||(k=1/0,l=-(1/0),d.forEach(function(a){g(a)&&(k>a&&(k=+a),a>l&&(l=+a))}),k>l&&(k=0,l=1),i.set(k),j.set(l),e.Lib.nestedProperty(b,c+"cmin").set(k),e.Lib.nestedProperty(b,c+"cmax").set(l)),e.Colorscale.makeScaleFunction(f,k,l)):e.Lib.identity};var o={start:1,end:-1,middle:0,bottom:1,top:-1},p=1.3;k.textPointStyle=function(a,b){a.each(function(a){var c=f.select(this),d=a.tx||b.text;if(!d||Array.isArray(d))return void c.remove();var h=a.tp||b.textposition,i=-1!==h.indexOf("top")?"top":-1!==h.indexOf("bottom")?"bottom":"middle",j=-1!==h.indexOf("left")?"end":-1!==h.indexOf("right")?"start":"middle",l=a.ts||b.textfont.size,m=a.mrc?a.mrc/.8+1:0;l=g(l)&&l>0?l:0,c.call(k.font,a.tf||b.textfont.family,l,a.tc||b.textfont.color).attr("text-anchor",j).text(d).call(e.util.convertToTspans);var n=f.select(this.parentNode),q=c.selectAll("tspan.line"),r=((q[0].length||1)-1)*p+1,s=o[j]*m,t=.75*l+o[i]*m+(o[i]-1)*r*l/2;n.attr("transform","translate("+s+","+t+")"),r>1&&q.attr({x:c.attr("x"),y:c.attr("y")})})};var q=.5;k.smoothopen=function(a,b){if(a.length<3)return"M"+a.join("L");var c,e="M"+a[0],f=[];for(c=1;c<a.length-1;c++)f.push(d(a[c-1],a[c],a[c+1],b));for(e+="Q"+f[0][0]+" "+a[1],c=2;c<a.length-1;c++)e+="C"+f[c-2][1]+" "+f[c-1][0]+" "+a[c];return e+="Q"+f[a.length-3][1]+" "+a[a.length-1]},k.smoothclosed=function(a,b){if(a.length<3)return"M"+a.join("L")+"Z";var c,e="M"+a[0],f=a.length-1,g=[d(a[f],a[0],a[1],b)];for(c=1;f>c;c++)g.push(d(a[c-1],a[c],a[c+1],b));for(g.push(d(a[f-1],a[f],a[0],b)),c=1;f>=c;c++)e+="C"+g[c-1][1]+" "+g[c][0]+" "+a[c];return e+="C"+g[f][1]+" "+g[0][0]+" "+a[0]+"Z"};var r={hv:function(a,b){return"H"+f.round(b[0],2)+"V"+f.round(b[1],2)},vh:function(a,b){return"V"+f.round(b[1],2)+"H"+f.round(b[0],2)},hvh:function(a,b){return"H"+f.round((a[0]+b[0])/2,2)+"V"+f.round(b[1],2)+"H"+f.round(b[0],2)},vhv:function(a,b){return"V"+f.round((a[1]+b[1])/2,2)+"H"+f.round(b[0],2)+"V"+f.round(b[1],2)}},s=function(a,b){return"L"+f.round(b[0],2)+","+f.round(b[1],2)};k.steps=function(a){var b=r[a]||s;return function(a){for(var c="M"+f.round(a[0][0],2)+","+f.round(a[0][1],2),d=1;d<a.length;d++)c+=b(a[d-1],a[d]);return c}},k.makeTester=function(a){var b=f.select("body").selectAll("#js-plotly-tester").data([0]);b.enter().append("svg").attr("id","js-plotly-tester").attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px"});var c=b.selectAll(".js-reference-point").data([0]);c.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),b.node()._cache||(b.node()._cache={}),a._tester=b,a._testref=c};var t=[],u=1e4;k.bBox=function(a){var b=a.attributes["data-bb"];if(b&&b.value)return e.Lib.extendFlat({},t[b.value]);var c=f.select("#js-plotly-tester"),d=c.node(),g=a.cloneNode(!0);d.appendChild(g),f.select(g).attr({x:0,y:0,transform:""});var h=g.getBoundingClientRect(),i=c.select(".js-reference-point").node().getBoundingClientRect();d.removeChild(g);var j={height:h.height,width:h.width,left:h.left-i.left,top:h.top-i.top,right:h.right-i.left,bottom:h.bottom-i.top};return t.length>=u&&(f.selectAll("[data-bb]").attr("data-bb",null),t=[]),a.setAttribute("data-bb",t.length),t.push(j),e.Lib.extendFlat({},j)},k.setClipUrl=function(a,b){if(!b)return void a.attr("clip-path",null);var c="#"+b,d=f.select("base");d.size()&&d.attr("href")&&(c=window.location.href+c),a.attr("clip-path","url("+c+")")}},{"../../constants/xmlns_namespaces":338,"../../plotly":366,"../../traces/scatter/make_bubble_size_func":514,"../../traces/scatter/subtypes":520,"./symbol_defs":318,d3:70,"fast-isnumeric":74}],318:[function(a,b,c){"use strict";var d=a("d3");b.exports={circle:{n:0,f:function(a){var b=d.round(a,2);return"M"+b+",0A"+b+","+b+" 0 1,1 0,-"+b+"A"+b+","+b+" 0 0,1 "+b+",0Z"}},square:{n:1,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"H-"+b+"V-"+b+"H"+b+"Z"}},diamond:{n:2,f:function(a){var b=d.round(1.3*a,2);return"M"+b+",0L0,"+b+"L-"+b+",0L0,-"+b+"Z"}},cross:{n:3,f:function(a){var b=d.round(.4*a,2),c=d.round(1.2*a,2);return"M"+c+","+b+"H"+b+"V"+c+"H-"+b+"V"+b+"H-"+c+"V-"+b+"H-"+b+"V-"+c+"H"+b+"V-"+b+"H"+c+"Z"}},x:{n:4,f:function(a){var b=d.round(.8*a/Math.sqrt(2),2),c="l"+b+","+b,e="l"+b+",-"+b,f="l-"+b+",-"+b,g="l-"+b+","+b;return"M0,"+b+c+e+f+e+f+g+f+g+c+g+c+"Z"}},"triangle-up":{n:5,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M-"+b+","+c+"H"+b+"L0,-"+e+"Z"}},"triangle-down":{n:6,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M-"+b+",-"+c+"H"+b+"L0,"+e+"Z"}},"triangle-left":{n:7,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M"+c+",-"+b+"V"+b+"L-"+e+",0Z"}},"triangle-right":{n:8,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M-"+c+",-"+b+"V"+b+"L"+e+",0Z"}},"triangle-ne":{n:9,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M-"+c+",-"+b+"H"+b+"V"+c+"Z"}},"triangle-se":{n:10,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M"+b+",-"+c+"V"+b+"H-"+c+"Z"}},"triangle-sw":{n:11,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M"+c+","+b+"H-"+b+"V-"+c+"Z"}},"triangle-nw":{n:12,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M-"+b+","+c+"V-"+b+"H"+c+"Z"}},pentagon:{n:13,f:function(a){var b=d.round(.951*a,2),c=d.round(.588*a,2),e=d.round(-a,2),f=d.round(a*-.309,2),g=d.round(.809*a,2);return"M"+b+","+f+"L"+c+","+g+"H-"+c+"L-"+b+","+f+"L0,"+e+"Z"}},hexagon:{n:14,f:function(a){var b=d.round(a,2),c=d.round(a/2,2),e=d.round(a*Math.sqrt(3)/2,2);return"M"+e+",-"+c+"V"+c+"L0,"+b+"L-"+e+","+c+"V-"+c+"L0,-"+b+"Z"}},hexagon2:{n:15,f:function(a){var b=d.round(a,2),c=d.round(a/2,2),e=d.round(a*Math.sqrt(3)/2,2);return"M-"+c+","+e+"H"+c+"L"+b+",0L"+c+",-"+e+"H-"+c+"L-"+b+",0Z"}},octagon:{n:16,f:function(a){var b=d.round(.924*a,2),c=d.round(.383*a,2);return"M-"+c+",-"+b+"H"+c+"L"+b+",-"+c+"V"+c+"L"+c+","+b+"H-"+c+"L-"+b+","+c+"V-"+c+"Z"}},star:{n:17,f:function(a){var b=1.4*a,c=d.round(.225*b,2),e=d.round(.951*b,2),f=d.round(.363*b,2),g=d.round(.588*b,2),h=d.round(-b,2),i=d.round(b*-.309,2),j=d.round(.118*b,2),k=d.round(.809*b,2),l=d.round(.382*b,2);return"M"+c+","+i+"H"+e+"L"+f+","+j+"L"+g+","+k+"L0,"+l+"L-"+g+","+k+"L-"+f+","+j+"L-"+e+","+i+"H-"+c+"L0,"+h+"Z"}},hexagram:{n:18,f:function(a){var b=d.round(.66*a,2),c=d.round(.38*a,2),e=d.round(.76*a,2);return"M-"+e+",0l-"+c+",-"+b+"h"+e+"l"+c+",-"+b+"l"+c+","+b+"h"+e+"l-"+c+","+b+"l"+c+","+b+"h-"+e+"l-"+c+","+b+"l-"+c+",-"+b+"h-"+e+"Z"}},"star-triangle-up":{n:19,f:function(a){var b=d.round(a*Math.sqrt(3)*.8,2),c=d.round(.8*a,2),e=d.round(1.6*a,2),f=d.round(4*a,2),g="A "+f+","+f+" 0 0 1 ";return"M-"+b+","+c+g+b+","+c+g+"0,-"+e+g+"-"+b+","+c+"Z"}},"star-triangle-down":{n:20,f:function(a){var b=d.round(a*Math.sqrt(3)*.8,2),c=d.round(.8*a,2),e=d.round(1.6*a,2),f=d.round(4*a,2),g="A "+f+","+f+" 0 0 1 ";return"M"+b+",-"+c+g+"-"+b+",-"+c+g+"0,"+e+g+b+",-"+c+"Z"}},"star-square":{n:21,f:function(a){var b=d.round(1.1*a,2),c=d.round(2*a,2),e="A "+c+","+c+" 0 0 1 ";return"M-"+b+",-"+b+e+"-"+b+","+b+e+b+","+b+e+b+",-"+b+e+"-"+b+",-"+b+"Z"}},"star-diamond":{n:22,f:function(a){var b=d.round(1.4*a,2),c=d.round(1.9*a,2),e="A "+c+","+c+" 0 0 1 ";return"M-"+b+",0"+e+"0,"+b+e+b+",0"+e+"0,-"+b+e+"-"+b+",0Z"}},"diamond-tall":{n:23,f:function(a){var b=d.round(.7*a,2),c=d.round(1.4*a,2);return"M0,"+c+"L"+b+",0L0,-"+c+"L-"+b+",0Z"}},"diamond-wide":{n:24,f:function(a){var b=d.round(1.4*a,2),c=d.round(.7*a,2);return"M0,"+c+"L"+b+",0L0,-"+c+"L-"+b+",0Z"}},hourglass:{n:25,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"H-"+b+"L"+b+",-"+b+"H-"+b+"Z"},noDot:!0},bowtie:{n:26,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"V-"+b+"L-"+b+","+b+"V-"+b+"Z"},noDot:!0},"circle-cross":{n:27,f:function(a){var b=d.round(a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b+"M"+b+",0A"+b+","+b+" 0 1,1 0,-"+b+"A"+b+","+b+" 0 0,1 "+b+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(a){var b=d.round(a,2),c=d.round(a/Math.sqrt(2),2);return"M"+c+","+c+"L-"+c+",-"+c+"M"+c+",-"+c+"L-"+c+","+c+"M"+b+",0A"+b+","+b+" 0 1,1 0,-"+b+"A"+b+","+b+" 0 0,1 "+b+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(a){var b=d.round(a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b+"M"+b+","+b+"H-"+b+"V-"+b+"H"+b+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b+"M"+b+","+b+"H-"+b+"V-"+b+"H"+b+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(a){var b=d.round(1.3*a,2);return"M"+b+",0L0,"+b+"L-"+b+",0L0,-"+b+"ZM0,-"+b+"V"+b+"M-"+b+",0H"+b},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(a){var b=d.round(1.3*a,2),c=d.round(.65*a,2);return"M"+b+",0L0,"+b+"L-"+b+",0L0,-"+b+"ZM-"+c+",-"+c+"L"+c+","+c+"M-"+c+","+c+"L"+c+",-"+c},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(a){var b=d.round(1.4*a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b},needLine:!0,noDot:!0},asterisk:{n:35,f:function(a){var b=d.round(1.2*a,2),c=d.round(.85*a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b+"M"+c+","+c+"L-"+c+",-"+c+"M"+c+",-"+c+"L-"+c+","+c},needLine:!0,noDot:!0},hash:{n:36,f:function(a){var b=d.round(a/2,2),c=d.round(a,2);return"M"+b+","+c+"V-"+c+"m-"+c+",0V"+c+"M"+c+","+b+"H-"+c+"m0,-"+c+"H"+c},needLine:!0},"y-up":{n:37,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M-"+b+","+e+"L0,0M"+b+","+e+"L0,0M0,-"+c+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M-"+b+",-"+e+"L0,0M"+b+",-"+e+"L0,0M0,"+c+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M"+e+","+b+"L0,0M"+e+",-"+b+"L0,0M-"+c+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M-"+e+","+b+"L0,0M-"+e+",-"+b+"L0,0M"+c+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(a){var b=d.round(1.4*a,2);return"M"+b+",0H-"+b},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(a){var b=d.round(1.4*a,2);return"M0,"+b+"V-"+b},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(a){var b=d.round(a,2);return"M"+b+",-"+b+"L-"+b+","+b},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"L-"+b+",-"+b},needLine:!0,noDot:!0}}},{d3:70}],319:[function(a,b,c){"use strict";b.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],320:[function(a,b,c){"use strict";function d(a,b,c,d){var f=b["error_"+d]||{},i=f.visible&&-1!==["linear","log"].indexOf(c.type),j=[];if(i){for(var k=h(f),l=0;l<a.length;l++){var m=a[l],n=m[d];if(e(c.c2l(n))){var o=k(n,l);if(e(o[0])&&e(o[1])){var p=m[d+"s"]=n-o[0],q=m[d+"h"]=n+o[1];j.push(p,q)}}}g.expand(c,j,{padded:!0})}}var e=a("fast-isnumeric"),f=a("../../plots/plots"),g=a("../../plots/cartesian/axes"),h=a("./compute_error");b.exports=function(a){for(var b=a.calcdata,c=0;c<b.length;c++){var e=b[c],h=e[0].trace;if(f.traceIs(h,"errorBarsOK")){var i=g.getFromId(a,h.xaxis),j=g.getFromId(a,h.yaxis);d(e,h,i,"x"),d(e,h,j,"y")}}}},{"../../plots/cartesian/axes":369,"../../plots/plots":413,"./compute_error":321,"fast-isnumeric":74}],321:[function(a,b,c){"use strict";function d(a,b){return"percent"===a?function(a){return Math.abs(a*b/100)}:"constant"===a?function(){return Math.abs(b)}:"sqrt"===a?function(a){return Math.sqrt(Math.abs(a))}:void 0}b.exports=function(a){var b=a.type,c=a.symmetric;if("data"===b){var e=a.array,f=a.arrayminus;return c||void 0===f?function(a,b){var c=+e[b];return[c,c]}:function(a,b){return[+f[b],+e[b]]}}var g=d(b,a.value),h=d(b,a.valueminus);return c||void 0===a.valueminus?function(a){var b=g(a);return[b,b]}:function(a){return[h(a),g(a)]}}},{}],322:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/plots"),f=a("../../lib"),g=a("./attributes");b.exports=function(a,b,c,h){function i(a,b){return f.coerce(l,k,g,a,b)}var j="error_"+h.axis,k=b[j]={},l=a[j]||{},m=void 0!==l.array||void 0!==l.value||"sqrt"===l.type,n=i("visible",m);if(n!==!1){var o=i("type","array"in l?"data":"percent"),p=!0;if("sqrt"!==o&&(p=i("symmetric",!(("data"===o?"arrayminus":"valueminus")in l))),"data"===o){var q=i("array");if(q||(k.array=[]),i("traceref"),!p){var r=i("arrayminus");r||(k.arrayminus=[]),i("tracerefminus")}}else"percent"!==o&&"constant"!==o||(i("value"),p||i("valueminus"));var s="copy_"+h.inherit+"style";if(h.inherit){var t=b["error_"+h.inherit];(t||{}).visible&&i(s,!(l.color||d(l.thickness)||d(l.width)))}h.inherit&&k[s]||(i("color",c),i("thickness"),i("width",e.traceIs(b,"gl3d")?0:4))}}},{"../../lib":349,"../../plots/plots":413,"./attributes":319,"fast-isnumeric":74}],323:[function(a,b,c){"use strict";function d(a,b,c){var d={x:b.c2p(a.x),y:c.c2p(a.y)};return void 0!==a.yh&&(d.yh=c.c2p(a.yh),d.ys=c.c2p(a.ys),f(d.ys)||(d.noYS=!0,d.ys=c.c2p(a.ys,!0))),void 0!==a.xh&&(d.xh=b.c2p(a.xh),d.xs=b.c2p(a.xs),f(d.xs)||(d.noXS=!0,d.xs=b.c2p(a.xs,!0))),d}var e=a("d3"),f=a("fast-isnumeric"),g=a("../../lib"),h=a("../color"),i=a("../../traces/scatter/subtypes"),j=b.exports={};j.attributes=a("./attributes"),j.supplyDefaults=a("./defaults"),j.calc=a("./calc"),j.calcFromTrace=function(a,b){for(var c=a.x||[],d=a.y,e=c.length||d.length,f=new Array(e),g=0;e>g;g++)f[g]={x:c[g],y:d[g]};return f[0].trace=a,j.calc({calcdata:[f],_fullLayout:b}),f},j.plot=function(a,b,c){var h=b.x(),j=b.y();b.plot.select(".errorlayer").selectAll("g.errorbars").remove();var k;b.plot.select(".errorlayer").selectAll("g.errorbars").data(c).enter().append("g").attr("class","errorbars").each(function(a){var b=a[0].trace,c=b.error_x,l=b.error_y,m=i.hasMarkers(b)&&b.marker.maxdisplayed>0;(l.visible||c.visible)&&e.select(this).selectAll("g").data(g.identity).enter().append("g").each(function(a){k=d(a,h,j);var b,g=e.select(this);if(!m||a.vis){if(l.visible&&f(k.x)&&f(k.yh)&&f(k.ys)){var i=l.width;b="M"+(k.x-i)+","+k.yh+"h"+2*i+"m-"+i+",0V"+k.ys,k.noYS||(b+="m-"+i+",0h"+2*i),g.append("path").classed("yerror",!0).attr("d",b)}if(c.visible&&f(k.y)&&f(k.xh)&&f(k.xs)){var n=(c.copy_ystyle?l:c).width;b="M"+k.xh+","+(k.y-n)+"v"+2*n+"m0,-"+n+"H"+k.xs,k.noXS||(b+="m0,-"+n+"v"+2*n),g.append("path").classed("xerror",!0).attr("d",b)}}})})},j.style=function(a){e.select(a).selectAll("g.errorbars").each(function(a){var b=e.select(this),c=a[0].trace,d=c.error_y||{},f=c.error_x||{};b.selectAll("g path.yerror").style("stroke-width",d.thickness+"px").call(h.stroke,d.color),f.copy_ystyle&&(f=d),b.selectAll("g path.xerror").style("stroke-width",f.thickness+"px").call(h.stroke,f.color)})},j.hoverInfo=function(a,b,c){b.error_y.visible&&(c.yerr=a.yh-a.y,b.error_y.symmetric||(c.yerrneg=a.y-a.ys)),b.error_x.visible&&(c.xerr=a.xh-a.x,b.error_x.symmetric||(c.xerrneg=a.x-a.xs))}},{"../../lib":349,"../../traces/scatter/subtypes":520,"../color":299,"./attributes":319,"./calc":320,"./defaults":322,d3:70,"fast-isnumeric":74}],324:[function(a,b,c){"use strict";var d=a("../../plots/font_attributes"),e=a("../color/attributes"),f=a("../../lib/extend").extendFlat;b.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:e.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:f({},d,{}),traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":345,"../../plots/font_attributes":383,"../color/attributes":298}],325:[function(a,b,c){"use strict";b.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],326:[function(a,b,c){"use strict";function d(a){return a.visible&&j.traceIs(a,"showLegend")}function e(a){return-1!==(a.traceorder||"").indexOf("grouped")}function f(a){return-1!==(a.traceorder||"").indexOf("reversed")}var g=a("../../plotly"),h=a("d3"),i=a("../../lib"),j=a("../../plots/plots"),k=a("../../plots/cartesian/graph_interact"),l=a("../color"),m=a("../drawing"),n=a("../../traces/scatter/subtypes"),o=a("../../traces/pie/style_one"),p=b.exports={},q=a("./constants");p.layoutAttributes=a("./attributes"),p.supplyLayoutDefaults=function(a,b,c){function g(a,b){return i.coerce(k,l,p.layoutAttributes,a,b)}for(var h,k=a.legend||{},l=b.legend={},m=0,n="normal",o=0;o<c.length;o++)h=c[o],d(h)&&(m++,j.traceIs(h,"pie")&&m++),(j.traceIs(h,"bar")&&"stack"===b.barmode||-1!==["tonextx","tonexty"].indexOf(h.fill))&&(n=e({traceorder:n})?"grouped+reversed":"reversed"),void 0!==h.legendgroup&&""!==h.legendgroup&&(n=f({traceorder:n})?"reversed+grouped":"grouped");var q=i.coerce(a,b,j.layoutAttributes,"showlegend",m>1);q!==!1&&(g("bgcolor",b.paper_bgcolor),g("bordercolor"),g("borderwidth"),i.coerceFont(g,"font",b.font),g("traceorder",n),e(b.legend)&&g("tracegroupgap"),g("x"),g("xanchor"),g("y"),g("yanchor"),i.noneOrAll(k,l,["x","y"]))},p.lines=function(a){var b=a[0].trace,c=b.visible&&b.fill&&"none"!==b.fill,d=n.hasLines(b),e=h.select(this).select(".legendfill").selectAll("path").data(c?[a]:[]);e.enter().append("path").classed("js-fill",!0),e.exit().remove(),e.attr("d","M5,0h30v6h-30z").call(m.fillGroupStyle);var f=h.select(this).select(".legendlines").selectAll("path").data(d?[a]:[]);f.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),f.exit().remove(),f.call(m.lineGroupStyle)},p.points=function(a){function b(a,b,c){var d=i.nestedProperty(g,a).get(),e=Array.isArray(d)&&b?b(d):d;if(c){if(e<c[0])return c[0];if(e>c[1])return c[1]}return e}function c(a){return a[0]}var d,e,f=a[0],g=f.trace,j=n.hasMarkers(g),k=n.hasText(g),l=n.hasLines(g);if(j||k||l){var o={},p={};j&&(o.mc=b("marker.color",c),o.mo=b("marker.opacity",i.mean,[.2,1]),o.ms=b("marker.size",i.mean,[2,16]),o.mlc=b("marker.line.color",c),o.mlw=b("marker.line.width",i.mean,[0,5]),p.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),l&&(p.line={width:b("line.width",c,[0,10])}),k&&(o.tx="Aa",o.tp=b("textposition",c),o.ts=10,o.tc=b("textfont.color",c),o.tf=b("textfont.family",c)),d=[i.minExtend(f,o)],e=i.minExtend(g,p)}var q=h.select(this).select("g.legendpoints"),r=q.selectAll("path.scatterpts").data(j?d:[]);r.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),r.exit().remove(),r.call(m.pointStyle,e),j&&(d[0].mrc=3);var s=q.selectAll("g.pointtext").data(k?d:[]);s.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),s.exit().remove(),s.selectAll("text").call(m.textPointStyle,e)},p.bars=function(a){var b=a[0].trace,c=b.marker||{},d=c.line||{},e=h.select(this).select("g.legendpoints").selectAll("path.legendbar").data(j.traceIs(b,"bar")?[a]:[]);e.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),e.exit().remove(),e.each(function(a){var b=(a.mlw+1||d.width+1)-1,e=h.select(this);e.style("stroke-width",b+"px").call(l.fill,a.mc||c.color),b&&e.call(l.stroke,a.mlc||d.color)})},p.boxes=function(a){var b=a[0].trace,c=h.select(this).select("g.legendpoints").selectAll("path.legendbox").data(j.traceIs(b,"box")&&b.visible?[a]:[]);c.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each(function(a){var c=(a.lw+1||b.line.width+1)-1,d=h.select(this);d.style("stroke-width",c+"px").call(l.fill,a.fc||b.fillcolor),c&&d.call(l.stroke,a.lc||b.line.color)})},p.pie=function(a){var b=a[0].trace,c=h.select(this).select("g.legendpoints").selectAll("path.legendpie").data(j.traceIs(b,"pie")&&b.visible?[a]:[]);c.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()&&c.call(o,a[0],b)},p.style=function(a){a.each(function(a){var b=h.select(this),c=b.selectAll("g.legendfill").data([a]);c.enter().append("g").classed("legendfill",!0);var d=b.selectAll("g.legendlines").data([a]);d.enter().append("g").classed("legendlines",!0);var e=b.selectAll("g.legendsymbols").data([a]);e.enter().append("g").classed("legendsymbols",!0),e.style("opacity",a[0].trace.opacity),e.selectAll("g.legendpoints").data([a]).enter().append("g").classed("legendpoints",!0)}).each(p.bars).each(p.boxes).each(p.pie).each(p.lines).each(p.points)},p.texts=function(a,b,c,d,e){function f(a){g.util.convertToTspans(a,function(){b.firstRender&&p.repositionLegend(b,e)}),a.selectAll("tspan.line").attr({x:a.attr("x")})}var i=b._fullLayout,k=c[0].trace,l=j.traceIs(k,"pie"),n=k.index,o=l?c[0].label:k.name,q=h.select(a).selectAll("text.legendtext").data([0]);q.enter().append("text").classed("legendtext",!0),q.attr({x:40,y:0,"data-unformatted":o}).style({"text-anchor":"start","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}).call(m.font,i.legend.font).text(o),b._context.editable&&!l?q.call(g.util.makeEditable).call(f).on("edit",function(a){this.attr({"data-unformatted":a}),this.text(a).call(f),this.text()||(a=" "),g.restyle(b,"name",a,n)}):q.call(f)},p.getLegendData=function(a,b){function c(a,c){if(""!==a&&e(b))-1===p.indexOf(a)?(p.push(a),q=!0,o[a]=[[c]]):o[a].push([c]);else{var d="~~i"+s;p.push(d),o[d]=[[c]],s++}}var g,h,i,k,l,m,n,o={},p=[],q=!1,r={},s=0;for(l=0;l<a.length;l++)if(g=a[l],h=g[0],i=h.trace,k=i.legendgroup,d(i)&&i.showlegend)if(j.traceIs(i,"pie"))for(r[k]||(r[k]={}),m=0;m<g.length;m++)n=g[m].label,r[k][n]||(c(k,{label:n,color:g[m].color,i:g[m].i,trace:i}),r[k][n]=!0);else c(k,h);if(!p.length)return[];var t,u,v=p.length;if(q&&e(b))for(u=new Array(v),l=0;v>l;l++)t=o[p[l]],u[l]=f(b)?t.reverse():t;else{for(u=[new Array(v)],l=0;v>l;l++)t=o[p[l]][0],u[0][f(b)?v-l-1:l]=t;v=1}return b._lgroupsLength=v,u},p.draw=function(a){function b(a){var b=A-q.scrollBarHeight-2*q.scrollBarMargin,c=s.attr("data-scroll"),e=i.constrain(c-a,Math.min(A-d.height,0),0),f=-e/(d.height-A)*b+q.scrollBarMargin;s.attr("data-scroll",e),s.attr("transform","translate(0, "+e+")"),t.call(m.setRect,d.width-(q.scrollBarWidth+q.scrollBarMargin),f,q.scrollBarWidth,q.scrollBarHeight)}var c=a._fullLayout;if(c._infolayer&&a.calcdata){var d=c.legend,f=c.showlegend&&p.getLegendData(a.calcdata,d),n=c.hiddenlabels||[];if(!c.showlegend||!f.length)return c._infolayer.selectAll(".legend").remove(),void j.autoMargin(a,"legend");"undefined"==typeof a.firstRender?a.firstRender=!0:a.firstRender&&(a.firstRender=!1);var o=c._infolayer.selectAll("svg.legend").data([0]);o.enter().append("svg").attr({"class":"legend","pointer-events":"all"});var r=o.selectAll("rect.bg").data([0]);r.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}).call(l.stroke,d.bordercolor).call(l.fill,d.bgcolor).style("stroke-width",d.borderwidth+"px");var s=o.selectAll("g.scrollbox").data([0]);s.enter().append("g").attr("class","scrollbox"), 46 s.exit().remove();var t=o.selectAll("rect.scrollbar").data([0]);t.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(l.fill,"#808BA4");var u=s.selectAll("g.groups").data(f);u.enter().append("g").attr("class","groups"),u.exit().remove(),e(d)&&u.attr("transform",function(a,b){return"translate(0,"+b*d.tracegroupgap+")"});var v=u.selectAll("g.traces").data(i.identity);v.enter().append("g").attr("class","traces"),v.exit().remove(),v.call(p.style).style("opacity",function(a){var b=a[0].trace;return j.traceIs(b,"pie")?-1!==n.indexOf(a[0].label)?.5:1:"legendonly"===b.visible?.5:1}).each(function(b,c){p.texts(this,a,b,c,v);var d=h.select(this).selectAll("rect").data([0]);d.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(l.fill,"rgba(0,0,0,0)"),d.on("click",function(){if(!a._dragged){var c,d,e=a._fullData,f=b[0].trace,h=f.legendgroup,i=[];if(j.traceIs(f,"pie")){var k=b[0].label,l=n.slice(),m=l.indexOf(k);-1===m?l.push(k):l.splice(m,1),g.relayout(a,"hiddenlabels",l)}else{if(""===h)i=[f.index];else for(var o=0;o<e.length;o++)c=e[o],c.legendgroup===h&&i.push(c.index);d=f.visible===!0?"legendonly":!0,g.restyle(a,"visible",d,i)}}})}),p.repositionLegend(a,v);var w=c._size,x=w.l+w.w*d.x,y=w.t+w.h*(1-d.y);"right"===d.xanchor||"auto"===d.xanchor&&d.x>=2/3?x-=d.width:("center"===d.xanchor||"auto"===d.xanchor&&d.x>1/3)&&(x-=d.width/2),"bottom"===d.yanchor||"auto"===d.yanchor&&d.y<=1/3?y-=d.height:("middle"===d.yanchor||"auto"===d.yanchor&&d.y<2/3)&&(y-=d.height/2);var z=c.height-c.margin.b,A=Math.min(z-y,d.height),B=s.attr("data-scroll")?s.attr("data-scroll"):0;if(s.attr("transform","translate(0, "+B+")"),r.attr({width:d.width-2*d.borderwidth,height:A-2*d.borderwidth,x:d.borderwidth,y:d.borderwidth}),o.call(m.setRect,x,y,d.width,A),a.firstRender&&d.height-A>0&&!a._context.staticPlot&&(r.attr({width:d.width-2*d.borderwidth+q.scrollBarWidth}),o.node().addEventListener("wheel",function(a){a.preventDefault(),b(a.deltaY/20)}),t.node().addEventListener("mousedown",function(a){function c(a){1===a.buttons&&b(a.movementY)}function d(){t.node().removeEventListener("mousemove",c),window.removeEventListener("mouseup",d)}a.preventDefault(),window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)}),t.call(m.setRect,d.width-(q.scrollBarWidth+q.scrollBarMargin),q.scrollBarMargin,q.scrollBarWidth,q.scrollBarHeight)),a._context.editable){var C,D,E,F,G,H;k.dragElement({element:o.node(),prepFn:function(){E=Number(o.attr("x")),F=Number(o.attr("y")),G=Number(o.attr("width")),H=Number(o.attr("height")),k.setCursor(o)},moveFn:function(b,c){var e=a._fullLayout._size;o.call(m.setPosition,E+b,F+c),C=k.dragAlign(E+b,G,e.l,e.l+e.w,d.xanchor),D=k.dragAlign(F+c+H,-H,e.t+e.h,e.t,d.yanchor);var f=k.dragCursors(C,D,d.xanchor,d.yanchor);k.setCursor(o,f)},doneFn:function(b){k.setCursor(o),b&&void 0!==C&&void 0!==D&&g.relayout(a,{"legend.x":C,"legend.y":D})}})}}},p.repositionLegend=function(a,b){var c=a._fullLayout,d=c._size,f=c.legend,g=f.borderwidth;f.width=0,f.height=0,b.each(function(a){var b,c,d=a[0].trace,e=h.select(this),i=e.selectAll(".legendtoggle"),j=e.selectAll(".legendtext"),k=e.selectAll(".legendtext>tspan"),l=1.3*f.font.size,n=k[0].length||1,o=j.node()&&m.bBox(j.node()).width,p=e.select("g[class*=math-group]");if(!d.showlegend)return void e.remove();if(p.node()){var q=m.bBox(p.node());l=q.height,o=q.width,p.attr("transform","translate(0,"+l/4+")")}else b=l*(.3+(1-n)/2),j.attr("y",b),k.attr("y",b);c=Math.max(l*n,16)+3,e.attr("transform","translate("+g+","+(5+g+f.height+c/2)+")"),i.attr({x:0,y:-c/2,height:c}),f.height+=c,f.width=Math.max(f.width,o||0)}),f.width+=45+2*g,f.height+=10+2*g,e(f)&&(f.height+=(f._lgroupsLength-1)*f.tracegroupgap),b.selectAll(".legendtoggle").attr("width",(a._context.editable?0:f.width)+40);var i=d.l+d.w*f.x,k=d.t+d.h*(1-f.y),l="left";"right"===f.xanchor||"auto"===f.xanchor&&f.x>=2/3?(i-=f.width,l="right"):("center"===f.xanchor||"auto"===f.xanchor&&f.x>1/3)&&(i-=f.width/2,l="center");var n="top";"bottom"===f.yanchor||"auto"===f.yanchor&&f.y<=1/3?(k-=f.height,n="bottom"):("middle"===f.yanchor||"auto"===f.yanchor&&f.y<2/3)&&(k-=f.height/2,n="middle"),f.width=Math.ceil(f.width),f.height=Math.ceil(f.height),i=Math.round(i),k=Math.round(k),j.autoMargin(a,"legend",{x:f.x,y:f.y,l:f.width*({right:1,center:.5}[l]||0),r:f.width*({left:1,center:.5}[l]||0),b:f.height*({top:1,middle:.5}[n]||0),t:f.height*({bottom:1,middle:.5}[n]||0)})}},{"../../lib":349,"../../plotly":366,"../../plots/cartesian/graph_interact":374,"../../plots/plots":413,"../../traces/pie/style_one":500,"../../traces/scatter/subtypes":520,"../color":299,"../drawing":317,"./attributes":324,"./constants":325,d3:70}],327:[function(a,b,c){"use strict";function d(a,b){var c=b.currentTarget,d=c.getAttribute("data-attr"),e=c.getAttribute("data-val")||!0,f=a._fullLayout,g={};if("zoom"===d)for(var h,i,k,l="in"===e?.5:2,m=(1+l)/2,n=(1-l)/2,p=j.Axes.list(a,null,!0),q=0;q<p.length;q++)h=p[q],h.fixedrange||(i=h._name,"auto"===e?g[i+".autorange"]=!0:"reset"===e?void 0===h._rangeInitial?g[i+".autorange"]=!0:g[i+".range"]=h._rangeInitial.slice():(k=h.range,g[i+".range"]=[m*k[0]+n*k[1],m*k[1]+n*k[0]]));else"hovermode"!==d||"x"!==e&&"y"!==e||(e=f._isHoriz?"y":"x",c.setAttribute("data-val",e)),g[d]=e;j.relayout(a,g).then(function(){"dragmode"===d&&(f._hasCartesian&&j.Fx.setCursor(f._paper.select(".nsewdrag"),o[e]),j.Fx.supplyLayoutDefaults(a.layout,f,a._fullData),j.Fx.init(a))})}function e(a,b){for(var c=b.currentTarget,d=c.getAttribute("data-attr"),e=c.getAttribute("data-val")||!0,f=a._fullLayout,g=j.Plots.getSubplotIds(f,"gl3d"),h={},i=d.split("."),k=0;k<g.length;k++)h[g[k]+"."+i[1]]=e;j.relayout(a,h)}function f(a,b){for(var c=b.currentTarget,d=c.getAttribute("data-attr"),e=a._fullLayout,f=j.Plots.getSubplotIds(e,"gl3d"),g=0;g<f.length;g++){var h=f[g],i=e[h],k=i._scene;"resetDefault"===d?k.setCameraToDefault():"resetLastSave"===d&&k.setCamera(i.camera)}}function g(a,b){var c=b.currentTarget,d=c._previousVal||!1,e=a.layout,f=a._fullLayout,g=j.Plots.getSubplotIds(f,"gl3d"),h=["xaxis","yaxis","zaxis"],i=["showspikes","spikesides","spikethickness","spikecolor"],l={},m={},n={};if(d)n=k.extendDeep(e,d),c._previousVal=null;else{n={"allaxes.showspikes":!1};for(var o=0;o<g.length;o++){var p=g[o],q=f[p],r=l[p]={};r.hovermode=q.hovermode,n[p+".hovermode"]=!1;for(var s=0;3>s;s++){var t=h[s];m=r[t]={};for(var u=0;u<i.length;u++){var v=i[u];m[v]=q[t][v]}}}c._previousVal=k.extendDeep({},l)}j.relayout(a,n)}function h(a,b){for(var c=b.currentTarget,d=c.getAttribute("data-attr"),e=c.getAttribute("data-val")||!0,f=a._fullLayout,g=j.Plots.getSubplotIds(f,"geo"),h=0;h<g.length;h++){var i=f[g[h]]._geo;if("zoom"===d){var k=i.projection.scale(),l="in"===e?2*k:.5*k;i.projection.scale(l),i.zoom.scale(l),i.render()}else"reset"===d&&i.zoomReset()}}function i(a){var b,c=a._fullLayout;b=c._hasCartesian?c._isHoriz?"y":"x":"closest";var d=a._fullLayout.hovermode?!1:b;j.relayout(a,"hovermode",d)}var j=a("../../plotly"),k=a("../../lib"),l=a("../../snapshot"),m=a("../../../build/ploticon"),n=b.exports={};n.toImage={name:"toImage",title:"Download plot as a png",icon:m.camera,click:function(a){var b="png";if(k.isIE())return void k.notifier("Snapshotting is unavailable in Internet Explorer. Consider exporting your images using the Plotly Cloud","long");if(a._snapshotInProgress)return void k.notifier("Snapshotting is still in progress - please hold","long");a._snapshotInProgress=!0,k.notifier("Taking snapshot - this may take a few seconds","long");var c=l.toImage(a,{format:b}),d=a.fn||"newplot";d+="."+b,c.once("success",function(b){a._snapshotInProgress=!1;var e=document.createElement("a");e.href=b,e.download=d,document.body.appendChild(e),e.click(),document.body.removeChild(e),c.clean()}),c.once("error",function(d){a._snapshotInProgress=!1,k.notifier("Sorry there was a problem downloading your "+b,"long"),console.error(d),c.clean()})}},n.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:m.disk,click:function(a){j.Plots.sendDataToCloud(a)}},n.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:m.zoombox,click:d},n.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:m.pan,click:d},n.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:m.selectbox,click:d},n.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:m.lasso,click:d},n.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:m.zoom_plus,click:d},n.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:m.zoom_minus,click:d},n.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:m.autoscale,click:d},n.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:m.home,click:d},n.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:m.tooltip_basic,gravity:"ne",click:d},n.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(a){return a._fullLayout._isHoriz?"y":"x"},icon:m.tooltip_compare,gravity:"ne",click:d};var o={pan:"move",zoom:"crosshair",select:"crosshair",lasso:"crosshair"};n.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:m.zoombox,click:e},n.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:m.pan,click:e},n.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:m["3d_rotate"],click:e},n.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:m["z-axis"],click:e},n.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:m.home,click:f},n.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:m.movie,click:f},n.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:g},n.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:m.zoom_plus,click:h},n.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:m.zoom_minus,click:h},n.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:m.autoscale,click:h},n.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:i},n.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:i},n.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:m.tooltip_basic,gravity:"ne",click:i},n.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:function(a,b){i(a),g(a,b)}},n.resetViews={name:"resetViews",title:"Reset views",icon:m.home,click:function(a,b){var c=b.currentTarget;c.setAttribute("data-attr","zoom"),c.setAttribute("data-val","reset"),d(a,b),c.setAttribute("data-attr","resetLastSave"),f(a,b)}}},{"../../../build/ploticon":2,"../../lib":349,"../../plotly":366,"../../snapshot":420}],328:[function(a,b,c){"use strict";function d(a){this.container=a.container,this.element=document.createElement("div"),this.update(a.graphInfo,a.buttons),this.container.appendChild(this.element)}function e(a,b){var c=a._fullLayout,e=new d({graphInfo:a,container:c._paperdiv.node(),buttons:b});return c._privateplot&&f.select(e.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),e}var f=a("d3"),g=a("../../lib"),h=a("../../../build/ploticon"),i=d.prototype;i.update=function(a,b){this.graphInfo=a;var c=this.graphInfo._context;"hover"===c.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var d=!this.hasButtons(b),e=this.hasLogo!==c.displaylogo;(d||e)&&(this.removeAllButtons(),this.updateButtons(b),c.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},i.updateButtons=function(a){var b=this;this.buttons=a,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(a){var c=b.createGroup();a.forEach(function(a){var d=a.name;if(!d)throw new Error("must provide button 'name' in button config");if(-1!==b.buttonsNames.indexOf(d))throw new Error("button name '"+d+"' is taken");b.buttonsNames.push(d);var e=b.createButton(a);b.buttonElements.push(e),c.appendChild(e)}),b.element.appendChild(c)})},i.createGroup=function(){var a=document.createElement("div");return a.className="modebar-group",a},i.createButton=function(a){var b=this,c=document.createElement("a");c.setAttribute("rel","tooltip"),c.className="modebar-btn";var d=a.title;void 0===d&&(d=a.name),(d||0===d)&&c.setAttribute("data-title",d),void 0!==a.attr&&c.setAttribute("data-attr",a.attr);var e=a.val;void 0!==e&&("function"==typeof e&&(e=e(this.graphInfo)),c.setAttribute("data-val",e));var f=a.click;if("function"!=typeof f)throw new Error("must provide button 'click' function in button config");return c.addEventListener("click",function(c){a.click(b.graphInfo,c),b.updateActiveButton(c.currentTarget)}),c.setAttribute("data-toggle",a.toggle||!1),a.toggle&&c.classList.add("active"),c.appendChild(this.createIcon(a.icon||h.question)),c.setAttribute("data-gravity",a.gravity||"n"),c},i.createIcon=function(a){var b=a.ascent-a.descent,c="http://www.w3.org/2000/svg",d=document.createElementNS(c,"svg"),e=document.createElementNS(c,"path");return d.setAttribute("height","1em"),d.setAttribute("width",a.width/b+"em"),d.setAttribute("viewBox",[0,0,a.width,b].join(" ")),e.setAttribute("d",a.path),e.setAttribute("transform","matrix(1 0 0 -1 0 "+a.ascent+")"),d.appendChild(e),d},i.updateActiveButton=function(a){var b=this.graphInfo._fullLayout,c=void 0!==a?a.getAttribute("data-attr"):null;this.buttonElements.forEach(function(a){var d=a.getAttribute("data-val")||!0,e=a.getAttribute("data-attr"),h="true"===a.getAttribute("data-toggle"),i=f.select(a);if(h)e===c&&i.classed("active",!i.classed("active"));else{var j=null===e?e:g.nestedProperty(b,e).get();i.classed("active",j===d)}})},i.hasButtons=function(a){var b=this.buttons;if(!b)return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;++c){if(a[c].length!==b[c].length)return!1;for(var d=0;d<a[c].length;d++)if(a[c][d].name!==b[c][d].name)return!1}return!0},i.getLogo=function(){var a=this.createGroup(),b=document.createElement("a");return b.href="https://plot.ly/",b.target="_blank",b.setAttribute("data-title","Produced with Plotly"),b.className="modebar-btn plotlyjsicon modebar-btn--logo",b.appendChild(this.createIcon(h.plotlylogo)),a.appendChild(b),a},i.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},i.destroy=function(){g.removeElement(this.container.querySelector(".modebar"))},b.exports=e},{"../../../build/ploticon":2,"../../lib":349,d3:70}],329:[function(a,b,c){"use strict";function d(a,b,c){function d(a){for(var c=[],d=0;d<a.length;d++){var e=a[d];-1===b.indexOf(e)&&c.push(l[e])}p.push(c)}var h=a._fullLayout,i=a._fullData,j=h._hasCartesian,k=h._hasGL3D,m=h._hasGeo,n=h._hasPie,o=h._hasGL2D,p=[];if(d(["toImage","sendDataToCloud"]),(j||o||n)+m+k>1)return d(["resetViews","toggleHover"]),g(p,c);k&&(d(["zoom3d","pan3d","orbitRotation","tableRotation"]),d(["resetCameraDefault3d","resetCameraLastSave3d"]),d(["hoverClosest3d"])),m&&(d(["zoomInGeo","zoomOutGeo","resetGeo"]),d(["hoverClosestGeo"]));var q=e(h),r=[];return!j&&!o||q||(r=["zoom2d","pan2d"]),j&&f(i)&&(r.push("select2d"),r.push("lasso2d")),r.length&&d(r),!j&&!o||q||d(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),j&&n?d(["toggleHover"]):o?d(["hoverClosestGl2d"]):j?d(["hoverClosestCartesian","hoverCompareCartesian"]):n&&d(["hoverClosestPie"]),g(p,c)}function e(a){for(var b=i.Axes.list({_fullLayout:a},null,!0),c=!0,d=0;d<b.length;d++)if(!b[d].fixedrange){c=!1;break}return c}function f(a){for(var b=!1,c=0;c<a.length&&!b;c++){var d=a[c];d._module&&d._module.selectPoints&&("scatter"===d.type?(j.hasMarkers(d)||j.hasText(d))&&(b=!0):b=!0)}return b}function g(a,b){if(b.length)if(Array.isArray(b[0]))for(var c=0;c<b.length;c++)a.push(b[c]);else a.push(b);return a}function h(a){for(var b=0;b<a.length;b++)for(var c=a[b],d=0;d<c.length;d++){var e=c[d];if("string"==typeof e){if(void 0===l[e])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));a[b][d]=l[e]}}return a}var i=a("../../plotly"),j=a("../../traces/scatter/subtypes"),k=a("./"),l=a("./buttons");b.exports=function(a){var b=a._fullLayout,c=a._context,e=b._modeBar;if(!c.displayModeBar)return void(e&&(e.destroy(),delete b._modeBar));if(!Array.isArray(c.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(c.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,g=c.modeBarButtons;f=Array.isArray(g)&&g.length?h(g):d(a,c.modeBarButtonsToRemove,c.modeBarButtonsToAdd),e?e.update(a,f):b._modeBar=k(a,f)}},{"../../plotly":366,"../../traces/scatter/subtypes":520,"./":328,"./buttons":327}],330:[function(a,b,c){"use strict";var d=a("../annotations/attributes"),e=a("../../traces/scatter/attributes"),f=a("../../lib/extend").extendFlat,g=e.line;b.exports={_isLinkedToArray:!0,type:{valType:"enumerated",values:["circle","rect","path","line"]},xref:f({},d.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:f({},d.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:g.color,width:g.width,dash:g.dash},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":345,"../../traces/scatter/attributes":502,"../annotations/attributes":296}],331:[function(a,b,c){"use strict";function d(a,b){function c(b,c){return j.Lib.coerce(a,d,l.layoutAttributes,b,c)}var d={};c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var e=a.path?"path":"rect",g=c("type",e),h=["x","y"],i=0;2>i;i++){var k=h[i],m={_fullLayout:b},n=j.Axes.coerceRef(a,d,m,k);if("path"!==g){var o=.25,p=.75;if("paper"!==n){var q=j.Axes.getFromId(m,n),r=f(q);o=r(q.range[0]+o*(q.range[1]-q.range[0])),p=r(q.range[0]+p*(q.range[1]-q.range[0]))}c(k+"0",o),c(k+"1",p)}}return"path"===g?c("path"):j.Lib.noneOrAll(a,d,["x0","x1","y0","y1"]),d}function e(a){return"category"===a.type?a.c2l:a.d2l}function f(a){return"category"===a.type?a.l2c:a.l2d}function g(a){return function(b){return a(b.replace("_"," "))}}function h(a,b){var c,d,f,h,i=b.type,k=j.Axes.getFromId(a,b.xref),m=j.Axes.getFromId(a,b.yref),n=a._fullLayout._size;if(k?(c=e(k),d=function(a){return k._offset+k.l2p(c(a,!0))}):d=function(a){return n.l+n.w*a},m?(f=e(m),h=function(a){return m._offset+m.l2p(f(a,!0))}):h=function(a){return n.t+n.h*(1-a)},"path"===i)return k&&"date"===k.type&&(d=g(d)),m&&"date"===m.type&&(h=g(h)),l.convertPath(b.path,d,h);var o=d(b.x0),p=d(b.x1),q=h(b.y0),r=h(b.y1);if("line"===i)return"M"+o+","+q+"L"+p+","+r;if("rect"===i)return"M"+o+","+q+"H"+p+"V"+r+"H"+o+"Z";var s=(o+p)/2,t=(q+r)/2,u=Math.abs(s-o),v=Math.abs(t-q),w="A"+u+","+v,x=s+u+","+t,y=s+","+(t-v);return"M"+x+w+" 0 1,1 "+y+w+" 0 0,1 "+x+"Z"}function i(a,b,c,d,e){var f="category"===a.type?Number:a.d2c;if(void 0!==b)return[f(b),f(c)];if(d){var h,i,j,k,l,o=1/0,p=-(1/0),q=d.match(m);for("date"===a.type&&(f=g(f)),h=0;h<q.length;h++)i=q[h],j=e[i.charAt(0)].drawn,void 0!==j&&(k=q[h].substr(1).match(n),!k||k.length<j||(l=f(k[j]),o>l&&(o=l),l>p&&(p=l)));return p>=o?[o,p]:void 0}}var j=a("../../plotly"),k=a("fast-isnumeric"),l=b.exports={};l.layoutAttributes=a("./attributes"),l.supplyLayoutDefaults=function(a,b){for(var c=a.shapes||[],e=b.shapes=[],f=0;f<c.length;f++)e.push(d(c[f]||{},b))},l.drawAll=function(a){var b=a._fullLayout;b._shapelayer.selectAll("path").remove();for(var c=0;c<b.shapes.length;c++)l.draw(a,c)},l.add=function(a){var b=a._fullLayout.shapes.length;j.relayout(a,"shapes["+b+"]","add")},l.draw=function(a,b,c,g){var i,m=a.layout,n=a._fullLayout;if(!k(b)||-1===b){if(!b&&Array.isArray(g))return m.shapes=g,l.supplyLayoutDefaults(m,n),void l.drawAll(a);if("remove"===g)return delete m.shapes,n.shapes=[],void l.drawAll(a);if(c&&"add"!==g){for(i=0;i<n.shapes.length;i++)l.draw(a,i,c,g);return}b=n.shapes.length,n.shapes.push({})}if(!c&&g){if("remove"===g){for(n._shapelayer.selectAll('[data-index="'+b+'"]').remove(),n.shapes.splice(b,1),m.shapes.splice(b,1),i=b;i<n.shapes.length;i++)n._shapelayer.selectAll('[data-index="'+(i+1)+'"]').attr("data-index",String(i)),l.draw(a,i);return}if("add"===g||j.Lib.isPlainObject(g)){n.shapes.splice(b,0,{});var o=j.Lib.isPlainObject(g)?j.Lib.extendFlat({},g):{text:"New text"};for(m.shapes?m.shapes.splice(b,0,o):m.shapes=[o],i=n.shapes.length-1;i>b;i--)n._shapelayer.selectAll('[data-index="'+(i-1)+'"]').attr("data-index",String(i)),l.draw(a,i)}}n._shapelayer.selectAll('[data-index="'+b+'"]').remove();var p=m.shapes[b];if(p){var q={xref:p.xref,yref:p.yref},r={};"string"==typeof c&&c?r[c]=g:j.Lib.isPlainObject(c)&&(r=c);var s=Object.keys(r);for(i=0;i<r.length;i++){var t=s[i];j.Lib.nestedProperty(p,t).set(r[t])}var u=["x0","x1","y0","y1"];for(i=0;4>i;i++){var v=u[i];if(void 0===r[v]&&void 0!==p[v]){var w,x=v.charAt(0),y=j.Axes.getFromId(a,j.Axes.coerceRef(q,{},a,x)),z=j.Axes.getFromId(a,j.Axes.coerceRef(p,{},a,x)),A=p[v];void 0!==r[x+"ref"]&&(y?(w=e(y)(A),A=(w-y.range[0])/(y.range[1]-y.range[0])):A=(A-z.domain[0])/(z.domain[1]-z.domain[0]),z?(w=z.range[0]+A*(z.range[1]-z.range[0]),A=f(z)(w)):A=y.domain[0]+A*(y.domain[1]-y.domain[0])),p[v]=A}}var B=d(p,n);n.shapes[b]=B;var C={"data-index":String(b),"fill-rule":"evenodd",d:h(a,B)},D=(B.xref+B.yref).replace(/paper/g,""),E=B.line.width?B.line.color:"rgba(0,0,0,0)",F=n._shapelayer.append("path").attr(C).style("opacity",B.opacity).call(j.Color.stroke,E).call(j.Color.fill,B.fillcolor).call(j.Drawing.dashLine,B.line.dash,B.line.width);D&&F.call(j.Drawing.setClipUrl,"clip"+n._uid+D)}};var m=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,n=/[^\s,]+/g,o={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},p={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},q={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};l.convertPath=function(a,b,c){return a.replace(m,function(a){var d=0,e=a.charAt(0),f=o[e],g=p[e],h=q[e],i=a.substr(1).replace(n,function(a){return f[d]?a=b(a):g[d]&&(a=c(a)),d++,d>h&&(a="X"),a});return d>h&&(i=i.replace(/[\s,]*X.*/,""),console.log("ignoring extra params in segment "+a)),e+i})},l.calcAutorange=function(a){var b,c,d,e,f,g=a._fullLayout,h=g.shapes;if(h.length&&a._fullData.length)for(b=0;b<h.length;b++)c=h[b],d=c.line.width/2,"paper"!==c.xref&&(e=j.Axes.getFromId(a,c.xref),f=i(e,c.x0,c.x1,c.path,o),f&&j.Axes.expand(e,f,{ppad:d})),"paper"!==c.yref&&(e=j.Axes.getFromId(a,c.yref),f=i(e,c.y0,c.y1,c.path,p),f&&j.Axes.expand(e,f,{ppad:d}))}},{"../../plotly":366,"./attributes":330,"fast-isnumeric":74}],332:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../plotly"),g=a("../../plots/plots"),h=a("../../lib"),i=a("../drawing"),j=a("../color"),k=a("../../lib/svg_text_utils"),l=a("../../plots/cartesian/axis_ids"),m=b.exports={};m.draw=function(a,b){function c(a){h.syncOrAsync([m,n],a)}function m(b){return b.attr("transform",H?"rotate("+[H.rotate,r.x,r.y]+") translate(0, "+H.offset+")":null),b.style({"font-family":E,"font-size":d.round(F,2)+"px",fill:j.rgb(G),opacity:K*j.opacity(G),"font-weight":g.fontWeight}).attr(r).call(k.convertToTspans).attr(r),b.selectAll("tspan.line").attr(r),g.previousPromises(a)}function n(a){var b=d.select(a.node().parentNode);if(I&&I.selection&&I.side&&M){b.attr("transform",null);var c=0,f={left:"right",right:"left",top:"bottom",bottom:"top"}[I.side],g=-1!==["left","top"].indexOf(I.side)?-1:1,j=e(I.pad)?I.pad:2,k=i.bBox(b.node()),l={left:0,top:0,right:s.width,bottom:s.height},m=v?s.width:(l[I.side]-k[I.side])*("left"===I.side||"top"===I.side?-1:1);if(0>m?c=m:(k.left-=I.offsetLeft,k.right-=I.offsetLeft,k.top-=I.offsetTop,k.bottom-=I.offsetTop,I.selection.each(function(){var a=i.bBox(this);h.bBoxIntersect(k,a,j)&&(c=Math.max(c,g*(a[I.side]-k[f])+j))}),c=Math.min(m,c)),c>0||0>m){var n={left:[-c,0],right:[c,0],top:[0,-c],bottom:[0,c]}[I.side];b.attr("transform","translate("+n+")")}}}function o(){K=0,L=!0,M=Q,s._infolayer.select("."+b).attr({"data-unformatted":M}).text(M).on("mouseover.opacity",function(){d.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(1e3).style("opacity",0)})}var p,q,r,s=a._fullLayout,t=s._size,u=b.charAt(0),v="cb"===b.substr(1,2);if(v){var w=b.substr(3).replace("title","");a._fullData.some(function(b,c){return b.uid===w?(p=c,q=a.calcdata[c][0].t.cb.axis,!0):void 0})}else q=s[l.id2name(b.replace("title",""))]||s;var x,y,z,A,B,C=q===s?"title":q._name+".title",D=v?"colorscale":(q._id||u).toUpperCase()+" axis",E=q.titlefont.family,F=q.titlefont.size,G=q.titlefont.color,H="",I={selection:d.select(a).selectAll("g."+q._id+"tick"),side:q.side},J=v?0:1.5;v?(I.offsetLeft=t.l,I.offsetTop=t.t):I.selection.size()&&(B=d.select(I.selection.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/),B&&(I.offsetLeft=+B[1],I.offsetTop=+B[2])),v&&q.titleside?(x=t.l+q.titlex*t.w,y=t.t+(1-q.titley)*t.h+("top"===q.titleside?3+.75*F:-3-.25*F),r={x:x,y:y,"text-anchor":"start"},I={},b="h"+b):"x"===u?(z=q,A="free"===z.anchor?{_offset:t.t+(1-(z.position||0))*t.h,_length:0}:l.getFromId(a,z.anchor),x=z._offset+z._length/2,y=A._offset+("top"===z.side?-10-F*(J+(z.showticklabels?1:0)):A._length+10+F*(J+(z.showticklabels?1.5:.5))),r={x:x,y:y,"text-anchor":"middle"},I.side||(I.side="bottom")):"y"===u?(A=q,z="free"===A.anchor?{_offset:t.l+(A.position||0)*t.w,_length:0}:l.getFromId(a,A.anchor),y=A._offset+A._length/2,x=z._offset+("right"===A.side?z._length+10+F*(J+(A.showticklabels?1:.5)):-10-F*(J+(A.showticklabels?.5:0))),r={x:x,y:y,"text-anchor":"middle"},H={rotate:"-90",offset:0},I.side||(I.side="left")):(D="Plot",F=s.titlefont.size,x=s.width/2,y=s._size.t/2,r={x:x,y:y,"text-anchor":"middle"},I={});var K=1,L=!1,M=q.title.trim();""===M&&(K=0),M.match(/Click to enter .+ title/)&&(K=.2,L=!0);var N;if(v){N=d.select(a).selectAll("."+q._id.substr(1)+" .cbtitle");var O="h"===b.charAt(0)?b.substr(1):"h"+b;N.selectAll("."+O+",."+O+"-math-group").remove()}else N=s._infolayer.selectAll(".g-"+b).data([0]),N.enter().append("g").classed("g-"+b,!0);var P=N.selectAll("text").data([0]);P.enter().append("text"),P.text(M).attr("class",b),P.attr({"data-unformatted":M}).call(c);var Q="Click to enter "+D.replace(/\d+/,"")+" title";a._context.editable?(M||o(),P.call(k.makeEditable).on("edit",function(b){if(v){var c=a._fullData[p];g.traceIs(c,"markerColorscale")?f.restyle(a,"marker.colorbar.title",b,p):f.restyle(a,"colorbar.title",b,p)}else f.relayout(a,C,b)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(c)}).on("input",function(a){this.text(a||" ").attr(r).selectAll("tspan.line").attr(r)})):M&&!M.match(/Click to enter .+ title/)||P.remove(),P.classed("js-placeholder",L)}},{"../../lib":349,"../../lib/svg_text_utils":360,"../../plotly":366,"../../plots/cartesian/axis_ids":371,"../../plots/plots":413,"../color":299,"../drawing":317,d3:70,"fast-isnumeric":74}],333:[function(a,b,c){"use strict";b.exports={DZA:"algeria",AGO:"angola",EGY:"egypt",BGD:"bangladesh|^(?=.*east).*paki?stan",NER:"\\bniger(?!ia)",LIE:"liechtenstein",NAM:"namibia",BGR:"bulgaria",BOL:"bolivia",GHA:"ghana|gold.?coast",CCK:"\\bcocos|keeling",PAK:"^(?!.*east).*paki?stan",CPV:"verde",JOR:"jordan",LBR:"liberia",LBY:"libya",MYS:"malaysia",IOT:"british.?indian.?ocean",PRI:"puerto.?rico",MYT:"mayotte",PRK:"^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|\\bd\\.?p\\.?r\\.?k",PSE:"palestin|\\bgaza|west.?bank",TZA:"tanzania",BWA:"botswana|bechuana",KHM:"cambodia|kampuchea|khmer|^p\\.?r\\.?k\\.?$",UMI:"minor.?outlying.?is",TTO:"trinidad|tobago",PRY:"paraguay",HKG:"hong.?kong",SAU:"\\bsa\\w*.?arabia",LBN:"lebanon",SVN:"slovenia",BFA:"burkina|\\bfaso|upper.?volta",SVK:"^(?!.*cze).*slovak",MRT:"mauritania",HRV:"croatia",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai).*china|^p\\.?r\\.?c\\.?$",KNA:"kitts|\\bnevis",JAM:"jamaica",SMR:"san.?marino",GIB:"gibraltar",DJI:"djibouti",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",FIN:"finland",URY:"uruguay",VAT:"holy.?see|vatican|papal.?st",STP:"\\bs(a|ã)o.?tom(e|é)",SYC:"seychell",NPL:"nepal",CXR:"christmas",LAO:"\\blaos?\\b",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",BVT:"bouvet",ZAF:"\\bs\\w*.?africa",KIR:"kiribati",PHL:"philippines",SXM:"^(?!.*martin)(?!.*saba).*maarten",ROU:"r(o|u|ou)mania",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",SYR:"syria",MAC:"maca(o|u)",NFK:"norfolk",NIC:"nicaragua",MLT:"\\bmalta",KAZ:"kazak",TCA:"turks",PYF:"french.?polynesia|tahiti",NIU:"niue",DMA:"dominica(?!n)",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",BEN:"benin|dahome",GUF:"^(?=.*french).*guiana",BEL:"^(?!.*luxem).*belgium",MSR:"montserrat",TGO:"togo",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GUM:"\\bguam",LKA:"sri.?lanka|ceylon",SSD:"\\bs\\w*.?sudan",FLK:"falkland|malvinas",PCN:"pitcairn",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",GUY:"guyana|british.?guiana",CRI:"costa.?rica",COK:"\\bcook",MAR:"morocco|\\bmaroc",MNP:"mariana",LSO:"lesotho|basuto",HUN:"^(?!.*austr).*hungary",TKM:"turkmen",SUR:"surinam|dutch.?guiana",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",BMU:"bermuda",HMD:"heard.*mcdonald",TCD:"\\bchad",GEO:"^(?!.*south).*georgia",MNE:"^(?!.*serbia).*montenegro",MNG:"mongolia",MHL:"marshall",MTQ:"martinique",CSK:"czechoslovakia",BLZ:"belize|^(?=.*british).*honduras",DDR:"german.?democratic.?republic|^(d|g)\\.?d\\.?r\\.?$|^(?=.*east).*germany",MMR:"myanmar|burma",AFG:"afghan",BDI:"burundi",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",BLR:"belarus|byelo",BLM:"barth(e|é)lemy",GRD:"grenada",TKL:"tokelau",GRC:"greece|hellenic|hellas",GRL:"greenland",SHN:"helena",AND:"andorra",MOZ:"mozambique",TJK:"tajik",THA:"thailand|\\bsiam",HTI:"haiti",MEX:"\\bmexic",ANT:"^(?=.*\\bant).*(nether|dutch)",ZWE:"zimbabwe|^(?!.*northern).*rhodesia",LCA:"\\blucia",IND:"india(?!.*ocea)",LVA:"latvia",BTN:"bhutan",VCT:"vincent",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",NOR:"norway",CZE:"^(?=.*rep).*czech|czechia|bohemia",ATF:"french.?southern|\\bfr.*\\bso.*\\ban.*\\b\\bt",ATG:"antigua",FJI:"fiji",HND:"^(?!.*brit).*honduras",MUS:"mauritius",DOM:"dominican",LUX:"^(?!.*belg).*luxem",ISR:"israel",YUG:"yugoslavia",FSM:"micronesia",PER:"peru",REU:"r(e|é)union",IDN:"indonesia",VUT:"vanuatu|new.?hebrides",MKD:"macedonia|^f\\.?y\\.?r\\.?o\\.?m\\.?$",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|\\bd\\.?r\\.?c|\\bd\\.?r\\.?o\\.?c|\\br\\.?d\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\w{1,2}opoldville",COG:"^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\w{1,2}opoldville)(?!.*free).*\\bcongo",ISL:"iceland",GLP:"guadeloupe",ETH:"ethiopia|abyssinia",COM:"comoro",COL:"colombia",NGA:"nigeria",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TWN:"taiwan|taipei|formosa",PRT:"portugal",MDA:"moldov|b(a|e)ssarabia",GGY:"guernsey",MDG:"madagascar|malagasy",ATA:"antarctica",ECU:"ecuador",SEN:"senegal",ESH:"sahara",MDV:"maldive",ASM:"^(?=.*americ).*samoa", 47 SPM:"miquelon",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",LTU:"lithuania",RWA:"rwanda",ZMB:"zambia|northern.?rhodesia",GMB:"gambia",WLF:"futuna|wallis",JEY:"jersey",FRO:"faroe|faeroe",GTM:"guatemala",DNK:"denmark",IMN:"^(?=.*isle).*\\bman",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baust.*\\bemp",SJM:"svalbard",VEN:"venezuela",PLW:"palau",KEN:"kenya|british.?east.?africa|east.?africa.?prot",TUR:"turkey",ALB:"albania",OMN:"\\boman|trucial",TUV:"tuvalu",ALA:"\\b(a|Ã¥)land",BRN:"brunei",TUN:"tunisia",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",BRB:"barbados",BRA:"brazil",CIV:"ivoire|ivory",SRB:"^(?!.*monte).*serbia",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",USA:"^(?!.*islands).*united.?states|^u\\.?s\\.?a\\.?$|^u\\.?s\\.?$",QAT:"qatar",WSM:"^(?!.*amer).*samoa",AZE:"azerbaijan",GNB:"bissau|^(?=.*portu).*guinea",SWZ:"swaziland",TON:"tonga",CAN:"canada",UKR:"ukrain",KOR:"^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea|\\br\\.?o\\.?k\\b",AIA:"anguill?a",CAF:"\\bcen.*\\baf|^c\\.?a\\.?r\\.?$",CHE:"switz|swiss",CYP:"cyprus",BIH:"herzegovina|bosnia",SGP:"singapore",SGS:"south.?georgia|sandwich",SOM:"somali",UZB:"uzbek",CMR:"cameroon",POL:"poland",EAZ:"zanz",KWT:"kuwait",ERI:"eritrea",GAB:"gabon",CYM:"cayman",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",EST:"estonia",MWI:"malawi|nyasa",ESP:"spain",IRQ:"\\biraq|mesopotamia",SLV:"el.?salvador",MLI:"\\bmali\\b",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",IRL:"ireland",IRN:"\\biran|persia",ABW:"^(?!.*bonaire).*\\baruba",SLE:"sierra",PAN:"panama",SDN:"^(?!.*\\bs(?!u)).*sudan",SLB:"solomon",NZL:"new.?zealand",MCO:"monaco",ITA:"italy",JPN:"japan",KGZ:"kyrgyz|kirghiz",UGA:"uganda",NCL:"new.?caledonia",PNG:"papua|\\bp.*\\bn.*\\bguin.*|^p\\.?n\\.?g\\.?$|new.?guinea",ARG:"argentin",SWE:"sweden",BHS:"bahamas",BHR:"bahrain",ARM:"armenia",NRU:"nauru",CUB:"\\bcuba"}},{}],334:[function(a,b,c){"use strict";var d=b.exports={};d.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa"},d.axesNames=["lonaxis","lataxis"],d.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},d.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},d.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},d.clipPad=.001,d.precision=.1,d.landColor="#F0DC82",d.waterColor="#3399FF",d.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},d.sphereSVG={type:"Sphere"},d.fillLayers=["ocean","land","lakes"],d.lineLayers=["subunits","countries","coastlines","rivers","frame"],d.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],d.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},d.baseLayersOverChoropleth=["rivers","lakes"]},{}],335:[function(a,b,c){"use strict";b.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],336:[function(a,b,c){"use strict";b.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],337:[function(a,b,c){"use strict";b.exports={circle:"â","circle-open":"â",square:"â ","square-open":"â¡",diamond:"â","diamond-open":"â",cross:"+",x:"â"}},{}],338:[function(a,b,c){"use strict";c.xmlns="http://www.w3.org/2000/xmlns/",c.svg="http://www.w3.org/2000/svg",c.xlink="http://www.w3.org/1999/xlink",c.svgAttrs={xmlns:c.svg,"xmlns:xlink":c.xlink}},{}],339:[function(a,b,c){"use strict";var d=a("./plotly");c.version="1.6.3",c.plot=d.plot,c.newPlot=d.newPlot,c.restyle=d.restyle,c.relayout=d.relayout,c.redraw=d.redraw,c.extendTraces=d.extendTraces,c.prependTraces=d.prependTraces,c.addTraces=d.addTraces,c.deleteTraces=d.deleteTraces,c.moveTraces=d.moveTraces,c.setPlotConfig=a("./plot_api/set_plot_config"),c.register=d.register,c.Icons=a("../build/ploticon"),c.Plots=d.Plots,c.Fx=d.Fx,c.Snapshot=d.Snapshot,c.PlotSchema=d.PlotSchema,c.Queue=d.Queue,c.d3=a("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":365,"./plotly":366,d3:70}],340:[function(a,b,c){"use strict";"undefined"!=typeof MathJax?(c.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):c.MathJax=!1},{}],341:[function(a,b,c){"use strict";b.exports=function(a,b,c,d){Array.isArray(a)&&(b[c]=a[d])}},{}],342:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("tinycolor2"),f=a("./nested_property"),g=a("../components/colorscale/get_scale");Object.keys(a("../components/colorscale/scales"));c.valObjects={data_array:{coerceFunction:function(a,b,c){Array.isArray(a)?b.set(a):void 0!==c&&b.set(c)}},enumerated:{coerceFunction:function(a,b,c,d){d.coerceNumber&&(a=+a),-1===d.values.indexOf(a)?b.set(c):b.set(a)}},"boolean":{coerceFunction:function(a,b,c){a===!0||a===!1?b.set(a):b.set(c)}},number:{coerceFunction:function(a,b,c,e){!d(a)||void 0!==e.min&&a<e.min||void 0!==e.max&&a>e.max?b.set(c):b.set(+a)}},integer:{coerceFunction:function(a,b,c,e){a%1||!d(a)||void 0!==e.min&&a<e.min||void 0!==e.max&&a>e.max?b.set(c):b.set(+a)}},string:{coerceFunction:function(a,b,c,d){if(d.strict===!0&&"string"!=typeof a)return void b.set(c);var e=String(a);void 0===a||d.noBlank===!0&&!e?b.set(c):b.set(e)}},color:{coerceFunction:function(a,b,c){e(a).isValid()?b.set(a):b.set(c)}},colorscale:{coerceFunction:function(a,b,c){b.set(g(a,c))}},angle:{coerceFunction:function(a,b,c){"auto"===a?b.set("auto"):d(a)?(Math.abs(a)>180&&(a-=360*Math.round(a/360)),b.set(+a)):b.set(c)}},axisid:{coerceFunction:function(a,b,c){if("string"==typeof a&&a.charAt(0)===c){var d=Number(a.substr(1));if(d%1===0&&d>1)return void b.set(a)}b.set(c)}},sceneid:{coerceFunction:function(a,b,c){if("string"==typeof a&&a.substr(0,5)===c){var d=Number(a.substr(5));if(d%1===0&&d>1)return void b.set(a)}b.set(c)}},geoid:{coerceFunction:function(a,b,c){if("string"==typeof a&&a.substr(0,3)===c){var d=Number(a.substr(3));if(d%1===0&&d>1)return void b.set(a)}b.set(c)}},flaglist:{coerceFunction:function(a,b,c,d){if("string"!=typeof a)return void b.set(c);if(-1!==d.extras.indexOf(a))return void b.set(a);for(var e=a.split("+"),f=0;f<e.length;){var g=e[f];-1===d.flags.indexOf(g)||e.indexOf(g)<f?e.splice(f,1):f++}e.length?b.set(e.join("+")):b.set(c)}},any:{coerceFunction:function(a,b,c){void 0===a?b.set(c):b.set(a)}},info_array:{coerceFunction:function(a,b,d,e){if(!Array.isArray(a))return void b.set(d);var f=e.items,g=[];d=Array.isArray(d)?d:[];for(var h=0;h<f.length;h++)c.coerce(a,g,f,"["+h+"]",d[h]);b.set(g)}}},c.coerce=function(a,b,d,e,g){var h=f(d,e).get(),i=f(a,e),j=f(b,e),k=i.get();return void 0===g&&(g=h.dflt),h.arrayOk&&Array.isArray(k)?(j.set(k),k):(c.valObjects[h.valType].coerceFunction(k,j,g,h),j.get())},c.coerce2=function(a,b,d,e,g){var h=f(a,e),i=c.coerce(a,b,d,e,g);return h.get()?i:!1},c.coerceFont=function(a,b,c){var d={};return c=c||{},d.family=a(b+".family",c.family),d.size=a(b+".size",c.size),d.color=a(b+".color",c.color),d}},{"../components/colorscale/get_scale":310,"../components/colorscale/scales":316,"./nested_property":352,"fast-isnumeric":74,tinycolor2:229}],343:[function(a,b,c){"use strict";function d(a,b){return String(a+Math.pow(10,b)).substr(1)}function e(a){var b;return b=s.test(a)?"Y":"y",b+=t.test(a)?"b":""}function f(a){var b;return b=v.test(a)?u.test(a)?"I":"H":"D"}var g=a("d3"),h=a("fast-isnumeric");c.dateTime2ms=function(a){try{if(a.getTime)return+a}catch(b){return!1}var c,d,e,f,g=String(a).split(" ");if(g.length>2)return!1;var i=g[0].split("-");if(i.length>3||3!==i.length&&g[1])return!1;if(4===i[0].length)c=Number(i[0]);else{if(2!==i[0].length)return!1;var j=(new Date).getFullYear();c=((Number(i[0])-j+70)%100+200)%100+j-70}return h(c)?1===i.length?new Date(c,0,1).getTime():(d=Number(i[1])-1,i[1].length>2||!(d>=0&&11>=d)?!1:2===i.length?new Date(c,d,1).getTime():(e=Number(i[2]),i[2].length>2||!(e>=1&&31>=e)?!1:(e=new Date(c,d,e).getTime(),g[1]?(i=g[1].split(":"),i.length>3?!1:(f=Number(i[0]),i[0].length>2||!(f>=0&&23>=f)?!1:(e+=36e5*f,1===i.length?e:(d=Number(i[1]),i[1].length>2||!(d>=0&&59>=d)?!1:(e+=6e4*d,2===i.length?e:(a=Number(i[2]),a>=0&&60>a?e+1e3*a:!1)))))):e))):!1},c.isDateTime=function(a){return c.dateTime2ms(a)!==!1},c.ms2DateTime=function(a,b){if("undefined"==typeof g)return void console.log("d3 is not defined");b||(b=0);var c=new Date(a),e=g.time.format("%Y-%m-%d")(c);return 7776e6>b?(e+=" "+d(c.getHours(),2),432e6>b&&(e+=":"+d(c.getMinutes(),2),108e5>b&&(e+=":"+d(c.getSeconds(),2),3e5>b&&(e+="."+d(c.getMilliseconds(),3)))),e.replace(/([:\s]00)*\.?[0]*$/,"")):e};var i={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},j={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},k=g.time.format.utc,l={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(k),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(k)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(k)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(a){j[a].forEach(function(b){l[a].D.push(k(b)),["H","I","D"].forEach(function(c){i[c].forEach(function(d){var e=l[a][c];e.push(k(b+"~"+d)),e.push(k(d+"~"+b))})})})});var m=/[a-z]*/g,n=function(a){return a.substr(0,3)},o=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,p=/[\s,\/\-\.\(\)]+/g,q=/~?([ap])~?m(~|$)/,r=function(a,b){return b+"m "},s=/\d\d\d\d/,t=/(^|~)[a-z]{3}/,u=/[ap]m/,v=/:/,w=/q([1-4])/,x=["31~mar","30~jun","30~sep","31~dec"],y=function(a,b){return x[b-1]},z=/ ?([+\-]\d\d:?\d\d|Z)$/;c.parseDate=function(a){if(a.getTime)return a;if("string"!=typeof a)return!1;a=a.toLowerCase().replace(m,n).replace(o,"").replace(p,"~").replace(q,r).replace(w,y).trim().replace(z,"");var b,c,d=null,g=e(a),h=f(a);b=l[g][h],c=b.length;for(var i=0;c>i&&!(d=b[i].parse(a));i++);if(!(d instanceof Date))return!1;var j=d.getTimezoneOffset();return d.setTime(d.getTime()+60*j*1e3),d}},{d3:70,"fast-isnumeric":74}],344:[function(a,b,c){"use strict";var d=a("events").EventEmitter,e={init:function(a){if(a._ev instanceof d)return a;var b=new d;return a._ev=b,a.on=b.on.bind(b),a.once=b.once.bind(b),a.removeListener=b.removeListener.bind(b),a.removeAllListeners=b.removeAllListeners.bind(b),a.emit=function(c,d){"undefined"!=typeof $&&$(a).trigger(c,d),b.emit(c,d)},a},triggerHandler:function(a,b,c){var d,e;"undefined"!=typeof $&&(d=$(a).triggerHandler(b,c));var f=a._ev;if(!f)return d;var g=f._events[b];if(!g)return d;"function"==typeof g&&(g=[g]);for(var h=g.pop(),i=0;i<g.length;i++)g[i](c);return e=h(c),void 0!==d?d:e}};b.exports=e},{events:54}],345:[function(a,b,c){"use strict";function d(a,b,c){for(var g,h,i,j,k,l,m=a[0],n=a.length,o=1;n>o;o++){g=a[o];for(h in g)i=m[h],j=g[h],b&&j&&(e(j)||(k=f(j)))?(k?(k=!1,l=i&&f(i)?i:[]):l=i&&e(i)?i:{},m[h]=d([l,j],b,c)):("undefined"!=typeof j||c)&&(m[h]=j)}return m}var e=a("./is_plain_object.js"),f=Array.isArray;c.extendFlat=function(){return d(arguments,!1,!1)},c.extendDeep=function(){return d(arguments,!0,!1)},c.extendDeepAll=function(){return d(arguments,!0,!0)}},{"./is_plain_object.js":350}],346:[function(a,b,c){"use strict";function d(a,b){var c=j[a];return c(b)}function e(a){for(var b,c,d=0;d<i.length;d++)if(b=i[d],c=new RegExp(h[b]),c.test(a.toLowerCase()))return b;console.warn("unrecognized country name: "+a+".")}var f=b.exports={},g=a("../plotly"),h=a("../constants/country-name_to_iso3"),i=Object.keys(h),j={"ISO-3":g.Lib.identity,"USA-states":g.Lib.identity,"country names":e};f.locationToFeature=function(a,b,c){for(var e,f=d(a,b),g=0;g<c.length;g++)if(e=c[g],e.id===f)return e;console.warn(["location with id",f,"does not have a matching topojson feature at this resolution."].join(" "))}},{"../constants/country-name_to_iso3":333,"../plotly":366}],347:[function(a,b,c){"use strict";function d(a,b){var c=k(a);return c[3]*=b,c}function e(a){return i(a).isValid()?a:l}function f(a){return j(a)?a:m}function g(a,b,c){var g,i,j,k,n,o=a.color,p=Array.isArray(o),q=Array.isArray(b),r=[];if(g=void 0!==a.colorscale?h.Colorscale.makeScaleFunction(a.colorscale,a.cmin,a.cmax):e,i=p?function(a,b){return void 0===a[b]?l:g(a[b])}:e,j=q?function(a,b){return void 0===a[b]?m:f(a[b])}:f,p||q)for(var s=0;c>s;s++)k=i(o,s),n=j(b,s),r[s]=d(k,n);else r=d(o,b);return r}var h=a("../plotly"),i=a("tinycolor2"),j=a("fast-isnumeric"),k=a("./str2rgbarray"),l=a("../components/color/attributes").defaultLine,m=1;b.exports=g},{"../components/color/attributes":298,"../plotly":366,"./str2rgbarray":359,"fast-isnumeric":74,tinycolor2:229}],348:[function(a,b,c){"use strict";function d(a){for(var b=0;(b=a.indexOf("<sup>",b))>=0;){var c=a.indexOf("</sup>",b);if(b>c)break;a=a.slice(0,b)+i(a.slice(b+5,c))+a.slice(c+6)}return a}function e(a){return a.replace(/\<br\>/g,"\n")}function f(a){return a.replace(/\<.*\>/g,"")}function g(a){for(var b=0;(b=a.indexOf("&",b))>=0;){var c=a.indexOf(";",b);if(b>c)b+=1;else{var d=j[a.slice(b+1,c)];a=d?a.slice(0,b)+d+a.slice(c+1):a.slice(0,b)+a.slice(c+1)}}return a}function h(a){return""+g(f(d(e(a))))}var i=a("superscript-text"),j={mu:"ÎŒ",amp:"&",lt:"<",gt:">"};b.exports=h},{"superscript-text":218}],349:[function(a,b,c){"use strict";var d=a("d3"),e=b.exports={};e.nestedProperty=a("./nested_property"),e.isPlainObject=a("./is_plain_object");var f=a("./coerce");e.valObjects=f.valObjects,e.coerce=f.coerce,e.coerce2=f.coerce2,e.coerceFont=f.coerceFont;var g=a("./dates");e.dateTime2ms=g.dateTime2ms,e.isDateTime=g.isDateTime,e.ms2DateTime=g.ms2DateTime,e.parseDate=g.parseDate;var h=a("./search");e.findBin=h.findBin,e.sorterAsc=h.sorterAsc,e.sorterDes=h.sorterDes,e.distinctVals=h.distinctVals,e.roundUp=h.roundUp;var i=a("./stats");e.aggNums=i.aggNums,e.len=i.len,e.mean=i.mean,e.variance=i.variance,e.stdev=i.stdev,e.interp=i.interp;var j=a("./matrix");e.init2dArray=j.init2dArray,e.transposeRagged=j.transposeRagged,e.dot=j.dot,e.translationMatrix=j.translationMatrix,e.rotationMatrix=j.rotationMatrix,e.rotationXYMatrix=j.rotationXYMatrix,e.apply2DTransform=j.apply2DTransform,e.apply2DTransform2=j.apply2DTransform2;var k=a("./extend");e.extendFlat=k.extendFlat,e.extendDeep=k.extendDeep,e.extendDeepAll=k.extendDeepAll,e.notifier=a("./notifier"),e.swapAttrs=function(a,b,c,d){c||(c="x"),d||(d="y");for(var f=0;f<b.length;f++){var g=b[f],h=e.nestedProperty(a,g.replace("?",c)),i=e.nestedProperty(a,g.replace("?",d)),j=h.get();h.set(i.get()),i.set(j)}},e.pauseEvent=function(a){return a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,!1},e.VERBOSE=!1,e.TIMER=(new Date).getTime(),e.log=function(){e.VERBOSE&&console.log.apply(console,arguments)},e.markTime=function(a){if(e.VERBOSE){var b=(new Date).getTime();console.log(a,b-e.TIMER,"(msec)"),"trace"===e.VERBOSE&&console.trace(),e.TIMER=b}},e.constrain=function(a,b,c){return b>c?Math.max(c,Math.min(b,a)):Math.max(b,Math.min(c,a))},e.bBoxIntersect=function(a,b,c){return c=c||0,a.left<=b.right+c&&b.left<=a.right+c&&a.top<=b.bottom+c&&b.top<=a.bottom+c},e.identity=function(a){return a},e.randstr=function l(a,b,c){if(c||(c=16),void 0===b&&(b=24),0>=b)return"0";var d,e,f,g=Math.log(Math.pow(2,b))/Math.log(c),h="";for(d=2;g===1/0;d*=2)g=Math.log(Math.pow(2,b/d))/Math.log(c)*d;var i=g-Math.floor(g);for(d=0;d<Math.floor(g);d++)f=Math.floor(Math.random()*c).toString(c),h=f+h;i&&(e=Math.pow(c,i),f=Math.floor(Math.random()*e).toString(c),h=f+h);var j=parseInt(h,c);return a&&a.indexOf(h)>-1||j!==1/0&&j>=Math.pow(2,b)?l(a,b,c):h},e.OptionControl=function(a,b){a||(a={}),b||(b="opt");var c={};return c.optionList=[],c._newoption=function(d){d[b]=a,c[d.name]=d,c.optionList.push(d)},c["_"+b]=a,c},e.smooth=function(a,b){if(b=Math.round(b)||0,2>b)return a;var c,d,e,f,g=a.length,h=2*g,i=2*b-1,j=new Array(i),k=new Array(g);for(c=0;i>c;c++)j[c]=(1-Math.cos(Math.PI*(c+1)/b))/(2*b);for(c=0;g>c;c++){for(f=0,d=0;i>d;d++)e=c+d+1-b,-g>e?e-=h*Math.round(e/h):e>=h&&(e-=h*Math.floor(e/h)),0>e?e=-1-e:e>=g&&(e=h-1-e),f+=a[e]*j[d];k[c]=f}return k},e.promiseError=function(a){console.log(a,a.stack)},e.syncOrAsync=function(a,b,c){function d(){return e.markTime("async done "+g.name),e.syncOrAsync(a,b,c)}for(var f,g;a.length;){if(g=a.splice(0,1)[0],f=g(b),f&&f.then)return f.then(d).then(void 0,e.promiseError);e.markTime("sync done "+g.name)}return c&&c(b)},e.stripTrailingSlash=function(a){return"/"===a.substr(-1)?a.substr(0,a.length-1):a},e.noneOrAll=function(a,b,c){if(a){var d,e,f=!1,g=!0;for(d=0;d<c.length;d++)e=a[c[d]],void 0!==e&&null!==e?f=!0:g=!1;if(f&&!g)for(d=0;d<c.length;d++)a[c[d]]=b[c[d]]}},e.mergeArray=function(a,b,c){if(Array.isArray(a))for(var d=Math.min(a.length,b.length),e=0;d>e;e++)b[e][c]=a[e]},e.minExtend=function(a,b){var c={};"object"!=typeof b&&(b={});var d,f,g,h=3,i=Object.keys(a);for(d=0;d<i.length;d++)f=i[d],g=a[f],"_"!==f.charAt(0)&&"function"!=typeof g&&("module"===f?c[f]=g:Array.isArray(g)?c[f]=g.slice(0,h):g&&"object"==typeof g?c[f]=e.minExtend(a[f],b[f]):c[f]=g);for(i=Object.keys(b),d=0;d<i.length;d++)f=i[d],g=b[f],"object"==typeof g&&f in c&&"object"==typeof c[f]||(c[f]=g);return c},e.titleCase=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},e.containsAny=function(a,b){for(var c=0;c<b.length;c++)if(-1!==a.indexOf(b[c]))return!0;return!1},e.getPlotDiv=function(a){for(;a&&a.removeAttribute;a=a.parentNode)if(e.isPlotDiv(a))return a},e.isPlotDiv=function(a){var b=d.select(a);return b.size()&&b.classed("js-plotly-plot")},e.removeElement=function(a){var b=a&&a.parentNode;b&&b.removeChild(a)},e.addStyleRule=function(a,b){if(!e.styleSheet){var c=document.createElement("style");c.appendChild(document.createTextNode("")),document.head.appendChild(c),e.styleSheet=c.sheet}var d=e.styleSheet;d.insertRule?d.insertRule(a+"{"+b+"}",0):d.addRule?d.addRule(a,b,0):console.warn("addStyleRule failed")},e.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob}},{"./coerce":342,"./dates":343,"./extend":345,"./is_plain_object":350,"./matrix":351,"./nested_property":352,"./notifier":353,"./search":356,"./stats":358,d3:70}],350:[function(a,b,c){"use strict";b.exports=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&Object.getPrototypeOf(a)===Object.prototype}},{}],351:[function(a,b,c){"use strict";c.init2dArray=function(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=new Array(b);return c},c.transposeRagged=function(a){var b,c,d=0,e=a.length;for(b=0;e>b;b++)d=Math.max(d,a[b].length);var f=new Array(d);for(b=0;d>b;b++)for(f[b]=new Array(e),c=0;e>c;c++)f[b][c]=a[c][b];return f},c.dot=function(a,b){if(!a.length||!b.length||a.length!==b.length)return null;var d,e,f=a.length;if(a[0].length)for(d=new Array(f),e=0;f>e;e++)d[e]=c.dot(a[e],b);else if(b[0].length){var g=c.transposeRagged(b);for(d=new Array(g.length),e=0;e<g.length;e++)d[e]=c.dot(a,g[e])}else for(d=0,e=0;f>e;e++)d+=a[e]*b[e];return d},c.translationMatrix=function(a,b){return[[1,0,a],[0,1,b],[0,0,1]]},c.rotationMatrix=function(a){var b=a*Math.PI/180;return[[Math.cos(b),-Math.sin(b),0],[Math.sin(b),Math.cos(b),0],[0,0,1]]},c.rotationXYMatrix=function(a,b,d){return c.dot(c.dot(c.translationMatrix(b,d),c.rotationMatrix(a)),c.translationMatrix(-b,-d))},c.apply2DTransform=function(a){return function(){var b=arguments;3===b.length&&(b=b[0]);var d=1===arguments.length?b[0]:[b[0],b[1]];return c.dot(a,[d[0],d[1],1]).slice(0,2)}},c.apply2DTransform2=function(a){var b=c.apply2DTransform(a);return function(a){return b(a.slice(0,2)).concat(b(a.slice(2,4)))}}},{}],352:[function(a,b,c){"use strict";function d(a,b){return function(){var c,e,f,g,h,i=a;for(g=0;g<b.length-1;g++){if(c=b[g],-1===c){for(e=!0,f=[],h=0;h<i.length;h++)f[h]=d(i[h],b.slice(g+1))(),f[h]!==f[0]&&(e=!1);return e?f[0]:f}if("number"==typeof c&&!Array.isArray(i))return;if(i=i[c],"object"!=typeof i||null===i)return}if("object"==typeof i&&null!==i&&(f=i[b[g]],null!==f))return f}}function e(a,b){var c=["annotations","shapes","range","domain"],d=-1===c.indexOf(b);return Array.isArray(a)&&d}function f(a,b){return function(c){var d,f,k=a,l=[a],m=j(c)&&!e(c,b[b.length-1]);for(f=0;f<b.length-1;f++){if(d=b[f],"number"==typeof d&&!Array.isArray(k))throw"array index but container is not an array";if(-1===d){if(m=!g(k,b.slice(f+1),c))break;return}if(!h(k,d,b[f+1],m))break;if(k=k[d],"object"!=typeof k||null===k)throw"container is not an object";l.push(k)}m?(f===b.length-1&&delete k[b[f]],i(l)):k[b[f]]=c}}function g(a,b,c){var d,e=Array.isArray(c),g=!0,i=c,k=e?!1:j(c),l=b[0];for(d=0;d<a.length;d++)e&&(i=c[d%c.length],k=j(i)),k&&(g=!1),h(a,d,l,k)&&f(a[d],b)(i);return g}function h(a,b,c,d){if(void 0===a[b]){if(d)return!1;"number"==typeof c?a[b]=[]:a[b]={}}return!0}function i(a){var b,c,d,f,g;for(b=a.length-1;b>=0;b--){if(d=a[b],g=!1,Array.isArray(d))for(c=d.length-1;c>=0;c--)j(d[c])?g?d[c]=void 0:d.pop():g=!0;else if("object"==typeof d&&null!==d)for(f=Object.keys(d),g=!1,c=f.length-1;c>=0;c--)j(d[f[c]])&&!e(d[f[c]],f[c])?delete d[f[c]]:g=!0;if(g)return}}function j(a){return void 0===a||null===a?!0:"object"!=typeof a?!1:Array.isArray(a)?!a.length:!Object.keys(a).length}function k(a,b,c){return{set:function(){throw"bad container"},get:function(){},astr:b,parts:c,obj:a}}var l=a("fast-isnumeric");b.exports=function(a,b){if(l(b))b=String(b);else if("string"!=typeof b||"[-1]"===b.substr(b.length-4))throw"bad property string";for(var c,e,g,h=0,i=b.split(".");h<i.length;){if(c=String(i[h]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(c[1])i[h]=c[1];else{if(0!==h)throw"bad property string";i.splice(0,1)}for(e=c[2].substr(1,c[2].length-2).split("]["),g=0;g<e.length;g++)h++,i.splice(h,0,Number(e[g]))}h++}return"object"!=typeof a?k(a,b,i):{set:f(a,i),get:d(a,i),astr:b,parts:i,obj:a}}},{"fast-isnumeric":74}],353:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=[];b.exports=function(a,b){function c(a){a.duration(700).style("opacity",0).each("end",function(a){var b=f.indexOf(a);-1!==b&&f.splice(b,1),d.select(this).remove()})}if(-1===f.indexOf(a)){f.push(a);var g=1e3;e(b)?g=b:"long"===b&&(g=3e3);var h=d.select("body").selectAll(".plotly-notifier").data([0]);h.enter().append("div").classed("plotly-notifier",!0);var i=h.selectAll(".notifier-note").data(f);i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(a){var b=d.select(this);b.append("button").classed("notifier-close",!0).html("×").on("click",function(){b.transition().call(c)}),b.append("p").html(a),b.transition().duration(700).style("opacity",1).transition().delay(g).call(c)})}}},{d3:70,"fast-isnumeric":74}],354:[function(a,b,c){"use strict";var d=a("./matrix").dot,e=b.exports={};e.tester=function(a){function b(a,b){var c=a[0],d=a[1];return e>c||c>f||g>d||d>h?!1:!b||!j(a)}function c(a,b){var c=a[0],i=a[1];if(e>c||c>f||g>i||i>h)return!1;var j,k,l,m,n,o=d.length,p=d[0][0],q=d[0][1],r=0;for(j=1;o>j;j++)if(k=p,l=q,p=d[j][0],q=d[j][1],m=Math.min(k,p),!(m>c||c>Math.max(k,p)||i>Math.max(l,q)))if(i<Math.min(l,q))c!==m&&r++;else{if(n=p===k?i:l+(c-k)*(q-l)/(p-k),i===n)return 1!==j||!b;n>=i&&c!==m&&r++}return r%2===1}var d=a.slice(),e=d[0][0],f=e,g=d[0][1],h=g;d.push(d[0]);for(var i=1;i<d.length;i++)e=Math.min(e,d[i][0]),f=Math.max(f,d[i][0]),g=Math.min(g,d[i][1]),h=Math.max(h,d[i][1]);var j,k=!1;return 5===d.length&&(d[0][0]===d[1][0]?d[2][0]===d[3][0]&&d[0][1]===d[3][1]&&d[1][1]===d[2][1]&&(k=!0,j=function(a){return a[0]===d[0][0]}):d[0][1]===d[1][1]&&d[2][1]===d[3][1]&&d[0][0]===d[3][0]&&d[1][0]===d[2][0]&&(k=!0,j=function(a){return a[1]===d[0][1]})),{xmin:e,xmax:f,ymin:g,ymax:h,pts:d,contains:k?b:c,isRect:k}};var f=e.isSegmentBent=function(a,b,c,e){var f,g,h,i=a[b],j=[a[c][0]-i[0],a[c][1]-i[1]],k=d(j,j),l=Math.sqrt(k),m=[-j[1]/l,j[0]/l];for(f=b+1;c>f;f++)if(g=[a[f][0]-i[0],a[f][1]-i[1]],h=d(g,j),0>h||h>k||Math.abs(d(g,m))>e)return!0;return!1};e.filter=function(a,b){function c(c){a.push(c);var h=d.length,i=e;d.splice(g+1);for(var j=i+1;j<a.length;j++)(j===a.length-1||f(a,i,j+1,b))&&(d.push(a[j]),d.length<h-2&&(e=j,g=d.length-1),i=j)}var d=[a[0]],e=0,g=0;if(a.length>1){var h=a.pop();c(h)}return{addPt:c,raw:a,filtered:d}}},{"./matrix":351}],355:[function(a,b,c){"use strict";function d(a,b){for(var c,d=[],f=0;f<b.length;f++)c=b[f],c===a?d[f]=c:"object"==typeof c?d[f]=Array.isArray(c)?e.Lib.extendDeep([],c):e.Lib.extendDeepAll({},c):d[f]=c;return d}var e=a("../plotly"),f={};f.add=function(a,b,c,d,e){var f,g;return a.undoQueue=a.undoQueue||{index:0,queue:[],sequence:!1},g=a.undoQueue.index,a.autoplay?void(a.undoQueue.inSequence||(a.autoplay=!1)):(!a.undoQueue.sequence||a.undoQueue.beginSequence?(f={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},a.undoQueue.queue.splice(g,a.undoQueue.queue.length-g,f),a.undoQueue.index+=1):f=a.undoQueue.queue[g-1],a.undoQueue.beginSequence=!1,f.undo.calls.unshift(b),f.undo.args.unshift(c),f.redo.calls.push(d),void f.redo.args.push(e))},f.startSequence=function(a){a.undoQueue=a.undoQueue||{index:0,queue:[],sequence:!1},a.undoQueue.sequence=!0,a.undoQueue.beginSequence=!0},f.stopSequence=function(a){a.undoQueue=a.undoQueue||{index:0,queue:[],sequence:!1},a.undoQueue.sequence=!1,a.undoQueue.beginSequence=!1},f.undo=function(a){var b,c;if(a.framework&&a.framework.isPolar)return void a.framework.undo();if(!(void 0===a.undoQueue||isNaN(a.undoQueue.index)||a.undoQueue.index<=0)){for(a.undoQueue.index--,b=a.undoQueue.queue[a.undoQueue.index],a.undoQueue.inSequence=!0,c=0;c<b.undo.calls.length;c++)f.plotDo(a,b.undo.calls[c],b.undo.args[c]);a.undoQueue.inSequence=!1,a.autoplay=!1}},f.redo=function(a){var b,c;if(a.framework&&a.framework.isPolar)return void a.framework.redo();if(!(void 0===a.undoQueue||isNaN(a.undoQueue.index)||a.undoQueue.index>=a.undoQueue.queue.length)){for(b=a.undoQueue.queue[a.undoQueue.index],a.undoQueue.inSequence=!0,c=0;c<b.redo.calls.length;c++)f.plotDo(a,b.redo.calls[c],b.redo.args[c]);a.undoQueue.inSequence=!1,a.autoplay=!1,a.undoQueue.index++}},f.plotDo=function(a,b,c){a.autoplay=!0,c=d(a,c),b.apply(null,c)},b.exports=f},{"../plotly":366}],356:[function(a,b,c){"use strict";function d(a,b){return b>a}function e(a,b){return b>=a}function f(a,b){return a>b}function g(a,b){return a>=b}var h=a("fast-isnumeric");c.findBin=function(a,b,c){if(h(b.start))return c?Math.ceil((a-b.start)/b.size)-1:Math.floor((a-b.start)/b.size);var i,j,k=0,l=b.length,m=0;for(j=b[b.length-1]>=b[0]?c?d:e:c?g:f;l>k&&m++<100;)i=Math.floor((k+l)/2),j(b[i],a)?k=i+1:l=i;return m>90&&console.log("Long binary search..."),k-1},c.sorterAsc=function(a,b){return a-b},c.sorterDes=function(a,b){return b-a},c.distinctVals=function(a){var b=a.slice();b.sort(c.sorterAsc);for(var d=b.length-1,e=b[d]-b[0]||1,f=e/(d||1)/1e4,g=[b[0]],h=0;d>h;h++)b[h+1]>b[h]+f&&(e=Math.min(e,b[h+1]-b[h]),g.push(b[h+1]));return{vals:g,minDiff:e}},c.roundUp=function(a,b,c){for(var d,e=0,f=b.length-1,g=0,h=c?0:1,i=c?1:0,j=c?Math.ceil:Math.floor;f>e&&g++<100;)d=j((e+f)/2),b[d]<=a?e=d+h:f=d-i;return b[e]}},{"fast-isnumeric":74}],357:[function(a,b,c){"use strict";var d=a("../plotly"),e=function(){};b.exports=function(a){for(var b in a)"function"==typeof a[b]&&(a[b]=e);a.destroy=function(){a.container.parentNode.removeChild(a.container)};var c=document.createElement("div");return c.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",c.style.cursor="pointer",c.style.fontSize="24px",c.style.color=d.Color.defaults[0],a.container.appendChild(c),a.container.style.background="#FFFFFF",a.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../plotly":366}],358:[function(a,b,c){"use strict";var d=a("fast-isnumeric");c.aggNums=function(a,b,e,f){var g,h;if(f||(f=e.length),d(b)||(b=!1),Array.isArray(e[0])){for(h=new Array(f),g=0;f>g;g++)h[g]=c.aggNums(a,b,e[g]);e=h}for(g=0;f>g;g++)d(b)?d(e[g])&&(b=a(+b,+e[g])):b=e[g];return b},c.len=function(a){return c.aggNums(function(a){return a+1},0,a)},c.mean=function(a,b){return b||(b=c.len(a)),c.aggNums(function(a,b){return a+b},0,a)/b},c.variance=function(a,b,e){return b||(b=c.len(a)),d(e)||(e=c.mean(a,b)),c.aggNums(function(a,b){return a+Math.pow(b-e,2)},0,a)/b},c.stdev=function(a,b,d){return Math.sqrt(c.variance(a,b,d))},c.interp=function(a,b){if(!d(b))throw"n should be a finite number";if(b=b*a.length-.5,0>b)return a[0];if(b>a.length-1)return a[a.length-1];var c=b%1;return c*a[Math.ceil(b)]+(1-c)*a[Math.floor(b)]}},{"fast-isnumeric":74}],359:[function(a,b,c){"use strict";function d(a){return a=e(a),f.str2RgbaArray(a.toRgbString())}var e=a("tinycolor2"),f=a("arraytools");b.exports=d},{arraytools:48,tinycolor2:229}],360:[function(a,b,c){"use strict";function d(a,b){return a.node().getBoundingClientRect()[b]}function e(a){return a.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function f(a,b,c){var d="math-output-"+i.Lib.randstr([],64),f=j.select("body").append("div").attr({id:d}).style({visibility:"hidden",position:"absolute"}).style({"font-size":b.fontSize+"px"}).text(e(a));MathJax.Hub.Queue(["Typeset",MathJax.Hub,f.node()],function(){var b=j.select("body").select("#MathJax_SVG_glyphs");if(f.select(".MathJax_SVG").empty()||!f.select("svg").node())console.log("There was an error in the tex syntax.",a),c();else{var d=f.select("svg").node().getBoundingClientRect();c(f.select(".MathJax_SVG"),b,d)}f.remove()})}function g(a){for(var b=i.util.html_entity_decode(a),c=b.split(/(<[^<>]*>)/).map(function(a){var b=a.match(/<(\/?)([^ >]*)\s*(.*)>/i),c=b&&b[2].toLowerCase(),d=m[c];if(void 0!==d){var e=b[1],f=b[3],g=f.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===c){if(e)return"</a>";if("href"!==f.substr(0,4).toLowerCase())return"<a>";var h=document.createElement("a");return h.href=f.substr(4).replace(/["'=]/g,""),-1===n.indexOf(h.protocol)?"<a>":'<a xlink:show="new" xlink:href'+f.substr(4)+">"}if("br"===c)return"<br>";if(e)return"sup"===c?'</tspan><tspan dy="0.42em">​</tspan>':"sub"===c?'</tspan><tspan dy="-0.21em">​</tspan>':"</tspan>";var j="<tspan";return"sup"!==c&&"sub"!==c||(j="​"+j),g&&(g=g[1].replace(/(^|;)\s*color:/,"$1 fill:"),d=(d?d+";":"")+g),j+(d?' style="'+d+'"':"")+">"}return i.util.xml_entity_encode(a).replace(/</g,"<")}),d=[],e=c.indexOf("<br>");e>0;e=c.indexOf("<br>",e+1))d.push(e);var f=0;d.forEach(function(a){for(var b=a+f,d=c.slice(0,b),e="",g=d.length-1;g>=0;g--){var h=d[g].match(/<(\/?).*>/i);if(h&&"<br>"!==d[g]){h[1]||(e=d[g]);break}}e&&(c.splice(b+1,0,e),c.splice(b,0,"</tspan>"),f+=2); 48 });var g=c.join(""),h=g.split(/<br>/gi);return h.length>1&&(c=h.map(function(a,b){return'<tspan class="line" dy="'+1.3*b+'em">'+a+"</tspan>"})),c.join("")}function h(a,b,c){var d,e,f,g=c.horizontalAlign,h=c.verticalAlign||"top",i=a.node().getBoundingClientRect(),j=b.node().getBoundingClientRect();return e="bottom"===h?function(){return i.bottom-d.height}:"middle"===h?function(){return i.top+(i.height-d.height)/2}:function(){return i.top},f="right"===g?function(){return i.right-d.width}:"center"===g?function(){return i.left+(i.width-d.width)/2}:function(){return i.left},function(){return d=this.node().getBoundingClientRect(),this.style({top:e()-j.top+"px",left:f()-j.left+"px","z-index":1e3}),this}}var i=a("../plotly"),j=a("d3"),k=a("../constants/xmlns_namespaces"),l=b.exports={};j.selection.prototype.appendSVG=function(a){for(var b=['<svg xmlns="',k.svg,'" ','xmlns:xlink="',k.xlink,'">',a,"</svg>"].join(""),c=(new DOMParser).parseFromString(b,"application/xml"),d=c.documentElement.firstChild;d;)this.node().appendChild(this.node().ownerDocument.importNode(d,!0)),d=d.nextSibling;return c.querySelector("parsererror")?(console.log(c.querySelector("parsererror div").textContent),null):j.select(this.node().lastChild)},l.html_entity_decode=function(a){var b=j.select("body").append("div").style({display:"none"}).html(""),c=a.replace(/(&[^;]*;)/gi,function(a){return"<"===a?"<":"&rt;"===a?">":b.html(a).text()});return b.remove(),c},l.xml_entity_encode=function(a){return a.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},l.convertToTspans=function(a,b){function c(){n.empty()||(o=k.attr("class")+"-math",n.select("svg."+o).remove()),a.text("").style({visibility:"visible","white-space":"pre"}),m=a.appendSVG(h),m||a.text(e),a.select("a").size()&&a.style("pointer-events","all"),b&&b.call(k)}var e=a.text(),h=g(e),k=a,l=!k.attr("data-notex")&&h.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),m=e,n=j.select(k.node().parentNode);if(!n.empty()){var o=k.attr("class")?k.attr("class").split(" ")[0]:"text";o+="-math",n.selectAll("svg."+o).remove(),n.selectAll("g."+o+"-group").remove(),a.style({visibility:null});for(var p=a.node();p&&p.removeAttribute;p=p.parentNode)p.removeAttribute("data-bb");if(l){var q=i.Lib.getPlotDiv(k.node());(q&&q._promises||[]).push(new Promise(function(a){k.style({visibility:"hidden"});var e={fontSize:parseInt(k.style("font-size"),10)};f(l[2],e,function(e,f,g){n.selectAll("svg."+o).remove(),n.selectAll("g."+o+"-group").remove();var h=e&&e.select("svg");if(!h||!h.node())return c(),void a();var i=n.append("g").classed(o+"-group",!0).attr({"pointer-events":"none"});i.node().appendChild(h.node()),f&&f.node()&&h.node().insertBefore(f.node().cloneNode(!0),h.node().firstChild),h.attr({"class":o,height:g.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var j=k.style("fill")||"black";h.select("g").attr({fill:j,stroke:j});var l=d(h,"width"),m=d(h,"height"),p=+k.attr("x")-l*{start:0,middle:.5,end:1}[k.attr("text-anchor")||"start"],q=parseInt(k.style("font-size"),10)||d(k,"height"),r=-q/4;"y"===o[0]?(i.attr({transform:"rotate("+[-90,+k.attr("x"),+k.attr("y")]+") translate("+[-l/2,r-m/2]+")"}),h.attr({x:+k.attr("x"),y:+k.attr("y")})):"l"===o[0]?h.attr({x:k.attr("x"),y:r-m/2}):"a"===o[0]?h.attr({x:0,y:r}):h.attr({x:p,y:+k.attr("y")+r-m/2}),b&&b.call(k,i),a(i)})}))}else c();return a}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},n=["http:","https:","mailto:"],o=new RegExp("</?("+Object.keys(m).join("|")+")( [^>]*)?/?>","g");l.plainText=function(a){return(a||"").replace(o," ")},l.makeEditable=function(a,b,c){function d(){f(),g.style({opacity:0});var a,b=m.attr("class");a=b?"."+b.split(" ")[0]+"-math-group":"[class*=-math-group]",a&&j.select(g.node().parentNode).select(a).style({opacity:0})}function e(a){var b=a.node(),c=document.createRange();c.selectNodeContents(b);var d=window.getSelection();d.removeAllRanges(),d.addRange(c),b.focus()}function f(){var a=j.select(i.Lib.getPlotDiv(g.node())),b=a.select(".svg-container"),d=b.append("div");d.classed("plugin-editable editable",!0).style({position:"absolute","font-family":g.style("font-family")||"Arial","font-size":g.style("font-size")||12,color:c.fill||g.style("fill")||"black",opacity:1,"background-color":c.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(g.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c.text||g.attr("data-unformatted")).call(h(g,b,c)).on("blur",function(){g.text(this.textContent).style({opacity:1});var a,b=j.select(this).attr("class");a=b?"."+b.split(" ")[0]+"-math-group":"[class*=-math-group]",a&&j.select(g.node().parentNode).select(a).style({opacity:0});var c=this.textContent;j.select(this).transition().duration(0).remove(),j.select(document).on("mouseup",null),k.edit.call(g,c)}).on("focus",function(){var a=this;j.select(document).on("mouseup",function(){return j.event.target===a?!1:void(document.activeElement===d.node()&&d.node().blur())})}).on("keyup",function(){27===j.event.which?(g.style({opacity:1}),j.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),k.cancel.call(g,this.textContent)):(k.input.call(g,this.textContent),j.select(this).call(h(g,b,c)))}).on("keydown",function(){13===j.event.which&&this.blur()}).call(e)}c||(c={});var g=this,k=j.dispatch("edit","input","cancel"),l=j.select(this.node()).style({"pointer-events":"all"}),m=b||l;return b&&l.style({"pointer-events":"none"}),c.immediate?d():m.on("click",d),j.rebind(this,k,"on")}},{"../constants/xmlns_namespaces":338,"../plotly":366,d3:70}],361:[function(a,b,c){"use strict";var d=b.exports={},e=a("../constants/geo_constants").locationmodeToLayer,f=a("topojson").feature;d.getTopojsonName=function(a){return[a.scope.replace(/ /g,"-"),"_",a.resolution.toString(),"m"].join("")},d.getTopojsonPath=function(a,b){return a+b+".json"},d.getTopojsonFeatures=function(a,b){var c=e[a.locationmode],d=b.objects[c];return f(b,d).features}},{"../constants/geo_constants":334,topojson:230}],362:[function(a,b,c){"use strict";function d(a){var b;if("string"==typeof a){if(b=document.getElementById(a),null===b)throw new Error("No DOM element with id '"+a+"' exists on the page.");return b}if(null===a||void 0===a)throw new Error("DOM element provided is null or undefined");return a}function e(a,b){a._fullLayout._paperdiv.style("background","white"),F.defaultConfig.setBackground(a,b)}function f(a,b){a._context||(a._context=G.extendFlat({},F.defaultConfig));var c=a._context;b&&(Object.keys(b).forEach(function(a){a in c&&("setBackground"===a&&"opaque"===b[a]?c[a]=e:c[a]=b[a])}),b.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio)),c.staticPlot&&(c.editable=!1,c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1)}function g(a,b,c){var d=C.select(a).selectAll(".plot-container").data([0]);d.enter().insert("div",":first-child").classed("plot-container plotly",!0);var e=d.selectAll(".svg-container").data([0]);e.enter().append("div").classed("svg-container",!0).style("position","relative"),e.html(""),b&&(a.data=b),c&&(a.layout=c),F.micropolar.manager.fillLayout(a),"initial"===a._fullLayout.autosize&&a._context.autosizable&&(w(a,{}),a._fullLayout.autosize=c.autosize=!0),e.style({width:a._fullLayout.width+"px",height:a._fullLayout.height+"px"}),a.framework=F.micropolar.manager.framework(a),a.framework({data:a.data,layout:a.layout},e.node()),a.framework.setUndoPoint();var f=a.framework.svg(),g=1,h=a._fullLayout.title;""!==h&&h||(g=0);var i="Click to enter title",j=function(){this.call(F.util.convertToTspans)},k=f.select(".title-group text").call(j);if(a._context.editable){k.attr({"data-unformatted":h}),h&&h!==i||(g=.2,k.attr({"data-unformatted":i}).text(i).style({opacity:g}).on("mouseover.opacity",function(){C.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){C.select(this).transition().duration(1e3).style("opacity",0)}));var l=function(){this.call(F.util.makeEditable).on("edit",function(b){a.framework({layout:{title:b}}),this.attr({"data-unformatted":b}).text(b).call(j),this.call(l)}).on("cancel",function(){var a=this.attr("data-unformatted");this.text(a).call(j)})};k.call(l)}return a._context.setBackground(a,a._fullLayout.paper_bgcolor),J.addLinks(a),Promise.resolve()}function h(a){var b,c;a||(a={}),a.xaxis1&&(a.xaxis||(a.xaxis=a.xaxis1),delete a.xaxis1),a.yaxis1&&(a.yaxis||(a.yaxis=a.yaxis1),delete a.yaxis1);var d=F.Axes.list({_fullLayout:a});for(b=0;b<d.length;b++){var e=d[b];e.anchor&&"free"!==e.anchor&&(e.anchor=F.Axes.cleanId(e.anchor)),e.overlaying&&(e.overlaying=F.Axes.cleanId(e.overlaying)),e.type||(e.isdate?e.type="date":e.islog?e.type="log":e.isdate===!1&&e.islog===!1&&(e.type="linear")),"withzero"!==e.autorange&&"tozero"!==e.autorange||(e.autorange=!0,e.rangemode="tozero"),delete e.islog,delete e.isdate,delete e.categories,l(e,"domain")&&delete e.domain,void 0!==e.autotick&&(void 0===e.tickmode&&(e.tickmode=e.autotick?"auto":"linear"),delete e.autotick)}void 0===a.annotations||Array.isArray(a.annotations)||(console.log("annotations must be an array"),delete a.annotations);var f=(a.annotations||[]).length;for(b=0;f>b;b++){var g=a.annotations[b];g.ref&&("paper"===g.ref?(g.xref="paper",g.yref="paper"):"data"===g.ref&&(g.xref="x",g.yref="y"),delete g.ref),i(g,"xref"),i(g,"yref")}void 0===a.shapes||Array.isArray(a.shapes)||(console.log("shapes must be an array"),delete a.shapes);var h=(a.shapes||[]).length;for(b=0;h>b;b++){var j=a.shapes[b];i(j,"xref"),i(j,"yref")}var k=a.legend;k&&(k.x>3?(k.x=1.02,k.xanchor="left"):k.x<-2&&(k.x=-.02,k.xanchor="right"),k.y>3?(k.y=1.02,k.yanchor="bottom"):k.y<-2&&(k.y=-.02,k.yanchor="top")),"rotate"===a.dragmode&&(a.dragmode="orbit"),a.scene1&&(a.scene||(a.scene=a.scene1),delete a.scene1);var m=J.getSubplotIds(a,"gl3d");for(b=0;b<m.length;b++){var n=a[m[b]],o=n.cameraposition;if(Array.isArray(o)&&4===o[0].length){var p=o[0],q=o[1],r=o[2],s=D([],p),t=[];for(c=0;3>c;++c)t[c]=q[b]+r*s[2+4*c];n.camera={eye:{x:t[0],y:t[1],z:t[2]},center:{x:q[0],y:q[1],z:q[2]},up:{x:s[1],y:s[5],z:s[9]}},delete n.cameraposition}}return G.markTime("finished rest of cleanLayout, starting color"),L.clean(a),G.markTime("finished cleanLayout color.clean"),a}function i(a,b){var c=a[b],d=b.charAt(0);c&&"paper"!==c&&(a[b]=F.Axes.cleanId(c,d))}function j(a,b){for(var c=[],d=(a.concat(Array.isArray(b)?b:[]).filter(function(a){return"uid"in a}).map(function(a){return a.uid})),e=0;e<a.length;e++){var f=a[e];if(!("uid"in f)||-1!==c.indexOf(f.uid)){var g,h;for(h=0;100>h&&(g=G.randstr(d),-1!==c.indexOf(g));h++);f.uid=G.randstr(d),d.push(f.uid)}if(c.push(f.uid),"histogramy"===f.type&&"xbins"in f&&!("ybins"in f)&&(f.ybins=f.xbins,delete f.xbins),f.error_y&&"opacity"in f.error_y){var i=L.defaults,j=f.error_y.color||(J.traceIs(f,"bar")?L.defaultLine:i[e%i.length]);f.error_y.color=L.addOpacity(L.rgb(j),L.opacity(j)*f.error_y.opacity),delete f.error_y.opacity}if("bardir"in f&&("h"!==f.bardir||!J.traceIs(f,"bar")&&"histogram"!==f.type.substr(0,9)||(f.orientation="h",u(f)),delete f.bardir),"histogramy"===f.type&&u(f),"histogramx"!==f.type&&"histogramy"!==f.type||(f.type="histogram"),"scl"in f&&(f.colorscale=f.scl,delete f.scl),"reversescl"in f&&(f.reversescale=f.reversescl,delete f.reversescl),f.xaxis&&(f.xaxis=F.Axes.cleanId(f.xaxis,"x")),f.yaxis&&(f.yaxis=F.Axes.cleanId(f.yaxis,"y")),J.traceIs(f,"gl3d")&&f.scene&&(f.scene=J.subplotsRegistry.gl3d.cleanId(f.scene)),J.traceIs(f,"pie")||(Array.isArray(f.textposition)?f.textposition=f.textposition.map(k):f.textposition&&(f.textposition=k(f.textposition))),J.traceIs(f,"2dMap")&&("YIGnBu"===f.colorscale&&(f.colorscale="YlGnBu"),"YIOrRd"===f.colorscale&&(f.colorscale="YlOrRd")),J.traceIs(f,"markerColorscale")&&f.marker){var m=f.marker;"YIGnBu"===m.colorscale&&(m.colorscale="YlGnBu"),"YIOrRd"===m.colorscale&&(m.colorscale="YlOrRd")}l(f,"line")&&delete f.line,"marker"in f&&(l(f.marker,"line")&&delete f.marker.line,l(f,"marker")&&delete f.marker),G.markTime("finished rest of cleanData, starting color"),L.clean(f),G.markTime("finished cleanData color.clean")}}function k(a){var b="middle",c="center";return-1!==a.indexOf("top")?b="top":-1!==a.indexOf("bottom")&&(b="bottom"),-1!==a.indexOf("left")?c="left":-1!==a.indexOf("right")&&(c="right"),b+" "+c}function l(a,b){return b in a&&"object"==typeof a[b]&&0===Object.keys(a[b]).length}function m(a){var b,c,d,e,f=F.Axes.list(a),g=a._fullData,h=a._fullLayout,i=a.calcdata=new Array(g.length);for(a.firstscatter=!0,a.numboxes=0,a._hmpixcount=0,a._hmlumcount=0,h._piecolormap={},h._piedefaultcolorcount=0,b=0;b<f.length;b++)f[b]._categories=[];for(b=0;b<g.length;b++)c=g[b],d=c._module,e=[],d&&c.visible===!0&&d.calc&&(e=d.calc(a,c)),Array.isArray(e)&&e[0]||(e=[{x:!1,y:!1}]),e[0].t||(e[0].t={}),e[0].trace=c,G.markTime("done with calcdata for "+b),i[b]=e}function n(a,b){var c,d,e=b+1,f=[];for(c=0;c<a.length;c++)d=a[c],0>d?f.push(e+d):f.push(d);return f}function o(a,b,c){var d,e;for(d=0;d<b.length;d++){if(e=b[d],e!==parseInt(e,10))throw new Error("all values in "+c+" must be integers");if(e>=a.data.length||e<-a.data.length)throw new Error(c+" must be valid indices for gd.data.");if(b.indexOf(e,d+1)>-1||e>=0&&b.indexOf(-a.data.length+e)>-1||0>e&&b.indexOf(a.data.length+e)>-1)throw new Error("each index in "+c+" must be unique.")}}function p(a,b,c){if(!Array.isArray(a.data))throw new Error("gd.data must be an array.");if("undefined"==typeof b)throw new Error("currentIndices is a required argument.");if(Array.isArray(b)||(b=[b]),o(a,b,"currentIndices"),"undefined"==typeof c||Array.isArray(c)||(c=[c]),"undefined"!=typeof c&&o(a,c,"newIndices"),"undefined"!=typeof c&&b.length!==c.length)throw new Error("current and new indices must be of equal length.")}function q(a,b,c){var d,e;if(!Array.isArray(a.data))throw new Error("gd.data must be an array.");if("undefined"==typeof b)throw new Error("traces must be defined.");for(Array.isArray(b)||(b=[b]),d=0;d<b.length;d++)if(e=b[d],"object"!=typeof e||Array.isArray(e)||null===e)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof c||Array.isArray(c)||(c=[c]),"undefined"!=typeof c&&c.length!==b.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function r(a,b,c,d){var e=G.isPlainObject(d);if(!Array.isArray(a.data))throw new Error("gd.data must be an array");if(!G.isPlainObject(b))throw new Error("update must be a key:value object");if("undefined"==typeof c)throw new Error("indices must be an integer or array of integers");o(a,c,"indices");for(var f in b){if(!Array.isArray(b[f])||b[f].length!==c.length)throw new Error("attribute "+f+" must be an array of length equal to indices array length");if(e&&(!(f in d)||!Array.isArray(d[f])||d[f].length!==b[f].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function s(a,b,c,d){var e,f,g,h,i,j=G.isPlainObject(d),k=[];Array.isArray(c)||(c=[c]),c=n(c,a.data.length-1);for(var l in b)for(var m=0;m<c.length;m++){if(e=a.data[c[m]],g=G.nestedProperty(e,l),f=g.get(),h=b[l][m],!Array.isArray(h))throw new Error("attribute: "+l+" index: "+m+" must be an array");if(!Array.isArray(f))throw new Error("cannot extend missing or non-array attribute: "+l);i=j?d[l][m]:d,E(i)||(i=-1),k.push({prop:g,target:f,insert:h,maxp:Math.floor(i)})}return k}function t(a,b,c,d,e,f){r(a,b,c,d);for(var g,h,i,j=s(a,b,c,d),k=[],l={},m={},n=0;n<j.length;n++)h=j[n].prop,i=j[n].maxp,g=e(j[n].target,j[n].insert),i>=0&&i<g.length&&(k=f(g,i)),i=j[n].target.length,h.set(g),Array.isArray(l[h.astr])||(l[h.astr]=[]),Array.isArray(m[h.astr])||(m[h.astr]=[]),l[h.astr].push(k),m[h.astr].push(i);return{update:l,maxPoints:m}}function u(a){var b;if(G.swapAttrs(a,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(a.z)&&Array.isArray(a.z[0])&&(a.transpose?delete a.transpose:a.transpose=!0),a.error_x&&a.error_y){var c=a.error_y,d="copy_ystyle"in c?c.copy_ystyle:!(c.color||c.thickness||c.width);G.swapAttrs(a,["error_?.copy_ystyle"]),d&&G.swapAttrs(a,["error_?.color","error_?.thickness","error_?.width"])}if(a.hoverinfo){var e=a.hoverinfo.split("+");for(b=0;b<e.length;b++)"x"===e[b]?e[b]="y":"y"===e[b]&&(e[b]="x");a.hoverinfo=e.join("+")}}function v(a){var b,c={left:0,right:0,bottom:0,top:0};if(a)for(b in a)a.hasOwnProperty(b)&&(c.left+=a[b].left||0,c.right+=a[b].right||0,c.bottom+=a[b].bottom||0,c.top+=a[b].top||0);return c}function w(a,b){var c,d,e,f=a._fullLayout,g=a._context;if(a.emit("plotly_autosize"),a._context.fillFrame)e=window.innerWidth,d=window.innerHeight,document.body.style.overflow="hidden";else if(E(g.frameMargins)&&g.frameMargins>0){var h=v(a._boundingBoxMargins),i=h.left+h.right,j=h.bottom+h.top,k=f._container.node().getBoundingClientRect(),l=1-2*g.frameMargins;e=Math.round(l*(k.width-i)),d=Math.round(l*(k.height-j))}else c=window.getComputedStyle(a),d=parseFloat(c.height)||f.height,e=parseFloat(c.width)||f.width;return Math.abs(f.width-e)>1||Math.abs(f.height-d)>1?(f.height=a.layout.height=d,f.width=a.layout.width=e):"initial"!==f.autosize&&(delete b.autosize,f.autosize=a.layout.autosize=!0),J.sanitizeMargins(f),b}function x(a){var b=C.select(a),c=a._fullLayout;if(c._hasGL3D&&J.subplotsRegistry.gl3d.initAxes(a),c._container=b.selectAll(".plot-container").data([0]),c._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),c._paperdiv=c._container.selectAll(".svg-container").data([0]),c._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===c.autosize&&(w(a,{}),c.autosize=!0,a.layout.autosize=!0),c._glcontainer=c._paperdiv.selectAll(".gl-container").data([0]),c._glcontainer.enter().append("div").classed("gl-container",!0),c._geocontainer=c._paperdiv.selectAll(".geo-container").data([0]),c._geocontainer.enter().append("div").classed("geo-container",!0),c._paperdiv.selectAll(".main-svg").remove(),c._paper=c._paperdiv.insert("svg",":first-child").classed("main-svg",!0),c._toppaper=c._paperdiv.append("svg").classed("main-svg",!0),!c._uid){var d=[];C.selectAll("defs").each(function(){this.id&&d.push(this.id.split("-")[1])}),c._uid=G.randstr(d)}c._paperdiv.selectAll(".main-svg").attr(S.svgAttrs),c._defs=c._paper.append("defs").attr("id","defs-"+c._uid),c._draggers=c._paper.append("g").classed("draglayer",!0);var e=F.Axes.getSubplots(a);e.join("")!==Object.keys(a._fullLayout._plots||{}).join("")&&y(a,e),c._hasCartesian&&z(a,e),c._shapelayer=c._paper.append("g").classed("shapelayer",!0),c._pielayer=c._paper.append("g").classed("pielayer",!0),c._glimages=c._paper.append("g").classed("glimages",!0),c._geoimages=c._paper.append("g").classed("geoimages",!0),c._infolayer=c._toppaper.append("g").classed("infolayer",!0),c._hoverlayer=c._toppaper.append("g").classed("hoverlayer",!0),a.emit("plotly_framework");var f=G.syncOrAsync([A,function(){return F.Axes.doTicks(a,"redraw")},K.init],a);return f&&f.then&&a._promises.push(f),f}function y(a,b){function c(b,c){return function(){return F.Axes.getFromId(a,b,c)}}for(var d,e,f=a._fullLayout._plots={},g=0;g<b.length;g++)d=b[g],e=f[d]={},e.id=d,e.x=c(d,"x"),e.y=c(d,"y"),e.xaxis=e.x(),e.yaxis=e.y()}function z(a,b){function c(a){a.append("g").classed("imagelayer",!0),a.append("g").classed("maplayer",!0),a.append("g").classed("barlayer",!0),a.append("g").classed("errorlayer",!0),a.append("g").classed("boxlayer",!0),a.append("g").classed("scatterlayer",!0)}var d=a._fullLayout,e=[];d._paper.selectAll("g.subplot").data(b).enter().append("g").classed("subplot",!0).each(function(f){var g=d._plots[f],h=g.plotgroup=C.select(this).classed(f,!0),i=g.xaxis,j=g.yaxis;g.overlays=[];var k=F.Axes.getFromId(a,i.overlaying)||i;k!==i&&k.overlaying&&(k=i,i.overlaying=!1);var l=F.Axes.getFromId(a,j.overlaying)||j;l!==j&&l.overlaying&&(l=j,j.overlaying=!1);var m=k._id+l._id;m!==f&&-1!==b.indexOf(m)?(g.mainplot=m,e.push(g),i.domain=k.domain.slice(),j.domain=l.domain.slice()):(g.bg=h.append("rect").style("stroke-width",0),g.gridlayer=h.append("g"),g.overgrid=h.append("g"),g.zerolinelayer=h.append("g"),g.overzero=h.append("g"),g.plot=h.append("svg").call(c),g.overplot=h.append("g"),g.xlines=h.append("path"),g.ylines=h.append("path"),g.overlines=h.append("g"),g.xaxislayer=h.append("g"),g.yaxislayer=h.append("g"),g.overaxes=h.append("g")),g.draglayer=d._draggers.append("g")}),e.forEach(function(a){var b=d._plots[a.mainplot];b.overlays.push(a),a.gridlayer=b.overgrid.append("g"),a.zerolinelayer=b.overzero.append("g"),a.plot=b.overplot.append("svg").call(c),a.xlines=b.overlines.append("path"),a.ylines=b.overlines.append("path"),a.xaxislayer=b.overaxes.append("g"),a.yaxislayer=b.overaxes.append("g")}),b.forEach(function(a){var b=d._plots[a];b.plot.attr("preserveAspectRatio","none").style("fill","none"),b.xlines.style("fill","none").classed("crisp",!0),b.ylines.style("fill","none").classed("crisp",!0)})}function A(a){return G.syncOrAsync([J.doAutoMargin,B],a)}function B(a){var b,c=a._fullLayout,d=c._size,e=F.Axes.list(a);for(b=0;b<e.length;b++)e[b]._linepositions={};c._paperdiv.style({width:c.width+"px",height:c.height+"px"}).selectAll(".main-svg").call(M.setSize,c.width,c.height),a._context.setBackground(a,c.paper_bgcolor);var f=[];return c._paper.selectAll("g.subplot").each(function(b){var e=c._plots[b],g=F.Axes.getFromId(a,b,"x"),h=F.Axes.getFromId(a,b,"y");g.setScale(),h.setScale(),e.bg&&e.bg.call(M.setRect,g._offset-d.p,h._offset-d.p,g._length+2*d.p,h._length+2*d.p).call(L.fill,c.plot_bgcolor),e.plot.call(M.setRect,g._offset,h._offset,g._length,h._length);var i=M.crispRound(a,g.linewidth,1),j=M.crispRound(a,h.linewidth,1),k=d.p+j,l="M"+-k+",",m="h"+(g._length+2*k),n="free"===g.anchor&&-1===f.indexOf(g._id),o=d.h*(1-(g.position||0))+i/2%1,p=g.anchor===h._id&&(g.mirror||"top"!==g.side)||"all"===g.mirror||"allticks"===g.mirror||g.mirrors&&g.mirrors[h._id+"bottom"],q=h._length+d.p+i/2,r=g.anchor===h._id&&(g.mirror||"top"===g.side)||"all"===g.mirror||"allticks"===g.mirror||g.mirrors&&g.mirrors[h._id+"top"],s=-d.p-i/2,t=d.p,u=p?0:i,v=r?0:i,w=","+(-t-v)+"v"+(h._length+2*t+v+u),x="free"===h.anchor&&-1===f.indexOf(h._id),y=d.w*(h.position||0)+j/2%1,z=h.anchor===g._id&&(h.mirror||"right"!==h.side)||"all"===h.mirror||"allticks"===h.mirror||h.mirrors&&h.mirrors[g._id+"left"],A=-d.p-j/2,B=h.anchor===g._id&&(h.mirror||"right"===h.side)||"all"===h.mirror||"allticks"===h.mirror||h.mirrors&&h.mirrors[g._id+"right"],C=g._length+d.p+j/2;g._linepositions[b]=[p?q:void 0,r?s:void 0,n?o:void 0],g.anchor===h._id?g._linepositions[b][3]="top"===g.side?s:q:n&&(g._linepositions[b][3]=o),h._linepositions[b]=[z?A:void 0,B?C:void 0,x?y:void 0],h.anchor===g._id?h._linepositions[b][3]="right"===h.side?C:A:x&&(h._linepositions[b][3]=y);var D="translate("+g._offset+","+h._offset+")",E=D,G=D;n&&(E="translate("+g._offset+","+d.t+")",s+=h._offset-d.t,q+=h._offset-d.t),x&&(G="translate("+d.l+","+h._offset+")",A+=g._offset-d.l,C+=g._offset-d.l),e.xlines.attr("transform",E).attr("d",(p?l+q+m:"")+(r?l+s+m:"")+(n?l+o+m:"")||"M0,0").style("stroke-width",i+"px").call(L.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)"),e.ylines.attr("transform",G).attr("d",(z?"M"+A+w:"")+(B?"M"+C+w:"")+(x?"M"+y+w:"")||"M0,0").attr("stroke-width",j+"px").call(L.stroke,h.showline?h.linecolor:"rgba(0,0,0,0)"),e.xaxislayer.attr("transform",E),e.yaxislayer.attr("transform",G),e.gridlayer.attr("transform",D),e.zerolinelayer.attr("transform",D),e.draglayer.attr("transform",D),n&&f.push(g._id),x&&f.push(h._id)}),F.Axes.makeClipPaths(a),Q.draw(a,"gtitle"),R(a),a._promises.length&&Promise.all(a._promises)}var C=a("d3"),D=a("gl-mat4/fromQuat"),E=a("fast-isnumeric"),F=a("../plotly"),G=a("../lib"),H=a("../lib/events"),I=a("../lib/queue"),J=a("../plots/plots"),K=a("../plots/cartesian/graph_interact"),L=a("../components/color"),M=a("../components/drawing"),N=a("../components/errorbars"),O=a("../components/legend"),P=a("../components/shapes"),Q=a("../components/titles"),R=a("../components/modebar/manage"),S=a("../constants/xmlns_namespaces");F.plot=function(a,b,c,e){function i(){var b,c,d,e=a.calcdata;for(O.draw(a),b=0;b<e.length;b++)c=e[b],d=c[0].trace,d.visible===!0&&d._module.colorbar?d._module.colorbar(a,c):J.autoMargin(a,"cb"+d.uid);return J.doAutoMargin(a),J.previousPromises(a)}function k(){var b=JSON.stringify(z._size)===E?[]:[i,A];return G.syncOrAsync(b.concat(K.init),a)}function l(){if(B){for(var b,c,d=J.getSubplotIds(z,"cartesian"),e=a._modules,f=0;f<d.length;f++){b=z._plots[d[f]];for(var g=0;g<e.length;g++)c=e[g],c.setPositions&&c.setPositions(a,b)}return G.markTime("done with bar/box adjustments"),N.calc(a),G.markTime("done ErrorBars.calc"),G.syncOrAsync([P.calcAutorange,F.Annotations.calcAutorange,n],a)}}function n(){for(var b=F.Axes.list(a,"",!0),c=0;c<b.length;c++)F.Axes.doAutoRange(b[c])}function o(){return F.Axes.doTicks(a,"redraw")}function p(){for(var b=a.calcdata,c=0;c<b.length;c++){var d=b[c][0].trace,e=d.visible===!0,f=d.uid;e&&J.traceIs(d,"2dMap")||z._paper.selectAll(".hm"+f+",.contour"+f+",#clip"+f).remove(),e&&d._module.colorbar||z._infolayer.selectAll(".cb"+f).remove()}var g=J.subplotsRegistry;return z._hasGL3D&&g.gl3d.plot(a),z._hasGeo&&g.geo.plot(a),z._hasGL2D&&g.gl2d.plot(a),(z._hasCartesian||z._hasPie)&&g.cartesian.plot(a),J.style(a),G.markTime("done Plots.style"),P.drawAll(a),F.Annotations.drawAll(a),J.addLinks(a),a._replotting=!1,J.previousPromises(a)}function q(){P.drawAll(a),F.Annotations.drawAll(a),O.draw(a)}function r(){G.markTime("done plot"),a.emit("plotly_afterplot")}G.markTime("in plot"),a=d(a),H.init(a);var s=H.triggerHandler(a,"plotly_beforeplot",[b,c,e]);if(s===!1)return Promise.reject();b||c||G.isPlotDiv(a)||console.log("Warning: calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",a),f(a,e),c||(c={}),C.select(a).classed("js-plotly-plot",!0),M.makeTester(a),a._promises=[];var t=0===(a.data||[]).length&&Array.isArray(b);if(Array.isArray(b)&&(j(b,a.data),t?a.data=b:a.data.push.apply(a.data,b),a.empty=!1),a.layout&&!t||(a.layout=h(c)),a._dragging)return a._replotPending=!0,Promise.reject();if(a._replotPending=!1,J.supplyDefaults(a),b&&b[0]&&b[0].r)return g(a,b,c);a._replotting=!0;var u=a._fullData.length>0,v=F.Axes.getSubplots(a).join(""),w=Object.keys(a._fullLayout._plots||{}).join(""),y=w===v;u?a.framework===x&&!t&&y||(a.framework=x,x(a)):y?t&&x(a):(a.framework=x,x(a));var z=a._fullLayout,B=!a.calcdata||a.calcdata.length!==(a.data||[]).length;B&&(m(a),a._context.doubleClick===!1&&a._context.displayModeBar===!1||F.Axes.saveRangeInitial(a));for(var D=0;D<a.calcdata.length;D++)a.calcdata[D][0].trace=a._fullData[D];var E=JSON.stringify(z._size),I=G.syncOrAsync([J.previousPromises,i,A,k,l,o,p,q],a,r);return I&&I.then?I:Promise.resolve(a)},F.redraw=function(a){return a=d(a),G.isPlotDiv(a)?(a.calcdata=void 0,F.plot(a).then(function(){return a.emit("plotly_redraw"),a})):void console.log("This element is not a Plotly Plot",a)},F.newPlot=function(a,b,c,e){return a=d(a),J.purge(a),F.plot(a,b,c,e)},F.extendTraces=function T(a,b,c,e){a=d(a);var f=t(a,b,c,e,function(a,b){return a.concat(b)},function(a,b){return a.splice(0,a.length-b)}),g=F.redraw(a),h=[a,f.update,c,f.maxPoints];return I&&I.add(a,F.prependTraces,h,T,arguments),g},F.prependTraces=function U(a,b,c,e){a=d(a);var f=t(a,b,c,e,function(a,b){return b.concat(a)},function(a,b){return a.splice(b,a.length)}),g=F.redraw(a),h=[a,f.update,c,f.maxPoints];return I&&I.add(a,F.extendTraces,h,U,arguments),g},F.addTraces=function V(a,b,c){a=d(a);var e,f,g=[],h=F.deleteTraces,i=V,k=[a,g],l=[a,b];for(q(a,b,c),Array.isArray(b)||(b=[b]),j(b,a.data),e=0;e<b.length;e+=1)a.data.push(b[e]);for(e=0;e<b.length;e++)g.push(-b.length+e);if("undefined"==typeof c)return f=F.redraw(a),I&&I.add(a,h,k,i,l),f;Array.isArray(c)||(c=[c]);try{p(a,g,c)}catch(m){throw a.data.splice(a.data.length-b.length,b.length),m}return I&&I.startSequence(a),I&&I.add(a,h,k,i,l),f=F.moveTraces(a,g,c),I&&I.stopSequence(a),f},F.deleteTraces=function W(a,b){a=d(a);var c,e,f=[],g=F.addTraces,h=W,i=[a,f,b],j=[a,b];if("undefined"==typeof b)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(b)||(b=[b]),o(a,b,"indices"),b=n(b,a.data.length-1),b.sort(G.sorterDes),c=0;c<b.length;c+=1)e=a.data.splice(b[c],1)[0],f.push(e);var k=F.redraw(a);return I&&I.add(a,g,i,h,j),k},F.moveTraces=function X(a,b,c){a=d(a);var e,f=[],g=[],h=X,i=X,j=[a,c,b],k=[a,b,c];if(p(a,b,c),b=Array.isArray(b)?b:[b],"undefined"==typeof c)for(c=[],e=0;e<b.length;e++)c.push(-b.length+e);for(c=Array.isArray(c)?c:[c],b=n(b,a.data.length-1),c=n(c,a.data.length-1),e=0;e<a.data.length;e++)-1===b.indexOf(e)&&f.push(a.data[e]);for(e=0;e<b.length;e++)g.push({newIndex:c[e],trace:a.data[b[e]]});for(g.sort(function(a,b){return a.newIndex-b.newIndex}),e=0;e<g.length;e+=1)f.splice(g[e].newIndex,0,g[e].trace);a.data=f;var l=F.redraw(a);return I&&I.add(a,h,j,i,k),l},F.restyle=function Y(a,b,c,e){function f(){return e.map(function(){})}function g(a){var b=F.Axes.id2name(a);-1===o.indexOf(b)&&o.push(b)}function h(a){return"LAYOUT"+a+".autorange"}function i(a){return"LAYOUT"+a+".range"}function j(b,c,d){if(Array.isArray(b))return void b.forEach(function(a){j(a,c,d)});if(!(b in m)){var g;g="LAYOUT"===b.substr(0,6)?G.nestedProperty(a.layout,b.replace("LAYOUT","")):G.nestedProperty(a.data[e[d]],b),b in A||(A[b]=f()),void 0===A[b][d]&&(A[b][d]=g.get()),void 0!==c&&g.set(c)}}a=d(a);var k,l=a._fullLayout,m={};if("string"==typeof b)m[b]=c;else{if(!G.isPlainObject(b))return console.log("restyle fail",b,c,e),Promise.reject();m=b,void 0===e&&(e=c)}Object.keys(m).length&&(a.changed=!0),E(e)?e=[e]:Array.isArray(e)&&e.length||(e=a._fullData.map(function(a,b){return b}));var n=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull"];for(k=0;k<e.length;k++)if(J.traceIs(a._fullData[e[k]],"box")){n.push("name");break}var o,p=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean"],q=["zmin","zmax","zauto","marker.cmin","marker.cmax","marker.cauto","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],r=["type","x","y","x0","y0","orientation","xaxis","yaxis"],s=!1,t=!1,v=!1,w=!1,x=!1,y=!1,z={},A={},B={};(l._hasGL3D||l._hasGeo||l._hasGL2D)&&(v=!0);var C=["zmin","zmax"],D=["xbins.start","xbins.end","xbins.size"],H=["ybins.start","ybins.end","ybins.size"],K=["contours.start","contours.end","contours.size"]; 49 for(var L in m){var M,N,P,Q,R,S=m[L];if(z[L]=S,"LAYOUT"!==L.substr(0,6)){for(A[L]=f(),k=0;k<e.length;k++){if(M=a.data[e[k]],N=a._fullData[e[k]],P=G.nestedProperty(M,L),Q=P.get(),R=Array.isArray(S)?S[k%S.length]:S,-1!==C.indexOf(L))j("zauto",!1,k);else if("colorscale"===L)j("autocolorscale",!1,k);else if("autocolorscale"===L)j("colorscale",void 0,k);else if("marker.colorscale"===L)j("marker.autocolorscale",!1,k);else if("marker.autocolorscale"===L)j("marker.colorscale",void 0,k);else if("zauto"===L)j(C,void 0,k);else if(-1!==D.indexOf(L))j("autobinx",!1,k);else if("autobinx"===L)j(D,void 0,k);else if(-1!==H.indexOf(L))j("autobiny",!1,k);else if("autobiny"===L)j(H,void 0,k);else if(-1!==K.indexOf(L))j("autocontour",!1,k);else if("autocontour"===L)j(K,void 0,k);else if(-1!==["x0","dx"].indexOf(L)&&N.x&&"scaled"!==N.xtype)j("xtype","scaled",k);else if(-1!==["y0","dy"].indexOf(L)&&N.y&&"scaled"!==N.ytype)j("ytype","scaled",k);else if("colorbar.thicknessmode"===L&&P.get()!==R&&-1!==["fraction","pixels"].indexOf(R)&&N.colorbar){var T=-1!==["top","bottom"].indexOf(N.colorbar.orient)?l.height-l.margin.t-l.margin.b:l.width-l.margin.l-l.margin.r;j("colorbar.thickness",N.colorbar.thickness*("fraction"===R?1/T:T),k)}else if("colorbar.lenmode"===L&&P.get()!==R&&-1!==["fraction","pixels"].indexOf(R)&&N.colorbar){var U=-1!==["top","bottom"].indexOf(N.colorbar.orient)?l.width-l.margin.l-l.margin.r:l.height-l.margin.t-l.margin.b;j("colorbar.len",N.colorbar.len*("fraction"===R?1/U:U),k)}else"colorbar.tick0"===L||"colorbar.dtick"===L?j("colorbar.tickmode","linear",k):"colorbar.tickmode"===L&&j(["colorbar.tick0","colorbar.dtick"],void 0,k);if("type"===L&&"pie"===R!=("pie"===Q)){var V="x",W="y";"bar"!==R&&"bar"!==Q||"h"!==M.orientation||(V="y",W="x"),G.swapAttrs(M,["?","?src"],"labels",V),G.swapAttrs(M,["d?","?0"],"label",V),G.swapAttrs(M,["?","?src"],"values",W),"pie"===Q?(G.nestedProperty(M,"marker.color").set(G.nestedProperty(M,"marker.colors").get()),l._pielayer.selectAll("g.trace").remove()):J.traceIs(M,"cartesian")&&(G.nestedProperty(M,"marker.colors").set(G.nestedProperty(M,"marker.color").get()),B[M.xaxis||"x"]=!0,B[M.yaxis||"y"]=!0)}A[L][k]=Q;var X=["swapxy","swapxyaxes","orientation","orientationaxes"];if(-1!==X.indexOf(L)){if("orientation"===L){if(P.set(R),P.get()===A[L][k])continue}else"orientationaxes"===L&&(M.orientation={v:"h",h:"v"}[N.orientation]);u(M)}else P.set(R)}if(-1!==["swapxyaxes","orientationaxes"].indexOf(L)&&F.Axes.swap(a,e),"orientationaxes"===L){var Z=G.nestedProperty(a.layout,"hovermode");"x"===Z.get()?Z.set("y"):"y"===Z.get()&&Z.set("x")}if(-1!==e.indexOf(0)&&-1!==r.indexOf(L)&&(F.Axes.clearTypes(a,e),s=!0),-1!==["autobinx","autobiny","zauto"].indexOf(L)&&R===!1||(x=!0),(-1!==["colorbar","line"].indexOf(P.parts[0])||"marker"===P.parts[0]&&"colorbar"===P.parts[1])&&(y=!0),-1!==n.indexOf(L)){if(-1!==["orientation","type"].indexOf(L)){for(o=[],k=0;k<e.length;k++){var $=a.data[e[k]];J.traceIs($,"cartesian")&&(g($.xaxis||"x"),g($.yaxis||"y"),"type"===b&&j(["autobinx","autobiny"],!0,k))}j(o.map(h),!0,0),j(o.map(i),[0,1],0)}s=!0}else-1!==q.indexOf(L)?v=!0:-1!==p.indexOf(L)&&(t=!0)}else P=G.nestedProperty(a.layout,L.replace("LAYOUT","")),A[L]=[P.get()],P.set(Array.isArray(S)?S[0]:S),s=!0}var _=Object.keys(B);a:for(k=0;k<_.length;k++){for(var aa=_[k],ba=aa.charAt(0),ca=ba+"axis",da=0;da<a.data.length;da++)if(J.traceIs(a.data[da],"cartesian")&&(a.data[da][ca]||ba)===aa)continue a;j("LAYOUT"+F.Axes.id2name(aa),null,0)}I&&I.add(a,Y,[a,A,e],Y,[a,z,e]);var ea=!1;F.Axes.list(a).forEach(function(a){a.autorange&&(ea=!0)}),(s||w||t&&ea)&&(a.calcdata=void 0);var fa;w?fa=[function(){var b=a.layout;return a.layout=void 0,F.plot(a,"",b)}]:s||v||t?fa=[F.plot]:(J.supplyDefaults(a),fa=[J.previousPromises],x&&fa.push(function(){var b,c,d;for(b=0;b<a.calcdata.length;b++)c=a.calcdata[b],d=(((c[0]||{}).trace||{})._module||{}).arraysToCalcdata,d&&d(c);return J.style(a),O.draw(a),J.previousPromises(a)}),y&&fa.push(function(){return a.calcdata.forEach(function(a){if((a[0].t||{}).cb){var b=a[0].trace,c=a[0].t.cb;J.traceIs(b,"contour")&&c.line({width:b.contours.showlines!==!1?b.line.width:0,dash:b.line.dash,color:"line"===b.contours.coloring?c._opts.line.color:b.line.color}),J.traceIs(b,"markerColorscale")?c.options(b.marker.colorbar)():c.options(b.colorbar)()}}),J.previousPromises(a)}));var ga=G.syncOrAsync(fa,a);return ga&&ga.then||(ga=Promise.resolve()),ga.then(function(){return a.emit("plotly_restyle",G.extendDeep([],[z,e])),a})},F.relayout=function Z(a,b,c){function e(a,b){if(Array.isArray(a))return void a.forEach(function(a){e(a,b)});if(!(a in p)){var c=G.nestedProperty(n,a);a in z||(z[a]=c.get()),void 0!==b&&c.set(b)}}function f(a,b){var c=F.Axes.id2name(a[b+"ref"]||b);return(o[c]||{}).autorange}if(a=d(a),a.framework&&a.framework.isPolar)return Promise.resolve(a);var g,h,i,j,k,l,m,n=a.layout,o=a._fullLayout,p={},q=!1,r=!1,s=!1,t=!1,u=!1,v=!1;if("string"==typeof b)p[b]=c;else{if(!G.isPlainObject(b))return console.log("relayout fail",b,c),Promise.reject();p=b}for(Object.keys(p).length&&(a.changed=!0),i=Object.keys(p),h=F.Axes.list(a),m=0;m<i.length;m++){if(0===i[m].indexOf("allaxes")){for(var x=0;x<h.length;x++)k=h[x]._id.substr(1),l=-1!==k.indexOf("scene")?k+".":"",g=i[m].replace("allaxes",l+h[x]._name),p[g]||(p[g]=p[i[m]]);delete p[i[m]]}i[m].match(/^annotations\[[0-9-]+\].ref$/)&&(j=p[i[m]].split("y"),p[i[m].replace("ref","xref")]=j[0],p[i[m].replace("ref","yref")]=2===j.length?"y"+j[1]:"paper",delete p[i[m]])}var y={},z={},B=["height","width"];for(var C in p){var D=G.nestedProperty(n,C),E=p[C],H=D.parts.length,K="string"==typeof D.parts[H-1]?H-1:H-2,L=D.parts[K],M=D.parts[K-1]+"."+L,N=D.parts.slice(0,K).join("."),P=G.nestedProperty(a.layout,N).get(),S=G.nestedProperty(o,N).get();if(y[C]=E,z[C]="reverse"===L?E:D.get(),-1!==B.indexOf(C)?e("autosize",!1):"autosize"===C?e(B,void 0):M.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?e(N+".autorange",!1):M.match(/^[xyz]axis[0-9]*\.autorange$/)?e([N+".range[0]",N+".range[1]"],void 0):M.match(/^aspectratio\.[xyz]$/)?e(D.parts[0]+".aspectmode","manual"):M.match(/^aspectmode$/)?e([N+".x",N+".y",N+".z"],void 0):"tick0"===L||"dtick"===L?e(N+".tickmode","linear"):"tickmode"===L?e([N+".tick0",N+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(L)&&!Object.keys(E||{}).length&&(u=!0),"type"===L&&"log"===S.type!=("log"===E)){var T=P;if(T&&T.range)if(S.autorange)"log"===E&&(T.range=T.range[1]>T.range[0]?[1,2]:[2,1]);else{var U=T.range[0],V=T.range[1];"log"===E?(0>=U&&0>=V&&e(N+".autorange",!0),0>=U?U=V/1e6:0>=V&&(V=U/1e6),e(N+".range[0]",Math.log(U)/Math.LN10),e(N+".range[1]",Math.log(V)/Math.LN10)):(e(N+".range[0]",Math.pow(10,U)),e(N+".range[1]",Math.pow(10,V)))}else e(N+".autorange",!0)}if("reverse"===L)P.range?P.range.reverse():(e(N+".autorange",!0),P.range=[1,0]),S.autorange?u=!0:t=!0;else if("annotations"===D.parts[0]||"shapes"===D.parts[0]){var W=D.parts[1],X=D.parts[0],Y=n[X]||[],$=F[G.titleCase(X)],_=Y[W]||{};2===D.parts.length&&("add"===p[C]||G.isPlainObject(p[C])?z[C]="remove":"remove"===p[C]?-1===W?(z[X]=Y,delete z[C]):z[C]=_:console.log("???",p)),!f(_,"x")&&!f(_,"y")||G.containsAny(C,["color","opacity","align","dash"])||(u=!0),$.draw(a,W,D.parts.slice(2).join("."),p[C]),delete p[C]}else 0===D.parts[0].indexOf("scene")?t=!0:0===D.parts[0].indexOf("geo")?t=!0:!o._hasGL2D||-1===C.indexOf("axis")&&"plot_bgcolor"!==D.parts[0]?"hiddenlabels"===C?u=!0:-1!==D.parts[0].indexOf("legend")?q=!0:-1!==C.indexOf("title")?r=!0:-1!==D.parts[0].indexOf("bgcolor")?s=!0:D.parts.length>1&&G.containsAny(D.parts[1],["tick","exponent","grid","zeroline"])?r=!0:-1!==C.indexOf(".linewidth")&&-1!==C.indexOf("axis")?r=s=!0:D.parts.length>1&&-1!==D.parts[1].indexOf("line")?s=!0:D.parts.length>1&&"mirror"===D.parts[1]?r=s=!0:"margin.pad"===C?r=s=!0:"margin"===D.parts[0]||"autorange"===D.parts[1]||"rangemode"===D.parts[1]||"type"===D.parts[1]||"domain"===D.parts[1]||C.match(/^(bar|box|font)/)?u=!0:-1!==["hovermode","dragmode"].indexOf(C)?v=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(C)&&(t=!0):t=!0,D.set(E)}I&&I.add(a,Z,[a,z],Z,[a,y]),p.autosize&&(p=w(a,p)),(p.height||p.width||p.autosize)&&(u=!0);var aa=Object.keys(p),ba=[J.previousPromises];if(t||u)ba.push(function(){return a.layout=void 0,u&&(a.calcdata=void 0),F.plot(a,"",n)});else if(aa.length&&(J.supplyDefaults(a),o=a._fullLayout,q&&ba.push(function(){return O.draw(a),J.previousPromises(a)}),s&&ba.push(A),r&&ba.push(function(){return F.Axes.doTicks(a,"redraw"),Q.draw(a,"gtitle"),J.previousPromises(a)}),v)){var ca;for(R(a),ca=J.getSubplotIds(o,"gl3d"),m=0;m<ca.length;m++)k=o[ca[m]]._scene,k.updateFx(o.dragmode,o.hovermode);for(ca=J.getSubplotIds(o,"gl2d"),m=0;m<ca.length;m++)k=o._plots[ca[m]]._scene2d,k.updateFx(o);for(ca=J.getSubplotIds(o,"geo"),m=0;m<ca.length;m++){var da=o[ca[m]]._geo;da.updateFx(o.hovermode)}}var ea=G.syncOrAsync(ba,a);return ea&&ea.then||(ea=Promise.resolve(a)),ea.then(function(){return a.emit("plotly_relayout",G.extendDeep({},y)),a})}},{"../components/color":299,"../components/drawing":317,"../components/errorbars":323,"../components/legend":326,"../components/modebar/manage":329,"../components/shapes":331,"../components/titles":332,"../constants/xmlns_namespaces":338,"../lib":349,"../lib/events":344,"../lib/queue":355,"../plotly":366,"../plots/cartesian/graph_interact":374,"../plots/plots":413,d3:70,"fast-isnumeric":74,"gl-mat4/fromQuat":91}],363:[function(a,b,c){"use strict";function d(a,b){try{a._fullLayout._paper.style("background",b)}catch(c){console.log(c)}}b.exports={staticPlot:!1,editable:!1,autosizable:!1,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:d,topojsonURL:"https://cdn.plot.ly/"}},{}],364:[function(a,b,c){"use strict";function d(a){var b=q.attributes,c=i({type:a}),d=k(a),e=m(a),f={},l={};f.type=null,t(f,b),f=g(c.attributes,f,"attributes",a),void 0!==e.attributes&&t(f,e.attributes),f.type=a,f=j(f),h(f),B.traces[a]=s({},d,{attributes:f}),void 0!==c.layoutAttributes&&(l=g(c.layoutAttributes,l,"layoutAttributes",a),h(l),B.traces[a].layoutAttributes=l)}function e(){var a=q.layoutAttributes,b={};b=g(a,b,"layoutAttributes","*"),b=l(b),b=n(b),b=j(b),h(b),b=o(b),B.layout={layoutAttributes:b}}function f(){B.defs={valObjects:r.valObjects,metaKeys:A.concat(["description","role"])}}function g(a,b,c,d){var e,f,h,j,k;return Object.keys(a).forEach(function(l){return l===v?void Object.keys(a[l]).forEach(function(j){e=i({module:a[l][j]}),void 0!==e&&(f=e[c],h=g(f,{},c,d),r.nestedProperty(b,j).set(t({},h)))}):l===w?void Object.keys(a[l]).forEach(function(e){e===d&&(j=i({module:a[l][e]}),void 0!==j&&(k=j[c],k=g(k,{},c,d),u(b,k)))}):void(b[l]=r.isPlainObject(a[l])?u({},a[l]):a[l])}),b}function h(a){function b(a){return{valType:"string"}}function c(a,c,d){E.isValObject(a)?"data_array"===a.valType?(a.role="data",d[c+"src"]=b(c)):a.arrayOk===!0&&(d[c+"src"]=b(c)):r.isPlainObject(a)&&(a.role="object")}E.crawl(a,c)}function i(a){if("type"in a)return"area"===a.type?{attributes:C}:q.getModule({type:a.type});var b=q.subplotsRegistry,c=a.module;return b[c]?b[c]:"module"in a?p[c]:void 0}function j(a){return Object.keys(a).forEach(function(b){"_"===b.charAt(0)&&-1===A.indexOf(b)&&delete a[b]}),a}function k(a){return"area"===a?{}:q.modules[a].meta||{}}function l(a){return s(a,{radialaxis:D.radialaxis,angularaxis:D.angularaxis}),s(a,D.layout),a}function m(a){if("area"===a)return{};var b=q.subplotsRegistry,c=Object.keys(b).filter(function(b){return q.traceIs({type:a},b)})[0];return void 0===c?{}:b[c]}function n(a){var b=q.subplotsRegistry;return Object.keys(a).forEach(function(c){Object.keys(b).forEach(function(d){var e,f=b[d];e="cartesian"===d||"gl2d"===d?f.attrRegex.x.test(c)||f.attrRegex.y.test(c):f.attrRegex.test(c),e&&(a[c][x]=!0)})}),a}function o(a){return Object.keys(a).forEach(function(b){var c=t({},a[b]);if(c[y]===!0){var d=b.substr(0,b.length-1);delete c[y],a[b]={items:{}},a[b].items[d]=c,a[b].role="object"}}),a}var p=a("../plotly"),q=a("../plots/plots"),r=a("../lib"),s=r.extendFlat,t=r.extendDeep,u=r.extendDeepAll,v="_nestedModules",w="_composedModules",x="_isSubplotObj",y="_isLinkedToArray",z="_deprecated",A=[x,y,z],B={traces:{},layout:{},defs:{}},C=a("../plots/polar/area_attributes"),D=a("../plots/polar/axis_attributes"),E=b.exports={};E.get=function(){return q.allTypes.concat("area").forEach(d),e(),f(),B},E.crawl=function(a,b){Object.keys(a).forEach(function(c){var d=a[c];-1===A.indexOf(c)&&(b(d,c,a),E.isValObject(d)||r.isPlainObject(d)&&E.crawl(d,b))})},E.isValObject=function(a){return a&&void 0!==a.valType}},{"../lib":349,"../plotly":366,"../plots/plots":413,"../plots/polar/area_attributes":414,"../plots/polar/axis_attributes":415}],365:[function(a,b,c){"use strict";var d=a("../plotly");b.exports=function(a){return d.Lib.extendFlat(d.defaultConfig,a)}},{"../plotly":366}],366:[function(a,b,c){"use strict";a("es6-promise").polyfill(),c.Lib=a("./lib"),c.util=a("./lib/svg_text_utils"),c.Queue=a("./lib/queue"),a("../build/plotcss"),c.MathJaxConfig=a("./fonts/mathjax_config"),c.defaultConfig=a("./plot_api/plot_config");var d=c.Plots=a("./plots/plots");c.Axes=a("./plots/cartesian/axes"),c.Fx=a("./plots/cartesian/graph_interact"),c.micropolar=a("./plots/polar/micropolar"),c.Color=a("./components/color"),c.Drawing=a("./components/drawing"),c.Colorscale=a("./components/colorscale"),c.Colorbar=a("./components/colorbar"),c.ErrorBars=a("./components/errorbars"),c.Annotations=a("./components/annotations"),c.Shapes=a("./components/shapes"),c.Legend=a("./components/legend"),c.ModeBar=a("./components/modebar"),c.register=function(a){if(!a)throw new Error("No argument passed to Plotly.register.");a&&!Array.isArray(a)&&(a=[a]);for(var b=0;b<a.length;b++){var c=a[b];if(c&&"trace"!==c.moduleType)throw new Error("Invalid module was attempted to be registered!");d.register(c,c.name,c.categories,c.meta),d.subplotsRegistry[c.basePlotModule.name]||d.registerSubplot(c.basePlotModule)}},c.register(a("./traces/scatter")),a("./plot_api/plot_api"),c.PlotSchema=a("./plot_api/plot_schema"),c.Snapshot=a("./snapshot")},{"../build/plotcss":1,"./components/annotations":297,"./components/color":299,"./components/colorbar":304,"./components/colorscale":312,"./components/drawing":317,"./components/errorbars":323,"./components/legend":326,"./components/modebar":328,"./components/shapes":331,"./fonts/mathjax_config":340,"./lib":349,"./lib/queue":355,"./lib/svg_text_utils":360,"./plot_api/plot_api":362,"./plot_api/plot_config":363,"./plot_api/plot_schema":364,"./plots/cartesian/axes":369,"./plots/cartesian/graph_interact":374,"./plots/plots":413,"./plots/polar/micropolar":416,"./snapshot":420,"./traces/scatter":511,"es6-promise":73}],367:[function(a,b,c){"use strict";b.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none"],dflt:"all"},stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0}}}},{}],368:[function(a,b,c){"use strict";b.exports={xaxis:{valType:"axisid",dflt:"x"},yaxis:{valType:"axisid",dflt:"y"}}},{}],369:[function(a,b,c){"use strict";function d(a){var b,c,d=a.tickvals,e=a.ticktext,f=new Array(d.length),g=1.0001*a.range[0]-1e-4*a.range[1],i=1.0001*a.range[1]-1e-4*a.range[0],j=Math.min(g,i),k=Math.max(g,i),l=0;for(Array.isArray(e)||(e=[]),c=0;c<d.length;c++)b=a.d2l(d[c]),b>j&&k>b&&(void 0===e[c]?f[l]=x.tickText(a,b):f[l]=h(a,b,String(e[c])),l++);return l<d.length&&f.splice(l,d.length-l),f}function e(a,b,c){return b*v.Lib.roundUp(a/b,c)}function f(a){var b,c=a.dtick;if(a._tickexponent=0,u(c)||"string"==typeof c||(c=1),"category"===a.type)a._tickround=null;else if(u(c)||"L"===c.charAt(0))if("date"===a.type)c>=864e5?a._tickround="d":c>=36e5?a._tickround="H":c>=6e4?a._tickround="M":c>=1e3?a._tickround="S":a._tickround=3-Math.round(Math.log(c/2)/Math.LN10);else{u(c)||(c=Number(c.substr(1))),a._tickround=2-Math.floor(Math.log(c)/Math.LN10+.01),b="log"===a.type?Math.pow(10,Math.max(a.range[0],a.range[1])):Math.max(Math.abs(a.range[0]),Math.abs(a.range[1]));var d=Math.floor(Math.log(b)/Math.LN10+.01);Math.abs(d)>3&&("SI"===a.exponentformat||"B"===a.exponentformat?a._tickexponent=3*Math.round((d-1)/3):a._tickexponent=d)}else"M"===c.charAt(0)?a._tickround=2===c.length?"m":"y":a._tickround=null}function g(a,b){var c=a.match(M),d=new Date(b);if(c){var e=Math.min(+c[1]||6,6),f=String(b/1e3%1+2.0000005).substr(2,e).replace(/0+$/,"")||"0";return t.time.format(a.replace(M,f))(d)}return t.time.format(a)(d)}function h(a,b,c){var d=a.tickfont||a._td._fullLayout.font;return{x:b,dx:0,dy:0,text:c||"",fontSize:d.size,font:d.family,fontColor:d.color}}function i(a,b,c,d){var e,f=b.x,h=a._tickround,i=new Date(f),j="";c&&a.hoverformat?e=g(a.hoverformat,f):a.tickformat?e=g(a.tickformat,f):(d&&(u(h)?h+=2:h={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[h]),"y"===h?e=G(i):"m"===h?e=H(i):(f!==a._tmin||c||(j="<br>"+G(i)),"d"===h?e=I(i):"H"===h?e=J(i):(f!==a._tmin||c||(j="<br>"+I(i)+", "+G(i)),e=K(i),"M"!==h&&(e+=L(i),"S"!==h&&(e+=m(s(f/1e3,1),a,"none",c).substr(1)))))),b.text=e+j}function j(a,b,c,d,e){var f=a.dtick,g=b.x;if(!d||"string"==typeof f&&"L"===f.charAt(0)||(f="L3"),a.tickformat||"string"==typeof f&&"L"===f.charAt(0))b.text=m(Math.pow(10,g),a,e,d);else if(u(f)||"D"===f.charAt(0)&&s(g+.01,1)<.1)if(-1!==["e","E","power"].indexOf(a.exponentformat)){var h=Math.round(g);0===h?b.text=1:1===h?b.text="10":h>1?b.text="10<sup>"+h+"</sup>":b.text="10<sup>â"+-h+"</sup>",b.fontSize*=1.25}else b.text=m(Math.pow(10,g),a,"","fakehover"),"D1"===f&&"y"===a._id.charAt(0)&&(b.dy-=b.fontSize/6);else{if("D"!==f.charAt(0))throw"unrecognized dtick "+String(f);b.text=String(Math.round(Math.pow(10,s(g,1)))),b.fontSize*=.75}if("D1"===a.dtick){var i=String(b.text).charAt(0);"0"!==i&&"1"!==i||("y"===a._id.charAt(0)?b.dx-=b.fontSize/4:(b.dy+=b.fontSize/2,b.dx+=(a.range[1]>a.range[0]?1:-1)*b.fontSize*(0>g?.5:.25)))}}function k(a,b){var c=a._categories[Math.round(b.x)];void 0===c&&(c=""),b.text=String(c)}function l(a,b,c,d,e){"all"===a.showexponent&&Math.abs(b.x/a.dtick)<1e-6&&(e="hide"),b.text=m(b.x,a,e,d)}function m(a,b,c,d){var e=0>a,g=b._tickround,h=c||b.exponentformat||"B",i=b._tickexponent,j=b.tickformat;if(d){var k={exponentformat:b.exponentformat,dtick:"none"===b.showexponent?b.dtick:u(a)?Math.abs(a)||1:1,range:"none"===b.showexponent?b.range:[0,a||1]};f(k),g=(Number(k._tickround)||0)+4,i=k._tickexponent,b.hoverformat&&(j=b.hoverformat)}if(j)return t.format(j)(a).replace(/-/g,"â");var l=Math.pow(10,-g)/2;if("none"===h&&(i=0),a=Math.abs(a),l>a)a="0",e=!1;else{if(a+=l,i&&(a*=Math.pow(10,-i),g+=i),0===g)a=String(Math.floor(a));else if(0>g){a=String(Math.round(a)),a=a.substr(0,a.length+g);for(var m=g;0>m;m++)a+="0"}else{a=String(a);var o=a.indexOf(".")+1;o&&(a=a.substr(0,o+g).replace(/\.?0+$/,""))}a=n(a,b._td._fullLayout.separators)}if(i&&"hide"!==h){var p;p=0>i?"â"+-i:"power"!==h?"+"+i:String(i),"e"===h||("SI"===h||"B"===h)&&(i>12||-15>i)?a+="e"+p:"E"===h?a+="E"+p:"power"===h?a+="×10<sup>"+p+"</sup>":"B"===h&&9===i?a+="B":"SI"!==h&&"B"!==h||(a+=N[i/3+5])}return e?"â"+a:a}function n(a,b){var c=b.charAt(0),d=b.charAt(1),e=a.split("."),f=e[0],g=e.length>1?c+e[1]:"";if(d&&(e.length>1||f.length>4))for(;O.test(f);)f=f.replace(O,"$1"+d+"$2");return f+g}function o(a,b){var c,d,e=[];for(c=0;c<b.length;c++){var f=[],g=a._fullData[b[c]].xaxis,h=a._fullData[b[c]].yaxis;if(g&&h){for(d=0;d<e.length;d++)-1===e[d].x.indexOf(g)&&-1===e[d].y.indexOf(h)||f.push(d);if(f.length){var i,j=e[f[0]];if(f.length>1)for(d=1;d<f.length;d++)i=e[f[d]],p(j.x,i.x),p(j.y,i.y);p(j.x,[g]),p(j.y,[h])}else e.push({x:[g],y:[h]})}}return e}function p(a,b){for(var c=0;c<b.length;c++)-1===a.indexOf(b[c])&&a.push(b[c])}function q(a,b,c){var d,e,f=[],g=[],h=a.layout;for(d=0;d<b.length;d++)f.push(x.getFromId(a,b[d]));for(d=0;d<c.length;d++)g.push(x.getFromId(a,c[d]));var i=Object.keys(f[0]),j=["anchor","domain","overlaying","position","side","tickangle"],k=["linear","log"];for(d=0;d<i.length;d++){var l=i[d],m=f[0][l],n=g[0][l],o=!0,p=!1,q=!1;if("_"!==l.charAt(0)&&"function"!=typeof m&&-1===j.indexOf(l)){for(e=1;e<f.length&&o;e++){var s=f[e][l];"type"===l&&-1!==k.indexOf(m)&&-1!==k.indexOf(s)&&m!==s?p=!0:s!==m&&(o=!1)}for(e=1;e<g.length&&o;e++){var t=g[e][l];"type"===l&&-1!==k.indexOf(n)&&-1!==k.indexOf(t)&&n!==t?q=!0:g[e][l]!==n&&(o=!1)}o&&(p&&(h[f[0]._name].type="linear"),q&&(h[g[0]._name].type="linear"),r(h,l,f,g))}}for(d=0;d<a._fullLayout.annotations.length;d++){var u=a._fullLayout.annotations[d];-1!==b.indexOf(u.xref)&&-1!==c.indexOf(u.yref)&&v.Lib.swapAttrs(h.annotations[d],["?"])}}function r(a,b,c,d){var e,f=v.Lib.nestedProperty,g=f(a[c[0]._name],b).get(),h=f(a[d[0]._name],b).get();for("title"===b&&("Click to enter X axis title"===g&&(g="Click to enter Y axis title"),"Click to enter Y axis title"===h&&(h="Click to enter X axis title")),e=0;e<c.length;e++)f(a,c[e]._name+"."+b).set(h);for(e=0;e<d.length;e++)f(a,d[e]._name+"."+b).set(g)}function s(a,b){return(a%b+b)%b}var t=a("d3"),u=a("fast-isnumeric"),v=a("../../plotly"),w=a("../../components/titles"),x=b.exports={};x.layoutAttributes=a("./layout_attributes"),x.supplyLayoutDefaults=a("./layout_defaults"),x.setConvert=a("./set_convert");var y=a("./axis_ids");x.id2name=y.id2name,x.cleanId=y.cleanId,x.list=y.list,x.listIds=y.listIds,x.getFromId=y.getFromId,x.getFromTrace=y.getFromTrace,x.coerceRef=function(a,b,c,d){var e=c._fullLayout._hasGL2D?[]:x.listIds(c,d),f=d+"ref",g={};return g[f]={valType:"enumerated",values:e.concat(["paper"]),dflt:e[0]||"paper"},v.Lib.coerce(a,b,g,f)},x.clearTypes=function(a,b){Array.isArray(b)&&b.length||(b=a._fullData.map(function(a,b){return b})),b.forEach(function(b){var c=a.data[b];delete(x.getFromId(a,c.xaxis)||{}).type,delete(x.getFromId(a,c.yaxis)||{}).type})},x.counterLetter=function(a){var b=a.charAt(0);return"x"===b?"y":"y"===b?"x":void 0},x.minDtick=function(a,b,c,d){-1===["log","category"].indexOf(a.type)&&d?null===a._minDtick?(a._minDtick=b,a._forceTick0=c):a._minDtick&&((a._minDtick/b+1e-6)%1<2e-6&&((c-a._forceTick0)/b%1+1.000001)%1<2e-6?(a._minDtick=b,a._forceTick0=c):((b/a._minDtick+1e-6)%1>2e-6||((c-a._forceTick0)/a._minDtick%1+1.000001)%1>2e-6)&&(a._minDtick=0)):a._minDtick=0},x.doAutoRange=function(a){if(a._length||a.setScale(),a.autorange&&a._min&&a._max&&a._min.length&&a._max.length){var b,c=a._min[0].val,d=a._max[0].val;for(b=1;b<a._min.length&&c===d;b++)c=Math.min(c,a._min[b].val);for(b=1;b<a._max.length&&c===d;b++)d=Math.max(d,a._max[b].val);var e,f,g,h,i,j,k,l=0,m=a.range&&a.range[1]<a.range[0];for("reversed"===a.autorange&&(m=!0,a.autorange=!0),b=0;b<a._min.length;b++)for(f=a._min[b],e=0;e<a._max.length;e++)g=a._max[e],k=g.val-f.val,j=a._length-f.pad-g.pad,k>0&&j>0&&k/j>l&&(h=f,i=g,l=k/j);c===d?a.range=m?[c+1,"normal"!==a.rangemode?0:c-1]:["normal"!==a.rangemode?0:c-1,c+1]:l&&("linear"!==a.type&&"-"!==a.type||("tozero"===a.rangemode&&h.val>=0?h={val:0,pad:0}:"nonnegative"===a.rangemode&&(h.val-l*h.pad<0&&(h={val:0,pad:0}),i.val<0&&(i={val:1,pad:0})),l=(i.val-h.val)/(a._length-h.pad-i.pad)),a.range=[h.val-l*h.pad,i.val+l*i.pad],a.range[0]===a.range[1]&&(a.range=[a.range[0]-1,a.range[0]+1]),m&&a.range.reverse());var n=a._td.layout[a._name];n||(a._td.layout[a._name]=n={}),n!==a&&(n.range=a.range.slice(),n.autorange=a.autorange)}},x.saveRangeInitial=function(a,b){for(var c=x.list(a,"",!0),d=!1,e=0;e<c.length;e++){var f=c[e],g=void 0===f._rangeInitial,h=g||!(f.range[0]===f._rangeInitial[0]&&f.range[1]===f._rangeInitial[1]);(g&&f.autorange===!1||b&&h)&&(f._rangeInitial=f.range.slice(),d=!0)}return d};var z=Number.MAX_VALUE/2;x.expand=function(a,b,c){function d(a){if(Array.isArray(a))return function(b){return Math.max(Number(a[b]||0),0)};var b=Math.max(Number(a||0),0);return function(){return b}}function e(c){function d(a){return u(a)&&Math.abs(a)<z}if(i=b[c],u(i)){if(l=t(c)+r,m=v(c)+r,o=i-x(c),p=i+w(c),"log"===a.type&&p/10>o&&(o=p/10),j=a.c2l(o),k=a.c2l(p),s&&(j=Math.min(0,j),k=Math.max(0,k)),d(j)){for(n=!0,g=0;g<a._min.length&&n;g++)h=a._min[g],h.val<=j&&h.pad>=m?n=!1:h.val>=j&&h.pad<=m&&(a._min.splice(g,1),g--);n&&a._min.push({val:j,pad:s&&0===j?0:m})}if(d(k)){for(n=!0,g=0;g<a._max.length&&n;g++)h=a._max[g],h.val>=k&&h.pad>=l?n=!1:h.val<=k&&h.pad<=l&&(a._max.splice(g,1),g--);n&&a._max.push({val:k,pad:s&&0===k?0:l})}}}if(a.autorange&&b){a._min||(a._min=[]),a._max||(a._max=[]),c||(c={}),a._m||a.setScale();var f,g,h,i,j,k,l,m,n,o,p,q=b.length,r=c.padded?.05*a._length:0,s=c.tozero&&("linear"===a.type||"-"===a.type),t=d((a._m>0?c.ppadplus:c.ppadminus)||c.ppad||0),v=d((a._m>0?c.ppadminus:c.ppadplus)||c.ppad||0),w=d(c.vpadplus||c.vpad),x=d(c.vpadminus||c.vpad);for(f=0;6>f;f++)e(f);for(f=q-1;f>5;f--)e(f)}},x.autoBin=function(a,b,c,d){function e(a){return(1+100*(a-n)/l.dtick)%100<2}var f=v.Lib.aggNums(Math.min,null,a),g=v.Lib.aggNums(Math.max,null,a);if("category"===b.type)return{start:f-.5,end:g+.5,size:1};var h;if(c)h=(g-f)/c;else{var i=v.Lib.distinctVals(a),j=Math.pow(10,Math.floor(Math.log(i.minDiff)/Math.LN10)),k=j*v.Lib.roundUp(i.minDiff/j,[.9,1.9,4.9,9.9],!0);h=Math.max(k,2*v.Lib.stdev(a)/Math.pow(a.length,d?.25:.4))}var l={type:"log"===b.type?"linear":b.type,range:[f,g]};x.autoTicks(l,h);var m,n=x.tickIncrement(x.tickFirst(l),l.dtick,"reverse");if("number"==typeof l.dtick){for(var o=0,p=0,q=0,r=0,s=0;s<a.length;s++)a[s]%1===0?q++:u(a[s])||r++,e(a[s])&&o++,e(a[s]+l.dtick/2)&&p++;var t=a.length-r;if(q===t&&"date"!==b.type)l.dtick<1?n=f-.5*l.dtick:n-=.5;else if(.1*t>p&&(o>.3*t||e(f)||e(g))){var w=l.dtick/2;n+=f>n+w?w:-w}var y=1+Math.floor((g-n)/l.dtick);m=n+y*l.dtick}else for(m=n;g>=m;)m=x.tickIncrement(m,l.dtick);return{start:n,end:m,size:l.dtick}},x.calcTicks=function(a){if("array"===a.tickmode)return d(a);if("auto"===a.tickmode||!a.dtick){var b,c=a.nticks;c||("category"===a.type?(b=a.tickfont?1.2*(a.tickfont.size||12):15,c=a._length/b):(b="y"===a._id.charAt(0)?40:80,c=v.Lib.constrain(a._length/b,4,9)+1)),x.autoTicks(a,Math.abs(a.range[1]-a.range[0])/c),a._minDtick>0&&a.dtick<2*a._minDtick&&(a.dtick=a._minDtick,a.tick0=a._forceTick0)}a.tick0||(a.tick0="date"===a.type?new Date(2e3,0,1).getTime():0),f(a),a._tmin=x.tickFirst(a);var e=a.range[1]<a.range[0],g=[],h=1.0001*a.range[1]-1e-4*a.range[0];"category"===a.type&&(h=e?Math.max(-.5,h):Math.min(a._categories.length-.5,h));for(var i=a._tmin;(e?i>=h:h>=i)&&(g.push(i),!(g.length>1e3));i=x.tickIncrement(i,a.dtick,e));a._tmax=g[g.length-1];for(var j=new Array(g.length),k=0;k<g.length;k++)j[k]=x.tickText(a,g[k]);return j};var A=[2,5,10],B=[1,2,3,6,12],C=[1,2,5,10,15,30],D=[1,2,3,7,14],E=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],F=[-.301,0,.301,.699,1];x.autoTicks=function(a,b){var c;if("date"===a.type)a.tick0=new Date(2e3,0,1).getTime(),b>157788e5?(b/=315576e5,c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick="M"+12*e(b,c,A)):b>12096e5?(b/=26298e5,a.dtick="M"+e(b,1,B)):b>432e5?(a.dtick=e(b,864e5,D),a.tick0=new Date(2e3,0,2).getTime()):b>18e5?a.dtick=e(b,36e5,B):b>3e4?a.dtick=e(b,6e4,C):b>500?a.dtick=e(b,1e3,C):(c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick=e(b,c,A));else if("log"===a.type)if(a.tick0=0,b>.7)a.dtick=Math.ceil(b);else if(Math.abs(a.range[1]-a.range[0])<1){var d=1.5*Math.abs((a.range[1]-a.range[0])/b);b=Math.abs(Math.pow(10,a.range[1])-Math.pow(10,a.range[0]))/d,c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick="L"+e(b,c,A)}else a.dtick=b>.3?"D2":"D1";else"category"===a.type?(a.tick0=0,a.dtick=Math.ceil(Math.max(b,1))):(a.tick0=0,c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick=e(b,c,A));if(0===a.dtick&&(a.dtick=1),!u(a.dtick)&&"string"!=typeof a.dtick){var f=a.dtick;throw a.dtick=1,"ax.dtick error: "+String(f)}},x.tickIncrement=function(a,b,c){var d=c?-1:1;if(u(b))return a+d*b;var e=b.charAt(0),f=d*Number(b.substr(1));if("M"===e){var g=new Date(a);return g.setMonth(g.getMonth()+f)}if("L"===e)return Math.log(Math.pow(10,a)+f)/Math.LN10;if("D"===e){var h="D2"===b?F:E,i=a+.01*d,j=v.Lib.roundUp(s(i,1),h,c);return Math.floor(i)+Math.log(t.round(Math.pow(10,j),1))/Math.LN10}throw"unrecognized dtick "+String(b)},x.tickFirst=function(a){var b=a.range[1]<a.range[0],c=b?Math.floor:Math.ceil,d=1.0001*a.range[0]-1e-4*a.range[1],e=a.dtick,f=a.tick0;if(u(e)){var g=c((d-f)/e)*e+f;return"category"===a.type&&(g=v.Lib.constrain(g,0,a._categories.length-1)),g}var h,i,j,k=e.charAt(0),l=Number(e.substr(1));if("M"===k){for(h=new Date(f),d=new Date(d),i=12*(d.getFullYear()-h.getFullYear())+d.getMonth()-h.getMonth(),j=h.setMonth(h.getMonth()+(Math.round(i/l)+(b?1:-1))*l);b?j>d:d>j;)j=x.tickIncrement(j,e,b);return j}if("L"===k)return Math.log(c((Math.pow(10,d)-f)/l)*l+f)/Math.LN10;if("D"===k){var m="D2"===e?F:E,n=v.Lib.roundUp(s(d,1),m,b);return Math.floor(d)+Math.log(t.round(Math.pow(10,n),1))/Math.LN10}throw"unrecognized dtick "+String(e)};var G=t.time.format("%Y"),H=t.time.format("%b %Y"),I=t.time.format("%b %-d"),J=t.time.format("%b %-d %Hh"),K=t.time.format("%H:%M"),L=t.time.format(":%S"),M=/%(\d?)f/g;x.tickText=function(a,b,c){function d(d){var e;return void 0===d?!0:c?"none"===d:(e={first:a._tmin,last:a._tmax}[d],"all"!==d&&b!==e)}var e,f,g=h(a,b),m="array"===a.tickmode,n=c||m;if(m&&Array.isArray(a.ticktext)){var o=Math.abs(a.range[1]-a.range[0])/1e4;for(f=0;f<a.ticktext.length&&!(Math.abs(b-a.d2l(a.tickvals[f]))<o);f++);if(f<a.ticktext.length)return g.text=String(a.ticktext[f]),g}return e="none"!==a.exponentformat&&d(a.showexponent)?"hide":"","date"===a.type?i(a,g,c,n):"log"===a.type?j(a,g,c,n,e):"category"===a.type?k(a,g):l(a,g,c,n,e),a.tickprefix&&!d(a.showtickprefix)&&(g.text=a.tickprefix+g.text),a.ticksuffix&&!d(a.showticksuffix)&&(g.text+=a.ticksuffix),g};var N=["f","p","n","μ","m","","k","M","G","T"],O=/(\d+)(\d{3})/;x.subplotMatch=/^x([0-9]*)y([0-9]*)$/,x.getSubplots=function(a,b){function c(a,b){return-1!==a.indexOf(b._id)}var d,e,f,g=[],h=a.data||[];for(d=0;d<h.length;d++){var i=h[d];if(i.visible!==!1&&"legendonly"!==i.visible&&(v.Plots.traceIs(i,"cartesian")||v.Plots.traceIs(i,"gl2d"))){var j=i.xaxis||"x",k=i.yaxis||"y";f=j+k,-1===g.indexOf(f)&&g.push(f)}}var l=x.list(a,"",!0);for(d=0;d<l.length;d++){var m=l[d],n=m._id.charAt(0),o="free"===m.anchor?"x"===n?"y":"x":m.anchor,p=x.getFromId(a,o),q=!1;for(e=0;e<g.length;e++)if(c(g[e],m)){q=!0;break}"free"===m.anchor&&q||p&&(f="x"===n?m._id+p._id:p._id+m._id,-1===g.indexOf(f)&&g.push(f))}var r=x.subplotMatch,s=[];for(d=0;d<g.length;d++)f=g[d],r.test(f)&&s.push(f);return s.sort(function(a,b){var c=a.match(r),d=b.match(r);return c[1]===d[1]?+(c[2]||1)-(d[2]||1):+(c[1]||0)-(d[1]||0)}),b?x.findSubplotsWithAxis(s,b):s},x.findSubplotsWithAxis=function(a,b){for(var c=new RegExp("x"===b._id.charAt(0)?"^"+b._id+"y":b._id+"$"),d=[],e=0;e<a.length;e++){var f=a[e];c.test(f)&&d.push(f)}return d},x.makeClipPaths=function(a){var b,c,d=a._fullLayout,e=d._defs,f={_offset:0,_length:d.width,_id:""},g={_offset:0,_length:d.height,_id:""},h=x.list(a,"x",!0),i=x.list(a,"y",!0),j=[];for(b=0;b<h.length;b++)for(j.push({x:h[b],y:g}),c=0;c<i.length;c++)0===b&&j.push({x:f,y:i[c]}),j.push({x:h[b],y:i[c]});var k=e.selectAll("g.clips").data([0]);k.enter().append("g").classed("clips",!0);var l=k.selectAll(".axesclip").data(j,function(a){return a.x._id+a.y._id});l.enter().append("clipPath").classed("axesclip",!0).attr("id",function(a){return"clip"+d._uid+a.x._id+a.y._id}).append("rect"),l.exit().remove(),l.each(function(a){t.select(this).select("rect").attr({x:a.x._offset||0,y:a.y._offset||0,width:a.x._length||1,height:a.y._length||1})})},x.doTicks=function(a,b,c){function d(a){var b=i.l2p(a.x);return b>1&&b<i._length-1}function e(a,b){ 50 var c=a.selectAll("path."+z).data("inside"===i.ticks?J:s,y);b&&i.ticks?(c.enter().append("path").classed(z,1).classed("ticks",1).classed("crisp",1).call(v.Color.stroke,i.tickcolor).style("stroke-width",G+"px").attr("d",b),c.attr("transform",m),c.exit().remove()):c.remove()}function f(d,e){function f(a,b){a.each(function(a){var c=n(b),d=t.select(this),e=d.select(".text-math-group"),f=m(a)+(u(b)&&0!==+b?" rotate("+b+","+k(a)+","+(l(a)-a.fontSize/2)+")":"");if(e.empty()){var g=d.select("text").attr({transform:f,"text-anchor":c});g.empty()||g.selectAll("tspan.line").attr({x:g.attr("x"),y:g.attr("y")})}else{var h=v.Drawing.bBox(e.node()).width*{end:-.5,start:.5}[c];e.attr("transform",f+(h?"translate("+h+",0)":""))}})}function g(){return B.length&&Promise.all(B)}function h(){if(f(j,i.tickangle),"x"===q&&!u(i.tickangle)&&("log"!==i.type||"D"!==String(i.dtick).charAt(0))){var d=[];for(j.each(function(a){var b=t.select(this),c=b.select(".text-math-group"),e=i.l2p(a.x);c.empty()&&(c=b.select("text"));var f=v.Drawing.bBox(c.node());d.push({top:0,bottom:10,height:10,left:e-f.width/2,right:e+f.width/2+2,width:f.width+2})}),p=0;p<d.length-1;p++)if(v.Lib.bBoxIntersect(d[p],d[p+1])){A=30;break}if(A){var e=Math.abs((s[s.length-1].x-s[0].x)*i._m)/(s.length-1);2.5*x>e&&(A=90),f(j,A)}i._lastangle=A}return c||w.draw(a,b+"title"),b+" done"}var j=d.selectAll("g."+z).data(s,y);if(!i.showticklabels||!u(e))return j.remove(),void w.draw(a,b+"title");var k,l,n,o;if("x"===q){var r="bottom"===H?1:-1;k=function(a){return a.dx},o=e+(D+C)*r,l=function(a){return a.dy+o+a.fontSize*("bottom"===H?1:-.5)},n=function(a){return u(a)&&0!==a&&180!==a?0>a*r?"end":"start":"middle"}}else l=function(a){return a.dy+a.fontSize/2},k=function(a){return a.dx+e+(D+C+(90===Math.abs(i.tickangle)?a.fontSize/2:0))*("right"===H?1:-1)},n=function(a){return u(a)&&90===Math.abs(a)?"middle":"right"===H?"start":"end"};var x=0,A=0,B=[];j.enter().append("g").classed(z,1).append("text").attr("text-anchor","middle").each(function(b){var c=t.select(this),d=a._promises.length;c.call(v.Drawing.setPosition,k(b),l(b)).call(v.Drawing.font,b.font,b.fontSize,b.fontColor).text(b.text).call(v.util.convertToTspans),d=a._promises[d],d?B.push(a._promises.pop().then(function(){f(c,i.tickangle)})):f(c,i.tickangle)}),j.exit().remove(),j.each(function(a){x=Math.max(x,a.fontSize)}),f(j,i._lastangle||i.tickangle);var E=v.Lib.syncOrAsync([g,h]);return E&&E.then&&a._promises.push(E),E}function g(a,b){return a.visible!==!0||a.xaxis+a.yaxis!==b?!1:v.Plots.traceIs(a,"bar")&&a.orientation==={x:"h",y:"v"}[q]?!0:a.fill&&a.fill.charAt(a.fill.length-1)===q}function h(b,c,e){var f=b.gridlayer,h=b.zerolinelayer,j=b["hidegrid"+q]?[]:J,k="M0,0"+("x"===q?"v":"h")+c._length,l=f.selectAll("path."+A).data(i.showgrid===!1?[]:j,y);l.enter().append("path").classed(A,1).classed("crisp",1).attr("d",k).each(function(a){i.zeroline&&("linear"===i.type||"-"===i.type)&&Math.abs(a.x)<i.dtick/100&&t.select(this).remove()}),l.attr("transform",m).call(v.Color.stroke,i.gridcolor||"#ddd").style("stroke-width",E+"px"),l.exit().remove();for(var n=!1,o=0;o<a._fullData.length;o++)if(g(a._fullData[o],e)){n=!0;break}var p=i.range[0]*i.range[1]<=0&&i.zeroline&&("linear"===i.type||"-"===i.type)&&j.length&&(n||d({x:0})||!i.showline),r=h.selectAll("path."+B).data(p?[{x:0}]:[]);r.enter().append("path").classed(B,1).classed("zl",1).classed("crisp",1).attr("d",k),r.attr("transform",m).call(v.Color.stroke,i.zerolinecolor||v.Color.defaultLine).style("stroke-width",F+"px"),r.exit().remove()}var i,j=a._fullLayout,k=!1;if("object"==typeof b)i=b,b=i._id,k=!0;else if(i=x.getFromId(a,b),"redraw"===b&&j._paper.selectAll("g.subplot").each(function(a){var b=j._plots[a],c=b.x(),d=b.y();b.plot.attr("viewBox","0 0 "+c._length+" "+d._length),b.xaxislayer.selectAll("."+c._id+"tick").remove(),b.yaxislayer.selectAll("."+d._id+"tick").remove(),b.gridlayer.selectAll("path").remove(),b.zerolinelayer.selectAll("path").remove()}),!b||"redraw"===b)return v.Lib.syncOrAsync(x.list(a,"",!0).map(function(c){return function(){if(c._id){var d=x.doTicks(a,c._id);return"redraw"===b&&(c._r=c.range.slice()),d}}}));i.tickformat||(-1===["none","e","E","power","SI","B"].indexOf(i.exponentformat)&&(i.exponentformat="e"),-1===["all","first","last","none"].indexOf(i.showexponent)&&(i.showexponent="all")),i.range=[+i.range[0],+i.range[1]],i.setScale();var l,m,n,o,p,q=b.charAt(0),r=x.counterLetter(b),s=x.calcTicks(i),y=function(a){return a.text+a.x+i.mirror},z=b+"tick",A=b+"grid",B=b+"zl",C=(i.linewidth||1)/2,D=("outside"===i.ticks?i.ticklen:1)+(i.linewidth||0),E=v.Drawing.crispRound(a,i.gridwidth,1),F=v.Drawing.crispRound(a,i.zerolinewidth,E),G=v.Drawing.crispRound(a,i.tickwidth,1);if("x"===q)l=["bottom","top"],m=function(a){return"translate("+i.l2p(a.x)+",0)"},n="M0,",o="v";else{if("y"!==q)return void console.log("unrecognized doTicks axis",b);l=["left","right"],m=function(a){return"translate(0,"+i.l2p(a.x)+")"},n="M",o=",0h"}var H=i.side||l[0],I=[-1,1,H===l[1]?1:-1];"inside"!==i.ticks==("x"===q)&&(I=I.map(function(a){return-a}));var J=s.filter(d);if(k)return e(i._axislayer,n+(i._pos+C*I[2])+o+I[2]*i.ticklen),f(i._axislayer,i._pos);var K=x.getSubplots(a,i).map(function(a){var b=j._plots[a];if(j._hasCartesian){var c=b[q+"axislayer"],d=i._linepositions[a]||[],g=b[r](),k=g._id===i.anchor,m=[!1,!1,!1],s="";if("allticks"===i.mirror?m=[!0,!0,!1]:k&&("ticks"===i.mirror?m=[!0,!0,!1]:m[l.indexOf(H)]=!0),i.mirrors)for(p=0;2>p;p++){var t=i.mirrors[g._id+l[p]];"ticks"!==t&&"labels"!==t||(m[p]=!0)}return void 0!==d[2]&&(m[2]=!0),m.forEach(function(a,b){var c=d[b],e=I[b];a&&u(c)&&(s+=n+(c+C*e)+o+e*i.ticklen)}),e(c,s),h(b,g,a),f(c,d[3])}}).filter(function(a){return a&&a.then});return K.length?Promise.all(K):0},x.swap=function(a,b){for(var c=o(a,b),d=0;d<c.length;d++)q(a,c[d].x,c[d].y)}},{"../../components/titles":332,"../../plotly":366,"./axis_ids":371,"./layout_attributes":376,"./layout_defaults":377,"./set_convert":380,d3:70,"fast-isnumeric":74}],370:[function(a,b,c){"use strict";function d(a,b){if("-"===a.type){var c=a._id,d=c.charAt(0);-1!==c.indexOf("scene")&&(c=d);var i=h(b,c,d);if(i){if("histogram"===i.type&&d==={v:"y",h:"x"}[i.orientation||"v"])return void(a.type="linear");if(f(i,d)){for(var j,k=e(i),l=[],m=0;m<b.length;m++)j=b[m],n.traceIs(j,"box")&&(j[d+"axis"]||d)===c&&(void 0!==j[k]?l.push(j[k][0]):void 0!==j.name?l.push(j.name):l.push("text"));a.type=g(l)}else a.type=g(i[d]||[i[d+"0"]])}}}function e(a){return{v:"x",h:"y"}[a.orientation||"v"]}function f(a,b){var c=e(a);return n.traceIs(a,"box")&&b===c&&void 0===a[c]&&void 0===a[c+"0"]}function g(a){return j(a)?"date":k(a)?"category":i(a)?"linear":"-"}function h(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];if((e[c+"axis"]||c)===b){if(f(e,c))return e;if((e[c]||[]).length||e[c+"0"])return e}}}function i(a){if(!a)return!1;for(var b=0;b<a.length;b++)if(l(a[b]))return!0;return!1}function j(a){for(var b,c=0,d=0,e=Math.max(1,(a.length-1)/1e3),f=0;f<a.length;f+=e)b=a[Math.round(f)],m.isDateTime(b)&&(c+=1),l(b)&&(d+=1);return c>2*d}function k(a){for(var b,c=Math.max(1,(a.length-1)/1e3),d=0,e=0,f=0;f<a.length;f+=c)b=s(a[Math.round(f)]),l(b)?d++:"string"==typeof b&&""!==b&&"None"!==b&&e++;return e>2*d}var l=a("fast-isnumeric"),m=a("../../lib"),n=a("../plots"),o=a("./layout_attributes"),p=a("./tick_value_defaults"),q=a("./tick_defaults"),r=a("./set_convert"),s=a("./clean_datum"),t=a("./axis_ids");b.exports=function(a,b,c,e){var f=e.letter,g=e.font||{},h="Click to enter "+(e.title||f.toUpperCase()+" axis")+" title";e.name&&(b._name=e.name,b._id=t.name2id(e.name));var i=c("type");"-"===i&&(d(b,e.data),"-"===b.type?b.type="linear":i=a.type=b.type),r(b),c("title",h),m.coerceFont(c,"titlefont",{family:g.family,size:Math.round(1.2*g.size),color:g.color});var j=2===(a.range||[]).length&&l(a.range[0])&&l(a.range[1]),k=c("autorange",!j);k&&c("rangemode");var n=c("range",[-1,"x"===f?6:4]);n[0]===n[1]&&(b.range=[n[0]-1,n[0]+1]),m.noneOrAll(a.range,b.range,[0,1]),c("fixedrange"),p(a,b,c,i),q(a,b,c,i,e);var s=m.coerce2(a,b,o,"linecolor"),u=m.coerce2(a,b,o,"linewidth"),v=c("showline",!!s||!!u);v||(delete b.linecolor,delete b.linewidth),(v||b.ticks)&&c("mirror");var w=m.coerce2(a,b,o,"gridcolor"),x=m.coerce2(a,b,o,"gridwidth"),y=c("showgrid",e.showGrid||!!w||!!x);y||(delete b.gridcolor,delete b.gridwidth);var z=m.coerce2(a,b,o,"zerolinecolor"),A=m.coerce2(a,b,o,"zerolinewidth"),B=c("zeroline",e.showGrid||!!z||!!A);return B||(delete b.zerolinecolor,delete b.zerolinewidth),b}},{"../../lib":349,"../plots":413,"./axis_ids":371,"./clean_datum":372,"./layout_attributes":376,"./set_convert":380,"./tick_defaults":381,"./tick_value_defaults":382,"fast-isnumeric":74}],371:[function(a,b,c){"use strict";function d(a,b,c){function d(a,c){for(var d=Object.keys(a),e=/^[xyz]axis[0-9]*/,f=[],g=0;g<d.length;g++){var h=d[g];b&&h.charAt(0)!==b||e.test(h)&&f.push(c+h)}return f.sort()}var f=a._fullLayout;if(!f)return[];var g=d(f,"");if(c)return g;for(var h=e.getSubplotIds(f,"gl3d")||[],i=0;i<h.length;i++){var j=h[i];g=g.concat(d(f[j],j+"."))}return g}var e=a("../plots"),f=a("../../lib"),g=a("./constants");c.id2name=function(a){if("string"==typeof a&&a.match(g.AX_ID_PATTERN)){var b=a.substr(1);return"1"===b&&(b=""),a.charAt(0)+"axis"+b}},c.name2id=function(a){if(a.match(g.AX_NAME_PATTERN)){var b=a.substr(5);return"1"===b&&(b=""),a.charAt(0)+b}},c.cleanId=function(a,b){if(a.match(g.AX_ID_PATTERN)&&(!b||a.charAt(0)===b)){var c=a.substr(1).replace(/^0+/,"");return"1"===c&&(c=""),a.charAt(0)+c}},c.list=function(a,b,c){return d(a,b,c).map(function(b){return f.nestedProperty(a._fullLayout,b).get()})},c.listIds=function(a,b){return d(a,b,!0).map(c.name2id)},c.getFromId=function(a,b,d){var e=a._fullLayout;return"x"===d?b=b.replace(/y[0-9]*/,""):"y"===d&&(b=b.replace(/x[0-9]*/,"")),e[c.id2name(b)]},c.getFromTrace=function(a,b,d){var f=a._fullLayout,g=null;if(e.traceIs(b,"gl3d")){var h=b.scene;"scene"===h.substr(0,5)&&(g=f[h][d+"axis"])}else g=c.getFromId(a,b[d+"axis"]||d);return g}},{"../../lib":349,"../plots":413,"./constants":373}],372:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib");b.exports=function(a){try{if("object"==typeof a&&null!==a&&a.getTime)return e.ms2DateTime(a);if("string"!=typeof a&&!d(a))return"";a=a.toString().replace(/['"%,$# ]/g,"")}catch(b){console.log(b,a)}return a}},{"../../lib":349,"fast-isnumeric":74}],373:[function(a,b,c){"use strict";b.exports={BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:600,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:100,BENDPX:1.5}},{}],374:[function(a,b,c){"use strict";function d(a,b){for(var c=[],d=a.length;d>0;d--)c.push(b);return c}function e(a,b){for(var c=[],d=0;d<a.length;d++)c.push(a[d].p2c(b));return c}function f(a,b){return function(c){var d=a(c),e=b(c);return Math.sqrt(d*d+e*e)}}function g(a,b,c){if("pie"===c)return void a.emit("plotly_hover",{points:[b]});c||(c="xy");var f=a._fullLayout,g=f._plots[c],n=[c].concat(g.overlays.map(function(a){return a.id})),o=n.map(function(b){return x.Axes.getFromId(a,b,"x")}),p=n.map(function(b){return x.Axes.getFromId(a,b,"y")}),q=b.hovermode||f.hovermode;if(-1===["x","y","closest"].indexOf(q)||!a.calcdata||a.querySelector(".zoombox")||a._dragging)return m(a,b);var r,s,t,u,v,y,A,C,D,E,F,G,H=[],I=[];if(Array.isArray(b))for(q="array",t=0;t<b.length;t++)v=a.calcdata[b[t].curveNumber||0],"none"!==v[0].trace.hoverinfo&&I.push(v);else{for(u=0;u<a.calcdata.length;u++)v=a.calcdata[u],y=v[0].trace,"none"!==y.hoverinfo&&-1!==n.indexOf(y.xaxis+y.yaxis)&&I.push(v);var J,K;if(b.target&&"clientX"in b&&"clientY"in b){if(z.triggerHandler(a,"plotly_beforehover",b)===!1)return;var L=b.target.getBoundingClientRect();if(J=b.clientX-L.left,K=b.clientY-L.top,0>J||J>L.width||0>K||K>L.height)return m(a,b)}else J="xpx"in b?b.xpx:o[0]._length/2,K="ypx"in b?b.ypx:p[0]._length/2;if(r="xval"in b?d(n,b.xval):e(o,J),s="yval"in b?d(n,b.yval):e(p,K),!w(r[0])||!w(s[0]))return console.log("Plotly.Fx.hover failed",b,a),m(a,b)}var M=1/0;for(u=0;u<I.length;u++)if(v=I[u],v&&v[0]&&v[0].trace&&v[0].trace.visible===!0){if(y=v[0].trace,A=n.indexOf(y.xaxis+y.yaxis),C=q,F={cd:v,trace:y,xa:o[A],ya:p[A],name:a.data.length>1||-1!==y.hoverinfo.indexOf("name")?y.name:void 0,index:!1,distance:Math.min(M,B.MAXDIST),color:x.Color.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},G=H.length,"array"===C){var N=b[u];"pointNumber"in N?(F.index=N.pointNumber,C="closest"):(C="","xval"in N&&(D=N.xval,C="x"),"yval"in N&&(E=N.yval,C=C?"closest":"y"))}else D=r[A],E=s[A];if(y._module&&y._module.hoverPoints){var O=y._module.hoverPoints(F,D,E,C);if(O)for(var P,Q=0;Q<O.length;Q++)P=O[Q],w(P.x0)&&w(P.y0)&&H.push(h(P,q))}else console.log("unrecognized trace type in hover",y);"closest"===q&&H.length>G&&(H.splice(0,G),M=H[0].distance)}if(0===H.length)return m(a,b);var R="y"===q&&I.length>1;H.sort(function(a,b){return a.distance-b.distance});var S={hovermode:q,rotateLabels:R,bgColor:x.Color.combine(f.plot_bgcolor,f.paper_bgcolor),container:f._hoverlayer,outerContainer:f._paperdiv},T=i(H,S);j(H,R?o[0]:p[0]),k(T,R);var U=a._hoverdata,V=[];for(t=0;t<H.length;t++){var W=H[t],X={data:W.trace._input,fullData:W.trace,curveNumber:W.trace.index,pointNumber:W.index,x:W.xVal,y:W.yVal,xaxis:W.xa,yaxis:W.ya};void 0!==W.zLabelVal&&(X.z=W.zLabelVal),V.push(X)}a._hoverdata=V,l(a,b,U)&&(U&&a.emit("plotly_unhover",{points:U}),a.emit("plotly_hover",{points:a._hoverdata,xaxes:o,yaxes:p,xvals:r,yvals:s}))}function h(a,b){a.posref="y"===b?(a.x0+a.x1)/2:(a.y0+a.y1)/2,a.x0=x.Lib.constrain(a.x0,0,a.xa._length),a.x1=x.Lib.constrain(a.x1,0,a.xa._length),a.y0=x.Lib.constrain(a.y0,0,a.ya._length),a.y1=x.Lib.constrain(a.y1,0,a.ya._length);var c;if(void 0!==a.xLabelVal){c="log"===a.xa.type&&a.xLabelVal<=0;var d=x.Axes.tickText(a.xa,a.xa.c2l(c?-a.xLabelVal:a.xLabelVal),"hover");c?0===a.xLabelVal?a.xLabel="0":a.xLabel="-"+d.text:a.xLabel=d.text,a.xVal=a.xa.c2d(a.xLabelVal)}if(void 0!==a.yLabelVal){c="log"===a.ya.type&&a.yLabelVal<=0;var e=x.Axes.tickText(a.ya,a.ya.c2l(c?-a.yLabelVal:a.yLabelVal),"hover");c?0===a.yLabelVal?a.yLabel="0":a.yLabel="-"+e.text:a.yLabel=e.text,a.yVal=a.ya.c2d(a.yLabelVal)}if(void 0!==a.zLabelVal&&(a.zLabel=String(a.zLabelVal)),void 0!==a.xerr){var f=x.Axes.tickText(a.xa,a.xa.c2l(a.xerr),"hover").text;void 0!==a.xerrneg?a.xLabel+=" +"+f+" / -"+x.Axes.tickText(a.xa,a.xa.c2l(a.xerrneg),"hover").text:a.xLabel+=" ± "+f,"x"===b&&(a.distance+=1)}if(void 0!==a.yerr){var g=x.Axes.tickText(a.ya,a.ya.c2l(a.yerr),"hover").text;void 0!==a.yerrneg?a.yLabel+=" +"+g+" / -"+x.Axes.tickText(a.ya,a.ya.c2l(a.yerrneg),"hover").text:a.yLabel+=" ± "+g,"y"===b&&(a.distance+=1)}var h=a.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(a.xLabel=void 0),-1===h.indexOf("y")&&(a.yLabel=void 0),-1===h.indexOf("z")&&(a.zLabel=void 0),-1===h.indexOf("text")&&(a.text=void 0),-1===h.indexOf("name")&&(a.name=void 0)),a}function i(a,b){var c,d,e=b.hovermode,f=b.rotateLabels,g=b.bgColor,h=b.container,i=b.outerContainer,j=a[0],k=j.xa,l=j.ya,m="y"===e?"yLabel":"xLabel",n=j[m],o=(String(n)||"").split(" ")[0],p=i.node().getBoundingClientRect(),q=p.top,r=p.width,s=p.height,t=j.distance<=B.MAXDIST&&("x"===e||"y"===e);for(c=0;c<a.length;c++){d=a[c].trace.hoverinfo;var w=d.split("+");if(-1===w.indexOf("all")&&-1===w.indexOf(e)){t=!1;break}}var y=h.selectAll("g.axistext").data(t?[0]:[]);y.enter().append("g").classed("axistext",!0),y.exit().remove(),y.each(function(){var b=u.select(this),c=b.selectAll("path").data([0]),d=b.selectAll("text").data([0]);c.enter().append("path").style({fill:x.Color.defaultLine,"stroke-width":"1px",stroke:x.Color.background}),d.enter().append("text").call(x.Drawing.font,L,K,x.Color.background).attr("data-notex",1),d.text(n).call(x.util.convertToTspans).call(x.Drawing.setPosition,0,0).selectAll("tspan.line").call(x.Drawing.setPosition,0,0),b.attr("transform","");var f=d.node().getBoundingClientRect();if("x"===e){d.attr("text-anchor","middle").call(x.Drawing.setPosition,0,"top"===k.side?q-f.bottom-I-J:q-f.top+I+J).selectAll("tspan.line").attr({x:d.attr("x"),y:d.attr("y")});var g="top"===k.side?"-":"";c.attr("d","M0,0L"+I+","+g+I+"H"+(J+f.width/2)+"v"+g+(2*J+f.height)+"H-"+(J+f.width/2)+"V"+g+I+"H-"+I+"Z"),b.attr("transform","translate("+(k._offset+(j.x0+j.x1)/2)+","+(l._offset+("top"===k.side?0:l._length))+")")}else{d.attr("text-anchor","right"===l.side?"start":"end").call(x.Drawing.setPosition,("right"===l.side?1:-1)*(J+I),q-f.top-f.height/2).selectAll("tspan.line").attr({x:d.attr("x"),y:d.attr("y")});var h="right"===l.side?"":"-";c.attr("d","M0,0L"+h+I+","+I+"V"+(J+f.height/2)+"h"+h+(2*J+f.width)+"V-"+(J+f.height/2)+"H"+h+I+"V-"+I+"Z"),b.attr("transform","translate("+(k._offset+("right"===l.side?k._length:0))+","+(l._offset+(j.y0+j.y1)/2)+")")}a=a.filter(function(a){return void 0!==a.zLabelVal||(a[m]||"").split(" ")[0]===o})});var z=h.selectAll("g.hovertext").data(a,function(a){return[a.trace.index,a.index,a.x0,a.y0,a.name,a.attr||""].join(",")});return z.enter().append("g").classed("hovertext",!0).each(function(){var a=u.select(this);a.append("rect").call(x.Color.fill,x.Color.addOpacity(g,.8)),a.append("text").classed("name",!0).call(x.Drawing.font,L,K),a.append("path").style("stroke-width","1px"),a.append("text").classed("nums",!0).call(x.Drawing.font,L,K)}),z.exit().remove(),z.each(function(a){var b=u.select(this).attr("transform",""),c="",d="",h=x.Color.opacity(a.color)?a.color:x.Color.defaultLine,i=x.Color.combine(h,g),j=v(i).getBrightness()>128?"#000":x.Color.background;if(a.name&&void 0===a.zLabelVal){var m=document.createElement("p");m.innerHTML=a.name,c=m.textContent||"",c.length>15&&(c=c.substr(0,12)+"...")}void 0!==a.zLabel?(void 0!==a.xLabel&&(d+="x: "+a.xLabel+"<br>"),void 0!==a.yLabel&&(d+="y: "+a.yLabel+"<br>"),d+=(d?"z: ":"")+a.zLabel):t&&a[e+"Label"]===n?d=a[("x"===e?"y":"x")+"Label"]||"":void 0===a.xLabel?void 0!==a.yLabel&&(d=a.yLabel):d=void 0===a.yLabel?a.xLabel:"("+a.xLabel+", "+a.yLabel+")",a.text&&!Array.isArray(a.text)&&(d+=(d?"<br>":"")+a.text),""===d&&(""===c&&b.remove(),d=c);var o=b.select("text.nums").style("fill",j).call(x.Drawing.setPosition,0,0).text(d).attr("data-notex",1).call(x.util.convertToTspans);o.selectAll("tspan.line").call(x.Drawing.setPosition,0,0);var p=b.select("text.name"),w=0;c&&c!==d?(p.style("fill",i).text(c).call(x.Drawing.setPosition,0,0).attr("data-notex",1).call(x.util.convertToTspans),p.selectAll("tspan.line").call(x.Drawing.setPosition,0,0),w=p.node().getBoundingClientRect().width+2*J):(p.remove(),b.select("rect").remove()),b.select("path").style({fill:i,stroke:j});var y,z,A=o.node().getBoundingClientRect(),B=k._offset+(a.x0+a.x1)/2,C=l._offset+(a.y0+a.y1)/2,E=Math.abs(a.x1-a.x0),F=Math.abs(a.y1-a.y0),G=A.width+I+J+w;a.ty0=q-A.top,a.bx=A.width+2*J,a.by=A.height+2*J,a.anchor="start",a.txwidth=A.width,a.tx2width=w,a.offset=0,f?(a.pos=B,y=s>=C+F/2+G,z=C-F/2-G>=0,"top"!==a.idealAlign&&y||!z?y?(C+=F/2,a.anchor="start"):a.anchor="middle":(C-=F/2,a.anchor="end")):(a.pos=C,y=r>=B+E/2+G,z=B-E/2-G>=0,"left"!==a.idealAlign&&y||!z?y?(B+=E/2,a.anchor="start"):a.anchor="middle":(B-=E/2,a.anchor="end")),o.attr("text-anchor",a.anchor),w&&p.attr("text-anchor",a.anchor),b.attr("transform","translate("+B+","+C+")"+(f?"rotate("+D+")":""))}),z}function j(a,b){function c(a){var b=a[0],c=a[a.length-1];if(e=l-b.pos-b.dp+b.size,f=c.pos+c.dp+c.size-m,e>.01){for(h=a.length-1;h>=0;h--)a[h].dp+=e;d=!1}if(!(.01>f)){if(-.01>e){for(h=a.length-1;h>=0;h--)a[h].dp-=f;d=!1}if(d){var j=0;for(g=0;g<a.length;g++)i=a[g],i.pos+i.dp+i.size>m&&j++;for(g=a.length-1;g>=0&&!(0>=j);g--)i=a[g],i.pos>m-1&&(i.del=!0,j--);for(g=0;g<a.length&&!(0>=j);g++)if(i=a[g],i.pos<l+1)for(i.del=!0,j--,f=2*i.size,h=a.length-1;h>=0;h--)a[h].dp-=f;for(g=a.length-1;g>=0&&!(0>=j);g--)i=a[g],i.pos+i.dp+i.size>m&&(i.del=!0,j--)}}}for(var d,e,f,g,h,i,j,k=0,l=b._offset,m=b._offset+b._length,n=a.map(function(a,c){return[{i:c,dp:0,pos:a.pos,posref:a.posref,size:a.by*("x"===b._id.charAt(0)?F:1)/2}]}).sort(function(a,b){return a[0].posref-b[0].posref});!d&&k<=a.length;){for(k++,d=!0,g=0;g<n.length-1;){var o=n[g],p=n[g+1],q=o[o.length-1],r=p[0];if(e=q.pos+q.dp+q.size-r.pos-r.dp+r.size,e>.01){for(h=p.length-1;h>=0;h--)p[h].dp+=e;for(o.push.apply(o,p),n.splice(g+1,1),j=0,h=o.length-1;h>=0;h--)j+=o[h].dp;for(f=j/o.length,h=o.length-1;h>=0;h--)o[h].dp-=f;d=!1}else g++}n.forEach(c)}for(g=n.length-1;g>=0;g--){var s=n[g];for(h=s.length-1;h>=0;h--){var t=s[h],u=a[t.i];u.offset=t.dp,u.del=t.del}}}function k(a,b){a.each(function(a){var c=u.select(this);if(a.del)return void c.remove();var d="end"===a.anchor?-1:1,e=c.select("text.nums"),f={start:1,end:-1,middle:0}[a.anchor],g=f*(I+J),h=g+f*(a.txwidth+J),i=0,j=a.offset;"middle"===a.anchor&&(g-=a.tx2width/2,h-=a.tx2width/2),b&&(j*=-H,i=a.offset*G),c.select("path").attr("d","middle"===a.anchor?"M-"+a.bx/2+",-"+a.by/2+"h"+a.bx+"v"+a.by+"h-"+a.bx+"Z":"M0,0L"+(d*I+i)+","+(I+j)+"v"+(a.by/2-I)+"h"+d*a.bx+"v-"+a.by+"H"+(d*I+i)+"V"+(j-I)+"Z"),e.call(x.Drawing.setPosition,g+i,j+a.ty0-a.by/2+J).selectAll("tspan.line").attr({x:e.attr("x"),y:e.attr("y")}),a.tx2width&&(c.select("text.name, text.name tspan.line").call(x.Drawing.setPosition,h+f*J+i,j+a.ty0-a.by/2+J),c.select("rect").call(x.Drawing.setRect,h+(f-1)*a.tx2width/2+i,j-a.by/2-1,a.tx2width,a.by+2))})}function l(a,b,c){if(!b.target)return!1;if(!c||c.length!==a._hoverdata.length)return!0;for(var d=c.length-1;d>=0;d--){var e=c[d],f=a._hoverdata[d];if(e.curveNumber!==f.curveNumber||String(e.pointNumber)!==String(f.pointNumber))return!0}return!1}function m(a,b){var c=a._fullLayout;b||(b={}),b.target&&z.triggerHandler(a,"plotly_beforehover",b)===!1||(c._hoverlayer.selectAll("g").remove(),b.target&&a._hoverdata&&a.emit("plotly_unhover",{points:a._hoverdata}),a._hoverdata=void 0)}function n(a,b){return a?"nsew"===a?"pan"===b?"move":"crosshair":a.toLowerCase()+"-resize":"pointer"}function o(a,b,c,d,e,f,g,h){function i(a,b){for(F=0;F<a.length;F++)if(!a[F].fixedrange)return b;return""}function j(a){a[0]=Number(a[0]),a[1]=Number(a[1])}function k(c,d,e){var f=X.getBoundingClientRect();for(Z=d-f.left,$=e-f.top,_={l:Z,r:Z,w:0,t:$,b:$,h:0},aa=a._hmpixcount?a._hmlumcount/a._hmpixcount:v(a._fullLayout.plot_bgcolor).getLuminance(),ba=ba="M0,0H"+N+"V"+O+"H0V0",ca=!1,da="xy",ea=b.plot.append("path").attr("class","zoombox").style({fill:aa>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ba+"Z"),fa=b.plot.append("path").attr("class","zoombox-corners").style({fill:x.Color.background,stroke:x.Color.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),l(),F=0;F<R.length;F++)j(R[F].range)}function l(){b.plot.selectAll(".select-outline").remove()}function m(a,b){var c=Math.max(0,Math.min(N,a+Z)),d=Math.max(0,Math.min(O,b+$)),e=Math.abs(c-Z),f=Math.abs(d-$),g=Math.floor(Math.min(f,e,Q)/2);_.l=Math.min(Z,c),_.r=Math.max(Z,c),_.t=Math.min($,d),_.b=Math.max($,d),!T||f<Math.min(Math.max(.6*e,P),Q)?P>e?(da="",_.r=_.l,_.t=_.b,fa.attr("d","M0,0Z")):(_.t=0,_.b=O,da="x",fa.attr("d","M"+(_.l-.5)+","+($-Q-.5)+"h-3v"+(2*Q+1)+"h3ZM"+(_.r+.5)+","+($-Q-.5)+"h3v"+(2*Q+1)+"h-3Z")):!S||e<Math.min(.6*f,Q)?(_.l=0,_.r=N,da="y",fa.attr("d","M"+(Z-Q-.5)+","+(_.t-.5)+"v-3h"+(2*Q+1)+"v3ZM"+(Z-Q-.5)+","+(_.b+.5)+"v3h"+(2*Q+1)+"v-3Z")):(da="xy",fa.attr("d","M"+(_.l-3.5)+","+(_.t-.5+g)+"h3v"+-g+"h"+g+"v-3h-"+(g+3)+"ZM"+(_.r+3.5)+","+(_.t-.5+g)+"h-3v"+-g+"h"+-g+"v-3h"+(g+3)+"ZM"+(_.r+3.5)+","+(_.b+.5-g)+"h-3v"+g+"h"+-g+"v3h"+(g+3)+"ZM"+(_.l-3.5)+","+(_.b+.5-g)+"h3v"+g+"h"+g+"v3h-"+(g+3)+"Z")),_.w=_.r-_.l,_.h=_.b-_.t,ea.attr("d",ba+"M"+_.l+","+_.t+"v"+_.h+"h"+_.w+"v-"+_.h+"h-"+_.w+"Z"),ca||(ea.transition().style("fill",aa>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),fa.transition().style("opacity",1).duration(200),ca=!0)}function o(a,b,c){var d,e,f;for(d=0;d<a.length;d++)e=a[d],e.fixedrange||(f=e.range,e.range=[f[0]+(f[1]-f[0])*b,f[0]+(f[1]-f[0])*c])}function r(b,c){return Math.min(_.h,_.w)<2*P?(2===c?z():q(a),s(a)):("xy"!==da&&"x"!==da||o(K,_.l/N,_.r/N),"xy"!==da&&"y"!==da||o(L,(O-_.b)/O,(O-_.t)/O),s(a),D(da),void(M&&a.data&&a._context.showTips&&(x.Lib.notifier("Double-click to<br>zoom back out","long"),M=!1)))}function t(b,c){var d=1===(g+h).length;if(b)D();else if(2!==c||d)if(1===c&&d){var e=g?L[0]:K[0],f="s"===g||"w"===h?0:1,i=e._name+".range["+f+"]",j=p(e,f),k="left",l="middle";if(e.fixedrange)return;g?(l="n"===g?"top":"bottom","right"===e.side&&(k="right")):"e"===h&&(k="right"),W.call(x.util.makeEditable,null,{immediate:!0,background:I.paper_bgcolor,text:String(j),fill:e.tickfont?e.tickfont.color:"#444",horizontalAlign:k,verticalAlign:l}).on("edit",function(b){var c="category"===e.type?e.c2l(b):e.d2l(b);void 0!==c&&x.relayout(a,i,c)})}else q(a);else z()}function u(b){function c(a,b,c){if(!a.fixedrange){j(a.range);var d=a.range,e=d[0]+(d[1]-d[0])*b;a.range=[e+(d[0]-e)*c,e+(d[1]-e)*c]}}if(a._context.scrollZoom||I._enablescrollzoom){var d=a.querySelector(".plotly");if(!(d.scrollHeight-d.clientHeight>10||d.scrollWidth-d.clientWidth>10)){clearTimeout(ha);var e=-b.deltaY;if(isFinite(e)||(e=b.wheelDelta/10),!isFinite(e))return void console.log("did not find wheel motion attributes",b);var f,i=Math.exp(-Math.min(Math.max(e,-20),20)/100),k=ja.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(b.clientX-k.left)/k.width,m=ga[0]+ga[2]*l,n=(k.bottom-b.clientY)/k.height,o=ga[1]+ga[3]*(1-n);if(h){for(f=0;f<K.length;f++)c(K[f],l,i);ga[2]*=i,ga[0]=m-ga[2]*l}if(g){for(f=0;f<L.length;f++)c(L[f],n,i);ga[3]*=i,ga[1]=o-ga[3]*(1-n)}return E(ga),y(g,h),ha=setTimeout(function(){ga=[0,0,N,O],D()},ia),x.Lib.pauseEvent(b)}}}function w(a,b){function c(a,b){for(var c=0;c<a.length;c++){var d=a[c];d.fixedrange||(d.range=[d._r[0]-b/d._m,d._r[1]-b/d._m])}}function d(a){return 1-(a>=0?Math.min(a,.9):1/(1/Math.max(a,-.3)+3.222))}function e(a,b,c){for(var e=1-b,f=0,g=0;g<a.length;g++){var h=a[g];h.fixedrange||(f=g,h.range[b]=h._r[e]+(h._r[b]-h._r[e])/d(c/h._length))}return a[f]._length*(a[f]._r[b]-a[f].range[b])/(a[f]._r[b]-a[f]._r[e])}return"ew"===S||"ns"===T?(S&&c(K,a),T&&c(L,b),E([S?-a:0,T?-b:0,N,O]),void y(T,S)):("w"===S?a=e(K,0,a):"e"===S?a=e(K,1,-a):S||(a=0),"n"===T?b=e(L,1,b):"s"===T?b=e(L,0,-b):T||(b=0),E(["w"===S?a:0,"n"===T?b:0,N-a,O-b]),void y(T,S))}function y(b,c){function d(a){for(f=0;f<a.length;f++)a[f].fixedrange||g.push(a[f]._id)}function e(d,e){var h;for(f=0;f<d.length;f++)h=d[f],(c&&-1!==g.indexOf(h.xref)||b&&-1!==g.indexOf(h.yref))&&e.draw(a,f)}var f,g=[];for(c&&d(K),b&&d(L),f=0;f<g.length;f++)x.Axes.doTicks(a,g[f],!0);e(I.annotations||[],x.Annotations),e(I.shapes||[],x.Shapes)}function z(){var b,c,d=a._context.doubleClick,e=(S?K:[]).concat(T?L:[]),f={};if("autosize"===d)for(c=0;c<e.length;c++)b=e[c],b.fixedrange||(f[b._name+".autorange"]=!0);else if("reset"===d)for(c=0;c<e.length;c++)b=e[c],b._rangeInitial?f[b._name+".range"]=b._rangeInitial.slice():f[b._name+".autorange"]=!0;else if("reset+autosize"===d)for(c=0;c<e.length;c++)b=e[c],b.fixedrange||(void 0===b._rangeInitial||b.range[0]===b._rangeInitial[0]&&b.range[1]===b._rangeInitial[1]?f[b._name+".autorange"]=!0:f[b._name+".range"]=b._rangeInitial.slice());a.emit("plotly_doubleclick",null),x.relayout(a,f)}function D(b){for(var c={},d=0;d<R.length;d++){var e=R[d];b&&-1===b.indexOf(e._id.charAt(0))||(e._r[0]!==e.range[0]&&(c[e._name+".range[0]"]=e.range[0]),e._r[1]!==e.range[1]&&(c[e._name+".range[1]"]=e.range[1]),e.range=e._r.slice())}E([0,0,N,O]),x.relayout(a,c)}function E(a){var b,c,d,e,f,i,j=I._plots,k=Object.keys(j);for(b=0;b<k.length;b++)if(c=j[k[b]],d=c.x(),e=c.y(),f=h&&-1!==K.indexOf(d)&&!d.fixedrange,i=g&&-1!==L.indexOf(e)&&!e.fixedrange,f||i){var l=[0,0,d._length,e._length];f&&(l[0]=a[0],l[2]=a[2]),i&&(l[1]=a[1],l[3]=a[3]),c.plot.attr("viewBox",l.join(" "))}}var F,G,H,I=a._fullLayout,J=[b].concat(g&&h?b.overlays:[]),K=[b.x()],L=[b.y()],N=K[0]._length,O=L[0]._length,P=B.MINDRAG,Q=B.MINZOOM;for(F=1;F<J.length;F++)G=J[F].x(),H=J[F].y(),-1===K.indexOf(G)&&K.push(G),-1===L.indexOf(H)&&L.push(H);var R=K.concat(L),S=i(K,h),T=i(L,g),U=n(T+S,I.dragmode),V=g+h+"drag",W=b.draglayer.selectAll("."+V).data([0]);W.enter().append("rect").classed("drag",!0).classed(V,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",b.id),W.call(x.Drawing.setRect,c,d,e,f).call(C.setCursor,U);var X=W.node();if(!T&&!S)return X.onmousedown=null,X.style.pointerEvents=g+h==="nsew"?"all":"none",X;var Y={element:X,gd:a,plotinfo:b,xaxes:K,yaxes:L,doubleclick:z,prepFn:function(b,c,d){var e=a._fullLayout.dragmode;g+h==="nsew"?b.shiftKey&&(e="pan"===e?"zoom":"pan"):e="pan","lasso"===e?Y.minDrag=1:Y.minDrag=void 0,"zoom"===e?(Y.moveFn=m,Y.doneFn=r,k(b,c,d)):"pan"===e?(Y.moveFn=w,Y.doneFn=t,l()):"select"!==e&&"lasso"!==e||A(b,c,d,Y,e)}};C.dragElement(Y);var Z,$,_,aa,ba,ca,da,ea,fa,ga=[0,0,N,O],ha=null,ia=300,ja=b.mainplot?I._plots[b.mainplot]:b;return g.length*h.length!==1&&(void 0!==X.onwheel?X.onwheel=u:void 0!==X.onmousewheel&&(X.onmousewheel=u)),X}function p(a,b){var c,d=a.range[b],e=Math.abs(d-a.range[1-b]);return"date"===a.type?x.Lib.ms2DateTime(d,e):"log"===a.type?(c=Math.ceil(Math.max(0,-Math.log(e)/Math.LN10))+3,u.format("."+c+"g")(Math.pow(10,d))):(c=Math.floor(Math.log(Math.abs(d))/Math.LN10)-Math.floor(Math.log(e)/Math.LN10)+4,u.format("."+String(c)+"g")(d))}function q(a){a._dragging=!0;var b=a._replotPending;a._replotPending=!1,setTimeout(function(){a._replotPending=b,r(a)},B.DBLCLICKDELAY)}function r(a){a._dragging=!1,a._replotPending&&x.plot(a)}function s(a){u.select(a).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function t(){var a=document.createElement("div");a.className="dragcover";var b=a.style;return b.position="fixed",b.left=0,b.right=0,b.top=0,b.bottom=0,b.zIndex=999999999,b.background="none",document.body.appendChild(a),a}var u=a("d3"),v=a("tinycolor2"),w=a("fast-isnumeric"),x=a("../../plotly"),y=a("../../lib"),z=a("../../lib/events"),A=a("./select"),B=a("./constants"),C=b.exports={};C.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},C.supplyLayoutDefaults=function(a,b,c){function d(c,d){return y.coerce(a,b,C.layoutAttributes,c,d)}d("dragmode");var e;if(b._hasCartesian){var f=b._isHoriz=C.isHoriz(c);e=f?"y":"x"}else e="closest";d("hovermode",e)},C.isHoriz=function(a){for(var b=!0,c=0;c<a.length;c++){var d=a[c];if("h"!==d.orientation){b=!1;break}}return b},C.init=function(a){var b=a._fullLayout;if(b._hasCartesian&&!a._context.staticPlot){var c=Object.keys(b._plots||{}).sort(function(a,c){if((b._plots[a].mainplot&&!0)===(b._plots[c].mainplot&&!0)){var d=a.split("y"),e=c.split("y");return d[0]===e[0]?Number(d[1]||1)-Number(e[1]||1):Number(d[0]||1)-Number(e[0]||1)}return b._plots[a].mainplot?1:-1});c.forEach(function(c){var d=b._plots[c];if(b._hasCartesian){var e=d.x(),f=d.y(),g=(e._linepositions[c]||[])[3],h=(f._linepositions[c]||[])[3],i=B.DRAGGERSIZE;if(w(g)&&"top"===e.side&&(g-=i),w(h)&&"right"!==f.side&&(h-=i),!d.mainplot){var j=o(a,d,0,0,e._length,f._length,"ns","ew");j.onmousemove=function(d){C.hover(a,d,c),b._lasthover=j,b._hoversubplot=c},j.onmouseout=function(b){a._dragging||C.unhover(a,b)},j.onclick=function(b){C.click(a,b)},o(a,d,-i,-i,i,i,"n","w"),o(a,d,e._length,-i,i,i,"n","e"),o(a,d,-i,f._length,i,i,"s","w"),o(a,d,e._length,f._length,i,i,"s","e")}w(g)&&("free"===e.anchor&&(g-=b._size.h*(1-f.domain[1])),o(a,d,.1*e._length,g,.8*e._length,i,"","ew"),o(a,d,0,g,.1*e._length,i,"","w"),o(a,d,.9*e._length,g,.1*e._length,i,"","e")),w(h)&&("free"===f.anchor&&(h-=b._size.w*e.domain[0]),o(a,d,h,.1*f._length,i,.8*f._length,"ns",""),o(a,d,h,.9*f._length,i,.1*f._length,"s",""),o(a,d,h,0,i,.1*f._length,"n",""))}});var d=b._hoverlayer.node();d.onmousemove=function(c){ 51 c.target=b._lasthover,C.hover(a,c,b._hoversubplot)},d.onclick=function(c){c.target=b._lasthover,C.click(a,c)},d.onmousedown=function(a){b._lasthover.onmousedown(a)}}};var D=B.YANGLE,E=Math.PI*D/180,F=1/Math.sin(E),G=Math.cos(E),H=Math.sin(E),I=B.HOVERARROWSIZE,J=B.HOVERTEXTPAD,K=B.HOVERFONTSIZE,L=B.HOVERFONT;C.hover=function(a,b,c){return"string"==typeof a&&(a=document.getElementById(a)),void 0===a._lastHoverTime&&(a._lastHoverTime=0),void 0!==a._hoverTimer&&(clearTimeout(a._hoverTimer),a._hoverTimer=void 0),Date.now()>a._lastHoverTime+B.HOVERMINTIME?(g(a,b,c),void(a._lastHoverTime=Date.now())):void(a._hoverTimer=setTimeout(function(){g(a,b,c),a._lastHoverTime=Date.now(),a._hoverTimer=void 0},B.HOVERMINTIME))},C.unhover=function(a,b,c){"string"==typeof a&&(a=document.getElementById(a)),a._hoverTimer&&(clearTimeout(a._hoverTimer),a._hoverTimer=void 0),m(a,b,c)},C.getDistanceFunction=function(a,b,c,d){return"closest"===a?d||f(b,c):"x"===a?b:c},C.getClosest=function(a,b,c){if(c.index!==!1)c.index>=0&&c.index<a.length?c.distance=0:c.index=!1;else for(var d=0;d<a.length;d++){var e=b(a[d]);e<c.distance&&(c.index=d,c.distance=e)}return c},C.loneHover=function(a,b){var c={color:a.color||x.Color.defaultLine,x0:a.x0||a.x||0,x1:a.x1||a.x||0,y0:a.y0||a.y||0,y1:a.y1||a.y||0,xLabel:a.xLabel,yLabel:a.yLabel,zLabel:a.zLabel,text:a.text,name:a.name,idealAlign:a.idealAlign,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},d=u.select(b.container),e=b.outerContainer?u.select(b.outerContainer):d,f={hovermode:"closest",rotateLabels:!1,bgColor:b.bgColor||x.Color.background,container:d,outerContainer:e},g=i([c],f);return k(g,f.rotateLabels),g.node()},C.loneUnhover=function(a){var b=a instanceof u.selection?a:u.select(a);b.selectAll("g.hovertext").remove()},C.click=function(a,b){a._hoverdata&&b&&b.target&&(a.emit("plotly_click",{points:a._hoverdata}),b.stopImmediatePropagation&&b.stopImmediatePropagation())};var M=!0;C.dragAlign=function(a,b,c,d,e){var f=(a-c)/(d-c),g=f+b/(d-c),h=(f+g)/2;return"left"===e||"bottom"===e?f:"center"===e||"middle"===e?h:"right"===e||"top"===e?g:2/3-h>f?f:g>4/3-h?g:h};var N=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];C.dragCursors=function(a,b,c,d){return a="left"===c?0:"center"===c?1:"right"===c?2:x.Lib.constrain(Math.floor(3*a),0,2),b="bottom"===d?0:"middle"===d?1:"top"===d?2:x.Lib.constrain(Math.floor(3*b),0,2),N[b][a]},C.dragElement=function(a){function b(b){var m=document.querySelector(".plugin-editable");return m&&u.select(m).on("blur").call(m),j._dragged=!1,j._dragging=!0,e=b.clientX,f=b.clientY,i=b.target,g=(new Date).getTime(),g-j._mouseDownTime<l?k+=1:(k=1,j._mouseDownTime=g),a.prepFn&&a.prepFn(b,e,f),h=t(),h.onmousemove=c,h.onmouseup=d,h.onmouseout=d,h.style.cursor=window.getComputedStyle(a.element).cursor,x.Lib.pauseEvent(b)}function c(b){var c=b.clientX-e,d=b.clientY-f,g=a.minDrag||B.MINDRAG;return Math.abs(c)<g&&(c=0),Math.abs(d)<g&&(d=0),(c||d)&&(j._dragged=!0,C.unhover(j)),a.moveFn&&a.moveFn(c,d,j._dragged),x.Lib.pauseEvent(b)}function d(b){if(h.onmousemove=null,h.onmouseup=null,h.onmouseout=null,x.Lib.removeElement(h),!j._dragging)return void(j._dragged=!1);if(j._dragging=!1,(new Date).getTime()-j._mouseDownTime>l&&(k=Math.max(k-1,1)),a.doneFn&&a.doneFn(j._dragged,k),!j._dragged){var c=document.createEvent("MouseEvents");c.initEvent("click",!0,!0),i.dispatchEvent(c)}return r(j),j._dragged=!1,x.Lib.pauseEvent(b)}var e,f,g,h,i,j=x.Lib.getPlotDiv(a.element)||{},k=1,l=B.DBLCLICKDELAY;j._mouseDownTime||(j._mouseDownTime=0),a.element.onmousedown=b,a.element.style.pointerEvents="all"},C.setCursor=function(a,b){(a.attr("class")||"").split(" ").forEach(function(b){0===b.indexOf("cursor-")&&a.classed(b,!1)}),b&&a.classed("cursor-"+b,!0)},C.inbox=function(a,b){return 0>a*b||0===a?B.MAXDIST*(.6-.3/Math.max(3,Math.abs(a-b))):1/0}},{"../../lib":349,"../../lib/events":344,"../../plotly":366,"./constants":373,"./select":379,d3:70,"fast-isnumeric":74,tinycolor2:229}],375:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../plots"),f=a("../../components/errorbars");c.name="cartesian",c.attr=["xaxis","yaxis"],c.idRoot=["x","y"],c.attributes=a("./attributes"),c.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},c.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},c.plot=function(a){function b(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],f=e[0].trace;f.xaxis+f.yaxis===b&&c.push(e)}return c}function c(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],f=e[0].trace;f._module===b&&f.visible===!0&&c.push(e)}return c}for(var g=a._fullLayout,h=e.getSubplotIds(g,"cartesian"),i=a.calcdata,j=a._modules,k=0;k<h.length;k++){var l=h[k],m=g._plots[l],n=b(i,l),o=[];m.plot&&m.plot.selectAll("g.trace").remove();for(var p=0;p<j.length;p++){var q=j[p];if("cartesian"===q.basePlotModule.name&&"pie"!==q.name){var r=c(n,q);q.plot(a,m,r),d.markTime("done "+(r[0]&&r[0][0].trace.type)),r[0]&&r[0][0].trace&&e.traceIs(r[0][0].trace,"errorBarsOK")&&(o=o.concat(r))}}f.plot(a,m,o),d.markTime("done ErrorBars")}if(g._hasPie){var s=e.getModule("pie"),t=c(i,s);t.length&&s.plot(a,t)}},c.clean=function(a,b,c,d){d._hasPie&&!b._hasPie&&d._pielayer.selectAll("g.trace").remove()}},{"../../components/errorbars":323,"../../lib":349,"../plots":413,"./attributes":368}],376:[function(a,b,c){"use strict";var d=a("./index"),e=a("../font_attributes"),f=a("../../components/color/attributes"),g=a("../../lib/extend").extendFlat;b.exports={title:{valType:"string"},titlefont:g({},e,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"number",dflt:0},dtick:{valType:"any",dflt:1},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:f.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:g({},e,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:f.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:f.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:f.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",d.idRegex.x.toString(),d.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",d.idRegex.x.toString(),d.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":298,"../../lib/extend":345,"../font_attributes":383,"./index":375}],377:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../plots"),f=a("./constants"),g=a("./layout_attributes"),h=a("./axis_defaults"),i=a("./position_defaults"),j=a("./axis_ids");b.exports=function(a,b,c){function k(a,b){var c=Number(a.substr(5)||1),d=Number(b.substr(5)||1);return c-d}var l,m=Object.keys(a),n=[],o=[],p=[],q=[],r={},s={};for(l=0;l<c.length;l++){var t,u,v=c[l];if(e.traceIs(v,"cartesian"))t=n,u=o;else{if(!e.traceIs(v,"gl2d"))continue;t=p,u=q}var w=j.id2name(v.xaxis),x=j.id2name(v.yaxis);if(w&&-1===t.indexOf(w)&&t.push(w),x&&-1===u.indexOf(x)&&u.push(x),e.traceIs(v,"2dMap")&&(r[w]=!0,r[x]=!0),e.traceIs(v,"oriented")){var y="h"===v.orientation?x:w;s[y]=!0}}var z=b._hasGL3D||b._hasGeo;if(!z)for(l=0;l<m.length;l++){var A=m[l];-1===p.indexOf(A)&&-1===n.indexOf(A)&&f.xAxisMatch.test(A)?n.push(A):-1===q.indexOf(A)&&-1===o.indexOf(A)&&f.yAxisMatch.test(A)&&o.push(A)}n.length&&o.length&&(b._hasCartesian=!0);var B=n.concat(p).sort(k),C=o.concat(q).sort(k);B.concat(C).forEach(function(e){function f(a,b){return d.coerce(l,m,g,a,b)}var k=e.charAt(0),l=a[e]||{},m={},n={letter:k,font:b.font,outerTicks:r[e],showGrid:!s[e],name:e,data:c},o={letter:k,counterAxes:{x:C,y:B}[k].map(j.name2id),overlayableAxes:{x:B,y:C}[k].filter(function(b){return b!==e&&!(a[b]||{}).overlaying}).map(j.name2id)};h(l,m,f,n),i(l,m,f,o),b[e]=m,a[e]||"-"===l.type||(a[e]={type:l.type})}),B.length&&C.length&&d.coerce(a,b,e.layoutAttributes,"plot_bgcolor")}},{"../../lib":349,"../plots":413,"./axis_defaults":370,"./axis_ids":371,"./constants":373,"./layout_attributes":376,"./position_defaults":378}],378:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib");b.exports=function(a,b,c,f){var g=f.counterAxes||[],h=f.overlayableAxes||[],i=f.letter,j=e.coerce(a,b,{anchor:{valType:"enumerated",values:["free"].concat(g),dflt:d(a.position)?"free":g[0]||"free"}},"anchor");"free"===j&&c("position"),e.coerce(a,b,{side:{valType:"enumerated",values:"x"===i?["bottom","top"]:["left","right"],dflt:"x"===i?"bottom":"left"}},"side");var k=!1;if(h.length&&(k=e.coerce(a,b,{overlaying:{valType:"enumerated",values:[!1].concat(h),dflt:!1}},"overlaying")),!k){var l=c("domain");l[0]>l[1]-.01&&(b.domain=[0,1]),e.noneOrAll(a.domain,b.domain,[0,1])}return b}},{"../../lib":349,"fast-isnumeric":74}],379:[function(a,b,c){"use strict";function d(a){return a._id}var e=a("../../lib/polygon"),f=a("../../components/color"),g=a("./axes"),h=a("./constants"),i=e.filter,j=e.tester,k=h.MINSELECT;b.exports=function(a,b,c,e,l){function m(a){var b="y"===a._id.charAt(0)?1:0;return function(c){return a.p2d(c[b])}}function n(a,b){return a-b}var o,p=e.plotinfo.plot,q=e.element.getBoundingClientRect(),r=b-q.left,s=c-q.top,t=r,u=s,v="M"+r+","+s,w=e.xaxes[0]._length,x=e.yaxes[0]._length,y=e.xaxes.map(d),z=e.yaxes.map(d),A=e.xaxes.concat(e.yaxes);"lasso"===l&&(o=i([[r,s]],h.BENDPX));var B=p.selectAll("path.select-outline").data([1,2]);B.enter().append("path").attr("class",function(a){return"select-outline select-outline-"+a}).attr("d",v+"Z");var C,D,E,F,G,H=p.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1}).attr("d","M0,0Z"),I=[],J=e.gd,K=[];for(C=0;C<J.calcdata.length;C++)D=J.calcdata[C],E=D[0].trace,E._module&&E._module.selectPoints&&-1!==y.indexOf(E.xaxis)&&-1!==z.indexOf(E.yaxis)&&I.push({selectPoints:E._module.selectPoints,cd:D,xaxis:g.getFromId(J,E.xaxis),yaxis:g.getFromId(J,E.yaxis)});e.moveFn=function(a,b){var c,d;t=Math.max(0,Math.min(w,a+r)),u=Math.max(0,Math.min(x,b+s));var f=Math.abs(t-r),g=Math.abs(u-s);for("select"===l?(g<Math.min(.6*f,k)?(c=j([[r,0],[r,x],[t,x],[t,0]]),H.attr("d","M"+c.xmin+","+(s-k)+"h-4v"+2*k+"h4ZM"+(c.xmax-1)+","+(s-k)+"h4v"+2*k+"h-4Z")):f<Math.min(.6*g,k)?(c=j([[0,s],[0,u],[w,u],[w,s]]),H.attr("d","M"+(r-k)+","+c.ymin+"v-4h"+2*k+"v4ZM"+(r-k)+","+(c.ymax-1)+"v4h"+2*k+"v-4Z")):(c=j([[r,s],[r,u],[t,u],[t,s]]),H.attr("d","M0,0Z")),B.attr("d","M"+c.xmin+","+c.ymin+"H"+(c.xmax-1)+"V"+(c.ymax-1)+"H"+c.xmin+"Z")):"lasso"===l&&(o.addPt([t,u]),c=j(o.filtered),B.attr("d","M"+o.filtered.join("L")+"Z")),K=[],C=0;C<I.length;C++)F=I[C],[].push.apply(K,F.selectPoints(F,c));if(G={points:K},"select"===l){var h,i=G.range={};for(C=0;C<A.length;C++)d=A[C],h=d._id.charAt(0),i[d._id]=[d.p2d(c[h+"min"]),d.p2d(c[h+"max"])].sort(n)}else{var p=G.lassoPoints={};for(C=0;C<A.length;C++)d=A[C],p[d._id]=o.filtered.map(m(d))}e.gd.emit("plotly_selecting",G)},e.doneFn=function(a,b){if(a||2!==b)e.gd.emit("plotly_selected",G);else{for(B.remove(),C=0;C<I.length;C++)F=I[C],F.selectPoints(F,!1);J.emit("plotly_deselect",null)}H.remove()}}},{"../../components/color":299,"../../lib/polygon":354,"./axes":369,"./constants":373}],380:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("./constants"),h=a("./clean_datum"),i=a("./axis_ids");b.exports=function(a){function b(b,c){if(b>0)return Math.log(b)/Math.LN10;if(0>=b&&c&&a.range&&2===a.range.length){var d=a.range[0],e=a.range[1];return.5*(d+e-3*k*Math.abs(d-e))}return g.BADNUM}function c(a){return Math.pow(10,a)}function j(a){return e(a)?Number(a):g.BADNUM}var k=10;if(a.c2l="log"===a.type?b:j,a.l2c="log"===a.type?c:j,a.l2d=function(b){return a.c2d(a.l2c(b))},a.p2d=function(b){return a.l2d(a.p2l(b))},a.setScale=function(){var b,c=a._td._fullLayout._size;if(a._categories||(a._categories=[]),a.overlaying){var d=i.getFromId(a._td,a.overlaying);a.domain=d.domain}for(a.range&&2===a.range.length&&a.range[0]!==a.range[1]||(a.range=[-1,1]),b=0;2>b;b++)e(a.range[b])||(a.range[b]=e(a.range[1-b])?a.range[1-b]*(b?10:.1):b?1:-1),a.range[b]<-(Number.MAX_VALUE/2)?a.range[b]=-(Number.MAX_VALUE/2):a.range[b]>Number.MAX_VALUE/2&&(a.range[b]=Number.MAX_VALUE/2);if("y"===a._id.charAt(0)?(a._offset=c.t+(1-a.domain[1])*c.h,a._length=c.h*(a.domain[1]-a.domain[0]),a._m=a._length/(a.range[0]-a.range[1]),a._b=-a._m*a.range[1]):(a._offset=c.l+a.domain[0]*c.w,a._length=c.w*(a.domain[1]-a.domain[0]),a._m=a._length/(a.range[1]-a.range[0]),a._b=-a._m*a.range[0]),!isFinite(a._m)||!isFinite(a._b))throw f.notifier("Something went wrong with axis scaling","long"),a._td._replotting=!1,new Error("axis scaling")},a.l2p=function(b){return e(b)?d.round(f.constrain(a._b+a._m*b,-k*a._length,(1+k)*a._length),2):g.BADNUM},a.p2l=function(b){return(b-a._b)/a._m},a.c2p=function(b,c){return a.l2p(a.c2l(b,c))},a.p2c=function(b){return a.l2c(a.p2l(b))},-1!==["linear","log","-"].indexOf(a.type))a.c2d=j,a.d2c=function(a){return a=h(a),e(a)?Number(a):g.BADNUM},a.d2l=function(b,c){return"log"===a.type?a.c2l(a.d2c(b),c):a.d2c(b)};else if("date"===a.type){if(a.c2d=function(a){return e(a)?f.ms2DateTime(a):g.BADNUM},a.d2c=function(a){return e(a)?Number(a):f.dateTime2ms(a)},a.d2l=a.d2c,a.range&&a.range.length>1)try{var l=a.range.map(f.dateTime2ms);!e(a.range[0])&&e(l[0])&&(a.range[0]=l[0]),!e(a.range[1])&&e(l[1])&&(a.range[1]=l[1])}catch(m){console.log(m,a.range)}}else"category"===a.type&&(a.c2d=function(b){return a._categories[Math.round(b)]},a.d2c=function(b){null!==b&&void 0!==b&&-1===a._categories.indexOf(b)&&a._categories.push(b);var c=a._categories.indexOf(b);return-1===c?g.BADNUM:c},a.d2l=a.d2c);a.makeCalcdata=function(b,c){var d,e,f;if(c in b)for(d=b[c],e=new Array(d.length),f=0;f<d.length;f++)e[f]=a.d2c(d[f]);else{var g=c+"0"in b?a.d2c(b[c+"0"]):0,h=b["d"+c]?Number(b["d"+c]):1;for(d=b[{x:"y",y:"x"}[c]],e=new Array(d.length),f=0;f<d.length;f++)e[f]=g+f*h}return e},a._min=[],a._max=[],a._minDtick=null,a._forceTick0=null}},{"../../lib":349,"./axis_ids":371,"./clean_datum":372,"./constants":373,d3:70,"fast-isnumeric":74}],381:[function(a,b,c){"use strict";function d(a){var b=["showexponent","showtickprefix","showticksuffix"],c=b.filter(function(b){return void 0!==a[b]}),d=function(b){return a[b]===a[c[0]]};return c.every(d)||1===c.length?a[c[0]]:void 0}var e=a("../../lib"),f=a("./layout_attributes");b.exports=function(a,b,c,g,h){var i=e.coerce2(a,b,f,"ticklen"),j=e.coerce2(a,b,f,"tickwidth"),k=e.coerce2(a,b,f,"tickcolor"),l=c("ticks",h.outerTicks||i||j||k?"outside":"");l||(delete b.ticklen,delete b.tickwidth,delete b.tickcolor);var m=d(a),n=c("tickprefix");n&&c("showtickprefix",m);var o=c("ticksuffix");o&&c("showticksuffix",m);var p=c("showticklabels");if(p&&(e.coerceFont(c,"tickfont",h.font||{}),c("tickangle"),"category"!==g)){var q=c("tickformat");q||"date"===g||(c("showexponent",m),c("exponentformat"))}"category"===g||h.noHover||c("hoverformat")}},{"../../lib":349,"./layout_attributes":376}],382:[function(a,b,c){"use strict";var d=a("fast-isnumeric");b.exports=function(a,b,c,e){var f="auto";"array"!==a.tickmode||"log"!==e&&"date"!==e||(a.tickmode="auto"),Array.isArray(a.tickvals)?f="array":a.dtick&&d(a.dtick)&&(f="linear");var g=c("tickmode",f);if("auto"===g)c("nticks");else if("linear"===g)c("tick0"),c("dtick");else{var h=c("tickvals");void 0===h?b.tickmode="auto":c("ticktext")}}},{"fast-isnumeric":74}],383:[function(a,b,c){"use strict";b.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],384:[function(a,b,c){"use strict";function d(a,b){this.id=a.id,this.graphDiv=a.graphDiv,this.container=a.container,this.topojsonURL=a.topojsonURL,o(),this.hoverContainer=null,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework(),this.updateFx(b.hovermode),this.traceHash={}}function e(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];d.visible===!0&&b.push(d)}return b}function f(a,b,c){return k.geo.graticule().extent([[a[0],b[0]],[a[1],b[1]]]).step(c)}function g(a,b,c){var d=t.layerNameToAdjective[b];a.select("."+b).selectAll("path").attr("stroke","none").call(l.fill,c[d+"color"])}function h(a,b,c){var d=t.layerNameToAdjective[b];a.select("."+b).selectAll("path").attr("fill","none").call(l.stroke,c[d+"color"]).call(m.dashLine,"",c[d+"width"])}function i(a,b,c){a.select("."+b+"graticule").selectAll("path").attr("fill","none").call(l.stroke,c[b].gridcolor).call(m.dashLine,"",c[b].gridwidth)}function j(a){var b={type:"linear",showexponent:"all",exponentformat:n.layoutAttributes.exponentformat.dflt,_td:{_fullLayout:a}};return n.setConvert(b),b}var k=a("d3"),l=a("../../components/color"),m=a("../../components/drawing"),n=a("../../plots/cartesian/axes"),o=a("./projections"),p=a("./set_scale"),q=a("./zoom"),r=a("./zoom_reset"),s=a("../../constants/xmlns_namespaces"),t=a("../../constants/geo_constants"),u=a("../../lib/topojson_utils"),v=a("topojson").feature;b.exports=d;var w=d.prototype;w.plot=function(a,b,c){var d,e,f=this,g=b[f.id],h=b._size;f.projection=null,f.setScale=p(g,h),f.makeProjection(g),f.makePath(),f.adjustLayout(g,h),f.zoom=q(f,g),f.zoomReset=r(f,g),f.mockAxis=j(b),f.framework.call(f.zoom).on("dblclick.zoom",f.zoomReset),d=u.getTopojsonName(g),null===f.topojson||d!==f.topojsonName?(f.topojsonName=d,void 0!==PlotlyGeoAssets.topojson[f.topojsonName]?(f.topojson=PlotlyGeoAssets.topojson[f.topojsonName],f.onceTopojsonIsLoaded(a,g)):(e=u.getTopojsonPath(f.topojsonURL,f.topojsonName),c.push(new Promise(function(b,c){k.json(e,function(d,h){return d?void c(404===d.status?new Error(["plotly.js could not find topojson file at",e,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",e].join(" "))):(f.topojson=h,PlotlyGeoAssets.topojson[f.topojsonName]=h,f.onceTopojsonIsLoaded(a,g),void b())})})))):f.onceTopojsonIsLoaded(a,g)},w.onceTopojsonIsLoaded=function(a,b){var c;this.drawLayout(b);var d=this.traceHash,f={};for(c=0;c<a.length;c++){var g=a[c];f[g.type]=f[g.type]||[],f[g.type].push(g)}var h=Object.keys(d),i=Object.keys(f);for(c=0;c<h.length;c++){var j=h[c];if(-1===i.indexOf(j)){var k=d[j][0];k.visible=!1,f[j]=[k]}}for(i=Object.keys(f),c=0;c<i.length;c++){var l=f[i[c]],m=l[0]._module;m.plot(this,e(l),b)}this.traceHash=f,this.render()},w.updateFx=function(a){this.showHover=a!==!1},w.makeProjection=function(a){var b,c=a.projection,d=c.type,e=null===this.projection||d!==this.projectionType;e?(this.projectionType=d,b=this.projection=k.geo[t.projNames[d]]()):b=this.projection,b.translate(c._translate0).precision(t.precision),a._isAlbersUsa||b.rotate(c._rotate).center(c._center),a._clipAngle?(this.clipAngle=a._clipAngle,b.clipAngle(a._clipAngle-t.clipPad)):this.clipAngle=null,c.parallels&&b.parallels(c.parallels),e&&this.setScale(b),b.translate(c._translate).scale(c._scale)},w.makePath=function(){this.path=k.geo.path().projection(this.projection)},w.makeFramework=function(){var a=this.geoDiv=k.select(this.container).append("div");a.attr("id",this.id).style("position","absolute");var b=this.hoverContainer=a.append("svg");b.attr(s.svgAttrs).style({position:"absolute","z-index":20,"pointer-events":"none"});var c=this.framework=a.append("svg");c.attr(s.svgAttrs).attr({position:"absolute",preserveAspectRatio:"none"}),c.append("g").attr("class","bglayer").append("rect"),c.append("g").attr("class","baselayer"),c.append("g").attr("class","choroplethlayer"),c.append("g").attr("class","baselayeroverchoropleth"),c.append("g").attr("class","scattergeolayer"),c.on("dblclick.zoom",null)},w.adjustLayout=function(a,b){var c=a.domain;this.geoDiv.style({left:b.l+b.w*c.x[0]+a._marginX+"px",top:b.t+b.h*(1-c.y[1])+a._marginY+"px",width:a._width+"px",height:a._height+"px"}),this.hoverContainer.attr({width:a._width,height:a._height}),this.framework.attr({width:a._width,height:a._height}),this.framework.select(".bglayer").select("rect").attr({width:a._width,height:a._height}).style({fill:a.bgcolor,"stroke-width":0})},w.drawTopo=function(a,b,c){if(c["show"+b]===!0){var d=this.topojson,e="frame"===b?t.sphereSVG:v(d,d.objects[b]);a.append("g").datum(e).attr("class",b).append("path").attr("class","basepath")}},w.drawGraticule=function(a,b,c){var d=c[b];if(d.showgrid===!0){var e=t.scopeDefaults[c.scope],g=e.lonaxisRange,h=e.lataxisRange,i="lonaxis"===b?[d.dtick]:[0,d.dtick],j=f(g,h,i);a.append("g").datum(j).attr("class",b+"graticule").append("path").attr("class","graticulepath")}},w.drawLayout=function(a){var b,c=this.framework.select("g.baselayer"),d=t.baseLayers,e=t.axesNames;c.selectAll("*").remove();for(var f=0;f<d.length;f++)b=d[f],-1!==e.indexOf(b)?this.drawGraticule(c,b,a):this.drawTopo(c,b,a);this.styleLayout(a)},w.styleLayer=function(a,b,c){var d=t.fillLayers,e=t.lineLayers;-1!==d.indexOf(b)?g(a,b,c):-1!==e.indexOf(b)&&h(a,b,c)},w.styleLayout=function(a){for(var b,c=this.framework.select("g.baselayer"),d=t.baseLayers,e=t.axesNames,f=0;f<d.length;f++)b=d[f],-1!==e.indexOf(b)?i(c,b,a):this.styleLayer(c,b,a)},w.render=function(){function a(a){var b=f([a.lon,a.lat]);return b?"translate("+b[0]+","+b[1]+")":null}function b(a){var b=f.rotate(),c=k.geo.distance([a.lon,a.lat],[-b[0],-b[1]]),d=h*Math.PI/180;return c>d?"0":"1.0"}var c=this.framework,d=c.select("g.choroplethlayer"),e=c.select("g.scattergeolayer"),f=this.projection,g=this.path,h=this.clipAngle;c.selectAll("path.basepath").attr("d",g),c.selectAll("path.graticulepath").attr("d",g),d.selectAll("path.choroplethlocation").attr("d",g),d.selectAll("path.basepath").attr("d",g),e.selectAll("path.js-line").attr("d",g),null!==h?(e.selectAll("path.point").style("opacity",b).attr("transform",a),e.selectAll("text").style("opacity",b).attr("transform",a)):(e.selectAll("path.point").attr("transform",a),e.selectAll("text").attr("transform",a))}},{"../../components/color":299,"../../components/drawing":317,"../../constants/geo_constants":334,"../../constants/xmlns_namespaces":338,"../../lib/topojson_utils":361,"../../plots/cartesian/axes":369,"./projections":391,"./set_scale":392,"./zoom":393,"./zoom_reset":394,d3:70,topojson:230}],385:[function(a,b,c){"use strict";var d=a("./geo"),e=a("../../plots/plots");c.name="geo",c.attr="geo",c.idRoot="geo",c.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,c.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,c.attributes=a("./layout/attributes"),c.layoutAttributes=a("./layout/layout_attributes"),c.supplyLayoutDefaults=a("./layout/defaults"),c.plot=function(a){var b=a._fullLayout,c=a._fullData,f=e.getSubplotIds(b,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var g=0;g<f.length;g++){var h=f[g],i=e.getSubplotData(c,"geo",h),j=b[h]._geo;void 0===j&&(j=new d({id:h,graphDiv:a,container:b._geocontainer.node(),topojsonURL:a._context.topojsonURL},b),b[h]._geo=j),j.plot(i,b,a._promises)}},c.clean=function(a,b,c,d){for(var f=e.getSubplotIds(d,"geo"),g=0;g<f.length;g++){var h=f[g],i=d[h]._geo;!b[h]&&i&&i.geoDiv.remove()}}},{"../../plots/plots":413,"./geo":384,"./layout/attributes":386,"./layout/defaults":389,"./layout/layout_attributes":390}],386:[function(a,b,c){"use strict";b.exports={geo:{valType:"geoid",dflt:"geo"}}},{}],387:[function(a,b,c){"use strict";var d=a("../../../components/color/attributes");b.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":298}],388:[function(a,b,c){"use strict";var d=a("../../../lib"),e=a("../../../constants/geo_constants"),f=a("./axis_attributes");b.exports=function(a,b){function c(a,b){return d.coerce(h,i,f,a,b)}function g(a){var c,d,f,g,h,i,j=b.scope;return"world"===j?(c=b.projection,d=c.type,f=c.rotation,h=e[a+"Span"],i=void 0!==h[d]?h[d]/2:h["*"]/2,g="lonaxis"===a?f.lon:f.lat,[g-i,g+i]):e.scopeDefaults[j][a+"Range"]}for(var h,i,j=e.axesNames,k=0;k<j.length;k++){var l=j[k];h=a[l]||{},i={};var m=g(l),n=c("range",m);d.noneOrAll(h.range,i.range,[0,1]),c("tick0",n[0]),c("dtick","lonaxis"===l?30:10);var o=c("showgrid");o&&(c("gridcolor"),c("gridwidth")),b[l]=i,b[l]._fullRange=m}}},{"../../../constants/geo_constants":334,"../../../lib":349,"./axis_attributes":387}],389:[function(a,b,c){"use strict";function d(a,b,c){var d,e=c("scope"),f="world"!==e,h=g.scopeDefaults[e],j=c("resolution"),k=c("projection.type",h.projType),l="albers usa"===k,m=-1!==k.indexOf("conic");if(m){var n=h.projParallels||[0,60];c("projection.parallels",n)}if(l)b.scope="usa";else{var o=h.projRotate||[0,0,0];c("projection.rotation.lon",o[0]),c("projection.rotation.lat",o[1]),c("projection.rotation.roll",o[2]),d=c("showcoastlines",!f),d&&(c("coastlinecolor"),c("coastlinewidth")),d=c("showocean"),d&&c("oceancolor")}c("projection.scale"),d=c("showland"),d&&c("landcolor"),d=c("showlakes"),d&&c("lakecolor"),d=c("showrivers"),d&&(c("rivercolor"),c("riverwidth")),d=c("showcountries",f),d&&(c("countrycolor"),c("countrywidth")),("usa"===e||"north america"===e&&50===j)&&(c("showsubunits",!0),c("subunitcolor"),c("subunitwidth")),f||(d=c("showframe",!0),d&&(c("framecolor"),c("framewidth"))),c("bgcolor"),i(a,b),b._isHighRes=50===j,b._clipAngle=g.lonaxisSpan[k]/2,b._isAlbersUsa=l,b._isConic=m,b._isScoped=f;var p=b.projection.rotation||{};b.projection._rotate=[-p.lon||0,-p.lat||0,p.roll||0]}var e=a("../../../lib"),f=a("../../plots"),g=a("../../../constants/geo_constants"),h=a("./layout_attributes"),i=a("./axis_defaults");b.exports=function(a,b,c){function g(a,b){return e.coerce(i,j,h,a,b)}if(b._hasGeo)for(var i,j,k=f.findSubplotIds(c,"geo"),l=k.length,m=0;l>m;m++){var n=k[m];i=a[n]?a[n]:a[n]={},i=a[n],j={},g("domain.x"),g("domain.y",[m/l,(m+1)/l]),d(i,j,g),b[n]=j}}},{"../../../constants/geo_constants":334,"../../../lib":349,"../../plots":413,"./axis_defaults":388,"./layout_attributes":390}],390:[function(a,b,c){"use strict";var d=a("../../../components/color/attributes"),e=a("../../../constants/geo_constants"),f=a("./axis_attributes");b.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(e.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(e.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:e.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:e.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:e.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:e.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:f,lataxis:f}},{"../../../components/color/attributes":298,"../../../constants/geo_constants":334,"./axis_attributes":387}],391:[function(a,b,c){function d(){function a(a,c){return{type:"Feature",id:a.id,properties:a.properties,geometry:b(a.geometry,c)}}function b(a,c){if(!a)return null;if("GeometryCollection"===a.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(a){return b(a,c)})};if(!y.hasOwnProperty(a.type))return null;var d=y[a.type];return e.geo.stream(a,c(d)),d.result()}function c(){}function d(a){if((b=a.length)<4)return!1;for(var b,c=0,d=a[b-1][1]*a[0][0]-a[b-1][0]*a[0][1];++c<b;)d+=a[c-1][1]*a[c][0]-a[c-1][0]*a[c][1];return 0>=d}function f(a,b){for(var c=b[0],d=b[1],e=!1,f=0,g=a.length,h=g-1;g>f;h=f++){var i=a[f],j=i[0],k=i[1],l=a[h],m=l[0],n=l[1];k>d^n>d&&(m-j)*(d-k)/(n-k)+j>c&&(e=!e)}return e}function g(a){return a>1?C:-1>a?-C:Math.asin(a)}function h(a,b){var c=(2+C)*Math.sin(b);b/=2;for(var d=0,e=1/0;10>d&&Math.abs(e)>z;d++){var f=Math.cos(b);b-=e=(b+Math.sin(b)*(f+2)-c)/(2*f*(1+f))}return[2/Math.sqrt(B*(4+B))*a*(1+Math.cos(b)),2*Math.sqrt(B/(4+B))*Math.sin(b)]}function i(a,b){function c(c,d){var e=H(c/b,d);return e[0]*=a,e}return arguments.length<2&&(b=a),1===b?H:b===1/0?k:(c.invert=function(c,d){var e=H.invert(c/a,d);return e[0]*=b,e},c)}function j(){var a=2,b=G(i),c=b(a);return c.coefficient=function(c){return arguments.length?b(a=+c):a},c}function k(a,b){return[a*Math.cos(b)/Math.cos(b/=2),2*Math.sin(b)]}function l(a,b){return[3*a/(2*B)*Math.sqrt(B*B/3-b*b),b]}function m(a,b){return[a,1.25*Math.log(Math.tan(B/4+.4*b))]}function n(a){return function(b){var c,d=a*Math.sin(b),e=30;do b-=c=(b+Math.sin(b)-d)/(1+Math.cos(b));while(Math.abs(c)>z&&--e>0);return b/2}}function o(a,b,c){function d(c,d){return[a*c*Math.cos(d=e(d)),b*Math.sin(d)]}var e=n(c);return d.invert=function(d,e){var f=g(e/b);return[d/(a*Math.cos(f)),g((2*f+Math.sin(2*f))/c)]},d}function p(a,b){var c=b*b,d=c*c;return[a*(.8707-.131979*c+d*(-.013791+d*(.003971*c-.001529*d))),b*(1.007226+c*(.015085+d*(-.044475+.028874*c-.005916*d)))]}function q(a,b){var c,d=Math.min(18,36*Math.abs(b)/B),e=Math.floor(d),f=d-e,g=(c=J[e])[0],h=c[1],i=(c=J[++e])[0],j=c[1],k=(c=J[Math.min(19,++e)])[0],l=c[1];return[a*(i+f*(k-g)/2+f*f*(k-2*i+g)/2),(b>0?C:-C)*(j+f*(l-h)/2+f*f*(l-2*j+h)/2)]}function r(a,b){return[a*Math.cos(b),b]}e.geo.project=function(a,c){var d=c.stream;if(!d)throw new Error("not yet supported");return(a&&s.hasOwnProperty(a.type)?s[a.type]:b)(a,d)};var s={Feature:a,FeatureCollection:function(b,c){return{type:"FeatureCollection",features:b.features.map(function(b){return a(b,c)})}}},t=[],u=[],v={point:function(a,b){t.push([a,b])},result:function(){var a=t.length?t.length<2?{type:"Point",coordinates:t[0]}:{type:"MultiPoint", 52 coordinates:t}:null;return t=[],a}},w={lineStart:c,point:function(a,b){t.push([a,b])},lineEnd:function(){t.length&&(u.push(t),t=[])},result:function(){var a=u.length?u.length<2?{type:"LineString",coordinates:u[0]}:{type:"MultiLineString",coordinates:u}:null;return u=[],a}},x={polygonStart:c,lineStart:c,point:function(a,b){t.push([a,b])},lineEnd:function(){var a=t.length;if(a){do t.push(t[0].slice());while(++a<4);u.push(t),t=[]}},polygonEnd:c,result:function(){if(!u.length)return null;var a=[],b=[];return u.forEach(function(c){d(c)?a.push([c]):b.push(c)}),b.forEach(function(b){var c=b[0];a.some(function(a){return f(a[0],c)?(a.push(b),!0):void 0})||a.push([b])}),u=[],a.length?a.length>1?{type:"MultiPolygon",coordinates:a}:{type:"Polygon",coordinates:a[0]}:null}},y={Point:v,MultiPoint:v,LineString:w,MultiLineString:w,Polygon:x,MultiPolygon:x,Sphere:x},z=1e-6,A=z*z,B=Math.PI,C=B/2,D=(Math.sqrt(B),B/180),E=180/B,F=e.geo.projection,G=e.geo.projectionMutator;e.geo.interrupt=function(a){function b(b,c){for(var d=0>c?-1:1,e=i[+(0>c)],f=0,g=e.length-1;g>f&&b>e[f][2][0];++f);var h=a(b-e[f][1][0],c);return h[0]+=a(e[f][1][0],d*c>d*e[f][0][1]?e[f][0][1]:c)[0],h}function c(){h=i.map(function(b){return b.map(function(b){var c,d=a(b[0][0],b[0][1])[0],e=a(b[2][0],b[2][1])[0],f=a(b[1][0],b[0][1])[1],g=a(b[1][0],b[1][1])[1];return f>g&&(c=f,f=g,g=c),[[d,f],[e,g]]})})}function d(){for(var a=1e-6,b=[],c=0,d=i[0].length;d>c;++c){var g=i[0][c],h=180*g[0][0]/B,j=180*g[0][1]/B,k=180*g[1][1]/B,l=180*g[2][0]/B,m=180*g[2][1]/B;b.push(f([[h+a,j+a],[h+a,k-a],[l-a,k-a],[l-a,m+a]],30))}for(var c=i[1].length-1;c>=0;--c){var g=i[1][c],h=180*g[0][0]/B,j=180*g[0][1]/B,k=180*g[1][1]/B,l=180*g[2][0]/B,m=180*g[2][1]/B;b.push(f([[l-a,m-a],[l-a,k+a],[h+a,k+a],[h+a,j-a]],30))}return{type:"Polygon",coordinates:[e.merge(b)]}}function f(a,b){for(var c,d,e,f=-1,g=a.length,h=a[0],i=[];++f<g;){c=a[f],d=(c[0]-h[0])/b,e=(c[1]-h[1])/b;for(var j=0;b>j;++j)i.push([h[0]+j*d,h[1]+j*e]);h=c}return i.push(c),i}function g(a,b){return Math.abs(a[0]-b[0])<z&&Math.abs(a[1]-b[1])<z}var h,i=[[[[-B,0],[0,C],[B,0]]],[[[-B,0],[0,-C],[B,0]]]];a.invert&&(b.invert=function(c,d){for(var e=h[+(0>d)],f=i[+(0>d)],j=0,k=e.length;k>j;++j){var l=e[j];if(l[0][0]<=c&&c<l[1][0]&&l[0][1]<=d&&d<l[1][1]){var m=a.invert(c-a(f[j][1][0],0)[0],d);return m[0]+=f[j][1][0],g(b(m[0],m[1]),[c,d])?m:null}}});var j=e.geo.projection(b),k=j.stream;return j.stream=function(a){var b=j.rotate(),c=k(a),f=(j.rotate([0,0]),k(a));return j.rotate(b),c.sphere=function(){e.geo.stream(d(),f)},c},j.lobes=function(a){return arguments.length?(i=a.map(function(a){return a.map(function(a){return[[a[0][0]*B/180,a[0][1]*B/180],[a[1][0]*B/180,a[1][1]*B/180],[a[2][0]*B/180,a[2][1]*B/180]]})}),c(),j):i.map(function(a){return a.map(function(a){return[[180*a[0][0]/B,180*a[0][1]/B],[180*a[1][0]/B,180*a[1][1]/B],[180*a[2][0]/B,180*a[2][1]/B]]})})},j},h.invert=function(a,b){var c=.5*b*Math.sqrt((4+B)/B),d=g(c),e=Math.cos(d);return[a/(2/Math.sqrt(B*(4+B))*(1+e)),g((d+c*(e+2))/(2+C))]},(e.geo.eckert4=function(){return F(h)}).raw=h;var H=e.geo.azimuthalEqualArea.raw;k.invert=function(a,b){var c=2*g(b/2);return[a*Math.cos(c/2)/Math.cos(c),c]},(e.geo.hammer=j).raw=i,l.invert=function(a,b){return[2/3*B*a/Math.sqrt(B*B/3-b*b),b]},(e.geo.kavrayskiy7=function(){return F(l)}).raw=l,m.invert=function(a,b){return[a,2.5*Math.atan(Math.exp(.8*b))-.625*B]},(e.geo.miller=function(){return F(m)}).raw=m;var I=(n(B),o(Math.SQRT2/C,Math.SQRT2,B));(e.geo.mollweide=function(){return F(I)}).raw=I,p.invert=function(a,b){var c,d=b,e=25;do{var f=d*d,g=f*f;d-=c=(d*(1.007226+f*(.015085+g*(-.044475+.028874*f-.005916*g)))-b)/(1.007226+f*(.045255+g*(-0.311325+.259866*f-.005916*11*g)))}while(Math.abs(c)>z&&--e>0);return[a/(.8707+(f=d*d)*(-.131979+f*(-.013791+f*f*f*(.003971-.001529*f)))),d]},(e.geo.naturalEarth=function(){return F(p)}).raw=p;var J=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];J.forEach(function(a){a[1]*=1.0144}),q.invert=function(a,b){var c=b/C,d=90*c,e=Math.min(18,Math.abs(d/5)),f=Math.max(0,Math.floor(e));do{var g=J[f][1],h=J[f+1][1],i=J[Math.min(19,f+2)][1],j=i-g,k=i-2*h+g,l=2*(Math.abs(c)-h)/j,m=k/j,n=l*(1-m*l*(1-2*m*l));if(n>=0||1===f){d=(b>=0?5:-5)*(n+e);var o,p=50;do e=Math.min(18,Math.abs(d)/5),f=Math.floor(e),n=e-f,g=J[f][1],h=J[f+1][1],i=J[Math.min(19,f+2)][1],d-=(o=(b>=0?C:-C)*(h+n*(i-g)/2+n*n*(i-2*h+g)/2)-b)*E;while(Math.abs(o)>A&&--p>0);break}}while(--f>=0);var q=J[f][0],r=J[f+1][0],s=J[Math.min(19,f+2)][0];return[a/(r+n*(s-q)/2+n*n*(s-2*r+q)/2),d*D]},(e.geo.robinson=function(){return F(q)}).raw=q,r.invert=function(a,b){return[a/Math.cos(b),b]},(e.geo.sinusoidal=function(){return F(r)}).raw=r}var e=a("d3");b.exports=d},{d3:70}],392:[function(a,b,c){"use strict";function d(a,b){var c=a.projection,d=a.lonaxis,g=a.lataxis,i=a.domain,j=a.framewidth||0,k=b.w*(i.x[1]-i.x[0]),l=b.h*(i.y[1]-i.y[0]),m=d.range[0]+h,n=d.range[1]-h,o=g.range[0]+h,p=g.range[1]-h,q=d._fullRange[0]+h,r=d._fullRange[1]-h,s=g._fullRange[0]+h,t=g._fullRange[1]-h;c._translate0=[b.l+k/2,b.t+l/2];var u=n-m,v=p-o,w=[m+u/2,o+v/2],x=c._rotate;c._center=[w[0]+x[0],w[1]+x[1]];var y=function(b){function d(a){return Math.min(v*k/(a[1][0]-a[0][0]),v*l/(a[1][1]-a[0][1]))}var g,h,i,u,v=b.scale(),w=c._translate0,x=e(m,o,n,p),y=e(q,s,r,t);i=f(b,x),g=d(i),u=f(b,y),c._fullScale=d(u),b.scale(g),i=f(b,x),h=[w[0]-i[0][0]+j,w[1]-i[0][1]+j],c._translate=h,b.translate(h),i=f(b,x),a._isAlbersUsa||b.clipExtent(i),g=c.scale*g,c._scale=g,a._width=Math.round(i[1][0])+j,a._height=Math.round(i[1][1])+j,a._marginX=(k-Math.round(i[1][0]))/2,a._marginY=(l-Math.round(i[1][1]))/2};return y}function e(a,b,c,d){var e=(c-a)/4;return{type:"Polygon",coordinates:[[[a,b],[a,d],[a+e,d],[a+2*e,d],[a+3*e,d],[c,d],[c,b],[c-e,b],[c-2*e,b],[c-3*e,b],[a,b]]]}}function f(a,b){return g.geo.path().projection(a).bounds(b)}var g=a("d3"),h=a("../../constants/geo_constants").clipPad;b.exports=d},{"../../constants/geo_constants":334,d3:70}],393:[function(a,b,c){"use strict";function d(a,b){var c;return(c=b._isScoped?f:b._clipAngle?h:g)(a,b.projection)}function e(a,b){var c=b._fullScale;return v.behavior.zoom().translate(a.translate()).scale(a.scale()).scaleExtent([.5*c,100*c])}function f(a,b){function c(){v.select(this).style(y)}function d(){g.scale(v.event.scale).translate(v.event.translate),a.render()}function f(){v.select(this).style(z)}var g=a.projection,h=e(g,b);return h.on("zoomstart",c).on("zoom",d).on("zoomend",f),h}function g(a,b){function c(a){return q.invert(a)}function d(a){var b=q(c(a));return Math.abs(b[0]-a[0])>s||Math.abs(b[1]-a[1])>s}function f(){v.select(this).style(y),i=v.mouse(this),j=q.rotate(),k=q.translate(),l=j,m=c(i)}function g(){return n=v.mouse(this),d(i)?(r.scale(q.scale()),void r.translate(q.translate())):(q.scale(v.event.scale),q.translate([k[0],v.event.translate[1]]),m?c(n)&&(p=c(n),o=[l[0]+(p[0]-m[0]),j[1],j[2]],q.rotate(o),l=o):(i=n,m=c(i)),void a.render())}function h(){v.select(this).style(z)}var i,j,k,l,m,n,o,p,q=a.projection,r=e(q,b),s=2;return r.on("zoomstart",f).on("zoom",g).on("zoomend",h),r}function h(a,b){function c(a){r++||a({type:"zoomstart"})}function d(a){a({type:"zoom"})}function f(a){--r||a({type:"zoomend"})}var g,h=a.projection,n={r:h.rotate(),k:h.scale()},o=e(h,b),p=u(o,"zoomstart","zoom","zoomend"),r=0,s=o.on;return o.on("zoomstart",function(){v.select(this).style(y);var a=v.mouse(this),b=h.rotate(),e=b,f=h.translate(),r=j(b);g=i(h,a),s.call(o,"zoom",function(){var c=v.mouse(this);if(h.scale(n.k=v.event.scale),g){if(i(h,c)){h.rotate(b).translate(f);var j=i(h,c),o=l(g,j),s=q(k(r,o)),t=n.r=m(s,g,e);isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])||(t=e),h.rotate(t),e=t}}else a=c,g=i(h,a);d(p.of(this,arguments))}),c(p.of(this,arguments))}).on("zoomend",function(){v.select(this).style(z),s.call(o,"zoom",null),f(p.of(this,arguments))}).on("zoom.redraw",function(){a.render()}),v.rebind(o,p,"on")}function i(a,b){var c=a.invert(b);return c&&isFinite(c[0])&&isFinite(c[1])&&r(c)}function j(a){var b=.5*a[0]*w,c=.5*a[1]*w,d=.5*a[2]*w,e=Math.sin(b),f=Math.cos(b),g=Math.sin(c),h=Math.cos(c),i=Math.sin(d),j=Math.cos(d);return[f*h*j+e*g*i,e*h*j-f*g*i,f*g*j+e*h*i,f*h*i-e*g*j]}function k(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=b[0],h=b[1],i=b[2],j=b[3];return[c*g-d*h-e*i-f*j,c*h+d*g+e*j-f*i,c*i-d*j+e*g+f*h,c*j+d*i-e*h+f*g]}function l(a,b){if(a&&b){var c=t(a,b),d=Math.sqrt(s(c,c)),e=.5*Math.acos(Math.max(-1,Math.min(1,s(a,b)))),f=Math.sin(e)/d;return d&&[Math.cos(e),c[2]*f,-c[1]*f,c[0]*f]}}function m(a,b,c){var d=p(b,2,a[0]);d=p(d,1,a[1]),d=p(d,0,a[2]-c[2]);var e,f,g=b[0],h=b[1],i=b[2],j=d[0],k=d[1],l=d[2],m=Math.atan2(h,g)*x,o=Math.sqrt(g*g+h*h);Math.abs(k)>o?(f=(k>0?90:-90)-m,e=0):(f=Math.asin(k/o)*x-m,e=Math.sqrt(o*o-k*k));var q=180-f-2*m,r=(Math.atan2(l,j)-Math.atan2(i,e))*x,s=(Math.atan2(l,j)-Math.atan2(i,-e))*x,t=n(c[0],c[1],f,r),u=n(c[0],c[1],q,s);return u>=t?[f,r,c[2]]:[q,s,c[2]]}function n(a,b,c,d){var e=o(c-a),f=o(d-b);return Math.sqrt(e*e+f*f)}function o(a){return(a%360+540)%360-180}function p(a,b,c){var d=c*w,e=a.slice(),f=0===b?1:0,g=2===b?1:2,h=Math.cos(d),i=Math.sin(d);return e[f]=a[f]*h-a[g]*i,e[g]=a[g]*h+a[f]*i,e}function q(a){return[Math.atan2(2*(a[0]*a[1]+a[2]*a[3]),1-2*(a[1]*a[1]+a[2]*a[2]))*x,Math.asin(Math.max(-1,Math.min(1,2*(a[0]*a[2]-a[3]*a[1]))))*x,Math.atan2(2*(a[0]*a[3]+a[1]*a[2]),1-2*(a[2]*a[2]+a[3]*a[3]))*x]}function r(a){var b=a[0]*w,c=a[1]*w,d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function s(a,b){for(var c=0,d=0,e=a.length;e>d;++d)c+=a[d]*b[d];return c}function t(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function u(a){for(var b=0,c=arguments.length,d=[];++b<c;)d.push(arguments[b]);var e=v.dispatch.apply(null,d);return e.of=function(b,c){return function(d){var f;try{f=d.sourceEvent=v.event,d.target=a,v.event=d,e[d.type].apply(b,c)}finally{v.event=f}}},e}var v=a("d3"),w=Math.PI/180,x=180/Math.PI,y={cursor:"pointer"},z={cursor:"auto"};b.exports=d},{d3:70}],394:[function(a,b,c){"use strict";function d(a,b){var c=a.projection,d=a.zoom,f=function(){a.makeProjection(b),a.makePath(),d.scale(c.scale()),d.translate(c.translate()),e.loneUnhover(a.hoverContainer),a.render()};return f}var e=a("../cartesian/graph_interact");b.exports=d},{"../cartesian/graph_interact":374}],395:[function(a,b,c){"use strict";function d(a,b){this.element=a,this.plot=b,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxStart=[0,0],this.boxEnd=[0,0]}function e(a){var b=a.mouseContainer,c=a.glplot,e=new d(b,c);return e.mouseListener=f(b,function(b,d,f){function g(b,c,d){var f=Math.min(c,d),g=Math.max(c,d);f!==g?(b[0]=f,b[1]=g,e.dataBox=b):(a.selectBox.selectBox=[0,0,1,1],a.glplot.setDirty())}var h=a.xaxis.range,i=a.yaxis.range,j=c.viewBox,k=e.lastPos[0],l=e.lastPos[1];switch(d*=c.pixelRatio,f*=c.pixelRatio,f=j[3]-j[1]-f,a.fullLayout.dragmode){case"zoom":if(b){var m=d/(j[2]-j[0])*(h[1]-h[0])+h[0],n=f/(j[3]-j[1])*(i[1]-i[0])+i[0];e.boxEnabled||(e.boxStart[0]=m,e.boxStart[1]=n),e.boxEnd[0]=m,e.boxEnd[1]=n,e.boxEnabled=!0}else e.boxEnabled&&(g(h,e.boxStart[0],e.boxEnd[0]),g(i,e.boxStart[1],e.boxEnd[1]),e.boxEnabled=!1);break;case"pan":if(e.boxEnabled=!1,b){var o=(k-d)*(h[1]-h[0])/(c.viewBox[2]-c.viewBox[0]),p=(l-f)*(i[1]-i[0])/(c.viewBox[3]-c.viewBox[1]);h[0]+=o,h[1]+=o,i[0]+=p,i[1]+=p,e.lastInputTime=Date.now(),a.cameraChanged()}}e.lastPos[0]=d,e.lastPos[1]=f}),e.wheelListener=g(b,function(b,d){var f=a.xaxis.range,g=a.yaxis.range,h=c.viewBox,i=e.lastPos[0],j=e.lastPos[1];switch(a.fullLayout.dragmode){case"zoom":break;case"pan":var k=Math.exp(.1*d/(h[3]-h[1])),l=i/(h[2]-h[0])*(f[1]-f[0])+f[0],m=j/(h[3]-h[1])*(g[1]-g[0])+g[0];f[0]=(f[0]-l)*k+l,f[1]=(f[1]-l)*k+l,g[0]=(g[0]-m)*k+m,g[1]=(g[1]-m)*k+m,e.lastInputTime=Date.now(),a.cameraChanged()}return!0}),e}var f=a("mouse-change"),g=a("mouse-wheel");b.exports=e},{"mouse-change":196,"mouse-wheel":200}],396:[function(a,b,c){"use strict";function d(a){this.scene=a,this.gl=a.gl,this.pixelRatio=a.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0]}function e(a){return new d(a)}var f=a("../../plotly"),g=a("../../lib/html2unicode"),h=a("../../lib/str2rgbarray"),i=d.prototype,j=["xaxis","yaxis"];i.merge=function(a){this.titleEnable=!1,this.backgroundColor=h(a.plot_bgcolor);var b,c,d,e,f,i,k,l,m,n,o;for(n=0;2>n;++n){for(b=j[n],c=a[this.scene[b]._name],d=/Click to enter .+ title/.test(c.title)?"":c.title,o=0;2>=o;o+=2)this.labelEnable[n+o]=!1,this.labels[n+o]=g(d),this.labelColor[n+o]=h(c.titlefont.color),this.labelFont[n+o]=c.titlefont.family,this.labelSize[n+o]=c.titlefont.size,this.labelPad[n+o]=this.getLabelPad(b,c),this.tickEnable[n+o]=!1,this.tickColor[n+o]=h((c.tickfont||{}).color),this.tickAngle[n+o]="auto"===c.tickangle?0:Math.PI*-c.tickangle/180,this.tickPad[n+o]=this.getTickPad(c),this.tickMarkLength[n+o]=0,this.tickMarkWidth[n+o]=c.tickwidth||0,this.tickMarkColor[n+o]=h(c.tickcolor),this.borderLineEnable[n+o]=!1,this.borderLineColor[n+o]=h(c.linecolor),this.borderLineWidth[n+o]=c.linewidth||0;k=this.hasSharedAxis(c),f=this.hasAxisInDfltPos(b,c)&&!k,i=this.hasAxisInAltrPos(b,c)&&!k,e=c.mirror||!1,l=k?-1!==String(e).indexOf("all"):!!e,m=k?"allticks"===e:-1!==String(e).indexOf("ticks"),f?this.labelEnable[n]=!0:i&&(this.labelEnable[n+2]=!0),f?this.tickEnable[n]=c.showticklabels:i&&(this.tickEnable[n+2]=c.showticklabels),(f||l)&&(this.borderLineEnable[n]=c.showline),(i||l)&&(this.borderLineEnable[n+2]=c.showline),(f||m)&&(this.tickMarkLength[n]=this.getTickMarkLength(c)),(i||m)&&(this.tickMarkLength[n+2]=this.getTickMarkLength(c)),this.gridLineEnable[n]=c.showgrid,this.gridLineColor[n]=h(c.gridcolor),this.gridLineWidth[n]=c.gridwidth,this.zeroLineEnable[n]=c.zeroline,this.zeroLineColor[n]=h(c.zerolinecolor),this.zeroLineWidth[n]=c.zerolinewidth}},i.hasSharedAxis=function(a){var b=this.scene,c=f.Plots.getSubplotIds(b.fullLayout,"gl2d"),d=f.Axes.findSubplotsWithAxis(c,a);return 0!==d.indexOf(b.id)},i.hasAxisInDfltPos=function(a,b){var c=b.side;return"xaxis"===a?"bottom"===c:"yaxis"===a?"left"===c:void 0},i.hasAxisInAltrPos=function(a,b){var c=b.side;return"xaxis"===a?"top"===c:"yaxis"===a?"right"===c:void 0},i.getLabelPad=function(a,b){var c=1.5,d=b.titlefont.size,e=b.showticklabels;return"xaxis"===a?"top"===b.side?-10+d*(c+(e?1:0)):-10+d*(c+(e?.5:0)):"yaxis"===a?"right"===b.side?10+d*(c+(e?1:.5)):10+d*(c+(e?.5:0)):void 0},i.getTickPad=function(a){return"outside"===a.ticks?10+a.ticklen:15},i.getTickMarkLength=function(a){if(!a.ticks)return 0;var b=a.ticklen;return"inside"===a.ticks?-b:b},b.exports=e},{"../../lib/html2unicode":348,"../../lib/str2rgbarray":359,"../../plotly":366}],397:[function(a,b,c){"use strict";var d=a("../../plotly"),e=a("./scene2d"),f=d.Plots;c.name="gl2d",c.attr=["xaxis","yaxis"],c.idRoot=["x","y"],c.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},c.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},c.attributes=a("../cartesian/attributes"),c.plot=function(a){for(var b=a._fullLayout,c=a._fullData,d=f.getSubplotIds(b,"gl2d"),g=0;g<d.length;g++){var h=d[g],i=b._plots[h],j=f.getSubplotData(c,"gl2d",h),k=i._scene2d;void 0===k&&(k=new e({container:a.querySelector(".gl-container"),id:h,staticPlot:a._context.staticPlot,plotGlPixelRatio:a._context.plotGlPixelRatio},b),i._scene2d=k),k.plot(j,b,a.layout)}}},{"../../plotly":366,"../cartesian/attributes":368,"./scene2d":398}],398:[function(a,b,c){"use strict";function d(a,b){this.container=a.container,this.pixelRatio=a.plotGlPixelRatio||window.devicePixelRatio,this.id=a.id,this.staticPlot=!!a.staticPlot,this.fullLayout=b,this.updateAxes(b),this.makeFramework(),this.glplotOptions=n(this),this.glplotOptions.merge(b),this.glplot=k(this.glplotOptions),this.camera=o(this),this.traces={},this.spikes=l(this.glplot),this.selectBox=m(this.glplot,{innerFill:!1,outerFill:!0}),this.pickResult=null,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function e(a,b){for(var c=0;2>c;++c){var d=a[c],e=b[c];if(d.length!==e.length)return!0;for(var f=0;f<d.length;++f)if(d[f].x!==e[f].x)return!0}return!1}var f,g,h=a("../../plots/plots"),i=a("../../plots/cartesian/axes"),j=a("../../plots/cartesian/graph_interact"),k=a("gl-plot2d"),l=a("gl-spikes2d"),m=a("gl-select-box"),n=a("./convert"),o=a("./camera"),p=a("../../lib/html2unicode"),q=a("../../lib/show_no_webgl_msg"),r=["xaxis","yaxis"];b.exports=d;var s=d.prototype;s.makeFramework=function(){if(this.staticPlot){if(!g){f=document.createElement("canvas");try{g=f.getContext("webgl",{preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0})}catch(a){throw new Error(["Error creating static canvas/context for image server"].join(" "))}}this.canvas=f,this.gl=g}else{var b,c=document.createElement("canvas"),d={premultipliedAlpha:!0};try{b=c.getContext("webgl",d)}catch(a){}if(!b)try{b=c.getContext("experimental-webgl",d)}catch(a){}b||q(this),this.canvas=c,this.gl=b}var e=this.canvas,h=this.pixelRatio,i=this.fullLayout;e.width=0|Math.ceil(h*i.width),e.height=0|Math.ceil(h*i.height),e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style["pointer-events"]="none";var j=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");j.style.position="absolute",j.style.top=j.style.left="0px",j.style.width=j.style.height="100%",j.style["z-index"]=20,j.style["pointer-events"]="none";var k=this.mouseContainer=document.createElement("div");k.style.position="absolute";var l=this.container;l.appendChild(e),l.appendChild(j),l.appendChild(k)},s.toImage=function(a){a||(a="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(f),this.glplot.setDirty(!0),this.glplot.draw();var b=this.glplot.gl,c=b.drawingBufferWidth,d=b.drawingBufferHeight;b.bindFramebuffer(b.FRAMEBUFFER,null);var e=new Uint8Array(c*d*4);b.readPixels(0,0,c,d,b.RGBA,b.UNSIGNED_BYTE,e);for(var g=0,h=d-1;h>g;++g,--h)for(var i=0;c>i;++i)for(var j=0;4>j;++j){var k=e[4*(c*g+i)+j];e[4*(c*g+i)+j]=e[4*(c*h+i)+j],e[4*(c*h+i)+j]=k}var l=document.createElement("canvas");l.width=c,l.height=d;var m=l.getContext("2d"),n=m.createImageData(c,d);n.data.set(e),m.putImageData(n,0,0);var o;switch(a){case"jpeg":o=l.toDataURL("image/jpeg");break;case"webp":o=l.toDataURL("image/webp");break;default:o=l.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(f),o},s.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var a=[i.calcTicks(this.xaxis),i.calcTicks(this.yaxis)],b=0;2>b;++b)for(var c=0;c<a[b].length;++c)a[b][c].text=p(a[b][c].text+"").replace(/\n/g," ");return a},s.updateAxes=function(a){var b=i.subplotMatch,c="xaxis"+this.id.match(b)[1],d="yaxis"+this.id.match(b)[2];this.xaxis=a[c],this.yaxis=a[d]},s.updateFx=function(a){var b=this.fullLayout;b.dragmode=a.dragmode,b.hovermode=a.hovermode},s.cameraChanged=function(){var a=this.camera,b=this.xaxis.range,c=this.yaxis.range;this.glplot.setDataBox([b[0],c[0],b[1],c[1]]);var d=this.computeTickMarks(),f=this.glplotOptions.ticks;e(d,f)&&(this.glplotOptions.ticks=d,this.glplotOptions.dataBox=a.dataBox,this.glplot.update(this.glplotOptions))},s.destroy=function(){this.glplot.dispose()},s.plot=function(a,b){var c,d,e=this.glplot,f=this.pixelRatio;this.fullLayout=b,this.updateAxes(b);var g=b.width,j=b.height,k=0|Math.ceil(f*g),l=0|Math.ceil(f*j),m=this.canvas;m.width===k&&m.height===l||(m.width=k,m.height=l),a?Array.isArray(a)||(a=[a]):a=[];var n,o;for(c=0;c<a.length;++c){if(n=a[c],o=this.traces[n.uid])o.update(n);else{var p=h.getModule(n.type);o=p.plot(this,n)}this.traces[n.uid]=o}var q=Object.keys(this.traces);a:for(c=0;c<q.length;++c){for(d=0;d<a.length;++d)if(a[d].uid===q[c])continue a;o=this.traces[q[c]],o.dispose(),delete this.traces[q[c]]}var s=this.glplotOptions;s.merge(b),s.screenBox=[0,0,g,j];var t=b._size,u=this.xaxis.domain,v=this.yaxis.domain;s.viewBox=[t.l+u[0]*t.w,t.b+v[0]*t.h,g-t.r-(1-u[1])*t.w,j-t.t-(1-v[1])*t.h],this.mouseContainer.style.width=t.w*(u[1]-u[0])+"px",this.mouseContainer.style.height=t.h*(v[1]-v[0])+"px",this.mouseContainer.height=t.h*(v[1]-v[0]),this.mouseContainer.style.left=t.l+u[0]*t.w+"px",this.mouseContainer.style.top=t.t+(1-v[1])*t.h+"px";var w=this.bounds;for(w[0]=w[1]=1/0,w[2]=w[3]=-(1/0),q=Object.keys(this.traces),c=0;c<q.length;++c){o=this.traces[q[c]];for(var x=0;2>x;++x)w[x]=Math.min(w[x],o.bounds[x]),w[x+2]=Math.max(w[x+2],o.bounds[x+2])}var y;for(c=0;2>c;++c)w[c]>w[c+2]&&(w[c]=-1,w[c+2]=1),y=this[r[c]],y._length=s.viewBox[c+2]-s.viewBox[c],i.doAutoRange(y);s.ticks=this.computeTickMarks();var z=this.xaxis.range,A=this.yaxis.range;s.dataBox=[z[0],A[0],z[1],A[1]],s.merge(b),e.update(s)},s.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var a=this.glplot,b=this.camera,c=b.mouseListener,d=this.fullLayout;this.cameraChanged();var e=c.x*a.pixelRatio,f=this.canvas.height-a.pixelRatio*c.y;if(b.boxEnabled&&"zoom"===d.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(b.boxStart[0],b.boxEnd[0]),Math.min(b.boxStart[1],b.boxEnd[1]),Math.max(b.boxStart[0],b.boxEnd[0]),Math.max(b.boxStart[1],b.boxEnd[1])],a.setDirty();else{this.selectBox.enabled=!1;var g=d._size,h=this.xaxis.domain,i=this.yaxis.domain,k=a.pick(e/a.pixelRatio+g.l+h[0]*g.w,f/a.pixelRatio-(g.t+(1-i[1])*g.h));if(k&&d.hovermode){var l=k.object._trace.handlePick(k);if(l&&(!this.lastPickResult||this.lastPickResult.trace!==l.trace||this.lastPickResult.dataCoord[0]!==l.dataCoord[0]||this.lastPickResult.dataCoord[1]!==l.dataCoord[1])){var m=this.lastPickResult=l;this.spikes.update({center:k.dataCoord}),m.screenCoord=[((a.viewBox[2]-a.viewBox[0])*(k.dataCoord[0]-a.dataBox[0])/(a.dataBox[2]-a.dataBox[0])+a.viewBox[0])/a.pixelRatio,(this.canvas.height-(a.viewBox[3]-a.viewBox[1])*(k.dataCoord[1]-a.dataBox[1])/(a.dataBox[3]-a.dataBox[1])-a.viewBox[1])/a.pixelRatio];var n=m.hoverinfo;if("all"!==n){var o=n.split("+");-1===o.indexOf("x")&&(m.traceCoord[0]=void 0),-1===o.indexOf("y")&&(m.traceCoord[1]=void 0),-1===o.indexOf("text")&&(m.textLabel=void 0),-1===o.indexOf("name")&&(m.name=void 0)}j.loneHover({x:m.screenCoord[0],y:m.screenCoord[1],xLabel:this.hoverFormatter("xaxis",m.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",m.traceCoord[1]),text:m.textLabel,name:m.name,color:m.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:k.dataCoord}}}else!k&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,j.loneUnhover(this.svgContainer))}a.draw()}},s.hoverFormatter=function(a,b){if(void 0!==b){var c=this[a];return i.tickText(c,c.c2l(b),"hover").text}}},{"../../lib/html2unicode":348,"../../lib/show_no_webgl_msg":357,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"../../plots/plots":413,"./camera":395,"./convert":396,"gl-plot2d":122,"gl-select-box":152,"gl-spikes2d":178}],399:[function(a,b,c){"use strict";function d(a,b){a=a||document.body,b=b||{};var c=[.01,1/0];"distanceLimits"in b&&(c[0]=b.distanceLimits[0],c[1]=b.distanceLimits[1]),"zoomMin"in b&&(c[0]=b.zoomMin),"zoomMax"in b&&(c[1]=b.zoomMax);var d=f({center:b.center||[0,0,0],up:b.up||[0,1,0],eye:b.eye||[0,0,10],mode:b.mode||"orbit",distanceLimits:c}),i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=0,k=a.clientWidth,l=a.clientHeight,m={keyBindingMode:"rotate",view:d,element:a,delay:b.delay||16,rotateSpeed:b.rotateSpeed||1,zoomSpeed:b.zoomSpeed||1,translateSpeed:b.translateSpeed||1,flipX:!!b.flipX,flipY:!!b.flipY,modes:d.modes,tick:function(){var b=e(),c=this.delay,f=b-2*c;d.idle(b-c),d.recalcMatrix(f),d.flush(b-(100+2*c));for(var g=!0,h=d.computedMatrix,m=0;16>m;++m)g=g&&i[m]===h[m],i[m]=h[m];var n=a.clientWidth===k&&a.clientHeight===l;return k=a.clientWidth,l=a.clientHeight,g?!n:(j=Math.exp(d.computedRadius[0]),!0)},lookAt:function(a,b,c){d.lookAt(d.lastT(),a,b,c)},rotate:function(a,b,c){d.rotate(d.lastT(),a,b,c)},pan:function(a,b,c){d.pan(d.lastT(),a,b,c)},translate:function(a,b,c){d.translate(d.lastT(),a,b,c)}};Object.defineProperties(m,{matrix:{get:function(){return d.computedMatrix},set:function(a){return d.setMatrix(d.lastT(),a),d.computedMatrix},enumerable:!0},mode:{get:function(){return d.getMode()},set:function(a){var b=d.computedUp.slice(),c=d.computedEye.slice(),f=d.computedCenter.slice();if(d.setMode(a),"turntable"===a){var g=e();d._active.lookAt(g,c,f,b),d._active.lookAt(g+500,c,f,[0,0,1]),d._active.flush(g)}return d.getMode()},enumerable:!0},center:{get:function(){return d.computedCenter},set:function(a){return d.lookAt(d.lastT(),null,a),d.computedCenter},enumerable:!0},eye:{get:function(){return d.computedEye},set:function(a){return d.lookAt(d.lastT(),a),d.computedEye},enumerable:!0},up:{get:function(){return d.computedUp},set:function(a){return d.lookAt(d.lastT(),null,null,a),d.computedUp},enumerable:!0},distance:{get:function(){return j},set:function(a){return d.setDistance(d.lastT(),a),a},enumerable:!0},distanceLimits:{get:function(){return d.getDistanceLimits(c)},set:function(a){return d.setDistanceLimits(a),a},enumerable:!0}}),a.addEventListener("contextmenu",function(a){return a.preventDefault(),!1});var n=0,o=0;return g(a,function(b,c,f,g){var h="rotate"===m.keyBindingMode,i="pan"===m.keyBindingMode,k="zoom"===m.keyBindingMode,l=!!g.control,p=!!g.alt,q=!!g.shift,r=!!(1&b),s=!!(2&b),t=!!(4&b),u=1/a.clientHeight,v=u*(c-n),w=u*(f-o),x=m.flipX?1:-1,y=m.flipY?1:-1,z=e(),A=Math.PI*m.rotateSpeed;if((h&&r&&!l&&!p&&!q||r&&!l&&!p&&q)&&d.rotate(z,x*A*v,-y*A*w,0),(i&&r&&!l&&!p&&!q||s||r&&l&&!p&&!q)&&d.pan(z,-m.translateSpeed*v*j,m.translateSpeed*w*j,0),k&&r&&!l&&!p&&!q||t||r&&!l&&p&&!q){var B=-m.zoomSpeed*w/window.innerHeight*(z-d.lastT())*100;d.pan(z,0,0,j*(Math.exp(B)-1))}return n=c,o=f,!0}),h(a,function(a,b){var c=m.flipX?1:-1,f=m.flipY?1:-1,g=e();if(Math.abs(a)>Math.abs(b))d.rotate(g,0,0,-a*c*Math.PI*m.rotateSpeed/window.innerWidth);else{var h=-m.zoomSpeed*f*b/window.innerHeight*(g-d.lastT())/100;d.pan(g,0,0,j*(Math.exp(h)-1))}},!0),m}b.exports=d;var e=a("right-now"),f=a("3d-view"),g=a("mouse-change"),h=a("mouse-wheel")},{"3d-view":38,"mouse-change":196,"mouse-wheel":200,"right-now":210}],400:[function(a,b,c){"use strict";var d=a("./scene"),e=a("../plots"),f=["xaxis","yaxis","zaxis"];c.name="gl3d",c.attr="scene",c.idRoot="scene",c.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,c.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,c.attributes=a("./layout/attributes"),c.layoutAttributes=a("./layout/layout_attributes"),c.supplyLayoutDefaults=a("./layout/defaults"),c.plot=function(a){var b=a._fullLayout,c=a._fullData,f=e.getSubplotIds(b,"gl3d");b._paperdiv.style({width:b.width+"px",height:b.height+"px"}),a._context.setBackground(a,b.paper_bgcolor);for(var g=0;g<f.length;g++){var h=f[g],i=e.getSubplotData(c,"gl3d",h),j=b[h]._scene;void 0===j&&(j=new d({id:h,graphDiv:a,container:a.querySelector(".gl-container"),staticPlot:a._context.staticPlot,plotGlPixelRatio:a._context.plotGlPixelRatio},b),b[h]._scene=j),j.plot(i,b,a.layout)}},c.clean=function(a,b,c,d){for(var f=e.getSubplotIds(d,"gl3d"),g=0;g<f.length;g++){var h=f[g];!b[h]&&d[h]._scene&&d[h]._scene.destroy()}},c.cleanId=function(a){if(a.match(/^scene[0-9]*$/)){var b=a.substr(5);return"1"===b&&(b=""),"scene"+b}},c.setConvert=a("./set_convert"),c.initAxes=function(a){for(var b=a._fullLayout,c=e.getSubplotIds(b,"gl3d"),d=0;d<c.length;++d)for(var g=c[d],h=b[g],i=0;3>i;++i){var j=f[i],k=h[j];k._td=a}}},{"../plots":413,"./layout/attributes":401,"./layout/defaults":405,"./layout/layout_attributes":406,"./scene":410,"./set_convert":411}],401:[function(a,b,c){"use strict";b.exports={scene:{valType:"sceneid",dflt:"scene"}}},{}],402:[function(a,b,c){"use strict";var d=a("../../cartesian/layout_attributes"),e=a("../../../lib/extend").extendFlat;b.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:"rgb(0,0,0)"},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},title:d.title,titlefont:d.titlefont,type:d.type,autorange:d.autorange,rangemode:d.rangemode,range:d.range,fixedrange:d.fixedrange,tickmode:d.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:d.ticks,mirror:d.mirror,ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,showticklabels:d.showticklabels,tickfont:d.tickfont,tickangle:d.tickangle,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,showexponent:d.showexponent,exponentformat:d.exponentformat,tickformat:d.tickformat,hoverformat:d.hoverformat,showline:d.showline,linecolor:d.linecolor,linewidth:d.linewidth,showgrid:d.showgrid,gridcolor:e({},d.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:d.gridwidth,zeroline:d.zeroline,zerolinecolor:d.zerolinecolor,zerolinewidth:d.zerolinewidth}},{"../../../lib/extend":345,"../../cartesian/layout_attributes":376}],403:[function(a,b,c){"use strict";var d=a("../../../lib"),e=a("./axis_attributes"),f=a("../../cartesian/axis_defaults"),g=["xaxis","yaxis","zaxis"],h=function(){};b.exports=function(a,b,c){function i(a,b){return d.coerce(j,k,e,a,b)}for(var j,k,l=0;l<g.length;l++){var m=g[l];j=a[m]||{},k={_id:m[0]+c.scene,_name:m},b[m]=k=f(j,k,i,{font:c.font,letter:m[0],data:c.data,showGrid:!0}),i("gridcolor"),i("title",m[0]),k.setScale=h,i("showspikes")&&(i("spikesides"),i("spikethickness"),i("spikecolor")),i("showbackground")&&i("backgroundcolor"),i("showaxeslabels")}}},{"../../../lib":349,"../../cartesian/axis_defaults":370,"./axis_attributes":402}],404:[function(a,b,c){"use strict";function d(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2], 53 this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=i(this.tickPad),this._defaultLabelPad=i(this.labelPad),this._defaultLineTickLength=i(this.lineTickLength)}function e(a){var b=new d;return b.merge(a),b}var f=a("arraytools"),g=a("../../../lib/html2unicode"),h=a("../../../lib/str2rgbarray"),i=f.copy1D,j=["xaxis","yaxis","zaxis"],k=d.prototype;k.merge=function(a){for(var b=this,c=0;3>c;++c){var d=a[j[c]];b.labels[c]=g(d.title),"titlefont"in d&&(d.titlefont.color&&(b.labelColor[c]=h(d.titlefont.color)),d.titlefont.family&&(b.labelFont[c]=d.titlefont.family),d.titlefont.size&&(b.labelSize[c]=d.titlefont.size)),"showline"in d&&(b.lineEnable[c]=d.showline),"linecolor"in d&&(b.lineColor[c]=h(d.linecolor)),"linewidth"in d&&(b.lineWidth[c]=d.linewidth),"showgrid"in d&&(b.gridEnable[c]=d.showgrid),"gridcolor"in d&&(b.gridColor[c]=h(d.gridcolor)),"gridwidth"in d&&(b.gridWidth[c]=d.gridwidth),"log"===d.type?b.zeroEnable[c]=!1:"zeroline"in d&&(b.zeroEnable[c]=d.zeroline),"zerolinecolor"in d&&(b.zeroLineColor[c]=h(d.zerolinecolor)),"zerolinewidth"in d&&(b.zeroLineWidth[c]=d.zerolinewidth),"ticks"in d&&d.ticks?b.lineTickEnable[c]=!0:b.lineTickEnable[c]=!1,"ticklen"in d&&(b.lineTickLength[c]=b._defaultLineTickLength[c]=d.ticklen),"tickcolor"in d&&(b.lineTickColor[c]=h(d.tickcolor)),"tickwidth"in d&&(b.lineTickWidth[c]=d.tickwidth),"tickangle"in d&&(b.tickAngle[c]="auto"===d.tickangle?0:Math.PI*-d.tickangle/180),"showticklabels"in d&&(b.tickEnable[c]=d.showticklabels),"tickfont"in d&&(d.tickfont.color&&(b.tickColor[c]=h(d.tickfont.color)),d.tickfont.family&&(b.tickFont[c]=d.tickfont.family),d.tickfont.size&&(b.tickSize[c]=d.tickfont.size)),"mirror"in d?-1!==["ticks","all","allticks"].indexOf(d.mirror)?(b.lineTickMirror[c]=!0,b.lineMirror[c]=!0):d.mirror===!0?(b.lineTickMirror[c]=!1,b.lineMirror[c]=!0):(b.lineTickMirror[c]=!1,b.lineMirror[c]=!1):b.lineMirror[c]=!1,"showbackground"in d&&d.showbackground!==!1?(b.backgroundEnable[c]=!0,b.backgroundColor[c]=h(d.backgroundcolor)):b.backgroundEnable[c]=!1}},b.exports=e},{"../../../lib/html2unicode":348,"../../../lib/str2rgbarray":359,arraytools:48}],405:[function(a,b,c){"use strict";var d=a("../../../lib"),e=a("../../plots"),f=a("./layout_attributes"),g=a("./axis_defaults");b.exports=function(a,b,c){function h(a,b){return d.coerce(j,k,f,a,b)}function i(c){var d=!(b._hasCartesian||b._hasGeo||b._hasGL2D||b._hasPie),e=-1!==f[c].values.indexOf(a[c]);return d&&e?a[c]:void 0}if(b._hasGL3D)for(var j,k,l=e.findSubplotIds(c,"gl3d"),m=l.length,n=0;m>n;n++){var o=l[n];a[o]?j=a[o]:a[o]=j={},k=b[o]||{},h("bgcolor");for(var p=Object.keys(f.camera),q=0;q<p.length;q++)h("camera."+p[q]+".x"),h("camera."+p[q]+".y"),h("camera."+p[q]+".z");h("domain.x",[n/m,(n+1)/m]),h("domain.y");var r=!!h("aspectratio.x")&&!!h("aspectratio.y")&&!!h("aspectratio.z"),s=r?"manual":"auto",t=h("aspectmode",s);r||(j.aspectratio=k.aspectratio={x:1,y:1,z:1},"manual"===t&&(k.aspectmode="auto")),g(j,k,{font:b.font,scene:o,data:c}),h("dragmode",i("dragmode")),h("hovermode",i("hovermode")),b[o]=k}}},{"../../../lib":349,"../../plots":413,"./axis_defaults":403,"./layout_attributes":406}],406:[function(a,b,c){"use strict";function d(a,b,c){return{x:{valType:"number",dflt:a},y:{valType:"number",dflt:b},z:{valType:"number",dflt:c}}}var e=a("./axis_attributes"),f=a("../../../lib/extend").extendFlat;b.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:f(d(0,0,1),{}),center:f(d(0,0,0),{}),eye:f(d(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:e,yaxis:e,zaxis:e,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan"],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":345,"./axis_attributes":402}],407:[function(a,b,c){"use strict";function d(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function e(a){var b=new d;return b.merge(a),b}var f=a("../../../lib/str2rgbarray"),g=["xaxis","yaxis","zaxis"],h=d.prototype;h.merge=function(a){for(var b=0;3>b;++b){var c=a[g[b]];this.enabled[b]=c.showspikes,this.colors[b]=f(c.spikecolor),this.drawSides[b]=c.spikesides,this.lineWidth[b]=c.spikethickness}},b.exports=e},{"../../../lib/str2rgbarray":359}],408:[function(a,b,c){"use strict";function d(a){for(var b=new Array(3),c=0;3>c;++c){for(var d=a[c],e=new Array(d.length),f=0;f<d.length;++f)e[f]=d[f].x;b[c]=e}return b}function e(a){for(var b=a.axesOptions,c=a.glplot.axesPixels,e=a.fullSceneLayout,j=[[],[],[]],k=0;3>k;++k){var l=e[h[k]];if(l._length=(c[k].hi-c[k].lo)*c[k].pixelsPerDataUnit/a.dataScale[k],Math.abs(l._length)===1/0)j[k]=[];else{l.range[0]=c[k].lo/a.dataScale[k],l.range[1]=c[k].hi/a.dataScale[k],l._m=1/(a.dataScale[k]*c[k].pixelsPerDataUnit),l.range[0]===l.range[1]&&(l.range[0]-=1,l.range[1]+=1);var m=l.tickmode;if("auto"===l.tickmode){l.tickmode="linear";var n=l.nticks||f.Lib.constrain(l._length/40,4,9);f.Axes.autoTicks(l,Math.abs(l.range[1]-l.range[0])/n)}for(var o=f.Axes.calcTicks(l),p=0;p<o.length;++p)o[p].x=o[p].x*a.dataScale[k],o[p].text=g(o[p].text);j[k]=o,l.tickmode=m}}b.ticks=j;for(var k=0;3>k;++k){i[k]=.5*(a.glplot.bounds[0][k]+a.glplot.bounds[1][k]);for(var p=0;2>p;++p)b.bounds[p][k]=a.glplot.bounds[p][k]}a.contourLevels=d(j)}b.exports=e;var f=a("../../../plotly"),g=a("../../../lib/html2unicode"),h=["xaxis","yaxis","zaxis"],i=[0,0,0]},{"../../../lib/html2unicode":348,"../../../plotly":366}],409:[function(a,b,c){"use strict";function d(a,b){var c,d,e=[0,0,0,0];for(c=0;4>c;++c)for(d=0;4>d;++d)e[d]+=a[4*c+d]*b[c];return e}function e(a,b){var c=d(a.projection,d(a.view,d(a.model,[b[0],b[1],b[2],1])));return c}b.exports=e},{}],410:[function(a,b,c){"use strict";function d(a){function b(b,c){if("string"==typeof c)return c;var d=a.fullSceneLayout[b];return n.tickText(d,d.c2l(c),"hover").text}var c=a.svgContainer,d=a.container.getBoundingClientRect(),e=d.width,f=d.height;c.setAttributeNS(null,"viewBox","0 0 "+e+" "+f),c.setAttributeNS(null,"width",e),c.setAttributeNS(null,"height",f),w(a),a.glplot.axes.update(a.axesOptions);for(var g=Object.keys(a.traces),h=null,i=a.glplot.selection,j=0;j<g.length;++j){var k=a.traces[g[j]];k.handlePick(i)&&(h=k),k.setContourLevels&&k.setContourLevels()}var l;if(null!==h){var m=s(a.glplot.cameraParams,i.dataCoordinate),k=h.data,p=k.hoverinfo,q=b("xaxis",i.traceCoordinate[0]),r=b("yaxis",i.traceCoordinate[1]),t=b("zaxis",i.traceCoordinate[2]);if("all"!==p){var u=p.split("+");-1===u.indexOf("x")&&(q=void 0),-1===u.indexOf("y")&&(r=void 0),-1===u.indexOf("z")&&(t=void 0),-1===u.indexOf("text")&&(i.textLabel=void 0),-1===u.indexOf("name")&&(h.name=void 0)}a.fullSceneLayout.hovermode&&o.loneHover({x:(.5+.5*m[0]/m[3])*e,y:(.5-.5*m[1]/m[3])*f,xLabel:q,yLabel:r,zLabel:t,text:i.textLabel,name:h.name,color:h.color},{container:c});var v={points:[{x:q,y:r,z:t,data:k._input,fullData:k,curveNumber:k.index,pointNumber:i.data.index}]};i.buttons&&i.distance<5?a.graphDiv.emit("plotly_click",v):a.graphDiv.emit("plotly_hover",v),l=v}else o.loneUnhover(c),a.graphDiv.emit("plotly_unhover",l)}function e(a,b,c,e){var f={canvas:c,gl:e,container:a.container,axes:a.axesOptions,spikes:a.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(a.staticMode){if(!j){i=document.createElement("canvas");try{j=i.getContext("webgl",{preserveDrawingBuffer:!0,premultipliedAlpha:!0})}catch(g){throw new Error("error creating static canvas/context for image server")}}f.pixelRatio=a.pixelRatio,f.gl=j,f.canvas=i}try{a.glplot=k(f)}catch(g){q(a)}if(a.staticMode||a.glplot.canvas.addEventListener("webglcontextlost",function(a){console.log("lost context"),a.preventDefault()}),!a.camera){var h=a.fullSceneLayout.camera;a.camera=r(a.container,{center:[h.center.x,h.center.y,h.center.z],eye:[h.eye.x,h.eye.y,h.eye.z],up:[h.up.x,h.up.y,h.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return a.glplot.mouseListener.enabled=!1,a.glplot.camera=a.camera,a.glplot.oncontextloss=function(){a.recoverContext()},a.glplot.onrender=d.bind(null,a),a.traces={},!0}function f(a,b){var c=document.createElement("div"),d=a.container;this.graphDiv=a.graphDiv;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.style.position="absolute",f.style.top=f.style.left="0px",f.style.width=f.style.height="100%",f.style["z-index"]=20,f.style["pointer-events"]="none",c.appendChild(f),this.svgContainer=f,c.id=a.id,c.style.position="absolute",c.style.top=c.style.left="0px",c.style.width=c.style.height="100%",d.appendChild(c),this.fullLayout=b,this.id=a.id||"scene",this.fullSceneLayout=b[this.id],this.plotArgs=[[],{},{}],this.axesOptions=u(b[this.id]),this.spikeOptions=v(b[this.id]),this.container=c,this.staticMode=!!a.staticPlot,this.pixelRatio=a.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],!e(this,b)}function g(a,b,c,d){for(var e=0;e<b.length;++e)if(Array.isArray(b[e]))for(var f=0;f<b[e].length;++f){var g=a.d2l(b[e][f]);!isNaN(g)&&isFinite(g)&&(d[0][c]=Math.min(d[0][c],g),d[1][c]=Math.max(d[1][c],g))}else{var g=a.d2l(b[e]);!isNaN(g)&&isFinite(g)&&(d[0][c]=Math.min(d[0][c],g),d[1][c]=Math.max(d[1][c],g))}}function h(a,b,c){var d=a.fullSceneLayout;g(d.xaxis,b.x,0,c),g(d.yaxis,b.y,1,c),g(d.zaxis,b.z,2,c)}var i,j,k=a("gl-plot3d"),l=a("../../lib"),m=a("../../plots/plots"),n=a("../../plots/cartesian/axes"),o=a("../../plots/cartesian/graph_interact"),p=a("../../lib/str2rgbarray"),q=a("../../lib/show_no_webgl_msg"),r=a("./camera"),s=a("./project"),t=a("./set_convert"),u=a("./layout/convert"),v=a("./layout/spikes"),w=a("./layout/tick_marks"),x=f.prototype;x.recoverContext=function(){function a(){return c.isContextLost()?void requestAnimationFrame(a):e(b,b.fullLayout,d,c)?void b.plot.apply(b,b.plotArgs):void console.error("catastrophic/unrecoverable webgl error. context lost.")}var b=this,c=this.glplot.gl,d=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(a)};var y=["xaxis","yaxis","zaxis"];x.plot=function(a,b,c){if(this.plotArgs=[a,b,c],!this.glplot.contextLost){var d,e,f,g,i=b[this.id],j=c[this.id];for(i.bgcolor?this.glplot.clearColor=p(i.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullSceneLayout=i,this.glplotLayout=i,this.axesOptions.merge(i),this.spikeOptions.merge(i),this.updateFx(i.dragmode,i.hovermode),this.glplot.update({}),f=0;3>f;++f){var k=i[y[f]];t(k)}a?Array.isArray(a)||(a=[a]):a=[];for(var l=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],f=0;f<a.length;++f){var d=a[f];d.visible===!0&&h(this,d,l)}for(var n=[1,1,1],g=0;3>g;++g)l[0][g]>l[1][g]?n[g]=1:l[1][g]===l[0][g]?n[g]=1:n[g]=1/(l[1][g]-l[0][g]);this.dataScale=n;for(var f=0;f<a.length;++f)if(d=a[f],d.visible===!0){if(e=this.traces[d.uid])e.update(d);else{var o=m.getModule(d.type);e=o.plot(this,d),this.traces[d.uid]=e}e.name=d.name}var q=Object.keys(this.traces);a:for(f=0;f<q.length;++f){for(g=0;g<a.length;++g)if(a[g].uid===q[f]&&a[g].visible===!0)continue a;e=this.traces[q[f]],e.dispose(),delete this.traces[q[f]]}var r=[[0,0,0],[0,0,0]],s=[],u={};for(f=0;3>f;++f){var k=i[y[f]],v=k.type;if(v in u?(u[v].acc*=n[f],u[v].count+=1):u[v]={acc:n[f],count:1},k.autorange){for(r[0][f]=1/0,r[1][f]=-(1/0),g=0;g<this.glplot.objects.length;++g){var w=this.glplot.objects[g].bounds;r[0][f]=Math.min(r[0][f],w[0][f]/n[f]),r[1][f]=Math.max(r[1][f],w[1][f]/n[f])}if("rangemode"in k&&"tozero"===k.rangemode&&(r[0][f]=Math.min(r[0][f],0),r[1][f]=Math.max(r[1][f],0)),r[0][f]>r[1][f])r[0][f]=-1,r[1][f]=1;else{var x=r[1][f]-r[0][f];r[0][f]-=x/32,r[1][f]+=x/32}}else{var z=i[y[f]].range;r[0][f]=z[0],r[1][f]=z[1]}r[0][f]===r[1][f]&&(r[0][f]-=1,r[1][f]+=1),s[f]=r[1][f]-r[0][f],this.glplot.bounds[0][f]=r[0][f]*n[f],this.glplot.bounds[1][f]=r[1][f]*n[f]}for(var A=[1,1,1],f=0;3>f;++f){var k=i[y[f]],v=k.type,B=u[v];A[f]=Math.pow(B.acc,1/B.count)/n[f]}var C,D=4;if("auto"===i.aspectmode)C=Math.max.apply(null,A)/Math.min.apply(null,A)<=D?A:[1,1,1];else if("cube"===i.aspectmode)C=[1,1,1];else if("data"===i.aspectmode)C=A;else{if("manual"!==i.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var E=i.aspectratio;C=[E.x,E.y,E.z]}i.aspectratio.x=j.aspectratio.x=C[0],i.aspectratio.y=j.aspectratio.y=C[1],i.aspectratio.z=j.aspectratio.z=C[2],this.glplot.aspect=C;var F=i.domain||null,G=b._size||null;if(F&&G){var H=this.container.style;H.position="absolute",H.left=G.l+F.x[0]*G.w+"px",H.top=G.t+(1-F.y[1])*G.h+"px",H.width=G.w*(F.x[1]-F.x[0])+"px",H.height=G.h*(F.y[1]-F.y[0])+"px"}}},x.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},x.setCameraToDefault=function(){this.glplot.camera.lookAt([1.25,1.25,1.25],[0,0,0],[0,0,1])},x.getCamera=function(){this.glplot.camera.view.recalcMatrix(this.camera.view.lastT());var a=this.glplot.camera.up,b=this.glplot.camera.center,c=this.glplot.camera.eye;return{up:{x:a[0],y:a[1],z:a[2]},center:{x:b[0],y:b[1],z:b[2]},eye:{x:c[0],y:c[1],z:c[2]}}},x.setCamera=function(a){var b=a.up,c=a.center,d=a.eye;this.glplot.camera.lookAt([d.x,d.y,d.z],[c.x,c.y,c.z],[b.x,b.y,b.z])},x.saveCamera=function(a){function b(a,b,c,d){var e=["up","center","eye"],f=["x","y","z"];return a[e[c]][f[d]]===b[e[c]][f[d]]}var c=this.getCamera(),d=l.nestedProperty(a,this.id+".camera"),e=d.get(),f=!1;if(void 0===e)f=!0;else for(var g=0;3>g;g++)for(var h=0;3>h;h++)if(!b(c,e,g,h)){f=!0;break}return f&&d.set(c),f},x.updateFx=function(a,b){var c=this.camera;c&&("orbit"===a?(c.mode="orbit",c.keyBindingMode="rotate"):"turntable"===a?(c.up=[0,0,1],c.mode="turntable",c.keyBindingMode="rotate"):c.keyBindingMode=a),this.fullSceneLayout.hovermode=b},x.toImage=function(a){a||(a="png"),this.staticMode&&this.container.appendChild(i),this.glplot.redraw();var b=this.glplot.gl,c=b.drawingBufferWidth,d=b.drawingBufferHeight;b.bindFramebuffer(b.FRAMEBUFFER,null);var e=new Uint8Array(c*d*4);b.readPixels(0,0,c,d,b.RGBA,b.UNSIGNED_BYTE,e);for(var f=0,g=d-1;g>f;++f,--g)for(var h=0;c>h;++h)for(var j=0;4>j;++j){var k=e[4*(c*f+h)+j];e[4*(c*f+h)+j]=e[4*(c*g+h)+j],e[4*(c*g+h)+j]=k}var l=document.createElement("canvas");l.width=c,l.height=d;var m=l.getContext("2d"),n=m.createImageData(c,d);n.data.set(e),m.putImageData(n,0,0);var o;switch(a){case"jpeg":o=l.toDataURL("image/jpeg");break;case"webp":o=l.toDataURL("image/webp");break;default:o=l.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(i),o},b.exports=f},{"../../lib":349,"../../lib/show_no_webgl_msg":357,"../../lib/str2rgbarray":359,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"../../plots/plots":413,"./camera":399,"./layout/convert":404,"./layout/spikes":407,"./layout/tick_marks":408,"./project":409,"./set_convert":411,"gl-plot3d":140}],411:[function(a,b,c){"use strict";var d=a("../cartesian/axes"),e=function(){};b.exports=function(a){d.setConvert(a),a.setScale=e}},{"../cartesian/axes":369}],412:[function(a,b,c){"use strict";var d=a("../plotly"),e=a("./font_attributes"),f=a("../components/color/attributes"),g=d.Lib.extendFlat;b.exports={font:{family:g({},e.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:g({},e.size,{dflt:12}),color:g({},e.color,{dflt:f.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:g({},e,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:f.background},plot_bgcolor:{valType:"color",dflt:f.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_hasCartesian:{valType:"boolean",dflt:!1},_hasGL3D:{valType:"boolean",dflt:!1},_hasGeo:{valType:"boolean",dflt:!1},_hasPie:{valType:"boolean",dflt:!1},_hasGL2D:{valType:"boolean",dflt:!1},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes"}}},{"../components/color/attributes":298,"../plotly":366,"./font_attributes":383}],413:[function(a,b,c){"use strict";function d(a){return"object"==typeof a&&(a=a.type),a}function e(a,b){b.text("");var c=b.append("a").attr({"xlink:xlink:href":"#","class":"link--impt link--embedview","font-weight":"bold"}).text(a._context.linkText+" "+String.fromCharCode(187));if(a._context.sendData)c.on("click",function(){l.sendDataToCloud(a)});else{var d=window.location.pathname.split("/"),e=window.location.search;c.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+d[2].split(".")[0]+"/"+d[1]+e})}}function f(a,b,c,d){var e,f,g=Object.keys(p);for(e=0;e<g.length;e++){var h=p[g[e]];h.clean&&h.clean(a,b,c,d)}var i=!!d._paper,j=!!d._infolayer;a:for(e=0;e<c.length;e++){var k=c[e],l=k.uid;for(f=0;f<a.length;f++){var m=a[f];if(l===m.uid)continue a}i&&d._paper.selectAll(".hm"+l+",.contour"+l+",#clip"+l).remove(),j&&d._infolayer.selectAll(".cb"+l).remove()}}function g(a,b){for(var c,d=Object.keys(b),e=0;e<d.length;++e){var f=d[e];if("_"===f.charAt(0)||"function"==typeof b[f]){if(f in a)continue;a[f]=b[f]}else if(Array.isArray(b[f])&&Array.isArray(a[f])&&b[f].length&&k.isPlainObject(b[f][0])){if(b[f].length!==a[f].length)throw new Error("relinkPrivateKeys needs equal length arrays");for(c=0;c<b[f].length;c++)g(a[f][c],b[f][c])}else k.isPlainObject(b[f])&&k.isPlainObject(a[f])&&(g(a[f],b[f]),Object.keys(a[f]).length||delete a[f])}}var h=a("../plotly"),i=a("d3"),j=a("fast-isnumeric"),k=a("../lib"),l=b.exports={},m=l.modules={},n=l.allTypes=[],o=l.allCategories={},p=l.subplotsRegistry={};l.attributes=a("./attributes"),l.attributes.type.values=n,l.fontAttrs=a("./font_attributes"),l.layoutAttributes=a("./layout_attributes"),l.fontWeight="normal",l.register=function(a,b,c,d){if(m[b])return void console.log("type "+b+" already registered");for(var e={},f=0;f<c.length;f++)e[c[f]]=!0,o[c[f]]=!0;m[b]={_module:a,categories:e},d&&Object.keys(d).length&&(m[b].meta=d),n.push(b)},l.getModule=function(a){if(void 0!==a.r)return console.log("Oops, tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",a),!1;var b=m[d(a)];return b?b._module:!1},l.traceIs=function(a,b){if(a=d(a),"various"===a)return!1;var c=m[a];return c||(void 0!==a&&console.warn("unrecognized trace type "+a),c=m[l.attributes.type.dflt]),!!c.categories[b]},l.registerSubplot=function(a){var b=a.name;return p[b]?void console.log("plot type "+b+" already registered"):void(p[b]=a)},l.findSubplotIds=function(a,b){var c=[];if(void 0===l.subplotsRegistry[b])return c;for(var d=l.subplotsRegistry[b].attr,e=0;e<a.length;e++){var f=a[e];l.traceIs(f,b)&&-1===c.indexOf(f[d])&&c.push(f[d])}return c},l.getSubplotIds=function(a,b){var c=l.subplotsRegistry[b];if(void 0===c)return[];if("cartesian"===b&&!a._hasCartesian)return[];if("gl2d"===b&&!a._hasGL2D)return[];if("cartesian"===b||"gl2d"===b)return Object.keys(a._plots);for(var d=c.idRegex,e=Object.keys(a),f=[],g=0;g<e.length;g++){var h=e[g];d.test(h)&&f.push(h)}var i=c.idRoot.length;return f.sort(function(a,b){var c=+(a.substr(i)||1),d=+(b.substr(i)||1);return c-d}),f},l.getSubplotData=function(a,b,c){if(void 0===l.subplotsRegistry[b])return[];for(var d,e=l.subplotsRegistry[b].attr,f=[],g=0;g<a.length;g++)if(d=a[g],"gl2d"===b&&l.traceIs(d,"gl2d")){var i=h.Axes.subplotMatch,j="x"+c.match(i)[1],k="y"+c.match(i)[2];d[e[0]]===j&&d[e[1]]===k&&f.push(d)}else d[e]===c&&f.push(d);return f},l.redrawText=function(a){return a._fullLayout._hasGL3D||a.data&&a.data[0]&&a.data[0].r?void 0:new Promise(function(b){setTimeout(function(){h.Annotations.drawAll(a),h.Legend.draw(a),(a.calcdata||[]).forEach(function(a){a[0]&&a[0].t&&a[0].t.cb&&a[0].t.cb()}),b(l.previousPromises(a))},300)})},l.resize=function(a){return new Promise(function(b,c){a&&"none"!==i.select(a).style("display")||c(new Error("Resize must be passed a plot div element.")),a._redrawTimer&&clearTimeout(a._redrawTimer),a._redrawTimer=setTimeout(function(){if((a._fullLayout||{}).autosize){var c=a.changed;a.autoplay=!0,h.relayout(a,{autosize:!0}),a.changed=c,b(a)}},100)})},l.previousPromises=function(a){return(a._promises||[]).length?Promise.all(a._promises).then(function(){a._promises=[]}):void 0},l.addLinks=function(a){var b=a._fullLayout,c=b._paper.selectAll("text.js-plot-link-container").data([0]);c.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.Color.defaultLine,"pointer-events":"all"}).each(function(){var a=i.select(this);a.append("tspan").classed("js-link-to-tool",!0),a.append("tspan").classed("js-link-spacer",!0),a.append("tspan").classed("js-sourcelinks",!0)});var d=c.node(),f={y:b._paper.attr("height")-9};d&&d.getComputedTextLength()>=b.width-20?(f["text-anchor"]="start",f.x=5):(f["text-anchor"]="end",f.x=b._paper.attr("width")-7),c.attr(f);var g=c.select(".js-link-to-tool"),j=c.select(".js-link-spacer"),k=c.select(".js-sourcelinks");a._context.showSources&&a._context.showSources(a),a._context.showLink&&e(a,g),j.text(g.text()&&k.text()?" - ":"")},l.sendDataToCloud=function(a){a.emit("plotly_beforeexport");var b=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",c=i.select(a).append("div").attr("id","hiddenform").style("display","none"),d=c.append("form").attr({action:b+"/external",method:"post",target:"_blank"}),e=d.append("input").attr({type:"text",name:"data"});return e.node().value=l.graphJson(a,!1,"keepdata"),d.node().submit(),c.remove(),a.emit("plotly_afterexport"),!1},l.supplyDefaults=function(a){var b,c,d,e,i,j,k=a._fullLayout||{},m=a._fullLayout={},n=a.layout||{},o=a._fullData||[],p=a._fullData=[],q=a.data||[],r=a._modules=[];for(l.supplyLayoutGlobalDefaults(n,m),m._dataLength=q.length,b=0;b<q.length;b++)c=q[b],d=l.supplyDataDefaults(c,b,m),p.push(d),l.traceIs(d,"cartesian")?m._hasCartesian=!0:l.traceIs(d,"gl3d")?m._hasGL3D=!0:l.traceIs(d,"geo")?m._hasGeo=!0:l.traceIs(d,"pie")?m._hasPie=!0:l.traceIs(d,"gl2d")?m._hasGL2D=!0:"r"in d&&(m._hasPolar=!0),e=d._module,e&&-1===r.indexOf(e)&&r.push(e);for(b=0;b<r.length;b++)e=r[b],e.cleanData&&e.cleanData(p);if(o.length===q.length)for(b=0;b<p.length;b++)g(p[b],o[b]);for(l.supplyLayoutModuleDefaults(n,m,p),f(p,m,o,k),g(m,k),l.doAutoMargin(a),i=h.Axes.list(a),b=0;b<i.length;b++)j=i[b],j._td=a,j.setScale();if((a.calcdata||[]).length===p.length)for(b=0;b<p.length;b++)c=p[b],(a.calcdata[b][0]||{}).trace=c},l.supplyDataDefaults=function(a,b,c){function d(b,c){return k.coerce(a,f,l.attributes,b,c)}function e(b,c){return l.traceIs(f,b)?k.coerce(a,f,l.subplotsRegistry[b].attributes,c):void 0}var f={},g=h.Color.defaults[b%h.Color.defaults.length];f.index=b;var i,j,m=d("visible");return d("type"),d("uid"),e("gl3d","scene"),e("geo","geo"),(m||i)&&(j=l.getModule(f),f._module=j),m&&d("hoverinfo",1===c._dataLength?"x+y+z+text":void 0),j&&m&&j.supplyDefaults(a,f,g,c),m&&(d("name","trace "+b),l.traceIs(f,"noOpacity")||d("opacity"),e("cartesian","xaxis"),e("cartesian","yaxis"),e("gl2d","xaxis"),e("gl2d","yaxis"),l.traceIs(f,"showLegend")&&(d("showlegend"),d("legendgroup"))),f._input=a,f},l.supplyLayoutGlobalDefaults=function(a,b){function c(c,d){return k.coerce(a,b,l.layoutAttributes,c,d)}var d=k.coerceFont(c,"font");c("title"),k.coerceFont(c,"titlefont",{family:d.family,size:Math.round(1.4*d.size),color:d.color});var e=c("autosize",a.width&&a.height?!1:"initial");c("width"),c("height"),c("margin.l"),c("margin.r"),c("margin.t"),c("margin.b"),c("margin.pad"),c("margin.autoexpand"),"initial"!==e&&l.sanitizeMargins(b),c("paper_bgcolor"),c("separators"),c("hidesources"),c("smith"),c("_hasCartesian"),c("_hasGL3D"),c("_hasGeo"),c("_hasPie"),c("_hasGL2D")},l.supplyLayoutModuleDefaults=function(a,b,c){var d,e;h.Axes.supplyLayoutDefaults(a,b,c);var f=Object.keys(p);for(d=0;d<f.length;d++)e=p[f[d]],e.supplyLayoutDefaults&&e.supplyLayoutDefaults(a,b,c);var g=Object.keys(m);for(d=0;d<g.length;d++)e=m[n[d]]._module,e.supplyLayoutDefaults&&e.supplyLayoutDefaults(a,b,c);var i=["Fx","Annotations","Shapes","Legend"];for(d=0;d<i.length;d++)e=i[d],h[e]&&h[e].supplyLayoutDefaults(a,b,c)},l.purge=function(a){var b=a._fullLayout||{};void 0!==b._glcontainer&&b._glcontainer.remove(),void 0!==b._geocontainer&&b._geocontainer.remove(),b._modeBar&&b._modeBar.destroy(),delete a.data,delete a.layout,delete a._fullData,delete a._fullLayout,delete a.calcdata,delete a.framework,delete a.empty,delete a.fid,delete a.undoqueue,delete a.undonum,delete a.autoplay,delete a.changed,delete a._modules,delete a._tester,delete a._testref,delete a._promises,delete a._redrawTimer,delete a._replotting,delete a.firstscatter,delete a.hmlumcount,delete a.hmpixcount,delete a.numboxes,delete a._hoverTimer,delete a._lastHoverTime,a.removeAllListeners&&a.removeAllListeners()},l.style=function(a){for(var b=a._modules.concat(h.ErrorBars),c=0;c<b.length;c++){var d=b[c];d.style&&d.style(a)}},l.sanitizeMargins=function(a){if(a&&a.margin){var b,c=a.width,d=a.height,e=a.margin,f=c-(e.l+e.r),g=d-(e.t+e.b);0>f&&(b=(c-1)/(e.l+e.r),e.l=Math.floor(b*e.l),e.r=Math.floor(b*e.r)),0>g&&(b=(d-1)/(e.t+e.b),e.t=Math.floor(b*e.t),e.b=Math.floor(b*e.b))}},l.autoMargin=function(a,b,c){var d=a._fullLayout;if(d._pushmargin||(d._pushmargin={}),d.margin.autoexpand!==!1){if(c){var e=c.pad||12;c.l+c.r>.5*d.width&&(c.l=c.r=0),c.b+c.t>.5*d.height&&(c.b=c.t=0),d._pushmargin[b]={l:{val:c.x,size:c.l+e},r:{val:c.x,size:c.r+e},b:{val:c.y,size:c.b+e},t:{val:c.y,size:c.t+e}}}else delete d._pushmargin[b];a._replotting||l.doAutoMargin(a)}},l.doAutoMargin=function(a){var b=a._fullLayout;b._size||(b._size={}),b._pushmargin||(b._pushmargin={});var c=b._size,d=JSON.stringify(c),e=Math.max(b.margin.l||0,0),f=Math.max(b.margin.r||0,0),g=Math.max(b.margin.t||0,0),i=Math.max(b.margin.b||0,0),k=b._pushmargin;return b.margin.autoexpand!==!1&&(k.base={l:{val:0,size:e},r:{val:1,size:f},t:{val:1,size:g},b:{val:0,size:i}},Object.keys(k).forEach(function(a){var c=k[a].l||{},d=k[a].b||{},h=c.val,l=c.size,m=d.val,n=d.size;Object.keys(k).forEach(function(a){if(j(l)&&k[a].r){var c=k[a].r.val,d=k[a].r.size;if(c>h){var o=(l*c+(d-b.width)*h)/(c-h),p=(d*(1-h)+(l-b.width)*(1-c))/(c-h);o>=0&&p>=0&&o+p>e+f&&(e=o,f=p)}}if(j(n)&&k[a].t){var q=k[a].t.val,r=k[a].t.size;if(q>m){var s=(n*q+(r-b.height)*m)/(q-m),t=(r*(1-m)+(n-b.height)*(1-q))/(q-m);s>=0&&t>=0&&s+t>i+g&&(i=s,g=t)}}})})),c.l=Math.round(e),c.r=Math.round(f),c.t=Math.round(g),c.b=Math.round(i),c.p=Math.round(b.margin.pad),c.w=Math.round(b.width)-c.l-c.r,c.h=Math.round(b.height)-c.t-c.b,a._replotting||"{}"===d||d===JSON.stringify(b._size)?void 0:h.plot(a)},l.graphJson=function(a,b,c,d,e){function f(a){if("function"==typeof a)return null;if(k.isPlainObject(a)){var b,d,e={};for(b in a)if("function"!=typeof a[b]&&-1===["_","["].indexOf(b.charAt(0))){if("keepdata"===c){if("src"===b.substr(b.length-3))continue}else if("keepstream"===c){if(d=a[b+"src"],"string"==typeof d&&d.indexOf(":")>0&&!k.isPlainObject(a.stream))continue}else if("keepall"!==c&&(d=a[b+"src"],"string"==typeof d&&d.indexOf(":")>0))continue;e[b]=f(a[b])}return e}return Array.isArray(a)?a.map(f):a&&a.getTime?k.ms2DateTime(a):a}(e&&b&&!a._fullData||e&&!b&&!a._fullLayout)&&l.supplyDefaults(a);var g=e?a._fullData:a.data,h=e?a._fullLayout:a.layout,i={data:(g||[]).map(function(a){var c=f(a);return b&&delete c.fit,c})};return b||(i.layout=f(h)),a.framework&&a.framework.isPolar&&(i=a.framework.getConfig()),"object"===d?i:JSON.stringify(i)}},{"../lib":349,"../plotly":366,"./attributes":367,"./font_attributes":383,"./layout_attributes":412,d3:70,"fast-isnumeric":74}],414:[function(a,b,c){"use strict";var d=a("../../traces/scatter/attributes"),e=d.marker;b.exports={r:d.r,t:d.t,marker:{color:e.color,size:e.size,symbol:e.symbol,opacity:e.opacity}}},{"../../traces/scatter/attributes":502}],415:[function(a,b,c){"use strict";function d(a,b){var c={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return f({},b,c)}var e=a("../cartesian/layout_attributes"),f=a("../../lib/extend").extendFlat,g=f({},e.domain,{});b.exports={radialaxis:d("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:g,orientation:{valType:"number"}}),angularaxis:d("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:g}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":345,"../cartesian/layout_attributes":376}],416:[function(a,b,c){var d=a("../../plotly"),e=a("d3"),f=b.exports={version:"0.2.2",manager:a("./micropolar_manager")},g=d.Lib.extendDeepAll;f.Axis=function(){function a(a){c=a||c;var j=i.data,l=i.layout;return("string"==typeof c||c.nodeName)&&(c=e.select(c)),c.datum(j).each(function(a,c){function i(a,b){return h(a)%360+l.orientation}var j=a.slice();k={data:f.util.cloneJson(j),layout:f.util.cloneJson(l)};var m=0;j.forEach(function(a,b){a.color||(a.color=l.defaultColorRange[m],m=(m+1)%l.defaultColorRange.length),a.strokeColor||(a.strokeColor="LinePlot"===a.geometry?a.color:e.rgb(a.color).darker().toString()),k.data[b].color=a.color,k.data[b].strokeColor=a.strokeColor,k.data[b].strokeDash=a.strokeDash,k.data[b].strokeSize=a.strokeSize});var n=j.filter(function(a,b){var c=a.visible;return"undefined"==typeof c||c===!0}),o=!1,p=n.map(function(a,b){return o=o||"undefined"!=typeof a.groupId,a});if(o){var q=e.nest().key(function(a,b){return"undefined"!=typeof a.groupId?a.groupId:"unstacked"}).entries(p),r=[],s=q.map(function(a,b){if("unstacked"===a.key)return a.values;var c=a.values[0].r.map(function(a,b){return 0});return a.values.forEach(function(a,b,d){a.yStack=[c],r.push(c),c=f.util.sumArrays(a.r,c)}),a.values});n=e.merge(s)}n.forEach(function(a,b){a.t=Array.isArray(a.t[0])?a.t:[a.t],a.r=Array.isArray(a.r[0])?a.r:[a.r]});var t=Math.min(l.width-l.margin.left-l.margin.right,l.height-l.margin.top-l.margin.bottom)/2;t=Math.max(10,t);var u,v=[l.margin.left+t,l.margin.top+t];if(o){var w=e.max(f.util.sumArrays(f.util.arrayLast(n).r[0],f.util.arrayLast(r)));u=[0,w]}else u=e.extent(f.util.flattenArray(n.map(function(a,b){return a.r})));l.radialAxis.domain!=f.DATAEXTENT&&(u[0]=0),d=e.scale.linear().domain(l.radialAxis.domain!=f.DATAEXTENT&&l.radialAxis.domain?l.radialAxis.domain:u).range([0,t]),k.layout.radialAxis.domain=d.domain();var x,y=f.util.flattenArray(n.map(function(a,b){return a.t})),z="string"==typeof y[0];z&&(y=f.util.deduplicate(y),x=y.slice(),y=e.range(y.length),n=n.map(function(a,b){var c=a;return a.t=[y],o&&(c.yStack=a.yStack),c}));var A=n.filter(function(a,b){return"LinePlot"===a.geometry||"DotPlot"===a.geometry}).length===n.length,B=null===l.needsEndSpacing?z||!A:l.needsEndSpacing,C=l.angularAxis.domain&&l.angularAxis.domain!=f.DATAEXTENT&&!z&&l.angularAxis.domain[0]>=0,D=C?l.angularAxis.domain:e.extent(y),E=Math.abs(y[1]-y[0]);A&&!z&&(E=0);var F=D.slice();B&&z&&(F[1]+=E);var G=l.angularAxis.ticksCount||4;G>8&&(G=G/(G/8)+G%8),l.angularAxis.ticksStep&&(G=(F[1]-F[0])/G);var H=l.angularAxis.ticksStep||(F[1]-F[0])/(G*(l.minorTicks+1));x&&(H=Math.max(Math.round(H),1)),F[2]||(F[2]=H);var I=e.range.apply(this,F); 54 if(I=I.map(function(a,b){return parseFloat(a.toPrecision(12))}),h=e.scale.linear().domain(F.slice(0,2)).range("clockwise"===l.direction?[0,360]:[360,0]),k.layout.angularAxis.domain=h.domain(),k.layout.angularAxis.endPadding=B?E:0,b=e.select(this).select("svg.chart-root"),"undefined"==typeof b||b.empty()){var J="<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>",K=(new DOMParser).parseFromString(J,"application/xml"),L=this.appendChild(this.ownerDocument.importNode(K.documentElement,!0));b=e.select(L)}b.select(".guides-group").style({"pointer-events":"none"}),b.select(".angular.axis-group").style({"pointer-events":"none"}),b.select(".radial.axis-group").style({"pointer-events":"none"});var M,N=b.select(".chart-group"),O={fill:"none",stroke:l.tickColor},P={"font-size":l.font.size,"font-family":l.font.family,fill:l.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(a,b){return" "+a+" 0 "+l.font.outlineColor}).join(",")};if(l.showLegend){M=b.select(".legend-group").attr({transform:"translate("+[t,l.margin.top]+")"}).style({display:"block"});var Q=n.map(function(a,b){var c=f.util.cloneJson(a);return c.symbol="DotPlot"===a.geometry?a.dotType||"circle":"LinePlot"!=a.geometry?"square":"line",c.visibleInLegend="undefined"==typeof a.visibleInLegend||a.visibleInLegend,c.color="LinePlot"===a.geometry?a.strokeColor:a.color,c});f.Legend().config({data:n.map(function(a,b){return a.name||"Element"+b}),legendConfig:g({},f.Legend.defaultConfig().legendConfig,{container:M,elements:Q,reverseOrder:l.legend.reverseOrder})})();var R=M.node().getBBox();t=Math.min(l.width-R.width-l.margin.left-l.margin.right,l.height-l.margin.top-l.margin.bottom)/2,t=Math.max(10,t),v=[l.margin.left+t,l.margin.top+t],d.range([0,t]),k.layout.radialAxis.domain=d.domain(),M.attr("transform","translate("+[v[0]+t,v[1]-t]+")")}else M=b.select(".legend-group").style({display:"none"});b.attr({width:l.width,height:l.height}).style({opacity:l.opacity}),N.attr("transform","translate("+v+")").style({cursor:"crosshair"});var S=[(l.width-(l.margin.left+l.margin.right+2*t+(R?R.width:0)))/2,(l.height-(l.margin.top+l.margin.bottom+2*t))/2];if(S[0]=Math.max(0,S[0]),S[1]=Math.max(0,S[1]),b.select(".outer-group").attr("transform","translate("+S+")"),l.title){var T=b.select("g.title-group text").style(P).text(l.title),U=T.node().getBBox();T.attr({x:v[0]-U.width/2,y:v[1]-t-20})}var V=b.select(".radial.axis-group");if(l.radialAxis.gridLinesVisible){var W=V.selectAll("circle.grid-circle").data(d.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(O),W.attr("r",d),W.exit().remove()}V.select("circle.outside-circle").attr({r:t}).style(O);var X=b.select("circle.background-circle").attr({r:t}).style({fill:l.backgroundColor,stroke:l.stroke});if(l.radialAxis.visible){var Y=e.svg.axis().scale(d).ticks(5).tickSize(5);V.call(Y).attr({transform:"rotate("+l.radialAxis.orientation+")"}),V.selectAll(".domain").style(O),V.selectAll("g>text").text(function(a,b){return this.textContent+l.radialAxis.ticksSuffix}).style(P).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(a,b){return"horizontal"===l.radialAxis.tickOrientation?"rotate("+-l.radialAxis.orientation+") translate("+[0,P["font-size"]]+")":"translate("+[0,P["font-size"]]+")"}}),V.selectAll("g>line").style({stroke:"black"})}var Z=b.select(".angular.axis-group").selectAll("g.angular-tick").data(I),$=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(a,b){return"rotate("+i(a,b)+")"}}).style({display:l.angularAxis.visible?"block":"none"}),Z.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(a,b){return b%(l.minorTicks+1)==0}).classed("minor",function(a,b){return!(b%(l.minorTicks+1)==0)}).style(O),$.selectAll(".minor").style({stroke:l.minorTickColor}),Z.select("line.grid-line").attr({x1:l.tickLength?t-l.tickLength:0,x2:t}).style({display:l.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(P);var _=Z.select("text.axis-text").attr({x:t+l.labelOffset,dy:".35em",transform:function(a,b){var c=i(a,b),d=t+l.labelOffset,e=l.angularAxis.tickOrientation;return"horizontal"==e?"rotate("+-c+" "+d+" 0)":"radial"==e?270>c&&c>90?"rotate(180 "+d+" 0)":null:"rotate("+(180>=c&&c>0?-90:90)+" "+d+" 0)"}}).style({"text-anchor":"middle",display:l.angularAxis.labelsVisible?"block":"none"}).text(function(a,b){return b%(l.minorTicks+1)!=0?"":x?x[a]+l.angularAxis.ticksSuffix:a+l.angularAxis.ticksSuffix}).style(P);l.angularAxis.rewriteTicks&&_.text(function(a,b){return b%(l.minorTicks+1)!=0?"":l.angularAxis.rewriteTicks(this.textContent,b)});var aa=e.max(N.selectAll(".angular-tick text")[0].map(function(a,b){return a.getCTM().e+a.getBBox().width}));M.attr({transform:"translate("+[t+aa,l.margin.top]+")"});var ba=b.select("g.geometry-group").selectAll("g").size()>0,ca=b.select("g.geometry-group").selectAll("g.geometry").data(n);if(ca.enter().append("g").attr({"class":function(a,b){return"geometry geometry"+b}}),ca.exit().remove(),n[0]||ba){var da=[];n.forEach(function(a,b){var c={};c.radialScale=d,c.angularScale=h,c.container=ca.filter(function(a,c){return c==b}),c.geometry=a.geometry,c.orientation=l.orientation,c.direction=l.direction,c.index=b,da.push({data:a,geometryConfig:c})});var ea=e.nest().key(function(a,b){return"undefined"!=typeof a.data.groupId||"unstacked"}).entries(da),fa=[];ea.forEach(function(a,b){"unstacked"===a.key?fa=fa.concat(a.values.map(function(a,b){return[a]})):fa.push(a.values)}),fa.forEach(function(a,b){var c;c=Array.isArray(a)?a[0].geometryConfig.geometry:a.geometryConfig.geometry;var d=a.map(function(a,b){return g(f[c].defaultConfig(),a)});f[c]().config(d)()})}var ga,ha,ia=b.select(".guides-group"),ja=b.select(".tooltips-group"),ka=f.tooltipPanel().config({container:ja,fontSize:8})(),la=f.tooltipPanel().config({container:ja,fontSize:8})(),ma=f.tooltipPanel().config({container:ja,hasTick:!0})();if(!z){var na=ia.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(a,b){var c=f.util.getMousePos(X).angle;na.attr({x2:-t,transform:"rotate("+c+")"}).style({opacity:.5});var d=(c+180+360-l.orientation)%360;ga=h.invert(d);var e=f.util.convertToCartesian(t+12,c+180);ka.text(f.util.round(ga)).move([e[0]+v[0],e[1]+v[1]])}).on("mouseout.angular-guide",function(a,b){ia.select("line").style({opacity:0})})}var oa=ia.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(a,b){var c=f.util.getMousePos(X).radius;oa.attr({r:c}).style({opacity:.5}),ha=d.invert(f.util.getMousePos(X).radius);var e=f.util.convertToCartesian(c,l.radialAxis.orientation);la.text(f.util.round(ha)).move([e[0]+v[0],e[1]+v[1]])}).on("mouseout.radial-guide",function(a,b){oa.style({opacity:0}),ma.hide(),ka.hide(),la.hide()}),b.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(a,c){var d=e.select(this),g=d.style("fill"),h="black",i=d.style("opacity")||1;if(d.attr({"data-opacity":i}),"none"!=g){d.attr({"data-fill":g}),h=e.hsl(g).darker().toString(),d.style({fill:h,opacity:1});var j={t:f.util.round(a[0]),r:f.util.round(a[1])};z&&(j.t=x[a[0]]);var k="t: "+j.t+", r: "+j.r,l=this.getBoundingClientRect(),m=b.node().getBoundingClientRect(),n=[l.left+l.width/2-S[0]-m.left,l.top+l.height/2-S[1]-m.top];ma.config({color:h}).text(k),ma.move(n)}else g=d.style("stroke"),d.attr({"data-stroke":g}),h=e.hsl(g).darker().toString(),d.style({stroke:h,opacity:1})}).on("mousemove.tooltip",function(a,b){return 0!=e.event.which?!1:void(e.select(this).attr("data-fill")&&ma.show())}).on("mouseout.tooltip",function(a,b){ma.hide();var c=e.select(this),d=c.attr("data-fill");d?c.style({fill:d,opacity:c.attr("data-opacity")}):c.style({stroke:c.attr("data-stroke"),opacity:c.attr("data-opacity")})})}),m}var b,c,d,h,i={data:[],layout:{}},j={},k={},l=e.dispatch("hover"),m={};return m.render=function(b){return a(b),this},m.config=function(a){if(!arguments.length)return i;var b=f.util.cloneJson(a);return b.data.forEach(function(a,b){i.data[b]||(i.data[b]={}),g(i.data[b],f.Axis.defaultConfig().data[0]),g(i.data[b],a)}),g(i.layout,f.Axis.defaultConfig().layout),g(i.layout,b.layout),this},m.getLiveConfig=function(){return k},m.getinputConfig=function(){return j},m.radialScale=function(a){return d},m.angularScale=function(a){return h},m.svg=function(){return b},e.rebind(m,l,"on"),m},f.Axis.defaultConfig=function(a,b){var c={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:e.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return c},f.util={},f.DATAEXTENT="dataExtent",f.AREA="AreaChart",f.LINE="LinePlot",f.DOT="DotPlot",f.BAR="BarChart",f.util._override=function(a,b){for(var c in a)c in b&&(b[c]=a[c])},f.util._extend=function(a,b){for(var c in a)b[c]=a[c]},f.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},f.util.dataFromEquation2=function(a,b){var c=b||6,d=e.range(0,360+c,c).map(function(b,c){var d=b*Math.PI/180,e=a(d);return[b,e]});return d},f.util.dataFromEquation=function(a,b,c){var d=b||6,f=[],g=[];e.range(0,360+d,d).forEach(function(b,c){var d=b*Math.PI/180,e=a(d);f.push(b),g.push(e)});var h={t:f,r:g};return c&&(h.name=c),h},f.util.ensureArray=function(a,b){if("undefined"==typeof a)return null;var c=[].concat(a);return e.range(b).map(function(a,b){return c[b]||c[0]})},f.util.fillArrays=function(a,b,c){return b.forEach(function(b,d){a[b]=f.util.ensureArray(a[b],c)}),a},f.util.cloneJson=function(a){return JSON.parse(JSON.stringify(a))},f.util.validateKeys=function(a,b){"string"==typeof b&&(b=b.split("."));var c=b.shift();return a[c]&&(!b.length||objHasKeys(a[c],b))},f.util.sumArrays=function(a,b){return e.zip(a,b).map(function(a,b){return e.sum(a)})},f.util.arrayLast=function(a){return a[a.length-1]},f.util.arrayEqual=function(a,b){for(var c=Math.max(a.length,b.length,1);c-- >=0&&a[c]===b[c];);return-2===c},f.util.flattenArray=function(a){for(var b=[];!f.util.arrayEqual(b,a);)b=a,a=[].concat.apply([],a);return a},f.util.deduplicate=function(a){return a.filter(function(a,b,c){return c.indexOf(a)==b})},f.util.convertToCartesian=function(a,b){var c=b*Math.PI/180,d=a*Math.cos(c),e=a*Math.sin(c);return[d,e]},f.util.round=function(a,b){var c=b||2,d=Math.pow(10,c);return Math.round(a*d)/d},f.util.getMousePos=function(a){var b=e.mouse(a.node()),c=b[0],d=b[1],f={};return f.x=c,f.y=d,f.pos=b,f.angle=180*(Math.atan2(d,c)+Math.PI)/Math.PI,f.radius=Math.sqrt(c*c+d*d),f},f.util.duplicatesCount=function(a){for(var b,c={},d={},e=0,f=a.length;f>e;e++)b=a[e],b in c?(c[b]++,d[b]=c[b]):c[b]=1;return d},f.util.duplicates=function(a){return Object.keys(f.util.duplicatesCount(a))},f.util.translator=function(a,b,c,d){if(d){var e=c.slice();c=b,b=e}var f=b.reduce(function(a,b){return"undefined"!=typeof a?a[b]:void 0},a);"undefined"!=typeof f&&(b.reduce(function(a,c,d){return"undefined"!=typeof a?(d===b.length-1&&delete a[c],a[c]):void 0},a),c.reduce(function(a,b,d){return"undefined"==typeof a[b]&&(a[b]={}),d===c.length-1&&(a[b]=f),a[b]},a))},f.PolyChart=function(){function a(){var a=c[0].geometryConfig,b=a.container;"string"==typeof b&&(b=e.select(b)),b.datum(c).each(function(b,c){function d(b,c){var d=a.radialScale(b[1]),e=(a.angularScale(b[0])+a.orientation)*Math.PI/180;return{r:d,t:e}}function f(a){var b=a.r*Math.cos(a.t),c=a.r*Math.sin(a.t);return{x:b,y:c}}var g=!!b[0].data.yStack,i=b.map(function(a,b){return g?e.zip(a.data.t[0],a.data.r[0],a.data.yStack[0]):e.zip(a.data.t[0],a.data.r[0])}),j=a.angularScale,k=a.radialScale.domain()[0],l={};l.bar=function(c,d,f){var g=b[f].data,h=a.radialScale(c[1])-a.radialScale(0),i=a.radialScale(c[2]||0),k=g.barWidth;e.select(this).attr({"class":"mark bar",d:"M"+[[h+i,-k/2],[h+i,k/2],[i,k/2],[i,-k/2]].join("L")+"Z",transform:function(b,c){return"rotate("+(a.orientation+j(b[0]))+")"}})},l.dot=function(a,c,g){var h=a[2]?[a[0],a[1]+a[2]]:a,i=e.svg.symbol().size(b[g].data.dotSize).type(b[g].data.dotType)(a,c);e.select(this).attr({"class":"mark dot",d:i,transform:function(a,b){var c=f(d(h));return"translate("+[c.x,c.y]+")"}})};var m=e.svg.line.radial().interpolate(b[0].data.lineInterpolation).radius(function(b){return a.radialScale(b[1])}).angle(function(b){return a.angularScale(b[0])*Math.PI/180});l.line=function(c,d,f){var g=c[2]?i[f].map(function(a,b){return[a[0],a[1]+a[2]]}):i[f];if(e.select(this).each(l.dot).style({opacity:function(a,c){return+b[f].data.dotVisible},fill:q.stroke(c,d,f)}).attr({"class":"mark dot"}),!(d>0)){var h=e.select(this.parentNode).selectAll("path.line").data([0]);h.enter().insert("path"),h.attr({"class":"line",d:m(g),transform:function(b,c){return"rotate("+(a.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(a,b){return q.fill(c,d,f)},"fill-opacity":0,stroke:function(a,b){return q.stroke(c,d,f)},"stroke-width":function(a,b){return q["stroke-width"](c,d,f)},"stroke-dasharray":function(a,b){return q["stroke-dasharray"](c,d,f)},opacity:function(a,b){return q.opacity(c,d,f)},display:function(a,b){return q.display(c,d,f)}})}};var n=a.angularScale.range(),o=Math.abs(n[1]-n[0])/i[0].length*Math.PI/180,p=e.svg.arc().startAngle(function(a){return-o/2}).endAngle(function(a){return o/2}).innerRadius(function(b){return a.radialScale(k+(b[2]||0))}).outerRadius(function(b){return a.radialScale(k+(b[2]||0))+a.radialScale(b[1])});l.arc=function(b,c,d){e.select(this).attr({"class":"mark arc",d:p,transform:function(b,c){return"rotate("+(a.orientation+j(b[0])+90)+")"}})};var q={fill:function(a,c,d){return b[d].data.color},stroke:function(a,c,d){return b[d].data.strokeColor},"stroke-width":function(a,c,d){return b[d].data.strokeSize+"px"},"stroke-dasharray":function(a,c,d){return h[b[d].data.strokeDash]},opacity:function(a,c,d){return b[d].data.opacity},display:function(a,c,d){return"undefined"==typeof b[d].data.visible||b[d].data.visible?"block":"none"}},r=e.select(this).selectAll("g.layer").data(i);r.enter().append("g").attr({"class":"layer"});var s=r.selectAll("path.mark").data(function(a,b){return a});s.enter().append("path").attr({"class":"mark"}),s.style(q).each(l[a.geometryType]),s.exit().remove(),r.exit().remove()})}var b,c=[f.PolyChart.defaultConfig()],d=e.dispatch("hover"),h={solid:"none",dash:[5,2],dot:[2,5]};return a.config=function(a){return arguments.length?(a.forEach(function(a,b){c[b]||(c[b]={}),g(c[b],f.PolyChart.defaultConfig()),g(c[b],a)}),this):c},a.getColorScale=function(){return b},e.rebind(a,d,"on"),a},f.PolyChart.defaultConfig=function(){var a={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:e.scale.category20()}};return a},f.BarChart=function(){return f.PolyChart()},f.BarChart.defaultConfig=function(){var a={geometryConfig:{geometryType:"bar"}};return a},f.AreaChart=function(){return f.PolyChart()},f.AreaChart.defaultConfig=function(){var a={geometryConfig:{geometryType:"arc"}};return a},f.DotPlot=function(){return f.PolyChart()},f.DotPlot.defaultConfig=function(){var a={geometryConfig:{geometryType:"dot",dotType:"circle"}};return a},f.LinePlot=function(){return f.PolyChart()},f.LinePlot.defaultConfig=function(){var a={geometryConfig:{geometryType:"line"}};return a},f.Legend=function(){function a(){var c=b.legendConfig,d=b.data.map(function(a,b){return[].concat(a).map(function(a,d){var e=g({},c.elements[b]);return e.name=a,e.color=[].concat(c.elements[b].color)[d],e})}),f=e.merge(d);f=f.filter(function(a,b){return c.elements[b]&&(c.elements[b].visibleInLegend||"undefined"==typeof c.elements[b].visibleInLegend)}),c.reverseOrder&&(f=f.reverse());var h=c.container;("string"==typeof h||h.nodeName)&&(h=e.select(h));var i=f.map(function(a,b){return a.color}),j=c.fontSize,k=null==c.isContinuous?"number"==typeof f[0]:c.isContinuous,l=k?c.height:j*f.length,m=h.classed("legend-group",!0),n=m.selectAll("svg").data([0]),o=n.enter().append("svg").attr({width:300,height:l+j,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});o.append("g").classed("legend-axis",!0),o.append("g").classed("legend-marks",!0);var p=e.range(f.length),q=e.scale[k?"linear":"ordinal"]().domain(p).range(i),r=e.scale[k?"linear":"ordinal"]().domain(p)[k?"range":"rangePoints"]([0,l]),s=function(a,b){var c=3*b;return"line"===a?"M"+[[-b/2,-b/12],[b/2,-b/12],[b/2,b/12],[-b/2,b/12]]+"Z":-1!=e.svg.symbolTypes.indexOf(a)?e.svg.symbol().type(a).size(c)():e.svg.symbol().type("square").size(c)()};if(k){var t=n.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(i);t.enter().append("stop"),t.attr({offset:function(a,b){return b/(i.length-1)*100+"%"}}).style({"stop-color":function(a,b){return a}}),n.append("rect").classed("legend-mark",!0).attr({height:c.height,width:c.colorBandWidth,fill:"url(#grad1)"})}else{var u=n.select(".legend-marks").selectAll("path.legend-mark").data(f);u.enter().append("path").classed("legend-mark",!0),u.attr({transform:function(a,b){return"translate("+[j/2,r(b)+j/2]+")"},d:function(a,b){var c=a.symbol;return s(c,j)},fill:function(a,b){return q(b)}}),u.exit().remove()}var v=e.svg.axis().scale(r).orient("right"),w=n.select("g.legend-axis").attr({transform:"translate("+[k?c.colorBandWidth:j,j/2]+")"}).call(v);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:k?c.textColor:"none"}),w.selectAll("text").style({fill:c.textColor,"font-size":c.fontSize}).text(function(a,b){return f[b].name}),a}var b=f.Legend.defaultConfig(),c=e.dispatch("hover");return a.config=function(a){return arguments.length?(g(b,a),this):b},e.rebind(a,c,"on"),a},f.Legend.defaultConfig=function(a,b){var c={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return c},f.tooltipPanel=function(){var a,b,c,d={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},h="tooltip-"+f.tooltipPanel.uid++,i=10,j=function(){a=d.container.selectAll("g."+h).data([0]);var e=a.enter().append("g").classed(h,!0).style({"pointer-events":"none",display:"none"});return c=e.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),b=e.append("text").attr({dx:d.padding+i,dy:.3*+d.fontSize}),j};return j.text=function(f){var g=e.hsl(d.color).l,h=g>=.5?"#aaa":"white",k=g>=.5?"black":"white",l=f||"";b.style({fill:k,"font-size":d.fontSize+"px"}).text(l);var m=d.padding,n=b.node().getBBox(),o={fill:d.color,stroke:h,"stroke-width":"2px"},p=n.width+2*m+i,q=n.height+2*m;return c.attr({d:"M"+[[i,-q/2],[i,-q/4],[d.hasTick?0:i,0],[i,q/4],[i,q/2],[p,q/2],[p,-q/2]].join("L")+"Z"}).style(o),a.attr({transform:"translate("+[i,-q/2+2*m]+")"}),a.style({display:"block"}),j},j.move=function(b){return a?(a.attr({transform:"translate("+[b[0],b[1]]+")"}).style({display:"block"}),j):void 0},j.hide=function(){return a?(a.style({display:"none"}),j):void 0},j.show=function(){return a?(a.style({display:"block"}),j):void 0},j.config=function(a){return g(d,a),j},j},f.tooltipPanel.uid=1,f.adapter={},f.adapter.plotly=function(){var a={};return a.convert=function(a,b){var c={};if(a.data&&(c.data=a.data.map(function(a,c){var d=g({},a),e=[[d,["marker","color"],["color"]],[d,["marker","opacity"],["opacity"]],[d,["marker","line","color"],["strokeColor"]],[d,["marker","line","dash"],["strokeDash"]],[d,["marker","line","width"],["strokeSize"]],[d,["marker","symbol"],["dotType"]],[d,["marker","size"],["dotSize"]],[d,["marker","barWidth"],["barWidth"]],[d,["line","interpolation"],["lineInterpolation"]],[d,["showlegend"],["visibleInLegend"]]];return e.forEach(function(a,c){f.util.translator.apply(null,a.concat(b))}),b||delete d.marker,b&&delete d.groupId,b?("LinePlot"===d.geometry?(d.type="scatter",d.dotVisible===!0?(delete d.dotVisible,d.mode="lines+markers"):d.mode="lines"):"DotPlot"===d.geometry?(d.type="scatter",d.mode="markers"):"AreaChart"===d.geometry?d.type="area":"BarChart"===d.geometry&&(d.type="bar"),delete d.geometry):("scatter"===d.type?"lines"===d.mode?d.geometry="LinePlot":"markers"===d.mode?d.geometry="DotPlot":"lines+markers"===d.mode&&(d.geometry="LinePlot",d.dotVisible=!0):"area"===d.type?d.geometry="AreaChart":"bar"===d.type&&(d.geometry="BarChart"),delete d.mode,delete d.type),d}),!b&&a.layout&&"stack"===a.layout.barmode)){var d=f.util.duplicates(c.data.map(function(a,b){return a.geometry}));c.data.forEach(function(a,b){var e=d.indexOf(a.geometry);-1!=e&&(c.data[b].groupId=e)})}if(a.layout){var h=g({},a.layout),i=[[h,["plot_bgcolor"],["backgroundColor"]],[h,["showlegend"],["showLegend"]],[h,["radialaxis"],["radialAxis"]],[h,["angularaxis"],["angularAxis"]],[h.angularaxis,["showline"],["gridLinesVisible"]],[h.angularaxis,["showticklabels"],["labelsVisible"]],[h.angularaxis,["nticks"],["ticksCount"]],[h.angularaxis,["tickorientation"],["tickOrientation"]],[h.angularaxis,["ticksuffix"],["ticksSuffix"]],[h.angularaxis,["range"],["domain"]],[h.angularaxis,["endpadding"],["endPadding"]],[h.radialaxis,["showline"],["gridLinesVisible"]],[h.radialaxis,["tickorientation"],["tickOrientation"]],[h.radialaxis,["ticksuffix"],["ticksSuffix"]],[h.radialaxis,["range"],["domain"]],[h.angularAxis,["showline"],["gridLinesVisible"]],[h.angularAxis,["showticklabels"],["labelsVisible"]],[h.angularAxis,["nticks"],["ticksCount"]],[h.angularAxis,["tickorientation"],["tickOrientation"]],[h.angularAxis,["ticksuffix"],["ticksSuffix"]],[h.angularAxis,["range"],["domain"]],[h.angularAxis,["endpadding"],["endPadding"]],[h.radialAxis,["showline"],["gridLinesVisible"]],[h.radialAxis,["tickorientation"],["tickOrientation"]],[h.radialAxis,["ticksuffix"],["ticksSuffix"]],[h.radialAxis,["range"],["domain"]],[h.font,["outlinecolor"],["outlineColor"]],[h.legend,["traceorder"],["reverseOrder"]],[h,["labeloffset"],["labelOffset"]],[h,["defaultcolorrange"],["defaultColorRange"]]];if(i.forEach(function(a,c){f.util.translator.apply(null,a.concat(b))}),b?("undefined"!=typeof h.tickLength&&(h.angularaxis.ticklen=h.tickLength,delete h.tickLength),h.tickColor&&(h.angularaxis.tickcolor=h.tickColor,delete h.tickColor)):(h.angularAxis&&"undefined"!=typeof h.angularAxis.ticklen&&(h.tickLength=h.angularAxis.ticklen),h.angularAxis&&"undefined"!=typeof h.angularAxis.tickcolor&&(h.tickColor=h.angularAxis.tickcolor)),h.legend&&"boolean"!=typeof h.legend.reverseOrder&&(h.legend.reverseOrder="normal"!=h.legend.reverseOrder),h.legend&&"boolean"==typeof h.legend.traceorder&&(h.legend.traceorder=h.legend.traceorder?"reversed":"normal",delete h.legend.reverseOrder),h.margin&&"undefined"!=typeof h.margin.t){var j=["t","r","b","l","pad"],k=["top","right","bottom","left","pad"],l={};e.entries(h.margin).forEach(function(a,b){l[k[j.indexOf(a.key)]]=a.value}),h.margin=l}b&&(delete h.needsEndSpacing,delete h.minorTickColor,delete h.minorTicks,delete h.angularaxis.ticksCount,delete h.angularaxis.ticksCount,delete h.angularaxis.ticksStep,delete h.angularaxis.rewriteTicks,delete h.angularaxis.nticks,delete h.radialaxis.ticksCount,delete h.radialaxis.ticksCount,delete h.radialaxis.ticksStep,delete h.radialaxis.rewriteTicks,delete h.radialaxis.nticks),c.layout=h}return c},a}},{"../../plotly":366,"./micropolar_manager":417,d3:70}],417:[function(a,b,c){"use strict";var d=a("../../plotly"),e=a("d3"),f=a("./undo_manager"),g=b.exports={},h=d.Lib.extendDeepAll;g.framework=function(a){function b(b,f){return f&&(l=f),e.select(e.select(l).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),c=c?h(c,b):b,j||(j=d.micropolar.Axis()),k=d.micropolar.adapter.plotly().convert(c),j.config(k).render(l),a.data=c.data,a.layout=c.layout,g.fillLayout(a),c}var c,i,j,k,l,m=new f;return b.isPolar=!0,b.svg=function(){return j.svg()},b.getConfig=function(){return c},b.getLiveConfig=function(){return d.micropolar.adapter.plotly().convert(j.getLiveConfig(),!0)},b.getLiveScales=function(){return{t:j.angularScale(),r:j.radialScale()}},b.setUndoPoint=function(){var a=this,b=d.micropolar.util.cloneJson(c);!function(b,c){m.add({undo:function(){c&&a(c)},redo:function(){a(b)}})}(b,i),i=d.micropolar.util.cloneJson(b)},b.undo=function(){m.undo()},b.redo=function(){m.redo()},b},g.fillLayout=function(a){var b=e.select(a).selectAll(".plot-container"),c=b.selectAll(".svg-container"),f=a.framework&&a.framework.svg&&a.framework.svg(),g={width:800,height:600,paper_bgcolor:d.Color.background,_container:b,_paperdiv:c,_paper:f};a._fullLayout=h(g,a.layout)}},{"../../plotly":366,"./undo_manager":418,d3:70}],418:[function(a,b,c){"use strict";b.exports=function(){function a(a,b){return a?(e=!0,a[b](),e=!1,this):this}var b,c=[],d=-1,e=!1;return{add:function(a){return e?this:(c.splice(d+1,c.length-d),c.push(a),d=c.length-1,this)},setCallback:function(a){b=a},undo:function(){var e=c[d];return e?(a(e,"undo"),d-=1,b&&b(e.undo),this):this},redo:function(){var e=c[d+1];return e?(a(e,"redo"),d+=1,b&&b(e.redo),this):this},clear:function(){c=[],d=-1},hasUndo:function(){return-1!==d},hasRedo:function(){return d<c.length-1},getCommands:function(){return c},getPreviousCommand:function(){return c[d-1]},getIndex:function(){return d}}}},{}],419:[function(a,b,c){"use strict";function d(a){var b;switch(a){case"themes__thumb":b={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":b={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:b={}}return b}function e(a){var b=["xaxis","yaxis","zaxis"];return b.indexOf(a.slice(0,5))>-1}var f=a("../plotly"),g=f.Lib.extendFlat,h=f.Lib.extendDeep;b.exports=function(a,b){a.framework&&a.framework.isPolar&&(a=a.framework.getConfig());var c,i=a.data,j=a.layout,k=h([],i),l=h({},j,d(b.tileClass));if(b.width&&(l.width=b.width),b.height&&(l.height=b.height),"thumbnail"===b.tileClass||"themes__thumb"===b.tileClass){l.annotations=[];var m=Object.keys(l);for(c=0;c<m.length;c++)e(m[c])&&(l[m[c]].title="");for(c=0;c<k.length;c++){var n=k[c];n.showscale=!1,n.marker&&(n.marker.showscale=!1),"pie"===n.type&&(n.textposition="none")}}if(Array.isArray(b.annotations))for(c=0;c<b.annotations.length;c++)l.annotations.push(b.annotations[c]);var o=f.Plots.getSubplotIds(l,"gl3d");if(o.length){var p={};for("thumbnail"===b.tileClass&&(p={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),c=0;c<o.length;c++){var q=o[c];g(l[q].xaxis,p),g(l[q].yaxis,p),g(l[q].zaxis,p),l[q]._scene=null}}var r=document.createElement("div");b.tileClass&&(r.className=b.tileClass);var s={td:r,layout:l,data:k,config:{staticPlot:void 0===b.staticPlot?!0:b.staticPlot,plotGlPixelRatio:void 0===b.plotGlPixelRatio?2:b.plotGlPixelRatio,displaylogo:b.displaylogo||!1,showLink:b.showLink||!1,showTips:b.showTips||!1}};return"transparent"!==b.setBackground&&(s.config.setBackground=b.setBackground||"opaque"),s.td.defaultLayout=d(b.tileClass),s}},{"../plotly":366}],420:[function(a,b,c){"use strict";function d(a){return a._hasGL3D||a._hasGL2D?500:0}function e(a){return function(){var b=a._fullLayout;b._hasGL3D||b._hasGL2D||a.data&&a.data[0]&&a.data[0].r||(a.calcdata||[]).forEach(function(a){a[0]&&a[0].t&&a[0].t.cb&&a[0].t.cb()})}}var f={getDelay:d,getRedrawFunc:e,clone:a("./cloneplot"),toSVG:a("./tosvg"),svgToImg:a("./svgtoimg"),toImage:a("./toimage")};b.exports=f},{"./cloneplot":419,"./svgtoimg":421,"./toimage":422,"./tosvg":423}],421:[function(a,b,c){"use strict";function d(a){var b=a.emitter?a.emitter:new e,c=window.Image,d=window.Blob,f=a.svg,g=a.format||"png",h=a.canvas,i=h.getContext("2d"),j=new c,k=window.URL||window.webkitURL,l=new d([f],{type:"image/svg+xml;charset=utf-8"}),m=k.createObjectURL(l);return h.height=a.height||150,h.width=a.width||300,j.onload=function(){var a;switch(k.revokeObjectURL(m),i.drawImage(j,0,0),g){case"jpeg":a=h.toDataURL("image/jpeg");break;case"png":a=h.toDataURL("image/png");break;case"webp":a=h.toDataURL("image/webp");break;case"svg":a=f;break;default:return b.emit("error","Image format is not jpeg, png or svg")}b.emit("success",a)},j.onerror=function(a){return k.revokeObjectURL(m),b.emit("error",a)},j.src=m,b}var e=a("events").EventEmitter;b.exports=d},{events:54}],422:[function(a,b,c){"use strict";function d(a,b){function c(){var a=d.getDelay(i._fullLayout);setTimeout(function(){var a=f.Snapshot.toSVG(i),c=window.document.createElement("div"),d=window.document.createElement("canvas");c.appendChild(d),c.id=f.Lib.randstr(),d.id=f.Lib.randstr(),g=f.Snapshot.svgToImg({format:b.format,width:i._fullLayout.width,height:i._fullLayout.height,canvas:d,emitter:g,svg:a}),g.clean=function(){i&&i.remove()}},a)}var d=f.Snapshot,g=new e,h=d.clone(a,{format:"png"}),i=h.td;i.style.position="absolute",i.style.left="-5000px",document.body.appendChild(i);var j=d.getRedrawFunc(i);return f.plot(i,h.data,h.layout,h.config).then(j).then(c)["catch"](function(a){g.emit("error",a)}),g}var e=a("events").EventEmitter,f=a("../plotly");b.exports=d},{"../plotly":366,events:54}],423:[function(a,b,c){"use strict";function d(a,b,c){var d=b.toImage("png");a._glimages.append("svg:image").attr({xmlns:g.svg,"xlink:href":d,x:c.x,y:c.y,width:c.width,height:c.height,preserveAspectRatio:"none"}),b.destroy()}var e=a("../plotly"),f=a("d3"),g=a("../constants/xmlns_namespaces");b.exports=function(a,b){var c,h,i=a._fullLayout,j=i._paper,k=i._size;j.insert("rect",":first-child").call(e.Drawing.setRect,0,0,i.width,i.height).call(e.Color.fill,i.paper_bgcolor);var l,m=e.Plots.getSubplotIds(i,"gl3d");for(h=0;h<m.length;h++)l=i[m[h]],c=l.domain,d(i,l._scene,{x:k.l+k.w*c.x[0],y:k.t+k.h*(1-c.y[1]),width:k.w*(c.x[1]-c.x[0]),height:k.h*(c.y[1]-c.y[0])});var n,o=e.Plots.getSubplotIds(i,"gl2d");for(h=0;h<o.length;h++)n=i._plots[o[h]],d(i,n._scene2d,{x:k.l,y:k.t,width:k.w,height:k.h});var p,q,r=e.Plots.getSubplotIds(i,"geo");for(h=0;h<r.length;h++)p=i[r[h]],c=p.domain,q=p._geo.framework,q.attr("style",null),q.attr({x:k.l+k.w*c.x[0]+p._marginX,y:k.t+k.h*(1-c.y[1])+p._marginY,width:p._width,height:p._height}),i._geoimages.node().appendChild(q.node());if(i._toppaper){var s,t=i._toppaper.node().childNodes;for(h=0;h<t.length;h++)s=t[h],s.childNodes.length&&j.node().appendChild(s)}j.node().style.background="",j.selectAll("text").attr({"data-unformatted":null}).style({"-webkit-user-select":null,"-moz-user-select":null,"-ms-user-select":null}).each(function(){var a=f.select(this); 55 if("hidden"===a.style("visibility"))return void a.remove();var b=a.style("font-family");b&&-1!==b.indexOf('"')&&a.style("font-family",b.replace(/"/g,"\\'"))}),"pdf"!==b&&"eps"!==b||j.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),j.node().setAttributeNS(g.xmlns,"xmlns",g.svg),j.node().setAttributeNS(g.xmlns,"xmlns:xlink",g.xlink);var u=(new window.XMLSerializer).serializeToString(j.node());return u=e.util.html_entity_decode(u),u=e.util.xml_entity_encode(u)}},{"../constants/xmlns_namespaces":338,"../plotly":366,d3:70}],424:[function(a,b,c){"use strict";var d=a("../../lib").mergeArray;b.exports=function(a){var b=a[0].trace,c=b.marker,e=c.line;d(b.text,a,"tx"),d(c.opacity,a,"mo"),d(c.color,a,"mc"),d(e.color,a,"mlc"),d(e.width,a,"mlw")}},{"../../lib":349}],425:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=d.marker,f=e.line;b.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:d.text,orientation:{valType:"enumerated",values:["v","h"]},marker:{color:e.color,colorscale:e.colorscale,cauto:e.cauto,cmax:e.cmax,cmin:e.cmin,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,line:{color:f.color,colorscale:f.colorscale,cauto:f.cauto,cmax:f.cmax,cmin:f.cmin,width:f.width,autocolorscale:f.autocolorscale,reversescale:f.reversescale}},r:d.r,t:d.t,_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../scatter/attributes":502}],426:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/cartesian/axes"),f=a("../../components/colorscale/has_colorscale"),g=a("../../components/colorscale/calc");b.exports=function(a,b){var c,h,i,j=e.getFromId(a,b.xaxis||"x"),k=e.getFromId(a,b.yaxis||"y"),l=b.orientation||(b.x&&!b.y?"h":"v");"h"===l?(h=j.makeCalcdata(b,"x"),c=k.makeCalcdata(b,"y")):(h=k.makeCalcdata(b,"y"),c=j.makeCalcdata(b,"x"));var m=Math.min(c.length,h.length),n=[];for(i=0;m>i;i++)d(c[i])&&d(h[i])&&n.push({p:c[i],s:h[i],b:0});return f(b,"marker")&&g(b,b.marker.color,"marker","c"),f(b,"marker.line")&&g(b,b.marker.line.color,"marker.line","c"),n}},{"../../components/colorscale/calc":306,"../../components/colorscale/has_colorscale":311,"../../plots/cartesian/axes":369,"fast-isnumeric":74}],427:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/color"),f=a("../scatter/xy_defaults"),g=a("../bar/style_defaults"),h=a("../../components/errorbars/defaults"),i=a("./attributes");b.exports=function(a,b,c,j){function k(c,e){return d.coerce(a,b,i,c,e)}var l=f(a,b,k);return l?(k("orientation",b.x&&!b.y?"h":"v"),k("text"),g(a,b,k,c,j),h(a,b,e.defaultLine,{axis:"y"}),void h(a,b,e.defaultLine,{axis:"x",inherit:"y"})):void(b.visible=!1)}},{"../../components/color":299,"../../components/errorbars/defaults":322,"../../lib":349,"../bar/style_defaults":435,"../scatter/xy_defaults":522,"./attributes":425}],428:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/graph_interact"),e=a("../../components/errorbars"),f=a("../../components/color");b.exports=function(a,b,c,g){var h,i=a.cd,j=i[0].trace,k=i[0].t,l=a.xa,m=a.ya,n="closest"===g?k.barwidth/2:k.dbar*(1-l._td._fullLayout.bargap)/2;h="closest"!==g?function(a){return a.p}:"h"===j.orientation?function(a){return a.y}:function(a){return a.x};var o,p;"h"===j.orientation?(o=function(a){return d.inbox(a.b-b,a.x-b)+(a.x-b)/(a.x-a.b)},p=function(a){var b=h(a)-c;return d.inbox(b-n,b+n)}):(p=function(a){return d.inbox(a.b-c,a.y-c)+(a.y-c)/(a.y-a.b)},o=function(a){var c=h(a)-b;return d.inbox(c-n,c+n)});var q=d.getDistanceFunction(g,o,p);if(d.getClosest(i,q,a),a.index!==!1){var r=i[a.index],s=r.mcc||j.marker.color,t=r.mlcc||j.marker.line.color,u=r.mlw||j.marker.line.width;return f.opacity(s)?a.color=s:f.opacity(t)&&u&&(a.color=t),"h"===j.orientation?(a.x0=a.x1=l.c2p(r.x,!0),a.xLabelVal=r.s,a.y0=m.c2p(h(r)-n,!0),a.y1=m.c2p(h(r)+n,!0),a.yLabelVal=r.p):(a.y0=a.y1=m.c2p(r.y,!0),a.yLabelVal=r.s,a.x0=l.c2p(h(r)-n,!0),a.x1=l.c2p(h(r)+n,!0),a.xLabelVal=r.p),r.tx&&(a.text=r.tx),e.hoverInfo(r,j,a),[a]}}},{"../../components/color":299,"../../components/errorbars":323,"../../plots/cartesian/graph_interact":374}],429:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.layoutAttributes=a("./layout_attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("./layout_defaults"),d.calc=a("./calc"),d.setPositions=a("./set_positions"),d.colorbar=a("../scatter/colorbar"),d.arraysToCalcdata=a("./arrays_to_calcdata"),d.plot=a("./plot"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="bar",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../scatter/colorbar":505,"./arrays_to_calcdata":424,"./attributes":425,"./calc":426,"./defaults":427,"./hover":428,"./layout_attributes":430,"./layout_defaults":431,"./plot":432,"./set_positions":433,"./style":434}],430:[function(a,b,c){"use strict";b.exports={barmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],431:[function(a,b,c){"use strict";var d=a("../../plots/plots"),e=a("../../plots/cartesian/axes"),f=a("../../lib"),g=a("./layout_attributes");b.exports=function(a,b,c){function h(c,d){return f.coerce(a,b,g,c,d)}for(var i=!1,j=!1,k=!1,l={},m=0;m<c.length;m++){var n=c[m];if(d.traceIs(n,"bar")){if(i=!0,"overlay"!==a.barmode&&"stack"!==a.barmode){var o=n.xaxis+n.yaxis;l[o]&&(k=!0),l[o]=!0}if(n.visible&&"histogram"===n.type){var p=e.getFromId({_fullLayout:b},n["v"===n.orientation?"xaxis":"yaxis"]);"category"!==p.type&&(j=!0)}}}if(i){var q=h("barmode");"overlay"!==q&&h("barnorm"),h("bargap",j&&!k?0:.2),h("bargroupgap")}}},{"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413,"./layout_attributes":430}],432:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("../../components/color"),h=a("./arrays_to_calcdata");b.exports=function(a,b,c){var i=b.x(),j=b.y(),k=a._fullLayout,l=b.plot.select(".barlayer").selectAll("g.trace.bars").data(c).enter().append("g").attr("class","trace bars");l.append("g").attr("class","points").each(function(b){var c=b[0].t,l=b[0].trace;h(b),d.select(this).selectAll("path").data(f.identity).enter().append("path").each(function(b){function f(a){return 0===k.bargap&&0===k.bargroupgap?d.round(Math.round(a)-r,2):a}function h(a,b){return Math.abs(a-b)>=2?f(a):a>b?Math.ceil(a):Math.floor(a)}var m,n,o,p;if("h"===l.orientation?(o=j.c2p(c.poffset+b.p,!0),p=j.c2p(c.poffset+b.p+c.barwidth,!0),m=i.c2p(b.b,!0),n=i.c2p(b.s+b.b,!0)):(m=i.c2p(c.poffset+b.p,!0),n=i.c2p(c.poffset+b.p+c.barwidth,!0),p=j.c2p(b.s+b.b,!0),o=j.c2p(b.b,!0)),!(e(m)&&e(n)&&e(o)&&e(p)&&m!==n&&o!==p))return void d.select(this).remove();var q=(b.mlw+1||l.marker.line.width+1||(b.trace?b.trace.marker.line.width:0)+1)-1,r=d.round(q/2%1,2);if(!a._context.staticPlot){var s=g.opacity(b.mc||l.marker.color),t=1>s||q>.01?f:h;m=t(m,n),n=t(n,m),o=t(o,p),p=t(p,o)}d.select(this).attr("d","M"+m+","+o+"V"+p+"H"+n+"V"+o+"Z")})})}},{"../../components/color":299,"../../lib":349,"./arrays_to_calcdata":424,d3:70,"fast-isnumeric":74}],433:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/plots"),f=a("../../plots/cartesian/axes"),g=a("../../lib");b.exports=function(a,b){var c,h,i=a._fullLayout,j=b.x(),k=b.y();["v","h"].forEach(function(l){function m(b){function c(a){a[o]=a.p+m}var d=[];b.forEach(function(b){a.calcdata[b].forEach(function(a){d.push(a.p)})});var e=g.distinctVals(d),h=e.vals,j=e.minDiff,k=!1,l=[];"group"===i.barmode&&b.forEach(function(b){k||(a.calcdata[b].forEach(function(a){k||l.forEach(function(b){Math.abs(a.p-b)<j&&(k=!0)})}),k||a.calcdata[b].forEach(function(a){l.push(a.p)}))}),f.minDtick(q,j,h[0],k),f.expand(q,h,{vpad:j/2}),j*=1-i.bargap,k&&(j/=n.length);for(var m,p=0;p<b.length;p++){var r=a.calcdata[b[p]][0].t;r.barwidth=j*(1-i.bargroupgap),r.poffset=((k?(2*p+1-b.length)*j:0)-r.barwidth)/2,r.dbar=e.minDiff,m=r.poffset+r.barwidth/2,a.calcdata[b[p]].forEach(c)}}var n=[],o={v:"x",h:"y"}[l],p={v:"y",h:"x"}[l],q=b[o](),r=b[p]();if(a._fullData.forEach(function(a,b){a.visible===!0&&e.traceIs(a,"bar")&&a.orientation===l&&a.xaxis===j._id&&a.yaxis===k._id&&n.push(b)}),n.length){"overlay"===i.barmode?n.forEach(function(a){m([a])}):m(n);var s="stack"===i.barmode,t=i.barnorm;if(s||t){var u,v,w,x=r.l2c(r.c2l(0)),y=x,z={},A=a.calcdata[n[0]][0].t.barwidth/100,B=0,C=!0;for(c=0;c<n.length;c++)for(v=a.calcdata[n[c]],h=0;h<v.length;h++){B=Math.round(v[h].p/A);var D=z[B]||0;s&&(v[h].b=D),u=v[h].b+v[h].s,z[B]=D+v[h].s,s&&(v[h][p]=u,!t&&d(r.c2l(u))&&(x=Math.max(x,u),y=Math.min(y,u)))}if(t){C=!1;var E="fraction"===t?1:100,F=E/1e9;for(y=0,x=s?E:0,c=0;c<n.length;c++)for(v=a.calcdata[n[c]],h=0;h<v.length;h++)w=E/z[Math.round(v[h].p/A)],v[h].b*=w,v[h].s*=w,u=v[h].b+v[h].s,v[h][p]=u,d(r.c2l(u))&&(y-F>u&&(C=!0,y=u),u>x+F&&(C=!0,x=u))}f.expand(r,[y,x],{tozero:!0,padded:C})}else{var G=function(a){return a[p]=a.s,a.s};for(c=0;c<n.length;c++)f.expand(r,a.calcdata[n[c]].map(G),{tozero:!0,padded:!0})}}})}},{"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413,"fast-isnumeric":74}],434:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/color"),f=a("../../components/drawing");b.exports=function(a){var b=d.select(a).selectAll("g.trace.bars"),c=b.size(),g=a._fullLayout;b.style("opacity",function(a){return a[0].trace.opacity}).each(function(a){("stack"===g.barmode&&c>1||0===g.bargap&&0===g.bargroupgap&&!a[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),b.selectAll("g.points").each(function(a){var b=a[0].trace,c=b.marker,g=c.line,h=(b._input||{}).marker||{},i=f.tryColorscale(c,h,""),j=f.tryColorscale(c,h,"line.");d.select(this).selectAll("path").each(function(a){var b,f,h=(a.mlw+1||g.width+1)-1,k=d.select(this);b="mc"in a?a.mcc=i(a.mc):Array.isArray(c.color)?e.defaultLine:c.color,k.style("stroke-width",h+"px").call(e.fill,b),h&&(f="mlc"in a?a.mlcc=j(a.mlc):Array.isArray(g.color)?e.defaultLine:g.color,k.call(e.stroke,f))})})}},{"../../components/color":299,"../../components/drawing":317,d3:70}],435:[function(a,b,c){"use strict";var d=a("../../components/color"),e=a("../../components/colorscale/has_colorscale"),f=a("../../components/colorscale/defaults");b.exports=function(a,b,c,g,h){c("marker.color",g),e(a,"marker")&&f(a,b,h,c,{prefix:"marker.",cLetter:"c"}),c("marker.line.color",d.defaultLine),e(a,"marker.line")&&f(a,b,h,c,{prefix:"marker.line.",cLetter:"c"}),c("marker.line.width")}},{"../../components/color":299,"../../components/colorscale/defaults":308,"../../components/colorscale/has_colorscale":311}],436:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../components/color/attributes"),f=a("../../lib/extend").extendFlat,g=d.marker,h=g.line;b.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:f({},g.symbol,{arrayOk:!1}),opacity:f({},g.opacity,{arrayOk:!1,dflt:1}),size:f({},g.size,{arrayOk:!1}),color:f({},g.color,{arrayOk:!1}),line:{color:f({},h.color,{arrayOk:!1,dflt:e.defaultLine}),width:f({},h.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:d.fillcolor}},{"../../components/color/attributes":298,"../../lib/extend":345,"../scatter/attributes":502}],437:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("../../plots/cartesian/axes");b.exports=function(a,b){function c(a,b,c,f,g){var h;return c in b?o=f.makeCalcdata(b,c):(h=c+"0"in b?b[c+"0"]:"name"in b&&("category"===f.type||d(b.name)&&-1!==["linear","log"].indexOf(f.type)||e.isDateTime(b.name)&&"date"===f.type)?b.name:a.numboxes,h=f.d2c(h),o=g.map(function(){return h})),o}function g(a,b,c,f,g){var h,i,j,k,l=f.length,m=b.length,n=[],o=[];for(h=0;l>h;++h)i=f[h],a[h]={pos:i},o[h]=i-g,n[h]=[];for(o.push(f[l-1]+g),h=0;m>h;++h)k=b[h],d(k)&&(j=e.findBin(c[h],o),j>=0&&m>j&&n[j].push(k));return n}function h(a,b){var c,d,f,g;for(g=0;g<b.length;++g)c=b[g].sort(e.sorterAsc),d=c.length,f=a[g],f.val=c,f.min=c[0],f.max=c[d-1],f.mean=e.mean(c,d),f.sd=e.stdev(c,d,f.mean),f.q1=e.interp(c,.25),f.med=e.interp(c,.5),f.q3=e.interp(c,.75),f.lf=Math.min(f.q1,c[Math.min(e.findBin(2.5*f.q1-1.5*f.q3,c,!0)+1,d-1)]),f.uf=Math.max(f.q3,c[Math.max(e.findBin(2.5*f.q3-1.5*f.q1,c),0)]),f.lo=4*f.q1-3*f.q3,f.uo=4*f.q3-3*f.q1}var i,j,k,l,m,n,o,p,q,r=f.getFromId(a,b.xaxis||"x"),s=f.getFromId(a,b.yaxis||"y"),t=b.orientation,u=[];"h"===t?(i=r,j="x",m=s,n="y"):(i=s,j="y",m=r,n="x"),k=i.makeCalcdata(b,j),f.expand(i,k,{padded:!0}),o=c(a,b,n,m,k);var v=e.distinctVals(o);return p=v.vals,q=v.minDiff/2,l=g(u,k,o,p,q),h(u,l),u=u.filter(function(a){return a.val&&a.val.length}),u.length?(u[0].t={boxnum:a.numboxes,dPos:q},a.numboxes++,u):[{t:{emptybox:!0}}]}},{"../../lib":349,"../../plots/cartesian/axes":369,"fast-isnumeric":74}],438:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/color"),f=a("./attributes");b.exports=function(a,b,c){function g(c,e){return d.coerce(a,b,f,c,e)}var h,i=g("y"),j=g("x");if(i&&i.length)h="v",j||g("x0");else{if(!j||!j.length)return void(b.visible=!1);h="h",g("y0")}g("orientation",h),g("line.color",(a.marker||{}).color||c),g("line.width",2),g("fillcolor",e.addOpacity(b.line.color,.5)),g("whiskerwidth"),g("boxmean");var k=d.coerce2(a,b,f,"marker.outliercolor"),l=g("marker.line.outliercolor"),m=k||l?g("boxpoints","suspectedoutliers"):g("boxpoints");m&&(g("jitter","all"===m?.3:0),g("pointpos","all"===m?-1.5:0),g("marker.symbol"),g("marker.opacity"),g("marker.size"),g("marker.color",b.line.color),g("marker.line.color"),g("marker.line.width"),"suspectedoutliers"===m&&(g("marker.line.outliercolor",b.marker.color),g("marker.line.outlierwidth")))}},{"../../components/color":299,"../../lib":349,"./attributes":436}],439:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/axes"),e=a("../../plots/cartesian/graph_interact"),f=a("../../lib"),g=a("../../components/color");b.exports=function(a,b,c,h){var i,j,k,l,m,n,o,p,q,r=a.cd,s=r[0].trace,t=r[0].t,u=a.xa,v=a.ya,w=[];if(l="closest"===h?2.5*t.bdPos:t.bdPos,"h"===s.orientation?(i=function(a){return e.inbox(a.min-b,a.max-b)},j=function(a){var b=a.pos+t.bPos-c;return e.inbox(b-l,b+l)},m="y",n=v,p="x",q=u):(i=function(a){var c=a.pos+t.bPos-b;return e.inbox(c-l,c+l)},j=function(a){return e.inbox(a.min-c,a.max-c)},m="x",n=u,p="y",q=v),k=e.getDistanceFunction(h,i,j),e.getClosest(r,k,a),a.index!==!1){var x=r[a.index],y=s.line.color,z=(s.marker||{}).color;g.opacity(y)&&s.line.width?a.color=y:g.opacity(z)&&s.boxpoints?a.color=z:a.color=s.fillcolor,a[m+"0"]=n.c2p(x.pos+t.bPos-t.bdPos,!0),a[m+"1"]=n.c2p(x.pos+t.bPos+t.bdPos,!0),d.tickText(n,n.c2l(x.pos),"hover").text,a[m+"LabelVal"]=x.pos;var A,B,C={},D=["med","min","q1","q3","max"];s.boxmean&&D.push("mean"),s.boxpoints&&[].push.apply(D,["lf","uf"]);for(var E=0;E<D.length;E++)A=D[E],A in x&&!(x[A]in C)&&(C[x[A]]=!0,o=q.c2p(x[A],!0),B=f.extendFlat({},a),B[p+"0"]=B[p+"1"]=o,B[p+"LabelVal"]=x[A],B.attr=A,"mean"===A&&"sd"in x&&"sd"===s.boxmean&&(B[p+"err"]=x.sd),a.name="",w.push(B));return w}}},{"../../components/color":299,"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374}],440:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.layoutAttributes=a("./layout_attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("./layout_defaults"),d.calc=a("./calc"),d.setPositions=a("./set_positions"),d.plot=a("./plot"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="box",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","symbols","oriented","box","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":436,"./calc":437,"./defaults":438,"./hover":439,"./layout_attributes":441,"./layout_defaults":442,"./plot":443,"./set_positions":444,"./style":445}],441:[function(a,b,c){"use strict";b.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay"},boxgap:{valType:"number",min:0,max:1,dflt:.3},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3}}},{}],442:[function(a,b,c){"use strict";var d=a("../../plots/plots"),e=a("../../lib"),f=a("./layout_attributes");b.exports=function(a,b,c){function g(c,d){return e.coerce(a,b,f,c,d)}for(var h,i=0;i<c.length;i++)if(d.traceIs(c[i],"box")){h=!0;break}h&&(g("boxmode"),g("boxgap"),g("boxgroupgap"))}},{"../../lib":349,"../../plots/plots":413,"./layout_attributes":441}],443:[function(a,b,c){"use strict";function d(){i=2e9}function e(){var a=i;return i=(69069*i+1)%4294967296,Math.abs(i-a)<429496729?e():i/4294967296}var f=a("d3"),g=a("../../lib"),h=a("../../components/drawing"),i=2e9,j=5,k=.01;b.exports=function(a,b,c){var i,l,m=a._fullLayout,n=b.x(),o=b.y(),p=b.plot.select(".boxlayer").selectAll("g.trace.boxes").data(c).enter().append("g").attr("class","trace boxes");p.each(function(b){var c=b[0].t,p=b[0].trace,q="group"===m.boxmode&&a.numboxes>1,r=c.dPos*(1-m.boxgap)*(1-m.boxgroupgap)/(q?a.numboxes:1),s=q?2*c.dPos*(-.5+(c.boxnum+.5)/a.numboxes)*(1-m.boxgap):0,t=r*p.whiskerwidth;return p.visible!==!0||c.emptybox?void f.select(this).remove():("h"===p.orientation?(i=o,l=n):(i=n,l=o),c.bPos=s,c.bdPos=r,d(),f.select(this).selectAll("path.box").data(g.identity).enter().append("path").attr("class","box").each(function(a){var b=i.c2p(a.pos+s,!0),c=i.c2p(a.pos+s-r,!0),d=i.c2p(a.pos+s+r,!0),e=i.c2p(a.pos+s-t,!0),h=i.c2p(a.pos+s+t,!0),j=l.c2p(a.q1,!0),k=l.c2p(a.q3,!0),m=g.constrain(l.c2p(a.med,!0),Math.min(j,k)+1,Math.max(j,k)-1),n=l.c2p(p.boxpoints===!1?a.min:a.lf,!0),o=l.c2p(p.boxpoints===!1?a.max:a.uf,!0);"h"===p.orientation?f.select(this).attr("d","M"+m+","+c+"V"+d+"M"+j+","+c+"V"+d+"H"+k+"V"+c+"ZM"+j+","+b+"H"+n+"M"+k+","+b+"H"+o+(0===p.whiskerwidth?"":"M"+n+","+e+"V"+h+"M"+o+","+e+"V"+h)):f.select(this).attr("d","M"+c+","+m+"H"+d+"M"+c+","+j+"H"+d+"V"+k+"H"+c+"ZM"+b+","+j+"V"+n+"M"+b+","+k+"V"+o+(0===p.whiskerwidth?"":"M"+e+","+n+"H"+h+"M"+e+","+o+"H"+h))}),p.boxpoints&&f.select(this).selectAll("g.points").data(function(a){return a.forEach(function(a){a.t=c,a.trace=p}),a}).enter().append("g").attr("class","points").selectAll("path").data(function(a){var b,c,d,f,h,i,l,m="all"===p.boxpoints?a.val:a.val.filter(function(b){return b<a.lf||b>a.uf}),n=(a.q3-a.q1)*k,o=[],q=0;if(p.jitter){for(b=0;b<m.length;b++)c=Math.max(0,b-j),f=m[c],d=Math.min(m.length-1,b+j),h=m[d],"all"!==p.boxpoints&&(m[b]<a.lf?h=Math.min(h,a.lf):f=Math.max(f,a.uf)),i=Math.sqrt(n*(d-c)/(h-f))||0,i=g.constrain(Math.abs(i),0,1),o.push(i),q=Math.max(i,q);l=2*p.jitter/q}return m.map(function(b,c){var d,f=p.pointpos;return p.jitter&&(f+=l*o[c]*(e()-.5)),d="h"===p.orientation?{y:a.pos+f*r+s,x:b}:{x:a.pos+f*r+s,y:b},"suspectedoutliers"===p.boxpoints&&b<a.uo&&b>a.lo&&(d.so=!0),d})}).enter().append("path").call(h.translatePoints,n,o),void(p.boxmean&&f.select(this).selectAll("path.mean").data(g.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(a){var b=i.c2p(a.pos+s,!0),c=i.c2p(a.pos+s-r,!0),d=i.c2p(a.pos+s+r,!0),e=l.c2p(a.mean,!0),g=l.c2p(a.mean-a.sd,!0),h=l.c2p(a.mean+a.sd,!0);"h"===p.orientation?f.select(this).attr("d","M"+e+","+c+"V"+d+("sd"!==p.boxmean?"":"m0,0L"+g+","+b+"L"+e+","+c+"L"+h+","+b+"Z")):f.select(this).attr("d","M"+c+","+e+"H"+d+("sd"!==p.boxmean?"":"m0,0L"+b+","+g+"L"+c+","+e+"L"+b+","+h+"Z"))})))})}},{"../../components/drawing":317,"../../lib":349,d3:70}],444:[function(a,b,c){"use strict";var d=a("../../plots/plots"),e=a("../../plots/cartesian/axes"),f=a("../../lib");b.exports=function(a,b){var c,g,h,i,j=a._fullLayout,k=b.x(),l=b.y(),m=["v","h"];for(g=0;g<m.length;++g){var n,o,p,q=m[g],r=[],s=[],t=0,u=0;for(c="h"===q?l:k,h=0;h<a.calcdata.length;++h)n=a.calcdata[h],o=n[0].t,p=n[0].trace,p.visible===!0&&d.traceIs(p,"box")&&!o.emptybox&&p.orientation===q&&p.xaxis===k._id&&p.yaxis===l._id&&(r.push(h),p.boxpoints!==!1&&(t=Math.max(t,p.jitter-p.pointpos-1),u=Math.max(u,p.jitter+p.pointpos-1)));for(h=0;h<r.length;h++)for(n=a.calcdata[r[h]],i=0;i<n.length;i++)s.push(n[i].pos);if(s.length){var v=f.distinctVals(s),w=v.minDiff/2;for(s.length===v.vals.length&&(a.numboxes=1),e.minDtick(c,v.minDiff,v.vals[0],!0),g=0;g<r.length;++g)a.calcdata[g][0].t.dPos=w;var x=(1-j.boxgap)*(1-j.boxgroupgap)*w/a.numboxes;e.expand(c,v.vals,{vpadminus:w+t*x,vpadplus:w+u*x})}}}},{"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413}],445:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/color"),f=a("../../components/drawing");b.exports=function(a){var b=d.select(a).selectAll("g.trace.boxes");b.style("opacity",function(a){return a[0].trace.opacity}).each(function(a){var b=a[0].trace,c=b.line.width;d.select(this).selectAll("path.box").style("stroke-width",c+"px").call(e.stroke,b.line.color).call(e.fill,b.fillcolor),d.select(this).selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(e.stroke,b.line.color),d.select(this).selectAll("g.points path").call(f.pointStyle,b)})}},{"../../components/color":299,"../../components/drawing":317,d3:70}],446:[function(a,b,c){"use strict";var d=a("../scattergeo/attributes"),e=a("../../components/colorscale/attributes"),f=a("../../plots/attributes"),g=a("../../lib/extend").extendFlat,h=d.marker.line;b.exports={locations:{valType:"data_array"},locationmode:d.locationmode,z:{valType:"data_array"},text:{valType:"data_array"},marker:{line:{color:h.color,width:h.width}},zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,hoverinfo:g({},f.hoverinfo,{flags:["location","z","text","name"]}),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345,"../../plots/attributes":367,"../scattergeo/attributes":529}],447:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/colorscale/defaults"),f=a("./attributes");b.exports=function(a,b,c,g){function h(c,e){return d.coerce(a,b,f,c,e)}var i,j=h("locations");if(j&&(i=j.length),!j||!i)return void(b.visible=!1);var k=h("z");return Array.isArray(k)?(k.length>i&&(b.z=k.slice(0,i)),h("locationmode"),h("text"),h("marker.line.color"),h("marker.line.width"),e(a,b,g,h,{prefix:"",cLetter:"z"}),void h("hoverinfo",1===g._dataLength?"location+z+text":void 0)):void(b.visible=!1)}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":446}],448:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../heatmap/colorbar"),d.calc=a("../surface/calc"),d.plot=a("./plot").plot,d.moduleType="trace",d.name="choropleth",d.basePlotModule=a("../../plots/geo"),d.categories=["geo","noOpacity"],d.meta={},b.exports=d},{"../../plots/geo":385,"../heatmap/colorbar":461,"../surface/calc":539,"./attributes":446,"./defaults":447,"./plot":449}],449:[function(a,b,c){"use strict";function d(a,b){function c(b){var c=a.mockAxis;return g.tickText(c,c.c2l(b),"hover").text}var d=b.hoverinfo;if("none"===d)return function(a){delete a.nameLabel,delete a.textLabel};var e="all"===d?q.hoverinfo.flags:d.split("+"),f=-1!==e.indexOf("name"),h=-1!==e.indexOf("location"),i=-1!==e.indexOf("z"),j=-1!==e.indexOf("text"),k=!f&&h;return function(a){var d=[];k?a.nameLabel=a.id:(f&&(a.nameLabel=b.name),h&&d.push(a.id)),i&&d.push(c(a.z)),j&&d.push(a.tx),a.textLabel=d.join("<br>")}}function e(a){return function(b,c){return{points:[{data:a._input,fullData:a,curveNumber:a.index,pointNumber:c,location:b.id,z:b.z}]}}}var f=a("d3"),g=a("../../plots/cartesian/axes"),h=a("../../plots/cartesian/graph_interact"),i=a("../../components/color"),j=a("../../components/drawing"),k=a("../../components/colorscale/get_scale"),l=a("../../components/colorscale/make_scale_function"),m=a("../../lib/topojson_utils").getTopojsonFeatures,n=a("../../lib/geo_location_utils").locationToFeature,o=a("../../lib/array_to_calc_item"),p=a("../../constants/geo_constants"),q=a("./attributes"),r=b.exports={};r.calcGeoJSON=function(a,b){for(var c,d=[],e=a.locations,f=e.length,g=m(a,b),h=(a.marker||{}).line||{},i=0;f>i;i++)c=n(a.locationmode,e[i],g),void 0!==c&&(c.z=a.z[i],void 0!==a.text&&(c.tx=a.text[i]),o(h.color,c,"mlc",i),o(h.width,c,"mlw",i),d.push(c));return d.length>0&&(d[0].trace=a),d},r.plot=function(a,b,c){var g,i=a.framework,j=i.select("g.choroplethlayer"),k=i.select("g.baselayer"),l=i.select("g.baselayeroverchoropleth"),m=p.baseLayersOverChoropleth,n=j.selectAll("g.trace.choropleth").data(b,function(a){return a.uid});n.enter().append("g").attr("class","trace choropleth"),n.exit().remove(),n.each(function(b){function c(b,c){if(a.showHover){var d=a.projection(b.properties.ct);j(b),h.loneHover({x:d[0],y:d[1],name:b.nameLabel,text:b.textLabel},{container:a.hoverContainer.node()}),a.graphDiv.emit("plotly_hover",k(b,c))}}function g(b,c){a.graphDiv.emit("plotly_click",k(b,c))}var i=r.calcGeoJSON(b,a.topojson),j=d(a,b),k=e(b);f.select(this).selectAll("path.choroplethlocation").data(i).enter().append("path").attr("class","choroplethlocation").on("mouseover",c).on("click",g).on("mouseout",function(){h.loneUnhover(a.hoverContainer)}).on("mousedown",function(){h.loneUnhover(a.hoverContainer)}).on("mouseup",c)}),l.selectAll("*").remove();for(var o=0;o<m.length;o++)g=m[o],k.select("g."+g).remove(),a.drawTopo(l,g,c),a.styleLayer(l,g,c);r.style(a)},r.style=function(a){a.framework.selectAll("g.trace.choropleth").each(function(a){var b=f.select(this),c=a.marker||{},d=c.line||{},e=a.zmin,g=a.zmax,h=k(a.colorscale),m=l(h,e,g);b.selectAll("path.choroplethlocation").each(function(a){f.select(this).attr("fill",function(a){return m(a.z)}).call(i.stroke,a.mlc||d.color).call(j.dashLine,"",a.mlw||d.width)})})}},{"../../components/color":299,"../../components/colorscale/get_scale":310,"../../components/colorscale/make_scale_function":315,"../../components/drawing":317,"../../constants/geo_constants":334,"../../lib/array_to_calc_item":341,"../../lib/geo_location_utils":346,"../../lib/topojson_utils":361,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"./attributes":446,d3:70}],450:[function(a,b,c){"use strict";var d=a("../heatmap/attributes"),e=a("../scatter/attributes"),f=a("../../lib/extend").extendFlat,g=e.line;b.exports={z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:d.text,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,zauto:d.zauto,zmin:d.zmin,zmax:d.zmax,colorscale:d.colorscale,autocolorscale:d.autocolorscale,reversescale:d.reversescale,showscale:d.showscale,connectgaps:d.connectgaps,autocontour:{valType:"boolean",dflt:!0},ncontours:{valType:"integer",dflt:0},contours:{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"number",dflt:null},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill"},showlines:{valType:"boolean",dflt:!0}},line:{color:f({},g.color,{}),width:g.width,dash:g.dash,smoothing:f({},g.smoothing,{})},_nestedModules:{colorbar:"Colorbar"}}},{"../../lib/extend":345,"../heatmap/attributes":459,"../scatter/attributes":502}],451:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/axes"),e=a("../heatmap/calc");b.exports=function(a,b){var c=e(a,b),f=b.contours;if(b.autocontour!==!1){var g={type:"linear",range:[b.zmin,b.zmax]};d.autoTicks(g,(b.zmax-b.zmin)/(b.ncontours||15)),f.start=d.tickFirst(g),f.size=g.dtick,g.range.reverse(),f.end=d.tickFirst(g),f.start===b.zmin&&(f.start+=f.size),f.end===b.zmax&&(f.end-=f.size),f.end+=f.size/100,b._input.contours=f}return c}},{"../../plots/cartesian/axes":369,"../heatmap/calc":460}],452:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../plots/plots"),f=a("../../components/colorscale/get_scale"),g=a("../../components/colorbar/draw");b.exports=function(a,b){var c=b[0].trace,h="cb"+c.uid;if(a._fullLayout._infolayer.selectAll("."+h).remove(),c.showscale===!1)return void e.autoMargin(a,h);var i=g(a,h);b[0].t.cb=i;var j=c.contours,k=c.line,l=j.size||1,m=Math.floor((j.end+l/10-j.start)/l)+1,n=f(c.colorscale),o="lines"===j.coloring?0:1,p=d.scale.linear().interpolate(d.interpolateRgb),q=n.map(function(a){return(a[0]*(m+o-1)-o/2)*l+j.start}),r=n.map(function(a){return a[1]});if("heatmap"===j.coloring){c.zauto&&c.autocontour===!1&&(c.zmin=j.start-l/2,c.zmax=c.zmin+m*l),i.filllevels({start:c.zmin,end:c.zmax,size:(c.zmax-c.zmin)/254}),q=n.map(function(a){return a[0]*(c.zmax-c.zmin)+c.zmin});var s=d.extent([c.zmin,c.zmax,j.start,j.start+l*(m-1)]),t=s[c.zmin<c.zmax?0:1],u=s[c.zmin<c.zmax?1:0];t!==c.zmin&&(q.splice(0,0,t),r.splice(0,0,r[0])),u!==c.zmax&&(q.push(u),r.push(r[r.length-1]))}p.domain(q).range(r),i.fillcolor("fill"===j.coloring||"heatmap"===j.coloring?p:"").line({color:"lines"===j.coloring?p:k.color,width:j.showlines!==!1?k.width:0,dash:k.dash}).levels({start:j.start,end:j.end,size:l}).options(c.colorbar)()}},{"../../components/colorbar/draw":302,"../../components/colorscale/get_scale":310,"../../plots/plots":413,d3:70}],453:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../heatmap/has_columns"),f=a("../heatmap/xyz_defaults"),g=a("../contour/style_defaults"),h=a("./attributes");b.exports=function(a,b,c,i){function j(c,e){return d.coerce(a,b,h,c,e)}var k=f(a,b,j);if(!k)return void(b.visible=!1);j("text"),j("connectgaps",e(b));var l=d.coerce2(a,b,h,"contours.start"),m=d.coerce2(a,b,h,"contours.end"),n=j("autocontour",!(l&&m));j(n?"ncontours":"contours.size"),g(a,b,j,i)}},{"../../lib":349,"../contour/style_defaults":458,"../heatmap/has_columns":464,"../heatmap/xyz_defaults":470,"./attributes":450}],454:[function(a,b,c){"use strict";var d=a("../heatmap/hover");b.exports=function(a,b,c,e){return d(a,b,c,e,!0)}},{"../heatmap/hover":465}],455:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("./calc"),d.plot=a("./plot"),d.style=a("./style"),d.colorbar=a("./colorbar"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="contour",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap","contour"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":450,"./calc":451,"./colorbar":452,"./defaults":453,"./hover":454,"./plot":456,"./style":457}],456:[function(a,b,c){"use strict";function d(a,b,c){v.markTime("in Contour.plot");var d=c[0].trace,f=c[0].x,h=c[0].y,j=d.contours,k=d.uid,l=b.x(),m=b.y(),q=a._fullLayout,t="contour"+k,u=e(j,b,c[0]);if(d.visible!==!0)return q._paper.selectAll("."+t+",.hm"+k).remove(),void q._infolayer.selectAll(".cb"+k).remove();"heatmap"===j.coloring?(d.zauto&&d.autocontour===!1&&(d._input.zmin=d.zmin=j.start-j.size/2,d._input.zmax=d.zmax=d.zmin+u.length*j.size),x(a,b,[c])):q._paper.selectAll(".hm"+k).remove(),g(u),i(u);var w=l.c2p(f[0],!0),y=l.c2p(f[f.length-1],!0),z=m.c2p(h[0],!0),A=m.c2p(h[h.length-1],!0),B=[[w,A],[y,A],[y,z],[w,z]],C=n(b,c,t);o(C,B,j),p(C,u,B,j),r(C,u,j),s(C,b,c[0],B),v.markTime("done Contour.plot")}function e(a,b,c){for(var d=a.size||1,e=[],f=a.start;f<a.end+d/10;f+=d)e.push({level:f,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:b.x(),yaxis:b.y(),x:c.x,y:c.y,z:c.z,smoothing:c.trace.line.smoothing});return e}function f(a,b){var c=(b[0][0]>a?0:1)+(b[0][1]>a?0:2)+(b[1][1]>a?0:4)+(b[1][0]>a?0:8);if(5===c||10===c){var d=(b[0][0]+b[0][1]+b[1][0]+b[1][1])/4; 56 return a>d?5===c?713:1114:5===c?104:208}return 15===c?0:c}function g(a){var b,c,d,e,g,h,i,j,k,l=a[0].z,m=l.length,n=l[0].length,o=2===m||2===n;for(c=0;m-1>c;c++)for(e=[],0===c&&(e=e.concat(y)),c===m-2&&(e=e.concat(z)),b=0;n-1>b;b++)for(d=e.slice(),0===b&&(d=d.concat(A)),b===n-2&&(d=d.concat(B)),g=b+","+c,h=[[l[c][b],l[c][b+1]],[l[c+1][b],l[c+1][b+1]]],k=0;k<a.length;k++)j=a[k],i=f(j.level,h),i&&(j.crossings[g]=i,-1!==d.indexOf(i)&&(j.starts.push([b,c]),o&&-1!==d.indexOf(i,d.indexOf(i)+1)&&j.starts.push([b,c])))}function h(a,b,c){function d(a){return n[a%n.length]}var e,f=b.join(","),g=f,h=a.crossings[g],i=j(h,c,b),n=[m(a,b,[-i[0],-i[1]])],o=i.join(","),p=a.z.length,q=a.z[0].length;for(e=0;1e4>e;e++){if(h>20?(h=D[h][(i[0]||i[1])<0?0:1],a.crossings[g]=E[h]):delete a.crossings[g],i=C[h],!i){console.log("found bad marching index",h,b,a.level);break}if(n.push(m(a,b,i)),b[0]+=i[0],b[1]+=i[1],k(n[n.length-1],n[n.length-2])&&n.pop(),g=b.join(","),g===f&&i.join(",")===o||c&&(i[0]&&(b[0]<0||b[0]>q-2)||i[1]&&(b[1]<0||b[1]>p-2)))break;h=a.crossings[g]}1e4===e&&console.log("Infinite loop in contour?");var r,s,t,u,v,w,x,y=k(n[0],n[n.length-1]),z=0,A=.2*a.smoothing,B=[],F=0;for(e=1;e<n.length;e++)x=l(n[e],n[e-1]),z+=x,B.push(x);var G=z/B.length*A;for(e=n.length-2;e>=F;e--)if(r=B[e],G>r){for(t=0,s=e-1;s>=F&&r+B[s]<G;s--)r+=B[s];if(y&&e===n.length-2)for(t=0;s>t&&r+B[t]<G;t++)r+=B[t];v=e-s+t+1,w=Math.floor((e+s+t+2)/2),u=y||e!==n.length-2?y||-1!==s?v%2?d(w):[(d(w)[0]+d(w+1)[0])/2,(d(w)[1]+d(w+1)[1])/2]:n[0]:n[n.length-1],n.splice(s+1,e-s+1,u),e=s+1,t&&(F=t),y&&(e===n.length-2?n[t]=n[n.length-1]:0===e&&(n[n.length-1]=n[0]))}if(n.splice(0,F),!(n.length<2))if(y)n.pop(),a.paths.push(n);else{c||console.log("unclosed interior contour?",a.level,f,n.join("L"));var H=!1;a.edgepaths.forEach(function(b,c){if(!H&&k(b[0],n[n.length-1])){n.pop(),H=!0;var d=!1;a.edgepaths.forEach(function(b,e){!d&&k(b[b.length-1],n[0])&&(d=!0,n.splice(0,1),a.edgepaths.splice(c,1),e===c?a.paths.push(n.concat(b)):a.edgepaths[e]=a.edgepaths[e].concat(n,b))}),d||(a.edgepaths[c]=n.concat(b))}}),a.edgepaths.forEach(function(b,c){!H&&k(b[b.length-1],n[0])&&(n.splice(0,1),a.edgepaths[c]=b.concat(n),H=!0)}),H||a.edgepaths.push(n)}}function i(a){var b,c,d,e,f;for(d=0;d<a.length;d++){for(e=a[d],f=0;f<e.starts.length;f++)c=e.starts[f],h(e,c,"edge");for(b=0;Object.keys(e.crossings).length&&1e4>b;)b++,c=Object.keys(e.crossings)[0].split(",").map(Number),h(e,c);1e4===b&&console.log("Infinite loop in contour?")}}function j(a,b,c){var d=0,e=0;return a>20&&b?208===a||1114===a?d=0===c[0]?1:-1:e=0===c[1]?1:-1:-1!==y.indexOf(a)?e=1:-1!==A.indexOf(a)?d=1:-1!==z.indexOf(a)?e=-1:d=-1,[d,e]}function k(a,b){return Math.abs(a[0]-b[0])<.01&&Math.abs(a[1]-b[1])<.01}function l(a,b){var c=a[0]-b[0],d=a[1]-b[1];return Math.sqrt(c*c+d*d)}function m(a,b,c){var d=b[0]+Math.max(c[0],0),e=b[1]+Math.max(c[1],0),f=a.z[e][d],g=a.xaxis,h=a.yaxis;if(c[1]){var i=(a.level-f)/(a.z[e][d+1]-f);return[g.c2p((1-i)*a.x[d]+i*a.x[d+1],!0),h.c2p(a.y[e],!0)]}var j=(a.level-f)/(a.z[e+1][d]-f);return[g.c2p(a.x[d],!0),h.c2p((1-j)*a.y[e]+j*a.y[e+1],!0)]}function n(a,b,c){var d=a.plot.select(".maplayer").selectAll("g.contour."+c).data(b);return d.enter().append("g").classed("contour",!0).classed(c,!0),d.exit().remove(),d}function o(a,b,c){var d=a.selectAll("g.contourbg").data([0]);d.enter().append("g").classed("contourbg",!0);var e=d.selectAll("path").data("fill"===c.coloring?[0]:[]);e.enter().append("path"),e.exit().remove(),e.attr("d","M"+b.join("L")+"Z").style("stroke","none")}function p(a,b,c,d){var e=a.selectAll("g.contourfill").data([0]);e.enter().append("g").classed("contourfill",!0);var f=e.selectAll("path").data("fill"===d.coloring?b:[]);f.enter().append("path"),f.exit().remove(),f.each(function(a){var b=q(a,c);b?u.select(this).attr("d",b).style("stroke","none"):u.select(this).remove()})}function q(a,b){function c(a){return Math.abs(a[1]-b[0][1])<.01}function d(a){return Math.abs(a[1]-b[2][1])<.01}function e(a){return Math.abs(a[0]-b[0][0])<.01}function f(a){return Math.abs(a[0]-b[2][0])<.01}for(var g,h,i,j,k,l,m=a.edgepaths.length||a.z[0][0]<a.level?"":"M"+b.join("L")+"Z",n=0,o=a.edgepaths.map(function(a,b){return b}),p=!0;o.length;){for(l=w.smoothopen(a.edgepaths[n],a.smoothing),m+=p?l:l.replace(/^M/,"L"),o.splice(o.indexOf(n),1),g=a.edgepaths[n][a.edgepaths[n].length-1],j=-1,i=0;4>i;i++){if(!g){console.log("missing end?",n,a);break}for(c(g)&&!f(g)?h=b[1]:e(g)?h=b[0]:d(g)?h=b[3]:f(g)&&(h=b[2]),k=0;k<a.edgepaths.length;k++){var q=a.edgepaths[k][0];Math.abs(g[0]-h[0])<.01?Math.abs(g[0]-q[0])<.01&&(q[1]-g[1])*(h[1]-q[1])>=0&&(h=q,j=k):Math.abs(g[1]-h[1])<.01?Math.abs(g[1]-q[1])<.01&&(q[0]-g[0])*(h[0]-q[0])>=0&&(h=q,j=k):console.log("endpt to newendpt is not vert. or horz.",g,h,q)}if(g=h,j>=0)break;m+="L"+h}if(j===a.edgepaths.length){console.log("unclosed perimeter path");break}n=j,p=-1===o.indexOf(n),p&&(n=o[0],m+="Z")}for(n=0;n<a.paths.length;n++)m+=w.smoothclosed(a.paths[n],a.smoothing);return m}function r(a,b,c){var d=b[0].smoothing,e=a.selectAll("g.contourlevel").data(c.showlines===!1?[]:b);e.enter().append("g").classed("contourlevel",!0),e.exit().remove();var f=e.selectAll("path.openline").data(function(a){return a.edgepaths});f.enter().append("path").classed("openline",!0),f.exit().remove(),f.attr("d",function(a){return w.smoothopen(a,d)}).style("stroke-miterlimit",1);var g=e.selectAll("path.closedline").data(function(a){return a.paths});g.enter().append("path").classed("closedline",!0),g.exit().remove(),g.attr("d",function(a){return w.smoothclosed(a,d)}).style("stroke-miterlimit",1)}function s(a,b,c,d){var e="clip"+c.trace.uid,f=b.plot.selectAll("defs").data([0]);f.enter().append("defs");var h=f.selectAll("#"+e).data(c.trace.connectgaps?[]:[0]);if(h.enter().append("clipPath").attr("id",e),h.exit().remove(),c.trace.connectgaps===!1){var j={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:b.x(),yaxis:b.y(),x:c.x,y:c.y,z:t(c),smoothing:0};g([j]),i([j]);var k=q(j,d),l=h.selectAll("path").data([0]);l.enter().append("path"),l.attr("d",k)}else e=null;a.call(w.setClipUrl,e),b.plot.selectAll(".hm"+c.trace.uid).call(w.setClipUrl,e)}function t(a){var b,c,d=a.trace._emptypoints,e=[],f=a.z.length,g=a.z[0].length,h=[];for(b=0;g>b;b++)h.push(1);for(b=0;f>b;b++)e.push(h.slice());for(b=0;b<d.length;b++)c=d[b],e[c[0]][c[1]]=0;return a.zmask=e,e}var u=a("d3"),v=a("../../lib"),w=a("../../components/drawing"),x=a("../heatmap/plot");b.exports=function(a,b,c){for(var e=0;e<c.length;e++)d(a,b,c[e])};var y=[1,9,13,104,713],z=[4,6,7,104,713],A=[8,12,14,208,1114],B=[2,3,11,208,1114],C=[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],D={104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},E={1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11}},{"../../components/drawing":317,"../../lib":349,"../heatmap/plot":468,d3:70}],457:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/drawing"),f=a("../../components/colorscale/get_scale"),g=a("../heatmap/style");b.exports=function(a){d.select(a).selectAll("g.contour").style("opacity",function(a){return a.trace.opacity}).each(function(a){var b=d.select(this),c=a.trace,g=c.contours,h=c.line,i="lines"===g.coloring,j=g.size||1,k=Math.floor((g.end+j/10-g.start)/j)+1,l=f(c.colorscale),m=i?0:1,n=d.scale.linear().domain(l.map(function(a){return(a[0]*(k+m-1)-m/2)*j+g.start})).interpolate(d.interpolateRgb).range(l.map(function(a){return a[1]}));b.selectAll("g.contourlevel").each(function(a,b){d.select(this).selectAll("path").call(e.lineGroupStyle,h.width,i?n(g.start+b*j):h.color,h.dash)}),b.selectAll("g.contourbg path").style("fill",n(g.start-j/2)),b.selectAll("g.contourfill path").style("fill",function(a,b){return n(g.start+(b+.5)*j)})}),g(a)}},{"../../components/colorscale/get_scale":310,"../../components/drawing":317,"../heatmap/style":469,d3:70}],458:[function(a,b,c){"use strict";var d=a("../../components/colorscale/defaults");b.exports=function(a,b,c,e){var f,g=c("contours.coloring");"fill"===g&&(f=c("contours.showlines")),f!==!1&&("lines"!==g&&c("line.color","#000"),c("line.width",.5),c("line.dash")),c("line.smoothing"),"none"!==(b.contours||{}).coloring&&d(a,b,e,c,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":308}],459:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../components/colorscale/attributes"),f=a("../../lib/extend").extendFlat;b.exports={z:{valType:"data_array"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:{valType:"data_array"},transpose:{valType:"boolean",dflt:!1},xtype:{valType:"enumerated",values:["array","scaled"]},ytype:{valType:"enumerated",values:["array","scaled"]},zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:f({},e.autocolorscale,{dflt:!1}),reversescale:e.reversescale,showscale:e.showscale,zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1},connectgaps:{valType:"boolean",dflt:!1},_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345,"../scatter/attributes":502}],460:[function(a,b,c){"use strict";function d(a){function b(a){return j(a)?+a:void 0}var c,d,e,f,g,h,i=a.z;if(a.transpose){for(c=0,g=0;g<i.length;g++)c=Math.max(c,i[g].length);if(0===c)return!1;e=function(a){return a.length},f=function(a,b,c){return a[c][b]}}else c=i.length,e=function(a,b){return a[b].length},f=function(a,b,c){return a[b][c]};var k=new Array(c);for(g=0;c>g;g++)for(d=e(i,g),k[g]=new Array(d),h=0;d>h;h++)k[g][h]=b(f(i,g,h));return k}function e(a,b,c,d,e,f){var g,h,i,j=[],k=m.traceIs(a,"contour"),l=m.traceIs(a,"histogram");if(Array.isArray(b)&&!l&&"category"!==f.type){b=b.map(f.d2c);var n=b.length;if(!(e>=n))return k?b.slice(0,e):b.slice(0,e+1);if(k)j=b.slice(0,e);else if(1===e)j=[b[0]-.5,b[0]+.5];else{for(j=[1.5*b[0]-.5*b[1]],i=1;n>i;i++)j.push(.5*(b[i-1]+b[i]));j.push(1.5*b[n-1]-.5*b[n-2])}if(e>n){var o=j[j.length-1],p=o-j[j.length-2];for(i=n;e>i;i++)o+=p,j.push(o)}}else for(h=d||1,g=void 0===c?0:l||"category"===f.type?c:f.d2c(c),i=k?0:-.5;e>i;i++)j.push(g+h*i);return j}function f(a){return.5-.25*Math.min(1,.5*a)}function g(a,b,c){var d,e,g=1;if(Array.isArray(c))for(d=0;d<b.length;d++)e=b[d],a[e[0]][e[1]]=c[e[0]][e[1]];else i(a,b);for(d=0;d<b.length&&!(b[d][2]<4);d++);for(b=b.slice(d),d=0;100>d&&g>s;d++)g=i(a,b,f(g));return g>s&&console.log("interp2d didn't converge quickly",g),a}function h(a){var b,c,d,e,f,g,h,i,j=[],k={},l=[],m=a[0],n=[],o=[0,0,0],p=r(a);for(c=0;c<a.length;c++)for(b=n,n=m,m=a[c+1]||[],d=0;p>d;d++)void 0===n[d]&&(g=(void 0!==n[d-1]?1:0)+(void 0!==n[d+1]?1:0)+(void 0!==b[d]?1:0)+(void 0!==m[d]?1:0),g?(0===c&&g++,0===d&&g++,c===a.length-1&&g++,d===n.length-1&&g++,4>g&&(k[[c,d]]=[c,d,g]),j.push([c,d,g])):l.push([c,d]));for(;l.length;){for(h={},i=!1,f=l.length-1;f>=0;f--)e=l[f],c=e[0],d=e[1],g=((k[[c-1,d]]||o)[2]+(k[[c+1,d]]||o)[2]+(k[[c,d-1]]||o)[2]+(k[[c,d+1]]||o)[2])/20,g&&(h[e]=[c,d,g],l.splice(f,1),i=!0);if(!i)throw"findEmpties iterated with no new neighbors";for(e in h)k[e]=h[e],j.push(h[e])}return j.sort(function(a,b){return b[2]-a[2]})}function i(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q=0;for(g=0;g<b.length;g++){for(d=b[g],e=d[0],f=d[1],n=a[e][f],m=0,l=0,h=0;4>h;h++)i=t[h],j=a[e+i[0]],j&&(k=j[f+i[1]],void 0!==k&&(0===m?o=p=k:(o=Math.min(o,k),p=Math.max(p,k)),l++,m+=k));if(0===l)throw"iterateInterp2d order is wrong: no defined neighbors";a[e][f]=m/l,void 0===n?4>l&&(q=1):(a[e][f]=(1+c)*a[e][f]-c*n,p>o&&(q=Math.max(q,Math.abs(a[e][f]-n)/(p-o))))}return q}var j=a("fast-isnumeric"),k=a("../../lib"),l=a("../../plots/cartesian/axes"),m=a("../../plots/plots"),n=a("../histogram2d/calc"),o=a("../../components/colorscale/calc"),p=a("./has_columns"),q=a("./convert_column_xyz"),r=a("./max_row_length");b.exports=function(a,b){function c(a){B=b._input.zsmooth=b.zsmooth=!1,k.notifier("cannot fast-zsmooth: "+a)}k.markTime("start convert x&y");var f,i,j,s,t,u,v,w,x=l.getFromId(a,b.xaxis||"x"),y=l.getFromId(a,b.yaxis||"y"),z=m.traceIs(b,"contour"),A=m.traceIs(b,"histogram"),B=z?"best":b.zsmooth;if(x._minDtick=0,y._minDtick=0,k.markTime("done convert x&y"),A){var C=n(a,b);f=C.x,i=C.x0,j=C.dx,s=C.y,t=C.y0,u=C.dy,v=C.z}else p(b)&&q(b,x,y),f=b.x?x.makeCalcdata(b,"x"):[],s=b.y?y.makeCalcdata(b,"y"):[],i=b.x0||0,j=b.dx||1,t=b.y0||0,u=b.dy||1,v=d(b),(z||b.connectgaps)&&(b._emptypoints=h(v),b._interpz=g(v,b._emptypoints,b._interpz));if("fast"===B)if("log"===x.type||"log"===y.type)c("log axis found");else if(!A){if(f.length){var D=(f[f.length-1]-f[0])/(f.length-1),E=Math.abs(D/100);for(w=0;w<f.length-1;w++)if(Math.abs(f[w+1]-f[w]-D)>E){c("x scale is not linear");break}}if(s.length&&"fast"===B){var F=(s[s.length-1]-s[0])/(s.length-1),G=Math.abs(F/100);for(w=0;w<s.length-1;w++)if(Math.abs(s[w+1]-s[w]-F)>G){c("y scale is not linear");break}}}var H=r(v),I="scaled"===b.xtype?"":b.x,J=e(b,I,i,j,H,x),K="scaled"===b.ytype?"":b.y,L=e(b,K,t,u,v.length,y);l.expand(x,J),l.expand(y,L);var M={x:J,y:L,z:v};if(o(b,v,"","z"),z&&b.contours&&"heatmap"===b.contours.coloring){var N="contour"===b.type?"heatmap":"histogram2d";M.xfill=e(N,I,i,j,H,x),M.yfill=e(N,K,t,u,v.length,y)}return[M]};var s=.01,t=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":306,"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413,"../histogram2d/calc":480,"./convert_column_xyz":462,"./has_columns":464,"./max_row_length":467,"fast-isnumeric":74}],461:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("../../plots/plots"),h=a("../../components/colorscale/get_scale"),i=a("../../components/colorbar/draw");b.exports=function(a,b){var c=b[0].trace,j="cb"+c.uid,k=h(c.colorscale),l=c.zmin,m=c.zmax;if(e(l)||(l=f.aggNums(Math.min,null,c.z)),e(m)||(m=f.aggNums(Math.max,null,c.z)),a._fullLayout._infolayer.selectAll("."+j).remove(),!c.showscale)return void g.autoMargin(a,j);var n=b[0].t.cb=i(a,j);n.fillcolor(d.scale.linear().domain(k.map(function(a){return l+a[0]*(m-l)})).range(k.map(function(a){return a[1]}))).filllevels({start:l,end:m,size:(m-l)/254}).options(c.colorbar)(),f.markTime("done colorbar")}},{"../../components/colorbar/draw":302,"../../components/colorscale/get_scale":310,"../../lib":349,"../../plots/plots":413,d3:70,"fast-isnumeric":74}],462:[function(a,b,c){"use strict";var d=a("../../lib");b.exports=function(a,b,c){var e,f=a.x.slice(),g=a.y.slice(),h=a.z,i=a.text,j=Math.min(f.length,g.length,h.length),k=void 0!==i&&!Array.isArray(i[0]);for(j<f.length&&(f=f.slice(0,j)),j<g.length&&(g=g.slice(0,j)),e=0;j>e;e++)f[e]=b.d2c(f[e]),g[e]=c.d2c(g[e]);var l,m,n,o=d.distinctVals(f),p=o.vals,q=d.distinctVals(g),r=q.vals,s=d.init2dArray(r.length,p.length);for(k&&(n=d.init2dArray(r.length,p.length)),e=0;j>e;e++)l=d.findBin(f[e]+o.minDiff/2,p),m=d.findBin(g[e]+q.minDiff/2,r),s[m][l]=h[e],k&&(n[m][l]=i[e]);a.x=p,a.y=r,a.z=s,k&&(a.text=n)}},{"../../lib":349}],463:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./has_columns"),f=a("./xyz_defaults"),g=a("../../components/colorscale/defaults"),h=a("./attributes");b.exports=function(a,b,c,i){function j(c,e){return d.coerce(a,b,h,c,e)}var k=f(a,b,j);return k?(j("text"),j("zsmooth"),j("connectgaps",e(b)&&b.zsmooth!==!1),void g(a,b,i,j,{prefix:"",cLetter:"z"})):void(b.visible=!1)}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":459,"./has_columns":464,"./xyz_defaults":470}],464:[function(a,b,c){"use strict";b.exports=function(a){return!Array.isArray(a.z[0])}},{}],465:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/graph_interact"),e=a("../../lib");b.exports=function(a,b,c,f,g){if(!(a.distance<d.MAXDIST)){var h,i,j,k,l=a.cd[0],m=l.trace,n=a.xa,o=a.ya,p=l.x,q=l.y,r=l.z,s=l.zmask,t=p,u=q;if(a.index!==!1){try{j=Math.round(a.index[1]),k=Math.round(a.index[0])}catch(v){return void console.log("Error hovering on heatmap, pointNumber must be [row,col], found:",a.index)}if(0>j||j>=r[0].length||0>k||k>r.length)return}else{if(d.inbox(b-p[0],b-p[p.length-1])>d.MAXDIST||d.inbox(c-q[0],c-q[q.length-1])>d.MAXDIST)return;if(g){var w;for(t=[2*p[0]-p[1]],w=1;w<p.length;w++)t.push((p[w]+p[w-1])/2);for(t.push([2*p[p.length-1]-p[p.length-2]]),u=[2*q[0]-q[1]],w=1;w<q.length;w++)u.push((q[w]+q[w-1])/2);u.push([2*q[q.length-1]-q[q.length-2]])}j=Math.max(0,Math.min(t.length-2,e.findBin(b,t))),k=Math.max(0,Math.min(u.length-2,e.findBin(c,u)))}var x=n.c2p(p[j]),y=n.c2p(p[j+1]),z=o.c2p(q[k]),A=o.c2p(q[k+1]);g?(y=x,h=p[j],A=z,i=q[k]):(h=(p[j]+p[j+1])/2,i=(q[k]+q[k+1])/2,m.zsmooth&&(x=y=(x+y)/2,z=A=(z+A)/2));var B=r[k][j];s&&!s[k][j]&&(B=void 0);var C;return Array.isArray(m.text)&&Array.isArray(m.text[k])&&(C=m.text[k][j]),[e.extendFlat(a,{index:[k,j],distance:d.MAXDIST+10,x0:x,x1:y,y0:z,y1:A,xLabelVal:h,yLabelVal:i,zLabelVal:B,text:C})]}}},{"../../lib":349,"../../plots/cartesian/graph_interact":374}],466:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("./calc"),d.plot=a("./plot"),d.colorbar=a("./colorbar"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="heatmap",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":459,"./calc":460,"./colorbar":461,"./defaults":463,"./hover":465,"./plot":468,"./style":469}],467:[function(a,b,c){"use strict";b.exports=function(a){for(var b=0,c=0;c<a.length;c++)b=Math.max(b,a[c].length);return b}},{}],468:[function(a,b,c){"use strict";function d(a,b,c){function d(a,b){var c=b.length-2,d=g.constrain(g.findBin(a,b),0,c),e=b[d],f=b[d+1],h=g.constrain(d+(a-e)/(f-e)-.5,0,c),i=Math.round(h),j=Math.abs(h-i);return h&&h!==c&&j?{bin0:i,frac:j,bin1:Math.round(i+j/(h-i))}:{bin0:i,bin1:i,frac:0}}function l(a,b){if(void 0!==a){var c=V((a-B)/(C-B));return c[0]=Math.round(c[0]),c[1]=Math.round(c[1]),c[2]=Math.round(c[2]),ea+=b,fa+=c[0]*b,ga+=c[1]*b,ha+=c[2]*b,c}return[0,0,0,0]}function m(a,b,c){a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=Math.round(255*c[3])}function n(a,b,c,d){var e=a[c.bin0];if(void 0===e)return l(void 0,1);var f,g=a[c.bin1],h=b[c.bin0],i=b[c.bin1],j=g-e||0,k=h-e||0;return f=void 0===g?void 0===i?0:void 0===h?2*(i-e):2*(2*i-h-e)/3:void 0===i?void 0===h?0:2*(2*e-g-h)/3:void 0===h?2*(2*i-g-e)/3:i+e-g-h,l(e+c.frac*j+d.frac*(k+c.frac*f))}g.markTime("in Heatmap.plot");var o=c[0].trace,p=o.uid,q=b.x(),r=b.y(),s=a._fullLayout,t="hm"+p;if(s._paper.selectAll(".contour"+p).remove(),o.visible!==!0)return s._paper.selectAll("."+t).remove(),void s._infolayer.selectAll(".cb"+p).remove();var u,v,w,x,y,z,A=c[0].z,B=o.zmin,C=o.zmax,D=i(o.colorscale),E=c[0].x,F=c[0].y,G=h.traceIs(o,"contour"),H=G?"best":o.zsmooth,I=A.length,J=k(A),K=!1,L=!1;for(z=0;void 0===u&&z<E.length-1;)u=q.c2p(E[z]),z++;for(z=E.length-1;void 0===v&&z>0;)v=q.c2p(E[z]),z--;for(u>v&&(w=v,v=u,u=w,K=!0),z=0;void 0===x&&z<F.length-1;)x=r.c2p(F[z]),z++;for(z=F.length-1;void 0===y&&z>0;)y=r.c2p(F[z]),z--;if(x>y&&(w=x,x=y,y=w,L=!0),G&&(E=c[0].xfill,F=c[0].yfill),"fast"!==H){var M="best"===H?0:.5;u=Math.max(-M*q._length,u),v=Math.min((1+M)*q._length,v),x=Math.max(-M*r._length,x),y=Math.min((1+M)*r._length,y)}var N=Math.round(v-u),O=Math.round(y-x);if(!(0>=N||0>=O)){var P,Q;"fast"===H?(P=J,Q=I):(P=N,Q=O);var R=document.createElement("canvas");R.width=P,R.height=Q;var S,T,U=R.getContext("2d"),V=e.scale.linear().domain(D.map(function(a){return a[0]})).range(D.map(function(a){var b=f(a[1]).toRgb();return[b.r,b.g,b.b,b.a]})).clamp(!0);"fast"===H?(S=K?function(a){return J-1-a}:g.identity,T=L?function(a){return I-1-a}:g.identity):(S=function(a){return g.constrain(Math.round(q.c2p(E[a])-u),0,N)},T=function(a){return g.constrain(Math.round(r.c2p(F[a])-x),0,O)});var W,X,Y,Z,$,_,aa=T(0),ba=[aa,aa],ca=K?0:1,da=L?0:1,ea=0,fa=0,ga=0,ha=0;if(g.markTime("done init png"),H){var ia=0,ja=new Uint8Array(N*O*4);if("best"===H){var ka,la,ma,na=new Array(E.length),oa=new Array(F.length),pa=new Array(N);for(z=0;z<E.length;z++)na[z]=Math.round(q.c2p(E[z])-u);for(z=0;z<F.length;z++)oa[z]=Math.round(r.c2p(F[z])-x);for(z=0;N>z;z++)pa[z]=d(z,na);for(X=0;O>X;X++)for(ka=d(X,oa),la=A[ka.bin0],ma=A[ka.bin1],z=0;N>z;z++,ia+=4)_=n(la,ma,pa[z],ka),m(ja,ia,_)}else for(X=0;I>X;X++)for($=A[X],ba=T(X),z=0;J>z;z++)_=l($[z],1),ia=4*(ba*N+S(z)),m(ja,ia,_);var qa=U.createImageData(N,O);qa.data.set(ja),U.putImageData(qa,0,0)}else for(X=0;I>X;X++)if($=A[X],ba.reverse(),ba[da]=T(X+1),ba[0]!==ba[1]&&void 0!==ba[0]&&void 0!==ba[1])for(Y=S(0),W=[Y,Y],z=0;J>z;z++)W.reverse(),W[ca]=S(z+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1]&&(Z=$[z],_=l(Z,(W[1]-W[0])*(ba[1]-ba[0])),U.fillStyle="rgba("+_.join(",")+")",U.fillRect(W[0],ba[0],W[1]-W[0],ba[1]-ba[0]));g.markTime("done filling png"),fa=Math.round(fa/ea),ga=Math.round(ga/ea),ha=Math.round(ha/ea);var ra=f("rgb("+fa+","+ga+","+ha+")");a._hmpixcount=(a._hmpixcount||0)+ea,a._hmlumcount=(a._hmlumcount||0)+ea*ra.getLuminance();var sa=b.plot.select(".imagelayer").selectAll("g.hm."+t).data([0]);sa.enter().append("g").classed("hm",!0).classed(t,!0),sa.exit().remove();var ta=sa.selectAll("image").data(c);ta.enter().append("svg:image"),ta.exit().remove(),ta.attr({xmlns:j.svg,"xlink:href":R.toDataURL("image/png"),height:O,width:N,x:u,y:x,preserveAspectRatio:"none"}),g.markTime("done showing png")}}var e=a("d3"),f=a("tinycolor2"),g=a("../../lib"),h=a("../../plots/plots"),i=a("../../components/colorscale/get_scale"),j=a("../../constants/xmlns_namespaces"),k=a("./max_row_length");b.exports=function(a,b,c){for(var e=0;e<c.length;e++)d(a,b,c[e])}},{"../../components/colorscale/get_scale":310,"../../constants/xmlns_namespaces":338,"../../lib":349,"../../plots/plots":413,"./max_row_length":467,d3:70,tinycolor2:229}],469:[function(a,b,c){"use strict";var d=a("d3");b.exports=function(a){d.select(a).selectAll("image").style("opacity",function(a){return a.trace.opacity})}},{d3:70}],470:[function(a,b,c){"use strict";function d(a,b){var c=b(a),d=c?b(a+"type","array"):"scaled";return"scaled"===d&&(b(a+"0"),b("d"+a)),c}function e(a){for(var b,c=!0,d=!1,e=!1,g=0;g<a.length;g++){if(b=a[g],!Array.isArray(b)){c=!1;break}b.length>0&&(d=!0);for(var h=0;h<b.length;h++)if(f(b[h])){e=!0;break}}return c&&d&&e}var f=a("fast-isnumeric"),g=a("./has_columns");b.exports=function(a,b,c){var f,h,i=c("z");if(void 0===i||!i.length)return 0;if(g(a)){if(f=c("x"),h=c("y"),!f||!h)return 0}else{if(f=d("x",c),h=d("y",c),!e(i))return 0;c("transpose")}return b.z.length}},{"./has_columns":464,"fast-isnumeric":74}],471:[function(a,b,c){"use strict";function d(a){return{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"any",dflt:1}}}var e=a("../bar/attributes"),f=a("../../lib").extendFlat,g=e.marker,h=g.line;b.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:e.text,orientation:e.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},autobinx:{valType:"boolean",dflt:!0},nbinsx:{valType:"integer",min:0,dflt:0},xbins:d("x"),autobiny:{valType:"boolean",dflt:!0},nbinsy:{valType:"integer",min:0,dflt:0},ybins:d("y"),marker:{color:g.color,colorscale:g.colorscale,cauto:g.cauto,cmax:g.cmax,cmin:g.cmin,autocolorscale:g.autocolorscale,reversescale:g.reversescale,showscale:g.showscale,line:{color:h.color,colorscale:h.colorscale,cauto:h.cauto,cmax:h.cmax,cmin:h.cmin,autocolorscale:h.autocolorscale,reversescale:h.reversescale,width:f({},h.width,{dflt:0})}},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:e._deprecated.bardir}}},{"../../lib":349,"../bar/attributes":425}],472:[function(a,b,c){"use strict";b.exports=function(a,b){for(var c=a.length,d=0,e=0;c>e;e++)b[e]?(a[e]/=b[e],d+=a[e]):a[e]=null;return d}},{}],473:[function(a,b,c){"use strict";b.exports=function(a,b,c,d){return c("histnorm"),d.forEach(function(a){var b=c(a+"bins.start"),d=c(a+"bins.end"),e=c("autobin"+a,!(b&&d));c(e?"nbins"+a:a+"bins.size")}),b}},{}],474:[function(a,b,c){"use strict";var d=a("fast-isnumeric");b.exports={count:function(a,b,c){return c[a]++,1},sum:function(a,b,c,e){var f=e[b];return d(f)?(f=Number(f),c[a]+=f,f):0},avg:function(a,b,c,e,f){var g=e[b];return d(g)&&(g=Number(g),c[a]+=g,f[a]++),0},min:function(a,b,c,e){var f=e[b];if(d(f)){if(f=Number(f),!d(c[a]))return c[a]=f,f;if(c[a]>f)return c[a]=f,f-c[a]}return 0},max:function(a,b,c,e){var f=e[b];if(d(f)){if(f=Number(f),!d(c[a]))return c[a]=f,f;if(c[a]<f)return c[a]=f,f-c[a]}return 0}}},{"fast-isnumeric":74}],475:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("../../plots/cartesian/axes"),g=a("./bin_functions"),h=a("./norm_functions"),i=a("./average");b.exports=function(a,b){if(b.visible===!0){var c,j=[],k=[],l=f.getFromId(a,"h"===b.orientation?b.yaxis||"y":b.xaxis||"x"),m="h"===b.orientation?"y":"x",n={x:"y",y:"x"}[m],o=l.makeCalcdata(b,m);b["autobin"+m]===!1&&m+"bins"in b||(b[m+"bins"]=f.autoBin(o,l,b["nbins"+m]),b._input[m+"bins"]=b[m+"bins"]);var p,q,r,s,t=b[m+"bins"],u="string"==typeof t.size,v=u?[]:t,w=[],x=[],y=0,z=b.histnorm,A=b.histfunc,B=-1!==z.indexOf("density"),C="max"===A||"min"===A,D=C?null:0,E=g.count,F=h[z],G=!1;for(Array.isArray(b[n])&&"count"!==A&&(s=b[n],G="avg"===A,E=g[A]),c=t.start,q=t.end+(t.start-f.tickIncrement(t.start,t.size))/1e6;q>c&&j.length<5e3;)p=f.tickIncrement(c,t.size),j.push((c+p)/2),k.push(D),u&&v.push(c),B&&w.push(1/(p-c)),G&&x.push(0),c=p;var H=k.length;for(c=0;c<o.length;c++)r=e.findBin(o[c],v),r>=0&&H>r&&(y+=E(r,c,k,s,x));G&&(y=i(k,x)),F&&F(k,y,w);var I=Math.min(j.length,k.length),J=[],K=0,L=I-1;for(c=0;I>c;c++)if(k[c]){K=c;break}for(c=I-1;c>K;c--)if(k[c]){L=c;break}for(c=K;L>=c;c++)d(j[c])&&d(k[c])&&J.push({p:j[c],s:k[c],b:0});return J}}},{"../../lib":349,"../../plots/cartesian/axes":369,"./average":472,"./bin_functions":474,"./norm_functions":478,"fast-isnumeric":74}],476:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/color"),f=a("./bin_defaults"),g=a("../bar/style_defaults"),h=a("../../components/errorbars/defaults"),i=a("./attributes");b.exports=function(a,b,c,j){function k(c,e){return d.coerce(a,b,i,c,e)}var l=k("x"),m=k("y");k("text");var n=k("orientation",m&&!l?"h":"v"),o=b["v"===n?"x":"y"];if(!o||!o.length)return void(b.visible=!1);var p=b["h"===n?"x":"y"];p&&k("histfunc");var q="h"===n?["y"]:["x"];f(a,b,k,q),g(a,b,k,c,j),h(a,b,e.defaultLine,{axis:"y"}),h(a,b,e.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":299,"../../components/errorbars/defaults":322,"../../lib":349,"../bar/style_defaults":435,"./attributes":471,"./bin_defaults":473}],477:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.layoutAttributes=a("../bar/layout_attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("../bar/layout_defaults"),d.calc=a("./calc"),d.setPositions=a("../bar/set_positions"),d.plot=a("../bar/plot"),d.style=a("../bar/style"),d.colorbar=a("../scatter/colorbar"),d.hoverPoints=a("../bar/hover"),d.moduleType="trace",d.name="histogram",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../bar/hover":428,"../bar/layout_attributes":430,"../bar/layout_defaults":431,"../bar/plot":432,"../bar/set_positions":433,"../bar/style":434,"../scatter/colorbar":505,"./attributes":471,"./calc":475,"./defaults":476}],478:[function(a,b,c){"use strict";b.exports={percent:function(a,b){for(var c=a.length,d=100/b,e=0;c>e;e++)a[e]*=d},probability:function(a,b){for(var c=a.length,d=0;c>d;d++)a[d]/=b},density:function(a,b,c,d){var e=a.length;d=d||1;for(var f=0;e>f;f++)a[f]*=c[f]*d},"probability density":function(a,b,c,d){var e=a.length;d&&(b/=d);for(var f=0;e>f;f++)a[f]*=c[f]/b}}},{}],479:[function(a,b,c){"use strict";var d=a("../histogram/attributes"),e=a("../heatmap/attributes");b.exports={x:d.x,y:d.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:d.histnorm,histfunc:d.histfunc,autobinx:d.autobinx,nbinsx:d.nbinsx,xbins:d.xbins,autobiny:d.autobiny,nbinsy:d.nbinsy,ybins:d.ybins,zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,zsmooth:e.zsmooth,_nestedModules:{colorbar:"Colorbar"}}},{"../heatmap/attributes":459,"../histogram/attributes":471}],480:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../plots/cartesian/axes"),f=a("../histogram/bin_functions"),g=a("../histogram/norm_functions"),h=a("../histogram/average");b.exports=function(a,b){var c,i,j,k,l,m,n=e.getFromId(a,b.xaxis||"x"),o=b.x?n.makeCalcdata(b,"x"):[],p=e.getFromId(a,b.yaxis||"y"),q=b.y?p.makeCalcdata(b,"y"):[],r=Math.min(o.length,q.length);o.length>r&&o.splice(r,o.length-r),q.length>r&&q.splice(r,q.length-r),d.markTime("done convert data"),!b.autobinx&&"xbins"in b||(b.xbins=e.autoBin(o,n,b.nbinsx,"2d"),"histogram2dcontour"===b.type&&(b.xbins.start-=b.xbins.size,b.xbins.end+=b.xbins.size),b._input.xbins=b.xbins),!b.autobiny&&"ybins"in b||(b.ybins=e.autoBin(q,p,b.nbinsy,"2d"),"histogram2dcontour"===b.type&&(b.ybins.start-=b.ybins.size,b.ybins.end+=b.ybins.size),b._input.ybins=b.ybins),d.markTime("done autoBin"),l=[];var s,t,u=[],v=[],w="string"==typeof b.xbins.size?[]:b.xbins,x="string"==typeof b.xbins.size?[]:b.ybins,y=0,z=[],A=b.histnorm,B=b.histfunc,C=-1!==A.indexOf("density"),D="max"===B||"min"===B,E=D?null:0,F=f.count,G=g[A],H=!1,I=[],J=[],K="z"in b?b.z:"marker"in b&&Array.isArray(b.marker.color)?b.marker.color:"";K&&"count"!==B&&(H="avg"===B,F=f[B]);var L=b.xbins,M=L.end+(L.start-e.tickIncrement(L.start,L.size))/1e6;for(m=L.start;M>m;m=e.tickIncrement(m,L.size))u.push(E),Array.isArray(w)&&w.push(m),H&&v.push(0);Array.isArray(w)&&w.push(m);var N=u.length;for(c=b.xbins.start,i=(m-c)/N,c+=i/2,L=b.ybins,M=L.end+(L.start-e.tickIncrement(L.start,L.size))/1e6,m=L.start;M>m;m=e.tickIncrement(m,L.size))l.push(u.concat()),Array.isArray(x)&&x.push(m),H&&z.push(v.concat());Array.isArray(x)&&x.push(m);var O=l.length;for(j=b.ybins.start,k=(m-j)/O,j+=k/2,C&&(I=u.map(function(a,b){return Array.isArray(w)?1/(w[b+1]-w[b]):1/i}),J=l.map(function(a,b){return Array.isArray(x)?1/(x[b+1]-x[b]):1/k})),d.markTime("done making bins"),m=0;r>m;m++)s=d.findBin(o[m],w),t=d.findBin(q[m],x),s>=0&&N>s&&t>=0&&O>t&&(y+=F(s,m,l[t],K,z[t]));if(H)for(t=0;O>t;t++)y+=h(l[t],z[t]);if(G)for(t=0;O>t;t++)G(l[t],y,I,J[t]);return d.markTime("done binning"),{x:o,x0:c,dx:i,y:q,y0:j,dy:k,z:l}}},{"../../lib":349,"../../plots/cartesian/axes":369,"../histogram/average":472,"../histogram/bin_functions":474,"../histogram/norm_functions":478}],481:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./sample_defaults"),f=a("../../components/colorscale/defaults"),g=a("./attributes");b.exports=function(a,b,c){function h(c,e){return d.coerce(a,b,g,c,e)}e(a,b,h),h("zsmooth"),f(a,b,c,h,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":479,"./sample_defaults":483}],482:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("../heatmap/calc"),d.plot=a("../heatmap/plot"),d.colorbar=a("../heatmap/colorbar"),d.style=a("../heatmap/style"),d.hoverPoints=a("../heatmap/hover"),d.moduleType="trace",d.name="histogram2d",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap","histogram"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../heatmap/calc":460,"../heatmap/colorbar":461,"../heatmap/hover":465,"../heatmap/plot":468,"../heatmap/style":469,"./attributes":479,"./defaults":481}],483:[function(a,b,c){"use strict";var d=a("../histogram/bin_defaults");b.exports=function(a,b,c){var e=c("x"),f=c("y");if(!(e&&e.length&&f&&f.length))return void(b.visible=!1);var g=c("z")||c("marker.color");g&&c("histfunc");var h=["x","y"];d(a,b,c,h)}},{"../histogram/bin_defaults":473}],484:[function(a,b,c){"use strict";var d=a("../histogram2d/attributes"),e=a("../contour/attributes"); 57 b.exports={x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,autobinx:d.autobinx,nbinsx:d.nbinsx,xbins:d.xbins,autobiny:d.autobiny,nbinsy:d.nbinsy,ybins:d.ybins,zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,autocontour:e.autocontour,ncontours:e.ncontours,contours:e.contours,line:e.line,_nestedModules:{colorbar:"Colorbar"}}},{"../contour/attributes":450,"../histogram2d/attributes":479}],485:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../histogram2d/sample_defaults"),f=a("../contour/style_defaults"),g=a("./attributes");b.exports=function(a,b,c,h){function i(c,e){return d.coerce(a,b,g,c,e)}e(a,b,i);var j=d.coerce2(a,b,g,"contours.start"),k=d.coerce2(a,b,g,"contours.end"),l=i("autocontour",!(j&&k));i(l?"ncontours":"contours.size"),f(a,b,i,h)}},{"../../lib":349,"../contour/style_defaults":458,"../histogram2d/sample_defaults":483,"./attributes":484}],486:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("../contour/calc"),d.plot=a("../contour/plot"),d.style=a("../contour/style"),d.colorbar=a("../contour/colorbar"),d.hoverPoints=a("../contour/hover"),d.moduleType="trace",d.name="histogram2dcontour",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap","contour","histogram"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../contour/calc":451,"../contour/colorbar":452,"../contour/hover":454,"../contour/plot":456,"../contour/style":457,"./attributes":484,"./defaults":485}],487:[function(a,b,c){"use strict";var d=a("../../components/colorscale/attributes"),e=a("../surface/attributes"),f=a("../../lib/extend").extendFlat;b.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:f({},e.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:f({},e.contours.x.show,{}),color:f({},e.contours.x.color),width:f({},e.contours.x.width)},colorscale:d.colorscale,reversescale:d.reversescale,showscale:d.showscale,lighting:f({},e.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345,"../surface/attributes":538}],488:[function(a,b,c){"use strict";function d(a,b,c){this.scene=a,this.uid=c,this.mesh=b,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function e(a){return a.map(function(a){var b=a[0],c=j(a[1]),d=c.toRgb();return{index:b,rgb:[d.r,d.g,d.b,1]}})}function f(a){return a.map(n)}function g(a,b,c){for(var d=new Array(a.length),e=0;e<a.length;++e)d[e]=[a[e],b[e],c[e]];return d}function h(a,b){var c=a.glplot.gl,e=i({gl:c}),f=new d(a,e,b.uid);return f.update(b),a.glplot.add(e),f}var i=a("gl-mesh3d"),j=a("tinycolor2"),k=a("delaunay-triangulate"),l=a("alpha-shape"),m=a("convex-hull"),n=a("../../lib/str2rgbarray"),o=d.prototype;o.handlePick=function(a){if(a.object===this.mesh){var b=a.data.index;return a.traceCoordinate=[this.data.x[b],this.data.y[b],this.data.z[b]],!0}},o.update=function(a){function b(a,b,c){return b.map(function(b){return a.d2l(b)*c})}var c=this.scene,d=c.fullSceneLayout;this.data=a;var h,i=g(b(d.xaxis,a.x,c.dataScale[0]),b(d.yaxis,a.y,c.dataScale[1]),b(d.zaxis,a.z,c.dataScale[2]));if(a.i&&a.j&&a.k)h=g(a.i,a.j,a.k);else if(0===a.alphahull)h=m(i);else if(a.alphahull>0)h=l(a.alphahull,i);else{var j=["x","y","z"].indexOf(a.delaunayaxis);h=k(i.map(function(a){return[a[(j+1)%3],a[(j+2)%3]]}))}var o={positions:i,cells:h,ambient:a.lighting.ambient,diffuse:a.lighting.diffuse,specular:a.lighting.specular,roughness:a.lighting.roughness,fresnel:a.lighting.fresnel,opacity:a.opacity,contourEnable:a.contour.show,contourColor:n(a.contour.color).slice(0,3),contourWidth:a.contour.width,useFacetNormals:a.flatshading};a.intensity?(this.color="#fff",o.vertexIntensity=a.intensity,o.colormap=e(a.colorscale)):a.vertexcolor?(this.color=a.vertexcolors[0],o.vertexColors=f(a.vertexcolor)):a.facecolor?(this.color=a.facecolor[0],o.cellColors=f(a.facecolor)):(this.color=a.color,o.meshColor=n(a.color)),this.mesh.update(o)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},b.exports=h},{"../../lib/str2rgbarray":359,"alpha-shape":39,"convex-hull":60,"delaunay-triangulate":71,"gl-mesh3d":107,tinycolor2:229}],489:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/colorbar/defaults"),f=a("./attributes");b.exports=function(a,b,c,g){function h(c,e){return d.coerce(a,b,f,c,e)}function i(a){var b=a.map(function(a){var b=h(a);return b&&Array.isArray(b)?b:null});return b.every(function(a){return a&&a.length===b[0].length})&&b}var j=i(["x","y","z"]),k=i(["i","j","k"]);return j?(k&&k.forEach(function(a){for(var b=0;b<a.length;++b)a[b]|=0}),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","contour.show","contour.color","contour.width","colorscale","reversescale","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(a){h(a)}),"intensity"in a?(h("intensity"),h("showscale",!0)):(b.showscale=!1,"vertexcolor"in a?h("vertexcolor"):"facecolor"in a?h("facecolor"):h("color",c)),b.reversescale&&(b.colorscale=b.colorscale.map(function(a){return[1-a[0],a[1]]}).reverse()),void(b.showscale&&e(a,b,g))):void(b.visible=!1)}},{"../../components/colorbar/defaults":301,"../../lib":349,"./attributes":487}],490:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../heatmap/colorbar"),d.plot=a("./convert"),d.moduleType="trace",d.name="mesh3d",d.basePlotModule=a("../../plots/gl3d"),d.categories=["gl3d"],d.meta={},b.exports=d},{"../../plots/gl3d":400,"../heatmap/colorbar":461,"./attributes":487,"./convert":488,"./defaults":489}],491:[function(a,b,c){"use strict";var d=a("../../components/color/attributes"),e=a("../../plots/font_attributes"),f=a("../../plots/attributes"),g=a("../../lib/extend").extendFlat;b.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:d.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:g({},f.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:g({},e,{}),insidetextfont:g({},e,{}),outsidetextfont:g({},e,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":298,"../../lib/extend":345,"../../plots/attributes":367,"../../plots/font_attributes":383}],492:[function(a,b,c){"use strict";function d(a){if(!i){var b=g.defaults;i=b.slice();var c;for(c=0;c<b.length;c++)i.push(f(b[c]).lighten(20).toHexString());for(c=0;c<g.defaults.length;c++)i.push(f(b[c]).darken(20).toHexString())}return i[a%i.length]}var e=a("fast-isnumeric"),f=a("tinycolor2"),g=a("../../components/color"),h=a("./helpers");b.exports=function(a,b){var c,i,j,k,l,m,n=b.values,o=b.labels,p=[],q=a._fullLayout,r=q._piecolormap,s={},t=!1,u=0,v=q.hiddenlabels||[];if(b.dlabel)for(o=new Array(n.length),c=0;c<n.length;c++)o[c]=String(b.label0+c*b.dlabel);for(c=0;c<n.length;c++)i=n[c],e(i)&&(i=+i,0>i||(j=o[c],void 0!==j&&""!==j||(j=c),j=String(j),void 0===s[j]&&(s[j]=!0,k=f(b.marker.colors[c]),k.isValid()?(k=g.addOpacity(k,k.getAlpha()),r[j]||(r[j]=k)):r[j]?k=r[j]:(k=!1,t=!0),l=-1!==v.indexOf(j),l||(u+=i),p.push({v:i,label:j,color:k,i:c,hidden:l}))));if(b.sort&&p.sort(function(a,b){return b.v-a.v}),t)for(c=0;c<p.length;c++)m=p[c],m.color===!1&&(r[m.label]=m.color=d(q._piedefaultcolorcount),q._piedefaultcolorcount++);if(p[0]&&(p[0].vTotal=u),b.textinfo&&"none"!==b.textinfo){var w,x=-1!==b.textinfo.indexOf("label"),y=-1!==b.textinfo.indexOf("text"),z=-1!==b.textinfo.indexOf("value"),A=-1!==b.textinfo.indexOf("percent");for(c=0;c<p.length;c++)m=p[c],w=x?[m.label]:[],y&&b.text[m.i]&&w.push(b.text[m.i]),z&&w.push(h.formatPieValue(m.v)),A&&w.push(h.formatPiePercent(m.v/u)),m.text=w.join("<br>")}return p};var i},{"../../components/color":299,"./helpers":494,"fast-isnumeric":74,tinycolor2:229}],493:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./attributes");b.exports=function(a,b,c,f){function g(c,f){return d.coerce(a,b,e,c,f)}var h=d.coerceFont,i=g("values");if(!Array.isArray(i)||!i.length)return void(b.visible=!1);var j=g("labels");Array.isArray(j)||(g("label0"),g("dlabel"));var k=g("marker.line.width");k&&g("marker.line.color");var l=g("marker.colors");Array.isArray(l)||(b.marker.colors=[]),g("scalegroup");var m=g("text"),n=g("textinfo",Array.isArray(m)?"text+percent":"percent");if(g("hoverinfo",1===f._dataLength?"label+text+value+percent":void 0),n&&"none"!==n){var o=g("textposition"),p=Array.isArray(o)||"auto"===o,q=p||"inside"===o,r=p||"outside"===o;if(q||r){var s=h(g,"textfont",f.font);q&&h(g,"insidetextfont",s),r&&h(g,"outsidetextfont",s)}}g("domain.x"),g("domain.y"),g("hole"),g("sort"),g("direction"),g("rotation"),g("pull")}},{"../../lib":349,"./attributes":491}],494:[function(a,b,c){"use strict";c.formatPiePercent=function(a){var b=(100*a).toPrecision(3);return-1!==b.indexOf(".")?b.replace(/[.]?0+$/,"")+"%":b+"%"},c.formatPieValue=function(a){var b=a.toPrecision(10);return-1!==b.indexOf(".")?b.replace(/[.]?0+$/,""):b}},{}],495:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("./layout_defaults"),d.layoutAttributes=a("./layout_attributes"),d.calc=a("./calc"),d.plot=a("./plot"),d.style=a("./style"),d.styleOne=a("./style_one"),d.moduleType="trace",d.name="pie",d.basePlotModule=a("../../plots/cartesian"),d.categories=["pie","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":491,"./calc":492,"./defaults":493,"./layout_attributes":496,"./layout_defaults":497,"./plot":498,"./style":499,"./style_one":500}],496:[function(a,b,c){"use strict";b.exports={hiddenlabels:{valType:"data_array"}}},{}],497:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./layout_attributes");b.exports=function(a,b){function c(c,f){return d.coerce(a,b,e,c,f)}c("hiddenlabels")}},{"../../lib":349,"./layout_attributes":496}],498:[function(a,b,c){"use strict";function d(a,b,c){var d=Math.sqrt(a.width*a.width+a.height*a.height),f=a.width/a.height,g=Math.PI*Math.min(b.v/c.vTotal,.5),h=1-c.trace.hole,i=e(b,c),j={scale:i*c.r*2/d,rCenter:1-i,rotate:0};if(j.scale>=1)return j;var k=f+1/(2*Math.tan(g)),l=c.r*Math.min(1/(Math.sqrt(k*k+.5)+k),h/(Math.sqrt(f*f+h/2)+f)),m={scale:2*l/a.height,rCenter:Math.cos(l/c.r)-l*f/c.r,rotate:(180/Math.PI*b.midangle+720)%180-90},n=1/f,o=n+1/(2*Math.tan(g)),p=c.r*Math.min(1/(Math.sqrt(o*o+.5)+o),h/(Math.sqrt(n*n+h/2)+n)),q={scale:2*p/a.width,rCenter:Math.cos(p/c.r)-p/f/c.r,rotate:(180/Math.PI*b.midangle+810)%180-90},r=q.scale>m.scale?q:m;return j.scale<1&&r.scale>j.scale?r:j}function e(a,b){if(a.v===b.vTotal&&!b.trace.hole)return 1;var c=Math.PI*Math.min(a.v/b.vTotal,.5);return Math.min(1/(1+1/Math.sin(c)),(1-b.trace.hole)/2)}function f(a,b){var c=b.pxmid[0],d=b.pxmid[1],e=a.width/2,f=a.height/2;return 0>c&&(e*=-1),0>d&&(f*=-1),{scale:1,rCenter:1,rotate:0,x:e+Math.abs(f)*(e>0?1:-1)/2,y:f/(1+c*c/(d*d)),outside:!0}}function g(a,b){function c(a,b){return a.pxmid[1]-b.pxmid[1]}function d(a,b){return b.pxmid[1]-a.pxmid[1]}function e(a,c){c||(c={});var d,e,f,h,m,n,p=c.labelExtraY+(g?c.yLabelMax:c.yLabelMin),q=g?a.yLabelMin:a.yLabelMax,r=g?a.yLabelMax:a.yLabelMin,s=a.cyFinal+j(a.px0[1],a.px1[1]),t=p-q;if(t*l>0&&(a.labelExtraY=t),Array.isArray(b.pull))for(e=0;e<o.length;e++)f=o[e],f===a||(b.pull[a.i]||0)>=b.pull[f.i]||((a.pxmid[1]-f.pxmid[1])*l>0?(h=f.cyFinal+j(f.px0[1],f.px1[1]),t=h-q-a.labelExtraY,t*l>0&&(a.labelExtraY+=t)):(r+a.labelExtraY-s)*l>0&&(d=3*k*Math.abs(e-o.indexOf(a)),m=f.cxFinal+i(f.px0[0],f.px1[0]),n=m+d-(a.cxFinal+a.pxmid[0])-a.labelExtraX,n*k>0&&(a.labelExtraX+=n)))}var f,g,h,i,j,k,l,m,n,o,p,q,r;for(g=0;2>g;g++)for(h=g?c:d,j=g?Math.max:Math.min,l=g?1:-1,f=0;2>f;f++){for(i=f?Math.max:Math.min,k=f?1:-1,m=a[g][f],m.sort(h),n=a[1-g][f],o=n.concat(m),q=[],p=0;p<m.length;p++)void 0!==m[p].yLabelMid&&q.push(m[p]);for(r=!1,p=0;g&&p<n.length;p++)if(void 0!==n[p].yLabelMid){r=n[p];break}for(p=0;p<q.length;p++){var s=p&&q[p-1];r&&!p&&(s=r),e(q[p],s)}}}function h(a,b){var c,d,e,f,g,h,i,k,l,m,n=[];for(e=0;e<a.length;e++){if(g=a[e][0],h=g.trace,c=b.w*(h.domain.x[1]-h.domain.x[0]),d=b.h*(h.domain.y[1]-h.domain.y[0]),i=h.tiltaxis*Math.PI/180,k=h.pull,Array.isArray(k))for(k=0,f=0;f<h.pull.length;f++)h.pull[f]>k&&(k=h.pull[f]);g.r=Math.min(c/j(h.tilt,Math.sin(i),h.depth),d/j(h.tilt,Math.cos(i),h.depth))/(2+2*k),g.cx=b.l+b.w*(h.domain.x[1]+h.domain.x[0])/2,g.cy=b.t+b.h*(2-h.domain.y[1]-h.domain.y[0])/2,h.scalegroup&&-1===n.indexOf(h.scalegroup)&&n.push(h.scalegroup)}for(f=0;f<n.length;f++){for(m=1/0,l=n[f],e=0;e<a.length;e++)g=a[e][0],g.trace.scalegroup===l&&(m=Math.min(m,g.r*g.r/g.vTotal));for(e=0;e<a.length;e++)g=a[e][0],g.trace.scalegroup===l&&(g.r=Math.sqrt(m*g.vTotal))}}function i(a){function b(a){var b=l.r*Math.sin(a),c=-l.r*Math.cos(a);return n?[b*(1-h*d*d)+c*g*h,b*g*h+c*(1-h*e*e),Math.sin(f)*(c*e-b*d)]:[b,c]}var c,d,e,f,g,h,i,j,k,l=a[0],m=l.trace,n=m.tilt,o=m.rotation*Math.PI/180,p=2*Math.PI/l.vTotal,q="px0",r="px1";if("counterclockwise"===m.direction){for(i=0;i<a.length&&a[i].hidden;i++);if(i===a.length)return;o+=p*a[i].v,p*=-1,q="px1",r="px0"}for(n&&(f=n*Math.PI/180,c=m.tiltaxis*Math.PI/180,g=Math.sin(c)*Math.cos(c),h=1-Math.cos(f),d=Math.sin(c),e=Math.cos(c)),k=b(o),i=0;i<a.length;i++)j=a[i],j.hidden||(j[q]=k,o+=p*j.v/2,j.pxmid=b(o),j.midangle=o,o+=p*j.v/2,k=b(o),j[r]=k,j.largeArc=j.v>l.vTotal/2?1:0)}function j(a,b,c){if(!a)return 1;var d=Math.sin(a*Math.PI/180);return Math.max(.01,c*d*Math.abs(b)+2*Math.sqrt(1-d*d*b*b))}var k=a("d3"),l=a("../../plots/cartesian/graph_interact"),m=a("../../components/color"),n=a("../../components/drawing"),o=a("../../lib/svg_text_utils"),p=a("./helpers");b.exports=function(a,b){var c=a._fullLayout;h(b,c._size);var j=c._pielayer.selectAll("g.trace").data(b);j.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),j.exit().remove(),j.order(),j.each(function(b){var h=k.select(this),j=b[0],q=j.trace,r=0,s=(q.depth||0)*j.r*Math.sin(r)/2,t=q.tiltaxis||0,u=t*Math.PI/180,v=[s*Math.sin(u),s*Math.cos(u)],w=j.r*Math.cos(r),x=h.selectAll("g.part").data(q.tilt?["top","sides"]:["top"]);x.enter().append("g").attr("class",function(a){return a+" part"}),x.exit().remove(),x.order(),i(b),h.selectAll(".top").each(function(){var h=k.select(this).selectAll("g.slice").data(b);h.enter().append("g").classed("slice",!0),h.exit().remove();var i=[[[],[]],[[],[]]],r=!1;h.each(function(g){function h(b){var c=a._fullLayout,d=a._fullData[q.index],f=d.hoverinfo;if("all"===f&&(f="label+text+value+percent+name"),!a._dragging&&c.hovermode!==!1&&"none"!==f&&f){var h=e(g,j),i=x+g.pxmid[0]*(1-h),k=y+g.pxmid[1]*(1-h),m=[];-1!==f.indexOf("label")&&m.push(g.label),d.text&&d.text[g.i]&&-1!==f.indexOf("text")&&m.push(d.text[g.i]),-1!==f.indexOf("value")&&m.push(p.formatPieValue(g.v)),-1!==f.indexOf("percent")&&m.push(p.formatPiePercent(g.v/j.vTotal)),l.loneHover({x0:i-h*j.r,x1:i+h*j.r,y:k,text:m.join("<br>"),name:-1!==f.indexOf("name")?d.name:void 0,color:g.color,idealAlign:g.pxmid[0]<0?"left":"right"},{container:c._hoverlayer.node(),outerContainer:c._paper.node()}),l.hover(a,b,"pie"),B=!0}}function m(){B&&(l.loneUnhover(c._hoverlayer.node()),B=!1)}function s(){a._hoverdata=[g],a._hoverdata.trace=b.trace,l.click(a,{target:!0})}function u(a,b,c,d){return"a"+d*j.r+","+d*w+" "+t+" "+g.largeArc+(c?" 1 ":" 0 ")+d*(b[0]-a[0])+","+d*(b[1]-a[1])}if(g.hidden)return void k.select(this).selectAll("path,g").remove();i[g.pxmid[1]<0?0:1][g.pxmid[0]<0?0:1].push(g);var x=j.cx+v[0],y=j.cy+v[1],z=k.select(this),A=z.selectAll("path.surface").data([g]),B=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),z.select("path.textline").remove(),z.on("mouseover",h).on("mouseout",m).on("click",s),q.pull){var C=+(Array.isArray(q.pull)?q.pull[g.i]:q.pull)||0;C>0&&(x+=C*g.pxmid[0],y+=C*g.pxmid[1])}g.cxFinal=x,g.cyFinal=y;var D=q.hole;if(g.v===j.vTotal){var E="M"+(x+g.px0[0])+","+(y+g.px0[1])+u(g.px0,g.pxmid,!0,1)+u(g.pxmid,g.px0,!0,1)+"Z";D?A.attr("d","M"+(x+D*g.px0[0])+","+(y+D*g.px0[1])+u(g.px0,g.pxmid,!1,D)+u(g.pxmid,g.px0,!1,D)+"Z"+E):A.attr("d",E)}else{var F=u(g.px0,g.px1,!0,1);if(D){var G=1-D;A.attr("d","M"+(x+D*g.px1[0])+","+(y+D*g.px1[1])+u(g.px1,g.px0,!1,D)+"l"+G*g.px0[0]+","+G*g.px0[1]+F+"Z")}else A.attr("d","M"+x+","+y+"l"+g.px0[0]+","+g.px0[1]+F+"Z")}var H=Array.isArray(q.textposition)?q.textposition[g.i]:q.textposition,I=z.selectAll("g.slicetext").data(g.text&&"none"!==H?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each(function(){var a=k.select(this).selectAll("text").data([0]);a.enter().append("text").attr("data-notex",1),a.exit().remove(),a.text(g.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(n.font,"outside"===H?q.outsidetextfont:q.insidetextfont).call(o.convertToTspans),a.selectAll("tspan.line").attr({x:0,y:0});var b,c=n.bBox(a.node());"outside"===H?b=f(c,g):(b=d(c,g,j),"auto"===H&&b.scale<1&&(a.call(n.font,q.outsidetextfont),q.outsidetextfont.family===q.insidetextfont.family&&q.outsidetextfont.size===q.insidetextfont.size||(a.attr({"data-bb":""}),c=n.bBox(a.node())),b=f(c,g)));var e=x+g.pxmid[0]*b.rCenter+(b.x||0),h=y+g.pxmid[1]*b.rCenter+(b.y||0);b.outside&&(g.yLabelMin=h-c.height/2,g.yLabelMid=h,g.yLabelMax=h+c.height/2,g.labelExtraX=0,g.labelExtraY=0,r=!0),a.attr("transform","translate("+e+","+h+")"+(b.scale<1?"scale("+b.scale+")":"")+(b.rotate?"rotate("+b.rotate+")":"")+"translate("+-(c.left+c.right)/2+","+-(c.top+c.bottom)/2+")")})}),r&&g(i,q),h.each(function(a){if(a.labelExtraX||a.labelExtraY){var b=k.select(this),c=b.select("g.slicetext text");c.attr("transform","translate("+a.labelExtraX+","+a.labelExtraY+")"+c.attr("transform"));var d=a.cxFinal+a.pxmid[0],e=a.cyFinal+a.pxmid[1],f="M"+d+","+e,g=(a.yLabelMax-a.yLabelMin)*(a.pxmid[0]<0?-1:1)/4;if(a.labelExtraX){var h=a.labelExtraX*a.pxmid[1]/a.pxmid[0],i=a.yLabelMid+a.labelExtraY-(a.cyFinal+a.pxmid[1]);f+=Math.abs(h)>Math.abs(i)?"l"+i*a.pxmid[0]/a.pxmid[1]+","+i+"H"+(d+a.labelExtraX+g):"l"+a.labelExtraX+","+h+"v"+(i-h)+"h"+g}else f+="V"+(a.yLabelMid+a.labelExtraY)+"h"+g;b.append("path").classed("textline",!0).call(m.stroke,q.outsidetextfont.color).attr({"stroke-width":Math.min(2,q.outsidetextfont.size/8),d:f,fill:"none"})}})})}),setTimeout(function(){j.selectAll("tspan").each(function(){var a=k.select(this);a.attr("dy")&&a.attr("dy",a.attr("dy"))})},0)}},{"../../components/color":299,"../../components/drawing":317,"../../lib/svg_text_utils":360,"../../plots/cartesian/graph_interact":374,"./helpers":494,d3:70}],499:[function(a,b,c){"use strict";var d=a("d3"),e=a("./style_one");b.exports=function(a){a._fullLayout._pielayer.selectAll(".trace").each(function(a){var b=a[0],c=b.trace,f=d.select(this);f.style({opacity:c.opacity}),f.selectAll(".top path.surface").each(function(a){d.select(this).call(e,a,c)})})}},{"./style_one":500,d3:70}],500:[function(a,b,c){"use strict";var d=a("../../components/color");b.exports=function(a,b,c){var e=c.marker.line.color;Array.isArray(e)&&(e=e[b.i]||d.defaultLine);var f=c.marker.line.width||0;Array.isArray(f)&&(f=f[b.i]||0),a.style({"stroke-width":f,fill:b.color}).call(d.stroke,e)}},{"../../components/color":299}],501:[function(a,b,c){"use strict";var d=a("../../lib");b.exports=function(a){var b=a[0].trace,c=b.marker;if(d.mergeArray(b.text,a,"tx"),d.mergeArray(b.textposition,a,"tp"),b.textfont&&(d.mergeArray(b.textfont.size,a,"ts"),d.mergeArray(b.textfont.color,a,"tc"),d.mergeArray(b.textfont.family,a,"tf")),c&&c.line){var e=c.line;d.mergeArray(c.opacity,a,"mo"),d.mergeArray(c.symbol,a,"mx"),d.mergeArray(c.color,a,"mc"),d.mergeArray(e.color,a,"mlc"),d.mergeArray(e.width,a,"mlw")}}},{"../../lib":349}],502:[function(a,b,c){"use strict";var d=a("../../components/drawing");a("./constants");b.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx"],dflt:"none"},fillcolor:{valType:"color"},marker:{symbol:{valType:"enumerated",values:d.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},color:{valType:"color",arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!1},line:{color:{valType:"color",arrayOk:!0},width:{valType:"number",min:0,arrayOk:!0},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1}}},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/drawing":317,"./constants":506}],503:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/cartesian/axes"),f=a("../../lib"),g=a("./subtypes"),h=a("./marker_colorscale_calc");b.exports=function(a,b){var c=e.getFromId(a,b.xaxis||"x"),i=e.getFromId(a,b.yaxis||"y");f.markTime("in Scatter.calc");var j=c.makeCalcdata(b,"x");f.markTime("finished convert x");var k=i.makeCalcdata(b,"y");f.markTime("finished convert y");var l,m,n,o=Math.min(j.length,k.length);c._minDtick=0,i._minDtick=0,j.length>o&&j.splice(o,j.length-o),k.length>o&&k.splice(o,k.length-o);var p={padded:!0},q={padded:!0};if(g.hasMarkers(b)){if(l=b.marker,m=l.size,Array.isArray(m)){var r={type:"linear"};e.setConvert(r),m=r.makeCalcdata(b.marker,"size"),m.length>o&&m.splice(o,m.length-o)}var s,t=1.6*(b.marker.sizeref||1);s="area"===b.marker.sizemode?function(a){return Math.max(Math.sqrt((a||0)/t),3)}:function(a){return Math.max((a||0)/t,3)},p.ppad=q.ppad=Array.isArray(m)?m.map(s):s(m)}h(b),!("tozerox"===b.fill||"tonextx"===b.fill&&a.firstscatter)||j[0]===j[o-1]&&k[0]===k[o-1]?b.error_y.visible||-1===["tonexty","tozeroy"].indexOf(b.fill)&&(g.hasMarkers(b)||g.hasText(b))||(p.padded=!1,p.ppad=0):p.tozero=!0,!("tozeroy"===b.fill||"tonexty"===b.fill&&a.firstscatter)||j[0]===j[o-1]&&k[0]===k[o-1]?-1!==["tonextx","tozerox"].indexOf(b.fill)&&(q.padded=!1):q.tozero=!0,f.markTime("ready for Axes.expand"),e.expand(c,j,p),f.markTime("done expand x"),e.expand(i,k,q),f.markTime("done expand y");var u=new Array(o);for(n=0;o>n;n++)u[n]=d(j[n])&&d(k[n])?{x:j[n],y:k[n]}:{x:!1,y:!1};return void 0!==typeof m&&f.mergeArray(m,u,"ms"),a.firstscatter=!1,u}},{"../../lib":349,"../../plots/cartesian/axes":369,"./marker_colorscale_calc":515,"./subtypes":520,"fast-isnumeric":74}],504:[function(a,b,c){"use strict";b.exports=function(a){var b,c,d,e,f;for(b=0;b<a.length;b++)if(c=a[b],d=c.fill,"none"!==d&&"scatter"===c.type&&(c.opacity=void 0,"tonexty"===d||"tonextx"===d))for(e=b-1;e>=0;e--)if(f=a[e],"scatter"===f.type&&f.xaxis===c.xaxis&&f.yaxis===c.yaxis){f.opacity=void 0;break}}},{}],505:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("../../plots/plots"),h=a("../../components/colorscale/get_scale"),i=a("../../components/colorbar/draw");b.exports=function(a,b){var c=b[0].trace,j=c.marker,k="cb"+c.uid;if(a._fullLayout._infolayer.selectAll("."+k).remove(),void 0===j||!j.showscale)return void g.autoMargin(a,k);var l=h(j.colorscale),m=j.color,n=j.cmin,o=j.cmax;e(n)||(n=f.aggNums(Math.min,null,m)),e(o)||(o=f.aggNums(Math.max,null,m));var p=b[0].t.cb=i(a,k);p.fillcolor(d.scale.linear().domain(l.map(function(a){return n+a[0]*(o-n)})).range(l.map(function(a){return a[1]}))).filllevels({start:n,end:o,size:(o-n)/254}).options(j.colorbar)(),f.markTime("done colorbar")}},{"../../components/colorbar/draw":302,"../../components/colorscale/get_scale":310,"../../lib":349,"../../plots/plots":413,d3:70,"fast-isnumeric":74}],506:[function(a,b,c){"use strict";b.exports={PTS_LINESONLY:20}},{}],507:[function(a,b,c){"use strict";function d(a,b,c){var d=c("line.shape");"spline"===d&&c("line.smoothing")}var e=a("../../lib"),f=a("./attributes"),g=a("./constants"),h=a("./subtypes"),i=a("./xy_defaults"),j=a("./marker_defaults"),k=a("./line_defaults"),l=a("./text_defaults"),m=a("./fillcolor_defaults"),n=a("../../components/errorbars/defaults");b.exports=function(a,b,c,o){function p(c,d){return e.coerce(a,b,f,c,d)}var q=i(a,b,p),r=q<g.PTS_LINESONLY?"lines+markers":"lines";return q?(p("text"),p("mode",r),h.hasLines(b)&&(k(a,b,c,p),d(a,b,p),p("connectgaps")),h.hasMarkers(b)&&j(a,b,c,o,p),h.hasText(b)&&l(a,b,o,p),(h.hasMarkers(b)||h.hasText(b))&&p("marker.maxdisplayed"),p("fill"),"none"!==b.fill&&(m(a,b,c,p),h.hasLines(b)||d(a,b,p)),n(a,b,c,{axis:"y"}),void n(a,b,c,{axis:"x",inherit:"y"})):void(b.visible=!1)}},{"../../components/errorbars/defaults":322,"../../lib":349,"./attributes":502,"./constants":506,"./fillcolor_defaults":508,"./line_defaults":512,"./marker_defaults":516,"./subtypes":520,"./text_defaults":521,"./xy_defaults":522}],508:[function(a,b,c){"use strict";var d=a("../../components/color");b.exports=function(a,b,c,e){var f=!1;if(b.marker){var g=b.marker.color,h=(b.marker.line||{}).color;g&&!Array.isArray(g)?f=g:h&&!Array.isArray(h)&&(f=h)}e("fillcolor",d.addOpacity((b.line||{}).color||f||c,.5))}},{"../../components/color":299}],509:[function(a,b,c){"use strict";var d=a("../../components/color"),e=a("./subtypes");b.exports=function(a,b){var c,f;if("lines"===a.mode)return c=a.line.color,c&&d.opacity(c)?c:a.fillcolor;if("none"===a.mode)return a.fill?a.fillcolor:"";var g=b.mcc||(a.marker||{}).color,h=b.mlcc||((a.marker||{}).line||{}).color;return f=g&&d.opacity(g)?g:h&&d.opacity(h)&&(b.mlw||((a.marker||{}).line||{}).width)?h:"",f?d.opacity(f)<.3?d.addOpacity(f,.3):f:(c=(a.line||{}).color,c&&d.opacity(c)&&e.hasLines(a)&&a.line.width?c:a.fillcolor)}},{"../../components/color":299,"./subtypes":520}],510:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/graph_interact"),e=a("../../components/errorbars"),f=a("./get_trace_color");b.exports=function(a,b,c,g){var h=a.cd,i=h[0].trace,j=a.xa,k=a.ya,l=function(a){var c=Math.max(3,a.mrc||0);return Math.max(Math.abs(j.c2p(a.x)-j.c2p(b))-c,1-3/c)},m=function(a){var b=Math.max(3,a.mrc||0);return Math.max(Math.abs(k.c2p(a.y)-k.c2p(c))-b,1-3/b)},n=function(a){var d=Math.max(3,a.mrc||0),e=Math.abs(j.c2p(a.x)-j.c2p(b)),f=Math.abs(k.c2p(a.y)-k.c2p(c));return Math.max(Math.sqrt(e*e+f*f)-d,1-3/d)},o=d.getDistanceFunction(g,l,m,n);if(d.getClosest(h,o,a),a.index!==!1){var p=h[a.index],q=j.c2p(p.x,!0),r=k.c2p(p.y,!0),s=p.mrc||1;return a.color=f(i,p),a.x0=q-s,a.x1=q+s,a.xLabelVal=p.x,a.y0=r-s,a.y1=r+s,a.yLabelVal=p.y,p.tx?a.text=p.tx:i.text&&(a.text=i.text),e.hoverInfo(p,i,a),[a]}}},{"../../components/errorbars":323,"../../plots/cartesian/graph_interact":374,"./get_trace_color":509}],511:[function(a,b,c){"use strict";var d={},e=a("./subtypes");d.hasLines=e.hasLines,d.hasMarkers=e.hasMarkers,d.hasText=e.hasText,d.isBubble=e.isBubble,d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.cleanData=a("./clean_data"),d.calc=a("./calc"),d.arraysToCalcdata=a("./arrays_to_calcdata"),d.plot=a("./plot"),d.colorbar=a("./colorbar"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.selectPoints=a("./select"),d.moduleType="trace",d.name="scatter",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./arrays_to_calcdata":501,"./attributes":502,"./calc":503,"./clean_data":504,"./colorbar":505,"./defaults":507,"./hover":510,"./plot":517,"./select":518,"./style":519,"./subtypes":520}],512:[function(a,b,c){"use strict";b.exports=function(a,b,c,d){var e=(a.marker||{}).color;d("line.color",(Array.isArray(e)?!1:e)||c),d("line.width"),d("line.dash")}},{}],513:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/axes");b.exports=function(a,b){function c(b){var c=w.c2p(a[b].x),d=x.c2p(a[b].y);return c===C||d===C?!1:[c,d]}function e(a){var b=a[0]/w._length,c=a[1]/x._length;return(1+10*Math.max(0,-b,b-1,-c,c-1))*z}function f(a,b){var c=a[0]-b[0],d=a[1]-b[1];return Math.sqrt(c*c+d*d)}var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w=b.xaxis,x=b.yaxis,y=b.connectGaps,z=b.baseTolerance,A=b.linear,B=[],C=d.BADNUM,D=.2,E=new Array(a.length),F=0;for(g=0;g<a.length;g++)if(h=c(g)){for(F=0,E[F++]=h,g++;g<a.length;g++){if(j=c(g),!j){if(y)continue;break}if(A){if(m=f(j,h),!(m<e(j)*D)){for(o=[(j[0]-h[0])/m,(j[1]-h[1])/m],k=h,q=m,r=t=u=0,n=!1,i=j,g++;g<a.length;g++){if(l=c(g),!l){if(y)continue;break}if(p=[l[0]-h[0],l[1]-h[1]],v=p[0]*o[1]-p[1]*o[0],t=Math.min(t,v),u=Math.max(u,v),u-t>e(l))break;i=l,s=p[0]*o[0]+p[1]*o[1],s>q?(q=s,j=l,n=!1):r>s&&(r=s,k=l,n=!0)}if(n?(E[F++]=j,i!==k&&(E[F++]=k)):(k!==h&&(E[F++]=k),i!==j&&(E[F++]=j)),E[F++]=i,g>=a.length||!l)break;E[F++]=l,h=l}}else E[F++]=j}B.push(E.slice(0,F))}return B}},{"../../plots/cartesian/axes":369}],514:[function(a,b,c){"use strict";var d=a("fast-isnumeric");b.exports=function(a){var b=a.marker,c=b.sizeref||1,e=b.sizemin||0,f="area"===b.sizemode?function(a){return Math.sqrt(a/c)}:function(a){return a/c};return function(a){var b=f(a/2);return d(b)&&b>0?Math.max(b,e):0}}},{"fast-isnumeric":74}],515:[function(a,b,c){"use strict";var d=a("../../components/colorscale/has_colorscale"),e=a("../../components/colorscale/calc"),f=a("./subtypes");b.exports=function(a){if(f.hasMarkers(a)){var b=a.marker;d(a,"marker")&&e(a,b.color,"marker","c"),d(a,"marker.line")&&e(a,b.line.color,"marker.line","c")}}},{"../../components/colorscale/calc":306,"../../components/colorscale/has_colorscale":311,"./subtypes":520}],516:[function(a,b,c){"use strict"; 58 var d=a("../../components/color"),e=a("../../components/colorscale/has_colorscale"),f=a("../../components/colorscale/defaults"),g=a("./subtypes");b.exports=function(a,b,c,h,i){var j,k=g.isBubble(a),l=(a.line||{}).color;l&&(c=l),i("marker.symbol"),i("marker.opacity",k?.7:1),i("marker.size"),i("marker.color",c),e(a,"marker")&&f(a,b,h,i,{prefix:"marker.",cLetter:"c"}),j=l&&b.marker.color!==l?l:k?d.background:d.defaultLine,i("marker.line.color",j),e(a,"marker.line")&&f(a,b,h,i,{prefix:"marker.line.",cLetter:"c"}),i("marker.line.width",k?1:0),k&&(i("marker.sizeref"),i("marker.sizemin"),i("marker.sizemode"))}},{"../../components/color":299,"../../components/colorscale/defaults":308,"../../components/colorscale/has_colorscale":311,"./subtypes":520}],517:[function(a,b,c){"use strict";function d(a,b,c){var d=b.x(),f=b.y(),g=e.extent(d.range.map(d.l2c)),i=e.extent(f.range.map(f.l2c));c.forEach(function(a,b){var d=a[0].trace;if(h.hasMarkers(d)){var e=d.marker.maxdisplayed;if(0!==e){var f=a.filter(function(a){return a.x>=g[0]&&a.x<=g[1]&&a.y>=i[0]&&a.y<=i[1]}),j=Math.ceil(f.length/e),k=0;c.forEach(function(a,c){var d=a[0].trace;h.hasMarkers(d)&&d.marker.maxdisplayed>0&&b>c&&k++});var l=Math.round(k*j/3+Math.floor(k/3)*j/7.1);a.forEach(function(a){delete a.vis}),f.forEach(function(a,b){0===Math.round((b+l)%j)&&(a.vis=!0)})}}})}var e=a("d3"),f=a("../../lib"),g=a("../../components/drawing"),h=a("./subtypes"),i=a("./arrays_to_calcdata"),j=a("./line_points");b.exports=function(a,b,c){function k(a){return a.filter(function(a){return a.vis})}d(a,b,c);var l=b.x(),m=b.y(),n=b.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(c);n.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2);var o,p,q,r="";n.each(function(a){var b=a[0].trace,c=b.line,d=e.select(this);if(b.visible===!0&&(a[0].node3=d,i(a),h.hasLines(b)||"none"!==b.fill)){var f,k,n,s,t="",u="";o="tozero"===b.fill.substr(0,6)||"to"===b.fill.substr(0,2)&&!r?d.append("path").classed("js-fill",!0):null,q&&(p=q.datum(a)),q=d.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(c.shape)?(k=g.steps(c.shape),n=g.steps(c.shape.split("").reverse().join(""))):k=n="spline"===c.shape?function(a){return g.smoothopen(a,c.smoothing)}:function(a){return"M"+a.join("L")},s=function(a){return"L"+n(a.reverse()).substr(1)};var v=j(a,{xaxis:l,yaxis:m,connectGaps:b.connectgaps,baseTolerance:Math.max(c.width||1,3)/4,linear:"linear"===c.shape});if(v.length){for(var w=v[0][0],x=v[v.length-1],y=x[x.length-1],z=0;z<v.length;z++){var A=v[z];f=k(A),t+=t?"L"+f.substr(1):f,u=s(A)+u,h.hasLines(b)&&A.length>1&&d.append("path").classed("js-line",!0).attr("d",f)}o?w&&y&&("y"===b.fill.charAt(b.fill.length-1)?w[1]=y[1]=m.c2p(0,!0):w[0]=y[0]=l.c2p(0,!0),o.attr("d",t+"L"+y+"L"+w+"Z")):"tonext"===b.fill.substr(0,6)&&t&&r&&p.attr("d",t+r+"Z"),r=u}}}),n.selectAll("path:not([d])").remove(),n.append("g").attr("class","points").each(function(a){var b=a[0].trace,c=e.select(this),d=h.hasMarkers(b),i=h.hasText(b);!d&&!i||b.visible!==!0?c.remove():(d&&c.selectAll("path.point").data(b.marker.maxdisplayed?k:f.identity).enter().append("path").classed("point",!0).call(g.translatePoints,l,m),i&&c.selectAll("g").data(b.marker.maxdisplayed?k:f.identity).enter().append("g").append("text").call(g.translatePoints,l,m))})}},{"../../components/drawing":317,"../../lib":349,"./arrays_to_calcdata":501,"./line_points":513,"./subtypes":520,d3:70}],518:[function(a,b,c){"use strict";var d=a("./subtypes"),e=.2;b.exports=function(a,b){var c,f,g,h,i=a.cd,j=a.xaxis,k=a.yaxis,l=[],m=i[0].trace,n=m.index,o=m.marker;if(d.hasMarkers(m)||d.hasText(m)){var p=Array.isArray(o.opacity)?1:o.opacity;if(b===!1)for(c=0;c<i.length;c++)i[c].dim=0;else for(c=0;c<i.length;c++)f=i[c],g=j.c2p(f.x),h=k.c2p(f.y),b.contains([g,h])?(l.push({curveNumber:n,pointNumber:c,x:f.x,y:f.y}),f.dim=0):f.dim=1;return i[0].node3.selectAll("path.point").style("opacity",function(a){return((a.mo+1||p+1)-1)*(a.dim?e:1)}),i[0].node3.selectAll("text").style("opacity",function(a){return a.dim?e:1}),l}}},{"./subtypes":520}],519:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/drawing");b.exports=function(a){var b=d.select(a).selectAll("g.trace.scatter");b.style("opacity",function(a){return a[0].trace.opacity}),b.selectAll("g.points").each(function(a){d.select(this).selectAll("path.point").call(e.pointStyle,a.trace||a[0].trace),d.select(this).selectAll("text").call(e.textPointStyle,a.trace||a[0].trace)}),b.selectAll("g.trace path.js-line").call(e.lineGroupStyle),b.selectAll("g.trace path.js-fill").call(e.fillGroupStyle)}},{"../../components/drawing":317,d3:70}],520:[function(a,b,c){"use strict";b.exports={hasLines:function(a){return a.visible&&a.mode&&-1!==a.mode.indexOf("lines")},hasMarkers:function(a){return a.visible&&a.mode&&-1!==a.mode.indexOf("markers")},hasText:function(a){return a.visible&&a.mode&&-1!==a.mode.indexOf("text")},isBubble:function(a){return"object"==typeof a.marker&&Array.isArray(a.marker.size)}}},{}],521:[function(a,b,c){"use strict";var d=a("../../lib");b.exports=function(a,b,c,e){e("textposition"),d.coerceFont(e,"textfont",c.font)}},{"../../lib":349}],522:[function(a,b,c){"use strict";b.exports=function(a,b,c){var d,e=c("x"),f=c("y");if(e)f?(d=Math.min(e.length,f.length),d<e.length&&(b.x=e.slice(0,d)),d<f.length&&(b.y=f.slice(0,d))):(d=e.length,c("y0"),c("dy"));else{if(!f)return 0;d=b.y.length,c("x0"),c("dx")}return d}},{}],523:[function(a,b,c){"use strict";function d(a){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var e=a("../scatter/attributes"),f=a("../../constants/gl_markers"),g=a("../../lib/extend").extendFlat,h=e.line,i=e.marker,j=i.line;b.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:g({},e.text,{}),mode:g({},e.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:d("x"),y:d("y"),z:d("z")},line:{color:h.color,width:h.width,dash:h.dash},marker:{color:i.color,symbol:{valType:"enumerated",values:Object.keys(f),dflt:"circle",arrayOk:!0},size:g({},i.size,{dflt:8}),sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,opacity:g({},i.opacity,{arrayOk:!1}),colorscale:i.colorscale,cauto:i.cauto,cmax:i.cmax,cmin:i.cmin,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,line:{color:j.color,width:g({},j.width,{arrayOk:!1}),colorscale:j.colorscale,cauto:j.cauto,cmax:j.cmax,cmin:j.cmin,autocolorscale:j.autocolorscale,reversescale:j.reversescale}},textposition:g({},e.textposition,{dflt:"top center"}),textfont:e.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl_markers":337,"../../lib/extend":345,"../scatter/attributes":502}],524:[function(a,b,c){"use strict";var d=a("../scatter/arrays_to_calcdata"),e=a("../scatter/marker_colorscale_calc");b.exports=function(a,b){var c=[{x:!1,y:!1,trace:b,t:{}}];return d(c),e(b),c}},{"../scatter/arrays_to_calcdata":501,"../scatter/marker_colorscale_calc":515}],525:[function(a,b,c){"use strict";function d(a,b,c){if(!b||!b.visible)return null;for(var d=g(b),e=new Array(a.length),f=0;f<a.length;f++){var h=d(+a[f],f);e[f]=[-h[0]*c,h[1]*c]}return e}function e(a){for(var b=0;b<a.length;b++)if(a[b])return a[b].length;return 0}function f(a,b){var c=[d(a.x,a.error_x,b[0]),d(a.y,a.error_y,b[1]),d(a.z,a.error_z,b[2])],f=e(c);if(0===f)return null;for(var g=new Array(f),h=0;f>h;h++){for(var i=[[0,0,0],[0,0,0]],j=0;3>j;j++)if(c[j])for(var k=0;2>k;k++)i[k][j]=c[j][h][k];g[h]=i}return g}var g=a("../../components/errorbars/compute_error");b.exports=f},{"../../components/errorbars/compute_error":321}],526:[function(a,b,c){"use strict";function d(a,b){this.scene=a,this.uid=b,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function e(a,b,c){var d,e=(c+1)%3,f=(c+2)%3,g=[],h=[];for(d=0;d<a.length;++d){var i=a[d];!isNaN(i[e])&&isFinite(i[e])&&!isNaN(i[f])&&isFinite(i[f])&&(g.push([i[e],i[f]]),h.push(d))}var j=r(g);for(d=0;d<j.length;++d)for(var k=j[d],l=0;l<k.length;++l)k[l]=h[k[l]];return{positions:a,cells:j,meshColor:b}}function f(a){for(var b=[0,0,0],c=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0],e=0;3>e;e++){var f=a[e];f&&f.copy_zstyle!==!1&&(f=a[2]),f&&(b[e]=f.width/2,c[e]=t(f.color),d=f.thickness)}return{capSize:b,color:c,lineWidth:d}}function g(a){var b=[0,0];return Array.isArray(a)?[0,-1]:(a.indexOf("bottom")>=0&&(b[1]+=1),a.indexOf("top")>=0&&(b[1]-=1),a.indexOf("left")>=0&&(b[0]-=1),a.indexOf("right")>=0&&(b[0]+=1),b)}function h(a,b){return b(4*a)}function i(a){return x[a]}function j(a,b,c,d,e){var f=null;if(Array.isArray(a)){f=[];for(var g=0;b>g;g++)void 0===a[g]?f[g]=d:f[g]=c(a[g],e)}else f=c(a,s.identity);return f}function k(a,b){var c,d,e,k,l,m,n=[],o=a.fullSceneLayout,p=a.dataScale,q=o.xaxis,r=o.yaxis,w=o.zaxis,x=b.marker,z=b.line,A=b.x||[],B=b.y||[],C=b.z||[],D=A.length;for(d=0;D>d;d++)e=q.d2l(A[d])*p[0],k=r.d2l(B[d])*p[1],l=w.d2l(C[d])*p[2],n[d]=[e,k,l];if(Array.isArray(b.text))m=b.text;else if(void 0!==b.text)for(m=new Array(D),d=0;D>d;d++)m[d]=b.text;if(c={position:n,mode:b.mode,text:m},"line"in b&&(c.lineColor=t(z.color),c.lineWidth=z.width,c.lineDashes=z.dash),"marker"in b){var E=v(b);c.scatterColor=u(x,1,D),c.scatterSize=j(x.size,D,h,20,E),c.scatterMarker=j(x.symbol,D,i,"â"),c.scatterLineWidth=x.line.width,c.scatterLineColor=u(x.line,1,D),c.scatterAngle=0}"textposition"in b&&(c.textOffset=g(b.textposition),c.textColor=u(b.textfont,1,D),c.textSize=j(b.textfont.size,D,s.identity,12),c.textFont=b.textfont.family,c.textAngle=0);var F=["x","y","z"];for(c.project=[!1,!1,!1],c.projectScale=[1,1,1],c.projectOpacity=[1,1,1],d=0;3>d;++d){var G=b.projection[F[d]];(c.project[d]=G.show)&&(c.projectOpacity[d]=G.opacity,c.projectScale[d]=G.scale)}c.errorBounds=y(b,p);var H=f([b.error_x,b.error_y,b.error_z]);return c.errorColor=H.color,c.errorLineWidth=H.lineWidth,c.errorCapSize=H.capSize,c.delaunayAxis=b.surfaceaxis,c.delaunayColor=t(b.surfacecolor),c}function l(a){if(Array.isArray(a)){var b=a[0];return Array.isArray(b)&&(a=b),"rgb("+a.slice(0,3).map(function(a){return Math.round(255*a)})+")"}return null}function m(a,b){var c=new d(a,b.uid);return c.update(b),c}var n=a("gl-line3d"),o=a("gl-scatter3d"),p=a("gl-error3d"),q=a("gl-mesh3d"),r=a("delaunay-triangulate"),s=a("../../lib"),t=a("../../lib/str2rgbarray"),u=a("../../lib/gl_format_color"),v=a("../scatter/make_bubble_size_func"),w=a("../../constants/gl3d_dashes"),x=a("../../constants/gl_markers"),y=a("./calc_errors"),z=d.prototype;z.handlePick=function(a){if(a.object&&(a.object===this.linePlot||a.object===this.delaunayMesh||a.object===this.textMarkers||a.object===this.scatterPlot)){a.object.highlight&&a.object.highlight(null),this.scatterPlot&&(a.object=this.scatterPlot,this.scatterPlot.highlight(a.data)),this.textLabels&&void 0!==this.textLabels[a.data.index]?a.textLabel=this.textLabels[a.data.index]:a.textLabel="";var b=a.data.index;return a.traceCoordinate=[this.data.x[b],this.data.y[b],this.data.z[b]],!0}},z.update=function(a){var b,c,d,f,g=this.scene.glplot.gl,h=w.solid;this.data=a;var i=k(this.scene,a);"mode"in i&&(this.mode=i.mode),"lineDashes"in i&&i.lineDashes in w&&(h=w[i.lineDashes]),this.color=l(i.scatterColor)||l(i.lineColor),this.dataPoints=i.position,b={gl:g,position:i.position,color:i.lineColor,lineWidth:i.lineWidth||1,dashes:h[0],dashScale:h[1],opacity:a.opacity},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(b):(this.linePlot=n(b),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var j=a.opacity;if(a.marker&&a.marker.opacity&&(j*=a.marker.opacity),c={gl:g,position:i.position,color:i.scatterColor,size:i.scatterSize,glyph:i.scatterMarker,opacity:j,orthographic:!0,lineWidth:i.scatterLineWidth,lineColor:i.scatterLineColor,project:i.project,projectScale:i.projectScale,projectOpacity:i.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(c):(this.scatterPlot=o(c),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),f={gl:g,position:i.position,glyph:i.text,color:i.textColor,size:i.textSize,angle:i.textAngle,alignment:i.textOffset,font:i.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:a.opacity},this.textLabels=i.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(f):(this.textMarkers=o(f),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),d={gl:g,position:i.position,color:i.errorColor,error:i.errorBounds,lineWidth:i.errorLineWidth,capSize:i.errorCapSize,opacity:a.opacity},this.errorBars?i.errorBounds?this.errorBars.update(d):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):i.errorBounds&&(this.errorBars=p(d),this.scene.glplot.add(this.errorBars)),i.delaunayAxis>=0){var m=e(i.position,i.delaunayColor,i.delaunayAxis);this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=g,this.delaunayMesh=q(m),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},z.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.textMarkers),this.delaunayMesh.dispose())},b.exports=m},{"../../constants/gl3d_dashes":336,"../../constants/gl_markers":337,"../../lib":349,"../../lib/gl_format_color":347,"../../lib/str2rgbarray":359,"../scatter/make_bubble_size_func":514,"./calc_errors":525,"delaunay-triangulate":71,"gl-error3d":78,"gl-line3d":84,"gl-mesh3d":107,"gl-scatter3d":150}],527:[function(a,b,c){"use strict";function d(a,b,c){var d=0,e=c("x"),f=c("y"),g=c("z");return e&&f&&g&&(d=Math.min(e.length,f.length,g.length),d<e.length&&(b.x=e.slice(0,d)),d<f.length&&(b.y=f.slice(0,d)),d<g.length&&(b.z=g.slice(0,d))),d}var e=a("../../lib"),f=a("../scatter/subtypes"),g=a("../scatter/marker_defaults"),h=a("../scatter/line_defaults"),i=a("../scatter/text_defaults"),j=a("../../components/errorbars/defaults"),k=a("./attributes");b.exports=function(a,b,c,l){function m(c,d){return e.coerce(a,b,k,c,d)}var n=d(a,b,m);if(!n)return void(b.visible=!1);m("text"),m("mode"),f.hasLines(b)&&h(a,b,c,m),f.hasMarkers(b)&&g(a,b,c,l,m),f.hasText(b)&&i(a,b,l,m);var o=(b.line||{}).color,p=(b.marker||{}).color;m("surfaceaxis")>=0&&m("surfacecolor",o||p);for(var q=["x","y","z"],r=0;3>r;++r){var s="projection."+q[r];m(s+".show")&&(m(s+".opacity"),m(s+".scale"))}j(a,b,c,{axis:"z"}),j(a,b,c,{axis:"y",inherit:"z"}),j(a,b,c,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":322,"../../lib":349,"../scatter/line_defaults":512,"../scatter/marker_defaults":516,"../scatter/subtypes":520,"../scatter/text_defaults":521,"./attributes":523}],528:[function(a,b,c){"use strict";var d={};d.plot=a("./convert"),d.attributes=a("./attributes"),d.markerSymbols=a("../../constants/gl_markers"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../scatter/colorbar"),d.calc=a("./calc"),d.moduleType="trace",d.name="scatter3d",d.basePlotModule=a("../../plots/gl3d"),d.categories=["gl3d","symbols","markerColorscale","showLegend"],d.meta={},b.exports=d},{"../../constants/gl_markers":337,"../../plots/gl3d":400,"../scatter/colorbar":505,"./attributes":523,"./calc":524,"./convert":526,"./defaults":527}],529:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../plots/attributes"),f=a("../../lib/extend").extendFlat,g=d.marker,h=d.line,i=g.line;b.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:f({},d.mode,{dflt:"markers"}),text:f({},d.text,{}),line:{color:h.color,width:h.width,dash:h.dash},marker:{symbol:g.symbol,opacity:g.opacity,size:g.size,sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode,color:g.color,colorscale:g.colorscale,cauto:g.cauto,cmax:g.cmax,cmin:g.cmin,autocolorscale:g.autocolorscale,reversescale:g.reversescale,showscale:g.showscale,line:{color:i.color,width:i.width,colorscale:i.colorscale,cauto:i.cauto,cmax:i.cmax,cmin:i.cmin,autocolorscale:i.autocolorscale,reversescale:i.reversescale}},textfont:d.textfont,textposition:d.textposition,hoverinfo:f({},e.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../lib/extend":345,"../../plots/attributes":367,"../scatter/attributes":502}],530:[function(a,b,c){"use strict";var d=a("../scatter/marker_colorscale_calc");b.exports=function(a,b){var c=[{x:!1,y:!1,trace:b,t:{}}];return d(b),c}},{"../scatter/marker_colorscale_calc":515}],531:[function(a,b,c){"use strict";function d(a,b,c){var d,e,f=0,g=c("locations");return g?(c("locationmode"),f=g.length):(d=c("lon")||[],e=c("lat")||[],f=Math.min(d.length,e.length),f<d.length&&(b.lon=d.slice(0,f)),f<e.length&&(b.lat=e.slice(0,f)),f)}var e=a("../../lib"),f=a("../scatter/subtypes"),g=a("../scatter/marker_defaults"),h=a("../scatter/line_defaults"),i=a("../scatter/text_defaults"),j=a("./attributes");b.exports=function(a,b,c,k){function l(c,d){return e.coerce(a,b,j,c,d)}var m=d(a,b,l);return m?(l("text"),l("mode"),f.hasLines(b)&&h(a,b,c,l),f.hasMarkers(b)&&g(a,b,c,k,l),f.hasText(b)&&i(a,b,k,l),void l("hoverinfo",1===k._dataLength?"lon+lat+location+text":void 0)):void(b.visible=!1)}},{"../../lib":349,"../scatter/line_defaults":512,"../scatter/marker_defaults":516,"../scatter/subtypes":520,"../scatter/text_defaults":521,"./attributes":529}],532:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../scatter/colorbar"),d.calc=a("./calc"),d.plot=a("./plot").plot,d.moduleType="trace",d.name="scattergeo",d.basePlotModule=a("../../plots/geo"),d.categories=["geo","symbols","markerColorscale","showLegend"],d.meta={},b.exports=d},{"../../plots/geo":385,"../scatter/colorbar":505,"./attributes":529,"./calc":530,"./defaults":531,"./plot":533}],533:[function(a,b,c){"use strict";function d(a,b,c){function d(a,d){m(a,b,d,c)}var e=a.marker;if(d(a.text,"tx"),d(a.textposition,"tp"),a.textfont&&(d(a.textfont.size,"ts"),d(a.textfont.color,"tc"),d(a.textfont.family,"tf")),e&&e.line){var f=e.line;d(e.opacity,"mo"),d(e.symbol,"mx"),d(e.color,"mc"),d(e.size,"ms"),d(f.color,"mlc"),d(f.width,"mlw")}}function e(a){for(var b=a.lon.length,c=new Array(b),d=0;b>d;d++)c[d]=[a.lon[d],a.lat[d]];return{type:"LineString",coordinates:c,trace:a}}function f(a,b){function c(b){var c=a.mockAxis;return j.tickText(c,c.c2l(b),"hover").text+"°"}var d=b.hoverinfo;if("none"===d)return function(a){delete a.textLabel};var e="all"===d?q.hoverinfo.flags:d.split("+"),f=-1!==e.indexOf("location")&&Array.isArray(b.locations),g=-1!==e.indexOf("lon"),h=-1!==e.indexOf("lat"),i=-1!==e.indexOf("text");return function(a){var d=[];f?d.push(a.location):g&&h?d.push("("+c(a.lon)+", "+c(a.lat)+")"):g?d.push("lon: "+c(a.lon)):h&&d.push("lat: "+c(a.lat)),i&&d.push(a.tx||b.text),a.textLabel=d.join("<br>")}}function g(a){var b=Array.isArray(a.locations);return function(c,d){return{points:[{data:a._input,fullData:a,curveNumber:a.index,pointNumber:d,lon:c.lon,lat:c.lat,location:b?c.location:null}]}}}var h=a("d3"),i=a("../../plots/cartesian/graph_interact"),j=a("../../plots/cartesian/axes"),k=a("../../lib/topojson_utils").getTopojsonFeatures,l=a("../../lib/geo_location_utils").locationToFeature,m=a("../../lib/array_to_calc_item"),n=a("../../components/color"),o=a("../../components/drawing"),p=a("../scatter/subtypes"),q=a("./attributes"),r=b.exports={};r.calcGeoJSON=function(a,b){var c,e,f,g,h=[],i=Array.isArray(a.locations);i?(g=a.locations,c=g.length,e=k(a,b),f=function(a,b){var c=l(a.locationmode,g[b],e);return void 0!==c?c.properties.ct:void 0}):(c=a.lon.length,f=function(a,b){return[a.lon[b],a.lat[b]]});for(var j=0;c>j;j++){var m=f(a,j);if(m){var n={lon:m[0],lat:m[1],location:i?a.locations[j]:null};d(a,n,j),h.push(n)}}return h.length>0&&(h[0].trace=a),h},r.plot=function(a,b){var c=a.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(b,function(a){return a.uid});c.enter().append("g").attr("class","trace scattergeo"),c.exit().remove(),c.each(function(a){p.hasLines(a)&&h.select(this).append("path").datum(e(a)).attr("class","js-line")}),c.append("g").attr("class","points").each(function(b){function c(c,d){if(a.showHover){var e=a.projection([c.lon,c.lat]);m(c),i.loneHover({x:e[0],y:e[1],name:q?b.name:void 0,text:c.textLabel,color:c.mc||(b.marker||{}).color},{container:a.hoverContainer.node()}),a.graphDiv.emit("plotly_hover",n(c,d))}}function d(b,c){a.graphDiv.emit("plotly_click",n(b,c))}var e=h.select(this),j=p.hasMarkers(b),k=p.hasText(b);if(j||k){var l=r.calcGeoJSON(b,a.topojson),m=f(a,b),n=g(b),o=b.hoverinfo,q="all"===o||-1!==o.indexOf("name");j&&e.selectAll("path.point").data(l).enter().append("path").attr("class","point").on("mouseover",c).on("click",d).on("mouseout",function(){i.loneUnhover(a.hoverContainer)}).on("mousedown",function(){i.loneUnhover(a.hoverContainer)}).on("mouseup",c),k&&e.selectAll("g").data(l).enter().append("g").append("text")}}),r.style(a)},r.style=function(a){var b=a.framework.selectAll("g.trace.scattergeo");b.style("opacity",function(a){return a.opacity}),b.selectAll("g.points").each(function(a){h.select(this).selectAll("path.point").call(o.pointStyle,a),h.select(this).selectAll("text").call(o.textPointStyle,a)}),b.selectAll("path.js-line").style("fill","none").each(function(a){var b=a.trace,c=b.line||{};h.select(this).call(n.stroke,c.color).call(o.dashLine,c.dash||"",c.width||0)})}},{"../../components/color":299,"../../components/drawing":317,"../../lib/array_to_calc_item":341,"../../lib/geo_location_utils":346,"../../lib/topojson_utils":361,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"../scatter/subtypes":520,"./attributes":529,d3:70}],534:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../constants/gl2d_dashes"),f=a("../../constants/gl_markers"),g=a("../../lib/extend").extendFlat,h=d.line,i=d.marker,j=i.line;b.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:g({},d.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:h.color,width:h.width,dash:{valType:"enumerated",values:Object.keys(e),dflt:"solid"}},marker:{color:i.color,symbol:{valType:"enumerated",values:Object.keys(f),dflt:"circle",arrayOk:!0},size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,opacity:i.opacity,colorscale:i.colorscale,cauto:i.cauto,cmax:i.cmax,cmin:i.cmin,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,line:{color:j.color,width:j.width,colorscale:j.colorscale,cauto:j.cauto,cmax:j.cmax,cmin:j.cmin,autocolorscale:j.autocolorscale,reversescale:j.reversescale}},fill:g({},d.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:d.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl2d_dashes":335,"../../constants/gl_markers":337,"../../lib/extend":345,"../scatter/attributes":502}],535:[function(a,b,c){"use strict";function d(a,b){this.scene=a,this.uid=b,this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array,color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=n(a.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=o(a.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=o(a.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array,sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=l(a.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=m(a.glplot,this.scatterOptions),this.fancyScatter._trace=this}function e(a,b,c){return Array.isArray(b)||(b=[b]),f(a,b,c)}function f(a,b,c){for(var d=new Array(c),e=b[0],f=0;c>f;++f)d[f]=a(f>=b.length?e:b[f]);return d}function g(a,b,c){return i(D(a,c),C(b,c),c)}function h(a,b,c,d){var e=u(a,b,d);return e=Array.isArray(e[0])?e:f(q.identity,[e],d),i(e,C(c,d),d)}function i(a,b,c){for(var d=new Array(4*c),e=0;c>e;++e){for(var f=0;3>f;++f)d[4*e+f]=a[e][f];d[4*e+3]=a[e][3]*b[e]}return d}function j(a,b){if(void 0===Float32Array.slice){for(var c=new Float32Array(b),d=0;b>d;d++)c[d]=a[d];return c}return a.slice(0,b)}function k(a,b){var c=new d(a,b.uid);return c.update(b),c}var l=a("gl-scatter2d"),m=a("gl-scatter2d-fancy"),n=a("gl-line2d"),o=a("gl-error2d"),p=a("fast-isnumeric"),q=a("../../lib"),r=a("../../plots/cartesian/axes"),s=a("../../components/errorbars"),t=a("../../lib/str2rgbarray"),u=a("../../lib/gl_format_color"),v=a("../scatter/subtypes"),w=a("../scatter/make_bubble_size_func"),x=a("../scatter/get_trace_color"),y=a("../../constants/gl_markers"),z=a("../../constants/gl2d_dashes"),A=["xaxis","yaxis"],B=d.prototype;B.handlePick=function(a){var b=this.idToIndex[a.pointId];return{trace:this,dataCoord:a.dataCoord,traceCoord:[this.xData[b],this.yData[b]],textLabel:Array.isArray(this.textLabels)?this.textLabels[b]:this.textLabels,color:Array.isArray(this.color)?this.color[b]:this.color,name:this.name,hoverinfo:this.hoverinfo}},B.isFancy=function(a){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!a.x||!a.y)return!0;var b=a.marker||{};if(Array.isArray(b.symbol)||"circle"!==b.symbol||Array.isArray(b.size)||Array.isArray(b.line.width)||Array.isArray(b.opacity))return!0;var c=b.color;if(Array.isArray(c))return!0;var d=Array.isArray(b.line.color);return Array.isArray(d)?!0:this.hasErrorX?!0:!!this.hasErrorY};var C=e.bind(null,function(a){return+a}),D=e.bind(null,t),E=e.bind(null,function(a){return y[a]||"â"});B.update=function(a){a.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=v.hasLines(a),this.hasErrorX=a.error_x.visible===!0,this.hasErrorY=a.error_y.visible===!0,this.hasMarkers=v.hasMarkers(a)),this.textLabels=a.text,this.name=a.name,this.hoverinfo=a.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.isFancy(a)?this.updateFancy(a):this.updateFast(a),this.color=x(a,{})},B.updateFast=function(a){for(var b,c,d=this.xData=a.x,e=this.yData=a.y,f=d.length,g=new Array(f),h=new Float32Array(2*f),i=this.bounds,k=0,l=0,m=0;f>m;++m)b=d[m],c=e[m],p(b)&&p(c)&&(g[k++]=m,h[l++]=b,h[l++]=c,i[0]=Math.min(i[0],b),i[1]=Math.min(i[1],c),i[2]=Math.max(i[2],b),i[3]=Math.max(i[3],c));h=j(h,l),this.idToIndex=g,this.updateLines(a,h),this.updateError("X",a),this.updateError("Y",a);var n;if(this.hasMarkers){this.scatterOptions.positions=h;var o=t(a.marker.color),q=t(a.marker.line.color),r=a.opacity*a.marker.opacity;o[3]*=r,this.scatterOptions.color=o,q[3]*=r,this.scatterOptions.borderColor=q,n=a.marker.size,this.scatterOptions.size=n,this.scatterOptions.borderSize=a.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(i,n)},B.updateFancy=function(a){var b,c,d,f,g,i,k,l,m=this.scene,n=m.xaxis,o=m.yaxis,p=this.bounds,q=this.xData=n.makeCalcdata(a,"x"),r=this.yData=o.makeCalcdata(a,"y"),t=s.calcFromTrace(a,m.fullLayout),u=q.length,v=new Array(u),x=new Float32Array(2*u),y=new Float32Array(4*u),z=new Float32Array(4*u),A=0,B=0,D=0,F=0,G="log"===n.type?function(a){return n.d2l(a)}:function(a){return a},H="log"===o.type?function(a){return o.d2l(a)}:function(a){return a};for(b=0;u>b;++b)d=G(q[b]),f=H(r[b]),isNaN(d)||isNaN(f)||(v[A++]=b,x[B++]=d,x[B++]=f,g=y[D++]=d-t[b].xs||0,i=y[D++]=t[b].xh-d||0,y[D++]=0,y[D++]=0,z[F++]=0,z[F++]=0,k=z[F++]=f-t[b].ys||0,l=z[F++]=t[b].yh-f||0,p[0]=Math.min(p[0],d-g),p[1]=Math.min(p[1],f-k),p[2]=Math.max(p[2],d+i),p[3]=Math.max(p[3],f+l));x=j(x,B),this.idToIndex=v,this.updateLines(a,x),this.updateError("X",a,x,y),this.updateError("Y",a,x,z);var I;if(this.hasMarkers){this.scatterOptions.positions=x,this.scatterOptions.sizes=new Array(A),this.scatterOptions.glyphs=new Array(A),this.scatterOptions.borderWidths=new Array(A),this.scatterOptions.colors=new Array(4*A),this.scatterOptions.borderColors=new Array(4*A);var J,K=w(a),L=a.marker,M=L.opacity,N=a.opacity,O=h(L,M,N,u),P=E(L.symbol,u),Q=C(L.line.width,u),R=h(L.line,M,N,u);for(I=e(K,L.size,u),b=0;A>b;++b)for(J=v[b],this.scatterOptions.sizes[b]=4*I[J],this.scatterOptions.glyphs[b]=P[J],this.scatterOptions.borderWidths[b]=.5*Q[J],c=0;4>c;++c)this.scatterOptions.colors[4*b+c]=O[4*J+c],this.scatterOptions.borderColors[4*b+c]=R[4*J+c];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(q,r,I)},B.updateLines=function(a,b){if(this.hasLines){this.lineOptions.positions=b;var c=t(a.line.color);this.hasMarkers&&(c[3]*=a.marker.opacity);for(var d=Math.round(.5*this.lineOptions.width),e=(z[a.line.dash]||[1]).slice(),f=0;f<e.length;++f)e[f]*=d;switch(a.fill){case"tozeroy":this.lineOptions.fill=[!1,!0,!1,!1];break;case"tozerox":this.lineOptions.fill=[!0,!1,!1,!1];break;default:this.lineOptions.fill=[!1,!1,!1,!1]}var g=t(a.fillcolor);this.lineOptions.color=c,this.lineOptions.width=2*a.line.width,this.lineOptions.dashes=e,this.lineOptions.fillColor=[g,g,g,g]}else this.lineOptions.positions=new Float32Array;this.line.update(this.lineOptions)},B.updateError=function(a,b,c,d){var e=this["error"+a],f=b["error_"+a.toLowerCase()],h=this["error"+a+"Options"];"x"===a.toLowerCase()&&f.copy_ystyle&&(f=b.error_y),this["hasError"+a]?(h.positions=c,h.errors=d,h.capSize=f.width,h.lineWidth=f.thickness/2,h.color=g(f.color,1,1)):h.positions=new Float32Array,e.update(h)},B.expandAxesFast=function(a,b){for(var c,d,e,f=b||10,g=0;2>g;g++)c=this.scene[A[g]],d=c._min,d||(d=[]),d.push({val:a[g],pad:f}),e=c._max,e||(e=[]),e.push({val:a[g+2],pad:f})},B.expandAxesFancy=function(a,b,c){var d=this.scene,e={padded:!0,ppad:c};r.expand(d.xaxis,a,e),r.expand(d.yaxis,b,e)},B.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},b.exports=k},{"../../components/errorbars":323,"../../constants/gl2d_dashes":335,"../../constants/gl_markers":337,"../../lib":349,"../../lib/gl_format_color":347,"../../lib/str2rgbarray":359,"../../plots/cartesian/axes":369,"../scatter/get_trace_color":509,"../scatter/make_bubble_size_func":514,"../scatter/subtypes":520, 59 "fast-isnumeric":74,"gl-error2d":76,"gl-line2d":82,"gl-scatter2d":147,"gl-scatter2d-fancy":142}],536:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../scatter/constants"),f=a("../scatter/subtypes"),g=a("../scatter/xy_defaults"),h=a("../scatter/marker_defaults"),i=a("../scatter/line_defaults"),j=a("../scatter/fillcolor_defaults"),k=a("../../components/errorbars/defaults"),l=a("./attributes");b.exports=function(a,b,c,m){function n(c,e){return d.coerce(a,b,l,c,e)}var o=g(a,b,n);return o?(n("text"),n("mode",o<e.PTS_LINESONLY?"lines+markers":"lines"),f.hasLines(b)&&i(a,b,c,n),f.hasMarkers(b)&&h(a,b,c,m,n),n("fill"),"none"!==b.fill&&j(a,b,c,n),k(a,b,c,{axis:"y"}),void k(a,b,c,{axis:"x",inherit:"y"})):void(b.visible=!1)}},{"../../components/errorbars/defaults":322,"../../lib":349,"../scatter/constants":506,"../scatter/fillcolor_defaults":508,"../scatter/line_defaults":512,"../scatter/marker_defaults":516,"../scatter/subtypes":520,"../scatter/xy_defaults":522,"./attributes":534}],537:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../scatter/colorbar"),d.calc=a("../scatter3d/calc"),d.plot=a("./convert"),d.moduleType="trace",d.name="scattergl",d.basePlotModule=a("../../plots/gl2d"),d.categories=["gl2d","symbols","errorBarsOK","markerColorscale","showLegend"],d.meta={},b.exports=d},{"../../plots/gl2d":397,"../scatter/colorbar":505,"../scatter3d/calc":524,"./attributes":534,"./convert":535,"./defaults":536}],538:[function(a,b,c){"use strict";function d(a){return{valType:"boolean",dflt:!1}}function e(a){return{show:{valType:"boolean",dflt:!1},project:{x:d("x"),y:d("y"),z:d("z")},color:{valType:"color",dflt:"#000"},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!1},highlightColor:{valType:"color",dflt:"#000"},highlightWidth:{valType:"number",min:1,max:16,dflt:2}}}var f=a("../../components/colorscale/attributes"),g=a("../../lib/extend").extendFlat;b.exports={z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},zauto:f.zauto,zmin:f.zmin,zmax:f.zmax,colorscale:f.colorscale,autocolorscale:g({},f.autocolorscale,{dflt:!1}),reversescale:f.reversescale,showscale:f.showscale,contours:{x:e("x"),y:e("y"),z:e("z")},hidesurface:{valType:"boolean",dflt:!1},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345}],539:[function(a,b,c){"use strict";var d=a("../../components/colorscale/calc");b.exports=function(a,b){d(b,b.z,"","z")}},{"../../components/colorscale/calc":306}],540:[function(a,b,c){"use strict";function d(a,b,c){this.scene=a,this.uid=c,this.surface=b,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function e(a,b){return void 0===b&&(b=1),a.map(function(a){var c=a[0],d=n(a[1]),e=d.toRgb();return{index:c,rgb:[e.r,e.g,e.b,b]}})}function f(a){var b=a.shape,c=[b[0]+2,b[1]+2],d=j(new Float32Array(c[0]*c[1]),c);return m.assign(d.lo(1,1).hi(b[0],b[1]),a),m.assign(d.lo(1).hi(b[0],1),a.hi(b[0],1)),m.assign(d.lo(1,c[1]-1).hi(b[0],1),a.lo(0,b[1]-1).hi(b[0],1)),m.assign(d.lo(0,1).hi(1,b[1]),a.hi(1)),m.assign(d.lo(c[0]-1,1).hi(1,b[1]),a.lo(b[0]-1)),d.set(0,0,a.get(0,0)),d.set(0,c[1]-1,a.get(0,b[1]-1)),d.set(c[0]-1,0,a.get(b[0]-1,0)),d.set(c[0]-1,c[1]-1,a.get(b[0]-1,b[1]-1)),d}function g(a){var b=Math.max(a[0].shape[0],a[0].shape[1]);if(p>b){for(var c=p/b,d=[0|Math.floor(a[0].shape[0]*c+1),0|Math.floor(a[0].shape[1]*c+1)],e=d[0]*d[1],g=0;3>g;++g){var h=f(a[g]),i=j(new Float32Array(e),d);k(i,h,[c,0,0,0,c,0,0,0,1]),a[g]=i}return c}return 1}function h(a,b){var c=a.glplot.gl,e=i({gl:c}),f=new d(a,e,b.uid);return f.update(b),a.glplot.add(e),f}var i=a("gl-surface3d"),j=a("ndarray"),k=a("ndarray-homography"),l=a("ndarray-fill"),m=a("ndarray-ops"),n=a("tinycolor2"),o=a("../../lib/str2rgbarray"),p=128,q=d.prototype;q.handlePick=function(a){if(a.object===this.surface){var b=[Math.min(0|Math.round(a.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(a.data.index[1]/this.dataScale-1),this.data.z.length-1)],c=[0,0,0];Array.isArray(this.data.x[0])?c[0]=this.data.x[b[1]][b[0]]:c[0]=this.data.x[b[0]],Array.isArray(this.data.y[0])?c[1]=this.data.y[b[1]][b[0]]:c[1]=this.data.y[b[1]],c[2]=this.data.z[b[1]][b[0]],a.traceCoordinate=c;var d=this.scene.fullSceneLayout;a.dataCoordinate=[d.xaxis.d2l(c[0])*this.scene.dataScale[0],d.yaxis.d2l(c[1])*this.scene.dataScale[1],d.zaxis.d2l(c[2])*this.scene.dataScale[2]];var e=this.data.text;return e&&e[b[1]]&&void 0!==e[b[1]][b[0]]?a.textLabel=e[b[1]][b[0]]:a.textLabel="",a.data.dataCoordinate=a.dataCoordinate.slice(),this.surface.highlight(a.data),this.scene.glplot.spikes.position=a.dataCoordinate,!0}},q.setContourLevels=function(){for(var a=[[],[],[]],b=!1,c=0;3>c;++c)this.showContour[c]&&(b=!0,a[c]=this.scene.contourLevels[c]);b&&this.surface.update({levels:a})},q.update=function(a){var b,c=this.scene,d=c.fullSceneLayout,f=this.surface,h=a.opacity,i=e(a.colorscale,h),k=a.z,m=a.x,n=a.y,p=d.xaxis,q=d.yaxis,r=d.zaxis,s=c.dataScale,t=k[0].length,u=k.length,v=[j(new Float32Array(t*u),[t,u]),j(new Float32Array(t*u),[t,u]),j(new Float32Array(t*u),[t,u])],w=v[0],x=v[1],y=c.contourLevels;this.data=a,l(v[2],function(a,b){return r.d2l(k[b][a])*s[2]}),Array.isArray(m[0])?l(w,function(a,b){return p.d2l(m[b][a])*s[0]}):l(w,function(a){return p.d2l(m[a])*s[0]}),Array.isArray(n[0])?l(x,function(a,b){return q.d2l(n[b][a])*s[1]}):l(x,function(a,b){return q.d2l(n[b])*s[1]}),this.dataScale=g(v);var z={colormap:i,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!a.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1,colorBounds:[a.zmin*s[2],a.zmax*s[2]]};"opacity"in a&&a.opacity<1&&(z.opacity=.25*a.opacity);var A=[!0,!0,!0],B=[!0,!0,!0],C=["x","y","z"];for(b=0;3>b;++b){var D=a.contours[C[b]];A[b]=D.highlight,B[b]=D.show,z.showContour[b]=D.show||D.highlight,z.showContour[b]&&(z.contourProject[b]=[D.project.x,D.project.y,D.project.z],D.show?(this.showContour[b]=!0,z.levels[b]=y[b],f.highlightColor[b]=z.contourColor[b]=o(D.color),D.usecolormap?f.highlightTint[b]=z.contourTint[b]=0:f.highlightTint[b]=z.contourTint[b]=1,z.contourWidth[b]=D.width):this.showContour[b]=!1,D.highlight&&(z.dynamicColor[b]=o(D.highlightColor),z.dynamicWidth[b]=D.highlightWidth))}z.coords=v,f.update(z),f.highlightEnable=A,f.contourEnable=B,f.visible=a.visible,f.snapToData=!0,"lighting"in a&&(f.ambientLight=a.lighting.ambient,f.diffuseLight=a.lighting.diffuse,f.specularLight=a.lighting.specular,f.roughness=a.lighting.roughness,f.fresnel=a.lighting.fresnel),h&&1>h&&(f.supportsTransparency=!0)},q.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},b.exports=h},{"../../lib/str2rgbarray":359,"gl-surface3d":184,ndarray:208,"ndarray-fill":201,"ndarray-homography":206,"ndarray-ops":207,tinycolor2:229}],541:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/colorscale/defaults"),f=a("./attributes");b.exports=function(a,b,c,g){function h(c,e){return d.coerce(a,b,f,c,e)}var i,j,k=h("z");if(!k)return void(b.visible=!1);var l=k[0].length,m=k.length;if(h("x"),h("y"),!Array.isArray(b.x))for(b.x=[],i=0;l>i;++i)b.x[i]=i;if(h("text"),!Array.isArray(b.y))for(b.y=[],i=0;m>i;++i)b.y[i]=i;h("lighting.ambient"),h("lighting.diffuse"),h("lighting.specular"),h("lighting.roughness"),h("lighting.fresnel"),h("hidesurface"),h("opacity"),h("colorscale");var n=["x","y","z"];for(i=0;3>i;++i){var o="contours."+n[i],p=h(o+".show"),q=h(o+".highlight");if(p||q)for(j=0;3>j;++j)h(o+".project."+n[j]);p&&(h(o+".color"),h(o+".width"),h(o+".usecolormap")),q&&(h(o+".highlightColor"),h(o+".highlightWidth"))}e(a,b,g,h,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":538}],542:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../heatmap/colorbar"),d.calc=a("./calc"),d.plot=a("./convert"),d.moduleType="trace",d.name="surface",d.basePlotModule=a("../../plots/gl3d"),d.categories=["gl3d","noOpacity"],d.meta={},b.exports=d},{"../../plots/gl3d":400,"../heatmap/colorbar":461,"./attributes":538,"./calc":539,"./convert":540,"./defaults":541}]},{},[12])(12)}),angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(l(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",to:{height:f[0].scrollHeight+"px"}}).start()["finally"](i):a.addClass(f,"in",{to:{height:f[0].scrollHeight+"px"}}).then(i)})}function i(){f.removeClass("collapsing").addClass("collapse").css({height:"auto"}),m(d)}function j(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(n(d)).then(function(){f.css({height:f[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:{height:"0"}}).start()["finally"](k):a.removeClass(f,"in",{to:{height:"0"}}).then(k)}):k()}function k(){f.css({height:"0"}),f.removeClass("collapsing").addClass("collapse"),o(d)}var l=c(g.expanding),m=c(g.expanded),n=c(g.collapsing),o=c(g.collapsed);d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css({height:"auto"}),d.$watch(g.uibCollapse,function(a){a?j():h()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.uibAccordionTransclude]},function(a){if(a){var c=angular.element(b[0].querySelector("[uib-accordion-header]"));c.html(""),c.append(a)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;t.length;)t.shift()}function g(a){for(var b=0;b<q.length;b++)q[b].slide.active=b===a}function h(c,d,i){if(!u){if(angular.extend(c,{direction:i}),angular.extend(q[s].slide||{},{direction:i}),e.enabled(b)&&!a.$currentTransition&&q[d].element&&p.slides.length>1){q[d].element.data(r,c.direction);var j=p.getCurrentIndex();angular.isNumber(j)&&q[j].element&&q[j].element.data(r,c.direction),a.$currentTransition=!0,e.on("addClass",q[d].element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),t.length)){var d=t.pop().slide,g=d.index,i=g>p.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})}a.active=c.index,s=c.index,g(d),l()}}function i(a){for(var b=0;b<q.length;b++)if(q[b].slide===a)return b}function j(){n&&(c.cancel(n),n=null)}function k(b){b.length||(a.$currentTransition=null,f())}function l(){j();var b=+a.interval;!isNaN(b)&&b>0&&(n=c(m,b))}function m(){var b=+a.interval;o&&!isNaN(b)&&b>0&&q.length?a.next():a.pause()}var n,o,p=this,q=p.slides=a.slides=[],r="uib-slideDirection",s=a.active,t=[],u=!1;p.addSlide=function(b,c){q.push({slide:b,element:c}),q.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===q.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),s=b.index,a.active=b.index,g(s),p.select(q[i(b)]),1===q.length&&a.play())},p.getCurrentIndex=function(){for(var a=0;a<q.length;a++)if(q[a].slide.index===s)return a},p.next=a.next=function(){var b=(p.getCurrentIndex()+1)%q.length;return 0===b&&a.noWrap()?void a.pause():p.select(q[b],"next")},p.prev=a.prev=function(){var b=p.getCurrentIndex()-1<0?q.length-1:p.getCurrentIndex()-1;return a.noWrap()&&b===q.length-1?void a.pause():p.select(q[b],"prev")},p.removeSlide=function(b){var c=i(b),d=t.indexOf(q[c]);-1!==d&&t.splice(d,1),q.splice(c,1),q.length>0&&s===c?c>=q.length?(s=q.length-1,a.active=s,g(s),p.select(q[q.length-1])):(s=c,a.active=s,g(s),p.select(q[c])):s>c&&(s--,a.active=s),0===q.length&&(s=null,a.active=null,f())},p.select=a.select=function(b,c){var d=i(b.slide);void 0===c&&(c=d>p.getCurrentIndex()?"next":"prev"),b.slide.index===s||a.$currentTransition?b&&b.slide.index!==s&&a.$currentTransition&&t.push(q[d]):h(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===q.length-1&&a.noWrap()},a.pause=function(){a.noPause||(o=!1,j())},a.play=function(){o||(o=!0,l())},a.$on("$destroy",function(){u=!0,j()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",l),a.$watchCollection("slides",k),a.$watch("active",function(a){if(angular.isNumber(a)&&s!==a){for(var b=0;b<q.length;b++)if(q[b].slide.index===a){a=b;break}var c=q[a];c&&(g(a),p.select(q[a]),s=a)}})}]).directive("uibCarousel",function(){return{transclude:!0,replace:!0,controller:"UibCarouselController",controllerAs:"carousel",templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/carousel.html"},scope:{active:"=",interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",function(){return{require:"^uibCarousel",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/slide.html"},scope:{actual:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)})}}}).animation(".item",["$animateCss",function(a){function b(a,b,c){a.removeClass(b),c&&c()}var c="uib-slideDirection";return{beforeAddClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i+" "+h,f);return d.addClass(h),a(d,{addClass:i}).start().done(j),function(){g=!0}}f()},beforeRemoveClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i,f);return a(d,{addClass:i}).start().done(j),function(){g=!0}}f()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter",function(a,b,c,d){function e(a,b){var c=[],e=a.split(""),f=a.indexOf("'");if(f>-1){var g=!1;a=a.split("");for(var h=f;h<a.length;h++)g?("'"===a[h]&&(h+1<a.length&&"'"===a[h+1]?(a[h+1]="$",e[h+1]=""):(e[h]="",g=!1)),a[h]="$"):"'"===a[h]&&(a[h]="$",e[h]="",g=!0);a=a.join("")}return angular.forEach(n,function(d){var f=a.indexOf(d.key);if(f>-1){a=a.split(""),e[f]="("+d.regex+")",a[f]="$";for(var g=f+1,h=f+d.key.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,key:d.key,apply:d[b],matcher:d.regex})}}),{regex:new RegExp("^"+e.join("")+"$"),map:d(c,"index")}}function f(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function g(a){return parseInt(a,10)}function h(a,b){return a&&b?l(a,b):a}function i(a,b){return a&&b?l(a,b,!0):a}function j(a,b){var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function k(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function l(a,b,c){c=c?-1:1;var d=j(b,a.getTimezoneOffset());return k(a,c*(d-a.getTimezoneOffset()))}var m,n,o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=b.id,this.parsers={},this.formatters={},n=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=g(c+d),this.minutes+=g(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}]},this.init(),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==m&&this.init(),this.formatters[c]||(this.formatters[c]=e(c,"formatter"));var d=this.formatters[c],f=d.map,g=c;return f.reduce(function(b,c,d){var e=g.match(new RegExp("(.*)"+c.key));e&&angular.isString(e[1])&&(b+=e[1],g=g.replace(e[1]+c.key,""));var h=d===f.length-1?g:"";return c.apply?b+c.apply.call(null,a)+h:b+h},"")},this.parse=function(c,d,g){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(o,"\\$&"),b.id!==m&&this.init(),this.parsers[d]||(this.parsers[d]=e(d,"apply"));var h=this.parsers[d],i=h.regex,j=h.map,k=c.match(i),l=!1;if(k&&k.length){var n,p;angular.isDate(g)&&!isNaN(g.getTime())?n={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),n={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(l=!0),s.apply&&s.apply.call(n,k[q])}var t=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return f(n.year,n.month,n.date)&&(!angular.isDate(g)||isNaN(g.getTime())||l?(p=new Date(0),t.call(p,n.year,n.month,n.date),u.call(p,n.hours||0,n.minutes||0,n.seconds||0,n.milliseconds||0)):(p=new Date(g),t.call(p,n.year,n.month,n.date),u.call(p,n.hours,n.minutes,n.seconds,n.milliseconds))),p}},this.toTimezone=h,this.fromTimezone=i,this.timezoneToOffset=j,this.addDateMinutes=k,this.convertTimezoneToLocal=l}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}var m=this,n={$setViewValue:angular.noop},o={},p=[];!!b.datepickerOptions;a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:h.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":m[b]=angular.isDefined(a.datepickerOptions[b])?d(a.datepickerOptions[b])(a.$parent):h[b];break;case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":m[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:h[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?m.startingDay=a.datepickerOptions.startingDay:angular.isNumber(h.startingDay)?m.startingDay=h.startingDay:m.startingDay=(e.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?m[b]=k.fromTimezone(new Date(a),o.timezone):(i&&f.warn("Literal date support has been deprecated, please switch to date object usage"),m[b]=new Date(g(a,"medium"))):m[b]=h[b]?k.fromTimezone(new Date(h[b]),o.timezone):null,m.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){m[b]=a[b]=angular.isDefined(c)?c:datepickerOptions[b],("minMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)<m.modes.indexOf(m[b])||"maxMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)>m.modes.indexOf(m[b]))&&(a.datepickerMode=m[b],a.datepickerOptions.datepickerMode=m[b])}):m[b]=a[b]=h[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&p.push(a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,m.refreshView()})),a.isActive=function(b){return 0===m.compare(b.date,m.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){n=b,o=b.$options||h.ngModelOptions,a.datepickerOptions.initDate?(m.activeDate=k.fromTimezone(a.datepickerOptions.initDate,o.timezone)||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(n.$isEmpty(n.$modelValue)||n.$invalid)&&(m.activeDate=k.fromTimezone(a,o.timezone),m.refreshView())})):m.activeDate=new Date,this.activeDate=n.$modelValue?k.fromTimezone(new Date(n.$modelValue),o.timezone):k.fromTimezone(new Date,o.timezone),n.$render=function(){m.render()}},this.render=function(){if(n.$viewValue){var a=new Date(n.$viewValue),b=!isNaN(a);b?this.activeDate=k.fromTimezone(a,o.timezone):j||f.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=n.$viewValue?new Date(n.$viewValue):null;b=k.fromTimezone(b,o.timezone),n.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=n.$viewValue?new Date(n.$viewValue):null;d=k.fromTimezone(d,o.timezone);var e=new Date;e=k.fromTimezone(e,o.timezone);var f=this.compare(b,e),g={date:b,label:k.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),m.activeDate&&0===this.compare(g.date,m.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===m.minMode){var c=n.$viewValue?k.fromTimezone(new Date(n.$viewValue),o.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=k.toTimezone(c,o.timezone),n.$setViewValue(c),n.$render()}else m.activeDate=b,l(m.modes[m.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode")},a.move=function(a){var b=m.activeDate.getFullYear()+a*(m.step.years||0),c=m.activeDate.getMonth()+a*(m.step.months||0);m.activeDate.setFullYear(b,c,1),m.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===m.maxMode&&1===b||a.datepickerMode===m.minMode&&-1===b||(l(m.modes[m.modes.indexOf(a.datepickerMode)+b]), 60 a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var q=function(){m.element[0].focus()};a.$on("uib:datepicker.focus",q),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),m.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(m.isDisabled(m.activeDate))return;a.select(m.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(m.handleKeyDown(c,b),m.refreshView()):a.toggleMode("up"===c?1:-1)},a.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('<div class="uib-position-scrollbar-measure"></div>');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(f,g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight,bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX)},scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,w,a.date);if(isNaN(c))for(var d=0;d<I.length;d++)if(c=l.parse(b,I[d],a.date),!isNaN(c))return c;return c}function r(a){if(angular.isNumber(a)&&(a=new Date(a)),!a)return null;if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=q(a);if(!isNaN(b))return l.toTimezone(b,J)}return F.$options&&F.$options.allowInvalid?a:void 0}function s(a,b){var d=a||b;return c.ngRequired||d?(angular.isNumber(d)&&(d=new Date(d)),d?angular.isDate(d)&&!isNaN(d)?!0:angular.isString(d)?!isNaN(q(b)):!1:!0):!0}function t(c){if(a.isOpen||!a.disabled){var d=H[0],e=b[0].contains(c.target),f=void 0!==d.contains&&d.contains(c.target);!a.isOpen||e||f||a.$apply(function(){a.isOpen=!1})}}function u(c){27===c.which&&a.isOpen?(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!1}),b[0].focus()):40!==c.which||a.isOpen||(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!0}))}function v(){if(a.isOpen){var d=angular.element(H[0].querySelector(".uib-datepicker-popup")),e=c.popupPlacement?c.popupPlacement:m.placement,f=j.positionElements(b,d,e,y);d.css({top:f.top+"px",left:f.left+"px"}),d.hasClass("uib-position-measure")&&d.removeClass("uib-position-measure")}}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K=!1,L=[];this.init=function(e){if(F=e,G=e.$options,x=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):m.closeOnDateSelection,y=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):m.appendToBody,z=angular.isDefined(c.onOpenFocus)?a.$parent.$eval(c.onOpenFocus):m.onOpenFocus,A=angular.isDefined(c.datepickerPopupTemplateUrl)?c.datepickerPopupTemplateUrl:m.datepickerPopupTemplateUrl,B=angular.isDefined(c.datepickerTemplateUrl)?c.datepickerTemplateUrl:m.datepickerTemplateUrl,I=angular.isDefined(c.altInputFormats)?a.$parent.$eval(c.altInputFormats):m.altInputFormats,a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):m.showButtonBar,m.html5Types[c.type]?(w=m.html5Types[c.type],K=!0):(w=c.uibDatepickerPopup||m.datepickerPopup,c.$observe("uibDatepickerPopup",function(a,b){var c=a||m.datepickerPopup;if(c!==w&&(w=c,F.$modelValue=null,!w))throw new Error("uibDatepickerPopup must have a date format specified.")})),!w)throw new Error("uibDatepickerPopup must have a date format specified.");if(K&&c.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");C=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"),G?(J=G.timezone,a.ngModelOptions=angular.copy(G),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),C.attr("ng-model-options","ngModelOptions")):J=null,C.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":A}),D=angular.element(C.children()[0]),D.attr("template-url",B),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),D.attr("datepicker-options","datepickerOptions"),K?F.$formatters.push(function(b){return a.date=l.fromTimezone(b,J),b}):(F.$$parserName="date",F.$validators.date=s,F.$parsers.unshift(r),F.$formatters.push(function(b){return F.$isEmpty(b)?(a.date=b,b):(a.date=l.fromTimezone(b,J),angular.isNumber(a.date)&&(a.date=new Date(a.date)),l.filter(a.date,w))})),F.$viewChangeListeners.push(function(){a.date=q(F.$viewValue)}),b.on("keydown",u),H=d(C)(a),C.remove(),y?h.find("body").append(H):b.after(H),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),H.remove(),b.off("keydown",u),h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,J));var c={};return angular.forEach(["minDate","maxDate"],function(b){null===a.datepickerOptions[b]?c[b]=null:angular.isDate(a.datepickerOptions[b])?c[b]=l.fromTimezone(new Date(a.datepickerOptions[b]),J):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium")))}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?l.filter(a.date,w):null;b.val(d),F.$setViewValue(d),x&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):b=new Date(d.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),z&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;y||j.parsePlacement(d)[2]?(E=E||angular.element(j.scrollParent(b)),E&&E.on("scroll",v)):E=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b){c||(a.on("click",d),a.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b){c===b&&(c=null,a.off("click",d),a.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen,angular.isFunction(r)&&r(o,o.isOpen),o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:m.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",e.right=window.innerWidth-(m.left+b.prop("offsetWidth"))+"px"):(e.left=m.left+"px",e.right="auto"),!t){var v=h.offset(u);e.top=m.top-v.top+"px",i?e.right=window.innerWidth-(m.left-v.left+b.prop("offsetWidth"))+"px":e.left=m.left-v.left+"px"}n.dropdownMenu.css(e)}var w=u?u:b,x=w.hasClass(u?p:q);if(x===!c&&g[c?"addClass":"removeClass"](w,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var y=angular.element('<ul class="dropdown-menu"></ul>');n.dropdownMenu.replaceWith(y),n.dropdownMenu=y}f.close(o),n.selectedOption=null}angular.isFunction(r)&&r(a,c)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b===a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b===a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.stackedMap","ui.bootstrap.position"]).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}).provider("$uibResolve",function(){var a=this;this.resolver=null,this.setResolver=function(a){this.resolver=a},this.$get=["$injector","$q",function(b,c){var d=a.resolver?b.get(a.resolver):null;return{resolve:function(a,e,f,g){if(d)return d.resolve(a,e,f,g);var h=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?h.push(c.resolve(b.invoke(a))):angular.isString(a)?h.push(c.resolve(b.get(a))):h.push(c.resolve(a))}),c.all(h).then(function(b){var c={},d=0;return angular.forEach(a,function(a,e){c[e]=b[d++]}),c})}}}]}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(a,b,c){function d(b,d,e){e.modalInClass&&(a.addClass(d,e.modalInClass),b.$on(c.NOW_CLOSING_EVENT,function(c,f){var g=f();b.modalOptions.animation?a.removeClass(d,e.modalInClass).then(g):g()}))}return{replace:!0,templateUrl:"uib/template/modal/backdrop.html",compile:function(a,b){return a.addClass(b.backdropClass),d}}}]).directive("uibModalWindow",["$uibModalStack","$q","$animateCss","$document",function(a,b,c,d){return{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/modal/window.html"},link:function(e,f,g){f.addClass(g.windowClass||""),f.addClass(g.windowTopClass||""),e.size=g.size,e.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!==c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},f.on("click",e.close),e.$isRendered=!0;var h=b.defer();g.$observe("modalRender",function(a){"true"===a&&h.resolve()}),h.promise.then(function(){var h=null;g.modalInClass&&(h=c(f,{addClass:g.modalInClass}).start(),e.$on(a.NOW_CLOSING_EVENT,function(a,b){var d=b();c(f,{removeClass:g.modalInClass}).start().then(d)})),b.when(h).then(function(){var b=a.getTop();if(b&&a.modalRendered(b.key),!d[0].activeElement||!f[0].contains(d[0].activeElement)){var c=f[0].querySelector("[autofocus]");c?c.focus():f[0].focus()}})})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.uibModalAnimationClass)}}}).directive("uibModalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap","$uibPosition",function(a,b,c,d,e,f,g,h,i){function j(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function k(){for(var a=-1,b=v.keys(),c=0;c<b.length;c++)v.get(b[c]).value.backdrop&&(a=c);return a>-1&&y>a&&(a=y),a}function l(a,b){var c=v.get(a).value,d=c.appendTo;v.remove(a),z=v.top(),z&&(y=parseInt(z.value.modalDomEl.attr("index"),10)),o(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||u;w.remove(b,a),d.toggleClass(b,w.hasKey(b)),t&&t.heightOverflow&&t.scrollbarWidth&&(t.originalRight?d.css({paddingRight:t.originalRight+"px"}):d.css({paddingRight:""}),t=null),m(!0)},c.closedDeferred),n(),b&&b.focus?b.focus():d.focus&&d.focus()}function m(a){var b;v.length()>0&&(b=v.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function n(){if(r&&-1===k()){var a=s;o(r,s,function(){a=null}),r=void 0,s=void 0}}function o(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){b.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(x.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function p(a){if(a.isDefaultPrevented())return a;var b=v.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){x.dismiss(b.key,"escape key press")}));break;case 9:var c=x.loadFocusElementList(b),d=!1;a.shiftKey?(x.isFocusInFirstItem(a,c)||x.isModalFocused(a,b))&&(d=x.focusLastFocusableElement(c)):x.isFocusInLastItem(a,c)&&(d=x.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function q(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var r,s,t,u="modal-open",v=h.createNew(),w=g.createNew(),x={NOW_CLOSING_EVENT:"modal.stack.now-closing"},y=0,z=null,A="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(k,function(a){s&&(s.index=a)}),c.on("keydown",p),e.$on("$destroy",function(){c.off("keydown",p)}),x.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||u;m(!1),z=v.top(),v.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),w.put(h,b);var j=f.appendTo,l=k();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!r&&(s=e.$new(!0),s.modalOptions=f,s.index=l,r=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>'),r.attr("backdrop-class",f.backdropClass),f.animation&&r.attr("modal-animation","true"),d(r)(s),a.enter(r,j)),y=z?parseInt(z.value.modalDomEl.attr("index"),10)+1:0;var n=angular.element('<div uib-modal-window="modal-window"></div>');n.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:y,animate:"animate"}).html(f.content),f.animation&&n.attr("modal-animation","true"),t=i.scrollbarPadding(j),t.heightOverflow&&t.scrollbarWidth&&j.css({paddingRight:t.right+"px"}),j.addClass(h),a.enter(d(n)(f.scope),j),v.top().value.modalDomEl=n,v.top().value.modalOpener=g},x.close=function(a,b){var c=v.get(a);return c&&q(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),l(a,c.value.modalOpener),!0):!c},x.dismiss=function(a,b){var c=v.get(a);return c&&q(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),l(a,c.value.modalOpener),!0):!c},x.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},x.getTop=function(){return v.top()},x.modalRendered=function(a){var b=v.get(a);b&&b.value.renderDeferred.resolve()},x.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},x.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},x.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},x.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},x.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},x.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(A);return c?Array.prototype.filter.call(c,function(a){return j(a); 61 }):c}}},x}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i,j={};e.controller&&(j.$scope=d,j.$uibModalInstance=p,angular.forEach(a[1],function(a,b){j[b]=a}),i=f(e.controller,j,!0),e.controllerAs?(g=i.instance,e.bindToController&&(g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,c)),g=i(),d[e.controllerAs]=g):g=i(),angular.isFunction(g.$onInit)&&g.$onInit()),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup uib-title="'+r+"title"+s+'" '+(n.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen" origin-scope="origScope" class="uib-position-measure"></div>';return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){N.isOpen?q():m()}function m(){M&&!a.$eval(d[k+"Enable"])||(u(),x(),N.popupDelay?G||(G=g(r,N.popupDelay,!1)):r())}function q(){s(),N.popupCloseDelay?H||(H=g(t,N.popupCloseDelay,!1)):t()}function r(){return s(),u(),N.content?(v(),void N.$evalAsync(function(){N.isOpen=!0,y(!0),S()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){N&&N.$evalAsync(function(){N&&(N.isOpen=!1,y(!1),N.animation?F||(F=g(w,150,!1)):w())})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=N.$new(),D=c(E,function(a){K?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null)}function x(){N.title=d[k+"Title"],Q?N.content=Q(a):N.content=d[e],N.popupClass=d[k+"Class"],N.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);N.popupDelay=isNaN(c)?n.popupDelay:c,N.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){P&&angular.isFunction(P.assign)&&P.assign(a,b)}function z(){R.length=0,Q?(R.push(a.$watch(Q,function(a){N.content=a,!a&&N.isOpen&&t()})),R.push(E.$watch(function(){O||(O=!0,E.$$postDigest(function(){O=!1,N&&N.isOpen&&S()}))}))):R.push(d.$observe(e,function(a){N.content=a,!a&&N.isOpen?t():S()})),R.push(d.$observe(k+"Title",function(a){N.title=a,N.isOpen&&S()})),R.push(d.$observe(k+"Placement",function(a){N.placement=a?a:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0],N.isOpen&&S()}))}function A(){R.length&&(angular.forEach(R,function(a){a()}),R.length=0)}function B(a){N&&N.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];T(),L=p(a),"none"!==L.show&&L.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===L.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(L.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J,K=angular.isDefined(n.appendToBody)?n.appendToBody:!1,L=p(void 0),M=angular.isDefined(d[k+"Enable"]),N=a.$new(!0),O=!1,P=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,Q=n.useContentExp?l(d[e]):!1,R=[],S=function(){D&&D.html()&&(I||(I=g(function(){var a=i.positionElements(b,D,N.placement,K);D.css({top:a.top+"px",left:a.left+"px"}),D.hasClass(a.placement.split("-")[0])||(D.removeClass(J.split("-")[0]),D.addClass(a.placement.split("-")[0])),D.hasClass(n.placementClassPrefix+a.placement)||(D.removeClass(n.placementClassPrefix+J),D.addClass(n.placementClassPrefix+a.placement)),D.hasClass("uib-position-measure")?(i.positionArrow(D,a.placement),D.removeClass("uib-position-measure")):J!==a.placement&&i.positionArrow(D,a.placement),J=a.placement,I=null},0,!1)))};N.origScope=a,N.isOpen=!1,o.add(N,{close:t}),N.contentExp=function(){return N.content},d.$observe("disabled",function(a){a&&s(),a&&N.isOpen&&t()}),P&&a.$watch(P,function(a){N&&!a===N.isOpen&&j()});var T=function(){L.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),L.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var U=a.$eval(d[k+"Animation"]);N.animation=angular.isDefined(U)?!!U:n.animation;var V,W=k+"AppendToBody";V=W in d&&void 0===d[W]?!0:a.$eval(d[W]),K=angular.isDefined(V)?V:K,a.$on("$destroy",function(){T(),w(),o.remove(N),N=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{uibTitle:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",uibTitle:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{uibTitle:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;b<d.tabs.length;b++)if(d.tabs[b].index===a)return b}var c,d=this;d.tabs=[],d.select=function(a,f){if(!e){var g=b(c),h=d.tabs[g];if(h){if(h.tab.onDeselect({$event:f}),f&&f.isDefaultPrevented())return;h.tab.active=!1}var i=d.tabs[a];i?(i.tab.onSelect({$event:f}),i.tab.active=!0,d.active=i.index,c=i.index):!i&&angular.isNumber(c)&&(d.active=null,c=null)}},d.addTab=function(a){if(d.tabs.push({tab:a,index:a.index}),d.tabs.sort(function(a,b){return a.index>b.index?1:a.index<b.index?-1:0}),a.index===d.active||!angular.isNumber(d.active)&&1===d.tabs.length){var c=b(a.index);d.select(c)}},d.removeTab=function(a){for(var b,c=0;c<d.tabs.length;c++)if(d.tabs[c].tab===a){b=c;break}if(d.tabs[b].index===d.active){var e=b===d.tabs.length-1?b-1:b+1%d.tabs.length;d.select(e)}d.tabs.splice(b,1)},a.$watch("tabset.active",function(a){angular.isNumber(a)&&a!==c&&d.select(b(a))});var e;a.$on("$destroy",function(){e=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tabset.html"},link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1,angular.isUndefined(c.active)&&(a.active=0)}}}).directive("uibTab",["$parse",function(a){return{require:"^uibTabset",replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(b,c,d,e,f){b.disabled=!1,d.disable&&b.$parent.$watch(a(d.disable),function(a){b.disabled=!!a}),angular.isUndefined(d.index)&&(e.tabs&&e.tabs.length?b.index=Math.max.apply(null,e.tabs.map(function(a){return a.index}))+1:b.index=0),angular.isUndefined(d.classes)&&(b.classes=""),b.select=function(a){if(!b.disabled){for(var c,d=0;d<e.tabs.length;d++)if(e.tabs[d].tab===b){c=d;break}e.select(c,a)}},e.addTab(b),b.$on("$destroy",function(){e.removeTab(b)}),b.$transcludeFn=f}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("uibTabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("uib-tab-heading")||a.hasAttribute("data-uib-tab-heading")||a.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===a.tagName.toLowerCase()||"data-uib-tab-heading"===a.tagName.toLowerCase()||"x-uib-tab-heading"===a.tagName.toLowerCase()||"uib:tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^uibTabset",link:function(b,c,d){var e=b.$eval(d.uibTabContentTransclude).tab;e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(a,b,c,d,e,f,g){function h(){var b=+a.hours,c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===v[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),u.$setViewValue(new Date(s)),n(a)}function m(){u.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(u.$modelValue){var c=s.getHours(),d=s.getMinutes(),e=s.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!w),"m"!==b&&(a.minutes=k(d)),a.meridian=s.getHours()<12?v[0]:v[1],"s"!==b&&(a.seconds=k(e)),a.meridian=s.getHours()<12?v[0]:v[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=v[0]}function o(a){s=q(s,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s=new Date,t=[],u={$setViewValue:angular.noop},v=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,w=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){u=b,u.$render=this.render,u.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var x=g.hourStep;c.hourStep&&t.push(a.$parent.$watch(d(c.hourStep),function(a){x=+a}));var y=g.minuteStep;c.minuteStep&&t.push(a.$parent.$watch(d(c.minuteStep),function(a){y=+a}));var z;t.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);z=isNaN(b)?void 0:b}));var A;t.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);A=isNaN(b)?void 0:b}));var B=!1;c.ngDisabled&&t.push(a.$parent.$watch(d(c.ngDisabled),function(a){B=a})),a.noIncrementHours=function(){var a=p(s,60*x);return B||a>A||s>a&&z>a},a.noDecrementHours=function(){var a=p(s,60*-x);return B||z>a||a>s&&a>A},a.noIncrementMinutes=function(){var a=p(s,y);return B||a>A||s>a&&z>a},a.noDecrementMinutes=function(){var a=p(s,-y);return B||z>a||a>s&&a>A},a.noIncrementSeconds=function(){var a=q(s,C);return B||a>A||s>a&&z>a},a.noDecrementSeconds=function(){var a=q(s,-C);return B||z>a||a>s&&a>A},a.noToggleMeridian=function(){return s.getHours()<12?B||p(s,720)>A:B||p(s,-720)<z};var C=g.secondStep;c.secondStep&&t.push(a.$parent.$watch(d(c.secondStep),function(a){C=+a})),a.showSeconds=g.showSeconds,c.showSeconds&&t.push(a.$parent.$watch(d(c.showSeconds),function(b){a.showSeconds=!!b})),a.showMeridian=g.showMeridian,c.showMeridian&&t.push(a.$parent.$watch(d(c.showMeridian),function(b){if(a.showMeridian=!!b,u.$error.time){var c=h(),d=i();angular.isDefined(c)&&angular.isDefined(d)&&(s.setHours(c),l())}else n()})),this.setupMousewheelEvents=function(b,c,d){var e=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){u.$setViewValue(null),u.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(a),s.setMinutes(b),z>s||s>A?e(!0):l("h")):e(!0)},b.bind("blur",function(b){u.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!w)})}),a.updateMinutes=function(){var a=i(),b=h();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(b),s.setMinutes(a),z>s||s>A?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){u.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();u.$setDirty(),angular.isDefined(a)?(s.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=u.$viewValue;isNaN(b)?(u.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(s=b),z>s||s>A?(u.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*x*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-x*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*y)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-y)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(C)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-C)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(s.getHours()<12?60:-60)):a.meridian=a.meridian===v[0]?v[1]:v[0])},a.blur=function(){u.$setTouched()},a.$on("$destroy",function(){for(;t.length;)t.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){N.moveInProgress||(N.moveInProgress=!0,N.$digest()),Y()}function o(){N.position=D?l.offset(b):l.position(b),N.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1),a.$watch(c.typeaheadMinLength,function(a){t=a||0===a?a:1});var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=e(c.typeaheadOnSelect),A=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,B=e(c.typeaheadNoResults).assign||angular.noop,C=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,D=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,E=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,F=a.$eval(c.typeaheadFocusFirst)!==!1,G=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,H=e(c.typeaheadIsOpen).assign||angular.noop,I=a.$eval(c.typeaheadShowHint)||!1,J=e(c.ngModel),K=e(c.ngModel+"($$$p)"),L=function(b,c){return angular.isFunction(J(a))&&q&&q.$options&&q.$options.getterSetter?K(b,{$$$p:c}):J.assign(b,c)},M=m.parse(c.uibTypeahead),N=a.$new(),O=a.$on("$destroy",function(){N.$destroy()});N.$on("$destroy",O);var P="typeahead-"+N.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":P});var Q,R;I&&(Q=angular.element("<div></div>"),Q.css("position","relative"),b.after(Q),R=b.clone(),R.attr("placeholder",""),R.attr("tabindex","-1"),R.val(""),R.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),Q.append(R),R.after(b));var S=angular.element("<div uib-typeahead-popup></div>");S.attr({id:P,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&S.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&S.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var T=function(){I&&R.val("")},U=function(){N.matches=[],N.activeIdx=-1,b.attr("aria-expanded",!1),T()},V=function(a){return P+"-option-"+a};N.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",V(a))});var W=function(a,b){return N.matches.length>b&&a?a.toUpperCase()===N.matches[b].label.toUpperCase():!1},X=function(c,d){var e={$viewValue:c};y(a,!0),B(a,!1),f.when(M.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){N.activeIdx=F?0:-1,B(a,!1),N.matches.length=0;for(var h=0;h<f.length;h++)e[M.itemName]=f[h], 62 N.matches.push({id:V(h),label:M.viewMapper(N,e),model:f[h]});if(N.query=c,o(),b.attr("aria-expanded",!0),G&&1===N.matches.length&&W(c,0)&&(angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(0,d)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(0,d)),I){var i=N.matches[0].label;angular.isString(c)&&c.length>0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?R.val(c+i.slice(c.length)):R.val("")}}else U(),B(a,!0);g&&y(a,!1)},function(){U(),y(a,!1),B(a,!0)})};D&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Y=k(function(){N.matches.length&&o(),N.moveInProgress=!1},s);N.moveInProgress=!1,N.query=void 0;var Z,$=function(a){Z=g(function(){X(a)},u)},_=function(){Z&&g.cancel(Z)};U(),N.assignIsOpen=function(b){H(a,b)},N.select=function(d,e){var f,h,i={};x=!0,i[M.itemName]=h=N.matches[d].model,f=M.modelMapper(a,i),L(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),z(a,{$item:h,$model:f,$label:M.viewMapper(a,i),$event:e}),U(),N.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==N.matches.length&&-1!==r.indexOf(b.which)){if(-1===N.activeIdx&&(9===b.which||13===b.which)||9===b.which&&b.shiftKey)return U(),void N.$digest();b.preventDefault();var c;switch(b.which){case 9:case 13:N.$apply(function(){angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(N.activeIdx,b)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(N.activeIdx,b)});break;case 27:b.stopPropagation(),U(),a.$digest();break;case 38:N.activeIdx=(N.activeIdx>0?N.activeIdx:N.matches.length)-1,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop;break;case 40:N.activeIdx=(N.activeIdx+1)%N.matches.length,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){X(p.$viewValue,a)},0)}),b.bind("blur",function(a){A&&N.matches.length&&-1!==N.activeIdx&&!x&&(x=!0,N.$apply(function(){angular.isObject(N.debounceUpdate)&&angular.isNumber(N.debounceUpdate.blur)?k(function(){N.select(N.activeIdx,a)},N.debounceUpdate.blur):N.select(N.activeIdx,a)})),!v&&p.$error.editable&&(p.$viewValue="",p.$setValidity("editable",!0),p.$setValidity("parse",!0),b.val("")),w=!1,x=!1});var aa=function(c){b[0]!==c.target&&3!==c.which&&0!==N.matches.length&&(U(),j.$$phase||a.$digest())};h.on("click",aa),a.$on("$destroy",function(){h.off("click",aa),(D||E)&&ba.remove(),D&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),S.remove(),I&&Q.remove()});var ba=d(S)(N);D?h.find("body").append(ba):E?angular.element(E).eq(0).append(ba):b.after(ba),this.init=function(b,c){p=b,q=c,N.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(_(),$(b)):X(b):(y(a,!1),_(),U()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),C?(e.$model=b,C(a,e)):(e[M.itemName]=b,c=M.viewMapper(a,e),e[M.itemName]=void 0,d=M.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-time input{width:50px;}</style>'),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'),angular.$$uibTypeaheadCss=!0}),angular.module("ui.calendar",[]).constant("uiCalendarConfig",{calendars:{}}).controller("uiCalendarCtrl",["$scope","$locale",function(a,b){var c=a.eventSources,d=a.calendarWatchEvent?a.calendarWatchEvent:angular.noop,e=function(b){return function(){if(a.$root.$$phase)return b.apply(this,arguments);var c=arguments,d=this;return a.$root.$apply(function(){return b.apply(d,c)})}},f=1;this.eventFingerprint=function(a){a._id||(a._id=f++);var b=d({event:a})||"",c=moment.isMoment(a.start)?a.start.unix():a.start?moment(a.start).unix():"",e=moment.isMoment(a.end)?a.end.unix():a.end?moment(a.end).unix():"";return""+a._id+(a.id||"")+(a.title||"")+(a.url||"")+c+e+(a.allDay||"")+(a.className||"")+b};var g=1,h=1;this.sourceFingerprint=function(a){var b=""+(a.__id||(a.__id=g++)),c=angular.isObject(a)&&a.events;return c&&(b=b+"-"+(c.__id||(c.__id=h++))),b},this.allEvents=function(){for(var a=[],b=0,d=c.length;d>b;b++){var e=c[b];if(angular.isArray(e))a.push(e);else if(angular.isObject(e)&&angular.isArray(e.events)){var f={};for(var g in e)"_id"!==g&&"events"!==g&&(f[g]=e[g]);for(var h=0;h<e.events.length;h++)angular.extend(e.events[h],f);a.push(e.events)}}return Array.prototype.concat.apply([],a)},this.changeWatcher=function(a,b){var c,d=function(){for(var c,d,e=angular.isFunction(a)?a():a,g=[],h=0,i=e.length;i>h;h++)d=e[h],c=b(d),f[c]=d,g.push(c);return g},e=function(a,b){var c,d,e=[],f={};for(c=0,d=b.length;d>c;c++)f[b[c]]=!0;for(c=0,d=a.length;d>c;c++)f[a[c]]||e.push(a[c]);return e},f={},g=function(a,d){var g,h,i,j,k={},l=e(d,a);for(g=0,h=l.length;h>g;g++){var m=l[g];i=f[m],delete f[m];var n=b(i);n===m?c.onRemoved(i):(k[n]=m,c.onChanged(i))}var o=e(a,d);for(g=0,h=o.length;h>g;g++)j=o[g],i=f[j],k[j]||c.onAdded(i)};return c={subscribe:function(a,b){a.$watch(d,function(a,c){var d=!(b&&b(a,c)===!1);d&&g(a,c)},!0)},onAdded:angular.noop,onChanged:angular.noop,onRemoved:angular.noop}},this.getFullCalendarConfig=function(a,b){var c={};return angular.extend(c,b),angular.extend(c,a),angular.forEach(c,function(a,b){"function"==typeof a&&(c[b]=e(c[b]))}),c},this.getLocaleConfig=function(a){if(!a.lang||a.useNgLocale){var c=function(a){var b,c;b=[];for(c in a)b[c]=a[c];return b},d=b.DATETIME_FORMATS;return{monthNames:c(d.MONTH),monthNamesShort:c(d.SHORTMONTH),dayNames:c(d.DAY),dayNamesShort:c(d.SHORTDAY)}}return{}}}]).directive("uiCalendar",["uiCalendarConfig",function(a){return{restrict:"A",scope:{eventSources:"=ngModel",calendarWatchEvent:"&"},controller:"uiCalendarCtrl",link:function(b,c,d,e){function f(){var c,f=d.uiCalendar?b.$parent.$eval(d.uiCalendar):{};c=e.getFullCalendarConfig(f,a);var g=e.getLocaleConfig(c);angular.extend(g,c),l={eventSources:h},angular.extend(l,g),l.calendars=null;var i={};for(var j in l)"eventSources"!==j&&(i[j]=l[j]);return JSON.stringify(i)}var g,h=b.eventSources,i=!1,j=e.changeWatcher(h,e.sourceFingerprint),k=e.changeWatcher(e.allEvents,e.eventFingerprint),l=null;b.destroyCalendar=function(){g&&g.fullCalendar&&g.fullCalendar("destroy"),g=d.calendar?a.calendars[d.calendar]=$(c).html(""):$(c).html("")},b.initCalendar=function(){g||(g=angular.element(c).html("")),g.fullCalendar(l),d.calendar&&(a.calendars[d.calendar]=g)},b.$on("$destroy",function(){b.destroyCalendar()}),j.onAdded=function(b){g&&g.fullCalendar&&(g.fullCalendar(l),d.calendar&&(a.calendars[d.calendar]=g),g.fullCalendar("addEventSource",b),i=!0)},j.onRemoved=function(a){g&&g.fullCalendar&&(g.fullCalendar("removeEventSource",a),i=!0)},j.onChanged=function(){g&&g.fullCalendar&&(g.fullCalendar("refetchEvents"),i=!0)},k.onAdded=function(a){g&&g.fullCalendar&&g.fullCalendar("renderEvent",a,!!a.stick)},k.onRemoved=function(a){g&&g.fullCalendar&&g.fullCalendar("removeEvents",a._id)},k.onChanged=function(a){if(g&&g.fullCalendar)for(var b=g.fullCalendar("clientEvents",a._id),c=0;c<b.length;c++){var d=b[c];d=angular.extend(d,a),g.fullCalendar("updateEvent",d)}},j.subscribe(b),k.subscribe(b,function(){return i===!0?(i=!1,!1):void 0}),b.$watch(f,function(a,c){a!==c?(b.destroyCalendar(),b.initCalendar()):a&&angular.isUndefined(g)&&b.initCalendar()})}}}]),function(a,b){"undefined"!=typeof module&&module.exports?(b("undefined"==typeof angular?require("angular"):angular),module.exports="ngDialog"):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(this,function(a){"use strict";var b=a.module("ngDialog",[]),c=a.element,d=a.isDefined,e=(document.body||document.documentElement).style,f=d(e.animation)||d(e.WebkitAnimation)||d(e.MozAnimation)||d(e.MsAnimation)||d(e.OAnimation),g="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",h="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",i="ngdialog-disabled-animation",j={html:!1,body:!1},k={},l=[],m=!1,n=!1;return b.provider("ngDialog",function(){var b=this.defaults={className:"ngdialog-theme-default",appendClassName:"",disableAnimation:!1,plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,overlay:!0,cache:!0,trapFocus:!0,preserveFocus:!0,ariaAuto:!0,ariaRole:null,ariaLabelledById:null,ariaLabelledBySelector:null,ariaDescribedById:null,ariaDescribedBySelector:null,bodyClassName:"ngdialog-open"};this.setForceHtmlReload=function(a){j.html=a||!1},this.setForceBodyReload=function(a){j.body=a||!1},this.setDefaults=function(c){a.extend(b,c)},this.setOpenOnePerName=function(a){n=a||!1};var d,e=0,o=0,p={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller","$injector",function(q,r,s,t,u,v,w,x,y,z){var A=[],B={onDocumentKeydown:function(a){27===a.keyCode&&C.close("$escape")},activate:function(a){var b=a.data("$ngDialogOptions");b.trapFocus&&(a.on("keydown",B.onTrapFocusKeydown),A.body.on("keydown",B.onTrapFocusKeydown))},deactivate:function(a){a.off("keydown",B.onTrapFocusKeydown),A.body.off("keydown",B.onTrapFocusKeydown)},deactivateAll:function(b){a.forEach(b,function(b){var c=a.element(b);B.deactivate(c)})},setBodyPadding:function(a){var b=parseInt(A.body.css("padding-right")||0,10);A.body.css("padding-right",b+a+"px"),A.body.data("ng-dialog-original-padding",b),v.$broadcast("ngDialog.setPadding",a)},resetBodyPadding:function(){var a=A.body.data("ng-dialog-original-padding");a?A.body.css("padding-right",a+"px"):A.body.css("padding-right",""),v.$broadcast("ngDialog.setPadding",0)},performCloseDialog:function(a,b){var c=a.data("$ngDialogOptions"),e=a.attr("id"),h=k[e];if(h){if("undefined"!=typeof x.Hammer){var i=h.hammerTime;i.off("tap",d),i.destroy&&i.destroy(),delete h.hammerTime}else a.unbind("click");1===o&&A.body.unbind("keydown",B.onDocumentKeydown),a.hasClass("ngdialog-closing")||(o-=1);var j=a.data("$ngDialogPreviousFocus");j&&j.focus&&j.focus(),v.$broadcast("ngDialog.closing",a,b),o=0>o?0:o,f&&!c.disableAnimation?(h.$destroy(),a.unbind(g).bind(g,function(){B.closeDialogElement(a,b)}).addClass("ngdialog-closing")):(h.$destroy(),B.closeDialogElement(a,b)),p[e]&&(p[e].resolve({id:e,value:b,$dialog:a,remainingDialogs:o}),delete p[e]),k[e]&&delete k[e],l.splice(l.indexOf(e),1),l.length||(A.body.unbind("keydown",B.onDocumentKeydown),m=!1)}},closeDialogElement:function(a,b){var c=a.data("$ngDialogOptions");a.remove(),0===o&&(A.html.removeClass(c.bodyClassName),A.body.removeClass(c.bodyClassName),B.resetBodyPadding()),v.$broadcast("ngDialog.closed",a,b)},closeDialog:function(b,c){var d=b.data("$ngDialogPreCloseCallback");if(d&&a.isFunction(d)){var e=d.call(b,c);a.isObject(e)?e.closePromise?e.closePromise.then(function(){B.performCloseDialog(b,c)}):e.then(function(){B.performCloseDialog(b,c)},function(){}):e!==!1&&B.performCloseDialog(b,c)}else B.performCloseDialog(b,c)},onTrapFocusKeydown:function(b){var c,d=a.element(b.currentTarget);if(d.hasClass("ngdialog"))c=d;else if(c=B.getActiveDialog(),null===c)return;var e=9===b.keyCode,f=b.shiftKey===!0;e&&B.handleTab(c,b,f)},handleTab:function(a,b,c){var d=B.getFocusableElements(a);if(0===d.length)return void(document.activeElement&&document.activeElement.blur());var e=document.activeElement,f=Array.prototype.indexOf.call(d,e),g=-1===f,h=0===f,i=f===d.length-1,j=!1;c?(g||h)&&(d[d.length-1].focus(),j=!0):(g||i)&&(d[0].focus(),j=!0),j&&(b.preventDefault(),b.stopPropagation())},autoFocus:function(a){var b=a[0],d=b.querySelector("*[autofocus]");if(null===d||(d.focus(),document.activeElement!==d)){var e=B.getFocusableElements(a);if(e.length>0)return void e[0].focus();var f=B.filterVisibleElements(b.querySelectorAll("h1,h2,h3,h4,h5,h6,p,span"));if(f.length>0){var g=f[0];c(g).attr("tabindex","-1").css("outline","0"),g.focus()}}},getFocusableElements:function(a){var b=a[0],c=b.querySelectorAll(h),d=B.filterTabbableElements(c);return B.filterVisibleElements(d)},filterTabbableElements:function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d];"-1"!==c(e).attr("tabindex")&&b.push(e)}return b},filterVisibleElements:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];(d.offsetWidth>0||d.offsetHeight>0)&&b.push(d)}return b},getActiveDialog:function(){var a=document.querySelectorAll(".ngdialog");return 0===a.length?null:c(a[a.length-1])},applyAriaAttributes:function(a,b){if(b.ariaAuto){if(!b.ariaRole){var c=B.getFocusableElements(a).length>0?"dialog":"alertdialog";b.ariaRole=c}b.ariaLabelledBySelector||(b.ariaLabelledBySelector="h1,h2,h3,h4,h5,h6"),b.ariaDescribedBySelector||(b.ariaDescribedBySelector="article,section,p")}b.ariaRole&&a.attr("role",b.ariaRole),B.applyAriaAttribute(a,"aria-labelledby",b.ariaLabelledById,b.ariaLabelledBySelector),B.applyAriaAttribute(a,"aria-describedby",b.ariaDescribedById,b.ariaDescribedBySelector)},applyAriaAttribute:function(a,b,d,e){if(d&&a.attr(b,d),e){var f=a.attr("id"),g=a[0].querySelector(e);if(!g)return;var h=f+"-"+b;return c(g).attr("id",h),a.attr(b,h),h}},detectUIRouter:function(){try{return a.module("ui.router"),!0}catch(b){return!1}},getRouterLocationEventName:function(){return B.detectUIRouter()?"$stateChangeSuccess":"$locationChangeSuccess"}},C={__PRIVATE__:B,open:function(f){function g(a,b){return v.$broadcast("ngDialog.templateLoading",a),u.get(a,b||{}).then(function(b){return v.$broadcast("ngDialog.templateLoaded",a),b.data||""})}function h(b){return b?a.isString(b)&&q.plain?b:"boolean"!=typeof q.cache||q.cache?g(b,{cache:r}):g(b,{cache:!1}):"Empty template"}var j=null;if(f=f||{},!(n&&f.name&&(j=f.name+" dialog",this.isOpen(j)))){var q=a.copy(b),D=++e;j=j||"ngdialog"+D,l.push(j),"undefined"!=typeof q.data&&("undefined"==typeof f.data&&(f.data={}),f.data=a.merge(a.copy(q.data),f.data)),a.extend(q,f);var E;p[j]=E=t.defer();var F;k[j]=F=a.isObject(q.scope)?q.scope.$new():v.$new();var G,H,I=a.extend({},q.resolve);return a.forEach(I,function(b,c){I[c]=a.isString(b)?z.get(b):z.invoke(b,null,null,c)}),t.all({template:h(q.template||q.templateUrl),locals:t.all(I)}).then(function(b){var e=b.template,f=b.locals;q.showClose&&(e+='<div class="ngdialog-close"></div>');var g=q.overlay?"":" ngdialog-no-overlay";if(G=c('<div id="'+j+'" class="ngdialog'+g+'"></div>'),G.html(q.overlay?'<div class="ngdialog-overlay"></div><div class="ngdialog-content" role="document">'+e+"</div>":'<div class="ngdialog-content" role="document">'+e+"</div>"),G.data("$ngDialogOptions",q),F.ngDialogId=j,q.data&&a.isString(q.data)){var h=q.data.replace(/^\s*/,"")[0];F.ngDialogData="{"===h||"["===h?a.fromJson(q.data):new String(q.data),F.ngDialogData.ngDialogId=j}else q.data&&a.isObject(q.data)&&(F.ngDialogData=q.data,F.ngDialogData.ngDialogId=j);if(q.className&&G.addClass(q.className),q.appendClassName&&G.addClass(q.appendClassName),q.disableAnimation&&G.addClass(i),H=q.appendTo&&a.isString(q.appendTo)?a.element(document.querySelector(q.appendTo)):A.body,B.applyAriaAttributes(G,q),q.preCloseCallback){var k;a.isFunction(q.preCloseCallback)?k=q.preCloseCallback:a.isString(q.preCloseCallback)&&F&&(a.isFunction(F[q.preCloseCallback])?k=F[q.preCloseCallback]:F.$parent&&a.isFunction(F.$parent[q.preCloseCallback])?k=F.$parent[q.preCloseCallback]:v&&a.isFunction(v[q.preCloseCallback])&&(k=v[q.preCloseCallback])),k&&G.data("$ngDialogPreCloseCallback",k)}if(F.closeThisDialog=function(a){B.closeDialog(G,a)},q.controller&&(a.isString(q.controller)||a.isArray(q.controller)||a.isFunction(q.controller))){var l;q.controllerAs&&a.isString(q.controllerAs)&&(l=q.controllerAs);var n=y(q.controller,a.extend(f,{$scope:F,$element:G}),!0,l);q.bindToController&&a.extend(n.instance,{ngDialogId:F.ngDialogId,ngDialogData:F.ngDialogData,closeThisDialog:F.closeThisDialog}),G.data("$ngDialogControllerController",n())}if(w(function(){var a=document.querySelectorAll(".ngdialog");B.deactivateAll(a),s(G)(F);var b=x.innerWidth-A.body.prop("clientWidth");A.html.addClass(q.bodyClassName),A.body.addClass(q.bodyClassName);var c=b-(x.innerWidth-A.body.prop("clientWidth"));c>0&&B.setBodyPadding(c),H.append(G),B.activate(G),q.trapFocus&&B.autoFocus(G),q.name?v.$broadcast("ngDialog.opened",{dialog:G,name:q.name}):v.$broadcast("ngDialog.opened",G)}),m||(A.body.bind("keydown",B.onDocumentKeydown),m=!0),q.closeByNavigation){var p=B.getRouterLocationEventName();v.$on(p,function(){B.closeDialog(G)})}if(q.preserveFocus&&G.data("$ngDialogPreviousFocus",document.activeElement),d=function(a){var b=q.closeByDocument?c(a.target).hasClass("ngdialog-overlay"):!1,d=c(a.target).hasClass("ngdialog-close");(b||d)&&C.close(G.attr("id"),d?"$closeButton":"$document")},"undefined"!=typeof x.Hammer){var r=F.hammerTime=x.Hammer(G[0]);r.on("tap",d)}else G.bind("click",d);return o+=1,C}),{id:j,closePromise:E.promise,close:function(a){B.closeDialog(G,a)}}}},openConfirm:function(d){var e=t.defer(),f=a.copy(b);d=d||{},"undefined"!=typeof f.data&&("undefined"==typeof d.data&&(d.data={}),d.data=a.merge(a.copy(f.data),d.data)),a.extend(f,d),f.scope=a.isObject(f.scope)?f.scope.$new():v.$new(),f.scope.confirm=function(a){e.resolve(a);var b=c(document.getElementById(g.id));B.performCloseDialog(b,a)};var g=C.open(f);return g?(g.closePromise.then(function(a){return a?e.reject(a.value):e.reject()}),e.promise):void 0},isOpen:function(a){var b=c(document.getElementById(a));return b.length>0},close:function(a,b){var d=c(document.getElementById(a));if(d.length)B.closeDialog(d,b);else if("$escape"===a){var e=l[l.length-1];d=c(document.getElementById(e)),d.data("$ngDialogOptions").closeByEscape&&B.closeDialog(d,"$escape")}else C.closeAll(b);return C},closeAll:function(a){for(var b=document.querySelectorAll(".ngdialog"),d=b.length-1;d>=0;d--){var e=b[d];B.closeDialog(c(e),a)}},getOpenDialogs:function(){return l},getDefaults:function(){return b}};return a.forEach(["html","body"],function(a){if(A[a]=q.find(a),j[a]){var b=B.getRouterLocationEventName();v.$on(b,function(){A[a]=q.find(a)})}}),C}]}),b.directive("ngDialog",["ngDialog",function(b){return{restrict:"A",scope:{ngDialogScope:"="},link:function(c,d,e){d.on("click",function(d){d.preventDefault();var f=a.isDefined(c.ngDialogScope)?c.ngDialogScope:"noScope";a.isDefined(e.ngDialogClosePrevious)&&b.close(e.ngDialogClosePrevious);var g=b.getDefaults();b.open({template:e.ngDialog,className:e.ngDialogClass||g.className,appendClassName:e.ngDialogAppendClass,controller:e.ngDialogController,controllerAs:e.ngDialogControllerAs,bindToController:e.ngDialogBindToController,scope:f,data:e.ngDialogData,showClose:"false"===e.ngDialogShowClose?!1:"true"===e.ngDialogShowClose?!0:g.showClose,closeByDocument:"false"===e.ngDialogCloseByDocument?!1:"true"===e.ngDialogCloseByDocument?!0:g.closeByDocument,closeByEscape:"false"===e.ngDialogCloseByEscape?!1:"true"===e.ngDialogCloseByEscape?!0:g.closeByEscape,overlay:"false"===e.ngDialogOverlay?!1:"true"===e.ngDialogOverlay?!0:g.overlay,preCloseCallback:e.ngDialogPreCloseCallback||g.preCloseCallback,bodyClassName:e.ngDialogBodyClass||g.bodyClassName})})}}}]),b}),function(a,b,c){function d(b,c){if(a.isArray(b)){for(var d=b.length-1;d>=0;d--){var e=b[d];"string"===a.type(e)&&i.transports[e]||(c.log("Invalid transport: "+e+", removing it from the transports list."),b.splice(d,1))}0===b.length&&(c.log("No transports remain within the specified transport array."),b=null)}else if(i.transports[b]||"auto"===b){if("auto"===b&&i._.ieVersion<=8)return["longPolling"]}else c.log("Invalid transport: "+b.toString()+"."),b=null;return b}function e(a){return"http:"===a?80:"https:"===a?443:void 0}function f(a,b){return b.match(/:\d+$/)?b:b+":"+e(a)}function g(b,c){var d=this,e=[];d.tryBuffer=function(c){return b.state===a.signalR.connectionState.connecting?(e.push(c),!0):!1},d.drain=function(){if(b.state===a.signalR.connectionState.connected)for(;e.length>0;)c(e.shift())},d.clear=function(){e=[]}}var h={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if("function"!=typeof a)throw new Error(h.nojQuery);var i,j,k="complete"===b.document.readyState,l=a(b),m="__Negotiate Aborted__",n={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},o={processData:!0,timeout:null,async:!0,global:!1,cache:!1},p=function(a,c){if(c!==!1){var d;"undefined"!=typeof b.console&&(d="["+(new Date).toTimeString()+"] SignalR: "+a,b.console.debug?b.console.debug(d):b.console.log&&b.console.log(d))}},q=function(b,c,d){return c===b.state?(b.state=d,a(b).triggerHandler(n.onStateChanged,[{oldState:c,newState:d}]),!0):!1},r=function(a){return a.state===i.connectionState.disconnected},s=function(a){return a._.keepAliveData.activated&&a.transport.supportsKeepAlive(a)},t=function(c){var d,e;c._.configuredStopReconnectingTimeout||(e=function(b){var c=i._.format(i.resources.reconnectTimeout,b.disconnectTimeout);b.log(c),a(b).triggerHandler(n.onError,[i._.error(c,"TimeoutException")]),b.stop(!1,!1)},c.reconnecting(function(){var a=this;a.state===i.connectionState.reconnecting&&(d=b.setTimeout(function(){e(a)},a.disconnectTimeout))}),c.stateChanged(function(a){a.oldState===i.connectionState.reconnecting&&b.clearTimeout(d)}),c._.configuredStopReconnectingTimeout=!0)};i=function(a,b,c){return new i.fn.init(a,b,c)},i._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var a,c;return"Microsoft Internet Explorer"===b.navigator.appName&&(c=/MSIE ([0-9]+\.[0-9]+)/.exec(b.navigator.userAgent),c&&(a=b.parseFloat(c[1]))),a}(),error:function(a,b,c){var d=new Error(a);return d.source=b,"undefined"!=typeof c&&(d.context=c),d},transportError:function(a,b,d,e){var f=this.error(a,d,e);return f.transport=b?b.name:c,f},format:function(){for(var a=arguments[0],b=0;b<arguments.length-1;b++)a=a.replace("{"+b+"}",arguments[b+1]);return a},firefoxMajorVersion:function(a){var b=a.match(/Firefox\/(\d+)/);return!b||!b.length||b.length<2?0:parseInt(b[1],10)},configurePingInterval:function(c){var d=c._.config,e=function(b){a(c).triggerHandler(n.onError,[b])};d&&!c._.pingIntervalId&&d.pingInterval&&(c._.pingIntervalId=b.setInterval(function(){i.transports._logic.pingServer(c).fail(e)},d.pingInterval))}},i.events=n,i.resources=h,i.ajaxDefaults=o,i.changeState=q,i.isDisconnecting=r,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'></script>.")}},l.load(function(){k=!0}),i.fn=i.prototype={init:function(b,c,d){var e=a(this);this.url=b,this.qs=c,this.lastError=null,this._={keepAliveData:{},connectingMessageBuffer:new g(this,function(a){e.triggerHandler(n.onReceived,[a])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0},"boolean"==typeof d&&(this.logging=d)},_parseResponse:function(a){var b=this;return a&&"string"==typeof a?b.json.parse(a):a; 63 },_originalJson:b.JSON,json:b.JSON,isCrossDomain:function(c,d){var e;return c=a.trim(c),d=d||b.location,0!==c.indexOf("http")?!1:(e=b.document.createElement("a"),e.href=c,e.protocol+f(e.protocol,e.host)!==d.protocol+f(d.protocol,d.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:i.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(c,e){var f,g=this,j={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},o=g._deferral||a.Deferred(),p=b.document.createElement("a");if(g.lastError=null,g._deferral=o,!g.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if("function"===a.type(c)?e=c:"object"===a.type(c)&&(a.extend(j,c),"function"===a.type(j.callback)&&(e=j.callback)),j.transport=d(j.transport,g),!j.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");if(g._.config=j,!k&&j.waitForPageLoad===!0)return g._.deferredStartHandler=function(){g.start(c,e)},l.bind("load",g._.deferredStartHandler),o.promise();if(g.state===i.connectionState.connecting)return o.promise();if(q(g,i.connectionState.disconnected,i.connectionState.connecting)===!1)return o.resolve(g),o.promise();t(g),p.href=g.url,p.protocol&&":"!==p.protocol?(g.protocol=p.protocol,g.host=p.host):(g.protocol=b.document.location.protocol,g.host=p.host||b.document.location.host),g.baseUrl=g.protocol+"//"+g.host,g.wsProtocol="https:"===g.protocol?"wss://":"ws://","auto"===j.transport&&j.jsonp===!0&&(j.transport="longPolling"),0===g.url.indexOf("//")&&(g.url=b.location.protocol+g.url,g.log("Protocol relative URL detected, normalizing it to '"+g.url+"'.")),this.isCrossDomain(g.url)&&(g.log("Auto detected cross domain url."),"auto"===j.transport&&(j.transport=["webSockets","serverSentEvents","longPolling"]),"undefined"==typeof j.withCredentials&&(j.withCredentials=!0),j.jsonp||(j.jsonp=!a.support.cors,j.jsonp&&g.log("Using jsonp because this browser doesn't support CORS.")),g.contentType=i._.defaultContentType),g.withCredentials=j.withCredentials,g.ajaxDataType=j.jsonp?"jsonp":"text",a(g).bind(n.onStart,function(b,c){"function"===a.type(e)&&e.call(g),o.resolve(g)}),g._.initHandler=i.transports._logic.initHandler(g),f=function(c,d){var e=i._.error(h.noTransportOnInit);if(d=d||0,d>=c.length)return 0===d?g.log("No transports supported by the server were selected."):1===d?g.log("No fallback transports were selected."):g.log("Fallback transports exhausted."),a(g).triggerHandler(n.onError,[e]),o.reject(e),void g.stop();if(g.state!==i.connectionState.disconnected){var j=c[d],k=i.transports[j],m=function(){f(c,d+1)};g.transport=k;try{g._.initHandler.start(k,function(){var c=i._.firefoxMajorVersion(b.navigator.userAgent)>=11,d=!!g.withCredentials&&c;g.log("The start request succeeded. Transitioning to the connected state."),s(g)&&i.transports._logic.monitorKeepAlive(g),i.transports._logic.startHeartbeat(g),i._.configurePingInterval(g),q(g,i.connectionState.connecting,i.connectionState.connected)||g.log("WARNING! The connection was not in the connecting state."),g._.connectingMessageBuffer.drain(),a(g).triggerHandler(n.onStart),l.bind("unload",function(){g.log("Window unloading, stopping the connection."),g.stop(d)}),c&&l.bind("beforeunload",function(){b.setTimeout(function(){g.stop(d)},0)})},m)}catch(p){g.log(k.name+" transport threw '"+p.message+"' when attempting to start."),m()}}};var r=g.url+"/negotiate",u=function(b,c){var d=i._.error(h.errorOnNegotiate,b,c._.negotiateRequest);a(c).triggerHandler(n.onError,d),o.reject(d),c.stop()};return a(g).triggerHandler(n.onStarting),r=i.transports._logic.prepareQueryString(g,r),g.log("Negotiating with '"+r+"'."),g._.negotiateRequest=i.transports._logic.ajax(g,{url:r,error:function(a,b){b!==m?u(a,g):o.reject(i._.error(h.stoppedWhileNegotiating,null,g._.negotiateRequest))},success:function(b){var c,d,e,k=[],l=[];try{c=g._parseResponse(b)}catch(m){return void u(i._.error(h.errorParsingNegotiateResponse,m),g)}return d=g._.keepAliveData,g.appRelativeUrl=c.Url,g.id=c.ConnectionId,g.token=c.ConnectionToken,g.webSocketServerUrl=c.WebSocketServerUrl,g._.pollTimeout=1e3*c.ConnectionTimeout+1e4,g.disconnectTimeout=1e3*c.DisconnectTimeout,g._.totalTransportConnectTimeout=g.transportConnectTimeout+1e3*c.TransportConnectTimeout,c.KeepAliveTimeout?(d.activated=!0,d.timeout=1e3*c.KeepAliveTimeout,d.timeoutWarning=d.timeout*g.keepAliveWarnAt,g._.beatInterval=(d.timeout-d.timeoutWarning)/3):d.activated=!1,g.reconnectWindow=g.disconnectTimeout+(d.timeout||0),c.ProtocolVersion&&c.ProtocolVersion===g.clientProtocol?(a.each(i.transports,function(a){return 0===a.indexOf("_")||"webSockets"===a&&!c.TryWebSockets?!0:void l.push(a)}),a.isArray(j.transport)?a.each(j.transport,function(b,c){a.inArray(c,l)>=0&&k.push(c)}):"auto"===j.transport?k=l:a.inArray(j.transport,l)>=0&&k.push(j.transport),void f(k)):(e=i._.error(i._.format(h.protocolIncompatible,g.clientProtocol,c.ProtocolVersion)),a(g).triggerHandler(n.onError,[e]),void o.reject(e))}}),o.promise()},starting:function(b){var c=this;return a(c).bind(n.onStarting,function(a,d){b.call(c)}),c},send:function(a){var b=this;if(b.state===i.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(b.state===i.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return b.transport.send(b,a),b},received:function(b){var c=this;return a(c).bind(n.onReceived,function(a,d){b.call(c,d)}),c},stateChanged:function(b){var c=this;return a(c).bind(n.onStateChanged,function(a,d){b.call(c,d)}),c},error:function(b){var c=this;return a(c).bind(n.onError,function(a,d,e){c.lastError=d,b.call(c,d,e)}),c},disconnected:function(b){var c=this;return a(c).bind(n.onDisconnect,function(a,d){b.call(c)}),c},connectionSlow:function(b){var c=this;return a(c).bind(n.onConnectionSlow,function(a,d){b.call(c)}),c},reconnecting:function(b){var c=this;return a(c).bind(n.onReconnecting,function(a,d){b.call(c)}),c},reconnected:function(b){var c=this;return a(c).bind(n.onReconnect,function(a,d){b.call(c)}),c},stop:function(c,d){var e=this,f=e._deferral;return e._.deferredStartHandler&&l.unbind("load",e._.deferredStartHandler),delete e._.config,delete e._.deferredStartHandler,k||e._.config&&e._.config.waitForPageLoad!==!0?e.state!==i.connectionState.disconnected?(e.log("Stopping connection."),q(e,e.state,i.connectionState.disconnected),b.clearTimeout(e._.beatHandle),b.clearInterval(e._.pingIntervalId),e.transport&&(e.transport.stop(e),d!==!1&&e.transport.abort(e,c),s(e)&&i.transports._logic.stopMonitoringKeepAlive(e),e.transport=null),e._.negotiateRequest&&(e._.negotiateRequest.abort(m),delete e._.negotiateRequest),e._.initHandler&&e._.initHandler.stop(),a(e).triggerHandler(n.onDisconnect),delete e._deferral,delete e.messageId,delete e.groupsToken,delete e.id,delete e._.pingIntervalId,delete e._.lastMessageAt,delete e._.lastActiveAt,e._.connectingMessageBuffer.clear(),e):void 0:(e.log("Stopping connection prior to negotiate."),void(f&&f.reject(i._.error(h.stoppedWhileLoading))))},log:function(a){p(a,this.logging)}},i.fn.init.prototype=i.fn,i.noConflict=function(){return a.connection===i&&(a.connection=j),i},a.connection&&(j=a.connection),a.connection=a.signalR=i}(window.jQuery,window),function(a,b,c){function d(a){a._.keepAliveData.monitoring&&e(a),h.markActive(a)&&(a._.beatHandle=b.setTimeout(function(){d(a)},a._.beatInterval))}function e(b){var c,d=b._.keepAliveData;b.state===i.connectionState.connected&&(c=(new Date).getTime()-b._.lastMessageAt,c>=d.timeout?(b.log("Keep alive timed out. Notifying transport that connection has been lost."),b.transport.lostConnection(b)):c>=d.timeoutWarning?d.userNotified||(b.log("Keep alive has been missed, connection may be dead/slow."),a(b).triggerHandler(j.onConnectionSlow),d.userNotified=!0):d.userNotified=!1)}function f(a,b){var c=a.url+b;return a.transport&&(c+="?transport="+a.transport.name),h.prepareQueryString(a,c)}function g(a){this.connection=a,this.startRequested=!1,this.startCompleted=!1,this.connectionStopped=!1}var h,i=a.signalR,j=a.signalR.events,k=a.signalR.changeState,l="__Start Aborted__";i.transports={},g.prototype={start:function(a,d,e){var f=this,g=f.connection,h=!1;return f.startRequested||f.connectionStopped?void g.log("WARNING! "+a.name+" transport cannot be started. Initialization ongoing or completed."):(g.log(a.name+" transport starting."),f.transportTimeoutHandle=b.setTimeout(function(){h||(h=!0,g.log(a.name+" transport timed out when trying to connect."),f.transportFailed(a,c,e))},g._.totalTransportConnectTimeout),void a.start(g,function(){h||f.initReceived(a,d)},function(b){return h||(h=!0,f.transportFailed(a,b,e)),!f.startCompleted||f.connectionStopped}))},stop:function(){this.connectionStopped=!0,b.clearTimeout(this.transportTimeoutHandle),i.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(a,c){var d=this,e=d.connection;return d.startRequested?void e.log("WARNING! The client received multiple init messages."):void(d.connectionStopped||(d.startRequested=!0,b.clearTimeout(d.transportTimeoutHandle),e.log(a.name+" transport connected. Initiating start request."),i.transports._logic.ajaxStart(e,function(){d.startCompleted=!0,c()})))},transportFailed:function(c,d,e){var f,g=this.connection,h=g._deferral;this.connectionStopped||(b.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(f=i._.error(i.resources.errorDuringStartRequest,d),g.log(c.name+" transport failed during the start request. Stopping the connection."),a(g).triggerHandler(j.onError,[f]),h&&h.reject(f),g.stop()):(c.stop(g),g.log(c.name+" transport failed to connect. Attempting to fall back."),e()))}},h=i.transports._logic={ajax:function(b,c){return a.ajax(a.extend(!0,{},a.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:b.withCredentials},contentType:b.contentType,dataType:b.ajaxDataType},c))},pingServer:function(b){var c,d,e=a.Deferred();return b.transport?(c=b.url+"/ping",c=h.addQs(c,b.qs),d=h.ajax(b,{url:c,success:function(a){var c;try{c=b._parseResponse(a)}catch(f){return e.reject(i._.transportError(i.resources.pingServerFailedParse,b.transport,f,d)),void b.stop()}"pong"===c.Response?e.resolve():e.reject(i._.transportError(i._.format(i.resources.pingServerFailedInvalidResponse,a),b.transport,null,d))},error:function(a){401===a.status||403===a.status?(e.reject(i._.transportError(i._.format(i.resources.pingServerFailedStatusCode,a.status),b.transport,a,d)),b.stop()):e.reject(i._.transportError(i.resources.pingServerFailed,b.transport,a,d))}})):e.reject(i._.transportError(i.resources.noConnectionTransport,b.transport)),e.promise()},prepareQueryString:function(a,c){var d;return d=h.addQs(c,"clientProtocol="+a.clientProtocol),d=h.addQs(d,a.qs),a.token&&(d+="&connectionToken="+b.encodeURIComponent(a.token)),a.data&&(d+="&connectionData="+b.encodeURIComponent(a.data)),d},addQs:function(b,c){var d,e=-1!==b.indexOf("?")?"&":"?";if(!c)return b;if("object"==typeof c)return b+e+a.param(c);if("string"==typeof c)return d=c.charAt(0),"?"!==d&&"&"!==d||(e=""),b+e+c;throw new Error("Query string property must be either a string or object.")},getUrl:function(a,c,d,e,f){var g="webSockets"===c?"":a.baseUrl,i=g+a.appRelativeUrl,j="transport="+c;return!f&&a.groupsToken&&(j+="&groupsToken="+b.encodeURIComponent(a.groupsToken)),d?(i+=e?"/poll":"/reconnect",!f&&a.messageId&&(j+="&messageId="+b.encodeURIComponent(a.messageId))):i+="/connect",i+="?"+j,i=h.prepareQueryString(a,i),f||(i+="&tid="+Math.floor(11*Math.random())),i},maximizePersistentResponse:function(a){return{MessageId:a.C,Messages:a.M,Initialized:"undefined"!=typeof a.S,ShouldReconnect:"undefined"!=typeof a.T,LongPollDelay:a.L,GroupsToken:a.G}},updateGroups:function(a,b){b&&(a.groupsToken=b)},stringifySend:function(a,b){return"string"==typeof b||"undefined"==typeof b||null===b?b:a.json.stringify(b)},ajaxSend:function(b,c){var d,e=h.stringifySend(b,c),g=f(b,"/send"),k=function(b,e){a(e).triggerHandler(j.onError,[i._.transportError(i.resources.sendFailed,e.transport,b,d),c])};return d=h.ajax(b,{url:g,type:"jsonp"===b.ajaxDataType?"GET":"POST",contentType:i._.defaultContentType,data:{data:e},success:function(a){var c;if(a){try{c=b._parseResponse(a)}catch(d){return k(d,b),void b.stop()}h.triggerReceived(b,c)}},error:function(a,c){"abort"!==c&&"parsererror"!==c&&k(a,b)}})},ajaxAbort:function(a,b){if("undefined"!=typeof a.transport){b="undefined"==typeof b?!0:b;var c=f(a,"/abort");h.ajax(a,{url:c,async:b,timeout:1e3,type:"POST"}),a.log("Fired ajax abort async = "+b+".")}},ajaxStart:function(b,c){var d=function(a){var c=b._deferral;c&&c.reject(a)},e=function(c){b.log("The start request failed. Stopping the connection."),a(b).triggerHandler(j.onError,[c]),d(c),b.stop()};b._.startRequest=h.ajax(b,{url:f(b,"/start"),success:function(a,d,f){var g;try{g=b._parseResponse(a)}catch(h){return void e(i._.error(i._.format(i.resources.errorParsingStartResponse,a),h,f))}"started"===g.Response?c():e(i._.error(i._.format(i.resources.invalidStartResponse,a),null,f))},error:function(a,c,f){c!==l?e(i._.error(i.resources.errorDuringStartRequest,f,a)):(b.log("The start request aborted because connection.stop() was called."),d(i._.error(i.resources.stoppedDuringStartRequest,null,a)))}})},tryAbortStartRequest:function(a){a._.startRequest&&(a._.startRequest.abort(l),delete a._.startRequest)},tryInitialize:function(a,b){a.Initialized&&b()},triggerReceived:function(b,c){b._.connectingMessageBuffer.tryBuffer(c)||a(b).triggerHandler(j.onReceived,[c])},processMessages:function(b,c,d){var e;h.markLastMessage(b),c&&(e=h.maximizePersistentResponse(c),h.updateGroups(b,e.GroupsToken),e.MessageId&&(b.messageId=e.MessageId),e.Messages&&(a.each(e.Messages,function(a,c){h.triggerReceived(b,c)}),h.tryInitialize(e,d)))},monitorKeepAlive:function(b){var c=b._.keepAliveData;c.monitoring?b.log("Tried to monitor keep alive but it's already being monitored."):(c.monitoring=!0,h.markLastMessage(b),b._.keepAliveData.reconnectKeepAliveUpdate=function(){h.markLastMessage(b)},a(b).bind(j.onReconnect,b._.keepAliveData.reconnectKeepAliveUpdate),b.log("Now monitoring keep alive with a warning timeout of "+c.timeoutWarning+", keep alive timeout of "+c.timeout+" and disconnecting timeout of "+b.disconnectTimeout))},stopMonitoringKeepAlive:function(b){var c=b._.keepAliveData;c.monitoring&&(c.monitoring=!1,a(b).unbind(j.onReconnect,b._.keepAliveData.reconnectKeepAliveUpdate),b._.keepAliveData={},b.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(a){a._.lastActiveAt=(new Date).getTime(),d(a)},markLastMessage:function(a){a._.lastMessageAt=(new Date).getTime()},markActive:function(a){return h.verifyLastActive(a)?(a._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(a){return a.state===i.connectionState.connected||a.state===i.connectionState.reconnecting},ensureReconnectingState:function(b){return k(b,i.connectionState.connected,i.connectionState.reconnecting)===!0&&a(b).triggerHandler(j.onReconnecting),b.state===i.connectionState.reconnecting},clearReconnectTimeout:function(a){a&&a._.reconnectTimeout&&(b.clearTimeout(a._.reconnectTimeout),delete a._.reconnectTimeout)},verifyLastActive:function(b){if((new Date).getTime()-b._.lastActiveAt>=b.reconnectWindow){var c=i._.format(i.resources.reconnectWindowTimeout,new Date(b._.lastActiveAt),b.reconnectWindow);return b.log(c),a(b).triggerHandler(j.onError,[i._.error(c,"TimeoutException")]),b.stop(!1,!1),!1}return!0},reconnect:function(a,c){var d=i.transports[c];if(h.isConnectedOrReconnecting(a)&&!a._.reconnectTimeout){if(!h.verifyLastActive(a))return;a._.reconnectTimeout=b.setTimeout(function(){h.verifyLastActive(a)&&(d.stop(a),h.ensureReconnectingState(a)&&(a.log(c+" reconnecting."),d.start(a)))},a.reconnectDelay)}},handleParseFailure:function(b,c,d,e,f){var g=i._.transportError(i._.format(i.resources.parseFailed,c),b.transport,d,f);e&&e(g)?b.log("Failed to parse server response while attempting to connect."):(a(b).triggerHandler(j.onError,[g]),b.stop())},initHandler:function(a){return new g(a)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=d.transports._logic;d.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(b,c){var f=g.stringifySend(b,c);try{b.socket.send(f)}catch(h){a(b).triggerHandler(e.onError,[d._.transportError(d.resources.webSocketsInvalidState,b.transport,h,b.socket),c])}},start:function(c,h,i){var j,k=!1,l=this,m=!h,n=a(c);return b.WebSocket?void(c.socket||(j=c.webSocketServerUrl?c.webSocketServerUrl:c.wsProtocol+c.host,j+=g.getUrl(c,this.name,m),c.log("Connecting to websocket endpoint '"+j+"'."),c.socket=new b.WebSocket(j),c.socket.onopen=function(){k=!0,c.log("Websocket opened."),g.clearReconnectTimeout(c),f(c,d.connectionState.reconnecting,d.connectionState.connected)===!0&&n.triggerHandler(e.onReconnect)},c.socket.onclose=function(b){var f;this===c.socket&&(k&&"undefined"!=typeof b.wasClean&&b.wasClean===!1?(f=d._.transportError(d.resources.webSocketClosed,c.transport,b),c.log("Unclean disconnect from websocket: "+(b.reason||"[no reason given]."))):c.log("Websocket closed."),i&&i(f)||(f&&a(c).triggerHandler(e.onError,[f]),l.reconnect(c)))},c.socket.onmessage=function(b){var d;try{d=c._parseResponse(b.data)}catch(e){return void g.handleParseFailure(c,b.data,e,i,b)}d&&(a.isEmptyObject(d)||d.M?g.processMessages(c,d,h):g.triggerReceived(c,d))})):void i()},reconnect:function(a){g.reconnect(a,this.name)},lostConnection:function(a){this.reconnect(a)},stop:function(a){g.clearReconnectTimeout(a),a.socket&&(a.log("Closing the Websocket."),a.socket.close(),a.socket=null)},abort:function(a,b){g.ajaxAbort(a,b)}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=d.transports._logic,h=function(a){b.clearTimeout(a._.reconnectAttemptTimeoutHandle),delete a._.reconnectAttemptTimeoutHandle};d.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(c,i,j){var k,l=this,m=!1,n=a(c),o=!i;if(c.eventSource&&(c.log("The connection already has an event source. Stopping it."),c.stop()),!b.EventSource)return void(j&&(c.log("This browser doesn't support SSE."),j()));k=g.getUrl(c,this.name,o);try{c.log("Attempting to connect to SSE endpoint '"+k+"'."),c.eventSource=new b.EventSource(k,{withCredentials:c.withCredentials})}catch(p){return c.log("EventSource failed trying to connect with error "+p.Message+"."),void(j?j():(n.triggerHandler(e.onError,[d._.transportError(d.resources.eventSourceFailedToConnect,c.transport,p)]),o&&l.reconnect(c)))}o&&(c._.reconnectAttemptTimeoutHandle=b.setTimeout(function(){m===!1&&c.eventSource.readyState!==b.EventSource.OPEN&&l.reconnect(c)},l.timeOut)),c.eventSource.addEventListener("open",function(a){c.log("EventSource connected."),h(c),g.clearReconnectTimeout(c),m===!1&&(m=!0,f(c,d.connectionState.reconnecting,d.connectionState.connected)===!0&&n.triggerHandler(e.onReconnect))},!1),c.eventSource.addEventListener("message",function(a){var b;if("initialized"!==a.data){try{b=c._parseResponse(a.data)}catch(d){return void g.handleParseFailure(c,a.data,d,j,a)}g.processMessages(c,b,i)}},!1),c.eventSource.addEventListener("error",function(a){var f=d._.transportError(d.resources.eventSourceError,c.transport,a);this===c.eventSource&&(j&&j(f)||(c.log("EventSource readyState: "+c.eventSource.readyState+"."),a.eventPhase===b.EventSource.CLOSED?(c.log("EventSource reconnecting due to the server connection ending."),l.reconnect(c)):(c.log("EventSource error."),n.triggerHandler(e.onError,[f]))))},!1)},reconnect:function(a){g.reconnect(a,this.name)},lostConnection:function(a){this.reconnect(a)},send:function(a,b){g.ajaxSend(a,b)},stop:function(a){h(a),g.clearReconnectTimeout(a),a&&a.eventSource&&(a.log("EventSource calling close()."),a.eventSource.close(),a.eventSource=null,delete a.eventSource)},abort:function(a,b){g.ajaxAbort(a,b)}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=d.transports._logic,h=function(){var a=b.document.createElement("iframe");return a.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),a},i=function(){var a=null,c=1e3,e=0;return{prevent:function(){d._.ieVersion<=8&&(0===e&&(a=b.setInterval(function(){var a=h();b.document.body.appendChild(a),b.document.body.removeChild(a),a=null},c)),e++)},cancel:function(){1===e&&b.clearInterval(a),e>0&&e--}}}();d.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(a,c,d){var e,f=this,j=g.foreverFrame.count+=1,k=h(),l=function(){a.log("Forever frame iframe finished loading and is no longer receiving messages."),d&&d()||f.reconnect(a)};return b.EventSource?void(d&&(a.log("Forever Frame is not supported by SignalR on browsers with SSE support."),d())):(k.setAttribute("data-signalr-connection-id",a.id),i.prevent(),e=g.getUrl(a,this.name),e+="&frameId="+j,b.document.documentElement.appendChild(k),a.log("Binding to iframe's load event."),k.addEventListener?k.addEventListener("load",l,!1):k.attachEvent&&k.attachEvent("onload",l),k.src=e,g.foreverFrame.connections[j]=a,a.frame=k,a.frameId=j,void(c&&(a.onSuccess=function(){a.log("Iframe transport started."),c()})))},reconnect:function(a){var c=this;g.isConnectedOrReconnecting(a)&&g.verifyLastActive(a)&&b.setTimeout(function(){if(g.verifyLastActive(a)&&a.frame&&g.ensureReconnectingState(a)){var b=a.frame,d=g.getUrl(a,c.name,!0)+"&frameId="+a.frameId;a.log("Updating iframe src to '"+d+"'."),b.src=d}},a.reconnectDelay)},lostConnection:function(a){this.reconnect(a)},send:function(a,b){g.ajaxSend(a,b)},receive:function(b,c){var e,f,h;if(b.json!==b._originalJson&&(c=b._originalJson.stringify(c)),h=b._parseResponse(c),g.processMessages(b,h,b.onSuccess),b.state===a.signalR.connectionState.connected&&(b.frameMessageCount=(b.frameMessageCount||0)+1,b.frameMessageCount>d.transports.foreverFrame.iframeClearThreshold&&(b.frameMessageCount=0,e=b.frame.contentWindow||b.frame.contentDocument,e&&e.document&&e.document.body)))for(f=e.document.body;f.firstChild;)f.removeChild(f.firstChild)},stop:function(a){var c=null;if(i.cancel(),a.frame){if(a.frame.stop)a.frame.stop();else try{c=a.frame.contentWindow||a.frame.contentDocument,c.document&&c.document.execCommand&&c.document.execCommand("Stop")}catch(d){a.log("Error occured when stopping foreverFrame transport. Message = "+d.message+".")}a.frame.parentNode===b.document.body&&b.document.body.removeChild(a.frame),delete g.foreverFrame.connections[a.frameId],a.frame=null,a.frameId=null,delete a.frame,delete a.frameId,delete a.onSuccess,delete a.frameMessageCount,a.log("Stopping forever frame.")}},abort:function(a,b){g.ajaxAbort(a,b)},getConnection:function(a){return g.foreverFrame.connections[a]},started:function(b){f(b,d.connectionState.reconnecting,d.connectionState.connected)===!0&&a(b).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=a.signalR.isDisconnecting,h=d.transports._logic;d.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(c,i,j){var k=this,l=function(){l=a.noop,c.log("LongPolling connected."),i()},m=function(a){return j(a)?(c.log("LongPolling failed to connect."),!0):!1},n=c._,o=0,p=function(c){b.clearTimeout(n.reconnectTimeoutId),n.reconnectTimeoutId=null,f(c,d.connectionState.reconnecting,d.connectionState.connected)===!0&&(c.log("Raising the reconnect event"),a(c).triggerHandler(e.onReconnect))},q=36e5;c.pollXhr&&(c.log("Polling xhr requests already exists, aborting."),c.stop()),c.messageId=null,n.reconnectTimeoutId=null,n.pollTimeoutId=b.setTimeout(function(){!function f(i,j){var r=i.messageId,s=null===r,t=!s,u=!j,v=h.getUrl(i,k.name,t,u,!0),w={};i.messageId&&(w.messageId=i.messageId),i.groupsToken&&(w.groupsToken=i.groupsToken),g(i)!==!0&&(c.log("Opening long polling request to '"+v+"'."),i.pollXhr=h.ajax(c,{xhrFields:{onprogress:function(){h.markLastMessage(c)}},url:v,type:"POST",contentType:d._.defaultContentType,data:w,timeout:c._.pollTimeout,success:function(d){var e,j,k,q=0;c.log("Long poll complete."),o=0;try{e=c._parseResponse(d)}catch(r){return void h.handleParseFailure(i,d,r,m,i.pollXhr)}null!==n.reconnectTimeoutId&&p(i),e&&(j=h.maximizePersistentResponse(e)),h.processMessages(i,e,l),j&&"number"===a.type(j.LongPollDelay)&&(q=j.LongPollDelay),g(i)!==!0&&(k=j&&j.ShouldReconnect,k&&!h.ensureReconnectingState(i)||(q>0?n.pollTimeoutId=b.setTimeout(function(){f(i,k)},q):f(i,k)))},error:function(g,j){var l=d._.transportError(d.resources.longPollFailed,c.transport,g,i.pollXhr);if(b.clearTimeout(n.reconnectTimeoutId),n.reconnectTimeoutId=null,"abort"===j)return void c.log("Aborted xhr request.");if(!m(l)){if(o++,c.state!==d.connectionState.reconnecting&&(c.log("An error occurred using longPolling. Status = "+j+". Response = "+g.responseText+"."),a(i).triggerHandler(e.onError,[l])),(c.state===d.connectionState.connected||c.state===d.connectionState.reconnecting)&&!h.verifyLastActive(c))return;if(!h.ensureReconnectingState(i))return;n.pollTimeoutId=b.setTimeout(function(){f(i,!0)},k.reconnectDelay)}}}),t&&j===!0&&(n.reconnectTimeoutId=b.setTimeout(function(){p(i)},Math.min(1e3*(Math.pow(2,o)-1),q))))}(c)},250)},lostConnection:function(a){a.pollXhr&&a.pollXhr.abort("lostConnection")},send:function(a,b){h.ajaxSend(a,b)},stop:function(a){b.clearTimeout(a._.pollTimeoutId),b.clearTimeout(a._.reconnectTimeoutId),delete a._.pollTimeoutId,delete a._.reconnectTimeoutId,a.pollXhr&&(a.pollXhr.abort(),a.pollXhr=null,delete a.pollXhr)},abort:function(a,b){h.ajaxAbort(a,b)}}}(window.jQuery,window),function(a,b,c){function d(a){return a+k}function e(a,b,c){var d,e=a.length,f=[];for(d=0;e>d;d+=1)a.hasOwnProperty(d)&&(f[d]=b.call(c,a[d],d,a));return f}function f(b){return a.isFunction(b)?null:"undefined"===a.type(b)?null:b}function g(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1}function h(a,b){var c,d=a._.invocationCallbacks;g(d)&&a.log("Clearing hub invocation callbacks with error: "+b+"."),a._.invocationCallbackId=0,delete a._.invocationCallbacks,a._.invocationCallbacks={};for(var e in d)c=d[e],c.method.call(c.scope,{E:b})}function i(a,b){return new i.fn.init(a,b)}function j(b,c){var d={qs:null,logging:!1,useDefaultPath:!0};return a.extend(d,c),b&&!d.useDefaultPath||(b=(b||"")+"/signalr"),new j.fn.init(b,d)}var k=".hubProxy",l=a.signalR;i.fn=i.prototype={init:function(a,b){this.state={},this.connection=a,this.hubName=b,this._={callbackMap:{}}},constructor:i,hasSubscriptions:function(){return g(this._.callbackMap)},on:function(b,c){var e=this,f=e._.callbackMap;return b=b.toLowerCase(),f[b]||(f[b]={}),f[b][c]=function(a,b){c.apply(e,b)},a(e).bind(d(b),f[b][c]),e},off:function(b,c){var e,f=this,h=f._.callbackMap;return b=b.toLowerCase(),e=h[b],e&&(e[c]?(a(f).unbind(d(b),e[c]),delete e[c],g(e)||delete h[b]):c||(a(f).unbind(d(b)),delete h[b])),f},invoke:function(b){var c=this,d=c.connection,g=a.makeArray(arguments).slice(1),h=e(g,f),i={H:c.hubName,M:b,A:h,I:d._.invocationCallbackId},j=a.Deferred(),k=function(e){var f,g,h=c._maximizeHubResponse(e);a.extend(c.state,h.State),h.Progress?j.notifyWith?j.notifyWith(c,[h.Progress.Data]):d._.progressjQueryVersionLogged||(d.log("A hub method invocation progress update was received but the version of jQuery in use ("+a.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),d._.progressjQueryVersionLogged=!0):h.Error?(h.StackTrace&&d.log(h.Error+"\n"+h.StackTrace+"."),f=h.IsHubException?"HubException":"Exception",g=l._.error(h.Error,f),g.data=h.ErrorData,d.log(c.hubName+"."+b+" failed to execute. Error: "+g.message),j.rejectWith(c,[g])):(d.log("Invoked "+c.hubName+"."+b),j.resolveWith(c,[h.Result]))};return d._.invocationCallbacks[d._.invocationCallbackId.toString()]={scope:c,method:k},d._.invocationCallbackId+=1,a.isEmptyObject(c.state)||(i.S=c.state),d.log("Invoking "+c.hubName+"."+b),d.send(i),j.promise()},_maximizeHubResponse:function(a){return{State:a.S,Result:a.R,Progress:a.P?{Id:a.P.I,Data:a.P.D}:null,Id:a.I,IsHubException:a.H,Error:a.E,StackTrace:a.T,ErrorData:a.D}}},i.fn.init.prototype=i.fn,j.fn=j.prototype=a.connection(),j.fn.init=function(b,c){var e={qs:null,logging:!1,useDefaultPath:!0},f=this;a.extend(e,c),a.signalR.fn.init.call(f,b,e.qs,e.logging),f.proxies={},f._.invocationCallbackId=0,f._.invocationCallbacks={},f.received(function(b){var c,e,g,h,i,j;b&&("undefined"!=typeof b.P?(g=b.P.I.toString(),h=f._.invocationCallbacks[g],h&&h.method.call(h.scope,b)):"undefined"!=typeof b.I?(g=b.I.toString(),h=f._.invocationCallbacks[g],h&&(f._.invocationCallbacks[g]=null,delete f._.invocationCallbacks[g],h.method.call(h.scope,b))):(c=this._maximizeClientHubInvocation(b),f.log("Triggering client hub event '"+c.Method+"' on hub '"+c.Hub+"'."),i=c.Hub.toLowerCase(),j=c.Method.toLowerCase(),e=this.proxies[i],a.extend(e.state,c.State),a(e).triggerHandler(d(j),[c.Args])))}),f.error(function(a,b){var c,d;b&&(c=b.I,d=f._.invocationCallbacks[c],d&&(f._.invocationCallbacks[c]=null,delete f._.invocationCallbacks[c],d.method.call(d.scope,{E:a})))}),f.reconnecting(function(){f.transport&&"webSockets"===f.transport.name&&h(f,"Connection started reconnecting before invocation result was received.")}),f.disconnected(function(){h(f,"Connection was disconnected before invocation result was received.")})},j.fn._maximizeClientHubInvocation=function(a){return{Hub:a.H,Method:a.M,Args:a.A,State:a.S}},j.fn._registerSubscribedHubs=function(){var b=this;b._subscribedToHubs||(b._subscribedToHubs=!0,b.starting(function(){var c=[];a.each(b.proxies,function(a){this.hasSubscriptions()&&(c.push({name:a}),b.log("Client subscribed to hub '"+a+"'."))}),0===c.length&&b.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to."),b.data=b.json.stringify(c)}))},j.fn.createHubProxy=function(a){a=a.toLowerCase();var b=this.proxies[a];return b||(b=i(this,a),this.proxies[a]=b),this._registerSubscribedHubs(),b},j.fn.init.prototype=j.fn,a.hubConnection=j}(window.jQuery,window),function(a,b){a.signalR.version="2.2.0"}(window.jQuery); 12 v.clearFocusListCache()},v.close=function(a,b){var c=t.get(a);return c&&n(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),k(a,c.value.modalOpener),!0):!c},v.dismiss=function(a,b){var c=t.get(a);return c&&n(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),k(a,c.value.modalOpener),!0):!c},v.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},v.getTop=function(){return t.top()},v.modalRendered=function(a){var b=t.get(a);b&&b.value.renderDeferred.resolve()},v.focusFirstFocusableElement=function(){return r.length>0?(r[0].focus(),!0):!1},v.focusLastFocusableElement=function(){return r.length>0?(r[r.length-1].focus(),!0):!1},v.isFocusInFirstItem=function(a){return r.length>0?(a.target||a.srcElement)==r[0]:!1},v.isFocusInLastItem=function(a){return r.length>0?(a.target||a.srcElement)==r[r.length-1]:!1},v.clearFocusListCache=function(){r=[],w=0},v.loadFocusElementList=function(a){if((void 0===r||!r.length0)&&a){var b=a.value.modalDomEl;b&&b.length&&(r=b[0].querySelectorAll(x))}},v}]).provider("$modal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$modalStack",function(b,c,d,e,f,g){function h(a){return a.template?d.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}function i(a){var c=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?c.push(d.when(b.invoke(a))):angular.isString(a)?c.push(d.when(b.get(a))):c.push(d.when(a))}),c}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(b){var e=d.defer(),j=d.defer(),l=d.defer(),m={result:e.promise,opened:j.promise,rendered:l.promise,close:function(a){return g.close(m,a)},dismiss:function(a){return g.dismiss(m,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var n,o=d.all([h(b)].concat(i(b.resolve)));return n=k=d.all([k]).then(function(){return o},function(){return o}).then(function(a){var d=(b.scope||c).$new();d.$close=m.close,d.$dismiss=m.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var h,i={},k=1;b.controller&&(i.$scope=d,i.$modalInstance=m,angular.forEach(b.resolve,function(b,c){i[c]=a[k++]}),h=f(b.controller,i),b.controllerAs&&(b.bindToController&&angular.extend(h,d),d[b.controllerAs]=h)),g.open(m,{scope:d,deferred:e,renderDeferred:l,content:a[0],animation:b.animation,backdrop:b.backdrop,keyboard:b.keyboard,backdropClass:b.backdropClass,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size,openedClass:b.openedClass}),j.resolve(!0)},function(a){j.reject(a),e.reject(a)})["finally"](function(){k===n&&(k=null)}),m},j}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(g,h){e=g,this.config=h,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=h.itemsPerPage,a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b,c){c&&c.preventDefault();var d=!a.ngDisabled||!c;d&&a.page!==b&&b>0&&b<=a.totalPages&&(c&&c.target&&c.target.blur(),e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages}}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["pagination","?ngModel"],controller:"PaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"template/pagination/pagination.html"},replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["pager","?ngModel"],controller:"PaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"template/pagination/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate","$rootScope","$parse",function(e,f,g,h,i,j,k,l){return function(e,m,n,o){function p(a){var b=(a||o.trigger||n).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}o=angular.extend({},b,d,o);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup title="'+r+"title"+s+'" '+(o.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';return{restrict:"EA",compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){I.isOpen?q():n()}function n(){H&&!a.$eval(d[m+"Enable"])||(v(),I.popupDelay?D||(D=g(r,I.popupDelay,!1)):r())}function q(){s(),k.$$phase||k.$digest()}function r(){return D=null,C&&(g.cancel(C),C=null),(o.useContentExp?I.contentExp():I.content)?(t(),I.isOpen=!0,K&&K.assign(I.origScope,I.isOpen),k.$$phase||I.$apply(),A.css({display:"block"}),void L()):angular.noop}function s(){I.isOpen=!1,K&&K.assign(I.origScope,I.isOpen),g.cancel(D),D=null,g.cancel(E),E=null,I.animation?C||(C=g(u,500)):u()}function t(){A&&u(),B=I.$new(),A=c(B,function(a){F?h.find("body").append(a):b.after(a)}),o.useContentExp&&(B.$watch("contentExp()",function(a){!a&&I.isOpen&&s()}),B.$watch(function(){J||(J=!0,B.$$postDigest(function(){J=!1,I.isOpen&&L()}))}))}function u(){C=null,A&&(A.remove(),A=null),B&&(B.$destroy(),B=null)}function v(){w(),x(),y()}function w(){I.popupClass=d[m+"Class"]}function x(){var a=d[m+"Placement"];I.placement=angular.isDefined(a)?a:o.placement}function y(){var a=d[m+"PopupDelay"],b=parseInt(a,10);I.popupDelay=isNaN(b)?o.popupDelay:b}function z(){var a=d[m+"Trigger"];M(),G=p(a),"none"!==G.show&&G.show.forEach(function(a,c){a===G.hide[c]?b[0].addEventListener(a,j):a&&(b[0].addEventListener(a,n),b[0].addEventListener(G.hide[c],q))})}var A,B,C,D,E,F=angular.isDefined(o.appendToBody)?o.appendToBody:!1,G=p(void 0),H=angular.isDefined(d[m+"Enable"]),I=a.$new(!0),J=!1,K=angular.isDefined(d[m+"IsOpen"])?l(d[m+"IsOpen"]):!1,L=function(){A&&(E||(E=g(function(){A.css({top:0,left:0,width:"auto",height:"auto"});var a=i.position(A),c=i.positionElements(b,A,I.placement,F);c.top+="px",c.left+="px",c.width=a.width+"px",c.height=a.height+"px",A.css(c),E=null},0,!1)))};I.origScope=a,I.isOpen=!1,I.contentExp=function(){return a.$eval(d[e])},o.useContentExp||d.$observe(e,function(a){I.content=a,!a&&I.isOpen?s():L()}),d.$observe("disabled",function(a){D&&a&&(g.cancel(D),D=null),a&&I.isOpen&&s()}),d.$observe(m+"Title",function(a){I.title=a,L()}),d.$observe(m+"Placement",function(){I.isOpen&&(x(),L())}),K&&a.$watch(K,function(a){a!==I.isOpen&&j()});var M=function(){G.show.forEach(function(a){b.unbind(a,n)}),G.hide.forEach(function(a){b.unbind(a,q)})};z();var N=a.$eval(d[m+"Animation"]);I.animation=angular.isDefined(N)?!!N:o.animation;var O=a.$eval(d[m+"AppendToBody"]);F=angular.isDefined(O)?O:F,F&&a.$on("$locationChangeSuccess",function(){I.isOpen&&s()}),a.$on("$destroy",function(){g.cancel(C),g.cancel(D),g.cancel(E),M(),u(),I=null})}}}}}]}).directive("tooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.tooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("tooltipClasses",function(){return{restrict:"A",link:function(a,b,c){a.placement&&b.addClass(a.placement),a.popupClass&&b.addClass(a.popupClass),a.animation()&&b.addClass(c.tooltipAnimationClass)}}}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/tooltip/tooltip-template-popup.html"}}).directive("tooltipTemplate",["$tooltip",function(a){return a("tooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlPopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-popup.html"}}).directive("tooltipHtml",["$tooltip",function(a){return a("tooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).value("tooltipHtmlUnsafeSuppressDeprecated",!1).directive("tooltipHtmlUnsafe",["$tooltip","tooltipHtmlUnsafeSuppressDeprecated","$log",function(a,b,c){return b||c.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."),a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/popover/popover-template.html"}}).directive("popoverTemplate",["$tooltip",function(a){return a("popoverTemplate","popover","click",{useContentExp:!0})}]).directive("popoverHtmlPopup",function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",title:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover-html.html"}}).directive("popoverHtml",["$tooltip",function(a){return a("popoverHtml","popover","click",{useContentExp:!0})}]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).value("$progressSuppressWarning",!1).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(a.max)?a.max:c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.max=a.max,b.$watch("value",function(a){b.recalculatePercentage()}),b.recalculatePercentage=function(){b.percent=+(100*b.value/b.max).toFixed(2);var a=d.bars.reduce(function(a,b){return a+b.percent},0);a>100&&(b.percent-=a-100)},b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)},a.$watch("max",function(b){d.bars.forEach(function(b){b.max=a.max,b.recalculatePercentage()})})}]).directive("uibProgress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"uibProgress",scope:{max:"=?"},templateUrl:"template/progressbar/progress.html"}}).directive("progress",["$log","$progressSuppressWarning",function(a,b){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{max:"=?"},templateUrl:"template/progressbar/progress.html",link:function(){b&&a.warn("progress is now deprecated. Use uib-progress instead")}}}]).directive("uibBar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("bar",["$log","$progressSuppressWarning",function(a,b){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(c,d,e,f){b&&a.warn("bar is now deprecated. Use uib-bar instead"),f.addBar(c,d)}}}]).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null,titles:["one","two","three","four","five"]}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(d.$viewValue===b?0:b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect(),a.selectCalled=!1)}),a.active=!0,a.selectCalled||(a.onSelect(),a.selectCalled=!0)},b.addTab=function(a){c.push(a),1===c.length&&a.active!==!1?a.active=!0:a.active?b.select(a):a.active=!1},b.removeTab=function(a){var e=c.indexOf(a);if(a.active&&c.length>1&&!d){var f=e==c.length-1?e-1:e+1;b.select(c[f])}c.splice(e,1)};var d;a.$on("$destroy",function(){d=!0})}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse","$log",function(a,b){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},link:function(c,d,e,f,g){c.$watch("active",function(a){a&&f.select(c)}),c.disabled=!1,e.disable&&c.$parent.$watch(a(e.disable),function(a){c.disabled=!!a}),e.disabled&&(b.warn('Use of "disabled" attribute has been deprecated, please use "disable"'),c.$parent.$watch(a(e.disabled),function(a){c.disabled=!!a})),c.select=function(){c.disabled||(c.active=!0)},f.addTab(c),c.$on("$destroy",function(){f.removeTab(c)}),c.$transcludeFn=g}}}]).directive("tabHeadingTransclude",function(){return{restrict:"A",require:"^tab",link:function(a,b,c,d){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||a.hasAttribute("x-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase()||"x-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===q[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a.toString()}function j(a){k(),p.$setViewValue(new Date(o)),l(a)}function k(){p.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=o.getHours(),d=o.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),"m"!==b&&(a.minutes=i(d)),a.meridian=o.getHours()<12?q[0]:q[1]}function m(a,b){var c=new Date(a.getTime()+6e4*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes()),d}function n(a){o=m(o,a),j()}var o=new Date,p={$setViewValue:angular.noop},q=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){p=c,p.$render=this.render,p.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g);var i=angular.isDefined(b.arrowkeys)?a.$parent.$eval(b.arrowkeys):f.arrowkeys;i&&this.setupArrowkeyEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var r=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){r=parseInt(a,10)});var s=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){s=parseInt(a,10)});var t;a.$parent.$watch(c(b.min),function(a){var b=new Date(a);t=isNaN(b)?void 0:b});var u;a.$parent.$watch(c(b.max),function(a){var b=new Date(a);u=isNaN(b)?void 0:b}),a.noIncrementHours=function(){var a=m(o,60*r);return a>u||o>a&&t>a},a.noDecrementHours=function(){var a=m(o,60*-r);return t>a||a>o&&a>u},a.noIncrementMinutes=function(){var a=m(o,s);return a>u||o>a&&t>a},a.noDecrementMinutes=function(){var a=m(o,-s);return t>a||a>o&&a>u},a.noToggleMeridian=function(){return o.getHours()<13?m(o,720)>u:m(o,-720)<t},a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,p.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(o.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c){b.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply())}),c.bind("keydown",function(b){38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply())})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){p.$setViewValue(null),p.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g(),b=h();angular.isDefined(a)&&angular.isDefined(b)?(o.setHours(a),t>o||o>u?d(!0):j("h")):d(!0)},b.bind("blur",function(b){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h(),b=g();angular.isDefined(a)&&angular.isDefined(b)?(o.setMinutes(a),t>o||o>u?d(void 0,!0):j("m")):d(void 0,!0)},c.bind("blur",function(b){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var b=p.$viewValue;isNaN(b)?(p.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(o=b),t>o||o>u?(p.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):k(),l())},a.showSpinners=angular.isDefined(b.showSpinners)?a.$parent.$eval(b.showSpinners):f.showSpinners,a.incrementHours=function(){a.noIncrementHours()||n(60*r)},a.decrementHours=function(){a.noDecrementHours()||n(60*-r)},a.incrementMinutes=function(){a.noIncrementMinutes()||n(s)},a.decrementMinutes=function(){a.noDecrementMinutes()||n(-s)},a.toggleMeridian=function(){a.noToggleMeridian()||n(720*(o.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(a,b){return b.templateUrl||"template/timepicker/timepicker.html"},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.transition",[]).value("$transitionSuppressDeprecated",!1).factory("$transition",["$q","$timeout","$rootScope","$log","$transitionSuppressDeprecated",function(a,b,c,d,e){function f(a){for(var b in a)if(void 0!==h.style[b])return a[b]}e||d.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");var g=function(d,e,f){f=f||{};var h=a.defer(),i=g[f.animation?"animationEndEventName":"transitionEndEventName"],j=function(a){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(e)?d.addClass(e):angular.isFunction(e)?e(d):angular.isObject(e)&&d.css(e),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},h=document.createElement("trans"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},j={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return g.transitionEndEventName=f(i),g.animationEndEventName=f(j),g}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$window","$rootScope","$position","typeaheadParser",function(a,b,c,d,e,f,g,h,i){var j=[9,13,27,38,40],k=200;return{require:["ngModel","^?ngModelOptions"],link:function(l,m,n,o){function p(){K.moveInProgress||(K.moveInProgress=!0,K.$digest()),S&&d.cancel(S),S=d(function(){K.matches.length&&q(),K.moveInProgress=!1,K.$digest()},k)}function q(){K.position=D?h.offset(m):h.position(m),K.position.top+=m.prop("offsetHeight")}var r=o[0],s=o[1],t=l.$eval(n.typeaheadMinLength);t||0===t||(t=1);var u,v,w=l.$eval(n.typeaheadWaitMs)||0,x=l.$eval(n.typeaheadEditable)!==!1,y=b(n.typeaheadLoading).assign||angular.noop,z=b(n.typeaheadOnSelect),A=angular.isDefined(n.typeaheadSelectOnBlur)?l.$eval(n.typeaheadSelectOnBlur):!1,B=b(n.typeaheadNoResults).assign||angular.noop,C=n.typeaheadInputFormatter?b(n.typeaheadInputFormatter):void 0,D=n.typeaheadAppendToBody?l.$eval(n.typeaheadAppendToBody):!1,E=l.$eval(n.typeaheadFocusFirst)!==!1,F=n.typeaheadSelectOnExact?l.$eval(n.typeaheadSelectOnExact):!1,G=b(n.ngModel),H=b(n.ngModel+"($$$p)"),I=function(a,b){return angular.isFunction(G(l))&&s&&s.$options&&s.$options.getterSetter?H(a,{$$$p:b}):G.assign(a,b)},J=i.parse(n.typeahead),K=l.$new(),L=l.$on("$destroy",function(){K.$destroy()});K.$on("$destroy",L);var M="typeahead-"+K.$id+"-"+Math.floor(1e4*Math.random());m.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":M});var N=angular.element("<div typeahead-popup></div>");N.attr({id:M,matches:"matches",active:"activeIdx",select:"select(activeIdx)","move-in-progress":"moveInProgress",query:"query",position:"position"}),angular.isDefined(n.typeaheadTemplateUrl)&&N.attr("template-url",n.typeaheadTemplateUrl),angular.isDefined(n.typeaheadPopupTemplateUrl)&&N.attr("popup-template-url",n.typeaheadPopupTemplateUrl);var O=function(){K.matches=[],K.activeIdx=-1,m.attr("aria-expanded",!1)},P=function(a){return M+"-option-"+a};K.$watch("activeIdx",function(a){0>a?m.removeAttr("aria-activedescendant"):m.attr("aria-activedescendant",P(a))});var Q=function(a,b){return K.matches.length>b&&a?a.toUpperCase()===K.matches[b].label.toUpperCase():!1},R=function(a){var b={$viewValue:a};y(l,!0),B(l,!1),c.when(J.source(l,b)).then(function(c){var d=a===r.$viewValue;if(d&&u)if(c&&c.length>0){K.activeIdx=E?0:-1,B(l,!1),K.matches.length=0;for(var e=0;e<c.length;e++)b[J.itemName]=c[e],K.matches.push({id:P(e),label:J.viewMapper(K,b),model:c[e]});K.query=a,q(),m.attr("aria-expanded",!0),F&&1===K.matches.length&&Q(a,0)&&K.select(0)}else O(),B(l,!0);d&&y(l,!1)},function(){O(),y(l,!1),B(l,!0)})};D&&(angular.element(f).bind("resize",p),e.find("body").bind("scroll",p));var S;K.moveInProgress=!1,O(),K.query=void 0;var T,U=function(a){T=d(function(){R(a)},w)},V=function(){T&&d.cancel(T)};r.$parsers.unshift(function(a){return u=!0,0===t||a&&a.length>=t?w>0?(V(),U(a)):R(a):(y(l,!1),V(),O()),x?a:a?void r.$setValidity("editable",!1):(r.$setValidity("editable",!0),null)}),r.$formatters.push(function(a){var b,c,d={};return x||r.$setValidity("editable",!0),C?(d.$model=a,C(l,d)):(d[J.itemName]=a,b=J.viewMapper(l,d),d[J.itemName]=void 0,c=J.viewMapper(l,d),b!==c?b:a)}),K.select=function(a){var b,c,e={};v=!0,e[J.itemName]=c=K.matches[a].model,b=J.modelMapper(l,e),I(l,b),r.$setValidity("editable",!0),r.$setValidity("parse",!0),z(l,{$item:c,$model:b,$label:J.viewMapper(l,e)}),O(),K.$eval(n.typeaheadFocusOnSelect)!==!1&&d(function(){m[0].focus()},0,!1)},m.bind("keydown",function(a){if(0!==K.matches.length&&-1!==j.indexOf(a.which)){if(-1===K.activeIdx&&(9===a.which||13===a.which))return O(),void K.$digest();a.preventDefault(),40===a.which?(K.activeIdx=(K.activeIdx+1)%K.matches.length,K.$digest()):38===a.which?(K.activeIdx=(K.activeIdx>0?K.activeIdx:K.matches.length)-1,K.$digest()):13===a.which||9===a.which?K.$apply(function(){K.select(K.activeIdx)}):27===a.which&&(a.stopPropagation(),O(),K.$digest())}}),m.bind("blur",function(){A&&K.matches.length&&-1!==K.activeIdx&&!v&&(v=!0,K.$apply(function(){K.select(K.activeIdx)})),u=!1,v=!1});var W=function(a){m[0]!==a.target&&3!==a.which&&0!==K.matches.length&&(O(),g.$$phase||K.$digest())};e.bind("click",W),l.$on("$destroy",function(){e.unbind("click",W),D&&X.remove(),N.remove()});var X=a(N)(K);D?e.find("body").append(X):m.after(X)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"template/typeahead/typeahead-popup.html"},link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"template/typeahead/typeahead-match.html";a(g).then(function(a){b(a.trim())(d,function(a){e.replaceWith(a)})})}}}]).filter("typeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.module("dndLists",[]).directive("dndDraggable",["$parse","$timeout","dndDropEffectWorkaround","dndDragTypeWorkaround",function(a,b,c,d){ 13 return function(e,f,g){f.attr("draggable","true"),g.dndDisableIf&&e.$watch(g.dndDisableIf,function(a){f.attr("draggable",!a)}),f.on("dragstart",function(h){return h=h.originalEvent||h,"false"==f.attr("draggable")?!0:(h.dataTransfer.setData("Text",angular.toJson(e.$eval(g.dndDraggable))),h.dataTransfer.effectAllowed=g.dndEffectAllowed||"move",f.addClass("dndDragging"),b(function(){f.addClass("dndDraggingSource")},0),c.dropEffect="none",d.isDragging=!0,d.dragType=g.dndType?e.$eval(g.dndType):void 0,h._dndHandle&&h.dataTransfer.setDragImage&&h.dataTransfer.setDragImage(f[0],0,0),a(g.dndDragstart)(e,{event:h}),void h.stopPropagation())}),f.on("dragend",function(h){h=h.originalEvent||h;var i=c.dropEffect;e.$apply(function(){switch(i){case"move":a(g.dndMoved)(e,{event:h});break;case"copy":a(g.dndCopied)(e,{event:h});break;case"none":a(g.dndCanceled)(e,{event:h})}a(g.dndDragend)(e,{event:h,dropEffect:i})}),f.removeClass("dndDragging"),b(function(){f.removeClass("dndDraggingSource")},0),d.isDragging=!1,h.stopPropagation()}),f.on("click",function(b){g.dndSelected&&(b=b.originalEvent||b,e.$apply(function(){a(g.dndSelected)(e,{event:b})}),b.stopPropagation())}),f.on("selectstart",function(){this.dragDrop&&this.dragDrop()})}}]).directive("dndList",["$parse","$timeout","dndDropEffectWorkaround","dndDragTypeWorkaround",function(a,b,c,d){return function(e,f,g){function h(a,b,c){var d=r?a.offsetX||a.layerX:a.offsetY||a.layerY,e=r?b.offsetWidth:b.offsetHeight,f=r?b.offsetLeft:b.offsetTop;return f=c?f:0,f+e/2>d}function i(){var a;return angular.forEach(f.children(),function(b){var c=angular.element(b);c.hasClass("dndPlaceholder")&&(a=c)}),a||angular.element("<li class='dndPlaceholder'></li>")}function j(){return Array.prototype.indexOf.call(q.children,p)}function k(a){if(!d.isDragging&&!s)return!1;if(!n(a.dataTransfer.types))return!1;if(g.dndAllowedTypes&&d.isDragging){var b=e.$eval(g.dndAllowedTypes);if(angular.isArray(b)&&-1===b.indexOf(d.dragType))return!1}return!g.dndDisableIf||!e.$eval(g.dndDisableIf)}function l(){return o.remove(),f.removeClass("dndDragover"),!0}function m(b,c,f,g){return a(b)(e,{event:c,index:f,item:g||void 0,external:!d.isDragging,type:d.isDragging?d.dragType:void 0})}function n(a){if(!a)return!0;for(var b=0;b<a.length;b++)if("Text"===a[b]||"text/plain"===a[b])return!0;return!1}var o=i(),p=o[0],q=f[0];o.remove();var r=g.dndHorizontalList&&e.$eval(g.dndHorizontalList),s=g.dndExternalSources&&e.$eval(g.dndExternalSources);f.on("dragenter",function(a){return a=a.originalEvent||a,k(a)?void a.preventDefault():!0}),f.on("dragover",function(a){if(a=a.originalEvent||a,!k(a))return!0;if(p.parentNode!=q&&f.append(o),a.target!==q){for(var b=a.target;b.parentNode!==q&&b.parentNode;)b=b.parentNode;b.parentNode===q&&b!==p&&(h(a,b)?q.insertBefore(p,b):q.insertBefore(p,b.nextSibling))}else if(h(a,p,!0))for(;p.previousElementSibling&&(h(a,p.previousElementSibling,!0)||0===p.previousElementSibling.offsetHeight);)q.insertBefore(p,p.previousElementSibling);else for(;p.nextElementSibling&&!h(a,p.nextElementSibling,!0);)q.insertBefore(p,p.nextElementSibling.nextElementSibling);return g.dndDragover&&!m(g.dndDragover,a,j())?l():(f.addClass("dndDragover"),a.preventDefault(),a.stopPropagation(),!1)}),f.on("drop",function(a){if(a=a.originalEvent||a,!k(a))return!0;a.preventDefault();var b,d=a.dataTransfer.getData("Text")||a.dataTransfer.getData("text/plain");try{b=JSON.parse(d)}catch(f){return l()}var h=j();return g.dndDrop&&(b=m(g.dndDrop,a,h,b),!b)?l():(b!==!0&&e.$apply(function(){e.$eval(g.dndList).splice(h,0,b)}),m(g.dndInserted,a,h,b),"none"===a.dataTransfer.dropEffect?"copy"===a.dataTransfer.effectAllowed||"move"===a.dataTransfer.effectAllowed?c.dropEffect=a.dataTransfer.effectAllowed:c.dropEffect=a.ctrlKey?"copy":"move":c.dropEffect=a.dataTransfer.dropEffect,l(),a.stopPropagation(),!1)}),f.on("dragleave",function(a){a=a.originalEvent||a,f.removeClass("dndDragover"),b(function(){f.hasClass("dndDragover")||o.remove()},100)})}}]).directive("dndNodrag",function(){return function(a,b,c){b.attr("draggable","true"),b.on("dragstart",function(a){a=a.originalEvent||a,a._dndHandle||(a.dataTransfer.types&&a.dataTransfer.types.length||a.preventDefault(),a.stopPropagation())}),b.on("dragend",function(a){a=a.originalEvent||a,a._dndHandle||a.stopPropagation()})}}).directive("dndHandle",function(){return function(a,b,c){b.attr("draggable","true"),b.on("dragstart dragend",function(a){a=a.originalEvent||a,a._dndHandle=!0})}}).factory("dndDragTypeWorkaround",function(){return{}}).factory("dndDropEffectWorkaround",function(){return{}}),!function(){function a(a){return a&&(a.ownerDocument||a.document||a).documentElement}function b(a){return a&&(a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView)}function c(a,b){return b>a?-1:a>b?1:a>=b?0:NaN}function d(a){return null===a?NaN:+a}function e(a){return!isNaN(a)}function f(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function g(a){return a.length}function h(a){for(var b=1;a*b%1;)b*=10;return b}function i(a,b){for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}function j(){this._=Object.create(null)}function k(a){return(a+="")===og||a[0]===pg?pg+a:a}function l(a){return(a+="")[0]===pg?a.slice(1):a}function m(a){return k(a)in this._}function n(a){return(a=k(a))in this._&&delete this._[a]}function o(){var a=[];for(var b in this._)a.push(l(b));return a}function p(){var a=0;for(var b in this._)++a;return a}function q(){for(var a in this._)return!1;return!0}function r(){this._=Object.create(null)}function s(a){return a}function t(a,b,c){return function(){var d=c.apply(b,arguments);return d===b?a:d}}function u(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(var c=0,d=qg.length;d>c;++c){var e=qg[c]+b;if(e in a)return e}}function v(){}function w(){}function x(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new j;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function y(){bg.event.preventDefault()}function z(){for(var a,b=bg.event;a=b.sourceEvent;)b=a;return b}function A(a){for(var b=new w,c=0,d=arguments.length;++c<d;)b[arguments[c]]=x(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=bg.event;e.target=a,bg.event=e,b[e.type].apply(c,d)}finally{bg.event=f}}},b}function B(a){return sg(a,wg),a}function C(a){return"function"==typeof a?a:function(){return tg(a,this)}}function D(a){return"function"==typeof a?a:function(){return ug(a,this)}}function E(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=bg.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function F(a){return a.trim().replace(/\s+/g," ")}function G(a){return new RegExp("(?:^|\\s+)"+bg.requote(a)+"(?:\\s+|$)","g")}function H(a){return(a+"").trim().split(/^|\s+/)}function I(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=H(a).map(J);var e=a.length;return"function"==typeof b?d:c}function J(a){var b=G(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",F(e+" "+a))):c.setAttribute("class",F(e.replace(b," ")))}}function K(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function L(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function M(a){function b(){var b=this.ownerDocument,c=this.namespaceURI;return c?b.createElementNS(c,a):b.createElement(a)}function c(){return this.ownerDocument.createElementNS(a.space,a.local)}return"function"==typeof a?a:(a=bg.ns.qualify(a)).local?c:b}function N(){var a=this.parentNode;a&&a.removeChild(this)}function O(a){return{__data__:a}}function P(a){return function(){return vg(this,a)}}function Q(a){return arguments.length||(a=c),function(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}}function R(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function S(a){return sg(a,yg),a}function T(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function U(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=i(b,dg(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+bg.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),i=V;h>0&&(a=a.slice(0,h));var j=zg.get(a);return j&&(a=j,i=W),h?b?e:d:b?v:f}function V(a,b){return function(c){var d=bg.event;bg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{bg.event=d}}}function W(a,b){var c=V(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function X(c){var d=".dragsuppress-"+ ++Bg,e="click"+d,f=bg.select(b(c)).on("touchmove"+d,y).on("dragstart"+d,y).on("selectstart"+d,y);if(null==Ag&&(Ag="onselectstart"in c?!1:u(c.style,"userSelect")),Ag){var g=a(c).style,h=g[Ag];g[Ag]="none"}return function(a){if(f.on(d,null),Ag&&(g[Ag]=h),a){var b=function(){f.on(e,null)};f.on(e,function(){y(),b()},!0),setTimeout(b,0)}}}function Y(a,c){c.changedTouches&&(c=c.changedTouches[0]);var d=a.ownerSVGElement||a;if(d.createSVGPoint){var e=d.createSVGPoint();if(0>Cg){var f=b(a);if(f.scrollX||f.scrollY){d=bg.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var g=d[0][0].getScreenCTM();Cg=!(g.f||g.e),d.remove()}}return Cg?(e.x=c.pageX,e.y=c.pageY):(e.x=c.clientX,e.y=c.clientY),e=e.matrixTransform(a.getScreenCTM().inverse()),[e.x,e.y]}var h=a.getBoundingClientRect();return[c.clientX-h.left-a.clientLeft,c.clientY-h.top-a.clientTop]}function Z(){return bg.event.changedTouches[0].identifier}function $(a){return a>0?1:0>a?-1:0}function _(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function aa(a){return a>1?0:-1>a?Fg:Math.acos(a)}function ba(a){return a>1?Ig:-1>a?-Ig:Math.asin(a)}function ca(a){return((a=Math.exp(a))-1/a)/2}function da(a){return((a=Math.exp(a))+1/a)/2}function ea(a){return((a=Math.exp(2*a))-1)/(a+1)}function fa(a){return(a=Math.sin(a/2))*a}function ga(){}function ha(a,b,c){return this instanceof ha?(this.h=+a,this.s=+b,void(this.l=+c)):arguments.length<2?a instanceof ha?new ha(a.h,a.s,a.l):va(""+a,wa,ha):new ha(a,b,c)}function ia(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a=isNaN(a)?0:(a%=360)<0?a+360:a,b=isNaN(b)?0:0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,new ra(e(a+120),e(a),e(a-120))}function ja(a,b,c){return this instanceof ja?(this.h=+a,this.c=+b,void(this.l=+c)):arguments.length<2?a instanceof ja?new ja(a.h,a.c,a.l):a instanceof la?na(a.l,a.a,a.b):na((a=xa((a=bg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new ja(a,b,c)}function ka(a,b,c){return isNaN(a)&&(a=0),isNaN(b)&&(b=0),new la(c,Math.cos(a*=Jg)*b,Math.sin(a)*b)}function la(a,b,c){return this instanceof la?(this.l=+a,this.a=+b,void(this.b=+c)):arguments.length<2?a instanceof la?new la(a.l,a.a,a.b):a instanceof ja?ka(a.h,a.c,a.l):xa((a=ra(a)).r,a.g,a.b):new la(a,b,c)}function ma(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=oa(e)*Ug,d=oa(d)*Vg,f=oa(f)*Wg,new ra(qa(3.2404542*e-1.5371385*d-.4985314*f),qa(-.969266*e+1.8760108*d+.041556*f),qa(.0556434*e-.2040259*d+1.0572252*f))}function na(a,b,c){return a>0?new ja(Math.atan2(c,b)*Kg,Math.sqrt(b*b+c*c),a):new ja(NaN,NaN,a)}function oa(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function pa(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function qa(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function ra(a,b,c){return this instanceof ra?(this.r=~~a,this.g=~~b,void(this.b=~~c)):arguments.length<2?a instanceof ra?new ra(a.r,a.g,a.b):va(""+a,ra,ia):new ra(a,b,c)}function sa(a){return new ra(a>>16,a>>8&255,255&a)}function ta(a){return sa(a)+""}function ua(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function va(a,b,c){a=a.toLowerCase();var d,e,f,g=0,h=0,i=0;if(d=/([a-z]+)\((.*)\)/.exec(a))switch(e=d[2].split(","),d[1]){case"hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return b(za(e[0]),za(e[1]),za(e[2]))}return(f=Zg.get(a))?b(f.r,f.g,f.b):(null==a||"#"!==a.charAt(0)||isNaN(f=parseInt(a.slice(1),16))||(4===a.length?(g=(3840&f)>>4,g=g>>4|g,h=240&f,h=h>>4|h,i=15&f,i=i<<4|i):7===a.length&&(g=(16711680&f)>>16,h=(65280&f)>>8,i=255&f)),b(g,h,i))}function wa(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):(d=NaN,e=i>0&&1>i?0:d),new ha(d,e,i)}function xa(a,b,c){a=ya(a),b=ya(b),c=ya(c);var d=pa((.4124564*a+.3575761*b+.1804375*c)/Ug),e=pa((.2126729*a+.7151522*b+.072175*c)/Vg),f=pa((.0193339*a+.119192*b+.9503041*c)/Wg);return la(116*e-16,500*(d-e),200*(e-f))}function ya(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function za(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function Aa(a){return"function"==typeof a?a:function(){return a}}function Ba(a){return function(b,c,d){return 2===arguments.length&&"function"==typeof c&&(d=c,c=null),Ca(b,c,a,d)}}function Ca(a,b,c,d){function e(){var a,b=i.status;if(!b&&Ea(i)||b>=200&&300>b||304===b){try{a=c.call(f,i)}catch(d){return void g.error.call(f,d)}g.load.call(f,a)}else g.error.call(f,i)}var f={},g=bg.dispatch("beforesend","progress","load","error"),h={},i=new XMLHttpRequest,j=null;return!this.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(a)||(i=new XDomainRequest),"onload"in i?i.onload=i.onerror=e:i.onreadystatechange=function(){i.readyState>3&&e()},i.onprogress=function(a){var b=bg.event;bg.event=a;try{g.progress.call(f,i)}finally{bg.event=b}},f.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(null==b?delete h[a]:h[a]=b+"",f)},f.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",f):b},f.responseType=function(a){return arguments.length?(j=a,f):j},f.response=function(a){return c=a,f},["get","post"].forEach(function(a){f[a]=function(){return f.send.apply(f,[a].concat(dg(arguments)))}}),f.send=function(c,d,e){if(2===arguments.length&&"function"==typeof d&&(e=d,d=null),i.open(c,a,!0),null==b||"accept"in h||(h.accept=b+",*/*"),i.setRequestHeader)for(var k in h)i.setRequestHeader(k,h[k]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=j&&(i.responseType=j),null!=e&&f.on("error",e).on("load",function(a){e(null,a)}),g.beforesend.call(f,i),i.send(null==d?null:d),f},f.abort=function(){return i.abort(),f},bg.rebind(f,g,"on"),null==d?f:f.get(Da(d))}function Da(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function Ea(a){var b=a.responseType;return b&&"text"!==b?a.response:a.responseText}function Fa(){var a=Ga(),b=Ha()-a;b>24?(isFinite(b)&&(clearTimeout(bh),bh=setTimeout(Fa,b)),ah=0):(ah=1,dh(Fa))}function Ga(){var a=Date.now();for(ch=$g;ch;)a>=ch.t&&(ch.f=ch.c(a-ch.t)),ch=ch.n;return a}function Ha(){for(var a,b=$g,c=1/0;b;)b.f?b=a?a.n=b.n:$g=b.n:(b.t<c&&(c=b.t),b=(a=b).n);return _g=a,c}function Ia(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function Ja(a,b){var c=Math.pow(10,3*ng(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function Ka(a){var b=a.decimal,c=a.thousands,d=a.grouping,e=a.currency,f=d&&c?function(a,b){for(var e=a.length,f=[],g=0,h=d[0],i=0;e>0&&h>0&&(i+h+1>b&&(h=Math.max(1,b-i)),f.push(a.substring(e-=h,e+h)),!((i+=h+1)>b));)h=d[g=(g+1)%d.length];return f.reverse().join(c)}:s;return function(a){var c=fh.exec(a),d=c[1]||" ",g=c[2]||">",h=c[3]||"-",i=c[4]||"",j=c[5],k=+c[6],l=c[7],m=c[8],n=c[9],o=1,p="",q="",r=!1,s=!0;switch(m&&(m=+m.substring(1)),(j||"0"===d&&"="===g)&&(j=d="0",g="="),n){case"n":l=!0,n="g";break;case"%":o=100,q="%",n="f";break;case"p":o=100,q="%",n="r";break;case"b":case"o":case"x":case"X":"#"===i&&(p="0"+n.toLowerCase());case"c":s=!1;case"d":r=!0,m=0;break;case"s":o=-1,n="r"}"$"===i&&(p=e[0],q=e[1]),"r"!=n||m||(n="g"),null!=m&&("g"==n?m=Math.max(1,Math.min(21,m)):"e"!=n&&"f"!=n||(m=Math.max(0,Math.min(20,m)))),n=gh.get(n)||La;var t=j&&l;return function(a){var c=q;if(r&&a%1)return"";var e=0>a||0===a&&0>1/a?(a=-a,"-"):"-"===h?"":h;if(0>o){var i=bg.formatPrefix(a,m);a=i.scale(a),c=i.symbol+q}else a*=o;a=n(a,m);var u,v,w=a.lastIndexOf(".");if(0>w){var x=s?a.lastIndexOf("e"):-1;0>x?(u=a,v=""):(u=a.substring(0,x),v=a.substring(x))}else u=a.substring(0,w),v=b+a.substring(w+1);!j&&l&&(u=f(u,1/0));var y=p.length+u.length+v.length+(t?0:e.length),z=k>y?new Array(y=k-y+1).join(d):"";return t&&(u=f(z+u,z.length?k-v.length:1/0)),e+=p,a=u+v,("<"===g?e+a+z:">"===g?z+e+a:"^"===g?z.substring(0,y>>=1)+e+a+z.substring(y):e+(t?a:z+a))+c}}}function La(a){return a+""}function Ma(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Na(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new ih(c-1)),1),c}function f(a,c){return b(a=new ih(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{ih=Ma;var d=new Ma;return d._=a,g(d,b,c)}finally{ih=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=Oa(a);return i.floor=i,i.round=Oa(d),i.ceil=Oa(e),i.offset=Oa(f),i.range=h,a}function Oa(a){return function(b,c){try{ih=Ma;var d=new Ma;return d._=b,a(d,c)._}finally{ih=Date}}}function Pa(a){function b(a){function b(b){for(var c,e,f,g=[],h=-1,i=0;++h<d;)37===a.charCodeAt(h)&&(g.push(a.slice(i,h)),null!=(e=kh[c=a.charAt(++h)])&&(c=a.charAt(++h)),(f=C[c])&&(c=f(b,null==e?"e"===c?" ":"0":e)),g.push(c),i=h+1);return g.push(a.slice(i,h)),g.join("")}var d=a.length;return b.parse=function(b){var d={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},e=c(d,a,b,0);if(e!=b.length)return null;"p"in d&&(d.H=d.H%12+12*d.p);var f=null!=d.Z&&ih!==Ma,g=new(f?Ma:ih);return"j"in d?g.setFullYear(d.y,0,d.j):"w"in d&&("W"in d||"U"in d)?(g.setFullYear(d.y,0,1),g.setFullYear(d.y,0,"W"in d?(d.w+6)%7+7*d.W-(g.getDay()+5)%7:d.w+7*d.U-(g.getDay()+6)%7)):g.setFullYear(d.y,d.m,d.d),g.setHours(d.H+(d.Z/100|0),d.M+d.Z%100,d.S,d.L),f?g._:g},b.toString=function(){return a},b}function c(a,b,c,d){for(var e,f,g,h=0,i=b.length,j=c.length;i>h;){if(d>=j)return-1;if(e=b.charCodeAt(h++),37===e){if(g=b.charAt(h++),f=D[g in kh?b.charAt(h++):g],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function d(a,b,c){w.lastIndex=0;var d=w.exec(b.slice(c));return d?(a.w=x.get(d[0].toLowerCase()),c+d[0].length):-1}function e(a,b,c){u.lastIndex=0;var d=u.exec(b.slice(c));return d?(a.w=v.get(d[0].toLowerCase()),c+d[0].length):-1}function f(a,b,c){A.lastIndex=0;var d=A.exec(b.slice(c));return d?(a.m=B.get(d[0].toLowerCase()),c+d[0].length):-1}function g(a,b,c){y.lastIndex=0;var d=y.exec(b.slice(c));return d?(a.m=z.get(d[0].toLowerCase()),c+d[0].length):-1}function h(a,b,d){return c(a,C.c.toString(),b,d)}function i(a,b,d){return c(a,C.x.toString(),b,d)}function j(a,b,d){return c(a,C.X.toString(),b,d)}function k(a,b,c){var d=t.get(b.slice(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}var l=a.dateTime,m=a.date,n=a.time,o=a.periods,p=a.days,q=a.shortDays,r=a.months,s=a.shortMonths;b.utc=function(a){function c(a){try{ih=Ma;var b=new ih;return b._=a,d(b)}finally{ih=Date}}var d=b(a);return c.parse=function(a){try{ih=Ma;var b=d.parse(a);return b&&b._}finally{ih=Date}},c.toString=d.toString,c},b.multi=b.utc.multi=hb;var t=bg.map(),u=Ra(p),v=Sa(p),w=Ra(q),x=Sa(q),y=Ra(r),z=Sa(r),A=Ra(s),B=Sa(s);o.forEach(function(a,b){t.set(a.toLowerCase(),b)});var C={a:function(a){return q[a.getDay()]},A:function(a){return p[a.getDay()]},b:function(a){return s[a.getMonth()]},B:function(a){return r[a.getMonth()]},c:b(l),d:function(a,b){return Qa(a.getDate(),b,2)},e:function(a,b){return Qa(a.getDate(),b,2)},H:function(a,b){return Qa(a.getHours(),b,2)},I:function(a,b){return Qa(a.getHours()%12||12,b,2)},j:function(a,b){return Qa(1+hh.dayOfYear(a),b,3)},L:function(a,b){return Qa(a.getMilliseconds(),b,3)},m:function(a,b){return Qa(a.getMonth()+1,b,2)},M:function(a,b){return Qa(a.getMinutes(),b,2)},p:function(a){return o[+(a.getHours()>=12)]},S:function(a,b){return Qa(a.getSeconds(),b,2)},U:function(a,b){return Qa(hh.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return Qa(hh.mondayOfYear(a),b,2)},x:b(m),X:b(n),y:function(a,b){return Qa(a.getFullYear()%100,b,2)},Y:function(a,b){return Qa(a.getFullYear()%1e4,b,4)},Z:fb,"%":function(){return"%"}},D={a:d,A:e,b:f,B:g,c:h,d:_a,e:_a,H:bb,I:bb,j:ab,L:eb,m:$a,M:cb,p:k,S:db,U:Ua,w:Ta,W:Va,x:i,X:j,y:Xa,Y:Wa,Z:Ya,"%":gb};return b}function Qa(a,b,c){var d=0>a?"-":"",e=(d?-a:a)+"",f=e.length;return d+(c>f?new Array(c-f+1).join(b)+e:e)}function Ra(a){return new RegExp("^(?:"+a.map(bg.requote).join("|")+")","i")}function Sa(a){for(var b=new j,c=-1,d=a.length;++c<d;)b.set(a[c].toLowerCase(),c);return b}function Ta(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+1));return d?(a.w=+d[0],c+d[0].length):-1}function Ua(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c));return d?(a.U=+d[0],c+d[0].length):-1}function Va(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c));return d?(a.W=+d[0],c+d[0].length):-1}function Wa(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+4));return d?(a.y=+d[0],c+d[0].length):-1}function Xa(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.y=Za(+d[0]),c+d[0].length):-1}function Ya(a,b,c){return/^[+-]\d{4}$/.test(b=b.slice(c,c+5))?(a.Z=-b,c+5):-1}function Za(a){return a+(a>68?1900:2e3)}function $a(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function _a(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function ab(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+3));return d?(a.j=+d[0],c+d[0].length):-1}function bb(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function cb(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function db(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function eb(a,b,c){lh.lastIndex=0;var d=lh.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function fb(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=ng(b)/60|0,e=ng(b)%60;return c+Qa(d,"0",2)+Qa(e,"0",2)}function gb(a,b,c){mh.lastIndex=0;var d=mh.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function hb(a){for(var b=a.length,c=-1;++c<b;)a[c][0]=this(a[c][0]);return function(b){for(var c=0,d=a[c];!d[1](b);)d=a[++c];return d[0](b)}}function ib(){}function jb(a,b,c){var d=c.s=a+b,e=d-a,f=d-e;c.t=a-f+(b-e)}function kb(a,b){a&&qh.hasOwnProperty(a.type)&&qh[a.type](a,b)}function lb(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++e<f;)d=a[e],b.point(d[0],d[1],d[2]);b.lineEnd()}function mb(a,b){var c=-1,d=a.length;for(b.polygonStart();++c<d;)lb(a[c],b,1);b.polygonEnd()}function nb(){function a(a,b){a*=Jg,b=b*Jg/2+Fg/4;var c=a-d,g=c>=0?1:-1,h=g*c,i=Math.cos(b),j=Math.sin(b),k=f*j,l=e*i+k*Math.cos(h),m=k*g*Math.sin(h);sh.add(Math.atan2(m,l)),d=a,e=i,f=j}var b,c,d,e,f;th.point=function(g,h){th.point=a,d=(b=g)*Jg,e=Math.cos(h=(c=h)*Jg/2+Fg/4),f=Math.sin(h)},th.lineEnd=function(){a(b,c)}}function ob(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function pb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function qb(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function rb(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function sb(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function tb(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function ub(a){return[Math.atan2(a[1],a[0]),ba(a[2])]}function vb(a,b){return ng(a[0]-b[0])<Dg&&ng(a[1]-b[1])<Dg}function wb(a,b){a*=Jg;var c=Math.cos(b*=Jg);xb(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function xb(a,b,c){++uh,wh+=(a-wh)/uh,xh+=(b-xh)/uh,yh+=(c-yh)/uh}function yb(){function a(a,e){a*=Jg;var f=Math.cos(e*=Jg),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);vh+=j,zh+=j*(b+(b=g)),Ah+=j*(c+(c=h)),Bh+=j*(d+(d=i)),xb(b,c,d)}var b,c,d;Fh.point=function(e,f){e*=Jg;var g=Math.cos(f*=Jg);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),Fh.point=a,xb(b,c,d)}}function zb(){Fh.point=wb}function Ab(){function a(a,b){a*=Jg;var c=Math.cos(b*=Jg),g=c*Math.cos(a),h=c*Math.sin(a),i=Math.sin(b),j=e*i-f*h,k=f*g-d*i,l=d*h-e*g,m=Math.sqrt(j*j+k*k+l*l),n=d*g+e*h+f*i,o=m&&-aa(n)/m,p=Math.atan2(m,n);Ch+=o*j,Dh+=o*k,Eh+=o*l,vh+=p,zh+=p*(d+(d=g)),Ah+=p*(e+(e=h)),Bh+=p*(f+(f=i)),xb(d,e,f)}var b,c,d,e,f;Fh.point=function(g,h){b=g,c=h,Fh.point=a,g*=Jg;var i=Math.cos(h*=Jg);d=i*Math.cos(g),e=i*Math.sin(g),f=Math.sin(h),xb(d,e,f)},Fh.lineEnd=function(){a(b,c),Fh.lineEnd=zb,Fh.point=wb}}function Bb(a,b){function c(c,d){return c=a(c,d),b(c[0],c[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=b.invert(c,d),c&&a.invert(c[0],c[1])}),c}function Cb(){return!0}function Db(a,b,c,d,e){var f=[],g=[];if(a.forEach(function(a){if(!((b=a.length-1)<=0)){var b,c=a[0],d=a[b];if(vb(c,d)){e.lineStart();for(var h=0;b>h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i=new Fb(c,a,null,!0),j=new Fb(c,null,i,!1);i.o=j,f.push(i),g.push(j),i=new Fb(d,a,null,!1),j=new Fb(d,null,i,!0),i.o=j,f.push(i),g.push(j)}}),g.sort(b),Eb(f),Eb(g),f.length){for(var h=0,i=c,j=g.length;j>h;++h)g[h].e=i=!i;for(var k,l,m=f[0];;){for(var n=m,o=!0;n.v;)if((n=n.n)===m)return;k=n.z,e.lineStart();do{if(n.v=n.o.v=!0,n.e){if(o)for(var h=0,j=k.length;j>h;++h)e.point((l=k[h])[0],l[1]);else d(n.x,n.n.x,1,e);n=n.n}else{if(o){k=n.p.z;for(var h=k.length-1;h>=0;--h)e.point((l=k[h])[0],l[1])}else d(n.x,n.p.x,-1,e);n=n.p}n=n.o,k=n.z,o=!o}while(!n.v);e.lineEnd()}}}function Eb(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d<b;)e.n=c=a[d],c.p=e,e=c;e.n=c=a[0],c.p=e}}function Fb(a,b,c,d){this.x=a,this.z=b,this.o=c,this.e=d,this.v=!1,this.n=this.p=null}function Gb(a,b,c,d){return function(e,f){function g(b,c){var d=e(b,c);a(b=d[0],c=d[1])&&f.point(b,c)}function h(a,b){var c=e(a,b);q.point(c[0],c[1])}function i(){s.point=h,q.lineStart()}function j(){s.point=g,q.lineEnd()}function k(a,b){p.push([a,b]);var c=e(a,b);u.point(c[0],c[1])}function l(){u.lineStart(),p=[]}function m(){k(p[0][0],p[0][1]),u.lineEnd();var a,b=u.clean(),c=t.buffer(),d=c.length;if(p.pop(),o.push(p),p=null,d)if(1&b){a=c[0];var e,d=a.length-1,g=-1;if(d>0){for(v||(f.polygonStart(),v=!0),f.lineStart();++g<d;)f.point((e=a[g])[0],e[1]);f.lineEnd()}}else d>1&&2&b&&c.push(c.pop().concat(c.shift())),n.push(c.filter(Hb))}var n,o,p,q=b(f),r=e.invert(d[0],d[1]),s={point:g,lineStart:i,lineEnd:j,polygonStart:function(){s.point=k,s.lineStart=l,s.lineEnd=m,n=[],o=[]},polygonEnd:function(){s.point=g,s.lineStart=i,s.lineEnd=j,n=bg.merge(n);var a=Nb(r,o);n.length?(v||(f.polygonStart(),v=!0),Db(n,Jb,a,c,f)):a&&(v||(f.polygonStart(),v=!0),f.lineStart(),c(null,null,1,f),f.lineEnd()),v&&(f.polygonEnd(),v=!1),n=o=null},sphere:function(){f.polygonStart(),f.lineStart(),c(null,null,1,f),f.lineEnd(),f.polygonEnd()}},t=Ib(),u=b(t),v=!1;return s}}function Hb(a){return a.length>1}function Ib(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){a.push([b,c])},lineEnd:v,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function Jb(a,b){return((a=a.x)[0]<0?a[1]-Ig-Dg:Ig-a[1])-((b=b.x)[0]<0?b[1]-Ig-Dg:Ig-b[1])}function Kb(a){var b,c=NaN,d=NaN,e=NaN;return{lineStart:function(){a.lineStart(),b=1},point:function(f,g){var h=f>0?Fg:-Fg,i=ng(f-c);ng(i-Fg)<Dg?(a.point(c,d=(d+g)/2>0?Ig:-Ig),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Fg&&(ng(c-e)<Dg&&(c-=e*Dg),ng(f-h)<Dg&&(f-=h*Dg),d=Lb(c,d,f,g),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),b=0),a.point(c=f,d=g),e=h},lineEnd:function(){a.lineEnd(),c=d=NaN},clean:function(){return 2-b}}}function Lb(a,b,c,d){var e,f,g=Math.sin(a-c);return ng(g)>Dg?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function Mb(a,b,c,d){var e;if(null==a)e=c*Ig,d.point(-Fg,e),d.point(0,e),d.point(Fg,e),d.point(Fg,0),d.point(Fg,-e),d.point(0,-e),d.point(-Fg,-e),d.point(-Fg,0),d.point(-Fg,e);else if(ng(a[0]-b[0])>Dg){var f=a[0]<b[0]?Fg:-Fg;e=c*f/2,d.point(-f,e),d.point(0,e),d.point(f,e)}else d.point(b[0],b[1])}function Nb(a,b){var c=a[0],d=a[1],e=[Math.sin(c),-Math.cos(c),0],f=0,g=0;sh.reset();for(var h=0,i=b.length;i>h;++h){var j=b[h],k=j.length;if(k)for(var l=j[0],m=l[0],n=l[1]/2+Fg/4,o=Math.sin(n),p=Math.cos(n),q=1;;){q===k&&(q=0),a=j[q];var r=a[0],s=a[1]/2+Fg/4,t=Math.sin(s),u=Math.cos(s),v=r-m,w=v>=0?1:-1,x=w*v,y=x>Fg,z=o*t;if(sh.add(Math.atan2(z*w*Math.sin(x),p*u+z*Math.cos(x))),f+=y?v+w*Gg:v,y^m>=c^r>=c){var A=qb(ob(l),ob(a));tb(A);var B=qb(e,A);tb(B);var C=(y^v>=0?-1:1)*ba(B[2]);(d>C||d===C&&(A[0]||A[1]))&&(g+=y^v>=0?1:-1)}if(!q++)break;m=r,o=t,p=u,l=a}}return(-Dg>f||Dg>f&&0>sh)^1&g}function Ob(a){function b(a,b){return Math.cos(a)*Math.cos(b)>f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Fg:-Fg),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(vb(c,n)||vb(o,n))&&(o[0]+=Dg,o[1]+=Dg,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&vb(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=ob(a),e=ob(b),g=[1,0,0],h=qb(d,e),i=pb(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=qb(g,h),o=sb(g,l),p=sb(h,m);rb(o,p);var q=n,r=pb(o,q),s=pb(q,q),t=r*r-s*(pb(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=sb(q,(-r-u)/s);if(rb(v,o),v=ub(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=ng(B-Fg)<Dg,D=C||Dg>B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(ng(v[0]-x)<Dg?z:A):z<=v[1]&&v[1]<=A:B>Fg^(x<=v[0]&&v[0]<=y)){var E=sb(q,(-r+u)/s);return rb(E,o),[v,ub(E)]}}}function e(b,c){var d=g?a:Fg-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=ng(f)>Dg,i=nc(a,6*Jg);return Gb(b,c,i,g?[0,-a]:[-Fg,a-Fg])}function Pb(a,b,c,d){return function(e){var f,g=e.a,h=e.b,i=g.x,j=g.y,k=h.x,l=h.y,m=0,n=1,o=k-i,p=l-j;if(f=a-i,o||!(f>0)){if(f/=o,0>o){if(m>f)return;n>f&&(n=f)}else if(o>0){ 14 if(f>n)return;f>m&&(m=f)}if(f=c-i,o||!(0>f)){if(f/=o,0>o){if(f>n)return;f>m&&(m=f)}else if(o>0){if(m>f)return;n>f&&(n=f)}if(f=b-j,p||!(f>0)){if(f/=p,0>p){if(m>f)return;n>f&&(n=f)}else if(p>0){if(f>n)return;f>m&&(m=f)}if(f=d-j,p||!(0>f)){if(f/=p,0>p){if(f>n)return;f>m&&(m=f)}else if(p>0){if(m>f)return;n>f&&(n=f)}return m>0&&(e.a={x:i+m*o,y:j+m*p}),1>n&&(e.b={x:i+n*o,y:j+n*p}),e}}}}}}function Qb(a,b,c,d){function e(d,e){return ng(d[0]-a)<Dg?e>0?0:3:ng(d[0]-c)<Dg?e>0?2:1:ng(d[1]-b)<Dg?e>0?1:0:e>0?3:2}function f(a,b){return g(a.x,b.x)}function g(a,b){var c=e(a,1),d=e(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}return function(h){function i(a){for(var b=0,c=q.length,d=a[1],e=0;c>e;++e)for(var f,g=1,h=q[e],i=h.length,j=h[0];i>g;++g)f=h[g],j[1]<=d?f[1]>d&&_(j,f,a)>0&&++b:f[1]<=d&&_(j,f,a)<0&&--b,j=f;return 0!==b}function j(f,h,i,j){var k=0,l=0;if(null==f||(k=e(f,i))!==(l=e(h,i))||g(f,h)<0^i>0){do j.point(0===k||3===k?a:c,k>1?d:b);while((k=(k+i+4)%4)!==l)}else j.point(h[0],h[1])}function k(e,f){return e>=a&&c>=e&&f>=b&&d>=f}function l(a,b){k(a,b)&&h.point(a,b)}function m(){D.point=o,q&&q.push(r=[]),y=!0,x=!1,v=w=NaN}function n(){p&&(o(s,t),u&&x&&B.rejoin(),p.push(B.buffer())),D.point=l,x&&h.lineEnd()}function o(a,b){a=Math.max(-Hh,Math.min(Hh,a)),b=Math.max(-Hh,Math.min(Hh,b));var c=k(a,b);if(q&&r.push([a,b]),y)s=a,t=b,u=c,y=!1,c&&(h.lineStart(),h.point(a,b));else if(c&&x)h.point(a,b);else{var d={a:{x:v,y:w},b:{x:a,y:b}};C(d)?(x||(h.lineStart(),h.point(d.a.x,d.a.y)),h.point(d.b.x,d.b.y),c||h.lineEnd(),z=!1):c&&(h.lineStart(),h.point(a,b),z=!1)}v=a,w=b,x=c}var p,q,r,s,t,u,v,w,x,y,z,A=h,B=Ib(),C=Pb(a,b,c,d),D={point:l,lineStart:m,lineEnd:n,polygonStart:function(){h=B,p=[],q=[],z=!0},polygonEnd:function(){h=A,p=bg.merge(p);var b=i([a,d]),c=z&&b,e=p.length;(c||e)&&(h.polygonStart(),c&&(h.lineStart(),j(null,null,1,h),h.lineEnd()),e&&Db(p,f,b,j,h),h.polygonEnd()),p=q=r=null}};return D}}function Rb(a){var b=0,c=Fg/3,d=fc(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Fg/180,c=a[1]*Fg/180):[b/Fg*180,c/Fg*180]},e}function Sb(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,ba((f-(a*a+c*c)*e*e)/(2*e))]},c}function Tb(){function a(a,b){Jh+=e*a-d*b,d=a,e=b}var b,c,d,e;Oh.point=function(f,g){Oh.point=a,b=d=f,c=e=g},Oh.lineEnd=function(){a(b,c)}}function Ub(a,b){Kh>a&&(Kh=a),a>Mh&&(Mh=a),Lh>b&&(Lh=b),b>Nh&&(Nh=b)}function Vb(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Wb(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d,h.point=a},pointRadius:function(a){return f=Wb(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function Wb(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function Xb(a,b){wh+=a,xh+=b,++yh}function Yb(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);zh+=g*(b+a)/2,Ah+=g*(c+d)/2,Bh+=g,Xb(b=a,c=d)}var b,c;Qh.point=function(d,e){Qh.point=a,Xb(b=d,c=e)}}function Zb(){Qh.point=Xb}function $b(){function a(a,b){var c=a-d,f=b-e,g=Math.sqrt(c*c+f*f);zh+=g*(d+a)/2,Ah+=g*(e+b)/2,Bh+=g,g=e*a-d*b,Ch+=g*(d+a),Dh+=g*(e+b),Eh+=3*g,Xb(d=a,e=b)}var b,c,d,e;Qh.point=function(f,g){Qh.point=a,Xb(b=d=f,c=e=g)},Qh.lineEnd=function(){a(b,c)}}function _b(a){function b(b,c){a.moveTo(b+g,c),a.arc(b,c,g,0,Gg)}function c(b,c){a.moveTo(b,c),h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e,h.point=b},pointRadius:function(a){return g=a,h},result:v};return h}function ac(a){function b(a){return(h?d:c)(a)}function c(b){return dc(b,function(c,d){c=a(c,d),b.point(c[0],c[1])})}function d(b){function c(c,d){c=a(c,d),b.point(c[0],c[1])}function d(){t=NaN,y.point=f,b.lineStart()}function f(c,d){var f=ob([c,d]),g=a(c,d);e(t,u,s,v,w,x,t=g[0],u=g[1],s=c,v=f[0],w=f[1],x=f[2],h,b),b.point(t,u)}function g(){y.point=c,b.lineEnd()}function i(){d(),y.point=j,y.lineEnd=k}function j(a,b){f(l=a,m=b),n=t,o=u,p=v,q=w,r=x,y.point=f}function k(){e(t,u,s,v,w,x,n,o,l,p,q,r,h,b),y.lineEnd=g,g()}var l,m,n,o,p,q,r,s,t,u,v,w,x,y={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart(),y.lineStart=i},polygonEnd:function(){b.polygonEnd(),y.lineStart=d}};return y}function e(b,c,d,h,i,j,k,l,m,n,o,p,q,r){var s=k-b,t=l-c,u=s*s+t*t;if(u>4*f&&q--){var v=h+n,w=i+o,x=j+p,y=Math.sqrt(v*v+w*w+x*x),z=Math.asin(x/=y),A=ng(ng(x)-1)<Dg||ng(d-m)<Dg?(d+m)/2:Math.atan2(w,v),B=a(A,z),C=B[0],D=B[1],E=C-b,F=D-c,G=t*E-s*F;(G*G/u>f||ng((s*E+t*F)/u-.5)>.3||g>h*n+i*o+j*p)&&(e(b,c,d,h,i,j,C,D,A,v/=y,w/=y,x,q,r),r.point(C,D),e(C,D,A,v,w,x,k,l,m,n,o,p,q,r))}}var f=.5,g=Math.cos(30*Jg),h=16;return b.precision=function(a){return arguments.length?(h=(f=a*a)>0&&16,b):Math.sqrt(f)},b}function bc(a){var b=ac(function(b,c){return a([b*Kg,c*Kg])});return function(a){return gc(b(a))}}function cc(a){this.stream=a}function dc(a,b){return{point:b,sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}function ec(a){return fc(function(){return a})()}function fc(a){function b(a){return a=h(a[0]*Jg,a[1]*Jg),[a[0]*m+i,j-a[1]*m]}function c(a){return a=h.invert((a[0]-i)/m,(j-a[1])/m),a&&[a[0]*Kg,a[1]*Kg]}function d(){h=Bb(g=jc(r,t,u),f);var a=f(p,q);return i=n-a[0]*m,j=o+a[1]*m,e()}function e(){return k&&(k.valid=!1,k=null),b}var f,g,h,i,j,k,l=ac(function(a,b){return a=f(a,b),[a[0]*m+i,j-a[1]*m]}),m=150,n=480,o=250,p=0,q=0,r=0,t=0,u=0,v=Gh,w=s,x=null,y=null;return b.stream=function(a){return k&&(k.valid=!1),k=gc(v(g,l(w(a)))),k.valid=!0,k},b.clipAngle=function(a){return arguments.length?(v=null==a?(x=a,Gh):Ob((x=+a)*Jg),e()):x},b.clipExtent=function(a){return arguments.length?(y=a,w=a?Qb(a[0][0],a[0][1],a[1][0],a[1][1]):s,e()):y},b.scale=function(a){return arguments.length?(m=+a,d()):m},b.translate=function(a){return arguments.length?(n=+a[0],o=+a[1],d()):[n,o]},b.center=function(a){return arguments.length?(p=a[0]%360*Jg,q=a[1]%360*Jg,d()):[p*Kg,q*Kg]},b.rotate=function(a){return arguments.length?(r=a[0]%360*Jg,t=a[1]%360*Jg,u=a.length>2?a[2]%360*Jg:0,d()):[r*Kg,t*Kg,u*Kg]},bg.rebind(b,l,"precision"),function(){return f=a.apply(this,arguments),b.invert=f.invert&&c,d()}}function gc(a){return dc(a,function(b,c){a.point(b*Jg,c*Jg)})}function hc(a,b){return[a,b]}function ic(a,b){return[a>Fg?a-Gg:-Fg>a?a+Gg:a,b]}function jc(a,b,c){return a?b||c?Bb(lc(a),mc(b,c)):lc(a):b||c?mc(b,c):ic}function kc(a){return function(b,c){return b+=a,[b>Fg?b-Gg:-Fg>b?b+Gg:b,c]}}function lc(a){var b=kc(a);return b.invert=kc(-a),b}function mc(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),ba(k*f+i*g)]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),ba(k*d-h*e)]},c}function nc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var i=g*b;null!=e?(e=oc(c,e),f=oc(c,f),(g>0?f>e:e>f)&&(e+=g*Gg)):(e=a+g*Gg,f=a-.5*i);for(var j,k=e;g>0?k>f:f>k;k-=i)h.point((j=ub([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],j[1])}}function oc(a,b){var c=ob(b);c[0]-=a,tb(c);var d=aa(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Dg)%(2*Math.PI)}function pc(a,b,c){var d=bg.range(a,b-Dg,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function qc(a,b,c){var d=bg.range(a,b-Dg,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function rc(a){return a.source}function sc(a){return a.target}function tc(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(fa(d-b)+e*g*fa(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Kg,Math.atan2(g,Math.sqrt(d*d+e*e))*Kg]}:function(){return[a*Kg,b*Kg]};return o.distance=m,o}function uc(){function a(a,e){var f=Math.sin(e*=Jg),g=Math.cos(e),h=ng((a*=Jg)-b),i=Math.cos(h);Rh+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;Sh.point=function(e,f){b=e*Jg,c=Math.sin(f*=Jg),d=Math.cos(f),Sh.point=a},Sh.lineEnd=function(){Sh.point=Sh.lineEnd=v}}function vc(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function wc(a,b){function c(a,b){g>0?-Ig+Dg>b&&(b=-Ig+Dg):b>Ig-Dg&&(b=Ig-Dg);var c=g/Math.pow(e(b),f);return[c*Math.sin(f*a),g-c*Math.cos(f*a)]}var d=Math.cos(a),e=function(a){return Math.tan(Fg/4+a/2)},f=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(e(b)/e(a)),g=d*Math.pow(e(a),f)/f;return f?(c.invert=function(a,b){var c=g-b,d=$(f)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/f,2*Math.atan(Math.pow(g/d,1/f))-Ig]},c):yc}function xc(a,b){function c(a,b){var c=f-b;return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;return ng(e)<Dg?hc:(c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-$(e)*Math.sqrt(a*a+c*c)]},c)}function yc(a,b){return[a,Math.log(Math.tan(Fg/4+b/2))]}function zc(a){var b,c=ec(a),d=c.scale,e=c.translate,f=c.clipExtent;return c.scale=function(){var a=d.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.translate=function(){var a=e.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.clipExtent=function(a){var g=f.apply(c,arguments);if(g===c){if(b=null==a){var h=Fg*d(),i=e();f([[i[0]-h,i[1]-h],[i[0]+h,i[1]+h]])}}else b&&(g=null);return g},c.clipExtent(null)}function Ac(a,b){return[Math.log(Math.tan(Fg/4+b/2)),-a]}function Bc(a){return a[0]}function Cc(a){return a[1]}function Dc(a){for(var b=a.length,c=[0,1],d=2,e=2;b>e;e++){for(;d>1&&_(a[c[d-2]],a[c[d-1]],a[e])<=0;)--d;c[d++]=e}return c.slice(0,d)}function Ec(a,b){return a[0]-b[0]||a[1]-b[1]}function Fc(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Gc(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function Hc(a){var b=a[0],c=a[a.length-1];return!(b[0]-c[0]||b[1]-c[1])}function Ic(){bd(this),this.edge=this.site=this.circle=null}function Jc(a){var b=ci.pop()||new Ic;return b.site=a,b}function Kc(a){Uc(a),_h.remove(a),ci.push(a),bd(a)}function Lc(a){var b=a.circle,c=b.x,d=b.cy,e={x:c,y:d},f=a.P,g=a.N,h=[a];Kc(a);for(var i=f;i.circle&&ng(c-i.circle.x)<Dg&&ng(d-i.circle.cy)<Dg;)f=i.P,h.unshift(i),Kc(i),i=f;h.unshift(i),Uc(i);for(var j=g;j.circle&&ng(c-j.circle.x)<Dg&&ng(d-j.circle.cy)<Dg;)g=j.N,h.push(j),Kc(j),j=g;h.push(j),Uc(j);var k,l=h.length;for(k=1;l>k;++k)j=h[k],i=h[k-1],$c(j.edge,i.site,j.site,e);i=h[0],j=h[l-1],j.edge=Yc(i.site,j.site,null,e),Tc(i),Tc(j)}function Mc(a){for(var b,c,d,e,f=a.x,g=a.y,h=_h._;h;)if(d=Nc(h,g)-f,d>Dg)h=h.L;else{if(e=f-Oc(h,g),!(e>Dg)){d>-Dg?(b=h.P,c=h):e>-Dg?(b=h,c=h.N):b=c=h;break}if(!h.R){b=h;break}h=h.R}var i=Jc(a);if(_h.insert(b,i),b||c){if(b===c)return Uc(b),c=Jc(b.site),_h.insert(i,c),i.edge=c.edge=Yc(b.site,i.site),Tc(b),void Tc(c);if(!c)return void(i.edge=Yc(b.site,i.site));Uc(b),Uc(c);var j=b.site,k=j.x,l=j.y,m=a.x-k,n=a.y-l,o=c.site,p=o.x-k,q=o.y-l,r=2*(m*q-n*p),s=m*m+n*n,t=p*p+q*q,u={x:(q*s-n*t)/r+k,y:(m*t-p*s)/r+l};$c(c.edge,j,o,u),i.edge=Yc(j,a,null,u),c.edge=Yc(a,o,null,u),Tc(b),Tc(c)}}function Nc(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d;var g=a.P;if(!g)return-(1/0);c=g.site;var h=c.x,i=c.y,j=i-b;if(!j)return h;var k=h-d,l=1/f-1/j,m=k/j;return l?(-m+Math.sqrt(m*m-2*l*(k*k/(-2*j)-i+j/2+e-f/2)))/l+d:(d+h)/2}function Oc(a,b){var c=a.N;if(c)return Nc(c,b);var d=a.site;return d.y===b?d.x:1/0}function Pc(a){this.site=a,this.edges=[]}function Qc(a){for(var b,c,d,e,f,g,h,i,j,k,l=a[0][0],m=a[1][0],n=a[0][1],o=a[1][1],p=$h,q=p.length;q--;)if(f=p[q],f&&f.prepare())for(h=f.edges,i=h.length,g=0;i>g;)k=h[g].end(),d=k.x,e=k.y,j=h[++g%i].start(),b=j.x,c=j.y,(ng(d-b)>Dg||ng(e-c)>Dg)&&(h.splice(g,0,new _c(Zc(f.site,k,ng(d-l)<Dg&&o-e>Dg?{x:l,y:ng(b-l)<Dg?c:o}:ng(e-o)<Dg&&m-d>Dg?{x:ng(c-o)<Dg?b:m,y:o}:ng(d-m)<Dg&&e-n>Dg?{x:m,y:ng(b-m)<Dg?c:n}:ng(e-n)<Dg&&d-l>Dg?{x:ng(c-n)<Dg?b:l,y:n}:null),f.site,null)),++i)}function Rc(a,b){return b.angle-a.angle}function Sc(){bd(this),this.x=this.y=this.arc=this.site=this.cy=null}function Tc(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,e=a.site,f=c.site;if(d!==f){var g=e.x,h=e.y,i=d.x-g,j=d.y-h,k=f.x-g,l=f.y-h,m=2*(i*l-j*k);if(!(m>=-Eg)){var n=i*i+j*j,o=k*k+l*l,p=(l*n-j*o)/m,q=(i*o-k*n)/m,l=q+h,r=di.pop()||new Sc;r.arc=a,r.site=e,r.x=p+g,r.y=l+Math.sqrt(p*p+q*q),r.cy=l,a.circle=r;for(var s=null,t=bi._;t;)if(r.y<t.y||r.y===t.y&&r.x<=t.x){if(!t.L){s=t.P;break}t=t.L}else{if(!t.R){s=t;break}t=t.R}bi.insert(s,r),s||(ai=r)}}}}function Uc(a){var b=a.circle;b&&(b.P||(ai=b.N),bi.remove(b),di.push(b),bd(b),a.circle=null)}function Vc(a){for(var b,c=Zh,d=Pb(a[0][0],a[0][1],a[1][0],a[1][1]),e=c.length;e--;)b=c[e],(!Wc(b,a)||!d(b)||ng(b.a.x-b.b.x)<Dg&&ng(b.a.y-b.b.y)<Dg)&&(b.a=b.b=null,c.splice(e,1))}function Wc(a,b){var c=a.b;if(c)return!0;var d,e,f=a.a,g=b[0][0],h=b[1][0],i=b[0][1],j=b[1][1],k=a.l,l=a.r,m=k.x,n=k.y,o=l.x,p=l.y,q=(m+o)/2,r=(n+p)/2;if(p===n){if(g>q||q>=h)return;if(m>o){if(f){if(f.y>=j)return}else f={x:q,y:i};c={x:q,y:j}}else{if(f){if(f.y<i)return}else f={x:q,y:j};c={x:q,y:i}}}else if(d=(m-o)/(p-n),e=r-d*q,-1>d||d>1)if(m>o){if(f){if(f.y>=j)return}else f={x:(i-e)/d,y:i};c={x:(j-e)/d,y:j}}else{if(f){if(f.y<i)return}else f={x:(j-e)/d,y:j};c={x:(i-e)/d,y:i}}else if(p>n){if(f){if(f.x>=h)return}else f={x:g,y:d*g+e};c={x:h,y:d*h+e}}else{if(f){if(f.x<g)return}else f={x:h,y:d*h+e};c={x:g,y:d*g+e}}return a.a=f,a.b=c,!0}function Xc(a,b){this.l=a,this.r=b,this.a=this.b=null}function Yc(a,b,c,d){var e=new Xc(a,b);return Zh.push(e),c&&$c(e,a,b,c),d&&$c(e,b,a,d),$h[a.i].edges.push(new _c(e,a,b)),$h[b.i].edges.push(new _c(e,b,a)),e}function Zc(a,b,c){var d=new Xc(a,null);return d.a=b,d.b=c,Zh.push(d),d}function $c(a,b,c,d){a.a||a.b?a.l===c?a.b=d:a.a=d:(a.a=d,a.l=b,a.r=c)}function _c(a,b,c){var d=a.a,e=a.b;this.edge=a,this.site=b,this.angle=c?Math.atan2(c.y-b.y,c.x-b.x):a.l===b?Math.atan2(e.x-d.x,d.y-e.y):Math.atan2(d.x-e.x,e.y-d.y)}function ad(){this._=null}function bd(a){a.U=a.C=a.L=a.R=a.P=a.N=null}function cd(a,b){var c=b,d=b.R,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.R=d.L,c.R&&(c.R.U=c),d.L=c}function dd(a,b){var c=b,d=b.L,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.L=d.R,c.L&&(c.L.U=c),d.R=c}function ed(a){for(;a.L;)a=a.L;return a}function fd(a,b){var c,d,e,f=a.sort(gd).pop();for(Zh=[],$h=new Array(a.length),_h=new ad,bi=new ad;;)if(e=ai,f&&(!e||f.y<e.y||f.y===e.y&&f.x<e.x))f.x===c&&f.y===d||($h[f.i]=new Pc(f),Mc(f),c=f.x,d=f.y),f=a.pop();else{if(!e)break;Lc(e.arc)}b&&(Vc(b),Qc(b));var g={cells:$h,edges:Zh};return _h=bi=Zh=$h=null,g}function gd(a,b){return b.y-a.y||b.x-a.x}function hd(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}function id(a){return a.x}function jd(a){return a.y}function kd(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function ld(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&ld(a,i[0],c,d,g,h),i[1]&&ld(a,i[1],g,d,e,h),i[2]&&ld(a,i[2],c,h,g,f),i[3]&&ld(a,i[3],g,h,e,f)}}function md(a,b,c,d,e,f,g){var h,i=1/0;return function j(a,k,l,m,n){if(!(k>f||l>g||d>m||e>n)){if(o=a.point){var o,p=b-a.x,q=c-a.y,r=p*p+q*q;if(i>r){var s=Math.sqrt(i=r);d=b-s,e=c-s,f=b+s,g=c+s,h=o}}for(var t=a.nodes,u=.5*(k+m),v=.5*(l+n),w=b>=u,x=c>=v,y=x<<1|w,z=y+4;z>y;++y)if(a=t[3&y])switch(3&y){case 0:j(a,k,l,u,v);break;case 1:j(a,u,l,m,v);break;case 2:j(a,k,v,u,n);break;case 3:j(a,u,v,m,n)}}}(a,d,e,f,g),h}function nd(a,b){a=bg.rgb(a),b=bg.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+ua(Math.round(c+f*a))+ua(Math.round(d+g*a))+ua(Math.round(e+h*a))}}function od(a,b){var c,d={},e={};for(c in a)c in b?d[c]=rd(a[c],b[c]):e[c]=a[c];for(c in b)c in a||(e[c]=b[c]);return function(a){for(c in d)e[c]=d[c](a);return e}}function pd(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}}function qd(a,b){var c,d,e,f=fi.lastIndex=gi.lastIndex=0,g=-1,h=[],i=[];for(a+="",b+="";(c=fi.exec(a))&&(d=gi.exec(b));)(e=d.index)>f&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:pd(c,d)})),f=gi.lastIndex;return f<b.length&&(e=b.slice(f),h[g]?h[g]+=e:h[++g]=e),h.length<2?i[0]?(b=i[0].x,function(a){return b(a)+""}):function(){return b}:(b=i.length,function(a){for(var c,d=0;b>d;++d)h[(c=i[d]).i]=c.x(a);return h.join("")})}function rd(a,b){for(var c,d=bg.interpolators.length;--d>=0&&!(c=bg.interpolators[d](a,b)););return c}function sd(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(rd(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}}function td(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function ud(a){return function(b){return 1-a(1-b)}}function vd(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function wd(a){return a*a}function xd(a){return a*a*a}function yd(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function zd(a){return function(b){return Math.pow(b,a)}}function Ad(a){return 1-Math.cos(a*Ig)}function Bd(a){return Math.pow(2,10*(a-1))}function Cd(a){return 1-Math.sqrt(1-a*a)}function Dd(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/Gg*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*Gg/b)}}function Ed(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Fd(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Gd(a,b){a=bg.hcl(a),b=bg.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.c:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ka(c+f*a,d+g*a,e+h*a)+""}}function Hd(a,b){a=bg.hsl(a),b=bg.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.s:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ia(c+f*a,d+g*a,e+h*a)+""}}function Id(a,b){a=bg.lab(a),b=bg.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return ma(c+f*a,d+g*a,e+h*a)+""}}function Jd(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function Kd(a){var b=[a.a,a.b],c=[a.c,a.d],d=Md(b),e=Ld(b,c),f=Md(Nd(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*Kg,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*Kg:0}function Ld(a,b){return a[0]*b[0]+a[1]*b[1]}function Md(a){var b=Math.sqrt(Ld(a,a));return b&&(a[0]/=b,a[1]/=b),b}function Nd(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function Od(a,b){var c,d=[],e=[],f=bg.transform(a),g=bg.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(d.push("translate(",null,",",null,")"),e.push({i:1,x:pd(h[0],i[0])},{i:3,x:pd(h[1],i[1])})):i[0]||i[1]?d.push("translate("+i+")"):d.push(""),j!=k?(j-k>180?k+=360:k-j>180&&(j+=360),e.push({i:d.push(d.pop()+"rotate(",null,")")-2,x:pd(j,k)})):k&&d.push(d.pop()+"rotate("+k+")"),l!=m?e.push({i:d.push(d.pop()+"skewX(",null,")")-2,x:pd(l,m)}):m&&d.push(d.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(c=d.push(d.pop()+"scale(",null,",",null,")"),e.push({i:c-4,x:pd(n[0],o[0])},{i:c-2,x:pd(n[1],o[1])})):1==o[0]&&1==o[1]||d.push(d.pop()+"scale("+o+")"),c=e.length,function(a){for(var b,f=-1;++f<c;)d[(b=e[f]).i]=b.x(a);return d.join("")}}function Pd(a,b){return b=(b-=a=+a)||1/b,function(c){return(c-a)/b}}function Qd(a,b){return b=(b-=a=+a)||1/b,function(c){return Math.max(0,Math.min(1,(c-a)/b))}}function Rd(a){for(var b=a.source,c=a.target,d=Td(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function Sd(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function Td(a,b){if(a===b)return a;for(var c=Sd(a),d=Sd(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function Ud(a){a.fixed|=2}function Vd(a){a.fixed&=-7}function Wd(a){a.fixed|=4,a.px=a.x,a.py=a.y}function Xd(a){a.fixed&=-5}function Yd(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++i<h;)f=g[i],null!=f&&(Yd(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function Zd(a,b){return bg.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=de,a}function $d(a,b){for(var c=[a];null!=(a=c.pop());)if(b(a),(e=a.children)&&(d=e.length))for(var d,e;--d>=0;)c.push(e[d])}function _d(a,b){for(var c=[a],d=[];null!=(a=c.pop());)if(d.push(a),(f=a.children)&&(e=f.length))for(var e,f,g=-1;++g<e;)c.push(f[g]);for(;null!=(a=d.pop());)b(a)}function ae(a){return a.children}function be(a){return a.value}function ce(a,b){return b.value-a.value}function de(a){return bg.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function ee(a){return a.x}function fe(a){return a.y}function ge(a,b,c){a.y0=b,a.y=c}function he(a){return bg.range(a.length)}function ie(a){for(var b=-1,c=a[0].length,d=[];++b<c;)d[b]=0;return d}function je(a){for(var b,c=1,d=0,e=a[0][1],f=a.length;f>c;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function ke(a){return a.reduce(le,0)}function le(a,b){return a+b[1]}function me(a,b){return ne(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ne(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function oe(a){return[bg.min(a),bg.max(a)]}function pe(a,b){return a.value-b.value}function qe(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function re(a,b){a._pack_next=b,b._pack_prev=a}function se(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function te(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-(1/0),m=1/0,n=-(1/0);if(c.forEach(ue),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],xe(d,e,f),b(f),qe(d,f),d._pack_prev=f,qe(f,e),e=d._pack_next,g=3;j>g;g++){xe(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(se(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!se(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.r<d.r?re(d,e=h):re(d=i,e),g--):(qe(d,f),e=f,b(f))}var r=(k+l)/2,s=(m+n)/2,t=0;for(g=0;j>g;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(ve)}}function ue(a){a._pack_next=a._pack_prev=a}function ve(a){delete a._pack_next,delete a._pack_prev}function we(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e)for(var f=-1,g=e.length;++f<g;)we(e[f],b,c,d)}function xe(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f;g*=g,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function ye(a,b){return a.parent==b.parent?1:2}function ze(a){var b=a.children;return b.length?b[0]:a.t}function Ae(a){var b,c=a.children;return(b=c.length)?c[b-1]:a.t}function Be(a,b,c){var d=c/(b.i-a.i);b.c-=d,b.s+=c,a.c+=d,b.z+=c,b.m+=c}function Ce(a){for(var b,c=0,d=0,e=a.children,f=e.length;--f>=0;)b=e[f],b.z+=c,b.m+=c,c+=b.s+(d+=b.c)}function De(a,b,c){return a.a.parent===b.parent?a.a:c}function Ee(a){return 1+bg.max(a,function(a){return a.y})}function Fe(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function Ge(a){var b=a.children;return b&&b.length?Ge(b[0]):a}function He(a){var b,c=a.children;return c&&(b=c.length)?He(c[b-1]):a}function Ie(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function Je(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return 0>e&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function Ke(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function Le(a){return a.rangeExtent?a.rangeExtent():Ke(a.range())}function Me(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function Ne(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),a[d]=b.floor(f),a[e]=b.ceil(g),a}function Oe(a){return a?{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}:ri}function Pe(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());++g<=h;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=bg.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function Qe(a,b,c,d){function e(){var e=Math.min(a.length,b.length)>2?Pe:Me,i=d?Qd:Pd;return g=e(a,b,i,c),h=e(b,a,i,rd),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(Jd)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?(c=a,e()):c},f.ticks=function(b){return Ue(a,b)},f.tickFormat=function(b,c){return Ve(a,b,c)},f.nice=function(b){return Se(a,b),e()},f.copy=function(){return Qe(a,b,c,d)},e()}function Re(a,b){return bg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function Se(a,b){return Ne(a,Oe(Te(a,b)[2]))}function Te(a,b){null==b&&(b=10);var c=Ke(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function Ue(a,b){return bg.range.apply(bg,Te(a,b))}function Ve(a,b,c){var d=Te(a,b);if(c){var e=fh.exec(c);if(e.shift(),"s"===e[8]){var f=bg.formatPrefix(Math.max(ng(d[0]),ng(d[1])));return e[7]||(e[7]="."+We(f.scale(d[2]))),e[8]="f",c=bg.format(e.join("")),function(a){return c(f.scale(a))+f.symbol}}e[7]||(e[7]="."+Xe(e[8],d)),c=e.join("")}else c=",."+We(d[2])+"f";return bg.format(c)}function We(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function Xe(a,b){var c=We(b[2]);return a in si?Math.abs(c-We(Math.max(ng(b[0]),ng(b[1]))))+ +("e"!==a):c-2*("%"===a)}function Ye(a,b,c,d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(a>0?0:-a))/Math.log(b)}function f(a){return c?Math.pow(b,a):-Math.pow(b,-a)}function g(b){return a(e(b))}return g.invert=function(b){return f(a.invert(b))},g.domain=function(b){return arguments.length?(c=b[0]>=0,a.domain((d=b.map(Number)).map(e)),g):d},g.base=function(c){return arguments.length?(b=+c,a.domain(d.map(e)),g):b},g.nice=function(){var b=Ne(d.map(e),c?Math:ui);return a.domain(b),d=b.map(f),g},g.ticks=function(){var a=Ke(d),g=[],h=a[0],i=a[1],j=Math.floor(e(h)),k=Math.ceil(e(i)),l=b%1?2:b;if(isFinite(k-j)){if(c){for(;k>j;j++)for(var m=1;l>m;m++)g.push(f(j)*m);g.push(f(j))}else for(g.push(f(j));j++<k;)for(var m=l-1;m>0;m--)g.push(f(j)*m);for(j=0;g[j]<h;j++);for(k=g.length;g[k-1]>i;k--);g=g.slice(j,k)}return g},g.tickFormat=function(a,b){if(!arguments.length)return ti;arguments.length<2?b=ti:"function"!=typeof b&&(b=bg.format(b));var d,h=Math.max(.1,a/g.ticks().length),i=c?(d=1e-12,Math.ceil):(d=-1e-12,Math.floor);return function(a){return a/f(i(e(a)+d))<=h?b(a):""}},g.copy=function(){return Ye(a.copy(),b,c,d)},Re(g,a)}function Ze(a,b,c){function d(b){return a(e(b))}var e=$e(b),f=$e(1/b);return d.invert=function(b){return f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain((c=b.map(Number)).map(e)),d):c},d.ticks=function(a){return Ue(c,a)},d.tickFormat=function(a,b){return Ve(c,a,b)},d.nice=function(a){return d.domain(Se(c,a))},d.exponent=function(g){return arguments.length?(e=$e(b=g),f=$e(1/b),a.domain(c.map(e)),d):b},d.copy=function(){return Ze(a.copy(),b,c)},Re(d,a)}function $e(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function _e(a,b){function c(c){return f[((e.get(c)||("range"===b.t?e.set(c,a.push(c)):NaN))-1)%f.length]}function d(b,c){return bg.range(a.length).map(function(a){return b+c*a})}var e,f,g;return c.domain=function(d){if(!arguments.length)return a;a=[],e=new j;for(var f,g=-1,h=d.length;++g<h;)e.has(f=d[g])||e.set(f,a.push(f));return c[b.t].apply(c,b.a)},c.range=function(a){return arguments.length?(f=a,g=0,b={t:"range",a:arguments},c):f},c.rangePoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=(i+j)/2,0):(j-i)/(a.length-1+h);return f=d(i+k*h/2,k),g=0,b={t:"rangePoints",a:arguments},c},c.rangeRoundPoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=j=Math.round((i+j)/2),0):(j-i)/(a.length-1+h)|0;return f=d(i+Math.round(k*h/2+(j-i-(a.length-1+h)*k)/2),k),g=0,b={t:"rangeRoundPoints",a:arguments},c},c.rangeBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=(l-k)/(a.length-h+2*i);return f=d(k+m*i,m),j&&f.reverse(),g=m*(1-h),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-h+2*i));return f=d(k+Math.round((l-k-(a.length-h)*m)/2),m),j&&f.reverse(),g=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return g},c.rangeExtent=function(){return Ke(b.a[0])},c.copy=function(){return _e(a,b)},c.domain(a)}function af(a,b){function f(){var c=0,d=b.length;for(h=[];++c<d;)h[c-1]=bg.quantile(a,c/d);return g}function g(a){return isNaN(a=+a)?void 0:b[bg.bisect(h,a)]}var h;return g.domain=function(b){return arguments.length?(a=b.map(d).filter(e).sort(c),f()):a},g.range=function(a){return arguments.length?(b=a,f()):b},g.quantiles=function(){return h},g.invertExtent=function(c){return c=b.indexOf(c),0>c?[NaN,NaN]:[c>0?h[c-1]:a[0],c<h.length?h[c]:a[a.length-1]]},g.copy=function(){return af(a,b)},f()}function bf(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.invertExtent=function(b){return b=c.indexOf(b),b=0>b?NaN:b/f+a,[b,b+1/f]},d.copy=function(){return bf(a,b,c)},e()}function cf(a,b){function c(c){return c>=c?b[bg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return cf(a,b)},c}function df(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return Ue(a,b)},b.tickFormat=function(b,c){return Ve(a,b,c)},b.copy=function(){return df(a)},b}function ef(){return 0}function ff(a){return a.innerRadius}function gf(a){return a.outerRadius}function hf(a){return a.startAngle}function jf(a){return a.endAngle}function kf(a){return a&&a.padAngle}function lf(a,b,c,d){return(a-c)*b-(b-d)*a>0?0:1}function mf(a,b,c,d,e){var f=a[0]-b[0],g=a[1]-b[1],h=(e?d:-d)/Math.sqrt(f*f+g*g),i=h*g,j=-h*f,k=a[0]+i,l=a[1]+j,m=b[0]+i,n=b[1]+j,o=(k+m)/2,p=(l+n)/2,q=m-k,r=n-l,s=q*q+r*r,t=c-d,u=k*n-m*l,v=(0>r?-1:1)*Math.sqrt(t*t*s-u*u),w=(u*r-q*v)/s,x=(-u*q-r*v)/s,y=(u*r+q*v)/s,z=(-u*q+r*v)/s,A=w-o,B=x-p,C=y-o,D=z-p; 15 return A*A+B*B>C*C+D*D&&(w=y,x=z),[[w-i,x-j],[w*c/t,x*c/t]]}function nf(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=Aa(c),o=Aa(d);++l<m;)e.call(this,i=b[l],l)?k.push([+n.call(this,i,l),+o.call(this,i,l)]):k.length&&(g(),k=[]);return k.length&&g(),j.length?j.join(""):null}var c=Bc,d=Cc,e=Cb,f=of,g=f.key,h=.7;return b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b.defined=function(a){return arguments.length?(e=a,b):e},b.interpolate=function(a){return arguments.length?(g="function"==typeof a?f=a:(f=Ai.get(a)||of).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function of(a){return a.join("L")}function pf(a){return of(a)+"Z"}function qf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d[0]+(d=a[b])[0])/2,"V",d[1]);return c>1&&e.push("H",d[0]),e.join("")}function rf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function sf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function tf(a,b){return a.length<4?of(a):a[1]+wf(a.slice(1,-1),xf(a,b))}function uf(a,b){return a.length<3?of(a):a[0]+wf((a.push(a[0]),a),xf([a[a.length-2]].concat(a,[a[1]]),b))}function vf(a,b){return a.length<3?of(a):a[0]+wf(a,xf(a,b))}function wf(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return of(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],i=2),b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+k[0]+","+k[1]}return d}function xf(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,i=a.length;++h<i;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function yf(a){if(a.length<3)return of(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f,"L",Cf(Di,g),",",Cf(Di,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Df(i,g,h);return a.pop(),i.push("L",d),i.join("")}function zf(a){if(a.length<4)return of(a);for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];++d<3;)b=a[d],f.push(b[0]),g.push(b[1]);for(c.push(Cf(Di,f)+","+Cf(Di,g)),--d;++d<e;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),Df(c,f,g);return c.join("")}function Af(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];++d<4;)c=a[d%e],g.push(c[0]),h.push(c[1]);for(b=[Cf(Di,g),",",Cf(Di,h)],--d;++d<f;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),Df(b,g,h);return b.join("")}function Bf(a,b){var c=a.length-1;if(c)for(var d,e,f=a[0][0],g=a[0][1],h=a[c][0]-f,i=a[c][1]-g,j=-1;++j<=c;)d=a[j],e=j/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*i);return yf(a)}function Cf(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Df(a,b,c){a.push("C",Cf(Bi,b),",",Cf(Bi,c),",",Cf(Ci,b),",",Cf(Ci,c),",",Cf(Di,b),",",Cf(Di,c))}function Ef(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Ff(a){for(var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=Ef(e,f);++b<c;)d[b]=(g+(g=Ef(e=f,f=a[b+1])))/2;return d[b]=g,d}function Gf(a){for(var b,c,d,e,f=[],g=Ff(a),h=-1,i=a.length-1;++h<i;)b=Ef(a[h],a[h+1]),ng(b)<Dg?g[h]=g[h+1]=0:(c=g[h]/b,d=g[h+1]/b,e=c*c+d*d,e>9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Hf(a){return a.length<3?of(a):a[0]+wf(a,Gf(a))}function If(a){for(var b,c,d,e=-1,f=a.length;++e<f;)b=a[e],c=b[0],d=b[1]-Ig,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function Jf(a){function b(b){function i(){p.push("M",h(a(r),l),k,j(a(q.reverse()),l),"Z")}for(var m,n,o,p=[],q=[],r=[],s=-1,t=b.length,u=Aa(c),v=Aa(e),w=c===d?function(){return n}:Aa(d),x=e===f?function(){return o}:Aa(f);++s<t;)g.call(this,m=b[s],s)?(q.push([n=+u.call(this,m,s),o=+v.call(this,m,s)]),r.push([+w.call(this,m,s),+x.call(this,m,s)])):q.length&&(i(),q=[],r=[]);return q.length&&i(),p.length?p.join(""):null}var c=Bc,d=Bc,e=0,f=Cc,g=Cb,h=of,i=h.key,j=h,k="L",l=.7;return b.x=function(a){return arguments.length?(c=d=a,b):d},b.x0=function(a){return arguments.length?(c=a,b):c},b.x1=function(a){return arguments.length?(d=a,b):d},b.y=function(a){return arguments.length?(e=f=a,b):f},b.y0=function(a){return arguments.length?(e=a,b):e},b.y1=function(a){return arguments.length?(f=a,b):f},b.defined=function(a){return arguments.length?(g=a,b):g},b.interpolate=function(a){return arguments.length?(i="function"==typeof a?h=a:(h=Ai.get(a)||of).key,j=h.reverse||h,k=h.closed?"M":"L",b):i},b.tension=function(a){return arguments.length?(l=a,b):l},b}function Kf(a){return a.radius}function Lf(a){return[a.x,a.y]}function Mf(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]-Ig;return[c*Math.cos(d),c*Math.sin(d)]}}function Nf(){return 64}function Of(){return"circle"}function Pf(a){var b=Math.sqrt(a/Fg);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+-b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function Qf(a){return function(){var b,c;(b=this[a])&&(c=b[b.active])&&(--b.count?delete b[b.active]:delete this[a],b.active+=.5,c.event&&c.event.interrupt.call(this,this.__data__,c.index))}}function Rf(a,b,c){return sg(a,Ki),a.namespace=b,a.id=c,a}function Sf(a,b,c,d){var e=a.id,f=a.namespace;return R(a,"function"==typeof c?function(a,g,h){a[f][e].tween.set(b,d(c.call(a,a.__data__,g,h)))}:(c=d(c),function(a){a[f][e].tween.set(b,c)}))}function Tf(a){return null==a&&(a=""),function(){this.textContent=a}}function Uf(a){return null==a?"__transition__":"__transition_"+a+"__"}function Vf(a,b,c,d,e){var f=a[c]||(a[c]={active:0,count:0}),g=f[d];if(!g){var h=e.time;g=f[d]={tween:new j,time:h,delay:e.delay,duration:e.duration,ease:e.ease,index:b},e=null,++f.count,bg.timer(function(e){function i(c){if(f.active>d)return k();var e=f[f.active];e&&(--f.count,delete f[f.active],e.event&&e.event.interrupt.call(a,a.__data__,e.index)),f.active=d,g.event&&g.event.start.call(a,a.__data__,b),g.tween.forEach(function(c,d){(d=d.call(a,a.__data__,b))&&p.push(d)}),m=g.ease,l=g.duration,bg.timer(function(){return o.c=j(c||1)?Cb:j,1},0,h)}function j(c){if(f.active!==d)return 1;for(var e=c/l,h=m(e),i=p.length;i>0;)p[--i].call(a,h);return e>=1?(g.event&&g.event.end.call(a,a.__data__,b),k()):void 0}function k(){return--f.count?delete f[d]:delete a[c],1}var l,m,n=g.delay,o=ch,p=[];return o.t=n+h,e>=n?i(e-n):void(o.c=i)},0,h)}}function Wf(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate("+(isFinite(d)?d:c(a))+",0)"})}function Xf(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate(0,"+(isFinite(d)?d:c(a))+")"})}function Yf(a){return a.toISOString()}function Zf(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=bg.bisect(Ti,e);return f==Ti.length?[b.year,Te(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/Ti[f-1]<Ti[f]/e?f-1:f]:[Wi,Te(a,c)[2]]}return d.invert=function(b){return $f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map($f)},d.nice=function(a,b){function c(c){return!isNaN(c)&&!a.range(c,$f(+c+1),b).length}var f=d.domain(),g=Ke(f),h=null==a?e(g,10):"number"==typeof a&&e(g,a);return h&&(a=h[0],b=h[1]),d.domain(Ne(f,b>1?{floor:function(b){for(;c(b=a.floor(b));)b=$f(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=$f(+b+1);return b}}:a))},d.ticks=function(a,b){var c=Ke(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],$f(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return Zf(a.copy(),b,c)},Re(d,a)}function $f(a){return new Date(a)}function _f(a){return JSON.parse(a.responseText)}function ag(a){var b=eg.createRange();return b.selectNode(eg.body),b.createContextualFragment(a.responseText)}var bg={version:"3.5.6"},cg=[].slice,dg=function(a){return cg.call(a)},eg=this.document;if(eg)try{dg(eg.documentElement.childNodes)[0].nodeType}catch(fg){dg=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}if(Date.now||(Date.now=function(){return+new Date}),eg)try{eg.createElement("DIV").style.setProperty("opacity",0,"")}catch(gg){var hg=this.Element.prototype,ig=hg.setAttribute,jg=hg.setAttributeNS,kg=this.CSSStyleDeclaration.prototype,lg=kg.setProperty;hg.setAttribute=function(a,b){ig.call(this,a,b+"")},hg.setAttributeNS=function(a,b,c){jg.call(this,a,b,c+"")},kg.setProperty=function(a,b,c){lg.call(this,a,b+"",c)}}bg.ascending=c,bg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:NaN},bg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c},bg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c},bg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f<g;)if(null!=(d=a[f])&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;++f<g;)if(null!=(d=b.call(a,a[f],f))&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]},bg.sum=function(a,b){var c,d=0,f=a.length,g=-1;if(1===arguments.length)for(;++g<f;)e(c=+a[g])&&(d+=c);else for(;++g<f;)e(c=+b.call(a,a[g],g))&&(d+=c);return d},bg.mean=function(a,b){var c,f=0,g=a.length,h=-1,i=g;if(1===arguments.length)for(;++h<g;)e(c=d(a[h]))?f+=c:--i;else for(;++h<g;)e(c=d(b.call(a,a[h],h)))?f+=c:--i;return i?f/i:void 0},bg.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1],f=c-d;return f?e+f*(a[d]-e):e},bg.median=function(a,b){var f,g=[],h=a.length,i=-1;if(1===arguments.length)for(;++i<h;)e(f=d(a[i]))&&g.push(f);else for(;++i<h;)e(f=d(b.call(a,a[i],i)))&&g.push(f);return g.length?bg.quantile(g.sort(c),.5):void 0},bg.variance=function(a,b){var c,f,g=a.length,h=0,i=0,j=-1,k=0;if(1===arguments.length)for(;++j<g;)e(c=d(a[j]))&&(f=c-h,h+=f/++k,i+=f*(c-h));else for(;++j<g;)e(c=d(b.call(a,a[j],j)))&&(f=c-h,h+=f/++k,i+=f*(c-h));return k>1?i/(k-1):void 0},bg.deviation=function(){var a=bg.variance.apply(this,arguments);return a?Math.sqrt(a):a};var mg=f(c);bg.bisectLeft=mg.left,bg.bisect=bg.bisectRight=mg.right,bg.bisector=function(a){return f(1===a.length?function(b,d){return c(a(b),d)}:a)},bg.shuffle=function(a,b,c){(f=arguments.length)<3&&(c=a.length,2>f&&(b=0));for(var d,e,f=c-b;f;)e=Math.random()*f--|0,d=a[f+b],a[f+b]=a[e+b],a[e+b]=d;return a},bg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},bg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},bg.zip=function(){if(!(d=arguments.length))return[];for(var a=-1,b=bg.min(arguments,g),c=new Array(b);++a<b;)for(var d,e=-1,f=c[a]=new Array(d);++e<d;)f[e]=arguments[e][a];return c},bg.transpose=function(a){return bg.zip.apply(bg,a)},bg.keys=function(a){var b=[];for(var c in a)b.push(c);return b},bg.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},bg.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},bg.merge=function(a){for(var b,c,d,e=a.length,f=-1,g=0;++f<e;)g+=a[f].length;for(c=new Array(g);--e>=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var ng=Math.abs;bg.range=function(a,b,c){if(arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0)),(b-a)/c===1/0)throw new Error("infinite range");var d,e=[],f=h(ng(c)),g=-1;if(a*=f,b*=f,c*=f,0>c)for(;(d=a+c*++g)>b;)e.push(d/f);else for(;(d=a+c*++g)<b;)e.push(d/f);return e},bg.map=function(a,b){var c=new j;if(a instanceof j)a.forEach(function(a,b){c.set(a,b)});else if(Array.isArray(a)){var d,e=-1,f=a.length;if(1===arguments.length)for(;++e<f;)c.set(e,a[e]);else for(;++e<f;)c.set(b.call(a,d=a[e],e),d)}else for(var g in a)c.set(g,a[g]);return c};var og="__proto__",pg="\x00";i(j,{has:m,get:function(a){return this._[k(a)]},set:function(a,b){return this._[k(a)]=b},remove:n,keys:o,values:function(){var a=[];for(var b in this._)a.push(this._[b]);return a},entries:function(){var a=[];for(var b in this._)a.push({key:l(b),value:this._[b]});return a},size:p,empty:q,forEach:function(a){for(var b in this._)a.call(this,l(b),this._[b])}}),bg.nest=function(){function a(b,g,h){if(h>=f.length)return d?d.call(e,g):c?g.sort(c):g;for(var i,k,l,m,n=-1,o=g.length,p=f[h++],q=new j;++n<o;)(m=q.get(i=p(k=g[n])))?m.push(k):q.set(i,[k]);return b?(k=b(),l=function(c,d){k.set(c,a(b,d,h))}):(k={},l=function(c,d){k[c]=a(b,d,h)}),q.forEach(l),k}function b(a,c){if(c>=f.length)return a;var d=[],e=g[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},f=[],g=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(bg.map,c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return g[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},bg.set=function(a){var b=new r;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},i(r,{has:m,add:function(a){return this._[k(a+="")]=!0,a},remove:n,values:o,size:p,empty:q,forEach:function(a){for(var b in this._)a.call(this,l(b))}}),bg.behavior={},bg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d<e;)a[c=arguments[d]]=t(a,b,b[c]);return a};var qg=["webkit","ms","moz","Moz","o","O"];bg.dispatch=function(){for(var a=new w,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=x(a);return a},w.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.slice(c+1),a=a.slice(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},bg.event=null,bg.requote=function(a){return a.replace(rg,"\\$&")};var rg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sg={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},tg=function(a,b){return b.querySelector(a)},ug=function(a,b){return b.querySelectorAll(a)},vg=function(a,b){var c=a.matches||a[u(a,"matchesSelector")];return(vg=function(a,b){return c.call(a,b)})(a,b)};"function"==typeof Sizzle&&(tg=function(a,b){return Sizzle(a,b)[0]||null},ug=Sizzle,vg=Sizzle.matchesSelector),bg.selection=function(){return bg.select(eg.documentElement)};var wg=bg.selection.prototype=[];wg.select=function(a){var b,c,d,e,f=[];a=C(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=-1,j=d.length;++i<j;)(e=d[i])?(b.push(c=a.call(e,e.__data__,i,g)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return B(f)},wg.selectAll=function(a){var b,c,d=[];a=D(a);for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)(c=g[h])&&(d.push(b=dg(a.call(c,c.__data__,h,e))),b.parentNode=c);return B(d)};var xg={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};bg.ns={prefix:xg,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.slice(0,b),a=a.slice(b+1)),xg.hasOwnProperty(c)?{space:xg[c],local:a}:a}},wg.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=bg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(E(b,a[b]));return this}return this.each(E(a,b))},wg.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=H(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!G(a[e]).test(b))return!1;return!0}for(b in a)this.each(I(b,a[b]));return this}return this.each(I(a,b))},wg.style=function(a,c,d){var e=arguments.length;if(3>e){if("string"!=typeof a){2>e&&(c="");for(d in a)this.each(K(d,a[d],c));return this}if(2>e){var f=this.node();return b(f).getComputedStyle(f,null).getPropertyValue(a)}d=""}return this.each(K(a,c,d))},wg.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(L(b,a[b]));return this}return this.each(L(a,b))},wg.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},wg.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},wg.append=function(a){return a=M(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},wg.insert=function(a,b){return a=M(a),b=C(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},wg.remove=function(){return this.each(N)},wg.data=function(a,b){function c(a,c){var d,e,f,g=a.length,l=c.length,m=Math.min(g,l),n=new Array(l),o=new Array(l),p=new Array(g);if(b){var q,r=new j,s=new Array(g);for(d=-1;++d<g;)r.has(q=b.call(e=a[d],e.__data__,d))?p[d]=e:r.set(q,e),s[d]=q;for(d=-1;++d<l;)(e=r.get(q=b.call(c,f=c[d],d)))?e!==!0&&(n[d]=e,e.__data__=f):o[d]=O(f),r.set(q,!0);for(d=-1;++d<g;)r.get(s[d])!==!0&&(p[d]=a[d])}else{for(d=-1;++d<m;)e=a[d],f=c[d],e?(e.__data__=f,n[d]=e):o[d]=O(f);for(;l>d;++d)o[d]=O(c[d]);for(;g>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,h.push(o),i.push(n),k.push(p)}var d,e,f=-1,g=this.length;if(!arguments.length){for(a=new Array(g=(d=this[0]).length);++f<g;)(e=d[f])&&(a[f]=e.__data__);return a}var h=S([]),i=B([]),k=B([]);if("function"==typeof a)for(;++f<g;)c(d=this[f],a.call(d,d.parentNode.__data__,f));else for(;++f<g;)c(d=this[f],a);return i.enter=function(){return h},i.exit=function(){return k},i},wg.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},wg.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=P(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return B(e)},wg.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},wg.sort=function(a){a=Q.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},wg.each=function(a){return R(this,function(b,c,d){a.call(b,b.__data__,c,d)})},wg.call=function(a){var b=dg(arguments);return a.apply(b[0]=this,b),this},wg.empty=function(){return!this.node()},wg.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},wg.size=function(){var a=0;return R(this,function(){++a}),a};var yg=[];bg.selection.enter=S,bg.selection.enter.prototype=yg,yg.append=wg.append,yg.empty=wg.empty,yg.node=wg.node,yg.call=wg.call,yg.size=wg.size,yg.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++h<i;){d=(e=this[h]).update,g.push(b=[]),b.parentNode=e.parentNode;for(var j=-1,k=e.length;++j<k;)(f=e[j])?(b.push(d[j]=c=a.call(e.parentNode,f.__data__,j,h)),c.__data__=f.__data__):b.push(null)}return B(g)},yg.insert=function(a,b){return arguments.length<2&&(b=T(this)),wg.insert.call(this,a,b)},bg.select=function(b){var c;return"string"==typeof b?(c=[tg(b,eg)],c.parentNode=eg.documentElement):(c=[b],c.parentNode=a(b)),B([c])},bg.selectAll=function(a){var b;return"string"==typeof a?(b=dg(ug(a,eg)),b.parentNode=eg.documentElement):(b=a,b.parentNode=null),B([b])},wg.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(U(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(U(a,b,c))};var zg=bg.map({mouseenter:"mouseover",mouseleave:"mouseout"});eg&&zg.forEach(function(a){"on"+a in eg&&zg.remove(a)});var Ag,Bg=0;bg.mouse=function(a){return Y(a,z())};var Cg=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;bg.touch=function(a,b,c){if(arguments.length<3&&(c=b,b=z().changedTouches),b)for(var d,e=0,f=b.length;f>e;++e)if((d=b[e]).identifier===c)return Y(a,d)},bg.behavior.drag=function(){function a(){this.on("mousedown.drag",f).on("touchstart.drag",g)}function c(a,b,c,f,g){return function(){function h(){var a,c,d=b(m,p);d&&(a=d[0]-t[0],c=d[1]-t[1],o|=a|c,t=d,n({type:"drag",x:d[0]+j[0],y:d[1]+j[1],dx:a,dy:c}))}function i(){b(m,p)&&(r.on(f+q,null).on(g+q,null),s(o&&bg.event.target===l),n({type:"dragend"}))}var j,k=this,l=bg.event.target,m=k.parentNode,n=d.of(k,arguments),o=0,p=a(),q=".drag"+(null==p?"":"-"+p),r=bg.select(c(l)).on(f+q,h).on(g+q,i),s=X(l),t=b(m,p);e?(j=e.apply(k,arguments),j=[j.x-t[0],j.y-t[1]]):j=[0,0],n({type:"dragstart"})}}var d=A(a,"drag","dragstart","dragend"),e=null,f=c(v,bg.mouse,b,"mousemove","mouseup"),g=c(Z,bg.touch,s,"touchmove","touchend");return a.origin=function(b){return arguments.length?(e=b,a):e},bg.rebind(a,d,"on")},bg.touches=function(a,b){return arguments.length<2&&(b=z().touches),b?dg(b).map(function(b){var c=Y(a,b);return c.identifier=b.identifier,c}):[]};var Dg=1e-6,Eg=Dg*Dg,Fg=Math.PI,Gg=2*Fg,Hg=Gg-Dg,Ig=Fg/2,Jg=Fg/180,Kg=180/Fg,Lg=Math.SQRT2,Mg=2,Ng=4;bg.interpolateZoom=function(a,b){function c(a){var b=a*s;if(r){var c=da(p),g=f/(Mg*m)*(c*ea(Lg*b+p)-ca(p));return[d+g*j,e+g*k,f*c/da(Lg*b+p)]}return[d+a*j,e+a*k,f*Math.exp(Lg*b)]}var d=a[0],e=a[1],f=a[2],g=b[0],h=b[1],i=b[2],j=g-d,k=h-e,l=j*j+k*k,m=Math.sqrt(l),n=(i*i-f*f+Ng*l)/(2*f*Mg*m),o=(i*i-f*f-Ng*l)/(2*i*Mg*m),p=Math.log(Math.sqrt(n*n+1)-n),q=Math.log(Math.sqrt(o*o+1)-o),r=q-p,s=(r||Math.log(i/f))/Lg;return c.duration=1e3*s,c},bg.behavior.zoom=function(){function a(a){a.on(F,l).on(Pg+".zoom",n).on("dblclick.zoom",o).on(I,m)}function c(a){return[(a[0]-z.x)/z.k,(a[1]-z.y)/z.k]}function d(a){return[a[0]*z.k+z.x,a[1]*z.k+z.y]}function e(a){z.k=Math.max(C[0],Math.min(C[1],a))}function f(a,b){b=d(b),z.x+=a[0]-b[0],z.y+=a[1]-b[1]}function g(b,c,d,g){b.__chart__={x:z.x,y:z.y,k:z.k},e(Math.pow(2,g)),f(q=c,d),b=bg.select(b),D>0&&(b=b.transition().duration(D)),b.call(a.event)}function h(){v&&v.domain(u.range().map(function(a){return(a-z.x)/z.k}).map(u.invert)),x&&x.domain(w.range().map(function(a){return(a-z.y)/z.k}).map(w.invert))}function i(a){E++||a({type:"zoomstart"})}function j(a){h(),a({type:"zoom",scale:z.k,translate:[z.x,z.y]})}function k(a){--E||(a({type:"zoomend"}),q=null)}function l(){function a(){l=1,f(bg.mouse(e),n),j(h)}function d(){m.on(G,null).on(H,null),o(l&&bg.event.target===g),k(h)}var e=this,g=bg.event.target,h=J.of(e,arguments),l=0,m=bg.select(b(e)).on(G,a).on(H,d),n=c(bg.mouse(e)),o=X(e);Ji.call(e),i(h)}function m(){function a(){var a=bg.touches(o);return n=z.k,a.forEach(function(a){a.identifier in q&&(q[a.identifier]=c(a))}),a}function b(){var b=bg.event.target;bg.select(b).on(u,d).on(v,h),w.push(b);for(var c=bg.event.changedTouches,e=0,f=c.length;f>e;++e)q[c[e].identifier]=null;var i=a(),j=Date.now();if(1===i.length){if(500>j-t){var k=i[0];g(o,k,q[k.identifier],Math.floor(Math.log(z.k)/Math.LN2)+1),y()}t=j}else if(i.length>1){var k=i[0],l=i[1],m=k[0]-l[0],n=k[1]-l[1];r=m*m+n*n}}function d(){var a,b,c,d,g=bg.touches(o);Ji.call(o);for(var h=0,i=g.length;i>h;++h,d=null)if(c=g[h],d=q[c.identifier]){if(b)break;a=c,b=d}if(d){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=r&&Math.sqrt(k/r);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+d[0])/2,(b[1]+d[1])/2],e(l*n)}t=null,f(a,b),j(p)}function h(){if(bg.event.touches.length){for(var b=bg.event.changedTouches,c=0,d=b.length;d>c;++c)delete q[b[c].identifier];for(var e in q)return void a()}bg.selectAll(w).on(s,null),x.on(F,l).on(I,m),A(),k(p)}var n,o=this,p=J.of(o,arguments),q={},r=0,s=".zoom-"+bg.event.changedTouches[0].identifier,u="touchmove"+s,v="touchend"+s,w=[],x=bg.select(o),A=X(o);b(),i(p),x.on(F,null).on(I,b)}function n(){var a=J.of(this,arguments);s?clearTimeout(s):(Ji.call(this),p=c(q=r||bg.mouse(this)),i(a)),s=setTimeout(function(){s=null,k(a)},50),y(),e(Math.pow(2,.002*Og())*z.k),f(q,p),j(a)}function o(){var a=bg.mouse(this),b=Math.log(z.k)/Math.LN2;g(this,a,c(a),bg.event.shiftKey?Math.ceil(b)-1:Math.floor(b)+1)}var p,q,r,s,t,u,v,w,x,z={x:0,y:0,k:1},B=[960,500],C=Qg,D=250,E=0,F="mousedown.zoom",G="mousemove.zoom",H="mouseup.zoom",I="touchstart.zoom",J=A(a,"zoomstart","zoom","zoomend");return Pg||(Pg="onwheel"in eg?(Og=function(){return-bg.event.deltaY*(bg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in eg?(Og=function(){return bg.event.wheelDelta},"mousewheel"):(Og=function(){return-bg.event.detail},"MozMousePixelScroll")),a.event=function(a){a.each(function(){var a=J.of(this,arguments),b=z;Hi?bg.select(this).transition().each("start.zoom",function(){z=this.__chart__||{x:0,y:0,k:1},i(a)}).tween("zoom:zoom",function(){var c=B[0],d=B[1],e=q?q[0]:c/2,f=q?q[1]:d/2,g=bg.interpolateZoom([(e-z.x)/z.k,(f-z.y)/z.k,c/z.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),h=c/d[2];this.__chart__=z={x:e-d[0]*h,y:f-d[1]*h,k:h},j(a)}}).each("interrupt.zoom",function(){k(a)}).each("end.zoom",function(){k(a)}):(this.__chart__=z,i(a),j(a),k(a))})},a.translate=function(b){return arguments.length?(z={x:+b[0],y:+b[1],k:z.k},h(),a):[z.x,z.y]},a.scale=function(b){return arguments.length?(z={x:z.x,y:z.y,k:+b},h(),a):z.k},a.scaleExtent=function(b){return arguments.length?(C=null==b?Qg:[+b[0],+b[1]],a):C},a.center=function(b){return arguments.length?(r=b&&[+b[0],+b[1]],a):r},a.size=function(b){return arguments.length?(B=b&&[+b[0],+b[1]],a):B},a.duration=function(b){return arguments.length?(D=+b,a):D},a.x=function(b){return arguments.length?(v=b,u=b.copy(),z={x:0,y:0,k:1},a):v},a.y=function(b){return arguments.length?(x=b,w=b.copy(),z={x:0,y:0,k:1},a):x},bg.rebind(a,J,"on")};var Og,Pg,Qg=[0,1/0];bg.color=ga,ga.prototype.toString=function(){return this.rgb()+""},bg.hsl=ha;var Rg=ha.prototype=new ga;Rg.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new ha(this.h,this.s,this.l/a)},Rg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ha(this.h,this.s,a*this.l)},Rg.rgb=function(){return ia(this.h,this.s,this.l)},bg.hcl=ja;var Sg=ja.prototype=new ga;Sg.brighter=function(a){return new ja(this.h,this.c,Math.min(100,this.l+Tg*(arguments.length?a:1)))},Sg.darker=function(a){return new ja(this.h,this.c,Math.max(0,this.l-Tg*(arguments.length?a:1)))},Sg.rgb=function(){return ka(this.h,this.c,this.l).rgb()},bg.lab=la;var Tg=18,Ug=.95047,Vg=1,Wg=1.08883,Xg=la.prototype=new ga;Xg.brighter=function(a){return new la(Math.min(100,this.l+Tg*(arguments.length?a:1)),this.a,this.b)},Xg.darker=function(a){return new la(Math.max(0,this.l-Tg*(arguments.length?a:1)),this.a,this.b)},Xg.rgb=function(){return ma(this.l,this.a,this.b)},bg.rgb=ra;var Yg=ra.prototype=new ga;Yg.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),new ra(Math.min(255,b/a),Math.min(255,c/a),Math.min(255,d/a))):new ra(e,e,e)},Yg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ra(a*this.r,a*this.g,a*this.b)},Yg.hsl=function(){return wa(this.r,this.g,this.b)},Yg.toString=function(){return"#"+ua(this.r)+ua(this.g)+ua(this.b)};var Zg=bg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Zg.forEach(function(a,b){Zg.set(a,sa(b))}),bg.functor=Aa,bg.xhr=Ba(s),bg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=Ca(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),i=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=j)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++<j;)if(34===a.charCodeAt(c)){if(34!==a.charCodeAt(c+1))break;++c}k=c+2;var d=a.charCodeAt(c+1);return 13===d?(e=!0,10===a.charCodeAt(c+2)&&++k):10===d&&(e=!0),a.slice(b+1,c).replace(/""/g,'"')}for(;j>k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==i)continue;return a.slice(b,k-h)}return a.slice(b)}for(var d,e,f={},g={},h=[],j=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();b&&null==(m=b(m,l++))||h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new r,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}), 16 [e.map(g).join(a)].concat(b.map(function(b){return e.map(function(a){return g(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c},bg.csv=bg.dsv(",","text/csv"),bg.tsv=bg.dsv(" ","text/tab-separated-values");var $g,_g,ah,bh,ch,dh=this[u(this,"requestAnimationFrame")]||function(a){setTimeout(a,17)};bg.timer=function(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,f:!1,n:null};_g?_g.n=f:$g=f,_g=f,ah||(bh=clearTimeout(bh),ah=1,dh(Fa))},bg.timer.flush=function(){Ga(),Ha()},bg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var eh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ja);bg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=bg.round(a,Ia(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c-1)/3)))),eh[8+c/3]};var fh=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,gh=bg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=bg.round(a,Ia(a,b))).toFixed(Math.max(0,Math.min(20,Ia(a*(1+1e-15),b))))}}),hh=bg.time={},ih=Date;Ma.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){jh.setUTCDate.apply(this._,arguments)},setDay:function(){jh.setUTCDay.apply(this._,arguments)},setFullYear:function(){jh.setUTCFullYear.apply(this._,arguments)},setHours:function(){jh.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){jh.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){jh.setUTCMinutes.apply(this._,arguments)},setMonth:function(){jh.setUTCMonth.apply(this._,arguments)},setSeconds:function(){jh.setUTCSeconds.apply(this._,arguments)},setTime:function(){jh.setTime.apply(this._,arguments)}};var jh=Date.prototype;hh.year=Na(function(a){return a=hh.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),hh.years=hh.year.range,hh.years.utc=hh.year.utc.range,hh.day=Na(function(a){var b=new ih(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),hh.days=hh.day.range,hh.days.utc=hh.day.utc.range,hh.dayOfYear=function(a){var b=hh.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(a,b){b=7-b;var c=hh[a]=Na(function(a){return(a=hh.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=hh.year(a).getDay();return Math.floor((hh.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});hh[a+"s"]=c.range,hh[a+"s"].utc=c.utc.range,hh[a+"OfYear"]=function(a){var c=hh.year(a).getDay();return Math.floor((hh.dayOfYear(a)+(c+b)%7)/7)}}),hh.week=hh.sunday,hh.weeks=hh.sunday.range,hh.weeks.utc=hh.sunday.utc.range,hh.weekOfYear=hh.sundayOfYear;var kh={"-":"",_:" ",0:"0"},lh=/^\s*\d+/,mh=/^%/;bg.locale=function(a){return{numberFormat:Ka(a),timeFormat:Pa(a)}};var nh=bg.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});bg.format=nh.numberFormat,bg.geo={},ib.prototype={s:0,t:0,add:function(a){jb(a,this.t,oh),jb(oh.s,this.s,this),this.s?this.t+=oh.t:this.s=oh.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var oh=new ib;bg.geo.stream=function(a,b){a&&ph.hasOwnProperty(a.type)?ph[a.type](a,b):kb(a,b)};var ph={Feature:function(a,b){kb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++d<e;)kb(c[d].geometry,b)}},qh={Sphere:function(a,b){b.sphere()},Point:function(a,b){a=a.coordinates,b.point(a[0],a[1],a[2])},MultiPoint:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)a=c[d],b.point(a[0],a[1],a[2])},LineString:function(a,b){lb(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)lb(c[d],b,0)},Polygon:function(a,b){mb(a.coordinates,b)},MultiPolygon:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)mb(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;++d<e;)kb(c[d],b)}};bg.geo.area=function(a){return rh=0,bg.geo.stream(a,th),rh};var rh,sh=new ib,th={sphere:function(){rh+=4*Fg},point:v,lineStart:v,lineEnd:v,polygonStart:function(){sh.reset(),th.lineStart=nb},polygonEnd:function(){var a=2*sh;rh+=0>a?4*Fg+a:a,th.lineStart=th.lineEnd=th.point=v}};bg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=ob([b*Jg,c*Jg]);if(r){var e=qb(r,d),f=[e[1],-e[0],0],g=qb(f,e);tb(g),g=ub(g);var i=b-o,j=i>0?1:-1,p=g[0]*Kg*j,q=ng(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Kg;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Kg;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=ng(d)>180?d+(d>0?360:-360):d}else p=a,q=c;th.point(a,c),b(a,c)}function f(){th.lineStart()}function g(){e(p,q),th.lineEnd(),ng(s)>Dg&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a<b[0]||b[1]<a}var k,l,m,n,o,p,q,r,s,t,u,v={point:a,lineStart:c,lineEnd:d,polygonStart:function(){v.point=e,v.lineStart=f,v.lineEnd=g,s=0,th.polygonStart()},polygonEnd:function(){th.polygonEnd(),v.point=a,v.lineStart=c,v.lineEnd=d,0>sh?(k=-(m=180),l=-(n=90)):s>Dg?n=90:-Dg>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],bg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-(1/0),b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,k===1/0||l===1/0?[[NaN,NaN],[NaN,NaN]]:[[k,l],[m,n]]}}(),bg.geo.centroid=function(a){uh=vh=wh=xh=yh=zh=Ah=Bh=Ch=Dh=Eh=0,bg.geo.stream(a,Fh);var b=Ch,c=Dh,d=Eh,e=b*b+c*c+d*d;return Eg>e&&(b=zh,c=Ah,d=Bh,Dg>vh&&(b=wh,c=xh,d=yh),e=b*b+c*c+d*d,Eg>e)?[NaN,NaN]:[Math.atan2(c,b)*Kg,ba(d/Math.sqrt(e))*Kg]};var uh,vh,wh,xh,yh,zh,Ah,Bh,Ch,Dh,Eh,Fh={sphere:v,point:wb,lineStart:yb,lineEnd:zb,polygonStart:function(){Fh.lineStart=Ab},polygonEnd:function(){Fh.lineStart=yb}},Gh=Gb(Cb,Kb,Mb,[-Fg,-Fg/2]),Hh=1e9;bg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=Qb(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(bg.geo.conicEqualArea=function(){return Rb(Sb)}).raw=Sb,bg.geo.albers=function(){return bg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},bg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=bg.geo.albers(),g=bg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=bg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Dg,l+.12*j+Dg],[k-.214*j-Dg,l+.234*j-Dg]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Dg,l+.166*j+Dg],[k-.115*j-Dg,l+.234*j-Dg]]).stream(i).point,a},a.scale(1070)};var Ih,Jh,Kh,Lh,Mh,Nh,Oh={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Jh=0,Oh.lineStart=Tb},polygonEnd:function(){Oh.lineStart=Oh.lineEnd=Oh.point=v,Ih+=ng(Jh/2)}},Ph={point:Ub,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},Qh={point:Xb,lineStart:Yb,lineEnd:Zb,polygonStart:function(){Qh.lineStart=$b},polygonEnd:function(){Qh.point=Xb,Qh.lineStart=Yb,Qh.lineEnd=Zb}};bg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),bg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Ih=0,bg.geo.stream(a,e(Oh)),Ih},a.centroid=function(a){return wh=xh=yh=zh=Ah=Bh=Ch=Dh=Eh=0,bg.geo.stream(a,e(Qh)),Eh?[Ch/Eh,Dh/Eh]:Bh?[zh/Bh,Ah/Bh]:yh?[wh/yh,xh/yh]:[NaN,NaN]},a.bounds=function(a){return Mh=Nh=-(Kh=Lh=1/0),bg.geo.stream(a,e(Ph)),[[Kh,Lh],[Mh,Nh]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||bc(a):s,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new Vb:new _b(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(bg.geo.albersUsa()).context(null)},bg.geo.transform=function(a){return{stream:function(b){var c=new cc(b);for(var d in a)c[d]=a[d];return c}}},cc.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},bg.geo.projection=ec,bg.geo.projectionMutator=fc,(bg.geo.equirectangular=function(){return ec(hc)}).raw=hc.invert=hc,bg.geo.rotation=function(a){function b(b){return b=a(b[0]*Jg,b[1]*Jg),b[0]*=Kg,b[1]*=Kg,b}return a=jc(a[0]%360*Jg,a[1]*Jg,a.length>2?a[2]*Jg:0),b.invert=function(b){return b=a.invert(b[0]*Jg,b[1]*Jg),b[0]*=Kg,b[1]*=Kg,b},b},ic.invert=hc,bg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=jc(-a[0]*Jg,-a[1]*Jg,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Kg,a[1]*=Kg}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=nc((b=+d)*Jg,e*Jg),a):b},a.precision=function(d){return arguments.length?(c=nc(b*Jg,(e=+d)*Jg),a):e},a.angle(90)},bg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Jg,e=a[1]*Jg,f=b[1]*Jg,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},bg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return bg.range(Math.ceil(f/q)*q,e,q).map(m).concat(bg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(bg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return ng(a%q)>Dg}).map(k)).concat(bg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return ng(a%r)>Dg}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=pc(h,g,90),l=qc(d,c,s),m=pc(j,i,90),n=qc(f,e,s),a):s},a.majorExtent([[-180,-90+Dg],[180,90-Dg]]).minorExtent([[-180,-80-Dg],[180,80+Dg]])},bg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=rc,e=sc;return a.distance=function(){return bg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},bg.geo.interpolate=function(a,b){return tc(a[0]*Jg,a[1]*Jg,b[0]*Jg,b[1]*Jg)},bg.geo.length=function(a){return Rh=0,bg.geo.stream(a,Sh),Rh};var Rh,Sh={sphere:v,point:v,lineStart:uc,lineEnd:v,polygonStart:v,polygonEnd:v},Th=vc(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(bg.geo.azimuthalEqualArea=function(){return ec(Th)}).raw=Th;var Uh=vc(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},s);(bg.geo.azimuthalEquidistant=function(){return ec(Uh)}).raw=Uh,(bg.geo.conicConformal=function(){return Rb(wc)}).raw=wc,(bg.geo.conicEquidistant=function(){return Rb(xc)}).raw=xc;var Vh=vc(function(a){return 1/a},Math.atan);(bg.geo.gnomonic=function(){return ec(Vh)}).raw=Vh,yc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Ig]},(bg.geo.mercator=function(){return zc(yc)}).raw=yc;var Wh=vc(function(){return 1},Math.asin);(bg.geo.orthographic=function(){return ec(Wh)}).raw=Wh;var Xh=vc(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(bg.geo.stereographic=function(){return ec(Xh)}).raw=Xh,Ac.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Ig]},(bg.geo.transverseMercator=function(){var a=zc(Ac),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[a[1],-a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},c([0,0,90])}).raw=Ac,bg.geom={},bg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e=Aa(c),f=Aa(d),g=a.length,h=[],i=[];for(b=0;g>b;b++)h.push([+e.call(this,a[b],b),+f.call(this,a[b],b),b]);for(h.sort(Ec),b=0;g>b;b++)i.push([h[b][0],-h[b][1]]);var j=Dc(h),k=Dc(i),l=k[0]===j[0],m=k[k.length-1]===j[j.length-1],n=[];for(b=j.length-1;b>=0;--b)n.push(a[h[j[b]][2]]);for(b=+l;b<k.length-m;++b)n.push(a[h[k[b]][2]]);return n}var c=Bc,d=Cc;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},bg.geom.polygon=function(a){return sg(a,Yh),a};var Yh=bg.geom.polygon.prototype=[];Yh.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b<c;)a=d,d=this[b],e+=a[1]*d[0]-a[0]*d[1];return.5*e},Yh.centroid=function(a){var b,c,d=-1,e=this.length,f=0,g=0,h=this[e-1];for(arguments.length||(a=-1/(6*this.area()));++d<e;)b=h,h=this[d],c=b[0]*h[1]-h[0]*b[1],f+=(b[0]+h[0])*c,g+=(b[1]+h[1])*c;return[f*a,g*a]},Yh.clip=function(a){for(var b,c,d,e,f,g,h=Hc(a),i=-1,j=this.length-Hc(this),k=this[j-1];++i<j;){for(b=a.slice(),a.length=0,e=this[i],f=b[(d=b.length-h)-1],c=-1;++c<d;)g=b[c],Fc(g,k,e)?(Fc(f,k,e)||a.push(Gc(f,g,k,e)),a.push(g)):Fc(f,k,e)&&a.push(Gc(f,g,k,e)),f=g;h&&a.push(a[0]),k=e}return a};var Zh,$h,_h,ai,bi,ci=[],di=[];Pc.prototype.prepare=function(){for(var a,b=this.edges,c=b.length;c--;)a=b[c].edge,a.b&&a.a||b.splice(c,1);return b.sort(Rc),b.length},_c.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},ad.prototype={insert:function(a,b){var c,d,e;if(a){if(b.P=a,b.N=a.N,a.N&&(a.N.P=b),a.N=b,a.R){for(a=a.R;a.L;)a=a.L;a.L=b}else a.R=b;c=a}else this._?(a=ed(this._),b.P=null,b.N=a,a.P=a.L=b,c=a):(b.P=b.N=null,this._=b,c=null);for(b.L=b.R=null,b.U=c,b.C=!0,a=b;c&&c.C;)d=c.U,c===d.L?(e=d.R,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.R&&(cd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,dd(this,d))):(e=d.L,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.L&&(dd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,cd(this,d))),c=a.U;this._.C=!1},remove:function(a){a.N&&(a.N.P=a.P),a.P&&(a.P.N=a.N),a.N=a.P=null;var b,c,d,e=a.U,f=a.L,g=a.R;if(c=f?g?ed(g):f:g,e?e.L===a?e.L=c:e.R=c:this._=c,f&&g?(d=c.C,c.C=a.C,c.L=f,f.U=c,c!==g?(e=c.U,c.U=a.U,a=c.R,e.L=a,c.R=g,g.U=c):(c.U=e,e=c,a=c.R)):(d=a.C,a=c),a&&(a.U=e),!d){if(a&&a.C)return void(a.C=!1);do{if(a===this._)break;if(a===e.L){if(b=e.R,b.C&&(b.C=!1,e.C=!0,cd(this,e),b=e.R),b.L&&b.L.C||b.R&&b.R.C){b.R&&b.R.C||(b.L.C=!1,b.C=!0,dd(this,b),b=e.R),b.C=e.C,e.C=b.R.C=!1,cd(this,e),a=this._;break}}else if(b=e.L,b.C&&(b.C=!1,e.C=!0,dd(this,e),b=e.L),b.L&&b.L.C||b.R&&b.R.C){b.L&&b.L.C||(b.R.C=!1,b.C=!0,cd(this,b),b=e.L),b.C=e.C,e.C=b.L.C=!1,dd(this,e),a=this._;break}b.C=!0,a=e,e=e.U}while(!a.C);a&&(a.C=!1)}}},bg.geom.voronoi=function(a){function b(a){var b=new Array(a.length),d=h[0][0],e=h[0][1],f=h[1][0],g=h[1][1];return fd(c(a),h).cells.forEach(function(c,h){var i=c.edges,j=c.site,k=b[h]=i.length?i.map(function(a){var b=a.start();return[b.x,b.y]}):j.x>=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Dg)*Dg,y:Math.round(g(a,b)/Dg)*Dg,i:b}})}var d=Bc,e=Cc,f=d,g=e,h=ei;return a?b(a):(b.links=function(a){return fd(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return fd(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(Rc),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i<j;)e=k,f=l,k=h[i].edge,l=k.l===g?k.r:k.l,d<f.i&&d<l.i&&hd(g,f,l)<0&&b.push([a[d],a[f.i],a[l.i]])}),b},b.x=function(a){return arguments.length?(f=Aa(d=a),b):d},b.y=function(a){return arguments.length?(g=Aa(e=a),b):e},b.clipExtent=function(a){return arguments.length?(h=null==a?ei:a,b):h===ei?null:h},b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===ei?null:h&&h[1]},b)};var ei=[[-1e6,-1e6],[1e6,1e6]];bg.geom.delaunay=function(a){return bg.geom.voronoi().triangles(a)},bg.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,f,g,h){if(!isNaN(c)&&!isNaN(d))if(a.leaf){var i=a.x,k=a.y;if(null!=i)if(ng(i-c)+ng(k-d)<.01)j(a,b,c,d,e,f,g,h);else{var l=a.point;a.x=a.y=a.point=null,j(a,l,i,k,e,f,g,h),j(a,b,c,d,e,f,g,h)}else a.x=c,a.y=d,a.point=b}else j(a,b,c,d,e,f,g,h)}function j(a,b,c,d,e,g,h,i){var j=.5*(e+h),k=.5*(g+i),l=c>=j,m=d>=k,n=m<<1|l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=kd()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=Aa(h),u=Aa(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.x<p&&(p=k.x),k.y<q&&(q=k.y),k.x>r&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=kd();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){ld(a,z,p,q,r,s)},z.find=function(a){return md(z,a[0],a[1],p,q,r,s)},n=-1,null==b){for(;++n<o;)f(z,a[n],l[n],m[n],p,q,r,s);--n}else a.forEach(z.add);return l=m=a=k=null,z}var g,h=Bc,i=Cc;return(g=arguments.length)?(h=id,i=jd,3===g&&(e=c,d=b,c=b=0),f(a)):(f.x=function(a){return arguments.length?(h=a,f):h},f.y=function(a){return arguments.length?(i=a,f):i},f.extent=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=+a[0][0],c=+a[0][1],d=+a[1][0],e=+a[1][1]),f):null==b?null:[[b,c],[d,e]]},f.size=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=c=0,d=+a[0],e=+a[1]),f):null==b?null:[d-b,e-c]},f)},bg.interpolateRgb=nd,bg.interpolateObject=od,bg.interpolateNumber=pd,bg.interpolateString=qd;var fi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gi=new RegExp(fi.source,"g");bg.interpolate=rd,bg.interpolators=[function(a,b){var c=typeof b;return("string"===c?Zg.has(b.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(b)?nd:qd:b instanceof ga?nd:Array.isArray(b)?sd:"object"===c&&isNaN(b)?od:pd)(a,b)}],bg.interpolateArray=sd;var hi=function(){return s},ii=bg.map({linear:hi,poly:zd,quad:function(){return wd},cubic:function(){return xd},sin:function(){return Ad},exp:function(){return Bd},circle:function(){return Cd},elastic:Dd,back:Ed,bounce:function(){return Fd}}),ji=bg.map({"in":s,out:ud,"in-out":vd,"out-in":function(a){return vd(ud(a))}});bg.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.slice(0,b):a,d=b>=0?a.slice(b+1):"in";return c=ii.get(c)||hi,d=ji.get(d)||s,td(d(c.apply(null,cg.call(arguments,1))))},bg.interpolateHcl=Gd,bg.interpolateHsl=Hd,bg.interpolateLab=Id,bg.interpolateRound=Jd,bg.transform=function(a){var b=eg.createElementNS(bg.ns.prefix.svg,"g");return(bg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Kd(c?c.matrix:ki)})(a)},Kd.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ki={a:1,b:0,c:0,d:1,e:0,f:0};bg.interpolateTransform=Od,bg.layout={},bg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c<d;)b.push(Rd(a[c]));return b}},bg.layout.chord=function(){function a(){var a,j,l,m,n,o={},p=[],q=bg.range(f),r=[];for(c=[],d=[],a=0,m=-1;++m<f;){for(j=0,n=-1;++n<f;)j+=e[m][n];p.push(j),r.push(bg.range(f)),a+=j}for(g&&q.sort(function(a,b){return g(p[a],p[b])}),h&&r.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})}),a=(Gg-k*f)/a,j=0,m=-1;++m<f;){for(l=j,n=-1;++n<f;){var s=q[m],t=r[s][n],u=e[s][t],v=j,w=j+=u*a;o[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}d[s]={index:s,startAngle:l,endAngle:j,value:(j-l)/a},j+=k}for(m=-1;++m<f;)for(n=m-1;++n<f;){var x=o[m+"-"+n],y=o[n+"-"+m];(x.value||y.value)&&c.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}i&&b()}function b(){c.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var c,d,e,f,g,h,i,j={},k=0;return j.matrix=function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,j):e},j.padding=function(a){return arguments.length?(k=a,c=d=null,j):k},j.sortGroups=function(a){return arguments.length?(g=a,c=d=null,j):g},j.sortSubgroups=function(a){return arguments.length?(h=a,c=null,j):h},j.sortChords=function(a){return arguments.length?(i=a,c&&b(),j):i},j.chords=function(){return c||a(),c},j.groups=function(){return d||a(),d},j},bg.layout.force=function(){function a(a){return function(b,c,d,e){if(b.point!==a){var f=b.cx-a.x,g=b.cy-a.y,h=e-c,i=f*f+g*g;if(i>h*h/q){if(o>i){var j=b.charge/i;a.px-=f*j,a.py-=g*j}return!0}if(b.point&&i&&o>i){var j=b.pointCharge/i;a.px-=f*j,a.py-=g*j}}return!b.charge}}function b(a){a.px=bg.event.x,a.py=bg.event.y,h.resume()}var c,d,e,f,g,h={},i=bg.dispatch("start","tick","end"),j=[1,1],k=.9,l=li,m=mi,n=-30,o=ni,p=.1,q=.64,r=[],t=[];return h.tick=function(){if((d*=.99)<.005)return i.end({type:"end",alpha:d=0}),!0;var b,c,h,l,m,o,q,s,u,v=r.length,w=t.length;for(c=0;w>c;++c)h=t[c],l=h.source,m=h.target,s=m.x-l.x,u=m.y-l.y,(o=s*s+u*u)&&(o=d*f[c]*((o=Math.sqrt(o))-e[c])/o,s*=o,u*=o,m.x-=s*(q=l.weight/(m.weight+l.weight)),m.y-=u*q,l.x+=s*(q=1-q),l.y+=u*q);if((q=d*p)&&(s=j[0]/2,u=j[1]/2,c=-1,q))for(;++c<v;)h=r[c],h.x+=(s-h.x)*q,h.y+=(u-h.y)*q;if(n)for(Yd(b=bg.geom.quadtree(r),d,g),c=-1;++c<v;)(h=r[c]).fixed||b.visit(a(h));for(c=-1;++c<v;)h=r[c],h.fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*k,h.y-=(h.py-(h.py=h.y))*k);i.tick({type:"tick",alpha:d})},h.nodes=function(a){return arguments.length?(r=a,h):r},h.links=function(a){return arguments.length?(t=a,h):t},h.size=function(a){return arguments.length?(j=a,h):j},h.linkDistance=function(a){return arguments.length?(l="function"==typeof a?a:+a,h):l},h.distance=h.linkDistance,h.linkStrength=function(a){return arguments.length?(m="function"==typeof a?a:+a,h):m},h.friction=function(a){return arguments.length?(k=+a,h):k},h.charge=function(a){return arguments.length?(n="function"==typeof a?a:+a,h):n},h.chargeDistance=function(a){return arguments.length?(o=a*a,h):Math.sqrt(o)},h.gravity=function(a){return arguments.length?(p=+a,h):p},h.theta=function(a){return arguments.length?(q=a*a,h):Math.sqrt(q)},h.alpha=function(a){return arguments.length?(a=+a,d?d=a>0?a:0:a>0&&(i.start({type:"start",alpha:d=a}),bg.timer(h.tick)),h):d},h.start=function(){function a(a,d){if(!c){for(c=new Array(i),h=0;i>h;++h)c[h]=[];for(h=0;k>h;++h){var e=t[h];c[e.source.index].push(e.target),c[e.target.index].push(e.source)}}for(var f,g=c[b],h=-1,j=g.length;++h<j;)if(!isNaN(f=g[h][a]))return f;return Math.random()*d}var b,c,d,i=r.length,k=t.length,o=j[0],p=j[1];for(b=0;i>b;++b)(d=r[b]).index=b,d.weight=0;for(b=0;k>b;++b)d=t[b],"number"==typeof d.source&&(d.source=r[d.source]),"number"==typeof d.target&&(d.target=r[d.target]),++d.source.weight,++d.target.weight;for(b=0;i>b;++b)d=r[b],isNaN(d.x)&&(d.x=a("x",o)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(e=[],"function"==typeof l)for(b=0;k>b;++b)e[b]=+l.call(this,t[b],b);else for(b=0;k>b;++b)e[b]=l;if(f=[],"function"==typeof m)for(b=0;k>b;++b)f[b]=+m.call(this,t[b],b);else for(b=0;k>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;i>b;++b)g[b]=+n.call(this,r[b],b);else for(b=0;i>b;++b)g[b]=n;return h.resume()},h.resume=function(){return h.alpha(.1)},h.stop=function(){return h.alpha(0)},h.drag=function(){return c||(c=bg.behavior.drag().origin(s).on("dragstart.force",Ud).on("drag.force",b).on("dragend.force",Vd)),arguments.length?void this.on("mouseover.force",Wd).on("mouseout.force",Xd).call(c):c},bg.rebind(h,i,"on")};var li=20,mi=1,ni=1/0;bg.layout.hierarchy=function(){function a(e){var f,g=[e],h=[];for(e.depth=0;null!=(f=g.pop());)if(h.push(f),(j=c.call(a,f,f.depth))&&(i=j.length)){for(var i,j,k;--i>=0;)g.push(k=j[i]),k.parent=f,k.depth=f.depth+1;d&&(f.value=0),f.children=j}else d&&(f.value=+d.call(a,f,f.depth)||0),delete f.children;return _d(e,function(a){var c,e;b&&(c=a.children)&&c.sort(b),d&&(e=a.parent)&&(e.value+=a.value)}),h}var b=ce,c=ae,d=be;return a.sort=function(c){return arguments.length?(b=c,a):b},a.children=function(b){return arguments.length?(c=b,a):c},a.value=function(b){return arguments.length?(d=b,a):d},a.revalue=function(b){return d&&($d(b,function(a){a.children&&(a.value=0)}),_d(b,function(b){var c;b.children||(b.value=+d.call(a,b,b.depth)||0),(c=b.parent)&&(c.value+=b.value)})),b},a},bg.layout.partition=function(){function a(b,c,d,e){var f=b.children;if(b.x=c,b.y=b.depth*e,b.dx=d,b.dy=e,f&&(g=f.length)){var g,h,i,j=-1;for(d=b.value?d/b.value:0;++j<g;)a(h=f[j],c,i=h.value*d,e),c+=i}}function b(a){var c=a.children,d=0;if(c&&(e=c.length))for(var e,f=-1;++f<e;)d=Math.max(d,b(c[f]));return 1+d}function c(c,f){var g=d.call(this,c,f);return a(g[0],0,e[0],e[1]/b(g[0])),g}var d=bg.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},Zd(c,d)},bg.layout.pie=function(){function a(g){var h,i=g.length,j=g.map(function(c,d){return+b.call(a,c,d)}),k=+("function"==typeof d?d.apply(this,arguments):d),l=("function"==typeof e?e.apply(this,arguments):e)-k,m=Math.min(Math.abs(l)/i,+("function"==typeof f?f.apply(this,arguments):f)),n=m*(0>l?-1:1),o=(l-i*n)/bg.sum(j),p=bg.range(i),q=[];return null!=c&&p.sort(c===oi?function(a,b){return j[b]-j[a]}:function(a,b){return c(g[a],g[b])}),p.forEach(function(a){q[a]={data:g[a],value:h=j[a],startAngle:k,endAngle:k+=h*o+n,padAngle:m}}),q}var b=Number,c=oi,d=0,e=Gg,f=0;return a.value=function(c){return arguments.length?(b=c,a):b},a.sort=function(b){return arguments.length?(c=b,a):c},a.startAngle=function(b){return arguments.length?(d=b,a):d},a.endAngle=function(b){return arguments.length?(e=b,a):e},a.padAngle=function(b){return arguments.length?(f=b,a):f},a};var oi={};bg.layout.stack=function(){function a(h,i){if(!(m=h.length))return h;var j=h.map(function(c,d){return b.call(a,c,d)}),k=j.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,b,c)]})}),l=c.call(a,k,i);j=bg.permute(j,l),k=bg.permute(k,l);var m,n,o,p,q=d.call(a,k,i),r=j[0].length;for(o=0;r>o;++o)for(e.call(a,j[0][o],p=q[o],k[0][o][1]),n=1;m>n;++n)e.call(a,j[n][o],p+=k[n-1][o][1],k[n][o][1]);return h}var b=s,c=he,d=ie,e=ge,f=ee,g=fe;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:pi.get(b)||he,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:qi.get(b)||ie,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var pi=bg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(je),f=a.map(ke),g=bg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return bg.range(a.length).reverse()},"default":he}),qi=bg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand: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;e>b;b++)d+=a[b][c][1];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},zero:ie});bg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f<n;)g=i[f]=[],g.dx=l[f+1]-(g.x=l[f]),g.y=0;if(n>0)for(f=-1;++f<m;)h=j[f],h>=k[0]&&h<=k[1]&&(g=i[bg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=oe,e=me;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Aa(b), 17 a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return ne(a,b)}:Aa(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},bg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,_d(h,function(a){a.r=+k(a.value)}),_d(h,te),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;_d(h,function(a){a.r+=l}),_d(h,te),_d(h,function(a){a.r-=l})}return we(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=bg.layout.hierarchy().sort(pe),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},Zd(a,c)},bg.layout.tree=function(){function a(a,e){var k=g.call(this,a,e),l=k[0],m=b(l);if(_d(m,c),m.parent.m=-m.z,$d(m,d),j)$d(l,f);else{var n=l,o=l,p=l;$d(l,function(a){a.x<n.x&&(n=a),a.x>o.x&&(o=a),a.depth>p.depth&&(p=a)});var q=h(n,o)/2-n.x,r=i[0]/(o.x+h(o,n)/2+q),s=i[1]/(p.depth||1);$d(l,function(a){a.x=(a.x+q)*r,a.y=a.depth*s})}return k}function b(a){for(var b,c={A:null,children:[a]},d=[c];null!=(b=d.pop());)for(var e,f=b.children,g=0,h=f.length;h>g;++g)d.push((f[g]=e={_:f[g],parent:b,children:(e=f[g].children)&&e.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:g}).a=e);return c.children[0]}function c(a){var b=a.children,c=a.parent.children,d=a.i?c[a.i-1]:null;if(b.length){Ce(a);var f=(b[0].z+b[b.length-1].z)/2;d?(a.z=d.z+h(a._,d._),a.m=a.z-f):a.z=f}else d&&(a.z=d.z+h(a._,d._));a.parent.A=e(a,d,a.parent.A||c[0])}function d(a){a._.x=a.z+a.parent.m,a.m+=a.parent.m}function e(a,b,c){if(b){for(var d,e=a,f=a,g=b,i=e.parent.children[0],j=e.m,k=f.m,l=g.m,m=i.m;g=Ae(g),e=ze(e),g&&e;)i=ze(i),f=Ae(f),f.a=a,d=g.z+l-e.z-j+h(g._,e._),d>0&&(Be(De(g,a,c),a,d),j+=d,k+=d),l+=g.m,j+=e.m,m+=i.m,k+=f.m;g&&!Ae(f)&&(f.t=g,f.m+=l-k),e&&!ze(i)&&(i.t=e,i.m+=j-m,c=a)}return c}function f(a){a.x*=i[0],a.y=a.depth*i[1]}var g=bg.layout.hierarchy().sort(null).value(null),h=ye,i=[1,1],j=null;return a.separation=function(b){return arguments.length?(h=b,a):h},a.size=function(b){return arguments.length?(j=null==(i=b)?f:null,a):j?null:i},a.nodeSize=function(b){return arguments.length?(j=null==(i=b)?null:f,a):j?i:null},Zd(a,g)},bg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;_d(i,function(a){var b=a.children;b&&b.length?(a.x=Fe(b),a.y=Ee(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Ge(i),l=He(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return _d(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=bg.layout.hierarchy().sort(null).value(null),c=ye,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},Zd(a,b)},bg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++e<f;)d=(c=a[e]).value*(0>b?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++g<h;)(c=a[g].area)&&(f>c&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++f<g;)e=a[f],e.x=h,e.y=j,e.dy=k,h+=e.dx=Math.min(c.x+c.dx-h,k?i(e.area/k):0);e.z=!0,e.dx+=c.x+c.dx-h,c.y+=k,c.dy-=k}else{for((d||k>c.dx)&&(k=c.dx);++f<g;)e=a[f],e.x=h,e.y=j,e.dx=k,j+=e.dy=Math.min(c.y+c.dy-j,k?i(e.area/k):0);e.z=!1,e.dy+=c.y+c.dy-j,c.x+=k,c.dx-=k}}function f(d){var e=g||h(d),f=e[0];return f.x=0,f.y=0,f.dx=j[0],f.dy=j[1],g&&h.revalue(f),a([f],f.dx*f.dy/f.value),(g?c:b)(f),m&&(g=e),e}var g,h=bg.layout.hierarchy(),i=Math.round,j=[1,1],k=null,l=Ie,m=!1,n="squarify",o=.5*(1+Math.sqrt(5));return f.size=function(a){return arguments.length?(j=a,f):j},f.padding=function(a){function b(b){var c=a.call(f,b,b.depth);return null==c?Ie(b):Je(b,"number"==typeof c?[c,c,c,c]:c)}function c(b){return Je(b,a)}if(!arguments.length)return k;var d;return l=null==(k=a)?Ie:"function"==(d=typeof a)?b:"number"===d?(a=[a,a,a,a],c):c,f},f.round=function(a){return arguments.length?(i=a?Math.round:Number,f):i!=Number},f.sticky=function(a){return arguments.length?(m=a,g=null,f):m},f.ratio=function(a){return arguments.length?(o=a,f):o},f.mode=function(a){return arguments.length?(n=a+"",f):n},Zd(f,h)},bg.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=bg.random.normal.apply(bg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=bg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},bg.scale={};var ri={floor:s,ceil:s};bg.scale.linear=function(){return Qe([0,1],[0,1],rd,!1)};var si={s:1,g:1,p:1,r:1,e:1};bg.scale.log=function(){return Ye(bg.scale.linear().domain([0,1]),10,!0,[1,10])};var ti=bg.format(".0e"),ui={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};bg.scale.pow=function(){return Ze(bg.scale.linear(),1,[0,1])},bg.scale.sqrt=function(){return bg.scale.pow().exponent(.5)},bg.scale.ordinal=function(){return _e([],{t:"range",a:[[]]})},bg.scale.category10=function(){return bg.scale.ordinal().range(vi)},bg.scale.category20=function(){return bg.scale.ordinal().range(wi)},bg.scale.category20b=function(){return bg.scale.ordinal().range(xi)},bg.scale.category20c=function(){return bg.scale.ordinal().range(yi)};var vi=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ta),wi=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ta),xi=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ta),yi=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ta);bg.scale.quantile=function(){return af([],[])},bg.scale.quantize=function(){return bf(0,1,[0,1])},bg.scale.threshold=function(){return cf([.5],[0,1])},bg.scale.identity=function(){return df([0,1])},bg.svg={},bg.svg.arc=function(){function a(){var a=Math.max(0,+c.apply(this,arguments)),j=Math.max(0,+d.apply(this,arguments)),k=g.apply(this,arguments)-Ig,l=h.apply(this,arguments)-Ig,m=Math.abs(l-k),n=k>l?0:1;if(a>j&&(o=j,j=a,a=o),m>=Hg)return b(j,n)+(a?b(a,1-n):"")+"Z";var o,p,q,r,s,t,u,v,w,x,y,z,A=0,B=0,C=[];if((r=(+i.apply(this,arguments)||0)/2)&&(q=f===zi?Math.sqrt(a*a+j*j):+f.apply(this,arguments),n||(B*=-1),j&&(B=ba(q/j*Math.sin(r))),a&&(A=ba(q/a*Math.sin(r)))),j){s=j*Math.cos(k+B),t=j*Math.sin(k+B),u=j*Math.cos(l-B),v=j*Math.sin(l-B);var D=Math.abs(l-k-2*B)<=Fg?0:1;if(B&&lf(s,t,u,v)===n^D){var E=(k+l)/2;s=j*Math.cos(E),t=j*Math.sin(E),u=v=null}}else s=t=0;if(a){w=a*Math.cos(l-A),x=a*Math.sin(l-A),y=a*Math.cos(k+A),z=a*Math.sin(k+A);var F=Math.abs(k-l+2*A)<=Fg?0:1;if(A&&lf(w,x,y,z)===1-n^F){var G=(k+l)/2;w=a*Math.cos(G),x=a*Math.sin(G),y=z=null}}else w=x=0;if((o=Math.min(Math.abs(j-a)/2,+e.apply(this,arguments)))>.001){p=j>a^n?0:1;var H=null==y?[w,x]:null==u?[s,t]:Gc([s,t],[y,z],[u,v],[w,x]),I=s-H[0],J=t-H[1],K=u-H[0],L=v-H[1],M=1/Math.sin(Math.acos((I*K+J*L)/(Math.sqrt(I*I+J*J)*Math.sqrt(K*K+L*L)))/2),N=Math.sqrt(H[0]*H[0]+H[1]*H[1]);if(null!=u){var O=Math.min(o,(j-N)/(M+1)),P=mf(null==y?[w,x]:[y,z],[s,t],j,O,n),Q=mf([u,v],[w,x],j,O,n);o===O?C.push("M",P[0],"A",O,",",O," 0 0,",p," ",P[1],"A",j,",",j," 0 ",1-n^lf(P[1][0],P[1][1],Q[1][0],Q[1][1]),",",n," ",Q[1],"A",O,",",O," 0 0,",p," ",Q[0]):C.push("M",P[0],"A",O,",",O," 0 1,",p," ",Q[0])}else C.push("M",s,",",t);if(null!=y){var R=Math.min(o,(a-N)/(M-1)),S=mf([s,t],[y,z],a,-R,n),T=mf([w,x],null==u?[s,t]:[u,v],a,-R,n);o===R?C.push("L",T[0],"A",R,",",R," 0 0,",p," ",T[1],"A",a,",",a," 0 ",n^lf(T[1][0],T[1][1],S[1][0],S[1][1]),",",1-n," ",S[1],"A",R,",",R," 0 0,",p," ",S[0]):C.push("L",T[0],"A",R,",",R," 0 0,",p," ",S[0])}else C.push("L",w,",",x)}else C.push("M",s,",",t),null!=u&&C.push("A",j,",",j," 0 ",D,",",n," ",u,",",v),C.push("L",w,",",x),null!=y&&C.push("A",a,",",a," 0 ",F,",",1-n," ",y,",",z);return C.push("Z"),C.join("")}function b(a,b){return"M0,"+a+"A"+a+","+a+" 0 1,"+b+" 0,"+-a+"A"+a+","+a+" 0 1,"+b+" 0,"+a}var c=ff,d=gf,e=ef,f=zi,g=hf,h=jf,i=kf;return a.innerRadius=function(b){return arguments.length?(c=Aa(b),a):c},a.outerRadius=function(b){return arguments.length?(d=Aa(b),a):d},a.cornerRadius=function(b){return arguments.length?(e=Aa(b),a):e},a.padRadius=function(b){return arguments.length?(f=b==zi?zi:Aa(b),a):f},a.startAngle=function(b){return arguments.length?(g=Aa(b),a):g},a.endAngle=function(b){return arguments.length?(h=Aa(b),a):h},a.padAngle=function(b){return arguments.length?(i=Aa(b),a):i},a.centroid=function(){var a=(+c.apply(this,arguments)+ +d.apply(this,arguments))/2,b=(+g.apply(this,arguments)+ +h.apply(this,arguments))/2-Ig;return[Math.cos(b)*a,Math.sin(b)*a]},a};var zi="auto";bg.svg.line=function(){return nf(s)};var Ai=bg.map({linear:of,"linear-closed":pf,step:qf,"step-before":rf,"step-after":sf,basis:yf,"basis-open":zf,"basis-closed":Af,bundle:Bf,cardinal:vf,"cardinal-open":tf,"cardinal-closed":uf,monotone:Hf});Ai.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var Bi=[0,2/3,1/3,0],Ci=[0,1/3,2/3,0],Di=[0,1/6,2/3,1/6];bg.svg.line.radial=function(){var a=nf(If);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},rf.reverse=sf,sf.reverse=rf,bg.svg.area=function(){return Jf(s)},bg.svg.area.radial=function(){var a=Jf(If);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},bg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)-Ig,k=j.call(a,e,d)-Ig;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Fg)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=rc,g=sc,h=Kf,i=hf,j=jf;return a.radius=function(b){return arguments.length?(h=Aa(b),a):h},a.source=function(b){return arguments.length?(f=Aa(b),a):f},a.target=function(b){return arguments.length?(g=Aa(b),a):g},a.startAngle=function(b){return arguments.length?(i=Aa(b),a):i},a.endAngle=function(b){return arguments.length?(j=Aa(b),a):j},a},bg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=rc,c=sc,d=Lf;return a.source=function(c){return arguments.length?(b=Aa(c),a):b},a.target=function(b){return arguments.length?(c=Aa(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},bg.svg.diagonal.radial=function(){var a=bg.svg.diagonal(),b=Lf,c=a.projection;return a.projection=function(a){return arguments.length?c(Mf(b=a)):b},a},bg.svg.symbol=function(){function a(a,d){return(Ei.get(b.call(this,a,d))||Pf)(c.call(this,a,d))}var b=Of,c=Nf;return a.type=function(c){return arguments.length?(b=Aa(c),a):b},a.size=function(b){return arguments.length?(c=Aa(b),a):c},a};var Ei=bg.map({circle:Pf,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Gi)),c=b*Gi;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Fi),c=b*Fi/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Fi),c=b*Fi/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});bg.svg.symbolTypes=Ei.keys();var Fi=Math.sqrt(3),Gi=Math.tan(30*Jg);wg.transition=function(a){for(var b,c,d=Hi||++Li,e=Uf(a),f=[],g=Ii||{time:Date.now(),ease:yd,delay:0,duration:250},h=-1,i=this.length;++h<i;){f.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(c=j[k])&&Vf(c,k,e,d,g),b.push(c)}return Rf(f,e,d)},wg.interrupt=function(a){return this.each(null==a?Ji:Qf(Uf(a)))};var Hi,Ii,Ji=Qf(Uf()),Ki=[],Li=0;Ki.call=wg.call,Ki.empty=wg.empty,Ki.node=wg.node,Ki.size=wg.size,bg.transition=function(a,b){return a&&a.transition?Hi?a.transition(b):a:bg.selection().transition(a)},bg.transition.prototype=Ki,Ki.select=function(a){var b,c,d,e=this.id,f=this.namespace,g=[];a=C(a);for(var h=-1,i=this.length;++h<i;){g.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(d=j[k])&&(c=a.call(d,d.__data__,k,h))?("__data__"in d&&(c.__data__=d.__data__),Vf(c,k,f,e,d[f][e]),b.push(c)):b.push(null)}return Rf(g,f,e)},Ki.selectAll=function(a){var b,c,d,e,f,g=this.id,h=this.namespace,i=[];a=D(a);for(var j=-1,k=this.length;++j<k;)for(var l=this[j],m=-1,n=l.length;++m<n;)if(d=l[m]){f=d[h][g],c=a.call(d,d.__data__,m,j),i.push(b=[]);for(var o=-1,p=c.length;++o<p;)(e=c[o])&&Vf(e,o,h,g,f),b.push(e)}return Rf(i,h,g)},Ki.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=P(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return Rf(e,this.namespace,this.id)},Ki.tween=function(a,b){var c=this.id,d=this.namespace;return arguments.length<2?this.node()[d][c].tween.get(a):R(this,null==b?function(b){b[d][c].tween.remove(a)}:function(e){e[d][c].tween.set(a,b)})},Ki.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?Od:rd,h=bg.ns.qualify(a);return Sf(this,"attr."+a,b,h.local?f:e)},Ki.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=bg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Ki.style=function(a,c,d){function e(){this.style.removeProperty(a)}function f(c){return null==c?e:(c+="",function(){var e,f=b(this).getComputedStyle(this,null).getPropertyValue(a);return f!==c&&(e=rd(f,c),function(b){this.style.setProperty(a,e(b),d)})})}var g=arguments.length;if(3>g){if("string"!=typeof a){2>g&&(c="");for(d in a)this.style(d,a[d],c);return this}d=""}return Sf(this,"style."+a,c,f)},Ki.styleTween=function(a,c,d){function e(e,f){var g=c.call(this,e,f,b(this).getComputedStyle(this,null).getPropertyValue(a));return g&&function(b){this.style.setProperty(a,g(b),d)}}return arguments.length<3&&(d=""),this.tween("style."+a,e)},Ki.text=function(a){return Sf(this,"text",a,Tf)},Ki.remove=function(){var a=this.namespace;return this.each("end.transition",function(){var b;this[a].count<2&&(b=this.parentNode)&&b.removeChild(this)})},Ki.ease=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].ease:("function"!=typeof a&&(a=bg.ease.apply(bg,arguments)),R(this,function(d){d[c][b].ease=a}))},Ki.delay=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].delay:R(this,"function"==typeof a?function(d,e,f){d[c][b].delay=+a.call(d,d.__data__,e,f)}:(a=+a,function(d){d[c][b].delay=a}))},Ki.duration=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].duration:R(this,"function"==typeof a?function(d,e,f){d[c][b].duration=Math.max(1,a.call(d,d.__data__,e,f))}:(a=Math.max(1,a),function(d){d[c][b].duration=a}))},Ki.each=function(a,b){var c=this.id,d=this.namespace;if(arguments.length<2){var e=Ii,f=Hi;try{Hi=c,R(this,function(b,e,f){Ii=b[d][c],a.call(b,b.__data__,e,f)})}finally{Ii=e,Hi=f}}else R(this,function(e){var f=e[d][c];(f.event||(f.event=bg.dispatch("start","end","interrupt"))).on(a,b)});return this},Ki.transition=function(){for(var a,b,c,d,e=this.id,f=++Li,g=this.namespace,h=[],i=0,j=this.length;j>i;i++){h.push(a=[]);for(var b=this[i],k=0,l=b.length;l>k;k++)(c=b[k])&&(d=c[g][e],Vf(c,k,g,f,{time:d.time,ease:d.ease,delay:d.delay+d.duration,duration:d.duration})),a.push(c)}return Rf(h,g,f)},bg.svg.axis=function(){function a(a){a.each(function(){var a,j=bg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):s:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Dg),q=bg.transition(o.exit()).style("opacity",Dg).remove(),r=bg.transition(o.order()).style("opacity",1),t=Math.max(e,0)+g,u=Le(l),v=j.selectAll(".domain").data([0]),w=(v.enter().append("path").attr("class","domain"),bg.transition(v));p.append("line"),p.append("text");var x,y,z,A,B=p.select("line"),C=r.select("line"),D=o.select("text").text(n),E=p.select("text"),F=r.select("text"),G="top"===d||"left"===d?-1:1;if("bottom"===d||"top"===d?(a=Wf,x="x",z="y",y="x2",A="y2",D.attr("dy",0>G?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+u[0]+","+G*f+"V0H"+u[1]+"V"+G*f)):(a=Xf,x="y",z="x",y="y2",A="x2",D.attr("dy",".32em").style("text-anchor",0>G?"end":"start"),w.attr("d","M"+G*f+","+u[0]+"H0V"+u[1]+"H"+G*f)),B.attr(A,G*e),E.attr(z,G*t),C.attr(y,0).attr(A,G*e),F.attr(x,0).attr(z,G*t),l.rangeBand){var H=l,I=H.rangeBand()/2;k=l=function(a){return H(a)+I}}else k.rangeBand?k=l:q.call(a,l,k);p.call(a,k,l),r.call(a,l,l)})}var b,c=bg.scale.linear(),d=Mi,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Ni?b+"":Mi,a):d},a.ticks=function(){return arguments.length?(h=arguments,a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Mi="bottom",Ni={top:1,right:1,bottom:1,left:1};bg.svg.brush=function(){function a(b){b.each(function(){var b=bg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",f).on("touchstart.brush",f),g=b.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),b.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=b.selectAll(".resize").data(p,s);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Oi[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var i,l=bg.transition(b),m=bg.transition(g);j&&(i=Le(j),m.attr("x",i[0]).attr("width",i[1]-i[0]),d(l)),k&&(i=Le(k),m.attr("y",i[0]).attr("height",i[1]-i[0]),e(l)),c(l)})}function c(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+l[+/e$/.test(a)]+","+m[+/^s/.test(a)]+")"})}function d(a){a.select(".extent").attr("x",l[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function e(a){a.select(".extent").attr("y",m[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function f(){function f(){32==bg.event.keyCode&&(D||(t=null,F[0]-=l[1],F[1]-=m[1],D=2),y())}function p(){32==bg.event.keyCode&&2==D&&(F[0]+=l[1],F[1]+=m[1],D=0,y())}function q(){var a=bg.mouse(v),b=!1;u&&(a[0]+=u[0],a[1]+=u[1]),D||(bg.event.altKey?(t||(t=[(l[0]+l[1])/2,(m[0]+m[1])/2]),F[0]=l[+(a[0]<t[0])],F[1]=m[+(a[1]<t[1])]):t=null),B&&r(a,j,0)&&(d(z),b=!0),C&&r(a,k,1)&&(e(z),b=!0),b&&(c(z),x({type:"brush",mode:D?"move":"resize"}))}function r(a,b,c){var d,e,f=Le(b),i=f[0],j=f[1],k=F[c],p=c?m:l,q=p[1]-p[0];return D&&(i-=k,j-=q+k),d=(c?o:n)?Math.max(i,Math.min(j,a[c])):a[c],D?e=(d+=k)+q:(t&&(k=Math.max(i,Math.min(j,2*t[c]-d))),d>k?(e=d,d=k):e=k),p[0]!=d||p[1]!=e?(c?h=null:g=null,p[0]=d,p[1]=e,!0):void 0}function s(){q(),z.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),bg.select("body").style("cursor",null),G.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),E(),x({type:"brushend"})}var t,u,v=this,w=bg.select(bg.event.target),x=i.of(v,arguments),z=bg.select(v),A=w.datum(),B=!/^(n|s)$/.test(A)&&j,C=!/^(e|w)$/.test(A)&&k,D=w.classed("extent"),E=X(v),F=bg.mouse(v),G=bg.select(b(v)).on("keydown.brush",f).on("keyup.brush",p);if(bg.event.changedTouches?G.on("touchmove.brush",q).on("touchend.brush",s):G.on("mousemove.brush",q).on("mouseup.brush",s),z.interrupt().selectAll("*").interrupt(),D)F[0]=l[0]-F[0],F[1]=m[0]-F[1];else if(A){var H=+/w$/.test(A),I=+/^n/.test(A);u=[l[1-H]-F[0],m[1-I]-F[1]],F[0]=l[H],F[1]=m[I]}else bg.event.altKey&&(t=F.slice());z.style("pointer-events","none").selectAll(".resize").style("display",null),bg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),q()}var g,h,i=A(a,"brushstart","brush","brushend"),j=null,k=null,l=[0,0],m=[0,0],n=!0,o=!0,p=Pi[0];return a.event=function(a){a.each(function(){var a=i.of(this,arguments),b={x:l,y:m,i:g,j:h},c=this.__chart__||b;this.__chart__=b,Hi?bg.select(this).transition().each("start.brush",function(){g=c.i,h=c.j,l=c.x,m=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=sd(l,b.x),d=sd(m,b.y);return g=h=null,function(e){l=b.x=c(e),m=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){g=b.i,h=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(j=b,p=Pi[!j<<1|!k],a):j},a.y=function(b){return arguments.length?(k=b,p=Pi[!j<<1|!k],a):k},a.clamp=function(b){return arguments.length?(j&&k?(n=!!b[0],o=!!b[1]):j?n=!!b:k&&(o=!!b),a):j&&k?[n,o]:j?n:k?o:null},a.extent=function(b){var c,d,e,f,i;return arguments.length?(j&&(c=b[0],d=b[1],k&&(c=c[0],d=d[0]),g=[c,d],j.invert&&(c=j(c),d=j(d)),c>d&&(i=c,c=d,d=i),c==l[0]&&d==l[1]||(l=[c,d])),k&&(e=b[0],f=b[1],j&&(e=e[1],f=f[1]),h=[e,f],k.invert&&(e=k(e),f=k(f)),e>f&&(i=e,e=f,f=i),e==m[0]&&f==m[1]||(m=[e,f])),a):(j&&(g?(c=g[0],d=g[1]):(c=l[0],d=l[1],j.invert&&(c=j.invert(c),d=j.invert(d)),c>d&&(i=c,c=d,d=i))),k&&(h?(e=h[0],f=h[1]):(e=m[0],f=m[1],k.invert&&(e=k.invert(e),f=k.invert(f)),e>f&&(i=e,e=f,f=i))),j&&k?[[c,e],[d,f]]:j?[c,d]:k&&[e,f])},a.clear=function(){return a.empty()||(l=[0,0],m=[0,0],g=h=null),a},a.empty=function(){return!!j&&l[0]==l[1]||!!k&&m[0]==m[1]},bg.rebind(a,i,"on")};var Oi={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Pi=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Qi=hh.format=nh.timeFormat,Ri=Qi.utc,Si=Ri("%Y-%m-%dT%H:%M:%S.%LZ");Qi.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Yf:Si,Yf.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Yf.toString=Si.toString,hh.second=Na(function(a){return new ih(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),hh.seconds=hh.second.range,hh.seconds.utc=hh.second.utc.range,hh.minute=Na(function(a){return new ih(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),hh.minutes=hh.minute.range,hh.minutes.utc=hh.minute.utc.range,hh.hour=Na(function(a){var b=a.getTimezoneOffset()/60;return new ih(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),hh.hours=hh.hour.range,hh.hours.utc=hh.hour.utc.range,hh.month=Na(function(a){return a=hh.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),hh.months=hh.month.range,hh.months.utc=hh.month.utc.range;var Ti=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ui=[[hh.second,1],[hh.second,5],[hh.second,15],[hh.second,30],[hh.minute,1],[hh.minute,5],[hh.minute,15],[hh.minute,30],[hh.hour,1],[hh.hour,3],[hh.hour,6],[hh.hour,12],[hh.day,1],[hh.day,2],[hh.week,1],[hh.month,1],[hh.month,3],[hh.year,1]],Vi=Qi.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Cb]]),Wi={range:function(a,b,c){return bg.range(Math.ceil(a/c)*c,+b,c).map($f)},floor:s,ceil:s};Ui.year=hh.year,hh.scale=function(){return Zf(bg.scale.linear(),Ui,Vi)};var Xi=Ui.map(function(a){return[a[0].utc,a[1]]}),Yi=Ri.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Cb]]);Xi.year=hh.year.utc,hh.scale.utc=function(){return Zf(bg.scale.linear(),Xi,Yi)},bg.text=Ba(function(a){return a.responseText}),bg.json=function(a,b){return Ca(a,"application/json",_f,b)},bg.html=function(a,b){return Ca(a,"text/html",ag,b)},bg.xml=Ba(function(a){return a.responseXML}),"function"==typeof define&&define.amd?define(bg):"object"==typeof module&&module.exports&&(module.exports=bg),this.d3=bg}(),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Hc.apply(null,arguments)}function b(a){Hc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ca(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a);a._isValid=!(isNaN(a._d.getTime())||!(b.overflow<0)||b.empty||b.invalidMonth||b.invalidWeekday||b.nullInput||b.invalidFormat||b.userInvalidated),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=j(b)),"undefined"!=typeof b._locale&&(a._locale=b._locale),Jc.length>0)for(c in Jc)d=Jc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Kc===!1&&(Kc=!0,a.updateOffset(this),Kc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function q(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=p(b)),c}function r(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&q(a[d])!==q(b[d]))&&g++;return g+f}function s(){}function t(a){return a?a.toLowerCase().replace("_","-"):a}function u(a){for(var b,c,d,e,f=0;f<a.length;){for(e=t(a[f]).split("-"),b=e.length,c=t(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=v(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&r(e,c,!0)>=b-1)break;b--}f++}return null}function v(a){var b=null;if(!Lc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ic._abbr,require("./locale/"+a),w(b)}catch(c){}return Lc[a]}function w(a,b){var c;return a&&(c="undefined"==typeof b?y(a):x(a,b),c&&(Ic=c)),Ic._abbr}function x(a,b){return null!==b?(b.abbr=a,Lc[a]=Lc[a]||new s,Lc[a].set(b),w(a),Lc[a]):(delete Lc[a],null)}function y(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ic;if(!c(a)){if(b=v(a))return b;a=[a]}return u(a)}function z(a,b){var c=a.toLowerCase();Mc[c]=Mc[c+"s"]=Mc[b]=a}function A(a){return"string"==typeof a?Mc[a]||Mc[a.toLowerCase()]:void 0}function B(a){var b,c,d={};for(c in a)f(a,c)&&(b=A(c),b&&(d[b]=a[c]));return d}function C(b,c){return function(d){return null!=d?(E(this,b,d),a.updateOffset(this,c),this):D(this,b)}}function D(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function E(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function F(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=A(a),"function"==typeof this[a])return this[a](b);return this}function G(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function H(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Qc[a]=e),b&&(Qc[b[0]]=function(){return G(e.apply(this,arguments),b[1],b[2])}),c&&(Qc[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function I(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function J(a){var b,c,d=a.match(Nc);for(b=0,c=d.length;c>b;b++)Qc[d[b]]?d[b]=Qc[d[b]]:d[b]=I(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function K(a,b){return a.isValid()?(b=L(b,a.localeData()),Pc[b]=Pc[b]||J(b), 18 Pc[b](a)):a.localeData().invalidDate()}function L(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Oc.lastIndex=0;d>=0&&Oc.test(a);)a=a.replace(Oc,c),Oc.lastIndex=0,d-=1;return a}function M(a){return"function"==typeof a&&"[object Function]"===Object.prototype.toString.call(a)}function N(a,b,c){dd[a]=M(b)?b:function(a){return a&&c?c:b}}function O(a,b){return f(dd,a)?dd[a](b._strict,b._locale):new RegExp(P(a))}function P(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=q(a)}),c=0;c<a.length;c++)ed[a[c]]=d}function R(a,b){Q(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function S(a,b,c){null!=b&&f(ed,a)&&ed[a](b,c._a,c,a)}function T(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function U(a){return this._months[a.month()]}function V(a){return this._monthsShort[a.month()]}function W(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function X(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),T(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function Y(b){return null!=b?(X(this,b),a.updateOffset(this,!0),this):D(this,"Month")}function Z(){return T(this.year(),this.month())}function $(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[gd]<0||c[gd]>11?gd:c[hd]<1||c[hd]>T(c[fd],c[gd])?hd:c[id]<0||c[id]>24||24===c[id]&&(0!==c[jd]||0!==c[kd]||0!==c[ld])?id:c[jd]<0||c[jd]>59?jd:c[kd]<0||c[kd]>59?kd:c[ld]<0||c[ld]>999?ld:-1,j(a)._overflowDayOfYear&&(fd>b||b>hd)&&(b=hd),j(a).overflow=b),a}function _(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function aa(a,b){var c=!0;return g(function(){return c&&(_(a+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ba(a,b){od[a]||(_(b),od[a]=!0)}function ca(a){var b,c,d=a._i,e=pd.exec(d);if(e){for(j(a).iso=!0,b=0,c=qd.length;c>b;b++)if(qd[b][1].exec(d)){a._f=qd[b][0];break}for(b=0,c=rd.length;c>b;b++)if(rd[b][1].exec(d)){a._f+=(e[6]||" ")+rd[b][0];break}d.match(ad)&&(a._f+="Z"),va(a)}else a._isValid=!1}function da(b){var c=sd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ca(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ea(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fa(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ga(a){return ha(a)?366:365}function ha(a){return a%4===0&&a%100!==0||a%400===0}function ia(){return ha(this.year())}function ja(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Da(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ka(a){return ja(a,this._week.dow,this._week.doy).week}function la(){return this._week.dow}function ma(){return this._week.doy}function na(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function oa(a){var b=ja(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function pa(a,b,c,d,e){var f,g=6+e-d,h=fa(a,0,1+g),i=h.getUTCDay();return e>i&&(i+=7),c=null!=c?1*c:e,f=1+g+7*(b-1)-i+c,{year:f>0?a:a-1,dayOfYear:f>0?f:ga(a-1)+f}}function qa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function ra(a,b,c){return null!=a?a:null!=b?b:c}function sa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ta(a){var b,c,d,e,f=[];if(!a._d){for(d=sa(a),a._w&&null==a._a[hd]&&null==a._a[gd]&&ua(a),a._dayOfYear&&(e=ra(a._a[fd],d[fd]),a._dayOfYear>ga(e)&&(j(a)._overflowDayOfYear=!0),c=fa(e,0,a._dayOfYear),a._a[gd]=c.getUTCMonth(),a._a[hd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[id]&&0===a._a[jd]&&0===a._a[kd]&&0===a._a[ld]&&(a._nextDay=!0,a._a[id]=0),a._d=(a._useUTC?fa:ea).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[id]=24)}}function ua(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ra(b.GG,a._a[fd],ja(Da(),1,4).year),d=ra(b.W,1),e=ra(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ra(b.gg,a._a[fd],ja(Da(),f,g).year),d=ra(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=pa(c,d,e,g,f),a._a[fd]=h.year,a._dayOfYear=h.dayOfYear}function va(b){if(b._f===a.ISO_8601)return void ca(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=L(b._f,b._locale).match(Nc)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(O(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Qc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),S(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[id]<=12&&b._a[id]>0&&(j(b).bigHour=void 0),b._a[id]=wa(b._locale,b._a[id],b._meridiem),ta(b),$(b)}function wa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function xa(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=m({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],va(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function ya(a){if(!a._d){var b=B(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ta(a)}}function za(a){var b=new n($(Aa(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Aa(a){var b=a._i,e=a._f;return a._locale=a._locale||y(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),o(b)?new n($(b)):(c(e)?xa(a):e?va(a):d(b)?a._d=b:Ba(a),a))}function Ba(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?da(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ta(b)):"object"==typeof f?ya(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ca(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,za(f)}function Da(a,b,c,d){return Ca(a,b,c,d,!1)}function Ea(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Da();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d}function Fa(){var a=[].slice.call(arguments,0);return Ea("isBefore",a)}function Ga(){var a=[].slice.call(arguments,0);return Ea("isAfter",a)}function Ha(a){var b=B(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=y(),this._bubble()}function Ia(a){return a instanceof Ha}function Ja(a,b){H(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+G(~~(a/60),2)+b+G(~~a%60,2)})}function Ka(a){var b=(a||"").match(ad)||[],c=b[b.length-1]||[],d=(c+"").match(xd)||["-",0,0],e=+(60*d[1])+q(d[2]);return"+"===d[0]?e:-e}function La(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Da(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Da(b).local()}function Ma(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Na(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ka(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ma(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?bb(this,Ya(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ma(this)}function Oa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Pa(a){return this.utcOffset(0,a)}function Qa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ma(this),"m")),this}function Ra(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ka(this._i)),this}function Sa(a){return a=a?Da(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Ta(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ua(){if("undefined"!=typeof this._isDSTShifted)return this._isDSTShifted;var a={};if(m(a,this),a=Aa(a),a._a){var b=a._isUTC?h(a._a):Da(a._a);this._isDSTShifted=this.isValid()&&r(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Va(){return!this._isUTC}function Wa(){return this._isUTC}function Xa(){return this._isUTC&&0===this._offset}function Ya(a,b){var c,d,e,g=a,h=null;return Ia(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=yd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:q(h[hd])*c,h:q(h[id])*c,m:q(h[jd])*c,s:q(h[kd])*c,ms:q(h[ld])*c}):(h=zd.exec(a))?(c="-"===h[1]?-1:1,g={y:Za(h[2],c),M:Za(h[3],c),d:Za(h[4],c),h:Za(h[5],c),m:Za(h[6],c),s:Za(h[7],c),w:Za(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=_a(Da(g.from),Da(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ha(g),Ia(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Za(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function $a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function _a(a,b){var c;return b=La(b,a),a.isBefore(b)?c=$a(a,b):(c=$a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function ab(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ba(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ya(c,d),bb(this,e,a),this}}function bb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&E(b,"Date",D(b,"Date")+g*d),h&&X(b,D(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function cb(a,b){var c=a||Da(),d=La(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse";return this.format(b&&b[f]||this.localeData().calendar(f,this,Da(c)))}function db(){return new n(this)}function eb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this>+a):(c=o(a)?+a:+Da(a),c<+this.clone().startOf(b))}function fb(a,b){var c;return b=A("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+a>+this):(c=o(a)?+a:+Da(a),+this.clone().endOf(b)<c)}function gb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function hb(a,b){var c;return b=A(b||"millisecond"),"millisecond"===b?(a=o(a)?a:Da(a),+this===+a):(c=+Da(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))}function ib(a,b,c){var d,e,f=La(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=A(b),"year"===b||"month"===b||"quarter"===b?(e=jb(this,f),"quarter"===b?e/=3:"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:p(e)}function jb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function kb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function lb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():K(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):K(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function mb(b){var c=K(this,b||a.defaultFormat);return this.localeData().postformat(c)}function nb(a,b){return this.isValid()?Ya({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ob(a){return this.from(Da(),a)}function pb(a,b){return this.isValid()?Ya({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function qb(a){return this.to(Da(),a)}function rb(a){var b;return void 0===a?this._locale._abbr:(b=y(a),null!=b&&(this._locale=b),this)}function sb(){return this._locale}function tb(a){switch(a=A(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function ub(a){return a=A(a),void 0===a||"millisecond"===a?this:this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")}function vb(){return+this._d-6e4*(this._offset||0)}function wb(){return Math.floor(+this/1e3)}function xb(){return this._offset?new Date(+this):this._d}function yb(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function zb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Ab(){return k(this)}function Bb(){return g({},j(this))}function Cb(){return j(this).overflow}function Db(a,b){H(0,[a,a.length],0,b)}function Eb(a,b,c){return ja(Da([a,11,31+b-c]),b,c).week}function Fb(a){var b=ja(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")}function Gb(a){var b=ja(this,1,4).year;return null==a?b:this.add(a-b,"y")}function Hb(){return Eb(this.year(),1,4)}function Ib(){var a=this.localeData()._week;return Eb(this.year(),a.dow,a.doy)}function Jb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Kb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Lb(a){return this._weekdays[a.day()]}function Mb(a){return this._weekdaysShort[a.day()]}function Nb(a){return this._weekdaysMin[a.day()]}function Ob(a){var b,c,d;for(this._weekdaysParse=this._weekdaysParse||[],b=0;7>b;b++)if(this._weekdaysParse[b]||(c=Da([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Pb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Kb(a,this.localeData()),this.add(a-b,"d")):b}function Qb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Rb(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Sb(a,b){H(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Tb(a,b){return b._meridiemParse}function Ub(a){return"p"===(a+"").toLowerCase().charAt(0)}function Vb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Wb(a,b){b[ld]=q(1e3*("0."+a))}function Xb(){return this._isUTC?"UTC":""}function Yb(){return this._isUTC?"Coordinated Universal Time":""}function Zb(a){return Da(1e3*a)}function $b(){return Da.apply(null,arguments).parseZone()}function _b(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function bc(){return this._invalidDate}function cc(a){return this._ordinal.replace("%d",a)}function dc(a){return a}function ec(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function gc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function hc(a,b,c,d){var e=y(),f=h().set(d,b);return e[c](f,a)}function ic(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return hc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=hc(a,f,c,e);return g}function jc(a,b){return ic(a,b,"months",12,"month")}function kc(a,b){return ic(a,b,"monthsShort",12,"month")}function lc(a,b){return ic(a,b,"weekdays",7,"day")}function mc(a,b){return ic(a,b,"weekdaysShort",7,"day")}function nc(a,b){return ic(a,b,"weekdaysMin",7,"day")}function oc(){var a=this._data;return this._milliseconds=Wd(this._milliseconds),this._days=Wd(this._days),this._months=Wd(this._months),a.milliseconds=Wd(a.milliseconds),a.seconds=Wd(a.seconds),a.minutes=Wd(a.minutes),a.hours=Wd(a.hours),a.months=Wd(a.months),a.years=Wd(a.years),this}function pc(a,b,c,d){var e=Ya(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function qc(a,b){return pc(this,a,b,1)}function rc(a,b){return pc(this,a,b,-1)}function sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*sc(vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=p(f/1e3),i.seconds=a%60,b=p(a/60),i.minutes=b%60,c=p(b/60),i.hours=c%24,g+=p(c/24),e=p(uc(g)),h+=e,g-=sc(vc(e)),d=p(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function uc(a){return 4800*a/146097}function vc(a){return 146097*a/4800}function wc(a){var b,c,d=this._milliseconds;if(a=A(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12)}function yc(a){return function(){return this.as(a)}}function zc(a){return a=A(a),this[a+"s"]()}function Ac(a){return function(){return this._data[a]}}function Bc(){return p(this.days()/7)}function Cc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Dc(a,b,c){var d=Ya(a).abs(),e=ke(d.as("s")),f=ke(d.as("m")),g=ke(d.as("h")),h=ke(d.as("d")),i=ke(d.as("M")),j=ke(d.as("y")),k=e<le.s&&["s",e]||1===f&&["m"]||f<le.m&&["mm",f]||1===g&&["h"]||g<le.h&&["hh",g]||1===h&&["d"]||h<le.d&&["dd",h]||1===i&&["M"]||i<le.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Cc.apply(null,k)}function Ec(a,b){return void 0===le[a]?!1:void 0===b?le[a]:(le[a]=b,!0)}function Fc(a){var b=this.localeData(),c=Dc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Gc(){var a,b,c,d=me(this._milliseconds)/1e3,e=me(this._days),f=me(this._months);a=p(d/60),b=p(a/60),d%=60,a%=60,c=p(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Hc,Ic,Jc=a.momentProperties=[],Kc=!1,Lc={},Mc={},Nc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pc={},Qc={},Rc=/\d/,Sc=/\d\d/,Tc=/\d{3}/,Uc=/\d{4}/,Vc=/[+-]?\d{6}/,Wc=/\d\d?/,Xc=/\d{1,3}/,Yc=/\d{1,4}/,Zc=/[+-]?\d{1,6}/,$c=/\d+/,_c=/[+-]?\d+/,ad=/Z|[+-]\d\d:?\d\d/gi,bd=/[+-]?\d+(\.\d{1,3})?/,cd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,dd={},ed={},fd=0,gd=1,hd=2,id=3,jd=4,kd=5,ld=6;H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),H("MMMM",0,0,function(a){return this.localeData().months(this,a)}),z("month","M"),N("M",Wc),N("MM",Wc,Sc),N("MMM",cd),N("MMMM",cd),Q(["M","MM"],function(a,b){b[gd]=q(a)-1}),Q(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[gd]=e:j(c).invalidMonth=a});var md="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),nd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),od={};a.suppressDeprecationWarnings=!1;var pd=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],rd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],sd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=aa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),z("year","y"),N("Y",_c),N("YY",Wc,Sc),N("YYYY",Yc,Uc),N("YYYYY",Zc,Vc),N("YYYYYY",Zc,Vc),Q(["YYYYY","YYYYYY"],fd),Q("YYYY",function(b,c){c[fd]=2===b.length?a.parseTwoDigitYear(b):q(b)}),Q("YY",function(b,c){c[fd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return q(a)+(q(a)>68?1900:2e3)};var td=C("FullYear",!1);H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),N("w",Wc),N("ww",Wc,Sc),N("W",Wc),N("WW",Wc,Sc),R(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=q(a)});var ud={dow:0,doy:6};H("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),N("DDD",Xc),N("DDDD",Tc),Q(["DDD","DDDD"],function(a,b,c){c._dayOfYear=q(a)}),a.ISO_8601=function(){};var vd=aa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return this>a?this:a}),wd=aa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Da.apply(null,arguments);return a>this?this:a});Ja("Z",":"),Ja("ZZ",""),N("Z",ad),N("ZZ",ad),Q(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ka(a)});var xd=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var yd=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,zd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ya.fn=Ha.prototype;var Ad=ab(1,"add"),Bd=ab(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Cd=aa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Db("gggg","weekYear"),Db("ggggg","weekYear"),Db("GGGG","isoWeekYear"),Db("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),N("G",_c),N("g",_c),N("GG",Wc,Sc),N("gg",Wc,Sc),N("GGGG",Yc,Uc),N("gggg",Yc,Uc),N("GGGGG",Zc,Vc),N("ggggg",Zc,Vc),R(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=q(a)}),R(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),H("Q",0,0,"quarter"),z("quarter","Q"),N("Q",Rc),Q("Q",function(a,b){b[gd]=3*(q(a)-1)}),H("D",["DD",2],"Do","date"),z("date","D"),N("D",Wc),N("DD",Wc,Sc),N("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),Q(["D","DD"],hd),Q("Do",function(a,b){b[hd]=q(a.match(Wc)[0],10)});var Dd=C("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),H("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),H("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),N("d",Wc),N("e",Wc),N("E",Wc),N("dd",cd),N("ddd",cd),N("dddd",cd),R(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),R(["d","e","E"],function(a,b,c,d){b[d]=q(a)});var Ed="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Gd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");H("H",["HH",2],0,"hour"),H("h",["hh",2],0,function(){return this.hours()%12||12}),Sb("a",!0),Sb("A",!1),z("hour","h"),N("a",Tb),N("A",Tb),N("H",Wc),N("h",Wc),N("HH",Wc,Sc),N("hh",Wc,Sc),Q(["H","HH"],id),Q(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),Q(["h","hh"],function(a,b,c){b[id]=q(a),j(c).bigHour=!0});var Hd=/[ap]\.?m?\.?/i,Id=C("Hours",!0);H("m",["mm",2],0,"minute"),z("minute","m"),N("m",Wc),N("mm",Wc,Sc),Q(["m","mm"],jd);var Jd=C("Minutes",!1);H("s",["ss",2],0,"second"),z("second","s"),N("s",Wc),N("ss",Wc,Sc),Q(["s","ss"],kd);var Kd=C("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),z("millisecond","ms"),N("S",Xc,Rc),N("SS",Xc,Sc),N("SSS",Xc,Tc);var Ld;for(Ld="SSSS";Ld.length<=9;Ld+="S")N(Ld,$c);for(Ld="S";Ld.length<=9;Ld+="S")Q(Ld,Wb);var Md=C("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Nd=n.prototype;Nd.add=Ad,Nd.calendar=cb,Nd.clone=db,Nd.diff=ib,Nd.endOf=ub,Nd.format=mb,Nd.from=nb,Nd.fromNow=ob,Nd.to=pb,Nd.toNow=qb,Nd.get=F,Nd.invalidAt=Cb,Nd.isAfter=eb,Nd.isBefore=fb,Nd.isBetween=gb,Nd.isSame=hb,Nd.isValid=Ab,Nd.lang=Cd,Nd.locale=rb,Nd.localeData=sb,Nd.max=wd,Nd.min=vd,Nd.parsingFlags=Bb,Nd.set=F,Nd.startOf=tb,Nd.subtract=Bd,Nd.toArray=yb,Nd.toObject=zb,Nd.toDate=xb,Nd.toISOString=lb,Nd.toJSON=lb,Nd.toString=kb,Nd.unix=wb,Nd.valueOf=vb,Nd.year=td,Nd.isLeapYear=ia,Nd.weekYear=Fb,Nd.isoWeekYear=Gb,Nd.quarter=Nd.quarters=Jb,Nd.month=Y,Nd.daysInMonth=Z,Nd.week=Nd.weeks=na,Nd.isoWeek=Nd.isoWeeks=oa,Nd.weeksInYear=Ib,Nd.isoWeeksInYear=Hb,Nd.date=Dd,Nd.day=Nd.days=Pb,Nd.weekday=Qb,Nd.isoWeekday=Rb,Nd.dayOfYear=qa,Nd.hour=Nd.hours=Id,Nd.minute=Nd.minutes=Jd,Nd.second=Nd.seconds=Kd,Nd.millisecond=Nd.milliseconds=Md,Nd.utcOffset=Na,Nd.utc=Pa,Nd.local=Qa,Nd.parseZone=Ra,Nd.hasAlignedHourOffset=Sa,Nd.isDST=Ta,Nd.isDSTShifted=Ua,Nd.isLocal=Va,Nd.isUtcOffset=Wa,Nd.isUtc=Xa,Nd.isUTC=Xa,Nd.zoneAbbr=Xb,Nd.zoneName=Yb,Nd.dates=aa("dates accessor is deprecated. Use date instead.",Dd),Nd.months=aa("months accessor is deprecated. Use month instead",Y),Nd.years=aa("years accessor is deprecated. Use year instead",td),Nd.zone=aa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Oa);var Od=Nd,Pd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Qd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Rd="Invalid date",Sd="%d",Td=/\d{1,2}/,Ud={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Vd=s.prototype;Vd._calendar=Pd,Vd.calendar=_b,Vd._longDateFormat=Qd,Vd.longDateFormat=ac,Vd._invalidDate=Rd,Vd.invalidDate=bc,Vd._ordinal=Sd,Vd.ordinal=cc,Vd._ordinalParse=Td,Vd.preparse=dc,Vd.postformat=dc,Vd._relativeTime=Ud,Vd.relativeTime=ec,Vd.pastFuture=fc,Vd.set=gc,Vd.months=U,Vd._months=md,Vd.monthsShort=V,Vd._monthsShort=nd,Vd.monthsParse=W,Vd.week=ka,Vd._week=ud,Vd.firstDayOfYear=ma,Vd.firstDayOfWeek=la,Vd.weekdays=Lb,Vd._weekdays=Ed,Vd.weekdaysMin=Nb,Vd._weekdaysMin=Gd,Vd.weekdaysShort=Mb,Vd._weekdaysShort=Fd,Vd.weekdaysParse=Ob,Vd.isPM=Ub,Vd._meridiemParse=Hd,Vd.meridiem=Vb,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===q(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=aa("moment.lang is deprecated. Use moment.locale instead.",w),a.langData=aa("moment.langData is deprecated. Use moment.localeData instead.",y);var Wd=Math.abs,Xd=yc("ms"),Yd=yc("s"),Zd=yc("m"),$d=yc("h"),_d=yc("d"),ae=yc("w"),be=yc("M"),ce=yc("y"),de=Ac("milliseconds"),ee=Ac("seconds"),fe=Ac("minutes"),ge=Ac("hours"),he=Ac("days"),ie=Ac("months"),je=Ac("years"),ke=Math.round,le={s:45,m:45,h:22,d:26,M:11},me=Math.abs,ne=Ha.prototype;ne.abs=oc,ne.add=qc,ne.subtract=rc,ne.as=wc,ne.asMilliseconds=Xd,ne.asSeconds=Yd,ne.asMinutes=Zd,ne.asHours=$d,ne.asDays=_d,ne.asWeeks=ae,ne.asMonths=be,ne.asYears=ce,ne.valueOf=xc,ne._bubble=tc,ne.get=zc,ne.milliseconds=de,ne.seconds=ee,ne.minutes=fe,ne.hours=ge,ne.days=he,ne.weeks=Bc,ne.months=ie,ne.years=je,ne.humanize=Fc,ne.toISOString=Gc,ne.toString=Gc,ne.toJSON=Gc,ne.locale=rb,ne.localeData=sb,ne.toIsoString=aa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Gc),ne.lang=Cd,H("X",0,0,"unix"),H("x",0,0,"valueOf"),N("x",_c),N("X",bd),Q("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),Q("x",function(a,b,c){c._d=new Date(q(a))}),a.version="2.10.6",b(Da),a.fn=Od,a.min=Fa,a.max=Ga,a.utc=h,a.unix=Zb,a.months=jc,a.isDate=d,a.locale=w,a.invalid=l,a.duration=Ya,a.isMoment=o,a.weekdays=lc,a.parseZone=$b,a.localeData=y,a.isDuration=Ia,a.monthsShort=kc,a.weekdaysMin=nc,a.defineLocale=x,a.weekdaysShort=mc,a.normalizeUnits=A,a.relativeTimeThreshold=Ec;var oe=a;return oe}),function(a){"function"==typeof define&&define.amd?define(["jquery","moment"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("moment")):a(jQuery,moment)}(function(a,b){function c(a){return Q(a,Oa)}function d(b){var c,d={views:b.views||{}};return a.each(b,function(b,e){"views"!=b&&(a.isPlainObject(e)&&!/(time|duration|interval)$/i.test(b)&&-1==a.inArray(b,Oa)?(c=null,a.each(e,function(a,e){/^(month|week|day|default|basic(Week|Day)?|agenda(Week|Day)?)$/.test(a)?(d.views[a]||(d.views[a]={}),d.views[a][b]=e):(c||(c={}),c[a]=e)}),c&&(d[b]=c)):d[b]=e)}),d}function e(a,b){b.left&&a.css({"border-left-width":1,"margin-left":b.left-1}),b.right&&a.css({"border-right-width":1,"margin-right":b.right-1})}function f(a){a.css({"margin-left":"","margin-right":"","border-left-width":"","border-right-width":""})}function g(){a("body").addClass("fc-not-allowed")}function h(){a("body").removeClass("fc-not-allowed")}function i(b,c,d){var e=Math.floor(c/b.length),f=Math.floor(c-e*(b.length-1)),g=[],h=[],i=[],k=0;j(b),b.each(function(c,d){var j=c===b.length-1?f:e,l=a(d).outerHeight(!0);j>l?(g.push(d),h.push(l),i.push(a(d).height())):k+=l}),d&&(c-=k,e=Math.floor(c/g.length),f=Math.floor(c-e*(g.length-1))), 19 a(g).each(function(b,c){var d=b===g.length-1?f:e,j=h[b],k=i[b],l=d-(j-k);d>j&&a(c).height(l)})}function j(a){a.height("")}function k(b){var c=0;return b.find("> *").each(function(b,d){var e=a(d).outerWidth();e>c&&(c=e)}),c++,b.width(c),c}function l(a,b){return a.height(b).addClass("fc-scroller"),a[0].scrollHeight-1>a[0].clientHeight?!0:(m(a),!1)}function m(a){a.height("").removeClass("fc-scroller")}function n(b){var c=b.css("position"),d=b.parents().filter(function(){var b=a(this);return/(auto|scroll)/.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&d.length?d:a(b[0].ownerDocument||document)}function o(a){var b=a.offset();return{left:b.left,right:b.left+a.outerWidth(),top:b.top,bottom:b.top+a.outerHeight()}}function p(a){var b=a.offset(),c=r(a),d=b.left+u(a,"border-left-width")+c.left,e=b.top+u(a,"border-top-width")+c.top;return{left:d,right:d+a[0].clientWidth,top:e,bottom:e+a[0].clientHeight}}function q(a){var b=a.offset(),c=b.left+u(a,"border-left-width")+u(a,"padding-left"),d=b.top+u(a,"border-top-width")+u(a,"padding-top");return{left:c,right:c+a.width(),top:d,bottom:d+a.height()}}function r(a){var b=a.innerWidth()-a[0].clientWidth,c={left:0,right:0,top:0,bottom:a.innerHeight()-a[0].clientHeight};return s()&&"rtl"==a.css("direction")?c.left=b:c.right=b,c}function s(){return null===Pa&&(Pa=t()),Pa}function t(){var b=a("<div><div/></div>").css({position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}).appendTo("body"),c=b.children(),d=c.offset().left>b.offset().left;return b.remove(),d}function u(a,b){return parseFloat(a.css(b))||0}function v(a){return 1==a.which&&!a.ctrlKey}function w(a,b){var c={left:Math.max(a.left,b.left),right:Math.min(a.right,b.right),top:Math.max(a.top,b.top),bottom:Math.min(a.bottom,b.bottom)};return c.left<c.right&&c.top<c.bottom?c:!1}function x(a,b){return{left:Math.min(Math.max(a.left,b.left),b.right),top:Math.min(Math.max(a.top,b.top),b.bottom)}}function y(a){return{left:(a.left+a.right)/2,top:(a.top+a.bottom)/2}}function z(a,b){return{left:a.left-b.left,top:a.top-b.top}}function A(b){var c,d,e=[],f=[];for("string"==typeof b?f=b.split(/\s*,\s*/):"function"==typeof b?f=[b]:a.isArray(b)&&(f=b),c=0;c<f.length;c++)d=f[c],"string"==typeof d?e.push("-"==d.charAt(0)?{field:d.substring(1),order:-1}:{field:d,order:1}):"function"==typeof d&&e.push({func:d});return e}function B(a,b,c){var d,e;for(d=0;d<c.length;d++)if(e=C(a,b,c[d]))return e;return 0}function C(a,b,c){return c.func?c.func(a,b):D(a[c.field],b[c.field])*(c.order||1)}function D(b,c){return b||c?null==c?-1:null==b?1:"string"===a.type(b)||"string"===a.type(c)?String(b).localeCompare(String(c)):b-c:0}function E(a,b){var c,d,e,f,g=a.start,h=a.end,i=b.start,j=b.end;return h>i&&j>g?(g>=i?(c=g.clone(),e=!0):(c=i.clone(),e=!1),j>=h?(d=h.clone(),f=!0):(d=j.clone(),f=!1),{start:c,end:d,isStart:e,isEnd:f}):void 0}function F(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),"days"),ms:a.time()-c.time()})}function G(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),"days")})}function H(a,c,d){return b.duration(Math.round(a.diff(c,d,!0)),d)}function I(a,b){var c,d,e;for(c=0;c<Ra.length&&(d=Ra[c],e=J(d,a,b),!(e>=1&&ba(e)));c++);return d}function J(a,c,d){return null!=d?d.diff(c,a,!0):b.isDuration(c)?c.as(a):c.end.diff(c.start,a,!0)}function K(a,b,c){var d;return N(c)?(b-a)/c:(d=c.asMonths(),Math.abs(d)>=1&&ba(d)?b.diff(a,"months",!0)/d:b.diff(a,"days",!0)/c.asDays())}function L(a,b){var c,d;return N(a)||N(b)?a/b:(c=a.asMonths(),d=b.asMonths(),Math.abs(c)>=1&&ba(c)&&Math.abs(d)>=1&&ba(d)?c/d:a.asDays()/b.asDays())}function M(a,c){var d;return N(a)?b.duration(a*c):(d=a.asMonths(),Math.abs(d)>=1&&ba(d)?b.duration({months:d*c}):b.duration({days:a.asDays()*c}))}function N(a){return Boolean(a.hours()||a.minutes()||a.seconds()||a.milliseconds())}function O(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function P(a){return/^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(a)}function Q(a,b){var c,d,e,f,g,h,i={};if(b)for(c=0;c<b.length;c++){for(d=b[c],e=[],f=a.length-1;f>=0;f--)if(g=a[f][d],"object"==typeof g)e.unshift(g);else if(void 0!==g){i[d]=g;break}e.length&&(i[d]=Q(e))}for(c=a.length-1;c>=0;c--){h=a[c];for(d in h)d in i||(i[d]=h[d])}return i}function R(a){var b=function(){};return b.prototype=a,new b}function S(a,b){for(var c in a)U(a,c)&&(b[c]=a[c])}function T(a,b){var c,d,e=["constructor","toString","valueOf"];for(c=0;c<e.length;c++)d=e[c],a[d]!==Object.prototype[d]&&(b[d]=a[d])}function U(a,b){return Va.call(a,b)}function V(b){return/undefined|null|boolean|number|string/.test(a.type(b))}function W(b,c,d){if(a.isFunction(b)&&(b=[b]),b){var e,f;for(e=0;e<b.length;e++)f=b[e].apply(c,d)||f;return f}}function X(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]}function Y(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\n/g,"<br />")}function Z(a){return a.replace(/&.*?;/g,"")}function $(b){var c=[];return a.each(b,function(a,b){null!=b&&c.push(a+":"+b)}),c.join(";")}function _(a){return a.charAt(0).toUpperCase()+a.slice(1)}function aa(a,b){return a-b}function ba(a){return a%1===0}function ca(a,b){var c=a[b];return function(){return c.apply(a,arguments)}}function da(a,b){var c,d,e,f,g=function(){var h=+new Date-f;b>h&&h>0?c=setTimeout(g,b-h):(c=null,a.apply(e,d),c||(e=d=null))};return function(){e=this,d=arguments,f=+new Date,c||(c=setTimeout(g,b))}}function ea(c,d,e){var f,g,h,i,j=c[0],k=1==c.length&&"string"==typeof j;return b.isMoment(j)?(i=b.apply(null,c),ga(j,i)):O(j)||void 0===j?i=b.apply(null,c):(f=!1,g=!1,k?Wa.test(j)?(j+="-01",c=[j],f=!0,g=!0):(h=Xa.exec(j))&&(f=!h[5],g=!0):a.isArray(j)&&(g=!0),i=d||f?b.utc.apply(b,c):b.apply(null,c),f?(i._ambigTime=!0,i._ambigZone=!0):e&&(g?i._ambigZone=!0:k&&(i.utcOffset?i.utcOffset(j):i.zone(j)))),i._fullCalendar=!0,i}function fa(a,c){var d,e,f=!1,g=!1,h=a.length,i=[];for(d=0;h>d;d++)e=a[d],b.isMoment(e)||(e=Ma.moment.parseZone(e)),f=f||e._ambigTime,g=g||e._ambigZone,i.push(e);for(d=0;h>d;d++)e=i[d],c||!f||e._ambigTime?g&&!e._ambigZone&&(i[d]=e.clone().stripZone()):i[d]=e.clone().stripTime();return i}function ga(a,b){a._ambigTime?b._ambigTime=!0:b._ambigTime&&(b._ambigTime=!1),a._ambigZone?b._ambigZone=!0:b._ambigZone&&(b._ambigZone=!1)}function ha(a,b){a.year(b[0]||0).month(b[1]||0).date(b[2]||0).hours(b[3]||0).minutes(b[4]||0).seconds(b[5]||0).milliseconds(b[6]||0)}function ia(a,b){return Za.format.call(a,b)}function ja(a,b){return ka(a,pa(b))}function ka(a,b){var c,d="";for(c=0;c<b.length;c++)d+=la(a,b[c]);return d}function la(a,b){var c,d;return"string"==typeof b?b:(c=b.token)?$a[c]?$a[c](a):ia(a,c):b.maybe&&(d=ka(a,b.maybe),d.match(/[1-9]/))?d:""}function ma(a,b,c,d,e){var f;return a=Ma.moment.parseZone(a),b=Ma.moment.parseZone(b),f=(a.localeData||a.lang).call(a),c=f.longDateFormat(c)||c,d=d||" - ",na(a,b,pa(c),d,e)}function na(a,b,c,d,e){var f,g,h,i,j="",k="",l="",m="",n="";for(g=0;g<c.length&&(f=oa(a,b,c[g]),f!==!1);g++)j+=f;for(h=c.length-1;h>g&&(f=oa(a,b,c[h]),f!==!1);h--)k=f+k;for(i=g;h>=i;i++)l+=la(a,c[i]),m+=la(b,c[i]);return(l||m)&&(n=e?m+d+l:l+d+m),j+n+k}function oa(a,b,c){var d,e;return"string"==typeof c?c:(d=c.token)&&(e=_a[d.charAt(0)],e&&a.isSame(b,e))?ia(a,d):!1}function pa(a){return a in ab?ab[a]:ab[a]=qa(a)}function qa(a){for(var b,c=[],d=/\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g;b=d.exec(a);)b[1]?c.push(b[1]):b[2]?c.push({maybe:qa(b[2])}):b[3]?c.push({token:b[3]}):b[5]&&c.push(b[5]);return c}function ra(){}function sa(a,b){return a||b?a&&b?a.grid===b.grid&&a.row===b.row&&a.col===b.col:!1:!0}function ta(a){var b=va(a);return"background"===b||"inverse-background"===b}function ua(a){return"inverse-background"===va(a)}function va(a){return X((a.source||{}).rendering,a.rendering)}function wa(a){var b,c,d={};for(b=0;b<a.length;b++)c=a[b],(d[c._id]||(d[c._id]=[])).push(c);return d}function xa(a,b){return a.eventStartMS-b.eventStartMS}function ya(c){var d,e,f,g,h=Ma.dataAttrPrefix;return h&&(h+="-"),d=c.data(h+"event")||null,d&&(d="object"==typeof d?a.extend({},d):{},e=d.start,null==e&&(e=d.time),f=d.duration,g=d.stick,delete d.start,delete d.time,delete d.duration,delete d.stick),null==e&&(e=c.data(h+"start")),null==e&&(e=c.data(h+"time")),null==f&&(f=c.data(h+"duration")),null==g&&(g=c.data(h+"stick")),e=null!=e?b.duration(e):null,f=null!=f?b.duration(f):null,g=Boolean(g),{eventProps:d,startTime:e,duration:f,stick:g}}function za(a,b){var c,d;for(c=0;c<b.length;c++)if(d=b[c],d.leftCol<=a.rightCol&&d.rightCol>=a.leftCol)return!0;return!1}function Aa(a,b){return a.leftCol-b.leftCol}function Ba(a){var b,c,d,e=[];for(b=0;b<a.length;b++){for(c=a[b],d=0;d<e.length&&Ea(c,e[d]).length;d++);c.level=d,(e[d]||(e[d]=[])).push(c)}return e}function Ca(a){var b,c,d,e,f;for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)for(e=c[d],e.forwardSegs=[],f=b+1;f<a.length;f++)Ea(e,a[f],e.forwardSegs)}function Da(a){var b,c,d=a.forwardSegs,e=0;if(void 0===a.forwardPressure){for(b=0;b<d.length;b++)c=d[b],Da(c),e=Math.max(e,1+c.forwardPressure);a.forwardPressure=e}}function Ea(a,b,c){c=c||[];for(var d=0;d<b.length;d++)Fa(a,b[d])&&c.push(b[d]);return c}function Fa(a,b){return a.bottom>b.top&&a.top<b.bottom}function Ga(c,d){function e(){U?h()&&(k(),i()):f()}function f(){V=O.theme?"ui":"fc",c.addClass("fc"),O.isRTL?c.addClass("fc-rtl"):c.addClass("fc-ltr"),O.theme?c.addClass("ui-widget"):c.addClass("fc-unthemed"),U=a("<div class='fc-view-container'/>").prependTo(c),S=N.header=new Ja(N,O),T=S.render(),T&&c.prepend(T),i(O.defaultView),O.handleWindowResize&&(Y=da(m,O.windowResizeDelay),a(window).resize(Y))}function g(){W&&W.removeElement(),S.removeElement(),U.remove(),c.removeClass("fc fc-ltr fc-rtl fc-unthemed ui-widget"),Y&&a(window).unbind("resize",Y)}function h(){return c.is(":visible")}function i(b){ca++,W&&b&&W.type!==b&&(S.deactivateButton(W.type),H(),W.removeElement(),W=N.view=null),!W&&b&&(W=N.view=ba[b]||(ba[b]=N.instantiateView(b)),W.setElement(a("<div class='fc-view fc-"+b+"-view' />").appendTo(U)),S.activateButton(b)),W&&(Z=W.massageCurrentDate(Z),W.displaying&&Z.isWithin(W.intervalStart,W.intervalEnd)||h()&&(H(),W.display(Z),I(),u(),v(),q())),I(),ca--}function j(a){return h()?(a&&l(),ca++,W.updateSize(!0),ca--,!0):void 0}function k(){h()&&l()}function l(){X="number"==typeof O.contentHeight?O.contentHeight:"number"==typeof O.height?O.height-(T?T.outerHeight(!0):0):Math.round(U.width()/Math.max(O.aspectRatio,.5))}function m(a){!ca&&a.target===window&&W.start&&j(!0)&&W.trigger("windowResize",aa)}function n(){p(),r()}function o(){h()&&(H(),W.displayEvents(ea),I())}function p(){H(),W.clearEvents(),I()}function q(){!O.lazyFetching||$(W.start,W.end)?r():o()}function r(){_(W.start,W.end)}function s(a){ea=a,o()}function t(){o()}function u(){S.updateTitle(W.title)}function v(){var a=N.getNow();a.isWithin(W.intervalStart,W.intervalEnd)?S.disableButton("today"):S.enableButton("today")}function w(a,b){W.select(N.buildSelectRange.apply(N,arguments))}function x(){W&&W.unselect()}function y(){Z=W.computePrevDate(Z),i()}function z(){Z=W.computeNextDate(Z),i()}function A(){Z.add(-1,"years"),i()}function B(){Z.add(1,"years"),i()}function C(){Z=N.getNow(),i()}function D(a){Z=N.moment(a),i()}function E(a){Z.add(b.duration(a)),i()}function F(a,b){var c;b=b||"day",c=N.getViewSpec(b)||N.getUnitViewSpec(b),Z=a,i(c?c.type:null)}function G(){return Z.clone()}function H(){U.css({width:"100%",height:U.height(),overflow:"hidden"})}function I(){U.css({width:"",height:"",overflow:""})}function J(){return N}function K(){return W}function L(a,b){return void 0===b?O[a]:void("height"!=a&&"contentHeight"!=a&&"aspectRatio"!=a||(O[a]=b,j(!0)))}function M(a,b){var c=Array.prototype.slice.call(arguments,2);return b=b||aa,this.triggerWith(a,b,c),O[a]?O[a].apply(b,c):void 0}var N=this;N.initOptions(d||{});var O=this.options;N.render=e,N.destroy=g,N.refetchEvents=n,N.reportEvents=s,N.reportEventChange=t,N.rerenderEvents=o,N.changeView=i,N.select=w,N.unselect=x,N.prev=y,N.next=z,N.prevYear=A,N.nextYear=B,N.today=C,N.gotoDate=D,N.incrementDate=E,N.zoomTo=F,N.getDate=G,N.getCalendar=J,N.getView=K,N.option=L,N.trigger=M;var P=R(Ia(O.lang));if(O.monthNames&&(P._months=O.monthNames),O.monthNamesShort&&(P._monthsShort=O.monthNamesShort),O.dayNames&&(P._weekdays=O.dayNames),O.dayNamesShort&&(P._weekdaysShort=O.dayNamesShort),null!=O.firstDay){var Q=R(P._week);Q.dow=O.firstDay,P._week=Q}P._fullCalendar_weekCalc=function(a){return"function"==typeof a?a:"local"===a?a:"iso"===a||"ISO"===a?"ISO":void 0}(O.weekNumberCalculation),N.defaultAllDayEventDuration=b.duration(O.defaultAllDayEventDuration),N.defaultTimedEventDuration=b.duration(O.defaultTimedEventDuration),N.moment=function(){var a;return"local"===O.timezone?(a=Ma.moment.apply(null,arguments),a.hasTime()&&a.local()):a="UTC"===O.timezone?Ma.moment.utc.apply(null,arguments):Ma.moment.parseZone.apply(null,arguments),"_locale"in a?a._locale=P:a._lang=P,a},N.getIsAmbigTimezone=function(){return"local"!==O.timezone&&"UTC"!==O.timezone},N.rezoneDate=function(a){return N.moment(a.toArray())},N.getNow=function(){var a=O.now;return"function"==typeof a&&(a=a()),N.moment(a)},N.getEventEnd=function(a){return a.end?a.end.clone():N.getDefaultEventEnd(a.allDay,a.start)},N.getDefaultEventEnd=function(a,b){var c=b.clone();return a?c.stripTime().add(N.defaultAllDayEventDuration):c.add(N.defaultTimedEventDuration),N.getIsAmbigTimezone()&&c.stripZone(),c},N.humanizeDuration=function(a){return(a.locale||a.lang).call(a,O.lang).humanize()},Ka.call(N,O);var S,T,U,V,W,X,Y,Z,$=N.isFetchNeeded,_=N.fetchEvents,aa=c[0],ba={},ca=0,ea=[];Z=null!=O.defaultDate?N.moment(O.defaultDate):N.getNow(),N.getSuggestedViewHeight=function(){return void 0===X&&k(),X},N.isHeightAuto=function(){return"auto"===O.contentHeight||"auto"===O.height},N.initialize()}function Ha(b){a.each(rb,function(a,c){null==b[a]&&(b[a]=c(b))})}function Ia(a){var c=b.localeData||b.langData;return c.call(b,a)||c.call(b,"en")}function Ja(b,c){function d(){var b=c.header;return n=c.theme?"ui":"fc",b?o=a("<div class='fc-toolbar'/>").append(f("left")).append(f("right")).append(f("center")).append('<div class="fc-clear"/>'):void 0}function e(){o.remove(),o=a()}function f(d){var e=a('<div class="fc-'+d+'"/>'),f=c.header[d];return f&&a.each(f.split(" "),function(d){var f,g=a(),h=!0;a.each(this.split(","),function(d,e){var f,i,j,k,l,m,o,q,r,s;"title"==e?(g=g.add(a("<h2> </h2>")),h=!1):((f=(b.options.customButtons||{})[e])?(j=function(a){f.click&&f.click.call(s[0],a)},k="",l=f.text):(i=b.getViewSpec(e))?(j=function(){b.changeView(e)},p.push(e),k=i.buttonTextOverride,l=i.buttonTextDefault):b[e]&&(j=function(){b[e]()},k=(b.overrides.buttonText||{})[e],l=c.buttonText[e]),j&&(m=f?f.themeIcon:c.themeButtonIcons[e],o=f?f.icon:c.buttonIcons[e],q=k?Y(k):m&&c.theme?"<span class='ui-icon ui-icon-"+m+"'></span>":o&&!c.theme?"<span class='fc-icon fc-icon-"+o+"'></span>":Y(l),r=["fc-"+e+"-button",n+"-button",n+"-state-default"],s=a('<button type="button" class="'+r.join(" ")+'">'+q+"</button>").click(function(a){s.hasClass(n+"-state-disabled")||(j(a),(s.hasClass(n+"-state-active")||s.hasClass(n+"-state-disabled"))&&s.removeClass(n+"-state-hover"))}).mousedown(function(){s.not("."+n+"-state-active").not("."+n+"-state-disabled").addClass(n+"-state-down")}).mouseup(function(){s.removeClass(n+"-state-down")}).hover(function(){s.not("."+n+"-state-active").not("."+n+"-state-disabled").addClass(n+"-state-hover")},function(){s.removeClass(n+"-state-hover").removeClass(n+"-state-down")}),g=g.add(s)))}),h&&g.first().addClass(n+"-corner-left").end().last().addClass(n+"-corner-right").end(),g.length>1?(f=a("<div/>"),h&&f.addClass("fc-button-group"),f.append(g),e.append(f)):e.append(g)}),e}function g(a){o.find("h2").text(a)}function h(a){o.find(".fc-"+a+"-button").addClass(n+"-state-active")}function i(a){o.find(".fc-"+a+"-button").removeClass(n+"-state-active")}function j(a){o.find(".fc-"+a+"-button").attr("disabled","disabled").addClass(n+"-state-disabled")}function k(a){o.find(".fc-"+a+"-button").removeAttr("disabled").removeClass(n+"-state-disabled")}function l(){return p}var m=this;m.render=d,m.removeElement=e,m.updateTitle=g,m.activateButton=h,m.deactivateButton=i,m.disableButton=j,m.enableButton=k,m.getViewsWithButtons=l;var n,o=a(),p=[]}function Ka(c){function d(a,b){return!M||a.clone().stripZone()<M.clone().stripZone()||b.clone().stripZone()>N.clone().stripZone()}function e(a,b){M=a,N=b,U=[];var c=++S,d=R.length;T=d;for(var e=0;d>e;e++)f(R[e],c)}function f(b,c){g(b,function(d){var e,f,g,h=a.isArray(b.events);if(c==S){if(d)for(e=0;e<d.length;e++)f=d[e],g=h?f:s(f,b),g&&U.push.apply(U,x(g));T--,T||O(U)}})}function g(b,d){var e,f,h=Ma.sourceFetchers;for(e=0;e<h.length;e++){if(f=h[e].call(L,b,M.clone(),N.clone(),c.timezone,d),f===!0)return;if("object"==typeof f)return void g(f,d)}var i=b.events;if(i)a.isFunction(i)?(L.pushLoading(),i.call(L,M.clone(),N.clone(),c.timezone,function(a){d(a),L.popLoading()})):a.isArray(i)?d(i):d();else{var j=b.url;if(j){var k,l=b.success,m=b.error,n=b.complete;k=a.isFunction(b.data)?b.data():b.data;var o=a.extend({},k||{}),p=X(b.startParam,c.startParam),q=X(b.endParam,c.endParam),r=X(b.timezoneParam,c.timezoneParam);p&&(o[p]=M.format()),q&&(o[q]=N.format()),c.timezone&&"local"!=c.timezone&&(o[r]=c.timezone),L.pushLoading(),a.ajax(a.extend({},sb,b,{data:o,success:function(b){b=b||[];var c=W(l,this,arguments);a.isArray(c)&&(b=c),d(b)},error:function(){W(m,this,arguments),d()},complete:function(){W(n,this,arguments),L.popLoading()}}))}else d()}}function h(a){var b=i(a);b&&(R.push(b),T++,f(b,S))}function i(b){var c,d,e=Ma.sourceNormalizers;if(a.isFunction(b)||a.isArray(b)?c={events:b}:"string"==typeof b?c={url:b}:"object"==typeof b&&(c=a.extend({},b)),c){for(c.className?"string"==typeof c.className&&(c.className=c.className.split(/\s+/)):c.className=[],a.isArray(c.events)&&(c.origArray=c.events,c.events=a.map(c.events,function(a){return s(a,c)})),d=0;d<e.length;d++)e[d].call(L,c);return c}}function j(b){R=a.grep(R,function(a){return!k(a,b)}),U=a.grep(U,function(a){return!k(a.source,b)}),O(U)}function k(a,b){return a&&b&&l(a)==l(b)}function l(a){return("object"==typeof a?a.origArray||a.googleCalendarId||a.url||a.events:null)||a}function m(a){a.start=L.moment(a.start),a.end?a.end=L.moment(a.end):a.end=null,y(a,n(a)),O(U)}function n(b){var c={};return a.each(b,function(a,b){o(a)&&void 0!==b&&V(b)&&(c[a]=b)}),c}function o(a){return!/^_|^(id|allDay|start|end)$/.test(a)}function p(a,b){var c,d,e,f=s(a);if(f){for(c=x(f),d=0;d<c.length;d++)e=c[d],e.source||(b&&(Q.events.push(e),e.source=Q),U.push(e));return O(U),c}return[]}function q(b){var c,d;for(null==b?b=function(){return!0}:a.isFunction(b)||(c=b+"",b=function(a){return a._id==c}),U=a.grep(U,b,!0),d=0;d<R.length;d++)a.isArray(R[d].events)&&(R[d].events=a.grep(R[d].events,b,!0));O(U)}function r(b){return a.isFunction(b)?a.grep(U,b):null!=b?(b+="",a.grep(U,function(a){return a._id==b})):U}function s(d,e){var f,g,h,i={};if(c.eventDataTransform&&(d=c.eventDataTransform(d)),e&&e.eventDataTransform&&(d=e.eventDataTransform(d)),a.extend(i,d),e&&(i.source=e),i._id=d._id||(void 0===d.id?"_fc"+tb++:d.id+""),d.className?"string"==typeof d.className?i.className=d.className.split(/\s+/):i.className=d.className:i.className=[],f=d.start||d.date,g=d.end,P(f)&&(f=b.duration(f)),P(g)&&(g=b.duration(g)),d.dow||b.isDuration(f)||b.isDuration(g))i.start=f?b.duration(f):null,i.end=g?b.duration(g):null,i._recurring=!0;else{if(f&&(f=L.moment(f),!f.isValid()))return!1;g&&(g=L.moment(g),g.isValid()||(g=null)),h=d.allDay,void 0===h&&(h=X(e?e.allDayDefault:void 0,c.allDayDefault)),t(f,g,h,i)}return i}function t(a,b,c,d){d.start=a,d.end=b,d.allDay=c,u(d),La(d)}function u(a){v(a),a.end&&!a.end.isAfter(a.start)&&(a.end=null),a.end||(c.forceEventDuration?a.end=L.getDefaultEventEnd(a.allDay,a.start):a.end=null)}function v(a){null==a.allDay&&(a.allDay=!(a.start.hasTime()||a.end&&a.end.hasTime())),a.allDay?(a.start.stripTime(),a.end&&a.end.stripTime()):(a.start.hasTime()||(a.start=L.rezoneDate(a.start)),a.end&&!a.end.hasTime()&&(a.end=L.rezoneDate(a.end)))}function w(b){var c;return b.end||(c=b.allDay,null==c&&(c=!b.start.hasTime()),b=a.extend({},b),b.end=L.getDefaultEventEnd(c,b.start)),b}function x(b,c,d){var e,f,g,h,i,j,k,l,m,n=[];if(c=c||M,d=d||N,b)if(b._recurring){if(f=b.dow)for(e={},g=0;g<f.length;g++)e[f[g]]=!0;for(h=c.clone().stripTime();h.isBefore(d);)e&&!e[h.day()]||(i=b.start,j=b.end,k=h.clone(),l=null,i&&(k=k.time(i)),j&&(l=h.clone().time(j)),m=a.extend({},b),t(k,l,!i&&!j,m),n.push(m)),h.add(1,"days")}else n.push(b);return n}function y(b,c,d){function e(a,b){return d?H(a,b,d):c.allDay?G(a,b):F(a,b)}var f,g,h,i,j,k,l={};return c=c||{},c.start||(c.start=b.start.clone()),void 0===c.end&&(c.end=b.end?b.end.clone():null),null==c.allDay&&(c.allDay=b.allDay),u(c),f={start:b._start.clone(),end:b._end?b._end.clone():L.getDefaultEventEnd(b._allDay,b._start),allDay:c.allDay},u(f),g=null!==b._end&&null===c.end,h=e(c.start,f.start),c.end?(i=e(c.end,f.end),j=i.subtract(h)):j=null,a.each(c,function(a,b){o(a)&&void 0!==b&&(l[a]=b)}),k=z(r(b._id),g,c.allDay,h,j,l),{dateDelta:h,durationDelta:j,undo:k}}function z(b,c,d,e,f,g){var h=L.getIsAmbigTimezone(),i=[];return e&&!e.valueOf()&&(e=null),f&&!f.valueOf()&&(f=null),a.each(b,function(b,j){var k,l;k={start:j.start.clone(),end:j.end?j.end.clone():null,allDay:j.allDay},a.each(g,function(a){k[a]=j[a]}),l={start:j._start,end:j._end,allDay:d},u(l),c?l.end=null:f&&!l.end&&(l.end=L.getDefaultEventEnd(l.allDay,l.start)),e&&(l.start.add(e),l.end&&l.end.add(e)),f&&l.end.add(f),h&&!l.allDay&&(e||f)&&(l.start.stripZone(),l.end&&l.end.stripZone()),a.extend(j,g,l),La(j),i.push(function(){a.extend(j,k),La(j)})}),function(){for(var a=0;a<i.length;a++)i[a]()}}function A(b){var d,e=c.businessHours,f={className:"fc-nonbusiness",start:"09:00",end:"17:00",dow:[1,2,3,4,5],rendering:"inverse-background"},g=L.getView();return e&&(d=a.extend({},f,"object"==typeof e?e:{})),d?(b&&(d.start=null,d.end=null),x(s(d),g.start,g.end)):[]}function B(a,b){var d=b.source||{},e=X(b.constraint,d.constraint,c.eventConstraint),f=X(b.overlap,d.overlap,c.eventOverlap);return a=w(a),E(a,e,f,b)}function C(a){return E(a,c.selectConstraint,c.selectOverlap)}function D(b,c){var d,e;return c&&(d=a.extend({},c,b),e=x(s(d))[0]),e?B(b,e):(b=w(b),C(b))}function E(b,c,d,e){var f,g,h,i,j,k;if(b=a.extend({},b),b.start=b.start.clone().stripZone(),b.end=b.end.clone().stripZone(),null!=c){for(f=I(c),g=!1,i=0;i<f.length;i++)if(J(f[i],b)){g=!0;break}if(!g)return!1}for(h=L.getPeerEvents(e,b),i=0;i<h.length;i++)if(j=h[i],K(j,b)){if(d===!1)return!1;if("function"==typeof d&&!d(j,e))return!1;if(e){if(k=X(j.overlap,(j.source||{}).overlap),k===!1)return!1;if("function"==typeof k&&!k(e,j))return!1}}return!0}function I(a){return"businessHours"===a?A():"object"==typeof a?x(s(a)):r(a)}function J(a,b){var c=a.start.clone().stripZone(),d=L.getEventEnd(a).stripZone();return b.start>=c&&b.end<=d}function K(a,b){var c=a.start.clone().stripZone(),d=L.getEventEnd(a).stripZone();return b.start<d&&b.end>c}var L=this;L.isFetchNeeded=d,L.fetchEvents=e,L.addEventSource=h,L.removeEventSource=j,L.updateEvent=m,L.renderEvent=p,L.removeEvents=q,L.clientEvents=r,L.mutateEvent=y,L.normalizeEventRange=u,L.normalizeEventRangeTimes=v,L.ensureVisibleEventRange=w;var M,N,O=L.reportEvents,Q={events:[]},R=[Q],S=0,T=0,U=[];a.each((c.events?[c.events]:[]).concat(c.eventSources||[]),function(a,b){var c=i(b);c&&R.push(c)}),L.getBusinessHoursEvents=A,L.isEventRangeAllowed=B,L.isSelectionRangeAllowed=C,L.isExternalDropRangeAllowed=D,L.getEventCache=function(){return U}}function La(a){a._allDay=a.allDay,a._start=a.start.clone(),a._end=a.end?a.end.clone():null}var Ma=a.fullCalendar={version:"2.4.0"},Na=Ma.views={};a.fn.fullCalendar=function(b){var c=Array.prototype.slice.call(arguments,1),d=this;return this.each(function(e,f){var g,h=a(f),i=h.data("fullCalendar");"string"==typeof b?i&&a.isFunction(i[b])&&(g=i[b].apply(i,c),e||(d=g),"destroy"===b&&h.removeData("fullCalendar")):i||(i=new nb(h,b),h.data("fullCalendar",i),i.render())}),d};var Oa=["header","buttonText","buttonIcons","themeButtonIcons"];Ma.intersectionToSeg=E,Ma.applyAll=W,Ma.debounce=da,Ma.isInt=ba,Ma.htmlEscape=Y,Ma.cssToStr=$,Ma.proxy=ca,Ma.capitaliseFirstLetter=_,Ma.getClientRect=p,Ma.getContentRect=q,Ma.getScrollbarWidths=r;var Pa=null;Ma.intersectRects=w,Ma.parseFieldSpecs=A,Ma.compareByFieldSpecs=B,Ma.compareByFieldSpec=C,Ma.flexibleCompare=D,Ma.computeIntervalUnit=I,Ma.divideRangeByDuration=K,Ma.divideDurationByDuration=L,Ma.multiplyDuration=M,Ma.durationHasTime=N;var Qa=["sun","mon","tue","wed","thu","fri","sat"],Ra=["year","month","week","day","hour","minute","second","millisecond"];Ma.log=function(){var a=window.console;return a&&a.log?a.log.apply(a,arguments):void 0},Ma.warn=function(){var a=window.console;return a&&a.warn?a.warn.apply(a,arguments):Ma.log.apply(Ma,arguments)};var Sa,Ta,Ua,Va={}.hasOwnProperty,Wa=/^\s*\d{4}-\d\d$/,Xa=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/,Ya=b.fn,Za=a.extend({},Ya);Ma.moment=function(){return ea(arguments)},Ma.moment.utc=function(){var a=ea(arguments,!0);return a.hasTime()&&a.utc(),a},Ma.moment.parseZone=function(){return ea(arguments,!0,!0)},Ya.clone=function(){var a=Za.clone.apply(this,arguments);return ga(this,a),this._fullCalendar&&(a._fullCalendar=!0),a},Ya.week=Ya.weeks=function(a){var b=(this._locale||this._lang)._fullCalendar_weekCalc;return null==a&&"function"==typeof b?b(this):"ISO"===b?Za.isoWeek.apply(this,arguments):Za.week.apply(this,arguments)},Ya.time=function(a){if(!this._fullCalendar)return Za.time.apply(this,arguments);if(null==a)return b.duration({hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()});this._ambigTime=!1,b.isDuration(a)||b.isMoment(a)||(a=b.duration(a));var c=0;return b.isDuration(a)&&(c=24*Math.floor(a.asDays())),this.hours(c+a.hours()).minutes(a.minutes()).seconds(a.seconds()).milliseconds(a.milliseconds())},Ya.stripTime=function(){var a;return this._ambigTime||(a=this.toArray(),this.utc(),Ta(this,a.slice(0,3)),this._ambigTime=!0,this._ambigZone=!0),this},Ya.hasTime=function(){return!this._ambigTime},Ya.stripZone=function(){var a,b;return this._ambigZone||(a=this.toArray(),b=this._ambigTime,this.utc(),Ta(this,a),this._ambigTime=b||!1,this._ambigZone=!0),this},Ya.hasZone=function(){return!this._ambigZone},Ya.local=function(){var a=this.toArray(),b=this._ambigZone;return Za.local.apply(this,arguments),this._ambigTime=!1,this._ambigZone=!1,b&&Ua(this,a),this},Ya.utc=function(){return Za.utc.apply(this,arguments),this._ambigTime=!1,this._ambigZone=!1,this},a.each(["zone","utcOffset"],function(a,b){Za[b]&&(Ya[b]=function(a){return null!=a&&(this._ambigTime=!1,this._ambigZone=!1),Za[b].apply(this,arguments)})}),Ya.format=function(){return this._fullCalendar&&arguments[0]?ja(this,arguments[0]):this._ambigTime?ia(this,"YYYY-MM-DD"):this._ambigZone?ia(this,"YYYY-MM-DD[T]HH:mm:ss"):Za.format.apply(this,arguments)},Ya.toISOString=function(){return this._ambigTime?ia(this,"YYYY-MM-DD"):this._ambigZone?ia(this,"YYYY-MM-DD[T]HH:mm:ss"):Za.toISOString.apply(this,arguments)},Ya.isWithin=function(a,b){var c=fa([this,a,b]);return c[0]>=c[1]&&c[0]<c[2]},Ya.isSame=function(a,b){var c;return this._fullCalendar?b?(c=fa([this,a],!0),Za.isSame.call(c[0],c[1],b)):(a=Ma.moment.parseZone(a),Za.isSame.call(this,a)&&Boolean(this._ambigTime)===Boolean(a._ambigTime)&&Boolean(this._ambigZone)===Boolean(a._ambigZone)):Za.isSame.apply(this,arguments)},a.each(["isBefore","isAfter"],function(a,b){Ya[b]=function(a,c){var d;return this._fullCalendar?(d=fa([this,a]),Za[b].call(d[0],d[1],c)):Za[b].apply(this,arguments)}}),Sa="_d"in b()&&"updateOffset"in b,Ta=Sa?function(a,c){a._d.setTime(Date.UTC.apply(Date,c)),b.updateOffset(a,!1)}:ha,Ua=Sa?function(a,c){a._d.setTime(+new Date(c[0]||0,c[1]||0,c[2]||0,c[3]||0,c[4]||0,c[5]||0,c[6]||0)),b.updateOffset(a,!1)}:ha;var $a={t:function(a){return ia(a,"a").charAt(0)},T:function(a){return ia(a,"A").charAt(0)}};Ma.formatRange=ma;var _a={Y:"year",M:"month",D:"day",d:"day",A:"second",a:"second",T:"second",t:"second",H:"second",h:"second",m:"second",s:"second"},ab={};Ma.Class=ra,ra.extend=function(a){var b,c=this;return a=a||{},U(a,"constructor")&&(b=a.constructor),"function"!=typeof b&&(b=a.constructor=function(){c.apply(this,arguments)}),b.prototype=R(c.prototype),S(a,b.prototype),T(a,b.prototype),S(c,b),b},ra.mixin=function(a){S(a.prototype||a,this.prototype)};var bb=Ma.Emitter=ra.extend({callbackHash:null,on:function(a,b){return this.getCallbacks(a).add(b),this},off:function(a,b){return this.getCallbacks(a).remove(b),this},trigger:function(a){var b=Array.prototype.slice.call(arguments,1);return this.triggerWith(a,this,b),this},triggerWith:function(a,b,c){var d=this.getCallbacks(a);return d.fireWith(b,c),this},getCallbacks:function(b){var c;return this.callbackHash||(this.callbackHash={}),c=this.callbackHash[b],c||(c=this.callbackHash[b]=a.Callbacks()),c}}),cb=ra.extend({isHidden:!0,options:null,el:null,documentMousedownProxy:null,margin:10,constructor:function(a){this.options=a||{}},show:function(){this.isHidden&&(this.el||this.render(),this.el.show(),this.position(),this.isHidden=!1,this.trigger("show"))},hide:function(){this.isHidden||(this.el.hide(),this.isHidden=!0,this.trigger("hide"))},render:function(){var b=this,c=this.options;this.el=a('<div class="fc-popover"/>').addClass(c.className||"").css({top:0,left:0}).append(c.content).appendTo(c.parentEl),this.el.on("click",".fc-close",function(){b.hide()}),c.autoHide&&a(document).on("mousedown",this.documentMousedownProxy=ca(this,"documentMousedown"))},documentMousedown:function(b){this.el&&!a(b.target).closest(this.el).length&&this.hide()},removeElement:function(){this.hide(),this.el&&(this.el.remove(),this.el=null),a(document).off("mousedown",this.documentMousedownProxy)},position:function(){var b,c,d,e,f,g=this.options,h=this.el.offsetParent().offset(),i=this.el.outerWidth(),j=this.el.outerHeight(),k=a(window),l=n(this.el);e=g.top||0,f=void 0!==g.left?g.left:void 0!==g.right?g.right-i:0,l.is(window)||l.is(document)?(l=k,b=0,c=0):(d=l.offset(),b=d.top,c=d.left),b+=k.scrollTop(),c+=k.scrollLeft(),g.viewportConstrain!==!1&&(e=Math.min(e,b+l.outerHeight()-j-this.margin),e=Math.max(e,b+this.margin),f=Math.min(f,c+l.outerWidth()-i-this.margin),f=Math.max(f,c+this.margin)),this.el.css({top:e-h.top,left:f-h.left})},trigger:function(a){this.options[a]&&this.options[a].apply(this,Array.prototype.slice.call(arguments,1))}}),db=ra.extend({grid:null,rowCoords:null,colCoords:null,containerEl:null,bounds:null,constructor:function(a){this.grid=a},build:function(){this.grid.build(),this.rowCoords=this.grid.computeRowCoords(),this.colCoords=this.grid.computeColCoords(),this.computeBounds()},clear:function(){this.grid.clear(),this.rowCoords=null,this.colCoords=null},getCell:function(b,c){var d,e,f,g=this.rowCoords,h=g.length,i=this.colCoords,j=i.length,k=null,l=null;if(this.inBounds(b,c)){for(d=0;h>d;d++)if(e=g[d],c>=e.top&&c<e.bottom){k=d;break}for(d=0;j>d;d++)if(e=i[d],b>=e.left&&b<e.right){l=d;break}if(null!==k&&null!==l)return f=this.grid.getCell(k,l),f.grid=this.grid,a.extend(f,g[k],i[l]),f}return null},computeBounds:function(){this.bounds=this.containerEl?p(this.containerEl):null},inBounds:function(a,b){var c=this.bounds;return c?a>=c.left&&a<c.right&&b>=c.top&&b<c.bottom:!0}}),eb=ra.extend({coordMaps:null,constructor:function(a){this.coordMaps=a},build:function(){var a,b=this.coordMaps;for(a=0;a<b.length;a++)b[a].build()},getCell:function(a,b){var c,d=this.coordMaps,e=null;for(c=0;c<d.length&&!e;c++)e=d[c].getCell(a,b);return e},clear:function(){var a,b=this.coordMaps;for(a=0;a<b.length;a++)b[a].clear()}}),fb=Ma.DragListener=ra.extend({ 20 options:null,isListening:!1,isDragging:!1,originX:null,originY:null,mousemoveProxy:null,mouseupProxy:null,subjectEl:null,subjectHref:null,scrollEl:null,scrollBounds:null,scrollTopVel:null,scrollLeftVel:null,scrollIntervalId:null,scrollHandlerProxy:null,scrollSensitivity:30,scrollSpeed:200,scrollIntervalMs:50,constructor:function(a){a=a||{},this.options=a,this.subjectEl=a.subjectEl},mousedown:function(a){v(a)&&(a.preventDefault(),this.startListening(a),this.options.distance||this.startDrag(a))},startListening:function(b){var c;this.isListening||(b&&this.options.scroll&&(c=n(a(b.target)),c.is(window)||c.is(document)||(this.scrollEl=c,this.scrollHandlerProxy=da(ca(this,"scrollHandler"),100),this.scrollEl.on("scroll",this.scrollHandlerProxy))),a(document).on("mousemove",this.mousemoveProxy=ca(this,"mousemove")).on("mouseup",this.mouseupProxy=ca(this,"mouseup")).on("selectstart",this.preventDefault),b?(this.originX=b.pageX,this.originY=b.pageY):(this.originX=0,this.originY=0),this.isListening=!0,this.listenStart(b))},listenStart:function(a){this.trigger("listenStart",a)},mousemove:function(a){var b,c,d=a.pageX-this.originX,e=a.pageY-this.originY;this.isDragging||(b=this.options.distance||1,c=d*d+e*e,c>=b*b&&this.startDrag(a)),this.isDragging&&this.drag(d,e,a)},startDrag:function(a){this.isListening||this.startListening(),this.isDragging||(this.isDragging=!0,this.dragStart(a))},dragStart:function(a){var b=this.subjectEl;this.trigger("dragStart",a),(this.subjectHref=b?b.attr("href"):null)&&b.removeAttr("href")},drag:function(a,b,c){this.trigger("drag",a,b,c),this.updateScroll(c)},mouseup:function(a){this.stopListening(a)},stopDrag:function(a){this.isDragging&&(this.stopScrolling(),this.dragStop(a),this.isDragging=!1)},dragStop:function(a){var b=this;this.trigger("dragStop",a),setTimeout(function(){b.subjectHref&&b.subjectEl.attr("href",b.subjectHref)},0)},stopListening:function(b){this.stopDrag(b),this.isListening&&(this.scrollEl&&(this.scrollEl.off("scroll",this.scrollHandlerProxy),this.scrollHandlerProxy=null),a(document).off("mousemove",this.mousemoveProxy).off("mouseup",this.mouseupProxy).off("selectstart",this.preventDefault),this.mousemoveProxy=null,this.mouseupProxy=null,this.isListening=!1,this.listenStop(b))},listenStop:function(a){this.trigger("listenStop",a)},trigger:function(a){this.options[a]&&this.options[a].apply(this,Array.prototype.slice.call(arguments,1))},preventDefault:function(a){a.preventDefault()},computeScrollBounds:function(){var a=this.scrollEl;this.scrollBounds=a?o(a):null},updateScroll:function(a){var b,c,d,e,f=this.scrollSensitivity,g=this.scrollBounds,h=0,i=0;g&&(b=(f-(a.pageY-g.top))/f,c=(f-(g.bottom-a.pageY))/f,d=(f-(a.pageX-g.left))/f,e=(f-(g.right-a.pageX))/f,b>=0&&1>=b?h=b*this.scrollSpeed*-1:c>=0&&1>=c&&(h=c*this.scrollSpeed),d>=0&&1>=d?i=d*this.scrollSpeed*-1:e>=0&&1>=e&&(i=e*this.scrollSpeed)),this.setScrollVel(h,i)},setScrollVel:function(a,b){this.scrollTopVel=a,this.scrollLeftVel=b,this.constrainScrollVel(),!this.scrollTopVel&&!this.scrollLeftVel||this.scrollIntervalId||(this.scrollIntervalId=setInterval(ca(this,"scrollIntervalFunc"),this.scrollIntervalMs))},constrainScrollVel:function(){var a=this.scrollEl;this.scrollTopVel<0?a.scrollTop()<=0&&(this.scrollTopVel=0):this.scrollTopVel>0&&a.scrollTop()+a[0].clientHeight>=a[0].scrollHeight&&(this.scrollTopVel=0),this.scrollLeftVel<0?a.scrollLeft()<=0&&(this.scrollLeftVel=0):this.scrollLeftVel>0&&a.scrollLeft()+a[0].clientWidth>=a[0].scrollWidth&&(this.scrollLeftVel=0)},scrollIntervalFunc:function(){var a=this.scrollEl,b=this.scrollIntervalMs/1e3;this.scrollTopVel&&a.scrollTop(a.scrollTop()+this.scrollTopVel*b),this.scrollLeftVel&&a.scrollLeft(a.scrollLeft()+this.scrollLeftVel*b),this.constrainScrollVel(),this.scrollTopVel||this.scrollLeftVel||this.stopScrolling()},stopScrolling:function(){this.scrollIntervalId&&(clearInterval(this.scrollIntervalId),this.scrollIntervalId=null,this.scrollStop())},scrollHandler:function(){this.scrollIntervalId||this.scrollStop()},scrollStop:function(){}}),gb=fb.extend({coordMap:null,origCell:null,cell:null,coordAdjust:null,constructor:function(a,b){fb.prototype.constructor.call(this,b),this.coordMap=a},listenStart:function(a){var b,c,d,e=this.subjectEl;fb.prototype.listenStart.apply(this,arguments),this.computeCoords(),a?(c={left:a.pageX,top:a.pageY},d=c,e&&(b=o(e),d=x(d,b)),this.origCell=this.getCell(d.left,d.top),e&&this.options.subjectCenter&&(this.origCell&&(b=w(this.origCell,b)||b),d=y(b)),this.coordAdjust=z(d,c)):(this.origCell=null,this.coordAdjust=null)},computeCoords:function(){this.coordMap.build(),this.computeScrollBounds()},dragStart:function(a){var b;fb.prototype.dragStart.apply(this,arguments),b=this.getCell(a.pageX,a.pageY),b&&this.cellOver(b)},drag:function(a,b,c){var d;fb.prototype.drag.apply(this,arguments),d=this.getCell(c.pageX,c.pageY),sa(d,this.cell)||(this.cell&&this.cellOut(),d&&this.cellOver(d))},dragStop:function(){this.cellDone(),fb.prototype.dragStop.apply(this,arguments)},cellOver:function(a){this.cell=a,this.trigger("cellOver",a,sa(a,this.origCell),this.origCell)},cellOut:function(){this.cell&&(this.trigger("cellOut",this.cell),this.cellDone(),this.cell=null)},cellDone:function(){this.cell&&this.trigger("cellDone",this.cell)},listenStop:function(){fb.prototype.listenStop.apply(this,arguments),this.origCell=this.cell=null,this.coordMap.clear()},scrollStop:function(){fb.prototype.scrollStop.apply(this,arguments),this.computeCoords()},getCell:function(a,b){return this.coordAdjust&&(a+=this.coordAdjust.left,b+=this.coordAdjust.top),this.coordMap.getCell(a,b)}}),hb=ra.extend({options:null,sourceEl:null,el:null,parentEl:null,top0:null,left0:null,mouseY0:null,mouseX0:null,topDelta:null,leftDelta:null,mousemoveProxy:null,isFollowing:!1,isHidden:!1,isAnimating:!1,constructor:function(b,c){this.options=c=c||{},this.sourceEl=b,this.parentEl=c.parentEl?a(c.parentEl):b.parent()},start:function(b){this.isFollowing||(this.isFollowing=!0,this.mouseY0=b.pageY,this.mouseX0=b.pageX,this.topDelta=0,this.leftDelta=0,this.isHidden||this.updatePosition(),a(document).on("mousemove",this.mousemoveProxy=ca(this,"mousemove")))},stop:function(b,c){function d(){this.isAnimating=!1,e.removeElement(),this.top0=this.left0=null,c&&c()}var e=this,f=this.options.revertDuration;this.isFollowing&&!this.isAnimating&&(this.isFollowing=!1,a(document).off("mousemove",this.mousemoveProxy),b&&f&&!this.isHidden?(this.isAnimating=!0,this.el.animate({top:this.top0,left:this.left0},{duration:f,complete:d})):d())},getEl:function(){var a=this.el;return a||(this.sourceEl.width(),a=this.el=this.sourceEl.clone().css({position:"absolute",visibility:"",display:this.isHidden?"none":"",margin:0,right:"auto",bottom:"auto",width:this.sourceEl.width(),height:this.sourceEl.height(),opacity:this.options.opacity||"",zIndex:this.options.zIndex}).appendTo(this.parentEl)),a},removeElement:function(){this.el&&(this.el.remove(),this.el=null)},updatePosition:function(){var a,b;this.getEl(),null===this.top0&&(this.sourceEl.width(),a=this.sourceEl.offset(),b=this.el.offsetParent().offset(),this.top0=a.top-b.top,this.left0=a.left-b.left),this.el.css({top:this.top0+this.topDelta,left:this.left0+this.leftDelta})},mousemove:function(a){this.topDelta=a.pageY-this.mouseY0,this.leftDelta=a.pageX-this.mouseX0,this.isHidden||this.updatePosition()},hide:function(){this.isHidden||(this.isHidden=!0,this.el&&this.el.hide())},show:function(){this.isHidden&&(this.isHidden=!1,this.updatePosition(),this.getEl().show())}}),ib=ra.extend({view:null,isRTL:null,cellHtml:"<td/>",constructor:function(a){this.view=a,this.isRTL=a.opt("isRTL")},rowHtml:function(a,b){var c,d,e=this.getHtmlRenderer("cell",a),f="";for(b=b||0,c=0;c<this.colCnt;c++)d=this.getCell(b,c),f+=e(d);return f=this.bookendCells(f,a,b),"<tr>"+f+"</tr>"},bookendCells:function(a,b,c){var d=this.getHtmlRenderer("intro",b)(c||0),e=this.getHtmlRenderer("outro",b)(c||0),f=this.isRTL?e:d,g=this.isRTL?d:e;return"string"==typeof a?f+a+g:a.prepend(f).append(g)},getHtmlRenderer:function(a,b){var c,d,e,f,g=this.view;return c=a+"Html",b&&(d=b+_(a)+"Html"),d&&(f=g[d])?e=g:d&&(f=this[d])?e=this:(f=g[c])?e=g:(f=this[c])&&(e=this),"function"==typeof f?function(){return f.apply(e,arguments)||""}:function(){return f||""}}}),jb=Ma.Grid=ib.extend({start:null,end:null,rowCnt:0,colCnt:0,el:null,coordMap:null,elsByFill:null,externalDragStartProxy:null,colHeadFormat:null,eventTimeFormat:null,displayEventTime:null,displayEventEnd:null,cellDuration:null,largeUnit:null,constructor:function(){ib.apply(this,arguments),this.coordMap=new db(this),this.elsByFill={},this.externalDragStartProxy=ca(this,"externalDragStart")},computeColHeadFormat:function(){},computeEventTimeFormat:function(){return this.view.opt("smallTimeFormat")},computeDisplayEventTime:function(){return!0},computeDisplayEventEnd:function(){return!0},setRange:function(a){this.start=a.start.clone(),this.end=a.end.clone(),this.rangeUpdated(),this.processRangeOptions()},rangeUpdated:function(){},processRangeOptions:function(){var a,b,c=this.view;this.colHeadFormat=c.opt("columnFormat")||this.computeColHeadFormat(),this.eventTimeFormat=c.opt("eventTimeFormat")||c.opt("timeFormat")||this.computeEventTimeFormat(),a=c.opt("displayEventTime"),null==a&&(a=this.computeDisplayEventTime()),b=c.opt("displayEventEnd"),null==b&&(b=this.computeDisplayEventEnd()),this.displayEventTime=a,this.displayEventEnd=b},build:function(){},clear:function(){},rangeToSegs:function(a){},diffDates:function(a,b){return this.largeUnit?H(a,b,this.largeUnit):F(a,b)},getCell:function(b,c){var d;return null==c&&("number"==typeof b?(c=b%this.colCnt,b=Math.floor(b/this.colCnt)):(c=b.col,b=b.row)),d={row:b,col:c},a.extend(d,this.getRowData(b),this.getColData(c)),a.extend(d,this.computeCellRange(d)),d},computeCellRange:function(a){var b=this.computeCellDate(a);return{start:b,end:b.clone().add(this.cellDuration)}},computeCellDate:function(a){},getRowData:function(a){return{}},getColData:function(a){return{}},getRowEl:function(a){},getColEl:function(a){},getCellDayEl:function(a){return this.getColEl(a.col)||this.getRowEl(a.row)},computeRowCoords:function(){var a,b,c,d=[];for(a=0;a<this.rowCnt;a++)b=this.getRowEl(a),c=b.offset().top,d.push({top:c,bottom:c+b.outerHeight()});return d},computeColCoords:function(){var a,b,c,d=[];for(a=0;a<this.colCnt;a++)b=this.getColEl(a),c=b.offset().left,d.push({left:c,right:c+b.outerWidth()});return d},setElement:function(b){var c=this;this.el=b,b.on("mousedown",function(b){a(b.target).is(".fc-event-container *, .fc-more")||a(b.target).closest(".fc-popover").length||c.dayMousedown(b)}),this.bindSegHandlers(),this.bindGlobalHandlers()},removeElement:function(){this.unbindGlobalHandlers(),this.el.remove()},renderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},bindGlobalHandlers:function(){a(document).on("dragstart sortstart",this.externalDragStartProxy)},unbindGlobalHandlers:function(){a(document).off("dragstart sortstart",this.externalDragStartProxy)},dayMousedown:function(a){var b,c,d=this,e=this.view,f=e.opt("selectable"),i=new gb(this.coordMap,{scroll:e.opt("dragScroll"),dragStart:function(){e.unselect()},cellOver:function(a,e,h){h&&(b=e?a:null,f&&(c=d.computeSelection(h,a),c?d.renderSelection(c):g()))},cellOut:function(a){b=null,c=null,d.unrenderSelection(),h()},listenStop:function(a){b&&e.triggerDayClick(b,d.getCellDayEl(b),a),c&&e.reportSelection(c,a),h()}});i.mousedown(a)},renderRangeHelper:function(a,b){var c=this.fabricateHelperEvent(a,b);this.renderHelper(c,b)},fabricateHelperEvent:function(a,b){var c=b?R(b.event):{};return c.start=a.start.clone(),c.end=a.end?a.end.clone():null,c.allDay=null,this.view.calendar.normalizeEventRange(c),c.className=(c.className||[]).concat("fc-helper"),b||(c.editable=!1),c},renderHelper:function(a,b){},unrenderHelper:function(){},renderSelection:function(a){this.renderHighlight(this.selectionRangeToSegs(a))},unrenderSelection:function(){this.unrenderHighlight()},computeSelection:function(a,b){var c,d=[a.start,a.end,b.start,b.end];return d.sort(aa),c={start:d[0].clone(),end:d[3].clone()},this.view.calendar.isSelectionRangeAllowed(c)?c:null},selectionRangeToSegs:function(a){return this.rangeToSegs(a)},renderHighlight:function(a){this.renderFill("highlight",a)},unrenderHighlight:function(){this.unrenderFill("highlight")},highlightSegClasses:function(){return["fc-highlight"]},renderFill:function(a,b){},unrenderFill:function(a){var b=this.elsByFill[a];b&&(b.remove(),delete this.elsByFill[a])},renderFillSegEls:function(b,c){var d,e=this,f=this[b+"SegEl"],g="",h=[];if(c.length){for(d=0;d<c.length;d++)g+=this.fillSegHtml(b,c[d]);a(g).each(function(b,d){var g=c[b],i=a(d);f&&(i=f.call(e,g,i)),i&&(i=a(i),i.is(e.fillSegTag)&&(g.el=i,h.push(g)))})}return h},fillSegTag:"div",fillSegHtml:function(a,b){var c=this[a+"SegClasses"],d=this[a+"SegCss"],e=c?c.call(this,b):[],f=$(d?d.call(this,b):{});return"<"+this.fillSegTag+(e.length?' class="'+e.join(" ")+'"':"")+(f?' style="'+f+'"':"")+" />"},headHtml:function(){return'<div class="fc-row '+this.view.widgetHeaderClass+'"><table><thead>'+this.rowHtml("head")+"</thead></table></div>"},headCellHtml:function(a){var b=this.view,c=a.start;return'<th class="fc-day-header '+b.widgetHeaderClass+" fc-"+Qa[c.day()]+'">'+Y(c.format(this.colHeadFormat))+"</th>"},bgCellHtml:function(a){var b=this.view,c=a.start,d=this.getDayClasses(c);return d.unshift("fc-day",b.widgetContentClass),'<td class="'+d.join(" ")+'" data-date="'+c.format("YYYY-MM-DD")+'"></td>'},getDayClasses:function(a){var b=this.view,c=b.calendar.getNow().stripTime(),d=["fc-"+Qa[a.day()]];return 1==b.intervalDuration.as("months")&&a.month()!=b.intervalStart.month()&&d.push("fc-other-month"),a.isSame(c,"day")?d.push("fc-today",b.highlightStateClass):c>a?d.push("fc-past"):d.push("fc-future"),d}});jb.mixin({mousedOverSeg:null,isDraggingSeg:!1,isResizingSeg:!1,isDraggingExternal:!1,segs:null,renderEvents:function(a){var b,c,d=this.eventsToSegs(a),e=[],f=[];for(b=0;b<d.length;b++)c=d[b],ta(c.event)?e.push(c):f.push(c);e=this.renderBgSegs(e)||e,f=this.renderFgSegs(f)||f,this.segs=e.concat(f)},unrenderEvents:function(){this.triggerSegMouseout(),this.unrenderFgSegs(),this.unrenderBgSegs(),this.segs=null},getEventSegs:function(){return this.segs||[]},renderFgSegs:function(a){},unrenderFgSegs:function(){},renderFgSegEls:function(b,c){var d,e=this.view,f="",g=[];if(b.length){for(d=0;d<b.length;d++)f+=this.fgSegHtml(b[d],c);a(f).each(function(c,d){var f=b[c],h=e.resolveEventEl(f.event,a(d));h&&(h.data("fc-seg",f),f.el=h,g.push(f))})}return g},fgSegHtml:function(a,b){},renderBgSegs:function(a){return this.renderFill("bgEvent",a)},unrenderBgSegs:function(){this.unrenderFill("bgEvent")},bgEventSegEl:function(a,b){return this.view.resolveEventEl(a.event,b)},bgEventSegClasses:function(a){var b=a.event,c=b.source||{};return["fc-bgevent"].concat(b.className,c.className||[])},bgEventSegCss:function(a){var b=this.view,c=a.event,d=c.source||{};return{"background-color":c.backgroundColor||c.color||d.backgroundColor||d.color||b.opt("eventBackgroundColor")||b.opt("eventColor")}},businessHoursSegClasses:function(a){return["fc-nonbusiness","fc-bgevent"]},bindSegHandlers:function(){var b=this,c=this.view;a.each({mouseenter:function(a,c){b.triggerSegMouseover(a,c)},mouseleave:function(a,c){b.triggerSegMouseout(a,c)},click:function(a,b){return c.trigger("eventClick",this,a.event,b)},mousedown:function(d,e){a(e.target).is(".fc-resizer")&&c.isEventResizable(d.event)?b.segResizeMousedown(d,e,a(e.target).is(".fc-start-resizer")):c.isEventDraggable(d.event)&&b.segDragMousedown(d,e)}},function(c,d){b.el.on(c,".fc-event-container > *",function(c){var e=a(this).data("fc-seg");return!e||b.isDraggingSeg||b.isResizingSeg?void 0:d.call(this,e,c)})})},triggerSegMouseover:function(a,b){this.mousedOverSeg||(this.mousedOverSeg=a,this.view.trigger("eventMouseover",a.el[0],a.event,b))},triggerSegMouseout:function(a,b){b=b||{},this.mousedOverSeg&&(a=a||this.mousedOverSeg,this.mousedOverSeg=null,this.view.trigger("eventMouseout",a.el[0],a.event,b))},segDragMousedown:function(a,b){var c,d=this,e=this.view,f=e.calendar,i=a.el,j=a.event,k=new hb(a.el,{parentEl:e.el,opacity:e.opt("dragOpacity"),revertDuration:e.opt("dragRevertDuration"),zIndex:2}),l=new gb(e.coordMap,{distance:5,scroll:e.opt("dragScroll"),subjectEl:i,subjectCenter:!0,listenStart:function(a){k.hide(),k.start(a)},dragStart:function(b){d.triggerSegMouseout(a,b),d.segDragStart(a,b),e.hideEvent(j)},cellOver:function(b,h,i){a.cell&&(i=a.cell),c=d.computeEventDrop(i,b,j),c&&!f.isEventRangeAllowed(c,j)&&(g(),c=null),c&&e.renderDrag(c,a)?k.hide():k.show(),h&&(c=null)},cellOut:function(){e.unrenderDrag(),k.show(),c=null},cellDone:function(){h()},dragStop:function(b){k.stop(!c,function(){e.unrenderDrag(),e.showEvent(j),d.segDragStop(a,b),c&&e.reportEventDrop(j,c,this.largeUnit,i,b)})},listenStop:function(){k.stop()}});l.mousedown(b)},segDragStart:function(a,b){this.isDraggingSeg=!0,this.view.trigger("eventDragStart",a.el[0],a.event,b,{})},segDragStop:function(a,b){this.isDraggingSeg=!1,this.view.trigger("eventDragStop",a.el[0],a.event,b,{})},computeEventDrop:function(a,b,c){var d,e,f=this.view.calendar,g=a.start,h=b.start;return g.hasTime()===h.hasTime()?(d=this.diffDates(h,g),c.allDay&&N(d)?(e={start:c.start.clone(),end:f.getEventEnd(c),allDay:!1},f.normalizeEventRangeTimes(e)):e={start:c.start.clone(),end:c.end?c.end.clone():null,allDay:c.allDay},e.start.add(d),e.end&&e.end.add(d)):e={start:h.clone(),end:null,allDay:!h.hasTime()},e},applyDragOpacity:function(a){var b=this.view.opt("dragOpacity");null!=b&&a.each(function(a,c){c.style.opacity=b})},externalDragStart:function(b,c){var d,e,f=this.view;f.opt("droppable")&&(d=a((c?c.item:null)||b.target),e=f.opt("dropAccept"),(a.isFunction(e)?e.call(d[0],d):d.is(e))&&(this.isDraggingExternal||this.listenToExternalDrag(d,b,c)))},listenToExternalDrag:function(a,b,c){var d,e,f=this,i=ya(a);d=new gb(this.coordMap,{listenStart:function(){f.isDraggingExternal=!0},cellOver:function(a){e=f.computeExternalDrop(a,i),e?f.renderDrag(e):g()},cellOut:function(){e=null,f.unrenderDrag(),h()},dragStop:function(){f.unrenderDrag(),h(),e&&f.view.reportExternalDrop(i,e,a,b,c)},listenStop:function(){f.isDraggingExternal=!1}}),d.startDrag(b)},computeExternalDrop:function(a,b){var c={start:a.start.clone(),end:null};return b.startTime&&!c.start.hasTime()&&c.start.time(b.startTime),b.duration&&(c.end=c.start.clone().add(b.duration)),this.view.calendar.isExternalDropRangeAllowed(c,b.eventProps)?c:null},renderDrag:function(a,b){},unrenderDrag:function(){},segResizeMousedown:function(a,b,c){var d,e,f=this,i=this.view,j=i.calendar,k=a.el,l=a.event,m=j.getEventEnd(l);d=new gb(this.coordMap,{distance:5,scroll:i.opt("dragScroll"),subjectEl:k,dragStart:function(b){f.triggerSegMouseout(a,b),f.segResizeStart(a,b)},cellOver:function(b,d,h){e=c?f.computeEventStartResize(h,b,l):f.computeEventEndResize(h,b,l),e&&(j.isEventRangeAllowed(e,l)?e.start.isSame(l.start)&&e.end.isSame(m)&&(e=null):(g(),e=null)),e&&(i.hideEvent(l),f.renderEventResize(e,a))},cellOut:function(){e=null},cellDone:function(){f.unrenderEventResize(),i.showEvent(l),h()},dragStop:function(b){f.segResizeStop(a,b),e&&i.reportEventResize(l,e,this.largeUnit,k,b)}}),d.mousedown(b)},segResizeStart:function(a,b){this.isResizingSeg=!0,this.view.trigger("eventResizeStart",a.el[0],a.event,b,{})},segResizeStop:function(a,b){this.isResizingSeg=!1,this.view.trigger("eventResizeStop",a.el[0],a.event,b,{})},computeEventStartResize:function(a,b,c){return this.computeEventResize("start",a,b,c)},computeEventEndResize:function(a,b,c){return this.computeEventResize("end",a,b,c)},computeEventResize:function(a,b,c,d){var e,f,g=this.view.calendar,h=this.diffDates(c[a],b[a]);return e={start:d.start.clone(),end:g.getEventEnd(d),allDay:d.allDay},e.allDay&&N(h)&&(e.allDay=!1,g.normalizeEventRangeTimes(e)),e[a].add(h),e.start.isBefore(e.end)||(f=d.allDay?g.defaultAllDayEventDuration:g.defaultTimedEventDuration,this.cellDuration&&this.cellDuration<f&&(f=this.cellDuration),"start"==a?e.start=e.end.clone().subtract(f):e.end=e.start.clone().add(f)),e},renderEventResize:function(a,b){},unrenderEventResize:function(){},getEventTimeText:function(a,b,c){return null==b&&(b=this.eventTimeFormat),null==c&&(c=this.displayEventEnd),this.displayEventTime&&a.start.hasTime()?c&&a.end?this.view.formatRange(a,b):a.start.format(b):""},getSegClasses:function(a,b,c){var d=a.event,e=["fc-event",a.isStart?"fc-start":"fc-not-start",a.isEnd?"fc-end":"fc-not-end"].concat(d.className,d.source?d.source.className:[]);return b&&e.push("fc-draggable"),c&&e.push("fc-resizable"),e},getEventSkinCss:function(a){var b=this.view,c=a.source||{},d=a.color,e=c.color,f=b.opt("eventColor");return{"background-color":a.backgroundColor||d||c.backgroundColor||e||b.opt("eventBackgroundColor")||f,"border-color":a.borderColor||d||c.borderColor||e||b.opt("eventBorderColor")||f,color:a.textColor||c.textColor||b.opt("eventTextColor")}},eventsToSegs:function(a,b){var c,d=this.eventsToRanges(a),e=[];for(c=0;c<d.length;c++)e.push.apply(e,this.eventRangeToSegs(d[c],b));return e},eventsToRanges:function(b){var c=this,d=wa(b),e=[];return a.each(d,function(a,b){b.length&&e.push.apply(e,ua(b[0])?c.eventsToInverseRanges(b):c.eventsToNormalRanges(b))}),e},eventsToNormalRanges:function(a){var b,c,d,e,f=this.view.calendar,g=[];for(b=0;b<a.length;b++)c=a[b],d=c.start.clone().stripZone(),e=f.getEventEnd(c).stripZone(),g.push({event:c,start:d,end:e,eventStartMS:+d,eventDurationMS:e-d});return g},eventsToInverseRanges:function(a){var b,c,d=this.view,e=d.start.clone().stripZone(),f=d.end.clone().stripZone(),g=this.eventsToNormalRanges(a),h=[],i=a[0],j=e;for(g.sort(xa),b=0;b<g.length;b++)c=g[b],c.start>j&&h.push({event:i,start:j,end:c.start}),j=c.end;return f>j&&h.push({event:i,start:j,end:f}),h},eventRangeToSegs:function(a,b){var c,d,e;for(a=this.view.calendar.ensureVisibleEventRange(a),c=b?b(a):this.rangeToSegs(a),d=0;d<c.length;d++)e=c[d],e.event=a.event,e.eventStartMS=a.eventStartMS,e.eventDurationMS=a.eventDurationMS;return c},sortSegs:function(a){a.sort(ca(this,"compareSegs"))},compareSegs:function(a,b){return a.eventStartMS-b.eventStartMS||b.eventDurationMS-a.eventDurationMS||b.event.allDay-a.event.allDay||B(a.event,b.event,this.view.eventOrderSpecs)}}),Ma.dataAttrPrefix="";var kb=jb.extend({numbersVisible:!1,bottomCoordPadding:0,breakOnWeeks:null,cellDates:null,dayToCellOffsets:null,rowEls:null,dayEls:null,helperEls:null,constructor:function(){jb.apply(this,arguments),this.cellDuration=b.duration(1,"day")},renderDates:function(a){var b,c,d,e=this.view,f=this.rowCnt,g=this.colCnt,h=f*g,i="";for(b=0;f>b;b++)i+=this.dayRowHtml(b,a);for(this.el.html(i),this.rowEls=this.el.find(".fc-row"),this.dayEls=this.el.find(".fc-day"),c=0;h>c;c++)d=this.getCell(c),e.trigger("dayRender",null,d.start,this.dayEls.eq(c))},unrenderDates:function(){this.removeSegPopover()},renderBusinessHours:function(){var a=this.view.calendar.getBusinessHoursEvents(!0),b=this.eventsToSegs(a);this.renderFill("businessHours",b,"bgevent")},dayRowHtml:function(a,b){var c=this.view,d=["fc-row","fc-week",c.widgetContentClass];return b&&d.push("fc-rigid"),'<div class="'+d.join(" ")+'"><div class="fc-bg"><table>'+this.rowHtml("day",a)+'</table></div><div class="fc-content-skeleton"><table>'+(this.numbersVisible?"<thead>"+this.rowHtml("number",a)+"</thead>":"")+"</table></div></div>"},dayCellHtml:function(a){return this.bgCellHtml(a)},computeColHeadFormat:function(){return this.rowCnt>1?"ddd":this.colCnt>1?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("extraSmallTimeFormat")},computeDisplayEventEnd:function(){return 1==this.colCnt},rangeUpdated:function(){var a,b,c,d;if(this.updateCellDates(),a=this.cellDates,this.breakOnWeeks){for(b=a[0].day(),d=1;d<a.length&&a[d].day()!=b;d++);c=Math.ceil(a.length/d)}else c=1,d=a.length;this.rowCnt=c,this.colCnt=d},updateCellDates:function(){for(var a=this.view,b=this.start.clone(),c=[],d=-1,e=[];b.isBefore(this.end);)a.isHiddenDay(b)?e.push(d+.5):(d++,e.push(d),c.push(b.clone())),b.add(1,"days");this.cellDates=c,this.dayToCellOffsets=e},computeCellDate:function(a){var b=this.colCnt,c=a.row*b+(this.isRTL?b-a.col-1:a.col);return this.cellDates[c].clone()},getRowEl:function(a){return this.rowEls.eq(a)},getColEl:function(a){return this.dayEls.eq(a)},getCellDayEl:function(a){return this.dayEls.eq(a.row*this.colCnt+a.col)},computeRowCoords:function(){var a=jb.prototype.computeRowCoords.call(this);return a[a.length-1].bottom+=this.bottomCoordPadding,a},rangeToSegs:function(a){var b,c,d,e,f,g,h,i,j,k,l=this.isRTL,m=this.rowCnt,n=this.colCnt,o=[];for(a=this.view.computeDayRange(a),b=this.dateToCellOffset(a.start),c=this.dateToCellOffset(a.end.subtract(1,"days")),d=0;m>d;d++)e=d*n,f=e+n-1,i=Math.max(e,b),j=Math.min(f,c),i=Math.ceil(i),j=Math.floor(j),j>=i&&(g=i===b,h=j===c,i-=e,j-=e,k={row:d,isStart:g,isEnd:h},l?(k.leftCol=n-j-1,k.rightCol=n-i-1):(k.leftCol=i,k.rightCol=j),o.push(k));return o},dateToCellOffset:function(a){var b=this.dayToCellOffsets,c=a.diff(this.start,"days");return 0>c?b[0]-1:c>=b.length?b[b.length-1]+1:b[c]},renderDrag:function(a,b){return this.renderHighlight(this.eventRangeToSegs(a)),b&&!b.el.closest(this.el).length?(this.renderRangeHelper(a,b),this.applyDragOpacity(this.helperEls),!0):void 0},unrenderDrag:function(){this.unrenderHighlight(),this.unrenderHelper()},renderEventResize:function(a,b){this.renderHighlight(this.eventRangeToSegs(a)),this.renderRangeHelper(a,b)},unrenderEventResize:function(){this.unrenderHighlight(),this.unrenderHelper()},renderHelper:function(b,c){var d,e=[],f=this.eventsToSegs([b]);f=this.renderFgSegEls(f),d=this.renderSegRows(f),this.rowEls.each(function(b,f){var g,h=a(f),i=a('<div class="fc-helper-skeleton"><table/></div>');g=c&&c.row===b?c.el.position().top:h.find(".fc-content-skeleton tbody").position().top,i.css("top",g).find("table").append(d[b].tbodyEl),h.append(i),e.push(i[0])}),this.helperEls=a(e)},unrenderHelper:function(){this.helperEls&&(this.helperEls.remove(),this.helperEls=null)},fillSegTag:"td",renderFill:function(b,c,d){var e,f,g,h=[];for(c=this.renderFillSegEls(b,c),e=0;e<c.length;e++)f=c[e],g=this.renderFillRow(b,f,d),this.rowEls.eq(f.row).append(g),h.push(g[0]);return this.elsByFill[b]=a(h),c},renderFillRow:function(b,c,d){var e,f,g=this.colCnt,h=c.leftCol,i=c.rightCol+1;return d=d||b.toLowerCase(),e=a('<div class="fc-'+d+'-skeleton"><table><tr/></table></div>'),f=e.find("tr"),h>0&&f.append('<td colspan="'+h+'"/>'),f.append(c.el.attr("colspan",i-h)),g>i&&f.append('<td colspan="'+(g-i)+'"/>'),this.bookendCells(f,b),e}});kb.mixin({rowStructs:null,unrenderEvents:function(){this.removeSegPopover(),jb.prototype.unrenderEvents.apply(this,arguments)},getEventSegs:function(){return jb.prototype.getEventSegs.call(this).concat(this.popoverSegs||[])},renderBgSegs:function(b){var c=a.grep(b,function(a){return a.event.allDay});return jb.prototype.renderBgSegs.call(this,c)},renderFgSegs:function(b){var c;return b=this.renderFgSegEls(b),c=this.rowStructs=this.renderSegRows(b),this.rowEls.each(function(b,d){a(d).find(".fc-content-skeleton > table").append(c[b].tbodyEl)}),b},unrenderFgSegs:function(){for(var a,b=this.rowStructs||[];a=b.pop();)a.tbodyEl.remove();this.rowStructs=null},renderSegRows:function(a){var b,c,d=[];for(b=this.groupSegRows(a),c=0;c<b.length;c++)d.push(this.renderSegRow(c,b[c]));return d},fgSegHtml:function(a,b){var c,d,e=this.view,f=a.event,g=e.isEventDraggable(f),h=!b&&f.allDay&&a.isStart&&e.isEventResizableFromStart(f),i=!b&&f.allDay&&a.isEnd&&e.isEventResizableFromEnd(f),j=this.getSegClasses(a,g,h||i),k=$(this.getEventSkinCss(f)),l="";return j.unshift("fc-day-grid-event","fc-h-event"),a.isStart&&(c=this.getEventTimeText(f),c&&(l='<span class="fc-time">'+Y(c)+"</span>")),d='<span class="fc-title">'+(Y(f.title||"")||" ")+"</span>",'<a class="'+j.join(" ")+'"'+(f.url?' href="'+Y(f.url)+'"':"")+(k?' style="'+k+'"':"")+'><div class="fc-content">'+(this.isRTL?d+" "+l:l+" "+d)+"</div>"+(h?'<div class="fc-resizer fc-start-resizer" />':"")+(i?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},renderSegRow:function(b,c){function d(b){for(;b>g;)k=(r[e-1]||[])[g],k?k.attr("rowspan",parseInt(k.attr("rowspan")||1,10)+1):(k=a("<td/>"),h.append(k)),q[e][g]=k,r[e][g]=k,g++}var e,f,g,h,i,j,k,l=this.colCnt,m=this.buildSegLevels(c),n=Math.max(1,m.length),o=a("<tbody/>"),p=[],q=[],r=[];for(e=0;n>e;e++){if(f=m[e],g=0,h=a("<tr/>"),p.push([]),q.push([]),r.push([]),f)for(i=0;i<f.length;i++){for(j=f[i],d(j.leftCol),k=a('<td class="fc-event-container"/>').append(j.el),j.leftCol!=j.rightCol?k.attr("colspan",j.rightCol-j.leftCol+1):r[e][g]=k;g<=j.rightCol;)q[e][g]=k,p[e][g]=j,g++;h.append(k)}d(l),this.bookendCells(h,"eventSkeleton"),o.append(h)}return{row:b,tbodyEl:o,cellMatrix:q,segMatrix:p,segLevels:m,segs:c}},buildSegLevels:function(a){var b,c,d,e=[];for(this.sortSegs(a),b=0;b<a.length;b++){for(c=a[b],d=0;d<e.length&&za(c,e[d]);d++);c.level=d,(e[d]||(e[d]=[])).push(c)}for(d=0;d<e.length;d++)e[d].sort(Aa);return e},groupSegRows:function(a){var b,c=[];for(b=0;b<this.rowCnt;b++)c.push([]);for(b=0;b<a.length;b++)c[a[b].row].push(a[b]);return c}}),kb.mixin({segPopover:null,popoverSegs:null,removeSegPopover:function(){this.segPopover&&this.segPopover.hide()},limitRows:function(a){var b,c,d=this.rowStructs||[];for(b=0;b<d.length;b++)this.unlimitRow(b),c=a?"number"==typeof a?a:this.computeRowLevelLimit(b):!1,c!==!1&&this.limitRow(b,c)},computeRowLevelLimit:function(b){function c(b,c){f=Math.max(f,a(c).outerHeight())}var d,e,f,g=this.rowEls.eq(b),h=g.height(),i=this.rowStructs[b].tbodyEl.children();for(d=0;d<i.length;d++)if(e=i.eq(d).removeClass("fc-limited"),f=0,e.find("> td > :first-child").each(c),e.position().top+f>h)return d;return!1},limitRow:function(b,c){function d(d){for(;d>x;)e=u.getCell(b,x),k=u.getCellSegs(e,c),k.length&&(n=g[c-1][x],t=u.renderMoreLink(e,k),s=a("<div/>").append(t),n.append(s),w.push(s[0])),x++}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=this,v=this.rowStructs[b],w=[],x=0;if(c&&c<v.segLevels.length){for(f=v.segLevels[c-1],g=v.cellMatrix,h=v.tbodyEl.children().slice(c).addClass("fc-limited").get(),i=0;i<f.length;i++){for(j=f[i],d(j.leftCol),m=[],l=0;x<=j.rightCol;)e=this.getCell(b,x),k=this.getCellSegs(e,c),m.push(k),l+=k.length,x++;if(l){for(n=g[c-1][j.leftCol],o=n.attr("rowspan")||1,p=[],q=0;q<m.length;q++)r=a('<td class="fc-more-cell"/>').attr("rowspan",o),k=m[q],e=this.getCell(b,j.leftCol+q),t=this.renderMoreLink(e,[j].concat(k)),s=a("<div/>").append(t),r.append(s),p.push(r[0]),w.push(r[0]);n.addClass("fc-limited").after(a(p)),h.push(n[0])}}d(this.colCnt),v.moreEls=a(w),v.limitedEls=a(h)}},unlimitRow:function(a){var b=this.rowStructs[a];b.moreEls&&(b.moreEls.remove(),b.moreEls=null),b.limitedEls&&(b.limitedEls.removeClass("fc-limited"),b.limitedEls=null)},renderMoreLink:function(b,c){var d=this,e=this.view;return a('<a class="fc-more"/>').text(this.getMoreLinkText(c.length)).on("click",function(f){var g=e.opt("eventLimitClick"),h=b.start,i=a(this),j=d.getCellDayEl(b),k=d.getCellSegs(b),l=d.resliceDaySegs(k,h),m=d.resliceDaySegs(c,h);"function"==typeof g&&(g=e.trigger("eventLimitClick",null,{date:h,dayEl:j,moreEl:i,segs:l,hiddenSegs:m},f)),"popover"===g?d.showSegPopover(b,i,l):"string"==typeof g&&e.calendar.zoomTo(h,g)})},showSegPopover:function(a,b,c){var d,e,f=this,g=this.view,h=b.parent();d=1==this.rowCnt?g.el:this.rowEls.eq(a.row),e={className:"fc-more-popover",content:this.renderSegPopoverContent(a,c),parentEl:this.el,top:d.offset().top,autoHide:!0,viewportConstrain:g.opt("popoverViewportConstrain"),hide:function(){f.segPopover.removeElement(),f.segPopover=null,f.popoverSegs=null}},this.isRTL?e.right=h.offset().left+h.outerWidth()+1:e.left=h.offset().left-1,this.segPopover=new cb(e),this.segPopover.show()},renderSegPopoverContent:function(b,c){var d,e=this.view,f=e.opt("theme"),g=b.start.format(e.opt("dayPopoverFormat")),h=a('<div class="fc-header '+e.widgetHeaderClass+'"><span class="fc-close '+(f?"ui-icon ui-icon-closethick":"fc-icon fc-icon-x")+'"></span><span class="fc-title">'+Y(g)+'</span><div class="fc-clear"/></div><div class="fc-body '+e.widgetContentClass+'"><div class="fc-event-container"></div></div>'),i=h.find(".fc-event-container"); 21 for(c=this.renderFgSegEls(c,!0),this.popoverSegs=c,d=0;d<c.length;d++)c[d].cell=b,i.append(c[d].el);return h},resliceDaySegs:function(b,c){var d=a.map(b,function(a){return a.event}),e=c.clone().stripTime(),f=e.clone().add(1,"days"),g={start:e,end:f};return b=this.eventsToSegs(d,function(a){var b=E(a,g);return b?[b]:[]}),this.sortSegs(b),b},getMoreLinkText:function(a){var b=this.view.opt("eventLimitText");return"function"==typeof b?b(a):"+"+a+" "+b},getCellSegs:function(a,b){for(var c,d=this.rowStructs[a.row].segMatrix,e=b||0,f=[];e<d.length;)c=d[e][a.col],c&&f.push(c),e++;return f}});var lb=jb.extend({slotDuration:null,snapDuration:null,minTime:null,maxTime:null,colDates:null,labelFormat:null,labelInterval:null,dayEls:null,slatEls:null,slatTops:null,helperEl:null,businessHourSegs:null,constructor:function(){jb.apply(this,arguments),this.processOptions()},renderDates:function(){this.el.html(this.renderHtml()),this.dayEls=this.el.find(".fc-day"),this.slatEls=this.el.find(".fc-slats tr")},renderBusinessHours:function(){var a=this.view.calendar.getBusinessHoursEvents();this.businessHourSegs=this.renderFill("businessHours",this.eventsToSegs(a),"bgevent")},renderHtml:function(){return'<div class="fc-bg"><table>'+this.rowHtml("slotBg")+'</table></div><div class="fc-slats"><table>'+this.slatRowHtml()+"</table></div>"},slotBgCellHtml:function(a){return this.bgCellHtml(a)},slatRowHtml:function(){for(var a,c,d,e=this.view,f=this.isRTL,g="",h=b.duration(+this.minTime);h<this.maxTime;)a=this.start.clone().time(h),c=ba(L(h,this.labelInterval)),d='<td class="fc-axis fc-time '+e.widgetContentClass+'" '+e.axisStyleAttr()+">"+(c?"<span>"+Y(a.format(this.labelFormat))+"</span>":"")+"</td>",g+="<tr "+(c?"":'class="fc-minor"')+">"+(f?"":d)+'<td class="'+e.widgetContentClass+'"/>'+(f?d:"")+"</tr>",h.add(this.slotDuration);return g},processOptions:function(){var c,d=this.view,e=d.opt("slotDuration"),f=d.opt("snapDuration");e=b.duration(e),f=f?b.duration(f):e,this.slotDuration=e,this.snapDuration=f,this.cellDuration=f,this.minTime=b.duration(d.opt("minTime")),this.maxTime=b.duration(d.opt("maxTime")),c=d.opt("slotLabelFormat"),a.isArray(c)&&(c=c[c.length-1]),this.labelFormat=c||d.opt("axisFormat")||d.opt("smallTimeFormat"),c=d.opt("slotLabelInterval"),this.labelInterval=c?b.duration(c):this.computeLabelInterval(e)},computeLabelInterval:function(a){var c,d,e;for(c=yb.length-1;c>=0;c--)if(d=b.duration(yb[c]),e=L(d,a),ba(e)&&e>1)return d;return b.duration(a)},computeColHeadFormat:function(){return this.colCnt>1?this.view.opt("dayOfMonthFormat"):"dddd"},computeEventTimeFormat:function(){return this.view.opt("noMeridiemTimeFormat")},computeDisplayEventEnd:function(){return!0},rangeUpdated:function(){var a,b=this.view,c=[];for(a=this.start.clone();a.isBefore(this.end);)c.push(a.clone()),a.add(1,"day"),a=b.skipHiddenDays(a);this.isRTL&&c.reverse(),this.colDates=c,this.colCnt=c.length,this.rowCnt=Math.ceil((this.maxTime-this.minTime)/this.snapDuration)},computeCellDate:function(a){var b=this.colDates[a.col],c=this.computeSnapTime(a.row);return b=this.view.calendar.rezoneDate(b),b.time(c),b},getColEl:function(a){return this.dayEls.eq(a)},computeSnapTime:function(a){return b.duration(this.minTime+this.snapDuration*a)},rangeToSegs:function(a){var b,c,d,e,f=this.colCnt,g=[];for(a={start:a.start.clone().stripZone(),end:a.end.clone().stripZone()},c=0;f>c;c++)d=this.colDates[c],e={start:d.clone().time(this.minTime),end:d.clone().time(this.maxTime)},b=E(a,e),b&&(b.col=c,g.push(b));return g},updateSize:function(a){this.computeSlatTops(),a&&this.updateSegVerticals()},computeRowCoords:function(){var a,b,c=this.el.offset().top,d=[];for(a=0;a<this.rowCnt;a++)b={top:c+this.computeTimeTop(this.computeSnapTime(a))},a>0&&(d[a-1].bottom=b.top),d.push(b);return b.bottom=b.top+this.computeTimeTop(this.computeSnapTime(a)),d},computeDateTop:function(a,c){return this.computeTimeTop(b.duration(a.clone().stripZone()-c.clone().stripTime()))},computeTimeTop:function(a){var b,c,d,e,f=(a-this.minTime)/this.slotDuration;return f=Math.max(0,f),f=Math.min(this.slatEls.length,f),b=Math.floor(f),c=f-b,d=this.slatTops[b],c?(e=this.slatTops[b+1],d+(e-d)*c):d},computeSlatTops:function(){var b,c=[];this.slatEls.each(function(d,e){b=a(e).position().top,c.push(b)}),c.push(b+this.slatEls.last().outerHeight()),this.slatTops=c},renderDrag:function(a,b){return b?(this.renderRangeHelper(a,b),this.applyDragOpacity(this.helperEl),!0):void this.renderHighlight(this.eventRangeToSegs(a))},unrenderDrag:function(){this.unrenderHelper(),this.unrenderHighlight()},renderEventResize:function(a,b){this.renderRangeHelper(a,b)},unrenderEventResize:function(){this.unrenderHelper()},renderHelper:function(b,c){var d,e,f,g,h=this.eventsToSegs([b]);for(h=this.renderFgSegEls(h),d=this.renderSegTable(h),e=0;e<h.length;e++)f=h[e],c&&c.col===f.col&&(g=c.el,f.el.css({left:g.css("left"),right:g.css("right"),"margin-left":g.css("margin-left"),"margin-right":g.css("margin-right")}));this.helperEl=a('<div class="fc-helper-skeleton"/>').append(d).appendTo(this.el)},unrenderHelper:function(){this.helperEl&&(this.helperEl.remove(),this.helperEl=null)},renderSelection:function(a){this.view.opt("selectHelper")?this.renderRangeHelper(a):this.renderHighlight(this.selectionRangeToSegs(a))},unrenderSelection:function(){this.unrenderHelper(),this.unrenderHighlight()},renderFill:function(b,c,d){var e,f,g,h,i,j,k,l,m,n;if(c.length){for(c=this.renderFillSegEls(b,c),e=this.groupSegCols(c),d=d||b.toLowerCase(),f=a('<div class="fc-'+d+'-skeleton"><table><tr/></table></div>'),g=f.find("tr"),h=0;h<e.length;h++)if(i=e[h],j=a("<td/>").appendTo(g),i.length)for(k=a('<div class="fc-'+d+'-container"/>').appendTo(j),l=this.colDates[h],m=0;m<i.length;m++)n=i[m],k.append(n.el.css({top:this.computeDateTop(n.start,l),bottom:-this.computeDateTop(n.end,l)}));this.bookendCells(g,b),this.el.append(f),this.elsByFill[b]=f}return c}});lb.mixin({eventSkeletonEl:null,renderFgSegs:function(b){return b=this.renderFgSegEls(b),this.el.append(this.eventSkeletonEl=a('<div class="fc-content-skeleton"/>').append(this.renderSegTable(b))),b},unrenderFgSegs:function(a){this.eventSkeletonEl&&(this.eventSkeletonEl.remove(),this.eventSkeletonEl=null)},renderSegTable:function(b){var c,d,e,f,g,h,i=a("<table><tr/></table>"),j=i.find("tr");for(c=this.groupSegCols(b),this.computeSegVerticals(b),f=0;f<c.length;f++){for(g=c[f],this.placeSlotSegs(g),h=a('<div class="fc-event-container"/>'),d=0;d<g.length;d++)e=g[d],e.el.css(this.generateSegPositionCss(e)),e.bottom-e.top<30&&e.el.addClass("fc-short"),h.append(e.el);j.append(a("<td/>").append(h))}return this.bookendCells(j,"eventSkeleton"),i},placeSlotSegs:function(a){var b,c,d;if(this.sortSegs(a),b=Ba(a),Ca(b),c=b[0]){for(d=0;d<c.length;d++)Da(c[d]);for(d=0;d<c.length;d++)this.computeSlotSegCoords(c[d],0,0)}},computeSlotSegCoords:function(a,b,c){var d,e=a.forwardSegs;if(void 0===a.forwardCoord)for(e.length?(this.sortForwardSlotSegs(e),this.computeSlotSegCoords(e[0],b+1,c),a.forwardCoord=e[0].backwardCoord):a.forwardCoord=1,a.backwardCoord=a.forwardCoord-(a.forwardCoord-c)/(b+1),d=0;d<e.length;d++)this.computeSlotSegCoords(e[d],0,a.forwardCoord)},updateSegVerticals:function(){var a,b=(this.segs||[]).concat(this.businessHourSegs||[]);for(this.computeSegVerticals(b),a=0;a<b.length;a++)b[a].el.css(this.generateSegVerticalCss(b[a]))},computeSegVerticals:function(a){var b,c;for(b=0;b<a.length;b++)c=a[b],c.top=this.computeDateTop(c.start,c.start),c.bottom=this.computeDateTop(c.end,c.start)},fgSegHtml:function(a,b){var c,d,e,f=this.view,g=a.event,h=f.isEventDraggable(g),i=!b&&a.isStart&&f.isEventResizableFromStart(g),j=!b&&a.isEnd&&f.isEventResizableFromEnd(g),k=this.getSegClasses(a,h,i||j),l=$(this.getEventSkinCss(g));return k.unshift("fc-time-grid-event","fc-v-event"),f.isMultiDayEvent(g)?(a.isStart||a.isEnd)&&(c=this.getEventTimeText(a),d=this.getEventTimeText(a,"LT"),e=this.getEventTimeText(a,null,!1)):(c=this.getEventTimeText(g),d=this.getEventTimeText(g,"LT"),e=this.getEventTimeText(g,null,!1)),'<a class="'+k.join(" ")+'"'+(g.url?' href="'+Y(g.url)+'"':"")+(l?' style="'+l+'"':"")+'><div class="fc-content">'+(c?'<div class="fc-time" data-start="'+Y(e)+'" data-full="'+Y(d)+'"><span>'+Y(c)+"</span></div>":"")+(g.title?'<div class="fc-title">'+Y(g.title)+"</div>":"")+'</div><div class="fc-bg"/>'+(j?'<div class="fc-resizer fc-end-resizer" />':"")+"</a>"},generateSegPositionCss:function(a){var b,c,d=this.view.opt("slotEventOverlap"),e=a.backwardCoord,f=a.forwardCoord,g=this.generateSegVerticalCss(a);return d&&(f=Math.min(1,e+2*(f-e))),this.isRTL?(b=1-f,c=e):(b=e,c=1-f),g.zIndex=a.level+1,g.left=100*b+"%",g.right=100*c+"%",d&&a.forwardPressure&&(g[this.isRTL?"marginLeft":"marginRight"]=20),g},generateSegVerticalCss:function(a){return{top:a.top,bottom:-a.bottom}},groupSegCols:function(a){var b,c=[];for(b=0;b<this.colCnt;b++)c.push([]);for(b=0;b<a.length;b++)c[a[b].col].push(a[b]);return c},sortForwardSlotSegs:function(a){a.sort(ca(this,"compareForwardSlotSegs"))},compareForwardSlotSegs:function(a,b){return b.forwardPressure-a.forwardPressure||(a.backwardCoord||0)-(b.backwardCoord||0)||this.compareSegs(a,b)}});var mb=Ma.View=ra.extend({type:null,name:null,title:null,calendar:null,options:null,coordMap:null,el:null,displaying:null,isSkeletonRendered:!1,isEventsRendered:!1,start:null,end:null,intervalStart:null,intervalEnd:null,intervalDuration:null,intervalUnit:null,isRTL:!1,isSelected:!1,eventOrderSpecs:null,scrollerEl:null,scrollTop:null,widgetHeaderClass:null,widgetContentClass:null,highlightStateClass:null,nextDayThreshold:null,isHiddenDayHash:null,documentMousedownProxy:null,constructor:function(a,c,d,e){this.calendar=a,this.type=this.name=c,this.options=d,this.intervalDuration=e||b.duration(1,"day"),this.nextDayThreshold=b.duration(this.opt("nextDayThreshold")),this.initThemingProps(),this.initHiddenDays(),this.isRTL=this.opt("isRTL"),this.eventOrderSpecs=A(this.opt("eventOrder")),this.documentMousedownProxy=ca(this,"documentMousedown"),this.initialize()},initialize:function(){},opt:function(a){return this.options[a]},trigger:function(a,b){var c=this.calendar;return c.trigger.apply(c,[a,b||this].concat(Array.prototype.slice.call(arguments,2),[this]))},setDate:function(a){this.setRange(this.computeRange(a))},setRange:function(b){a.extend(this,b),this.updateTitle()},computeRange:function(a){var b,c,d=I(this.intervalDuration),e=a.clone().startOf(d),f=e.clone().add(this.intervalDuration);return/year|month|week|day/.test(d)?(e.stripTime(),f.stripTime()):(e.hasTime()||(e=this.calendar.rezoneDate(e)),f.hasTime()||(f=this.calendar.rezoneDate(f))),b=e.clone(),b=this.skipHiddenDays(b),c=f.clone(),c=this.skipHiddenDays(c,-1,!0),{intervalUnit:d,intervalStart:e,intervalEnd:f,start:b,end:c}},computePrevDate:function(a){return this.massageCurrentDate(a.clone().startOf(this.intervalUnit).subtract(this.intervalDuration),-1)},computeNextDate:function(a){return this.massageCurrentDate(a.clone().startOf(this.intervalUnit).add(this.intervalDuration))},massageCurrentDate:function(a,b){return this.intervalDuration.as("days")<=1&&this.isHiddenDay(a)&&(a=this.skipHiddenDays(a,b),a.startOf("day")),a},updateTitle:function(){this.title=this.computeTitle()},computeTitle:function(){return this.formatRange({start:this.intervalStart,end:this.intervalEnd},this.opt("titleFormat")||this.computeTitleFormat(),this.opt("titleRangeSeparator"))},computeTitleFormat:function(){return"year"==this.intervalUnit?"YYYY":"month"==this.intervalUnit?this.opt("monthYearFormat"):this.intervalDuration.as("days")>1?"ll":"LL"},formatRange:function(a,b,c){var d=a.end;return d.hasTime()||(d=d.clone().subtract(1)),ma(a.start,d,b,c,this.opt("isRTL"))},setElement:function(a){this.el=a,this.bindGlobalHandlers()},removeElement:function(){this.clear(),this.isSkeletonRendered&&(this.unrenderSkeleton(),this.isSkeletonRendered=!1),this.unbindGlobalHandlers(),this.el.remove()},display:function(b){var c=this,d=null;return this.displaying&&(d=this.queryScroll()),this.clear().then(function(){return c.displaying=a.when(c.displayView(b)).then(function(){c.forceScroll(c.computeInitialScroll(d)),c.triggerRender()})})},clear:function(){var b=this,c=this.displaying;return c?c.then(function(){return b.displaying=null,b.clearEvents(),b.clearView()}):a.when()},displayView:function(a){this.isSkeletonRendered||(this.renderSkeleton(),this.isSkeletonRendered=!0),this.setDate(a),this.render&&this.render(),this.renderDates(),this.updateSize(),this.renderBusinessHours()},clearView:function(){this.unselect(),this.triggerUnrender(),this.unrenderBusinessHours(),this.unrenderDates(),this.destroy&&this.destroy()},renderSkeleton:function(){},unrenderSkeleton:function(){},renderDates:function(){},unrenderDates:function(){},renderBusinessHours:function(){},unrenderBusinessHours:function(){},triggerRender:function(){this.trigger("viewRender",this,this,this.el)},triggerUnrender:function(){this.trigger("viewDestroy",this,this,this.el)},bindGlobalHandlers:function(){a(document).on("mousedown",this.documentMousedownProxy)},unbindGlobalHandlers:function(){a(document).off("mousedown",this.documentMousedownProxy)},initThemingProps:function(){var a=this.opt("theme")?"ui":"fc";this.widgetHeaderClass=a+"-widget-header",this.widgetContentClass=a+"-widget-content",this.highlightStateClass=a+"-state-highlight"},updateSize:function(a){var b;a&&(b=this.queryScroll()),this.updateHeight(a),this.updateWidth(a),a&&this.setScroll(b)},updateWidth:function(a){},updateHeight:function(a){var b=this.calendar;this.setHeight(b.getSuggestedViewHeight(),b.isHeightAuto())},setHeight:function(a,b){},computeScrollerHeight:function(a){var b,c,d=this.scrollerEl;return b=this.el.add(d),b.css({position:"relative",left:-1}),c=this.el.outerHeight()-d.height(),b.css({position:"",left:""}),a-c},computeInitialScroll:function(a){return 0},queryScroll:function(){return this.scrollerEl?this.scrollerEl.scrollTop():void 0},setScroll:function(a){return this.scrollerEl?this.scrollerEl.scrollTop(a):void 0},forceScroll:function(a){var b=this;this.setScroll(a),setTimeout(function(){b.setScroll(a)},0)},displayEvents:function(a){var b=this.queryScroll();this.clearEvents(),this.renderEvents(a),this.isEventsRendered=!0,this.setScroll(b),this.triggerEventRender()},clearEvents:function(){this.isEventsRendered&&(this.triggerEventUnrender(),this.destroyEvents&&this.destroyEvents(),this.unrenderEvents(),this.isEventsRendered=!1)},renderEvents:function(a){},unrenderEvents:function(){},triggerEventRender:function(){this.renderedEventSegEach(function(a){this.trigger("eventAfterRender",a.event,a.event,a.el)}),this.trigger("eventAfterAllRender")},triggerEventUnrender:function(){this.renderedEventSegEach(function(a){this.trigger("eventDestroy",a.event,a.event,a.el)})},resolveEventEl:function(b,c){var d=this.trigger("eventRender",b,b,c);return d===!1?c=null:d&&d!==!0&&(c=a(d)),c},showEvent:function(a){this.renderedEventSegEach(function(a){a.el.css("visibility","")},a)},hideEvent:function(a){this.renderedEventSegEach(function(a){a.el.css("visibility","hidden")},a)},renderedEventSegEach:function(a,b){var c,d=this.getEventSegs();for(c=0;c<d.length;c++)b&&d[c].event._id!==b._id||d[c].el&&a.call(this,d[c])},getEventSegs:function(){return[]},isEventDraggable:function(a){var b=a.source||{};return X(a.startEditable,b.startEditable,this.opt("eventStartEditable"),a.editable,b.editable,this.opt("editable"))},reportEventDrop:function(a,b,c,d,e){var f=this.calendar,g=f.mutateEvent(a,b,c),h=function(){g.undo(),f.reportEventChange()};this.triggerEventDrop(a,g.dateDelta,h,d,e),f.reportEventChange()},triggerEventDrop:function(a,b,c,d,e){this.trigger("eventDrop",d[0],a,b,c,e,{})},reportExternalDrop:function(b,c,d,e,f){var g,h,i=b.eventProps;i&&(g=a.extend({},i,c),h=this.calendar.renderEvent(g,b.stick)[0]),this.triggerExternalDrop(h,c,d,e,f)},triggerExternalDrop:function(a,b,c,d,e){this.trigger("drop",c[0],b.start,d,e),a&&this.trigger("eventReceive",null,a)},renderDrag:function(a,b){},unrenderDrag:function(){},isEventResizableFromStart:function(a){return this.opt("eventResizableFromStart")&&this.isEventResizable(a)},isEventResizableFromEnd:function(a){return this.isEventResizable(a)},isEventResizable:function(a){var b=a.source||{};return X(a.durationEditable,b.durationEditable,this.opt("eventDurationEditable"),a.editable,b.editable,this.opt("editable"))},reportEventResize:function(a,b,c,d,e){var f=this.calendar,g=f.mutateEvent(a,b,c),h=function(){g.undo(),f.reportEventChange()};this.triggerEventResize(a,g.durationDelta,h,d,e),f.reportEventChange()},triggerEventResize:function(a,b,c,d,e){this.trigger("eventResize",d[0],a,b,c,e,{})},select:function(a,b){this.unselect(b),this.renderSelection(a),this.reportSelection(a,b)},renderSelection:function(a){},reportSelection:function(a,b){this.isSelected=!0,this.triggerSelect(a,b)},triggerSelect:function(a,b){this.trigger("select",null,a.start,a.end,b)},unselect:function(a){this.isSelected&&(this.isSelected=!1,this.destroySelection&&this.destroySelection(),this.unrenderSelection(),this.trigger("unselect",null,a))},unrenderSelection:function(){},documentMousedown:function(b){var c;this.isSelected&&this.opt("unselectAuto")&&v(b)&&(c=this.opt("unselectCancel"),c&&a(b.target).closest(c).length||this.unselect(b))},triggerDayClick:function(a,b,c){this.trigger("dayClick",b,a.start,c)},initHiddenDays:function(){var b,c=this.opt("hiddenDays")||[],d=[],e=0;for(this.opt("weekends")===!1&&c.push(0,6),b=0;7>b;b++)(d[b]=-1!==a.inArray(b,c))||e++;if(!e)throw"invalid hiddenDays";this.isHiddenDayHash=d},isHiddenDay:function(a){return b.isMoment(a)&&(a=a.day()),this.isHiddenDayHash[a]},skipHiddenDays:function(a,b,c){var d=a.clone();for(b=b||1;this.isHiddenDayHash[(d.day()+(c?b:0)+7)%7];)d.add(b,"days");return d},computeDayRange:function(a){var b,c=a.start.clone().stripTime(),d=a.end,e=null;return d&&(e=d.clone().stripTime(),b=+d.time(),b&&b>=this.nextDayThreshold&&e.add(1,"days")),(!d||c>=e)&&(e=c.clone().add(1,"days")),{start:c,end:e}},isMultiDayEvent:function(a){var b=this.computeDayRange(a);return b.end.diff(b.start,"days")>1}}),nb=Ma.Calendar=ra.extend({dirDefaults:null,langDefaults:null,overrides:null,options:null,viewSpecCache:null,view:null,header:null,loadingLevel:0,constructor:Ga,initialize:function(){},initOptions:function(a){var b,e,f,g;a=d(a),b=a.lang,e=ob[b],e||(b=nb.defaults.lang,e=ob[b]||{}),f=X(a.isRTL,e.isRTL,nb.defaults.isRTL),g=f?nb.rtlDefaults:{},this.dirDefaults=g,this.langDefaults=e,this.overrides=a,this.options=c([nb.defaults,g,e,a]),Ha(this.options),this.viewSpecCache={}},getViewSpec:function(a){var b=this.viewSpecCache;return b[a]||(b[a]=this.buildViewSpec(a))},getUnitViewSpec:function(b){var c,d,e;if(-1!=a.inArray(b,Ra))for(c=this.header.getViewsWithButtons(),a.each(Ma.views,function(a){c.push(a)}),d=0;d<c.length;d++)if(e=this.getViewSpec(c[d]),e&&e.singleUnit==b)return e},buildViewSpec:function(a){for(var d,e,f,g,h=this.overrides.views||{},i=[],j=[],k=[],l=a;l;)d=Na[l],e=h[l],l=null,"function"==typeof d&&(d={"class":d}),d&&(i.unshift(d),j.unshift(d.defaults||{}),f=f||d.duration,l=l||d.type),e&&(k.unshift(e),f=f||e.duration,l=l||e.type);return d=Q(i),d.type=a,d["class"]?(f&&(f=b.duration(f),f.valueOf()&&(d.duration=f,g=I(f),1===f.as(g)&&(d.singleUnit=g,k.unshift(h[g]||{})))),d.defaults=c(j),d.overrides=c(k),this.buildViewSpecOptions(d),this.buildViewSpecButtonText(d,a),d):!1},buildViewSpecOptions:function(a){a.options=c([nb.defaults,a.defaults,this.dirDefaults,this.langDefaults,this.overrides,a.overrides]),Ha(a.options)},buildViewSpecButtonText:function(a,b){function c(c){var d=c.buttonText||{};return d[b]||(a.singleUnit?d[a.singleUnit]:null)}a.buttonTextOverride=c(this.overrides)||a.overrides.buttonText,a.buttonTextDefault=c(this.langDefaults)||c(this.dirDefaults)||a.defaults.buttonText||c(nb.defaults)||(a.duration?this.humanizeDuration(a.duration):null)||b},instantiateView:function(a){var b=this.getViewSpec(a);return new b["class"](this,a,b.options,b.duration)},isValidViewType:function(a){return Boolean(this.getViewSpec(a))},pushLoading:function(){this.loadingLevel++||this.trigger("loading",null,!0,this.view)},popLoading:function(){--this.loadingLevel||this.trigger("loading",null,!1,this.view)},buildSelectRange:function(a,b){return a=this.moment(a),b=b?this.moment(b):a.hasTime()?a.clone().add(this.defaultTimedEventDuration):a.clone().add(this.defaultAllDayEventDuration),{start:a,end:b}}});nb.mixin(bb),nb.defaults={titleRangeSeparator:" â ",monthYearFormat:"MMMM YYYY",defaultTimedEventDuration:"02:00:00",defaultAllDayEventDuration:{days:1},forceEventDuration:!1,nextDayThreshold:"09:00:00",defaultView:"month",aspectRatio:1.35,header:{left:"title",center:"",right:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberTitle:"W",weekNumberCalculation:"local",scrollTime:"06:00:00",lazyFetching:!0,startParam:"start",endParam:"end",timezoneParam:"timezone",timezone:!1,isRTL:!1,buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day"},buttonIcons:{prev:"left-single-arrow",next:"right-single-arrow",prevYear:"left-double-arrow",nextYear:"right-double-arrow"},theme:!1,themeButtonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e",prevYear:"seek-prev",nextYear:"seek-next"},dragOpacity:.75,dragRevertDuration:500,dragScroll:!0,unselectAuto:!0,dropAccept:"*",eventOrder:"title",eventLimit:!1,eventLimitText:"more",eventLimitClick:"popover",dayPopoverFormat:"LL",handleWindowResize:!0,windowResizeDelay:200},nb.englishDefaults={dayPopoverFormat:"dddd, MMMM D"},nb.rtlDefaults={header:{left:"next,prev today",center:"",right:"title"},buttonIcons:{prev:"right-single-arrow",next:"left-single-arrow",prevYear:"right-double-arrow",nextYear:"left-double-arrow"},themeButtonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w",nextYear:"seek-prev",prevYear:"seek-next"}};var ob=Ma.langs={};Ma.datepickerLang=function(b,c,d){var e=ob[b]||(ob[b]={});e.isRTL=d.isRTL,e.weekNumberTitle=d.weekHeader,a.each(pb,function(a,b){e[a]=b(d)}),a.datepicker&&(a.datepicker.regional[c]=a.datepicker.regional[b]=d,a.datepicker.regional.en=a.datepicker.regional[""],a.datepicker.setDefaults(d))},Ma.lang=function(b,d){var e,f;e=ob[b]||(ob[b]={}),d&&(e=ob[b]=c([e,d])),f=Ia(b),a.each(qb,function(a,b){null==e[a]&&(e[a]=b(f,e))}),nb.defaults.lang=b};var pb={buttonText:function(a){return{prev:Z(a.prevText),next:Z(a.nextText),today:Z(a.currentText)}},monthYearFormat:function(a){return a.showMonthAfterYear?"YYYY["+a.yearSuffix+"] MMMM":"MMMM YYYY["+a.yearSuffix+"]"}},qb={dayOfMonthFormat:function(a,b){var c=a.longDateFormat("l");return c=c.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g,""),b.isRTL?c+=" ddd":c="ddd "+c,c},mediumTimeFormat:function(a){return a.longDateFormat("LT").replace(/\s*a$/i,"a")},smallTimeFormat:function(a){return a.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"a")},extraSmallTimeFormat:function(a){return a.longDateFormat("LT").replace(":mm","(:mm)").replace(/(\Wmm)$/,"($1)").replace(/\s*a$/i,"t")},hourFormat:function(a){return a.longDateFormat("LT").replace(":mm","").replace(/(\Wmm)$/,"").replace(/\s*a$/i,"a")},noMeridiemTimeFormat:function(a){return a.longDateFormat("LT").replace(/\s*a$/i,"")}},rb={smallDayDateFormat:function(a){return a.isRTL?"D dd":"dd D"},weekFormat:function(a){return a.isRTL?"w[ "+a.weekNumberTitle+"]":"["+a.weekNumberTitle+" ]w"},smallWeekFormat:function(a){return a.isRTL?"w["+a.weekNumberTitle+"]":"["+a.weekNumberTitle+"]w"}};Ma.lang("en",nb.englishDefaults),Ma.sourceNormalizers=[],Ma.sourceFetchers=[];var sb={dataType:"json",cache:!1},tb=1;nb.prototype.getPeerEvents=function(a,b){var c,d,e=this.getEventCache(),f=[];for(c=0;c<e.length;c++)d=e[c],a&&a._id===d._id||f.push(d);return f};var ub=mb.extend({dayGrid:null,dayNumbersVisible:!1,weekNumbersVisible:!1,weekNumberWidth:null,headRowEl:null,initialize:function(){this.dayGrid=new kb(this),this.coordMap=this.dayGrid.coordMap},setRange:function(a){mb.prototype.setRange.call(this,a),this.dayGrid.breakOnWeeks=/year|month|week/.test(this.intervalUnit),this.dayGrid.setRange(a)},computeRange:function(a){var b=mb.prototype.computeRange.call(this,a);return/year|month/.test(b.intervalUnit)&&(b.start.startOf("week"),b.start=this.skipHiddenDays(b.start),b.end.weekday()&&(b.end.add(1,"week").startOf("week"),b.end=this.skipHiddenDays(b.end,-1,!0))),b},renderDates:function(){this.dayNumbersVisible=this.dayGrid.rowCnt>1,this.weekNumbersVisible=this.opt("weekNumbers"),this.dayGrid.numbersVisible=this.dayNumbersVisible||this.weekNumbersVisible,this.el.addClass("fc-basic-view").html(this.renderHtml()),this.headRowEl=this.el.find("thead .fc-row"),this.scrollerEl=this.el.find(".fc-day-grid-container"),this.dayGrid.coordMap.containerEl=this.scrollerEl,this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(this.hasRigidRows())},unrenderDates:function(){this.dayGrid.unrenderDates(),this.dayGrid.removeElement()},renderBusinessHours:function(){this.dayGrid.renderBusinessHours()},renderHtml:function(){return'<table><thead class="fc-head"><tr><td class="'+this.widgetHeaderClass+'">'+this.dayGrid.headHtml()+'</td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'"><div class="fc-day-grid-container"><div class="fc-day-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){return this.weekNumbersVisible?'<th class="fc-week-number '+this.widgetHeaderClass+'" '+this.weekNumberStyleAttr()+"><span>"+Y(this.opt("weekNumberTitle"))+"</span></th>":void 0},numberIntroHtml:function(a){return this.weekNumbersVisible?'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"><span>"+this.dayGrid.getCell(a,0).start.format("w")+"</span></td>":void 0},dayIntroHtml:function(){return this.weekNumbersVisible?'<td class="fc-week-number '+this.widgetContentClass+'" '+this.weekNumberStyleAttr()+"></td>":void 0},introHtml:function(){return this.weekNumbersVisible?'<td class="fc-week-number" '+this.weekNumberStyleAttr()+"></td>":void 0},numberCellHtml:function(a){var b,c=a.start;return this.dayNumbersVisible?(b=this.dayGrid.getDayClasses(c),b.unshift("fc-day-number"),'<td class="'+b.join(" ")+'" data-date="'+c.format()+'">'+c.date()+"</td>"):"<td/>"},weekNumberStyleAttr:function(){return null!==this.weekNumberWidth?'style="width:'+this.weekNumberWidth+'px"':""},hasRigidRows:function(){var a=this.opt("eventLimit");return a&&"number"!=typeof a},updateWidth:function(){this.weekNumbersVisible&&(this.weekNumberWidth=k(this.el.find(".fc-week-number")))},setHeight:function(a,b){var c,d=this.opt("eventLimit");m(this.scrollerEl),f(this.headRowEl),this.dayGrid.removeSegPopover(),d&&"number"==typeof d&&this.dayGrid.limitRows(d),c=this.computeScrollerHeight(a),this.setGridHeight(c,b),d&&"number"!=typeof d&&this.dayGrid.limitRows(d),!b&&l(this.scrollerEl,c)&&(e(this.headRowEl,r(this.scrollerEl)),c=this.computeScrollerHeight(a),this.scrollerEl.height(c))},setGridHeight:function(a,b){b?j(this.dayGrid.rowEls):i(this.dayGrid.rowEls,a,!0)},renderEvents:function(a){this.dayGrid.renderEvents(a),this.updateHeight()},getEventSegs:function(){return this.dayGrid.getEventSegs()},unrenderEvents:function(){this.dayGrid.unrenderEvents()},renderDrag:function(a,b){return this.dayGrid.renderDrag(a,b)},unrenderDrag:function(){this.dayGrid.unrenderDrag()},renderSelection:function(a){this.dayGrid.renderSelection(a)},unrenderSelection:function(){this.dayGrid.unrenderSelection()}}),vb=ub.extend({computeRange:function(a){var b,c=ub.prototype.computeRange.call(this,a);return this.isFixedWeeks()&&(b=Math.ceil(c.end.diff(c.start,"weeks",!0)),c.end.add(6-b,"weeks")),c},setGridHeight:function(a,b){b=b||"variable"===this.opt("weekMode"),b&&(a*=this.rowCnt/6),i(this.dayGrid.rowEls,a,!b)},isFixedWeeks:function(){var a=this.opt("weekMode");return a?"fixed"===a:this.opt("fixedWeekCount")}});Na.basic={"class":ub},Na.basicDay={type:"basic",duration:{days:1}},Na.basicWeek={type:"basic",duration:{weeks:1}},Na.month={"class":vb,duration:{months:1},defaults:{fixedWeekCount:!0}};var wb=mb.extend({timeGrid:null,dayGrid:null,axisWidth:null,noScrollRowEls:null,bottomRuleEl:null,bottomRuleHeight:null,initialize:function(){this.timeGrid=new lb(this),this.opt("allDaySlot")?(this.dayGrid=new kb(this),this.coordMap=new eb([this.dayGrid.coordMap,this.timeGrid.coordMap])):this.coordMap=this.timeGrid.coordMap},setRange:function(a){mb.prototype.setRange.call(this,a),this.timeGrid.setRange(a),this.dayGrid&&this.dayGrid.setRange(a)},renderDates:function(){this.el.addClass("fc-agenda-view").html(this.renderHtml()),this.scrollerEl=this.el.find(".fc-time-grid-container"),this.timeGrid.coordMap.containerEl=this.scrollerEl,this.timeGrid.setElement(this.el.find(".fc-time-grid")),this.timeGrid.renderDates(),this.bottomRuleEl=a('<hr class="fc-divider '+this.widgetHeaderClass+'"/>').appendTo(this.timeGrid.el),this.dayGrid&&(this.dayGrid.setElement(this.el.find(".fc-day-grid")),this.dayGrid.renderDates(),this.dayGrid.bottomCoordPadding=this.dayGrid.el.next("hr").outerHeight()),this.noScrollRowEls=this.el.find(".fc-row:not(.fc-scroller *)")},unrenderDates:function(){this.timeGrid.unrenderDates(),this.timeGrid.removeElement(),this.dayGrid&&(this.dayGrid.unrenderDates(),this.dayGrid.removeElement())},renderBusinessHours:function(){this.timeGrid.renderBusinessHours(),this.dayGrid&&this.dayGrid.renderBusinessHours()},renderHtml:function(){return'<table><thead class="fc-head"><tr><td class="'+this.widgetHeaderClass+'">'+this.timeGrid.headHtml()+'</td></tr></thead><tbody class="fc-body"><tr><td class="'+this.widgetContentClass+'">'+(this.dayGrid?'<div class="fc-day-grid"/><hr class="fc-divider '+this.widgetHeaderClass+'"/>':"")+'<div class="fc-time-grid-container"><div class="fc-time-grid"/></div></td></tr></tbody></table>'},headIntroHtml:function(){var a,b;return this.opt("weekNumbers")?(a=this.timeGrid.getCell(0).start,b=a.format(this.opt("smallWeekFormat")),'<th class="fc-axis fc-week-number '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"><span>"+Y(b)+"</span></th>"):'<th class="fc-axis '+this.widgetHeaderClass+'" '+this.axisStyleAttr()+"></th>"},dayIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"><span>"+(this.opt("allDayHtml")||Y(this.opt("allDayText")))+"</span></td>"},slotBgIntroHtml:function(){return'<td class="fc-axis '+this.widgetContentClass+'" '+this.axisStyleAttr()+"></td>"},introHtml:function(){return'<td class="fc-axis" '+this.axisStyleAttr()+"></td>"},axisStyleAttr:function(){return null!==this.axisWidth?'style="width:'+this.axisWidth+'px"':""},updateSize:function(a){this.timeGrid.updateSize(a),mb.prototype.updateSize.call(this,a)},updateWidth:function(){this.axisWidth=k(this.el.find(".fc-axis"))},setHeight:function(a,b){var c,d;null===this.bottomRuleHeight&&(this.bottomRuleHeight=this.bottomRuleEl.outerHeight()),this.bottomRuleEl.hide(),this.scrollerEl.css("overflow",""),m(this.scrollerEl),f(this.noScrollRowEls),this.dayGrid&&(this.dayGrid.removeSegPopover(),c=this.opt("eventLimit"),c&&"number"!=typeof c&&(c=xb),c&&this.dayGrid.limitRows(c)),b||(d=this.computeScrollerHeight(a),l(this.scrollerEl,d)?(e(this.noScrollRowEls,r(this.scrollerEl)),d=this.computeScrollerHeight(a),this.scrollerEl.height(d)):(this.scrollerEl.height(d).css("overflow","hidden"),this.bottomRuleEl.show()))},computeInitialScroll:function(){var a=b.duration(this.opt("scrollTime")),c=this.timeGrid.computeTimeTop(a);return c=Math.ceil(c),c&&c++,c},renderEvents:function(a){var b,c,d=[],e=[],f=[];for(c=0;c<a.length;c++)a[c].allDay?d.push(a[c]):e.push(a[c]);b=this.timeGrid.renderEvents(e),this.dayGrid&&(f=this.dayGrid.renderEvents(d)),this.updateHeight()},getEventSegs:function(){return this.timeGrid.getEventSegs().concat(this.dayGrid?this.dayGrid.getEventSegs():[])},unrenderEvents:function(){this.timeGrid.unrenderEvents(),this.dayGrid&&this.dayGrid.unrenderEvents()},renderDrag:function(a,b){return a.start.hasTime()?this.timeGrid.renderDrag(a,b):this.dayGrid?this.dayGrid.renderDrag(a,b):void 0; 22 },unrenderDrag:function(){this.timeGrid.unrenderDrag(),this.dayGrid&&this.dayGrid.unrenderDrag()},renderSelection:function(a){a.start.hasTime()||a.end.hasTime()?this.timeGrid.renderSelection(a):this.dayGrid&&this.dayGrid.renderSelection(a)},unrenderSelection:function(){this.timeGrid.unrenderSelection(),this.dayGrid&&this.dayGrid.unrenderSelection()}}),xb=5,yb=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];return Na.agenda={"class":wb,defaults:{allDaySlot:!0,allDayText:"all-day",slotDuration:"00:30:00",minTime:"00:00:00",maxTime:"24:00:00",slotEventOverlap:!0}},Na.agendaDay={type:"agenda",duration:{days:1}},Na.agendaWeek={type:"agenda",duration:{weeks:1}},Ma}),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function b(b,g,h,i,j){function k(c,d){var f=d||[{message:c}];(b.googleCalendarError||a.noop).apply(j,f),(j.options.googleCalendarError||a.noop).apply(j,f),e.warn.apply(null,[c].concat(d||[]))}var l,m,n=d+"/"+encodeURIComponent(b.googleCalendarId)+"/events?callback=?",o=b.googleCalendarApiKey||j.options.googleCalendarApiKey,p=b.success;return o?(g.hasZone()||(g=g.clone().utc().add(-1,"day")),h.hasZone()||(h=h.clone().utc().add(1,"day")),i&&"local"!=i&&(m=i.replace(" ","_")),l=a.extend({},b.data||{},{key:o,timeMin:g.format(),timeMax:h.format(),timeZone:m,singleEvents:!0,maxResults:9999}),a.extend({},b,{googleCalendarId:null,url:n,data:l,startParam:!1,endParam:!1,timezoneParam:!1,success:function(b){var d,e,g=[];if(b.error)k("Google Calendar API: "+b.error.message,b.error.errors);else if(b.items&&(a.each(b.items,function(a,b){var d=b.htmlLink;m&&(d=c(d,"ctz="+m)),g.push({id:b.id,title:b.summary,start:b.start.dateTime||b.start.date,end:b.end.dateTime||b.end.date,url:d,location:b.location,description:b.description})}),d=[g].concat(Array.prototype.slice.call(arguments,1)),e=f(p,this,d),a.isArray(e)))return e;return g}})):(k("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/"),{})}function c(a,b){return a.replace(/(\?.*?)?(#|$)/,function(a,c,d){return(c?c+"&":"?")+b+d})}var d="https://www.googleapis.com/calendar/v3/calendars",e=a.fullCalendar,f=e.applyAll;e.sourceNormalizers.push(function(a){var b,c=a.googleCalendarId,d=a.url;!c&&d&&(/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(d)?c=d:((b=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(d))||(b=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(d)))&&(c=decodeURIComponent(b[1])),c&&(a.googleCalendarId=c)),c&&(null==a.editable&&(a.editable=!1),a.url=c)}),e.sourceFetchers.push(function(a,c,d,e){return a.googleCalendarId?b(a,c,d,e,this):void 0})}),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery),d3.gantt=function(){function a(c){w(c),x();var d=d3.tip().attr("class","d3-tip").html(function(a){var b=new Date(a.startDate),c=new Date(a.endDate),d=a.status;return a.last?d+" <br/> "+b.toUTCString()+" to now":d+" <br/> "+b.toUTCString()+" to "+c.toUTCString()}),h=d3.select(g).append("svg").attr("class","chart").attr("width","100%").attr("height",m+e.top+e.bottom),i=h.append("g").attr("class","gantt-chart").attr("width","100%").attr("height",m+e.top+e.bottom).attr("transform","translate("+e.left+", "+e.top+")").call(d);return i.selectAll(".chart").data(c,p).enter().append("rect").attr("rx",5).attr("ry",5).attr("class",function(a){return null==l[a.status]?"bar":l[a.status]}).attr("y",0).attr("transform",r).attr("height",function(a){return t.rangeBand()}).attr("width",function(a){return s(a.endDate-q)-s(a.startDate-q)}).on("mouseover",d.show).on("mouseout",d.hide),i.append("g").attr("class","x axis").attr("transform","translate(0, "+(m-e.top-e.bottom)+")").transition().call(u),f&&i.append("g").attr("class","y axis").transition().call(v),h.on("mousedown",function(){var b=d3.mouse(this),d=n;d=b[0]/d,a.zoom(c,d,this)}).on("contextmenu",function(d,e){b=null,d3.event.preventDefault(),a.redraw(c,this)}),a}var b,c,d="fit",e={top:20,right:40,bottom:20,left:70},f=!0,g="body",h=d3.time.day.offset(new Date,-3),i=d3.time.hour.offset(new Date,3),j=d,k=[],l=[],m=document.body.clientHeight-e.top-e.bottom-5,n=document.body.clientWidth-e.right-e.left-5,o="%H:%M",p=function(a){return a.startDate+a.taskName+a.endDate},q=36e5,r=function(a){return"translate("+s(a.startDate-q)+","+t(a.taskName)+")"},s=d3.time.scale().domain([h,i]).range([0,n]).clamp(!0),t=d3.scale.ordinal().domain(k).rangeRoundBands([0,m-e.top-e.bottom],.1),u=d3.svg.axis().scale(s).orient("bottom").tickFormat(d3.time.format(o)).tickSubdivide(!0).tickSize(8).tickPadding(8),v=d3.svg.axis().scale(t).orient("left").tickSize(0),w=function(a){if(j===d){if(void 0===a||a.length<1)return h=d3.time.day.offset(new Date,-3),void(i=d3.time.hour.offset(new Date,3));a.sort(function(a,b){return a.endDate-b.endDate}),i=a[a.length-1].endDate,a.sort(function(a,b){return a.startDate-b.startDate}),h=a[0].startDate}},x=function(){s=d3.time.scale().domain([h-q,i-q]).range([0,n]).clamp(!0),t=d3.scale.ordinal().domain(k).rangeRoundBands([0,m-e.top-e.bottom],.1),u=new Date(h).toDateString()!=new Date(i).toDateString()?d3.svg.axis().scale(s).orient("bottom").tickFormat(null).tickSubdivide(!0).tickSize(8).tickPadding(8):d3.svg.axis().scale(s).orient("bottom").tickFormat(d3.time.format(o)).tickSubdivide(!0).tickSize(8).tickPadding(8),v=d3.svg.axis().scale(t).orient("left").tickSize(0)};return a.zoom=function(d,e,f){w(d),null==b&&(b=h,c=i);var g=c-b,j=g*e+b,k=g/1.5,l=j-k/2;k/=2,b>l?k+=b-l:b=l;var m=j+k;m>c?b-=m-c:c=m,h=b,i=c,a.redrawInner(d,f)},a.redraw=function(b,c){w(b),a.redrawInner(b,c)},a.redrawInner=function(b,c){x();var d=d3.select(c),e=d.select(".gantt-chart"),f=e.selectAll("rect").data(b,p);return f.enter().insert("rect",":first-child").attr("rx",5).attr("ry",5).attr("class",function(a){return null==l[a.status]?"bar":l[a.status]}).transition().attr("y",0).attr("transform",r).attr("height",function(a){return t.rangeBand()}).attr("width",function(a){return s(a.endDate-q)-s(a.startDate-q)}),f.transition().attr("transform",r).attr("height",function(a){return t.rangeBand()}).attr("width",function(a){return s(a.endDate-q)-s(a.startDate-q)}),f.exit().remove(),d.select(".x").transition().call(u),d.select(".y").transition().call(v),a},a.margin=function(b){return arguments.length?(e=b,a):e},a.drawytitles=function(b){return arguments.length?(f=b,a):f},a.timeDomain=function(b){return arguments.length?(h=+b[0],i=+b[1],a):[h,i]},a.timeDomainMode=function(b){return arguments.length?(j=b,a):j},a.taskTypes=function(b){return arguments.length?(k=b,a):k},a.taskStatus=function(b){return arguments.length?(l=b,a):l},a.width=function(b){return arguments.length?(n=+b,a):n},a.height=function(b){return arguments.length?(m=+b,a):m},a.tickFormat=function(b){return arguments.length?(o=b,a):o},a.selector=function(b){return arguments.length?(g=b,a):g},a},function(a,b){"function"==typeof define&&define.amd?define(["d3"],b):"object"==typeof module&&module.exports?module.exports=function(a){return a.tip=b(a),a.tip}:a.d3.tip=b(a.d3)}(this,function(a){return function(){function b(a){v=o(a),w=v.createSVGPoint(),document.body.appendChild(u)}function c(){return"n"}function d(){return[0,0]}function e(){return" "}function f(){var a=q();return{top:a.n.y-u.offsetHeight,left:a.n.x-u.offsetWidth/2}}function g(){var a=q();return{top:a.s.y,left:a.s.x-u.offsetWidth/2}}function h(){var a=q();return{top:a.e.y-u.offsetHeight/2,left:a.e.x}}function i(){var a=q();return{top:a.w.y-u.offsetHeight/2,left:a.w.x-u.offsetWidth}}function j(){var a=q();return{top:a.nw.y-u.offsetHeight,left:a.nw.x-u.offsetWidth}}function k(){var a=q();return{top:a.ne.y-u.offsetHeight,left:a.ne.x}}function l(){var a=q();return{top:a.sw.y,left:a.sw.x-u.offsetWidth}}function m(){var a=q();return{top:a.se.y,left:a.e.x}}function n(){var b=a.select(document.createElement("div"));return b.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),b.node()}function o(a){return a=a.node(),"svg"===a.tagName.toLowerCase()?a:a.ownerSVGElement}function p(){return null===u&&(u=n(),document.body.appendChild(u)),a.select(u)}function q(){for(var b=x||a.event.target;"undefined"==typeof b.getScreenCTM&&"undefined"===b.parentNode;)b=b.parentNode;var c={},d=b.getScreenCTM(),e=b.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return w.x=h,w.y=i,c.nw=w.matrixTransform(d),w.x+=f,c.ne=w.matrixTransform(d),w.y+=g,c.se=w.matrixTransform(d),w.x-=f,c.sw=w.matrixTransform(d),w.y-=g/2,c.w=w.matrixTransform(d),w.x+=f,c.e=w.matrixTransform(d),w.x-=f/2,w.y-=g/2,c.n=w.matrixTransform(d),w.y+=g,c.s=w.matrixTransform(d),c}var r=c,s=d,t=e,u=n(),v=null,w=null,x=null;b.show=function(){var a=Array.prototype.slice.call(arguments);a[a.length-1]instanceof SVGElement&&(x=a.pop());var c,d=t.apply(this,a),e=s.apply(this,a),f=r.apply(this,a),g=p(),h=z.length,i=document.documentElement.scrollTop||document.body.scrollTop,j=document.documentElement.scrollLeft||document.body.scrollLeft;for(g.html(d).style({opacity:1,"pointer-events":"all"});h--;)g.classed(z[h],!1);return c=y.get(f).apply(this),g.classed(f,!0).style({top:c.top+e[0]+i+"px",left:c.left+e[1]+j+"px"}),b},b.hide=function(){var a=p();return a.style({opacity:0,"pointer-events":"none"}),b},b.attr=function(c,d){if(arguments.length<2&&"string"==typeof c)return p().attr(c);var e=Array.prototype.slice.call(arguments);return a.selection.prototype.attr.apply(p(),e),b},b.style=function(c,d){if(arguments.length<2&&"string"==typeof c)return p().style(c);var e=Array.prototype.slice.call(arguments);return a.selection.prototype.style.apply(p(),e),b},b.direction=function(c){return arguments.length?(r=null==c?c:a.functor(c),b):r},b.offset=function(c){return arguments.length?(s=null==c?c:a.functor(c),b):s},b.html=function(c){return arguments.length?(t=null==c?c:a.functor(c),b):t},b.destroy=function(){return u&&(p().remove(),u=null),b};var y=a.map({n:f,s:g,e:h,w:i,nw:j,ne:k,sw:l,se:m}),z=y.keys();return b}}),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(b,d){var e,f,g,h=b.nodeName.toLowerCase();return"area"===h?(e=b.parentNode,f=e.name,b.href&&f&&"map"===e.nodeName.toLowerCase()?(g=a("img[usemap='#"+f+"']")[0],!!g&&c(g)):!1):(/input|select|textarea|button|object/.test(h)?!b.disabled:"a"===h?b.href||d:d)&&c(b)}function c(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(b){var c=this.css("position"),d="absolute"===c,e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);return d&&"static"===b.css("position")?!1:e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:a(this[0].ownerDocument||document)},uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(c){return b(c,!isNaN(a.attr(c,"tabindex")))},tabbable:function(c){var d=a.attr(c,"tabindex"),e=isNaN(d);return(e||d>=0)&&b(c,!e)}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(b,c){function d(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),f&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var e="Width"===c?["Left","Right"]:["Top","Bottom"],f=c.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+c]=function(b){return void 0===b?g["inner"+c].call(this):this.each(function(){a(this).css(f,d(this,b)+"px")})},a.fn["outer"+c]=function(b,e){return"number"!=typeof b?g["outer"+c].call(this,b):this.each(function(){a(this).css(f,d(this,b,!0,e)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),disableSelection:function(){var a="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(b){if(void 0!==b)return this.css("zIndex",b);if(this.length)for(var c,d,e=a(this[0]);e.length&&e[0]!==document;){if(c=e.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(d=parseInt(e.css("zIndex"),10),!isNaN(d)&&0!==d))return d;e=e.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;f.length>e;e++)a.options[f[e][0]]&&f[e][1].apply(a.element,c)}}}),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){var b=0,c=Array.prototype.slice;return a.cleanData=function(b){return function(c){var d,e,f;for(f=0;null!=(e=c[f]);f++)try{d=a._data(e,"events"),d&&d.remove&&a(e).triggerHandler("remove")}catch(g){}b(c)}}(a.cleanData),a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];return b=b.split(".")[1],e=j+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e.toLowerCase()]=function(b){return!!a.data(b,e)},a[j]=a[j]||{},f=a[j][b],g=a[j][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new g(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,d){return a.isFunction(d)?void(i[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},e=function(a){return c.prototype[b].apply(this,a)};return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(i[b]=d)}),g.prototype=a.widget.extend(h,{widgetEventPrefix:f?h.widgetEventPrefix||b:b},i,{constructor:g,namespace:j,widgetName:b,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g),g},a.widget.extend=function(b){for(var d,e,f=c.call(arguments,1),g=0,h=f.length;h>g;g++)for(d in f[g])e=f[g][d],f[g].hasOwnProperty(d)&&void 0!==e&&(b[d]=a.isPlainObject(e)?a.isPlainObject(b[d])?a.widget.extend({},b[d],e):a.widget.extend({},e):e);return b},a.widget.bridge=function(b,d){var e=d.prototype.widgetFullName||b;a.fn[b]=function(f){var g="string"==typeof f,h=c.call(arguments,1),i=this;return f=!g&&h.length?a.widget.extend.apply(null,[f].concat(h)):f,g?this.each(function(){var c,d=a.data(this,e);return"instance"===f?(i=d,!1):d?a.isFunction(d[f])&&"_"!==f.charAt(0)?(c=d[f].apply(d,h),c!==d&&void 0!==c?(i=c&&c.jquery?i.pushStack(c.get()):c,!1):void 0):a.error("no such method '"+f+"' for "+b+" widget instance"):a.error("cannot call methods on "+b+" prior to initialization; attempted to call method '"+f+"'")}):this.each(function(){var b=a.data(this,e);b?(b.option(f||{}),b._init&&b._init()):a.data(this,e,new d(f,this))}),i}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(c,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=b++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this.options=a.widget.extend({},this.options,this._getCreateOptions(),c),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(b,c){var d,e,f,g=b;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof b)if(g={},d=b.split("."),b=d.shift(),d.length){for(e=g[b]=a.widget.extend({},this.options[b]),f=0;d.length-1>f;f++)e[d[f]]=e[d[f]]||{},e=e[d[f]];if(b=d.pop(),1===arguments.length)return void 0===e[b]?null:e[b];e[b]=c}else{if(1===arguments.length)return void 0===this.options[b]?null:this.options[b];g[b]=c}return this._setOptions(g),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!b),b&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(b,c,d){var e,f=this;"boolean"!=typeof b&&(d=c,c=b,b=!1),d?(c=e=a(c),this.bindings=this.bindings.add(c)):(d=c,c=this.element,e=this.widget()),a.each(d,function(d,g){function h(){return b||f.options.disabled!==!0&&!a(this).hasClass("ui-state-disabled")?("string"==typeof g?f[g]:g).apply(f,arguments):void 0}"string"!=typeof g&&(h.guid=g.guid=g.guid||h.guid||a.guid++);var i=d.match(/^([\w:-]*)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];k?e.delegate(k,j,h):c.bind(j,h)})},_off:function(b,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,b.unbind(c).undelegate(c),this.bindings=a(this.bindings.not(b).get()),this.focusable=a(this.focusable.not(b).get()),this.hoverable=a(this.hoverable.not(b).get())},_delay:function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={effect:e});var g,h=e?e===!0||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}}),a.widget}),function(a){"function"==typeof define&&define.amd?define(["jquery","./widget"],a):a(jQuery)}(function(a){var b=!1;return a(document).mouseup(function(){b=!1}),a.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){return!0===a.data(c.target,b.widgetName+".preventClickEvent")?(a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(c){if(!b){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var d=this,e=1===c.which,f="string"==typeof this.options.cancel&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:!1;return e&&!f&&this._mouseCapture(c)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(c)!==!1,!this._mouseStarted)?(c.preventDefault(),!0):(!0===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),b=!0,!0)):!0}},_mouseMove:function(b){if(this._mouseMoved){if(a.ui.ie&&(!document.documentMode||9>document.documentMode)&&!b.button)return this._mouseUp(b);if(!b.which)return this._mouseUp(b)}return(b.which||b.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted)},_mouseUp:function(c){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target===this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),b=!1,!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}),function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],a):a(jQuery)}(function(a){return a.widget("ui.draggable",a.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(a,b){this._super(a,b),"handle"===a&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(b){var c=this.options;return this._blurActiveElement(b),this.helper||c.disabled||a(b.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(b),this.handle?(this._blockFrames(c.iframeFix===!0?"iframe":c.iframeFix),!0):!1)},_blockFrames:function(b){this.iframeBlocks=this.document.find(b).map(function(){var b=a(this);return a("<div>").css("position","absolute").appendTo(b.parent()).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()).offset(b.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(b){var c=this.document[0];if(this.handleElement.is(b.target))try{c.activeElement&&"body"!==c.activeElement.nodeName.toLowerCase()&&a(c.activeElement).blur()}catch(d){}},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===a(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(b),this.originalPosition=this.position=this._generatePosition(b,!1),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._normalizeRightBottom(),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top}},_mouseDrag:function(b,c){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(b,!0),this.positionAbs=this._convertPositionTo("absolute"),!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=this,d=!1;return a.ui.ddmanager&&!this.options.dropBehaviour&&(d=a.ui.ddmanager.drop(this,b)),this.dropped&&(d=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!d||"valid"===this.options.revert&&d||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)?a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",b)!==!1&&c._clear()}):this._trigger("stop",b)!==!1&&this._clear(),!1},_mouseUp:function(b){return this._unblockFrames(),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),this.handleElement.is(b.target)&&this.element.focus(),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){return this.options.handle?!!a(b.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(b){ 23 var c=this.options,d=a.isFunction(c.helper),e=d?a(c.helper.apply(this.element[0],[b])):"clone"===c.helper?this.element.clone().removeAttr("id"):this.element;return e.parents("body").length||e.appendTo("parent"===c.appendTo?this.element[0].parentNode:c.appendTo),d&&e[0]===this.element[0]&&this._setPositionRelative(),e[0]===this.element[0]||/(fixed|absolute)/.test(e.css("position"))||e.css("position","absolute"),e},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_isRootNode:function(a){return/(html|body)/i.test(a.tagName)||a===this.document[0]},_getParentOffset:function(){var b=this.offsetParent.offset(),c=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==c&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var a=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+(b?0:this.scrollParent.scrollTop()),left:a.left-(parseInt(this.helper.css("left"),10)||0)+(b?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b,c,d,e=this.options,f=this.document[0];return this.relativeContainer=null,e.containment?"window"===e.containment?void(this.containment=[a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,a(window).scrollLeft()+a(window).width()-this.helperProportions.width-this.margins.left,a(window).scrollTop()+(a(window).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===e.containment?void(this.containment=[0,0,a(f).width()-this.helperProportions.width-this.margins.left,(a(f).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):e.containment.constructor===Array?void(this.containment=e.containment):("parent"===e.containment&&(e.containment=this.helper[0].parentNode),c=a(e.containment),d=c[0],void(d&&(b=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(b?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(a,b){b||(b=this.position);var c="absolute"===a?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:b.top+this.offset.relative.top*c+this.offset.parent.top*c-("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top)*c,left:b.left+this.offset.relative.left*c+this.offset.parent.left*c-("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)*c}},_generatePosition:function(a,b){var c,d,e,f,g=this.options,h=this._isRootNode(this.scrollParent[0]),i=a.pageX,j=a.pageY;return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),b&&(this.containment&&(this.relativeContainer?(d=this.relativeContainer.offset(),c=[this.containment[0]+d.left,this.containment[1]+d.top,this.containment[2]+d.left,this.containment[3]+d.top]):c=this.containment,a.pageX-this.offset.click.left<c[0]&&(i=c[0]+this.offset.click.left),a.pageY-this.offset.click.top<c[1]&&(j=c[1]+this.offset.click.top),a.pageX-this.offset.click.left>c[2]&&(i=c[2]+this.offset.click.left),a.pageY-this.offset.click.top>c[3]&&(j=c[3]+this.offset.click.top)),g.grid&&(e=g.grid[1]?this.originalPageY+Math.round((j-this.originalPageY)/g.grid[1])*g.grid[1]:this.originalPageY,j=c?e-this.offset.click.top>=c[1]||e-this.offset.click.top>c[3]?e:e-this.offset.click.top>=c[1]?e-g.grid[1]:e+g.grid[1]:e,f=g.grid[0]?this.originalPageX+Math.round((i-this.originalPageX)/g.grid[0])*g.grid[0]:this.originalPageX,i=c?f-this.offset.click.left>=c[0]||f-this.offset.click.left>c[2]?f:f-this.offset.click.left>=c[0]?f-g.grid[0]:f+g.grid[0]:f),"y"===g.axis&&(i=this.originalPageX),"x"===g.axis&&(j=this.originalPageY)),{top:j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d,this],!0),/^(drag|start|stop)/.test(b)&&(this.positionAbs=this._convertPositionTo("absolute"),d.offset=this.positionAbs),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c,d){var e=a.extend({},c,{item:d.element});d.sortables=[],a(d.options.connectToSortable).each(function(){var c=a(this).sortable("instance");c&&!c.options.disabled&&(d.sortables.push(c),c.refreshPositions(),c._trigger("activate",b,e))})},stop:function(b,c,d){var e=a.extend({},c,{item:d.element});d.cancelHelperRemoval=!1,a.each(d.sortables,function(){var a=this;a.isOver?(a.isOver=0,d.cancelHelperRemoval=!0,a.cancelHelperRemoval=!1,a._storedCSS={position:a.placeholder.css("position"),top:a.placeholder.css("top"),left:a.placeholder.css("left")},a._mouseStop(b),a.options.helper=a.options._helper):(a.cancelHelperRemoval=!0,a._trigger("deactivate",b,e))})},drag:function(b,c,d){a.each(d.sortables,function(){var e=!1,f=this;f.positionAbs=d.positionAbs,f.helperProportions=d.helperProportions,f.offset.click=d.offset.click,f._intersectsWith(f.containerCache)&&(e=!0,a.each(d.sortables,function(){return this.positionAbs=d.positionAbs,this.helperProportions=d.helperProportions,this.offset.click=d.offset.click,this!==f&&this._intersectsWith(this.containerCache)&&a.contains(f.element[0],this.element[0])&&(e=!1),e})),e?(f.isOver||(f.isOver=1,f.currentItem=c.helper.appendTo(f.element).data("ui-sortable-item",!0),f.options._helper=f.options.helper,f.options.helper=function(){return c.helper[0]},b.target=f.currentItem[0],f._mouseCapture(b,!0),f._mouseStart(b,!0,!0),f.offset.click.top=d.offset.click.top,f.offset.click.left=d.offset.click.left,f.offset.parent.left-=d.offset.parent.left-f.offset.parent.left,f.offset.parent.top-=d.offset.parent.top-f.offset.parent.top,d._trigger("toSortable",b),d.dropped=f.element,a.each(d.sortables,function(){this.refreshPositions()}),d.currentItem=d.element,f.fromOutside=d),f.currentItem&&(f._mouseDrag(b),c.position=f.position)):f.isOver&&(f.isOver=0,f.cancelHelperRemoval=!0,f.options._revert=f.options.revert,f.options.revert=!1,f._trigger("out",b,f._uiHash(f)),f._mouseStop(b,!0),f.options.revert=f.options._revert,f.options.helper=f.options._helper,f.placeholder&&f.placeholder.remove(),d._refreshOffsets(b),c.position=d._generatePosition(b,!0),d._trigger("fromSortable",b),d.dropped=!1,a.each(d.sortables,function(){this.refreshPositions()}))})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c,d){var e=a("body"),f=d.options;e.css("cursor")&&(f._cursor=e.css("cursor")),e.css("cursor",f.cursor)},stop:function(b,c,d){var e=d.options;e._cursor&&a("body").css("cursor",e._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("opacity")&&(f._opacity=e.css("opacity")),e.css("opacity",f.opacity)},stop:function(b,c,d){var e=d.options;e._opacity&&a(c.helper).css("opacity",e._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(a,b,c){c.scrollParentNotHidden||(c.scrollParentNotHidden=c.helper.scrollParent(!1)),c.scrollParentNotHidden[0]!==c.document[0]&&"HTML"!==c.scrollParentNotHidden[0].tagName&&(c.overflowOffset=c.scrollParentNotHidden.offset())},drag:function(b,c,d){var e=d.options,f=!1,g=d.scrollParentNotHidden[0],h=d.document[0];g!==h&&"HTML"!==g.tagName?(e.axis&&"x"===e.axis||(d.overflowOffset.top+g.offsetHeight-b.pageY<e.scrollSensitivity?g.scrollTop=f=g.scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(g.scrollTop=f=g.scrollTop-e.scrollSpeed)),e.axis&&"y"===e.axis||(d.overflowOffset.left+g.offsetWidth-b.pageX<e.scrollSensitivity?g.scrollLeft=f=g.scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(g.scrollLeft=f=g.scrollLeft-e.scrollSpeed))):(e.axis&&"x"===e.axis||(b.pageY-a(h).scrollTop()<e.scrollSensitivity?f=a(h).scrollTop(a(h).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(h).scrollTop())<e.scrollSensitivity&&(f=a(h).scrollTop(a(h).scrollTop()+e.scrollSpeed))),e.axis&&"y"===e.axis||(b.pageX-a(h).scrollLeft()<e.scrollSensitivity?f=a(h).scrollLeft(a(h).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(h).scrollLeft())<e.scrollSensitivity&&(f=a(h).scrollLeft(a(h).scrollLeft()+e.scrollSpeed)))),f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c,d){var e=d.options;d.snapElements=[],a(e.snap.constructor!==String?e.snap.items||":data(ui-draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!==d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o=d.options,p=o.snapTolerance,q=c.offset.left,r=q+d.helperProportions.width,s=c.offset.top,t=s+d.helperProportions.height;for(m=d.snapElements.length-1;m>=0;m--)i=d.snapElements[m].left-d.margins.left,j=i+d.snapElements[m].width,k=d.snapElements[m].top-d.margins.top,l=k+d.snapElements[m].height,i-p>r||q>j+p||k-p>t||s>l+p||!a.contains(d.snapElements[m].item.ownerDocument,d.snapElements[m].item)?(d.snapElements[m].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=!1):("inner"!==o.snapMode&&(e=p>=Math.abs(k-t),f=p>=Math.abs(l-s),g=p>=Math.abs(i-r),h=p>=Math.abs(j-q),e&&(c.position.top=d._convertPositionTo("relative",{top:k-d.helperProportions.height,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i-d.helperProportions.width}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j}).left)),n=e||f||g||h,"outer"!==o.snapMode&&(e=p>=Math.abs(k-s),f=p>=Math.abs(l-t),g=p>=Math.abs(i-q),h=p>=Math.abs(j-r),e&&(c.position.top=d._convertPositionTo("relative",{top:k,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l-d.helperProportions.height,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j-d.helperProportions.width}).left)),!d.snapElements[m].snapping&&(e||f||g||h||n)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=e||f||g||h||n)}}),a.ui.plugin.add("draggable","stack",{start:function(b,c,d){var e,f=d.options,g=a.makeArray(a(f.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});g.length&&(e=parseInt(a(g[0]).css("zIndex"),10)||0,a(g).each(function(b){a(this).css("zIndex",e+b)}),this.css("zIndex",e+g.length))}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("zIndex")&&(f._zIndex=e.css("zIndex")),e.css("zIndex",f.zIndex)},stop:function(b,c,d){var e=d.options;e._zIndex&&a(c.helper).css("zIndex",e._zIndex)}}),a.ui.draggable}),function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Plotly=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d=a("../src/plotly"),e={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var f in e){var g=f.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");d.Lib.addStyleRule(g,e[f])}},{"../src/plotly":366}],2:[function(a,b,c){"use strict";b.exports={undo:{width:857.1,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",ascent:850,descent:-150},home:{width:928.6,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",ascent:850,descent:-150},"camera-retro":{width:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",ascent:850,descent:-150},zoombox:{width:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",ascent:850,descent:-150},pan:{width:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",ascent:850,descent:-150},zoom_plus:{width:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",ascent:850,descent:-150},plotlylogo:{width:1542,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",ascent:850,descent:-150},"z-axis":{width:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",ascent:850,descent:-150},"3d_rotate":{width:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",ascent:850,descent:-150},camera:{width:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",ascent:850,descent:-150},movie:{width:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",ascent:850,descent:-150},question:{width:857.1,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",ascent:850,descent:-150},disk:{width:857.1,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",ascent:850,descent:-150},lasso:{width:1031,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",ascent:850,descent:-150},selectbox:{width:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",ascent:850,descent:-150}}},{}],3:[function(a,b,c){b.exports=a("../src/traces/bar")},{"../src/traces/bar":429}],4:[function(a,b,c){b.exports=a("../src/traces/box")},{"../src/traces/box":440}],5:[function(a,b,c){b.exports=a("../src/traces/choropleth")},{"../src/traces/choropleth":448}],6:[function(a,b,c){b.exports=a("../src/traces/contour")},{"../src/traces/contour":455}],7:[function(a,b,c){b.exports=a("../src/core")},{"../src/core":339}],8:[function(a,b,c){b.exports=a("../src/traces/heatmap")},{"../src/traces/heatmap":466}],9:[function(a,b,c){b.exports=a("../src/traces/histogram")},{"../src/traces/histogram":477}],10:[function(a,b,c){b.exports=a("../src/traces/histogram2d")},{"../src/traces/histogram2d":482}],11:[function(a,b,c){b.exports=a("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":486}],12:[function(a,b,c){"use strict";var d=a("./core");d.register([a("./bar"),a("./box"),a("./heatmap"),a("./histogram"),a("./histogram2d"),a("./histogram2dcontour"),a("./pie"),a("./contour"),a("./scatter3d"),a("./surface"),a("./mesh3d"),a("./scattergeo"),a("./choropleth"),a("./scattergl")]),b.exports=d},{"./bar":3,"./box":4,"./choropleth":5,"./contour":6,"./core":7,"./heatmap":8,"./histogram":9,"./histogram2d":10,"./histogram2dcontour":11,"./mesh3d":13,"./pie":14,"./scatter3d":15,"./scattergeo":16,"./scattergl":17,"./surface":18}],13:[function(a,b,c){b.exports=a("../src/traces/mesh3d")},{"../src/traces/mesh3d":490}],14:[function(a,b,c){b.exports=a("../src/traces/pie")},{"../src/traces/pie":495}],15:[function(a,b,c){b.exports=a("../src/traces/scatter3d")},{"../src/traces/scatter3d":528}],16:[function(a,b,c){b.exports=a("../src/traces/scattergeo")},{"../src/traces/scattergeo":532}],17:[function(a,b,c){b.exports=a("../src/traces/scattergl")},{"../src/traces/scattergl":537}],18:[function(a,b,c){b.exports=a("../src/traces/surface")},{"../src/traces/surface":542}],19:[function(a,b,c){"use strict";function d(a,b,c){return Math.min(b,Math.max(a,c))}function e(a,b,c){this.dimension=a.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var d=0;d<this.dimension;++d)this.bounds[0][d]=-(1/0),this.bounds[1][d]=1/0;this._state=a.slice().reverse(),this._velocity=b.slice().reverse(),this._time=[c],this._scratch=[a.slice(),a.slice(),a.slice(),a.slice(),a.slice()]}function f(a){for(var b=new Array(a),c=0;a>c;++c)b[c]=0;return b}function g(a,b,c){switch(arguments.length){case 0:return new e([0],[0],0);case 1:if("number"==typeof a){var d=f(a);return new e(d,d,0)}return new e(a,f(a.length),0);case 2:if("number"==typeof b){var d=f(a.length);return new e(a,d,+b)}c=0;case 3:if(a.length!==b.length)throw new Error("state and velocity lengths must match");return new e(a,b,c)}}b.exports=g;var h=a("cubic-hermite"),i=a("binary-search-bounds"),j=e.prototype;j.flush=function(a){var b=i.gt(this._time,a)-1;0>=b||(this._time.splice(0,b),this._state.splice(0,b*this.dimension),this._velocity.splice(0,b*this.dimension))},j.curve=function(a){var b=this._time,c=b.length,e=i.le(b,a),f=this._scratch[0],g=this._state,j=this._velocity,k=this.dimension,l=this.bounds;if(0>e)for(var m=k-1,n=0;k>n;++n,--m)f[n]=g[m];else if(e>=c-1)for(var m=g.length-1,o=a-b[c-1],n=0;k>n;++n,--m)f[n]=g[m]+o*j[m];else{for(var m=k*(e+1)-1,p=b[e],q=b[e+1],r=q-p||1,s=this._scratch[1],t=this._scratch[2],u=this._scratch[3],v=this._scratch[4],w=!0,n=0;k>n;++n,--m)s[n]=g[m],u[n]=j[m]*r,t[n]=g[m+k],v[n]=j[m+k]*r,w=w&&s[n]===t[n]&&u[n]===v[n]&&0===u[n];if(w)for(var n=0;k>n;++n)f[n]=s[n];else h(s,u,t,v,(a-p)/r,f)}for(var x=l[0],y=l[1],n=0;k>n;++n)f[n]=d(x[n],y[n],f[n]);return f},j.dcurve=function(a){var b=this._time,c=b.length,d=i.le(b,a),e=this._scratch[0],f=this._state,g=this._velocity,j=this.dimension;if(d>=c-1)for(var k=f.length-1,l=(a-b[c-1],0);j>l;++l,--k)e[l]=g[k];else{for(var k=j*(d+1)-1,m=b[d],n=b[d+1],o=n-m||1,p=this._scratch[1],q=this._scratch[2],r=this._scratch[3],s=this._scratch[4],t=!0,l=0;j>l;++l,--k)p[l]=f[k],r[l]=g[k]*o,q[l]=f[k+j],s[l]=g[k+j]*o,t=t&&p[l]===q[l]&&r[l]===s[l]&&0===r[l];if(t)for(var l=0;j>l;++l)e[l]=0;else{h.derivative(p,r,q,s,(a-m)/o,e);for(var l=0;j>l;++l)e[l]/=o}}return e},j.lastT=function(){var a=this._time;return a[a.length-1]},j.stable=function(){for(var a=this._velocity,b=a.length,c=this.dimension-1;c>=0;--c)if(a[--b])return!1;return!0},j.jump=function(a){var b=this.lastT(),c=this.dimension;if(!(b>a||arguments.length!==c+1)){var e=this._state,f=this._velocity,g=e.length-this.dimension,h=this.bounds,i=h[0],j=h[1];this._time.push(b,a);for(var k=0;2>k;++k)for(var l=0;c>l;++l)e.push(e[g++]),f.push(0);this._time.push(a);for(var l=c;l>0;--l)e.push(d(i[l-1],j[l-1],arguments[l])),f.push(0)}},j.push=function(a){var b=this.lastT(),c=this.dimension;if(!(b>a||arguments.length!==c+1)){var e=this._state,f=this._velocity,g=e.length-this.dimension,h=a-b,i=this.bounds,j=i[0],k=i[1],l=h>1e-6?1/h:0;this._time.push(a);for(var m=c;m>0;--m){var n=d(j[m-1],k[m-1],arguments[m]);e.push(n),f.push((n-e[g++])*l)}}},j.set=function(a){var b=this.dimension;if(!(a<this.lastT()||arguments.length!==b+1)){var c=this._state,e=this._velocity,f=this.bounds,g=f[0],h=f[1];this._time.push(a);for(var i=b;i>0;--i)c.push(d(g[i-1],h[i-1],arguments[i])),e.push(0)}},j.move=function(a){var b=this.lastT(),c=this.dimension;if(!(b>=a||arguments.length!==c+1)){var e=this._state,f=this._velocity,g=e.length-this.dimension,h=this.bounds,i=h[0],j=h[1],k=a-b,l=k>1e-6?1/k:0;this._time.push(a);for(var m=c;m>0;--m){var n=arguments[m];e.push(d(i[m-1],j[m-1],e[g++]+n)),f.push(n*l)}}},j.idle=function(a){var b=this.lastT();if(!(b>a)){var c=this.dimension,e=this._state,f=this._velocity,g=e.length-c,h=this.bounds,i=h[0],j=h[1],k=a-b;this._time.push(a);for(var l=c-1;l>=0;--l)e.push(d(i[l],j[l],e[g]+k*f[g])),f.push(0),g+=1}}},{"binary-search-bounds":20,"cubic-hermite":21}],20:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){var g=["function ",a,"(a,l,h,",d.join(","),"){",f?"":"var i=",c?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",e?".get(m)":"[m]"];return f?b.indexOf("c")<0?g.push(";if(x===y){return m}else if(x<=y){"):g.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):g.push(";if(",b,"){i=m;"),c?g.push("l=m+1}else{h=m-1}"):g.push("h=m-1}else{l=m+1}"),g.push("}"),f?g.push("return -1};"):g.push("return i};"),g.join("")}function e(a,b,c,e){var f=new Function([d("A","x"+a+"y",b,["y"],!1,e),d("B","x"+a+"y",b,["y"],!0,e),d("P","c(x,y)"+a+"0",b,["y","c"],!1,e),d("Q","c(x,y)"+a+"0",b,["y","c"],!0,e),"function dispatchBsearch",c,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",c].join("")); 24 return f()}b.exports={ge:e(">=",!1,"GE"),gt:e(">",!1,"GT"),lt:e("<",!0,"LT"),le:e("<=",!0,"LE"),eq:e("-",!0,"EQ",!0)}},{}],21:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){var g=6*e*e-6*e,h=3*e*e-4*e+1,i=-6*e*e+6*e,j=3*e*e-2*e;if(a.length){f||(f=new Array(a.length));for(var k=a.length-1;k>=0;--k)f[k]=g*a[k]+h*b[k]+i*c[k]+j*d[k];return f}return g*a+h*b+i*c[k]+j*d}function e(a,b,c,d,e,f){var g=e-1,h=e*e,i=g*g,j=(1+2*e)*i,k=e*i,l=h*(3-2*e),m=h*g;if(a.length){f||(f=new Array(a.length));for(var n=a.length-1;n>=0;--n)f[n]=j*a[n]+k*b[n]+l*c[n]+m*d[n];return f}return j*a+k*b+l*c+m*d}b.exports=e,b.exports.derivative=d},{}],22:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2];return a[0]=e*i-f*h,a[1]=f*g-d*i,a[2]=d*h-e*g,a}b.exports=d},{}],23:[function(a,b,c){function d(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}b.exports=d},{}],24:[function(a,b,c){function d(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)}b.exports=d},{}],25:[function(a,b,c){function d(a,b,c,d){var e=b[0],f=b[1],g=b[2];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a}b.exports=d},{}],26:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=c*c+d*d+e*e;return f>0&&(f=1/Math.sqrt(f),a[0]=b[0]*f,a[1]=b[1]*f,a[2]=b[2]*f),a}b.exports=d},{}],27:[function(a,b,c){"use strict";function d(a){this._components=a.slice(),this._time=[0],this.prevMatrix=a.slice(),this.nextMatrix=a.slice(),this.computedMatrix=a.slice(),this.computedInverse=a.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-(1/0),1/0]}function e(a){a=a||{};var b=a.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new d(b)}var f=a("binary-search-bounds"),g=a("mat4-interpolate"),h=a("gl-mat4/invert"),i=a("gl-mat4/rotateX"),j=a("gl-mat4/rotateY"),k=a("gl-mat4/rotateZ"),l=a("gl-mat4/lookAt"),m=a("gl-mat4/translate"),n=(a("gl-mat4/scale"),a("gl-vec3/normalize")),o=[0,0,0];b.exports=e;var p=d.prototype;p.recalcMatrix=function(a){var b=this._time,c=f.le(b,a),d=this.computedMatrix;if(!(0>c)){var e=this._components;if(c===b.length-1)for(var i=16*c,j=0;16>j;++j)d[j]=e[i++];else{for(var k=b[c+1]-b[c],i=16*c,l=this.prevMatrix,m=!0,j=0;16>j;++j)l[j]=e[i++];for(var o=this.nextMatrix,j=0;16>j;++j)o[j]=e[i++],m=m&&l[j]===o[j];if(1e-6>k||m)for(var j=0;16>j;++j)d[j]=l[j];else g(d,l,o,(a-b[c])/k)}var p=this.computedUp;p[0]=d[1],p[1]=d[5],p[2]=d[6],n(p,p);var q=this.computedInverse;h(q,d);var r=this.computedEye,s=q[15];r[0]=q[12]/s,r[1]=q[13]/s,r[2]=q[14]/s;for(var t=this.computedCenter,u=Math.exp(this.computedRadius[0]),j=0;3>j;++j)t[j]=r[j]-d[2+4*j]*u}},p.idle=function(a){if(!(a<this.lastT())){for(var b=this._components,c=b.length-16,d=0;16>d;++d)b.push(b[c++]);this._time.push(a)}},p.flush=function(a){var b=f.gt(this._time,a)-2;0>b||(this._time.slice(0,b),this._components.slice(0,16*b))},p.lastT=function(){return this._time[this._time.length-1]},p.lookAt=function(a,b,c,d){this.recalcMatrix(a),b=b||this.computedEye,c=c||o,d=d||this.computedUp,this.setMatrix(a,l(this.computedMatrix,b,c,d));for(var e=0,f=0;3>f;++f)e+=Math.pow(c[f]-b[f],2);e=Math.log(Math.sqrt(e)),this.computedRadius[0]=e},p.rotate=function(a,b,c,d){this.recalcMatrix(a);var e=this.computedInverse;b&&j(e,e,b),c&&i(e,e,c),d&&k(e,e,d),this.setMatrix(a,h(this.computedMatrix,e))};var q=[0,0,0];p.pan=function(a,b,c,d){q[0]=-(b||0),q[1]=-(c||0),q[2]=-(d||0),this.recalcMatrix(a);var e=this.computedInverse;m(e,e,q),this.setMatrix(a,h(e,e))},p.translate=function(a,b,c,d){q[0]=b||0,q[1]=c||0,q[2]=d||0,this.recalcMatrix(a);var e=this.computedMatrix;m(e,e,q),this.setMatrix(a,e)},p.setMatrix=function(a,b){if(!(a<this.lastT())){this._time.push(a);for(var c=0;16>c;++c)this._components.push(b[c])}},p.setDistance=function(a,b){this.computedRadius[0]=b},p.setDistanceLimits=function(a,b){var c=this._limits;c[0]=a,c[1]=b},p.getDistanceLimits=function(a){var b=this._limits;return a?(a[0]=b[0],a[1]=b[1],a):b}},{"binary-search-bounds":28,"gl-mat4/invert":94,"gl-mat4/lookAt":95,"gl-mat4/rotateX":99,"gl-mat4/rotateY":100,"gl-mat4/rotateZ":101,"gl-mat4/scale":102,"gl-mat4/translate":103,"gl-vec3/normalize":26,"mat4-interpolate":29}],28:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],29:[function(a,b,c){function d(a,b,c,d){if(0===k(b)||0===k(c))return!1;var e=j(b,m.translate,m.scale,m.skew,m.perspective,m.quaternion),f=j(c,n.translate,n.scale,n.skew,n.perspective,n.quaternion);return e&&f?(h(o.translate,m.translate,n.translate,d),h(o.skew,m.skew,n.skew,d),h(o.scale,m.scale,n.scale,d),h(o.perspective,m.perspective,n.perspective,d),l(o.quaternion,m.quaternion,n.quaternion,d),i(a,o.translate,o.scale,o.skew,o.perspective,o.quaternion),!0):!1}function e(){return{translate:f(),scale:f(1),skew:f(),perspective:g(),quaternion:g()}}function f(a){return[a||0,a||0,a||0]}function g(){return[0,0,0,1]}var h=a("gl-vec3/lerp"),i=a("mat4-recompose"),j=a("mat4-decompose"),k=a("gl-mat4/determinant"),l=a("quat-slerp"),m=e(),n=e(),o=e();b.exports=d},{"gl-mat4/determinant":90,"gl-vec3/lerp":25,"mat4-decompose":30,"mat4-recompose":32,"quat-slerp":33}],30:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a}function e(a,b){a[0][0]=b[0],a[0][1]=b[1],a[0][2]=b[2],a[1][0]=b[4],a[1][1]=b[5],a[1][2]=b[6],a[2][0]=b[8],a[2][1]=b[9],a[2][2]=b[10]}function f(a,b,c,d,e){a[0]=b[0]*d+c[0]*e,a[1]=b[1]*d+c[1]*e,a[2]=b[2]*d+c[2]*e}var g=a("./normalize"),h=a("gl-mat4/create"),i=a("gl-mat4/clone"),j=a("gl-mat4/determinant"),k=a("gl-mat4/invert"),l=a("gl-mat4/transpose"),m={length:a("gl-vec3/length"),normalize:a("gl-vec3/normalize"),dot:a("gl-vec3/dot"),cross:a("gl-vec3/cross")},n=h(),o=h(),p=[0,0,0,0],q=[[0,0,0],[0,0,0],[0,0,0]],r=[0,0,0];b.exports=function(a,b,c,h,s,t){if(b||(b=[0,0,0]),c||(c=[0,0,0]),h||(h=[0,0,0]),s||(s=[0,0,0,1]),t||(t=[0,0,0,1]),!g(n,a))return!1;if(i(o,n),o[3]=0,o[7]=0,o[11]=0,o[15]=1,Math.abs(j(o)<1e-8))return!1;var u=n[3],v=n[7],w=n[11],x=n[12],y=n[13],z=n[14],A=n[15];if(0!==u||0!==v||0!==w){p[0]=u,p[1]=v,p[2]=w,p[3]=A;var B=k(o,o);if(!B)return!1;l(o,o),d(s,p,o)}else s[0]=s[1]=s[2]=0,s[3]=1;if(b[0]=x,b[1]=y,b[2]=z,e(q,n),c[0]=m.length(q[0]),m.normalize(q[0],q[0]),h[0]=m.dot(q[0],q[1]),f(q[1],q[1],q[0],1,-h[0]),c[1]=m.length(q[1]),m.normalize(q[1],q[1]),h[0]/=c[1],h[1]=m.dot(q[0],q[2]),f(q[2],q[2],q[0],1,-h[1]),h[2]=m.dot(q[1],q[2]),f(q[2],q[2],q[1],1,-h[2]),c[2]=m.length(q[2]),m.normalize(q[2],q[2]),h[1]/=c[2],h[2]/=c[2],m.cross(r,q[1],q[2]),m.dot(q[0],r)<0)for(var C=0;3>C;C++)c[C]*=-1,q[C][0]*=-1,q[C][1]*=-1,q[C][2]*=-1;return t[0]=.5*Math.sqrt(Math.max(1+q[0][0]-q[1][1]-q[2][2],0)),t[1]=.5*Math.sqrt(Math.max(1-q[0][0]+q[1][1]-q[2][2],0)),t[2]=.5*Math.sqrt(Math.max(1-q[0][0]-q[1][1]+q[2][2],0)),t[3]=.5*Math.sqrt(Math.max(1+q[0][0]+q[1][1]+q[2][2],0)),q[2][1]>q[1][2]&&(t[0]=-t[0]),q[0][2]>q[2][0]&&(t[1]=-t[1]),q[1][0]>q[0][1]&&(t[2]=-t[2]),!0}},{"./normalize":31,"gl-mat4/clone":88,"gl-mat4/create":89,"gl-mat4/determinant":90,"gl-mat4/invert":94,"gl-mat4/transpose":104,"gl-vec3/cross":22,"gl-vec3/dot":23,"gl-vec3/length":24,"gl-vec3/normalize":26}],31:[function(a,b,c){b.exports=function(a,b){var c=b[15];if(0===c)return!1;for(var d=1/c,e=0;16>e;e++)a[e]=b[e]*d;return!0}},{}],32:[function(a,b,c){var d={identity:a("gl-mat4/identity"),translate:a("gl-mat4/translate"),multiply:a("gl-mat4/multiply"),create:a("gl-mat4/create"),scale:a("gl-mat4/scale"),fromRotationTranslation:a("gl-mat4/fromRotationTranslation")},e=(d.create(),d.create());b.exports=function(a,b,c,f,g,h){return d.identity(a),d.fromRotationTranslation(a,h,b),a[3]=g[0],a[7]=g[1],a[11]=g[2],a[15]=g[3],d.identity(e),0!==f[2]&&(e[9]=f[2],d.multiply(a,a,e)),0!==f[1]&&(e[9]=0,e[8]=f[1],d.multiply(a,a,e)),0!==f[0]&&(e[8]=0,e[4]=f[0],d.multiply(a,a,e)),d.scale(a,a,c),a}},{"gl-mat4/create":89,"gl-mat4/fromRotationTranslation":92,"gl-mat4/identity":93,"gl-mat4/multiply":96,"gl-mat4/scale":102,"gl-mat4/translate":103}],33:[function(a,b,c){b.exports=a("gl-quat/slerp")},{"gl-quat/slerp":34}],34:[function(a,b,c){function d(a,b,c,d){var e,f,g,h,i,j=b[0],k=b[1],l=b[2],m=b[3],n=c[0],o=c[1],p=c[2],q=c[3];return f=j*n+k*o+l*p+m*q,0>f&&(f=-f,n=-n,o=-o,p=-p,q=-q),1-f>1e-6?(e=Math.acos(f),g=Math.sin(e),h=Math.sin((1-d)*e)/g,i=Math.sin(d*e)/g):(h=1-d,i=d),a[0]=h*j+i*n,a[1]=h*k+i*o,a[2]=h*l+i*p,a[3]=h*m+i*q,a}b.exports=d},{}],35:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h,i,j){var k=b+f+j;if(l>0){var l=Math.sqrt(k+1);a[0]=.5*(g-i)/l,a[1]=.5*(h-d)/l,a[2]=.5*(c-f)/l,a[3]=.5*l}else{var m=Math.max(b,f,j),l=Math.sqrt(2*m-k+1);b>=m?(a[0]=.5*l,a[1]=.5*(e+c)/l,a[2]=.5*(h+d)/l,a[3]=.5*(g-i)/l):f>=m?(a[0]=.5*(c+e)/l,a[1]=.5*l,a[2]=.5*(i+g)/l,a[3]=.5*(h-d)/l):(a[0]=.5*(d+h)/l,a[1]=.5*(g+i)/l,a[2]=.5*l,a[3]=.5*(c-e)/l)}return a}b.exports=d},{}],36:[function(a,b,c){"use strict";function d(a,b,c){return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2))}function e(a,b,c,d){return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2)+Math.pow(d,2))}function f(a,b){var c=b[0],d=b[1],f=b[2],g=b[3],h=e(c,d,f,g);h>1e-6?(a[0]=c/h,a[1]=d/h,a[2]=f/h,a[3]=g/h):(a[0]=a[1]=a[2]=0,a[3]=1)}function g(a,b,c){this.radius=i([c]),this.center=i(b),this.rotation=i(a),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function h(a){a=a||{};var b=a.center||[0,0,0],c=a.rotation||[0,0,0,1],d=a.radius||1;b=[].slice.call(b,0,3),c=[].slice.call(c,0,4),f(c,c);var e=new g(c,b,Math.log(d));return e.setDistanceLimits(a.zoomMin,a.zoomMax),("eye"in a||"up"in a)&&e.lookAt(0,a.eye,a.center,a.up),e}b.exports=h;var i=a("filtered-vector"),j=a("gl-mat4/lookAt"),k=a("gl-mat4/fromQuat"),l=a("gl-mat4/invert"),m=a("./lib/quatFromFrame"),n=g.prototype;n.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},n.recalcMatrix=function(a){this.radius.curve(a),this.center.curve(a),this.rotation.curve(a);var b=this.computedRotation;f(b,b);var c=this.computedMatrix;k(c,b);var d=this.computedCenter,e=this.computedEye,g=this.computedUp,h=Math.exp(this.computedRadius[0]);e[0]=d[0]+h*c[2],e[1]=d[1]+h*c[6],e[2]=d[2]+h*c[10],g[0]=c[1],g[1]=c[5],g[2]=c[9];for(var i=0;3>i;++i){for(var j=0,l=0;3>l;++l)j+=c[i+4*l]*e[l];c[12+i]=-j}},n.getMatrix=function(a,b){this.recalcMatrix(a);var c=this.computedMatrix;if(b){for(var d=0;16>d;++d)b[d]=c[d];return b}return c},n.idle=function(a){this.center.idle(a),this.radius.idle(a),this.rotation.idle(a)},n.flush=function(a){this.center.flush(a),this.radius.flush(a),this.rotation.flush(a)},n.pan=function(a,b,c,e){b=b||0,c=c||0,e=e||0,this.recalcMatrix(a);var f=this.computedMatrix,g=f[1],h=f[5],i=f[9],j=d(g,h,i);g/=j,h/=j,i/=j;var k=f[0],l=f[4],m=f[8],n=k*g+l*h+m*i;k-=g*n,l-=h*n,m-=i*n;var o=d(k,l,m);k/=o,l/=o,m/=o;var p=f[2],q=f[6],r=f[10],s=p*g+q*h+r*i,t=p*k+q*l+r*m;p-=s*g+t*k,q-=s*h+t*l,r-=s*i+t*m;var u=d(p,q,r);p/=u,q/=u,r/=u;var v=k*b+g*c,w=l*b+h*c,x=m*b+i*c;this.center.move(a,v,w,x);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+e),this.radius.set(a,Math.log(y))},n.rotate=function(a,b,c,f){this.recalcMatrix(a),b=b||0,c=c||0;var g=this.computedMatrix,h=g[0],i=g[4],j=g[8],k=g[1],l=g[5],m=g[9],n=g[2],o=g[6],p=g[10],q=b*h+c*k,r=b*i+c*l,s=b*j+c*m,t=-(o*s-p*r),u=-(p*q-n*s),v=-(n*r-o*q),w=Math.sqrt(Math.max(0,1-Math.pow(t,2)-Math.pow(u,2)-Math.pow(v,2))),x=e(t,u,v,w);x>1e-6?(t/=x,u/=x,v/=x,w/=x):(t=u=v=0,w=1);var y=this.computedRotation,z=y[0],A=y[1],B=y[2],C=y[3],D=z*w+C*t+A*v-B*u,E=A*w+C*u+B*t-z*v,F=B*w+C*v+z*u-A*t,G=C*w-z*t-A*u-B*v;if(f){t=n,u=o,v=p;var H=Math.sin(f)/d(t,u,v);t*=H,u*=H,v*=H,w=Math.cos(b),D=D*w+G*t+E*v-F*u,E=E*w+G*u+F*t-D*v,F=F*w+G*v+D*u-E*t,G=G*w-D*t-E*u-F*v}var I=e(D,E,F,G);I>1e-6?(D/=I,E/=I,F/=I,G/=I):(D=E=F=0,G=1),this.rotation.set(a,D,E,F,G)},n.lookAt=function(a,b,c,d){this.recalcMatrix(a),c=c||this.computedCenter,b=b||this.computedEye,d=d||this.computedUp;var e=this.computedMatrix;j(e,b,c,d);var g=this.computedRotation;m(g,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),f(g,g),this.rotation.set(a,g[0],g[1],g[2],g[3]);for(var h=0,i=0;3>i;++i)h+=Math.pow(c[i]-b[i],2);this.radius.set(a,.5*Math.log(Math.max(h,1e-6))),this.center.set(a,c[0],c[1],c[2])},n.translate=function(a,b,c,d){this.center.move(a,b||0,c||0,d||0)},n.setMatrix=function(a,b){var c=this.computedRotation;m(c,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),f(c,c),this.rotation.set(a,c[0],c[1],c[2],c[3]);var d=this.computedMatrix;l(d,b);var e=d[15];if(Math.abs(e)>1e-6){var g=d[12]/e,h=d[13]/e,i=d[14]/e;this.recalcMatrix(a);var j=Math.exp(this.computedRadius[0]);this.center.set(a,g-d[2]*j,h-d[6]*j,i-d[10]*j),this.radius.idle(a)}else this.center.idle(a),this.radius.idle(a)},n.setDistance=function(a,b){b>0&&this.radius.set(a,Math.log(b))},n.setDistanceLimits=function(a,b){a=a>0?Math.log(a):-(1/0),b=b>0?Math.log(b):1/0,b=Math.max(b,a),this.radius.bounds[0][0]=a,this.radius.bounds[1][0]=b},n.getDistanceLimits=function(a){var b=this.radius.bounds;return a?(a[0]=Math.exp(b[0][0]),a[1]=Math.exp(b[1][0]),a):[Math.exp(b[0][0]),Math.exp(b[1][0])]},n.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},n.fromJSON=function(a){var b=this.lastT(),c=a.center;c&&this.center.set(b,c[0],c[1],c[2]);var d=a.rotation;d&&this.rotation.set(b,d[0],d[1],d[2],d[3]);var e=a.distance;e&&e>0&&this.radius.set(b,Math.log(e)),this.setDistanceLimits(a.zoomMin,a.zoomMax)}},{"./lib/quatFromFrame":35,"filtered-vector":19,"gl-mat4/fromQuat":91,"gl-mat4/invert":94,"gl-mat4/lookAt":95}],37:[function(a,b,c){"use strict";function d(a,b,c){return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2))}function e(a){return Math.min(1,Math.max(-1,a))}function f(a){var b=Math.abs(a[0]),c=Math.abs(a[1]),d=Math.abs(a[2]),e=[0,0,0];b>Math.max(c,d)?e[2]=1:c>Math.max(b,d)?e[0]=1:e[1]=1;for(var f=0,g=0,h=0;3>h;++h)f+=a[h]*a[h],g+=e[h]*a[h];for(var h=0;3>h;++h)e[h]-=g/f*a[h];return m(e,e),e}function g(a,b,c,d,e,f,g,h){this.center=i(c),this.up=i(d),this.right=i(e),this.radius=i([f]),this.angle=i([g,h]),this.angle.bounds=[[-(1/0),-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(a,b),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var j=0;16>j;++j)this.computedMatrix[j]=.5;this.recalcMatrix(0)}function h(a){a=a||{};var b=a.center||[0,0,0],c=a.up||[0,1,0],e=a.right||f(c),h=a.radius||1,i=a.theta||0,j=a.phi||0;if(b=[].slice.call(b,0,3),c=[].slice.call(c,0,3),m(c,c),e=[].slice.call(e,0,3),m(e,e),"eye"in a){var k=a.eye,o=[k[0]-b[0],k[1]-b[1],k[2]-b[2]];l(e,o,c),d(e[0],e[1],e[2])<1e-6?e=f(c):m(e,e),h=d(o[0],o[1],o[2]);var p=n(c,o)/h,q=n(e,o)/h;j=Math.acos(p),i=Math.acos(q)}return h=Math.log(h),new g(a.zoomMin,a.zoomMax,b,c,e,h,i,j)}b.exports=h;var i=a("filtered-vector"),j=a("gl-mat4/invert"),k=a("gl-mat4/rotate"),l=a("gl-vec3/cross"),m=a("gl-vec3/normalize"),n=a("gl-vec3/dot"),o=g.prototype;o.setDistanceLimits=function(a,b){a=a>0?Math.log(a):-(1/0),b=b>0?Math.log(b):1/0,b=Math.max(b,a),this.radius.bounds[0][0]=a,this.radius.bounds[1][0]=b},o.getDistanceLimits=function(a){var b=this.radius.bounds[0];return a?(a[0]=Math.exp(b[0][0]),a[1]=Math.exp(b[1][0]),a):[Math.exp(b[0][0]),Math.exp(b[1][0])]},o.recalcMatrix=function(a){this.center.curve(a),this.up.curve(a),this.right.curve(a),this.radius.curve(a),this.angle.curve(a);for(var b=this.computedUp,c=this.computedRight,e=0,f=0,g=0;3>g;++g)f+=b[g]*c[g],e+=b[g]*b[g];for(var h=Math.sqrt(e),i=0,g=0;3>g;++g)c[g]-=b[g]*f/e,i+=c[g]*c[g],b[g]/=h;for(var j=Math.sqrt(i),g=0;3>g;++g)c[g]/=j;var k=this.computedToward;l(k,b,c),m(k,k);for(var n=Math.exp(this.computedRadius[0]),o=this.computedAngle[0],p=this.computedAngle[1],q=Math.cos(o),r=Math.sin(o),s=Math.cos(p),t=Math.sin(p),u=this.computedCenter,v=q*s,w=r*s,x=t,y=-q*t,z=-r*t,A=s,B=this.computedEye,C=this.computedMatrix,g=0;3>g;++g){var D=v*c[g]+w*k[g]+x*b[g];C[4*g+1]=y*c[g]+z*k[g]+A*b[g],C[4*g+2]=D,C[4*g+3]=0}var E=C[1],F=C[5],G=C[9],H=C[2],I=C[6],J=C[10],K=F*J-G*I,L=G*H-E*J,M=E*I-F*H,N=d(K,L,M);K/=N,L/=N,M/=N,C[0]=K,C[4]=L,C[8]=M;for(var g=0;3>g;++g)B[g]=u[g]+C[2+4*g]*n;for(var g=0;3>g;++g){for(var i=0,O=0;3>O;++O)i+=C[g+4*O]*B[O];C[12+g]=-i}C[15]=1},o.getMatrix=function(a,b){this.recalcMatrix(a);var c=this.computedMatrix;if(b){for(var d=0;16>d;++d)b[d]=c[d];return b}return c};var p=[0,0,0];o.rotate=function(a,b,c,d){if(this.angle.move(a,b,c),d){this.recalcMatrix(a);var e=this.computedMatrix;p[0]=e[2],p[1]=e[6],p[2]=e[10];for(var f=this.computedUp,g=this.computedRight,h=this.computedToward,i=0;3>i;++i)e[4*i]=f[i],e[4*i+1]=g[i],e[4*i+2]=h[i];k(e,e,d,p);for(var i=0;3>i;++i)f[i]=e[4*i],g[i]=e[4*i+1];this.up.set(a,f[0],f[1],f[2]),this.right.set(a,g[0],g[1],g[2])}},o.pan=function(a,b,c,e){b=b||0,c=c||0,e=e||0,this.recalcMatrix(a);var f=this.computedMatrix,g=(Math.exp(this.computedRadius[0]),f[1]),h=f[5],i=f[9],j=d(g,h,i);g/=j,h/=j,i/=j;var k=f[0],l=f[4],m=f[8],n=k*g+l*h+m*i;k-=g*n,l-=h*n,m-=i*n;var o=d(k,l,m);k/=o,l/=o,m/=o;var p=k*b+g*c,q=l*b+h*c,r=m*b+i*c;this.center.move(a,p,q,r);var s=Math.exp(this.computedRadius[0]);s=Math.max(1e-4,s+e),this.radius.set(a,Math.log(s))},o.translate=function(a,b,c,d){this.center.move(a,b||0,c||0,d||0)},o.setMatrix=function(a,b,c,f){var g=1;"number"==typeof c&&(g=0|c),(0>g||g>3)&&(g=1);var h=(g+2)%3;b||(this.recalcMatrix(a),b=this.computedMatrix);var i=b[g],k=b[g+4],l=b[g+8];if(f){var m=Math.abs(i),n=Math.abs(k),o=Math.abs(l),p=Math.max(m,n,o);m===p?(i=0>i?-1:1,k=l=0):o===p?(l=0>l?-1:1,i=k=0):(k=0>k?-1:1,i=l=0)}else{var q=d(i,k,l);i/=q,k/=q,l/=q}var r=b[h],s=b[h+4],t=b[h+8],u=r*i+s*k+t*l;r-=i*u,s-=k*u,t-=l*u;var v=d(r,s,t);r/=v,s/=v,t/=v;var w=k*t-l*s,x=l*r-i*t,y=i*s-k*r,z=d(w,x,y);w/=z,x/=z,y/=z,this.center.jump(a,S,T,U),this.radius.idle(a),this.up.jump(a,i,k,l),this.right.jump(a,r,s,t);var A,B;if(2===g){var C=b[1],D=b[5],E=b[9],F=C*r+D*s+E*t,G=C*w+D*x+E*y;A=0>K?-Math.PI/2:Math.PI/2,B=Math.atan2(G,F)}else{var H=b[2],I=b[6],J=b[10],K=H*i+I*k+J*l,L=H*r+I*s+J*t,M=H*w+I*x+J*y;A=Math.asin(e(K)),B=Math.atan2(M,L)}this.angle.jump(a,B,A),this.recalcMatrix(a);var N=b[2],O=b[6],P=b[10],Q=this.computedMatrix;j(Q,b);var R=Q[15],S=Q[12]/R,T=Q[13]/R,U=Q[14]/R,V=Math.exp(this.computedRadius[0]);this.center.jump(a,S-N*V,T-O*V,U-P*V)},o.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},o.idle=function(a){this.center.idle(a),this.up.idle(a),this.right.idle(a),this.radius.idle(a),this.angle.idle(a)},o.flush=function(a){this.center.flush(a),this.up.flush(a),this.right.flush(a),this.radius.flush(a),this.angle.flush(a)},o.setDistance=function(a,b){b>0&&this.radius.set(a,Math.log(b))},o.lookAt=function(a,b,c,f){this.recalcMatrix(a),b=b||this.computedEye,c=c||this.computedCenter,f=f||this.computedUp;var g=f[0],h=f[1],i=f[2],j=d(g,h,i);if(!(1e-6>j)){g/=j,h/=j,i/=j;var k=b[0]-c[0],l=b[1]-c[1],m=b[2]-c[2],n=d(k,l,m);if(!(1e-6>n)){k/=n,l/=n,m/=n;var o=this.computedRight,p=o[0],q=o[1],r=o[2],s=g*p+h*q+i*r;p-=s*g,q-=s*h,r-=s*i;var t=d(p,q,r);if(!(.01>t&&(p=h*m-i*l,q=i*k-g*m,r=g*l-h*k,t=d(p,q,r),1e-6>t))){p/=t,q/=t,r/=t,this.up.set(a,g,h,i),this.right.set(a,p,q,r),this.center.set(a,c[0],c[1],c[2]),this.radius.set(a,Math.log(n));var u=h*r-i*q,v=i*p-g*r,w=g*q-h*p,x=d(u,v,w);u/=x,v/=x,w/=x;var y=g*k+h*l+i*m,z=p*k+q*l+r*m,A=u*k+v*l+w*m,B=Math.asin(e(y)),C=Math.atan2(A,z),D=this.angle._state,E=D[D.length-1],F=D[D.length-2];E%=2*Math.PI;var G=Math.abs(E+2*Math.PI-C),H=Math.abs(E-C),I=Math.abs(E-2*Math.PI-C);H>G&&(E+=2*Math.PI),H>I&&(E-=2*Math.PI),this.angle.jump(this.angle.lastT(),E,F),this.angle.set(a,C,B)}}}}},{"filtered-vector":19,"gl-mat4/invert":94,"gl-mat4/rotate":98,"gl-vec3/cross":22,"gl-vec3/dot":23,"gl-vec3/normalize":26}],38:[function(a,b,c){"use strict";function d(a,b){this._controllerNames=Object.keys(a),this._controllerList=this._controllerNames.map(function(b){return a[b]}),this._mode=b,this._active=a[b],this._active||(this._mode="turntable",this._active=a.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function e(a){a=a||{};var b=a.eye||[0,0,1],c=a.center||[0,0,0],e=a.up||[0,1,0],i=a.distanceLimits||[0,1/0],j=a.mode||"turntable",k=f(),l=g(),m=h();return k.setDistanceLimits(i[0],i[1]),k.lookAt(0,b,c,e),l.setDistanceLimits(i[0],i[1]),l.lookAt(0,b,c,e),m.setDistanceLimits(i[0],i[1]),m.lookAt(0,b,c,e),new d({turntable:k,orbit:l,matrix:m},j)}b.exports=e;var f=a("turntable-camera-controller"),g=a("orbit-camera-controller"),h=a("matrix-camera-controller"),i=d.prototype,j=[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]];j.forEach(function(a){for(var b=a[0],c=[],d=0;d<a[1];++d)c.push("a"+d);var e="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+a[0]+"("+c.join()+")}";i[b]=Function.apply(null,c.concat(e))}),i.recalcMatrix=function(a){this._active.recalcMatrix(a)},i.getDistance=function(a){return this._active.getDistance(a)},i.getDistanceLimits=function(a){return this._active.getDistanceLimits(a)},i.lastT=function(){return this._active.lastT()},i.setMode=function(a){if(a!==this._mode){var b=this._controllerNames.indexOf(a);if(!(0>b)){var c=this._active,d=this._controllerList[b],e=Math.max(c.lastT(),d.lastT());c.recalcMatrix(e),d.setMatrix(e,c.computedMatrix),this._active=d,this._mode=a,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},i.getMode=function(){return this._mode}},{"matrix-camera-controller":27,"orbit-camera-controller":36,"turntable-camera-controller":37}],39:[function(a,b,c){function d(a,b){return f(e(a,b))}b.exports=d;var e=a("alpha-complex"),f=a("simplicial-complex-boundary")},{"alpha-complex":40,"simplicial-complex-boundary":43}],40:[function(a,b,c){"use strict";function d(a,b){return e(b).filter(function(c){for(var d=new Array(c.length),e=0;e<c.length;++e)d[e]=b[c[e]];return f(d)*a<1})}b.exports=d;var e=a("delaunay-triangulate"),f=a("circumradius")},{circumradius:41,"delaunay-triangulate":71}],41:[function(a,b,c){function d(a){for(var b=e(a),c=0,d=0;d<a.length;++d)for(var f=a[d],g=0;g<b.length;++g)c+=Math.pow(f[g]-b[g],2);return Math.sqrt(c/a.length)}b.exports=d;var e=a("circumcenter")},{circumcenter:42}],42:[function(a,b,c){"use strict";function d(a,b){for(var c=0,d=a.length,e=0;d>e;++e)c+=a[e]*b[e];return c}function e(a){var b=a.length;if(0===b)return[];var c=(a[0].length,g([a.length+1,a.length+1],1)),e=g([a.length+1],1);c[b][b]=0;for(var f=0;b>f;++f){for(var i=0;f>=i;++i)c[i][f]=c[f][i]=2*d(a[f],a[i]);e[f]=d(a[f],a[f])}for(var j=h(c,e),k=0,l=j[b+1],f=0;f<l.length;++f)k+=l[f];for(var m=new Array(b),f=0;b>f;++f){for(var l=j[f],n=0,i=0;i<l.length;++i)n+=l[i];m[f]=n/k}return m}function f(a){if(0===a.length)return[];for(var b=a[0].length,c=g([b]),d=e(a),f=0;f<a.length;++f)for(var h=0;b>h;++h)c[h]+=a[f][h]*d[f];return c}var g=a("dup"),h=a("robust-linear-solve");f.barycenetric=e,b.exports=f},{dup:72,"robust-linear-solve":211}],43:[function(a,b,c){"use strict";function d(a){return f(e(a))}b.exports=d;var e=a("boundary-cells"),f=a("reduce-simplicial-complex")},{"boundary-cells":44,"reduce-simplicial-complex":47}],44:[function(a,b,c){"use strict";function d(a){for(var b=a.length,c=0,d=0;b>d;++d)c+=a[d].length;for(var e=new Array(c),f=0,d=0;b>d;++d)for(var g=a[d],h=g.length,i=0;h>i;++i)for(var j=e[f++]=new Array(h-1),k=1;h>k;++k)j[k-1]=g[(i+k)%h];return e}b.exports=d},{}],45:[function(a,b,c){"use strict";function d(a){for(var b=1,c=1;c<a.length;++c)for(var d=0;c>d;++d)if(a[c]<a[d])b=-b;else if(a[d]===a[c])return 0;return b}b.exports=d},{}],46:[function(a,b,c){"use strict";function d(a,b){return e(a,b)||f(a)-f(b)}var e=a("compare-cell"),f=a("cell-orientation");b.exports=d},{"cell-orientation":45,"compare-cell":59}],47:[function(a,b,c){"use strict";function d(a){a.sort(f);for(var b=a.length,c=0,d=0;b>d;++d){var h=a[d],i=g(h);if(0!==i){if(c>0){var j=a[c-1];if(0===e(h,j)&&g(j)!==i){c-=1;continue}}a[c++]=h}}return a.length=c,a}var e=a("compare-cell"),f=a("compare-oriented-cell"),g=a("cell-orientation");b.exports=d},{"cell-orientation":45,"compare-cell":59,"compare-oriented-cell":46}],48:[function(a,b,c){"use strict";var d=function(){function a(a){return!Array.isArray(a)&&null!==a&&"object"==typeof a}function b(a,b,c){for(var d=(b-a)/Math.max(c-1,1),e=[],f=0;c>f;f++)e.push(a+f*d);return e}function c(){for(var a=[].slice.call(arguments),b=a.map(function(a){return a.length}),c=Math.min.apply(null,b),d=[],e=0;c>e;e++){d[e]=[];for(var f=0;f<a.length;++f)d[e][f]=a[f][e]}return d}function d(a,b,c){for(var d=Math.min.apply(null,[a.length,b.length,c.length]),e=[],f=0;d>f;f++)e.push([a[f],b[f],c[f]]);return e}function e(a){function b(a){for(var d=0;d<a.length;d++)Array.isArray(a[d])?b(a[d],c):c+=a[d]}var c=0;return b(a,c),c}function f(a){for(var b=[],c=0;c<a.length;++c){b[c]=[];for(var d=0;d<a[c].length;++d)b[c][d]=a[c][d]}return b}function g(a){for(var b=[],c=0;c<a.length;++c)b[c]=a[c];return b}function h(a,b){if(a.length!==b.length)return!1;for(var c=a.length;c--;)if(a[c]!==b[c])return!1;return!0}function i(a,b){var c,d;if("string"!=typeof a)return a;if(c=[],"#"===a[0]?(a=a.substr(1),3===a.length&&(a+=a),d=parseInt(a,16),c[0]=d>>16&255,c[1]=d>>8&255,c[2]=255&d):l.test(a)&&(d=a.match(m),c[0]=parseInt(d[1]),c[1]=parseInt(d[2]),c[2]=parseInt(d[3])),!b)for(var e=0;3>e;++e)c[e]=c[e]/255;return c}function j(a,b){var c,d;if("string"!=typeof a)return a;if(c=[],"#"===a[0]?(a=a.substr(1),3===a.length&&(a+=a),d=parseInt(a,16),c[0]=d>>16&255,c[1]=d>>8&255,c[2]=255&d):l.test(a)&&(d=a.match(m),c[0]=parseInt(d[1]),c[1]=parseInt(d[2]),c[2]=parseInt(d[3]),d[4]?c[3]=parseFloat(d[4]):c[3]=1),!b)for(var e=0;3>e;++e)c[e]=c[e]/255;return c}var k={},l=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,m=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return k.isPlainObject=a,k.linspace=b,k.zip3=d,k.sum=e,k.zip=c,k.isEqual=h,k.copy2D=f,k.copy1D=g,k.str2RgbArray=i,k.str2RgbaArray=j,k};b.exports=d()},{}],49:[function(a,b,c){"use strict";"use restrict";function d(a){var b=32;return a&=-a,a&&b--,65535&a&&(b-=16),16711935&a&&(b-=8),252645135&a&&(b-=4),858993459&a&&(b-=2),1431655765&a&&(b-=1),b}var e=32;c.INT_BITS=e,c.INT_MAX=2147483647,c.INT_MIN=-1<<e-1,c.sign=function(a){return(a>0)-(0>a)},c.abs=function(a){var b=a>>e-1;return(a^b)-b},c.min=function(a,b){return b^(a^b)&-(b>a)},c.max=function(a,b){return a^(a^b)&-(b>a)},c.isPow2=function(a){return!(a&a-1||!a)},c.log2=function(a){var b,c;return b=(a>65535)<<4,a>>>=b,c=(a>255)<<3,a>>>=c,b|=c,c=(a>15)<<2,a>>>=c,b|=c,c=(a>3)<<1,a>>>=c,b|=c,b|a>>1},c.log10=function(a){return a>=1e9?9:a>=1e8?8:a>=1e7?7:a>=1e6?6:a>=1e5?5:a>=1e4?4:a>=1e3?3:a>=100?2:a>=10?1:0},c.popCount=function(a){return a-=a>>>1&1431655765,a=(858993459&a)+(a>>>2&858993459),16843009*(a+(a>>>4)&252645135)>>>24},c.countTrailingZeros=d,c.nextPow2=function(a){return a+=0===a,--a,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a+1},c.prevPow2=function(a){return a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a-(a>>>1)},c.parity=function(a){return a^=a>>>16,a^=a>>>8,a^=a>>>4,a&=15,27030>>>a&1};var f=new Array(256);!function(a){for(var b=0;256>b;++b){var c=b,d=b,e=7;for(c>>>=1;c;c>>>=1)d<<=1,d|=1&c,--e;a[b]=d<<e&255}}(f),c.reverse=function(a){return f[255&a]<<24|f[a>>>8&255]<<16|f[a>>>16&255]<<8|f[a>>>24&255]},c.interleave2=function(a,b){return a&=65535,a=16711935&(a|a<<8),a=252645135&(a|a<<4),a=858993459&(a|a<<2),a=1431655765&(a|a<<1),b&=65535,b=16711935&(b|b<<8),b=252645135&(b|b<<4),b=858993459&(b|b<<2),b=1431655765&(b|b<<1),a|b<<1},c.deinterleave2=function(a,b){return a=a>>>b&1431655765,a=858993459&(a|a>>>1),a=252645135&(a|a>>>2),a=16711935&(a|a>>>4),a=65535&(a|a>>>16),a<<16>>16},c.interleave3=function(a,b,c){return a&=1023,a=4278190335&(a|a<<16),a=251719695&(a|a<<8),a=3272356035&(a|a<<4),a=1227133513&(a|a<<2),b&=1023,b=4278190335&(b|b<<16),b=251719695&(b|b<<8),b=3272356035&(b|b<<4),b=1227133513&(b|b<<2),a|=b<<1,c&=1023,c=4278190335&(c|c<<16),c=251719695&(c|c<<8),c=3272356035&(c|c<<4),c=1227133513&(c|c<<2),a|c<<2},c.deinterleave3=function(a,b){return a=a>>>b&1227133513,a=3272356035&(a|a>>>2),a=251719695&(a|a>>>4),a=4278190335&(a|a>>>8),a=1023&(a|a>>>16),a<<22>>22},c.nextCombination=function(a){var b=a|a-1;return b+1|(~b&-~b)-1>>>d(a)+1}},{}],50:[function(a,b,c){(function(b){"use strict";function d(){try{var a=new Uint8Array(1);return a.foo=function(){return 42},42===a.foo()&&"function"==typeof a.subarray&&0===a.subarray(1,1).byteLength}catch(b){return!1}}function e(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(a){return this instanceof f?(f.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof a?g(this,a):"string"==typeof a?h(this,a,arguments.length>1?arguments[1]:"utf8"):i(this,a)):arguments.length>1?new f(a,arguments[1]):new f(a)}function g(a,b){if(a=p(a,0>b?0:0|q(b)),!f.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function h(a,b,c){"string"==typeof c&&""!==c||(c="utf8");var d=0|s(b,c);return a=p(a,d),a.write(b,c),a}function i(a,b){if(f.isBuffer(b))return j(a,b);if(Y(b))return k(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(b.buffer instanceof ArrayBuffer)return l(a,b);if(b instanceof ArrayBuffer)return m(a,b)}return b.length?n(a,b):o(a,b)}function j(a,b){var c=0|q(b.length);return a=p(a,c),b.copy(a,0,0,c),a}function k(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function m(a,b){return b.byteLength,f.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=f.prototype):a=l(a,new Uint8Array(b)),a}function n(a,b){var c=0|q(b.length);a=p(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function o(a,b){var c,d=0;"Buffer"===b.type&&Y(b.data)&&(c=b.data,d=0|q(c.length)),a=p(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function p(a,b){f.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=f.prototype):a.length=b;var c=0!==b&&b<=f.poolSize>>>1;return c&&(a.parent=Z),a}function q(a){if(a>=e())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e().toString(16)+" bytes");return 0|a}function r(a,b){if(!(this instanceof r))return new r(a,b);var c=new f(a,b);return delete c.parent,c}function s(a,b){"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":return R(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return U(a).length;default:if(d)return R(a).length;b=(""+b).toLowerCase(),d=!0}}function t(a,b,c){var d=!1;if(b=0|b,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),0>b&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function u(a,b,c,d){ 25 c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function v(a,b,c,d){return V(R(b,a.length-c),a,c,d)}function w(a,b,c,d){return V(S(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return V(U(b),a,c,d)}function z(a,b,c,d){return V(T(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;c>e;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(c>=e+h){var i,j,k,l;switch(h){case 1:128>f&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(55296>l||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&1114112>l&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if($>=b)return String.fromCharCode.apply(String,a);for(var c="",d=0;b>d;)c+=String.fromCharCode.apply(String,a.slice(d,d+=$));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=Q(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!==0||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,g){if(!f.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>e||g>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range")}function J(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);f>e;e++)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function K(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);f>e;e++)a[c+e]=b>>>8*(d?e:3-e)&255}function L(a,b,c,d,e,f){if(b>e||f>b)throw new RangeError("value is out of bounds");if(c+d>a.length)throw new RangeError("index out of range");if(0>c)throw new RangeError("index out of range")}function M(a,b,c,d,e){return e||L(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function N(a,b,c,d,e){return e||L(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function O(a){if(a=P(a).replace(_,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function P(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Q(a){return 16>a?"0"+a.toString(16):a.toString(16)}function R(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;d>g;g++){if(c=a.charCodeAt(g),c>55295&&57344>c){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(56320>c){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,128>c){if((b-=1)<0)break;f.push(c)}else if(2048>c){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(65536>c){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(1114112>c))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function S(a){for(var b=[],c=0;c<a.length;c++)b.push(255&a.charCodeAt(c));return b}function T(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);g++)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function U(a){return W.toByteArray(O(a))}function V(a,b,c,d){for(var e=0;d>e&&!(e+c>=b.length||e>=a.length);e++)b[e+c]=a[e];return e}var W=a("base64-js"),X=a("ieee754"),Y=a("isarray");c.Buffer=f,c.SlowBuffer=r,c.INSPECT_MAX_BYTES=50,f.poolSize=8192;var Z={};f.TYPED_ARRAY_SUPPORT=void 0!==b.TYPED_ARRAY_SUPPORT?b.TYPED_ARRAY_SUPPORT:d(),f.TYPED_ARRAY_SUPPORT?(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array):(f.prototype.length=void 0,f.prototype.parent=void 0),f.isBuffer=function(a){return!(null==a||!a._isBuffer)},f.compare=function(a,b){if(!f.isBuffer(a)||!f.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,g=Math.min(c,d);g>e&&a[e]===b[e];)++e;return e!==g&&(c=a[e],d=b[e]),d>c?-1:c>d?1:0},f.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(a,b){if(!Y(a))throw new TypeError("list argument must be an Array of Buffers.");if(0===a.length)return new f(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;c++)b+=a[c].length;var d=new f(b),e=0;for(c=0;c<a.length;c++){var g=a[c];g.copy(d,e),e+=g.length}return d},f.byteLength=s,f.prototype._isBuffer=!0,f.prototype.toString=function(){var a=0|this.length;return 0===a?"":0===arguments.length?B(this,0,a):t.apply(this,arguments)},f.prototype.equals=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===f.compare(this,a)},f.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},f.prototype.compare=function(a){if(!f.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?0:f.compare(this,a)},f.prototype.indexOf=function(a,b){function c(a,b,c){for(var d=-1,e=0;c+e<a.length;e++)if(a[c+e]===b[-1===d?0:e-d]){if(-1===d&&(d=e),e-d+1===b.length)return c+d}else d=-1;return-1}if(b>2147483647?b=2147483647:-2147483648>b&&(b=-2147483648),b>>=0,0===this.length)return-1;if(b>=this.length)return-1;if(0>b&&(b=Math.max(this.length+b,0)),"string"==typeof a)return 0===a.length?-1:String.prototype.indexOf.call(this,a,b);if(f.isBuffer(a))return c(this,a,b);if("number"==typeof a)return f.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,a,b):c(this,[a],b);throw new TypeError("val must be string, number or Buffer")},f.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b=0|b,isFinite(c)?(c=0|c,void 0===d&&(d="utf8")):(d=c,c=void 0);else{var e=d;d=b,b=0|c,c=e}var f=this.length-b;if((void 0===c||c>f)&&(c=f),a.length>0&&(0>c||0>b)||b>this.length)throw new RangeError("attempt to write outside buffer bounds");d||(d="utf8");for(var g=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(g)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),g=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;f.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c),0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c),a>b&&(b=a);var d;if(f.TYPED_ARRAY_SUPPORT)d=this.subarray(a,b),d.__proto__=f.prototype;else{var e=b-a;d=new f(e,void 0);for(var g=0;e>g;g++)d[g]=this[g+a]}return d.length&&(d.parent=this.parent||this),d},f.prototype.readUIntLE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},f.prototype.readUIntBE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},f.prototype.readUInt8=function(a,b){return b||H(a,1,this.length),this[a]},f.prototype.readUInt16LE=function(a,b){return b||H(a,2,this.length),this[a]|this[a+1]<<8},f.prototype.readUInt16BE=function(a,b){return b||H(a,2,this.length),this[a]<<8|this[a+1]},f.prototype.readUInt32LE=function(a,b){return b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},f.prototype.readUInt32BE=function(a,b){return b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},f.prototype.readIntLE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},f.prototype.readIntBE=function(a,b,c){a=0|a,b=0|b,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},f.prototype.readInt8=function(a,b){return b||H(a,1,this.length),128&this[a]?-1*(255-this[a]+1):this[a]},f.prototype.readInt16LE=function(a,b){b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt16BE=function(a,b){b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},f.prototype.readInt32LE=function(a,b){return b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},f.prototype.readInt32BE=function(a,b){return b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},f.prototype.readFloatLE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!0,23,4)},f.prototype.readFloatBE=function(a,b){return b||H(a,4,this.length),X.read(this,a,!1,23,4)},f.prototype.readDoubleLE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!0,52,8)},f.prototype.readDoubleBE=function(a,b){return b||H(a,8,this.length),X.read(this,a,!1,52,8)},f.prototype.writeUIntLE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=1,f=0;for(this[b]=255&a;++f<c&&(e*=256);)this[b+f]=a/e&255;return b+c},f.prototype.writeUIntBE=function(a,b,c,d){a=+a,b=0|b,c=0|c,d||I(this,a,b,c,Math.pow(2,8*c),0);var e=c-1,f=1;for(this[b+e]=255&a;--e>=0&&(f*=256);)this[b+e]=a/f&255;return b+c},f.prototype.writeUInt8=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,1,255,0),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),this[b]=255&a,b+1},f.prototype.writeUInt16LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeUInt16BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeUInt32LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a):K(this,a,b,!0),b+4},f.prototype.writeUInt32BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0>a?1:0;for(this[b]=255&a;++f<c&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b=0|b,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0>a?1:0;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=(a/g>>0)-h&255;return b+c},f.prototype.writeInt8=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,1,127,-128),f.TYPED_ARRAY_SUPPORT||(a=Math.floor(a)),0>a&&(a=255+a+1),this[b]=255&a,b+1},f.prototype.writeInt16LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8):J(this,a,b,!0),b+2},f.prototype.writeInt16BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=255&a):J(this,a,b,!1),b+2},f.prototype.writeInt32LE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):K(this,a,b,!0),b+4},f.prototype.writeInt32BE=function(a,b,c){return a=+a,b=0|b,c||I(this,a,b,4,2147483647,-2147483648),0>a&&(a=4294967295+a+1),f.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a):K(this,a,b,!1),b+4},f.prototype.writeFloatLE=function(a,b,c){return M(this,a,b,!0,c)},f.prototype.writeFloatBE=function(a,b,c){return M(this,a,b,!1,c)},f.prototype.writeDoubleLE=function(a,b,c){return N(this,a,b,!0,c)},f.prototype.writeDoubleBE=function(a,b,c){return N(this,a,b,!1,c)},f.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&c>d&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,g=d-c;if(this===a&&b>c&&d>b)for(e=g-1;e>=0;e--)a[e+b]=this[e+c];else if(1e3>g||!f.TYPED_ARRAY_SUPPORT)for(e=0;g>e;e++)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+g),b);return g},f.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),b>c)throw new RangeError("end < start");if(c!==b&&0!==this.length){if(0>b||b>=this.length)throw new RangeError("start out of bounds");if(0>c||c>this.length)throw new RangeError("end out of bounds");var d;if("number"==typeof a)for(d=b;c>d;d++)this[d]=a;else{var e=R(a.toString()),f=e.length;for(d=b;c>d;d++)this[d]=e[d%f]}return this}};var _=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":51,ieee754:52,isarray:53}],51:[function(a,b,c){!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===g||b===l?62:b===h||b===m?63:i>b?-1:i+10>b?b-i+26+26:k+26>b?b-k:j+26>b?b-j+26:void 0}function c(a){function c(a){j[l++]=a}var d,e,g,h,i,j;if(a.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=a.length;i="="===a.charAt(k-2)?2:"="===a.charAt(k-1)?1:0,j=new f(3*a.length/4-i),g=i>0?a.length-4:a.length;var l=0;for(d=0,e=0;g>d;d+=4,e+=3)h=b(a.charAt(d))<<18|b(a.charAt(d+1))<<12|b(a.charAt(d+2))<<6|b(a.charAt(d+3)),c((16711680&h)>>16),c((65280&h)>>8),c(255&h);return 2===i?(h=b(a.charAt(d))<<2|b(a.charAt(d+1))>>4,c(255&h)):1===i&&(h=b(a.charAt(d))<<10|b(a.charAt(d+1))<<4|b(a.charAt(d+2))>>2,c(h>>8&255),c(255&h)),j}function d(a){function b(a){return e.charAt(a)}function c(a){return b(a>>18&63)+b(a>>12&63)+b(a>>6&63)+b(63&a)}var d,f,g,h=a.length%3,i="";for(d=0,g=a.length-h;g>d;d+=3)f=(a[d]<<16)+(a[d+1]<<8)+a[d+2],i+=c(f);switch(h){case 1:f=a[a.length-1],i+=b(f>>2),i+=b(f<<4&63),i+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],i+=b(f>>10),i+=b(f>>4&63),i+=b(f<<2&63),i+="="}return i}var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="+".charCodeAt(0),h="/".charCodeAt(0),i="0".charCodeAt(0),j="a".charCodeAt(0),k="A".charCodeAt(0),l="-".charCodeAt(0),m="_".charCodeAt(0);a.toByteArray=c,a.fromByteArray=d}("undefined"==typeof c?this.base64js={}:c)},{}],52:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<<h)-1,j=i>>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<<j)-1,l=k>>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<<e|h,j+=e;j>0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],53:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],54:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||0>a||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:f=Array.prototype.slice.call(arguments,1),c.apply(this,f)}else if(g(c))for(f=Array.prototype.slice.call(arguments,1),j=c.slice(),d=j.length,i=0;d>i;i++)j[i].apply(this,f);return!0},d.prototype.addListener=function(a,b){var c;if(!e(b))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,e(b.listener)?b.listener:b),this._events[a]?g(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,g(this._events[a])&&!this._events[a].warned&&(c=h(this._maxListeners)?d.defaultMaxListeners:this._maxListeners,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())),this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(0>d)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.prototype.listenerCount=function(a){if(this._events){var b=this._events[a];if(e(b))return 1;if(b)return b.length}return 0},d.listenerCount=function(a,b){return a.listenerCount(b)}},{}],55:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h&&h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],56:[function(a,b,c){b.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}]}},{}],57:[function(a,b,c){"use strict";function d(a){for(var b,c="#",d=0;3>d;++d)b=a[d],b=b.toString(16),c+=("00"+b).substr(b.length);return c}function e(a){return"rgba("+a.join(",")+")"}var f=a("arraytools"),g=a("clone"),h=a("./colorScales");b.exports=function(a){var b,c,i,j,k,l,m,n,o,p,q,r,s,t=[],u=[],v=[],w=[];if(f.isPlainObject(a)||(a={}),o=a.nshades||72,n=a.format||"hex",m=a.colormap,m||(m="jet"),"string"==typeof m){if(m=m.toLowerCase(),!h[m])throw Error(m+" not a supported colorscale");l=g(h[m])}else{if(!Array.isArray(m))throw Error("unsupported colormap option",m);l=g(m)}if(l.length>o)throw new Error(m+" map requires nshades to be at least size "+l.length);for(q=Array.isArray(a.alpha)?2!==a.alpha.length?[1,1]:g(a.alpha):"number"==typeof a.alpha?[a.alpha,a.alpha]:[1,1],b=l.map(function(a){return Math.round(a.index*o)}),q[0]<0&&(q[0]=0),q[1]<0&&(q[0]=0),q[0]>1&&(q[0]=1),q[1]>1&&(q[0]=1),s=0;s<b.length;++s)r=l[s].index,c=l[s].rgb,4===c.length&&c[3]>=0&&c[3]<=1||(c[3]=q[0]+(q[1]-q[0])*r);for(s=0;s<b.length-1;++s)k=b[s+1]-b[s],i=l[s].rgb,j=l[s+1].rgb,t=t.concat(f.linspace(i[0],j[0],k)),u=u.concat(f.linspace(i[1],j[1],k)),v=v.concat(f.linspace(i[2],j[2],k)),w=w.concat(f.linspace(i[3],j[3],k));return t=t.map(Math.round),u=u.map(Math.round),v=v.map(Math.round),p=f.zip(t,u,v,w),"hex"===n&&(p=p.map(d)),"rgbaString"===n&&(p=p.map(e)),p}},{"./colorScales":56,arraytools:48,clone:58}],58:[function(a,b,c){(function(a){var c=function(){"use strict";function b(c,d,e,f){function h(c,e){if(null===c)return null;if(0==e)return c;var i,m;if("object"!=typeof c)return c;if(b.__isArray(c))i=[];else if(b.__isRegExp(c))i=new RegExp(c.source,g(c)),c.lastIndex&&(i.lastIndex=c.lastIndex);else if(b.__isDate(c))i=new Date(c.getTime());else{if(l&&a.isBuffer(c))return i=new a(c.length),c.copy(i),i;"undefined"==typeof f?(m=Object.getPrototypeOf(c),i=Object.create(m)):(i=Object.create(f),m=f)}if(d){var n=j.indexOf(c);if(-1!=n)return k[n];j.push(c),k.push(i)}for(var o in c){var p;m&&(p=Object.getOwnPropertyDescriptor(m,o)),p&&null==p.set||(i[o]=h(c[o],e-1))}return i}var i;"object"==typeof d&&(e=d.depth,f=d.prototype,i=d.filter,d=d.circular);var j=[],k=[],l="undefined"!=typeof a;return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=1/0),h(c,e)}function c(a){return Object.prototype.toString.call(a)}function d(a){return"object"==typeof a&&"[object Date]"===c(a)}function e(a){return"object"==typeof a&&"[object Array]"===c(a)}function f(a){return"object"==typeof a&&"[object RegExp]"===c(a)}function g(a){var b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),b}return b.clonePrototype=function(a){if(null===a)return null;var b=function(){};return b.prototype=a,new b},b.__objToStr=c,b.__isDate=d,b.__isArray=e,b.__isRegExp=f,b.__getRegExpFlags=g,b}();"object"==typeof b&&b.exports&&(b.exports=c)}).call(this,a("buffer").Buffer)},{buffer:50}],59:[function(a,b,c){function d(a,b){return a-b}function e(a,b){var c=a.length,e=a.length-b.length;if(e)return e;switch(c){case 0:return 0;case 1:return a[0]-b[0];case 2:return a[0]+a[1]-b[0]-b[1]||f(a[0],a[1])-f(b[0],b[1]);case 3:var g=a[0]+a[1],h=b[0]+b[1];if(e=g+a[2]-(h+b[2]))return e;var i=f(a[0],a[1]),j=f(b[0],b[1]);return f(i,a[2])-f(j,b[2])||f(i+a[2],g)-f(j+b[2],h);case 4:var k=a[0],l=a[1],m=a[2],n=a[3],o=b[0],p=b[1],q=b[2],r=b[3];return k+l+m+n-(o+p+q+r)||f(k,l,m,n)-f(o,p,q,r,o)||f(k+l,k+m,k+n,l+m,l+n,m+n)-f(o+p,o+q,o+r,p+q,p+r,q+r)||f(k+l+m,k+l+n,k+m+n,l+m+n)-f(o+p+q,o+p+r,o+q+r,p+q+r);default:for(var s=a.slice().sort(d),t=b.slice().sort(d),u=0;c>u;++u)if(e=s[u]-t[u])return e;return 0}}b.exports=e;var f=Math.min},{}],60:[function(a,b,c){"use strict";function d(a){var b=a.length;if(0===b)return[];if(1===b)return[[0]];var c=a[0].length;return 0===c?[]:1===c?e(a):2===c?f(a):g(a,c)}var e=a("./lib/ch1d"),f=a("./lib/ch2d"),g=a("./lib/chnd");b.exports=d},{"./lib/ch1d":61,"./lib/ch2d":62,"./lib/chnd":63}],61:[function(a,b,c){"use strict";function d(a){for(var b=0,c=0,d=1;d<a.length;++d)a[d][0]<a[b][0]&&(b=d),a[d][0]>a[c][0]&&(c=d);return c>b?[[b],[c]]:b>c?[[c],[b]]:[[b]]}b.exports=d},{}],62:[function(a,b,c){"use strict";function d(a){var b=e(a),c=b.length;if(2>=c)return[];for(var d=new Array(c),f=b[c-1],g=0;c>g;++g){var h=b[g];d[g]=[f,h],f=h}return d}b.exports=d;var e=a("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":65}],63:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),e=0;e<b.length;++e)d[e]=a[b[e]];for(var f=b.length,e=0;c>e;++e)b.indexOf(e)<0&&(d[f++]=a[e]);return d}function e(a,b){for(var c=a.length,d=b.length,e=0;c>e;++e)for(var f=a[e],g=0;g<f.length;++g){var h=f[g];if(d>h)f[g]=b[h];else{h-=d;for(var i=0;d>i;++i)h>=b[i]&&(h+=1);f[g]=h}}return a}function f(a,b){try{return g(a,!0)}catch(c){var f=h(a);if(f.length<=b)return[];var i=d(a,f),j=g(i,!0);return e(j,f)}}b.exports=f;var g=a("incremental-convex-hull"),h=a("affine-hull")},{"affine-hull":64,"incremental-convex-hull":191}],64:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(b+1),d=0;d<a.length;++d)c[d]=a[d];for(var d=0;d<=a.length;++d){for(var e=a.length;b>=e;++e){for(var g=new Array(b),h=0;b>h;++h)g[h]=Math.pow(e+1-d,h);c[e]=g}var i=f.apply(void 0,c);if(i)return!0}return!1}function e(a){var b=a.length;if(0===b)return[];if(1===b)return[0];for(var c=a[0].length,e=[a[0]],f=[0],g=1;b>g;++g)if(e.push(a[g]),d(e,c)){if(f.push(g),f.length===c+1)return f}else e.pop();return f}b.exports=e;var f=a("robust-orientation")},{"robust-orientation":214}],65:[function(a,b,c){"use strict";function d(a){var b=a.length;if(3>b){for(var c=new Array(b),d=0;b>d;++d)c[d]=d;return 2===b&&a[0][0]===a[1][0]&&a[0][1]===a[1][1]?[0]:c}for(var f=new Array(b),d=0;b>d;++d)f[d]=d;f.sort(function(b,c){var d=a[b][0]-a[c][0];return d?d:a[b][1]-a[c][1]});for(var g=[f[0],f[1]],h=[f[0],f[1]],d=2;b>d;++d){for(var i=f[d],j=a[i],k=g.length;k>1&&e(a[g[k-2]],a[g[k-1]],j)<=0;)k-=1,g.pop();for(g.push(i),k=h.length;k>1&&e(a[h[k-2]],a[h[k-1]],j)>=0;)k-=1,h.pop();h.push(i)}for(var c=new Array(h.length+g.length-2),l=0,d=0,m=g.length;m>d;++d)c[l++]=g[d];for(var n=h.length-2;n>0;--n)c[l++]=h[n];return c}b.exports=d;var e=a("robust-orientation")[3]},{"robust-orientation":214}],66:[function(a,b,c){"use strict";function d(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function e(a){var b=new d;b.pre=a.pre,b.body=a.body,b.post=a.post;var c=a.args.slice(0);b.argTypes=c;for(var e=0;e<c.length;++e){var g=c[e];if("array"===g||"object"==typeof g&&g.blockIndices){if(b.argTypes[e]="array",b.arrayArgs.push(e),b.arrayBlockIndices.push(g.blockIndices?g.blockIndices:0),b.shimArgs.push("array"+e),e<b.pre.args.length&&b.pre.args[e].count>0)throw new Error("cwise: pre() block may not reference array args");if(e<b.post.args.length&&b.post.args[e].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===g)b.scalarArgs.push(e),b.shimArgs.push("scalar"+e);else if("index"===g){if(b.indexArgs.push(e),e<b.pre.args.length&&b.pre.args[e].count>0)throw new Error("cwise: pre() block may not reference array index");if(e<b.body.args.length&&b.body.args[e].lvalue)throw new Error("cwise: body() block may not write to array index");if(e<b.post.args.length&&b.post.args[e].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===g){if(b.shapeArgs.push(e),e<b.pre.args.length&&b.pre.args[e].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(e<b.body.args.length&&b.body.args[e].lvalue)throw new Error("cwise: body() block may not write to array shape"); 26 if(e<b.post.args.length&&b.post.args[e].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof g||!g.offset)throw new Error("cwise: Unknown argument type "+c[e]);b.argTypes[e]="offset",b.offsetArgs.push({array:g.array,offset:g.offset}),b.offsetArgIndex.push(e)}}if(b.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(b.pre.args.length>c.length)throw new Error("cwise: Too many arguments in pre() block");if(b.body.args.length>c.length)throw new Error("cwise: Too many arguments in body() block");if(b.post.args.length>c.length)throw new Error("cwise: Too many arguments in post() block");return b.debug=!!a.printCode||!!a.debug,b.funcName=a.funcName||"cwise",b.blockSize=a.blockSize||64,f(b)}var f=a("./lib/thunk.js");b.exports=e},{"./lib/thunk.js":68}],67:[function(a,b,c){"use strict";function d(a,b,c){var d,e,f=a.length,g=b.arrayArgs.length,h=b.indexArgs.length>0,i=[],j=[],k=0,l=0;for(d=0;f>d;++d)j.push(["i",d,"=0"].join(""));for(e=0;g>e;++e)for(d=0;f>d;++d)l=k,k=a[d],0===d?j.push(["d",e,"s",d,"=t",e,"p",k].join("")):j.push(["d",e,"s",d,"=(t",e,"p",k,"-s",l,"*t",e,"p",l,")"].join(""));for(i.push("var "+j.join(",")),d=f-1;d>=0;--d)k=a[d],i.push(["for(i",d,"=0;i",d,"<s",k,";++i",d,"){"].join(""));for(i.push(c),d=0;f>d;++d){for(l=k,k=a[d],e=0;g>e;++e)i.push(["p",e,"+=d",e,"s",d].join(""));h&&(d>0&&i.push(["index[",l,"]-=s",l].join("")),i.push(["++index[",k,"]"].join(""))),i.push("}")}return i.join("\n")}function e(a,b,c,e){for(var f=b.length,g=c.arrayArgs.length,h=c.blockSize,i=c.indexArgs.length>0,j=[],k=0;g>k;++k)j.push(["var offset",k,"=p",k].join(""));for(var k=a;f>k;++k)j.push(["for(var j"+k+"=SS[",b[k],"]|0;j",k,">0;){"].join("")),j.push(["if(j",k,"<",h,"){"].join("")),j.push(["s",b[k],"=j",k].join("")),j.push(["j",k,"=0"].join("")),j.push(["}else{s",b[k],"=",h].join("")),j.push(["j",k,"-=",h,"}"].join("")),i&&j.push(["index[",b[k],"]=j",k].join(""));for(var k=0;g>k;++k){for(var l=["offset"+k],m=a;f>m;++m)l.push(["j",m,"*t",k,"p",b[m]].join(""));j.push(["p",k,"=(",l.join("+"),")"].join(""))}j.push(d(b,c,e));for(var k=a;f>k;++k)j.push("}");return j.join("\n")}function f(a){for(var b=0,c=a[0].length;c>b;){for(var d=1;d<a.length;++d)if(a[d][b]!==a[0][b])return b;++b}return b}function g(a,b,c){for(var d=a.body,e=[],f=[],g=0;g<a.args.length;++g){var h=a.args[g];if(!(h.count<=0)){var i=new RegExp(h.name,"g"),j="",k=b.arrayArgs.indexOf(g);switch(b.argTypes[g]){case"offset":var l=b.offsetArgIndex.indexOf(g),m=b.offsetArgs[l];k=m.array,j="+q"+l;case"array":j="p"+k+j;var n="l"+g,o="a"+k;if(0===b.arrayBlockIndices[k])1===h.count?"generic"===c[k]?h.lvalue?(e.push(["var ",n,"=",o,".get(",j,")"].join("")),d=d.replace(i,n),f.push([o,".set(",j,",",n,")"].join(""))):d=d.replace(i,[o,".get(",j,")"].join("")):d=d.replace(i,[o,"[",j,"]"].join("")):"generic"===c[k]?(e.push(["var ",n,"=",o,".get(",j,")"].join("")),d=d.replace(i,n),h.lvalue&&f.push([o,".set(",j,",",n,")"].join(""))):(e.push(["var ",n,"=",o,"[",j,"]"].join("")),d=d.replace(i,n),h.lvalue&&f.push([o,"[",j,"]=",n].join("")));else{for(var p=[h.name],q=[j],r=0;r<Math.abs(b.arrayBlockIndices[k]);r++)p.push("\\s*\\[([^\\]]+)\\]"),q.push("$"+(r+1)+"*t"+k+"b"+r);if(i=new RegExp(p.join(""),"g"),j=q.join("+"),"generic"===c[k])throw new Error("cwise: Generic arrays not supported in combination with blocks!");d=d.replace(i,[o,"[",j,"]"].join(""))}break;case"scalar":d=d.replace(i,"Y"+b.scalarArgs.indexOf(g));break;case"index":d=d.replace(i,"index");break;case"shape":d=d.replace(i,"shape")}}}return[e.join("\n"),d,f.join("\n")].join("\n").trim()}function h(a){for(var b=new Array(a.length),c=!0,d=0;d<a.length;++d){var e=a[d],f=e.match(/\d+/);f=f?f[0]:"",0===e.charAt(0)?b[d]="u"+e.charAt(1)+f:b[d]=e.charAt(0)+f,d>0&&(c=c&&b[d]===b[d-1])}return c?b[0]:b.join("")}function i(a,b){for(var c=b[1].length-Math.abs(a.arrayBlockIndices[0])|0,i=new Array(a.arrayArgs.length),k=new Array(a.arrayArgs.length),l=0;l<a.arrayArgs.length;++l)k[l]=b[2*l],i[l]=b[2*l+1];for(var m=[],n=[],o=[],p=[],q=[],l=0;l<a.arrayArgs.length;++l){a.arrayBlockIndices[l]<0?(o.push(0),p.push(c),m.push(c),n.push(c+a.arrayBlockIndices[l])):(o.push(a.arrayBlockIndices[l]),p.push(a.arrayBlockIndices[l]+c),m.push(0),n.push(a.arrayBlockIndices[l]));for(var r=[],s=0;s<i[l].length;s++)o[l]<=i[l][s]&&i[l][s]<p[l]&&r.push(i[l][s]-o[l]);q.push(r)}for(var t=["SS"],u=["'use strict'"],v=[],s=0;c>s;++s)v.push(["s",s,"=SS[",s,"]"].join(""));for(var l=0;l<a.arrayArgs.length;++l){t.push("a"+l),t.push("t"+l),t.push("p"+l);for(var s=0;c>s;++s)v.push(["t",l,"p",s,"=t",l,"[",o[l]+s,"]"].join(""));for(var s=0;s<Math.abs(a.arrayBlockIndices[l]);++s)v.push(["t",l,"b",s,"=t",l,"[",m[l]+s,"]"].join(""))}for(var l=0;l<a.scalarArgs.length;++l)t.push("Y"+l);if(a.shapeArgs.length>0&&v.push("shape=SS.slice(0)"),a.indexArgs.length>0){for(var w=new Array(c),l=0;c>l;++l)w[l]="0";v.push(["index=[",w.join(","),"]"].join(""))}for(var l=0;l<a.offsetArgs.length;++l){for(var x=a.offsetArgs[l],y=[],s=0;s<x.offset.length;++s)0!==x.offset[s]&&(1===x.offset[s]?y.push(["t",x.array,"p",s].join("")):y.push([x.offset[s],"*t",x.array,"p",s].join("")));0===y.length?v.push("q"+l+"=0"):v.push(["q",l,"=",y.join("+")].join(""))}var z=j([].concat(a.pre.thisVars).concat(a.body.thisVars).concat(a.post.thisVars));v=v.concat(z),u.push("var "+v.join(","));for(var l=0;l<a.arrayArgs.length;++l)u.push("p"+l+"|=0");a.pre.body.length>3&&u.push(g(a.pre,a,k));var A=g(a.body,a,k),B=f(q);c>B?u.push(e(B,q[0],a,A)):u.push(d(q[0],a,A)),a.post.body.length>3&&u.push(g(a.post,a,k)),a.debug&&console.log("-----Generated cwise routine for ",b,":\n"+u.join("\n")+"\n----------");var C=[a.funcName||"unnamed","_cwise_loop_",i[0].join("s"),"m",B,h(k)].join(""),D=new Function(["function ",C,"(",t.join(","),"){",u.join("\n"),"} return ",C].join(""));return D()}var j=a("uniq");b.exports=i},{uniq:234}],68:[function(a,b,c){"use strict";function d(a){var b=["'use strict'","var CACHED={}"],c=[],d=a.funcName+"_cwise_thunk";b.push(["return function ",d,"(",a.shimArgs.join(","),"){"].join(""));for(var f=[],g=[],h=[["array",a.arrayArgs[0],".shape.slice(",Math.max(0,a.arrayBlockIndices[0]),a.arrayBlockIndices[0]<0?","+a.arrayBlockIndices[0]+")":")"].join("")],i=[],j=[],k=0;k<a.arrayArgs.length;++k){var l=a.arrayArgs[k];c.push(["t",l,"=array",l,".dtype,","r",l,"=array",l,".order"].join("")),f.push("t"+l),f.push("r"+l),g.push("t"+l),g.push("r"+l+".join()"),h.push("array"+l+".data"),h.push("array"+l+".stride"),h.push("array"+l+".offset|0"),k>0&&(i.push("array"+a.arrayArgs[0]+".shape.length===array"+l+".shape.length+"+(Math.abs(a.arrayBlockIndices[0])-Math.abs(a.arrayBlockIndices[k]))),j.push("array"+a.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,a.arrayBlockIndices[0])+"]===array"+l+".shape[shapeIndex+"+Math.max(0,a.arrayBlockIndices[k])+"]"))}a.arrayArgs.length>1&&(b.push("if (!("+i.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),b.push("for(var shapeIndex=array"+a.arrayArgs[0]+".shape.length-"+Math.abs(a.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),b.push("if (!("+j.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),b.push("}"));for(var k=0;k<a.scalarArgs.length;++k)h.push("scalar"+a.scalarArgs[k]);c.push(["type=[",g.join(","),"].join()"].join("")),c.push("proc=CACHED[type]"),b.push("var "+c.join(",")),b.push(["if(!proc){","CACHED[type]=proc=compile([",f.join(","),"])}","return proc(",h.join(","),")}"].join("")),a.debug&&console.log("-----Generated thunk:\n"+b.join("\n")+"\n----------");var m=new Function("compile",b.join("\n"));return m(e.bind(void 0,a))}var e=a("./compile.js");b.exports=d},{"./compile.js":67}],69:[function(a,b,c){b.exports=a("cwise-compiler")},{"cwise-compiler":66}],70:[function(b,c,d){!function(){function b(a){return a&&(a.ownerDocument||a.document||a).documentElement}function d(a){return a&&(a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView)}function e(a,b){return b>a?-1:a>b?1:a>=b?0:NaN}function f(a){return null===a?NaN:+a}function g(a){return!isNaN(a)}function h(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)<0?d=f+1:e=f}return d},right:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a(b[f],c)>0?e=f:d=f+1}return d}}}function i(a){return a.length}function j(a){for(var b=1;a*b%1;)b*=10;return b}function k(a,b){for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}function l(){this._=Object.create(null)}function m(a){return(a+="")===wg||a[0]===xg?xg+a:a}function n(a){return(a+="")[0]===xg?a.slice(1):a}function o(a){return m(a)in this._}function p(a){return(a=m(a))in this._&&delete this._[a]}function q(){var a=[];for(var b in this._)a.push(n(b));return a}function r(){var a=0;for(var b in this._)++a;return a}function s(){for(var a in this._)return!1;return!0}function t(){this._=Object.create(null)}function u(a){return a}function v(a,b,c){return function(){var d=c.apply(b,arguments);return d===b?a:d}}function w(a,b){if(b in a)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(var c=0,d=yg.length;d>c;++c){var e=yg[c]+b;if(e in a)return e}}function x(){}function y(){}function z(a){function b(){for(var b,d=c,e=-1,f=d.length;++e<f;)(b=d[e].on)&&b.apply(this,arguments);return a}var c=[],d=new l;return b.on=function(b,e){var f,g=d.get(b);return arguments.length<2?g&&g.on:(g&&(g.on=null,c=c.slice(0,f=c.indexOf(g)).concat(c.slice(f+1)),d.remove(b)),e&&c.push(d.set(b,{on:e})),a)},b}function A(){jg.event.preventDefault()}function B(){for(var a,b=jg.event;a=b.sourceEvent;)b=a;return b}function C(a){for(var b=new y,c=0,d=arguments.length;++c<d;)b[arguments[c]]=z(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=jg.event;e.target=a,jg.event=e,b[e.type].apply(c,d)}finally{jg.event=f}}},b}function D(a){return Ag(a,Eg),a}function E(a){return"function"==typeof a?a:function(){return Bg(a,this)}}function F(a){return"function"==typeof a?a:function(){return Cg(a,this)}}function G(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=jg.ns.qualify(a),null==b?a.local?d:c:"function"==typeof b?a.local?h:g:a.local?f:e}function H(a){return a.trim().replace(/\s+/g," ")}function I(a){return new RegExp("(?:^|\\s+)"+jg.requote(a)+"(?:\\s+|$)","g")}function J(a){return(a+"").trim().split(/^|\s+/)}function K(a,b){function c(){for(var c=-1;++c<e;)a[c](this,b)}function d(){for(var c=-1,d=b.apply(this,arguments);++c<e;)a[c](this,d)}a=J(a).map(L);var e=a.length;return"function"==typeof b?d:c}function L(a){var b=I(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.getAttribute("class")||"";d?(b.lastIndex=0,b.test(e)||c.setAttribute("class",H(e+" "+a))):c.setAttribute("class",H(e.replace(b," ")))}}function M(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return null==b?d:"function"==typeof b?f:e}function N(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}return null==b?c:"function"==typeof b?e:d}function O(a){function b(){var b=this.ownerDocument,c=this.namespaceURI;return c?b.createElementNS(c,a):b.createElement(a)}function c(){return this.ownerDocument.createElementNS(a.space,a.local)}return"function"==typeof a?a:(a=jg.ns.qualify(a)).local?c:b}function P(){var a=this.parentNode;a&&a.removeChild(this)}function Q(a){return{__data__:a}}function R(a){return function(){return Dg(this,a)}}function S(a){return arguments.length||(a=e),function(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}}function T(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function U(a){return Ag(a,Gg),a}function V(a){var b,c;return function(d,e,f){var g,h=a[f].update,i=h.length;for(f!=c&&(c=f,b=0),e>=b&&(b=e+1);!(g=h[b])&&++b<i;);return g}}function W(a,b,c){function d(){var b=this[g];b&&(this.removeEventListener(a,b,b.$),delete this[g])}function e(){var e=i(b,lg(arguments));d.call(this),this.addEventListener(a,this[g]=e,e.$=c),e._=b}function f(){var b,c=new RegExp("^__on([^.]+)"+jg.requote(a)+"$");for(var d in this)if(b=d.match(c)){var e=this[d];this.removeEventListener(b[1],e,e.$),delete this[d]}}var g="__on"+a,h=a.indexOf("."),i=X;h>0&&(a=a.slice(0,h));var j=Hg.get(a);return j&&(a=j,i=Y),h?b?e:d:b?x:f}function X(a,b){return function(c){var d=jg.event;jg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{jg.event=d}}}function Y(a,b){var c=X(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function Z(a){var c=".dragsuppress-"+ ++Jg,e="click"+c,f=jg.select(d(a)).on("touchmove"+c,A).on("dragstart"+c,A).on("selectstart"+c,A);if(null==Ig&&(Ig="onselectstart"in a?!1:w(a.style,"userSelect")),Ig){var g=b(a).style,h=g[Ig];g[Ig]="none"}return function(a){if(f.on(c,null),Ig&&(g[Ig]=h),a){var b=function(){f.on(e,null)};f.on(e,function(){A(),b()},!0),setTimeout(b,0)}}}function $(a,b){b.changedTouches&&(b=b.changedTouches[0]);var c=a.ownerSVGElement||a;if(c.createSVGPoint){var e=c.createSVGPoint();if(0>Kg){var f=d(a);if(f.scrollX||f.scrollY){c=jg.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var g=c[0][0].getScreenCTM();Kg=!(g.f||g.e),c.remove()}}return Kg?(e.x=b.pageX,e.y=b.pageY):(e.x=b.clientX,e.y=b.clientY),e=e.matrixTransform(a.getScreenCTM().inverse()),[e.x,e.y]}var h=a.getBoundingClientRect();return[b.clientX-h.left-a.clientLeft,b.clientY-h.top-a.clientTop]}function _(){return jg.event.changedTouches[0].identifier}function aa(a){return a>0?1:0>a?-1:0}function ba(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function ca(a){return a>1?0:-1>a?Ng:Math.acos(a)}function da(a){return a>1?Qg:-1>a?-Qg:Math.asin(a)}function ea(a){return((a=Math.exp(a))-1/a)/2}function fa(a){return((a=Math.exp(a))+1/a)/2}function ga(a){return((a=Math.exp(2*a))-1)/(a+1)}function ha(a){return(a=Math.sin(a/2))*a}function ia(){}function ja(a,b,c){return this instanceof ja?(this.h=+a,this.s=+b,void(this.l=+c)):arguments.length<2?a instanceof ja?new ja(a.h,a.s,a.l):xa(""+a,ya,ja):new ja(a,b,c)}function ka(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a=isNaN(a)?0:(a%=360)<0?a+360:a,b=isNaN(b)?0:0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,new ta(e(a+120),e(a),e(a-120))}function la(a,b,c){return this instanceof la?(this.h=+a,this.c=+b,void(this.l=+c)):arguments.length<2?a instanceof la?new la(a.h,a.c,a.l):a instanceof na?pa(a.l,a.a,a.b):pa((a=za((a=jg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new la(a,b,c)}function ma(a,b,c){return isNaN(a)&&(a=0),isNaN(b)&&(b=0),new na(c,Math.cos(a*=Rg)*b,Math.sin(a)*b)}function na(a,b,c){return this instanceof na?(this.l=+a,this.a=+b,void(this.b=+c)):arguments.length<2?a instanceof na?new na(a.l,a.a,a.b):a instanceof la?ma(a.h,a.c,a.l):za((a=ta(a)).r,a.g,a.b):new na(a,b,c)}function oa(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=qa(e)*ah,d=qa(d)*bh,f=qa(f)*ch,new ta(sa(3.2404542*e-1.5371385*d-.4985314*f),sa(-.969266*e+1.8760108*d+.041556*f),sa(.0556434*e-.2040259*d+1.0572252*f))}function pa(a,b,c){return a>0?new la(Math.atan2(c,b)*Sg,Math.sqrt(b*b+c*c),a):new la(NaN,NaN,a)}function qa(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function ra(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function sa(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function ta(a,b,c){return this instanceof ta?(this.r=~~a,this.g=~~b,void(this.b=~~c)):arguments.length<2?a instanceof ta?new ta(a.r,a.g,a.b):xa(""+a,ta,ka):new ta(a,b,c)}function ua(a){return new ta(a>>16,a>>8&255,255&a)}function va(a){return ua(a)+""}function wa(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function xa(a,b,c){var d,e,f,g=0,h=0,i=0;if(d=/([a-z]+)\((.*)\)/.exec(a=a.toLowerCase()))switch(e=d[2].split(","),d[1]){case"hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return b(Ba(e[0]),Ba(e[1]),Ba(e[2]))}return(f=fh.get(a))?b(f.r,f.g,f.b):(null==a||"#"!==a.charAt(0)||isNaN(f=parseInt(a.slice(1),16))||(4===a.length?(g=(3840&f)>>4,g=g>>4|g,h=240&f,h=h>>4|h,i=15&f,i=i<<4|i):7===a.length&&(g=(16711680&f)>>16,h=(65280&f)>>8,i=255&f)),b(g,h,i))}function ya(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):(d=NaN,e=i>0&&1>i?0:d),new ja(d,e,i)}function za(a,b,c){a=Aa(a),b=Aa(b),c=Aa(c);var d=ra((.4124564*a+.3575761*b+.1804375*c)/ah),e=ra((.2126729*a+.7151522*b+.072175*c)/bh),f=ra((.0193339*a+.119192*b+.9503041*c)/ch);return na(116*e-16,500*(d-e),200*(e-f))}function Aa(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Ba(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function Ca(a){return"function"==typeof a?a:function(){return a}}function Da(a){return function(b,c,d){return 2===arguments.length&&"function"==typeof c&&(d=c,c=null),Ea(b,c,a,d)}}function Ea(a,b,c,d){function e(){var a,b=i.status;if(!b&&Ga(i)||b>=200&&300>b||304===b){try{a=c.call(f,i)}catch(d){return void g.error.call(f,d)}g.load.call(f,a)}else g.error.call(f,i)}var f={},g=jg.dispatch("beforesend","progress","load","error"),h={},i=new XMLHttpRequest,j=null;return!this.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(a)||(i=new XDomainRequest),"onload"in i?i.onload=i.onerror=e:i.onreadystatechange=function(){i.readyState>3&&e()},i.onprogress=function(a){var b=jg.event;jg.event=a;try{g.progress.call(f,i)}finally{jg.event=b}},f.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(null==b?delete h[a]:h[a]=b+"",f)},f.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",f):b},f.responseType=function(a){return arguments.length?(j=a,f):j},f.response=function(a){return c=a,f},["get","post"].forEach(function(a){f[a]=function(){return f.send.apply(f,[a].concat(lg(arguments)))}}),f.send=function(c,d,e){if(2===arguments.length&&"function"==typeof d&&(e=d,d=null),i.open(c,a,!0),null==b||"accept"in h||(h.accept=b+",*/*"),i.setRequestHeader)for(var k in h)i.setRequestHeader(k,h[k]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=j&&(i.responseType=j),null!=e&&f.on("error",e).on("load",function(a){e(null,a)}),g.beforesend.call(f,i),i.send(null==d?null:d),f},f.abort=function(){return i.abort(),f},jg.rebind(f,g,"on"),null==d?f:f.get(Fa(d))}function Fa(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function Ga(a){var b=a.responseType;return b&&"text"!==b?a.response:a.responseText}function Ha(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,n:null};return hh?hh.n=f:gh=f,hh=f,ih||(jh=clearTimeout(jh),ih=1,kh(Ia)),f}function Ia(){var a=Ja(),b=Ka()-a;b>24?(isFinite(b)&&(clearTimeout(jh),jh=setTimeout(Ia,b)),ih=0):(ih=1,kh(Ia))}function Ja(){for(var a=Date.now(),b=gh;b;)a>=b.t&&b.c(a-b.t)&&(b.c=null),b=b.n;return a}function Ka(){for(var a,b=gh,c=1/0;b;)b.c?(b.t<c&&(c=b.t),b=(a=b).n):b=a?a.n=b.n:gh=b.n;return hh=a,c}function La(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function Ma(a,b){var c=Math.pow(10,3*vg(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function Na(a){var b=a.decimal,c=a.thousands,d=a.grouping,e=a.currency,f=d&&c?function(a,b){for(var e=a.length,f=[],g=0,h=d[0],i=0;e>0&&h>0&&(i+h+1>b&&(h=Math.max(1,b-i)),f.push(a.substring(e-=h,e+h)),!((i+=h+1)>b));)h=d[g=(g+1)%d.length];return f.reverse().join(c)}:u;return function(a){var c=mh.exec(a),d=c[1]||" ",g=c[2]||">",h=c[3]||"-",i=c[4]||"",j=c[5],k=+c[6],l=c[7],m=c[8],n=c[9],o=1,p="",q="",r=!1,s=!0;switch(m&&(m=+m.substring(1)),(j||"0"===d&&"="===g)&&(j=d="0",g="="),n){case"n":l=!0,n="g";break;case"%":o=100,q="%",n="f";break;case"p":o=100,q="%",n="r";break;case"b":case"o":case"x":case"X":"#"===i&&(p="0"+n.toLowerCase());case"c":s=!1;case"d":r=!0,m=0;break;case"s":o=-1,n="r"}"$"===i&&(p=e[0],q=e[1]),"r"!=n||m||(n="g"),null!=m&&("g"==n?m=Math.max(1,Math.min(21,m)):"e"!=n&&"f"!=n||(m=Math.max(0,Math.min(20,m)))),n=nh.get(n)||Oa;var t=j&&l;return function(a){var c=q;if(r&&a%1)return"";var e=0>a||0===a&&0>1/a?(a=-a,"-"):"-"===h?"":h;if(0>o){var i=jg.formatPrefix(a,m);a=i.scale(a),c=i.symbol+q}else a*=o;a=n(a,m);var u,v,w=a.lastIndexOf(".");if(0>w){var x=s?a.lastIndexOf("e"):-1;0>x?(u=a,v=""):(u=a.substring(0,x),v=a.substring(x))}else u=a.substring(0,w),v=b+a.substring(w+1);!j&&l&&(u=f(u,1/0));var y=p.length+u.length+v.length+(t?0:e.length),z=k>y?new Array(y=k-y+1).join(d):"";return t&&(u=f(z+u,z.length?k-v.length:1/0)),e+=p,a=u+v,("<"===g?e+a+z:">"===g?z+e+a:"^"===g?z.substring(0,y>>=1)+e+a+z.substring(y):e+(t?a:z+a))+c}}}function Oa(a){return a+""}function Pa(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Qa(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new ph(c-1)),1),c}function f(a,c){return b(a=new ph(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{ph=Pa;var d=new Pa;return d._=a,g(d,b,c)}finally{ph=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=Ra(a);return i.floor=i,i.round=Ra(d),i.ceil=Ra(e),i.offset=Ra(f),i.range=h,a}function Ra(a){return function(b,c){try{ph=Pa;var d=new Pa;return d._=b,a(d,c)._}finally{ph=Date}}}function Sa(a){function b(a){function b(b){for(var c,e,f,g=[],h=-1,i=0;++h<d;)37===a.charCodeAt(h)&&(g.push(a.slice(i,h)),null!=(e=rh[c=a.charAt(++h)])&&(c=a.charAt(++h)),(f=C[c])&&(c=f(b,null==e?"e"===c?" ":"0":e)),g.push(c),i=h+1);return g.push(a.slice(i,h)),g.join("")}var d=a.length;return b.parse=function(b){var d={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},e=c(d,a,b,0);if(e!=b.length)return null;"p"in d&&(d.H=d.H%12+12*d.p);var f=null!=d.Z&&ph!==Pa,g=new(f?Pa:ph);return"j"in d?g.setFullYear(d.y,0,d.j):"W"in d||"U"in d?("w"in d||(d.w="W"in d?1:0),g.setFullYear(d.y,0,1),g.setFullYear(d.y,0,"W"in d?(d.w+6)%7+7*d.W-(g.getDay()+5)%7:d.w+7*d.U-(g.getDay()+6)%7)):g.setFullYear(d.y,d.m,d.d),g.setHours(d.H+(d.Z/100|0),d.M+d.Z%100,d.S,d.L),f?g._:g},b.toString=function(){return a},b}function c(a,b,c,d){for(var e,f,g,h=0,i=b.length,j=c.length;i>h;){if(d>=j)return-1;if(e=b.charCodeAt(h++),37===e){if(g=b.charAt(h++),f=D[g in rh?b.charAt(h++):g],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function d(a,b,c){w.lastIndex=0;var d=w.exec(b.slice(c));return d?(a.w=x.get(d[0].toLowerCase()),c+d[0].length):-1}function e(a,b,c){u.lastIndex=0;var d=u.exec(b.slice(c));return d?(a.w=v.get(d[0].toLowerCase()),c+d[0].length):-1}function f(a,b,c){A.lastIndex=0;var d=A.exec(b.slice(c));return d?(a.m=B.get(d[0].toLowerCase()),c+d[0].length):-1}function g(a,b,c){y.lastIndex=0;var d=y.exec(b.slice(c));return d?(a.m=z.get(d[0].toLowerCase()),c+d[0].length):-1}function h(a,b,d){return c(a,C.c.toString(),b,d)}function i(a,b,d){return c(a,C.x.toString(),b,d)}function j(a,b,d){return c(a,C.X.toString(),b,d)}function k(a,b,c){var d=t.get(b.slice(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}var l=a.dateTime,m=a.date,n=a.time,o=a.periods,p=a.days,q=a.shortDays,r=a.months,s=a.shortMonths;b.utc=function(a){function c(a){try{ph=Pa;var b=new ph;return b._=a,d(b)}finally{ph=Date}}var d=b(a);return c.parse=function(a){try{ph=Pa;var b=d.parse(a);return b&&b._}finally{ph=Date}},c.toString=d.toString,c},b.multi=b.utc.multi=kb;var t=jg.map(),u=Ua(p),v=Va(p),w=Ua(q),x=Va(q),y=Ua(r),z=Va(r),A=Ua(s),B=Va(s);o.forEach(function(a,b){t.set(a.toLowerCase(),b)});var C={a:function(a){return q[a.getDay()]},A:function(a){return p[a.getDay()]},b:function(a){return s[a.getMonth()]},B:function(a){return r[a.getMonth()]},c:b(l),d:function(a,b){return Ta(a.getDate(),b,2)},e:function(a,b){return Ta(a.getDate(),b,2)},H:function(a,b){return Ta(a.getHours(),b,2)},I:function(a,b){return Ta(a.getHours()%12||12,b,2)},j:function(a,b){return Ta(1+oh.dayOfYear(a),b,3)},L:function(a,b){return Ta(a.getMilliseconds(),b,3)},m:function(a,b){return Ta(a.getMonth()+1,b,2)},M:function(a,b){return Ta(a.getMinutes(),b,2)},p:function(a){return o[+(a.getHours()>=12)]},S:function(a,b){return Ta(a.getSeconds(),b,2)},U:function(a,b){return Ta(oh.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return Ta(oh.mondayOfYear(a),b,2)},x:b(m),X:b(n),y:function(a,b){return Ta(a.getFullYear()%100,b,2)},Y:function(a,b){return Ta(a.getFullYear()%1e4,b,4)},Z:ib,"%":function(){return"%"}},D={a:d,A:e,b:f,B:g,c:h,d:cb,e:cb,H:eb,I:eb,j:db,L:hb,m:bb,M:fb,p:k,S:gb,U:Xa,w:Wa,W:Ya,x:i,X:j,y:$a,Y:Za,Z:_a,"%":jb};return b}function Ta(a,b,c){var d=0>a?"-":"",e=(d?-a:a)+"",f=e.length;return d+(c>f?new Array(c-f+1).join(b)+e:e)}function Ua(a){return new RegExp("^(?:"+a.map(jg.requote).join("|")+")","i")}function Va(a){for(var b=new l,c=-1,d=a.length;++c<d;)b.set(a[c].toLowerCase(),c);return b}function Wa(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+1));return d?(a.w=+d[0],c+d[0].length):-1}function Xa(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c));return d?(a.U=+d[0],c+d[0].length):-1}function Ya(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c));return d?(a.W=+d[0],c+d[0].length):-1}function Za(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+4));return d?(a.y=+d[0],c+d[0].length):-1}function $a(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.y=ab(+d[0]),c+d[0].length):-1}function _a(a,b,c){return/^[+-]\d{4}$/.test(b=b.slice(c,c+5))?(a.Z=-b,c+5):-1}function ab(a){return a+(a>68?1900:2e3)}function bb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.m=d[0]-1,c+d[0].length):-1}function cb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.d=+d[0],c+d[0].length):-1}function db(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+3));return d?(a.j=+d[0],c+d[0].length):-1}function eb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.H=+d[0],c+d[0].length):-1}function fb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.M=+d[0],c+d[0].length):-1}function gb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+2));return d?(a.S=+d[0],c+d[0].length):-1}function hb(a,b,c){sh.lastIndex=0;var d=sh.exec(b.slice(c,c+3));return d?(a.L=+d[0],c+d[0].length):-1}function ib(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=vg(b)/60|0,e=vg(b)%60;return c+Ta(d,"0",2)+Ta(e,"0",2)}function jb(a,b,c){th.lastIndex=0;var d=th.exec(b.slice(c,c+1));return d?c+d[0].length:-1}function kb(a){for(var b=a.length,c=-1;++c<b;)a[c][0]=this(a[c][0]);return function(b){for(var c=0,d=a[c];!d[1](b);)d=a[++c];return d[0](b)}}function lb(){}function mb(a,b,c){var d=c.s=a+b,e=d-a,f=d-e;c.t=a-f+(b-e)}function nb(a,b){a&&xh.hasOwnProperty(a.type)&&xh[a.type](a,b)}function ob(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++e<f;)d=a[e],b.point(d[0],d[1],d[2]);b.lineEnd()}function pb(a,b){var c=-1,d=a.length;for(b.polygonStart();++c<d;)ob(a[c],b,1);b.polygonEnd()}function qb(){function a(a,b){a*=Rg,b=b*Rg/2+Ng/4;var c=a-d,g=c>=0?1:-1,h=g*c,i=Math.cos(b),j=Math.sin(b),k=f*j,l=e*i+k*Math.cos(h),m=k*g*Math.sin(h);zh.add(Math.atan2(m,l)),d=a,e=i,f=j}var b,c,d,e,f;Ah.point=function(g,h){Ah.point=a,d=(b=g)*Rg,e=Math.cos(h=(c=h)*Rg/2+Ng/4),f=Math.sin(h)},Ah.lineEnd=function(){a(b,c)}}function rb(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function sb(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function tb(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function ub(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function vb(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function wb(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function xb(a){return[Math.atan2(a[1],a[0]),da(a[2])]}function yb(a,b){return vg(a[0]-b[0])<Lg&&vg(a[1]-b[1])<Lg}function zb(a,b){a*=Rg;var c=Math.cos(b*=Rg);Ab(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function Ab(a,b,c){++Bh,Dh+=(a-Dh)/Bh,Eh+=(b-Eh)/Bh,Fh+=(c-Fh)/Bh}function Bb(){function a(a,e){a*=Rg;var f=Math.cos(e*=Rg),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);Ch+=j,Gh+=j*(b+(b=g)),Hh+=j*(c+(c=h)),Ih+=j*(d+(d=i)),Ab(b,c,d)}var b,c,d;Mh.point=function(e,f){e*=Rg;var g=Math.cos(f*=Rg);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),Mh.point=a,Ab(b,c,d)}}function Cb(){Mh.point=zb}function Db(){function a(a,b){a*=Rg;var c=Math.cos(b*=Rg),g=c*Math.cos(a),h=c*Math.sin(a),i=Math.sin(b),j=e*i-f*h,k=f*g-d*i,l=d*h-e*g,m=Math.sqrt(j*j+k*k+l*l),n=d*g+e*h+f*i,o=m&&-ca(n)/m,p=Math.atan2(m,n);Jh+=o*j,Kh+=o*k,Lh+=o*l,Ch+=p,Gh+=p*(d+(d=g)),Hh+=p*(e+(e=h)),Ih+=p*(f+(f=i)),Ab(d,e,f)}var b,c,d,e,f;Mh.point=function(g,h){b=g,c=h,Mh.point=a,g*=Rg;var i=Math.cos(h*=Rg);d=i*Math.cos(g),e=i*Math.sin(g),f=Math.sin(h),Ab(d,e,f)},Mh.lineEnd=function(){a(b,c),Mh.lineEnd=Cb,Mh.point=zb}}function Eb(a,b){function c(c,d){return c=a(c,d),b(c[0],c[1])}return a.invert&&b.invert&&(c.invert=function(c,d){return c=b.invert(c,d),c&&a.invert(c[0],c[1])}),c}function Fb(){return!0}function Gb(a,b,c,d,e){var f=[],g=[];if(a.forEach(function(a){if(!((b=a.length-1)<=0)){var b,c=a[0],d=a[b];if(yb(c,d)){e.lineStart();for(var h=0;b>h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i=new Ib(c,a,null,!0),j=new Ib(c,null,i,!1);i.o=j,f.push(i),g.push(j),i=new Ib(d,a,null,!1),j=new Ib(d,null,i,!0),i.o=j,f.push(i),g.push(j)}}),g.sort(b),Hb(f),Hb(g),f.length){for(var h=0,i=c,j=g.length;j>h;++h)g[h].e=i=!i;for(var k,l,m=f[0];;){for(var n=m,o=!0;n.v;)if((n=n.n)===m)return;k=n.z,e.lineStart();do{if(n.v=n.o.v=!0,n.e){if(o)for(var h=0,j=k.length;j>h;++h)e.point((l=k[h])[0],l[1]);else d(n.x,n.n.x,1,e);n=n.n}else{if(o){k=n.p.z;for(var h=k.length-1;h>=0;--h)e.point((l=k[h])[0],l[1])}else d(n.x,n.p.x,-1,e);n=n.p}n=n.o,k=n.z,o=!o}while(!n.v);e.lineEnd()}}}function Hb(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d<b;)e.n=c=a[d],c.p=e,e=c;e.n=c=a[0],c.p=e}}function Ib(a,b,c,d){this.x=a,this.z=b,this.o=c,this.e=d,this.v=!1,this.n=this.p=null}function Jb(a,b,c,d){return function(e,f){function g(b,c){var d=e(b,c);a(b=d[0],c=d[1])&&f.point(b,c)}function h(a,b){var c=e(a,b);q.point(c[0],c[1])}function i(){s.point=h,q.lineStart()}function j(){s.point=g,q.lineEnd()}function k(a,b){p.push([a,b]);var c=e(a,b);u.point(c[0],c[1])}function l(){u.lineStart(),p=[]}function m(){k(p[0][0],p[0][1]),u.lineEnd();var a,b=u.clean(),c=t.buffer(),d=c.length;if(p.pop(),o.push(p),p=null,d)if(1&b){a=c[0];var e,d=a.length-1,g=-1;if(d>0){for(v||(f.polygonStart(),v=!0),f.lineStart();++g<d;)f.point((e=a[g])[0],e[1]);f.lineEnd()}}else d>1&&2&b&&c.push(c.pop().concat(c.shift())),n.push(c.filter(Kb))}var n,o,p,q=b(f),r=e.invert(d[0],d[1]),s={point:g,lineStart:i,lineEnd:j,polygonStart:function(){s.point=k,s.lineStart=l,s.lineEnd=m,n=[],o=[]},polygonEnd:function(){s.point=g,s.lineStart=i,s.lineEnd=j,n=jg.merge(n);var a=Qb(r,o);n.length?(v||(f.polygonStart(),v=!0),Gb(n,Mb,a,c,f)):a&&(v||(f.polygonStart(),v=!0),f.lineStart(),c(null,null,1,f),f.lineEnd()),v&&(f.polygonEnd(),v=!1),n=o=null},sphere:function(){f.polygonStart(),f.lineStart(),c(null,null,1,f),f.lineEnd(),f.polygonEnd()}},t=Lb(),u=b(t),v=!1;return s}}function Kb(a){return a.length>1}function Lb(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){ 27 a.push([b,c])},lineEnd:x,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function Mb(a,b){return((a=a.x)[0]<0?a[1]-Qg-Lg:Qg-a[1])-((b=b.x)[0]<0?b[1]-Qg-Lg:Qg-b[1])}function Nb(a){var b,c=NaN,d=NaN,e=NaN;return{lineStart:function(){a.lineStart(),b=1},point:function(f,g){var h=f>0?Ng:-Ng,i=vg(f-c);vg(i-Ng)<Lg?(a.point(c,d=(d+g)/2>0?Qg:-Qg),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Ng&&(vg(c-e)<Lg&&(c-=e*Lg),vg(f-h)<Lg&&(f-=h*Lg),d=Ob(c,d,f,g),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),b=0),a.point(c=f,d=g),e=h},lineEnd:function(){a.lineEnd(),c=d=NaN},clean:function(){return 2-b}}}function Ob(a,b,c,d){var e,f,g=Math.sin(a-c);return vg(g)>Lg?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function Pb(a,b,c,d){var e;if(null==a)e=c*Qg,d.point(-Ng,e),d.point(0,e),d.point(Ng,e),d.point(Ng,0),d.point(Ng,-e),d.point(0,-e),d.point(-Ng,-e),d.point(-Ng,0),d.point(-Ng,e);else if(vg(a[0]-b[0])>Lg){var f=a[0]<b[0]?Ng:-Ng;e=c*f/2,d.point(-f,e),d.point(0,e),d.point(f,e)}else d.point(b[0],b[1])}function Qb(a,b){var c=a[0],d=a[1],e=[Math.sin(c),-Math.cos(c),0],f=0,g=0;zh.reset();for(var h=0,i=b.length;i>h;++h){var j=b[h],k=j.length;if(k)for(var l=j[0],m=l[0],n=l[1]/2+Ng/4,o=Math.sin(n),p=Math.cos(n),q=1;;){q===k&&(q=0),a=j[q];var r=a[0],s=a[1]/2+Ng/4,t=Math.sin(s),u=Math.cos(s),v=r-m,w=v>=0?1:-1,x=w*v,y=x>Ng,z=o*t;if(zh.add(Math.atan2(z*w*Math.sin(x),p*u+z*Math.cos(x))),f+=y?v+w*Og:v,y^m>=c^r>=c){var A=tb(rb(l),rb(a));wb(A);var B=tb(e,A);wb(B);var C=(y^v>=0?-1:1)*da(B[2]);(d>C||d===C&&(A[0]||A[1]))&&(g+=y^v>=0?1:-1)}if(!q++)break;m=r,o=t,p=u,l=a}}return(-Lg>f||Lg>f&&0>zh)^1&g}function Rb(a){function b(a,b){return Math.cos(a)*Math.cos(b)>f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Ng:-Ng),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(yb(c,n)||yb(o,n))&&(o[0]+=Lg,o[1]+=Lg,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&yb(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=rb(a),e=rb(b),g=[1,0,0],h=tb(d,e),i=sb(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=tb(g,h),o=vb(g,l),p=vb(h,m);ub(o,p);var q=n,r=sb(o,q),s=sb(q,q),t=r*r-s*(sb(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=vb(q,(-r-u)/s);if(ub(v,o),v=xb(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=vg(B-Ng)<Lg,D=C||Lg>B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(vg(v[0]-x)<Lg?z:A):z<=v[1]&&v[1]<=A:B>Ng^(x<=v[0]&&v[0]<=y)){var E=vb(q,(-r+u)/s);return ub(E,o),[v,xb(E)]}}}function e(b,c){var d=g?a:Ng-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=vg(f)>Lg,i=qc(a,6*Rg);return Jb(b,c,i,g?[0,-a]:[-Ng,a-Ng])}function Sb(a,b,c,d){return function(e){var f,g=e.a,h=e.b,i=g.x,j=g.y,k=h.x,l=h.y,m=0,n=1,o=k-i,p=l-j;if(f=a-i,o||!(f>0)){if(f/=o,0>o){if(m>f)return;n>f&&(n=f)}else if(o>0){if(f>n)return;f>m&&(m=f)}if(f=c-i,o||!(0>f)){if(f/=o,0>o){if(f>n)return;f>m&&(m=f)}else if(o>0){if(m>f)return;n>f&&(n=f)}if(f=b-j,p||!(f>0)){if(f/=p,0>p){if(m>f)return;n>f&&(n=f)}else if(p>0){if(f>n)return;f>m&&(m=f)}if(f=d-j,p||!(0>f)){if(f/=p,0>p){if(f>n)return;f>m&&(m=f)}else if(p>0){if(m>f)return;n>f&&(n=f)}return m>0&&(e.a={x:i+m*o,y:j+m*p}),1>n&&(e.b={x:i+n*o,y:j+n*p}),e}}}}}}function Tb(a,b,c,d){function e(d,e){return vg(d[0]-a)<Lg?e>0?0:3:vg(d[0]-c)<Lg?e>0?2:1:vg(d[1]-b)<Lg?e>0?1:0:e>0?3:2}function f(a,b){return g(a.x,b.x)}function g(a,b){var c=e(a,1),d=e(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}return function(h){function i(a){for(var b=0,c=q.length,d=a[1],e=0;c>e;++e)for(var f,g=1,h=q[e],i=h.length,j=h[0];i>g;++g)f=h[g],j[1]<=d?f[1]>d&&ba(j,f,a)>0&&++b:f[1]<=d&&ba(j,f,a)<0&&--b,j=f;return 0!==b}function j(f,h,i,j){var k=0,l=0;if(null==f||(k=e(f,i))!==(l=e(h,i))||g(f,h)<0^i>0){do j.point(0===k||3===k?a:c,k>1?d:b);while((k=(k+i+4)%4)!==l)}else j.point(h[0],h[1])}function k(e,f){return e>=a&&c>=e&&f>=b&&d>=f}function l(a,b){k(a,b)&&h.point(a,b)}function m(){D.point=o,q&&q.push(r=[]),y=!0,x=!1,v=w=NaN}function n(){p&&(o(s,t),u&&x&&B.rejoin(),p.push(B.buffer())),D.point=l,x&&h.lineEnd()}function o(a,b){a=Math.max(-Oh,Math.min(Oh,a)),b=Math.max(-Oh,Math.min(Oh,b));var c=k(a,b);if(q&&r.push([a,b]),y)s=a,t=b,u=c,y=!1,c&&(h.lineStart(),h.point(a,b));else if(c&&x)h.point(a,b);else{var d={a:{x:v,y:w},b:{x:a,y:b}};C(d)?(x||(h.lineStart(),h.point(d.a.x,d.a.y)),h.point(d.b.x,d.b.y),c||h.lineEnd(),z=!1):c&&(h.lineStart(),h.point(a,b),z=!1)}v=a,w=b,x=c}var p,q,r,s,t,u,v,w,x,y,z,A=h,B=Lb(),C=Sb(a,b,c,d),D={point:l,lineStart:m,lineEnd:n,polygonStart:function(){h=B,p=[],q=[],z=!0},polygonEnd:function(){h=A,p=jg.merge(p);var b=i([a,d]),c=z&&b,e=p.length;(c||e)&&(h.polygonStart(),c&&(h.lineStart(),j(null,null,1,h),h.lineEnd()),e&&Gb(p,f,b,j,h),h.polygonEnd()),p=q=r=null}};return D}}function Ub(a){var b=0,c=Ng/3,d=ic(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Ng/180,c=a[1]*Ng/180):[b/Ng*180,c/Ng*180]},e}function Vb(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,da((f-(a*a+c*c)*e*e)/(2*e))]},c}function Wb(){function a(a,b){Qh+=e*a-d*b,d=a,e=b}var b,c,d,e;Vh.point=function(f,g){Vh.point=a,b=d=f,c=e=g},Vh.lineEnd=function(){a(b,c)}}function Xb(a,b){Rh>a&&(Rh=a),a>Th&&(Th=a),Sh>b&&(Sh=b),b>Uh&&(Uh=b)}function Yb(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Zb(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d,h.point=a},pointRadius:function(a){return f=Zb(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function Zb(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function $b(a,b){Dh+=a,Eh+=b,++Fh}function _b(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);Gh+=g*(b+a)/2,Hh+=g*(c+d)/2,Ih+=g,$b(b=a,c=d)}var b,c;Xh.point=function(d,e){Xh.point=a,$b(b=d,c=e)}}function ac(){Xh.point=$b}function bc(){function a(a,b){var c=a-d,f=b-e,g=Math.sqrt(c*c+f*f);Gh+=g*(d+a)/2,Hh+=g*(e+b)/2,Ih+=g,g=e*a-d*b,Jh+=g*(d+a),Kh+=g*(e+b),Lh+=3*g,$b(d=a,e=b)}var b,c,d,e;Xh.point=function(f,g){Xh.point=a,$b(b=d=f,c=e=g)},Xh.lineEnd=function(){a(b,c)}}function cc(a){function b(b,c){a.moveTo(b+g,c),a.arc(b,c,g,0,Og)}function c(b,c){a.moveTo(b,c),h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e,h.point=b},pointRadius:function(a){return g=a,h},result:x};return h}function dc(a){function b(a){return(h?d:c)(a)}function c(b){return gc(b,function(c,d){c=a(c,d),b.point(c[0],c[1])})}function d(b){function c(c,d){c=a(c,d),b.point(c[0],c[1])}function d(){t=NaN,y.point=f,b.lineStart()}function f(c,d){var f=rb([c,d]),g=a(c,d);e(t,u,s,v,w,x,t=g[0],u=g[1],s=c,v=f[0],w=f[1],x=f[2],h,b),b.point(t,u)}function g(){y.point=c,b.lineEnd()}function i(){d(),y.point=j,y.lineEnd=k}function j(a,b){f(l=a,m=b),n=t,o=u,p=v,q=w,r=x,y.point=f}function k(){e(t,u,s,v,w,x,n,o,l,p,q,r,h,b),y.lineEnd=g,g()}var l,m,n,o,p,q,r,s,t,u,v,w,x,y={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart(),y.lineStart=i},polygonEnd:function(){b.polygonEnd(),y.lineStart=d}};return y}function e(b,c,d,h,i,j,k,l,m,n,o,p,q,r){var s=k-b,t=l-c,u=s*s+t*t;if(u>4*f&&q--){var v=h+n,w=i+o,x=j+p,y=Math.sqrt(v*v+w*w+x*x),z=Math.asin(x/=y),A=vg(vg(x)-1)<Lg||vg(d-m)<Lg?(d+m)/2:Math.atan2(w,v),B=a(A,z),C=B[0],D=B[1],E=C-b,F=D-c,G=t*E-s*F;(G*G/u>f||vg((s*E+t*F)/u-.5)>.3||g>h*n+i*o+j*p)&&(e(b,c,d,h,i,j,C,D,A,v/=y,w/=y,x,q,r),r.point(C,D),e(C,D,A,v,w,x,k,l,m,n,o,p,q,r))}}var f=.5,g=Math.cos(30*Rg),h=16;return b.precision=function(a){return arguments.length?(h=(f=a*a)>0&&16,b):Math.sqrt(f)},b}function ec(a){var b=dc(function(b,c){return a([b*Sg,c*Sg])});return function(a){return jc(b(a))}}function fc(a){this.stream=a}function gc(a,b){return{point:b,sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}function hc(a){return ic(function(){return a})()}function ic(a){function b(a){return a=h(a[0]*Rg,a[1]*Rg),[a[0]*m+i,j-a[1]*m]}function c(a){return a=h.invert((a[0]-i)/m,(j-a[1])/m),a&&[a[0]*Sg,a[1]*Sg]}function d(){h=Eb(g=mc(r,s,t),f);var a=f(p,q);return i=n-a[0]*m,j=o+a[1]*m,e()}function e(){return k&&(k.valid=!1,k=null),b}var f,g,h,i,j,k,l=dc(function(a,b){return a=f(a,b),[a[0]*m+i,j-a[1]*m]}),m=150,n=480,o=250,p=0,q=0,r=0,s=0,t=0,v=Nh,w=u,x=null,y=null;return b.stream=function(a){return k&&(k.valid=!1),k=jc(v(g,l(w(a)))),k.valid=!0,k},b.clipAngle=function(a){return arguments.length?(v=null==a?(x=a,Nh):Rb((x=+a)*Rg),e()):x},b.clipExtent=function(a){return arguments.length?(y=a,w=a?Tb(a[0][0],a[0][1],a[1][0],a[1][1]):u,e()):y},b.scale=function(a){return arguments.length?(m=+a,d()):m},b.translate=function(a){return arguments.length?(n=+a[0],o=+a[1],d()):[n,o]},b.center=function(a){return arguments.length?(p=a[0]%360*Rg,q=a[1]%360*Rg,d()):[p*Sg,q*Sg]},b.rotate=function(a){return arguments.length?(r=a[0]%360*Rg,s=a[1]%360*Rg,t=a.length>2?a[2]%360*Rg:0,d()):[r*Sg,s*Sg,t*Sg]},jg.rebind(b,l,"precision"),function(){return f=a.apply(this,arguments),b.invert=f.invert&&c,d()}}function jc(a){return gc(a,function(b,c){a.point(b*Rg,c*Rg)})}function kc(a,b){return[a,b]}function lc(a,b){return[a>Ng?a-Og:-Ng>a?a+Og:a,b]}function mc(a,b,c){return a?b||c?Eb(oc(a),pc(b,c)):oc(a):b||c?pc(b,c):lc}function nc(a){return function(b,c){return b+=a,[b>Ng?b-Og:-Ng>b?b+Og:b,c]}}function oc(a){var b=nc(a);return b.invert=nc(-a),b}function pc(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),da(k*f+i*g)]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),da(k*d-h*e)]},c}function qc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var i=g*b;null!=e?(e=rc(c,e),f=rc(c,f),(g>0?f>e:e>f)&&(e+=g*Og)):(e=a+g*Og,f=a-.5*i);for(var j,k=e;g>0?k>f:f>k;k-=i)h.point((j=xb([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],j[1])}}function rc(a,b){var c=rb(b);c[0]-=a,wb(c);var d=ca(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Lg)%(2*Math.PI)}function sc(a,b,c){var d=jg.range(a,b-Lg,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function tc(a,b,c){var d=jg.range(a,b-Lg,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function uc(a){return a.source}function vc(a){return a.target}function wc(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(ha(d-b)+e*g*ha(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Sg,Math.atan2(g,Math.sqrt(d*d+e*e))*Sg]}:function(){return[a*Sg,b*Sg]};return o.distance=m,o}function xc(){function a(a,e){var f=Math.sin(e*=Rg),g=Math.cos(e),h=vg((a*=Rg)-b),i=Math.cos(h);Yh+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;Zh.point=function(e,f){b=e*Rg,c=Math.sin(f*=Rg),d=Math.cos(f),Zh.point=a},Zh.lineEnd=function(){Zh.point=Zh.lineEnd=x}}function yc(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function zc(a,b){function c(a,b){g>0?-Qg+Lg>b&&(b=-Qg+Lg):b>Qg-Lg&&(b=Qg-Lg);var c=g/Math.pow(e(b),f);return[c*Math.sin(f*a),g-c*Math.cos(f*a)]}var d=Math.cos(a),e=function(a){return Math.tan(Ng/4+a/2)},f=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(e(b)/e(a)),g=d*Math.pow(e(a),f)/f;return f?(c.invert=function(a,b){var c=g-b,d=aa(f)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/f,2*Math.atan(Math.pow(g/d,1/f))-Qg]},c):Bc}function Ac(a,b){function c(a,b){var c=f-b;return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;return vg(e)<Lg?kc:(c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-aa(e)*Math.sqrt(a*a+c*c)]},c)}function Bc(a,b){return[a,Math.log(Math.tan(Ng/4+b/2))]}function Cc(a){var b,c=hc(a),d=c.scale,e=c.translate,f=c.clipExtent;return c.scale=function(){var a=d.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.translate=function(){var a=e.apply(c,arguments);return a===c?b?c.clipExtent(null):c:a},c.clipExtent=function(a){var g=f.apply(c,arguments);if(g===c){if(b=null==a){var h=Ng*d(),i=e();f([[i[0]-h,i[1]-h],[i[0]+h,i[1]+h]])}}else b&&(g=null);return g},c.clipExtent(null)}function Dc(a,b){return[Math.log(Math.tan(Ng/4+b/2)),-a]}function Ec(a){return a[0]}function Fc(a){return a[1]}function Gc(a){for(var b=a.length,c=[0,1],d=2,e=2;b>e;e++){for(;d>1&&ba(a[c[d-2]],a[c[d-1]],a[e])<=0;)--d;c[d++]=e}return c.slice(0,d)}function Hc(a,b){return a[0]-b[0]||a[1]-b[1]}function Ic(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Jc(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function Kc(a){var b=a[0],c=a[a.length-1];return!(b[0]-c[0]||b[1]-c[1])}function Lc(){ed(this),this.edge=this.site=this.circle=null}function Mc(a){var b=ji.pop()||new Lc;return b.site=a,b}function Nc(a){Xc(a),gi.remove(a),ji.push(a),ed(a)}function Oc(a){var b=a.circle,c=b.x,d=b.cy,e={x:c,y:d},f=a.P,g=a.N,h=[a];Nc(a);for(var i=f;i.circle&&vg(c-i.circle.x)<Lg&&vg(d-i.circle.cy)<Lg;)f=i.P,h.unshift(i),Nc(i),i=f;h.unshift(i),Xc(i);for(var j=g;j.circle&&vg(c-j.circle.x)<Lg&&vg(d-j.circle.cy)<Lg;)g=j.N,h.push(j),Nc(j),j=g;h.push(j),Xc(j);var k,l=h.length;for(k=1;l>k;++k)j=h[k],i=h[k-1],bd(j.edge,i.site,j.site,e);i=h[0],j=h[l-1],j.edge=_c(i.site,j.site,null,e),Wc(i),Wc(j)}function Pc(a){for(var b,c,d,e,f=a.x,g=a.y,h=gi._;h;)if(d=Qc(h,g)-f,d>Lg)h=h.L;else{if(e=f-Rc(h,g),!(e>Lg)){d>-Lg?(b=h.P,c=h):e>-Lg?(b=h,c=h.N):b=c=h;break}if(!h.R){b=h;break}h=h.R}var i=Mc(a);if(gi.insert(b,i),b||c){if(b===c)return Xc(b),c=Mc(b.site),gi.insert(i,c),i.edge=c.edge=_c(b.site,i.site),Wc(b),void Wc(c);if(!c)return void(i.edge=_c(b.site,i.site));Xc(b),Xc(c);var j=b.site,k=j.x,l=j.y,m=a.x-k,n=a.y-l,o=c.site,p=o.x-k,q=o.y-l,r=2*(m*q-n*p),s=m*m+n*n,t=p*p+q*q,u={x:(q*s-n*t)/r+k,y:(m*t-p*s)/r+l};bd(c.edge,j,o,u),i.edge=_c(j,a,null,u),c.edge=_c(a,o,null,u),Wc(b),Wc(c)}}function Qc(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d;var g=a.P;if(!g)return-(1/0);c=g.site;var h=c.x,i=c.y,j=i-b;if(!j)return h;var k=h-d,l=1/f-1/j,m=k/j;return l?(-m+Math.sqrt(m*m-2*l*(k*k/(-2*j)-i+j/2+e-f/2)))/l+d:(d+h)/2}function Rc(a,b){var c=a.N;if(c)return Qc(c,b);var d=a.site;return d.y===b?d.x:1/0}function Sc(a){this.site=a,this.edges=[]}function Tc(a){for(var b,c,d,e,f,g,h,i,j,k,l=a[0][0],m=a[1][0],n=a[0][1],o=a[1][1],p=fi,q=p.length;q--;)if(f=p[q],f&&f.prepare())for(h=f.edges,i=h.length,g=0;i>g;)k=h[g].end(),d=k.x,e=k.y,j=h[++g%i].start(),b=j.x,c=j.y,(vg(d-b)>Lg||vg(e-c)>Lg)&&(h.splice(g,0,new cd(ad(f.site,k,vg(d-l)<Lg&&o-e>Lg?{x:l,y:vg(b-l)<Lg?c:o}:vg(e-o)<Lg&&m-d>Lg?{x:vg(c-o)<Lg?b:m,y:o}:vg(d-m)<Lg&&e-n>Lg?{x:m,y:vg(b-m)<Lg?c:n}:vg(e-n)<Lg&&d-l>Lg?{x:vg(c-n)<Lg?b:l,y:n}:null),f.site,null)),++i)}function Uc(a,b){return b.angle-a.angle}function Vc(){ed(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wc(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,e=a.site,f=c.site;if(d!==f){var g=e.x,h=e.y,i=d.x-g,j=d.y-h,k=f.x-g,l=f.y-h,m=2*(i*l-j*k);if(!(m>=-Mg)){var n=i*i+j*j,o=k*k+l*l,p=(l*n-j*o)/m,q=(i*o-k*n)/m,l=q+h,r=ki.pop()||new Vc;r.arc=a,r.site=e,r.x=p+g,r.y=l+Math.sqrt(p*p+q*q),r.cy=l,a.circle=r;for(var s=null,t=ii._;t;)if(r.y<t.y||r.y===t.y&&r.x<=t.x){if(!t.L){s=t.P;break}t=t.L}else{if(!t.R){s=t;break}t=t.R}ii.insert(s,r),s||(hi=r)}}}}function Xc(a){var b=a.circle;b&&(b.P||(hi=b.N),ii.remove(b),ki.push(b),ed(b),a.circle=null)}function Yc(a){for(var b,c=ei,d=Sb(a[0][0],a[0][1],a[1][0],a[1][1]),e=c.length;e--;)b=c[e],(!Zc(b,a)||!d(b)||vg(b.a.x-b.b.x)<Lg&&vg(b.a.y-b.b.y)<Lg)&&(b.a=b.b=null,c.splice(e,1))}function Zc(a,b){var c=a.b;if(c)return!0;var d,e,f=a.a,g=b[0][0],h=b[1][0],i=b[0][1],j=b[1][1],k=a.l,l=a.r,m=k.x,n=k.y,o=l.x,p=l.y,q=(m+o)/2,r=(n+p)/2;if(p===n){if(g>q||q>=h)return;if(m>o){if(f){if(f.y>=j)return}else f={x:q,y:i};c={x:q,y:j}}else{if(f){if(f.y<i)return}else f={x:q,y:j};c={x:q,y:i}}}else if(d=(m-o)/(p-n),e=r-d*q,-1>d||d>1)if(m>o){if(f){if(f.y>=j)return}else f={x:(i-e)/d,y:i};c={x:(j-e)/d,y:j}}else{if(f){if(f.y<i)return}else f={x:(j-e)/d,y:j};c={x:(i-e)/d,y:i}}else if(p>n){if(f){if(f.x>=h)return}else f={x:g,y:d*g+e};c={x:h,y:d*h+e}}else{if(f){if(f.x<g)return}else f={x:h,y:d*h+e};c={x:g,y:d*g+e}}return a.a=f,a.b=c,!0}function $c(a,b){this.l=a,this.r=b,this.a=this.b=null}function _c(a,b,c,d){var e=new $c(a,b);return ei.push(e),c&&bd(e,a,b,c),d&&bd(e,b,a,d),fi[a.i].edges.push(new cd(e,a,b)),fi[b.i].edges.push(new cd(e,b,a)),e}function ad(a,b,c){var d=new $c(a,null);return d.a=b,d.b=c,ei.push(d),d}function bd(a,b,c,d){a.a||a.b?a.l===c?a.b=d:a.a=d:(a.a=d,a.l=b,a.r=c)}function cd(a,b,c){var d=a.a,e=a.b;this.edge=a,this.site=b,this.angle=c?Math.atan2(c.y-b.y,c.x-b.x):a.l===b?Math.atan2(e.x-d.x,d.y-e.y):Math.atan2(d.x-e.x,e.y-d.y)}function dd(){this._=null}function ed(a){a.U=a.C=a.L=a.R=a.P=a.N=null}function fd(a,b){var c=b,d=b.R,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.R=d.L,c.R&&(c.R.U=c),d.L=c}function gd(a,b){var c=b,d=b.L,e=c.U;e?e.L===c?e.L=d:e.R=d:a._=d,d.U=e,c.U=d,c.L=d.R,c.L&&(c.L.U=c),d.R=c}function hd(a){for(;a.L;)a=a.L;return a}function id(a,b){var c,d,e,f=a.sort(jd).pop();for(ei=[],fi=new Array(a.length),gi=new dd,ii=new dd;;)if(e=hi,f&&(!e||f.y<e.y||f.y===e.y&&f.x<e.x))f.x===c&&f.y===d||(fi[f.i]=new Sc(f),Pc(f),c=f.x,d=f.y),f=a.pop();else{if(!e)break;Oc(e.arc)}b&&(Yc(b),Tc(b));var g={cells:fi,edges:ei};return gi=ii=ei=fi=null,g}function jd(a,b){return b.y-a.y||b.x-a.x}function kd(a,b,c){return(a.x-c.x)*(b.y-a.y)-(a.x-b.x)*(c.y-a.y)}function ld(a){return a.x}function md(a){return a.y}function nd(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function od(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&od(a,i[0],c,d,g,h),i[1]&&od(a,i[1],g,d,e,h),i[2]&&od(a,i[2],c,h,g,f),i[3]&&od(a,i[3],g,h,e,f)}}function pd(a,b,c,d,e,f,g){var h,i=1/0;return function j(a,k,l,m,n){if(!(k>f||l>g||d>m||e>n)){if(o=a.point){var o,p=b-a.x,q=c-a.y,r=p*p+q*q;if(i>r){var s=Math.sqrt(i=r);d=b-s,e=c-s,f=b+s,g=c+s,h=o}}for(var t=a.nodes,u=.5*(k+m),v=.5*(l+n),w=b>=u,x=c>=v,y=x<<1|w,z=y+4;z>y;++y)if(a=t[3&y])switch(3&y){case 0:j(a,k,l,u,v);break;case 1:j(a,u,l,m,v);break;case 2:j(a,k,v,u,n);break;case 3:j(a,u,v,m,n)}}}(a,d,e,f,g),h}function qd(a,b){a=jg.rgb(a),b=jg.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+wa(Math.round(c+f*a))+wa(Math.round(d+g*a))+wa(Math.round(e+h*a))}}function rd(a,b){var c,d={},e={};for(c in a)c in b?d[c]=ud(a[c],b[c]):e[c]=a[c];for(c in b)c in a||(e[c]=b[c]);return function(a){for(c in d)e[c]=d[c](a);return e}}function sd(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}}function td(a,b){var c,d,e,f=mi.lastIndex=ni.lastIndex=0,g=-1,h=[],i=[];for(a+="",b+="";(c=mi.exec(a))&&(d=ni.exec(b));)(e=d.index)>f&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:sd(c,d)})),f=ni.lastIndex;return f<b.length&&(e=b.slice(f),h[g]?h[g]+=e:h[++g]=e),h.length<2?i[0]?(b=i[0].x,function(a){return b(a)+""}):function(){return b}:(b=i.length,function(a){for(var c,d=0;b>d;++d)h[(c=i[d]).i]=c.x(a);return h.join("")})}function ud(a,b){for(var c,d=jg.interpolators.length;--d>=0&&!(c=jg.interpolators[d](a,b)););return c}function vd(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(ud(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}}function wd(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function xd(a){return function(b){return 1-a(1-b)}}function yd(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function zd(a){return a*a}function Ad(a){return a*a*a}function Bd(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function Cd(a){return function(b){return Math.pow(b,a)}}function Dd(a){return 1-Math.cos(a*Qg)}function Ed(a){return Math.pow(2,10*(a-1))}function Fd(a){return 1-Math.sqrt(1-a*a)}function Gd(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/Og*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*Og/b)}}function Hd(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Id(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Jd(a,b){a=jg.hcl(a),b=jg.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.c:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ma(c+f*a,d+g*a,e+h*a)+""}}function Kd(a,b){a=jg.hsl(a),b=jg.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return isNaN(g)&&(g=0,d=isNaN(d)?b.s:d),isNaN(f)?(f=0,c=isNaN(c)?b.h:c):f>180?f-=360:-180>f&&(f+=360),function(a){return ka(c+f*a,d+g*a,e+h*a)+""}}function Ld(a,b){a=jg.lab(a),b=jg.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return oa(c+f*a,d+g*a,e+h*a)+""}}function Md(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function Nd(a){var b=[a.a,a.b],c=[a.c,a.d],d=Pd(b),e=Od(b,c),f=Pd(Qd(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*Sg,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*Sg:0}function Od(a,b){return a[0]*b[0]+a[1]*b[1]}function Pd(a){var b=Math.sqrt(Od(a,a));return b&&(a[0]/=b,a[1]/=b),b}function Qd(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function Rd(a){return a.length?a.pop()+",":""}function Sd(a,b,c,d){if(a[0]!==b[0]||a[1]!==b[1]){var e=c.push("translate(",null,",",null,")");d.push({i:e-4,x:sd(a[0],b[0])},{i:e-2,x:sd(a[1],b[1])})}else(b[0]||b[1])&&c.push("translate("+b+")")}function Td(a,b,c,d){a!==b?(a-b>180?b+=360:b-a>180&&(a+=360),d.push({i:c.push(Rd(c)+"rotate(",null,")")-2,x:sd(a,b)})):b&&c.push(Rd(c)+"rotate("+b+")")}function Ud(a,b,c,d){a!==b?d.push({i:c.push(Rd(c)+"skewX(",null,")")-2,x:sd(a,b)}):b&&c.push(Rd(c)+"skewX("+b+")")}function Vd(a,b,c,d){if(a[0]!==b[0]||a[1]!==b[1]){var e=c.push(Rd(c)+"scale(",null,",",null,")");d.push({i:e-4,x:sd(a[0],b[0])},{i:e-2,x:sd(a[1],b[1])})}else 1===b[0]&&1===b[1]||c.push(Rd(c)+"scale("+b+")")}function Wd(a,b){var c=[],d=[];return a=jg.transform(a),b=jg.transform(b),Sd(a.translate,b.translate,c,d),Td(a.rotate,b.rotate,c,d),Ud(a.skew,b.skew,c,d),Vd(a.scale,b.scale,c,d),a=b=null,function(a){for(var b,e=-1,f=d.length;++e<f;)c[(b=d[e]).i]=b.x(a);return c.join("")}}function Xd(a,b){return b=(b-=a=+a)||1/b,function(c){return(c-a)/b}}function Yd(a,b){return b=(b-=a=+a)||1/b,function(c){return Math.max(0,Math.min(1,(c-a)/b))}}function Zd(a){for(var b=a.source,c=a.target,d=_d(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function $d(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function _d(a,b){if(a===b)return a;for(var c=$d(a),d=$d(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function ae(a){a.fixed|=2}function be(a){a.fixed&=-7}function ce(a){a.fixed|=4,a.px=a.x,a.py=a.y}function de(a){a.fixed&=-5}function ee(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++i<h;)f=g[i],null!=f&&(ee(f,b,c),a.charge+=f.charge,d+=f.charge*f.cx,e+=f.charge*f.cy);if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function fe(a,b){return jg.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=le,a}function ge(a,b){for(var c=[a];null!=(a=c.pop());)if(b(a),(e=a.children)&&(d=e.length))for(var d,e;--d>=0;)c.push(e[d])}function he(a,b){for(var c=[a],d=[];null!=(a=c.pop());)if(d.push(a),(f=a.children)&&(e=f.length))for(var e,f,g=-1;++g<e;)c.push(f[g]);for(;null!=(a=d.pop());)b(a)}function ie(a){return a.children}function je(a){return a.value}function ke(a,b){return b.value-a.value}function le(a){return jg.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function me(a){return a.x}function ne(a){return a.y}function oe(a,b,c){a.y0=b,a.y=c}function pe(a){return jg.range(a.length)}function qe(a){for(var b=-1,c=a[0].length,d=[];++b<c;)d[b]=0;return d}function re(a){for(var b,c=1,d=0,e=a[0][1],f=a.length;f>c;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function se(a){return a.reduce(te,0)}function te(a,b){return a+b[1]}function ue(a,b){return ve(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ve(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function we(a){return[jg.min(a),jg.max(a)]}function xe(a,b){return a.value-b.value}function ye(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function ze(a,b){a._pack_next=b,b._pack_prev=a}function Ae(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function Be(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-(1/0),m=1/0,n=-(1/0);if(c.forEach(Ce),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],Fe(d,e,f),b(f),ye(d,f),d._pack_prev=f,ye(f,e),e=d._pack_next,g=3;j>g;g++){Fe(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(Ae(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!Ae(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.r<d.r?ze(d,e=h):ze(d=i,e),g--):(ye(d,f),e=f,b(f))}var r=(k+l)/2,s=(m+n)/2,t=0;for(g=0;j>g;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(De)}}function Ce(a){a._pack_next=a._pack_prev=a}function De(a){delete a._pack_next,delete a._pack_prev}function Ee(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e)for(var f=-1,g=e.length;++f<g;)Ee(e[f],b,c,d)}function Fe(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f;g*=g,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function Ge(a,b){return a.parent==b.parent?1:2}function He(a){var b=a.children;return b.length?b[0]:a.t}function Ie(a){var b,c=a.children;return(b=c.length)?c[b-1]:a.t}function Je(a,b,c){var d=c/(b.i-a.i);b.c-=d,b.s+=c,a.c+=d,b.z+=c,b.m+=c}function Ke(a){for(var b,c=0,d=0,e=a.children,f=e.length;--f>=0;)b=e[f],b.z+=c,b.m+=c,c+=b.s+(d+=b.c)}function Le(a,b,c){return a.a.parent===b.parent?a.a:c}function Me(a){return 1+jg.max(a,function(a){return a.y})}function Ne(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function Oe(a){var b=a.children;return b&&b.length?Oe(b[0]):a}function Pe(a){var b,c=a.children;return c&&(b=c.length)?Pe(c[b-1]):a}function Qe(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function Re(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return 0>e&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function Se(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function Te(a){return a.rangeExtent?a.rangeExtent():Se(a.range())}function Ue(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function Ve(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),a[d]=b.floor(f),a[e]=b.ceil(g),a}function We(a){return a?{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}:yi}function Xe(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());++g<=h;)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=jg.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function Ye(a,b,c,d){function e(){var e=Math.min(a.length,b.length)>2?Xe:Ue,i=d?Yd:Xd;return g=e(a,b,i,c),h=e(b,a,i,ud),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(Md)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?(c=a,e()):c},f.ticks=function(b){return af(a,b)},f.tickFormat=function(b,c){return bf(a,b,c)},f.nice=function(b){return $e(a,b),e()},f.copy=function(){return Ye(a,b,c,d)},e()}function Ze(a,b){return jg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function $e(a,b){return Ve(a,We(_e(a,b)[2])),Ve(a,We(_e(a,b)[2])),a}function _e(a,b){null==b&&(b=10);var c=Se(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function af(a,b){return jg.range.apply(jg,_e(a,b))}function bf(a,b,c){var d=_e(a,b);if(c){var e=mh.exec(c);if(e.shift(),"s"===e[8]){var f=jg.formatPrefix(Math.max(vg(d[0]),vg(d[1])));return e[7]||(e[7]="."+cf(f.scale(d[2]))),e[8]="f",c=jg.format(e.join("")),function(a){return c(f.scale(a))+f.symbol}}e[7]||(e[7]="."+df(e[8],d)),c=e.join("")}else c=",."+cf(d[2])+"f";return jg.format(c)}function cf(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function df(a,b){var c=cf(b[2]);return a in zi?Math.abs(c-cf(Math.max(vg(b[0]),vg(b[1]))))+ +("e"!==a):c-2*("%"===a)}function ef(a,b,c,d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(a>0?0:-a))/Math.log(b)}function f(a){return c?Math.pow(b,a):-Math.pow(b,-a)}function g(b){return a(e(b))}return g.invert=function(b){return f(a.invert(b))},g.domain=function(b){return arguments.length?(c=b[0]>=0,a.domain((d=b.map(Number)).map(e)),g):d},g.base=function(c){return arguments.length?(b=+c,a.domain(d.map(e)),g):b},g.nice=function(){var b=Ve(d.map(e),c?Math:Bi);return a.domain(b),d=b.map(f),g},g.ticks=function(){var a=Se(d),g=[],h=a[0],i=a[1],j=Math.floor(e(h)),k=Math.ceil(e(i)),l=b%1?2:b;if(isFinite(k-j)){if(c){for(;k>j;j++)for(var m=1;l>m;m++)g.push(f(j)*m);g.push(f(j))}else for(g.push(f(j));j++<k;)for(var m=l-1;m>0;m--)g.push(f(j)*m);for(j=0;g[j]<h;j++);for(k=g.length;g[k-1]>i;k--);g=g.slice(j,k)}return g},g.tickFormat=function(a,c){if(!arguments.length)return Ai;arguments.length<2?c=Ai:"function"!=typeof c&&(c=jg.format(c));var d=Math.max(1,b*a/g.ticks().length);return function(a){var g=a/f(Math.round(e(a)));return b-.5>g*b&&(g*=b),d>=g?c(a):""}},g.copy=function(){return ef(a.copy(),b,c,d)},Ze(g,a)}function ff(a,b,c){function d(b){return a(e(b))}var e=gf(b),f=gf(1/b);return d.invert=function(b){return f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain((c=b.map(Number)).map(e)),d):c},d.ticks=function(a){return af(c,a)},d.tickFormat=function(a,b){ 28 return bf(c,a,b)},d.nice=function(a){return d.domain($e(c,a))},d.exponent=function(g){return arguments.length?(e=gf(b=g),f=gf(1/b),a.domain(c.map(e)),d):b},d.copy=function(){return ff(a.copy(),b,c)},Ze(d,a)}function gf(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function hf(a,b){function c(c){return f[((e.get(c)||("range"===b.t?e.set(c,a.push(c)):NaN))-1)%f.length]}function d(b,c){return jg.range(a.length).map(function(a){return b+c*a})}var e,f,g;return c.domain=function(d){if(!arguments.length)return a;a=[],e=new l;for(var f,g=-1,h=d.length;++g<h;)e.has(f=d[g])||e.set(f,a.push(f));return c[b.t].apply(c,b.a)},c.range=function(a){return arguments.length?(f=a,g=0,b={t:"range",a:arguments},c):f},c.rangePoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=(i+j)/2,0):(j-i)/(a.length-1+h);return f=d(i+k*h/2,k),g=0,b={t:"rangePoints",a:arguments},c},c.rangeRoundPoints=function(e,h){arguments.length<2&&(h=0);var i=e[0],j=e[1],k=a.length<2?(i=j=Math.round((i+j)/2),0):(j-i)/(a.length-1+h)|0;return f=d(i+Math.round(k*h/2+(j-i-(a.length-1+h)*k)/2),k),g=0,b={t:"rangeRoundPoints",a:arguments},c},c.rangeBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=(l-k)/(a.length-h+2*i);return f=d(k+m*i,m),j&&f.reverse(),g=m*(1-h),b={t:"rangeBands",a:arguments},c},c.rangeRoundBands=function(e,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=e[1]<e[0],k=e[j-0],l=e[1-j],m=Math.floor((l-k)/(a.length-h+2*i));return f=d(k+Math.round((l-k-(a.length-h)*m)/2),m),j&&f.reverse(),g=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},c},c.rangeBand=function(){return g},c.rangeExtent=function(){return Se(b.a[0])},c.copy=function(){return hf(a,b)},c.domain(a)}function jf(a,b){function c(){var c=0,e=b.length;for(h=[];++c<e;)h[c-1]=jg.quantile(a,c/e);return d}function d(a){return isNaN(a=+a)?void 0:b[jg.bisect(h,a)]}var h;return d.domain=function(b){return arguments.length?(a=b.map(f).filter(g).sort(e),c()):a},d.range=function(a){return arguments.length?(b=a,c()):b},d.quantiles=function(){return h},d.invertExtent=function(c){return c=b.indexOf(c),0>c?[NaN,NaN]:[c>0?h[c-1]:a[0],c<h.length?h[c]:a[a.length-1]]},d.copy=function(){return jf(a,b)},c()}function kf(a,b,c){function d(b){return c[Math.max(0,Math.min(g,Math.floor(f*(b-a))))]}function e(){return f=c.length/(b-a),g=c.length-1,d}var f,g;return d.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],e()):[a,b]},d.range=function(a){return arguments.length?(c=a,e()):c},d.invertExtent=function(b){return b=c.indexOf(b),b=0>b?NaN:b/f+a,[b,b+1/f]},d.copy=function(){return kf(a,b,c)},e()}function lf(a,b){function c(c){return c>=c?b[jg.bisect(a,c)]:void 0}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.invertExtent=function(c){return c=b.indexOf(c),[a[c-1],a[c]]},c.copy=function(){return lf(a,b)},c}function mf(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return af(a,b)},b.tickFormat=function(b,c){return bf(a,b,c)},b.copy=function(){return mf(a)},b}function nf(){return 0}function of(a){return a.innerRadius}function pf(a){return a.outerRadius}function qf(a){return a.startAngle}function rf(a){return a.endAngle}function sf(a){return a&&a.padAngle}function tf(a,b,c,d){return(a-c)*b-(b-d)*a>0?0:1}function uf(a,b,c,d,e){var f=a[0]-b[0],g=a[1]-b[1],h=(e?d:-d)/Math.sqrt(f*f+g*g),i=h*g,j=-h*f,k=a[0]+i,l=a[1]+j,m=b[0]+i,n=b[1]+j,o=(k+m)/2,p=(l+n)/2,q=m-k,r=n-l,s=q*q+r*r,t=c-d,u=k*n-m*l,v=(0>r?-1:1)*Math.sqrt(Math.max(0,t*t*s-u*u)),w=(u*r-q*v)/s,x=(-u*q-r*v)/s,y=(u*r+q*v)/s,z=(-u*q+r*v)/s,A=w-o,B=x-p,C=y-o,D=z-p;return A*A+B*B>C*C+D*D&&(w=y,x=z),[[w-i,x-j],[w*c/t,x*c/t]]}function vf(a){function b(b){function g(){j.push("M",f(a(k),h))}for(var i,j=[],k=[],l=-1,m=b.length,n=Ca(c),o=Ca(d);++l<m;)e.call(this,i=b[l],l)?k.push([+n.call(this,i,l),+o.call(this,i,l)]):k.length&&(g(),k=[]);return k.length&&g(),j.length?j.join(""):null}var c=Ec,d=Fc,e=Fb,f=wf,g=f.key,h=.7;return b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b.defined=function(a){return arguments.length?(e=a,b):e},b.interpolate=function(a){return arguments.length?(g="function"==typeof a?f=a:(f=Hi.get(a)||wf).key,b):g},b.tension=function(a){return arguments.length?(h=a,b):h},b}function wf(a){return a.length>1?a.join("L"):a+"Z"}function xf(a){return a.join("L")+"Z"}function yf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d[0]+(d=a[b])[0])/2,"V",d[1]);return c>1&&e.push("H",d[0]),e.join("")}function zf(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function Af(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++b<c;)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function Bf(a,b){return a.length<4?wf(a):a[1]+Ef(a.slice(1,-1),Ff(a,b))}function Cf(a,b){return a.length<3?xf(a):a[0]+Ef((a.push(a[0]),a),Ff([a[a.length-2]].concat(a,[a[1]]),b))}function Df(a,b){return a.length<3?wf(a):a[0]+Ef(a,Ff(a,b))}function Ef(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return wf(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;if(c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],i=2),b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+2*h[0]/3)+","+(f[1]+2*h[1]/3)+","+k[0]+","+k[1]}return d}function Ff(a,b){for(var c,d=[],e=(1-b)/2,f=a[0],g=a[1],h=1,i=a.length;++h<i;)c=f,f=g,g=a[h],d.push([e*(g[0]-c[0]),e*(g[1]-c[1])]);return d}function Gf(a){if(a.length<3)return wf(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f,"L",Kf(Ki,g),",",Kf(Ki,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Lf(i,g,h);return a.pop(),i.push("L",d),i.join("")}function Hf(a){if(a.length<4)return wf(a);for(var b,c=[],d=-1,e=a.length,f=[0],g=[0];++d<3;)b=a[d],f.push(b[0]),g.push(b[1]);for(c.push(Kf(Ki,f)+","+Kf(Ki,g)),--d;++d<e;)b=a[d],f.shift(),f.push(b[0]),g.shift(),g.push(b[1]),Lf(c,f,g);return c.join("")}function If(a){for(var b,c,d=-1,e=a.length,f=e+4,g=[],h=[];++d<4;)c=a[d%e],g.push(c[0]),h.push(c[1]);for(b=[Kf(Ki,g),",",Kf(Ki,h)],--d;++d<f;)c=a[d%e],g.shift(),g.push(c[0]),h.shift(),h.push(c[1]),Lf(b,g,h);return b.join("")}function Jf(a,b){var c=a.length-1;if(c)for(var d,e,f=a[0][0],g=a[0][1],h=a[c][0]-f,i=a[c][1]-g,j=-1;++j<=c;)d=a[j],e=j/c,d[0]=b*d[0]+(1-b)*(f+e*h),d[1]=b*d[1]+(1-b)*(g+e*i);return Gf(a)}function Kf(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Lf(a,b,c){a.push("C",Kf(Ii,b),",",Kf(Ii,c),",",Kf(Ji,b),",",Kf(Ji,c),",",Kf(Ki,b),",",Kf(Ki,c))}function Mf(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Nf(a){for(var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=Mf(e,f);++b<c;)d[b]=(g+(g=Mf(e=f,f=a[b+1])))/2;return d[b]=g,d}function Of(a){for(var b,c,d,e,f=[],g=Nf(a),h=-1,i=a.length-1;++h<i;)b=Mf(a[h],a[h+1]),vg(b)<Lg?g[h]=g[h+1]=0:(c=g[h]/b,d=g[h+1]/b,e=c*c+d*d,e>9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d));for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function Pf(a){return a.length<3?wf(a):a[0]+Ef(a,Of(a))}function Qf(a){for(var b,c,d,e=-1,f=a.length;++e<f;)b=a[e],c=b[0],d=b[1]-Qg,b[0]=c*Math.cos(d),b[1]=c*Math.sin(d);return a}function Rf(a){function b(b){function i(){p.push("M",h(a(r),l),k,j(a(q.reverse()),l),"Z")}for(var m,n,o,p=[],q=[],r=[],s=-1,t=b.length,u=Ca(c),v=Ca(e),w=c===d?function(){return n}:Ca(d),x=e===f?function(){return o}:Ca(f);++s<t;)g.call(this,m=b[s],s)?(q.push([n=+u.call(this,m,s),o=+v.call(this,m,s)]),r.push([+w.call(this,m,s),+x.call(this,m,s)])):q.length&&(i(),q=[],r=[]);return q.length&&i(),p.length?p.join(""):null}var c=Ec,d=Ec,e=0,f=Fc,g=Fb,h=wf,i=h.key,j=h,k="L",l=.7;return b.x=function(a){return arguments.length?(c=d=a,b):d},b.x0=function(a){return arguments.length?(c=a,b):c},b.x1=function(a){return arguments.length?(d=a,b):d},b.y=function(a){return arguments.length?(e=f=a,b):f},b.y0=function(a){return arguments.length?(e=a,b):e},b.y1=function(a){return arguments.length?(f=a,b):f},b.defined=function(a){return arguments.length?(g=a,b):g},b.interpolate=function(a){return arguments.length?(i="function"==typeof a?h=a:(h=Hi.get(a)||wf).key,j=h.reverse||h,k=h.closed?"M":"L",b):i},b.tension=function(a){return arguments.length?(l=a,b):l},b}function Sf(a){return a.radius}function Tf(a){return[a.x,a.y]}function Uf(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]-Qg;return[c*Math.cos(d),c*Math.sin(d)]}}function Vf(){return 64}function Wf(){return"circle"}function Xf(a){var b=Math.sqrt(a/Ng);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+-b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function Yf(a){return function(){var b,c,d;(b=this[a])&&(d=b[c=b.active])&&(d.timer.c=null,d.timer.t=NaN,--b.count?delete b[c]:delete this[a],b.active+=.5,d.event&&d.event.interrupt.call(this,this.__data__,d.index))}}function Zf(a,b,c){return Ag(a,Ri),a.namespace=b,a.id=c,a}function $f(a,b,c,d){var e=a.id,f=a.namespace;return T(a,"function"==typeof c?function(a,g,h){a[f][e].tween.set(b,d(c.call(a,a.__data__,g,h)))}:(c=d(c),function(a){a[f][e].tween.set(b,c)}))}function _f(a){return null==a&&(a=""),function(){this.textContent=a}}function ag(a){return null==a?"__transition__":"__transition_"+a+"__"}function bg(a,b,c,d,e){function f(a){var b=p.delay;return j.t=b+i,a>=b?g(a-b):void(j.c=g)}function g(c){var e=o.active,f=o[e];f&&(f.timer.c=null,f.timer.t=NaN,--o.count,delete o[e],f.event&&f.event.interrupt.call(a,a.__data__,f.index));for(var g in o)if(d>+g){var l=o[g];l.timer.c=null,l.timer.t=NaN,--o.count,delete o[g]}j.c=h,Ha(function(){return j.c&&h(c||1)&&(j.c=null,j.t=NaN),1},0,i),o.active=d,p.event&&p.event.start.call(a,a.__data__,b),n=[],p.tween.forEach(function(c,d){(d=d.call(a,a.__data__,b))&&n.push(d)}),m=p.ease,k=p.duration}function h(e){for(var f=e/k,g=m(f),h=n.length;h>0;)n[--h].call(a,g);return f>=1?(p.event&&p.event.end.call(a,a.__data__,b),--o.count?delete o[d]:delete a[c],1):void 0}var i,j,k,m,n,o=a[c]||(a[c]={active:0,count:0}),p=o[d];p||(i=e.time,j=Ha(f,0,i),p=o[d]={tween:new l,time:i,timer:j,delay:e.delay,duration:e.duration,ease:e.ease,index:b},e=null,++o.count)}function cg(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate("+(isFinite(d)?d:c(a))+",0)"})}function dg(a,b,c){a.attr("transform",function(a){var d=b(a);return"translate(0,"+(isFinite(d)?d:c(a))+")"})}function eg(a){return a.toISOString()}function fg(a,b,c){function d(b){return a(b)}function e(a,c){var d=a[1]-a[0],e=d/c,f=jg.bisect($i,e);return f==$i.length?[b.year,_e(a.map(function(a){return a/31536e6}),c)[2]]:f?b[e/$i[f-1]<$i[f]/e?f-1:f]:[bj,_e(a,c)[2]]}return d.invert=function(b){return gg(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(gg)},d.nice=function(a,b){function c(c){return!isNaN(c)&&!a.range(c,gg(+c+1),b).length}var f=d.domain(),g=Se(f),h=null==a?e(g,10):"number"==typeof a&&e(g,a);return h&&(a=h[0],b=h[1]),d.domain(Ve(f,b>1?{floor:function(b){for(;c(b=a.floor(b));)b=gg(b-1);return b},ceil:function(b){for(;c(b=a.ceil(b));)b=gg(+b+1);return b}}:a))},d.ticks=function(a,b){var c=Se(d.domain()),f=null==a?e(c,10):"number"==typeof a?e(c,a):!a.range&&[{range:a},b];return f&&(a=f[0],b=f[1]),a.range(c[0],gg(+c[1]+1),1>b?1:b)},d.tickFormat=function(){return c},d.copy=function(){return fg(a.copy(),b,c)},Ze(d,a)}function gg(a){return new Date(a)}function hg(a){return JSON.parse(a.responseText)}function ig(a){var b=mg.createRange();return b.selectNode(mg.body),b.createContextualFragment(a.responseText)}var jg={version:"3.5.13"},kg=[].slice,lg=function(a){return kg.call(a)},mg=this.document;if(mg)try{lg(mg.documentElement.childNodes)[0].nodeType}catch(ng){lg=function(a){for(var b=a.length,c=new Array(b);b--;)c[b]=a[b];return c}}if(Date.now||(Date.now=function(){return+new Date}),mg)try{mg.createElement("DIV").style.setProperty("opacity",0,"")}catch(og){var pg=this.Element.prototype,qg=pg.setAttribute,rg=pg.setAttributeNS,sg=this.CSSStyleDeclaration.prototype,tg=sg.setProperty;pg.setAttribute=function(a,b){qg.call(this,a,b+"")},pg.setAttributeNS=function(a,b,c){rg.call(this,a,b,c+"")},sg.setProperty=function(a,b,c){tg.call(this,a,b+"",c)}}jg.ascending=e,jg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:NaN},jg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&c>d&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&c>d&&(c=d)}return c},jg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++e<f;)if(null!=(d=a[e])&&d>=d){c=d;break}for(;++e<f;)null!=(d=a[e])&&d>c&&(c=d)}else{for(;++e<f;)if(null!=(d=b.call(a,a[e],e))&&d>=d){c=d;break}for(;++e<f;)null!=(d=b.call(a,a[e],e))&&d>c&&(c=d)}return c},jg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++f<g;)if(null!=(d=a[f])&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=a[f])&&(c>d&&(c=d),d>e&&(e=d))}else{for(;++f<g;)if(null!=(d=b.call(a,a[f],f))&&d>=d){c=e=d;break}for(;++f<g;)null!=(d=b.call(a,a[f],f))&&(c>d&&(c=d),d>e&&(e=d))}return[c,e]},jg.sum=function(a,b){var c,d=0,e=a.length,f=-1;if(1===arguments.length)for(;++f<e;)g(c=+a[f])&&(d+=c);else for(;++f<e;)g(c=+b.call(a,a[f],f))&&(d+=c);return d},jg.mean=function(a,b){var c,d=0,e=a.length,h=-1,i=e;if(1===arguments.length)for(;++h<e;)g(c=f(a[h]))?d+=c:--i;else for(;++h<e;)g(c=f(b.call(a,a[h],h)))?d+=c:--i;return i?d/i:void 0},jg.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=+a[d-1],f=c-d;return f?e+f*(a[d]-e):e},jg.median=function(a,b){var c,d=[],h=a.length,i=-1;if(1===arguments.length)for(;++i<h;)g(c=f(a[i]))&&d.push(c);else for(;++i<h;)g(c=f(b.call(a,a[i],i)))&&d.push(c);return d.length?jg.quantile(d.sort(e),.5):void 0},jg.variance=function(a,b){var c,d,e=a.length,h=0,i=0,j=-1,k=0;if(1===arguments.length)for(;++j<e;)g(c=f(a[j]))&&(d=c-h,h+=d/++k,i+=d*(c-h));else for(;++j<e;)g(c=f(b.call(a,a[j],j)))&&(d=c-h,h+=d/++k,i+=d*(c-h));return k>1?i/(k-1):void 0},jg.deviation=function(){var a=jg.variance.apply(this,arguments);return a?Math.sqrt(a):a};var ug=h(e);jg.bisectLeft=ug.left,jg.bisect=jg.bisectRight=ug.right,jg.bisector=function(a){return h(1===a.length?function(b,c){return e(a(b),c)}:a)},jg.shuffle=function(a,b,c){(f=arguments.length)<3&&(c=a.length,2>f&&(b=0));for(var d,e,f=c-b;f;)e=Math.random()*f--|0,d=a[f+b],a[f+b]=a[e+b],a[e+b]=d;return a},jg.permute=function(a,b){for(var c=b.length,d=new Array(c);c--;)d[c]=a[b[c]];return d},jg.pairs=function(a){for(var b,c=0,d=a.length-1,e=a[0],f=new Array(0>d?0:d);d>c;)f[c]=[b=e,e=a[++c]];return f},jg.zip=function(){if(!(d=arguments.length))return[];for(var a=-1,b=jg.min(arguments,i),c=new Array(b);++a<b;)for(var d,e=-1,f=c[a]=new Array(d);++e<d;)f[e]=arguments[e][a];return c},jg.transpose=function(a){return jg.zip.apply(jg,a)},jg.keys=function(a){var b=[];for(var c in a)b.push(c);return b},jg.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},jg.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},jg.merge=function(a){for(var b,c,d,e=a.length,f=-1,g=0;++f<e;)g+=a[f].length;for(c=new Array(g);--e>=0;)for(d=a[e],b=d.length;--b>=0;)c[--g]=d[b];return c};var vg=Math.abs;jg.range=function(a,b,c){if(arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0)),(b-a)/c===1/0)throw new Error("infinite range");var d,e=[],f=j(vg(c)),g=-1;if(a*=f,b*=f,c*=f,0>c)for(;(d=a+c*++g)>b;)e.push(d/f);else for(;(d=a+c*++g)<b;)e.push(d/f);return e},jg.map=function(a,b){var c=new l;if(a instanceof l)a.forEach(function(a,b){c.set(a,b)});else if(Array.isArray(a)){var d,e=-1,f=a.length;if(1===arguments.length)for(;++e<f;)c.set(e,a[e]);else for(;++e<f;)c.set(b.call(a,d=a[e],e),d)}else for(var g in a)c.set(g,a[g]);return c};var wg="__proto__",xg="\x00";k(l,{has:o,get:function(a){return this._[m(a)]},set:function(a,b){return this._[m(a)]=b},remove:p,keys:q,values:function(){var a=[];for(var b in this._)a.push(this._[b]);return a},entries:function(){var a=[];for(var b in this._)a.push({key:n(b),value:this._[b]});return a},size:r,empty:s,forEach:function(a){for(var b in this._)a.call(this,n(b),this._[b])}}),jg.nest=function(){function a(b,g,h){if(h>=f.length)return d?d.call(e,g):c?g.sort(c):g;for(var i,j,k,m,n=-1,o=g.length,p=f[h++],q=new l;++n<o;)(m=q.get(i=p(j=g[n])))?m.push(j):q.set(i,[j]);return b?(j=b(),k=function(c,d){j.set(c,a(b,d,h))}):(j={},k=function(c,d){j[c]=a(b,d,h)}),q.forEach(k),j}function b(a,c){if(c>=f.length)return a;var d=[],e=g[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},f=[],g=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(jg.map,c,0),0)},e.key=function(a){return f.push(a),e},e.sortKeys=function(a){return g[f.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},jg.set=function(a){var b=new t;if(a)for(var c=0,d=a.length;d>c;++c)b.add(a[c]);return b},k(t,{has:o,add:function(a){return this._[m(a+="")]=!0,a},remove:p,values:q,size:r,empty:s,forEach:function(a){for(var b in this._)a.call(this,n(b))}}),jg.behavior={},jg.rebind=function(a,b){for(var c,d=1,e=arguments.length;++d<e;)a[c=arguments[d]]=v(a,b,b[c]);return a};var yg=["webkit","ms","moz","Moz","o","O"];jg.dispatch=function(){for(var a=new y,b=-1,c=arguments.length;++b<c;)a[arguments[b]]=z(a);return a},y.prototype.on=function(a,b){var c=a.indexOf("."),d="";if(c>=0&&(d=a.slice(c+1),a=a.slice(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},jg.event=null,jg.requote=function(a){return a.replace(zg,"\\$&")};var zg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ag={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},Bg=function(a,b){return b.querySelector(a)},Cg=function(a,b){return b.querySelectorAll(a)},Dg=function(a,b){var c=a.matches||a[w(a,"matchesSelector")];return(Dg=function(a,b){return c.call(a,b)})(a,b)};"function"==typeof Sizzle&&(Bg=function(a,b){return Sizzle(a,b)[0]||null},Cg=Sizzle,Dg=Sizzle.matchesSelector),jg.selection=function(){return jg.select(mg.documentElement)};var Eg=jg.selection.prototype=[];Eg.select=function(a){var b,c,d,e,f=[];a=E(a);for(var g=-1,h=this.length;++g<h;){f.push(b=[]),b.parentNode=(d=this[g]).parentNode;for(var i=-1,j=d.length;++i<j;)(e=d[i])?(b.push(c=a.call(e,e.__data__,i,g)),c&&"__data__"in e&&(c.__data__=e.__data__)):b.push(null)}return D(f)},Eg.selectAll=function(a){var b,c,d=[];a=F(a);for(var e=-1,f=this.length;++e<f;)for(var g=this[e],h=-1,i=g.length;++h<i;)(c=g[h])&&(d.push(b=lg(a.call(c,c.__data__,h,e))),b.parentNode=c);return D(d)};var Fg={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};jg.ns={prefix:Fg,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&"xmlns"!==(c=a.slice(0,b))&&(a=a.slice(b+1)),Fg.hasOwnProperty(c)?{space:Fg[c],local:a}:a}},Eg.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=jg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(G(b,a[b]));return this}return this.each(G(a,b))},Eg.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=J(a)).length,e=-1;if(b=c.classList){for(;++e<d;)if(!b.contains(a[e]))return!1}else for(b=c.getAttribute("class");++e<d;)if(!I(a[e]).test(b))return!1;return!0}for(b in a)this.each(K(b,a[b]));return this}return this.each(K(a,b))},Eg.style=function(a,b,c){var e=arguments.length;if(3>e){if("string"!=typeof a){2>e&&(b="");for(c in a)this.each(M(c,a[c],b));return this}if(2>e){var f=this.node();return d(f).getComputedStyle(f,null).getPropertyValue(a)}c=""}return this.each(M(a,b,c))},Eg.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(N(b,a[b]));return this}return this.each(N(a,b))},Eg.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},Eg.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},Eg.append=function(a){return a=O(a),this.select(function(){return this.appendChild(a.apply(this,arguments))})},Eg.insert=function(a,b){return a=O(a),b=E(b),this.select(function(){return this.insertBefore(a.apply(this,arguments),b.apply(this,arguments)||null)})},Eg.remove=function(){return this.each(P)},Eg.data=function(a,b){function c(a,c){var d,e,f,g=a.length,k=c.length,m=Math.min(g,k),n=new Array(k),o=new Array(k),p=new Array(g);if(b){var q,r=new l,s=new Array(g);for(d=-1;++d<g;)(e=a[d])&&(r.has(q=b.call(e,e.__data__,d))?p[d]=e:r.set(q,e),s[d]=q);for(d=-1;++d<k;)(e=r.get(q=b.call(c,f=c[d],d)))?e!==!0&&(n[d]=e,e.__data__=f):o[d]=Q(f),r.set(q,!0);for(d=-1;++d<g;)d in s&&r.get(s[d])!==!0&&(p[d]=a[d])}else{for(d=-1;++d<m;)e=a[d],f=c[d],e?(e.__data__=f,n[d]=e):o[d]=Q(f);for(;k>d;++d)o[d]=Q(c[d]);for(;g>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,h.push(o),i.push(n),j.push(p)}var d,e,f=-1,g=this.length;if(!arguments.length){for(a=new Array(g=(d=this[0]).length);++f<g;)(e=d[f])&&(a[f]=e.__data__);return a}var h=U([]),i=D([]),j=D([]);if("function"==typeof a)for(;++f<g;)c(d=this[f],a.call(d,d.parentNode.__data__,f));else for(;++f<g;)c(d=this[f],a);return i.enter=function(){return h},i.exit=function(){return j},i},Eg.datum=function(a){return arguments.length?this.property("__data__",a):this.property("__data__")},Eg.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=R(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return D(e)},Eg.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c,d=this[a],e=d.length-1,f=d[e];--e>=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},Eg.sort=function(a){a=S.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},Eg.each=function(a){return T(this,function(b,c,d){a.call(b,b.__data__,c,d)})},Eg.call=function(a){var b=lg(arguments);return a.apply(b[0]=this,b),this},Eg.empty=function(){return!this.node()},Eg.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null},Eg.size=function(){var a=0;return T(this,function(){++a}),a};var Gg=[];jg.selection.enter=U,jg.selection.enter.prototype=Gg,Gg.append=Eg.append,Gg.empty=Eg.empty,Gg.node=Eg.node,Gg.call=Eg.call,Gg.size=Eg.size,Gg.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++h<i;){d=(e=this[h]).update,g.push(b=[]),b.parentNode=e.parentNode;for(var j=-1,k=e.length;++j<k;)(f=e[j])?(b.push(d[j]=c=a.call(e.parentNode,f.__data__,j,h)),c.__data__=f.__data__):b.push(null)}return D(g)},Gg.insert=function(a,b){return arguments.length<2&&(b=V(this)),Eg.insert.call(this,a,b)},jg.select=function(a){var c;return"string"==typeof a?(c=[Bg(a,mg)],c.parentNode=mg.documentElement):(c=[a],c.parentNode=b(a)),D([c])},jg.selectAll=function(a){var b;return"string"==typeof a?(b=lg(Cg(a,mg)),b.parentNode=mg.documentElement):(b=lg(a),b.parentNode=null),D([b])},Eg.on=function(a,b,c){var d=arguments.length;if(3>d){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(W(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(W(a,b,c))};var Hg=jg.map({mouseenter:"mouseover",mouseleave:"mouseout"});mg&&Hg.forEach(function(a){"on"+a in mg&&Hg.remove(a)});var Ig,Jg=0;jg.mouse=function(a){return $(a,B())};var Kg=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;jg.touch=function(a,b,c){if(arguments.length<3&&(c=b,b=B().changedTouches),b)for(var d,e=0,f=b.length;f>e;++e)if((d=b[e]).identifier===c)return $(a,d)},jg.behavior.drag=function(){function a(){this.on("mousedown.drag",f).on("touchstart.drag",g)}function b(a,b,d,f,g){return function(){function h(){var a,c,d=b(m,p);d&&(a=d[0]-t[0],c=d[1]-t[1],o|=a|c,t=d,n({type:"drag",x:d[0]+j[0],y:d[1]+j[1],dx:a,dy:c}))}function i(){b(m,p)&&(r.on(f+q,null).on(g+q,null),s(o),n({type:"dragend"}))}var j,k=this,l=jg.event.target,m=k.parentNode,n=c.of(k,arguments),o=0,p=a(),q=".drag"+(null==p?"":"-"+p),r=jg.select(d(l)).on(f+q,h).on(g+q,i),s=Z(l),t=b(m,p);e?(j=e.apply(k,arguments),j=[j.x-t[0],j.y-t[1]]):j=[0,0],n({type:"dragstart"})}}var c=C(a,"drag","dragstart","dragend"),e=null,f=b(x,jg.mouse,d,"mousemove","mouseup"),g=b(_,jg.touch,u,"touchmove","touchend");return a.origin=function(b){return arguments.length?(e=b,a):e},jg.rebind(a,c,"on")},jg.touches=function(a,b){return arguments.length<2&&(b=B().touches),b?lg(b).map(function(b){var c=$(a,b);return c.identifier=b.identifier,c}):[]};var Lg=1e-6,Mg=Lg*Lg,Ng=Math.PI,Og=2*Ng,Pg=Og-Lg,Qg=Ng/2,Rg=Ng/180,Sg=180/Ng,Tg=Math.SQRT2,Ug=2,Vg=4;jg.interpolateZoom=function(a,b){var c,d,e=a[0],f=a[1],g=a[2],h=b[0],i=b[1],j=b[2],k=h-e,l=i-f,m=k*k+l*l;if(Mg>m)d=Math.log(j/g)/Tg,c=function(a){return[e+a*k,f+a*l,g*Math.exp(Tg*a*d)]};else{var n=Math.sqrt(m),o=(j*j-g*g+Vg*m)/(2*g*Ug*n),p=(j*j-g*g-Vg*m)/(2*j*Ug*n),q=Math.log(Math.sqrt(o*o+1)-o),r=Math.log(Math.sqrt(p*p+1)-p);d=(r-q)/Tg,c=function(a){var b=a*d,c=fa(q),h=g/(Ug*n)*(c*ga(Tg*b+q)-ea(q));return[e+h*k,f+h*l,g*c/fa(Tg*b+q)]}}return c.duration=1e3*d,c},jg.behavior.zoom=function(){function a(a){a.on(F,l).on(Xg+".zoom",n).on("dblclick.zoom",o).on(I,m)}function b(a){return[(a[0]-y.x)/y.k,(a[1]-y.y)/y.k]}function c(a){return[a[0]*y.k+y.x,a[1]*y.k+y.y]}function e(a){y.k=Math.max(B[0],Math.min(B[1],a))}function f(a,b){b=c(b),y.x+=a[0]-b[0],y.y+=a[1]-b[1]}function g(b,c,d,g){b.__chart__={x:y.x,y:y.y,k:y.k},e(Math.pow(2,g)),f(q=c,d),b=jg.select(b),D>0&&(b=b.transition().duration(D)),b.call(a.event)}function h(){v&&v.domain(u.range().map(function(a){return(a-y.x)/y.k}).map(u.invert)),x&&x.domain(w.range().map(function(a){return(a-y.y)/y.k}).map(w.invert))}function i(a){E++||a({type:"zoomstart"})}function j(a){h(),a({type:"zoom",scale:y.k,translate:[y.x,y.y]})}function k(a){--E||(a({type:"zoomend"}),q=null)}function l(){function a(){h=1,f(jg.mouse(e),m),j(g)}function c(){l.on(G,null).on(H,null),n(h),k(g)}var e=this,g=J.of(e,arguments),h=0,l=jg.select(d(e)).on(G,a).on(H,c),m=b(jg.mouse(e)),n=Z(e);Qi.call(e),i(g)}function m(){function a(){var a=jg.touches(o);return n=y.k,a.forEach(function(a){a.identifier in q&&(q[a.identifier]=b(a))}),a}function c(){var b=jg.event.target;jg.select(b).on(u,d).on(v,h),w.push(b);for(var c=jg.event.changedTouches,e=0,f=c.length;f>e;++e)q[c[e].identifier]=null;var i=a(),j=Date.now();if(1===i.length){if(500>j-t){var k=i[0];g(o,k,q[k.identifier],Math.floor(Math.log(y.k)/Math.LN2)+1),A()}t=j}else if(i.length>1){var k=i[0],l=i[1],m=k[0]-l[0],n=k[1]-l[1];r=m*m+n*n}}function d(){var a,b,c,d,g=jg.touches(o);Qi.call(o);for(var h=0,i=g.length;i>h;++h,d=null)if(c=g[h],d=q[c.identifier]){if(b)break;a=c,b=d}if(d){var k=(k=c[0]-a[0])*k+(k=c[1]-a[1])*k,l=r&&Math.sqrt(k/r);a=[(a[0]+c[0])/2,(a[1]+c[1])/2],b=[(b[0]+d[0])/2,(b[1]+d[1])/2],e(l*n)}t=null,f(a,b),j(p)}function h(){if(jg.event.touches.length){for(var b=jg.event.changedTouches,c=0,d=b.length;d>c;++c)delete q[b[c].identifier];for(var e in q)return void a()}jg.selectAll(w).on(s,null),x.on(F,l).on(I,m),z(),k(p)}var n,o=this,p=J.of(o,arguments),q={},r=0,s=".zoom-"+jg.event.changedTouches[0].identifier,u="touchmove"+s,v="touchend"+s,w=[],x=jg.select(o),z=Z(o);c(),i(p),x.on(F,null).on(I,c)}function n(){var a=J.of(this,arguments);s?clearTimeout(s):(Qi.call(this),p=b(q=r||jg.mouse(this)),i(a)),s=setTimeout(function(){s=null,k(a)},50),A(),e(Math.pow(2,.002*Wg())*y.k),f(q,p),j(a)}function o(){var a=jg.mouse(this),c=Math.log(y.k)/Math.LN2;g(this,a,b(a),jg.event.shiftKey?Math.ceil(c)-1:Math.floor(c)+1)}var p,q,r,s,t,u,v,w,x,y={x:0,y:0,k:1},z=[960,500],B=Yg,D=250,E=0,F="mousedown.zoom",G="mousemove.zoom",H="mouseup.zoom",I="touchstart.zoom",J=C(a,"zoomstart","zoom","zoomend");return Xg||(Xg="onwheel"in mg?(Wg=function(){return-jg.event.deltaY*(jg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in mg?(Wg=function(){return jg.event.wheelDelta},"mousewheel"):(Wg=function(){return-jg.event.detail},"MozMousePixelScroll")),a.event=function(a){a.each(function(){var a=J.of(this,arguments),b=y;Oi?jg.select(this).transition().each("start.zoom",function(){y=this.__chart__||{x:0,y:0,k:1},i(a)}).tween("zoom:zoom",function(){var c=z[0],d=z[1],e=q?q[0]:c/2,f=q?q[1]:d/2,g=jg.interpolateZoom([(e-y.x)/y.k,(f-y.y)/y.k,c/y.k],[(e-b.x)/b.k,(f-b.y)/b.k,c/b.k]);return function(b){var d=g(b),h=c/d[2];this.__chart__=y={x:e-d[0]*h,y:f-d[1]*h,k:h},j(a)}}).each("interrupt.zoom",function(){k(a)}).each("end.zoom",function(){k(a)}):(this.__chart__=y,i(a),j(a),k(a))})},a.translate=function(b){return arguments.length?(y={x:+b[0],y:+b[1],k:y.k},h(),a):[y.x,y.y]},a.scale=function(b){return arguments.length?(y={x:y.x,y:y.y,k:null},e(+b),h(),a):y.k},a.scaleExtent=function(b){return arguments.length?(B=null==b?Yg:[+b[0],+b[1]],a):B},a.center=function(b){return arguments.length?(r=b&&[+b[0],+b[1]],a):r},a.size=function(b){return arguments.length?(z=b&&[+b[0],+b[1]],a):z},a.duration=function(b){return arguments.length?(D=+b,a):D},a.x=function(b){return arguments.length?(v=b,u=b.copy(),y={x:0,y:0,k:1},a):v},a.y=function(b){return arguments.length?(x=b,w=b.copy(),y={x:0,y:0,k:1},a):x},jg.rebind(a,J,"on")};var Wg,Xg,Yg=[0,1/0];jg.color=ia,ia.prototype.toString=function(){return this.rgb()+""},jg.hsl=ja;var Zg=ja.prototype=new ia;Zg.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new ja(this.h,this.s,this.l/a)},Zg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ja(this.h,this.s,a*this.l)},Zg.rgb=function(){return ka(this.h,this.s,this.l)},jg.hcl=la;var $g=la.prototype=new ia;$g.brighter=function(a){return new la(this.h,this.c,Math.min(100,this.l+_g*(arguments.length?a:1)))},$g.darker=function(a){return new la(this.h,this.c,Math.max(0,this.l-_g*(arguments.length?a:1)))},$g.rgb=function(){return ma(this.h,this.c,this.l).rgb()},jg.lab=na;var _g=18,ah=.95047,bh=1,ch=1.08883,dh=na.prototype=new ia;dh.brighter=function(a){return new na(Math.min(100,this.l+_g*(arguments.length?a:1)),this.a,this.b)},dh.darker=function(a){return new na(Math.max(0,this.l-_g*(arguments.length?a:1)),this.a,this.b)},dh.rgb=function(){return oa(this.l,this.a,this.b)},jg.rgb=ta;var eh=ta.prototype=new ia;eh.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),new ta(Math.min(255,b/a),Math.min(255,c/a),Math.min(255,d/a))):new ta(e,e,e)},eh.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new ta(a*this.r,a*this.g,a*this.b)},eh.hsl=function(){return ya(this.r,this.g,this.b)},eh.toString=function(){return"#"+wa(this.r)+wa(this.g)+wa(this.b)};var fh=jg.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139, 29 darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});fh.forEach(function(a,b){fh.set(a,ua(b))}),jg.functor=Ca,jg.xhr=Da(u),jg.dsv=function(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=Ea(a,b,null==c?d:e(c),f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),i=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=j)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++<j;)if(34===a.charCodeAt(c)){if(34!==a.charCodeAt(c+1))break;++c}k=c+2;var d=a.charCodeAt(c+1);return 13===d?(e=!0,10===a.charCodeAt(c+2)&&++k):10===d&&(e=!0),a.slice(b+1,c).replace(/""/g,'"')}for(;j>k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==i)continue;return a.slice(b,k-h)}return a.slice(b)}for(var d,e,f={},g={},h=[],j=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();b&&null==(m=b(m,l++))||h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new t,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(g).join(a)].concat(b.map(function(b){return e.map(function(a){return g(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c},jg.csv=jg.dsv(",","text/csv"),jg.tsv=jg.dsv(" ","text/tab-separated-values");var gh,hh,ih,jh,kh=this[w(this,"requestAnimationFrame")]||function(a){setTimeout(a,17)};jg.timer=function(){Ha.apply(this,arguments)},jg.timer.flush=function(){Ja(),Ka()},jg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var lh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ma);jg.formatPrefix=function(a,b){var c=0;return(a=+a)&&(0>a&&(a*=-1),b&&(a=jg.round(a,La(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c-1)/3)))),lh[8+c/3]};var mh=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,nh=jg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=jg.round(a,La(a,b))).toFixed(Math.max(0,Math.min(20,La(a*(1+1e-15),b))))}}),oh=jg.time={},ph=Date;Pa.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){qh.setUTCDate.apply(this._,arguments)},setDay:function(){qh.setUTCDay.apply(this._,arguments)},setFullYear:function(){qh.setUTCFullYear.apply(this._,arguments)},setHours:function(){qh.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){qh.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){qh.setUTCMinutes.apply(this._,arguments)},setMonth:function(){qh.setUTCMonth.apply(this._,arguments)},setSeconds:function(){qh.setUTCSeconds.apply(this._,arguments)},setTime:function(){qh.setTime.apply(this._,arguments)}};var qh=Date.prototype;oh.year=Qa(function(a){return a=oh.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),oh.years=oh.year.range,oh.years.utc=oh.year.utc.range,oh.day=Qa(function(a){var b=new ph(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),oh.days=oh.day.range,oh.days.utc=oh.day.utc.range,oh.dayOfYear=function(a){var b=oh.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(a,b){b=7-b;var c=oh[a]=Qa(function(a){return(a=oh.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=oh.year(a).getDay();return Math.floor((oh.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});oh[a+"s"]=c.range,oh[a+"s"].utc=c.utc.range,oh[a+"OfYear"]=function(a){var c=oh.year(a).getDay();return Math.floor((oh.dayOfYear(a)+(c+b)%7)/7)}}),oh.week=oh.sunday,oh.weeks=oh.sunday.range,oh.weeks.utc=oh.sunday.utc.range,oh.weekOfYear=oh.sundayOfYear;var rh={"-":"",_:" ",0:"0"},sh=/^\s*\d+/,th=/^%/;jg.locale=function(a){return{numberFormat:Na(a),timeFormat:Sa(a)}};var uh=jg.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});jg.format=uh.numberFormat,jg.geo={},lb.prototype={s:0,t:0,add:function(a){mb(a,this.t,vh),mb(vh.s,this.s,this),this.s?this.t+=vh.t:this.s=vh.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vh=new lb;jg.geo.stream=function(a,b){a&&wh.hasOwnProperty(a.type)?wh[a.type](a,b):nb(a,b)};var wh={Feature:function(a,b){nb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++d<e;)nb(c[d].geometry,b)}},xh={Sphere:function(a,b){b.sphere()},Point:function(a,b){a=a.coordinates,b.point(a[0],a[1],a[2])},MultiPoint:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)a=c[d],b.point(a[0],a[1],a[2])},LineString:function(a,b){ob(a.coordinates,b,0)},MultiLineString:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)ob(c[d],b,0)},Polygon:function(a,b){pb(a.coordinates,b)},MultiPolygon:function(a,b){for(var c=a.coordinates,d=-1,e=c.length;++d<e;)pb(c[d],b)},GeometryCollection:function(a,b){for(var c=a.geometries,d=-1,e=c.length;++d<e;)nb(c[d],b)}};jg.geo.area=function(a){return yh=0,jg.geo.stream(a,Ah),yh};var yh,zh=new lb,Ah={sphere:function(){yh+=4*Ng},point:x,lineStart:x,lineEnd:x,polygonStart:function(){zh.reset(),Ah.lineStart=qb},polygonEnd:function(){var a=2*zh;yh+=0>a?4*Ng+a:a,Ah.lineStart=Ah.lineEnd=Ah.point=x}};jg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=rb([b*Rg,c*Rg]);if(r){var e=tb(r,d),f=[e[1],-e[0],0],g=tb(f,e);wb(g),g=xb(g);var i=b-o,j=i>0?1:-1,p=g[0]*Sg*j,q=vg(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Sg;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Sg;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=vg(d)>180?d+(d>0?360:-360):d}else p=a,q=c;Ah.point(a,c),b(a,c)}function f(){Ah.lineStart()}function g(){e(p,q),Ah.lineEnd(),vg(s)>Lg&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a<b[0]||b[1]<a}var k,l,m,n,o,p,q,r,s,t,u,v={point:a,lineStart:c,lineEnd:d,polygonStart:function(){v.point=e,v.lineStart=f,v.lineEnd=g,s=0,Ah.polygonStart()},polygonEnd:function(){Ah.polygonEnd(),v.point=a,v.lineStart=c,v.lineEnd=d,0>zh?(k=-(m=180),l=-(n=90)):s>Lg?n=90:-Lg>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],jg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-(1/0),b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,k===1/0||l===1/0?[[NaN,NaN],[NaN,NaN]]:[[k,l],[m,n]]}}(),jg.geo.centroid=function(a){Bh=Ch=Dh=Eh=Fh=Gh=Hh=Ih=Jh=Kh=Lh=0,jg.geo.stream(a,Mh);var b=Jh,c=Kh,d=Lh,e=b*b+c*c+d*d;return Mg>e&&(b=Gh,c=Hh,d=Ih,Lg>Ch&&(b=Dh,c=Eh,d=Fh),e=b*b+c*c+d*d,Mg>e)?[NaN,NaN]:[Math.atan2(c,b)*Sg,da(d/Math.sqrt(e))*Sg]};var Bh,Ch,Dh,Eh,Fh,Gh,Hh,Ih,Jh,Kh,Lh,Mh={sphere:x,point:zb,lineStart:Bb,lineEnd:Cb,polygonStart:function(){Mh.lineStart=Db},polygonEnd:function(){Mh.lineStart=Bb}},Nh=Jb(Fb,Nb,Pb,[-Ng,-Ng/2]),Oh=1e9;jg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=Tb(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(jg.geo.conicEqualArea=function(){return Ub(Vb)}).raw=Vb,jg.geo.albers=function(){return jg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},jg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=jg.geo.albers(),g=jg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=jg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Lg,l+.12*j+Lg],[k-.214*j-Lg,l+.234*j-Lg]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Lg,l+.166*j+Lg],[k-.115*j-Lg,l+.234*j-Lg]]).stream(i).point,a},a.scale(1070)};var Ph,Qh,Rh,Sh,Th,Uh,Vh={point:x,lineStart:x,lineEnd:x,polygonStart:function(){Qh=0,Vh.lineStart=Wb},polygonEnd:function(){Vh.lineStart=Vh.lineEnd=Vh.point=x,Ph+=vg(Qh/2)}},Wh={point:Xb,lineStart:x,lineEnd:x,polygonStart:x,polygonEnd:x},Xh={point:$b,lineStart:_b,lineEnd:ac,polygonStart:function(){Xh.lineStart=bc},polygonEnd:function(){Xh.point=$b,Xh.lineStart=_b,Xh.lineEnd=ac}};jg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),jg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Ph=0,jg.geo.stream(a,e(Vh)),Ph},a.centroid=function(a){return Dh=Eh=Fh=Gh=Hh=Ih=Jh=Kh=Lh=0,jg.geo.stream(a,e(Xh)),Lh?[Jh/Lh,Kh/Lh]:Ih?[Gh/Ih,Hh/Ih]:Fh?[Dh/Fh,Eh/Fh]:[NaN,NaN]},a.bounds=function(a){return Th=Uh=-(Rh=Sh=1/0),jg.geo.stream(a,e(Wh)),[[Rh,Sh],[Th,Uh]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||ec(a):u,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new Yb:new cc(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(jg.geo.albersUsa()).context(null)},jg.geo.transform=function(a){return{stream:function(b){var c=new fc(b);for(var d in a)c[d]=a[d];return c}}},fc.prototype={point:function(a,b){this.stream.point(a,b)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},jg.geo.projection=hc,jg.geo.projectionMutator=ic,(jg.geo.equirectangular=function(){return hc(kc)}).raw=kc.invert=kc,jg.geo.rotation=function(a){function b(b){return b=a(b[0]*Rg,b[1]*Rg),b[0]*=Sg,b[1]*=Sg,b}return a=mc(a[0]%360*Rg,a[1]*Rg,a.length>2?a[2]*Rg:0),b.invert=function(b){return b=a.invert(b[0]*Rg,b[1]*Rg),b[0]*=Sg,b[1]*=Sg,b},b},lc.invert=kc,jg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=mc(-a[0]*Rg,-a[1]*Rg,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Sg,a[1]*=Sg}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=qc((b=+d)*Rg,e*Rg),a):b},a.precision=function(d){return arguments.length?(c=qc(b*Rg,(e=+d)*Rg),a):e},a.angle(90)},jg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Rg,e=a[1]*Rg,f=b[1]*Rg,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},jg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return jg.range(Math.ceil(f/q)*q,e,q).map(m).concat(jg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(jg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return vg(a%q)>Lg}).map(k)).concat(jg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return vg(a%r)>Lg}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=sc(h,g,90),l=tc(d,c,s),m=sc(j,i,90),n=tc(f,e,s),a):s},a.majorExtent([[-180,-90+Lg],[180,90-Lg]]).minorExtent([[-180,-80-Lg],[180,80+Lg]])},jg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=uc,e=vc;return a.distance=function(){return jg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},jg.geo.interpolate=function(a,b){return wc(a[0]*Rg,a[1]*Rg,b[0]*Rg,b[1]*Rg)},jg.geo.length=function(a){return Yh=0,jg.geo.stream(a,Zh),Yh};var Yh,Zh={sphere:x,point:x,lineStart:xc,lineEnd:x,polygonStart:x,polygonEnd:x},$h=yc(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(jg.geo.azimuthalEqualArea=function(){return hc($h)}).raw=$h;var _h=yc(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},u);(jg.geo.azimuthalEquidistant=function(){return hc(_h)}).raw=_h,(jg.geo.conicConformal=function(){return Ub(zc)}).raw=zc,(jg.geo.conicEquidistant=function(){return Ub(Ac)}).raw=Ac;var ai=yc(function(a){return 1/a},Math.atan);(jg.geo.gnomonic=function(){return hc(ai)}).raw=ai,Bc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Qg]},(jg.geo.mercator=function(){return Cc(Bc)}).raw=Bc;var bi=yc(function(){return 1},Math.asin);(jg.geo.orthographic=function(){return hc(bi)}).raw=bi;var ci=yc(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(jg.geo.stereographic=function(){return hc(ci)}).raw=ci,Dc.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-Qg]},(jg.geo.transverseMercator=function(){var a=Cc(Dc),b=a.center,c=a.rotate;return a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[a[1],-a[0]])},a.rotate=function(a){return a?c([a[0],a[1],a.length>2?a[2]+90:90]):(a=c(),[a[0],a[1],a[2]-90])},c([0,0,90])}).raw=Dc,jg.geom={},jg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e=Ca(c),f=Ca(d),g=a.length,h=[],i=[];for(b=0;g>b;b++)h.push([+e.call(this,a[b],b),+f.call(this,a[b],b),b]);for(h.sort(Hc),b=0;g>b;b++)i.push([h[b][0],-h[b][1]]);var j=Gc(h),k=Gc(i),l=k[0]===j[0],m=k[k.length-1]===j[j.length-1],n=[];for(b=j.length-1;b>=0;--b)n.push(a[h[j[b]][2]]);for(b=+l;b<k.length-m;++b)n.push(a[h[k[b]][2]]);return n}var c=Ec,d=Fc;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},jg.geom.polygon=function(a){return Ag(a,di),a};var di=jg.geom.polygon.prototype=[];di.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b<c;)a=d,d=this[b],e+=a[1]*d[0]-a[0]*d[1];return.5*e},di.centroid=function(a){var b,c,d=-1,e=this.length,f=0,g=0,h=this[e-1];for(arguments.length||(a=-1/(6*this.area()));++d<e;)b=h,h=this[d],c=b[0]*h[1]-h[0]*b[1],f+=(b[0]+h[0])*c,g+=(b[1]+h[1])*c;return[f*a,g*a]},di.clip=function(a){for(var b,c,d,e,f,g,h=Kc(a),i=-1,j=this.length-Kc(this),k=this[j-1];++i<j;){for(b=a.slice(),a.length=0,e=this[i],f=b[(d=b.length-h)-1],c=-1;++c<d;)g=b[c],Ic(g,k,e)?(Ic(f,k,e)||a.push(Jc(f,g,k,e)),a.push(g)):Ic(f,k,e)&&a.push(Jc(f,g,k,e)),f=g;h&&a.push(a[0]),k=e}return a};var ei,fi,gi,hi,ii,ji=[],ki=[];Sc.prototype.prepare=function(){for(var a,b=this.edges,c=b.length;c--;)a=b[c].edge,a.b&&a.a||b.splice(c,1);return b.sort(Uc),b.length},cd.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},dd.prototype={insert:function(a,b){var c,d,e;if(a){if(b.P=a,b.N=a.N,a.N&&(a.N.P=b),a.N=b,a.R){for(a=a.R;a.L;)a=a.L;a.L=b}else a.R=b;c=a}else this._?(a=hd(this._),b.P=null,b.N=a,a.P=a.L=b,c=a):(b.P=b.N=null,this._=b,c=null);for(b.L=b.R=null,b.U=c,b.C=!0,a=b;c&&c.C;)d=c.U,c===d.L?(e=d.R,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.R&&(fd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,gd(this,d))):(e=d.L,e&&e.C?(c.C=e.C=!1,d.C=!0,a=d):(a===c.L&&(gd(this,c),a=c,c=a.U),c.C=!1,d.C=!0,fd(this,d))),c=a.U;this._.C=!1},remove:function(a){a.N&&(a.N.P=a.P),a.P&&(a.P.N=a.N),a.N=a.P=null;var b,c,d,e=a.U,f=a.L,g=a.R;if(c=f?g?hd(g):f:g,e?e.L===a?e.L=c:e.R=c:this._=c,f&&g?(d=c.C,c.C=a.C,c.L=f,f.U=c,c!==g?(e=c.U,c.U=a.U,a=c.R,e.L=a,c.R=g,g.U=c):(c.U=e,e=c,a=c.R)):(d=a.C,a=c),a&&(a.U=e),!d){if(a&&a.C)return void(a.C=!1);do{if(a===this._)break;if(a===e.L){if(b=e.R,b.C&&(b.C=!1,e.C=!0,fd(this,e),b=e.R),b.L&&b.L.C||b.R&&b.R.C){b.R&&b.R.C||(b.L.C=!1,b.C=!0,gd(this,b),b=e.R),b.C=e.C,e.C=b.R.C=!1,fd(this,e),a=this._;break}}else if(b=e.L,b.C&&(b.C=!1,e.C=!0,gd(this,e),b=e.L),b.L&&b.L.C||b.R&&b.R.C){b.L&&b.L.C||(b.R.C=!1,b.C=!0,fd(this,b),b=e.L),b.C=e.C,e.C=b.L.C=!1,gd(this,e),a=this._;break}b.C=!0,a=e,e=e.U}while(!a.C);a&&(a.C=!1)}}},jg.geom.voronoi=function(a){function b(a){var b=new Array(a.length),d=h[0][0],e=h[0][1],f=h[1][0],g=h[1][1];return id(c(a),h).cells.forEach(function(c,h){var i=c.edges,j=c.site,k=b[h]=i.length?i.map(function(a){var b=a.start();return[b.x,b.y]}):j.x>=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Lg)*Lg,y:Math.round(g(a,b)/Lg)*Lg,i:b}})}var d=Ec,e=Fc,f=d,g=e,h=li;return a?b(a):(b.links=function(a){return id(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return id(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(Uc),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i<j;)e=k,f=l,k=h[i].edge,l=k.l===g?k.r:k.l,d<f.i&&d<l.i&&kd(g,f,l)<0&&b.push([a[d],a[f.i],a[l.i]])}),b},b.x=function(a){return arguments.length?(f=Ca(d=a),b):d},b.y=function(a){return arguments.length?(g=Ca(e=a),b):e},b.clipExtent=function(a){return arguments.length?(h=null==a?li:a,b):h===li?null:h},b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===li?null:h&&h[1]},b)};var li=[[-1e6,-1e6],[1e6,1e6]];jg.geom.delaunay=function(a){return jg.geom.voronoi().triangles(a)},jg.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,f,g,h){if(!isNaN(c)&&!isNaN(d))if(a.leaf){var i=a.x,k=a.y;if(null!=i)if(vg(i-c)+vg(k-d)<.01)j(a,b,c,d,e,f,g,h);else{var l=a.point;a.x=a.y=a.point=null,j(a,l,i,k,e,f,g,h),j(a,b,c,d,e,f,g,h)}else a.x=c,a.y=d,a.point=b}else j(a,b,c,d,e,f,g,h)}function j(a,b,c,d,e,g,h,i){var j=.5*(e+h),k=.5*(g+i),l=c>=j,m=d>=k,n=m<<1|l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=nd()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=Ca(h),u=Ca(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.x<p&&(p=k.x),k.y<q&&(q=k.y),k.x>r&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=nd();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){od(a,z,p,q,r,s)},z.find=function(a){return pd(z,a[0],a[1],p,q,r,s)},n=-1,null==b){for(;++n<o;)f(z,a[n],l[n],m[n],p,q,r,s);--n}else a.forEach(z.add);return l=m=a=k=null,z}var g,h=Ec,i=Fc;return(g=arguments.length)?(h=ld,i=md,3===g&&(e=c,d=b,c=b=0),f(a)):(f.x=function(a){return arguments.length?(h=a,f):h},f.y=function(a){return arguments.length?(i=a,f):i},f.extent=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=+a[0][0],c=+a[0][1],d=+a[1][0],e=+a[1][1]),f):null==b?null:[[b,c],[d,e]]},f.size=function(a){return arguments.length?(null==a?b=c=d=e=null:(b=c=0,d=+a[0],e=+a[1]),f):null==b?null:[d-b,e-c]},f)},jg.interpolateRgb=qd,jg.interpolateObject=rd,jg.interpolateNumber=sd,jg.interpolateString=td;var mi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ni=new RegExp(mi.source,"g");jg.interpolate=ud,jg.interpolators=[function(a,b){var c=typeof b;return("string"===c?fh.has(b.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(b)?qd:td:b instanceof ia?qd:Array.isArray(b)?vd:"object"===c&&isNaN(b)?rd:sd)(a,b)}],jg.interpolateArray=vd;var oi=function(){return u},pi=jg.map({linear:oi,poly:Cd,quad:function(){return zd},cubic:function(){return Ad},sin:function(){return Dd},exp:function(){return Ed},circle:function(){return Fd},elastic:Gd,back:Hd,bounce:function(){return Id}}),qi=jg.map({"in":u,out:xd,"in-out":yd,"out-in":function(a){return yd(xd(a))}});jg.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.slice(0,b):a,d=b>=0?a.slice(b+1):"in";return c=pi.get(c)||oi,d=qi.get(d)||u,wd(d(c.apply(null,kg.call(arguments,1))))},jg.interpolateHcl=Jd,jg.interpolateHsl=Kd,jg.interpolateLab=Ld,jg.interpolateRound=Md,jg.transform=function(a){var b=mg.createElementNS(jg.ns.prefix.svg,"g");return(jg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Nd(c?c.matrix:ri)})(a)},Nd.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ri={a:1,b:0,c:0,d:1,e:0,f:0};jg.interpolateTransform=Wd,jg.layout={},jg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c<d;)b.push(Zd(a[c]));return b}},jg.layout.chord=function(){function a(){var a,j,l,m,n,o={},p=[],q=jg.range(f),r=[];for(c=[],d=[],a=0,m=-1;++m<f;){for(j=0,n=-1;++n<f;)j+=e[m][n];p.push(j),r.push(jg.range(f)),a+=j}for(g&&q.sort(function(a,b){return g(p[a],p[b])}),h&&r.forEach(function(a,b){a.sort(function(a,c){return h(e[b][a],e[b][c])})}),a=(Og-k*f)/a,j=0,m=-1;++m<f;){for(l=j,n=-1;++n<f;){var s=q[m],t=r[s][n],u=e[s][t],v=j,w=j+=u*a;o[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}d[s]={index:s,startAngle:l,endAngle:j,value:p[s]},j+=k}for(m=-1;++m<f;)for(n=m-1;++n<f;){var x=o[m+"-"+n],y=o[n+"-"+m];(x.value||y.value)&&c.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}i&&b()}function b(){c.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var c,d,e,f,g,h,i,j={},k=0;return j.matrix=function(a){return arguments.length?(f=(e=a)&&e.length,c=d=null,j):e},j.padding=function(a){return arguments.length?(k=a,c=d=null,j):k},j.sortGroups=function(a){return arguments.length?(g=a,c=d=null,j):g},j.sortSubgroups=function(a){return arguments.length?(h=a,c=null,j):h},j.sortChords=function(a){return arguments.length?(i=a,c&&b(),j):i},j.chords=function(){return c||a(),c},j.groups=function(){return d||a(),d},j},jg.layout.force=function(){function a(a){return function(b,c,d,e){if(b.point!==a){var f=b.cx-a.x,g=b.cy-a.y,h=e-c,i=f*f+g*g;if(i>h*h/r){if(p>i){var j=b.charge/i;a.px-=f*j,a.py-=g*j}return!0}if(b.point&&i&&p>i){var j=b.pointCharge/i;a.px-=f*j,a.py-=g*j}}return!b.charge}}function b(a){a.px=jg.event.x,a.py=jg.event.y,i.resume()}var c,d,e,f,g,h,i={},j=jg.dispatch("start","tick","end"),k=[1,1],l=.9,m=si,n=ti,o=-30,p=ui,q=.1,r=.64,s=[],t=[];return i.tick=function(){if((e*=.99)<.005)return c=null,j.end({type:"end",alpha:e=0}),!0;var b,d,i,m,n,p,r,u,v,w=s.length,x=t.length;for(d=0;x>d;++d)i=t[d],m=i.source,n=i.target,u=n.x-m.x,v=n.y-m.y,(p=u*u+v*v)&&(p=e*g[d]*((p=Math.sqrt(p))-f[d])/p,u*=p,v*=p,n.x-=u*(r=m.weight+n.weight?m.weight/(m.weight+n.weight):.5),n.y-=v*r,m.x+=u*(r=1-r),m.y+=v*r);if((r=e*q)&&(u=k[0]/2,v=k[1]/2,d=-1,r))for(;++d<w;)i=s[d],i.x+=(u-i.x)*r,i.y+=(v-i.y)*r;if(o)for(ee(b=jg.geom.quadtree(s),e,h),d=-1;++d<w;)(i=s[d]).fixed||b.visit(a(i));for(d=-1;++d<w;)i=s[d],i.fixed?(i.x=i.px,i.y=i.py):(i.x-=(i.px-(i.px=i.x))*l,i.y-=(i.py-(i.py=i.y))*l);j.tick({type:"tick",alpha:e})},i.nodes=function(a){return arguments.length?(s=a,i):s},i.links=function(a){return arguments.length?(t=a,i):t},i.size=function(a){return arguments.length?(k=a,i):k},i.linkDistance=function(a){return arguments.length?(m="function"==typeof a?a:+a,i):m},i.distance=i.linkDistance,i.linkStrength=function(a){return arguments.length?(n="function"==typeof a?a:+a,i):n},i.friction=function(a){return arguments.length?(l=+a,i):l},i.charge=function(a){return arguments.length?(o="function"==typeof a?a:+a,i):o},i.chargeDistance=function(a){return arguments.length?(p=a*a,i):Math.sqrt(p)},i.gravity=function(a){return arguments.length?(q=+a,i):q},i.theta=function(a){return arguments.length?(r=a*a,i):Math.sqrt(r)},i.alpha=function(a){return arguments.length?(a=+a,e?a>0?e=a:(c.c=null,c.t=NaN,c=null,j.end({type:"end",alpha:e=0})):a>0&&(j.start({type:"start",alpha:e=a}),c=Ha(i.tick)),i):e},i.start=function(){function a(a,d){if(!c){for(c=new Array(e),i=0;e>i;++i)c[i]=[];for(i=0;j>i;++i){var f=t[i];c[f.source.index].push(f.target),c[f.target.index].push(f.source)}}for(var g,h=c[b],i=-1,k=h.length;++i<k;)if(!isNaN(g=h[i][a]))return g;return Math.random()*d}var b,c,d,e=s.length,j=t.length,l=k[0],p=k[1];for(b=0;e>b;++b)(d=s[b]).index=b,d.weight=0;for(b=0;j>b;++b)d=t[b],"number"==typeof d.source&&(d.source=s[d.source]),"number"==typeof d.target&&(d.target=s[d.target]),++d.source.weight,++d.target.weight;for(b=0;e>b;++b)d=s[b],isNaN(d.x)&&(d.x=a("x",l)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(f=[],"function"==typeof m)for(b=0;j>b;++b)f[b]=+m.call(this,t[b],b);else for(b=0;j>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;j>b;++b)g[b]=+n.call(this,t[b],b);else for(b=0;j>b;++b)g[b]=n;if(h=[],"function"==typeof o)for(b=0;e>b;++b)h[b]=+o.call(this,s[b],b);else for(b=0;e>b;++b)h[b]=o;return i.resume()},i.resume=function(){return i.alpha(.1)},i.stop=function(){return i.alpha(0)},i.drag=function(){return d||(d=jg.behavior.drag().origin(u).on("dragstart.force",ae).on("drag.force",b).on("dragend.force",be)),arguments.length?void this.on("mouseover.force",ce).on("mouseout.force",de).call(d):d},jg.rebind(i,j,"on")};var si=20,ti=1,ui=1/0;jg.layout.hierarchy=function(){function a(e){var f,g=[e],h=[];for(e.depth=0;null!=(f=g.pop());)if(h.push(f),(j=c.call(a,f,f.depth))&&(i=j.length)){for(var i,j,k;--i>=0;)g.push(k=j[i]),k.parent=f,k.depth=f.depth+1;d&&(f.value=0),f.children=j}else d&&(f.value=+d.call(a,f,f.depth)||0),delete f.children;return he(e,function(a){var c,e;b&&(c=a.children)&&c.sort(b),d&&(e=a.parent)&&(e.value+=a.value)}),h}var b=ke,c=ie,d=je;return a.sort=function(c){return arguments.length?(b=c,a):b},a.children=function(b){return arguments.length?(c=b,a):c},a.value=function(b){return arguments.length?(d=b,a):d},a.revalue=function(b){return d&&(ge(b,function(a){a.children&&(a.value=0)}),he(b,function(b){var c; 30 b.children||(b.value=+d.call(a,b,b.depth)||0),(c=b.parent)&&(c.value+=b.value)})),b},a},jg.layout.partition=function(){function a(b,c,d,e){var f=b.children;if(b.x=c,b.y=b.depth*e,b.dx=d,b.dy=e,f&&(g=f.length)){var g,h,i,j=-1;for(d=b.value?d/b.value:0;++j<g;)a(h=f[j],c,i=h.value*d,e),c+=i}}function b(a){var c=a.children,d=0;if(c&&(e=c.length))for(var e,f=-1;++f<e;)d=Math.max(d,b(c[f]));return 1+d}function c(c,f){var g=d.call(this,c,f);return a(g[0],0,e[0],e[1]/b(g[0])),g}var d=jg.layout.hierarchy(),e=[1,1];return c.size=function(a){return arguments.length?(e=a,c):e},fe(c,d)},jg.layout.pie=function(){function a(g){var h,i=g.length,j=g.map(function(c,d){return+b.call(a,c,d)}),k=+("function"==typeof d?d.apply(this,arguments):d),l=("function"==typeof e?e.apply(this,arguments):e)-k,m=Math.min(Math.abs(l)/i,+("function"==typeof f?f.apply(this,arguments):f)),n=m*(0>l?-1:1),o=jg.sum(j),p=o?(l-i*n)/o:0,q=jg.range(i),r=[];return null!=c&&q.sort(c===vi?function(a,b){return j[b]-j[a]}:function(a,b){return c(g[a],g[b])}),q.forEach(function(a){r[a]={data:g[a],value:h=j[a],startAngle:k,endAngle:k+=h*p+n,padAngle:m}}),r}var b=Number,c=vi,d=0,e=Og,f=0;return a.value=function(c){return arguments.length?(b=c,a):b},a.sort=function(b){return arguments.length?(c=b,a):c},a.startAngle=function(b){return arguments.length?(d=b,a):d},a.endAngle=function(b){return arguments.length?(e=b,a):e},a.padAngle=function(b){return arguments.length?(f=b,a):f},a};var vi={};jg.layout.stack=function(){function a(h,i){if(!(m=h.length))return h;var j=h.map(function(c,d){return b.call(a,c,d)}),k=j.map(function(b){return b.map(function(b,c){return[f.call(a,b,c),g.call(a,b,c)]})}),l=c.call(a,k,i);j=jg.permute(j,l),k=jg.permute(k,l);var m,n,o,p,q=d.call(a,k,i),r=j[0].length;for(o=0;r>o;++o)for(e.call(a,j[0][o],p=q[o],k[0][o][1]),n=1;m>n;++n)e.call(a,j[n][o],p+=k[n-1][o][1],k[n][o][1]);return h}var b=u,c=pe,d=qe,e=oe,f=me,g=ne;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:wi.get(b)||pe,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:xi.get(b)||qe,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var wi=jg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(re),f=a.map(se),g=jg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return jg.range(a.length).reverse()},"default":pe}),xi=jg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand: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;e>b;b++)d+=a[b][c][1];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},zero:qe});jg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f<n;)g=i[f]=[],g.dx=l[f+1]-(g.x=l[f]),g.y=0;if(n>0)for(f=-1;++f<m;)h=j[f],h>=k[0]&&h<=k[1]&&(g=i[jg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=we,e=ue;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Ca(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return ve(a,b)}:Ca(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},jg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b};if(h.x=h.y=0,he(h,function(a){a.r=+k(a.value)}),he(h,Be),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;he(h,function(a){a.r+=l}),he(h,Be),he(h,function(a){a.r-=l})}return Ee(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=jg.layout.hierarchy().sort(xe),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},fe(a,c)},jg.layout.tree=function(){function a(a,e){var k=g.call(this,a,e),l=k[0],m=b(l);if(he(m,c),m.parent.m=-m.z,ge(m,d),j)ge(l,f);else{var n=l,o=l,p=l;ge(l,function(a){a.x<n.x&&(n=a),a.x>o.x&&(o=a),a.depth>p.depth&&(p=a)});var q=h(n,o)/2-n.x,r=i[0]/(o.x+h(o,n)/2+q),s=i[1]/(p.depth||1);ge(l,function(a){a.x=(a.x+q)*r,a.y=a.depth*s})}return k}function b(a){for(var b,c={A:null,children:[a]},d=[c];null!=(b=d.pop());)for(var e,f=b.children,g=0,h=f.length;h>g;++g)d.push((f[g]=e={_:f[g],parent:b,children:(e=f[g].children)&&e.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:g}).a=e);return c.children[0]}function c(a){var b=a.children,c=a.parent.children,d=a.i?c[a.i-1]:null;if(b.length){Ke(a);var f=(b[0].z+b[b.length-1].z)/2;d?(a.z=d.z+h(a._,d._),a.m=a.z-f):a.z=f}else d&&(a.z=d.z+h(a._,d._));a.parent.A=e(a,d,a.parent.A||c[0])}function d(a){a._.x=a.z+a.parent.m,a.m+=a.parent.m}function e(a,b,c){if(b){for(var d,e=a,f=a,g=b,i=e.parent.children[0],j=e.m,k=f.m,l=g.m,m=i.m;g=Ie(g),e=He(e),g&&e;)i=He(i),f=Ie(f),f.a=a,d=g.z+l-e.z-j+h(g._,e._),d>0&&(Je(Le(g,a,c),a,d),j+=d,k+=d),l+=g.m,j+=e.m,m+=i.m,k+=f.m;g&&!Ie(f)&&(f.t=g,f.m+=l-k),e&&!He(i)&&(i.t=e,i.m+=j-m,c=a)}return c}function f(a){a.x*=i[0],a.y=a.depth*i[1]}var g=jg.layout.hierarchy().sort(null).value(null),h=Ge,i=[1,1],j=null;return a.separation=function(b){return arguments.length?(h=b,a):h},a.size=function(b){return arguments.length?(j=null==(i=b)?f:null,a):j?null:i},a.nodeSize=function(b){return arguments.length?(j=null==(i=b)?null:f,a):j?i:null},fe(a,g)},jg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;he(i,function(a){var b=a.children;b&&b.length?(a.x=Ne(b),a.y=Me(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Oe(i),l=Pe(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return he(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=jg.layout.hierarchy().sort(null).value(null),c=Ge,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},fe(a,b)},jg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++e<f;)d=(c=a[e]).value*(0>b?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++g<h;)(c=a[g].area)&&(f>c&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++f<g;)e=a[f],e.x=h,e.y=j,e.dy=k,h+=e.dx=Math.min(c.x+c.dx-h,k?i(e.area/k):0);e.z=!0,e.dx+=c.x+c.dx-h,c.y+=k,c.dy-=k}else{for((d||k>c.dx)&&(k=c.dx);++f<g;)e=a[f],e.x=h,e.y=j,e.dx=k,j+=e.dy=Math.min(c.y+c.dy-j,k?i(e.area/k):0);e.z=!1,e.dy+=c.y+c.dy-j,c.x+=k,c.dx-=k}}function f(d){var e=g||h(d),f=e[0];return f.x=f.y=0,f.value?(f.dx=j[0],f.dy=j[1]):f.dx=f.dy=0,g&&h.revalue(f),a([f],f.dx*f.dy/f.value),(g?c:b)(f),m&&(g=e),e}var g,h=jg.layout.hierarchy(),i=Math.round,j=[1,1],k=null,l=Qe,m=!1,n="squarify",o=.5*(1+Math.sqrt(5));return f.size=function(a){return arguments.length?(j=a,f):j},f.padding=function(a){function b(b){var c=a.call(f,b,b.depth);return null==c?Qe(b):Re(b,"number"==typeof c?[c,c,c,c]:c)}function c(b){return Re(b,a)}if(!arguments.length)return k;var d;return l=null==(k=a)?Qe:"function"==(d=typeof a)?b:"number"===d?(a=[a,a,a,a],c):c,f},f.round=function(a){return arguments.length?(i=a?Math.round:Number,f):i!=Number},f.sticky=function(a){return arguments.length?(m=a,g=null,f):m},f.ratio=function(a){return arguments.length?(o=a,f):o},f.mode=function(a){return arguments.length?(n=a+"",f):n},fe(f,h)},jg.random={normal:function(a,b){var c=arguments.length;return 2>c&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=jg.random.normal.apply(jg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=jg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},jg.scale={};var yi={floor:u,ceil:u};jg.scale.linear=function(){return Ye([0,1],[0,1],ud,!1)};var zi={s:1,g:1,p:1,r:1,e:1};jg.scale.log=function(){return ef(jg.scale.linear().domain([0,1]),10,!0,[1,10])};var Ai=jg.format(".0e"),Bi={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};jg.scale.pow=function(){return ff(jg.scale.linear(),1,[0,1])},jg.scale.sqrt=function(){return jg.scale.pow().exponent(.5)},jg.scale.ordinal=function(){return hf([],{t:"range",a:[[]]})},jg.scale.category10=function(){return jg.scale.ordinal().range(Ci)},jg.scale.category20=function(){return jg.scale.ordinal().range(Di)},jg.scale.category20b=function(){return jg.scale.ordinal().range(Ei)},jg.scale.category20c=function(){return jg.scale.ordinal().range(Fi)};var Ci=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(va),Di=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(va),Ei=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(va),Fi=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(va);jg.scale.quantile=function(){return jf([],[])},jg.scale.quantize=function(){return kf(0,1,[0,1])},jg.scale.threshold=function(){return lf([.5],[0,1])},jg.scale.identity=function(){return mf([0,1])},jg.svg={},jg.svg.arc=function(){function a(){var a=Math.max(0,+c.apply(this,arguments)),j=Math.max(0,+d.apply(this,arguments)),k=g.apply(this,arguments)-Qg,l=h.apply(this,arguments)-Qg,m=Math.abs(l-k),n=k>l?0:1;if(a>j&&(o=j,j=a,a=o),m>=Pg)return b(j,n)+(a?b(a,1-n):"")+"Z";var o,p,q,r,s,t,u,v,w,x,y,z,A=0,B=0,C=[];if((r=(+i.apply(this,arguments)||0)/2)&&(q=f===Gi?Math.sqrt(a*a+j*j):+f.apply(this,arguments),n||(B*=-1),j&&(B=da(q/j*Math.sin(r))),a&&(A=da(q/a*Math.sin(r)))),j){s=j*Math.cos(k+B),t=j*Math.sin(k+B),u=j*Math.cos(l-B),v=j*Math.sin(l-B);var D=Math.abs(l-k-2*B)<=Ng?0:1;if(B&&tf(s,t,u,v)===n^D){var E=(k+l)/2;s=j*Math.cos(E),t=j*Math.sin(E),u=v=null}}else s=t=0;if(a){w=a*Math.cos(l-A),x=a*Math.sin(l-A),y=a*Math.cos(k+A),z=a*Math.sin(k+A);var F=Math.abs(k-l+2*A)<=Ng?0:1;if(A&&tf(w,x,y,z)===1-n^F){var G=(k+l)/2;w=a*Math.cos(G),x=a*Math.sin(G),y=z=null}}else w=x=0;if(m>Lg&&(o=Math.min(Math.abs(j-a)/2,+e.apply(this,arguments)))>.001){p=j>a^n?0:1;var H=o,I=o;if(Ng>m){var J=null==y?[w,x]:null==u?[s,t]:Jc([s,t],[y,z],[u,v],[w,x]),K=s-J[0],L=t-J[1],M=u-J[0],N=v-J[1],O=1/Math.sin(Math.acos((K*M+L*N)/(Math.sqrt(K*K+L*L)*Math.sqrt(M*M+N*N)))/2),P=Math.sqrt(J[0]*J[0]+J[1]*J[1]);I=Math.min(o,(a-P)/(O-1)),H=Math.min(o,(j-P)/(O+1))}if(null!=u){var Q=uf(null==y?[w,x]:[y,z],[s,t],j,H,n),R=uf([u,v],[w,x],j,H,n);o===H?C.push("M",Q[0],"A",H,",",H," 0 0,",p," ",Q[1],"A",j,",",j," 0 ",1-n^tf(Q[1][0],Q[1][1],R[1][0],R[1][1]),",",n," ",R[1],"A",H,",",H," 0 0,",p," ",R[0]):C.push("M",Q[0],"A",H,",",H," 0 1,",p," ",R[0])}else C.push("M",s,",",t);if(null!=y){var S=uf([s,t],[y,z],a,-I,n),T=uf([w,x],null==u?[s,t]:[u,v],a,-I,n);o===I?C.push("L",T[0],"A",I,",",I," 0 0,",p," ",T[1],"A",a,",",a," 0 ",n^tf(T[1][0],T[1][1],S[1][0],S[1][1]),",",1-n," ",S[1],"A",I,",",I," 0 0,",p," ",S[0]):C.push("L",T[0],"A",I,",",I," 0 0,",p," ",S[0])}else C.push("L",w,",",x)}else C.push("M",s,",",t),null!=u&&C.push("A",j,",",j," 0 ",D,",",n," ",u,",",v),C.push("L",w,",",x),null!=y&&C.push("A",a,",",a," 0 ",F,",",1-n," ",y,",",z);return C.push("Z"),C.join("")}function b(a,b){return"M0,"+a+"A"+a+","+a+" 0 1,"+b+" 0,"+-a+"A"+a+","+a+" 0 1,"+b+" 0,"+a}var c=of,d=pf,e=nf,f=Gi,g=qf,h=rf,i=sf;return a.innerRadius=function(b){return arguments.length?(c=Ca(b),a):c},a.outerRadius=function(b){return arguments.length?(d=Ca(b),a):d},a.cornerRadius=function(b){return arguments.length?(e=Ca(b),a):e},a.padRadius=function(b){return arguments.length?(f=b==Gi?Gi:Ca(b),a):f},a.startAngle=function(b){return arguments.length?(g=Ca(b),a):g},a.endAngle=function(b){return arguments.length?(h=Ca(b),a):h},a.padAngle=function(b){return arguments.length?(i=Ca(b),a):i},a.centroid=function(){var a=(+c.apply(this,arguments)+ +d.apply(this,arguments))/2,b=(+g.apply(this,arguments)+ +h.apply(this,arguments))/2-Qg;return[Math.cos(b)*a,Math.sin(b)*a]},a};var Gi="auto";jg.svg.line=function(){return vf(u)};var Hi=jg.map({linear:wf,"linear-closed":xf,step:yf,"step-before":zf,"step-after":Af,basis:Gf,"basis-open":Hf,"basis-closed":If,bundle:Jf,cardinal:Df,"cardinal-open":Bf,"cardinal-closed":Cf,monotone:Pf});Hi.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var Ii=[0,2/3,1/3,0],Ji=[0,1/3,2/3,0],Ki=[0,1/6,2/3,1/6];jg.svg.line.radial=function(){var a=vf(Qf);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},zf.reverse=Af,Af.reverse=zf,jg.svg.area=function(){return Rf(u)},jg.svg.area.radial=function(){var a=Rf(Qf);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},jg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)-Qg,k=j.call(a,e,d)-Qg;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Ng)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=uc,g=vc,h=Sf,i=qf,j=rf;return a.radius=function(b){return arguments.length?(h=Ca(b),a):h},a.source=function(b){return arguments.length?(f=Ca(b),a):f},a.target=function(b){return arguments.length?(g=Ca(b),a):g},a.startAngle=function(b){return arguments.length?(i=Ca(b),a):i},a.endAngle=function(b){return arguments.length?(j=Ca(b),a):j},a},jg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=uc,c=vc,d=Tf;return a.source=function(c){return arguments.length?(b=Ca(c),a):b},a.target=function(b){return arguments.length?(c=Ca(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},jg.svg.diagonal.radial=function(){var a=jg.svg.diagonal(),b=Tf,c=a.projection;return a.projection=function(a){return arguments.length?c(Uf(b=a)):b},a},jg.svg.symbol=function(){function a(a,d){return(Li.get(b.call(this,a,d))||Xf)(c.call(this,a,d))}var b=Wf,c=Vf;return a.type=function(c){return arguments.length?(b=Ca(c),a):b},a.size=function(b){return arguments.length?(c=Ca(b),a):c},a};var Li=jg.map({circle:Xf,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Ni)),c=b*Ni;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Mi),c=b*Mi/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Mi),c=b*Mi/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});jg.svg.symbolTypes=Li.keys();var Mi=Math.sqrt(3),Ni=Math.tan(30*Rg);Eg.transition=function(a){for(var b,c,d=Oi||++Si,e=ag(a),f=[],g=Pi||{time:Date.now(),ease:Bd,delay:0,duration:250},h=-1,i=this.length;++h<i;){f.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(c=j[k])&&bg(c,k,e,d,g),b.push(c)}return Zf(f,e,d)},Eg.interrupt=function(a){return this.each(null==a?Qi:Yf(ag(a)))};var Oi,Pi,Qi=Yf(ag()),Ri=[],Si=0;Ri.call=Eg.call,Ri.empty=Eg.empty,Ri.node=Eg.node,Ri.size=Eg.size,jg.transition=function(a,b){return a&&a.transition?Oi?a.transition(b):a:jg.selection().transition(a)},jg.transition.prototype=Ri,Ri.select=function(a){var b,c,d,e=this.id,f=this.namespace,g=[];a=E(a);for(var h=-1,i=this.length;++h<i;){g.push(b=[]);for(var j=this[h],k=-1,l=j.length;++k<l;)(d=j[k])&&(c=a.call(d,d.__data__,k,h))?("__data__"in d&&(c.__data__=d.__data__),bg(c,k,f,e,d[f][e]),b.push(c)):b.push(null)}return Zf(g,f,e)},Ri.selectAll=function(a){var b,c,d,e,f,g=this.id,h=this.namespace,i=[];a=F(a);for(var j=-1,k=this.length;++j<k;)for(var l=this[j],m=-1,n=l.length;++m<n;)if(d=l[m]){f=d[h][g],c=a.call(d,d.__data__,m,j),i.push(b=[]);for(var o=-1,p=c.length;++o<p;)(e=c[o])&&bg(e,o,h,g,f),b.push(e)}return Zf(i,h,g)},Ri.filter=function(a){var b,c,d,e=[];"function"!=typeof a&&(a=R(a));for(var f=0,g=this.length;g>f;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h,f)&&b.push(d)}return Zf(e,this.namespace,this.id)},Ri.tween=function(a,b){var c=this.id,d=this.namespace;return arguments.length<2?this.node()[d][c].tween.get(a):T(this,null==b?function(b){b[d][c].tween.remove(a)}:function(e){e[d][c].tween.set(a,b)})},Ri.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?Wd:ud,h=jg.ns.qualify(a);return $f(this,"attr."+a,b,h.local?f:e)},Ri.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=jg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Ri.style=function(a,b,c){function e(){this.style.removeProperty(a)}function f(b){return null==b?e:(b+="",function(){var e,f=d(this).getComputedStyle(this,null).getPropertyValue(a);return f!==b&&(e=ud(f,b),function(b){this.style.setProperty(a,e(b),c)})})}var g=arguments.length;if(3>g){if("string"!=typeof a){2>g&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return $f(this,"style."+a,b,f)},Ri.styleTween=function(a,b,c){function e(e,f){var g=b.call(this,e,f,d(this).getComputedStyle(this,null).getPropertyValue(a));return g&&function(b){this.style.setProperty(a,g(b),c)}}return arguments.length<3&&(c=""),this.tween("style."+a,e)},Ri.text=function(a){return $f(this,"text",a,_f)},Ri.remove=function(){var a=this.namespace;return this.each("end.transition",function(){var b;this[a].count<2&&(b=this.parentNode)&&b.removeChild(this)})},Ri.ease=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].ease:("function"!=typeof a&&(a=jg.ease.apply(jg,arguments)),T(this,function(d){d[c][b].ease=a}))},Ri.delay=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].delay:T(this,"function"==typeof a?function(d,e,f){d[c][b].delay=+a.call(d,d.__data__,e,f)}:(a=+a,function(d){d[c][b].delay=a}))},Ri.duration=function(a){var b=this.id,c=this.namespace;return arguments.length<1?this.node()[c][b].duration:T(this,"function"==typeof a?function(d,e,f){d[c][b].duration=Math.max(1,a.call(d,d.__data__,e,f))}:(a=Math.max(1,a),function(d){d[c][b].duration=a}))},Ri.each=function(a,b){var c=this.id,d=this.namespace;if(arguments.length<2){var e=Pi,f=Oi;try{Oi=c,T(this,function(b,e,f){Pi=b[d][c],a.call(b,b.__data__,e,f)})}finally{Pi=e,Oi=f}}else T(this,function(e){var f=e[d][c];(f.event||(f.event=jg.dispatch("start","end","interrupt"))).on(a,b)});return this},Ri.transition=function(){for(var a,b,c,d,e=this.id,f=++Si,g=this.namespace,h=[],i=0,j=this.length;j>i;i++){h.push(a=[]);for(var b=this[i],k=0,l=b.length;l>k;k++)(c=b[k])&&(d=c[g][e],bg(c,k,g,f,{time:d.time,ease:d.ease,delay:d.delay+d.duration,duration:d.duration})),a.push(c)}return Zf(h,g,f)},jg.svg.axis=function(){function a(a){a.each(function(){var a,j=jg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):u:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Lg),q=jg.transition(o.exit()).style("opacity",Lg).remove(),r=jg.transition(o.order()).style("opacity",1),s=Math.max(e,0)+g,t=Te(l),v=j.selectAll(".domain").data([0]),w=(v.enter().append("path").attr("class","domain"),jg.transition(v));p.append("line"),p.append("text");var x,y,z,A,B=p.select("line"),C=r.select("line"),D=o.select("text").text(n),E=p.select("text"),F=r.select("text"),G="top"===d||"left"===d?-1:1;if("bottom"===d||"top"===d?(a=cg,x="x",z="y",y="x2",A="y2",D.attr("dy",0>G?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+t[0]+","+G*f+"V0H"+t[1]+"V"+G*f)):(a=dg,x="y",z="x",y="y2",A="x2",D.attr("dy",".32em").style("text-anchor",0>G?"end":"start"),w.attr("d","M"+G*f+","+t[0]+"H0V"+t[1]+"H"+G*f)),B.attr(A,G*e),E.attr(z,G*s),C.attr(y,0).attr(A,G*e),F.attr(x,0).attr(z,G*s),l.rangeBand){var H=l,I=H.rangeBand()/2;k=l=function(a){return H(a)+I}}else k.rangeBand?k=l:q.call(a,l,k);p.call(a,k,l),r.call(a,l,l)})}var b,c=jg.scale.linear(),d=Ti,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Ui?b+"":Ti,a):d},a.ticks=function(){return arguments.length?(h=lg(arguments),a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Ti="bottom",Ui={top:1,right:1,bottom:1,left:1};jg.svg.brush=function(){function a(d){d.each(function(){var d=jg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",f).on("touchstart.brush",f),g=d.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),d.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=d.selectAll(".resize").data(p,u);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Vi[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var i,l=jg.transition(d),m=jg.transition(g);j&&(i=Te(j),m.attr("x",i[0]).attr("width",i[1]-i[0]),c(l)),k&&(i=Te(k),m.attr("y",i[0]).attr("height",i[1]-i[0]),e(l)),b(l)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+l[+/e$/.test(a)]+","+m[+/^s/.test(a)]+")"})}function c(a){a.select(".extent").attr("x",l[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function e(a){a.select(".extent").attr("y",m[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function f(){function f(){32==jg.event.keyCode&&(D||(t=null,F[0]-=l[1],F[1]-=m[1],D=2),A())}function p(){32==jg.event.keyCode&&2==D&&(F[0]+=l[1],F[1]+=m[1],D=0,A())}function q(){var a=jg.mouse(v),d=!1;u&&(a[0]+=u[0],a[1]+=u[1]),D||(jg.event.altKey?(t||(t=[(l[0]+l[1])/2,(m[0]+m[1])/2]),F[0]=l[+(a[0]<t[0])],F[1]=m[+(a[1]<t[1])]):t=null),B&&r(a,j,0)&&(c(y),d=!0),C&&r(a,k,1)&&(e(y),d=!0),d&&(b(y),x({type:"brush",mode:D?"move":"resize"}))}function r(a,b,c){var d,e,f=Te(b),i=f[0],j=f[1],k=F[c],p=c?m:l,q=p[1]-p[0];return D&&(i-=k,j-=q+k),d=(c?o:n)?Math.max(i,Math.min(j,a[c])):a[c],D?e=(d+=k)+q:(t&&(k=Math.max(i,Math.min(j,2*t[c]-d))),d>k?(e=d,d=k):e=k),p[0]!=d||p[1]!=e?(c?h=null:g=null,p[0]=d,p[1]=e,!0):void 0}function s(){q(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),jg.select("body").style("cursor",null),G.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),E(),x({type:"brushend"})}var t,u,v=this,w=jg.select(jg.event.target),x=i.of(v,arguments),y=jg.select(v),z=w.datum(),B=!/^(n|s)$/.test(z)&&j,C=!/^(e|w)$/.test(z)&&k,D=w.classed("extent"),E=Z(v),F=jg.mouse(v),G=jg.select(d(v)).on("keydown.brush",f).on("keyup.brush",p);if(jg.event.changedTouches?G.on("touchmove.brush",q).on("touchend.brush",s):G.on("mousemove.brush",q).on("mouseup.brush",s),y.interrupt().selectAll("*").interrupt(),D)F[0]=l[0]-F[0],F[1]=m[0]-F[1];else if(z){var H=+/w$/.test(z),I=+/^n/.test(z);u=[l[1-H]-F[0],m[1-I]-F[1]],F[0]=l[H],F[1]=m[I]}else jg.event.altKey&&(t=F.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),jg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),q()}var g,h,i=C(a,"brushstart","brush","brushend"),j=null,k=null,l=[0,0],m=[0,0],n=!0,o=!0,p=Wi[0];return a.event=function(a){a.each(function(){var a=i.of(this,arguments),b={x:l,y:m,i:g,j:h},c=this.__chart__||b;this.__chart__=b,Oi?jg.select(this).transition().each("start.brush",function(){g=c.i,h=c.j,l=c.x,m=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=vd(l,b.x),d=vd(m,b.y);return g=h=null,function(e){l=b.x=c(e),m=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){g=b.i,h=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(j=b,p=Wi[!j<<1|!k],a):j},a.y=function(b){return arguments.length?(k=b,p=Wi[!j<<1|!k],a):k},a.clamp=function(b){return arguments.length?(j&&k?(n=!!b[0],o=!!b[1]):j?n=!!b:k&&(o=!!b),a):j&&k?[n,o]:j?n:k?o:null},a.extent=function(b){var c,d,e,f,i;return arguments.length?(j&&(c=b[0],d=b[1],k&&(c=c[0],d=d[0]),g=[c,d],j.invert&&(c=j(c),d=j(d)),c>d&&(i=c,c=d,d=i),c==l[0]&&d==l[1]||(l=[c,d])),k&&(e=b[0],f=b[1],j&&(e=e[1],f=f[1]),h=[e,f],k.invert&&(e=k(e),f=k(f)),e>f&&(i=e,e=f,f=i),e==m[0]&&f==m[1]||(m=[e,f])),a):(j&&(g?(c=g[0],d=g[1]):(c=l[0],d=l[1],j.invert&&(c=j.invert(c),d=j.invert(d)),c>d&&(i=c,c=d,d=i))),k&&(h?(e=h[0],f=h[1]):(e=m[0],f=m[1],k.invert&&(e=k.invert(e),f=k.invert(f)),e>f&&(i=e,e=f,f=i))),j&&k?[[c,e],[d,f]]:j?[c,d]:k&&[e,f])},a.clear=function(){return a.empty()||(l=[0,0],m=[0,0],g=h=null),a},a.empty=function(){return!!j&&l[0]==l[1]||!!k&&m[0]==m[1]},jg.rebind(a,i,"on")};var Vi={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Wi=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xi=oh.format=uh.timeFormat,Yi=Xi.utc,Zi=Yi("%Y-%m-%dT%H:%M:%S.%LZ");Xi.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eg:Zi,eg.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},eg.toString=Zi.toString,oh.second=Qa(function(a){return new ph(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),oh.seconds=oh.second.range,oh.seconds.utc=oh.second.utc.range,oh.minute=Qa(function(a){return new ph(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),oh.minutes=oh.minute.range,oh.minutes.utc=oh.minute.utc.range,oh.hour=Qa(function(a){var b=a.getTimezoneOffset()/60;return new ph(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),oh.hours=oh.hour.range,oh.hours.utc=oh.hour.utc.range,oh.month=Qa(function(a){return a=oh.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),oh.months=oh.month.range,oh.months.utc=oh.month.utc.range;var $i=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],_i=[[oh.second,1],[oh.second,5],[oh.second,15],[oh.second,30],[oh.minute,1],[oh.minute,5],[oh.minute,15],[oh.minute,30],[oh.hour,1],[oh.hour,3],[oh.hour,6],[oh.hour,12],[oh.day,1],[oh.day,2],[oh.week,1],[oh.month,1],[oh.month,3],[oh.year,1]],aj=Xi.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Fb]]),bj={range:function(a,b,c){return jg.range(Math.ceil(a/c)*c,+b,c).map(gg)},floor:u,ceil:u};_i.year=oh.year,oh.scale=function(){return fg(jg.scale.linear(),_i,aj)};var cj=_i.map(function(a){return[a[0].utc,a[1]]}),dj=Yi.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Fb]]);cj.year=oh.year.utc,oh.scale.utc=function(){return fg(jg.scale.linear(),cj,dj)},jg.text=Da(function(a){return a.responseText}),jg.json=function(a,b){return Ea(a,"application/json",hg,b)},jg.html=function(a,b){return Ea(a,"text/html",ig,b)},jg.xml=Da(function(a){return a.responseXML}),"function"==typeof a&&a.amd?(this.d3=jg,a(jg)):"object"==typeof c&&c.exports?c.exports=jg:this.d3=jg}()},{}],71:[function(a,b,c){"use strict";function d(a,b){this.point=a,this.index=b}function e(a,b){for(var c=a.point,d=b.point,e=c.length,f=0;e>f;++f){var g=d[f]-c[f];if(g)return g}return 0}function f(a,b,c){if(1===a)return c?[[-1,0]]:[];var d=b.map(function(a,b){return[a[0],b]});d.sort(function(a,b){return a[0]-b[0]});for(var e=new Array(a-1),f=1;a>f;++f){var g=d[f-1],h=d[f];e[f-1]=[g[1],h[1]]}return c&&e.push([-1,e[0][1]],[e[a-1][1],-1]),e}function g(a,b){var c=a.length;if(0===c)return[];var g=a[0].length;if(1>g)return[];if(1===g)return f(c,a,b);for(var j=new Array(c),k=1,l=0;c>l;++l){for(var m=a[l],n=new Array(g+1),o=0,p=0;g>p;++p){ 31 var q=m[p];n[p]=q,o+=q*q}n[g]=o,j[l]=new d(n,l),k=Math.max(o,k)}i(j,e),c=j.length;for(var r=new Array(c+g+1),s=new Array(c+g+1),t=(g+1)*(g+1)*k,u=new Array(g+1),l=0;g>=l;++l)u[l]=0;u[g]=t,r[0]=u.slice(),s[0]=-1;for(var l=0;g>=l;++l){var n=u.slice();n[l]=1,r[l+1]=n,s[l+1]=-1}for(var l=0;c>l;++l){var v=j[l];r[l+g+1]=v.point,s[l+g+1]=v.index}var w=h(r,!1);if(w=b?w.filter(function(a){for(var b=0,c=0;g>=c;++c){var d=s[a[c]];if(0>d&&++b>=2)return!1;a[c]=d}return!0}):w.filter(function(a){for(var b=0;g>=b;++b){var c=s[a[b]];if(0>c)return!1;a[b]=c}return!0}),1&g)for(var l=0;l<w.length;++l){var v=w[l],n=v[0];v[0]=v[1],v[1]=n}return w}var h=a("incremental-convex-hull"),i=a("uniq");b.exports=g},{"incremental-convex-hull":191,uniq:234}],72:[function(a,b,c){"use strict";function d(a,b,c){var e=0|a[c];if(0>=e)return[];var f,g=new Array(e);if(c===a.length-1)for(f=0;e>f;++f)g[f]=b;else for(f=0;e>f;++f)g[f]=d(a,b,c+1);return g}function e(a,b){var c,d;for(c=new Array(a),d=0;a>d;++d)c[d]=b;return c}function f(a,b){switch("undefined"==typeof b&&(b=0),typeof a){case"number":if(a>0)return e(0|a,b);break;case"object":if("number"==typeof a.length)return d(a,b,0)}return[]}b.exports=f},{}],73:[function(b,c,d){(function(d,e){(function(){"use strict";function f(a){return"function"==typeof a||"object"==typeof a&&null!==a}function g(a){return"function"==typeof a}function h(a){return"object"==typeof a&&null!==a}function i(a){U=a}function j(a){Y=a}function k(){return function(){d.nextTick(p)}}function l(){return function(){T(p)}}function m(){var a=0,b=new _(p),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function n(){var a=new MessageChannel;return a.port1.onmessage=p,function(){a.port2.postMessage(0)}}function o(){return function(){setTimeout(p,1)}}function p(){for(var a=0;X>a;a+=2){var b=ca[a],c=ca[a+1];b(c),ca[a]=void 0,ca[a+1]=void 0}X=0}function q(){try{var a=b,c=a("vertx");return T=c.runOnLoop||c.runOnContext,l()}catch(d){return o()}}function r(){}function s(){return new TypeError("You cannot resolve a promise with itself")}function t(){return new TypeError("A promises callback cannot return that same promise.")}function u(a){try{return a.then}catch(b){return ga.error=b,ga}}function v(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function w(a,b,c){Y(function(a){var d=!1,e=v(c,b,function(c){d||(d=!0,b!==c?z(a,c):B(a,c))},function(b){d||(d=!0,C(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,C(a,e))},a)}function x(a,b){b._state===ea?B(a,b._result):b._state===fa?C(a,b._result):D(b,void 0,function(b){z(a,b)},function(b){C(a,b)})}function y(a,b){if(b.constructor===a.constructor)x(a,b);else{var c=u(b);c===ga?C(a,ga.error):void 0===c?B(a,b):g(c)?w(a,b,c):B(a,b)}}function z(a,b){a===b?C(a,s()):f(b)?y(a,b):B(a,b)}function A(a){a._onerror&&a._onerror(a._result),E(a)}function B(a,b){a._state===da&&(a._result=b,a._state=ea,0!==a._subscribers.length&&Y(E,a))}function C(a,b){a._state===da&&(a._state=fa,a._result=b,Y(A,a))}function D(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+ea]=c,e[f+fa]=d,0===f&&a._state&&Y(E,a)}function E(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?H(c,d,e,f):e(f);a._subscribers.length=0}}function F(){this.error=null}function G(a,b){try{return a(b)}catch(c){return ha.error=c,ha}}function H(a,b,c,d){var e,f,h,i,j=g(c);if(j){if(e=G(c,d),e===ha?(i=!0,f=e.error,e=null):h=!0,b===e)return void C(b,t())}else e=d,h=!0;b._state!==da||(j&&h?z(b,e):i?C(b,f):a===ea?B(b,e):a===fa&&C(b,e))}function I(a,b){try{b(function(b){z(a,b)},function(b){C(a,b)})}catch(c){C(a,c)}}function J(a,b){var c=this;c._instanceConstructor=a,c.promise=new a(r),c._validateInput(b)?(c._input=b,c.length=b.length,c._remaining=b.length,c._init(),0===c.length?B(c.promise,c._result):(c.length=c.length||0,c._enumerate(),0===c._remaining&&B(c.promise,c._result))):C(c.promise,c._validationError())}function K(a){return new ia(this,a).promise}function L(a){function b(a){z(e,a)}function c(a){C(e,a)}var d=this,e=new d(r);if(!W(a))return C(e,new TypeError("You must pass an array to race.")),e;for(var f=a.length,g=0;e._state===da&&f>g;g++)D(d.resolve(a[g]),void 0,b,c);return e}function M(a){var b=this;if(a&&"object"==typeof a&&a.constructor===b)return a;var c=new b(r);return z(c,a),c}function N(a){var b=this,c=new b(r);return C(c,a),c}function O(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function P(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function Q(a){this._id=na++,this._state=void 0,this._result=void 0,this._subscribers=[],r!==a&&(g(a)||O(),this instanceof Q||P(),I(this,a))}function R(){var a;if("undefined"!=typeof e)a=e;else if("undefined"!=typeof self)a=self;else try{a=Function("return this")()}catch(b){throw new Error("polyfill failed because global object is unavailable in this environment")}var c=a.Promise;c&&"[object Promise]"===Object.prototype.toString.call(c.resolve())&&!c.cast||(a.Promise=oa)}var S;S=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var T,U,V,W=S,X=0,Y=({}.toString,function(a,b){ca[X]=a,ca[X+1]=b,X+=2,2===X&&(U?U(p):V())}),Z="undefined"!=typeof window?window:void 0,$=Z||{},_=$.MutationObserver||$.WebKitMutationObserver,aa="undefined"!=typeof d&&"[object process]"==={}.toString.call(d),ba="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ca=new Array(1e3);V=aa?k():_?m():ba?n():void 0===Z&&"function"==typeof b?q():o();var da=void 0,ea=1,fa=2,ga=new F,ha=new F;J.prototype._validateInput=function(a){return W(a)},J.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},J.prototype._init=function(){this._result=new Array(this.length)};var ia=J;J.prototype._enumerate=function(){for(var a=this,b=a.length,c=a.promise,d=a._input,e=0;c._state===da&&b>e;e++)a._eachEntry(d[e],e)},J.prototype._eachEntry=function(a,b){var c=this,d=c._instanceConstructor;h(a)?a.constructor===d&&a._state!==da?(a._onerror=null,c._settledAt(a._state,b,a._result)):c._willSettleAt(d.resolve(a),b):(c._remaining--,c._result[b]=a)},J.prototype._settledAt=function(a,b,c){var d=this,e=d.promise;e._state===da&&(d._remaining--,a===fa?C(e,c):d._result[b]=c),0===d._remaining&&B(e,d._result)},J.prototype._willSettleAt=function(a,b){var c=this;D(a,void 0,function(a){c._settledAt(ea,b,a)},function(a){c._settledAt(fa,b,a)})};var ja=K,ka=L,la=M,ma=N,na=0,oa=Q;Q.all=ja,Q.race=ka,Q.resolve=la,Q.reject=ma,Q._setScheduler=i,Q._setAsap=j,Q._asap=Y,Q.prototype={constructor:Q,then:function(a,b){var c=this,d=c._state;if(d===ea&&!a||d===fa&&!b)return this;var e=new this.constructor(r),f=c._result;if(d){var g=arguments[d-1];Y(function(){H(d,e,g,f)})}else D(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var pa=R,qa={Promise:oa,polyfill:pa};"function"==typeof a&&a.amd?a(function(){return qa}):"undefined"!=typeof c&&c.exports?c.exports=qa:"undefined"!=typeof this&&(this.ES6Promise=qa),pa()}).call(this)}).call(this,b("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:55}],74:[function(a,b,c){"use strict";function d(a){for(var b,c=a.length,d=0;c>d;d++)if(b=a.charCodeAt(d),(9>b||b>13)&&32!==b&&133!==b&&160!==b&&5760!==b&&6158!==b&&(8192>b||b>8205)&&8232!==b&&8233!==b&&8239!==b&&8287!==b&&8288!==b&&12288!==b&&65279!==b)return!1;return!0}b.exports=function(a){var b=typeof a;if("string"===b){var c=a;if(a=+a,0===a&&d(c))return!1}else if("number"!==b)return!1;return 1>a-a}},{}],75:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.gl=a,this.type=b,this.handle=c,this.length=d,this.usage=e}function e(a,b,c,d,e,f){var g=e.length*e.BYTES_PER_ELEMENT;if(0>f)return a.bufferData(b,e,d),g;if(g+f>c)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return a.bufferSubData(b,f,e),c}function f(a,b){for(var c=i.malloc(a.length,b),d=a.length,e=0;d>e;++e)c[e]=a[e];return c}function g(a,b){for(var c=1,d=b.length-1;d>=0;--d){if(b[d]!==c)return!1;c*=a[d]}return!0}function h(a,b,c,e){if(c=c||a.ARRAY_BUFFER,e=e||a.DYNAMIC_DRAW,c!==a.ARRAY_BUFFER&&c!==a.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(e!==a.DYNAMIC_DRAW&&e!==a.STATIC_DRAW&&e!==a.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var f=a.createBuffer(),g=new d(a,c,f,0,e);return g.update(b),g}var i=a("typedarray-pool"),j=a("ndarray-ops"),k=a("ndarray"),l=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],m=d.prototype;m.bind=function(){this.gl.bindBuffer(this.type,this.handle)},m.unbind=function(){this.gl.bindBuffer(this.type,null)},m.dispose=function(){this.gl.deleteBuffer(this.handle)},m.update=function(a,b){if("number"!=typeof b&&(b=-1),this.bind(),"object"==typeof a&&"undefined"!=typeof a.shape){var c=a.dtype;if(l.indexOf(c)<0&&(c="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var d=gl.getExtension("OES_element_index_uint");c=d&&"uint16"!==c?"uint32":"uint16"}if(c===a.dtype&&g(a.shape,a.stride))0===a.offset&&a.data.length===a.shape[0]?this.length=e(this.gl,this.type,this.length,this.usage,a.data,b):this.length=e(this.gl,this.type,this.length,this.usage,a.data.subarray(a.offset,a.shape[0]),b);else{var h=i.malloc(a.size,c),m=k(h,a.shape);j.assign(m,a),0>b?this.length=e(this.gl,this.type,this.length,this.usage,h,b):this.length=e(this.gl,this.type,this.length,this.usage,h.subarray(0,a.size),b),i.free(h)}}else if(Array.isArray(a)){var n;n=this.type===this.gl.ELEMENT_ARRAY_BUFFER?f(a,"uint16"):f(a,"float32"),0>b?this.length=e(this.gl,this.type,this.length,this.usage,n,b):this.length=e(this.gl,this.type,this.length,this.usage,n.subarray(0,a.length),b),i.free(n)}else if("object"==typeof a&&"number"==typeof a.length)this.length=e(this.gl,this.type,this.length,this.usage,a,b);else{if("number"!=typeof a&&void 0!==a)throw new Error("gl-buffer: Invalid data type");if(b>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");a=0|a,0>=a&&(a=1),this.gl.bufferData(this.type,0|a,this.usage),this.length=a}},b.exports=h},{ndarray:208,"ndarray-ops":207,"typedarray-pool":233}],76:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.shader=b,this.buffer=c,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.color=[0,0,0,1]}function e(a,b){var c=f(a.gl,i.vertex,i.fragment),e=g(a.gl),h=new d(a,c,e);return h.update(b),a.addObject(h),h}var f=a("gl-shader"),g=a("gl-buffer"),h=a("typedarray-pool"),i=a("./lib/shaders");b.exports=e;var j=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],k=d.prototype;k.draw=function(){var a=[1,0,0,0,1,0,0,0,1],b=[1,1];return function(){var c=this.plot,d=this.shader,e=this.buffer,f=this.bounds,g=this.numPoints,h=(this.color,c.gl),i=c.dataBox,k=c.viewBox,l=c.pixelRatio,m=f[2]-f[0],n=f[3]-f[1],o=i[2]-i[0],p=i[3]-i[1];a[0]=2*m/o,a[4]=2*n/p,a[6]=2*(f[0]-i[0])/o-1,a[7]=2*(f[1]-i[1])/p-1;var q=k[2]-k[0],r=k[3]-k[1];b[0]=2*l/q,b[1]=2*l/r,e.bind(),d.bind(),d.uniforms.viewTransform=a,d.uniforms.pixelScale=b,d.uniforms.color=this.color,d.attributes.position.pointer(h.FLOAT,!1,16,0),d.attributes.pixelOffset.pointer(h.FLOAT,!1,16,8),h.drawArrays(h.TRIANGLES,0,g*j.length)}}(),k.drawPick=function(a){return a},k.pick=function(a,b){return null},k.update=function(a){a=a||{};var b=a.positions||[],c=a.errors||[],d=1;"lineWidth"in a&&(d=+a.lineWidth);var e=5;"capSize"in a&&(e=+a.capSize),this.color=(a.color||[0,0,0,1]).slice();for(var f=this.bounds=[1/0,1/0,-(1/0),-(1/0)],g=this.numPoints=b.length>>1,i=0;g>i;++i){var k=b[2*i],l=b[2*i+1];f[0]=Math.min(k,f[0]),f[1]=Math.min(l,f[1]),f[2]=Math.max(k,f[2]),f[3]=Math.max(l,f[3])}f[2]===f[0]&&(f[2]+=1),f[3]===f[1]&&(f[3]+=1);for(var m=1/(f[2]-f[0]),n=1/(f[3]-f[1]),o=f[0],p=f[1],q=h.mallocFloat32(g*j.length*4),r=0,i=0;g>i;++i)for(var k=b[2*i],l=b[2*i+1],s=c[4*i],t=c[4*i+1],u=c[4*i+2],v=c[4*i+3],w=0;w<j.length;++w){var x=j[w],y=x[0],z=x[1];0>y?y*=s:y>0&&(y*=t),0>z?z*=u:z>0&&(z*=v),q[r++]=m*(k-o+y),q[r++]=n*(l-p+z),q[r++]=d*x[2]+(e+d)*x[4],q[r++]=d*x[3]+(e+d)*x[5]}this.buffer.update(q),h.free(q)},k.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.buffer.dispose()}},{"./lib/shaders":77,"gl-buffer":75,"gl-shader":154,"typedarray-pool":233}],77:[function(a,b,c){b.exports={vertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 pixelOffset;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvoid main() {\n vec3 scrPosition = viewTransform * vec3(position, 1);\n gl_Position = vec4(\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\n 0,\n scrPosition.z);\n}\n",fragment:"#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"}},{}],78:[function(a,b,c){"use strict";function d(a,b,c,d){this.gl=a,this.shader=d,this.buffer=b,this.vao=c,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function e(a,b){for(var c=0;3>c;++c)a[0][c]=Math.min(a[0][c],b[c]),a[1][c]=Math.max(a[1][c],b[c])}function f(a,b,c,d){for(var e=m[d],f=0;f<e.length;++f){var g=e[f];a.push(b[0],b[1],b[2],c[0],c[1],c[2],c[3],g[0],g[1],g[2])}return e.length}function g(a){var b=a.gl,c=h(b),e=i(b,[{buffer:c,type:b.FLOAT,size:3,offset:0,stride:40},{buffer:c,type:b.FLOAT,size:4,offset:12,stride:40},{buffer:c,type:b.FLOAT,size:3,offset:28,stride:40}]),f=j(b);f.attributes.position.location=0,f.attributes.color.location=1,f.attributes.offset.location=2;var g=new d(b,c,e,f);return g.update(a),g}b.exports=g;var h=a("gl-buffer"),i=a("gl-vao"),j=a("./shaders/index"),k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=d.prototype;l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.drawTransparent=l.draw=function(a){var b=this.gl,c=this.shader.uniforms;this.shader.bind();var d=c.view=a.view||k,e=c.projection=a.projection||k;c.model=a.model||k,c.clipBounds=this.clipBounds,c.opacity=this.opacity;var f=d[12],g=d[13],h=d[14],i=d[15],j=this.pixelRatio*(e[3]*f+e[7]*g+e[11]*h+e[15]*i)/b.drawingBufferHeight;this.vao.bind();for(var l=0;3>l;++l)b.lineWidth(this.lineWidth[l]),c.capSize=this.capSize[l]*j,b.drawArrays(b.LINES,this.lineOffset[l],this.lineCount[l]);this.vao.unbind()};var m=function(){for(var a=new Array(3),b=0;3>b;++b){for(var c=[],d=1;2>=d;++d)for(var e=-1;1>=e;e+=2){var f=(d+b)%3,g=[0,0,0];g[f]=e,c.push(g)}a[b]=c}return a}();l.update=function(a){a=a||{},"lineWidth"in a&&(this.lineWidth=a.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in a&&(this.capSize=a.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in a&&(this.opacity=a.opacity);var b=a.color||[[0,0,0],[0,0,0],[0,0,0]],c=a.position,d=a.error;if(Array.isArray(b[0])||(b=[b,b,b]),c&&d){var g=[],h=c.length,i=0;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.lineCount=[0,0,0];for(var j=0;3>j;++j){this.lineOffset[j]=i;a:for(var k=0;h>k;++k){for(var l=c[k],m=0;3>m;++m)if(isNaN(l[m])||!isFinite(l[m]))continue a;var n=d[k],o=b[j];if(Array.isArray(o[0])&&(o=b[k]),3===o.length&&(o=[o[0],o[1],o[2],1]),!isNaN(n[0][j])&&!isNaN(n[1][j])){if(n[0][j]<0){var p=l.slice();p[j]+=n[0][j],g.push(l[0],l[1],l[2],o[0],o[1],o[2],o[3],0,0,0,p[0],p[1],p[2],o[0],o[1],o[2],o[3],0,0,0),e(this.bounds,p),i+=2+f(g,p,o,j)}if(n[1][j]>0){var p=l.slice();p[j]+=n[1][j],g.push(l[0],l[1],l[2],o[0],o[1],o[2],o[3],0,0,0,p[0],p[1],p[2],o[0],o[1],o[2],o[3],0,0,0),e(this.bounds,p),i+=2+f(g,p,o,j)}}}this.lineCount[j]=i-this.lineOffset[j]}this.buffer.update(g)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":79,"gl-buffer":75,"gl-vao":189}],79:[function(a,b,c){"use strict";var d=a("gl-shader"),e="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}",f="#define GLSLIFY 1\nprecision mediump float;\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = opacity * fragColor;\n}";b.exports=function(a){return d(a,e,f,null,[{name:"position",type:"vec3"},{name:"offset",type:"vec3"},{name:"color",type:"vec4"}])}},{"gl-shader":154}],80:[function(a,b,c){"use strict";function d(a){var b=a.getParameter(a.FRAMEBUFFER_BINDING),c=a.getParameter(a.RENDERBUFFER_BINDING),d=a.getParameter(a.TEXTURE_BINDING_2D);return[b,c,d]}function e(a,b){a.bindFramebuffer(a.FRAMEBUFFER,b[0]),a.bindRenderbuffer(a.RENDERBUFFER,b[1]),a.bindTexture(a.TEXTURE_2D,b[2])}function f(a,b){var c=a.getParameter(b.MAX_COLOR_ATTACHMENTS_WEBGL);s=new Array(c+1);for(var d=0;c>=d;++d){for(var e=new Array(c),f=0;d>f;++f)e[f]=a.COLOR_ATTACHMENT0+f;for(var f=d;c>f;++f)e[f]=a.NONE;s[d]=e}}function g(a){switch(a){case o:throw new Error("gl-fbo: Framebuffer unsupported");case p:throw new Error("gl-fbo: Framebuffer incomplete attachment");case q:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case r:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(a,b,c,d,e,f){if(!d)return null;var g=n(a,b,c,e,d);return g.magFilter=a.NEAREST,g.minFilter=a.NEAREST,g.mipSamples=1,g.bind(),a.framebufferTexture2D(a.FRAMEBUFFER,f,a.TEXTURE_2D,g.handle,0),g}function i(a,b,c,d,e){var f=a.createRenderbuffer();return a.bindRenderbuffer(a.RENDERBUFFER,f),a.renderbufferStorage(a.RENDERBUFFER,d,b,c),a.framebufferRenderbuffer(a.FRAMEBUFFER,e,a.RENDERBUFFER,f),f}function j(a){var b=d(a.gl),c=a.gl,f=a.handle=c.createFramebuffer(),j=a._shape[0],k=a._shape[1],l=a.color.length,m=a._ext,n=a._useStencil,o=a._useDepth,p=a._colorType;c.bindFramebuffer(c.FRAMEBUFFER,f);for(var q=0;l>q;++q)a.color[q]=h(c,j,k,p,c.RGBA,c.COLOR_ATTACHMENT0+q);0===l?(a._color_rb=i(c,j,k,c.RGBA4,c.COLOR_ATTACHMENT0),m&&m.drawBuffersWEBGL(s[0])):l>1&&m.drawBuffersWEBGL(s[l]);var r=c.getExtension("WEBGL_depth_texture");r?n?a.depth=h(c,j,k,r.UNSIGNED_INT_24_8_WEBGL,c.DEPTH_STENCIL,c.DEPTH_STENCIL_ATTACHMENT):o&&(a.depth=h(c,j,k,c.UNSIGNED_SHORT,c.DEPTH_COMPONENT,c.DEPTH_ATTACHMENT)):o&&n?a._depth_rb=i(c,j,k,c.DEPTH_STENCIL,c.DEPTH_STENCIL_ATTACHMENT):o?a._depth_rb=i(c,j,k,c.DEPTH_COMPONENT16,c.DEPTH_ATTACHMENT):n&&(a._depth_rb=i(c,j,k,c.STENCIL_INDEX,c.STENCIL_ATTACHMENT));var t=c.checkFramebufferStatus(c.FRAMEBUFFER);if(t!==c.FRAMEBUFFER_COMPLETE){a._destroyed=!0,c.bindFramebuffer(c.FRAMEBUFFER,null),c.deleteFramebuffer(a.handle),a.handle=null,a.depth&&(a.depth.dispose(),a.depth=null),a._depth_rb&&(c.deleteRenderbuffer(a._depth_rb),a._depth_rb=null);for(var q=0;q<a.color.length;++q)a.color[q].dispose(),a.color[q]=null;a._color_rb&&(c.deleteRenderbuffer(a._color_rb),a._color_rb=null),e(c,b),g(t)}e(c,b)}function k(a,b,c,d,e,f,g,h){this.gl=a,this._shape=[0|b,0|c],this._destroyed=!1,this._ext=h,this.color=new Array(e);for(var i=0;e>i;++i)this.color[i]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=d,this._useDepth=f,this._useStencil=g;var k=this,l=[0|b,0|c];Object.defineProperties(l,{0:{get:function(){return k._shape[0]},set:function(a){return k.width=a}},1:{get:function(){return k._shape[1]},set:function(a){return k.height=a}}}),this._shapeVector=l,j(this)}function l(a,b,c){if(a._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(a._shape[0]!==b||a._shape[1]!==c){var f=a.gl,h=f.getParameter(f.MAX_RENDERBUFFER_SIZE);if(0>b||b>h||0>c||c>h)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");a._shape[0]=b,a._shape[1]=c;for(var i=d(f),j=0;j<a.color.length;++j)a.color[j].shape=a._shape;a._color_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,a._color_rb),f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,a._shape[0],a._shape[1])),a.depth&&(a.depth.shape=a._shape),a._depth_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,a._depth_rb),a._useDepth&&a._useStencil?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,a._shape[0],a._shape[1]):a._useDepth?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,a._shape[0],a._shape[1]):a._useStencil&&f.renderbufferStorage(f.RENDERBUFFER,f.STENCIL_INDEX,a._shape[0],a._shape[1])),f.bindFramebuffer(f.FRAMEBUFFER,a.handle);var k=f.checkFramebufferStatus(f.FRAMEBUFFER);k!==f.FRAMEBUFFER_COMPLETE&&(a.dispose(),e(f,i),g(k)),e(f,i)}}function m(a,b,c,d){o||(o=a.FRAMEBUFFER_UNSUPPORTED,p=a.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,q=a.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,r=a.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var e=a.getExtension("WEBGL_draw_buffers");if(!s&&e&&f(a,e),Array.isArray(b)&&(d=c,c=0|b[1],b=0|b[0]),"number"!=typeof b)throw new Error("gl-fbo: Missing shape parameter");var g=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(0>b||b>g||0>c||c>g)throw new Error("gl-fbo: Parameters are too large for FBO");d=d||{};var h=1;if("color"in d){if(h=Math.max(0|d.color,0),0>h)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!e)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>a.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var i=a.UNSIGNED_BYTE,j=a.getExtension("OES_texture_float");if(d["float"]&&h>0){if(!j)throw new Error("gl-fbo: Context does not support floating point textures");i=a.FLOAT}else d.preferFloat&&h>0&&j&&(i=a.FLOAT);var l=!0;"depth"in d&&(l=!!d.depth);var m=!1;return"stencil"in d&&(m=!!d.stencil),new k(a,b,c,i,h,l,m,e)}var n=a("gl-texture2d");b.exports=m;var o,p,q,r,s=null,t=k.prototype;Object.defineProperties(t,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(a){if(Array.isArray(a)||(a=[0|a,0|a]),2!==a.length)throw new Error("gl-fbo: Shape vector must be length 2");var b=0|a[0],c=0|a[1];return l(this,b,c),[b,c]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(a){return a=0|a,l(this,a,this._shape[1]),a},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(a){return a=0|a,l(this,this._shape[0],a),a},enumerable:!1}}),t.bind=function(){if(!this._destroyed){var a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,this.handle),a.viewport(0,0,this._shape[0],this._shape[1])}},t.dispose=function(){if(!this._destroyed){this._destroyed=!0;var a=this.gl;a.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(a.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var b=0;b<this.color.length;++b)this.color[b].dispose(),this.color[b]=null;this._color_rb&&(a.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":185}],81:[function(a,b,c){c.lineVertex="#define GLSLIFY 1\nprecision mediump float;\n\nfloat inverse_1_0(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse_1_0(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse_1_0(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse_1_0(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\n\n\nattribute vec2 a, d;\n\nuniform mat3 matrix;\nuniform vec2 screenShape;\nuniform float width;\n\nvarying vec2 direction;\n\nvoid main() {\n vec2 dir = (matrix * vec3(d, 0)).xy;\n vec3 base = matrix * vec3(a, 1);\n vec2 n = 0.5 * width *\n normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\n vec2 tangent = normalize(screenShape.xy * dir);\n if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\n direction = -tangent;\n } else {\n direction = tangent;\n }\n gl_Position = vec4(base.xy/base.z + n, 0, 1);\n}\n",c.lineFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\nuniform vec2 screenShape;\nuniform sampler2D dashPattern;\nuniform float dashLength;\n\nvarying vec2 direction;\n\nvoid main() {\n float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\n vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\n gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\n}\n",c.mitreVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 p;\n\nuniform mat3 matrix;\nuniform vec2 screenShape;\nuniform float radius;\n\nvoid main() {\n vec3 pp = matrix * vec3(p, 1);\n gl_Position = vec4(pp.xy, 0, pp.z);\n gl_PointSize = radius;\n}\n",c.mitreFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n if(length(gl_PointCoord.xy - 0.5) > 0.25) {\n discard;\n }\n gl_FragColor = vec4(color.rgb, color.a);\n}\n",c.pickVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 a, d;\nattribute vec4 pick0, pick1;\n\nuniform mat3 matrix;\nuniform vec2 screenShape;\nuniform float width;\n\nvarying vec4 pickA, pickB;\n\nfloat inverse_1_0(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse_1_0(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse_1_0(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse_1_0(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\n\n\nvoid main() {\n vec3 base = matrix * vec3(a, 1);\n vec2 n = width *\n normalize(screenShape.yx * vec2(d.y, -d.x)) / screenShape.xy;\n gl_Position = vec4(base.xy/base.z + n, 0, 1);\n pickA = pick0;\n pickB = pick1;\n}\n",c.pickFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 pickOffset;\n\nvarying vec4 pickA, pickB;\n\nvoid main() {\n vec4 fragId = vec4(pickA.xyz, 0.0);\n if(pickB.w > pickA.w) {\n fragId.xyz = pickB.xyz;\n }\n\n fragId += pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n gl_FragColor = fragId / 255.0;\n}\n",c.fillVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 a, d;\n\nuniform mat3 matrix;\nuniform vec2 projectAxis;\nuniform float projectValue;\nuniform float depth;\n\nvoid main() {\n vec3 base = matrix * vec3(a, 1);\n vec2 p = base.xy / base.z;\n if(d.y < 0.0 || (d.y == 0.0 && d.x < 0.0)) {\n if(dot(p, projectAxis) < projectValue) {\n p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\n }\n }\n gl_Position = vec4(p, depth, 1);\n}\n",c.fillFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"; 32 },{}],82:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h){this.plot=a,this.dashPattern=b,this.lineBuffer=c,this.pickBuffer=d,this.lineShader=e,this.mitreShader=f,this.fillShader=g,this.pickShader=h,this.usingDashes=!1,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0,this.lodBuffer=[]}function e(a){return a.map(function(a){return a.slice()})}function f(a,b){var c=a.gl,e=h(c),f=h(c),j=i(c,[1,1]),k=g(c,l.lineVertex,l.lineFragment),m=g(c,l.mitreVertex,l.mitreFragment),n=g(c,l.fillVertex,l.fillFragment),o=g(c,l.pickVertex,l.pickFragment),p=new d(a,j,e,f,k,m,n,o);return a.addObject(p),p.update(b),p}b.exports=f;var g=a("gl-shader"),h=a("gl-buffer"),i=a("gl-texture2d"),j=a("ndarray"),k=a("typedarray-pool"),l=a("./lib/shaders"),m=d.prototype;m.draw=function(){var a=[1,0,0,0,1,0,0,0,1],b=[0,0],c=[1,0],d=[-1,0],e=[0,1],f=[0,-1];return function(){var g=this.plot,h=this.color,i=this.width,j=(this.numPoints,this.bounds),k=this.vertCount,l=g.gl,m=g.viewBox,n=g.dataBox,o=g.pixelRatio,p=j[2]-j[0],q=j[3]-j[1],r=n[2]-n[0],s=n[3]-n[1],t=m[2]-m[0],u=m[3]-m[1];a[0]=2*p/r,a[4]=2*q/s,a[6]=2*(j[0]-n[0])/r-1,a[7]=2*(j[1]-n[1])/s-1,b[0]=t,b[1]=u;var v=this.lineBuffer;v.bind();var w=this.fill;if(w[0]||w[1]||w[2]||w[3]){var x=this.fillShader;x.bind();var y=x.uniforms;y.matrix=a,y.depth=g.nextDepthValue();var z=x.attributes;z.a.pointer(l.FLOAT,!1,16,0),z.d.pointer(l.FLOAT,!1,16,8),l.depthMask(!0),l.enable(l.DEPTH_TEST);var A=this.fillColor;w[0]&&(y.color=A[0],y.projectAxis=d,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),w[1]&&(y.color=A[1],y.projectAxis=f,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),w[2]&&(y.color=A[2],y.projectAxis=c,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),w[3]&&(y.color=A[3],y.projectAxis=e,y.projectValue=1,l.drawArrays(l.TRIANGLES,0,k)),l.depthMask(!1),l.disable(l.DEPTH_TEST)}var B=this.lineShader;B.bind();var C=B.uniforms;C.matrix=a,C.color=h,C.width=i*o,C.screenShape=b,C.dashPattern=this.dashPattern.bind(),C.dashLength=this.dashLength*o;var D=B.attributes;if(D.a.pointer(l.FLOAT,!1,16,0),D.d.pointer(l.FLOAT,!1,16,8),l.drawArrays(l.TRIANGLES,0,k),i>2&&!this.usingDashes){var E=this.mitreShader;E.bind();var F=E.uniforms;F.matrix=a,F.color=h,F.screenShape=b,F.radius=i*o,E.attributes.p.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,k/3|0)}}}(),m.drawPick=function(){var a=[1,0,0,0,1,0,0,0,1],b=[0,0],c=[0,0,0,0];return function(d){var e=this.plot,f=this.pickShader,g=this.lineBuffer,h=this.pickBuffer,i=this.width,j=this.numPoints,k=this.bounds,l=this.vertCount,m=e.gl,n=e.viewBox,o=e.dataBox,p=e.pickPixelRatio,q=k[2]-k[0],r=k[3]-k[1],s=o[2]-o[0],t=o[3]-o[1],u=n[2]-n[0],v=n[3]-n[1];this.pickOffset=d,a[0]=2*q/s,a[4]=2*r/t,a[6]=2*(k[0]-o[0])/s-1,a[7]=2*(k[1]-o[1])/t-1,b[0]=u,b[1]=v,c[0]=255&d,c[1]=d>>>8&255,c[2]=d>>>16&255,c[3]=d>>>24,f.bind();var w=f.uniforms;w.matrix=a,w.width=i*p,w.pickOffset=c,w.screenShape=b;var x=f.attributes;return g.bind(),x.a.pointer(m.FLOAT,!1,16,0),x.d.pointer(m.FLOAT,!1,16,8),h.bind(),x.pick0.pointer(m.UNSIGNED_BYTE,!1,8,0),x.pick1.pointer(m.UNSIGNED_BYTE,!1,8,4),m.drawArrays(m.TRIANGLES,0,l),d+j}}(),m.pick=function(a,b,c){var d=this.pickOffset,e=this.numPoints;if(d>c||c>=d+e)return null;var f=c-d,g=this.data;return{object:this,pointId:f,dataCoord:[g[2*f],g[2*f+1]]}},m.update=function(a){a=a||{};var b=this.plot.gl;this.color=(a.color||[0,0,1,1]).slice(),this.width=+(a.width||1),this.fill=(a.fill||[!1,!1,!1,!1]).slice(),this.fillColor=e(a.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);for(var c=a.dashes||[1],d=0,f=0;f<c.length;++f)d+=c[f];for(var g=k.mallocUint8(d),h=0,l=255,f=0;f<c.length;++f){for(var m=0;m<c[f];++m)g[h++]=l;l^=255}this.dashPattern.dispose(),this.usingDashes=c.length>1,this.dashPattern=i(b,j(g,[d,1,4],[1,0,0])),this.dashPattern.minFilter=b.NEAREST,this.dashPattern.magFilter=b.NEAREST,this.dashLength=d,k.free(g);var n=a.positions;this.data=n;var o=this.bounds;o[0]=o[1]=1/0,o[2]=o[3]=-(1/0);var p=this.numPoints=n.length>>>1;if(0!==p){for(var f=0;p>f;++f){var q=n[2*f],r=n[2*f+1];o[0]=Math.min(o[0],q),o[1]=Math.min(o[1],r),o[2]=Math.max(o[2],q),o[3]=Math.max(o[3],r)}o[0]===o[2]&&(o[2]+=1),o[3]===o[1]&&(o[3]+=1);var s=k.mallocFloat32(24*(p-1)),t=k.mallocUint32(12*(p-1)),u=s.length,v=t.length,h=p;for(this.vertCount=6*(p-1);h>1;){var w=--h,q=n[2*h],r=n[2*h+1];q=(q-o[0])/(o[2]-o[0]),r=(r-o[1])/(o[3]-o[1]);var x=w-1,y=n[2*x],z=n[2*x+1];y=(y-o[0])/(o[2]-o[0]),z=(z-o[1])/(o[3]-o[1]);var A=y-q,B=z-r,C=w|1<<24,D=w-1,E=w,F=w-1|1<<24;s[--u]=-B,s[--u]=-A,s[--u]=r,s[--u]=q,t[--v]=C,t[--v]=D,s[--u]=B,s[--u]=A,s[--u]=z,s[--u]=y,t[--v]=E,t[--v]=F,s[--u]=-B,s[--u]=-A,s[--u]=z,s[--u]=y,t[--v]=E,t[--v]=F,s[--u]=B,s[--u]=A,s[--u]=z,s[--u]=y,t[--v]=E,t[--v]=F,s[--u]=-B,s[--u]=-A,s[--u]=r,s[--u]=q,t[--v]=C,t[--v]=D,s[--u]=B,s[--u]=A,s[--u]=r,s[--u]=q,t[--v]=C,t[--v]=D}this.lineBuffer.update(s),this.pickBuffer.update(t),k.free(s),k.free(t)}},m.dispose=function(){this.plot.removeObject(this),this.lineBuffer.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{"./lib/shaders":81,"gl-buffer":75,"gl-shader":154,"gl-texture2d":185,ndarray:208,"typedarray-pool":233}],83:[function(a,b,c){var d=a("gl-shader"),e="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvoid main() {\n vec4 projected = projection * view * model * vec4(position, 1.0);\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\n vec2 tangent = normalize(screenShape * tangentClip.xy);\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\n\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n",f="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n",g="#define GLSLIFY 1\nprecision mediump float;\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1_0(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",h=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];c.createShader=function(a){return d(a,e,f,null,h)},c.createPickShader=function(a){return d(a,e,g,null,h)}},{"gl-shader":154}],84:[function(a,b,c){"use strict";function d(a,b){for(var c=0,d=0;3>d;++d){var e=a[d]-b[d];c+=e*e}return Math.sqrt(c)}function e(a){for(var b=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],c=0;3>c;++c)b[0][c]=Math.max(a[0][c],b[0][c]),b[1][c]=Math.min(a[1][c],b[1][c]);return b}function f(a,b,c,d){this.arcLength=a,this.position=b,this.index=c,this.dataCoordinate=d}function g(a,b,c,d,e,f){this.gl=a,this.shader=b,this.pickShader=c,this.buffer=d,this.vao=e,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=f,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function h(a){var b=a.gl||a.scene&&a.scene.gl,c=p(b);c.attributes.position.location=0,c.attributes.nextPosition.location=1,c.attributes.arcLength.location=2,c.attributes.lineWidth.location=3,c.attributes.color.location=4;var d=q(b);d.attributes.position.location=0,d.attributes.nextPosition.location=1,d.attributes.arcLength.location=2,d.attributes.lineWidth.location=3,d.attributes.color.location=4;for(var e=i(b),f=j(b,[{buffer:e,size:3,offset:0,stride:48},{buffer:e,size:3,offset:12,stride:48},{buffer:e,size:1,offset:24,stride:48},{buffer:e,size:1,offset:28,stride:48},{buffer:e,size:4,offset:32,stride:48}]),h=n(new Array(1024),[256,1,4]),l=0;1024>l;++l)h.data[l]=255;var m=k(b,h);m.wrap=b.REPEAT;var o=new g(b,c,d,e,f,m);return o.update(a),o}b.exports=h;var i=a("gl-buffer"),j=a("gl-vao"),k=a("gl-texture2d"),l=a("glsl-read-float"),m=a("binary-search-bounds"),n=a("ndarray"),o=a("./lib/shaders"),p=o.createShader,q=o.createPickShader,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],s=g.prototype;s.isTransparent=function(){return this.opacity<1},s.isOpaque=function(){return this.opacity>=1},s.pickSlots=1,s.setPickBase=function(a){this.pickId=a},s.drawTransparent=s.draw=function(a){var b=this.gl,c=this.shader,d=this.vao;c.bind(),c.uniforms={model:a.model||r,view:a.view||r,projection:a.projection||r,clipBounds:e(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[b.drawingBufferWidth,b.drawingBufferHeight],pixelRatio:this.pixelRatio},d.bind(),d.draw(b.TRIANGLE_STRIP,this.vertexCount)},s.drawPick=function(a){var b=this.gl,c=this.pickShader,d=this.vao;c.bind(),c.uniforms={model:a.model||r,view:a.view||r,projection:a.projection||r,pickId:this.pickId,clipBounds:e(this.clipBounds),screenShape:[b.drawingBufferWidth,b.drawingBufferHeight],pixelRatio:this.pixelRatio},d.bind(),d.draw(b.TRIANGLE_STRIP,this.vertexCount)},s.update=function(a){this.dirty=!0,"dashScale"in a&&(this.dashScale=a.dashScale),"opacity"in a&&(this.opacity=+a.opacity);var b=a.position||a.positions;if(b){var c=a.color||a.colors||[0,0,0,1],e=a.lineWidth||1,f=[],g=[],h=[],i=0,j=0,k=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];a:for(var l=1;l<b.length;++l){var o=b[l-1],p=b[l];g.push(i),h.push(o.slice());for(var q=0;3>q;++q){if(isNaN(o[q])||isNaN(p[q])||!isFinite(o[q])||!isFinite(p[q]))continue a;k[0][q]=Math.min(k[0][q],o[q],p[q]),k[1][q]=Math.max(k[1][q],o[q],p[q])}var r,s;Array.isArray(c[0])?(r=c[l-1],s=c[l]):r=s=c,3===r.length&&(r=[r[0],r[1],r[2],1]),3===s.length&&(s=[s[0],s[1],s[2],1]);var t,u;Array.isArray(e)?(t=e[l-1],u=lineWidht[l]):t=u=e;var v=i;i+=d(o,p),f.push(o[0],o[1],o[2],p[0],p[1],p[2],v,t,r[0],r[1],r[2],r[3],o[0],o[1],o[2],p[0],p[1],p[2],v,-t,r[0],r[1],r[2],r[3],p[0],p[1],p[2],o[0],o[1],o[2],i,-t,s[0],s[1],s[2],s[3],p[0],p[1],p[2],o[0],o[1],o[2],i,t,s[0],s[1],s[2],s[3]),j+=4}if(this.buffer.update(f),g.push(i),h.push(b[b.length-1].slice()),this.bounds=k,this.vertexCount=j,this.points=h,this.arcLength=g,"dashes"in a){var w=a.dashes,x=w.slice();x.unshift(0);for(var l=1;l<x.length;++l)x[l]=x[l-1]+x[l];for(var y=n(new Array(1024),[256,1,4]),l=0;256>l;++l){for(var q=0;4>q;++q)y.set(l,0,q,0);1&m.le(x,x[x.length-1]*l/255)?y.set(l,0,0,0):y.set(l,0,0,255)}this.texture.setPixels(y)}}},s.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},s.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;var b=l(a.value[0],a.value[1],a.value[2],0),c=m.le(this.arcLength,b);if(0>c)return null;if(c===this.arcLength.length-1)return new f(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),c);for(var d=this.points[c],e=this.points[Math.min(c+1,this.points.length-1)],g=(b-this.arcLength[c])/(this.arcLength[c+1]-this.arcLength[c]),h=1-g,i=[0,0,0],j=0;3>j;++j)i[j]=h*d[j]+g*e[j];var k=Math.min(.5>g?c:c+1,this.points.length-1);return new f(b,i,k,this.points[k])}},{"./lib/shaders":83,"binary-search-bounds":85,"gl-buffer":75,"gl-texture2d":185,"gl-vao":189,"glsl-read-float":86,ndarray:208}],85:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],86:[function(a,b,c){function d(a,b,c,d){return e[0]=d,e[1]=c,e[2]=b,e[3]=a,f[0]}b.exports=d;var e=new Uint8Array(4),f=new Float32Array(e.buffer)},{}],87:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=k*g-h*j,m=-k*f+h*i,n=j*f-g*i,o=c*l+d*m+e*n;return o?(o=1/o,a[0]=l*o,a[1]=(-k*d+e*j)*o,a[2]=(h*d-e*g)*o,a[3]=m*o,a[4]=(k*c-e*i)*o,a[5]=(-h*c+e*f)*o,a[6]=n*o,a[7]=(-j*c+d*i)*o,a[8]=(g*c-d*f)*o,a):null}b.exports=d},{}],88:[function(a,b,c){function d(a){var b=new Float32Array(16);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15],b}b.exports=d},{}],89:[function(a,b,c){function d(){var a=new Float32Array(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}b.exports=d},{}],90:[function(a,b,c){function d(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15],r=b*g-c*f,s=b*h-d*f,t=b*i-e*f,u=c*h-d*g,v=c*i-e*g,w=d*i-e*h,x=j*o-k*n,y=j*p-l*n,z=j*q-m*n,A=k*p-l*o,B=k*q-m*o,C=l*q-m*p;return r*C-s*B+t*A+u*z-v*y+w*x}b.exports=d},{}],91:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,h=d+d,i=e+e,j=c*g,k=d*g,l=d*h,m=e*g,n=e*h,o=e*i,p=f*g,q=f*h,r=f*i;return a[0]=1-l-o,a[1]=k+r,a[2]=m-q,a[3]=0,a[4]=k-r,a[5]=1-j-o,a[6]=n+p,a[7]=0,a[8]=m+q,a[9]=n-p,a[10]=1-j-l,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}b.exports=d},{}],92:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=d+d,i=e+e,j=f+f,k=d*h,l=d*i,m=d*j,n=e*i,o=e*j,p=f*j,q=g*h,r=g*i,s=g*j;return a[0]=1-(n+p),a[1]=l+s,a[2]=m-r,a[3]=0,a[4]=l-s,a[5]=1-(k+p),a[6]=o+q,a[7]=0,a[8]=m+r,a[9]=o-q,a[10]=1-(k+n),a[11]=0,a[12]=c[0],a[13]=c[1],a[14]=c[2],a[15]=1,a}b.exports=d},{}],93:[function(a,b,c){function d(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}b.exports=d},{}],94:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y;return E?(E=1/E,a[0]=(h*D-i*C+j*B)*E,a[1]=(e*C-d*D-f*B)*E,a[2]=(p*x-q*w+r*v)*E,a[3]=(m*w-l*x-n*v)*E,a[4]=(i*A-g*D-j*z)*E,a[5]=(c*D-e*A+f*z)*E,a[6]=(q*u-o*x-r*t)*E,a[7]=(k*x-m*u+n*t)*E,a[8]=(g*C-h*A+j*y)*E,a[9]=(d*A-c*C-f*y)*E,a[10]=(o*w-p*u+r*s)*E,a[11]=(l*u-k*w-n*s)*E,a[12]=(h*z-g*B-i*y)*E,a[13]=(c*B-d*z+e*y)*E,a[14]=(p*t-o*v-q*s)*E,a[15]=(k*v-l*t+m*s)*E,a):null}b.exports=d},{}],95:[function(a,b,c){function d(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,p=b[0],q=b[1],r=b[2],s=d[0],t=d[1],u=d[2],v=c[0],w=c[1],x=c[2];return Math.abs(p-v)<1e-6&&Math.abs(q-w)<1e-6&&Math.abs(r-x)<1e-6?e(a):(l=p-v,m=q-w,n=r-x,o=1/Math.sqrt(l*l+m*m+n*n),l*=o,m*=o,n*=o,f=t*n-u*m,g=u*l-s*n,h=s*m-t*l,o=Math.sqrt(f*f+g*g+h*h),o?(o=1/o,f*=o,g*=o,h*=o):(f=0,g=0,h=0),i=m*h-n*g,j=n*f-l*h,k=l*g-m*f,o=Math.sqrt(i*i+j*j+k*k),o?(o=1/o,i*=o,j*=o,k*=o):(i=0,j=0,k=0),a[0]=f,a[1]=i,a[2]=l,a[3]=0,a[4]=g,a[5]=j,a[6]=m,a[7]=0,a[8]=h,a[9]=k,a[10]=n,a[11]=0,a[12]=-(f*p+g*q+h*r),a[13]=-(i*p+j*q+k*r),a[14]=-(l*p+m*q+n*r),a[15]=1,a)}var e=a("./identity");b.exports=d},{"./identity":93}],96:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],p=b[12],q=b[13],r=b[14],s=b[15],t=c[0],u=c[1],v=c[2],w=c[3];return a[0]=t*d+u*h+v*l+w*p,a[1]=t*e+u*i+v*m+w*q,a[2]=t*f+u*j+v*n+w*r,a[3]=t*g+u*k+v*o+w*s,t=c[4],u=c[5],v=c[6],w=c[7],a[4]=t*d+u*h+v*l+w*p,a[5]=t*e+u*i+v*m+w*q,a[6]=t*f+u*j+v*n+w*r,a[7]=t*g+u*k+v*o+w*s,t=c[8],u=c[9],v=c[10],w=c[11],a[8]=t*d+u*h+v*l+w*p,a[9]=t*e+u*i+v*m+w*q,a[10]=t*f+u*j+v*n+w*r,a[11]=t*g+u*k+v*o+w*s,t=c[12],u=c[13],v=c[14],w=c[15],a[12]=t*d+u*h+v*l+w*p,a[13]=t*e+u*i+v*m+w*q,a[14]=t*f+u*j+v*n+w*r,a[15]=t*g+u*k+v*o+w*s,a}b.exports=d},{}],97:[function(a,b,c){function d(a,b,c,d,e){var f=1/Math.tan(b/2),g=1/(d-e);return a[0]=f/c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=f,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(e+d)*g,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*e*d*g,a[15]=0,a}b.exports=d},{}],98:[function(a,b,c){function d(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C=d[0],D=d[1],E=d[2],F=Math.sqrt(C*C+D*D+E*E);return Math.abs(F)<1e-6?null:(F=1/F,C*=F,D*=F,E*=F,e=Math.sin(c),f=Math.cos(c),g=1-f,h=b[0],i=b[1],j=b[2],k=b[3],l=b[4],m=b[5],n=b[6],o=b[7],p=b[8],q=b[9],r=b[10],s=b[11],t=C*C*g+f,u=D*C*g+E*e,v=E*C*g-D*e,w=C*D*g-E*e,x=D*D*g+f,y=E*D*g+C*e,z=C*E*g+D*e,A=D*E*g-C*e,B=E*E*g+f,a[0]=h*t+l*u+p*v,a[1]=i*t+m*u+q*v,a[2]=j*t+n*u+r*v,a[3]=k*t+o*u+s*v,a[4]=h*w+l*x+p*y,a[5]=i*w+m*x+q*y,a[6]=j*w+n*x+r*y,a[7]=k*w+o*x+s*y,a[8]=h*z+l*A+p*B,a[9]=i*z+m*A+q*B,a[10]=j*z+n*A+r*B,a[11]=k*z+o*A+s*B,b!==a&&(a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a)}b.exports=d},{}],99:[function(a,b,c){function d(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[4],g=b[5],h=b[6],i=b[7],j=b[8],k=b[9],l=b[10],m=b[11];return b!==a&&(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[4]=f*e+j*d,a[5]=g*e+k*d,a[6]=h*e+l*d,a[7]=i*e+m*d,a[8]=j*e-f*d,a[9]=k*e-g*d,a[10]=l*e-h*d,a[11]=m*e-i*d,a}b.exports=d},{}],100:[function(a,b,c){function d(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[0],g=b[1],h=b[2],i=b[3],j=b[8],k=b[9],l=b[10],m=b[11];return b!==a&&(a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[0]=f*e-j*d,a[1]=g*e-k*d,a[2]=h*e-l*d,a[3]=i*e-m*d,a[8]=f*d+j*e,a[9]=g*d+k*e,a[10]=h*d+l*e,a[11]=i*d+m*e,a}b.exports=d},{}],101:[function(a,b,c){function d(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[0],g=b[1],h=b[2],i=b[3],j=b[4],k=b[5],l=b[6],m=b[7];return b!==a&&(a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[0]=f*e+j*d,a[1]=g*e+k*d,a[2]=h*e+l*d,a[3]=i*e+m*d,a[4]=j*e-f*d,a[5]=k*e-g*d,a[6]=l*e-h*d,a[7]=m*e-i*d,a}b.exports=d},{}],102:[function(a,b,c){function d(a,b,c){var d=c[0],e=c[1],f=c[2];return a[0]=b[0]*d,a[1]=b[1]*d,a[2]=b[2]*d,a[3]=b[3]*d,a[4]=b[4]*e,a[5]=b[5]*e,a[6]=b[6]*e,a[7]=b[7]*e,a[8]=b[8]*f,a[9]=b[9]*f,a[10]=b[10]*f,a[11]=b[11]*f,a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15],a}b.exports=d},{}],103:[function(a,b,c){function d(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p=c[0],q=c[1],r=c[2];return b===a?(a[12]=b[0]*p+b[4]*q+b[8]*r+b[12],a[13]=b[1]*p+b[5]*q+b[9]*r+b[13],a[14]=b[2]*p+b[6]*q+b[10]*r+b[14],a[15]=b[3]*p+b[7]*q+b[11]*r+b[15]):(d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],a[0]=d,a[1]=e,a[2]=f,a[3]=g,a[4]=h,a[5]=i,a[6]=j,a[7]=k,a[8]=l,a[9]=m,a[10]=n,a[11]=o,a[12]=d*p+h*q+l*r+b[12],a[13]=e*p+i*q+m*r+b[13],a[14]=f*p+j*q+n*r+b[14],a[15]=g*p+k*q+o*r+b[15]),a}b.exports=d},{}],104:[function(a,b,c){function d(a,b){if(a===b){var c=b[1],d=b[2],e=b[3],f=b[6],g=b[7],h=b[11];a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=c,a[6]=b[9],a[7]=b[13],a[8]=d,a[9]=f,a[11]=b[14],a[12]=e,a[13]=g,a[14]=h}else a[0]=b[0],a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=b[1],a[5]=b[5],a[6]=b[9],a[7]=b[13],a[8]=b[2],a[9]=b[6],a[10]=b[10],a[11]=b[14],a[12]=b[3],a[13]=b[7],a[14]=b[11],a[15]=b[15];return a}b.exports=d},{}],105:[function(a,b,c){"use strict";function d(a,b){for(var c=[0,0,0,0],d=0;4>d;++d)for(var e=0;4>e;++e)c[e]+=a[4*d+e]*b[d];return c}function e(a,b,c,e,f){for(var g=d(e,d(c,d(b,[a[0],a[1],a[2],1]))),h=0;3>h;++h)g[h]/=g[3];return[.5*f[0]*(1+g[0]),.5*f[1]*(1-g[1])]}function f(a,b){if(2===a.length){for(var c=0,d=0,e=0;2>e;++e)c+=Math.pow(b[e]-a[0][e],2),d+=Math.pow(b[e]-a[1][e],2);return c=Math.sqrt(c),d=Math.sqrt(d),1e-6>c+d?[1,0]:[d/(c+d),c/(d+c)]}if(3===a.length){var f=[0,0];return j(a[0],a[1],a[2],b,f),i(a,f)}return[]}function g(a,b){for(var c=[0,0,0],d=0;d<a.length;++d)for(var e=a[d],f=b[d],g=0;3>g;++g)c[g]+=f*e[g];return c}function h(a,b,c,d,h,i){if(1===a.length)return[0,a[0].slice()];for(var j=new Array(a.length),k=0;k<a.length;++k)j[k]=e(a[k],c,d,h,i);for(var l=0,m=1/0,k=0;k<j.length;++k){for(var n=0,o=0;2>o;++o)n+=Math.pow(j[k][o]-b[o],2);m>n&&(m=n,l=k)}for(var p=f(j,b),q=0,k=0;3>k;++k){if(p[k]<-.001||p[k]>1.0001)return null;q+=p[k]}return Math.abs(q-1)>.001?null:[l,g(a,p),p]}var i=a("barycentric"),j=a("polytope-closest-point/lib/closest_point_2d.js");b.exports=h},{barycentric:108,"polytope-closest-point/lib/closest_point_2d.js":110}],106:[function(a,b,c){var d="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",e="#define GLSLIFY 1\nprecision mediump float;\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",f="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",g="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",h="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",i="#define GLSLIFY 1\nprecision mediump float;\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",j="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",k="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}",l="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",m="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",n="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n";c.meshShader={vertex:d,fragment:e,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},c.wireShader={vertex:f,fragment:g,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},c.pointShader={vertex:h,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},c.pickShader={vertex:j,fragment:k,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},c.pointPickShader={vertex:l,fragment:k,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},c.contourShader={vertex:m,fragment:n,attributes:[{name:"position",type:"vec3"}]}},{}],107:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A){this.gl=a,this.cells=[],this.positions=[],this.intensity=[],this.texture=b,this.dirty=!0,this.triShader=c,this.lineShader=d,this.pointShader=e,this.pickShader=f,this.pointPickShader=g,this.contourShader=h,this.trianglePositions=i,this.triangleColors=k,this.triangleNormals=m,this.triangleUVs=l,this.triangleIds=j,this.triangleVAO=n,this.triangleCount=0,this.lineWidth=1,this.edgePositions=o,this.edgeColors=q,this.edgeUVs=r,this.edgeIds=p,this.edgeVAO=s,this.edgeCount=0,this.pointPositions=t,this.pointColors=v,this.pointUVs=w,this.pointSizes=x,this.pointIds=u,this.pointVAO=y,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=z,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=H,this._view=H,this._projection=H,this._resolution=[1,1]}function e(a){for(var b=w({colormap:a,nshades:256,format:"rgba"}),c=new Uint8Array(1024),d=0;256>d;++d){for(var e=b[d],f=0;3>f;++f)c[4*d+f]=e[f];c[4*d+3]=255*e[3]}return v(c,[256,256,4],[4,0,1])}function f(a,b,c){for(var d=new Array(b),e=0;b>e;++e)d[e]=0;for(var f=a.length,e=0;f>e;++e)for(var g=a[e],h=0;h<g.length;++h)d[g[h]]=c[e];return d}function g(a){for(var b=a.length,c=new Array(b),d=0;b>d;++d)c[d]=a[d][2];return c}function h(a){var b=o(a,B);return b.attributes.position.location=0,b.attributes.color.location=2,b.attributes.uv.location=3,b.attributes.normal.location=4,b}function i(a){var b=o(a,C);return b.attributes.position.location=0,b.attributes.color.location=2,b.attributes.uv.location=3,b}function j(a){var b=o(a,D);return b.attributes.position.location=0,b.attributes.color.location=2,b.attributes.uv.location=3,b.attributes.pointSize.location=4,b}function k(a){var b=o(a,E);return b.attributes.position.location=0,b.attributes.id.location=1,b}function l(a){var b=o(a,F);return b.attributes.position.location=0,b.attributes.id.location=1,b.attributes.pointSize.location=4,b}function m(a){var b=o(a,G);return b.attributes.position.location=0,b}function n(a){var b=a.gl,c=h(b),e=i(b),f=j(b),g=k(b),n=l(b),o=m(b),s=r(b,v(new Uint8Array([255,255,255,255]),[1,1,4]));s.generateMipmap(),s.minFilter=b.LINEAR_MIPMAP_LINEAR,s.magFilter=b.LINEAR;var t=p(b),u=p(b),w=p(b),x=p(b),y=p(b),z=q(b,[{buffer:t,type:b.FLOAT,size:3},{buffer:y,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:u,type:b.FLOAT,size:4},{buffer:w,type:b.FLOAT,size:2},{buffer:x,type:b.FLOAT,size:3}]),A=p(b),B=p(b),C=p(b),D=p(b),E=q(b,[{buffer:A,type:b.FLOAT,size:3},{buffer:D,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:b.FLOAT,size:4},{buffer:C,type:b.FLOAT,size:2}]),F=p(b),G=p(b),H=p(b),I=p(b),J=p(b),K=q(b,[{buffer:F,type:b.FLOAT,size:3},{buffer:J,type:b.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:G,type:b.FLOAT,size:4},{buffer:H,type:b.FLOAT,size:2},{buffer:I,type:b.FLOAT,size:1}]),L=p(b),M=q(b,[{ 33 buffer:L,type:b.FLOAT,size:3}]),N=new d(b,s,c,e,f,g,n,o,t,y,u,w,x,z,A,D,B,C,E,F,J,G,H,I,K,L,M);return N.update(a),N}var o=a("gl-shader"),p=a("gl-buffer"),q=a("gl-vao"),r=a("gl-texture2d"),s=a("normals"),t=a("gl-mat4/multiply"),u=a("gl-mat4/invert"),v=a("ndarray"),w=a("colormap"),x=a("simplicial-complex-contour"),y=a("typedarray-pool"),z=a("./lib/shaders"),A=a("./lib/closest-point"),B=z.meshShader,C=z.wireShader,D=z.pointShader,E=z.pickShader,F=z.pointPickShader,G=z.contourShader,H=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],I=d.prototype;I.isOpaque=function(){return this.opacity>=1},I.isTransparent=function(){return this.opacity<1},I.pickSlots=1,I.setPickBase=function(a){this.pickId=a},I.highlight=function(a){if(!a||!this.contourEnable)return void(this.contourCount=0);for(var b=x(this.cells,this.intensity,a.intensity),c=b.cells,d=b.vertexIds,e=b.vertexWeights,f=c.length,g=y.mallocFloat32(6*f),h=0,i=0;f>i;++i)for(var j=c[i],k=0;2>k;++k){var l=j[0];2===j.length&&(l=j[k]);for(var m=d[l][0],n=d[l][1],o=e[l],p=1-o,q=this.positions[m],r=this.positions[n],s=0;3>s;++s)g[h++]=o*q[s]+p*r[s]}this.contourCount=h/3|0,this.contourPositions.update(g.subarray(0,h)),y.free(g)},I.update=function(a){a=a||{};var b=this.gl;this.dirty=!0,"contourEnable"in a&&(this.contourEnable=a.contourEnable),"contourColor"in a&&(this.contourColor=a.contourColor),"lineWidth"in a&&(this.lineWidth=a.lineWidth),"opacity"in a&&(this.opacity=a.opacity),a.texture?(this.texture.dispose(),this.texture=r(b,a.texture)):a.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=b.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=b.LINEAR,this.texture.setPixels(e(a.colormap)),this.texture.generateMipmap());var c=a.cells,d=a.positions;if(d&&c){var h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=[],p=[],q=[],t=[],u=[],v=[],w=[];this.cells=c,this.positions=d;var x=a.vertexNormals,y=a.cellNormals;a.useFacetNormals&&!y&&(y=s.faceNormals(c,d)),y||x||(x=s.vertexNormals(c,d));var z=a.vertexColors,A=a.cellColors,B=a.meshColor||[1,1,1,1],C=a.vertexUVs,D=a.vertexIntensity,E=a.cellUVs,F=a.cellIntensity,G=1/0,H=-(1/0);if(!C&&!E)if(D)for(var I=0;I<D.length;++I){var J=D[I];G=Math.min(G,J),H=Math.max(H,J)}else if(F)for(var I=0;I<F.length;++I){var J=F[I];G=Math.min(G,J),H=Math.max(H,J)}else for(var I=0;I<d.length;++I){var J=d[I][2];G=Math.min(G,J),H=Math.max(H,J)}D?this.intensity=D:F?this.intensity=f(c,d.length,F):this.intensity=g(d);var K=a.pointSizes,L=a.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]];for(var I=0;I<d.length;++I)for(var M=d[I],N=0;3>N;++N)!isNaN(M[N])&&isFinite(M[N])&&(this.bounds[0][N]=Math.min(this.bounds[0][N],M[N]),this.bounds[1][N]=Math.max(this.bounds[1][N],M[N]));var O=0,P=0,Q=0;a:for(var I=0;I<c.length;++I){var R=c[I];switch(R.length){case 1:for(var S=R[0],M=d[S],N=0;3>N;++N)if(isNaN(M[N])||!isFinite(M[N]))continue a;q.push(M[0],M[1],M[2]);var T;T=z?z[S]:A?A[I]:B,3===T.length?t.push(T[0],T[1],T[2],1):t.push(T[0],T[1],T[2],T[3]);var U;U=C?C[S]:D?[(D[S]-G)/(H-G),0]:E?E[I]:F?[(F[I]-G)/(H-G),0]:[(M[2]-G)/(H-G),0],u.push(U[0],U[1]),K?v.push(K[S]):v.push(L),w.push(I),Q+=1;break;case 2:for(var N=0;2>N;++N)for(var S=R[N],M=d[S],V=0;3>V;++V)if(isNaN(M[V])||!isFinite(M[V]))continue a;for(var N=0;2>N;++N){var S=R[N],M=d[S];m.push(M[0],M[1],M[2]);var T;T=z?z[S]:A?A[I]:B,3===T.length?n.push(T[0],T[1],T[2],1):n.push(T[0],T[1],T[2],T[3]);var U;U=C?C[S]:D?[(D[S]-G)/(H-G),0]:E?E[I]:F?[(F[I]-G)/(H-G),0]:[(M[2]-G)/(H-G),0],o.push(U[0],U[1]),p.push(I)}P+=1;break;case 3:for(var N=0;3>N;++N)for(var S=R[N],M=d[S],V=0;3>V;++V)if(isNaN(M[V])||!isFinite(M[V]))continue a;for(var N=0;3>N;++N){var S=R[N],M=d[S];h.push(M[0],M[1],M[2]);var T;T=z?z[S]:A?A[I]:B,3===T.length?i.push(T[0],T[1],T[2],1):i.push(T[0],T[1],T[2],T[3]);var U;U=C?C[S]:D?[(D[S]-G)/(H-G),0]:E?E[I]:F?[(F[I]-G)/(H-G),0]:[(M[2]-G)/(H-G),0],k.push(U[0],U[1]);var W;W=x?x[S]:y[I],j.push(W[0],W[1],W[2]),l.push(I)}O+=1}}this.pointCount=Q,this.edgeCount=P,this.triangleCount=O,this.pointPositions.update(q),this.pointColors.update(t),this.pointUVs.update(u),this.pointSizes.update(v),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(m),this.edgeColors.update(n),this.edgeUVs.update(o),this.edgeIds.update(new Uint32Array(p)),this.trianglePositions.update(h),this.triangleColors.update(i),this.triangleUVs.update(k),this.triangleNormals.update(j),this.triangleIds.update(new Uint32Array(l))}},I.drawTransparent=I.draw=function(a){a=a||{};for(var b=this.gl,c=a.model||H,d=a.view||H,e=a.projection||H,f=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],g=0;3>g;++g)f[0][g]=Math.max(f[0][g],this.clipBounds[0][g]),f[1][g]=Math.min(f[1][g],this.clipBounds[1][g]);var h={model:c,view:d,projection:e,clipBounds:f,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var i=new Array(16);t(i,h.view,h.model),t(i,h.projection,i),u(i,i);for(var g=0;3>g;++g)h.eyePosition[g]=i[12+g]/i[15];for(var j=i[15],g=0;3>g;++g)j+=this.lightPosition[g]*i[4*g+3];for(var g=0;3>g;++g){for(var k=i[12+g],l=0;3>l;++l)k+=i[4*l+g]*this.lightPosition[l];h.lightPosition[g]=k/j}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=h,this.triangleVAO.bind(),b.drawArrays(b.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var m=this.lineShader;m.bind(),m.uniforms=h,this.edgeVAO.bind(),b.lineWidth(this.lineWidth),b.drawArrays(b.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var m=this.pointShader;m.bind(),m.uniforms=h,this.pointVAO.bind(),b.drawArrays(b.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var m=this.contourShader;m.bind(),m.uniforms=h,this.contourVAO.bind(),b.drawArrays(b.LINES,0,this.contourCount),this.contourVAO.unbind()}},I.drawPick=function(a){a=a||{};for(var b=this.gl,c=a.model||H,d=a.view||H,e=a.projection||H,f=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],g=0;3>g;++g)f[0][g]=Math.max(f[0][g],this.clipBounds[0][g]),f[1][g]=Math.min(f[1][g],this.clipBounds[1][g]);this._model=[].slice.call(c),this._view=[].slice.call(d),this._projection=[].slice.call(e),this._resolution=[b.drawingBufferWidth,b.drawingBufferHeight];var h={model:c,view:d,projection:e,clipBounds:f,pickId:this.pickId/255},i=this.pickShader;if(i.bind(),i.uniforms=h,this.triangleCount>0&&(this.triangleVAO.bind(),b.drawArrays(b.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),b.lineWidth(this.lineWidth),b.drawArrays(b.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var i=this.pointPickShader;i.bind(),i.uniforms=h,this.pointVAO.bind(),b.drawArrays(b.POINTS,0,this.pointCount),this.pointVAO.unbind()}},I.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;for(var b=a.value[0]+256*a.value[1]+65536*a.value[2],c=this.cells[b],d=this.positions,e=new Array(c.length),f=0;f<c.length;++f)e[f]=d[c[f]];var g=A(e,[a.coord[0],this._resolution[1]-a.coord[1]],this._model,this._view,this._projection,this._resolution);if(!g)return null;for(var h=g[2],i=0,f=0;f<c.length;++f)i+=h[f]*this.intensity[c[f]];return{position:g[1],index:c[g[0]],cell:c,cellId:b,intensity:i,dataCoordinate:this.positions[c[g[0]]]}},I.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},b.exports=n},{"./lib/closest-point":105,"./lib/shaders":106,colormap:57,"gl-buffer":75,"gl-mat4/invert":94,"gl-mat4/multiply":96,"gl-shader":154,"gl-texture2d":185,"gl-vao":189,ndarray:208,normals:109,"simplicial-complex-contour":111,"typedarray-pool":233}],108:[function(a,b,c){"use strict";function d(a){for(var b=0,c=0;c<a.length;++c)b+=a[c];return b}function e(a,b){for(var c=b.length,e=new Array(c+1),g=0;c>g;++g){for(var h=new Array(c+1),i=0;c>=i;++i)h[i]=a[i][g];e[g]=h}e[c]=new Array(c+1);for(var g=0;c>=g;++g)e[c][g]=1;for(var j=new Array(c+1),g=0;c>g;++g)j[g]=b[g];j[c]=1;var k=f(e,j),l=d(k[c+1]);0===l&&(l=1);for(var m=new Array(c+1),g=0;c>=g;++g)m[g]=d(k[g])/l;return m}b.exports=e;var f=a("robust-linear-solve")},{"robust-linear-solve":211}],109:[function(a,b,c){var d=1e-6;c.vertexNormals=function(a,b){for(var c=b.length,e=new Array(c),f=0;c>f;++f)e[f]=[0,0,0];for(var f=0;f<a.length;++f)for(var g=a[f],h=0,i=g[g.length-1],j=g[0],k=0;k<g.length;++k){h=i,i=j,j=g[(k+1)%g.length];for(var l=b[h],m=b[i],n=b[j],o=new Array(3),p=0,q=new Array(3),r=0,s=0;3>s;++s)o[s]=l[s]-m[s],p+=o[s]*o[s],q[s]=n[s]-m[s],r+=q[s]*q[s];if(p*r>d)for(var t=e[i],u=1/Math.sqrt(p*r),s=0;3>s;++s){var v=(s+1)%3,w=(s+2)%3;t[s]+=u*(q[v]*o[w]-q[w]*o[v])}}for(var f=0;c>f;++f){for(var t=e[f],x=0,s=0;3>s;++s)x+=t[s]*t[s];if(x>d)for(var u=1/Math.sqrt(x),s=0;3>s;++s)t[s]*=u;else for(var s=0;3>s;++s)t[s]=0}return e},c.faceNormals=function(a,b){for(var c=a.length,e=new Array(c),f=0;c>f;++f){for(var g=a[f],h=new Array(3),i=0;3>i;++i)h[i]=b[g[i]];for(var j=new Array(3),k=new Array(3),i=0;3>i;++i)j[i]=h[1][i]-h[0][i],k[i]=h[2][i]-h[0][i];for(var l=new Array(3),m=0,i=0;3>i;++i){var n=(i+1)%3,o=(i+2)%3;l[i]=j[n]*k[o]-j[o]*k[n],m+=l[i]*l[i]}m=m>d?1/Math.sqrt(m):0;for(var i=0;3>i;++i)l[i]*=m;e[f]=l}return e}},{}],110:[function(a,b,c){"use strict";function d(a,b,c,d,h){e.length<d.length&&(e=new Float64Array(d.length),f=new Float64Array(d.length),g=new Float64Array(d.length));for(var i=0;i<d.length;++i)e[i]=a[i]-d[i],f[i]=b[i]-a[i],g[i]=c[i]-a[i];for(var j=0,k=0,l=0,m=0,n=0,o=0,i=0;i<d.length;++i){var p=f[i],q=g[i],r=e[i];j+=p*p,k+=p*q,l+=q*q,m+=r*p,n+=r*q,o+=r*r}var s,t=Math.abs(j*l-k*k),u=k*n-l*m,v=k*m-j*n;if(t>=u+v)if(0>u)0>v&&0>m?(v=0,-m>=j?(u=1,s=j+2*m+o):(u=-m/j,s=m*u+o)):(u=0,n>=0?(v=0,s=o):-n>=l?(v=1,s=l+2*n+o):(v=-n/l,s=n*v+o));else if(0>v)v=0,m>=0?(u=0,s=o):-m>=j?(u=1,s=j+2*m+o):(u=-m/j,s=m*u+o);else{var w=1/t;u*=w,v*=w,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o}else{var x,y,z,A;0>u?(x=k+m,y=l+n,y>x?(z=y-x,A=j-2*k+l,z>=A?(u=1,v=0,s=j+2*m+o):(u=z/A,v=1-u,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o)):(u=0,0>=y?(v=1,s=l+2*n+o):n>=0?(v=0,s=o):(v=-n/l,s=n*v+o))):0>v?(x=k+n,y=j+m,y>x?(z=y-x,A=j-2*k+l,z>=A?(v=1,u=0,s=l+2*n+o):(v=z/A,u=1-v,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o)):(v=0,0>=y?(u=1,s=j+2*m+o):m>=0?(u=0,s=o):(u=-m/j,s=m*u+o))):(z=l+n-k-m,0>=z?(u=0,v=1,s=l+2*n+o):(A=j-2*k+l,z>=A?(u=1,v=0,s=j+2*m+o):(u=z/A,v=1-u,s=u*(j*u+k*v+2*m)+v*(k*u+l*v+2*n)+o)))}for(var B=1-u-v,i=0;i<d.length;++i)h[i]=B*a[i]+u*b[i]+v*c[i];return 0>s?0:s}var e=new Float64Array(4),f=new Float64Array(4),g=new Float64Array(4);b.exports=d},{}],111:[function(a,b,c){"use strict";function d(a){for(var b=a.length,c=0,d=0;b>d;++d)c=0|Math.max(c,a[d].length);return c-1}function e(a,b){for(var c=a.length,d=l.mallocUint8(c),e=0;c>e;++e)d[e]=a[e]<b|0;return d}function f(a,b){for(var c=a.length,d=b*(b+1)/2*c|0,e=l.mallocUint32(2*d),f=0,g=0;c>g;++g)for(var h=a[g],b=h.length,i=0;b>i;++i)for(var j=0;i>j;++j){var n=h[j],o=h[i];e[f++]=0|Math.min(n,o),e[f++]=0|Math.max(n,o)}var p=f/2|0;m(k(e,[p,2]));for(var q=2,g=2;f>g;g+=2)e[g-2]===e[g]&&e[g-1]===e[g+1]||(e[q++]=e[g],e[q++]=e[g+1]);return k(e,[q/2|0,2])}function g(a,b,c,d){for(var e=a.data,f=a.shape[0],g=l.mallocDouble(f),h=0,i=0;f>i;++i){var j=e[2*i],m=e[2*i+1];if(c[j]!==c[m]){var n=b[j],o=b[m];e[2*h]=j,e[2*h+1]=m,g[h++]=(o-d)/(o-n)}}return a.shape[0]=h,k(g,[h])}function h(a,b){var c=l.mallocInt32(2*b),d=a.shape[0],e=a.data;c[0]=0;for(var f=0,g=0;d>g;++g){var h=e[2*g];if(h!==f){for(c[2*f+1]=g;++f<h;)c[2*f]=g,c[2*f+1]=g;c[2*f]=g}}for(c[2*f+1]=d;++f<b;)c[2*f]=c[2*f+1]=d;return c}function i(a){for(var b=0|a.shape[0],c=a.data,d=new Array(b),e=0;b>e;++e)d[e]=[c[2*e],c[2*e+1]];return d}function j(a,b,c,j){c=c||0,"undefined"==typeof j&&(j=d(a));var k=a.length;if(0===k||1>j)return{cells:[],vertexIds:[],vertexWeights:[]};var m=e(b,+c),o=f(a,j),p=g(o,b,m,+c),q=h(o,0|b.length),r=n(j)(a,o.data,q,m),s=i(o),t=[].slice.call(p.data,0,p.shape[0]);return l.free(m),l.free(o.data),l.free(p.data),l.free(q),{cells:r,vertexIds:s,vertexWeights:t}}b.exports=j;var k=a("ndarray"),l=a("typedarray-pool"),m=a("ndarray-sort"),n=a("./lib/codegen")},{"./lib/codegen":112,ndarray:208,"ndarray-sort":115,"typedarray-pool":233}],112:[function(a,b,c){"use strict";function d(a){function b(a){if(!(a.length<=0)){j.push("R.push(");for(var b=0;b<a.length;++b){var c=a[b];b>0&&j.push(","),j.push("[");for(var d=0;d<c.length;++d){var e=c[d];d>0&&j.push(","),j.push("B(C,E,c[",e[0],"],c[",e[1],"])")}j.push("]")}j.push(");")}}var c=0,d=new Array(a+1);d[0]=[[]];for(var e=1;a>=e;++e)for(var h=d[e]=g(e),i=0;i<h.length;++i)c=Math.max(c,h[e].length);for(var j=["function B(C,E,i,j){","var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];","while(l<h){","var m=(l+h)>>1,v=E[2*m+1];","if(v===b){return m}","if(b<v){h=m}else{l=m+1}","}","return l;","};","function getContour",a,"d(F,E,C,S){","var n=F.length,R=[];","for(var i=0;i<n;++i){var c=F[i],l=c.length;"],e=a+1;e>1;--e){a+1>e&&j.push("else "),j.push("if(l===",e,"){");for(var k=[],i=0;e>i;++i)k.push("(S[c["+i+"]]<<"+i+")");j.push("var M=",k.join("+"),";if(M===0||M===",(1<<e)-1,"){continue}switch(M){");for(var h=d[e-1],i=0;i<h.length;++i)j.push("case ",i,":"),b(h[i]),j.push("break;");j.push("}}")}j.push("}return R;};return getContour",a,"d");var l=new Function("pool",j.join(""));return l(f)}function e(a){var b=h[a];return b||(b=h[a]=d(a)),b}b.exports=e;var f=a("typedarray-pool"),g=a("marching-simplex-table"),h={}},{"marching-simplex-table":113,"typedarray-pool":233}],113:[function(a,b,c){"use strict";function d(a,b,c){for(var d=new Array(a),e=0;a>e;++e)d[e]=0,e===b&&(d[e]+=.5),e===c&&(d[e]+=.5);return d}function e(a,b){if(0===b||b===(1<<a+1)-1)return[];for(var c=[],e=[],f=0;a>=f;++f)if(b&1<<f){c.push(d(a,f-1,f-1)),e.push(null);for(var h=0;a>=h;++h)~b&1<<h&&(c.push(d(a,f-1,h-1)),e.push([f,h]))}var i=g(c),j=[];a:for(var f=0;f<i.length;++f){for(var k=i[f],l=[],h=0;h<k.length;++h){if(!e[k[h]])continue a;l.push(e[k[h]].slice())}j.push(l)}return j}function f(a){for(var b=1<<a+1,c=new Array(b),d=0;b>d;++d)c[d]=e(a,d);return c}b.exports=f;var g=a("convex-hull")},{"convex-hull":60}],114:[function(a,b,c){"use strict";function d(a){switch(a){case"uint8":return[i.mallocUint8,i.freeUint8];case"uint16":return[i.mallocUint16,i.freeUint16];case"uint32":return[i.mallocUint32,i.freeUint32];case"int8":return[i.mallocInt8,i.freeInt8];case"int16":return[i.mallocInt16,i.freeInt16];case"int32":return[i.mallocInt32,i.freeInt32];case"float32":return[i.mallocFloat,i.freeFloat];case"float64":return[i.mallocDouble,i.freeDouble];default:return null}}function e(a){for(var b=[],c=0;a>c;++c)b.push("s"+c);for(var c=0;a>c;++c)b.push("n"+c);for(var c=1;a>c;++c)b.push("d"+c);for(var c=1;a>c;++c)b.push("e"+c);for(var c=1;a>c;++c)b.push("f"+c);return b}function f(a,b){function c(a){return"generic"===b?["data.get(",a,")"].join(""):["data[",a,"]"].join("")}function f(a,c){return"generic"===b?["data.set(",a,",",c,")"].join(""):["data[",a,"]=",c].join("")}var g=["'use strict'"],h=["ndarrayInsertionSort",a.join("d"),b].join(""),i=["left","right","data","offset"].concat(e(a.length)),j=d(b),k=["i,j,cptr,ptr=left*s0+offset"];if(a.length>1){for(var l=[],m=1;m<a.length;++m)k.push("i"+m),l.push("n"+m);j?k.push("scratch=malloc("+l.join("*")+")"):k.push("scratch=new Array("+l.join("*")+")"),k.push("dptr","sptr","a","b")}else k.push("scratch");if(g.push(["function ",h,"(",i.join(","),"){var ",k.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),a.length>1){g.push("dptr=0;sptr=ptr");for(var m=a.length-1;m>=0;--m){var n=a[m];0!==n&&g.push(["for(i",n,"=0;i",n,"<n",n,";++i",n,"){"].join(""))}g.push("scratch[dptr++]=",c("sptr"));for(var m=0;m<a.length;++m){var n=a[m];0!==n&&g.push("sptr+=d"+n,"}")}g.push("__g:while(j-->left){","dptr=0","sptr=cptr-s0");for(var m=1;m<a.length;++m)1===m&&g.push("__l:"),g.push(["for(i",m,"=0;i",m,"<n",m,";++i",m,"){"].join(""));g.push(["a=",c("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join(""));for(var m=a.length-1;m>=1;--m)g.push("sptr+=e"+m,"dptr+=f"+m,"}");g.push("dptr=cptr;sptr=cptr-s0");for(var m=a.length-1;m>=0;--m){var n=a[m];0!==n&&g.push(["for(i",n,"=0;i",n,"<n",n,";++i",n,"){"].join(""))}g.push(f("dptr",c("sptr")));for(var m=0;m<a.length;++m){var n=a[m];0!==n&&g.push(["dptr+=d",n,";sptr+=d",n].join(""),"}")}g.push("cptr-=s0\n}"),g.push("dptr=cptr;sptr=0");for(var m=a.length-1;m>=0;--m){var n=a[m];0!==n&&g.push(["for(i",n,"=0;i",n,"<n",n,";++i",n,"){"].join(""))}g.push(f("dptr","scratch[sptr++]"));for(var m=0;m<a.length;++m){var n=a[m];0!==n&&g.push("dptr+=d"+n,"}")}}else g.push("scratch="+c("ptr"),"while((j-->left)&&("+c("cptr-s0")+">scratch)){",f("cptr",c("cptr-s0")),"cptr-=s0","}",f("cptr","scratch"));if(g.push("}"),a.length>1&&j&&g.push("free(scratch)"),g.push("} return "+h),j){var o=new Function("malloc","free",g.join("\n"));return o(j[0],j[1])}var o=new Function(g.join("\n"));return o()}function g(a,b,c){function f(a){return["(offset+",a,"*s0)"].join("")}function g(a){return"generic"===b?["data.get(",a,")"].join(""):["data[",a,"]"].join("")}function h(a,c){return"generic"===b?["data.set(",a,",",c,")"].join(""):["data[",a,"]=",c].join("")}function i(b,c,d){if(1===b.length)v.push("ptr0="+f(b[0]));else for(var e=0;e<b.length;++e)v.push(["b_ptr",e,"=s0*",b[e]].join(""));c&&v.push("pivot_ptr=0"),v.push("ptr_shift=offset");for(var e=a.length-1;e>=0;--e){var g=a[e];0!==g&&v.push(["for(i",g,"=0;i",g,"<n",g,";++i",g,"){"].join(""))}if(b.length>1)for(var e=0;e<b.length;++e)v.push(["ptr",e,"=b_ptr",e,"+ptr_shift"].join(""));v.push(d),c&&v.push("++pivot_ptr");for(var e=0;e<a.length;++e){var g=a[e];0!==g&&(b.length>1?v.push("ptr_shift+=d"+g):v.push("ptr0+=d"+g),v.push("}"))}}function k(b,c,d,e){if(1===c.length)v.push("ptr0="+f(c[0]));else{for(var g=0;g<c.length;++g)v.push(["b_ptr",g,"=s0*",c[g]].join(""));v.push("ptr_shift=offset")}d&&v.push("pivot_ptr=0"),b&&v.push(b+":");for(var g=1;g<a.length;++g)v.push(["for(i",g,"=0;i",g,"<n",g,";++i",g,"){"].join(""));if(c.length>1)for(var g=0;g<c.length;++g)v.push(["ptr",g,"=b_ptr",g,"+ptr_shift"].join(""));v.push(e);for(var g=a.length-1;g>=1;--g)d&&v.push("pivot_ptr+=f"+g),c.length>1?v.push("ptr_shift+=e"+g):v.push("ptr0+=e"+g),v.push("}")}function l(){a.length>1&&y&&v.push("free(pivot1)","free(pivot2)")}function m(b,c){var d="el"+b,e="el"+c;if(a.length>1){var h="__l"+ ++z;k(h,[d,e],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",d,";",d,"=",e,";",e,"=tmp0;break ",h,"}\n","if(comp<0){break ",h,"}"].join(""))}else v.push(["if(",g(f(d)),">",g(f(e)),"){tmp0=",d,";",d,"=",e,";",e,"=tmp0}"].join(""))}function n(b,c){a.length>1?i([b,c],!1,h("ptr0",g("ptr1"))):v.push(h(f(b),g(f(c))))}function o(b,c,d){if(a.length>1){var e="__l"+ ++z;k(e,[c],!0,[b,"=",g("ptr0"),"-pivot",d,"[pivot_ptr]\n","if(",b,"!==0){break ",e,"}"].join(""))}else v.push([b,"=",g(f(c)),"-pivot",d].join(""))}function p(b,c){a.length>1?i([b,c],!1,["tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1","tmp")].join("")):v.push(["ptr0=",f(b),"\n","ptr1=",f(c),"\n","tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1","tmp")].join(""))}function q(b,c,d){a.length>1?(i([b,c,d],!1,["tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1",g("ptr2")),"\n",h("ptr2","tmp")].join("")),v.push("++"+c,"--"+d)):v.push(["ptr0=",f(b),"\n","ptr1=",f(c),"\n","ptr2=",f(d),"\n","++",c,"\n","--",d,"\n","tmp=",g("ptr0"),"\n",h("ptr0",g("ptr1")),"\n",h("ptr1",g("ptr2")),"\n",h("ptr2","tmp")].join(""))}function r(a,b){p(a,b),v.push("--"+b)}function s(b,c,d){a.length>1?i([b,c],!0,[h("ptr0",g("ptr1")),"\n",h("ptr1",["pivot",d,"[pivot_ptr]"].join(""))].join("")):v.push(h(f(b),g(f(c))),h(f(c),"pivot"+d))}function t(b,c){v.push(["if((",c,"-",b,")<=",j,"){\n","insertionSort(",b,",",c,",data,offset,",e(a.length).join(","),")\n","}else{\n",w,"(",b,",",c,",data,offset,",e(a.length).join(","),")\n","}"].join(""))}function u(b,c,d){a.length>1?(v.push(["__l",++z,":while(true){"].join("")),i([b],!0,["if(",g("ptr0"),"!==pivot",c,"[pivot_ptr]){break __l",z,"}"].join("")),v.push(d,"}")):v.push(["while(",g(f(b)),"===pivot",c,"){",d,"}"].join(""))}var v=["'use strict'"],w=["ndarrayQuickSort",a.join("d"),b].join(""),x=["left","right","data","offset"].concat(e(a.length)),y=d(b),z=0;v.push(["function ",w,"(",x.join(","),"){"].join(""));var A=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(a.length>1){for(var B=[],C=1;C<a.length;++C)B.push("n"+C),A.push("i"+C);for(var C=0;8>C;++C)A.push("b_ptr"+C);A.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+B.join("*")),y?A.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):A.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else A.push("pivot1","pivot2");if(v.push("var "+A.join(",")),m(1,2),m(4,5),m(1,3),m(2,3),m(1,4),m(3,4),m(2,5),m(2,3),m(4,5),a.length>1?i(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",h("ptr5","x"),"\n",h("ptr6","y"),"\n",h("ptr7","z")].join("")):v.push(["pivot1=",g(f("el2")),"\n","pivot2=",g(f("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(f("el1")),"\n","y=",g(f("el3")),"\n","z=",g(f("el5")),"\n",h(f("index1"),"x"),"\n",h(f("index3"),"y"),"\n",h(f("index5"),"z")].join("")),n("index2","left"),n("index4","right"),v.push("if(pivots_are_equal){"),v.push("for(k=less;k<=great;++k){"),o("comp","k",1),v.push("if(comp===0){continue}"),v.push("if(comp<0){"),v.push("if(k!==less){"),p("k","less"),v.push("}"),v.push("++less"),v.push("}else{"),v.push("while(true){"),o("comp","great",1),v.push("if(comp>0){"),v.push("great--"),v.push("}else if(comp<0){"),q("k","less","great"),v.push("break"),v.push("}else{"),r("k","great"),v.push("break"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}else{"),v.push("for(k=less;k<=great;++k){"),o("comp_pivot1","k",1),v.push("if(comp_pivot1<0){"),v.push("if(k!==less){"),p("k","less"),v.push("}"),v.push("++less"),v.push("}else{"),o("comp_pivot2","k",2),v.push("if(comp_pivot2>0){"),v.push("while(true){"),o("comp","great",2),v.push("if(comp>0){"),v.push("if(--great<k){break}"),v.push("continue"),v.push("}else{"),o("comp","great",1),v.push("if(comp<0){"),q("k","less","great"),v.push("}else{"),r("k","great"),v.push("}"),v.push("break"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),s("left","(less-1)",1),s("right","(great+1)",2),t("left","(less-2)"),t("(great+2)","right"),v.push("if(pivots_are_equal){"),l(),v.push("return"),v.push("}"),v.push("if(less<index1&&great>index5){"),u("less",1,"++less"),u("great",2,"--great"),v.push("for(k=less;k<=great;++k){"),o("comp_pivot1","k",1),v.push("if(comp_pivot1===0){"),v.push("if(k!==less){"),p("k","less"),v.push("}"),v.push("++less"),v.push("}else{"),o("comp_pivot2","k",2),v.push("if(comp_pivot2===0){"),v.push("while(true){"),o("comp","great",2),v.push("if(comp===0){"),v.push("if(--great<k){break}"),v.push("continue"),v.push("}else{"),o("comp","great",1),v.push("if(comp<0){"),q("k","less","great"),v.push("}else{"),r("k","great"),v.push("}"),v.push("break"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),v.push("}"),l(),t("less","great"),v.push("}return "+w),a.length>1&&y){var D=new Function("insertionSort","malloc","free",v.join("\n"));return D(c,y[0],y[1])}var D=new Function("insertionSort",v.join("\n"));return D(c)}function h(a,b){var c=["'use strict'"],d=["ndarraySortWrapper",a.join("d"),b].join(""),h=["array"];c.push(["function ",d,"(",h.join(","),"){"].join(""));for(var i=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],k=0;k<a.length;++k)i.push(["s",k,"=stride[",k,"]|0,n",k,"=shape[",k,"]|0"].join(""));for(var l=new Array(a.length),m=[],k=0;k<a.length;++k){var n=a[k];0!==n&&(0===m.length?l[n]="1":l[n]=m.join("*"),m.push("n"+n))}for(var o=-1,p=-1,k=0;k<a.length;++k){var q=a[k];0!==q&&(o>0?i.push(["d",q,"=s",q,"-d",o,"*n",o].join("")):i.push(["d",q,"=s",q].join("")),o=q);var n=a.length-1-k;0!==n&&(p>0?i.push(["e",n,"=s",n,"-e",p,"*n",p,",f",n,"=",l[n],"-f",p,"*n",p].join("")):i.push(["e",n,"=s",n,",f",n,"=",l[n]].join("")),p=n)}c.push("var "+i.join(","));var r=["0","n0-1","data","offset"].concat(e(a.length));c.push(["if(n0<=",j,"){","insertionSort(",r.join(","),")}else{","quickSort(",r.join(","),")}"].join("")),c.push("}return "+d);var s=new Function("insertionSort","quickSort",c.join("\n")),t=f(a,b),u=g(a,b,t);return s(t,u)}var i=a("typedarray-pool"),j=32;b.exports=h},{"typedarray-pool":233}],115:[function(a,b,c){"use strict";function d(a){var b=a.order,c=a.dtype,d=[b,c],g=d.join(":"),h=f[g];return h||(f[g]=h=e(b,c)),h(a),a}var e=a("./lib/compile_sort.js"),f={};b.exports=d},{"./lib/compile_sort.js":114}],116:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.vbo=b,this.shader=c}function e(a){var b=a.gl,c=f(b,[0,0,0,1,1,0,1,1]),e=g(b,h.boxVert,h.lineFrag);return new d(a,c,e)}b.exports=e;var f=a("gl-buffer"),g=a("gl-shader"),h=a("./shaders"),i=d.prototype;i.bind=function(){var a=this.shader;this.vbo.bind(),this.shader.bind(),a.attributes.coord.pointer(),a.uniforms.screenBox=this.plot.screenBox},i.drawBox=function(){var a=[0,0],b=[0,0];return function(c,d,e,f,g){var h=this.plot,i=this.shader,j=h.gl;a[0]=c,a[1]=d,b[0]=e,b[1]=f,i.uniforms.lo=a,i.uniforms.hi=b,i.uniforms.color=g,j.drawArrays(j.TRIANGLE_STRIP,0,4)}}(),i.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":119,"gl-buffer":75,"gl-shader":154}],117:[function(a,b,c){"use strict";function d(a,b,c,d){this.plot=a,this.vbo=b,this.shader=c,this.tickShader=d,this.ticks=[[],[]]}function e(a,b){return a-b}function f(a){var b=a.gl,c=g(b),e=h(b,j.gridVert,j.gridFrag),f=h(b,j.tickVert,j.gridFrag),i=new d(a,c,e,f);return i}b.exports=f;var g=a("gl-buffer"),h=a("gl-shader"),i=a("binary-search-bounds"),j=a("./shaders"),k=d.prototype;k.draw=function(){var a=[0,0],b=[0,0],c=[0,0];return function(){for(var d=this.plot,e=this.vbo,f=this.shader,g=this.ticks,h=d.gl,i=d._tickBounds,j=d.dataBox,k=d.viewBox,l=d.gridLineWidth,m=d.gridLineColor,n=d.gridLineEnable,o=d.pixelRatio,p=0;2>p;++p){var q=i[p],r=i[p+2],s=r-q,t=.5*(j[p+2]+j[p]),u=j[p+2]-j[p];b[p]=2*s/u,a[p]=2*(q-t)/u}f.bind(),e.bind(),f.attributes.dataCoord.pointer(),f.uniforms.dataShift=a,f.uniforms.dataScale=b;for(var v=0,p=0;2>p;++p){c[0]=c[1]=0,c[p]=1,f.uniforms.dataAxis=c,f.uniforms.lineWidth=l[p]/(k[p+2]-k[p])*o,f.uniforms.color=m[p];var w=6*g[p].length;n[p]&&h.drawArrays(h.TRIANGLES,v,w),v+=w}}}(),k.drawTickMarks=function(){var a=[0,0],b=[0,0],c=[1,0],d=[0,1],f=[0,0],g=[0,0];return function(){for(var h=this.plot,j=this.vbo,k=this.tickShader,l=this.ticks,m=h.gl,n=h._tickBounds,o=h.dataBox,p=h.viewBox,q=h.pixelRatio,r=h.screenBox,s=r[2]-r[0],t=r[3]-r[1],u=p[2]-p[0],v=p[3]-p[1],w=0;2>w;++w){var x=n[w],y=n[w+2],z=y-x,A=.5*(o[w+2]+o[w]),B=o[w+2]-o[w];b[w]=2*z/B,a[w]=2*(x-A)/B}b[0]*=u/s,a[0]*=u/s,b[1]*=v/t,a[1]*=v/t,k.bind(),j.bind(),k.attributes.dataCoord.pointer();var C=k.uniforms;C.dataShift=a,C.dataScale=b;var D=h.tickMarkLength,E=h.tickMarkWidth,F=h.tickMarkColor,G=0,H=6*l[0].length,I=Math.min(i.ge(l[0],(o[0]-n[0])/(n[2]-n[0]),e),l[0].length),J=Math.min(i.gt(l[0],(o[2]-n[0])/(n[2]-n[0]),e),l[0].length),K=G+6*I,L=6*Math.max(0,J-I),M=Math.min(i.ge(l[1],(o[1]-n[1])/(n[3]-n[1]),e),l[1].length),N=Math.min(i.gt(l[1],(o[3]-n[1])/(n[3]-n[1]),e),l[1].length),O=H+6*M,P=6*Math.max(0,N-M);f[0]=2*(p[0]-D[1])/s-1,f[1]=(p[3]+p[1])/t-1,g[0]=D[1]*q/s,g[1]=E[1]*q/t,C.color=F[1],C.tickScale=g,C.dataAxis=d,C.screenOffset=f,m.drawArrays(m.TRIANGLES,O,P),f[0]=(p[2]+p[0])/s-1,f[1]=2*(p[1]-D[0])/t-1,g[0]=E[0]*q/s,g[1]=D[0]*q/t,C.color=F[0],C.tickScale=g,C.dataAxis=c,C.screenOffset=f,m.drawArrays(m.TRIANGLES,K,L),f[0]=2*(p[2]+D[3])/s-1,f[1]=(p[3]+p[1])/t-1,g[0]=D[3]*q/s,g[1]=E[3]*q/t,C.color=F[3],C.tickScale=g,C.dataAxis=d,C.screenOffset=f,m.drawArrays(m.TRIANGLES,O,P),f[0]=(p[2]+p[0])/s-1,f[1]=2*(p[3]+D[2])/t-1,g[0]=E[2]*q/s,g[1]=D[2]*q/t,C.color=F[2],C.tickScale=g,C.dataAxis=c,C.screenOffset=f,m.drawArrays(m.TRIANGLES,K,L)}}(),k.update=function(){var a=[1,1,-1,-1,1,-1],b=[1,-1,1,1,-1,-1];return function(c){for(var d=c.ticks,e=c.bounds,f=new Float32Array(18*(d[0].length+d[1].length)),g=(this.plot.zeroLineEnable,0),h=[[],[]],i=0;2>i;++i)for(var j=h[i],k=d[i],l=e[i],m=e[i+2],n=0;n<k.length;++n){var o=(k[n].x-l)/(m-l);j.push(o);for(var p=0;6>p;++p)f[g++]=o,f[g++]=a[p],f[g++]=b[p]}this.ticks=h,this.vbo.update(f)}}(),k.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":119,"binary-search-bounds":121,"gl-buffer":75,"gl-shader":154}],118:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.vbo=b,this.shader=c}function e(a){var b=a.gl,c=f(b,[-1,-1,-1,1,1,-1,1,1]),e=g(b,h.lineVert,h.lineFrag),i=new d(a,c,e);return i}b.exports=e;var f=a("gl-buffer"),g=a("gl-shader"),h=a("./shaders"),i=d.prototype;i.bind=function(){var a=this.shader;this.vbo.bind(),this.shader.bind(),a.attributes.coord.pointer(),a.uniforms.screenBox=this.plot.screenBox},i.drawLine=function(){var a=[0,0],b=[0,0];return function(c,d,e,f,g,h){var i=this.plot,j=this.shader,k=i.gl;a[0]=c,a[1]=d,b[0]=e,b[1]=f,j.uniforms.start=a,j.uniforms.end=b,j.uniforms.width=g*i.pixelRatio,j.uniforms.color=h,k.drawArrays(k.TRIANGLE_STRIP,0,4)}}(),i.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":119,"gl-buffer":75,"gl-shader":154}],119:[function(a,b,c){"use strict";var d="#define GLSLIFY 1\nprecision lowp float;\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n";b.exports={lineVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n",lineFrag:d,textVert:"#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n",textFrag:d,gridVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n",gridFrag:d, 34 boxVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n",tickVert:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"}},{}],120:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.vbo=b,this.shader=c,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function e(a){var b=a.gl,c=f(b),e=g(b,j.textVert,j.textFrag),h=new d(a,c,e);return h}b.exports=e;var f=a("gl-buffer"),g=a("gl-shader"),h=a("text-cache"),i=a("binary-search-bounds"),j=a("./shaders"),k=d.prototype;k.drawTicks=function(){var a=[0,0],b=[0,0],c=[0,0];return function(d){var e=this.plot,f=this.shader,g=this.tickX[d],h=this.tickOffset[d],j=e.gl,k=e.viewBox,l=e.dataBox,m=e.screenBox,n=e.pixelRatio,o=e.tickEnable,p=e.tickPad,q=e.tickColor,r=e.tickAngle,s=(e.tickMarkLength,e.labelEnable),t=e.labelPad,u=e.labelColor,v=e.labelAngle,w=this.labelOffset[d],x=this.labelCount[d],y=i.lt(g,l[d]),z=i.le(g,l[d+2]);a[0]=a[1]=0,a[d]=1,b[d]=(k[2+d]+k[d])/(m[2+d]-m[d])-1;var A=2/m[2+(1^d)]-m[1^d];b[1^d]=A*k[1^d]-1,o[d]&&(b[1^d]-=A*n*p[d],z>y&&(f.uniforms.dataAxis=a,f.uniforms.screenOffset=b,f.uniforms.color=q[d],f.uniforms.angle=r[d],j.drawArrays(j.TRIANGLES,h[y],h[z]-h[y]))),s[d]&&(b[1^d]-=A*n*t[d],f.uniforms.dataAxis=c,f.uniforms.screenOffset=b,f.uniforms.color=u[d],f.uniforms.angle=v[d],j.drawArrays(j.TRIANGLES,w,x)),b[1^d]=A*k[2+(1^d)]-1,o[d+2]&&(b[1^d]+=A*n*p[d+2],z>y&&(f.uniforms.dataAxis=a,f.uniforms.screenOffset=b,f.uniforms.color=q[d+2],f.uniforms.angle=r[d+2],j.drawArrays(j.TRIANGLES,h[y],h[z]-h[y]))),s[d+2]&&(b[1^d]+=A*n*t[d+2],f.uniforms.dataAxis=c,f.uniforms.screenOffset=b,f.uniforms.color=u[d+2],f.uniforms.angle=v[d+2],j.drawArrays(j.TRIANGLES,w,x))}}(),k.drawTitle=function(){var a=[0,0],b=[0,0];return function(){for(var c=this.plot,d=this.shader,e=c.gl,f=c.screenBox,g=c.titleCenter,h=c.titleAngle,i=c.titleColor,g=c.titleCenter,j=c.pixelRatio,k=0;2>k;++k)b[k]=2*(g[k]*j-f[k])/(f[2+k]-f[k])-1;d.bind(),d.uniforms.dataAxis=a,d.uniforms.screenOffset=b,d.uniforms.angle=h,d.uniforms.color=i,e.drawArrays(e.TRIANGLES,this.titleOffset,this.titleCount)}}(),k.bind=function(){var a=[0,0],b=[0,0],c=[0,0];return function(){var d=this.plot,e=this.shader,f=d._tickBounds,g=d.dataBox,h=d.screenBox,i=d.viewBox;e.bind();for(var j=0;2>j;++j){var k=f[j],l=f[j+2],m=l-k,n=.5*(g[j+2]+g[j]),o=g[j+2]-g[j],p=i[j],q=i[j+2],r=q-p,s=h[j],t=h[j+2],u=t-s;b[j]=2*m/o*r/u,a[j]=2*(k-n)/o*r/u}c[1]=2*d.pixelRatio/(h[3]-h[1]),c[0]=c[1]*(h[3]-h[1])/(h[2]-h[0]),e.uniforms.dataScale=b,e.uniforms.dataShift=a,e.uniforms.textScale=c,this.vbo.bind(),e.attributes.textCoordinate.pointer()}}(),k.update=function(a){for(var b=[],c=a.ticks,d=a.bounds,e=0;2>e;++e){for(var f=[Math.floor(b.length/3)],g=[-(1/0)],i=c[e],j=0;j<i.length;++j){for(var k=i[j],l=k.x,m=k.text,n=k.font||"sans-serif",o=k.fontSize||12,p=h(n,m).data,q=1/(d[e+2]-d[e]),r=d[e],s=0;s<p.length;s+=2)b.push(p[s]*o,-p[s+1]*o,(l-r)*q);f.push(Math.floor(b.length/3)),g.push(l)}this.tickOffset[e]=f,this.tickX[e]=g}for(var e=0;2>e;++e){this.labelOffset[e]=Math.floor(b.length/3);for(var p=h(a.labelFont[e],a.labels[e]).data,o=a.labelSize[e],j=0;j<p.length;j+=2)b.push(p[j]*o,-p[j+1]*o,0);this.labelCount[e]=Math.floor(b.length/3)-this.labelOffset[e]}this.titleOffset=Math.floor(b.length/3);for(var p=h(a.titleFont,a.title).data,o=a.titleSize,j=0;j<p.length;j+=2)b.push(p[j]*o,-p[j+1]*o,0);this.titleCount=Math.floor(b.length/3)-this.titleOffset,this.vbo.update(b)},k.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":119,"binary-search-bounds":121,"gl-buffer":75,"gl-shader":154,"text-cache":228}],121:[function(a,b,c){"use strict";function d(a,b,c,d,e){var f=["function ",a,"(a,l,h,",d.join(","),"){",e?"":"var i=",c?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return e?b.indexOf("c")<0?f.push(";if(x===y){return m}else if(x<=y){"):f.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):f.push(";if(",b,"){i=m;"),c?f.push("l=m+1}else{h=m-1}"):f.push("h=m-1}else{l=m+1}"),f.push("}"),e?f.push("return -1};"):f.push("return i};"),f.join("")}function e(a,b,c,e){var f=new Function([d("A","x"+a+"y",b,["y"],e),d("P","c(x,y)"+a+"0",b,["y","c"],e),"function dispatchBsearch",c,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",c].join(""));return f()}b.exports={ge:e(">=",!1,"GE"),gt:e(">",!1,"GT"),lt:e("<",!0,"LT"),le:e("<=",!0,"LE"),eq:e("-",!0,"EQ",!0)}},{}],122:[function(a,b,c){"use strict";function d(a,b){this.gl=a,this.pickBuffer=b,this.screenBox=[0,0,a.drawingBufferWidth,a.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-(1/0),-(1/0)],this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function e(a){for(var b=a.slice(),c=0;c<b.length;++c)b[c]=b[c].slice();return b}function f(a,b){return a.x-b.x}function g(a){var b=a.gl,c=h(b,[b.drawingBufferWidth,b.drawingBufferHeight]),e=new d(b,c);return e.grid=i(e),e.text=j(e),e.line=k(e),e.box=l(e),e.update(a),e}b.exports=g;var h=a("gl-select-static"),i=a("./lib/grid"),j=a("./lib/text"),k=a("./lib/line"),l=a("./lib/box"),m=d.prototype;m.setDirty=function(){this.dirty=this.pickDirty=!0},m.setOverlayDirty=function(){this.dirty=!0},m.nextDepthValue=function(){return this._depthCounter++/65536},m.draw=function(){return function(){var a=this.gl,b=this.screenBox,c=this.viewBox,d=this.dataBox,e=this.pixelRatio,f=this.grid,g=this.line,h=this.text,i=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,a.bindFramebuffer(a.FRAMEBUFFER,null),a.enable(a.SCISSOR_TEST),a.disable(a.DEPTH_TEST),a.depthFunc(a.LESS),a.depthMask(!1),a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD,a.FUNC_ADD),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.scissor(b[0],b[1],b[2]-b[0],b[3]-b[1]);var j=this.borderColor;a.clearColor(j[0]*j[3],j[1]*j[3],j[2]*j[3],j[3]),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),a.scissor(c[0],c[1],c[2]-c[0],c[3]-c[1]),a.viewport(c[0],c[1],c[2]-c[0],c[3]-c[1]);var k=this.backgroundColor;a.clearColor(k[0]*k[3],k[1]*k[3],k[2]*k[3],k[3]),a.clear(a.COLOR_BUFFER_BIT),f.draw();var l=this.zeroLineEnable,m=this.zeroLineColor,n=this.zeroLineWidth;if(l[0]||l[1]){g.bind();for(var o=0;2>o;++o)if(l[o]&&d[o]<=0&&d[o+2]>=0){var p=b[o]-d[o]*(b[o+2]-b[o])/(d[o+2]-d[o]);0===o?g.drawLine(p,b[1],p,b[3],n[o],m[o]):g.drawLine(b[0],p,b[2],p,n[o],m[o])}}for(var o=0;o<i.length;++o)i[o].draw();a.viewport(b[0],b[1],b[2]-b[0],b[3]-b[1]),a.scissor(b[0],b[1],b[2]-b[0],b[3]-b[1]),this.grid.drawTickMarks(),g.bind();var q=this.borderLineEnable,r=this.borderLineWidth,s=this.borderLineColor;q[1]&&g.drawLine(c[0],c[1]-.5*r[1]*e,c[0],c[3]+.5*r[3]*e,r[1],s[1]),q[0]&&g.drawLine(c[0]-.5*r[0]*e,c[1],c[2]+.5*r[2]*e,c[1],r[0],s[0]),q[3]&&g.drawLine(c[2],c[1]-.5*r[1]*e,c[2],c[3]+.5*r[3]*e,r[3],s[3]),q[2]&&g.drawLine(c[0]-.5*r[0]*e,c[3],c[2]+.5*r[2]*e,c[3],r[2],s[2]),h.bind();for(var o=0;2>o;++o)h.drawTicks(o);this.titleEnable&&h.drawTitle();for(var t=this.overlays,o=0;o<t.length;++o)t[o].draw();a.disable(a.SCISSOR_TEST),a.disable(a.BLEND),a.depthMask(!0)}}}(),m.drawPick=function(){return function(){var a=this.pickBuffer;this.gl;this._pickTimeout=null,a.begin();for(var b=1,c=this.objects,d=0;d<c.length;++d)b=c[d].drawPick(b);a.end()}}(),m.pick=function(){return function(a,b){var c=this.pixelRatio,d=this.pickPixelRatio,e=this.viewBox,f=0|Math.round((a-e[0]/c)*d),g=0|Math.round((b-e[1]/c)*d),h=this.pickBuffer.query(f,g,this.pickRadius);if(!h)return null;for(var i=h.id+(h.value[0]<<8)+(h.value[1]<<16)+(h.value[2]<<24),j=this.objects,k=0;k<j.length;++k){var l=j[k].pick(f,g,i);if(l)return l}return null}}(),m.setScreenBox=function(a){var b=this.screenBox,c=this.pixelRatio;b[0]=0|Math.round(a[0]*c),b[1]=0|Math.round(a[1]*c),b[2]=0|Math.round(a[2]*c),b[3]=0|Math.round(a[3]*c),this.setDirty()},m.setDataBox=function(a){var b=this.dataBox,c=b[0]!==a[0]||b[1]!==a[1]||b[2]!==a[2]||b[3]!==a[3];c&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],this.setDirty())},m.setViewBox=function(a){var b=this.pixelRatio,c=this.viewBox;c[0]=0|Math.round(a[0]*b),c[1]=0|Math.round(a[1]*b),c[2]=0|Math.round(a[2]*b),c[3]=0|Math.round(a[3]*b);var d=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((a[2]-a[0])*d),0|Math.round((a[3]-a[1])*d)],this.setDirty()},m.update=function(a){a=a||{};var b=this.gl;this.pixelRatio=a.pixelRatio||1;var c=this.pixelRatio;this.pickPixelRatio=Math.max(c,1),this.setScreenBox(a.screenBox||[0,0,b.drawingBufferWidth/c,b.drawingBufferHeight/c]);this.screenBox;this.setViewBox(a.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/c,.125*(this.screenBox[3]-this.screenBox[1])/c,.875*(this.screenBox[2]-this.screenBox[0])/c,.875*(this.screenBox[3]-this.screenBox[1])/c]);var d=this.viewBox,g=(d[2]-d[0])/(d[3]-d[1]);this.setDataBox(a.dataBox||[-10,-10/g,10,10/g]),this.borderColor=(a.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(a.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(a.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(a.gridLineWidth||[1,1]).slice(),this.gridLineColor=e(a.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(a.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(a.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=e(a.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(a.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(a.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=e(a.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(a.titleCenter||[.5*(d[0]+d[2])/c,(d[3]+120)/c]).slice(),this.titleEnable=!("titleEnable"in a&&!a.titleEnable),this.titleAngle=a.titleAngle||0,this.titleColor=(a.titleColor||[0,0,0,1]).slice(),this.labelPad=(a.labelPad||[15,15,15,15]).slice(),this.labelAngle=(a.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(a.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=e(a.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(a.tickPad||[15,15,15,15]).slice(),this.tickAngle=(a.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(a.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=e(a.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(a.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(a.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=e(a.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=a.ticks||[[],[]],i=this._tickBounds;i[0]=i[1]=1/0,i[2]=i[3]=-(1/0);for(var j=0;2>j;++j){var k=h[j].slice(0);0!==k.length&&(k.sort(f),i[j]=Math.min(i[j],k[0].x),i[j+2]=Math.max(i[j+2],k[k.length-1].x))}this.grid.update({bounds:i,ticks:h}),this.text.update({bounds:i,ticks:h,labels:a.labels||["x","y"],labelSize:a.labelSize||[12,12],labelFont:a.labelFont||["sans-serif","sans-serif"],title:a.title||"",titleSize:a.titleSize||18,titleFont:a.titleFont||"sans-serif"}),this.setDirty()},m.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var a=this.objects.length-1;a>=0;--a)this.objects[a].dispose();this.objects.length=0;for(var a=this.overlays.length-1;a>=0;--a)this.overlays[a].dispose();this.overlays.length=0,this.gl=null},m.addObject=function(a){this.objects.indexOf(a)<0&&(this.objects.push(a),this.setDirty())},m.removeObject=function(a){for(var b=this.objects,c=0;c<b.length;++c)if(b[c]===a){b.splice(c,1),this.setDirty();break}},m.addOverlay=function(a){this.overlays.indexOf(a)<0&&(this.overlays.push(a),this.setOverlayDirty())},m.removeOverlay=function(a){for(var b=this.overlays,c=0;c<b.length;++c)if(b[c]===a){b.splice(c,1),this.setOverlayDirty();break}}},{"./lib/box":116,"./lib/grid":117,"./lib/line":118,"./lib/text":120,"gl-select-static":153}],123:[function(a,b,c){var d=a("gl-shader"),e="precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}",f="precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}";b.exports=function(a){return d(a,e,f,null,[{name:"position",type:"vec2"}])}},{"gl-shader":154}],124:[function(a,b,c){"use strict";function d(a,b){a=a||document.body,b=b||{};var c=[.01,1/0];"distanceLimits"in b&&(c[0]=b.distanceLimits[0],c[1]=b.distanceLimits[1]),"zoomMin"in b&&(c[0]=b.zoomMin),"zoomMax"in b&&(c[1]=b.zoomMax);var d=f({center:b.center||[0,0,0],up:b.up||[0,1,0],eye:b.eye||[0,0,10],mode:b.mode||"orbit",distanceLimits:c}),i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=0,k=a.clientWidth,l=a.clientHeight,m={view:d,element:a,delay:b.delay||16,rotateSpeed:b.rotateSpeed||1,zoomSpeed:b.zoomSpeed||1,translateSpeed:b.translateSpeed||1,flipX:!!b.flipX,flipY:!!b.flipY,modes:d.modes,tick:function(){var b=e(),c=this.delay;d.idle(b-c),d.flush(b-(100+2*c));var f=b-2*c;d.recalcMatrix(f);for(var g=!0,h=d.computedMatrix,m=0;16>m;++m)g=g&&i[m]===h[m],i[m]=h[m];var n=a.clientWidth===k&&a.clientHeight===l;return k=a.clientWidth,l=a.clientHeight,g?!n:(j=Math.exp(d.computedRadius[0]),!0)},lookAt:function(a,b,c){d.lookAt(d.lastT(),a,b,c)},rotate:function(a,b,c){d.rotate(d.lastT(),a,b,c)},pan:function(a,b,c){d.pan(d.lastT(),a,b,c)},translate:function(a,b,c){d.translate(d.lastT(),a,b,c)}};Object.defineProperties(m,{matrix:{get:function(){return d.computedMatrix},set:function(a){return d.setMatrix(d.lastT(),a),d.computedMatrix},enumerable:!0},mode:{get:function(){return d.getMode()},set:function(a){return d.setMode(a),d.getMode()},enumerable:!0},center:{get:function(){return d.computedCenter},set:function(a){return d.lookAt(d.lastT(),a),d.computedCenter},enumerable:!0},eye:{get:function(){return d.computedEye},set:function(a){return d.lookAt(d.lastT(),null,a),d.computedEye},enumerable:!0},up:{get:function(){return d.computedUp},set:function(a){return d.lookAt(d.lastT(),null,null,a),d.computedUp},enumerable:!0},distance:{get:function(){return j},set:function(a){return d.setDistance(d.lastT(),a),a},enumerable:!0},distanceLimits:{get:function(){return d.getDistanceLimits(c)},set:function(a){return d.setDistanceLimits(a),a},enumerable:!0}}),a.addEventListener("contextmenu",function(a){return a.preventDefault(),!1});var n=0,o=0;return g(a,function(b,c,f,g){var h=1/a.clientHeight,i=h*(c-n),k=h*(f-o),l=m.flipX?1:-1,p=m.flipY?1:-1,q=Math.PI*m.rotateSpeed,r=e();if(1&b)g.shift?d.rotate(r,0,0,-i*q):d.rotate(r,l*q*i,-p*q*k,0);else if(2&b)d.pan(r,-m.translateSpeed*i*j,m.translateSpeed*k*j,0);else if(4&b){var s=m.zoomSpeed*k/window.innerHeight*(r-d.lastT())*50;d.pan(r,0,0,j*(Math.exp(s)-1))}n=c,o=f}),h(a,function(a,b,c){var f=m.flipX?1:-1,g=m.flipY?1:-1,h=e();if(Math.abs(a)>Math.abs(b))d.rotate(h,0,0,-a*f*Math.PI*m.rotateSpeed/window.innerWidth);else{var i=m.zoomSpeed*g*b/window.innerHeight*(h-d.lastT())/100;d.pan(h,0,0,j*(Math.exp(i)-1))}},!0),m}b.exports=d;var e=a("right-now"),f=a("3d-view"),g=a("mouse-change"),h=a("mouse-wheel")},{"3d-view":38,"mouse-change":196,"mouse-wheel":200,"right-now":210}],125:[function(a,b,c){!function(){"use strict";function a(b){b.permitHostObjects___&&b.permitHostObjects___(a)}function c(a){return!(a.substr(0,n.length)==n&&"___"===a.substr(a.length-3))}function d(a){if(a!==Object(a))throw new TypeError("Not an object: "+a);var b=a[o];if(b&&b.key===a)return b;if(m(a)){b={key:a};try{return l(a,o,{value:b,writable:!1,enumerable:!1,configurable:!1}),b}catch(c){return}}}function e(a){return a.prototype=null,Object.freeze(a)}function f(){s||"undefined"==typeof console||(s=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=a);var g=!1;if("function"==typeof WeakMap){var h=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var i=new h,j=Object.freeze({});if(i.set(j,1),1===i.get(j))return void(b.exports=WeakMap);g=!0}}var k=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),l=Object.defineProperty,m=Object.isExtensible,n="weakmap:",o=n+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var p=new ArrayBuffer(25),q=new Uint8Array(p);crypto.getRandomValues(q),o=n+"rand:"+Array.prototype.map.call(q,function(a){return(a%36).toString(36)}).join("")+"___"}if(l(Object,"getOwnPropertyNames",{value:function(a){return k(a).filter(c)}}),"getPropertyNames"in Object){var r=Object.getPropertyNames;l(Object,"getPropertyNames",{value:function(a){return r(a).filter(c)}})}!function(){var a=Object.freeze;l(Object,"freeze",{value:function(b){return d(b),a(b)}});var b=Object.seal;l(Object,"seal",{value:function(a){return d(a),b(a)}});var c=Object.preventExtensions;l(Object,"preventExtensions",{value:function(a){return d(a),c(a)}})}();var s=!1,t=0,u=function(){function a(a,b){var c,e=d(a);return e?j in e?e[j]:b:(c=h.indexOf(a),c>=0?i[c]:b)}function b(a){var b=d(a);return b?j in b:h.indexOf(a)>=0}function c(a,b){var c,e=d(a);return e?e[j]=b:(c=h.indexOf(a),c>=0?i[c]=b:(c=h.length,i[c]=b,h[c]=a)),this}function g(a){var b,c,e=d(a);return e?j in e&&delete e[j]:(b=h.indexOf(a),0>b?!1:(c=h.length-1,h[b]=void 0,i[b]=i[c],h[b]=h[c],h.length=c,i.length=c,!0))}this instanceof u||f();var h=[],i=[],j=t++;return Object.create(u.prototype,{get___:{value:e(a)},has___:{value:e(b)},set___:{value:e(c)},delete___:{value:e(g)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(a,b){return this.get___(a,b)},writable:!0,configurable:!0},has:{value:function(a){return this.has___(a)},writable:!0,configurable:!0},set:{value:function(a,b){return this.set___(a,b)},writable:!0,configurable:!0},"delete":{value:function(a){return this.delete___(a)},writable:!0,configurable:!0}}),"function"==typeof h?!function(){function c(){function b(a,b){return k?j.has(a)?j.get(a):k.get___(a,b):j.get(a,b)}function c(a){return j.has(a)||(k?k.has___(a):!1)}function d(a){var b=!!j["delete"](a);return k?k.delete___(a)||b:b}this instanceof u||f();var i,j=new h,k=void 0,l=!1;return i=g?function(a,b){return j.set(a,b),j.has(a)||(k||(k=new u),k.set(a,b)),this}:function(a,b){if(l)try{j.set(a,b)}catch(c){k||(k=new u),k.set___(a,b)}else j.set(a,b);return this},Object.create(u.prototype,{get___:{value:e(b)},has___:{value:e(c)},set___:{value:e(i)},delete___:{value:e(d)},permitHostObjects___:{value:e(function(b){if(b!==a)throw new Error("bogus call to permitHostObjects___");l=!0})}})}g&&"undefined"!=typeof Proxy&&(Proxy=void 0),c.prototype=u.prototype,b.exports=c,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),b.exports=u)}}()},{}],126:[function(a,b,c){"use strict";function d(a){var b=h.get(a);if(!b||!a.isBuffer(b._triangleBuffer.buffer)){var c=f(a,new Float32Array([-1,-1,-1,4,4,-1]));b=g(a,[{buffer:c,type:a.FLOAT,size:2}]),b._triangleBuffer=c,h.set(a,b)}b.bind(),a.drawArrays(a.TRIANGLES,0,3),b.unbind()}var e="undefined"==typeof WeakMap?a("weak-map"):WeakMap,f=a("gl-buffer"),g=a("gl-vao"),h=new e;b.exports=d},{"gl-buffer":75,"gl-vao":189,"weak-map":125}],127:[function(a,b,c){"use strict";function d(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a}function e(a){this.gl=a,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=k(a)}function f(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function g(a,b,c,d,e){for(var f=a.primalOffset,g=a.primalMinor,h=a.mirrorOffset,i=a.mirrorMinor,j=d[b],k=0;3>k;++k)if(b!==k){var l=f,m=h,n=g,o=i;j&1<<k&&(l=h,m=f,n=i,o=g),l[k]=c[0][k],m[k]=c[1][k],e[k]>0?(n[k]=-1,o[k]=0):(n[k]=0,o[k]=1)}}function h(a,b){var c=new e(a);return c.update(b),c}b.exports=h;var i=a("./lib/text.js"),j=a("./lib/lines.js"),k=a("./lib/background.js"),l=a("./lib/cube.js"),m=a("./lib/ticks.js"),n=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o=e.prototype;o.update=function(a){function b(b,c,d){if(d in a){var e,f=a[d],g=this[d];(b?Array.isArray(f)&&Array.isArray(f[0]):Array.isArray(f))?this[d]=e=[c(f[0]),c(f[1]),c(f[2])]:this[d]=e=[c(f),c(f),c(f)];for(var h=0;3>h;++h)if(e[h]!==g[h])return!0}return!1}a=a||{};var c,d=b.bind(this,!1,Number),e=b.bind(this,!1,Boolean),f=b.bind(this,!1,String),g=b.bind(this,!0,function(a){if(Array.isArray(a)){if(3===a.length)return[+a[0],+a[1],+a[2],1];if(4===a.length)return[+a[0],+a[1],+a[2],+a[3]]}return[0,0,0,1]}),h=!1,k=!1;if("bounds"in a)for(var l=a.bounds,n=0;2>n;++n)for(var o=0;3>o;++o)l[n][o]!==this.bounds[n][o]&&(k=!0),this.bounds[n][o]=l[n][o];if("ticks"in a){c=a.ticks,h=!0,this.autoTicks=!1;for(var n=0;3>n;++n)this.tickSpacing[n]=0}else d("tickSpacing")&&(this.autoTicks=!0,k=!0);if(this._firstInit&&("ticks"in a||"tickSpacing"in a||(this.autoTicks=!0),k=!0,h=!0,this._firstInit=!1),k&&this.autoTicks&&(c=m.create(this.bounds,this.tickSpacing),h=!0),h){for(var n=0;3>n;++n)c[n].sort(function(a,b){return a.x-b.x});m.equal(c,this.ticks)?h=!1:this.ticks=c}e("tickEnable"),f("tickFont")&&(h=!0),d("tickSize"),d("tickAngle"),d("tickPad"),g("tickColor");var p=f("labels");f("labelFont")&&(p=!0),e("labelEnable"),d("labelSize"),d("labelPad"),g("labelColor"),e("lineEnable"),e("lineMirror"),d("lineWidth"),g("lineColor"),e("lineTickEnable"),e("lineTickMirror"),d("lineTickLength"),d("lineTickWidth"),g("lineTickColor"),e("gridEnable"),d("gridWidth"),g("gridColor"),e("zeroEnable"),g("zeroLineColor"),d("zeroLineWidth"),e("backgroundEnable"),g("backgroundColor"),this._text?this._text&&(p||h)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=i(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&h&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=j(this.gl,this.bounds,this.ticks))};var p=[new f,new f,new f],q=[0,0,0],r={model:n,view:n,projection:n};o.isOpaque=function(){return!0},o.isTransparent=function(){return!1},o.drawTransparent=function(a){};var s=[0,0,0],t=[0,0,0],u=[0,0,0];o.draw=function(a){a=a||r;for(var b=this.gl,c=a.model||n,e=a.view||n,f=a.projection||n,h=this.bounds,i=l(c,e,f,h),j=i.cubeEdges,k=i.axis,m=e[12],o=e[13],v=e[14],w=e[15],x=this.pixelRatio*(f[3]*m+f[7]*o+f[11]*v+f[15]*w)/b.drawingBufferHeight,y=0;3>y;++y)this.lastCubeProps.cubeEdges[y]=j[y],this.lastCubeProps.axis[y]=k[y];for(var z=p,y=0;3>y;++y)g(p[y],y,this.bounds,j,k);for(var b=this.gl,A=q,y=0;3>y;++y)this.backgroundEnable[y]?A[y]=k[y]:A[y]=0;this._background.draw(c,e,f,h,A,this.backgroundColor),this._lines.bind(c,e,f,this);for(var y=0;3>y;++y){var B=[0,0,0];k[y]>0?B[y]=h[1][y]:B[y]=h[0][y];for(var C=0;2>C;++C){var D=(y+1+C)%3,E=(y+1+(1^C))%3;this.gridEnable[D]&&this._lines.drawGrid(D,E,this.bounds,B,this.gridColor[D],this.gridWidth[D]*this.pixelRatio)}for(var C=0;2>C;++C){var D=(y+1+C)%3,E=(y+1+(1^C))%3;this.zeroEnable[E]&&h[0][E]<=0&&h[1][E]>=0&&this._lines.drawZero(D,E,this.bounds,B,this.zeroLineColor[E],this.zeroLineWidth[E]*this.pixelRatio)}}for(var y=0;3>y;++y){this.lineEnable[y]&&this._lines.drawAxisLine(y,this.bounds,z[y].primalOffset,this.lineColor[y],this.lineWidth[y]*this.pixelRatio),this.lineMirror[y]&&this._lines.drawAxisLine(y,this.bounds,z[y].mirrorOffset,this.lineColor[y],this.lineWidth[y]*this.pixelRatio);for(var F=d(s,z[y].primalMinor),G=d(t,z[y].mirrorMinor),H=this.lineTickLength,C=0;3>C;++C){var I=x/c[5*C];F[C]*=H[C]*I,G[C]*=H[C]*I}this.lineTickEnable[y]&&this._lines.drawAxisTicks(y,z[y].primalOffset,F,this.lineTickColor[y],this.lineTickWidth[y]*this.pixelRatio),this.lineTickMirror[y]&&this._lines.drawAxisTicks(y,z[y].mirrorOffset,G,this.lineTickColor[y],this.lineTickWidth[y]*this.pixelRatio)}this._text.bind(c,e,f,this.pixelRatio);for(var y=0;3>y;++y){for(var J=z[y].primalMinor,K=d(u,z[y].primalOffset),C=0;3>C;++C)this.lineTickEnable[y]&&(K[C]+=x*J[C]*Math.max(this.lineTickLength[C],0)/c[5*C]);if(this.tickEnable[y]){for(var C=0;3>C;++C)K[C]+=x*J[C]*this.tickPad[C]/c[5*C];this._text.drawTicks(y,this.tickSize[y],this.tickAngle[y],K,this.tickColor[y])}if(this.labelEnable[y]){for(var C=0;3>C;++C)K[C]+=x*J[C]*this.labelPad[C]/c[5*C];K[y]+=.5*(h[0][y]+h[1][y]),this._text.drawLabel(y,this.labelSize[y],this.labelAngle[y],K,this.labelColor[y])}}},o.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":128,"./lib/cube.js":129,"./lib/lines.js":130,"./lib/text.js":132,"./lib/ticks.js":133}],128:[function(a,b,c){"use strict";function d(a,b,c,d){this.gl=a,this.buffer=b,this.vao=c,this.shader=d}function e(a){for(var b=[],c=[],e=0,i=0;3>i;++i)for(var j=(i+1)%3,k=(i+2)%3,l=[0,0,0],m=[0,0,0],n=-1;1>=n;n+=2){c.push(e,e+2,e+1,e+1,e+2,e+3),l[i]=n,m[i]=n;for(var o=-1;1>=o;o+=2){l[j]=o;for(var p=-1;1>=p;p+=2)l[k]=p,b.push(l[0],l[1],l[2],m[0],m[1],m[2]),e+=1}var q=j;j=k,k=q}var r=f(a,new Float32Array(b)),s=f(a,new Uint16Array(c),a.ELEMENT_ARRAY_BUFFER),t=g(a,[{buffer:r,type:a.FLOAT,size:3,offset:0,stride:24},{buffer:r,type:a.FLOAT,size:3,offset:12,stride:24}],s),u=h(a);return u.attributes.position.location=0,u.attributes.normal.location=1,new d(a,r,t,u)}b.exports=e;var f=a("gl-buffer"),g=a("gl-vao"),h=a("./shaders").bg,i=d.prototype;i.draw=function(a,b,c,d,e,f){for(var g=!1,h=0;3>h;++h)g=g||e[h];if(g){var i=this.gl;i.enable(i.POLYGON_OFFSET_FILL),i.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:a,view:b,projection:c,bounds:d,enable:e,colors:f},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),i.disable(i.POLYGON_OFFSET_FILL)}},i.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":131,"gl-buffer":75,"gl-vao":189}],129:[function(a,b,c){"use strict";function d(a,b,c){for(var d=0;4>d;++d){a[d]=c[12+d];for(var e=0;3>e;++e)a[d]+=b[e]*c[4*e+d]}}function e(a){for(var b=0;b<p.length;++b)if(a=i.positive(a,p[b]),a.length<3)return 0;for(var c=a[0],d=c[0]/c[3],e=c[1]/c[3],f=0,b=1;b+1<a.length;++b){var g=a[b],h=a[b+1],j=g[0]/g[3],k=g[1]/g[3],l=h[0]/h[3],m=h[1]/h[3],n=j-d,o=k-e,q=l-d,r=m-e;f+=Math.abs(n*r-o*q)}return f}function f(a,b,c,f){h(k,b,a),h(k,c,k);for(var i=0,p=0;2>p;++p){n[2]=f[p][2];for(var t=0;2>t;++t){n[1]=f[t][1];for(var u=0;2>u;++u)n[0]=f[u][0],d(l[i],n,k),i+=1}}for(var v=-1,p=0;8>p;++p){for(var w=l[p][3],x=0;3>x;++x)m[p][x]=l[p][x]/w;0>w&&(0>v?v=p:m[p][2]<m[v][2]&&(v=p))}if(0>v){v=0;for(var y=0;3>y;++y){for(var z=(y+2)%3,A=(y+1)%3,B=-1,C=-1,D=0;2>D;++D){var E=D<<y,F=E+(D<<z)+(1-D<<A),G=E+(1-D<<z)+(D<<A);j(m[E],m[F],m[G],o)<0||(D?B=1:C=1)}if(0>B||0>C)C>B&&(v|=1<<y);else{for(var D=0;2>D;++D){var E=D<<y,F=E+(D<<z)+(1-D<<A),G=E+(1-D<<z)+(D<<A),H=e([l[E],l[F],l[G],l[E+(1<<z)+(1<<A)]]);D?B=H:C=H}C>B&&(v|=1<<y)}}}for(var I=7^v,J=-1,p=0;8>p;++p)p!==v&&p!==I&&(0>J?J=p:m[J][1]>m[p][1]&&(J=p));for(var K=-1,p=0;3>p;++p){var L=J^1<<p;if(L!==v&&L!==I){0>K&&(K=L);var A=m[L];A[0]<m[K][0]&&(K=L)}}for(var M=-1,p=0;3>p;++p){var L=J^1<<p;if(L!==v&&L!==I&&L!==K){0>M&&(M=L);var A=m[L];A[0]>m[M][0]&&(M=L)}}var N=q;N[0]=N[1]=N[2]=0,N[g.log2(K^J)]=J&K,N[g.log2(J^M)]=J&M;var O=7^M;O===v||O===I?(O=7^K,N[g.log2(M^O)]=O&M):N[g.log2(K^O)]=O&K;for(var P=r,Q=v,y=0;3>y;++y)Q&1<<y?P[y]=-1:P[y]=1;return s}b.exports=f;var g=a("bit-twiddle"),h=a("gl-mat4/multiply"),i=(a("gl-mat4/invert"),a("split-polygon")),j=a("robust-orientation"),k=new Array(16),l=(new Array(16),new Array(8)),m=new Array(8),n=new Array(3),o=[0,0,0];!function(){for(var a=0;8>a;++a)l[a]=[1,1,1,1],m[a]=[1,1,1]}();var p=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],q=[1,1,1],r=[0,0,0],s={cubeEdges:q,axis:r}},{"bit-twiddle":49,"gl-mat4/invert":94,"gl-mat4/multiply":96,"robust-orientation":214,"split-polygon":135}],130:[function(a,b,c){"use strict";function d(a){return a[0]=a[1]=a[2]=0,a}function e(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a}function f(a,b,c,d,e,f,g,h){this.gl=a,this.vertBuffer=b,this.vao=c,this.shader=d,this.tickCount=e,this.tickOffset=f,this.gridCount=g,this.gridOffset=h}function g(a,b,c){var d=[],e=[0,0,0],g=[0,0,0],k=[0,0,0],l=[0,0,0];d.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var m=0;3>m;++m){for(var n=d.length/3|0,o=0;o<c[m].length;++o){var p=+c[m][o].x;d.push(p,0,1,p,1,1,p,0,-1,p,0,-1,p,1,1,p,1,-1)}var q=d.length/3|0;e[m]=n,g[m]=q-n;for(var n=d.length/3|0,r=0;r<c[m].length;++r){var p=+c[m][r].x;d.push(p,0,1,p,1,1,p,0,-1,p,0,-1,p,1,1,p,1,-1)}var q=d.length/3|0;k[m]=n,l[m]=q-n}var s=h(a,new Float32Array(d)),t=i(a,[{buffer:s,type:a.FLOAT,size:3,stride:0,offset:0}]),u=j(a);return u.attributes.position.location=0,new f(a,s,t,u,g,e,l,k)}b.exports=g;var h=a("gl-buffer"),i=a("gl-vao"),j=a("./shaders").line,k=[0,0,0],l=[0,0,0],m=[0,0,0],n=[0,0,0],o=[1,1],p=f.prototype;p.bind=function(a,b,c){this.shader.bind(),this.shader.uniforms.model=a,this.shader.uniforms.view=b,this.shader.uniforms.projection=c,o[0]=this.gl.drawingBufferWidth,o[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=o,this.vao.bind()},p.drawAxisLine=function(a,b,c,f,g){var h=d(l);this.shader.uniforms.majorAxis=l, 35 h[a]=b[1][a]-b[0][a],this.shader.uniforms.minorAxis=h;var i=e(n,c);i[a]+=b[0][a],this.shader.uniforms.offset=i,this.shader.uniforms.lineWidth=g,this.shader.uniforms.color=f;var j=d(m);j[(a+2)%3]=1,this.shader.uniforms.screenAxis=j,this.vao.draw(this.gl.TRIANGLES,6);var j=d(m);j[(a+1)%3]=1,this.shader.uniforms.screenAxis=j,this.vao.draw(this.gl.TRIANGLES,6)},p.drawAxisTicks=function(a,b,c,e,f){var g=d(k);g[a]=1,this.shader.uniforms.majorAxis=g,this.shader.uniforms.offset=b,this.shader.uniforms.minorAxis=c,this.shader.uniforms.color=e,this.shader.uniforms.lineWidth=f;var h=d(m);h[a]=1,this.shader.uniforms.screenAxis=h,this.vao.draw(this.gl.TRIANGLES,this.tickCount[a],this.tickOffset[a])},p.drawGrid=function(a,b,c,f,g,h){var i=d(l);i[b]=c[1][b]-c[0][b],this.shader.uniforms.minorAxis=i;var j=e(n,f);j[b]+=c[0][b],this.shader.uniforms.offset=j;var o=d(k);o[a]=1,this.shader.uniforms.majorAxis=o;var p=d(m);p[a]=1,this.shader.uniforms.screenAxis=p,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=g,this.vao.draw(this.gl.TRIANGLES,this.gridCount[a],this.gridOffset[a])},p.drawZero=function(a,b,c,f,g,h){var i=d(l);this.shader.uniforms.majorAxis=i,i[a]=c[1][a]-c[0][a],this.shader.uniforms.minorAxis=i;var j=e(n,f);j[a]+=c[0][a],this.shader.uniforms.offset=j;var k=d(m);k[b]=1,this.shader.uniforms.screenAxis=k,this.shader.uniforms.lineWidth=h,this.shader.uniforms.color=g,this.vao.draw(this.gl.TRIANGLES,6)},p.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":131,"gl-buffer":75,"gl-vao":189}],131:[function(a,b,c){"use strict";var d=a("gl-shader"),e="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * view * model * vec4(p, 1.0);\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n",f="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";c.line=function(a){return d(a,e,f,null,[{name:"position",type:"vec3"}])};var g="#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvoid main() { \n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\n -sin(angle), cos(angle));\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n vec4 worldPosition = model * vec4(dataPosition, 1);\n \n //Compute clip position\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n //Apply text offset in clip coordinates\n clipPosition += vec4(viewOffset, 0, 0);\n\n //Done\n gl_Position = clipPosition;\n}",h="precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}";c.text=function(a){return d(a,g,h,null,[{name:"position",type:"vec3"}])};var i="#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n if(dot(normal, enable) > 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}",j="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}";c.bg=function(a){return d(a,i,j,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":154}],132:[function(a,b,c){(function(c){"use strict";function d(a,b,c,d){this.gl=a,this.shader=b,this.buffer=c,this.vao=d,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function e(a,b){try{return i(a,b)}catch(c){return console.warn("error vectorizing text:",c),{cells:[],positions:[]}}}function f(a,b,c,e,f,i){var k=g(a),l=h(a,[{buffer:k,size:3}]),m=j(a);m.attributes.position.location=0;var n=new d(a,m,k,l);return n.update(b,c,e,f,i),n}b.exports=f;var g=a("gl-buffer"),h=a("gl-vao"),i=a("vectorize-text"),j=a("./shaders").text,k=window||c.global||{},l=k.__TEXT_CACHE||{};k.__TEXT_CACHE={};var m=3,n=d.prototype,o=[0,0];n.bind=function(a,b,c,d){this.vao.bind(),this.shader.bind();var e=this.shader.uniforms;e.model=a,e.view=b,e.projection=c,e.pixelScale=d,o[0]=this.gl.drawingBufferWidth,o[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=o},n.update=function(a,b,c,d,f){function g(a,b,c,d){var f=l[c];f||(f=l[c]={});var g=f[b];g||(g=f[b]=e(b,{triangles:!0,font:c,textAlign:"center",textBaseline:"middle"}));for(var i=(d||12)/12,j=g.positions,k=g.cells,m=0,n=k.length;n>m;++m)for(var o=k[m],p=2;p>=0;--p){var q=j[o[p]];h.push(i*q[0],-i*q[1],a)}}for(var h=(this.gl,[]),i=[0,0,0],j=[0,0,0],k=[0,0,0],n=[0,0,0],o=0;3>o;++o){k[o]=h.length/m|0,g(.5*(a[0][o]+a[1][o]),b[o],c),n[o]=(h.length/m|0)-k[o],i[o]=h.length/m|0;for(var p=0;p<d[o].length;++p)d[o][p].text&&g(d[o][p].x,d[o][p].text,d[o][p].font||f,d[o][p].fontSize||12);j[o]=(h.length/m|0)-i[o]}this.buffer.update(h),this.tickOffset=i,this.tickCount=j,this.labelOffset=k,this.labelCount=n};var p=[0,0,0];n.drawTicks=function(a,b,c,d,e){var f=p;f[0]=f[1]=f[2]=0,f[a]=1,this.shader.uniforms.axis=f,this.shader.uniforms.color=e,this.shader.uniforms.angle=c,this.shader.uniforms.scale=b,this.shader.uniforms.offset=d,this.vao.draw(this.gl.TRIANGLES,this.tickCount[a],this.tickOffset[a])};var q=[0,0,0];n.drawLabel=function(a,b,c,d,e){this.shader.uniforms.axis=q,this.shader.uniforms.color=e,this.shader.uniforms.angle=c,this.shader.uniforms.scale=b,this.shader.uniforms.offset=d,this.vao.draw(this.gl.TRIANGLES,this.labelCount[a],this.labelOffset[a])},n.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,a("_process"))},{"./shaders":131,_process:55,"gl-buffer":75,"gl-vao":189,"vectorize-text":235}],133:[function(a,b,c){"use strict";function d(a,b){var c=a+"",d=c.indexOf("."),e=0;d>=0&&(e=c.length-d-1);var f=Math.pow(10,e),g=Math.round(a*b*f),h=g+"";if(h.indexOf("e")>=0)return h;var i=g/f,j=g%f;0>g?(i=0|-Math.ceil(i),j=0|-j):(i=0|Math.floor(i),j=0|j);var k=""+i;if(0>g&&(k="-"+k),e){for(var l=""+j;l.length<e;)l="0"+l;return k+"."+l}return k}function e(a,b){for(var c=[],e=0;3>e;++e){for(var f=[],g=(.5*(a[0][e]+a[1][e]),0);g*b[e]<=a[1][e];++g)f.push({x:g*b[e],text:d(b[e],g)});for(var g=-1;g*b[e]>=a[0][e];--g)f.push({x:g*b[e],text:d(b[e],g)});c.push(f)}return c}function f(a,b){for(var c=0;3>c;++c){if(a[c].length!==b[c].length)return!1;for(var d=0;d<a[c].length;++d){var e=a[c][d],f=b[c][d];if(e.x!==f.x||e.text!==f.text)return!1}}return!0}c.create=e,c.equal=f},{}],134:[function(a,b,c){"use strict";function d(a,b,c){var d=b||0,e=c||1;return[[a[12]+a[0],a[13]+a[1],a[14]+a[2],a[15]+a[3]],[a[12]-a[0],a[13]-a[1],a[14]-a[2],a[15]-a[3]],[a[12]+a[4],a[13]+a[5],a[14]+a[6],a[15]+a[7]],[a[12]-a[4],a[13]-a[5],a[14]-a[6],a[15]-a[7]],[d*a[12]+a[8],d*a[13]+a[9],d*a[14]+a[10],d*a[15]+a[11]],[e*a[12]-a[8],e*a[13]-a[9],e*a[14]-a[10],e*a[15]-a[11]]]}b.exports=d},{}],135:[function(a,b,c){"use strict";function d(a,b){var c=j(i(a,b),[b[b.length-1]]);return c[c.length-1]}function e(a,b,c,d){var e=d-b,f=-b/e;0>f?f=0:f>1&&(f=1);for(var g=1-f,h=a.length,i=new Array(h),j=0;h>j;++j)i[j]=f*a[j]+g*c[j];return i}function f(a,b){for(var c=[],f=[],g=d(a[a.length-1],b),h=a[a.length-1],i=a[0],j=0;j<a.length;++j,h=i){i=a[j];var k=d(i,b);if(0>g&&k>0||g>0&&0>k){var l=e(h,k,i,g);c.push(l),f.push(l.slice())}0>k?f.push(i.slice()):k>0?c.push(i.slice()):(c.push(i.slice()),f.push(i.slice())),g=k}return{positive:c,negative:f}}function g(a,b){for(var c=[],f=d(a[a.length-1],b),g=a[a.length-1],h=a[0],i=0;i<a.length;++i,g=h){h=a[i];var j=d(h,b);(0>f&&j>0||f>0&&0>j)&&c.push(e(g,j,h,f)),j>=0&&c.push(h.slice()),f=j}return c}function h(a,b){for(var c=[],f=d(a[a.length-1],b),g=a[a.length-1],h=a[0],i=0;i<a.length;++i,g=h){h=a[i];var j=d(h,b);(0>f&&j>0||f>0&&0>j)&&c.push(e(g,j,h,f)),0>=j&&c.push(h.slice()),f=j}return c}var i=a("robust-dot-product"),j=a("robust-sum");b.exports=f,b.exports.positive=g,b.exports.negative=h},{"robust-dot-product":136,"robust-sum":217}],136:[function(a,b,c){"use strict";function d(a,b){for(var c=e(a[0],b[0]),d=1;d<a.length;++d)c=f(c,e(a[d],b[d]));return c}var e=a("two-product"),f=a("robust-sum");b.exports=d},{"robust-sum":217,"two-product":231}],137:[function(a,b,c){"use strict";function d(a,b,c){this.lo=a,this.hi=b,this.pixelsPerDataUnit=c}function e(a,b,c,d,e){for(var f=0;3>f;++f){for(var g=o,h=p,i=0;3>i;++i)h[i]=g[i]=c[i];h[3]=g[3]=1,h[f]+=1,l(h,h,b),h[3]<0&&(a[f]=1/0),g[f]-=1,l(g,g,b),g[3]<0&&(a[f]=1/0);var j=(g[0]/g[3]-h[0]/h[3])*d,k=(g[1]/g[3]-h[1]/h[3])*e;a[f]=.25*Math.sqrt(j*j+k*k)}return a}function f(a,b,c,d,f){var l=b.model||m,o=b.view||m,p=b.projection||m,s=a.bounds,f=f||i(l,o,p,s),t=f.axis;f.edges;j(n,o,l),j(n,p,n);for(var u=q,v=0;3>v;++v)u[v].lo=1/0,u[v].hi=-(1/0),u[v].pixelsPerDataUnit=1/0;var w=g(k(n,n));k(n,n);for(var x=0;3>x;++x){var y=(x+1)%3,z=(x+2)%3,A=r;a:for(var v=0;2>v;++v){var B=[];if(t[x]<0!=!!v){A[x]=s[v][x];for(var C=0;2>C;++C){A[y]=s[C^v][y];for(var D=0;2>D;++D)A[z]=s[D^C^v][z],B.push(A.slice())}for(var C=0;C<w.length;++C){if(0===B.length)continue a;B=h.positive(B,w[C])}for(var C=0;C<B.length;++C)for(var z=B[C],E=e(r,n,z,c,d),D=0;3>D;++D)u[D].lo=Math.min(u[D].lo,z[D]),u[D].hi=Math.max(u[D].hi,z[D]),D!==x&&(u[D].pixelsPerDataUnit=Math.min(u[D].pixelsPerDataUnit,Math.abs(E[D])))}}}return u}b.exports=f;var g=a("extract-frustum-planes"),h=a("split-polygon"),i=a("./lib/cube.js"),j=a("gl-mat4/multiply"),k=a("gl-mat4/transpose"),l=a("gl-vec4/transformMat4"),m=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n=new Float32Array(16),o=[0,0,0,1],p=[0,0,0,1],q=[new d(1/0,-(1/0),1/0),new d(1/0,-(1/0),1/0),new d(1/0,-(1/0),1/0)],r=[0,0,0]},{"./lib/cube.js":129,"extract-frustum-planes":134,"gl-mat4/multiply":96,"gl-mat4/transpose":104,"gl-vec4/transformMat4":190,"split-polygon":135}],138:[function(a,b,c){"use strict";var d=a("gl-shader"),e="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n",f="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}";b.exports=function(a){return d(a,e,f,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":154}],139:[function(a,b,c){"use strict";function d(a,b,c,d){this.gl=a,this.buffer=b,this.vao=c,this.shader=d,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function e(a,b){function c(a,b,c,d,f,g){var h=[a,b,c,0,0,0,1];h[d+3]=1,h[d]=f,e.push.apply(e,h),h[6]=-1,e.push.apply(e,h),h[d]=g,e.push.apply(e,h),e.push.apply(e,h),h[6]=1,e.push.apply(e,h),h[d]=f,e.push.apply(e,h)}var e=[];c(0,0,0,0,0,1),c(0,0,0,1,0,1),c(0,0,0,2,0,1),c(1,0,0,1,-1,1),c(1,0,0,2,-1,1),c(0,1,0,0,-1,1),c(0,1,0,2,-1,1),c(0,0,1,0,-1,1),c(0,0,1,1,-1,1);var i=f(a,e),j=g(a,[{type:a.FLOAT,buffer:i,size:3,offset:0,stride:28},{type:a.FLOAT,buffer:i,size:3,offset:12,stride:28},{type:a.FLOAT,buffer:i,size:1,offset:24,stride:28}]),k=h(a);k.attributes.position.location=0,k.attributes.color.location=1,k.attributes.weight.location=2;var l=new d(a,i,j,k);return l.update(b),l}var f=a("gl-buffer"),g=a("gl-vao"),h=a("./shaders/index");b.exports=e;var i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],j=d.prototype,k=[0,0,0],l=[0,0,0],m=[0,0];j.isTransparent=function(){return!1},j.drawTransparent=function(a){},j.draw=function(a){var b=this.gl,c=this.vao,d=this.shader;c.bind(),d.bind();var e,f=a.model||i,g=a.view||i,h=a.projection||i;this.axes&&(e=this.axes.lastCubeProps.axis);for(var j=k,n=l,o=0;3>o;++o)e&&e[o]<0?(j[o]=this.bounds[0][o],n[o]=this.bounds[1][o]):(j[o]=this.bounds[1][o],n[o]=this.bounds[0][o]);m[0]=b.drawingBufferWidth,m[1]=b.drawingBufferHeight,d.uniforms.model=f,d.uniforms.view=g,d.uniforms.projection=h,d.uniforms.coordinates=[this.position,j,n],d.uniforms.colors=this.colors,d.uniforms.screenShape=m;for(var o=0;3>o;++o)d.uniforms.lineWidth=this.lineWidth[o]*this.pixelRatio,this.enabled[o]&&(c.draw(b.TRIANGLES,6,6*o),this.drawSides[o]&&c.draw(b.TRIANGLES,12,18+12*o));c.unbind()},j.update=function(a){a&&("bounds"in a&&(this.bounds=a.bounds),"position"in a&&(this.position=a.position),"lineWidth"in a&&(this.lineWidth=a.lineWidth),"colors"in a&&(this.colors=a.colors),"enabled"in a&&(this.enabled=a.enabled),"drawSides"in a&&(this.drawSides=a.drawSides))},j.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":138,"gl-buffer":75,"gl-vao":189}],140:[function(a,b,c){"use strict";function d(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function e(a,b){var c=null;try{c=a.getContext("webgl",b),c||(c=a.getContext("experimental-webgl",b))}catch(d){return null}return c}function f(a){var b=Math.round(Math.log(Math.abs(a))/Math.log(10));if(0>b){var c=Math.round(Math.pow(10,-b));return Math.ceil(a*c)/c}if(b>0){var c=Math.round(Math.pow(10,b));return Math.ceil(a/c)*c}return Math.ceil(a)}function g(a){return"boolean"==typeof a?a:!0}function h(a){function b(){if(!v&&S.autoResize){var a=w.parentNode,b=1,c=1;a&&a!==document.body?(b=a.clientWidth,c=a.clientHeight):(b=window.innerWidth,c=window.innerHeight);var d=0|Math.ceil(b*S.pixelRatio),e=0|Math.ceil(c*S.pixelRatio);if(d!==w.width||e!==w.height){w.width=d,w.height=e;var f=w.style;f.position=f.position||"absolute",f.left="0px",f.top="0px",f.width=b+"px",f.height=c+"px",M=!0}}}function c(){for(var a=I.length,b=L.length,c=0;b>c;++c)K[c]=0;a:for(var c=0;a>c;++c){var d=I[c],e=d.pickSlots;if(e){for(var f=0;b>f;++f)if(K[f]+e<255){J[c]=f,d.setPickBase(K[f]+1),K[f]+=e;continue a}var g=m(y,R);J[c]=b,L.push(g),K.push(e),d.setPickBase(1),b+=1}else J[c]=-1}for(;b>0&&0===K[b-1];)K.pop(),L.pop().dispose()}function h(){return S.contextLost?!0:void(y.isContextLost()&&(S.contextLost=!0,S.mouseListener.enabled=!1,S.selection.object=null,S.oncontextloss&&S.oncontextloss()))}function s(){if(!h()){y.colorMask(!0,!0,!0,!0),y.depthMask(!0),y.disable(y.BLEND),y.enable(y.DEPTH_TEST);for(var a=I.length,b=L.length,c=0;b>c;++c){var d=L[c];d.shape=T,d.begin();for(var e=0;a>e;++e)if(J[e]===c){var f=I[e];f.drawPick&&(f.pixelRatio=1,f.drawPick(Q))}d.end()}}}function t(){if(!h()){b();var a=S.camera.tick();Q.view=S.camera.matrix,M=M||a,N=N||a,F.pixelRatio=S.pixelRatio,H.pixelRatio=S.pixelRatio;var c=I.length,d=W[0],e=W[1];d[0]=d[1]=d[2]=1/0,e[0]=e[1]=e[2]=-(1/0);for(var g=0;c>g;++g){var i=I[g];i.pixelRatio=S.pixelRatio,i.axes=S.axes,M=M||!!i.dirty,N=N||!!i.dirty;var j=i.bounds;if(j)for(var l=j[0],m=j[1],n=0;3>n;++n)d[n]=Math.min(d[n],l[n]),e[n]=Math.max(e[n],m[n])}var p=S.bounds;if(S.autoBounds)for(var n=0;3>n;++n){if(e[n]<d[n])d[n]=-1,e[n]=1;else{d[n]===e[n]&&(d[n]-=1,e[n]+=1);var r=.05*(e[n]-d[n]);d[n]=d[n]-r,e[n]=e[n]+r}p[0][n]=d[n],p[1][n]=e[n]}for(var t=!1,n=0;3>n;++n)t=t||X[0][n]!==p[0][n]||X[1][n]!==p[1][n],X[0][n]=p[0][n],X[1][n]=p[1][n];if(t){for(var u=[0,0,0],g=0;3>g;++g)u[g]=f((p[1][g]-p[0][g])/10);F.autoTicks?F.update({bounds:p,tickSpacing:u}):F.update({bounds:p})}N=N||t,M=M||t;var v=y.drawingBufferWidth,w=y.drawingBufferHeight;R[0]=v,R[1]=w,T[0]=0|Math.max(v/S.pixelRatio,1),T[1]=0|Math.max(w/S.pixelRatio,1),q(O,S.fovy,v/w,S.zNear,S.zFar);for(var g=0;16>g;++g)P[g]=0;P[15]=1;for(var x=0,g=0;3>g;++g)x=Math.max(x,p[1][g]-p[0][g]);for(var g=0;3>g;++g)S.autoScale?P[5*g]=S.aspect[g]/(p[1][g]-p[0][g]):P[5*g]=1/x,S.autoCenter&&(P[12+g]=.5*-P[5*g]*(p[0][g]+p[1][g]));for(var g=0;c>g;++g){var i=I[g];i.axesBounds=p,S.clipToBounds&&(i.clipBounds=p)}if(A.object&&(S.snapToData?H.position=A.dataCoordinate:H.position=A.dataPosition,H.bounds=p),N&&(N=!1,s()),M){S.axesPixels=k(S.axes,Q,v,w),S.onrender&&S.onrender(),y.bindFramebuffer(y.FRAMEBUFFER,null),y.viewport(0,0,v,w);var z=S.clearColor;y.clearColor(z[0],z[1],z[2],z[3]),y.clear(y.COLOR_BUFFER_BIT|y.DEPTH_BUFFER_BIT),y.depthMask(!0),y.colorMask(!0,!0,!0,!0),y.enable(y.DEPTH_TEST),y.depthFunc(y.LEQUAL),y.disable(y.BLEND),y.disable(y.CULL_FACE);var D=!1;F.enable&&(D=D||F.isTransparent(),F.draw(Q)),H.axes=F,A.object&&H.draw(Q),y.disable(y.CULL_FACE);for(var g=0;c>g;++g){var i=I[g];i.axes=F,i.pixelRatio=S.pixelRatio,i.isOpaque&&i.isOpaque()&&i.draw(Q),i.isTransparent&&i.isTransparent()&&(D=!0)}if(D){B.shape=R,B.bind(),y.clear(y.DEPTH_BUFFER_BIT),y.colorMask(!1,!1,!1,!1),y.depthMask(!0),y.depthFunc(y.LESS),F.enable&&F.isTransparent()&&F.drawTransparent(Q);for(var g=0;c>g;++g){var i=I[g];i.isOpaque&&i.isOpaque()&&i.draw(Q)}y.enable(y.BLEND),y.blendEquation(y.FUNC_ADD),y.blendFunc(y.ONE,y.ONE_MINUS_SRC_ALPHA),y.colorMask(!0,!0,!0,!0),y.depthMask(!1),y.clearColor(0,0,0,0),y.clear(y.COLOR_BUFFER_BIT),F.isTransparent()&&F.drawTransparent(Q);for(var g=0;c>g;++g){var i=I[g];i.isTransparent&&i.isTransparent()&&i.drawTransparent(Q)}y.bindFramebuffer(y.FRAMEBUFFER,null),y.blendFunc(y.ONE,y.ONE_MINUS_SRC_ALPHA),y.disable(y.DEPTH_TEST),C.bind(),B.color[0].bind(0),C.uniforms.accumBuffer=0,o(y),y.disable(y.BLEND)}M=!1;for(var g=0;c>g;++g)I[g].dirty=!1}}}function u(){v||S.contextLost||(requestAnimationFrame(u),t())}a=a||{};var v=!1,w=(a.pixelRatio||parseFloat(window.devicePixelRatio),a.canvas);if(!w)if(w=document.createElement("canvas"),a.container){var x=a.container;x.appendChild(w)}else document.body.appendChild(w);var y=a.gl;if(y||(y=e(w,a.glOptions||{premultipliedAlpha:!0,antialias:!0})),!y)throw new Error("webgl not supported");var z=a.bounds||[[-10,-10,-10],[10,10,10]],A=new d,B=n(y,[y.drawingBufferWidth,y.drawingBufferHeight],{preferFloat:!0}),C=r(y),D=a.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},E=a.axes||{},F=j(y,E);F.enable=!E.disable;var G=a.spikes||{},H=l(y,G),I=[],J=[],K=[],L=[],M=!0,N=!0,O=new Array(16),P=new Array(16),Q={view:null,projection:O,model:P},N=!0,R=[y.drawingBufferWidth,y.drawingBufferHeight],S={gl:y,contextLost:!1,pixelRatio:a.pixelRatio||parseFloat(window.devicePixelRatio),canvas:w,selection:A,camera:i(w,D),axes:F,axesPixels:null,spikes:H,bounds:z,objects:I,shape:R,aspect:a.aspectRatio||[1,1,1],pickRadius:a.pickRadius||10,zNear:a.zNear||.01,zFar:a.zFar||1e3,fovy:a.fovy||Math.PI/4,clearColor:a.clearColor||[0,0,0,0],autoResize:g(a.autoResize),autoBounds:g(a.autoBounds),autoScale:!!a.autoScale,autoCenter:g(a.autoCenter),clipToBounds:g(a.clipToBounds),snapToData:!!a.snapToData,onselect:a.onselect||null,onrender:a.onrender||null,onclick:a.onclick||null,cameraParams:Q,oncontextloss:null,mouseListener:null},T=[y.drawingBufferWidth/S.pixelRatio|0,y.drawingBufferHeight/S.pixelRatio|0];S.autoResize&&b(),window.addEventListener("resize",b),S.update=function(a){v||(a=a||{},M=!0,N=!0)},S.add=function(a){v||(a.axes=F,I.push(a),J.push(-1),M=!0,N=!0,c())},S.remove=function(a){if(!v){var b=I.indexOf(a);0>b||(I.splice(b,1),J.pop(),M=!0,N=!0,c())}},S.dispose=function(){if(!v&&(v=!0,window.removeEventListener("resize",b),w.removeEventListener("webglcontextlost",h),S.mouseListener.enabled=!1,!S.contextLost)){F.dispose(),H.dispose();for(var a=0;a<I.length;++a)I[a].dispose();B.dispose();for(var a=0;a<L.length;++a)L[a].dispose();C.dispose(),y=null,F=null,H=null,I=[]}};var U=!1,V=0;S.mouseListener=p(w,function(a,b,c){if(!v){var d=L.length,e=I.length,f=A.object;A.distance=1/0,A.mouse[0]=b,A.mouse[1]=c,A.object=null,A.screen=null,A.dataCoordinate=A.dataPosition=null;var g=!1;if(a&&V)U=!0;else{U&&(N=!0),U=!1;for(var h=0;d>h;++h){var i=L[h].query(b,T[1]-c-1,S.pickRadius);if(i){if(i.distance>A.distance)continue;for(var j=0;e>j;++j){var k=I[j];if(J[j]===h){var l=k.pick(i);l&&(A.buttons=a,A.screen=i.coord,A.distance=i.distance,A.object=k,A.index=l.distance,A.dataPosition=l.position,A.dataCoordinate=l.dataCoordinate,A.data=l,g=!0)}}}}}f&&f!==A.object&&(f.highlight&&f.highlight(null),M=!0),A.object&&(A.object.highlight&&A.object.highlight(A.data),M=!0),g=g||A.object!==f,g&&S.onselect&&S.onselect(A),1&a&&!(1&V)&&S.onclick&&S.onclick(A),V=a}}),w.addEventListener("webglcontextlost",h);var W=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],X=[W[0].slice(),W[1].slice()];return u(),S.redraw=function(){v||(M=!0,t())},S}b.exports=h;var i=a("3d-view-controls"),j=a("gl-axes3d"),k=a("gl-axes3d/properties"),l=a("gl-spikes3d"),m=a("gl-select-static"),n=a("gl-fbo"),o=a("a-big-triangle"),p=a("mouse-change"),q=a("gl-mat4/perspective"),r=a("./lib/shader")},{"./lib/shader":123,"3d-view-controls":124,"a-big-triangle":126,"gl-axes3d":127,"gl-axes3d/properties":137,"gl-fbo":80,"gl-mat4/perspective":97,"gl-select-static":153,"gl-spikes3d":139,"mouse-change":196}],141:[function(a,b,c){"use strict";b.exports={vertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 color;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n fragColor = color;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",fragment:"#define GLSLIFY 1\nprecision lowp float;\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",pickVertex:"#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec2 offset;\nattribute vec4 id;\n\nuniform mat3 viewTransform;\nuniform vec2 pixelScale;\nuniform vec4 pickOffset;\n\nvarying vec4 fragColor;\n\nvec4 computePosition_1_0(vec2 position, vec2 offset, mat3 view, vec2 scale) {\n vec3 xposition = view * vec3(position, 1.0);\n return vec4(\n xposition.xy + scale * offset * xposition.z,\n 0,\n xposition.z);\n}\n\n\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_Position = computePosition_1_0(\n position,\n offset,\n viewTransform,\n pixelScale);\n}\n",pickFragment:"#define GLSLIFY 1\nprecision lowp float;\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],142:[function(a,b,c){"use strict";function d(a){if(a in m)return m[a];var b=k(a,{polygons:!0,font:"sans-serif",textAlign:"left",textBaseline:"alphabetic"}),c=[],d=[];b.forEach(function(a){a.forEach(function(a){for(var b=0;b<a.length;++b){var e=a[(b+a.length-1)%a.length],f=a[b],g=a[(b+1)%a.length],h=a[(b+2)%a.length],i=f[0]-e[0],j=f[1]-e[1],k=Math.sqrt(i*i+j*j);i/=k,j/=k,c.push(e[0],e[1]+1.4),d.push(j,-i),c.push(e[0],e[1]+1.4),d.push(-j,i),c.push(f[0],f[1]+1.4),d.push(-j,i),c.push(f[0],f[1]+1.4),d.push(-j,i),c.push(e[0],e[1]+1.4),d.push(j,-i),c.push(f[0],f[1]+1.4),d.push(j,-i);var l=h[0]-g[0],m=h[1]-g[1],n=Math.sqrt(l*l+m*m);l/=n,m/=n,c.push(f[0],f[1]+1.4),d.push(j,-i),c.push(f[0],f[1]+1.4),d.push(-j,i),c.push(g[0],g[1]+1.4),d.push(-m,l),c.push(g[0],g[1]+1.4),d.push(-m,l),c.push(f[0],f[1]+1.4),d.push(m,-l),c.push(g[0],g[1]+1.4),d.push(m,-l)}})});for(var e=[1/0,1/0,-(1/0),-(1/0)],f=0;f<c.length;f+=2)for(var g=0;2>g;++g)e[g]=Math.min(e[g],c[f+g]),e[2+g]=Math.max(e[2+g],c[f+g]);return m[a]={coords:c,normals:d,bounds:e}}function e(a,b,c,d,e,f,g){this.plot=a,this.shader=b,this.pickShader=c,this.positionBuffer=d,this.offsetBuffer=e,this.colorBuffer=f,this.idBuffer=g,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.numVertices=0,this.pickOffset=0,this.points=null}function f(a,b){var c=a.gl,d=g(c,l.vertex,l.fragment),f=g(c,l.pickVertex,l.pickFragment),i=h(c),j=h(c),k=h(c),m=h(c),n=new e(a,d,f,i,j,k,m);return n.update(b),a.addObject(n),n}b.exports=f;var g=a("gl-shader"),h=a("gl-buffer"),i=a("text-cache"),j=a("typedarray-pool"),k=a("vectorize-text"),l=a("./lib/shaders"),m={},n=e.prototype;!function(){function a(){var a=this.plot,d=this.bounds,e=a.viewBox,f=a.dataBox,g=a.pixelRatio,h=d[2]-d[0],i=d[3]-d[1],j=f[2]-f[0],k=f[3]-f[1];b[0]=2*h/j,b[4]=2*i/k,b[6]=2*(d[0]-f[0])/j-1,b[7]=2*(d[1]-f[1])/k-1;var l=e[2]-e[0],m=e[3]-e[1];c[0]=2*g/l,c[1]=2*g/m}var b=[1,0,0,0,1,0,0,0,1],c=[1,1];n.draw=function(){var d=this.plot,e=this.shader,f=this.numVertices,g=d.gl;a.call(this),e.bind(),e.uniforms.pixelScale=c,e.uniforms.viewTransform=b,this.positionBuffer.bind(),e.attributes.position.pointer(),this.offsetBuffer.bind(),e.attributes.offset.pointer(),this.colorBuffer.bind(),e.attributes.color.pointer(g.UNSIGNED_BYTE,!0),g.drawArrays(g.TRIANGLES,0,f)};var d=[0,0,0,0];n.drawPick=function(e){var f=this.plot,g=this.pickShader,h=this.numVertices,i=f.gl;this.pickOffset=e;for(var j=0;4>j;++j)d[j]=e>>8*j&255;return a.call(this),g.bind(),g.uniforms.pixelScale=c,g.uniforms.viewTransform=b,g.uniforms.pickOffset=d,this.positionBuffer.bind(),g.attributes.position.pointer(),this.offsetBuffer.bind(),g.attributes.offset.pointer(),this.idBuffer.bind(),g.attributes.id.pointer(i.UNSIGNED_BYTE,!1),i.drawArrays(i.TRIANGLES,0,h),e+this.numPoints}}(),n.pick=function(a,b,c){var d=this.pickOffset,e=this.numPoints;if(d>c||c>=d+e)return null;var f=c-d,g=this.points;return{object:this,pointId:f,dataCoord:[g[2*f],g[2*f+1]]}},n.update=function(a){a=a||{};var b=a.positions||[],c=a.colors||[],e=a.glyphs||[],f=a.sizes||[],g=a.borderWidths||[],h=a.borderColors||[];this.points=b;for(var k=this.bounds=[1/0,1/0,-(1/0),-(1/0)],l=0,m=0;m<e.length;++m){l+=i("sans-serif",e[m]).data.length+d(e[m]).coords.length>>1;for(var n=0;2>n;++n)k[n]=Math.min(k[n],b[2*m+n]),k[2+n]=Math.max(k[2+n],b[2*m+n])}k[0]===k[2]&&(k[2]+=1),k[3]===k[1]&&(k[3]+=1);for(var o=1/(k[2]-k[0]),p=1/(k[3]-k[1]),q=k[0],r=k[1],s=j.mallocFloat32(2*l),t=j.mallocFloat32(2*l),u=j.mallocUint8(4*l),v=j.mallocUint32(l),w=0,m=0;m<e.length;++m){for(var x=i("sans-serif",e[m]),y=d(e[m]),z=o*(b[2*m]-q),A=p*(b[2*m+1]-r),B=f[m],C=255*c[4*m],D=255*c[4*m+1],E=255*c[4*m+2],F=255*c[4*m+3],G=.5*(y.bounds[0]+y.bounds[2]),H=.5*(y.bounds[1]+y.bounds[3]),n=0;n<x.data.length;n+=2)s[2*w]=z,s[2*w+1]=A,t[2*w]=-B*(x.data[n]-G),t[2*w+1]=-B*(x.data[n+1]-H),u[4*w]=C,u[4*w+1]=D,u[4*w+2]=E,u[4*w+3]=F,v[w]=m,w+=1;var I=g[m];C=255*h[4*m],D=255*h[4*m+1],E=255*h[4*m+2],F=255*h[4*m+3];for(var n=0;n<y.coords.length;n+=2)s[2*w]=z,s[2*w+1]=A,t[2*w]=-(B*(y.coords[n]-G)+I*y.normals[n]),t[2*w+1]=-(B*(y.coords[n+1]-H)+I*y.normals[n+1]),u[4*w]=C,u[4*w+1]=D,u[4*w+2]=E,u[4*w+3]=F,v[w]=m,w+=1}this.numPoints=e.length,this.numVertices=l,this.positionBuffer.update(s),this.offsetBuffer.update(t),this.colorBuffer.update(u),this.idBuffer.update(v),j.free(s),j.free(t),j.free(u),j.free(v)},n.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.offsetBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":141,"gl-buffer":75,"gl-shader":154,"text-cache":228,"typedarray-pool":233,"vectorize-text":235}],143:[function(a,b,c){c.pointVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute float weight;\n\nuniform mat3 matrix;\nuniform float pointSize, useWeight;\n\nvarying float fragWeight;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n fragWeight = mix(1.0, weight, useWeight);\n}\n",c.pointFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\n\nvarying float fragWeight;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float radius = length(2.0*gl_PointCoord.xy-1.0);\n if(radius > 1.0) {\n discard;\n }\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n",c.pickVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n",c.pickFragment="#define GLSLIFY 1\nprecision mediump float;\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0*gl_PointCoord.xy-1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"},{}],144:[function(a,b,c){arguments[4][121][0].apply(c,arguments)},{dup:121}],145:[function(a,b,c){"use strict";function d(a,b,c,d,f){4*m>=f?e(0,f-1,a,b,c,d):l(0,f-1,a,b,c,d)}function e(a,b,c,d,e,f){for(var g=a+1;b>=g;++g){for(var h=c[g],i=d[2*g],j=d[2*g+1],k=e[g],l=f[g],m=g;m>a;){var n=c[m-1],o=d[2*(m-1)];if((n-h||i-o)>=0)break;c[m]=n,d[2*m]=o,d[2*m+1]=d[2*m-1],e[m]=e[m-1],f[m]=f[m-1],m-=1}c[m]=h,d[2*m]=i,d[2*m+1]=j,e[m]=k,f[m]=l}}function f(a,b,c,d,e,f){var g=c[a],h=d[2*a],i=d[2*a+1],j=e[a],k=f[a];c[a]=c[b],d[2*a]=d[2*b],d[2*a+1]=d[2*b+1],e[a]=e[b],f[a]=f[b],c[b]=g,d[2*b]=h,d[2*b+1]=i,e[b]=j,f[b]=k}function g(a,b,c,d,e,f){c[a]=c[b],d[2*a]=d[2*b],d[2*a+1]=d[2*b+1],e[a]=e[b],f[a]=f[b]}function h(a,b,c,d,e,f,g){var h=d[a],i=e[2*a],j=e[2*a+1],k=f[a],l=g[a];d[a]=d[b],e[2*a]=e[2*b],e[2*a+1]=e[2*b+1],f[a]=f[b],g[a]=g[b],d[b]=d[c],e[2*b]=e[2*c],e[2*b+1]=e[2*c+1],f[b]=f[c],g[b]=g[c],d[c]=h,e[2*c]=i,e[2*c+1]=j,f[c]=k,g[c]=l}function i(a,b,c,d,e,f,g,h,i,j,k){h[a]=h[b],i[2*a]=i[2*b],i[2*a+1]=i[2*b+1],j[a]=j[b],k[a]=k[b],h[b]=c,i[2*b]=d,i[2*b+1]=e,j[b]=f,k[b]=g}function j(a,b,c,d,e){return(c[a]-c[b]||d[2*b]-d[2*a]||e[a]-e[b])<0}function k(a,b,c,d,e,f,g,h){return(b-f[a]||g[2*a]-c||e-h[a])<0; 36 }function l(a,b,c,d,n,o){var p=(b-a+1)/6|0,q=a+p,r=b-p,s=a+b>>1,t=s-p,u=s+p,v=q,w=t,x=s,y=u,z=r,A=a+1,B=b-1,C=0;j(v,w,c,d,n,o)&&(C=v,v=w,w=C),j(y,z,c,d,n,o)&&(C=y,y=z,z=C),j(v,x,c,d,n,o)&&(C=v,v=x,x=C),j(w,x,c,d,n,o)&&(C=w,w=x,x=C),j(v,y,c,d,n,o)&&(C=v,v=y,y=C),j(x,y,c,d,n,o)&&(C=x,x=y,y=C),j(w,z,c,d,n,o)&&(C=w,w=z,z=C),j(w,x,c,d,n,o)&&(C=w,w=x,x=C),j(y,z,c,d,n,o)&&(C=y,y=z,z=C);var D=c[w],E=d[2*w],F=d[2*w+1],G=n[w],H=o[w],I=c[y],J=d[2*y],K=d[2*y+1],L=n[y],M=o[y],N=v,O=x,P=z,Q=q,R=s,S=r,T=c[N],U=c[O],V=c[P];c[Q]=T,c[R]=U,c[S]=V;for(var W=0;2>W;++W){var X=d[2*N+W],Y=d[2*O+W],Z=d[2*P+W];d[2*Q+W]=X,d[2*R+W]=Y,d[2*S+W]=Z}var $=n[N],_=n[O],aa=n[P];n[Q]=$,n[R]=_,n[S]=aa;var ba=o[N],ca=o[O],da=o[P];o[Q]=ba,o[R]=ca,o[S]=da,g(t,a,c,d,n,o),g(u,b,c,d,n,o);for(var ea=A;B>=ea;++ea)if(k(ea,D,E,F,G,c,d,n))ea!==A&&f(ea,A,c,d,n,o),++A;else if(!k(ea,I,J,K,L,c,d,n))for(;;){if(k(B,I,J,K,L,c,d,n)){k(B,D,E,F,G,c,d,n)?(h(ea,A,B,c,d,n,o),++A,--B):(f(ea,B,c,d,n,o),--B);break}if(--B<ea)break}i(a,A-1,D,E,F,G,H,c,d,n,o),i(b,B+1,I,J,K,L,M,c,d,n,o),m>=A-2-a?e(a,A-2,c,d,n,o):l(a,A-2,c,d,n,o),m>=b-(B+2)?e(B+2,b,c,d,n,o):l(B+2,b,c,d,n,o),m>=B-A?e(A,B,c,d,n,o):l(A,B,c,d,n,o)}b.exports=d;var m=32},{}],146:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g,h){for(var i=c,j=c;d>j;++j){var k=a[2*j],l=a[2*j+1],m=b[j];k>=e&&g>=k&&l>=f&&h>=l&&(j===i?i+=1:(a[2*j]=a[2*i],a[2*j+1]=a[2*i+1],b[j]=b[i],a[2*i]=k,a[2*i+1]=l,b[i]=m,i+=1))}return i}function e(a,b,c){this.pixelSize=a,this.offset=b,this.count=c}function f(a,b,c,f){function i(e,f,g,h,j,k){var l=.5*g,m=h+1,n=j-h;c[v]=n,u[v++]=k;for(var o=0;2>o;++o)for(var p=0;2>p;++p){var q=e+o*l,r=f+p*l,s=d(a,b,m,j,q,r,q+l,r+l);if(s!==m){if(s-m>=Math.max(.9*n,32)){var t=j+h>>>1;i(q,r,l,m,t,k+1),m=t}i(q,r,l,m,s,k+1),m=s}}}var j=a.length>>>1;if(1>j)return[];for(var k=1/0,l=1/0,m=-(1/0),n=-(1/0),o=0;j>o;++o){var p=a[2*o],q=a[2*o+1];k=Math.min(k,p),m=Math.max(m,p),l=Math.min(l,q),n=Math.max(n,q),b[o]=o}k===m&&(m+=1+Math.abs(m)),l===n&&(n+=1+Math.abs(m));var r=1/(m-k),s=1/(n-l),t=Math.max(m-k,n-l);f=f||[0,0,0,0],f[0]=k,f[1]=l,f[2]=m,f[3]=n;var u=g.mallocInt32(j),v=0;i(k,l,t,0,j,0),h(u,a,b,c,j);for(var w=[],x=0,y=j,v=j-1;v>=0;--v){a[2*v]=(a[2*v]-k)*r,a[2*v+1]=(a[2*v+1]-l)*s;var z=u[v];z!==x&&(w.push(new e(t*Math.pow(.5,z),v+1,y-(v+1))),y=v+1,x=z)}return w.push(new e(t*Math.pow(.5,z+1),0,y)),g.free(u),w}var g=a("typedarray-pool"),h=a("./lib/sort");b.exports=f},{"./lib/sort":145,"typedarray-pool":233}],147:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this.plot=a,this.offsetBuffer=b,this.pickBuffer=c,this.weightBuffer=d,this.shader=e,this.pickShader=f,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.pickOffset=0,this.points=null,this.xCoords=null}function e(a,b){var c=a.gl,e=g(c),h=g(c),i=g(c),j=f(c,k.pointVertex,k.pointFragment),l=f(c,k.pickVertex,k.pickFragment),m=new d(a,e,h,i,j,l);return m.update(b),a.addObject(m),m}var f=a("gl-shader"),g=a("gl-buffer"),h=a("binary-search-bounds"),i=a("snap-points-2d"),j=a("typedarray-pool"),k=a("./lib/shader");b.exports=e;var l=d.prototype;l.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.xCoords&&j.free(this.xCoords),this.plot.removeObject(this)},l.update=function(a){function b(b,c){return b in a?a[b]:c}a=a||{},this.size=b("size",12),this.color=b("color",[1,0,0,1]).slice(),this.borderSize=b("borderSize",1),this.borderColor=b("borderColor",[0,0,0,1]).slice(),this.xCoords&&j.free(this.xCoords);var c=a.positions,d=j.mallocFloat32(c.length),e=j.mallocInt32(c.length>>>1);d.set(c);var f=j.mallocFloat32(c.length);this.points=c,this.scales=i(d,e,f,this.bounds),this.offsetBuffer.update(d),this.pickBuffer.update(e),this.weightBuffer.update(f);for(var g=j.mallocFloat32(c.length>>>1),h=0,k=0;h<c.length;h+=2,++k)g[k]=d[h];j.free(e),j.free(d),j.free(f),this.xCoords=g,this.pointCount=c.length>>>1,this.pickOffset=0},l.drawPick=function(){var a=[1,0,0,0,1,0,0,0,1],b=[0,0,0,0];return function(c){var d=this.plot,e=this.pickShader,f=this.scales,g=this.offsetBuffer,i=this.pickBuffer,j=this.bounds,k=this.size,l=this.borderSize,m=d.gl,n=d.pickPixelRatio,o=d.viewBox,p=d.dataBox;if(0===this.pointCount)return c;var q=j[2]-j[0],r=j[3]-j[1],s=p[2]-p[0],t=p[3]-p[1],u=(o[2]-o[0])*n/d.pixelRatio,v=(o[3]-o[1])*n/d.pixelRatio,w=Math.min(s/u,t/v);a[0]=2*q/s,a[4]=2*r/t,a[6]=2*(j[0]-p[0])/s-1,a[7]=2*(j[1]-p[1])/t-1,this.pickOffset=c,b[0]=255&c,b[1]=c>>8&255,b[2]=c>>16&255,b[3]=c>>24&255,e.bind(),e.uniforms.matrix=a,e.uniforms.color=this.color,e.uniforms.borderColor=this.borderColor,e.uniforms.pointSize=n*(k+l),e.uniforms.pickOffset=b,0===this.borderSize?e.uniforms.centerFraction=2:e.uniforms.centerFraction=k/(k+l+1.25),g.bind(),e.attributes.position.pointer(),i.bind(),e.attributes.pickId.pointer(m.UNSIGNED_BYTE);for(var x=this.xCoords,y=(p[0]-j[0]-w*k*n)/q,z=(p[2]-j[0]+w*k*n)/q,A=f.length-1;A>=0;--A){var B=f[A];if(!(B.pixelSize<w&&A>1)){var C=B.offset,D=B.count+C,E=h.ge(x,y,C,D-1),F=h.lt(x,z,E,D-1)+1;m.drawArrays(m.POINTS,E,F-E)}}return c+this.pointCount}}(),l.draw=function(){var a=[1,0,0,0,1,0,0,0,1];return function(){var b=this.plot,c=this.shader,d=this.scales,e=this.offsetBuffer,f=this.bounds,g=this.size,i=this.borderSize,j=b.gl,k=b.pixelRatio,l=b.viewBox,m=b.dataBox;if(0!==this.pointCount){var n=f[2]-f[0],o=f[3]-f[1],p=m[2]-m[0],q=m[3]-m[1],r=l[2]-l[0],s=l[3]-l[1],t=Math.min(p/r,q/s);a[0]=2*n/p,a[4]=2*o/q,a[6]=2*(f[0]-m[0])/p-1,a[7]=2*(f[1]-m[1])/q-1,c.bind(),c.uniforms.matrix=a,c.uniforms.color=this.color,c.uniforms.borderColor=this.borderColor,c.uniforms.pointSize=k*(g+i),c.uniforms.useWeight=1,0===this.borderSize?c.uniforms.centerFraction=2:c.uniforms.centerFraction=g/(g+i+1.25),e.bind(),c.attributes.position.pointer(),this.weightBuffer.bind(),c.attributes.weight.pointer();for(var u=this.xCoords,v=(m[0]-f[0]-t*g*k)/n,w=(m[2]-f[0]+t*g*k)/n,x=!0,y=d.length-1;y>=0;--y){var z=d[y];if(!(z.pixelSize<t&&y>1)){var A=z.offset,B=z.count+A,C=h.ge(u,v,A,B-1),D=h.lt(u,w,C,B-1)+1;j.drawArrays(j.POINTS,C,D-C),x&&(x=!1,c.uniforms.useWeight=0)}}}}}(),l.pick=function(a,b,c){var d=this.pickOffset,e=this.pointCount;if(d>c||c>=d+e)return null;var f=c-d,g=this.points;return{object:this,pointId:f,dataCoord:[g[2*f],g[2*f+1]]}}},{"./lib/shader":143,"binary-search-bounds":144,"gl-buffer":75,"gl-shader":154,"snap-points-2d":146,"typedarray-pool":233}],148:[function(a,b,c){"use strict";function d(a,b){var c=f[b];if(c||(c=f[b]={}),a in c)return c[a];for(var d=e(a,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:b}),g=e(a,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:b}),h=[[1/0,1/0],[-(1/0),-(1/0)]],i=0;i<d.positions.length;++i)for(var j=d.positions[i],k=0;2>k;++k)h[0][k]=Math.min(h[0][k],j[k]),h[1][k]=Math.max(h[1][k],j[k]);return c[a]=[g,d,h]}var e=a("vectorize-text");b.exports=d;var f={}},{"vectorize-text":235}],149:[function(a,b,c){function d(a,b){var c=e(a,b),d=c.attributes;return d.position.location=0,d.color.location=1,d.glyph.location=2,d.id.location=3,c}var e=a("gl-shader"),f="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n \n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",g="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n \n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",h="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) ||\n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n",i="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = interpColor * opacity;\n }\n}\n",j="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n }\n}",k=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],l={vertex:f,fragment:i,attributes:k},m={vertex:g,fragment:i,attributes:k},n={vertex:h,fragment:i,attributes:k},o={vertex:f,fragment:j,attributes:k},p={vertex:g,fragment:j,attributes:k},q={vertex:h,fragment:j,attributes:k};c.createPerspective=function(a){return d(a,l)},c.createOrtho=function(a){return d(a,m)},c.createProject=function(a){return d(a,n)},c.createPickPerspective=function(a){return d(a,o)},c.createPickOrtho=function(a){return d(a,p)},c.createPickProject=function(a){return d(a,q)}},{"gl-shader":154}],150:[function(a,b,c){"use strict";function d(a,b){var c=a[0],d=a[1],e=a[2],f=a[3];return a[0]=b[0]*c+b[4]*d+b[8]*e+b[12]*f,a[1]=b[1]*c+b[5]*d+b[9]*e+b[13]*f,a[2]=b[2]*c+b[6]*d+b[10]*e+b[14]*f,a[3]=b[3]*c+b[7]*d+b[11]*e+b[15]*f,a}function e(a,b,c,e){return d(e,e,c),d(e,e,b),d(e,e,a)}function f(a,b){this.index=a,this.dataCoordinate=this.position=b}function g(a,b,c,d,e,g,h,i,j,k,l,m){this.gl=a,this.pixelRatio=1,this.shader=b,this.orthoShader=c,this.projectShader=d,this.pointBuffer=e,this.colorBuffer=g,this.glyphBuffer=h,this.idBuffer=i,this.vao=j,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=k,this.pickOrthoShader=l,this.pickProjectShader=m,this.points=[],this._selectResult=new f(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.dirty=!0}function h(a){return a[0]=a[1]=a[2]=0,a}function i(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=1,a}function j(a,b,c,d){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[c]=d,a}function k(a){for(var b=D,c=0;2>c;++c)for(var d=0;3>d;++d)b[c][d]=Math.max(Math.min(a[c][d],1e8),-1e8);return b}function l(a,b,c,d,f){var g,l=b.axesProject,m=b.gl,n=a.uniforms,o=c.model||u,p=c.view||u,q=c.projection||u,s=b.axesBounds,t=k(b.clipBounds);g=b.axes?b.axes.lastCubeProps.axis:[1,1,1],w[0]=2/m.drawingBufferWidth,w[1]=2/m.drawingBufferHeight,a.bind(),n.view=p,n.projection=q,n.screenSize=w,n.highlightId=b.highlightId,n.highlightScale=b.highlightScale,n.clipBounds=t,n.pickGroup=b.pickId/255,n.pixelRatio=b.pixelRatio;for(var v=0;3>v;++v)if(l[v]&&b.projectOpacity[v]<1===d){n.scale=b.projectScale[v],n.opacity=b.projectOpacity[v];for(var D=B,E=0;16>E;++E)D[E]=0;for(var E=0;4>E;++E)D[5*E]=1;D[5*v]=0,g[v]<0?D[12+v]=s[0][v]:D[12+v]=s[1][v],r(D,o,D),n.model=D;var F=(v+1)%3,G=(v+2)%3,H=h(x),I=h(y);H[F]=1,I[G]=1;var J=e(q,p,o,i(z,H)),K=e(q,p,o,i(A,I));if(Math.abs(J[1])>Math.abs(K[1])){var L=J;J=K,K=L,L=H,H=I,I=L;var M=F;F=G,G=M}J[0]<0&&(H[F]=-1),K[1]>0&&(I[G]=-1);for(var N=0,O=0,E=0;4>E;++E)N+=Math.pow(o[4*F+E],2),O+=Math.pow(o[4*G+E],2);H[F]/=Math.sqrt(N),I[G]/=Math.sqrt(O),n.axes[0]=H,n.axes[1]=I,n.fragClipBounds[0]=j(C,t[0],v,-1e8),n.fragClipBounds[1]=j(C,t[1],v,1e8),b.vao.draw(m.TRIANGLES,b.vertexCount),b.lineWidth>0&&(m.lineWidth(b.lineWidth),b.vao.draw(m.LINES,b.lineVertexCount,b.vertexCount))}}function m(a,b,c,d,e,f){var g=c.gl;if(c.vao.bind(),e===c.opacity<1||f){a.bind();var h=a.uniforms;h.model=d.model||u,h.view=d.view||u,h.projection=d.projection||u,w[0]=2/g.drawingBufferWidth,w[1]=2/g.drawingBufferHeight,h.screenSize=w,h.highlightId=c.highlightId,h.highlightScale=c.highlightScale,h.fragClipBounds=G,h.clipBounds=c.axes.bounds,h.opacity=c.opacity,h.pickGroup=c.pickId/255,h.pixelRatio=c.pixelRatio,c.vao.draw(g.TRIANGLES,c.vertexCount),c.lineWidth>0&&(g.lineWidth(c.lineWidth),c.vao.draw(g.LINES,c.lineVertexCount,c.vertexCount))}l(b,c,d,e,f),c.vao.unbind()}function n(a){var b=a.gl,c=s.createPerspective(b),d=s.createOrtho(b),e=s.createProject(b),f=s.createPickPerspective(b),h=s.createPickOrtho(b),i=s.createPickProject(b),j=o(b),k=o(b),l=o(b),m=o(b),n=p(b,[{buffer:j,size:3,type:b.FLOAT},{buffer:k,size:4,type:b.FLOAT},{buffer:l,size:2,type:b.FLOAT},{buffer:m,size:4,type:b.UNSIGNED_BYTE,normalized:!0}]),q=new g(b,c,d,e,j,k,l,m,n,f,h,i);return q.update(a),q}var o=a("gl-buffer"),p=a("gl-vao"),q=a("typedarray-pool"),r=a("gl-mat4/multiply"),s=a("./lib/shaders"),t=a("./lib/glyphs"),u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];b.exports=n;var v=g.prototype;v.pickSlots=1,v.setPickBase=function(a){this.pickId=a},v.isTransparent=function(){if(this.opacity<1)return!0;for(var a=0;3>a;++a)if(this.axesProject[a]&&this.projectOpacity[a]<1)return!0;return!1},v.isOpaque=function(){if(this.opacity>=1)return!0;for(var a=0;3>a;++a)if(this.axesProject[a]&&this.projectOpacity[a]>=1)return!0;return!1};var w=[0,0],x=[0,0,0],y=[0,0,0],z=[0,0,0,1],A=[0,0,0,1],B=u.slice(),C=[0,0,0],D=[[0,0,0],[0,0,0]],E=[-1e8,-1e8,-1e8],F=[1e8,1e8,1e8],G=[E,F];v.draw=function(a){var b=this.useOrtho?this.orthoShader:this.shader;m(b,this.projectShader,this,a,!1,!1)},v.drawTransparent=function(a){var b=this.useOrtho?this.orthoShader:this.shader;m(b,this.projectShader,this,a,!0,!1)},v.drawPick=function(a){var b=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;m(b,this.pickProjectShader,this,a,!1,!0)},v.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;var b=a.value[2]+(a.value[1]<<8)+(a.value[0]<<16);if(b>=this.pointCount||0>b)return null;var c=this.points[b],d=this._selectResult;d.index=b;for(var e=0;3>e;++e)d.position[e]=d.dataCoordinate[e]=c[e];return d},v.highlight=function(a){if(a){var b=a.index,c=255&b,d=b>>8&255,e=b>>16&255;this.highlightId=[c/255,d/255,e/255,0]}else this.highlightId=[1,1,1,1]},v.update=function(a){if(a=a||{},"perspective"in a&&(this.useOrtho=!a.perspective),"orthographic"in a&&(this.useOrtho=!!a.orthographic),"lineWidth"in a&&(this.lineWidth=a.lineWidth),"project"in a)if(Array.isArray(a.project))this.axesProject=a.project;else{var b=!!a.project;this.axesProject=[b,b,b]}if("projectScale"in a)if(Array.isArray(a.projectScale))this.projectScale=a.projectScale.slice();else{var c=+a.projectScale;this.projectScale=[c,c,c]}if("projectOpacity"in a)if(Array.isArray(a.projectOpacity))this.projectOpacity=a.projectOpacity.slice();else{var c=+a.projectOpacity;this.projectOpacity=[c,c,c]}"opacity"in a&&(this.opacity=a.opacity),this.dirty=!0;var d=a.position;if(d){var e=a.font||"normal",f=a.alignment||[0,0],g=[1/0,1/0,1/0],h=[-(1/0),-(1/0),-(1/0)],i=a.glyph,j=a.color,k=a.size,l=a.angle,m=a.lineColor,n=0,o=0,p=0,r=d.length;a:for(var s=0;r>s;++s){for(var u=d[s],v=0;3>v;++v)if(isNaN(u[v])||!isFinite(u[v]))continue a;var w;w=Array.isArray(i)?t(i[s],e):i?t(i,e):t("â",e);var x=w[0],y=w[1],z=w[2];o+=3*x.cells.length,p+=2*y.edges.length}var A=o+p,B=q.mallocFloat(3*A),C=q.mallocFloat(4*A),D=q.mallocFloat(2*A),E=q.mallocUint32(A),F=[0,f[1]],G=0,H=o,I=[0,0,0,1],J=[0,0,0,1],K=Array.isArray(j)&&Array.isArray(j[0]),L=Array.isArray(m)&&Array.isArray(m[0]);a:for(var s=0;r>s;++s){for(var u=d[s],v=0;3>v;++v){if(isNaN(u[v])||!isFinite(u[v])){n+=1;continue a}h[v]=Math.max(h[v],u[v]),g[v]=Math.min(g[v],u[v])}var w;w=Array.isArray(i)?t(i[s],e):i?t(i,e):t("â",e);var x=w[0],y=w[1],z=w[2];if(Array.isArray(j)){var M;if(M=K?j[s]:j,3===M.length){for(var v=0;3>v;++v)I[v]=M[v];I[3]=1}else if(4===M.length)for(var v=0;4>v;++v)I[v]=M[v]}else I[0]=I[1]=I[2]=0,I[3]=1;if(Array.isArray(m)){var M;if(M=L?m[s]:m,3===M.length){for(var v=0;3>v;++v)J[v]=M[v];J[v]=1}else if(4===M.length)for(var v=0;4>v;++v)J[v]=M[v]}else J[0]=J[1]=J[2]=0,J[3]=1;var N=.5;Array.isArray(k)?N=+k[s]:k?N=+k:this.useOrtho&&(N=12);var O=0;Array.isArray(l)?O=+l[s]:l&&(O=+l);for(var P=Math.cos(O),Q=Math.sin(O),u=d[s],v=0;3>v;++v)h[v]=Math.max(h[v],u[v]),g[v]=Math.min(g[v],u[v]);f[0]<0?F[0]=f[0]*(1+z[1][0]):f[0]>0&&(F[0]=-f[0]*(1+z[0][0]));for(var R=x.cells,S=x.positions,v=0;v<R.length;++v)for(var T=R[v],U=0;3>U;++U){for(var V=0;3>V;++V)B[3*G+V]=u[V];for(var V=0;4>V;++V)C[4*G+V]=I[V];E[G]=n;var W=S[T[U]];D[2*G]=N*(P*W[0]-Q*W[1]+F[0]),D[2*G+1]=N*(Q*W[0]+P*W[1]+F[1]),G+=1}for(var R=y.edges,S=y.positions,v=0;v<R.length;++v)for(var T=R[v],U=0;2>U;++U){for(var V=0;3>V;++V)B[3*H+V]=u[V];for(var V=0;4>V;++V)C[4*H+V]=J[V];E[H]=n;var W=S[T[U]];D[2*H]=N*(P*W[0]-Q*W[1]+F[0]),D[2*H+1]=N*(Q*W[0]+P*W[1]+F[1]),H+=1}n+=1}this.vertexCount=o,this.lineVertexCount=p,this.pointBuffer.update(B),this.colorBuffer.update(C),this.glyphBuffer.update(D),this.idBuffer.update(new Uint32Array(E)),q.free(B),q.free(C),q.free(D),q.free(E),this.bounds=[g,h],this.points=d,this.pointCount=d.length}},v.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":148,"./lib/shaders":149,"gl-buffer":75,"gl-mat4/multiply":96,"gl-vao":189,"typedarray-pool":233}],151:[function(a,b,c){"use strict";c.boxVertex="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",c.boxFragment="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"},{}],152:[function(a,b,c){"use strict";function d(a,b,c){this.plot=a,this.boxBuffer=b,this.boxShader=c,this.enabled=!0,this.selectBox=[1/0,1/0,-(1/0),-(1/0)],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function e(a,b){var c=a.gl,e=g(c,[0,0,0,1,1,0,1,1]),i=f(c,h.boxVertex,h.boxFragment),j=new d(a,e,i);return j.update(b),a.addOverlay(j),j}var f=a("gl-shader"),g=a("gl-buffer"),h=a("./lib/shaders");b.exports=e;var i=d.prototype;i.draw=function(){if(this.enabled){var a=this.plot,b=this.selectBox,c=this.borderWidth,d=(this.innerFill,this.innerColor),e=(this.outerFill,this.outerColor),f=this.borderColor,g=a.box,h=a.screenBox,i=a.dataBox,j=a.viewBox,k=a.pixelRatio,l=(b[0]-i[0])*(j[2]-j[0])/(i[2]-i[0])+j[0],m=(b[1]-i[1])*(j[3]-j[1])/(i[3]-i[1])+j[1],n=(b[2]-i[0])*(j[2]-j[0])/(i[2]-i[0])+j[0],o=(b[3]-i[1])*(j[3]-j[1])/(i[3]-i[1])+j[1];if(l=Math.max(l,j[0]),m=Math.max(m,j[1]),n=Math.min(n,j[2]),o=Math.min(o,j[3]),!(l>n||m>o)){g.bind();var p=h[2]-h[0],q=h[3]-h[1];if(this.outerFill&&(g.drawBox(0,0,p,m,e),g.drawBox(0,m,l,o,e),g.drawBox(0,o,p,q,e),g.drawBox(n,m,p,o,e)),this.innerFill&&g.drawBox(l,m,n,o,d),c>0){var r=c*k;g.drawBox(l-r,m-r,n+r,m+r,f),g.drawBox(l-r,o-r,n+r,o+r,f),g.drawBox(l-r,m-r,l+r,o+r,f),g.drawBox(n-r,m-r,n+r,o+r,f)}}}},i.update=function(a){a=a||{},this.innerFill=!!a.innerFill,this.outerFill=!!a.outerFill,this.innerColor=(a.innerColor||[0,0,0,.5]).slice(),this.outerColor=(a.outerColor||[0,0,0,.5]).slice(),this.borderColor=(a.borderColor||[0,0,0,1]).slice(),this.borderWidth=a.borderWidth||0,this.selectBox=(a.selectBox||this.selectBox).slice()},i.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":151,"gl-buffer":75,"gl-shader":154}],153:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.coord=[a,b],this.id=c,this.value=d,this.distance=e}function e(a,b,c){this.gl=a,this.fbo=b,this.buffer=c,this._readTimeout=null;var d=this;this._readCallback=function(){d.gl&&(b.bind(),a.readPixels(0,0,b.shape[0],b.shape[1],a.RGBA,a.UNSIGNED_BYTE,d.buffer),d._readTimeout=null)}}function f(a,b){var c=g(a,b),d=h.mallocUint8(b[0]*b[1]*4);return new e(a,c,d)}b.exports=f;var g=a("gl-fbo"),h=a("typedarray-pool"),i=a("ndarray"),j=a("bit-twiddle").nextPow2,k=a("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(255>_inline_31_arg0_||255>_inline_31_arg1_||255>_inline_31_arg2_||255>_inline_31_arg3_){var _inline_31_l=_inline_31_arg4_-_inline_31_arg6_[0],_inline_31_a=_inline_31_arg5_-_inline_31_arg6_[1],_inline_31_f=_inline_31_l*_inline_31_l+_inline_31_a*_inline_31_a;_inline_31_f<this_closestD2&&(this_closestD2=_inline_31_f,this_closestX=_inline_31_arg6_[0],this_closestY=_inline_31_arg6_[1])}}",args:[{name:"_inline_31_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg4_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_31_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_31_a","_inline_31_f","_inline_31_l"]},post:{body:"{return[this_closestX,this_closestY,this_closestD2]}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},debug:!1,funcName:"cwise",blockSize:64}),l=e.prototype;Object.defineProperty(l,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(a){if(this.gl){this.fbo.shape=a;var b=this.fbo.shape[0],c=this.fbo.shape[1];if(c*b*4>this.buffer.length){h.free(this.buffer);for(var d=this.buffer=h.mallocUint8(j(c*b*4)),e=0;c*b*4>e;++e)d[e]=255}return a}}}),l.begin=function(){var a=this.gl;this.shape;a&&(this.fbo.bind(),a.clearColor(1,1,1,1),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT))},l.end=function(){var a=this.gl;a&&(a.bindFramebuffer(a.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},l.query=function(a,b,c){if(!this.gl)return null;var e=this.fbo.shape.slice();a=0|a,b=0|b,"number"!=typeof c&&(c=1);var f=0|Math.min(Math.max(a-c,0),e[0]),g=0|Math.min(Math.max(a+c,0),e[0]),h=0|Math.min(Math.max(b-c,0),e[1]),j=0|Math.min(Math.max(b+c,0),e[1]);if(f>=g||h>=j)return null;var l=[g-f,j-h],m=i(this.buffer,[l[0],l[1],4],[4,4*e[0],1],4*(f+e[0]*h)),n=k(m.hi(l[0],l[1],1),c,c),o=n[0],p=n[1];if(0>o||Math.pow(this.radius,2)<n[2])return null;var q=m.get(o,p,0),r=m.get(o,p,1),s=m.get(o,p,2),t=m.get(o,p,3);return new d(o+f|0,p+h|0,q,[r,s,t],Math.sqrt(n[2]))},l.dispose=function(){this.gl&&(this.fbo.dispose(),h.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":49,"cwise/lib/wrapper":69,"gl-fbo":80,ndarray:208,"typedarray-pool":233}],154:[function(a,b,c){"use strict";function d(a){this.gl=a,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function e(a,b){return a.name<b.name?-1:1}function f(a,b,c,e,f){var g=new d(a);return g.update(b,c,e,f),g}var g=a("./lib/create-uniforms"),h=a("./lib/create-attributes"),i=a("./lib/reflect"),j=a("./lib/shader-cache"),k=a("./lib/runtime-reflect"),l=a("./lib/GLError"),m=d.prototype;m.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},m.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},m.update=function(a,b,c,d){function f(){n.program=j.program(o,n._vref,n._fref,u,v);for(var a=0;a<c.length;++a)C[a]=o.getUniformLocation(n.program,c[a].name)}if(!b||1===arguments.length){var m=a;a=m.vertex,b=m.fragment,c=m.uniforms,d=m.attributes}var n=this,o=n.gl,p=n._vref;n._vref=j.shader(o,o.VERTEX_SHADER,a),p&&p.dispose(),n.vertShader=n._vref.shader;var q=this._fref;if(n._fref=j.shader(o,o.FRAGMENT_SHADER,b),q&&q.dispose(),n.fragShader=n._fref.shader,!c||!d){var r=o.createProgram();if(o.attachShader(r,n.fragShader),o.attachShader(r,n.vertShader),o.linkProgram(r),!o.getProgramParameter(r,o.LINK_STATUS)){var s=o.getProgramInfoLog(r);throw new l(s,"Error linking program:"+s)}c=c||k.uniforms(o,r),d=d||k.attributes(o,r),o.deleteProgram(r)}d=d.slice(),d.sort(e);for(var t=[],u=[],v=[],w=0;w<d.length;++w){var x=d[w];if(x.type.indexOf("mat")>=0){for(var y=0|x.type.charAt(x.type.length-1),z=new Array(y),A=0;y>A;++A)z[A]=v.length,u.push(x.name+"["+A+"]"),"number"==typeof x.location?v.push(x.location+A):Array.isArray(x.location)&&x.location.length===y&&"number"==typeof x.location[A]?v.push(0|x.location[A]):v.push(-1);t.push({name:x.name,type:x.type,locations:z})}else t.push({name:x.name,type:x.type,locations:[v.length]}),u.push(x.name),"number"==typeof x.location?v.push(0|x.location):v.push(-1)}for(var B=0,w=0;w<v.length;++w)if(v[w]<0){for(;v.indexOf(B)>=0;)B+=1;v[w]=B}var C=new Array(c.length);f(),n._relink=f,n.types={uniforms:i(c),attributes:i(d)},n.attributes=h(o,n,t,v),Object.defineProperty(n,"uniforms",g(o,n,c,C))},b.exports=f},{"./lib/GLError":155,"./lib/create-attributes":156,"./lib/create-uniforms":157,"./lib/reflect":158,"./lib/runtime-reflect":159,"./lib/shader-cache":160}],155:[function(a,b,c){function d(a,b,c){this.shortMessage=b||"",this.longMessage=c||"",this.rawError=a||"",this.message="gl-shader: "+(b||a||"")+(c?"\n"+c:""),this.stack=(new Error).stack}d.prototype=new Error,d.prototype.name="GLError",d.prototype.constructor=d,b.exports=d},{}],156:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this._gl=a,this._wrapper=b,this._index=c,this._locations=d,this._dimension=e,this._constFunc=f}function e(a,b,c,e,f,g,h){for(var i=["gl","v"],j=[],k=0;f>k;++k)i.push("x"+k),j.push("x"+k);i.push("if(x0.length===void 0){return gl.vertexAttrib"+f+"f(v,"+j.join()+")}else{return gl.vertexAttrib"+f+"fv(v,x0)}");var l=Function.apply(null,i),m=new d(a,b,c,e,f,l);Object.defineProperty(g,h,{set:function(b){return a.disableVertexAttribArray(e[c]),l(a,e[c],b),b},get:function(){return m},enumerable:!0})}function f(a,b,c,d,f,g,h){for(var i=new Array(f),j=new Array(f),k=0;f>k;++k)e(a,b,c[k],d,f,i,k),j[k]=i[k];Object.defineProperty(i,"location",{set:function(a){if(Array.isArray(a))for(var b=0;f>b;++b)j[b].location=a[b];else for(var b=0;f>b;++b)j[b].location=a+b;return a},get:function(){for(var a=new Array(f),b=0;f>b;++b)a[b]=d[c[b]];return a},enumerable:!0}),i.pointer=function(b,e,g,h){b=b||a.FLOAT,e=!!e,g=g||f*f,h=h||0;for(var i=0;f>i;++i){var j=d[c[i]];a.vertexAttribPointer(j,f,b,e,g,h+i*f),a.enableVertexAttribArray(j)}};var l=new Array(f),m=a["vertexAttrib"+f+"fv"];Object.defineProperty(g,h,{set:function(b){for(var e=0;f>e;++e){var g=d[c[e]];if(a.disableVertexAttribArray(g),Array.isArray(b[0]))m.call(a,g,b[e]);else{for(var h=0;f>h;++h)l[h]=b[f*e+h];m.call(a,g,l)}}return b},get:function(){return i},enumerable:!0})}function g(a,b,c,d){for(var g={},i=0,j=c.length;j>i;++i){var k=c[i],l=k.name,m=k.type,n=k.locations;switch(m){case"bool":case"int":case"float":e(a,b,n[0],d,1,g,l);break;default:if(m.indexOf("vec")>=0){var o=m.charCodeAt(m.length-1)-48;if(2>o||o>4)throw new h("","Invalid data type for attribute "+l+": "+m);e(a,b,n[0],d,o,g,l)}else{if(!(m.indexOf("mat")>=0))throw new h("","Unknown data type for attribute "+l+": "+m);var o=m.charCodeAt(m.length-1)-48;if(2>o||o>4)throw new h("","Invalid data type for attribute "+l+": "+m);f(a,b,n,d,o,g,l)}}}return g}b.exports=g;var h=a("./GLError"),i=d.prototype;i.pointer=function(a,b,c,d){var e=this,f=e._gl,g=e._locations[e._index];f.vertexAttribPointer(g,e._dimension,a||f.FLOAT,!!b,c||0,d||0),f.enableVertexAttribArray(g)},i.set=function(a,b,c,d){return this._constFunc(this._locations[this._index],a,b,c,d)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(a){return a!==this._locations[this._index]&&(this._locations[this._index]=0|a,this._wrapper.program=null),0|a}})},{"./GLError":155}],157:[function(a,b,c){"use strict";function d(a){var b=new Function("y","return function(){return y}");return b(a)}function e(a,b){for(var c=new Array(a),d=0;a>d;++d)c[d]=b;return c}function f(a,b,c,f){function i(c){var d=new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+c+"])}");return d(a,b,f)}function j(a,b,c){switch(c){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+b+"],obj"+a+")";case"float":return"gl.uniform1f(locations["+b+"],obj"+a+")";default:var d=c.indexOf("vec");if(!(d>=0&&1>=d&&c.length===4+d)){if(0===c.indexOf("mat")&&4===c.length){var e=c.charCodeAt(c.length-1)-48;if(2>e||e>4)throw new h("","Invalid uniform dimension type for matrix "+name+": "+c);return"gl.uniformMatrix"+e+"fv(locations["+b+"],false,obj"+a+")"}throw new h("","Unknown uniform data type for "+name+": "+c)}var e=c.charCodeAt(c.length-1)-48;if(2>e||e>4)throw new h("","Invalid data type");switch(c.charAt(0)){case"b":case"i":return"gl.uniform"+e+"iv(locations["+b+"],obj"+a+")";case"v":return"gl.uniform"+e+"fv(locations["+b+"],obj"+a+")";default:throw new h("","Unrecognized data type for vector "+name+": "+c)}}}function k(a,b){if("object"!=typeof b)return[[a,b]];var c=[];for(var d in b){var e=b[d],f=a;f+=parseInt(d)+""===d?"["+d+"]":"."+d,"object"==typeof e?c.push.apply(c,k(f,e)):c.push([f,e]); 37 }return c}function l(b){for(var d=["return function updateProperty(obj){"],e=k("",b),g=0;g<e.length;++g){var h=e[g],i=h[0],l=h[1];f[l]&&d.push(j(i,l,c[l].type))}d.push("return obj}");var m=new Function("gl","locations",d.join("\n"));return m(a,f)}function m(a){switch(a){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var b=a.indexOf("vec");if(b>=0&&1>=b&&a.length===4+b){var c=a.charCodeAt(a.length-1)-48;if(2>c||c>4)throw new h("","Invalid data type");return"b"===a.charAt(0)?e(c,!1):e(c,0)}if(0===a.indexOf("mat")&&4===a.length){var c=a.charCodeAt(a.length-1)-48;if(2>c||c>4)throw new h("","Invalid uniform dimension type for matrix "+name+": "+a);return e(c*c,0)}throw new h("","Unknown uniform data type for "+name+": "+a)}}function n(a,b,e){if("object"==typeof e){var g=o(e);Object.defineProperty(a,b,{get:d(g),set:l(e),enumerable:!0,configurable:!1})}else f[e]?Object.defineProperty(a,b,{get:i(e),set:l(e),enumerable:!0,configurable:!1}):a[b]=m(c[e].type)}function o(a){var b;if(Array.isArray(a)){b=new Array(a.length);for(var c=0;c<a.length;++c)n(b,c,a[c])}else{b={};for(var d in a)n(b,d,a[d])}return b}var p=g(c,!0);return{get:d(o(p)),set:l(p),enumerable:!0,configurable:!0}}var g=a("./reflect"),h=a("./GLError");b.exports=f},{"./GLError":155,"./reflect":158}],158:[function(a,b,c){"use strict";function d(a,b){for(var c={},d=0;d<a.length;++d)for(var e=a[d].name,f=e.split("."),g=c,h=0;h<f.length;++h){var i=f[h].split("[");if(i.length>1){i[0]in g||(g[i[0]]=[]),g=g[i[0]];for(var j=1;j<i.length;++j){var k=parseInt(i[j]);j<i.length-1||h<f.length-1?(k in g||(j<i.length-1?g[k]=[]:g[k]={}),g=g[k]):b?g[k]=d:g[k]=a[d].type}}else h<f.length-1?(i[0]in g||(g[i[0]]={}),g=g[i[0]]):b?g[i[0]]=d:g[i[0]]=a[d].type}return c}b.exports=d},{}],159:[function(a,b,c){"use strict";function d(a,b){if(!h){var c=Object.keys(g);h={};for(var d=0;d<c.length;++d){var e=c[d];h[a[e]]=g[e]}}return h[b]}function e(a,b){for(var c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS),e=[],f=0;c>f;++f){var g=a.getActiveUniform(b,f);if(g){var h=d(a,g.type);if(g.size>1)for(var i=0;i<g.size;++i)e.push({name:g.name.replace("[0]","["+i+"]"),type:h});else e.push({name:g.name,type:h})}}return e}function f(a,b){for(var c=a.getProgramParameter(b,a.ACTIVE_ATTRIBUTES),e=[],f=0;c>f;++f){var g=a.getActiveAttrib(b,f);g&&e.push({name:g.name,type:d(a,g.type)})}return e}c.uniforms=e,c.attributes=f;var g={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},h=null},{}],160:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g){this.id=a,this.src=b,this.type=c,this.shader=d,this.count=f,this.programs=[],this.cache=g}function e(a){this.gl=a,this.shaders=[{},{}],this.programs={}}function f(a,b,c){var d=a.createShader(b);if(a.shaderSource(d,c),a.compileShader(d),!a.getShaderParameter(d,a.COMPILE_STATUS)){var e=a.getShaderInfoLog(d);try{var f=l(e,c,b)}catch(g){throw console.warn("Failed to format compiler error: "+g),new k(e,"Error compiling shader:\n"+e)}throw new k(e,f["short"],f["long"])}return d}function g(a,b,c,d,e){var f=a.createProgram();a.attachShader(f,b),a.attachShader(f,c);for(var g=0;g<d.length;++g)a.bindAttribLocation(f,e[g],d[g]);if(a.linkProgram(f),!a.getProgramParameter(f,a.LINK_STATUS)){var h=a.getProgramInfoLog(f);throw new k(h,"Error linking program: "+h)}return f}function h(a){var b=n.get(a);return b||(b=new e(a),n.set(a,b)),b}function i(a,b,c){return h(a).getShaderReference(b,c)}function j(a,b,c,d,e){return h(a).getProgram(b,c,d,e)}c.shader=i,c.program=j;var k=a("./GLError"),l=a("gl-format-compiler-error"),m="undefined"==typeof WeakMap?a("weakmap-shim"):WeakMap,n=new m,o=0;d.prototype.dispose=function(){if(0===--this.count){for(var a=this.cache,b=a.gl,c=this.programs,d=0,e=c.length;e>d;++d){var f=a.programs[c[d]];f&&(delete a.programs[d],b.deleteProgram(f))}b.deleteShader(this.shader),delete a.shaders[this.type===b.FRAGMENT_SHADER|0][this.src]}};var p=e.prototype;p.getShaderReference=function(a,b){var c=this.gl,e=this.shaders[a===c.FRAGMENT_SHADER|0],g=e[b];if(g&&c.isShader(g.shader))g.count+=1;else{var h=f(c,a,b);g=e[b]=new d(o++,b,a,h,[],1,this)}return g},p.getProgram=function(a,b,c,d){var e=[a.id,b.id,c.join(":"),d.join(":")].join("@"),f=this.programs[e];return f&&this.gl.isProgram(f)||(this.programs[e]=f=g(this.gl,a.shader,b.shader,c,d),a.programs.push(e),b.programs.push(e)),f}},{"./GLError":155,"gl-format-compiler-error":161,"weakmap-shim":177}],161:[function(a,b,c){function d(a,b,c){"use strict";var d=g(b)||"of unknown name (see npm glsl-shader-name)",i="unknown type";void 0!==c&&(i=c===f.FRAGMENT_SHADER?"fragment":"vertex");for(var j=e("Error compiling %s shader %s:\n",i,d),k=e("%s%s",j,a),l=a.split("\n"),m={},n=0;n<l.length;n++){var o=l[n];if(""!==o){var p=parseInt(o.split(":")[2]);if(isNaN(p))throw new Error(e("Could not parse error: %s",o));m[p]=o}}for(var q=h(b).split("\n"),n=0;n<q.length;n++)if(m[n+3]||m[n+2]||m[n+1]){var r=q[n];if(j+=r+"\n",m[n+1]){var s=m[n+1];s=s.substr(s.split(":",3).join(":").length+1).trim(),j+=e("^^^ %s\n\n",s)}}return{"long":j.trim(),"short":k.trim()}}var e=a("sprintf-js").sprintf,f=a("gl-constants/lookup"),g=a("glsl-shader-name"),h=a("add-line-numbers");b.exports=d},{"add-line-numbers":162,"gl-constants/lookup":166,"glsl-shader-name":167,"sprintf-js":174}],162:[function(a,b,c){function d(a,b,c){b="number"==typeof b?b:1,c=c||": ";var d=a.split(/\r?\n/),f=String(d.length+b-1).length;return d.map(function(a,d){var g=d+b,h=String(g).length,i=e(g,f-h);return i+c+a}).join("\n")}var e=a("pad-left");b.exports=d},{"pad-left":163}],163:[function(a,b,c){"use strict";var d=a("repeat-string");b.exports=function(a,b,c){return c="undefined"!=typeof c?c+"":" ",d(c,b)+a}},{"repeat-string":164}],164:[function(a,b,c){"use strict";function d(a,b){if("string"!=typeof a)throw new TypeError("repeat-string expects a string.");if(1===b)return a;if(2===b)return a+a;var c=a.length*b;for(e===a&&"undefined"!=typeof e||(e=a,f="");c>f.length&&b>0&&(1&b&&(f+=a),b>>=1);)a+=a;return f.substr(0,c)}b.exports=d;var e,f=""},{}],165:[function(a,b,c){b.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],166:[function(a,b,c){var d=a("./1.0/numbers");b.exports=function(a){return d[a]}},{"./1.0/numbers":165}],167:[function(a,b,c){function d(a){for(var b=Array.isArray(a)?a:e(a),c=0;c<b.length;c++){var d=b[c];if("preprocessor"===d.type){var g=d.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(g&&g[2]){var h=g[1],i=g[2];return(h?f(i):i).trim()}}}}var e=a("glsl-tokenizer"),f=a("atob-lite");b.exports=d},{"atob-lite":168,"glsl-tokenizer":173}],168:[function(a,b,c){b.exports=function(a){return atob(a)}},{}],169:[function(a,b,c){function d(){function a(a){a.length&&N.push({type:v[L],data:a,position:Q,line:O,column:P})}function b(a){J=0,T+=a,I=T.length;for(var b;G=T[J],I>J;){switch(b=J,L){case j:J=z();break;case k:J=y();break;case l:J=x();break;case m:J=A();break;case n:J=D();break;case u:J=C();break;case o:J=E();break;case i:J=F();break;case s:J=w();break;case h:J=d()}if(b!==J)switch(T[b]){case"\n":P=0,++O;break;default:++P}}return K+=J,T=T.slice(J),N}function c(b){return M.length&&a(M.join("")),L=t,a("(eof)"),N}function d(){return M=M.length?[]:M,"/"===H&&"*"===G?(Q=K+J-1,L=j,H=G,J+1):"/"===H&&"/"===G?(Q=K+J-1,L=k,H=G,J+1):"#"===G?(L=l,Q=K+J,J):/\s/.test(G)?(L=s,Q=K+J,J):(R=/\d/.test(G),S=/[^\w_]/.test(G),Q=K+J,L=R?n:S?m:i,J)}function w(){return/[^\s]/g.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function x(){return"\n"===G&&"\\"!==H?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function y(){return x()}function z(){return"/"===G&&"*"===H?(M.push(G),a(M.join("")),L=h,J+1):(M.push(G),H=G,J+1)}function A(){if("."===H&&/\d/.test(G))return L=o,J;if("/"===H&&"*"===G)return L=j,J;if("/"===H&&"/"===G)return L=k,J;if("."===G&&M.length){for(;B(M););return L=o,J}if(";"===G||")"===G||"("===G){if(M.length)for(;B(M););return a(G),L=h,J+1}var b=2===M.length&&"="!==G;if(/[\w_\d\s]/.test(G)||b){for(;B(M););return L=h,J}return M.push(G),H=G,J+1}function B(b){for(var c,d,e=0;;){if(c=f.indexOf(b.slice(0,b.length+e).join("")),d=f[c],-1===c){if(e--+b.length>0)continue;d=b.slice(0,1).join("")}return a(d),Q+=d.length,M=M.slice(d.length),M.length}}function C(){return/[^a-fA-F0-9]/.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function D(){return"."===G?(M.push(G),L=o,H=G,J+1):/[eE]/.test(G)?(M.push(G),L=o,H=G,J+1):"x"===G&&1===M.length&&"0"===M[0]?(L=u,M.push(G),H=G,J+1):/[^\d]/.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function E(){return"f"===G&&(M.push(G),H=G,J+=1),/[eE]/.test(G)?(M.push(G),H=G,J+1):/[^\d]/.test(G)?(a(M.join("")),L=h,J):(M.push(G),H=G,J+1)}function F(){if(/[^\d\w_]/.test(G)){var b=M.join("");return L=e.indexOf(b)>-1?r:g.indexOf(b)>-1?q:p,a(M.join("")),L=h,J}return M.push(G),H=G,J+1}var G,H,I,J=0,K=0,L=h,M=[],N=[],O=1,P=0,Q=0,R=!1,S=!1,T="";return function(a){return N=[],null!==a?b(a):c()}}b.exports=d;var e=a("./lib/literals"),f=a("./lib/operators"),g=a("./lib/builtins"),h=999,i=9999,j=0,k=1,l=2,m=3,n=4,o=5,p=6,q=7,r=8,s=9,t=10,u=11,v=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":170,"./lib/literals":171,"./lib/operators":172}],170:[function(a,b,c){b.exports=["gl_Position","gl_PointSize","gl_ClipVertex","gl_FragCoord","gl_FrontFacing","gl_FragColor","gl_FragData","gl_FragDepth","gl_Color","gl_SecondaryColor","gl_Normal","gl_Vertex","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_FogCoord","gl_MaxLights","gl_MaxClipPlanes","gl_MaxTextureUnits","gl_MaxTextureCoords","gl_MaxVertexAttribs","gl_MaxVertexUniformComponents","gl_MaxVaryingFloats","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformComponents","gl_MaxDrawBuffers","gl_ModelViewMatrix","gl_ProjectionMatrix","gl_ModelViewProjectionMatrix","gl_TextureMatrix","gl_NormalMatrix","gl_ModelViewMatrixInverse","gl_ProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverse","gl_TextureMatrixInverse","gl_ModelViewMatrixTranspose","gl_ProjectionMatrixTranspose","gl_ModelViewProjectionMatrixTranspose","gl_TextureMatrixTranspose","gl_ModelViewMatrixInverseTranspose","gl_ProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixInverseTranspose","gl_TextureMatrixInverseTranspose","gl_NormalScale","gl_DepthRangeParameters","gl_DepthRange","gl_ClipPlane","gl_PointParameters","gl_Point","gl_MaterialParameters","gl_FrontMaterial","gl_BackMaterial","gl_LightSourceParameters","gl_LightSource","gl_LightModelParameters","gl_LightModel","gl_LightModelProducts","gl_FrontLightModelProduct","gl_BackLightModelProduct","gl_LightProducts","gl_FrontLightProduct","gl_BackLightProduct","gl_FogParameters","gl_Fog","gl_TextureEnvColor","gl_EyePlaneS","gl_EyePlaneT","gl_EyePlaneR","gl_EyePlaneQ","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_ObjectPlaneR","gl_ObjectPlaneQ","gl_FrontColor","gl_BackColor","gl_FrontSecondaryColor","gl_BackSecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_Color","gl_SecondaryColor","gl_TexCoord","gl_FogFragCoord","gl_PointCoord","radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","faceforward","reflect","refract","matrixCompMult","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture2D","texture2DProj","texture2DLod","texture2DProjLod","textureCube","textureCubeLod","dFdx","dFdy"]},{}],171:[function(a,b,c){b.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],172:[function(a,b,c){b.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],173:[function(a,b,c){function d(a){var b=e(),c=[];return c=c.concat(b(a)),c=c.concat(b(null))}var e=a("./index");b.exports=d},{"./index":169}],174:[function(b,c,d){!function(b){function c(){var a=arguments[0],b=c.cache;return b[a]&&b.hasOwnProperty(a)||(b[a]=c.parse(a)),c.format.call(null,b[a],arguments)}function e(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function f(a,b){return Array(b+1).join(a)}var g={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};c.format=function(a,b){var d,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=e(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(d=b[n],i=0;i<j[2].length;i++){if(!d.hasOwnProperty(j[2][i]))throw new Error(c("[sprintf] property '%s' does not exist",j[2][i]));d=d[j[2][i]]}else d=j[1]?b[j[1]]:b[n++];if("function"==e(d)&&(d=d()),g.not_string.test(j[8])&&g.not_json.test(j[8])&&"number"!=e(d)&&isNaN(d))throw new TypeError(c("[sprintf] expecting number but found %s",e(d)));switch(g.number.test(j[8])&&(r=d>=0),j[8]){case"b":d=d.toString(2);break;case"c":d=String.fromCharCode(d);break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,j[6]?parseInt(j[6]):0);break;case"e":d=j[7]?d.toExponential(j[7]):d.toExponential();break;case"f":d=j[7]?parseFloat(d).toFixed(j[7]):parseFloat(d);break;case"g":d=j[7]?parseFloat(d).toPrecision(j[7]):parseFloat(d);break;case"o":d=d.toString(8);break;case"s":d=(d=String(d))&&j[7]?d.substring(0,j[7]):d;break;case"u":d>>>=0;break;case"x":d=d.toString(16);break;case"X":d=d.toString(16).toUpperCase()}g.json.test(j[8])?q[q.length]=d:(!g.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",d=d.toString().replace(g.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+d).length,k=j[6]&&m>0?f(l,m):"",q[q.length]=j[5]?s+d+k:"0"===l?s+k+d:k+s+d)}return q.join("")},c.cache={},c.parse=function(a){for(var b=a,c=[],d=[],e=0;b;){if(null!==(c=g.text.exec(b)))d[d.length]=c[0];else if(null!==(c=g.modulo.exec(b)))d[d.length]="%";else{if(null===(c=g.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){e|=1;var f=[],h=c[2],i=[];if(null===(i=g.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(f[f.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=g.key_access.exec(h)))f[f.length]=i[1];else{if(null===(i=g.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");f[f.length]=i[1]}c[2]=f}else e|=2;if(3===e)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var h=function(a,b,d){return d=(b||[]).slice(0),d.splice(0,0,a),c.apply(null,d)};"undefined"!=typeof d?(d.sprintf=c,d.vsprintf=h):(b.sprintf=c,b.vsprintf=h,"function"==typeof a&&a.amd&&a(function(){return{sprintf:c,vsprintf:h}}))}("undefined"==typeof window?this:window)},{}],175:[function(a,b,c){function d(){var a={};return function(b){if(("object"!=typeof b||null===b)&&"function"!=typeof b)throw new Error("Weakmap-shim: Key must be object");var c=b.valueOf(a);return c&&c.identity===a?c:e(b,a)}}var e=a("./hidden-store.js");b.exports=d},{"./hidden-store.js":176}],176:[function(a,b,c){function d(a,b){var c={identity:b},d=a.valueOf;return Object.defineProperty(a,"valueOf",{value:function(a){return a!==b?d.apply(this,arguments):c},writable:!0}),c}b.exports=d},{}],177:[function(a,b,c){function d(){var a=e();return{get:function(b,c){var d=a(b);return d.hasOwnProperty("value")?d.value:c},set:function(b,c){a(b).value=c},has:function(b){return"value"in a(b)},"delete":function(b){return delete a(b).value}}}var e=a("./create-store.js");b.exports=d},{"./create-store.js":175}],178:[function(a,b,c){"use strict";function d(a){this.plot=a,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function e(a,b){var c=new d(a);return c.update(b),a.addOverlay(c),c}b.exports=e;var f=d.prototype;f.update=function(a){a=a||{},this.enable=(a.enable||[!0,!0,!1,!1]).slice(),this.width=(a.width||[1,1,1,1]).slice(),this.color=(a.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(a){return a.slice()}),this.center=(a.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},f.draw=function(){var a=this.enable,b=this.width,c=this.color,d=this.center,e=this.plot,f=e.line,g=e.dataBox,h=e.viewBox;if(f.bind(),g[0]<=d[0]&&d[0]<=g[2]&&g[1]<=d[1]&&d[1]<=g[3]){var i=h[0]+(d[0]-g[0])/(g[2]-g[0])*(h[2]-h[0]),j=h[1]+(d[1]-g[1])/(g[3]-g[1])*(h[3]-h[1]);a[0]&&f.drawLine(i,j,h[0],j,b[0],c[0]),a[1]&&f.drawLine(i,j,i,h[1],b[1],c[1]),a[2]&&f.drawLine(i,j,h[2],j,b[2],c[2]),a[3]&&f.drawLine(i,j,i,h[3],b[3],c[3])}},f.dispose=function(){this.plot.removeOverlay(this)}},{}],179:[function(a,b,c){var d=a("gl-shader"),e="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec4 uv;\nattribute vec2 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n value = f.x;\n kill = f.y;\n planeCoordinate = uv.xy;\n \n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}",f="#define GLSLIFY 1\nprecision mediump float;\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = beckmannSpecular_1_1(L, V, N, roughness);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n float interpValue = (value - lowerBound.z) / (upperBound.z - lowerBound.z);\n vec4 surfaceColor = texture2D(colormap, vec2(interpValue, interpValue));\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",g="#define GLSLIFY 1\nprecision mediump float;\n\nattribute vec4 uv;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = dataCoordinate.z;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",h="#define GLSLIFY 1\nprecision mediump float;\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 || \n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}";c.createShader=function(a){var b=d(a,e,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec2"},{name:"normal",type:"vec3"}]);return b.attributes.uv.location=0,b.attributes.f.location=1,b.attributes.normal.location=2,b},c.createPickShader=function(a){var b=d(a,e,h,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec2"},{name:"normal",type:"vec3"}]);return b.attributes.uv.location=0,b.attributes.f.location=1,b.attributes.normal.location=2,b},c.createContourShader=function(a){var b=d(a,g,f,null,[{name:"uv",type:"vec4"}]);return b.attributes.uv.location=0,b},c.createPickContourShader=function(a){var b=d(a,g,h,null,[{name:"uv",type:"vec4"}]);return b.attributes.uv.location=0,b}},{"gl-shader":154}],180:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],181:[function(a,b,c){"use strict";function d(a){if(a in i)return i[a];for(var b=[],c=0;a>c;++c)b.push("out",c,"s=0.5*(inp",c,"l-inp",c,"r);");for(var d=["array"],e=["junk"],c=0;a>c;++c){d.push("array"),e.push("out"+c+"s");var f=g(a);f[c]=-1,d.push({array:0,offset:f.slice()}),f[c]=1,d.push({array:0,offset:f.slice()}),e.push("inp"+c+"l","inp"+c+"r")}return i[a]=h({args:d,pre:k,post:k,body:{body:b.join(""),args:e.map(function(a){return{name:a,lvalue:0===a.indexOf("out"),rvalue:0===a.indexOf("inp"),count:"junk"!==a|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+a})}function e(a){function b(b){for(var c=f-b.length,d=[],e=[],h=[],i=0;f>i;++i)b.indexOf(i+1)>=0?h.push("0"):b.indexOf(-(i+1))>=0?h.push("s["+i+"]-1"):(h.push("-1"),d.push("1"),e.push("s["+i+"]-2"));var j=".lo("+d.join()+").hi("+e.join()+")";if(0===d.length&&(j=""),c>0){g.push("if(1");for(var i=0;f>i;++i)b.indexOf(i+1)>=0||b.indexOf(-(i+1))>=0||g.push("&&s[",i,"]>2");g.push("){grad",c,"(src.pick(",h.join(),")",j);for(var i=0;f>i;++i)b.indexOf(i+1)>=0||b.indexOf(-(i+1))>=0||g.push(",dst.pick(",h.join(),",",i,")",j);g.push(");")}for(var i=0;i<b.length;++i){var k=Math.abs(b[i])-1,l="dst.pick("+h.join()+","+k+")"+j;switch(a[k]){case"clamp":var m=h.slice(),n=h.slice();b[i]<0?m[k]="s["+k+"]-2":n[k]="1",0===c?g.push("if(s[",k,"]>1){dst.set(",h.join(),",",k,",0.5*(src.get(",m.join(),")-src.get(",n.join(),")))}else{dst.set(",h.join(),",",k,",0)};"):g.push("if(s[",k,"]>1){diff(",l,",src.pick(",m.join(),")",j,",src.pick(",n.join(),")",j,");}else{zero(",l,");};");break;case"mirror":0===c?g.push("dst.set(",h.join(),",",k,",0);"):g.push("zero(",l,");");break;case"wrap":var o=h.slice(),p=h.slice();b[i]<0?(o[k]="s["+k+"]-2",p[k]="0"):(o[k]="s["+k+"]-1",p[k]="1"),0===c?g.push("if(s[",k,"]>2){dst.set(",h.join(),",",k,",0.5*(src.get(",o.join(),")-src.get(",p.join(),")))}else{dst.set(",h.join(),",",k,",0)};"):g.push("if(s[",k,"]>2){diff(",l,",src.pick(",o.join(),")",j,",src.pick(",p.join(),")",j,");}else{zero(",l,");};"); 38 break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}c>0&&g.push("};")}var c=a.join(),e=j[c];if(e)return e;for(var f=a.length,g=["function gradient(dst,src){var s=src.shape.slice();"],h=0;1<<f>h;++h){for(var k=[],n=0;f>n;++n)h&1<<n&&k.push(n+1);for(var o=0;o<1<<k.length;++o){for(var p=k.slice(),n=0;n<k.length;++n)o&1<<n&&(p[n]=-p[n]);b(p)}}g.push("return dst;};return gradient");for(var q=["diff","zero"],r=[l,m],h=1;f>=h;++h)q.push("grad"+h),r.push(d(h));q.push(g.join(""));var s=Function.apply(void 0,q),e=s.apply(void 0,r);return i[c]=e,e}function f(a,b,c){if(Array.isArray(c)){if(c.length!==b.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else c="string"==typeof c?g(b.dimension,c):g(b.dimension,"clamp");if(a.dimension!==b.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(a.shape[b.dimension]!==b.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var d=0;d<b.dimension;++d)if(a.shape[d]!==b.shape[d])throw new Error("ndarray-gradient: shape mismatch");if(0===b.size)return a;if(b.dimension<=0)return a.set(0),a;var f=e(c);return f(a,b)}b.exports=f;var g=a("dup"),h=a("cwise-compiler"),i={},j={},k={body:"",args:[],thisVars:[],localVars:[]},l=h({args:["array","array","array"],pre:k,post:k,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1},{name:"left",lvalue:!1,rvalue:!0,count:1},{name:"right",lvalue:!1,rvalue:!0,count:1}],body:"out=0.5*(left-right)",thisVars:[],localVars:[]},funcName:"cdiff"}),m=h({args:["array"],pre:k,post:k,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"})},{"cwise-compiler":66,dup:72}],182:[function(a,b,c){"use strict";var d=a("ndarray"),e=a("./doConvert.js");b.exports=function(a,b){for(var c=[],f=a,g=1;f instanceof Array;)c.push(f.length),g*=f.length,f=f[0];return 0===c.length?d():(b||(b=d(new Float64Array(g),c)),e(b,a),b)}},{"./doConvert.js":183,ndarray:208}],183:[function(a,b,c){b.exports=a("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":66}],184:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.position=a,this.index=b,this.uv=c,this.level=d,this.dataCoordinate=e}function e(a){var b=u([s({colormap:a,nshades:K,format:"rgba"}).map(function(a){return[a[0],a[1],a[2],255*a[3]]})]);return t.divseq(b,255),b}function f(a,b,c,e,f,g,h,i,j,k,l,m,n,o){this.gl=a,this.shape=b,this.bounds=c,this._shader=e,this._pickShader=f,this._coordinateBuffer=g,this._vao=h,this._colorMap=i,this._contourShader=j,this._contourPickShader=k,this._contourBuffer=l,this._contourVAO=m,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new d([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=n,this._dynamicVAO=o,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[v(r.mallocFloat(1024),[0,0]),v(r.mallocFloat(1024),[0,0]),v(r.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.dirty=!0}function g(a,b){for(var c=b.axes&&b.axes.lastCubeProps.axis||M,d=b.showSurface,e=b.showContour,f=0;3>f;++f){d=d||b.surfaceProject[f];for(var g=0;3>g;++g)e=e||b.contourProject[f][g]}for(var f=0;3>f;++f){for(var h=N.projections[f],g=0;16>g;++g)h[g]=0;for(var g=0;4>g;++g)h[5*g]=1;h[5*f]=0,h[12+f]=b.axesBounds[+(c[f]>0)][f],x(h,a.model,h);for(var i=N.clipBounds[f],j=0;2>j;++j)for(var g=0;3>g;++g)i[j][g]=a.clipBounds[j][g];i[0][f]=-1e8,i[1][f]=1e8}return N.showSurface=d,N.showContour=e,N}function h(a,b){a=a||{};var c=this.gl;c.disable(c.CULL_FACE),this._colorMap.bind(0);var d=O;d.model=a.model||H,d.view=a.view||H,d.projection=a.projection||H,d.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],d.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],d.contourColor=this.contourColor[0],d.inverseModel=y(d.inverseModel,d.model);for(var e=0;2>e;++e)for(var f=d.clipBounds[e],h=0;3>h;++h)f[h]=Math.min(Math.max(this.clipBounds[e][h],-1e8),1e8);d.kambient=this.ambientLight,d.kdiffuse=this.diffuseLight,d.kspecular=this.specularLight,d.shape=d.roughness=this.roughness,d.fresnel=this.fresnel,d.opacity=this.opacity,d.height=0,d.permutation=Q;var i=P;x(i,d.view,d.model),x(i,d.projection,i),y(i,i);for(var e=0;3>e;++e)d.eyePosition[e]=i[12+e]/i[15];for(var j=i[15],e=0;3>e;++e)j+=this.lightPosition[e]*i[4*e+3];for(var e=0;3>e;++e){for(var k=i[12+e],h=0;3>h;++h)k+=i[4*h+e]*this.lightPosition[h];d.lightPosition[e]=k/j}var l=g(d,this);if(l.showSurface&&b===this.opacity<1){this._shader.bind(),this._shader.uniforms=d,this._vao.bind(),this.showSurface&&this._vao.draw(c.TRIANGLES,this._vertexCount);for(var e=0;3>e;++e)this.surfaceProject[e]&&(this._shader.uniforms.model=l.projections[e],this._shader.uniforms.clipBounds=l.clipBounds[e],this._vao.draw(c.TRIANGLES,this._vertexCount));this._vao.unbind()}if(l.showContour&&!b){var m=this._contourShader;d.kambient=1,d.kdiffuse=0,d.kspecular=0,d.opacity=1,m.bind(),m.uniforms=d;var n=this._contourVAO;n.bind();for(var e=0;3>e;++e){m.uniforms.permutation=J[e],c.lineWidth(this.contourWidth[e]);for(var h=0;h<this.contourLevels[e].length;++h)h===this.highlightLevel[e]?(m.uniforms.contourColor=this.highlightColor[e],m.uniforms.contourTint=this.highlightTint[e]):0!==h&&h-1!==this.highlightLevel[e]||(m.uniforms.contourColor=this.contourColor[e],m.uniforms.contourTint=this.contourTint[e]),m.uniforms.height=this.contourLevels[e][h],n.draw(c.LINES,this._contourCounts[e][h],this._contourOffsets[e][h])}for(var e=0;3>e;++e){m.uniforms.model=l.projections[e],m.uniforms.clipBounds=l.clipBounds[e];for(var h=0;3>h;++h)if(this.contourProject[e][h]){m.uniforms.permutation=J[h],c.lineWidth(this.contourWidth[h]);for(var o=0;o<this.contourLevels[h].length;++o)o===this.highlightLevel[h]?(m.uniforms.contourColor=this.highlightColor[h],m.uniforms.contourTint=this.highlightTint[h]):0!==o&&o-1!==this.highlightLevel[h]||(m.uniforms.contourColor=this.contourColor[h],m.uniforms.contourTint=this.contourTint[h]),m.uniforms.height=this.contourLevels[h][o],n.draw(c.LINES,this._contourCounts[h][o],this._contourOffsets[h][o])}}n=this._dynamicVAO,n.bind();for(var e=0;3>e;++e)if(0!==this._dynamicCounts[e]){m.uniforms.model=d.model,m.uniforms.clipBounds=d.clipBounds,m.uniforms.permutation=J[e],c.lineWidth(this.dynamicWidth[e]),m.uniforms.contourColor=this.dynamicColor[e],m.uniforms.contourTint=this.dynamicTint[e],m.uniforms.height=this.dynamicLevel[e],n.draw(c.LINES,this._dynamicCounts[e],this._dynamicOffsets[e]);for(var h=0;3>h;++h)this.contourProject[h][e]&&(m.uniforms.model=l.projections[h],m.uniforms.clipBounds=l.clipBounds[h],n.draw(c.LINES,this._dynamicCounts[e],this._dynamicOffsets[e]))}n.unbind()}}function i(a,b){var c=b.shape.slice(),d=a.shape.slice();t.assign(a.lo(1,1).hi(c[0],c[1]),b),t.assign(a.lo(1).hi(c[0],1),b.hi(c[0],1)),t.assign(a.lo(1,d[1]-1).hi(c[0],1),b.lo(0,c[1]-1).hi(c[0],1)),t.assign(a.lo(0,1).hi(1,c[1]),b.hi(1)),t.assign(a.lo(d[0]-1,1).hi(1,c[1]),b.lo(c[0]-1)),a.set(0,0,b.get(0,0)),a.set(0,d[1]-1,b.get(0,c[1]-1)),a.set(d[0]-1,0,b.get(c[0]-1,0)),a.set(d[0]-1,d[1]-1,b.get(c[0]-1,c[1]-1))}function j(a,b){return Array.isArray(a)?[b(a[0]),b(a[1]),b(a[2])]:[b(a),b(a),b(a)]}function k(a){return Array.isArray(a)?3===a.length?[a[0],a[1],a[2],1]:[a[0],a[1],a[2],a[3]]:[0,0,0,1]}function l(a){if(Array.isArray(a)){if(Array.isArray(a))return[k(a[0]),k(a[1]),k(a[2])];var b=k(a);return[b.slice(),b.slice(),b.slice()]}}function m(a){var b=a.gl,c=(a.field||a.coords&&a.coords[2]||v([],[0,0]),C(b)),d=E(b),e=D(b),g=F(b),h=o(b),i=p(b,[{buffer:h,size:4,stride:G,offset:0},{buffer:h,size:2,stride:G,offset:16},{buffer:h,size:3,stride:G,offset:24}]),j=o(b),k=p(b,[{buffer:j,size:4}]),l=o(b),m=p(b,[{buffer:l,size:2,type:b.FLOAT}]),n=q(b,1,K,b.RGBA,b.UNSIGNED_BYTE);n.minFilter=b.LINEAR,n.magFilter=b.LINEAR;var r=new f(b,[0,0],[[0,0,0],[0,0,0]],c,d,h,i,n,e,g,j,k,l,m),s={levels:[[],[],[]]};for(var t in a)s[t]=a[t];return s.colormap=s.colormap||"jet",r.update(s),r}b.exports=m;var n=a("bit-twiddle"),o=a("gl-buffer"),p=a("gl-vao"),q=a("gl-texture2d"),r=a("typedarray-pool"),s=a("colormap"),t=a("ndarray-ops"),u=a("ndarray-pack"),v=a("ndarray"),w=a("surface-nets"),x=a("gl-mat4/multiply"),y=a("gl-mat4/invert"),z=a("binary-search-bounds"),A=a("ndarray-gradient"),v=a("ndarray"),B=a("./lib/shaders"),C=B.createShader,D=B.createContourShader,E=B.createPickShader,F=B.createPickContourShader,G=36,H=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],I=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],J=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var a=0;3>a;++a){var b=J[a],c=(a+1)%3,d=(a+2)%3;b[c+0]=1,b[d+3]=1,b[a+6]=1}}();var K=265,L=f.prototype;L.isTransparent=function(){return this.opacity<1},L.isOpaque=function(){if(this.opacity>=1)return!0;for(var a=0;3>a;++a)if(this._contourCounts[a].length>0||this._dynamicCounts[a]>0)return!0;return!1},L.pickSlots=1,L.setPickBase=function(a){this.pickId=a};var M=[0,0,0],N={showSurface:!1,showContour:!1,projections:[H.slice(),H.slice(),H.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},O={model:H,view:H,projection:H,inverseModel:H.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1},P=H.slice(),Q=[1,0,0,0,1,0,0,0,1];L.draw=function(a){return h.call(this,a,!1)},L.drawTransparent=function(a){return h.call(this,a,!0)};var R={model:H,view:H,projection:H,inverseModel:H,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};L.drawPick=function(a){a=a||{};var b=this.gl;b.disable(b.CULL_FACE);var c=R;c.model=a.model||H,c.view=a.view||H,c.projection=a.projection||H,c.shape=this._field[2].shape,c.pickId=this.pickId/255,c.lowerBound=this.bounds[0],c.upperBound=this.bounds[1],c.permutation=Q;for(var d=0;2>d;++d)for(var e=c.clipBounds[d],f=0;3>f;++f)e[f]=Math.min(Math.max(this.clipBounds[d][f],-1e8),1e8);var h=g(c,this);if(h.showSurface){this._pickShader.bind(),this._pickShader.uniforms=c,this._vao.bind(),this._vao.draw(b.TRIANGLES,this._vertexCount);for(var d=0;3>d;++d)this.surfaceProject[d]&&(this._pickShader.uniforms.model=h.projections[d],this._pickShader.uniforms.clipBounds=h.clipBounds[d],this._vao.draw(b.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour){var i=this._contourPickShader;i.bind(),i.uniforms=c;var j=this._contourVAO;j.bind();for(var f=0;3>f;++f){b.lineWidth(this.contourWidth[f]),i.uniforms.permutation=J[f];for(var d=0;d<this.contourLevels[f].length;++d)i.uniforms.height=this.contourLevels[f][d],j.draw(b.LINES,this._contourCounts[f][d],this._contourOffsets[f][d])}for(var d=0;3>d;++d){i.uniforms.model=h.projections[d],i.uniforms.clipBounds=h.clipBounds[d];for(var f=0;3>f;++f)if(this.contourProject[d][f]){i.uniforms.permutation=J[f],b.lineWidth(this.contourWidth[f]);for(var k=0;k<this.contourLevels[f].length;++k)i.uniforms.height=this.contourLevels[f][k],j.draw(b.LINES,this._contourCounts[f][k],this._contourOffsets[f][k])}}j.unbind()}},L.pick=function(a){if(!a)return null;if(a.id!==this.pickId)return null;var b=this._field[2].shape,c=this._pickResult,d=b[0]*(a.value[0]+(a.value[2]>>4)/16)/255,e=Math.floor(d),f=d-e,g=b[1]*(a.value[1]+(15&a.value[2])/16)/255,h=Math.floor(g),i=g-h;e+=1,h+=1;var j=c.position;j[0]=j[1]=j[2]=0;for(var k=0;2>k;++k)for(var l=k?f:1-f,m=0;2>m;++m)for(var n=m?i:1-i,o=e+k,p=h+m,q=l*n,r=0;3>r;++r)j[r]+=this._field[r].get(o,p)*q;for(var s=this._pickResult.level,t=0;3>t;++t)if(s[t]=z.le(this.contourLevels[t],j[t]),s[t]<0)this.contourLevels[t].length>0&&(s[t]=0);else if(s[t]<this.contourLevels[t].length-1){var u=this.contourLevels[t][s[t]],v=this.contourLevels[t][s[t]+1];Math.abs(u-j[t])>Math.abs(v-j[t])&&(s[t]+=1)}c.index[0]=.5>f?e:e+1,c.index[1]=.5>i?h:h+1,c.uv[0]=d/b[0],c.uv[1]=g/b[1];for(var r=0;3>r;++r)c.dataCoordinate[r]=this._field[r].get(c.index[0],c.index[1]);return c},L.update=function(a){a=a||{},this.dirty=!0,"contourWidth"in a&&(this.contourWidth=j(a.contourWidth,Number)),"showContour"in a&&(this.showContour=j(a.showContour,Boolean)),"showSurface"in a&&(this.showSurface=!!a.showSurface),"contourTint"in a&&(this.contourTint=j(a.contourTint,Boolean)),"contourColor"in a&&(this.contourColor=l(a.contourColor)),"contourProject"in a&&(this.contourProject=j(a.contourProject,function(a){return j(a,Boolean)})),"surfaceProject"in a&&(this.surfaceProject=a.surfaceProject),"dynamicColor"in a&&(this.dynamicColor=l(a.dynamicColor)),"dynamicTint"in a&&(this.dynamicTint=j(a.dynamicTint,Number)),"dynamicWidth"in a&&(this.dynamicWidth=j(a.dynamicWidth,Number)),"opacity"in a&&(this.opacity=a.opacity),"colorBounds"in a&&(this.colorBounds=a.colorBounds);var b=a.field||a.coords&&a.coords[2]||null;if(b||(b=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in a||"coords"in a){var c=(b.shape[0]+2)*(b.shape[1]+2);c>this._field[2].data.length&&(r.freeFloat(this._field[2].data),this._field[2].data=r.mallocFloat(n.nextPow2(c))),this._field[2]=v(this._field[2].data,[b.shape[0]+2,b.shape[1]+2]),i(this._field[2],b),this.shape=b.shape.slice();for(var d=this.shape,f=0;2>f;++f)this._field[2].size>this._field[f].data.length&&(r.freeFloat(this._field[f].data),this._field[f].data=r.mallocFloat(this._field[2].size)),this._field[f]=v(this._field[f].data,[d[0]+2,d[1]+2]);if(a.coords){var g=a.coords;if(!Array.isArray(g)||3!==g.length)throw new Error("gl-surface: invalid coordinates for x/y");for(var f=0;2>f;++f){for(var h=g[f],k=0;2>k;++k)if(h.shape[k]!==d[k])throw new Error("gl-surface: coords have incorrect shape");i(this._field[f],h)}}else if(a.ticks){var m=a.ticks;if(!Array.isArray(m)||2!==m.length)throw new Error("gl-surface: invalid ticks");for(var f=0;2>f;++f){var o=m[f];if((Array.isArray(o)||o.length)&&(o=v(o)),o.shape[0]!==d[f])throw new Error("gl-surface: invalid tick length");var p=v(o.data,d);p.stride[f]=o.stride[0],p.stride[1^f]=0,i(this._field[f],p)}}else{for(var f=0;2>f;++f){var q=[0,0];q[f]=1,this._field[f]=v(this._field[f].data,[d[0]+2,d[1]+2],q,0)}this._field[0].set(0,0,0);for(var k=0;k<d[0];++k)this._field[0].set(k+1,0,k);this._field[0].set(d[0]+1,0,d[0]-1),this._field[1].set(0,0,0);for(var k=0;k<d[1];++k)this._field[1].set(0,k+1,k);this._field[1].set(0,d[1]+1,d[1]-1)}for(var s=this._field,t=(s[2].size,v(r.mallocFloat(3*s[2].size*2),[3,d[0]+2,d[1]+2,2])),f=0;3>f;++f)A(t.pick(f),s[f],"mirror");for(var u=v(r.mallocFloat(3*s[2].size),[d[0]+2,d[1]+2,3]),f=0;f<d[0]+2;++f)for(var k=0;k<d[1]+2;++k){var x=t.get(0,f,k,0),y=t.get(0,f,k,1),z=t.get(1,f,k,0),B=t.get(1,f,k,1),C=t.get(2,f,k,0),D=t.get(2,f,k,1),E=z*D-B*C,F=C*y-D*x,G=x*B-y*z,H=Math.sqrt(E*E+F*F+G*G);1e-8>H?(H=Math.max(Math.abs(E),Math.abs(F),Math.abs(G)),1e-8>H?(G=1,F=E=0,H=1):H=1/H):H=1/Math.sqrt(H),u.set(f,k,0,E*H),u.set(f,k,1,F*H),u.set(f,k,2,G*H)}r.free(t.data);for(var J=[1/0,1/0,1/0],K=[-(1/0),-(1/0),-(1/0)],L=(d[0]-1)*(d[1]-1)*6,M=r.mallocFloat(n.nextPow2(9*L)),N=0,O=0,f=0;f<d[0]-1;++f)a:for(var k=0;k<d[1]-1;++k){for(var P=0;2>P;++P)for(var Q=0;2>Q;++Q)for(var R=0;3>R;++R){var S=this._field[R].get(1+f+P,1+k+Q);if(isNaN(S)||!isFinite(S))continue a}for(var R=0;6>R;++R){var T=f+I[R][0],U=k+I[R][1],V=this._field[0].get(T+1,U+1),W=this._field[1].get(T+1,U+1),S=this._field[2].get(T+1,U+1),E=u.get(T+1,U+1,0),F=u.get(T+1,U+1,1),G=u.get(T+1,U+1,2);M[N++]=T,M[N++]=U,M[N++]=V,M[N++]=W,M[N++]=S,M[N++]=0,M[N++]=E,M[N++]=F,M[N++]=G,J[0]=Math.min(J[0],V),J[1]=Math.min(J[1],W),J[2]=Math.min(J[2],S),K[0]=Math.max(K[0],V),K[1]=Math.max(K[1],W),K[2]=Math.max(K[2],S),O+=1}}this._vertexCount=O,this._coordinateBuffer.update(M.subarray(0,N)),r.freeFloat(M),r.free(u.data),this.bounds=[J,K]}var X=!1;if("levels"in a){var Y=a.levels;Y=Array.isArray(Y[0])?Y.slice():[[],[],Y];for(var f=0;3>f;++f)Y[f]=Y[f].slice(),Y.sort(function(a,b){return a-b});a:for(var f=0;3>f;++f){if(Y[f].length!==this.contourLevels[f].length){X=!0;break}for(var k=0;k<Y[f].length;++k)if(Y[f][k]!==this.contourLevels[f][k]){X=!0;break a}}this.contourLevels=Y}if(X){for(var s=this._field,d=this.shape,Z=[],$=0;3>$;++$){for(var Y=this.contourLevels[$],_=[],aa=[],ba=[0,0],f=0;f<Y.length;++f){var ca=w(this._field[$],Y[f]);_.push(Z.length/4|0);var O=0;a:for(var k=0;k<ca.cells.length;++k)for(var da=ca.cells[k],R=0;2>R;++R){var ea=ca.positions[da[R]],fa=ea[0],ga=0|Math.floor(fa),ha=fa-ga,ia=ea[1],ja=0|Math.floor(ia),ka=ia-ja,la=!1;b:for(var ma=0;2>ma;++ma){ba[ma]=0;for(var na=($+ma+1)%3,P=0;2>P;++P)for(var oa=P?ha:1-ha,T=0|Math.min(Math.max(ga+P,0),d[0]),Q=0;2>Q;++Q){var pa=Q?ka:1-ka,U=0|Math.min(Math.max(ja+Q,0),d[1]),S=this._field[na].get(T,U);if(!isFinite(S)||isNaN(S)){la=!0;break b}var qa=oa*pa;ba[ma]+=qa*S}}if(la){if(R>0){for(var ra=0;4>ra;++ra)Z.pop();O-=1}continue a}Z.push(ba[0],ba[1],ea[0],ea[1]),O+=1}aa.push(O)}this._contourOffsets[$]=_,this._contourCounts[$]=aa}for(var sa=r.mallocFloat(Z.length),f=0;f<Z.length;++f)sa[f]=Z[f];this._contourBuffer.update(sa),r.freeFloat(sa)}a.colormap&&this._colorMap.setPixels(e(a.colormap))},L.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var a=0;3>a;++a)r.freeFloat(this._field[a].data)},L.highlight=function(a){if(!a)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(var b=0;3>b;++b)this.enableHighlight[b]?this.highlightLevel[b]=a.level[b]:this.highlightLevel[b]=-1;var c;if(c=this.snapToData?a.dataCoordinate:a.position,this.enableDynamic[0]&&c[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&c[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&c[2]!==this.dynamicLevel[2]){for(var d=0,e=this.shape,f=r.mallocFloat(12*e[0]*e[1]),g=0;3>g;++g)if(this.enableDynamic[g]){this.dynamicLevel[g]=c[g];var h=(g+1)%3,i=(g+2)%3,j=this._field[g],k=this._field[h],l=this._field[i],m=w(j,c[g]),n=m.cells,o=m.positions;this._dynamicOffsets[g]=d;for(var b=0;b<n.length;++b)for(var p=n[b],q=0;2>q;++q){var s=o[p[q]],t=+s[0],u=0|t,v=0|Math.min(u+1,e[0]),x=t-u,y=1-x,z=+s[1],A=0|z,B=0|Math.min(A+1,e[1]),C=z-A,D=1-C,E=y*D,F=y*C,G=x*D,H=x*C,I=E*k.get(u,A)+F*k.get(u,B)+G*k.get(v,A)+H*k.get(v,B),J=E*l.get(u,A)+F*l.get(u,B)+G*l.get(v,A)+H*l.get(v,B);if(isNaN(I)||isNaN(J)){q&&(d-=1);break}f[2*d+0]=I,f[2*d+1]=J,d+=1}this._dynamicCounts[g]=d-this._dynamicOffsets[g]}else this.dynamicLevel[g]=NaN,this._dynamicCounts[g]=0;this._dynamicBuffer.update(f.subarray(0,2*d)),r.freeFloat(f)}}},{"./lib/shaders":179,"binary-search-bounds":180,"bit-twiddle":49,colormap:57,"gl-buffer":75,"gl-mat4/invert":94,"gl-mat4/multiply":96,"gl-texture2d":185,"gl-vao":189,ndarray:208,"ndarray-gradient":181,"ndarray-ops":207,"ndarray-pack":182,"surface-nets":227,"typedarray-pool":233}],185:[function(a,b,c){"use strict";function d(a){q=[a.LINEAR,a.NEAREST_MIPMAP_LINEAR,a.LINEAR_MIPMAP_NEAREST,a.LINEAR_MIPMAP_NEAREST],r=[a.NEAREST,a.LINEAR,a.NEAREST_MIPMAP_NEAREST,a.NEAREST_MIPMAP_LINEAR,a.LINEAR_MIPMAP_NEAREST,a.LINEAR_MIPMAP_LINEAR],s=[a.REPEAT,a.CLAMP_TO_EDGE,a.MIRRORED_REPEAT]}function e(a,b,c){var d=a.gl,e=d.getParameter(d.MAX_TEXTURE_SIZE);if(0>b||b>e||0>c||c>e)throw new Error("gl-texture2d: Invalid texture size");return a._shape=[b,c],a.bind(),d.texImage2D(d.TEXTURE_2D,0,a.format,b,c,0,a.format,a.type,null),a._mipLevels=[0],a}function f(a,b,c,d,e,f){this.gl=a,this.handle=b,this.format=e,this.type=f,this._shape=[c,d],this._mipLevels=[0],this._magFilter=a.NEAREST,this._minFilter=a.NEAREST,this._wrapS=a.CLAMP_TO_EDGE,this._wrapT=a.CLAMP_TO_EDGE,this._anisoSamples=1;var g=this,h=[this._wrapS,this._wrapT];Object.defineProperties(h,[{get:function(){return g._wrapS},set:function(a){return g.wrapS=a}},{get:function(){return g._wrapT},set:function(a){return g.wrapT=a}}]),this._wrapVector=h;var i=[this._shape[0],this._shape[1]];Object.defineProperties(i,[{get:function(){return g._shape[0]},set:function(a){return g.width=a}},{get:function(){return g._shape[1]},set:function(a){return g.height=a}}]),this._shapeVector=i}function g(a,b){return 3===a.length?1===b[2]&&b[1]===a[0]*a[2]&&b[0]===a[2]:1===b[0]&&b[1]===a[0]}function h(a,b,c,d,e,f,h,i){var j=i.dtype,k=i.shape.slice();if(k.length<2||k.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var l=0,m=0,q=g(k,i.stride.slice());"float32"===j?l=a.FLOAT:"float64"===j?(l=a.FLOAT,q=!1,j="float32"):"uint8"===j?l=a.UNSIGNED_BYTE:(l=a.UNSIGNED_BYTE,q=!1,j="uint8");var r=1;if(2===k.length)m=a.LUMINANCE,k=[k[0],k[1],1],i=n(i.data,k,[i.stride[0],i.stride[1],1],i.offset);else{if(3!==k.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===k[2])m=a.ALPHA;else if(2===k[2])m=a.LUMINANCE_ALPHA;else if(3===k[2])m=a.RGB;else{if(4!==k[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");m=a.RGBA}r=k[2]}if(m!==a.LUMINANCE&&m!==a.ALPHA||e!==a.LUMINANCE&&e!==a.ALPHA||(m=e),m!==e)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var s=i.size,u=h.indexOf(d)<0;if(u&&h.push(d),l===f&&q)0===i.offset&&i.data.length===s?u?a.texImage2D(a.TEXTURE_2D,d,e,k[0],k[1],0,e,f,i.data):a.texSubImage2D(a.TEXTURE_2D,d,b,c,k[0],k[1],e,f,i.data):u?a.texImage2D(a.TEXTURE_2D,d,e,k[0],k[1],0,e,f,i.data.subarray(i.offset,i.offset+s)):a.texSubImage2D(a.TEXTURE_2D,d,b,c,k[0],k[1],e,f,i.data.subarray(i.offset,i.offset+s));else{var v;v=f===a.FLOAT?p.mallocFloat32(s):p.mallocUint8(s);var w=n(v,k,[k[2],k[2]*k[0],1]);l===a.FLOAT&&f===a.UNSIGNED_BYTE?t(w,i):o.assign(w,i),u?a.texImage2D(a.TEXTURE_2D,d,e,k[0],k[1],0,e,f,v.subarray(0,s)):a.texSubImage2D(a.TEXTURE_2D,d,b,c,k[0],k[1],e,f,v.subarray(0,s)),f===a.FLOAT?p.freeFloat32(v):p.freeUint8(v)}}function i(a){var b=a.createTexture();return a.bindTexture(a.TEXTURE_2D,b),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),b}function j(a,b,c,d,e){var g=a.getParameter(a.MAX_TEXTURE_SIZE);if(0>b||b>g||0>c||c>g)throw new Error("gl-texture2d: Invalid texture shape");if(e===a.FLOAT&&!a.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var h=i(a);return a.texImage2D(a.TEXTURE_2D,0,d,b,c,0,d,e,null),new f(a,h,b,c,d,e)}function k(a,b,c,d){var e=i(a);return a.texImage2D(a.TEXTURE_2D,0,c,c,d,b),new f(a,e,0|b.width,0|b.height,c,d)}function l(a,b){var c=b.dtype,d=b.shape.slice(),e=a.getParameter(a.MAX_TEXTURE_SIZE);if(d[0]<0||d[0]>e||d[1]<0||d[1]>e)throw new Error("gl-texture2d: Invalid texture size");var h=g(d,b.stride.slice()),j=0;"float32"===c?j=a.FLOAT:"float64"===c?(j=a.FLOAT,h=!1,c="float32"):"uint8"===c?j=a.UNSIGNED_BYTE:(j=a.UNSIGNED_BYTE,h=!1,c="uint8");var k=0;if(2===d.length)k=a.LUMINANCE,d=[d[0],d[1],1],b=n(b.data,d,[b.stride[0],b.stride[1],1],b.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])k=a.ALPHA;else if(2===d[2])k=a.LUMINANCE_ALPHA;else if(3===d[2])k=a.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");k=a.RGBA}}j!==a.FLOAT||a.getExtension("OES_texture_float")||(j=a.UNSIGNED_BYTE,h=!1);var l,m,q=b.size;if(h)l=0===b.offset&&b.data.length===q?b.data:b.data.subarray(b.offset,b.offset+q);else{var r=[d[2],d[2]*d[0],1];m=p.malloc(q,c);var s=n(m,d,r,0);"float32"!==c&&"float64"!==c||j!==a.UNSIGNED_BYTE?o.assign(s,b):t(s,b),l=m.subarray(0,q)}var u=i(a);return a.texImage2D(a.TEXTURE_2D,0,k,d[0],d[1],0,k,j,l),h||p.free(m),new f(a,u,d[0],d[1],k,j)}function m(a){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(q||d(a),"number"==typeof arguments[1])return j(a,arguments[1],arguments[2],arguments[3]||a.RGBA,arguments[4]||a.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return j(a,0|arguments[1][0],0|arguments[1][1],arguments[2]||a.RGBA,arguments[3]||a.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var b=arguments[1];if(b instanceof HTMLCanvasElement||b instanceof HTMLImageElement||b instanceof HTMLVideoElement||b instanceof ImageData)return k(a,b,arguments[2]||a.RGBA,arguments[3]||a.UNSIGNED_BYTE);if(b.shape&&b.data&&b.stride)return l(a,b)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var n=a("ndarray"),o=a("ndarray-ops"),p=a("typedarray-pool");b.exports=m;var q=null,r=null,s=null,t=function(a,b){o.muls(a,b,255)},u=f.prototype;Object.defineProperties(u,{minFilter:{get:function(){return this._minFilter},set:function(a){this.bind();var b=this.gl;if(this.type===b.FLOAT&&q.indexOf(a)>=0&&(b.getExtension("OES_texture_float_linear")||(a=b.NEAREST)),r.indexOf(a)<0)throw new Error("gl-texture2d: Unknown filter mode "+a);return b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,a),this._minFilter=a}},magFilter:{get:function(){return this._magFilter},set:function(a){this.bind();var b=this.gl;if(this.type===b.FLOAT&&q.indexOf(a)>=0&&(b.getExtension("OES_texture_float_linear")||(a=b.NEAREST)),r.indexOf(a)<0)throw new Error("gl-texture2d: Unknown filter mode "+a);return b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a),this._magFilter=a}},mipSamples:{get:function(){return this._anisoSamples},set:function(a){var b=this._anisoSamples;if(this._anisoSamples=0|Math.max(a,1),b!==this._anisoSamples){var c=gl.getExtension("EXT_texture_filter_anisotropic");c&&this.gl.texParameterf(this.gl.TEXTURE_2D,c.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(a){if(this.bind(),s.indexOf(a)<0)throw new Error("gl-texture2d: Unknown wrap mode "+a);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,a),this._wrapS=a}},wrapT:{get:function(){return this._wrapT},set:function(a){if(this.bind(),s.indexOf(a)<0)throw new Error("gl-texture2d: Unknown wrap mode "+a);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,a),this._wrapT=a}},wrap:{get:function(){return this._wrapVector},set:function(a){if(Array.isArray(a)||(a=[a,a]),2!==a.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var b=0;2>b;++b)if(s.indexOf(a[b])<0)throw new Error("gl-texture2d: Unknown wrap mode "+a);this._wrapS=a[0],this._wrapT=a[1];var c=this.gl;return this.bind(),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,this._wrapS),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,this._wrapT),a}},shape:{get:function(){return this._shapeVector},set:function(a){if(Array.isArray(a)){if(2!==a.length)throw new Error("gl-texture2d: Invalid texture shape")}else a=[0|a,0|a];return e(this,0|a[0],0|a[1]),[0|a[0],0|a[1]]}},width:{get:function(){return this._shape[0]},set:function(a){return a=0|a,e(this,a,this._shape[1]),a}},height:{get:function(){return this._shape[1]},set:function(a){return a=0|a,e(this,this._shape[0],a),a}}}),u.bind=function(a){var b=this.gl;return void 0!==a&&b.activeTexture(b.TEXTURE0+(0|a)),b.bindTexture(b.TEXTURE_2D,this.handle),void 0!==a?0|a:b.getParameter(b.ACTIVE_TEXTURE)-b.TEXTURE0},u.dispose=function(){this.gl.deleteTexture(this.handle)},u.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var a=Math.min(this._shape[0],this._shape[1]),b=0;a>0;++b,a>>>=1)this._mipLevels.indexOf(b)<0&&this._mipLevels.push(b)},u.setPixels=function(a,b,c,d){var e=this.gl;if(this.bind(),Array.isArray(b)?(d=c,c=0|b[1],b=0|b[0]):(b=b||0,c=c||0),d=d||0,a instanceof HTMLCanvasElement||a instanceof ImageData||a instanceof HTMLImageElement||a instanceof HTMLVideoElement){var f=this._mipLevels.indexOf(d)<0;f?(e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,a),this._mipLevels.push(d)):e.texSubImage2D(e.TEXTURE_2D,d,b,c,this.format,this.type,a)}else{if(!(a.shape&&a.stride&&a.data))throw new Error("gl-texture2d: Unsupported data type");if(a.shape.length<2||b+a.shape[1]>this._shape[1]>>>d||c+a.shape[0]>this._shape[0]>>>d||0>b||0>c)throw new Error("gl-texture2d: Texture dimensions are out of bounds");h(e,b,c,d,this.format,this.type,this._mipLevels,a)}}},{ndarray:208,"ndarray-ops":207,"typedarray-pool":233}],186:[function(a,b,c){"use strict";function d(a,b,c){b?b.bind():a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,null);var d=0|a.getParameter(a.MAX_VERTEX_ATTRIBS);if(c){if(c.length>d)throw new Error("gl-vao: Too many vertex attributes");for(var e=0;e<c.length;++e){var f=c[e];if(f.buffer){var g=f.buffer,h=f.size||4,i=f.type||a.FLOAT,j=!!f.normalized,k=f.stride||0,l=f.offset||0;g.bind(),a.enableVertexAttribArray(e),a.vertexAttribPointer(e,h,i,j,k,l)}else{if("number"==typeof f)a.vertexAttrib1f(e,f);else if(1===f.length)a.vertexAttrib1f(e,f[0]);else if(2===f.length)a.vertexAttrib2f(e,f[0],f[1]);else if(3===f.length)a.vertexAttrib3f(e,f[0],f[1],f[2]);else{if(4!==f.length)throw new Error("gl-vao: Invalid vertex attribute");a.vertexAttrib4f(e,f[0],f[1],f[2],f[3])}a.disableVertexAttribArray(e)}}for(;d>e;++e)a.disableVertexAttribArray(e)}else{a.bindBuffer(a.ARRAY_BUFFER,null);for(var e=0;d>e;++e)a.disableVertexAttribArray(e)}}b.exports=d},{}],187:[function(a,b,c){"use strict";function d(a){this.gl=a,this._elements=null,this._attributes=null,this._elementsType=a.UNSIGNED_SHORT}function e(a){return new d(a)}var f=a("./do-bind.js");d.prototype.bind=function(){f(this.gl,this._elements,this._attributes)},d.prototype.update=function(a,b,c){this._elements=b,this._attributes=a,this._elementsType=c||this.gl.UNSIGNED_SHORT},d.prototype.dispose=function(){},d.prototype.unbind=function(){},d.prototype.draw=function(a,b,c){c=c||0;var d=this.gl;this._elements?d.drawElements(a,b,this._elementsType,c):d.drawArrays(a,c,b)},b.exports=e},{"./do-bind.js":186}],188:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this.location=a,this.dimension=b,this.a=c,this.b=d,this.c=e,this.d=f}function e(a,b,c){this.gl=a,this._ext=b,this.handle=c,this._attribs=[],this._useElements=!1,this._elementsType=a.UNSIGNED_SHORT}function f(a,b){return new e(a,b,b.createVertexArrayOES())}var g=a("./do-bind.js");d.prototype.bind=function(a){switch(this.dimension){case 1:a.vertexAttrib1f(this.location,this.a);break;case 2:a.vertexAttrib2f(this.location,this.a,this.b); 39 break;case 3:a.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:a.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},e.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var a=0;a<this._attribs.length;++a)this._attribs[a].bind(this.gl)},e.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},e.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},e.prototype.update=function(a,b,c){if(this.bind(),g(this.gl,b,a),this.unbind(),this._attribs.length=0,a)for(var e=0;e<a.length;++e){var f=a[e];"number"==typeof f?this._attribs.push(new d(e,1,f)):Array.isArray(f)&&this._attribs.push(new d(e,f.length,f[0],f[1],f[2],f[3]))}this._useElements=!!b,this._elementsType=c||this.gl.UNSIGNED_SHORT},e.prototype.draw=function(a,b,c){c=c||0;var d=this.gl;this._useElements?d.drawElements(a,b,this._elementsType,c):d.drawArrays(a,c,b)},b.exports=f},{"./do-bind.js":186}],189:[function(a,b,c){"use strict";function d(a,b,c,d){var g,h=a.getExtension("OES_vertex_array_object");return g=h?e(a,h):f(a),g.update(b,c,d),g}var e=a("./lib/vao-native.js"),f=a("./lib/vao-emulated.js");b.exports=d},{"./lib/vao-emulated.js":187,"./lib/vao-native.js":188}],190:[function(a,b,c){function d(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a}b.exports=d},{}],191:[function(a,b,c){"use strict";function d(a,b,c){this.vertices=a,this.adjacent=b,this.boundary=c,this.lastVisited=-1}function e(a,b,c){this.vertices=a,this.cell=b,this.index=c}function f(a,b){return k(a.vertices,b.vertices)}function g(a){for(var b=["function orient(){var tuple=this.tuple;return test("],c=0;a>=c;++c)c>0&&b.push(","),b.push("tuple[",c,"]");b.push(")}return orient");var d=new Function("test",b.join("")),e=j[a+1];return e||(e=j),d(e)}function h(a,b,c){this.dimension=a,this.vertices=b,this.simplices=c,this.interior=c.filter(function(a){return!a.boundary}),this.tuple=new Array(a+1);for(var d=0;a>=d;++d)this.tuple[d]=this.vertices[d];var e=l[a];e||(e=l[a]=g(a)),this.orient=e}function i(a,b){var c=a.length;if(0===c)throw new Error("Must have at least d+1 points");var e=a[0].length;if(e>=c)throw new Error("Must input at least d+1 points");var f=a.slice(0,e+1),g=j.apply(void 0,f);if(0===g)throw new Error("Input not in general position");for(var i=new Array(e+1),k=0;e>=k;++k)i[k]=k;0>g&&(i[0]=1,i[1]=0);for(var l=new d(i,new Array(e+1),!1),m=l.adjacent,n=new Array(e+2),k=0;e>=k;++k){for(var o=i.slice(),p=0;e>=p;++p)p===k&&(o[p]=-1);var q=o[0];o[0]=o[1],o[1]=q;var r=new d(o,new Array(e+1),!0);m[k]=r,n[k]=r}n[e+1]=l;for(var k=0;e>=k;++k)for(var o=m[k].vertices,s=m[k].adjacent,p=0;e>=p;++p){var t=o[p];if(0>t)s[p]=l;else for(var u=0;e>=u;++u)m[u].vertices.indexOf(t)<0&&(s[p]=m[u])}for(var v=new h(e,f,n),w=!!b,k=e+1;c>k;++k)v.insert(a[k],w);return v.boundary()}b.exports=i;var j=a("robust-orientation"),k=a("simplicial-complex").compareCells;d.prototype.flip=function(){var a=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=a;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};var l=[],m=h.prototype;m.handleBoundaryDegeneracy=function(a,b){var c=this.dimension,d=this.vertices.length-1,e=this.tuple,f=this.vertices,g=[a];for(a.lastVisited=-d;g.length>0;){a=g.pop();for(var h=(a.vertices,a.adjacent),i=0;c>=i;++i){var j=h[i];if(j.boundary&&!(j.lastVisited<=-d)){for(var k=j.vertices,l=0;c>=l;++l){var m=k[l];0>m?e[l]=b:e[l]=f[m]}var n=this.orient();if(n>0)return j;j.lastVisited=-d,0===n&&g.push(j)}}}return null},m.walk=function(a,b){var c=this.vertices.length-1,d=this.dimension,e=this.vertices,f=this.tuple,g=b?this.interior.length*Math.random()|0:this.interior.length-1,h=this.interior[g];a:for(;!h.boundary;){for(var i=h.vertices,j=h.adjacent,k=0;d>=k;++k)f[k]=e[i[k]];h.lastVisited=c;for(var k=0;d>=k;++k){var l=j[k];if(!(l.lastVisited>=c)){var m=f[k];f[k]=a;var n=this.orient();if(f[k]=m,0>n){h=l;continue a}l.boundary?l.lastVisited=-c:l.lastVisited=c}}return}return h},m.addPeaks=function(a,b){var c=this.vertices.length-1,g=this.dimension,h=this.vertices,i=this.tuple,j=this.interior,k=this.simplices,l=[b];b.lastVisited=c,b.vertices[b.vertices.indexOf(-1)]=c,b.boundary=!1,j.push(b);for(var m=[];l.length>0;){var b=l.pop(),n=b.vertices,o=b.adjacent,p=n.indexOf(c);if(!(0>p))for(var q=0;g>=q;++q)if(q!==p){var r=o[q];if(r.boundary&&!(r.lastVisited>=c)){var s=r.vertices;if(r.lastVisited!==-c){for(var t=0,u=0;g>=u;++u)s[u]<0?(t=u,i[u]=a):i[u]=h[s[u]];var v=this.orient();if(v>0){s[t]=c,r.boundary=!1,j.push(r),l.push(r),r.lastVisited=c;continue}r.lastVisited=-c}var w=r.adjacent,x=n.slice(),y=o.slice(),z=new d(x,y,!0);k.push(z);var A=w.indexOf(b);if(!(0>A)){w[A]=z,y[p]=r,x[q]=-1,y[q]=b,o[q]=z,z.flip();for(var u=0;g>=u;++u){var B=x[u];if(!(0>B||B===c)){for(var C=new Array(g-1),D=0,E=0;g>=E;++E){var F=x[E];0>F||E===u||(C[D++]=F)}m.push(new e(C,z,u))}}}}}}m.sort(f);for(var q=0;q+1<m.length;q+=2){var G=m[q],H=m[q+1],I=G.index,J=H.index;0>I||0>J||(G.cell.adjacent[G.index]=H.cell,H.cell.adjacent[H.index]=G.cell)}},m.insert=function(a,b){var c=this.vertices;c.push(a);var d=this.walk(a,b);if(d){for(var e=this.dimension,f=this.tuple,g=0;e>=g;++g){var h=d.vertices[g];0>h?f[g]=a:f[g]=c[h]}var i=this.orient(f);0>i||(0!==i||(d=this.handleBoundaryDegeneracy(d,a)))&&this.addPeaks(a,d)}},m.boundary=function(){for(var a=this.dimension,b=[],c=this.simplices,d=c.length,e=0;d>e;++e){var f=c[e];if(f.boundary){for(var g=new Array(a),h=f.vertices,i=0,j=0,k=0;a>=k;++k)h[k]>=0?g[i++]=h[k]:j=1&k;if(j===(1&a)){var l=g[0];g[0]=g[1],g[1]=l}b.push(g)}}return b}},{"robust-orientation":214,"simplicial-complex":194}],192:[function(a,b,c){arguments[4][49][0].apply(c,arguments)},{dup:49}],193:[function(a,b,c){"use strict";"use restrict";function d(a){this.roots=new Array(a),this.ranks=new Array(a);for(var b=0;a>b;++b)this.roots[b]=b,this.ranks[b]=0}b.exports=d;var e=d.prototype;Object.defineProperty(e,"length",{get:function(){return this.roots.length}}),e.makeSet=function(){var a=this.roots.length;return this.roots.push(a),this.ranks.push(0),a},e.find=function(a){for(var b=a,c=this.roots;c[a]!==a;)a=c[a];for(;c[b]!==a;){var d=c[b];c[b]=a,b=d}return a},e.link=function(a,b){var c=this.find(a),d=this.find(b);if(c!==d){var e=this.ranks,f=this.roots,g=e[c],h=e[d];h>g?f[c]=d:g>h?f[d]=c:(f[d]=c,++e[c])}}},{}],194:[function(a,b,c){"use strict";"use restrict";function d(a){for(var b=0,c=Math.max,d=0,e=a.length;e>d;++d)b=c(b,a[d].length);return b-1}function e(a){for(var b=-1,c=Math.max,d=0,e=a.length;e>d;++d)for(var f=a[d],g=0,h=f.length;h>g;++g)b=c(b,f[g]);return b+1}function f(a){for(var b=new Array(a.length),c=0,d=a.length;d>c;++c)b[c]=a[c].slice(0);return b}function g(a,b){var c=a.length,d=a.length-b.length,e=Math.min;if(d)return d;switch(c){case 0:return 0;case 1:return a[0]-b[0];case 2:var f=a[0]+a[1]-b[0]-b[1];return f?f:e(a[0],a[1])-e(b[0],b[1]);case 3:var g=a[0]+a[1],h=b[0]+b[1];if(f=g+a[2]-(h+b[2]))return f;var i=e(a[0],a[1]),j=e(b[0],b[1]),f=e(i,a[2])-e(j,b[2]);return f?f:e(i+a[2],g)-e(j+b[2],h);default:var k=a.slice(0);k.sort();var l=b.slice(0);l.sort();for(var m=0;c>m;++m)if(d=k[m]-l[m])return d;return 0}}function h(a,b){return g(a[0],b[0])}function i(a,b){if(b){for(var c=a.length,d=new Array(c),e=0;c>e;++e)d[e]=[a[e],b[e]];d.sort(h);for(var e=0;c>e;++e)a[e]=d[e][0],b[e]=d[e][1];return a}return a.sort(g),a}function j(a){if(0===a.length)return[];for(var b=1,c=a.length,d=1;c>d;++d){var e=a[d];if(g(e,a[d-1])){if(d===b){b++;continue}a[b++]=e}}return a.length=b,a}function k(a,b){for(var c=0,d=a.length-1,e=-1;d>=c;){var f=c+d>>1,h=g(a[f],b);0>=h?(0===h&&(e=f),c=f+1):h>0&&(d=f-1)}return e}function l(a,b){for(var c=new Array(a.length),d=0,e=c.length;e>d;++d)c[d]=[];for(var f=[],d=0,h=b.length;h>d;++d)for(var i=b[d],j=i.length,l=1,m=1<<j;m>l;++l){f.length=t.popCount(l);for(var n=0,o=0;j>o;++o)l&1<<o&&(f[n++]=i[o]);var p=k(a,f);if(!(0>p))for(;;)if(c[p++].push(d),p>=a.length||0!==g(a[p],f))break}return c}function m(a,b){if(!b)return l(j(o(a,0)),a,0);for(var c=new Array(b),d=0;b>d;++d)c[d]=[];for(var d=0,e=a.length;e>d;++d)for(var f=a[d],g=0,h=f.length;h>g;++g)c[f[g]].push(d);return c}function n(a){for(var b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0|e.length,g=1,h=1<<f;h>g;++g){for(var j=[],k=0;f>k;++k)g>>>k&1&&j.push(e[k]);b.push(j)}return i(b)}function o(a,b){if(0>b)return[];for(var c=[],d=(1<<b+1)-1,e=0;e<a.length;++e)for(var f=a[e],g=d;g<1<<f.length;g=t.nextCombination(g)){for(var h=new Array(b+1),j=0,k=0;k<f.length;++k)g&1<<k&&(h[j++]=f[k]);c.push(h)}return i(c)}function p(a){for(var b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;++f){for(var h=new Array(e.length-1),j=0,k=0;g>j;++j)j!==f&&(h[k++]=e[j]);b.push(h)}return i(b)}function q(a,b){for(var c=new u(b),d=0;d<a.length;++d)for(var e=a[d],f=0;f<e.length;++f)for(var g=f+1;g<e.length;++g)c.link(e[f],e[g]);for(var h=[],i=c.ranks,d=0;d<i.length;++d)i[d]=-1;for(var d=0;d<a.length;++d){var j=c.find(a[d][0]);i[j]<0?(i[j]=h.length,h.push([a[d].slice(0)])):h[i[j]].push(a[d].slice(0))}return h}function r(a){for(var b=j(i(o(a,0))),c=new u(b.length),d=0;d<a.length;++d)for(var e=a[d],f=0;f<e.length;++f)for(var g=k(b,[e[f]]),h=f+1;h<e.length;++h)c.link(g,k(b,[e[h]]));for(var l=[],m=c.ranks,d=0;d<m.length;++d)m[d]=-1;for(var d=0;d<a.length;++d){var n=c.find(k(b,[a[d][0]]));m[n]<0?(m[n]=l.length,l.push([a[d].slice(0)])):l[m[n]].push(a[d].slice(0))}return l}function s(a,b){return b?q(a,b):r(a)}var t=a("bit-twiddle"),u=a("union-find");c.dimension=d,c.countVertices=e,c.cloneCells=f,c.compareCells=g,c.normalize=i,c.unique=j,c.findCell=k,c.incidence=l,c.dual=m,c.explode=n,c.skeleton=o,c.boundary=p,c.connectedComponents=s},{"bit-twiddle":192,"union-find":193}],195:[function(a,b,c){"use strict";function d(a){for(var b=new Array(a),c=0;a>c;++c)b[c]=c;return b}b.exports=d},{}],196:[function(a,b,c){"use strict";function d(a,b){function c(a){var b=!1;return"altKey"in a&&(b=b||a.altKey!==p.alt,p.alt=!!a.altKey),"shiftKey"in a&&(b=b||a.shiftKey!==p.shift,p.shift=!!a.shiftKey),"ctrlKey"in a&&(b=b||a.ctrlKey!==p.control,p.control=!!a.ctrlKey),"metaKey"in a&&(b=b||a.metaKey!==p.meta,p.meta=!!a.metaKey),b}function d(a,d){var f=e.x(d),g=e.y(d);"buttons"in d&&(a=0|d.buttons),(a!==m||f!==n||g!==o||c(d))&&(m=0|a,n=f||0,o=g||0,b(m,n,o,p))}function f(a){d(0,a)}function g(){(m||n||o||p.shift||p.alt||p.meta||p.control)&&(n=o=0,m=0,p.shift=p.alt=p.control=p.meta=!1,b(0,0,0,p))}function h(a){c(a)&&b(m,n,o,p)}function i(a){0===e.buttons(a)?d(0,a):d(m,a)}function j(a){d(m|e.buttons(a),a)}function k(a){d(m&~e.buttons(a),a)}function l(){q||(q=!0,a.addEventListener("mousemove",i),a.addEventListener("mousedown",j),a.addEventListener("mouseup",k),a.addEventListener("mouseleave",f),a.addEventListener("mouseenter",f),a.addEventListener("mouseout",f),a.addEventListener("mouseover",f),a.addEventListener("blur",g),a.addEventListener("keyup",h),a.addEventListener("keydown",h),a.addEventListener("keypress",h),a!==window&&(window.addEventListener("blur",g),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}b||(b=a,a=window);var m=0,n=0,o=0,p={shift:!1,alt:!1,control:!1,meta:!1},q=!1;l();var r={element:a};return Object.defineProperties(r,{enabled:{get:function(){return q},set:function(a){a&&l()},enumerable:!0},buttons:{get:function(){return m},enumerable:!0},x:{get:function(){return n},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return p},enumerable:!0}}),r}b.exports=d;var e=a("mouse-event")},{"mouse-event":197}],197:[function(a,b,c){"use strict";function d(a){if("object"==typeof a){if("buttons"in a)return a.buttons;if("which"in a){var b=a.which;if(2===b)return 4;if(3===b)return 2;if(b>0)return 1<<b-1}else if("button"in a){var b=a.button;if(1===b)return 4;if(2===b)return 2;if(b>=0)return 1<<b}}return 0}function e(a){return a.target||a.srcElement||window}function f(a){if("object"==typeof a){if("offsetX"in a)return a.offsetX;var b=e(a),c=b.getBoundingClientRect();return a.clientX-c.left}return 0}function g(a){if("object"==typeof a){if("offsetY"in a)return a.offsetY;var b=e(a),c=b.getBoundingClientRect();return a.clientY-c.top}return 0}c.buttons=d,c.element=e,c.x=f,c.y=g},{}],198:[function(a,b,c){b.exports=function(a,b){b||(b=[0,""]),a=String(a);var c=parseFloat(a,10);return b[0]=c,b[1]=a.match(/[\d.\-\+]*\s*(.*)/)[1]||"",b}},{}],199:[function(a,b,c){"use strict";function d(a,b){var c=g(getComputedStyle(a).getPropertyValue(b));return c[0]*f(c[1],a)}function e(a,b){var c=document.createElement("div");c.style["font-size"]="128"+a,b.appendChild(c);var e=d(c,"font-size")/128;return b.removeChild(c),e}function f(a,b){switch(b=b||document.body,a=(a||"px").trim().toLowerCase(),b!==window&&b!==document||(b=document.body),a){case"%":return b.clientHeight/100;case"ch":case"ex":return e(a,b);case"em":return d(b,"font-size");case"rem":return d(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return h;case"cm":return h/2.54;case"mm":return h/25.4;case"pt":return h/72;case"pc":return h/6}return 1}var g=a("parse-unit");b.exports=f;var h=96},{"parse-unit":198}],200:[function(a,b,c){"use strict";function d(a,b,c){"function"==typeof a&&(c=!!b,b=a,a=window);var d=e("ex",a);a.addEventListener("wheel",function(a){c&&a.preventDefault();var e=a.deltaX||0,f=a.deltaY||0,g=a.deltaZ||0,h=a.deltaMode,i=1;switch(h){case 1:i=d;break;case 2:i=window.innerHeight}return e*=i,f*=i,g*=i,e||f||g?b(e,f,g):void 0})}var e=a("to-px");b.exports=d},{"to-px":199}],201:[function(a,b,c){"use strict";var d=a("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});b.exports=function(a,b){return d(a,b),a}},{"cwise/lib/wrapper":69}],202:[function(a,b,c){"use strict";function d(a,b){switch(b.length){case 0:break;case 1:a[0]=1/b[0];break;case 4:e(a,b);break;case 9:f(a,b);break;case 16:g(a,b);break;default:throw new Error("currently supports matrices up to 4x4")}return a}b.exports=d;var e=a("gl-mat2/invert"),f=a("gl-mat3/invert"),g=a("gl-mat4/invert")},{"gl-mat2/invert":203,"gl-mat3/invert":87,"gl-mat4/invert":94}],203:[function(a,b,c){function d(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*f-e*d;return g?(g=1/g,a[0]=f*g,a[1]=-d*g,a[2]=-e*g,a[3]=c*g,a):null}b.exports=d},{}],204:[function(a,b,c){"use strict";function d(a,b){var c=Math.floor(b),d=b-c,e=c>=0&&c<a.shape[0],f=c+1>=0&&c+1<a.shape[0],g=e?+a.get(c):0,h=f?+a.get(c+1):0;return(1-d)*g+d*h}function e(a,b,c){var d=Math.floor(b),e=b-d,f=d>=0&&d<a.shape[0],g=d+1>=0&&d+1<a.shape[0],h=Math.floor(c),i=c-h,j=h>=0&&h<a.shape[1],k=h+1>=0&&h+1<a.shape[1],l=f&&j?a.get(d,h):0,m=f&&k?a.get(d,h+1):0,n=g&&j?a.get(d+1,h):0,o=g&&k?a.get(d+1,h+1):0;return(1-i)*((1-e)*l+e*n)+i*((1-e)*m+e*o)}function f(a,b,c,d){var e=Math.floor(b),f=b-e,g=e>=0&&e<a.shape[0],h=e+1>=0&&e+1<a.shape[0],i=Math.floor(c),j=c-i,k=i>=0&&i<a.shape[1],l=i+1>=0&&i+1<a.shape[1],m=Math.floor(d),n=d-m,o=m>=0&&m<a.shape[2],p=m+1>=0&&m+1<a.shape[2],q=g&&k&&o?a.get(e,i,m):0,r=g&&l&&o?a.get(e,i+1,m):0,s=h&&k&&o?a.get(e+1,i,m):0,t=h&&l&&o?a.get(e+1,i+1,m):0,u=g&&k&&p?a.get(e,i,m+1):0,v=g&&l&&p?a.get(e,i+1,m+1):0,w=h&&k&&p?a.get(e+1,i,m+1):0,x=h&&l&&p?a.get(e+1,i+1,m+1):0;return(1-n)*((1-j)*((1-f)*q+f*s)+j*((1-f)*r+f*t))+n*((1-j)*((1-f)*u+f*w)+j*((1-f)*v+f*x))}function g(a){var b,c,d=0|a.shape.length,e=new Array(d),f=new Array(d),g=new Array(d),h=new Array(d);for(b=0;d>b;++b)c=+arguments[b+1],e[b]=Math.floor(c),f[b]=c-e[b],g[b]=0<=e[b]&&e[b]<a.shape[b],h[b]=0<=e[b]+1&&e[b]+1<a.shape[b];var i,j,k,l=0;a:for(b=0;1<<d>b;++b){for(j=1,k=a.offset,i=0;d>i;++i)if(b&1<<i){if(!h[i])continue a;j*=f[i],k+=a.stride[i]*(e[i]+1)}else{if(!g[i])continue a;j*=1-f[i],k+=a.stride[i]*e[i]}l+=j*a.data[k]}return l}function h(a,b,c,h){switch(a.shape.length){case 0:return 0;case 1:return d(a,b);case 2:return e(a,b,c);case 3:return f(a,b,c,h);default:return g.apply(void 0,arguments)}}b.exports=h,b.exports.d1=d,b.exports.d2=e,b.exports.d3=f},{}],205:[function(a,b,c){"use strict";var d=a("ndarray-linear-interpolate"),e=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_6_arg4_)}",args:[{name:"_inline_6_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_6_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_7_arg2_(this_warped,_inline_7_arg0_),_inline_7_arg1_=_inline_7_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg3_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),f=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_(_inline_10_arg4_,this_warped[0])}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),g=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),h=a("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});b.exports=function(a,b,c){switch(b.shape.length){case 1:f(a,c,d.d1,b);break;case 2:g(a,c,d.d2,b);break;case 3:h(a,c,d.d3,b);break;default:e(a,c,d.bind(void 0,b),b.shape.length)}return a}},{"cwise/lib/wrapper":69,"ndarray-linear-interpolate":204}],206:[function(a,b,c){"use strict";function d(a,b,c){var d=b.dimension,g=f([],c);return e(a,b,function(a,b){for(var c=0;d>c;++c){a[c]=g[(d+1)*d+c];for(var e=0;d>e;++e)a[c]+=g[(d+1)*e+c]*b[e]}for(var f=g[(d+1)*(d+1)-1],e=0;d>e;++e)f+=g[(d+1)*e+d]*b[e];for(var h=1/f,c=0;d>c;++c)a[c]*=h;return a}),a}var e=a("ndarray-warp"),f=a("gl-matrix-invert");b.exports=d},{"gl-matrix-invert":202,"ndarray-warp":205}],207:[function(a,b,c){"use strict";function d(a){if(!a)return h;for(var b=0;b<a.args.length;++b){var c=a.args[b];0===b?a.args[b]={name:c,lvalue:!0,rvalue:!!a.rvalue,count:a.count||1}:a.args[b]={name:c,lvalue:!1,rvalue:!0,count:1}}return a.thisVars||(a.thisVars=[]),a.localVars||(a.localVars=[]),a}function e(a){return g({args:a.args,pre:d(a.pre),body:d(a.body),post:d(a.proc),funcName:a.funcName})}function f(a){for(var b=[],c=0;c<a.args.length;++c)b.push("a"+c);var d=new Function("P",["return function ",a.funcName,"_ndarrayops(",b.join(","),") {P(",b.join(","),");return a0}"].join(""));return d(e(a))}var g=a("cwise-compiler"),h={body:"",args:[],thisVars:[],localVars:[]},i={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var a in i){var b=i[a];c[a]=f({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+b+"c"},funcName:a}),c[a+"eq"]=f({args:["array","array"],body:{args:["a","b"],body:"a"+b+"=b"},rvalue:!0,funcName:a+"eq"}),c[a+"s"]=f({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+b+"s"},funcName:a+"s"}),c[a+"seq"]=f({args:["array","scalar"],body:{args:["a","s"],body:"a"+b+"=s"},rvalue:!0,funcName:a+"seq"})}}();var j={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var a in j){var b=j[a];c[a]=f({args:["array","array"],body:{args:["a","b"],body:"a="+b+"b"},funcName:a}),c[a+"eq"]=f({args:["array"],body:{args:["a"],body:"a="+b+"a"},rvalue:!0,count:2,funcName:a+"eq"})}}();var k={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var a in k){var b=k[a];c[a]=f({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+b+"c"},funcName:a}),c[a+"s"]=f({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+b+"s"},funcName:a+"s"}),c[a+"eq"]=f({args:["array","array"],body:{args:["a","b"],body:"a=a"+b+"b"},rvalue:!0,count:2,funcName:a+"eq"}),c[a+"seq"]=f({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+b+"s"},rvalue:!0,count:2,funcName:a+"seq"})}}();var l=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var a=0;a<l.length;++a){var b=l[a];c[b]=f({args:["array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:b}),c[b+"eq"]=f({args:["array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"eq"})}}();var m=["max","min","atan2","pow"];!function(){for(var a=0;a<m.length;++a){var b=m[a];c[b]=f({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:b}),c[b+"s"]=f({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:b+"s"}),c[b+"eq"]=f({args:["array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"eq"}),c[b+"seq"]=f({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"seq"})}}();var n=["atan2","pow"];!function(){for(var a=0;a<n.length;++a){var b=n[a];c[b+"op"]=f({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:b+"op"}),c[b+"ops"]=f({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:b+"ops"}),c[b+"opeq"]=f({args:["array","array"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"opeq"}),c[b+"opseq"]=f({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+b,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:b+"opseq"})}}(),c.any=g({args:["array"],pre:h,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),c.all=g({args:["array"],pre:h,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),c.sum=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),c.prod=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),c.norm2squared=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),c.norm2=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),c.norminf=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),c.norm1=g({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),c.sup=g({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),c.inf=g({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),c.argmin=g({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),c.argmax=g({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),c.random=f({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),c.assign=f({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),c.assigns=f({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),c.equals=g({args:["array","array"],pre:h,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":66}],208:[function(a,b,c){function d(a,b){return a[0]-b[0]}function e(){var a,b=this.stride,c=new Array(b.length);for(a=0;a<c.length;++a)c[a]=[Math.abs(b[a]),a];c.sort(d);var e=new Array(c.length);for(a=0;a<e.length;++a)e[a]=c[a][1];return e}function f(a,b){var c=["View",b,"d",a].join("");0>b&&(c="View_Nil"+a);var d="generic"===a;if(-1===b){var f="function "+c+"(a){this.data=a;};var proto="+c+".prototype;proto.dtype='"+a+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+c+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+c+"(a){return new "+c+"(a);}",g=new Function(f);return g()}if(0===b){var f="function "+c+"(a,d) {this.data = a;this.offset = d};var proto="+c+".prototype;proto.dtype='"+a+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+c+"_copy() {return new "+c+"(this.data,this.offset)};proto.pick=function "+c+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+c+"_get(){return "+(d?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+c+"_set(v){return "+(d?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+c+"(a,b,c,d){return new "+c+"(a,d)}",g=new Function("TrivialArray",f);return g(l[a][0])}var f=["'use strict'"],h=i(b),j=h.map(function(a){return"i"+a}),k="this.offset+"+h.map(function(a){return"this.stride["+a+"]*i"+a}).join("+"),m=h.map(function(a){return"b"+a}).join(","),n=h.map(function(a){return"c"+a}).join(",");f.push("function "+c+"(a,"+m+","+n+",d){this.data=a","this.shape=["+m+"]","this.stride=["+n+"]","this.offset=d|0}","var proto="+c+".prototype","proto.dtype='"+a+"'","proto.dimension="+b),f.push("Object.defineProperty(proto,'size',{get:function "+c+"_size(){return "+h.map(function(a){return"this.shape["+a+"]"}).join("*"),"}})"),1===b?f.push("proto.order=[0]"):(f.push("Object.defineProperty(proto,'order',{get:"),4>b?(f.push("function "+c+"_order(){"),2===b?f.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===b&&f.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):f.push("ORDER})")), 40 f.push("proto.set=function "+c+"_set("+j.join(",")+",v){"),d?f.push("return this.data.set("+k+",v)}"):f.push("return this.data["+k+"]=v}"),f.push("proto.get=function "+c+"_get("+j.join(",")+"){"),d?f.push("return this.data.get("+k+")}"):f.push("return this.data["+k+"]}"),f.push("proto.index=function "+c+"_index(",j.join(),"){return "+k+"}"),f.push("proto.hi=function "+c+"_hi("+j.join(",")+"){return new "+c+"(this.data,"+h.map(function(a){return["(typeof i",a,"!=='number'||i",a,"<0)?this.shape[",a,"]:i",a,"|0"].join("")}).join(",")+","+h.map(function(a){return"this.stride["+a+"]"}).join(",")+",this.offset)}");var o=h.map(function(a){return"a"+a+"=this.shape["+a+"]"}),p=h.map(function(a){return"c"+a+"=this.stride["+a+"]"});f.push("proto.lo=function "+c+"_lo("+j.join(",")+"){var b=this.offset,d=0,"+o.join(",")+","+p.join(","));for(var q=0;b>q;++q)f.push("if(typeof i"+q+"==='number'&&i"+q+">=0){d=i"+q+"|0;b+=c"+q+"*d;a"+q+"-=d}");f.push("return new "+c+"(this.data,"+h.map(function(a){return"a"+a}).join(",")+","+h.map(function(a){return"c"+a}).join(",")+",b)}"),f.push("proto.step=function "+c+"_step("+j.join(",")+"){var "+h.map(function(a){return"a"+a+"=this.shape["+a+"]"}).join(",")+","+h.map(function(a){return"b"+a+"=this.stride["+a+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var q=0;b>q;++q)f.push("if(typeof i"+q+"==='number'){d=i"+q+"|0;if(d<0){c+=b"+q+"*(a"+q+"-1);a"+q+"=ceil(-a"+q+"/d)}else{a"+q+"=ceil(a"+q+"/d)}b"+q+"*=d}");f.push("return new "+c+"(this.data,"+h.map(function(a){return"a"+a}).join(",")+","+h.map(function(a){return"b"+a}).join(",")+",c)}");for(var r=new Array(b),s=new Array(b),q=0;b>q;++q)r[q]="a[i"+q+"]",s[q]="b[i"+q+"]";f.push("proto.transpose=function "+c+"_transpose("+j+"){"+j.map(function(a,b){return a+"=("+a+"===undefined?"+b+":"+a+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+c+"(this.data,"+r.join(",")+","+s.join(",")+",this.offset)}"),f.push("proto.pick=function "+c+"_pick("+j+"){var a=[],b=[],c=this.offset");for(var q=0;b>q;++q)f.push("if(typeof i"+q+"==='number'&&i"+q+">=0){c=(c+this.stride["+q+"]*i"+q+")|0}else{a.push(this.shape["+q+"]);b.push(this.stride["+q+"])}");f.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),f.push("return function construct_"+c+"(data,shape,stride,offset){return new "+c+"(data,"+h.map(function(a){return"shape["+a+"]"}).join(",")+","+h.map(function(a){return"stride["+a+"]"}).join(",")+",offset)}");var g=new Function("CTOR_LIST","ORDER",f.join("\n"));return g(l[a],e)}function g(a){if(j(a))return"buffer";if(k)switch(Object.prototype.toString.call(a)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(a)?"array":"generic"}function h(a,b,c,d){if(void 0===a){var e=l.array[0];return e([])}"number"==typeof a&&(a=[a]),void 0===b&&(b=[a.length]);var h=b.length;if(void 0===c){c=new Array(h);for(var i=h-1,j=1;i>=0;--i)c[i]=j,j*=b[i]}if(void 0===d){d=0;for(var i=0;h>i;++i)c[i]<0&&(d-=(b[i]-1)*c[i])}for(var k=g(a),m=l[k];m.length<=h+1;)m.push(f(k,m.length-1));var e=m[h+1];return e(a,b,c,d)}var i=a("iota-array"),j=a("is-buffer"),k="undefined"!=typeof Float64Array,l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};b.exports=h},{"iota-array":195,"is-buffer":209}],209:[function(a,b,c){b.exports=function(a){return!(null==a||!(a._isBuffer||a.constructor&&"function"==typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)))}},{}],210:[function(a,b,c){(function(a){b.exports=a.performance&&a.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],211:[function(a,b,c){"use strict";function d(a){for(var b="robustLinearSolve"+a+"d",c=["function ",b,"(A,b){return ["],d=0;a>d;++d){c.push("det([");for(var e=0;a>e;++e){e>0&&c.push(","),c.push("[");for(var f=0;a>f;++f)f>0&&c.push(","),f===d?c.push("+b[",e,"]"):c.push("+A[",e,"][",f,"]");c.push("]")}c.push("]),")}c.push("det(A)]}return ",b);var g=new Function("det",c.join(""));return g(6>a?h[a]:h)}function e(){return[0]}function f(a,b){return[[b[0]],[a[0][0]]]}function g(){for(;j.length<i;)j.push(d(j.length));for(var a=[],c=["function dispatchLinearSolve(A,b){switch(A.length){"],e=0;i>e;++e)a.push("s"+e),c.push("case ",e,":return s",e,"(A,b);");c.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),a.push("CACHE","g",c.join(""));var f=Function.apply(void 0,a);b.exports=f.apply(void 0,j.concat([j,d]));for(var e=0;i>e;++e)b.exports[e]=j[e]}var h=a("robust-determinant"),i=6,j=[e,f];g()},{"robust-determinant":213}],212:[function(a,b,c){"use strict";function d(a){for(var b=a.length,c=a[a.length-1],d=b,e=b-2;e>=0;--e){var f=c,g=a[e];c=f+g;var h=c-f,i=g-h;i&&(a[--d]=c,c=i)}for(var j=0,e=d;b>e;++e){var f=a[e],g=c;c=f+g;var h=c-f,i=g-h;i&&(a[j++]=i)}return a[j++]=c,a.length=j,a}b.exports=d},{}],213:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m[",c,"][",d,"]"].join("")}return b}function f(a){return 1&a?"-":""}function g(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",g(a.slice(0,b)),",",g(a.slice(b)),")"].join("")}function h(a){if(2===a.length)return["sum(prod(",a[0][0],",",a[1][1],"),prod(-",a[0][1],",",a[1][0],"))"].join("");for(var b=[],c=0;c<a.length;++c)b.push(["scale(",h(d(a,c)),",",f(c),a[0][c],")"].join(""));return g(b)}function i(a){var b=new Function("sum","scale","prod","compress",["function robustDeterminant",a,"(m){return compress(",h(e(a)),")};return robustDeterminant",a].join(""));return b(l,m,k,n)}function j(){for(;p.length<o;)p.push(i(p.length));for(var a=[],c=["function robustDeterminant(m){switch(m.length){"],d=0;o>d;++d)a.push("det"+d),c.push("case ",d,":return det",d,"(m);");c.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),a.push("CACHE","gen",c.join(""));var e=Function.apply(void 0,a);b.exports=e.apply(void 0,p.concat([p,i]));for(var d=0;d<p.length;++d)b.exports[d]=p[d]}var k=a("two-product"),l=a("robust-sum"),m=a("robust-scale"),n=a("robust-compress"),o=6,p=[function(){return[0]},function(a){return[a[0][0]]}];j()},{"robust-compress":212,"robust-scale":215,"robust-sum":217,"two-product":231}],214:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m",d,"[",a-c-1,"]"].join("")}return b}function f(a){return 1&a?"-":""}function g(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",g(a.slice(0,b)),",",g(a.slice(b)),")"].join("")}function h(a){if(2===a.length)return[["sum(prod(",a[0][0],",",a[1][1],"),prod(-",a[0][1],",",a[1][0],"))"].join("")];for(var b=[],c=0;c<a.length;++c)b.push(["scale(",g(h(d(a,c))),",",f(c),a[0][c],")"].join(""));return b}function i(a){for(var b=[],c=[],f=e(a),i=[],j=0;a>j;++j)0===(1&j)?b.push.apply(b,h(d(f,j))):c.push.apply(c,h(d(f,j))),i.push("m"+j);var k=g(b),p=g(c),q="orientation"+a+"Exact",r=["function ",q,"(",i.join(),"){var p=",k,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",q].join(""),s=new Function("sum","prod","scale","sub",r);return s(m,l,n,o)}function j(a){var b=v[a.length];return b||(b=v[a.length]=i(a.length)),b.apply(void 0,a)}function k(){for(;v.length<=p;)v.push(i(v.length));for(var a=[],c=["slow"],d=0;p>=d;++d)a.push("a"+d),c.push("o"+d);for(var e=["function getOrientation(",a.join(),"){switch(arguments.length){case 0:case 1:return 0;"],d=2;p>=d;++d)e.push("case ",d,":return o",d,"(",a.slice(0,d).join(),");");e.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),c.push(e.join(""));var f=Function.apply(void 0,c);b.exports=f.apply(void 0,[j].concat(v));for(var d=0;p>=d;++d)b.exports[d]=v[d]}var l=a("two-product"),m=a("robust-sum"),n=a("robust-scale"),o=a("robust-subtract"),p=5,q=1.1102230246251565e-16,r=(3+16*q)*q,s=(7+56*q)*q,t=i(3),u=i(4),v=[function(){return 0},function(){return 0},function(a,b){return b[0]-a[0]},function(a,b,c){var d,e=(a[1]-c[1])*(b[0]-c[0]),f=(a[0]-c[0])*(b[1]-c[1]),g=e-f;if(e>0){if(0>=f)return g;d=e+f}else{if(!(0>e))return g;if(f>=0)return g;d=-(e+f)}var h=r*d;return g>=h||-h>=g?g:t(a,b,c)},function(a,b,c,d){var e=a[0]-d[0],f=b[0]-d[0],g=c[0]-d[0],h=a[1]-d[1],i=b[1]-d[1],j=c[1]-d[1],k=a[2]-d[2],l=b[2]-d[2],m=c[2]-d[2],n=f*j,o=g*i,p=g*h,q=e*j,r=e*i,t=f*h,v=k*(n-o)+l*(p-q)+m*(r-t),w=(Math.abs(n)+Math.abs(o))*Math.abs(k)+(Math.abs(p)+Math.abs(q))*Math.abs(l)+(Math.abs(r)+Math.abs(t))*Math.abs(m),x=s*w;return v>x||-v>x?v:u(a,b,c,d)}];k()},{"robust-scale":215,"robust-subtract":216,"robust-sum":217,"two-product":231}],215:[function(a,b,c){"use strict";function d(a,b){var c=a.length;if(1===c){var d=e(a[0],b);return d[0]?d:[d[1]]}var g=new Array(2*c),h=[.1,.1],i=[.1,.1],j=0;e(a[0],b,h),h[0]&&(g[j++]=h[0]);for(var k=1;c>k;++k){e(a[k],b,i);var l=h[1];f(l,i[0],h),h[0]&&(g[j++]=h[0]);var m=i[1],n=h[1],o=m+n,p=o-m,q=n-p;h[1]=o,q&&(g[j++]=q)}return h[1]&&(g[j++]=h[1]),0===j&&(g[j++]=0),g.length=j,g}var e=a("two-product"),f=a("two-sum");b.exports=d},{"two-product":231,"two-sum":232}],216:[function(a,b,c){"use strict";function d(a,b){var c=a+b,d=c-a,e=c-d,f=b-d,g=a-e,h=g+f;return h?[h,c]:[c]}function e(a,b){var c=0|a.length,e=0|b.length;if(1===c&&1===e)return d(a[0],-b[0]);var f,g,h=c+e,i=new Array(h),j=0,k=0,l=0,m=Math.abs,n=a[k],o=m(n),p=-b[l],q=m(p);q>o?(g=n,k+=1,c>k&&(n=a[k],o=m(n))):(g=p,l+=1,e>l&&(p=-b[l],q=m(p))),c>k&&q>o||l>=e?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=-b[l],q=m(p)));for(var r,s,t,u,v,w=f+g,x=w-f,y=g-x,z=y,A=w;c>k&&e>l;)q>o?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=-b[l],q=m(p))),g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r;for(;c>k;)f=n,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,k+=1,c>k&&(n=a[k]);for(;e>l;)f=p,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,l+=1,e>l&&(p=-b[l]);return z&&(i[j++]=z),A&&(i[j++]=A),j||(i[j++]=0),i.length=j,i}b.exports=e},{}],217:[function(a,b,c){"use strict";function d(a,b){var c=a+b,d=c-a,e=c-d,f=b-d,g=a-e,h=g+f;return h?[h,c]:[c]}function e(a,b){var c=0|a.length,e=0|b.length;if(1===c&&1===e)return d(a[0],b[0]);var f,g,h=c+e,i=new Array(h),j=0,k=0,l=0,m=Math.abs,n=a[k],o=m(n),p=b[l],q=m(p);q>o?(g=n,k+=1,c>k&&(n=a[k],o=m(n))):(g=p,l+=1,e>l&&(p=b[l],q=m(p))),c>k&&q>o||l>=e?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=b[l],q=m(p)));for(var r,s,t,u,v,w=f+g,x=w-f,y=g-x,z=y,A=w;c>k&&e>l;)q>o?(f=n,k+=1,c>k&&(n=a[k],o=m(n))):(f=p,l+=1,e>l&&(p=b[l],q=m(p))),g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r;for(;c>k;)f=n,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,k+=1,c>k&&(n=a[k]);for(;e>l;)f=p,g=z,w=f+g,x=w-f,y=g-x,y&&(i[j++]=y),r=A+w,s=r-A,t=r-s,u=w-s,v=A-t,z=v+u,A=r,l+=1,e>l&&(p=b[l]);return z&&(i[j++]=z),A&&(i[j++]=A),j||(i[j++]=0),i.length=j,i}b.exports=e},{}],218:[function(a,b,c){"use strict";function d(a){return a.split("").map(function(a){return a in e?e[a]:""}).join("")}b.exports=d;var e={" ":" ",0:"â°",1:"¹",2:"²",3:"³",4:"âŽ",5:"âµ",6:"â¶",7:"â·",8:"âž",9:"â¹","+":"âº","-":"â»",a:"áµ",b:"áµ",c:"á¶",d:"áµ",e:"áµ",f:"ᶠ",g:"áµ",h:"Ê°",i:"â±",j:"ʲ",k:"áµ",l:"Ë¡",m:"áµ",n:"â¿",o:"áµ",p:"áµ",r:"ʳ",s:"Ë¢",t:"áµ",u:"áµ",v:"áµ",w:"Ê·",x:"Ë£",y:"Êž",z:"ᶻ"}},{}],219:[function(a,b,c){"use strict";function d(a){return"a"+a}function e(a){return"d"+a}function f(a,b){return"c"+a+"_"+b}function g(a){return"s"+a}function h(a,b){return"t"+a+"_"+b}function i(a){return"o"+a}function j(a){return"x"+a}function k(a){return"p"+a}function l(a,b){return"d"+a+"_"+b}function m(a){return"i"+a}function n(a,b){return"u"+a+"_"+b}function o(a){return"b"+a}function p(a){return"y"+a}function q(a){return"e"+a}function r(a){return"v"+a}function s(a,b,c){for(var d=0,e=0;a>e;++e)b&1<<e&&(d|=1<<c[e]);return d}function t(a,b,c,t,u,C){function D(a,b){M.push("for(",m(u[a]),"=",b,";",m(u[a]),"<",g(u[a]),";","++",m(u[a]),"){")}function E(a){for(var b=0;J>b;++b)M.push(k(b),"+=",n(b,u[a]),";");M.push("}")}function F(a){for(var b=a-1;b>=0;--b)D(b,0);for(var c=[],b=0;J>b;++b)C[b]?c.push(e(b)+".get("+k(b)+")"):c.push(e(b)+"["+k(b)+"]");for(var b=0;t>b;++b)c.push(j(b));M.push(x,"[",A,"++]=phase(",c.join(),");");for(var b=0;a>b;++b)E(b);for(var d=0;J>d;++d)M.push(k(d),"+=",n(d,u[a]),";")}function G(a){for(var b=0;J>b;++b)C[b]?M.push(f(b,0),"=",e(b),".get(",k(b),");"):M.push(f(b,0),"=",e(b),"[",k(b),"];");for(var c=[],b=0;J>b;++b)c.push(f(b,0));for(var b=0;t>b;++b)c.push(j(b));M.push(o(0),"=",x,"[",A,"]=phase(",c.join(),");");for(var d=1;1<<K>d;++d)M.push(o(d),"=",x,"[",A,"+",q(d),"];");for(var g=[],d=1;1<<K>d;++d)g.push("("+o(0)+"!=="+o(d)+")");M.push("if(",g.join("||"),"){");for(var h=[],b=0;K>b;++b)h.push(m(b));for(var b=0;J>b;++b){h.push(f(b,0));for(var d=1;1<<K>d;++d)C[b]?M.push(f(b,d),"=",e(b),".get(",k(b),"+",l(b,d),");"):M.push(f(b,d),"=",e(b),"[",k(b),"+",l(b,d),"];"),h.push(f(b,d))}for(var b=0;1<<K>b;++b)h.push(o(b));for(var b=0;t>b;++b)h.push(j(b));M.push("vertex(",h.join(),");",r(0),"=",w,"[",A,"]=",y,"++;");for(var i=(1<<K)-1,n=o(i),d=0;K>d;++d)if(0===(a&~(1<<d))){for(var p=i^1<<d,s=o(p),u=[],v=p;v>0;v=v-1&p)u.push(w+"["+A+"+"+q(v)+"]");u.push(r(0));for(var v=0;J>v;++v)1&d?u.push(f(v,i),f(v,p)):u.push(f(v,p),f(v,i));1&d?u.push(n,s):u.push(s,n);for(var v=0;t>v;++v)u.push(j(v));M.push("if(",n,"!==",s,"){","face(",u.join(),")}")}M.push("}",A,"+=1;")}function H(){for(var a=1;1<<K>a;++a)M.push(B,"=",q(a),";",q(a),"=",p(a),";",p(a),"=",B,";")}function I(a,b){if(0>a)return void G(b);F(a),M.push("if(",g(u[a]),">0){",m(u[a]),"=1;"),I(a-1,b|1<<u[a]);for(var c=0;J>c;++c)M.push(k(c),"+=",n(c,u[a]),";");a===K-1&&(M.push(A,"=0;"),H()),D(a,2),I(a-1,b),a===K-1&&(M.push("if(",m(u[K-1]),"&1){",A,"=0;}"),H()),E(a),M.push("}")}var J=C.length,K=u.length;if(2>K)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var L="extractContour"+u.join("_"),M=[],N=[],O=[],P=0;J>P;++P)O.push(d(P));for(var P=0;t>P;++P)O.push(j(P));for(var P=0;K>P;++P)N.push(g(P)+"="+d(0)+".shape["+P+"]|0");for(var P=0;J>P;++P){N.push(e(P)+"="+d(P)+".data",i(P)+"="+d(P)+".offset|0");for(var Q=0;K>Q;++Q)N.push(h(P,Q)+"="+d(P)+".stride["+Q+"]|0")}for(var P=0;J>P;++P){N.push(k(P)+"="+i(P)),N.push(f(P,0));for(var Q=1;1<<K>Q;++Q){for(var R=[],S=0;K>S;++S)Q&1<<S&&R.push("-"+h(P,S));N.push(l(P,Q)+"=("+R.join("")+")|0"),N.push(f(P,Q)+"=0")}}for(var P=0;J>P;++P)for(var Q=0;K>Q;++Q){var T=[h(P,u[Q])];Q>0&&T.push(h(P,u[Q-1])+"*"+g(u[Q-1])),N.push(n(P,u[Q])+"=("+T.join("-")+")|0")}for(var P=0;K>P;++P)N.push(m(P)+"=0");N.push(y+"=0");for(var U=["2"],P=K-2;P>=0;--P)U.push(g(u[P]));N.push(z+"=("+U.join("*")+")|0",x+"=mallocUint32("+z+")",w+"=mallocUint32("+z+")",A+"=0"),N.push(o(0)+"=0");for(var Q=1;1<<K>Q;++Q){for(var V=[],W=[],S=0;K>S;++S)Q&1<<S&&(0===W.length?V.push("1"):V.unshift(W.join("*"))),W.push(g(u[S]));var X="";V[0].indexOf(g(u[K-2]))<0&&(X="-");var Y=s(K,Q,u);N.push(q(Y)+"=(-"+V.join("-")+")|0",p(Y)+"=("+X+V.join("-")+")|0",o(Y)+"=0")}N.push(r(0)+"=0",B+"=0"),I(K-1,0),M.push("freeUint32(",w,");freeUint32(",x,");");var Z=["'use strict';","function ",L,"(",O.join(),"){","var ",N.join(),";",M.join(""),"}","return ",L].join(""),$=new Function("vertex","face","phase","mallocUint32","freeUint32",Z);return $(a,b,c,v.mallocUint32,v.freeUint32)}function u(a){function b(a){throw new Error("ndarray-extract-contour: "+a)}"object"!=typeof a&&b("Must specify arguments");var c=a.order;Array.isArray(c)||b("Must specify order");var d=a.arrayArguments||1;1>d&&b("Must have at least one array argument");var e=a.scalarArguments||0;0>e&&b("Scalar arg count must be > 0"),"function"!=typeof a.vertex&&b("Must specify vertex creation function"),"function"!=typeof a.cell&&b("Must specify cell creation function"),"function"!=typeof a.phase&&b("Must specify phase function");for(var f=a.getters||[],g=new Array(d),h=0;d>h;++h)f.indexOf(h)>=0?g[h]=!0:g[h]=!1;return t(a.vertex,a.cell,a.phase,e,c,g)}var v=a("typedarray-pool");b.exports=u;var w="V",x="P",y="N",z="Q",A="X",B="T"},{"typedarray-pool":233}],220:[function(a,b,c){function d(a){if(0>a)return Number("0/0");for(var b=h[0],c=h.length-1;c>0;--c)b+=h[c]/(a+c);var d=a+g+.5;return.5*Math.log(2*Math.PI)+(a+.5)*Math.log(d)-d+Math.log(b)-Math.log(a)}var e=7,f=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],g=607/128,h=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];b.exports=function i(a){if(.5>a)return Math.PI/(Math.sin(Math.PI*a)*i(1-a));if(a>100)return Math.exp(d(a));a-=1;for(var b=f[0],c=1;e+2>c;c++)b+=f[c]/(a+c);var g=a+e+.5;return Math.sqrt(2*Math.PI)*Math.pow(g,a+.5)*Math.exp(-g)*b},b.exports.log=d},{}],221:[function(a,b,c){"use strict";function d(a){var b=a.length;if(e>b){for(var c=1,d=0;b>d;++d)for(var g=0;d>g;++g)if(a[d]<a[g])c=-c;else if(a[d]===a[g])return 0;return c}for(var h=f.mallocUint8(b),d=0;b>d;++d)h[d]=0;for(var c=1,d=0;b>d;++d)if(!h[d]){var i=1;h[d]=1;for(var g=a[d];g!==d;g=a[g]){if(h[g])return f.freeUint8(h),0;i+=1,h[g]=1}1&i||(c=-c)}return f.freeUint8(h),c}b.exports=d;var e=32,f=a("typedarray-pool")},{"typedarray-pool":233}],222:[function(a,b,c){"use strict";function d(a){var b=a.length;switch(b){case 0:case 1:return 0;case 2:return a[1]}var c,d,e,h=f.mallocUint32(b),i=f.mallocUint32(b),j=0;for(g(a,i),e=0;b>e;++e)h[e]=a[e];for(e=b-1;e>0;--e)d=i[e],c=h[e],h[e]=h[d],h[d]=c,i[e]=i[c],i[c]=d,j=(j+c)*e;return f.freeUint32(i),f.freeUint32(h),j}function e(a,b,c){switch(a){case 0:return c?c:[];case 1:return c?(c[0]=0,c):[0];case 2:return c?(b?(c[0]=0,c[1]=1):(c[0]=1,c[1]=0),c):b?[0,1]:[1,0]}c=c||new Array(a);var d,e,f,g=1;for(c[0]=0,f=1;a>f;++f)c[f]=f,g=g*f|0;for(f=a-1;f>0;--f)d=b/g|0,b=b-d*g|0,g=g/f|0,e=0|c[f],c[f]=0|c[d],c[d]=0|e;return c}var f=a("typedarray-pool"),g=a("invert-permutation");c.rank=d,c.unrank=e},{"invert-permutation":223,"typedarray-pool":233}],223:[function(a,b,c){"use strict";function d(a,b){b=b||new Array(a.length);for(var c=0;c<a.length;++c)b[a[c]]=c;return b}b.exports=d},{}],224:[function(a,b,c){"use strict";function d(a){if(0>a)return[];if(0===a)return[[0]];for(var b=0|Math.round(g(a+1)),c=[],d=0;b>d;++d){for(var h=e.unrank(a,d),i=[0],j=0,k=0;k<h.length;++k)j+=1<<h[k],i.push(j);f(h)<1&&(i[0]=j,i[a]=0),c.push(i)}return c}b.exports=d;var e=a("permutation-rank"),f=a("permutation-parity"),g=a("gamma")},{gamma:220,"permutation-parity":221,"permutation-rank":222}],225:[function(a,b,c){b.exports=a("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":66}],226:[function(a,b,c){"use strict";function d(a,b){var c=[];return b=+b||0,e(a.hi(a.shape[0]-1),c,b),c}b.exports=d;var e=a("./lib/zc-core")},{"./lib/zc-core":225}],227:[function(a,b,c){"use strict";function d(a,b){var c=a.length,d=["'use strict';"],e="surfaceNets"+a.join("_")+"d"+b;d.push("var contour=genContour({","order:[",a.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===b&&d.push("getters:[0],");for(var f=[],i=[],j=0;c>j;++j)f.push("d"+j),i.push("d"+j);for(var j=0;1<<c>j;++j)f.push("v"+j),i.push("v"+j);for(var j=0;1<<c>j;++j)f.push("p"+j),i.push("p"+j);f.push("a","b","c"),i.push("a","c"),d.push("vertex:function vertexFunc(",f.join(),"){");for(var k=[],j=0;1<<c>j;++j)k.push("(p"+j+"<<"+j+")");d.push("var m=(",k.join("+"),")|0;if(m===0||m===",(1<<(1<<c))-1,"){return}");var l=[],m=[];128>=1<<(1<<c)?(d.push("switch(m){"),m=d):d.push("switch(m>>>7){");for(var j=0;1<<(1<<c)>j;++j){if(1<<(1<<c)>128&&j%128===0){l.length>0&&m.push("}}");var n="vExtra"+l.length;d.push("case ",j>>>7,":",n,"(m&0x7f,",i.join(),");break;"),m=["function ",n,"(m,",i.join(),"){switch(m){"],l.push(m)}m.push("case ",127&j,":");for(var o=new Array(c),p=new Array(c),q=new Array(c),r=new Array(c),s=0,t=0;c>t;++t)o[t]=[],p[t]=[],q[t]=0,r[t]=0;for(var t=0;1<<c>t;++t)for(var u=0;c>u;++u){var v=t^1<<u;if(!(v>t)&&!(j&1<<v)!=!(j&1<<t)){var w=1;j&1<<v?p[u].push("v"+v+"-v"+t):(p[u].push("v"+t+"-v"+v),w=-w),0>w?(o[u].push("-v"+t+"-v"+v),q[u]+=2):(o[u].push("v"+t+"+v"+v),q[u]-=2),s+=1;for(var x=0;c>x;++x)x!==u&&(v&1<<x?r[x]+=1:r[x]-=1)}}for(var y=[],u=0;c>u;++u)if(0===o[u].length)y.push("d"+u+"-0.5");else{var z="";q[u]<0?z=q[u]+"*c":q[u]>0&&(z="+"+q[u]+"*c");var A=.5*(o[u].length/s),B=.5+.5*(r[u]/s);y.push("d"+u+"-"+B+"-"+A+"*("+o[u].join("+")+z+")/("+p[u].join("+")+")")}m.push("a.push([",y.join(),"]);","break;")}d.push("}},"),l.length>0&&m.push("}}");for(var C=[],j=0;1<<c-1>j;++j)C.push("v"+j);C.push("c0","c1","p0","p1","a","b","c"),d.push("cell:function cellFunc(",C.join(),"){");var D=h(c-1);d.push("if(p0){b.push(",D.map(function(a){return"["+a.map(function(a){return"v"+a})+"]"}).join(),")}else{b.push(",D.map(function(a){var b=a.slice();return b.reverse(),"["+b.map(function(a){return"v"+a})+"]"}).join(),")}}});function ",e,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",e,";");for(var j=0;j<l.length;++j)d.push(l[j].join(""));var E=new Function("genContour",d.join(""));return E(g)}function e(a,b){for(var c=i(a,b),d=c.length,e=new Array(d),f=new Array(d),g=0;d>g;++g)e[g]=[c[g]],f[g]=[g];return{positions:e,cells:f}}function f(a,b){if(a.dimension<=0)return{positions:[],cells:[]};if(1===a.dimension)return e(a,b);var c=a.order.join()+"-"+a.dtype,f=j[c],b=+b||0;return f||(f=j[c]=d(a.order,a.dtype)),f(a,b)}b.exports=f;var g=a("ndarray-extract-contour"),h=a("triangulate-hypercube"),i=a("zero-crossings"),j={}},{"ndarray-extract-contour":219,"triangulate-hypercube":224,"zero-crossings":226}],228:[function(a,b,c){(function(c){"use strict";function d(a){for(var b=a.cells,c=a.positions,d=new Float32Array(6*b.length),e=0,f=0,g=0;g<b.length;++g)for(var h=b[g],i=0;3>i;++i){var j=c[h[i]];d[e++]=j[0],d[e++]=j[1]+1.4,f=Math.max(j[0],f)}return{data:d,shape:f}}function e(a,b){var c=h[a];c||(c=h[a]={" ":{data:new Float32Array(0),shape:.2}});var g=c[b];if(!g)if(b.length<=1||!/\d/.test(b))g=c[b]=d(f(b,{triangles:!0,font:a,textAlign:"left",textBaseline:"alphabetic"}));else{for(var i=b.split(/(\d|\s)/),j=new Array(i.length),k=0,l=0,m=0;m<i.length;++m)j[m]=e(a,i[m]),k+=j[m].data.length,l+=j[m].shape,m>0&&(l+=.02);for(var n=new Float32Array(k),o=0,p=-.5*l,m=0;m<j.length;++m){for(var q=j[m].data,r=0;r<q.length;r+=2)n[o++]=q[r]+p,n[o++]=q[r+1];p+=j[m].shape+.02}g=c[b]={data:n,shape:l}}return g}b.exports=e;var f=a("vectorize-text"),g=window||c.global||{},h=g.__TEXT_CACHE||{};g.__TEXT_CACHE={}}).call(this,a("_process"))},{_process:55,"vectorize-text":235}],229:[function(b,c,d){!function(){function b(a,c){if(a=a?a:"",c=c||{},a instanceof b)return a;if(!(this instanceof b))return new b(a,c);var e=d(a);this._originalInput=a,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=P(100*this._a)/100,this._format=c.format||e.format,this._gradientType=c.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=e.ok,this._tc_id=N++}function d(a){var b={r:0,g:0,b:0},c=1,d=!1,f=!1;return"string"==typeof a&&(a=J(a)),"object"==typeof a&&(a.hasOwnProperty("r")&&a.hasOwnProperty("g")&&a.hasOwnProperty("b")?(b=e(a.r,a.g,a.b),d=!0,f="%"===String(a.r).substr(-1)?"prgb":"rgb"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("v")?(a.s=G(a.s),a.v=G(a.v),b=i(a.h,a.s,a.v),d=!0,f="hsv"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("l")&&(a.s=G(a.s),a.l=G(a.l),b=g(a.h,a.s,a.l),d=!0,f="hsl"),a.hasOwnProperty("a")&&(c=a.a)),c=z(c),{ok:d,format:a.format||f,r:Q(255,R(b.r,0)),g:Q(255,R(b.g,0)),b:Q(255,R(b.b,0)),a:c}}function e(a,b,c){return{r:255*A(a,255),g:255*A(b,255),b:255*A(c,255)}}function f(a,b,c){a=A(a,255),b=A(b,255),c=A(c,255);var d,e,f=R(a,b,c),g=Q(a,b,c),h=(f+g)/2;if(f==g)d=e=0;else{var i=f-g;switch(e=h>.5?i/(2-f-g):i/(f+g),f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,l:h}}function g(a,b,c){function d(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+(b-a)*(2/3-c)*6:a}var e,f,g;if(a=A(a,360),b=A(b,100),c=A(c,100),0===b)e=f=g=c;else{var h=.5>c?c*(1+b):c+b-c*b,i=2*c-h;e=d(i,h,a+1/3),f=d(i,h,a),g=d(i,h,a-1/3)}return{r:255*e,g:255*f,b:255*g}}function h(a,b,c){a=A(a,255),b=A(b,255),c=A(c,255);var d,e,f=R(a,b,c),g=Q(a,b,c),h=f,i=f-g;if(e=0===f?0:i/f,f==g)d=0;else{switch(f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,v:h}}function i(a,b,c){a=6*A(a,360),b=A(b,100),c=A(c,100);var d=O.floor(a),e=a-d,f=c*(1-b),g=c*(1-e*b),h=c*(1-(1-e)*b),i=d%6,j=[c,g,f,f,h,c][i],k=[h,c,c,g,f,f][i],l=[f,f,h,c,c,g][i];return{r:255*j,g:255*k,b:255*l}}function j(a,b,c,d){var e=[F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16))];return d&&e[0].charAt(0)==e[0].charAt(1)&&e[1].charAt(0)==e[1].charAt(1)&&e[2].charAt(0)==e[2].charAt(1)?e[0].charAt(0)+e[1].charAt(0)+e[2].charAt(0):e.join("")}function k(a,b,c,d){var e=[F(H(d)),F(P(a).toString(16)),F(P(b).toString(16)),F(P(c).toString(16))];return e.join("")}function l(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s-=c/100,d.s=B(d.s),b(d)}function m(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s+=c/100,d.s=B(d.s),b(d)}function n(a){return b(a).desaturate(100)}function o(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l+=c/100,d.l=B(d.l),b(d)}function p(a,c){c=0===c?0:c||10;var d=b(a).toRgb();return d.r=R(0,Q(255,d.r-P(255*-(c/100)))),d.g=R(0,Q(255,d.g-P(255*-(c/100)))),d.b=R(0,Q(255,d.b-P(255*-(c/100)))),b(d)}function q(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l-=c/100,d.l=B(d.l),b(d)}function r(a,c){var d=b(a).toHsl(),e=(P(d.h)+c)%360;return d.h=0>e?360+e:e,b(d)}function s(a){var c=b(a).toHsl();return c.h=(c.h+180)%360,b(c)}function t(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+120)%360,s:c.s,l:c.l}),b({h:(d+240)%360,s:c.s,l:c.l})]}function u(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+90)%360,s:c.s,l:c.l}),b({h:(d+180)%360,s:c.s,l:c.l}),b({h:(d+270)%360,s:c.s,l:c.l})]}function v(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+72)%360,s:c.s,l:c.l}),b({h:(d+216)%360,s:c.s,l:c.l})]}function w(a,c,d){c=c||6,d=d||30;var e=b(a).toHsl(),f=360/d,g=[b(a)];for(e.h=(e.h-(f*c>>1)+720)%360;--c;)e.h=(e.h+f)%360,g.push(b(e));return g}function x(a,c){c=c||6;for(var d=b(a).toHsv(),e=d.h,f=d.s,g=d.v,h=[],i=1/c;c--;)h.push(b({h:e,s:f,v:g})),g=(g+i)%1;return h}function y(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}function z(a){return a=parseFloat(a),(isNaN(a)||0>a||a>1)&&(a=1),a}function A(a,b){D(a)&&(a="100%");var c=E(a);return a=Q(b,R(0,parseFloat(a))),c&&(a=parseInt(a*b,10)/100),O.abs(a-b)<1e-6?1:a%b/parseFloat(b)}function B(a){return Q(1,R(0,a))}function C(a){return parseInt(a,16)}function D(a){return"string"==typeof a&&-1!=a.indexOf(".")&&1===parseFloat(a)}function E(a){return"string"==typeof a&&-1!=a.indexOf("%")}function F(a){return 1==a.length?"0"+a:""+a}function G(a){return 1>=a&&(a=100*a+"%"),a}function H(a){return Math.round(255*parseFloat(a)).toString(16)}function I(a){return C(a)/255}function J(a){a=a.replace(L,"").replace(M,"").toLowerCase();var b=!1;if(T[a])a=T[a],b=!0;else if("transparent"==a)return{r:0,g:0,b:0,a:0,format:"name"};var c;return(c=V.rgb.exec(a))?{r:c[1],g:c[2],b:c[3]}:(c=V.rgba.exec(a))?{r:c[1],g:c[2],b:c[3],a:c[4]}:(c=V.hsl.exec(a))?{h:c[1],s:c[2],l:c[3]}:(c=V.hsla.exec(a))?{h:c[1],s:c[2],l:c[3],a:c[4]}:(c=V.hsv.exec(a))?{h:c[1],s:c[2],v:c[3]}:(c=V.hsva.exec(a))?{h:c[1],s:c[2],v:c[3],a:c[4]}:(c=V.hex8.exec(a))?{a:I(c[1]),r:C(c[2]),g:C(c[3]),b:C(c[4]),format:b?"name":"hex8"}:(c=V.hex6.exec(a))?{r:C(c[1]),g:C(c[2]),b:C(c[3]),format:b?"name":"hex"}:(c=V.hex3.exec(a))?{r:C(c[1]+""+c[1]),g:C(c[2]+""+c[2]),b:C(c[3]+""+c[3]),format:b?"name":"hex"}:!1}function K(a){var b,c;return a=a||{level:"AA",size:"small"},b=(a.level||"AA").toUpperCase(),c=(a.size||"small").toLowerCase(),"AA"!==b&&"AAA"!==b&&(b="AA"),"small"!==c&&"large"!==c&&(c="small"),{level:b,size:c}}var L=/^\s+/,M=/\s+$/,N=0,O=Math,P=O.round,Q=O.min,R=O.max,S=O.random;b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var a=this.toRgb();return(299*a.r+587*a.g+114*a.b)/1e3},getLuminance:function(){var a,b,c,d,e,f,g=this.toRgb();return a=g.r/255,b=g.g/255,c=g.b/255,d=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),e=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),f=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*d+.7152*e+.0722*f},setAlpha:function(a){return this._a=z(a),this._roundA=P(100*this._a)/100,this},toHsv:function(){var a=h(this._r,this._g,this._b);return{h:360*a.h,s:a.s,v:a.v,a:this._a}},toHsvString:function(){var a=h(this._r,this._g,this._b),b=P(360*a.h),c=P(100*a.s),d=P(100*a.v);return 1==this._a?"hsv("+b+", "+c+"%, "+d+"%)":"hsva("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHsl:function(){var a=f(this._r,this._g,this._b);return{h:360*a.h,s:a.s,l:a.l,a:this._a}},toHslString:function(){var a=f(this._r,this._g,this._b),b=P(360*a.h),c=P(100*a.s),d=P(100*a.l);return 1==this._a?"hsl("+b+", "+c+"%, "+d+"%)":"hsla("+b+", "+c+"%, "+d+"%, "+this._roundA+")"},toHex:function(a){return j(this._r,this._g,this._b,a)},toHexString:function(a){return"#"+this.toHex(a)},toHex8:function(){return k(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(100*A(this._r,255))+"%",g:P(100*A(this._g,255))+"%",b:P(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+P(100*A(this._r,255))+"%, "+P(100*A(this._g,255))+"%, "+P(100*A(this._b,255))+"%)":"rgba("+P(100*A(this._r,255))+"%, "+P(100*A(this._g,255))+"%, "+P(100*A(this._b,255))+"%, "+this._roundA+")"; 41 },toName:function(){return 0===this._a?"transparent":this._a<1?!1:U[j(this._r,this._g,this._b,!0)]||!1},toFilter:function(a){var c="#"+k(this._r,this._g,this._b,this._a),d=c,e=this._gradientType?"GradientType = 1, ":"";if(a){var f=b(a);d=f.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+e+"startColorstr="+c+",endColorstr="+d+")"},toString:function(a){var b=!!a;a=a||this._format;var c=!1,d=this._a<1&&this._a>=0,e=!b&&d&&("hex"===a||"hex6"===a||"hex3"===a||"name"===a);return e?"name"===a&&0===this._a?this.toName():this.toRgbString():("rgb"===a&&(c=this.toRgbString()),"prgb"===a&&(c=this.toPercentageRgbString()),"hex"!==a&&"hex6"!==a||(c=this.toHexString()),"hex3"===a&&(c=this.toHexString(!0)),"hex8"===a&&(c=this.toHex8String()),"name"===a&&(c=this.toName()),"hsl"===a&&(c=this.toHslString()),"hsv"===a&&(c=this.toHsvString()),c||this.toHexString())},clone:function(){return b(this.toString())},_applyModification:function(a,b){var c=a.apply(null,[this].concat([].slice.call(b)));return this._r=c._r,this._g=c._g,this._b=c._b,this.setAlpha(c._a),this},lighten:function(){return this._applyModification(o,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(q,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(n,arguments)},spin:function(){return this._applyModification(r,arguments)},_applyCombination:function(a,b){return a.apply(null,[this].concat([].slice.call(b)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(s,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(t,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},b.fromRatio=function(a,c){if("object"==typeof a){var d={};for(var e in a)a.hasOwnProperty(e)&&("a"===e?d[e]=a[e]:d[e]=G(a[e]));a=d}return b(a,c)},b.equals=function(a,c){return a&&c?b(a).toRgbString()==b(c).toRgbString():!1},b.random=function(){return b.fromRatio({r:S(),g:S(),b:S()})},b.mix=function(a,c,d){d=0===d?0:d||50;var e,f=b(a).toRgb(),g=b(c).toRgb(),h=d/100,i=2*h-1,j=g.a-f.a;e=i*j==-1?i:(i+j)/(1+i*j),e=(e+1)/2;var k=1-e,l={r:g.r*e+f.r*k,g:g.g*e+f.g*k,b:g.b*e+f.b*k,a:g.a*h+f.a*(1-h)};return b(l)},b.readability=function(a,c){var d=b(a),e=b(c);return(Math.max(d.getLuminance(),e.getLuminance())+.05)/(Math.min(d.getLuminance(),e.getLuminance())+.05)},b.isReadable=function(a,c,d){var e,f,g=b.readability(a,c);switch(f=!1,e=K(d),e.level+e.size){case"AAsmall":case"AAAlarge":f=g>=4.5;break;case"AAlarge":f=g>=3;break;case"AAAsmall":f=g>=7}return f},b.mostReadable=function(a,c,d){var e,f,g,h,i=null,j=0;d=d||{},f=d.includeFallbackColors,g=d.level,h=d.size;for(var k=0;k<c.length;k++)e=b.readability(a,c[k]),e>j&&(j=e,i=b(c[k]));return b.isReadable(a,i,{level:g,size:h})||!f?i:(d.includeFallbackColors=!1,b.mostReadable(a,["#fff","#000"],d))};var T=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=b.hexNames=y(T),V=function(){var a="[-\\+]?\\d+%?",b="[-\\+]?\\d*\\.\\d+%?",c="(?:"+b+")|(?:"+a+")",d="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?",e="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?";return{rgb:new RegExp("rgb"+d),rgba:new RegExp("rgba"+e),hsl:new RegExp("hsl"+d),hsla:new RegExp("hsla"+e),hsv:new RegExp("hsv"+d),hsva:new RegExp("hsva"+e),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();"undefined"!=typeof c&&c.exports?c.exports=b:"function"==typeof a&&a.amd?a(function(){return b}):window.tinycolor=b}()},{}],230:[function(b,c,d){!function(){function b(a,b){function c(b){var c,d=a.arcs[0>b?~b:b],e=d[0];return a.transform?(c=[0,0],d.forEach(function(a){c[0]+=a[0],c[1]+=a[1]})):c=d[d.length-1],0>b?[c,e]:[e,c]}function d(a,b){for(var c in a){var d=a[c];delete b[d.start],delete d.start,delete d.end,d.forEach(function(a){e[0>a?~a:a]=1}),h.push(d)}}var e={},f={},g={},h=[],i=-1;return b.forEach(function(c,d){var e,f=a.arcs[0>c?~c:c];f.length<3&&!f[1][0]&&!f[1][1]&&(e=b[++i],b[i]=c,b[d]=e)}),b.forEach(function(a){var b,d,e=c(a),h=e[0],i=e[1];if(b=g[h])if(delete g[b.end],b.push(a),b.end=i,d=f[i]){delete f[d.start];var j=d===b?b:b.concat(d);f[j.start=b.start]=g[j.end=d.end]=j}else f[b.start]=g[b.end]=b;else if(b=f[i])if(delete f[b.start],b.unshift(a),b.start=h,d=g[h]){delete g[d.end];var k=d===b?b:d.concat(b);f[k.start=d.start]=g[k.end=b.end]=k}else f[b.start]=g[b.end]=b;else b=[a],f[b.start=h]=g[b.end=i]=b}),d(g,f),d(f,g),b.forEach(function(a){e[0>a?~a:a]||h.push([a])}),h}function d(a,c,d){function e(a){var b=0>a?~a:a;(k[b]||(k[b]=[])).push({i:a,g:j})}function f(a){a.forEach(e)}function g(a){a.forEach(f)}function h(a){"GeometryCollection"===a.type?a.geometries.forEach(h):a.type in l&&(j=a,l[a.type](a.arcs))}var i=[];if(arguments.length>1){var j,k=[],l={LineString:f,MultiLineString:g,Polygon:g,MultiPolygon:function(a){a.forEach(g)}};h(c),k.forEach(arguments.length<3?function(a){i.push(a[0].i)}:function(a){d(a[0].g,a[a.length-1].g)&&i.push(a[0].i)})}else for(var m=0,n=a.arcs.length;n>m;++m)i.push(m);return{type:"MultiLineString",arcs:b(a,i)}}function e(a,c){function d(a){a.forEach(function(b){b.forEach(function(b){(f[b=0>b?~b:b]||(f[b]=[])).push(a)})}),g.push(a)}function e(b){return m(h(a,{type:"Polygon",arcs:[b]}).coordinates[0])>0}var f={},g=[],i=[];return c.forEach(function(a){"Polygon"===a.type?d(a.arcs):"MultiPolygon"===a.type&&a.arcs.forEach(d)}),g.forEach(function(a){if(!a._){var b=[],c=[a];for(a._=1,i.push(b);a=c.pop();)b.push(a),a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].forEach(function(a){a._||(a._=1,c.push(a))})})})}}),g.forEach(function(a){delete a._}),{type:"MultiPolygon",arcs:i.map(function(c){var d,g=[];if(c.forEach(function(a){a.forEach(function(a){a.forEach(function(a){f[0>a?~a:a].length<2&&g.push(a)})})}),g=b(a,g),(d=g.length)>1)for(var h,i=e(c[0][0]),j=0;d>j;++j)if(i===e(g[j])){h=g[0],g[0]=g[j],g[j]=h;break}return g})}}function f(a,b){return"GeometryCollection"===b.type?{type:"FeatureCollection",features:b.geometries.map(function(b){return g(a,b)})}:g(a,b)}function g(a,b){var c={type:"Feature",id:b.id,properties:b.properties||{},geometry:h(a,b)};return null==b.id&&delete c.id,c}function h(a,b){function c(a,b){b.length&&b.pop();for(var c,d=k[0>a?~a:a],e=0,f=d.length;f>e;++e)b.push(c=d[e].slice()),j(c,e);0>a&&i(b,f)}function d(a){return a=a.slice(),j(a,0),a}function e(a){for(var b=[],d=0,e=a.length;e>d;++d)c(a[d],b);return b.length<2&&b.push(b[0].slice()),b}function f(a){for(var b=e(a);b.length<4;)b.push(b[0].slice());return b}function g(a){return a.map(f)}function h(a){var b=a.type;return"GeometryCollection"===b?{type:b,geometries:a.geometries.map(h)}:b in l?{type:b,coordinates:l[b](a)}:null}var j=q(a.transform),k=a.arcs,l={Point:function(a){return d(a.coordinates)},MultiPoint:function(a){return a.coordinates.map(d)},LineString:function(a){return e(a.arcs)},MultiLineString:function(a){return a.arcs.map(e)},Polygon:function(a){return g(a.arcs)},MultiPolygon:function(a){return a.arcs.map(g)}};return h(b)}function i(a,b){for(var c,d=a.length,e=d-b;e<--d;)c=a[e],a[e++]=a[d],a[d]=c}function j(a,b){for(var c=0,d=a.length;d>c;){var e=c+d>>>1;a[e]<b?c=e+1:d=e}return c}function k(a){function b(a,b){a.forEach(function(a){0>a&&(a=~a);var c=e[a];c?c.push(b):e[a]=[b]})}function c(a,c){a.forEach(function(a){b(a,c)})}function d(a,b){"GeometryCollection"===a.type?a.geometries.forEach(function(a){d(a,b)}):a.type in g&&g[a.type](a.arcs,b)}var e={},f=a.map(function(){return[]}),g={LineString:b,MultiLineString:c,Polygon:c,MultiPolygon:function(a,b){a.forEach(function(a){c(a,b)})}};a.forEach(d);for(var h in e)for(var i=e[h],k=i.length,l=0;k>l;++l)for(var m=l+1;k>m;++m){var n,o=i[l],p=i[m];(n=f[o])[h=j(n,p)]!==p&&n.splice(h,0,p),(n=f[p])[h=j(n,o)]!==o&&n.splice(h,0,o)}return f}function l(a,b){function c(a){f.remove(a),a[1][2]=b(a),f.push(a)}var d=q(a.transform),e=r(a.transform),f=p();return b||(b=n),a.arcs.forEach(function(a){for(var g,h,i=[],j=0,k=0,l=a.length;l>k;++k)h=a[k],d(a[k]=[h[0],h[1],1/0],k);for(var k=1,l=a.length-1;l>k;++k)g=a.slice(k-1,k+2),g[1][2]=b(g),i.push(g),f.push(g);for(var k=0,l=i.length;l>k;++k)g=i[k],g.previous=i[k-1],g.next=i[k+1];for(;g=f.pop();){var m=g.previous,n=g.next;g[1][2]<j?g[1][2]=j:j=g[1][2],m&&(m.next=n,m[2]=g[2],c(m)),n&&(n.previous=m,n[0]=g[0],c(n))}a.forEach(e)}),a}function m(a){for(var b,c=-1,d=a.length,e=a[d-1],f=0;++c<d;)b=e,e=a[c],f+=b[0]*e[1]-b[1]*e[0];return f/2}function n(a){var b=a[0],c=a[1],d=a[2];return Math.abs((b[0]-d[0])*(c[1]-b[1])-(b[0]-c[0])*(d[1]-b[1]))}function o(a,b){return a[1][2]-b[1][2]}function p(){function a(a,b){for(;b>0;){var c=(b+1>>1)-1,e=d[c];if(o(a,e)>=0)break;d[e._=b]=e,d[a._=b=c]=a}}function b(a,b){for(;;){var c=b+1<<1,f=c-1,g=b,h=d[g];if(e>f&&o(d[f],h)<0&&(h=d[g=f]),e>c&&o(d[c],h)<0&&(h=d[g=c]),g===b)break;d[h._=b]=h,d[a._=b=g]=a}}var c={},d=[],e=0;return c.push=function(b){return a(d[b._=e]=b,e++),e},c.pop=function(){if(!(0>=e)){var a,c=d[0];return--e>0&&(a=d[e],b(d[a._=0]=a,0)),c}},c.remove=function(c){var f,g=c._;if(d[g]===c)return g!==--e&&(f=d[e],(o(f,c)<0?a:b)(d[f._=g]=f,g)),g},c}function q(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0),a[0]=(b+=a[0])*d+f,a[1]=(c+=a[1])*e+g}}function r(a){if(!a)return s;var b,c,d=a.scale[0],e=a.scale[1],f=a.translate[0],g=a.translate[1];return function(a,h){h||(b=c=0);var i=(a[0]-f)/d|0,j=(a[1]-g)/e|0;a[0]=i-b,a[1]=j-c,b=i,c=j}}function s(){}var t={version:"1.6.20",mesh:function(a){return h(a,d.apply(this,arguments))},meshArcs:d,merge:function(a){return h(a,e.apply(this,arguments))},mergeArcs:e,feature:f,neighbors:k,presimplify:l};"function"==typeof a&&a.amd?a(t):"object"==typeof c&&c.exports?c.exports=t:this.topojson=t}()},{}],231:[function(a,b,c){"use strict";function d(a,b,c){var d=a*b,f=e*a,g=f-a,h=f-g,i=a-h,j=e*b,k=j-b,l=j-k,m=b-l,n=d-h*l,o=n-i*l,p=o-h*m,q=i*m-p;return c?(c[0]=q,c[1]=d,c):[q,d]}b.exports=d;var e=+(Math.pow(2,27)+1)},{}],232:[function(a,b,c){"use strict";function d(a,b,c){var d=a+b,e=d-a,f=d-e,g=b-e,h=a-f;return c?(c[0]=h+g,c[1]=d,c):[h+g,d]}b.exports=d},{}],233:[function(a,b,c){(function(b,d){"use strict";function e(a){if(a){var b=a.length||a.byteLength,c=s.log2(b);w[c].push(a)}}function f(a){e(a.buffer)}function g(a){var a=s.nextPow2(a),b=s.log2(a),c=w[b];return c.length>0?c.pop():new ArrayBuffer(a)}function h(a){return new Uint8Array(g(a),0,a)}function i(a){return new Uint16Array(g(2*a),0,a)}function j(a){return new Uint32Array(g(4*a),0,a)}function k(a){return new Int8Array(g(a),0,a)}function l(a){return new Int16Array(g(2*a),0,a)}function m(a){return new Int32Array(g(4*a),0,a)}function n(a){return new Float32Array(g(4*a),0,a)}function o(a){return new Float64Array(g(8*a),0,a)}function p(a){return u?new Uint8ClampedArray(g(a),0,a):h(a)}function q(a){return new DataView(g(a),0,a)}function r(a){a=s.nextPow2(a);var b=s.log2(a),c=x[b];return c.length>0?c.pop():new d(a)}var s=a("bit-twiddle"),t=a("dup");b.__TYPEDARRAY_POOL||(b.__TYPEDARRAY_POOL={UINT8:t([32,0]),UINT16:t([32,0]),UINT32:t([32,0]),INT8:t([32,0]),INT16:t([32,0]),INT32:t([32,0]),FLOAT:t([32,0]),DOUBLE:t([32,0]),DATA:t([32,0]),UINT8C:t([32,0]),BUFFER:t([32,0])});var u="undefined"!=typeof Uint8ClampedArray,v=b.__TYPEDARRAY_POOL;v.UINT8C||(v.UINT8C=t([32,0])),v.BUFFER||(v.BUFFER=t([32,0]));var w=v.DATA,x=v.BUFFER;c.free=function(a){if(d.isBuffer(a))x[s.log2(a.length)].push(a);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(a)&&(a=a.buffer),!a)return;var b=a.length||a.byteLength,c=0|s.log2(b);w[c].push(a)}},c.freeUint8=c.freeUint16=c.freeUint32=c.freeInt8=c.freeInt16=c.freeInt32=c.freeFloat32=c.freeFloat=c.freeFloat64=c.freeDouble=c.freeUint8Clamped=c.freeDataView=f,c.freeArrayBuffer=e,c.freeBuffer=function(a){x[s.log2(a.length)].push(a)},c.malloc=function(a,b){if(void 0===b||"arraybuffer"===b)return g(a);switch(b){case"uint8":return h(a);case"uint16":return i(a);case"uint32":return j(a);case"int8":return k(a);case"int16":return l(a);case"int32":return m(a);case"float":case"float32":return n(a);case"double":case"float64":return o(a);case"uint8_clamped":return p(a);case"buffer":return r(a);case"data":case"dataview":return q(a);default:return null}return null},c.mallocArrayBuffer=g,c.mallocUint8=h,c.mallocUint16=i,c.mallocUint32=j,c.mallocInt8=k,c.mallocInt16=l,c.mallocInt32=m,c.mallocFloat32=c.mallocFloat=n,c.mallocFloat64=c.mallocDouble=o,c.mallocUint8Clamped=p,c.mallocDataView=q,c.mallocBuffer=r,c.clearCache=function(){for(var a=0;32>a;++a)v.UINT8[a].length=0,v.UINT16[a].length=0,v.UINT32[a].length=0,v.INT8[a].length=0,v.INT16[a].length=0,v.INT32[a].length=0,v.FLOAT[a].length=0,v.DOUBLE[a].length=0,v.UINT8C[a].length=0,w[a].length=0,x[a].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"bit-twiddle":49,buffer:50,dup:72}],234:[function(a,b,c){"use strict";function d(a,b){for(var c=1,d=a.length,e=a[0],f=a[0],g=1;d>g;++g)if(f=e,e=a[g],b(e,f)){if(g===c){c++;continue}a[c++]=e}return a.length=c,a}function e(a){for(var b=1,c=a.length,d=a[0],e=a[0],f=1;c>f;++f,e=d)if(e=d,d=a[f],d!==e){if(f===b){b++;continue}a[b++]=d}return a.length=b,a}function f(a,b,c){return 0===a.length?a:b?(c||a.sort(b),d(a,b)):(c||a.sort(),e(a))}b.exports=f},{}],235:[function(a,b,c){"use strict";function d(a,b){return"object"==typeof b&&null!==b||(b={}),e(a,b.canvas||f,b.context||g,b)}b.exports=d;var e=a("./lib/vtext"),f=null,g=null;"undefined"!=typeof document&&(f=document.createElement("canvas"),f.width=8192,f.height=1024,g=f.getContext("2d"))},{"./lib/vtext":236}],236:[function(a,b,c){"use strict";function d(a,b,c){for(var d=b.textAlign||"start",e=b.textBaseline||"alphabetic",f=[1<<30,1<<30],g=[0,0],h=a.length,i=0;h>i;++i)for(var j=a[i],k=0;2>k;++k)f[k]=0|Math.min(f[k],j[k]),g[k]=0|Math.max(g[k],j[k]);var l=0;switch(d){case"center":l=-.5*(f[0]+g[0]);break;case"right":case"end":l=-g[0];break;case"left":case"start":l=-f[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+d+"'")}var m=0;switch(e){case"hanging":case"top":m=-f[1];break;case"middle":m=-.5*(f[1]+g[1]);break;case"alphabetic":case"ideographic":m=-3*c;break;case"bottom":m=-g[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+e+"'")}var n=1/c;return"lineHeight"in b?n*=+b.lineHeight:"width"in b?n=b.width/(g[0]-f[0]):"height"in b&&(n=b.height/(g[1]-f[1])),a.map(function(a){return[n*(a[0]+l),n*(a[1]+m)]})}function e(a,b,c,d){var e=0|Math.ceil(b.measureText(c).width+2*d);if(e>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var f=3*d;a.height<f&&(a.height=f),b.fillStyle="#000",b.fillRect(0,0,a.width,a.height),b.fillStyle="#fff",b.fillText(c,d,2*d);var g=b.getImageData(0,0,e,f),h=k(g.data,[f,e,4]);return h.pick(-1,-1,0).transpose(1,0)}function f(a,b){var c=j(a,128);return b?l(c.cells,c.positions,.25):{edges:c.cells,positions:c.positions}}function g(a,b,c,e){var g=f(a,e),h=d(g.positions,b,c),i=g.edges,j="ccw"===b.orientation;if(m(h,i),b.polygons||b.polygon||b.polyline){for(var k=o(i,h),l=new Array(k.length),p=0;p<k.length;++p){for(var q=k[p],r=new Array(q.length),s=0;s<q.length;++s){for(var t=q[s],u=new Array(t.length),v=0;v<t.length;++v)u[v]=h[t[v]].slice();j&&u.reverse(),r[s]=u}l[p]=r}return l}return b.triangles||b.triangulate||b.triangle?{cells:n(h,i,{delaunay:!1,exterior:!1,interior:!0}),positions:h}:{edges:i,positions:h}}function h(a,b,c){try{return g(a,b,c,!0)}catch(d){}try{return g(a,b,c,!1)}catch(d){}return b.polygons||b.polyline||b.polygon?[]:b.triangles||b.triangulate||b.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function i(a,b,c,d){var f=d.size||64,g=d.font||"normal";c.font=f+"px "+g,c.textAlign="start",c.textBaseline="alphabetic",c.direction="ltr";var i=e(b,c,a,f);return h(i,d,f)}b.exports=i,b.exports.processPixels=h;var j=a("surface-nets"),k=a("ndarray"),l=a("simplify-planar-graph"),m=a("clean-pslg"),n=a("cdt2d"),o=a("planar-graph-to-polyline")},{cdt2d:237,"clean-pslg":244,ndarray:208,"planar-graph-to-polyline":290,"simplify-planar-graph":294,"surface-nets":227}],237:[function(a,b,c){"use strict";function d(a){return[Math.min(a[0],a[1]),Math.max(a[0],a[1])]}function e(a,b){return a[0]-b[0]||a[1]-b[1]}function f(a){return a.map(d).sort(e)}function g(a,b,c){return b in a?a[b]:c}function h(a,b,c){Array.isArray(b)?(c=c||{},b=b||[]):(c=b||{},b=[]);var d=!!g(c,"delaunay",!0),e=!!g(c,"interior",!0),h=!!g(c,"exterior",!0),m=!!g(c,"infinity",!1);if(!e&&!h||0===a.length)return[];var n=i(a,b);if(d||e!==h||m){for(var o=j(a.length,f(b)),p=0;p<n.length;++p){var q=n[p];o.addTriangle(q[0],q[1],q[2])}return d&&k(a,o),h?e?m?l(o,0,m):o.cells():l(o,1,m):l(o,-1)}return n}var i=a("./lib/monotone"),j=a("./lib/triangulation"),k=a("./lib/delaunay"),l=a("./lib/filter");b.exports=h},{"./lib/delaunay":238,"./lib/filter":239,"./lib/monotone":240,"./lib/triangulation":241}],238:[function(a,b,c){"use strict";function d(a,b,c,d,e,g){var h=b.opposite(d,e);if(!(0>h)){if(d>e){var i=d;d=e,e=i,i=g,g=h,h=i}b.isConstraint(d,e)||f(a[d],a[e],a[g],a[h])<0&&c.push(d,e)}}function e(a,b){for(var c=[],e=a.length,g=b.stars,h=0;e>h;++h)for(var i=g[h],j=1;j<i.length;j+=2){var k=i[j];if(!(h>k||b.isConstraint(h,k))){for(var l=i[j-1],m=-1,n=1;n<i.length;n+=2)if(i[n-1]===k){m=i[n];break}0>m||f(a[h],a[k],a[l],a[m])<0&&c.push(h,k)}}for(;c.length>0;){for(var k=c.pop(),h=c.pop(),l=-1,m=-1,i=g[h],o=1;o<i.length;o+=2){var p=i[o-1],q=i[o];p===k?m=q:q===k&&(l=p)}0>l||0>m||f(a[h],a[k],a[l],a[m])>=0||(b.flip(h,k),d(a,b,c,l,h,m),d(a,b,c,h,m,l),d(a,b,c,m,k,l),d(a,b,c,k,l,m))}}var f=a("robust-in-sphere")[4];a("binary-search-bounds");b.exports=e},{"binary-search-bounds":242,"robust-in-sphere":243}],239:[function(a,b,c){"use strict";function d(a,b,c,d,e,f,g){this.cells=a,this.neighbor=b,this.flags=d,this.constraint=c,this.active=e,this.next=f,this.boundary=g}function e(a,b){return a[0]-b[0]||a[1]-b[1]||a[2]-b[2]}function f(a,b){for(var c=a.cells(),f=c.length,g=0;f>g;++g){var h=c[g],i=h[0],j=h[1],k=h[2];k>j?i>j&&(h[0]=j,h[1]=k,h[2]=i):i>k&&(h[0]=k,h[1]=i,h[2]=j)}c.sort(e);for(var l=new Array(f),g=0;g<l.length;++g)l[g]=0;var m=[],n=[],o=new Array(3*f),p=new Array(3*f),q=null;b&&(q=[]);for(var r=new d(c,o,p,l,m,n,q),g=0;f>g;++g)for(var h=c[g],s=0;3>s;++s){var i=h[s],j=h[(s+1)%3],t=o[3*g+s]=r.locate(j,i,a.opposite(j,i)),u=p[3*g+s]=a.isConstraint(i,j);0>t&&(u?n.push(g):(m.push(g),l[g]=1),b&&q.push([j,i,-1]))}return r}function g(a,b,c){for(var d=0,e=0;e<a.length;++e)b[e]===c&&(a[d++]=a[e]);return a.length=d,a}function h(a,b,c){var d=f(a,c);if(0===b)return c?d.cells.concat(d.boundary):d.cells;for(var e=1,h=d.active,i=d.next,j=d.flags,k=d.cells,l=d.constraint,m=d.neighbor;h.length>0||i.length>0;){for(;h.length>0;){var n=h.pop();if(j[n]!==-e){j[n]=e;for(var o=(k[n],0);3>o;++o){var p=m[3*n+o];p>=0&&0===j[p]&&(l[3*n+o]?i.push(p):(h.push(p),j[p]=e))}}}var q=i;i=h,h=q,i.length=0,e=-e}var r=g(k,j,b);return c?r.concat(d.boundary):r}var i=a("binary-search-bounds");b.exports=h;var j=d.prototype;j.locate=function(){var a=[0,0,0];return function(b,c,d){var f=b,g=c,h=d;return d>c?b>c&&(f=c,g=d,h=b):b>d&&(f=d,g=b,h=c),0>f?-1:(a[0]=f,a[1]=g,a[2]=h,i.eq(this.cells,a,e))}}()},{"binary-search-bounds":242}],240:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.a=a,this.b=b,this.idx=c,this.lowerIds=d,this.upperIds=e}function e(a,b,c,d){this.a=a,this.b=b,this.type=c,this.idx=d}function f(a,b){var c=a.a[0]-b.a[0]||a.a[1]-b.a[1]||a.type-b.type;return c?c:a.type!==o&&(c=n(a.a,a.b,b.b))?c:a.idx-b.idx}function g(a,b){return n(a.a,a.b,b)}function h(a,b,c,d,e){for(var f=m.lt(b,d,g),h=m.gt(b,d,g),i=f;h>i;++i){for(var j=b[i],k=j.lowerIds,l=k.length;l>1&&n(c[k[l-2]],c[k[l-1]],d)>0;)a.push([k[l-1],k[l-2],e]),l-=1;k.length=l,k.push(e);for(var o=j.upperIds,l=o.length;l>1&&n(c[o[l-2]],c[o[l-1]],d)<0;)a.push([o[l-2],o[l-1],e]),l-=1;o.length=l,o.push(e)}}function i(a,b){var c;return(c=a.a[0]<b.a[0]?n(a.a,a.b,b.a):n(b.b,b.a,a.a))?c:(c=b.b[0]<a.b[0]?n(a.a,a.b,b.b):n(b.b,b.a,a.b),c||a.idx-b.idx)}function j(a,b,c){var e=m.le(a,c,i),f=a[e],g=f.upperIds,h=g[g.length-1];f.upperIds=[h],a.splice(e+1,0,new d(c.a,c.b,c.idx,[h],g))}function k(a,b,c){var d=c.a;c.a=c.b,c.b=d;var e=m.eq(a,c,i),f=a[e],g=a[e-1];g.upperIds=f.upperIds,a.splice(e,1)}function l(a,b){for(var c=a.length,g=b.length,i=[],l=0;c>l;++l)i.push(new e(a[l],null,o,l));for(var l=0;g>l;++l){var m=b[l],n=a[m[0]],r=a[m[1]];n[0]<r[0]?i.push(new e(n,r,q,l),new e(r,n,p,l)):n[0]>r[0]&&i.push(new e(r,n,q,l),new e(n,r,p,l))}i.sort(f);for(var s=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),t=[new d([s,1],[s,0],-1,[],[],[],[])],u=[],l=0,v=i.length;v>l;++l){var w=i[l],x=w.type;x===o?h(u,t,a,w.a,w.idx):x===q?j(t,a,w):k(t,a,w)}return u}var m=a("binary-search-bounds"),n=a("robust-orientation")[3],o=0,p=1,q=2;b.exports=l},{"binary-search-bounds":242,"robust-orientation":214}],241:[function(a,b,c){"use strict";function d(a,b){this.stars=a,this.edges=b}function e(a,b,c){for(var d=1,e=a.length;e>d;d+=2)if(a[d-1]===b&&a[d]===c)return a[d-1]=a[e-2],a[d]=a[e-1],void(a.length=e-2)}function f(a,b){for(var c=new Array(a),e=0;a>e;++e)c[e]=[];return new d(c,b)}var g=a("binary-search-bounds");b.exports=f;var h=d.prototype;h.isConstraint=function(){function a(a,b){return a[0]-b[0]||a[1]-b[1]}var b=[0,0];return function(c,d){return b[0]=Math.min(c,d),b[1]=Math.max(c,d),g.eq(this.edges,b,a)>=0}}(),h.removeTriangle=function(a,b,c){var d=this.stars;e(d[a],b,c),e(d[b],c,a),e(d[c],a,b)},h.addTriangle=function(a,b,c){var d=this.stars;d[a].push(b,c),d[b].push(c,a),d[c].push(a,b)},h.opposite=function(a,b){for(var c=this.stars[b],d=1,e=c.length;e>d;d+=2)if(c[d]===a)return c[d-1];return-1},h.flip=function(a,b){var c=this.opposite(a,b),d=this.opposite(b,a);this.removeTriangle(a,b,c),this.removeTriangle(b,a,d),this.addTriangle(a,d,c),this.addTriangle(b,c,d)},h.edges=function(){for(var a=this.stars,b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;f+=2)b.push([e[f],e[f+1]]);return b},h.cells=function(){for(var a=this.stars,b=[],c=0,d=a.length;d>c;++c)for(var e=a[c],f=0,g=e.length;g>f;f+=2){var h=e[f],i=e[f+1];c<Math.min(h,i)&&b.push([c,h,i])}return b}},{"binary-search-bounds":242}],242:[function(a,b,c){arguments[4][121][0].apply(c,arguments)},{dup:121}],243:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a.length-1),d=1;d<a.length;++d)for(var e=c[d-1]=new Array(a.length-1),f=0,g=0;f<a.length;++f)f!==b&&(e[g++]=a[d][f]);return c}function e(a){for(var b=new Array(a),c=0;a>c;++c){b[c]=new Array(a);for(var d=0;a>d;++d)b[c][d]=["m",d,"[",a-c-2,"]"].join("")}return b}function f(a){if(1===a.length)return a[0];if(2===a.length)return["sum(",a[0],",",a[1],")"].join("");var b=a.length>>1;return["sum(",f(a.slice(0,b)),",",f(a.slice(b)),")"].join("")}function g(a,b){if("m"===a.charAt(0)){if("w"===b.charAt(0)){var c=a.split("[");return["w",b.substr(1),"m",c[0].substr(1)].join("")}return["prod(",a,",",b,")"].join("")}return g(b,a)}function h(a){return a&!0?"-":""}function i(a){if(2===a.length)return[["diff(",g(a[0][0],a[1][1]),",",g(a[1][0],a[0][1]),")"].join("")];for(var b=[],c=0;c<a.length;++c)b.push(["scale(",f(i(d(a,c))),",",h(c),a[0][c],")"].join(""));return b}function j(a,b){for(var c=[],d=0;b-2>d;++d)c.push(["prod(m",a,"[",d,"],m",a,"[",d,"])"].join(""));return f(c)}function k(a){for(var b=[],c=[],g=e(a),h=0;a>h;++h)g[0][h]="1",g[a-1][h]="w"+h;for(var h=0;a>h;++h)0===(1&h)?b.push.apply(b,i(d(g,h))):c.push.apply(c,i(d(g,h)));for(var k=f(b),l=f(c),m="exactInSphere"+a,n=[],h=0;a>h;++h)n.push("m"+h);for(var o=["function ",m,"(",n.join(),"){"],h=0;a>h;++h){o.push("var w",h,"=",j(h,a),";");for(var p=0;a>p;++p)p!==h&&o.push("var w",h,"m",p,"=scale(w",h,",m",p,"[0]);")}o.push("var p=",k,",n=",l,",d=diff(p,n);return d[d.length-1];}return ",m);var u=new Function("sum","diff","prod","scale",o.join(""));return u(r,s,q,t)}function l(){return 0}function m(){return 0}function n(){return 0}function o(a){var b=v[a.length];return b||(b=v[a.length]=k(a.length)),b.apply(void 0,a)}function p(){for(;v.length<=u;)v.push(k(v.length));for(var a=[],c=["slow"],d=0;u>=d;++d)a.push("a"+d),c.push("o"+d);for(var e=["function testInSphere(",a.join(),"){switch(arguments.length){case 0:case 1:return 0;"],d=2;u>=d;++d)e.push("case ",d,":return o",d,"(",a.slice(0,d).join(),");");e.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),c.push(e.join(""));var f=Function.apply(void 0,c);b.exports=f.apply(void 0,[o].concat(v));for(var d=0;u>=d;++d)b.exports[d]=v[d]}var q=a("two-product"),r=a("robust-sum"),s=a("robust-subtract"),t=a("robust-scale"),u=6,v=[l,m,n];p()},{"robust-scale":215,"robust-subtract":216,"robust-sum":217,"two-product":231}],244:[function(a,b,c){"use strict";function d(a){var b=u(a),c=t(s(b),a);return 0>c?[b,w(b,1/0)]:c>0?[w(b,-(1/0)),b]:[b,b]}function e(a,b){for(var c=new Array(b.length),d=0;d<b.length;++d){var e=b[d],f=a[e[0]],g=a[e[1]];c[d]=[Math.min(f[0],g[0]),Math.min(f[1],g[1]),Math.max(f[0],g[0]),Math.max(f[1],g[1])]}return c}function f(a){for(var b=new Array(a.length),c=0;c<a.length;++c){var d=a[c];b[c]=[d[0],d[1],d[0],d[1]]}return b}function g(a,b,c){var d=[];return q(c,function(c,e){var f=b[c],g=b[e];if(f[0]!==g[0]&&f[0]!==g[1]&&f[1]!==g[0]&&f[1]!==g[1]){var h=a[f[0]],i=a[f[1]],j=a[g[0]],k=a[g[1]];r(h,i,j,k)&&d.push([c,e])}}),d}function h(a,b,c,d){var e=[];return q(c,d,function(c,d){var f=b[c];if(f[0]!==d&&f[1]!==d){var g=a[d],h=a[f[0]],i=a[f[1]];r(h,i,g,g)&&e.push([c,d])}}),e}function i(a,b,c,d,e){function f(b){if(b>=a.length)return g[b-a.length];var c=a[b];return[s(c[0]),s(c[1])]}for(var g=[],h=0;h<c.length;++h){var i=c[h],j=i[0],k=i[1],l=b[j],m=b[k],n=x(v(a[l[0]]),v(a[l[1]]),v(a[m[0]]),v(a[m[1]]));if(n){var o=g.length+a.length;g.push(n),d.push([j,o],[k,o])}}d.sort(function(a,b){if(a[0]!==b[0])return a[0]-b[0];var c=f(a[1]),d=f(b[1]);return t(c[0],d[0])||t(c[1],d[1])});for(var h=d.length-1;h>=0;--h){var p=d[h],j=p[0],q=b[j],r=q[0],u=q[1],w=a[r],y=a[u];if((w[0]-y[0]||w[1]-y[1])<0){var z=r;r=u,u=z}q[0]=r;var A,B=q[1]=p[1];for(e&&(A=q[2]);h>0&&d[h-1][0]===j;){var p=d[--h],C=p[1];e?b.push([B,C,A]):b.push([B,C]),B=C}e?b.push([B,u,A]):b.push([B,u])}return g}function j(a,b,c){for(var e=a.length+b.length,f=new p(e),g=c,h=0;h<b.length;++h){var i=b[h],j=d(i[0]),k=d(i[1]);g.push([j[0],k[0],j[1],k[1]]),a.push([u(i[0]),u(i[1])])}q(g,function(a,b){f.link(a,b)});for(var l=0,m=!0,n=new Array(e),h=0;e>h;++h){var o=f.find(h);o===h?(n[h]=l,a[l++]=a[h]):(m=!1,n[h]=-1)}if(a.length=l,m)return null;for(var h=0;e>h;++h)n[h]<0&&(n[h]=n[f.find(h)]);return n}function k(a,b){return a[0]-b[0]||a[1]-b[1]}function l(a,b){var c=a[0]-b[0]||a[1]-b[1];return c?c:a[2]<b[2]?-1:a[2]>b[2]?1:0}function m(a,b,c){if(0!==a.length){if(b)for(var d=0;d<a.length;++d){var e=a[d],f=b[e[0]],g=b[e[1]];e[0]=Math.min(f,g),e[1]=Math.max(f,g)}else for(var d=0;d<a.length;++d){var e=a[d],f=e[0],g=e[1];e[0]=Math.min(f,g),e[1]=Math.max(f,g)}c?a.sort(l):a.sort(k);for(var h=1,d=1;d<a.length;++d){var i=a[d-1],j=a[d];(j[0]!==i[0]||j[1]!==i[1]||c&&j[2]!==i[2])&&(a[h++]=j)}a.length=h}}function n(a,b,c){var d=e(a,b),k=g(a,b,d),l=f(a),n=h(a,b,d,l),o=i(a,b,k,n,c),p=j(a,o,l);return m(b,p,c),p?!0:k.length>0||n.length>0}function o(a,b,c){var d,e=!1;if(c){d=b;for(var f=new Array(b.length),g=0;g<b.length;++g){var h=b[g];f[g]=[h[0],h[1],c[g]]}b=f}for(;n(a,b,!!c);)e=!0;if(c&&e){d.length=0,c.length=0;for(var g=0;g<b.length;++g){var h=b[g];d.push([h[0],h[1]]),c.push(h[2])}}return e}b.exports=o;var p=a("union-find"),q=a("box-intersect"),r=(a("compare-cell"),a("robust-segment-intersect")),s=a("big-rat"),t=a("big-rat/cmp"),u=a("big-rat/to-float"),v=a("rat-vec"),w=a("nextafter"),x=a("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":245,"big-rat":249,"big-rat/cmp":247,"big-rat/to-float":262,"box-intersect":263,"compare-cell":59,nextafter:271,"rat-vec":273,"robust-segment-intersect":276,"union-find":277}],245:[function(a,b,c){"use strict";function d(a,b){return h(f(a[0],b[1]),f(a[1],b[0]))}function e(a,b,c,e){var f=j(b,a),h=j(e,c),m=d(f,h);if(0===i(m))return null;var n=j(a,c),o=d(h,n),p=g(o,m);return k(a,l(f,p))}b.exports=e;var f=a("big-rat/mul"),g=a("big-rat/div"),h=a("big-rat/sub"),i=a("big-rat/sign"),j=a("rat-vec/sub"),k=a("rat-vec/add"),l=a("rat-vec/muls");a("big-rat/to-float")},{"big-rat/div":248,"big-rat/mul":258,"big-rat/sign":260,"big-rat/sub":261,"big-rat/to-float":262,"rat-vec/add":272,"rat-vec/muls":274,"rat-vec/sub":275}],246:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[1]).add(b[0].mul(a[1])),a[1].mul(b[1]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],247:[function(a,b,c){"use strict";function d(a,b){return a[0].mul(b[1]).cmp(b[0].mul(a[1]))}b.exports=d},{}],248:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[1]),a[1].mul(b[0]))}var e=a("./lib/rationalize"); 42 b.exports=d},{"./lib/rationalize":256}],249:[function(a,b,c){"use strict";function d(a,b){if(e(a))return b?j(a,d(b)):[a[0].clone(),a[1].clone()];var c,k,l=0;if(f(a))c=a.clone();else if("string"==typeof a)c=h(a);else{if(0===a)return[g(0),g(1)];if(a===Math.floor(a))c=g(a);else{for(;a!==Math.floor(a);)a*=Math.pow(2,256),l-=256;c=g(a)}}if(e(b))c.mul(b[1]),k=b[0].clone();else if(f(b))k=b.clone();else if("string"==typeof b)k=h(b);else if(b)if(b===Math.floor(b))k=g(b);else{for(;b!==Math.floor(b);)b*=Math.pow(2,256),l+=256;k=g(b)}else k=g(1);return l>0?c=c.shln(l):0>l&&(k=k.shln(-l)),i(c,k)}var e=a("./is-rat"),f=a("./lib/is-bn"),g=a("./lib/num-to-bn"),h=a("./lib/str-to-bn"),i=a("./lib/rationalize"),j=a("./div");b.exports=d},{"./div":248,"./is-rat":250,"./lib/is-bn":254,"./lib/num-to-bn":255,"./lib/rationalize":256,"./lib/str-to-bn":257}],250:[function(a,b,c){"use strict";function d(a){return Array.isArray(a)&&2===a.length&&e(a[0])&&e(a[1])}var e=a("./lib/is-bn");b.exports=d},{"./lib/is-bn":254}],251:[function(a,b,c){"use strict";function d(a){return a.cmp(new e(0))}var e=a("bn.js");b.exports=d},{"bn.js":259}],252:[function(a,b,c){"use strict";function d(a){var b=a.length,c=a.words,d=0;if(1===b)d=c[0];else if(2===b)d=c[0]+67108864*c[1];else for(var d=0,e=0;b>e;e++){var f=c[e];d+=f*Math.pow(67108864,e)}return a.sign?-d:d}b.exports=d},{}],253:[function(a,b,c){"use strict";function d(a){var b=f(e.lo(a));if(32>b)return b;var c=f(e.hi(a));return c>20?52:c+32}var e=a("double-bits"),f=a("bit-twiddle").countTrailingZeros;b.exports=d},{"bit-twiddle":49,"double-bits":270}],254:[function(a,b,c){"use strict";function d(a){return a&&"object"==typeof a&&Boolean(a.words)}a("bn.js");b.exports=d},{"bn.js":259}],255:[function(a,b,c){"use strict";function d(a){var b=f.exponent(a);return 52>b?new e(a):new e(a*Math.pow(2,52-b)).shln(b-52)}var e=a("bn.js"),f=a("double-bits");b.exports=d},{"bn.js":259,"double-bits":270}],256:[function(a,b,c){"use strict";function d(a,b){var c=f(a),d=f(b);if(0===c)return[e(0),e(1)];if(0===d)return[e(0),e(0)];0>d&&(a=a.neg(),b=b.neg());var g=a.gcd(b);return g.cmpn(1)?[a.div(g),b.div(g)]:[a,b]}var e=a("./num-to-bn"),f=a("./bn-sign");b.exports=d},{"./bn-sign":251,"./num-to-bn":255}],257:[function(a,b,c){"use strict";function d(a){return new e(a)}var e=a("bn.js");b.exports=d},{"bn.js":259}],258:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[0]),a[1].mul(b[1]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],259:[function(a,b,c){!function(a,b){"use strict";function c(a,b){if(!a)throw new Error(b||"Assertion failed")}function d(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}function e(a,b,c){return null!==a&&"object"==typeof a&&Array.isArray(a.words)?a:(this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==b&&"be"!==b||(c=b,b=10),void(null!==a&&this._init(a||0,b||10,c||"be")))}function f(a,b,c){for(var d=0,e=Math.min(a.length,c),f=b;e>f;f++){var g=a.charCodeAt(f)-48;d<<=4,d|=g>=49&&54>=g?g-49+10:g>=17&&22>=g?g-17+10:15&g}return d}function g(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;f>g;g++){var h=a.charCodeAt(g)-48;e*=d,e+=h>=49?h-49+10:h>=17?h-17+10:h}return e}function h(a,b){this.name=a,this.p=new e(b,16),this.n=this.p.bitLength(),this.k=new e(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function i(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function j(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function l(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function m(a){if("string"==typeof a){var b=e._prime(a);this.m=b.p,this.prime=b}else this.m=a,this.prime=null}function n(a){m.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new e(1).ishln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof a?a.exports=e:b.BN=e,e.BN=e,e.wordSize=26,e.prototype._init=function(a,b,d){if("number"==typeof a)return this._initNumber(a,b,d);if("object"==typeof a)return this._initArray(a,b,d);"hex"===b&&(b=16),c(b===(0|b)&&b>=2&&36>=b),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.sign=!0),this.strip(),"le"===d&&this._initArray(this.toArray(),b,d)},e.prototype._initNumber=function(a,b,d){0>a&&(this.sign=!0,a=-a),67108864>a?(this.words=[67108863&a],this.length=1):4503599627370496>a?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(c(9007199254740992>a),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===d&&this._initArray(this.toArray(),b,d)},e.prototype._initArray=function(a,b,d){if(c("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var f=0;if("be"===d)for(var e=a.length-1,g=0;e>=0;e-=3){var h=a[e]|a[e-1]<<8|a[e-2]<<16;this.words[g]|=h<<f&67108863,this.words[g+1]=h>>>26-f&67108863,f+=24,f>=26&&(f-=26,g++)}else if("le"===d)for(var e=0,g=0;e<a.length;e+=3){var h=a[e]|a[e+1]<<8|a[e+2]<<16;this.words[g]|=h<<f&67108863,this.words[g+1]=h>>>26-f&67108863,f+=24,f>=26&&(f-=26,g++)}return this.strip()},e.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;for(var d=0,c=a.length-6,e=0;c>=b;c-=6){var g=f(a,c,c+6);this.words[e]|=g<<d&67108863,this.words[e+1]|=g>>>26-d&4194303,d+=24,d>=26&&(d-=26,e++)}if(c+6!==b){var g=f(a,b,c+6);this.words[e]|=g<<d&67108863,this.words[e+1]|=g>>>26-d&4194303}this.strip()},e.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;67108863>=e;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,h=f%d,i=Math.min(f,f-h)+c,j=0,k=c;i>k;k+=d)j=g(a,k,k+d,b),this.imuln(e),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j);if(0!==h){for(var l=1,j=g(a,k,a.length,b),k=0;h>k;k++)l*=b;this.imuln(l),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j)}},e.prototype.copy=function(a){a.words=new Array(this.length);for(var b=0;b<this.length;b++)a.words[b]=this.words[b];a.length=this.length,a.sign=this.sign,a.red=this.red},e.prototype.clone=function(){var a=new e(null);return this.copy(a),a},e.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},e.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var o=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];e.prototype.toString=function(a,b){if(a=a||10,16===a||"hex"===a){for(var d="",e=0,b=0|b||1,f=0,g=0;g<this.length;g++){var h=this.words[g],i=(16777215&(h<<e|f)).toString(16);f=h>>>24-e&16777215,d=0!==f||g!==this.length-1?o[6-i.length]+i+d:i+d,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(d=f.toString(16)+d);d.length%b!==0;)d="0"+d;return this.sign&&(d="-"+d),d}if(a===(0|a)&&a>=2&&36>=a){var j=p[a],k=q[a],d="",l=this.clone();for(l.sign=!1;0!==l.cmpn(0);){var m=l.modn(k).toString(a);l=l.idivn(k),d=0!==l.cmpn(0)?o[j-m.length]+m+d:m+d}return 0===this.cmpn(0)&&(d="0"+d),this.sign&&(d="-"+d),d}c(!1,"Base should be between 2 and 36")},e.prototype.toJSON=function(){return this.toString(16)},e.prototype.toArray=function(a){this.strip();var b=new Array(this.byteLength());b[0]=0;var c=this.clone();if("le"!==a)for(var d=0;0!==c.cmpn(0);d++){var e=c.andln(255);c.ishrn(8),b[b.length-d-1]=e}else for(var d=0;0!==c.cmpn(0);d++){var e=c.andln(255);c.ishrn(8),b[d]=e}return b},Math.clz32?e.prototype._countBits=function(a){return 32-Math.clz32(a)}:e.prototype._countBits=function(a){var b=a,c=0;return b>=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},e.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},e.prototype.bitLength=function(){var a=0,b=this.words[this.length-1],a=this._countBits(b);return 26*(this.length-1)+a},e.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var a=0,b=0;b<this.length;b++){var c=this._zeroBits(this.words[b]);if(a+=c,26!==c)break}return a},e.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},e.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var a=this.clone();return a.sign=!this.sign,a},e.prototype.ior=function(a){for(this.sign=this.sign||a.sign;this.length<a.length;)this.words[this.length++]=0;for(var b=0;b<a.length;b++)this.words[b]=this.words[b]|a.words[b];return this.strip()},e.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},e.prototype.iand=function(a){this.sign=this.sign&&a.sign;var b;b=this.length>a.length?a:this;for(var c=0;c<b.length;c++)this.words[c]=this.words[c]&a.words[c];return this.length=b.length,this.strip()},e.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},e.prototype.ixor=function(a){this.sign=this.sign||a.sign;var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;d<c.length;d++)this.words[d]=b.words[d]^c.words[d];if(this!==b)for(;d<b.length;d++)this.words[d]=b.words[d];return this.length=b.length,this.strip()},e.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},e.prototype.setn=function(a,b){c("number"==typeof a&&a>=0);for(var d=a/26|0,e=a%26;this.length<=d;)this.words[this.length++]=0;return b?this.words[d]=this.words[d]|1<<e:this.words[d]=this.words[d]&~(1<<e),this.strip()},e.prototype.iadd=function(a){if(this.sign&&!a.sign){this.sign=!1;var b=this.isub(a);return this.sign=!this.sign,this._normSign()}if(!this.sign&&a.sign){a.sign=!1;var b=this.isub(a);return a.sign=!0,b._normSign()}var c,d;this.length>a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f<d.length;f++){var b=c.words[f]+d.words[f]+e;this.words[f]=67108863&b,e=b>>>26}for(;0!==e&&f<c.length;f++){var b=c.words[f]+e;this.words[f]=67108863&b,e=b>>>26}if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;f<c.length;f++)this.words[f]=c.words[f];return this},e.prototype.add=function(a){if(a.sign&&!this.sign){a.sign=!1;var b=this.sub(a);return a.sign=!0,b}if(!a.sign&&this.sign){this.sign=!1;var b=a.sub(this);return this.sign=!0,b}return this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},e.prototype.isub=function(a){if(a.sign){a.sign=!1;var b=this.iadd(a);return a.sign=!0,b._normSign()}if(this.sign)return this.sign=!1,this.iadd(a),this.sign=!0,this._normSign();var c=this.cmp(a);if(0===c)return this.sign=!1,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g<e.length;g++){var b=d.words[g]-e.words[g]+f;f=b>>26,this.words[g]=67108863&b}for(;0!==f&&g<d.length;g++){var b=d.words[g]+f;f=b>>26,this.words[g]=67108863&b}if(0===f&&g<d.length&&d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this.length=Math.max(this.length,g),d!==this&&(this.sign=!0),this.strip()},e.prototype.sub=function(a){return this.clone().isub(a)},e.prototype._smallMulTo=function(a,b){b.sign=a.sign!==this.sign,b.length=this.length+a.length;for(var c=0,d=0;d<b.length-1;d++){for(var e=c>>>26,f=67108863&c,g=Math.min(d,a.length-1),h=Math.max(0,d-this.length+1);g>=h;h++){var i=d-h,j=0|this.words[i],k=0|a.words[h],l=j*k,m=67108863&l;e=e+(l/67108864|0)|0,m=m+f|0,f=67108863&m,e=e+(m>>>26)|0}b.words[d]=f,c=e}return 0!==c?b.words[d]=c:b.length--,b.strip()},e.prototype._bigMulTo=function(a,b){b.sign=a.sign!==this.sign,b.length=this.length+a.length;for(var c=0,d=0,e=0;e<b.length-1;e++){var f=d;d=0;for(var g=67108863&c,h=Math.min(e,a.length-1),i=Math.max(0,e-this.length+1);h>=i;i++){var j=e-i,k=0|this.words[j],l=0|a.words[i],m=k*l,n=67108863&m;f=f+(m/67108864|0)|0,n=n+g|0,g=67108863&n,f=f+(n>>>26)|0,d+=f>>>26,f&=67108863}b.words[e]=g,c=f,f=d}return 0!==c?b.words[e]=c:b.length--,b.strip()},e.prototype.mulTo=function(a,b){var c;return c=this.length+a.length<63?this._smallMulTo(a,b):this._bigMulTo(a,b)},e.prototype.mul=function(a){var b=new e(null);return b.words=new Array(this.length+a.length),this.mulTo(a,b)},e.prototype.imul=function(a){if(0===this.cmpn(0)||0===a.cmpn(0))return this.words[0]=0,this.length=1,this;var b=this.length,c=a.length;this.sign=a.sign!==this.sign,this.length=this.length+a.length,this.words[this.length-1]=0;for(var d=this.length-2;d>=0;d--){for(var e=0,f=0,g=Math.min(d,c-1),h=Math.max(0,d-b+1);g>=h;h++){var i=d-h,j=this.words[i],k=a.words[h],l=j*k,m=67108863&l;e+=l/67108864|0,m+=f,f=67108863&m,e+=m>>>26}this.words[d]=f,this.words[d+1]+=e,e=0}for(var e=0,i=1;i<this.length;i++){var n=this.words[i]+e;this.words[i]=67108863&n,e=n>>>26}return this.strip()},e.prototype.imuln=function(a){c("number"==typeof a);for(var b=0,d=0;d<this.length;d++){var e=this.words[d]*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[d]=67108863&f}return 0!==b&&(this.words[d]=b,this.length++),this},e.prototype.muln=function(a){return this.clone().imuln(a)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.mul(this)},e.prototype.ishln=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26,e=67108863>>>26-b<<26-b;if(0!==b){for(var f=0,g=0;g<this.length;g++){var h=this.words[g]&e,i=this.words[g]-h<<b;this.words[g]=i|f,f=h>>>26-b}f&&(this.words[g]=f,this.length++)}if(0!==d){for(var g=this.length-1;g>=0;g--)this.words[g+d]=this.words[g];for(var g=0;d>g;g++)this.words[g]=0;this.length+=d}return this.strip()},e.prototype.ishrn=function(a,b,d){c("number"==typeof a&&a>=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=d;if(e-=g,e=Math.max(0,e),i){for(var j=0;g>j;j++)i.words[j]=this.words[j];i.length=g}if(0===g);else if(this.length>g){this.length-=g;for(var j=0;j<this.length;j++)this.words[j]=this.words[j+g]}else this.words[0]=0,this.length=1;for(var k=0,j=this.length-1;j>=0&&(0!==k||j>=e);j--){var l=this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},e.prototype.shln=function(a){return this.clone().ishln(a)},e.prototype.shrn=function(a){return this.clone().ishrn(a)},e.prototype.testn=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26,e=1<<b;if(this.length<=d)return!1;var f=this.words[d];return!!(f&e)},e.prototype.imaskn=function(a){c("number"==typeof a&&a>=0);var b=a%26,d=(a-b)/26;if(c(!this.sign,"imaskn works only with positive numbers"),0!==b&&d++,this.length=Math.min(d,this.length),0!==b){var e=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}return this.strip()},e.prototype.maskn=function(a){return this.clone().imaskn(a)},e.prototype.iaddn=function(a){return c("number"==typeof a),0>a?this.isubn(-a):this.sign?1===this.length&&this.words[0]<a?(this.words[0]=a-this.words[0],this.sign=!1,this):(this.sign=!1,this.isubn(a),this.sign=!0,this):this._iaddn(a)},e.prototype._iaddn=function(a){this.words[0]+=a;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},e.prototype.isubn=function(a){if(c("number"==typeof a),0>a)return this.iaddn(-a);if(this.sign)return this.sign=!1,this.iaddn(a),this.sign=!0,this;this.words[0]-=a;for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},e.prototype.addn=function(a){return this.clone().iaddn(a)},e.prototype.subn=function(a){return this.clone().isubn(a)},e.prototype.iabs=function(){return this.sign=!1,this},e.prototype.abs=function(){return this.clone().iabs()},e.prototype._ishlnsubmul=function(a,b,d){var e,f=a.length+d;if(this.words.length<f){for(var g=new Array(f),e=0;e<this.length;e++)g[e]=this.words[e];this.words=g}else e=this.length;for(this.length=Math.max(this.length,f);e<this.length;e++)this.words[e]=0;for(var h=0,e=0;e<a.length;e++){var i=this.words[e+d]+h,j=a.words[e]*b;i-=67108863&j,h=(i>>26)-(j/67108864|0),this.words[e+d]=67108863&i}for(;e<this.length-d;e++){var i=this.words[e+d]+h;h=i>>26,this.words[e+d]=67108863&i}if(0===h)return this.strip();c(-1===h),h=0;for(var e=0;e<this.length;e++){var i=-this.words[e]+h;h=i>>26,this.words[e]=67108863&i}return this.sign=!0,this.strip()},e.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),f=a,g=f.words[f.length-1],h=this._countBits(g);c=26-h,0!==c&&(f=f.shln(c),d.ishln(c),g=f.words[f.length-1]);var i,j=d.length-f.length;if("mod"!==b){i=new e(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k<i.length;k++)i.words[k]=0}var l=d.clone()._ishlnsubmul(f,1,j);l.sign||(d=l,i&&(i.words[j]=1));for(var m=j-1;m>=0;m--){var n=67108864*d.words[f.length+m]+d.words[f.length+m-1];for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(f,n,m);d.sign;)n--,d.sign=!1,d._ishlnsubmul(f,1,m),0!==d.cmpn(0)&&(d.sign=!d.sign);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.ishrn(c),{div:i?i:null,mod:d}},e.prototype.divmod=function(a,b){if(c(0!==a.cmpn(0)),this.sign&&!a.sign){var d,f,g=this.neg().divmod(a,b);return"mod"!==b&&(d=g.div.neg()),"div"!==b&&(f=0===g.mod.cmpn(0)?g.mod:a.sub(g.mod)),{div:d,mod:f}}if(!this.sign&&a.sign){var d,g=this.divmod(a.neg(),b);return"mod"!==b&&(d=g.div.neg()),{div:d,mod:g.mod}}return this.sign&&a.sign?this.neg().divmod(a.neg(),b):a.length>this.length||this.cmp(a)<0?{div:new e(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new e(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new e(this.modn(a.words[0]))}:this._wordDiv(a,b)},e.prototype.div=function(a){return this.divmod(a,"div").div},e.prototype.mod=function(a){return this.divmod(a,"mod").mod},e.prototype.divRound=function(a){var b=this.divmod(a);if(0===b.mod.cmpn(0))return b.div;var c=b.div.sign?b.mod.isub(a):b.mod,d=a.shrn(1),e=a.andln(1),f=c.cmp(d);return 0>f||1===e&&0===f?b.div:b.div.sign?b.div.isubn(1):b.div.iaddn(1)},e.prototype.modn=function(a){c(67108863>=a);for(var b=(1<<26)%a,d=0,e=this.length-1;e>=0;e--)d=(b*d+this.words[e])%a;return d},e.prototype.idivn=function(a){c(67108863>=a);for(var b=0,d=this.length-1;d>=0;d--){var e=this.words[d]+67108864*b;this.words[d]=e/a|0,b=e%a}return this.strip()},e.prototype.divn=function(a){return this.clone().idivn(a)},e.prototype.egcd=function(a){c(!a.sign),c(0!==a.cmpn(0));var b=this,d=a.clone();b=b.sign?b.mod(a):b.clone();for(var f=new e(1),g=new e(0),h=new e(0),i=new e(1),j=0;b.isEven()&&d.isEven();)b.ishrn(1),d.ishrn(1),++j;for(var k=d.clone(),l=b.clone();0!==b.cmpn(0);){for(;b.isEven();)b.ishrn(1),f.isEven()&&g.isEven()?(f.ishrn(1),g.ishrn(1)):(f.iadd(k).ishrn(1),g.isub(l).ishrn(1));for(;d.isEven();)d.ishrn(1),h.isEven()&&i.isEven()?(h.ishrn(1),i.ishrn(1)):(h.iadd(k).ishrn(1),i.isub(l).ishrn(1));b.cmp(d)>=0?(b.isub(d),f.isub(h),g.isub(i)):(d.isub(b),h.isub(f),i.isub(g))}return{a:h,b:i,gcd:d.ishln(j)}},e.prototype._invmp=function(a){c(!a.sign),c(0!==a.cmpn(0));var b=this,d=a.clone();b=b.sign?b.mod(a):b.clone();for(var f=new e(1),g=new e(0),h=d.clone();b.cmpn(1)>0&&d.cmpn(1)>0;){for(;b.isEven();)b.ishrn(1),f.isEven()?f.ishrn(1):f.iadd(h).ishrn(1);for(;d.isEven();)d.ishrn(1),g.isEven()?g.ishrn(1):g.iadd(h).ishrn(1);b.cmp(d)>=0?(b.isub(d),f.isub(g)):(d.isub(b),g.isub(f))}return 0===b.cmpn(1)?f:g},e.prototype.gcd=function(a){if(0===this.cmpn(0))return a.clone();if(0===a.cmpn(0))return this.clone();var b=this.clone(),c=a.clone();b.sign=!1,c.sign=!1;for(var d=0;b.isEven()&&c.isEven();d++)b.ishrn(1),c.ishrn(1);for(;;){for(;b.isEven();)b.ishrn(1);for(;c.isEven();)c.ishrn(1);var e=b.cmp(c);if(0>e){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.ishln(d)},e.prototype.invm=function(a){return this.egcd(a).a.mod(a)},e.prototype.isEven=function(){return 0===(1&this.words[0])},e.prototype.isOdd=function(){return 1===(1&this.words[0])},e.prototype.andln=function(a){return this.words[0]&a},e.prototype.bincn=function(a){c("number"==typeof a);var b=a%26,d=(a-b)/26,e=1<<b;if(this.length<=d){for(var f=this.length;d+1>f;f++)this.words[f]=0;return this.words[d]|=e,this.length=d+1,this}for(var g=e,f=d;0!==g&&f<this.length;f++){var h=this.words[f];h+=g,g=h>>>26,h&=67108863,this.words[f]=h}return 0!==g&&(this.words[f]=g,this.length++),this},e.prototype.cmpn=function(a){var b=0>a;if(b&&(a=-a),this.sign&&!b)return-1;if(!this.sign&&b)return 1;a&=67108863,this.strip();var c;if(this.length>1)c=1;else{var d=this.words[0];c=d===a?0:a>d?-1:1}return this.sign&&(c=-c),c},e.prototype.cmp=function(a){if(this.sign&&!a.sign)return-1;if(!this.sign&&a.sign)return 1;var b=this.ucmp(a);return this.sign?-b:b},e.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var b=0,c=this.length-1;c>=0;c--){var d=this.words[c],e=a.words[c];if(d!==e){e>d?b=-1:d>e&&(b=1);break}}return b},e.red=function(a){return new m(a)},e.prototype.toRed=function(a){return c(!this.red,"Already a number in reduction context"),c(!this.sign,"red works only with positives"),a.convertTo(this)._forceRed(a)},e.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(a){return this.red=a,this},e.prototype.forceRed=function(a){return c(!this.red,"Already a number in reduction context"),this._forceRed(a)},e.prototype.redAdd=function(a){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},e.prototype.redIAdd=function(a){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},e.prototype.redSub=function(a){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},e.prototype.redISub=function(a){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},e.prototype.redShl=function(a){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},e.prototype.redMul=function(a){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},e.prototype.redIMul=function(a){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},e.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(a){return c(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var r={k256:null,p224:null,p192:null,p25519:null};h.prototype._tmp=function(){var a=new e(null);return a.words=new Array(Math.ceil(this.n/13)),a},h.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b<this.n?-1:c.ucmp(this.p);return 0===d?(c.words[0]=0,c.length=1):d>0?c.isub(this.p):c.strip(),c},h.prototype.split=function(a,b){a.ishrn(this.n,0,b)},h.prototype.imulK=function(a){return a.imul(this.k)},d(i,h),i.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;d>e;e++)b.words[e]=a.words[e];if(b.length=d,a.length<=9)return a.words[0]=0,void(a.length=1);var f=a.words[9];b.words[b.length++]=f&c;for(var e=10;e<a.length;e++){var g=a.words[e];a.words[e-10]=(g&c)<<4|f>>>22,f=g}a.words[e-10]=f>>>22,a.length-=9},i.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b,c=0,d=0;d<a.length;d++){var e=a.words[d];b=64*e,c+=977*e,b+=c/67108864|0,c&=67108863,a.words[d]=c,c=b}return 0===a.words[a.length-1]&&(a.length--,0===a.words[a.length-1]&&a.length--),a},d(j,h),d(k,h),d(l,h),l.prototype.imulK=function(a){for(var b=0,c=0;c<a.length;c++){var d=19*a.words[c]+b,e=67108863&d;d>>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},e._prime=function s(a){if(r[a])return r[a];var s;if("k256"===a)s=new i;else if("p224"===a)s=new j;else if("p192"===a)s=new k;else{if("p25519"!==a)throw new Error("Unknown prime "+a);s=new l}return r[a]=s,s},m.prototype._verify1=function(a){c(!a.sign,"red works only with positives"),c(a.red,"red works only with red numbers")},m.prototype._verify2=function(a,b){c(!a.sign&&!b.sign,"red works only with positives"),c(a.red&&a.red===b.red,"red works only with red numbers")},m.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.mod(this.m)._forceRed(this)},m.prototype.neg=function(a){var b=a.clone();return b.sign=!b.sign,b.iadd(this.m)._forceRed(this)},m.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},m.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},m.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},m.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},m.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.shln(b))},m.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},m.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},m.prototype.isqr=function(a){return this.imul(a,a)},m.prototype.sqr=function(a){return this.mul(a,a)},m.prototype.sqrt=function(a){if(0===a.cmpn(0))return a.clone();var b=this.m.andln(3);if(c(b%2===1),3===b){var d=this.m.add(new e(1)).ishrn(2),f=this.pow(a,d);return f}for(var g=this.m.subn(1),h=0;0!==g.cmpn(0)&&0===g.andln(1);)h++,g.ishrn(1);c(0!==g.cmpn(0));var i=new e(1).toRed(this),j=i.redNeg(),k=this.m.subn(1).ishrn(1),l=this.m.bitLength();for(l=new e(2*l*l).toRed(this);0!==this.pow(l,k).cmp(j);)l.redIAdd(j);for(var m=this.pow(l,g),f=this.pow(a,g.addn(1).ishrn(1)),n=this.pow(a,g),o=h;0!==n.cmp(i);){for(var p=n,q=0;0!==p.cmp(i);q++)p=p.redSqr();c(o>q);var r=this.pow(m,new e(1).ishln(o-q-1));f=f.redMul(r),m=r.redSqr(),n=n.redMul(m),o=q}return f},m.prototype.invm=function(a){var b=a._invmp(this.m);return b.sign?(b.sign=!1,this.imod(b).redNeg()):this.imod(b)},m.prototype.pow=function(a,b){var c=[];if(0===b.cmpn(0))return new e(1);for(var d=b.clone();0!==d.cmpn(0);)c.push(d.andln(1)),d.ishrn(1);for(var f=a,g=0;g<c.length&&0===c[g];g++,f=this.sqr(f));if(++g<c.length)for(var d=this.sqr(f);g<c.length;g++,d=this.sqr(d))0!==c[g]&&(f=this.mul(f,d));return f},m.prototype.convertTo=function(a){var b=a.mod(this.m);return b===a?b.clone():b},m.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},e.mont=function(a){return new n(a)},d(n,m),n.prototype.convertTo=function(a){return this.imod(a.shln(this.shift))},n.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},n.prototype.imul=function(a,b){if(0===a.cmpn(0)||0===b.cmpn(0))return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).ishrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},n.prototype.mul=function(a,b){if(0===a.cmpn(0)||0===b.cmpn(0))return new e(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=c.isub(d).ishrn(this.shift),g=f;return f.cmp(this.m)>=0?g=f.isub(this.m):f.cmpn(0)<0&&(g=f.iadd(this.m)),g._forceRed(this)},n.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{}],260:[function(a,b,c){"use strict";function d(a){return e(a[0])*e(a[1])}var e=a("./lib/bn-sign");b.exports=d},{"./lib/bn-sign":251}],261:[function(a,b,c){"use strict";function d(a,b){return e(a[0].mul(b[1]).sub(a[1].mul(b[0])),a[1].mul(b[1]))}var e=a("./lib/rationalize");b.exports=d},{"./lib/rationalize":256}],262:[function(a,b,c){"use strict";function d(a){var b=a[0],c=a[1];if(0===b.cmpn(0))return 0;var d=b.divmod(c),g=d.div,h=e(g),i=d.mod;if(0===i.cmpn(0))return h;if(h){var j=f(h)+4,k=e(i.shln(j).divRound(c));return 0>h&&(k=-k),h+k*Math.pow(2,-j)}var l=c.bitLength()-i.bitLength()+53,k=e(i.shln(l).divRound(c));return 1023>l?k*Math.pow(2,-l):(k*=Math.pow(2,-1023),k*Math.pow(2,1023-l))}var e=a("./lib/bn-to-num"),f=a("./lib/ctz");b.exports=d},{"./lib/bn-to-num":252,"./lib/ctz":253}],263:[function(a,b,c){"use strict";function d(a,b){for(var c=0;a>c;++c)if(!(b[c]<=b[c+a]))return!0;return!1}function e(a,b,c,e){for(var f=0,g=0,h=0,i=a.length;i>h;++h){var j=a[h];if(!d(b,j)){for(var k=0;2*b>k;++k)c[f++]=j[k];e[g++]=h}}return g}function f(a,b,c,d){var f=a.length,g=b.length;if(!(0>=f||0>=g)){var h=a[0].length>>>1;if(!(0>=h)){var i,j=l.mallocDouble(2*h*f),k=l.mallocInt32(f);if(f=e(a,h,j,k),f>0){if(1===h&&d)m.init(f),i=m.sweepComplete(h,c,0,f,j,k,0,f,j,k);else{var o=l.mallocDouble(2*h*g),p=l.mallocInt32(g);g=e(b,h,o,p),g>0&&(m.init(f+g),i=1===h?m.sweepBipartite(h,c,0,f,j,k,0,g,o,p):n(h,c,d,f,j,k,g,o,p),l.free(o),l.free(p))}l.free(j),l.free(k)}return i}}}function g(a,b){k.push([a,b])}function h(a){return k=[],f(a,a,g,!0),k}function i(a,b){return k=[],f(a,b,g,!1),k}function j(a,b,c){switch(arguments.length){case 1:return h(a);case 2:return"function"==typeof b?f(a,a,b,!0):i(a,b);case 3:return f(a,b,c,!1);default:throw new Error("box-intersect: Invalid arguments")}}b.exports=j;var k,l=a("typedarray-pool"),m=a("./lib/sweep"),n=a("./lib/intersect")},{"./lib/intersect":265,"./lib/sweep":269,"typedarray-pool":233}],264:[function(a,b,c){"use strict";function d(a,b,c){var d="bruteForce"+(a?"Red":"Blue")+(b?"Flip":"")+(c?"Full":""),e=["function ",d,"(",w.join(),"){","var ",j,"=2*",f,";"],i="for(var i="+k+","+o+"="+j+"*"+k+";i<"+l+";++i,"+o+"+="+j+"){var x0="+m+"["+g+"+"+o+"],x1="+m+"["+g+"+"+o+"+"+f+"],xi="+n+"[i];",x="for(var j="+p+","+t+"="+j+"*"+p+";j<"+q+";++j,"+t+"+="+j+"){var y0="+r+"["+g+"+"+t+"],"+(c?"y1="+r+"["+g+"+"+t+"+"+f+"],":"")+"yi="+s+"[j];";return a?e.push(i,v,":",x):e.push(x,v,":",i),c?e.push("if(y1<x0||x1<y0)continue;"):b?e.push("if(y0<=x0||x1<y0)continue;"):e.push("if(y0<x0||x1<y0)continue;"),e.push("for(var k="+g+"+1;k<"+f+";++k){var r0="+m+"[k+"+o+"],r1="+m+"[k+"+f+"+"+o+"],b0="+r+"[k+"+t+"],b1="+r+"[k+"+f+"+"+t+"];if(r1<b0||b1<r0)continue "+v+";}var "+u+"="+h+"("),b?e.push("yi,xi"):e.push("xi,yi"),e.push(");if("+u+"!==void 0)return "+u+";}}}"),{name:d,code:e.join("")}}function e(a){function b(b,c){var f=d(b,c,a);e.push(f.code),g.push("return "+f.name+"("+w.join()+");"); 43 }var c="bruteForce"+(a?"Full":"Partial"),e=[],f=w.slice();a||f.splice(3,0,i);var g=["function "+c+"("+f.join()+"){"];g.push("if("+l+"-"+k+">"+q+"-"+p+"){"),a?(b(!0,!1),g.push("}else{"),b(!1,!1)):(g.push("if("+i+"){"),b(!0,!0),g.push("}else{"),b(!0,!1),g.push("}}else{if("+i+"){"),b(!1,!0),g.push("}else{"),b(!1,!1),g.push("}")),g.push("}}return "+c);var h=e.join("")+g.join(""),j=new Function(h);return j()}var f="d",g="ax",h="vv",i="fp",j="es",k="rs",l="re",m="rb",n="ri",o="rp",p="bs",q="be",r="bb",s="bi",t="bp",u="rv",v="Q",w=[f,g,h,k,l,m,n,p,q,r,s];c.partial=e(!1),c.full=e(!0)},{}],265:[function(a,b,c){"use strict";function d(a,b){var c=8*j.log2(b+1)*(a+1)|0,d=j.nextPow2(z*c);C.length<d&&(i.free(C),C=i.mallocInt32(d));var e=j.nextPow2(A*c);e>D&&(i.free(D),D=i.mallocDouble(e))}function e(a,b,c,d,e,f,g,h,i){var j=z*a;C[j]=b,C[j+1]=c,C[j+2]=d,C[j+3]=e,C[j+4]=f,C[j+5]=g;var k=A*a;D[k]=h,D[k+1]=i}function f(a,b,c,d,e,f,g,h,i,j,k){var l=2*a,m=i*l,n=j[m+b];a:for(var o=e,p=e*l;f>o;++o,p+=l){var q=g[p+b],r=g[p+b+a];if(!(q>n||n>r||d&&n===q)){for(var s=h[o],t=b+1;a>t;++t){var q=g[p+t],r=g[p+t+a],u=j[m+t],v=j[m+t+a];if(u>r||q>v)continue a}var w;if(w=d?c(k,s):c(s,k),void 0!==w)return w}}}function g(a,b,c,d,e,f,g,h,i,j){var k=2*a,l=h*k,m=i[l+b];a:for(var n=d,o=d*k;e>n;++n,o+=k){var p=g[n];if(p!==j){var q=f[o+b],r=f[o+b+a];if(!(q>m||m>r)){for(var s=b+1;a>s;++s){var q=f[o+s],r=f[o+s+a],t=i[l+s],u=i[l+s+a];if(t>r||q>u)continue a}var v=c(p,j);if(void 0!==v)return v}}}}function h(a,b,c,h,i,j,k,p,B){d(a,h+k);var E,F=0,G=2*a;for(e(F++,0,0,h,0,k,c?16:0,-(1/0),1/0),c||e(F++,0,0,k,0,h,1,-(1/0),1/0);F>0;){F-=1;var H=F*z,I=C[H],J=C[H+1],K=C[H+2],L=C[H+3],M=C[H+4],N=C[H+5],O=F*A,P=D[O],Q=D[O+1],R=1&N,S=!!(16&N),T=i,U=j,V=p,W=B;if(R&&(T=p,U=B,V=i,W=j),!(2&N&&(K=v(a,I,J,K,T,U,Q),J>=K)||4&N&&(J=w(a,I,J,K,T,U,P),J>=K))){var X=K-J,Y=M-L;if(S){if(s>a*X*(X+Y)){if(E=n.scanComplete(a,I,b,J,K,T,U,L,M,V,W),void 0!==E)return E;continue}}else{if(a*Math.min(X,Y)<q){if(E=l(a,I,b,R,J,K,T,U,L,M,V,W),void 0!==E)return E;continue}if(r>a*X*Y){if(E=n.scanBipartite(a,I,b,R,J,K,T,U,L,M,V,W),void 0!==E)return E;continue}}var Z=t(a,I,J,K,T,U,P,Q);if(Z>J)if(q>a*(Z-J)){if(E=m(a,I+1,b,J,Z,T,U,L,M,V,W),void 0!==E)return E}else if(I===a-2){if(E=R?n.sweepBipartite(a,b,L,M,V,W,J,Z,T,U):n.sweepBipartite(a,b,J,Z,T,U,L,M,V,W),void 0!==E)return E}else e(F++,I+1,J,Z,L,M,R,-(1/0),1/0),e(F++,I+1,L,M,J,Z,1^R,-(1/0),1/0);if(K>Z){var $=o(a,I,L,M,V,W),_=V[G*$+I],aa=u(a,I,$,M,V,W,_);if(M>aa&&e(F++,I,Z,K,aa,M,(4|R)+(S?16:0),_,Q),$>L&&e(F++,I,Z,K,L,$,(2|R)+(S?16:0),P,_),$+1===aa){if(E=S?g(a,I,b,Z,K,T,U,$,V,W[$]):f(a,I,b,R,Z,K,T,U,$,V,W[$]),void 0!==E)return E}else if(aa>$){var ba;if(S){if(ba=x(a,I,Z,K,T,U,_),ba>Z){var ca=u(a,I,Z,ba,T,U,_);if(I===a-2){if(ca>Z&&(E=n.sweepComplete(a,b,Z,ca,T,U,$,aa,V,W),void 0!==E))return E;if(ba>ca&&(E=n.sweepBipartite(a,b,ca,ba,T,U,$,aa,V,W),void 0!==E))return E}else ca>Z&&e(F++,I+1,Z,ca,$,aa,16,-(1/0),1/0),ba>ca&&(e(F++,I+1,ca,ba,$,aa,0,-(1/0),1/0),e(F++,I+1,$,aa,ca,ba,1,-(1/0),1/0))}}else ba=R?y(a,I,Z,K,T,U,_):x(a,I,Z,K,T,U,_),ba>Z&&(I===a-2?E=R?n.sweepBipartite(a,b,$,aa,V,W,Z,ba,T,U):n.sweepBipartite(a,b,Z,ba,T,U,$,aa,V,W):(e(F++,I+1,Z,ba,$,aa,R,-(1/0),1/0),e(F++,I+1,$,aa,Z,ba,1^R,-(1/0),1/0)))}}}}}b.exports=h;var i=a("typedarray-pool"),j=a("bit-twiddle"),k=a("./brute"),l=k.partial,m=k.full,n=a("./sweep"),o=a("./median"),p=a("./partition"),q=128,r=1<<22,s=1<<22,t=p("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),u=p("lo===p0",["p0"]),v=p("lo<p0",["p0"]),w=p("hi<=p0",["p0"]),x=p("lo<=p0&&p0<=hi",["p0"]),y=p("lo<p0&&p0<=hi",["p0"]),z=6,A=2,B=1024,C=i.mallocInt32(B),D=i.mallocDouble(B)},{"./brute":264,"./median":266,"./partition":267,"./sweep":269,"bit-twiddle":49,"typedarray-pool":233}],266:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){for(var g=2*a,h=g*(c+1)+b,i=c+1;d>i;++i,h+=g)for(var j=e[h],k=i,l=g*(i-1);k>c&&e[l+b]>j;--k,l-=g){for(var m=l,n=l+g,o=0;g>o;++o,++m,++n){var p=e[m];e[m]=e[n],e[n]=p}var q=f[k];f[k]=f[k-1],f[k-1]=q}}function e(a,b,c,e,f,i){if(c+1>=e)return c;for(var j=c,k=e,l=e+c>>>1,m=2*a,n=l,o=f[m*l+b];k>j;){if(h>k-j){d(a,b,j,k,f,i),o=f[m*l+b];break}var p=k-j,q=Math.random()*p+j|0,r=f[m*q+b],s=Math.random()*p+j|0,t=f[m*s+b],u=Math.random()*p+j|0,v=f[m*u+b];t>=r?v>=t?(n=s,o=t):r>=v?(n=q,o=r):(n=u,o=v):t>=v?(n=s,o=t):v>=r?(n=q,o=r):(n=u,o=v);for(var w=m*(k-1),x=m*n,y=0;m>y;++y,++w,++x){var z=f[w];f[w]=f[x],f[x]=z}var A=i[k-1];i[k-1]=i[n],i[n]=A,n=g(a,b,j,k-1,f,i,o);for(var w=m*(k-1),x=m*n,y=0;m>y;++y,++w,++x){var z=f[w];f[w]=f[x],f[x]=z}var A=i[k-1];if(i[k-1]=i[n],i[n]=A,n>l){for(k=n-1;k>j&&f[m*(k-1)+b]===o;)k-=1;k+=1}else{if(!(l>n))break;for(j=n+1;k>j&&f[m*j+b]===o;)j+=1}}return g(a,b,c,l,f,i,f[m*l+b])}b.exports=e;var f=a("./partition"),g=f("lo<p0",["p0"]),h=8},{"./partition":267}],267:[function(a,b,c){"use strict";function d(a,b){var c="abcdef".split("").concat(b),d=[];return a.indexOf("lo")>=0&&d.push("lo=e[k+n]"),a.indexOf("hi")>=0&&d.push("hi=e[k+o]"),c.push(e.replace("_",d.join()).replace("$",a)),Function.apply(void 0,c)}b.exports=d;var e="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],268:[function(a,b,c){"use strict";function d(a,b){4*m>=b?e(0,b-1,a):l(0,b-1,a)}function e(a,b,c){for(var d=2*(a+1),e=a+1;b>=e;++e){for(var f=c[d++],g=c[d++],h=e,i=d-2;h-- >a;){var j=c[i-2],k=c[i-1];if(f>j)break;if(j===f&&g>k)break;c[i]=j,c[i+1]=k,i-=2}c[i]=f,c[i+1]=g}}function f(a,b,c){a*=2,b*=2;var d=c[a],e=c[a+1];c[a]=c[b],c[a+1]=c[b+1],c[b]=d,c[b+1]=e}function g(a,b,c){a*=2,b*=2,c[a]=c[b],c[a+1]=c[b+1]}function h(a,b,c,d){a*=2,b*=2,c*=2;var e=d[a],f=d[a+1];d[a]=d[b],d[a+1]=d[b+1],d[b]=d[c],d[b+1]=d[c+1],d[c]=e,d[c+1]=f}function i(a,b,c,d,e){a*=2,b*=2,e[a]=e[b],e[b]=c,e[a+1]=e[b+1],e[b+1]=d}function j(a,b,c){a*=2,b*=2;var d=c[a],e=c[b];return e>d?!1:d===e?c[a+1]>c[b+1]:!0}function k(a,b,c,d){a*=2;var e=d[a];return b>e?!0:e===b?d[a+1]<c:!1}function l(a,b,c){var d=(b-a+1)/6|0,n=a+d,o=b-d,p=a+b>>1,q=p-d,r=p+d,s=n,t=q,u=p,v=r,w=o,x=a+1,y=b-1,z=0;j(s,t,c)&&(z=s,s=t,t=z),j(v,w,c)&&(z=v,v=w,w=z),j(s,u,c)&&(z=s,s=u,u=z),j(t,u,c)&&(z=t,t=u,u=z),j(s,v,c)&&(z=s,s=v,v=z),j(u,v,c)&&(z=u,u=v,v=z),j(t,w,c)&&(z=t,t=w,w=z),j(t,u,c)&&(z=t,t=u,u=z),j(v,w,c)&&(z=v,v=w,w=z);for(var A=c[2*t],B=c[2*t+1],C=c[2*v],D=c[2*v+1],E=2*s,F=2*u,G=2*w,H=2*n,I=2*p,J=2*o,K=0;2>K;++K){var L=c[E+K],M=c[F+K],N=c[G+K];c[H+K]=L,c[I+K]=M,c[J+K]=N}g(q,a,c),g(r,b,c);for(var O=x;y>=O;++O)if(k(O,A,B,c))O!==x&&f(O,x,c),++x;else if(!k(O,C,D,c))for(;;){if(k(y,C,D,c)){k(y,A,B,c)?(h(O,x,y,c),++x,--y):(f(O,y,c),--y);break}if(--y<O)break}i(a,x-1,A,B,c),i(b,y+1,C,D,c),m>=x-2-a?e(a,x-2,c):l(a,x-2,c),m>=b-(y+2)?e(y+2,b,c):l(y+2,b,c),m>=y-x?e(x,y,c):l(x,y,c)}b.exports=d;var m=32},{}],269:[function(a,b,c){"use strict";function d(a){var b=l.nextPow2(a);p.length<b&&(k.free(p),p=k.mallocInt32(b)),q.length<b&&(k.free(q),q=k.mallocInt32(b)),r.length<b&&(k.free(r),r=k.mallocInt32(b)),s.length<b&&(k.free(s),s=k.mallocInt32(b)),t.length<b&&(k.free(t),t=k.mallocInt32(b)),u.length<b&&(k.free(u),u=k.mallocInt32(b));var c=8*b;v.length<c&&(k.free(v),v=k.mallocDouble(c))}function e(a,b,c,d){var e=b[d],f=a[c-1];a[e]=f,b[f]=e}function f(a,b,c,d){a[c]=d,b[d]=c}function g(a,b,c,d,g,h,i,j,k,l){for(var o=0,t=2*a,u=a-1,w=t-1,x=c;d>x;++x){var y=h[x],z=t*x;v[o++]=g[z+u],v[o++]=-(y+1),v[o++]=g[z+w],v[o++]=y}for(var x=i;j>x;++x){var y=l[x]+n,A=t*x;v[o++]=k[A+u],v[o++]=-y,v[o++]=k[A+w],v[o++]=y}var B=o>>>1;m(v,B);for(var C=0,D=0,x=0;B>x;++x){var E=0|v[2*x+1];if(E>=n)E=E-n|0,e(r,s,D--,E);else if(E>=0)e(p,q,C--,E);else if(-n>=E){E=-E-n|0;for(var F=0;C>F;++F){var G=b(p[F],E);if(void 0!==G)return G}f(r,s,D++,E)}else{E=-E-1|0;for(var F=0;D>F;++F){var G=b(E,r[F]);if(void 0!==G)return G}f(p,q,C++,E)}}}function h(a,b,c,d,g,h,i,j,k,l){for(var n=0,o=2*a,w=a-1,x=o-1,y=c;d>y;++y){var z=h[y]+1<<1,A=o*y;v[n++]=g[A+w],v[n++]=-z,v[n++]=g[A+x],v[n++]=z}for(var y=i;j>y;++y){var z=l[y]+1<<1,B=o*y;v[n++]=k[B+w],v[n++]=1|-z,v[n++]=k[B+x],v[n++]=1|z}var C=n>>>1;m(v,C);for(var D=0,E=0,F=0,y=0;C>y;++y){var G=0|v[2*y+1],H=1&G;if(C-1>y&&G>>1===v[2*y+3]>>1&&(H=2,y+=1),0>G){for(var I=-(G>>1)-1,J=0;F>J;++J){var K=b(t[J],I);if(void 0!==K)return K}if(0!==H)for(var J=0;D>J;++J){var K=b(p[J],I);if(void 0!==K)return K}if(1!==H)for(var J=0;E>J;++J){var K=b(r[J],I);if(void 0!==K)return K}0===H?f(p,q,D++,I):1===H?f(r,s,E++,I):2===H&&f(t,u,F++,I)}else{var I=(G>>1)-1;0===H?e(p,q,D--,I):1===H?e(r,s,E--,I):2===H&&e(t,u,F--,I)}}}function i(a,b,c,d,g,h,i,j,k,l,o,r){var s=0,t=2*a,u=b,w=b+a,x=1,y=1;d?y=n:x=n;for(var z=g;h>z;++z){var A=z+x,B=t*z;v[s++]=i[B+u],v[s++]=-A,v[s++]=i[B+w],v[s++]=A}for(var z=k;l>z;++z){var A=z+y,C=t*z;v[s++]=o[C+u],v[s++]=-A}var D=s>>>1;m(v,D);for(var E=0,z=0;D>z;++z){var F=0|v[2*z+1];if(0>F){var A=-F,G=!1;if(A>=n?(G=!d,A-=n):(G=!!d,A-=1),G)f(p,q,E++,A);else{var H=r[A],I=t*A,J=o[I+b+1],K=o[I+b+1+a];a:for(var L=0;E>L;++L){var M=p[L],N=t*M;if(!(K<i[N+b+1]||i[N+b+1+a]<J)){for(var O=b+2;a>O;++O)if(o[I+O+a]<i[N+O]||i[N+O+a]<o[I+O])continue a;var P,Q=j[M];if(P=d?c(H,Q):c(Q,H),void 0!==P)return P}}}}else e(p,q,E--,F-x)}}function j(a,b,c,d,e,f,g,h,i,j,k){for(var l=0,o=2*a,q=b,r=b+a,s=d;e>s;++s){var t=s+n,u=o*s;v[l++]=f[u+q],v[l++]=-t,v[l++]=f[u+r],v[l++]=t}for(var s=h;i>s;++s){var t=s+1,w=o*s;v[l++]=j[w+q],v[l++]=-t}var x=l>>>1;m(v,x);for(var y=0,s=0;x>s;++s){var z=0|v[2*s+1];if(0>z){var t=-z;if(t>=n)p[y++]=t-n;else{t-=1;var A=k[t],B=o*t,C=j[B+b+1],D=j[B+b+1+a];a:for(var E=0;y>E;++E){var F=p[E],G=g[F];if(G===A)break;var H=o*F;if(!(D<f[H+b+1]||f[H+b+1+a]<C)){for(var I=b+2;a>I;++I)if(j[B+I+a]<f[H+I]||f[H+I+a]<j[B+I])continue a;var J=c(G,A);if(void 0!==J)return J}}}}else{for(var t=z-n,E=y-1;E>=0;--E)if(p[E]===t){for(var I=E+1;y>I;++I)p[I-1]=p[I];break}--y}}}b.exports={init:d,sweepBipartite:g,sweepComplete:h,scanBipartite:i,scanComplete:j};var k=a("typedarray-pool"),l=a("bit-twiddle"),m=a("./sort"),n=1<<28,o=1024,p=k.mallocInt32(o),q=k.mallocInt32(o),r=k.mallocInt32(o),s=k.mallocInt32(o),t=k.mallocInt32(o),u=k.mallocInt32(o),v=k.mallocDouble(8*o)},{"./sort":268,"bit-twiddle":49,"typedarray-pool":233}],270:[function(a,b,c){(function(a){function c(a,b){return n[0]=a,n[1]=b,m[0]}function d(a){return m[0]=a,n[0]}function e(a){return m[0]=a,n[1]}function f(a,b){return n[1]=a,n[0]=b,m[0]}function g(a){return m[0]=a,n[1]}function h(a){return m[0]=a,n[0]}function i(a,b){return o.writeUInt32LE(a,0,!0),o.writeUInt32LE(b,4,!0),o.readDoubleLE(0,!0)}function j(a){return o.writeDoubleLE(a,0,!0),o.readUInt32LE(0,!0)}function k(a){return o.writeDoubleLE(a,0,!0),o.readUInt32LE(4,!0)}var l=!1;if("undefined"!=typeof Float64Array){var m=new Float64Array(1),n=new Uint32Array(m.buffer);m[0]=1,l=!0,1072693248===n[1]?(b.exports=function(a){return m[0]=a,[n[0],n[1]]},b.exports.pack=c,b.exports.lo=d,b.exports.hi=e):1072693248===n[0]?(b.exports=function(a){return m[0]=a,[n[1],n[0]]},b.exports.pack=f,b.exports.lo=g,b.exports.hi=h):l=!1}if(!l){var o=new a(8);b.exports=function(a){return o.writeDoubleLE(a,0,!0),[o.readUInt32LE(0,!0),o.readUInt32LE(4,!0)]},b.exports.pack=i,b.exports.lo=j,b.exports.hi=k}b.exports.sign=function(a){return b.exports.hi(a)>>>31},b.exports.exponent=function(a){var c=b.exports.hi(a);return(c<<1>>>21)-1023},b.exports.fraction=function(a){var c=b.exports.lo(a),d=b.exports.hi(a),e=1048575&d;return 2146435072&d&&(e+=1<<20),[c,e]},b.exports.denormalized=function(a){var c=b.exports.hi(a);return!(2146435072&c)}}).call(this,a("buffer").Buffer)},{buffer:50}],271:[function(a,b,c){"use strict";function d(a,b){if(isNaN(a)||isNaN(b))return NaN;if(a===b)return a;if(0===a)return 0>b?-f:f;var c=e.hi(a),d=e.lo(a);return b>a==a>0?d===g?(c+=1,d=0):d+=1:0===d?(d=g,c-=1):d-=1,e.pack(d,c)}var e=a("double-bits"),f=Math.pow(2,-1074),g=-1>>>0;b.exports=d},{"double-bits":270}],272:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),f=0;c>f;++f)d[f]=e(a[f],b[f]);return d}var e=a("big-rat/add");b.exports=d},{"big-rat/add":246}],273:[function(a,b,c){"use strict";function d(a){for(var b=new Array(a.length),c=0;c<a.length;++c)b[c]=e(a[c]);return b}b.exports=d;var e=a("big-rat")},{"big-rat":249}],274:[function(a,b,c){"use strict";function d(a,b){for(var c=e(b),d=a.length,g=new Array(d),h=0;d>h;++h)g[h]=f(a[h],c);return g}var e=a("big-rat"),f=a("big-rat/mul");b.exports=d},{"big-rat":249,"big-rat/mul":258}],275:[function(a,b,c){"use strict";function d(a,b){for(var c=a.length,d=new Array(c),f=0;c>f;++f)d[f]=e(a[f],b[f]);return d}var e=a("big-rat/sub");b.exports=d},{"big-rat/sub":261}],276:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=0;2>e;++e){var f=a[e],g=b[e],h=Math.min(f,g),i=Math.max(f,g),j=c[e],k=d[e],l=Math.min(j,k),m=Math.max(j,k);if(h>m||l>i)return!1}return!0}function e(a,b,c,e){var g=f(a,c,e),h=f(b,c,e);if(g>0&&h>0||0>g&&0>h)return!1;var i=f(c,a,b),j=f(e,a,b);return i>0&&j>0||0>i&&0>j?!1:0===g&&0===h&&0===i&&0===j?d(a,b,c,e):!0}b.exports=e;var f=a("robust-orientation")[3]},{"robust-orientation":214}],277:[function(a,b,c){arguments[4][193][0].apply(c,arguments)},{dup:193}],278:[function(a,b,c){"use strict";function d(a,b){for(var c=e(a,b.length),d=new Array(b.length),f=new Array(b.length),g=[],h=0;h<b.length;++h){var i=c[h].length;f[h]=i,d[h]=!0,1>=i&&g.push(h)}for(;g.length>0;){var j=g.pop();d[j]=!1;for(var k=c[j],h=0;h<k.length;++h){var l=k[h];0===--f[l]&&g.push(l)}}for(var m=new Array(b.length),n=[],h=0;h<b.length;++h)if(d[h]){var j=n.length;m[h]=j,n.push(b[h])}else m[h]=-1;for(var o=[],h=0;h<a.length;++h){var p=a[h];d[p[0]]&&d[p[1]]&&o.push([m[p[0]],m[p[1]]])}return[o,n]}b.exports=d;var e=a("edges-to-adjacency-list")},{"edges-to-adjacency-list":279}],279:[function(a,b,c){"use strict";function d(a,b){var c=a.length;if("number"!=typeof b){b=0;for(var d=0;c>d;++d){var f=a[d];b=Math.max(b,f[0],f[1])}b=(0|b)+1}b=0|b;for(var g=new Array(b),d=0;b>d;++d)g[d]=[];for(var d=0;c>d;++d){var f=a[d];g[f[0]].push(f[1]),g[f[1]].push(f[0])}for(var h=0;b>h;++h)e(g[h],function(a,b){return a-b});return g}b.exports=d;var e=a("uniq")},{uniq:234}],280:[function(a,b,c){"use strict";function d(a,b){function c(a,b){var c=j[b][a[b]];c.splice(c.indexOf(a),1)}function d(a,d,f){for(var g,h,i,k=0;2>k;++k)if(j[k][d].length>0){g=j[k][d][0],i=k;break}h=g[1^i];for(var l=0;2>l;++l)for(var m=j[l][d],n=0;n<m.length;++n){var o=m[n],p=o[1^l],q=e(b[a],b[d],b[h],b[p]);q>0&&(g=o,h=p,i=l)}return f?h:(g&&c(g,i),h)}function f(a,f){var g=j[f][a][0],h=[a];c(g,f);for(var i=g[1^f];;){for(;i!==a;)h.push(i),i=d(h[h.length-2],i,!1);if(j[0][a].length+j[1][a].length===0)break;var k=h[h.length-1],l=a,m=h[1],n=d(k,l,!0);if(e(b[k],b[l],b[m],b[n])<0)break;h.push(a),i=d(k,l)}return h}function g(a,b){return b[1]===b[b.length-1]}for(var h=0|b.length,i=a.length,j=[new Array(h),new Array(h)],k=0;h>k;++k)j[0][k]=[],j[1][k]=[];for(var k=0;i>k;++k){var l=a[k];j[0][l[0]].push(l),j[1][l[1]].push(l)}for(var m=[],k=0;h>k;++k)j[0][k].length+j[1][k].length===0&&m.push([k]);for(var k=0;h>k;++k)for(var n=0;2>n;++n){for(var o=[];j[n][k].length>0;){var p=(j[0][k].length,f(k,n));g(o,p)?o.push.apply(o,p):(o.length>0&&m.push(o),o=p)}o.length>0&&m.push(o)}return m}b.exports=d;var e=a("compare-angle")},{"compare-angle":281}],281:[function(a,b,c){"use strict";function d(a,b,c){var d=h(a[0],-b[0]),e=h(a[1],-b[1]),f=h(c[0],-b[0]),g=h(c[1],-b[1]),k=j(i(d,f),i(e,g));return k[k.length-1]>=0}function e(a,b,c,e){var h=f(b,c,e);if(0===h){var i=g(f(a,b,c)),j=g(f(a,b,e));if(i===j){if(0===i){var k=d(a,b,c),l=d(a,b,e);return k===l?0:k?1:-1}return 0}return 0===j?i>0?-1:d(a,b,e)?-1:1:0===i?j>0?1:d(a,b,c)?1:-1:g(j-i)}var m=f(a,b,c);if(m>0)return h>0&&f(a,b,e)>0?1:-1;if(0>m)return h>0||f(a,b,e)>0?1:-1;var n=f(a,b,e);return n>0?1:d(a,b,c)?1:-1}b.exports=e;var f=a("robust-orientation"),g=a("signum"),h=a("two-sum"),i=a("robust-product"),j=a("robust-sum")},{"robust-orientation":214,"robust-product":282,"robust-sum":217,signum:283,"two-sum":232}],282:[function(a,b,c){"use strict";function d(a,b){if(1===a.length)return f(b,a[0]);if(1===b.length)return f(a,b[0]);if(0===a.length||0===b.length)return[0];var c=[0];if(a.length<b.length)for(var d=0;d<a.length;++d)c=e(c,f(b,a[d]));else for(var d=0;d<b.length;++d)c=e(c,f(a,b[d]));return c}var e=a("robust-sum"),f=a("robust-scale");b.exports=d},{"robust-scale":215,"robust-sum":217}],283:[function(a,b,c){"use strict";b.exports=function(a){return 0>a?-1:a>0?1:0}},{}],284:[function(a,b,c){arguments[4][20][0].apply(c,arguments)},{dup:20}],285:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.mid=a,this.left=b,this.right=c,this.leftPoints=d,this.rightPoints=e,this.count=(b?b.count:0)+(c?c.count:0)+d.length}function e(a,b){a.mid=b.mid,a.left=b.left,a.right=b.right,a.leftPoints=b.leftPoints,a.rightPoints=b.rightPoints,a.count=b.count}function f(a,b){var c=o(b);a.mid=c.mid,a.left=c.left,a.right=c.right,a.leftPoints=c.leftPoints,a.rightPoints=c.rightPoints,a.count=c.count}function g(a,b){var c=a.intervals([]);c.push(b),f(a,c)}function h(a,b){var c=a.intervals([]),d=c.indexOf(b);return 0>d?s:(c.splice(d,1),f(a,c),t)}function i(a,b,c){for(var d=0;d<a.length&&a[d][0]<=b;++d){var e=c(a[d]);if(e)return e}}function j(a,b,c){for(var d=a.length-1;d>=0&&a[d][1]>=b;--d){var e=c(a[d]);if(e)return e}}function k(a,b){for(var c=0;c<a.length;++c){var d=b(a[c]);if(d)return d}}function l(a,b){return a-b}function m(a,b){var c=a[0]-b[0];return c?c:a[1]-b[1]}function n(a,b){var c=a[1]-b[1];return c?c:a[0]-b[0]}function o(a){if(0===a.length)return null;for(var b=[],c=0;c<a.length;++c)b.push(a[c][0],a[c][1]);b.sort(l);for(var e=b[b.length>>1],f=[],g=[],h=[],c=0;c<a.length;++c){var i=a[c];i[1]<e?f.push(i):e<i[0]?g.push(i):h.push(i)}var j=h,k=h.slice();return j.sort(m),k.sort(n),new d(e,o(f),o(g),j,k)}function p(a){this.root=a}function q(a){return new p(a&&0!==a.length?o(a):null)}var r=a("binary-search-bounds"),s=0,t=1,u=2;b.exports=q;var v=d.prototype;v.intervals=function(a){return a.push.apply(a,this.leftPoints),this.left&&this.left.intervals(a),this.right&&this.right.intervals(a),a},v.insert=function(a){var b=this.count-this.leftPoints.length;if(this.count+=1,a[1]<this.mid)this.left?4*(this.left.count+1)>3*(b+1)?g(this,a):this.left.insert(a):this.left=o([a]);else if(a[0]>this.mid)this.right?4*(this.right.count+1)>3*(b+1)?g(this,a):this.right.insert(a):this.right=o([a]);else{var c=r.ge(this.leftPoints,a,m),d=r.ge(this.rightPoints,a,n);this.leftPoints.splice(c,0,a),this.rightPoints.splice(d,0,a)}},v.remove=function(a){var b=this.count-this.leftPoints;if(a[1]<this.mid){if(!this.left)return s;var c=this.right?this.right.count:0;if(4*c>3*(b-1))return h(this,a);var d=this.left.remove(a);return d===u?(this.left=null,this.count-=1,t):(d===t&&(this.count-=1),d)}if(a[0]>this.mid){if(!this.right)return s;var f=this.left?this.left.count:0;if(4*f>3*(b-1))return h(this,a);var d=this.right.remove(a);return d===u?(this.right=null,this.count-=1,t):(d===t&&(this.count-=1),d)}if(1===this.count)return this.leftPoints[0]===a?u:s;if(1===this.leftPoints.length&&this.leftPoints[0]===a){if(this.left&&this.right){for(var g=this,i=this.left;i.right;)g=i,i=i.right;if(g===this)i.right=this.right;else{var j=this.left,d=this.right;g.count-=i.count,g.right=i.left,i.left=j,i.right=d}e(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?e(this,this.left):e(this,this.right);return t}for(var j=r.ge(this.leftPoints,a,m);j<this.leftPoints.length&&this.leftPoints[j][0]===a[0];++j)if(this.leftPoints[j]===a){this.count-=1,this.leftPoints.splice(j,1);for(var d=r.ge(this.rightPoints,a,n);d<this.rightPoints.length&&this.rightPoints[d][1]===a[1];++d)if(this.rightPoints[d]===a)return this.rightPoints.splice(d,1),t}return s},v.queryPoint=function(a,b){if(a<this.mid){if(this.left){var c=this.left.queryPoint(a,b);if(c)return c}return i(this.leftPoints,a,b)}if(a>this.mid){if(this.right){var c=this.right.queryPoint(a,b);if(c)return c}return j(this.rightPoints,a,b)}return k(this.leftPoints,b)},v.queryInterval=function(a,b,c){if(a<this.mid&&this.left){var d=this.left.queryInterval(a,b,c);if(d)return d}if(b>this.mid&&this.right){var d=this.right.queryInterval(a,b,c);if(d)return d}return b<this.mid?i(this.leftPoints,b,c):a>this.mid?j(this.rightPoints,a,c):k(this.leftPoints,c)};var w=p.prototype;w.insert=function(a){this.root?this.root.insert(a):this.root=new d(a[0],null,null,[a],[a])},w.remove=function(a){if(this.root){var b=this.root.remove(a);return b===u&&(this.root=null),b!==s}return!1},w.queryPoint=function(a,b){return this.root?this.root.queryPoint(a,b):void 0},w.queryInterval=function(a,b,c){return b>=a&&this.root?this.root.queryInterval(a,b,c):void 0},Object.defineProperty(w,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(w,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":284}],286:[function(a,b,c){"use strict";function d(a,b){var c,d;if(b[0][0]<b[1][0])c=b[0],d=b[1];else{if(!(b[0][0]>b[1][0])){var e=Math.min(a[0][1],a[1][1]),g=Math.max(a[0][1],a[1][1]),h=Math.min(b[0][1],b[1][1]),i=Math.max(b[0][1],b[1][1]);return h>g?g-h:e>i?e-i:g-i}c=b[1],d=b[0]}var j,k;a[0][1]<a[1][1]?(j=a[0],k=a[1]):(j=a[1],k=a[0]);var l=f(d,c,j);return l?l:(l=f(d,c,k),l?l:k-d)}function e(a,b){var c,e;if(b[0][0]<b[1][0])c=b[0],e=b[1];else{if(!(b[0][0]>b[1][0]))return d(b,a);c=b[1],e=b[0]}var g,h;if(a[0][0]<a[1][0])g=a[0],h=a[1];else{if(!(a[0][0]>a[1][0]))return-d(a,b);g=a[1],h=a[0]}var i=f(c,e,h),j=f(c,e,g);if(0>i){if(0>=j)return i}else if(i>0){if(j>=0)return i}else if(j)return j;if(i=f(h,g,e),j=f(h,g,c),0>i){if(0>=j)return i}else if(i>0){if(j>=0)return i}else if(j)return j;return e[0]-h[0]}b.exports=e;var f=a("robust-orientation")},{"robust-orientation":214}],287:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this._color=a,this.key=b,this.value=c,this.left=d,this.right=e,this._count=f}function e(a){return new d(a._color,a.key,a.value,a.left,a.right,a._count)}function f(a,b){return new d(a,b.key,b.value,b.left,b.right,b._count)}function g(a){a._count=1+(a.left?a.left._count:0)+(a.right?a.right._count:0)}function h(a,b){this._compare=a,this.root=b}function i(a,b){if(b.left){var c=i(a,b.left);if(c)return c}var c=a(b.key,b.value);return c?c:b.right?i(a,b.right):void 0}function j(a,b,c,d){var e=b(a,d.key);if(0>=e){if(d.left){var f=j(a,b,c,d.left);if(f)return f}var f=c(d.key,d.value);if(f)return f}return d.right?j(a,b,c,d.right):void 0}function k(a,b,c,d,e){var f,g=c(a,e.key),h=c(b,e.key);if(0>=g){if(e.left&&(f=k(a,b,c,d,e.left)))return f;if(h>0&&(f=d(e.key,e.value)))return f}return h>0&&e.right?k(a,b,c,d,e.right):void 0}function l(a,b){this.tree=a,this._stack=b}function m(a,b){a.key=b.key,a.value=b.value,a.left=b.left,a.right=b.right,a._color=b._color,a._count=b._count}function n(a){for(var b,c,d,h,i=a.length-1;i>=0;--i){if(b=a[i],0===i)return void(b._color=r);if(c=a[i-1],c.left===b){if(d=c.right,d.right&&d.right._color===q){if(d=c.right=e(d),h=d.right=e(d.right),c.right=d.left,d.left=c,d.right=h,d._color=c._color,b._color=r,c._color=r,h._color=r,g(c),g(d),i>1){var j=a[i-2];j.left===c?j.left=d:j.right=d}return void(a[i-1]=d)}if(d.left&&d.left._color===q){if(d=c.right=e(d),h=d.left=e(d.left),c.right=h.left,d.left=h.right,h.left=c,h.right=d,h._color=c._color,c._color=r,d._color=r,b._color=r,g(c),g(d),g(h),i>1){var j=a[i-2];j.left===c?j.left=h:j.right=h}return void(a[i-1]=h)}if(d._color===r){if(c._color===q)return c._color=r,void(c.right=f(q,d));c.right=f(q,d);continue}if(d=e(d),c.right=d.left,d.left=c,d._color=c._color,c._color=q,g(c),g(d),i>1){var j=a[i-2];j.left===c?j.left=d:j.right=d}a[i-1]=d,a[i]=c,i+1<a.length?a[i+1]=b:a.push(b),i+=2}else{if(d=c.left,d.left&&d.left._color===q){if(d=c.left=e(d),h=d.left=e(d.left),c.left=d.right,d.right=c,d.left=h,d._color=c._color,b._color=r,c._color=r,h._color=r,g(c),g(d),i>1){var j=a[i-2];j.right===c?j.right=d:j.left=d}return void(a[i-1]=d)}if(d.right&&d.right._color===q){if(d=c.left=e(d),h=d.right=e(d.right),c.left=h.right,d.right=h.left,h.right=c,h.left=d,h._color=c._color,c._color=r,d._color=r,b._color=r,g(c),g(d),g(h),i>1){var j=a[i-2];j.right===c?j.right=h:j.left=h}return void(a[i-1]=h)}if(d._color===r){if(c._color===q)return c._color=r,void(c.left=f(q,d));c.left=f(q,d);continue}if(d=e(d),c.left=d.right,d.right=c,d._color=c._color,c._color=q,g(c),g(d),i>1){var j=a[i-2];j.right===c?j.right=d:j.left=d}a[i-1]=d,a[i]=c,i+1<a.length?a[i+1]=b:a.push(b),i+=2}}}function o(a,b){return b>a?-1:a>b?1:0}function p(a){return new h(a||o,null)}b.exports=p;var q=0,r=1,s=h.prototype;Object.defineProperty(s,"keys",{get:function(){var a=[];return this.forEach(function(b,c){a.push(b)}),a}}),Object.defineProperty(s,"values",{get:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a}}),Object.defineProperty(s,"length",{get:function(){return this.root?this.root._count:0}}),s.insert=function(a,b){for(var c=this._compare,e=this.root,i=[],j=[];e;){var k=c(a,e.key);i.push(e),j.push(k),e=0>=k?e.left:e.right}i.push(new d(q,a,b,null,null,1));for(var l=i.length-2;l>=0;--l){var e=i[l];j[l]<=0?i[l]=new d(e._color,e.key,e.value,i[l+1],e.right,e._count+1):i[l]=new d(e._color,e.key,e.value,e.left,i[l+1],e._count+1)}for(var l=i.length-1;l>1;--l){var m=i[l-1],e=i[l];if(m._color===r||e._color===r)break;var n=i[l-2];if(n.left===m)if(m.left===e){var o=n.right;if(!o||o._color!==q){if(n._color=q,n.left=m.right,m._color=r,m.right=n,i[l-2]=m,i[l-1]=e,g(n),g(m),l>=3){var p=i[l-3];p.left===n?p.left=m:p.right=m}break}m._color=r,n.right=f(r,o),n._color=q,l-=1}else{var o=n.right;if(!o||o._color!==q){if(m.right=e.left,n._color=q,n.left=e.right,e._color=r,e.left=m,e.right=n,i[l-2]=e,i[l-1]=m,g(n),g(m),g(e),l>=3){var p=i[l-3];p.left===n?p.left=e:p.right=e}break}m._color=r,n.right=f(r,o),n._color=q,l-=1}else if(m.right===e){var o=n.left;if(!o||o._color!==q){if(n._color=q,n.right=m.left,m._color=r,m.left=n,i[l-2]=m,i[l-1]=e,g(n),g(m),l>=3){var p=i[l-3];p.right===n?p.right=m:p.left=m}break}m._color=r,n.left=f(r,o),n._color=q,l-=1}else{var o=n.left;if(!o||o._color!==q){if(m.left=e.right,n._color=q,n.right=e.left,e._color=r,e.right=m,e.left=n,i[l-2]=e,i[l-1]=m,g(n),g(m),g(e),l>=3){var p=i[l-3];p.right===n?p.right=e:p.left=e}break}m._color=r,n.left=f(r,o),n._color=q,l-=1}}return i[0]._color=r,new h(c,i[0])},s.forEach=function(a,b,c){if(this.root)switch(arguments.length){case 1:return i(a,this.root);case 2:return j(b,this._compare,a,this.root);case 3:if(this._compare(b,c)>=0)return;return k(b,c,this._compare,a,this.root)}},Object.defineProperty(s,"begin",{get:function(){for(var a=[],b=this.root;b;)a.push(b),b=b.left;return new l(this,a)}}),Object.defineProperty(s,"end",{get:function(){for(var a=[],b=this.root;b;)a.push(b),b=b.right;return new l(this,a)}}),s.at=function(a){if(0>a)return new l(this,[]);for(var b=this.root,c=[];;){if(c.push(b),b.left){if(a<b.left._count){b=b.left;continue}a-=b.left._count}if(!a)return new l(this,c);if(a-=1,!b.right)break;if(a>=b.right._count)break;b=b.right}return new l(this,[])},s.ge=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),0>=f&&(e=d.length),c=0>=f?c.left:c.right}return d.length=e,new l(this,d)},s.gt=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),0>f&&(e=d.length),c=0>f?c.left:c.right}return d.length=e,new l(this,d)},s.lt=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),f>0&&(e=d.length),c=0>=f?c.left:c.right}return d.length=e,new l(this,d)},s.le=function(a){for(var b=this._compare,c=this.root,d=[],e=0;c;){var f=b(a,c.key);d.push(c),f>=0&&(e=d.length),c=0>f?c.left:c.right}return d.length=e,new l(this,d)},s.find=function(a){for(var b=this._compare,c=this.root,d=[];c;){var e=b(a,c.key);if(d.push(c),0===e)return new l(this,d);c=0>=e?c.left:c.right}return new l(this,[])},s.remove=function(a){var b=this.find(a);return b?b.remove():this},s.get=function(a){for(var b=this._compare,c=this.root;c;){var d=b(a,c.key);if(0===d)return c.value;c=0>=d?c.left:c.right}};var t=l.prototype;Object.defineProperty(t,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(t,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),t.clone=function(){return new l(this.tree,this._stack.slice())},t.remove=function(){var a=this._stack;if(0===a.length)return this.tree;var b=new Array(a.length),c=a[a.length-1];b[b.length-1]=new d(c._color,c.key,c.value,c.left,c.right,c._count);for(var e=a.length-2;e>=0;--e){var c=a[e];c.left===a[e+1]?b[e]=new d(c._color,c.key,c.value,b[e+1],c.right,c._count):b[e]=new d(c._color,c.key,c.value,c.left,b[e+1],c._count)}if(c=b[b.length-1],c.left&&c.right){var f=b.length;for(c=c.left;c.right;)b.push(c),c=c.right;var g=b[f-1];b.push(new d(c._color,g.key,g.value,c.left,c.right,c._count)),b[f-1].key=c.key,b[f-1].value=c.value;for(var e=b.length-2;e>=f;--e)c=b[e],b[e]=new d(c._color,c.key,c.value,c.left,b[e+1],c._count);b[f-1].left=b[f]}if(c=b[b.length-1],c._color===q){var i=b[b.length-2];i.left===c?i.left=null:i.right===c&&(i.right=null),b.pop();for(var e=0;e<b.length;++e)b[e]._count--;return new h(this.tree._compare,b[0])}if(c.left||c.right){c.left?m(c,c.left):c.right&&m(c,c.right),c._color=r;for(var e=0;e<b.length-1;++e)b[e]._count--;return new h(this.tree._compare,b[0])}if(1===b.length)return new h(this.tree._compare,null);for(var e=0;e<b.length;++e)b[e]._count--;var j=b[b.length-2];return n(b),j.left===c?j.left=null:j.right=null,new h(this.tree._compare,b[0])},Object.defineProperty(t,"key",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].key:void 0},enumerable:!0}),Object.defineProperty(t,"value",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1].value:void 0},enumerable:!0}),Object.defineProperty(t,"index",{get:function(){var a=0,b=this._stack;if(0===b.length){var c=this.tree.root;return c?c._count:0}b[b.length-1].left&&(a=b[b.length-1].left._count);for(var d=b.length-2;d>=0;--d)b[d+1]===b[d].right&&(++a,b[d].left&&(a+=b[d].left._count));return a},enumerable:!0}),t.next=function(){var a=this._stack;if(0!==a.length){var b=a[a.length-1];if(b.right)for(b=b.right;b;)a.push(b),b=b.left;else for(a.pop();a.length>0&&a[a.length-1].right===b;)b=a[a.length-1],a.pop()}},Object.defineProperty(t,"hasNext",{get:function(){var a=this._stack;if(0===a.length)return!1;if(a[a.length-1].right)return!0;for(var b=a.length-1;b>0;--b)if(a[b-1].left===a[b])return!0;return!1}}),t.update=function(a){var b=this._stack;if(0===b.length)throw new Error("Can't update empty node!");var c=new Array(b.length),e=b[b.length-1];c[c.length-1]=new d(e._color,e.key,a,e.left,e.right,e._count);for(var f=b.length-2;f>=0;--f)e=b[f],e.left===b[f+1]?c[f]=new d(e._color,e.key,e.value,c[f+1],e.right,e._count):c[f]=new d(e._color,e.key,e.value,e.left,c[f+1],e._count);return new h(this.tree._compare,c[0])},t.prev=function(){var a=this._stack;if(0!==a.length){var b=a[a.length-1];if(b.left)for(b=b.left;b;)a.push(b),b=b.right;else for(a.pop();a.length>0&&a[a.length-1].left===b;)b=a[a.length-1],a.pop()}},Object.defineProperty(t,"hasPrev",{get:function(){var a=this._stack;if(0===a.length)return!1;if(a[a.length-1].left)return!0;for(var b=a.length-1;b>0;--b)if(a[b-1].right===a[b])return!0;return!1}})},{}],288:[function(a,b,c){"use strict";function d(a,b,c){this.slabs=a,this.coordinates=b,this.horizontal=c}function e(a,b){return a.y-b}function f(a,b){for(var c=null;a;){var d,e,g=a.key;g[0][0]<g[1][0]?(d=g[0],e=g[1]):(d=g[1],e=g[0]);var h=l(d,e,b);if(0>h)a=a.left;else if(h>0)if(b[0]!==g[1][0])c=a,a=a.right;else{var i=f(a.right,b);if(i)return i;a=a.left}else{if(b[0]!==g[1][0])return a;var i=f(a.right,b);if(i)return i;a=a.left}}return c}function g(a,b,c,d){this.y=a,this.index=b,this.start=c,this.closed=d}function h(a,b,c,d){this.x=a,this.segment=b,this.create=c,this.index=d}function i(a){for(var b=a.length,c=2*b,e=new Array(c),f=0;b>f;++f){var i=a[f],j=i[0][0]<i[1][0];e[2*f]=new h(i[0][0],i,j,f),e[2*f+1]=new h(i[1][0],i,!j,f)}e.sort(function(a,b){var c=a.x-b.x;return c?c:(c=a.create-b.create, 44 c?c:Math.min(a.segment[0][1],a.segment[1][1])-Math.min(b.segment[0][1],b.segment[1][1]))});for(var l=k(m),n=[],o=[],p=[],f=0;c>f;){for(var q=e[f].x,r=[];c>f;){var s=e[f];if(s.x!==q)break;f+=1,s.segment[0][0]===s.x&&s.segment[1][0]===s.x?s.create&&(s.segment[0][1]<s.segment[1][1]?(r.push(new g(s.segment[0][1],s.index,!0,!0)),r.push(new g(s.segment[1][1],s.index,!1,!1))):(r.push(new g(s.segment[1][1],s.index,!0,!1)),r.push(new g(s.segment[0][1],s.index,!1,!0)))):l=s.create?l.insert(s.segment,s.index):l.remove(s.segment)}n.push(l.root),o.push(q),p.push(r)}return new d(n,o,p)}b.exports=i;var j=a("binary-search-bounds"),k=a("functional-red-black-tree"),l=a("robust-orientation"),m=a("./lib/order-segments"),n=d.prototype;n.castUp=function(a){var b=j.le(this.coordinates,a[0]);if(0>b)return-1;var c=(this.slabs[b],f(this.slabs[b],a)),d=-1;if(c&&(d=c.value),this.coordinates[b]===a[0]){var g=null;if(c&&(g=c.key),b>0){var h=f(this.slabs[b-1],a);h&&(g?m(h.key,g)>0&&(g=h.key,d=h.value):(d=h.value,g=h.key))}var i=this.horizontal[b];if(i.length>0){var k=j.ge(i,a[1],e);if(k<i.length){var n=i[k];if(a[1]===n.y){if(n.closed)return n.index;for(;k<i.length-1&&i[k+1].y===a[1];)if(k+=1,n=i[k],n.closed)return n.index;if(n.y===a[1]&&!n.start){if(k+=1,k>=i.length)return d;n=i[k]}}if(n.start)if(g){var o=l(g[0],g[1],[a[0],n.y]);g[0][0]>g[1][0]&&(o=-o),o>0&&(d=n.index)}else d=n.index;else n.y!==a[1]&&(d=n.index)}}}return d}},{"./lib/order-segments":286,"binary-search-bounds":284,"functional-red-black-tree":287,"robust-orientation":214}],289:[function(a,b,c){function d(){return!0}function e(a){return function(b,c){var e=a[b];return e?!!e.queryPoint(c,d):!1}}function f(a){for(var b={},c=0;c<a.length;++c){var d=a[c],f=d[0][0],g=d[0][1],h=d[1][1],i=[Math.min(g,h),Math.max(g,h)];f in b?b[f].push(i):b[f]=[i]}for(var j={},k=Object.keys(b),c=0;c<k.length;++c){var l=b[k[c]];j[k[c]]=n(l)}return e(j)}function g(a,b){return function(c){var d=o.le(b,c[0]);if(0>d)return 1;var e=a[d];if(!e){if(!(d>0&&b[d]===c[0]))return 1;e=a[d-1]}for(var f=1;e;){var g=e.key,h=l(c,g[0],g[1]);if(g[0][0]<g[1][0])if(0>h)e=e.left;else{if(!(h>0))return 0;f=-1,e=e.right}else if(h>0)e=e.left;else{if(!(0>h))return 0;f=1,e=e.right}}return f}}function h(a){return 1}function i(a){return function(b){return a(b[0],b[1])?0:1}}function j(a,b){return function(c){return a(c[0],c[1])?0:b(c)}}function k(a){for(var b=a.length,c=[],d=[],e=0;b>e;++e)for(var k=a[e],l=k.length,n=l-1,o=0;l>o;n=o++){var p=k[n],q=k[o];p[0]===q[0]?d.push([p,q]):c.push([p,q])}if(0===c.length)return 0===d.length?h:i(f(d));var r=m(c),s=g(r.slabs,r.coordinates);return 0===d.length?s:j(f(d),s)}b.exports=k;var l=a("robust-orientation")[3],m=a("slab-decomposition"),n=a("interval-tree-1d"),o=a("binary-search-bounds")},{"binary-search-bounds":284,"interval-tree-1d":285,"robust-orientation":214,"slab-decomposition":288}],290:[function(a,b,c){"use strict";function d(a,b){for(var c=new Array(a),d=0;a>d;++d)c[d]=b;return c}function e(a){for(var b=new Array(a),c=0;a>c;++c)b[c]=[];return b}function f(a,b){function c(a){for(var c=a.length,d=[0],e=0;c>e;++e){var f=b[a[e]],g=b[a[(e+1)%c]],h=j(-f[0],f[1]),i=j(-f[0],g[1]),l=j(g[0],f[1]),m=j(g[0],g[1]);d=k(d,k(k(h,i),k(l,m)))}return d[d.length-1]>0}function f(a){for(var b=a.length,c=0;b>c;++c)if(!I[a[c]])return!1;return!0}var n=m(a,b);a=n[0],b=n[1];for(var o=b.length,p=(a.length,g(a,b.length)),q=0;o>q;++q)if(p[q].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var r=h(a,b);r=r.filter(c);for(var s=r.length,t=new Array(s),u=new Array(s),q=0;s>q;++q){t[q]=q;var v=new Array(s),w=r[q].map(function(a){return b[a]}),x=i([w]),y=0;a:for(var z=0;s>z;++z)if(v[z]=0,q!==z){for(var A=r[z],B=A.length,C=0;B>C;++C){var D=x(b[A[C]]);if(0!==D){0>D&&(v[z]=1,y+=1);continue a}}v[z]=1,y+=1}u[q]=[y,q,v]}u.sort(function(a,b){return b[0]-a[0]});for(var q=0;s>q;++q)for(var v=u[q],E=v[1],F=v[2],z=0;s>z;++z)F[z]&&(t[z]=E);for(var G=e(s),q=0;s>q;++q)G[q].push(t[q]),G[t[q]].push(q);for(var H={},I=d(o,!1),q=0;s>q;++q)for(var A=r[q],B=A.length,z=0;B>z;++z){var J=A[z],K=A[(z+1)%B],L=Math.min(J,K)+":"+Math.max(J,K);if(L in H){var M=H[L];G[M].push(q),G[q].push(M),I[J]=I[K]=!0}else H[L]=q}for(var N=[],O=d(s,-1),q=0;s>q;++q)t[q]!==q||f(r[q])?O[q]=-1:(N.push(q),O[q]=0);for(var n=[];N.length>0;){var P=N.pop(),Q=G[P];l(Q,function(a,b){return a-b});var R,S=Q.length,T=O[P];if(0===T){var A=r[P];R=[A]}for(var q=0;S>q;++q){var U=Q[q];if(!(O[U]>=0)&&(O[U]=1^T,N.push(U),0===T)){var A=r[U];f(A)||(A.reverse(),R.push(A))}}0===T&&n.push(R)}return n}b.exports=f;var g=a("edges-to-adjacency-list"),h=a("planar-dual"),i=a("point-in-big-polygon"),j=a("two-product"),k=a("robust-sum"),l=a("uniq"),m=a("./lib/trim-leaves")},{"./lib/trim-leaves":278,"edges-to-adjacency-list":279,"planar-dual":280,"point-in-big-polygon":289,"robust-sum":217,"two-product":231,uniq:234}],291:[function(a,b,c){arguments[4][49][0].apply(c,arguments)},{dup:49}],292:[function(a,b,c){"use strict";"use restrict";function d(a){this.roots=new Array(a),this.ranks=new Array(a);for(var b=0;a>b;++b)this.roots[b]=b,this.ranks[b]=0}b.exports=d,d.prototype.length=function(){return this.roots.length},d.prototype.makeSet=function(){var a=this.roots.length;return this.roots.push(a),this.ranks.push(0),a},d.prototype.find=function(a){for(var b=this.roots;b[a]!==a;){var c=b[a];b[a]=b[c],a=c}return a},d.prototype.link=function(a,b){var c=this.find(a),d=this.find(b);if(c!==d){var e=this.ranks,f=this.roots,g=e[c],h=e[d];h>g?f[c]=d:g>h?f[d]=c:(f[d]=c,++e[c])}}},{}],293:[function(a,b,c){arguments[4][194][0].apply(c,arguments)},{"bit-twiddle":291,dup:194,"union-find":292}],294:[function(a,b,c){"use strict";function d(a,b,c){var d=Math.abs(f(a,b,c)),e=Math.sqrt(Math.pow(b[0]-c[0],2)+Math.pow(b[1]-c[1],2));return d/e}function e(a,b,c){function e(a){if(u[a])return 1/0;var c=r[a],e=s[a];return 0>c||0>e?1/0:d(b[a],b[c],b[e])}function f(a,b){var c=z[a],d=z[b];z[a]=d,z[b]=c,A[c]=b,A[d]=a}function h(a){return t[z[a]]}function i(a){return 1&a?a-1>>1:(a>>1)-1}function j(a){for(var b=h(a);;){var c=b,d=2*a+1,e=2*(a+1),g=a;if(C>d){var i=h(d);c>i&&(g=d,c=i)}if(C>e){var j=h(e);c>j&&(g=e)}if(g===a)return a;f(a,g),a=g}}function k(a){for(var b=h(a);a>0;){var c=i(a);if(c>=0){var d=h(c);if(d>b){f(a,c),a=c;continue}}return a}}function l(){if(C>0){var a=z[0];return f(0,C-1),C-=1,j(0),a}return-1}function m(a,b){var c=z[a];return t[c]===b?a:(t[c]=-(1/0),k(a),l(),t[c]=b,C+=1,k(C-1))}function n(a){if(!u[a]){u[a]=!0;var b=r[a],c=s[a];r[c]>=0&&(r[c]=b),s[b]>=0&&(s[b]=c),A[b]>=0&&m(A[b],e(b)),A[c]>=0&&m(A[c],e(c))}}function o(a,b){if(a[b]<0)return b;var c=b,d=b;do{var e=a[d];if(!u[d]||0>e||e===d)break;if(d=e,e=a[d],!u[d]||0>e||e===d)break;d=e,c=a[c]}while(c!==d);for(var f=b;f!==d;f=a[f])a[f]=d;return d}for(var p=b.length,q=a.length,r=new Array(p),s=new Array(p),t=new Array(p),u=new Array(p),v=0;p>v;++v)r[v]=s[v]=-1,t[v]=1/0,u[v]=!1;for(var v=0;q>v;++v){var w=a[v];if(2!==w.length)throw new Error("Input must be a graph");var x=w[1],y=w[0];-1!==s[y]?s[y]=-2:s[y]=x,-1!==r[x]?r[x]=-2:r[x]=y}for(var z=[],A=new Array(p),v=0;p>v;++v){var B=t[v]=e(v);1/0>B?(A[v]=z.length,z.push(v)):A[v]=-1}for(var C=z.length,v=C>>1;v>=0;--v)j(v);for(;;){var D=l();if(0>D||t[D]>c)break;n(D)}for(var E=[],v=0;p>v;++v)u[v]||(A[v]=E.length,E.push(b[v].slice()));var F=(E.length,[]);return a.forEach(function(a){var b=o(r,a[0]),c=o(s,a[1]);if(b>=0&&c>=0&&b!==c){var d=A[b],e=A[c];d!==e&&F.push([d,e])}}),g.unique(g.normalize(F)),{positions:E,edges:F}}b.exports=e;var f=a("robust-orientation"),g=a("simplicial-complex")},{"robust-orientation":214,"simplicial-complex":293}],295:[function(a,b,c){"use strict";b.exports=["",{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],296:[function(a,b,c){"use strict";var d=a("./arrow_paths"),e=a("../../plots/cartesian"),f=a("../../plots/font_attributes"),g=a("../../lib/extend").extendFlat;b.exports={_isLinkedToArray:!0,text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:g({},f,{}),opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:d.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},ax:{valType:"number",dflt:-10},ay:{valType:"number",dflt:-30},xref:{valType:"enumerated",values:["paper",e.idRegex.x.toString()]},x:{valType:"number"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yref:{valType:"enumerated",values:["paper",e.idRegex.y.toString()]},y:{valType:"number"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":345,"../../plots/cartesian":375,"../../plots/font_attributes":383,"./arrow_paths":295}],297:[function(a,b,c){"use strict";function d(a,b){function c(b,c){return g.Lib.coerce(a,d,j.layoutAttributes,b,c)}var d={};c("opacity"),c("align"),c("bgcolor");var e=c("bordercolor"),f=g.Color.opacity(e);c("borderpad");var h=c("borderwidth"),i=c("showarrow");i&&(c("arrowcolor",f?d.bordercolor:g.Color.defaultLine),c("arrowhead"),c("arrowsize"),c("arrowwidth",2*(f&&h||1)),c("ax"),c("ay"),g.Lib.noneOrAll(a,d,["ax","ay"])),c("text",i?" ":"new text"),c("textangle"),g.Lib.coerceFont(c,"font",b.font);for(var k=["x","y"],l=0;2>l;l++){var m=k[l],n={_fullLayout:b},o=g.Axes.coerceRef(a,d,n,m),p=.5;if("paper"!==o){var q=g.Axes.getFromId(n,o);if(p=q.range[0]+p*(q.range[1]-q.range[0]),-1!==["date","category"].indexOf(q.type)&&"string"==typeof a[m]){var r;"date"===q.type?(r=g.Lib.dateTime2ms(a[m]),r!==!1&&(a[m]=r)):(q._categories||[]).length&&(r=q._categories.indexOf(a[m]),-1!==r&&(a[m]=r))}}c(m,p),i||c(m+"anchor")}return g.Lib.noneOrAll(a,d,["x","y"]),d}function e(a){var b=a._fullLayout;b.annotations.forEach(function(b){var c=g.Axes.getFromId(a,b.xref),d=g.Axes.getFromId(a,b.yref);if(c||d){var e=(b._xsize||0)/2,f=b._xshift||0,h=(b._ysize||0)/2,i=b._yshift||0,j=e-f,k=e+f,l=h-i,m=h+i;if(b.showarrow){var n=3*b.arrowsize*b.arrowwidth;j=Math.max(j,n),k=Math.max(k,n),l=Math.max(l,n),m=Math.max(m,n)}c&&c.autorange&&g.Axes.expand(c,[c.l2c(b.x)],{ppadplus:k,ppadminus:j}),d&&d.autorange&&g.Axes.expand(d,[d.l2c(b.y)],{ppadplus:m,ppadminus:l})}})}function f(a,b,c,d,e,f,g,h){var i=c-a,j=e-a,k=g-e,l=d-b,m=f-b,n=h-f,o=i*n-k*l;if(0===o)return null;var p=(j*n-k*m)/o,q=(j*l-i*m)/o;return 0>q||q>1||0>p||p>1?null:{x:a+i*p,y:b+l*p}}var g=a("../../plotly"),h=a("d3"),i=a("fast-isnumeric"),j=b.exports={};j.ARROWPATHS=a("./arrow_paths"),j.layoutAttributes=a("./attributes"),j.supplyLayoutDefaults=function(a,b){for(var c=a.annotations||[],e=b.annotations=[],f=0;f<c.length;f++)e.push(d(c[f]||{},b))},j.drawAll=function(a){var b=a._fullLayout;b._infolayer.selectAll(".annotation").remove();for(var c=0;c<b.annotations.length;c++)j.draw(a,c);return g.Plots.previousPromises(a)},j.add=function(a){var b=a._fullLayout.annotations.length;g.relayout(a,"annotations["+b+"]","add")},j.draw=function(a,b,c,e){function k(a){return a.call(g.Drawing.font,U).attr({"text-anchor":{left:"start",right:"end"}[I.align]||"middle"}),g.util.convertToTspans(a,l),a}function l(){function c(a,b){return"auto"===b&&(b=1/3>a?"left":a>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[b]}V.selectAll("tspan.line").attr({y:0,x:0});var d=P.select(".annotation-math-group"),e=!d.empty(),i=g.Drawing.bBox((e?d:V).node()),k=i.width,l=i.height,m=Math.round(k+2*S),n=Math.round(l+2*S);I._w=k,I._h=l;var p=!1;if(["x","y"].forEach(function(b){var d,e=g.Axes.getFromId(a,I[b+"ref"]||b),f=(M+("x"===b?0:90))*Math.PI/180,h=m*Math.abs(Math.cos(f))+n*Math.abs(Math.sin(f)),i=I[b+"anchor"];if(e){if(!e.autorange&&(I[b]-e.range[0])*(I[b]-e.range[1])>0)return void(p=!0);L[b]=e._offset+e.l2p(I[b]),d=.5}else d=I[b],"y"===b&&(d=1-d),L[b]="x"===b?w.l+w.w*d:w.t+w.h*d;var j=0;j=I.showarrow?I["a"+b]:h*c(d,i),L[b]+=j,I["_"+b+"type"]=e&&e.type,I["_"+b+"size"]=h,I["_"+b+"shift"]=j}),p)return void P.remove();var q,r;I.showarrow&&(q=g.Lib.constrain(L.x-I.ax,1,o.width-1),r=g.Lib.constrain(L.y-I.ay,1,o.height-1)),L.x=g.Lib.constrain(L.x,1,o.width-1),L.y=g.Lib.constrain(L.y,1,o.height-1);var s=S-i.top,t=S-i.left;e?d.select("svg").attr({x:S-1,y:S}):(V.attr({x:t,y:s}),V.selectAll("tspan.line").attr({y:s,x:t})),T.call(g.Drawing.setRect,Q/2,Q/2,m-Q,n-Q),P.call(g.Drawing.setRect,Math.round(L.x-m/2),Math.round(L.y-n/2),m,n);var u="annotations["+b+"]",v=function(c,d){h.select(a).selectAll('.annotation-arrow-g[data-index="'+b+'"]').remove();var e=L.x+c,i=L.y+d,k=g.Lib.rotationXYMatrix(M,e,i),l=g.Lib.apply2DTransform(k),m=g.Lib.apply2DTransform2(k),n=T.attr("width")/2,o=T.attr("height")/2,p=[[e-n,i-o,e-n,i+o],[e-n,i+o,e+n,i+o],[e+n,i+o,e+n,i-o],[e+n,i-o,e-n,i-o]].map(m);if(!p.reduce(function(a,b){return a^!!f(q,r,q+1e6,r+1e6,b[0],b[1],b[2],b[3])},!1)){p.forEach(function(a){var b=f(e,i,q,r,a[0],a[1],a[2],a[3]);b&&(e=b.x,i=b.y)});var s=I.arrowwidth,t=I.arrowcolor,v=N.append("g").style({opacity:g.Color.opacity(t)}).classed("annotation-arrow-g",!0).attr("data-index",String(b)),x=v.append("path").attr("d","M"+e+","+i+"L"+q+","+r).style("stroke-width",s+"px").call(g.Color.stroke,g.Color.rgb(t));j.arrowhead(x,I.arrowhead,"end",I.arrowsize);var y=v.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(b),d:"M3,3H-3V-3H3ZM0,0L"+(e-q)+","+(i-r),transform:"translate("+q+","+r+")"}).style("stroke-width",s+6+"px").call(g.Color.stroke,"rgba(0,0,0,0)").call(g.Color.fill,"rgba(0,0,0,0)");if(a._context.editable){var z,A,B;g.Fx.dragElement({element:y.node(),prepFn:function(){A=Number(P.attr("x")),B=Number(P.attr("y")),z={},J&&J.autorange&&(z[J._name+".autorange"]=!0),K&&K.autorange&&(z[K._name+".autorange"]=!0)},moveFn:function(a,b){v.attr("transform","translate("+a+","+b+")");var c=l(A,B),d=c[0]+a,e=c[1]+b;P.call(g.Drawing.setPosition,d,e),z[u+".x"]=J?I.x+a/J._m:(q+a-w.l)/w.w,z[u+".y"]=K?I.y+b/K._m:1-(r+b-w.t)/w.h,O.attr({transform:"rotate("+M+","+d+","+e+")"})},doneFn:function(b){if(b){g.relayout(a,z);var c=document.querySelector(".js-notes-box-panel");c&&c.redraw(c.selectedObj)}}})}}};I.showarrow&&v(0,0);var x=g.Lib.rotationXYMatrix(M,L.x,L.y),y=g.Lib.apply2DTransform(x);if(a._context.editable){var z,A,B;g.Fx.dragElement({element:P.node(),prepFn:function(){z=Number(P.attr("x")),A=Number(P.attr("y")),B={}},moveFn:function(a,b){P.call(g.Drawing.setPosition,z+a,A+b);var c="pointer";if(I.showarrow)B[u+".ax"]=I.ax+a,B[u+".ay"]=I.ay+b,v(a,b);else{if(J)B[u+".x"]=I.x+a/J._m;else{var d=I._xsize/w.w,e=I.x+I._xshift/w.w-d/2;B[u+".x"]=g.Fx.dragAlign(e+a/w.w,d,0,1,I.xanchor)}if(K)B[u+".y"]=I.y+b/K._m;else{var f=I._ysize/w.h,h=I.y-I._yshift/w.h-f/2;B[u+".y"]=g.Fx.dragAlign(h-b/w.h,f,0,1,I.yanchor)}J&&K||(c=g.Fx.dragCursors(J?.5:B[u+".x"],K?.5:B[u+".y"],I.xanchor,I.yanchor))}var i=y(z,A),j=i[0]+a,k=i[1]+b;P.call(g.Drawing.setPosition,j,k),O.attr({transform:"rotate("+M+","+j+","+k+")"}),g.Fx.setCursor(P,c)},doneFn:function(b){if(g.Fx.setCursor(P),b){g.relayout(a,B);var c=document.querySelector(".js-notes-box-panel");c&&c.redraw(c.selectedObj)}}})}}var m,n=a.layout,o=a._fullLayout;if(!i(b)||-1===b){if(!b&&Array.isArray(e))return n.annotations=e,j.supplyLayoutDefaults(n,o),void j.drawAll(a);if("remove"===e)return delete n.annotations,o.annotations=[],void j.drawAll(a);if(c&&"add"!==e){for(m=0;m<o.annotations.length;m++)j.draw(a,m,c,e);return}b=o.annotations.length,o.annotations.push({})}if(!c&&e){if("remove"===e){for(o._infolayer.selectAll('.annotation[data-index="'+b+'"]').remove(),o.annotations.splice(b,1),n.annotations.splice(b,1),m=b;m<o.annotations.length;m++)o._infolayer.selectAll('.annotation[data-index="'+(m+1)+'"]').attr("data-index",String(m)),j.draw(a,m);return}if("add"===e||g.Lib.isPlainObject(e)){o.annotations.splice(b,0,{});var p=g.Lib.isPlainObject(e)?g.Lib.extendFlat({},e):{text:"New text"};for(n.annotations?n.annotations.splice(b,0,p):n.annotations=[p],m=o.annotations.length-1;m>b;m--)o._infolayer.selectAll('.annotation[data-index="'+(m-1)+'"]').attr("data-index",String(m)),j.draw(a,m)}}o._infolayer.selectAll('.annotation[data-index="'+b+'"]').remove();var q=n.annotations[b],r=o.annotations[b];if(q){var s={xref:q.xref,yref:q.yref},t={};"string"==typeof c&&c?t[c]=e:g.Lib.isPlainObject(c)&&(t=c);var u=Object.keys(t);for(m=0;m<u.length;m++){var v=u[m];g.Lib.nestedProperty(q,v).set(t[v])}var w=o._size,x=["x","y"];for(m=0;2>m;m++){var y=x[m];if(void 0===t[y]&&void 0!==q[y]){var z=g.Axes.getFromId(a,g.Axes.coerceRef(s,{},a,y)),A=g.Axes.getFromId(a,g.Axes.coerceRef(q,{},a,y)),B=q[y],C=r["_"+y+"type"];if(void 0!==t[y+"ref"]){var D="auto"===q[y+"anchor"],E="x"===y?w.w:w.h,F=(r["_"+y+"size"]||0)/(2*E);if(z&&A)B=(B-z.range[0])/(z.range[1]-z.range[0]),B=A.range[0]+B*(A.range[1]-A.range[0]);else if(z){if(B=(B-z.range[0])/(z.range[1]-z.range[0]),B=z.domain[0]+B*(z.domain[1]-z.domain[0]),D){var G=B+F,H=B-F;2/3>B+H?B=H:B+G>4/3&&(B=G)}}else A&&(D&&(1/3>B?B+=F:B>2/3&&(B-=F)),B=(B-A.domain[0])/(A.domain[1]-A.domain[0]),B=A.range[0]+B*(A.range[1]-A.range[0]))}A&&A===z&&C&&("log"===C&&"log"!==A.type?B=Math.pow(10,B):"log"!==C&&"log"===A.type&&(B=B>0?Math.log(B)/Math.LN10:void 0)),q[y]=B}}var I=d(q,o);o.annotations[b]=I;var J=g.Axes.getFromId(a,I.xref),K=g.Axes.getFromId(a,I.yref),L={x:0,y:0},M=+I.textangle||0,N=o._infolayer.append("g").classed("annotation",!0).attr("data-index",String(b)).style("opacity",I.opacity).on("click",function(){a._dragging=!1,a.emit("plotly_clickannotation",{index:b,annotation:q,fullAnnotation:I})}),O=N.append("g").classed("annotation-text-g",!0).attr("data-index",String(b)),P=O.append("svg").call(g.Drawing.setPosition,0,0),Q=I.borderwidth,R=I.borderpad,S=Q+R,T=P.append("rect").attr("class","bg").style("stroke-width",Q+"px").call(g.Color.stroke,I.bordercolor).call(g.Color.fill,I.bgcolor),U=I.font,V=P.append("text").classed("annotation",!0).attr("data-unformatted",I.text).text(I.text);a._context.editable?V.call(g.util.makeEditable,P).call(k).on("edit",function(c){I.text=c,this.attr({"data-unformatted":I.text}),this.call(k);var d={};d["annotations["+b+"].text"]=I.text,J&&J.autorange&&(d[J._name+".autorange"]=!0),K&&K.autorange&&(d[K._name+".autorange"]=!0),g.relayout(a,d)}):V.call(k),O.attr({transform:"rotate("+M+","+L.x+","+L.y+")"}).call(g.Drawing.setPosition,L.x,L.y)}},j.arrowhead=function(a,b,c,d){i(d)||(d=1);var e=a.node(),f=j.ARROWPATHS[b||0];if(f){"string"==typeof c&&c||(c="end");var k,l,m,n,o=(g.Drawing.getPx(a,"stroke-width")||1)*d,p=a.style("stroke")||g.Color.defaultLine,q=a.style("stroke-opacity")||1,r=c.indexOf("start")>=0,s=c.indexOf("end")>=0,t=f.backoff*o;if("line"===e.nodeName){if(k={x:+a.attr("x1"),y:+a.attr("y1")},l={x:+a.attr("x2"),y:+a.attr("y2")},m=Math.atan2(k.y-l.y,k.x-l.x),n=m+Math.PI,t){var u=t*Math.cos(m),v=t*Math.sin(m);r&&(k.x-=u,k.y-=v,a.attr({x1:k.x,y1:k.y})),s&&(l.x+=u,l.y+=v,a.attr({x2:l.x,y2:l.y}))}}else if("path"===e.nodeName){var w=e.getTotalLength(),x="";if(r){var y=e.getPointAtLength(0),z=e.getPointAtLength(.1);m=Math.atan2(y.y-z.y,y.x-z.x),k=e.getPointAtLength(Math.min(t,w)),t&&(x="0px,"+t+"px,")}if(s){var A=e.getPointAtLength(w),B=e.getPointAtLength(w-.1);if(n=Math.atan2(A.y-B.y,A.x-B.x),l=e.getPointAtLength(Math.max(0,w-t)),t){var C=x?2*t:t;x+=w-C+"px,"+w+"px"}}else x&&(x+=w+"px");x&&a.style("stroke-dasharray",x)}var D=function(c,d){b>5&&(d=0),h.select(e.parentElement).append("path").attr({"class":a.attr("class"),d:f.path,transform:"translate("+c.x+","+c.y+")rotate("+180*d/Math.PI+")scale("+o+")"}).style({fill:p,opacity:q,"stroke-width":0})};r&&D(k,m),s&&D(l,n)}},j.calcAutorange=function(a){var b=a._fullLayout,c=b.annotations;if(c.length&&a._fullData.length){var d={};c.forEach(function(a){d[a.xref]=!0,d[a.yref]=!0});var f=g.Axes.list(a).filter(function(a){return a.autorange&&d[a._id]});if(f.length)return g.Lib.syncOrAsync([j.drawAll,e],a)}}},{"../../plotly":366,"./arrow_paths":295,"./attributes":296,d3:70,"fast-isnumeric":74}],298:[function(a,b,c){"use strict";c.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],c.defaultLine="#444",c.lightLine="#eee",c.background="#fff"},{}],299:[function(a,b,c){"use strict";function d(a){if(f(a)||"string"!=typeof a)return a;var b=a.trim();if("rgb"!==b.substr(0,3))return a;var c=b.match(/^rgba?\s*\(([^()]*)\)$/);if(!c)return a;var d=c[1].trim().split(/\s*[\s,]\s*/),e="a"===b.charAt(3)&&4===d.length;if(!e&&3!==d.length)return a;for(var g=0;g<d.length;g++){if(!d[g].length)return a;if(d[g]=Number(d[g]),!(d[g]>=0))return a;if(3===g)d[g]>1&&(d[g]=1);else if(d[g]>=1)return a}var h=Math.round(255*d[0])+", "+Math.round(255*d[1])+", "+Math.round(255*d[2]);return e?"rgba("+h+", "+d[3]+")":"rgb("+h+")"}var e=a("tinycolor2"),f=a("fast-isnumeric"),g=b.exports={},h=a("./attributes");g.defaults=h.defaults,g.defaultLine=h.defaultLine,g.lightLine=h.lightLine,g.background=h.background,g.tinyRGB=function(a){var b=a.toRgb();return"rgb("+Math.round(b.r)+", "+Math.round(b.g)+", "+Math.round(b.b)+")"},g.rgb=function(a){return g.tinyRGB(e(a))},g.opacity=function(a){return a?e(a).getAlpha():0},g.addOpacity=function(a,b){var c=e(a).toRgb();return"rgba("+Math.round(c.r)+", "+Math.round(c.g)+", "+Math.round(c.b)+", "+b+")"},g.combine=function(a,b){var c=e(a).toRgb();if(1===c.a)return e(a).toRgbString();var d=e(b||g.background).toRgb(),f=1===d.a?d:{r:255*(1-d.a)+d.r*d.a,g:255*(1-d.a)+d.g*d.a,b:255*(1-d.a)+d.b*d.a},h={r:f.r*(1-c.a)+c.r*c.a,g:f.g*(1-c.a)+c.g*c.a,b:f.b*(1-c.a)+c.b*c.a};return e(h).toRgbString()},g.stroke=function(a,b){var c=e(b);a.style({stroke:g.tinyRGB(c),"stroke-opacity":c.getAlpha()})},g.fill=function(a,b){var c=e(b);a.style({fill:g.tinyRGB(c),"fill-opacity":c.getAlpha()})},g.clean=function(a){if(a&&"object"==typeof a){var b,c,e,f,h=Object.keys(a);for(b=0;b<h.length;b++)if(e=h[b],f=a[e],"color"===e.substr(e.length-5))if(Array.isArray(f))for(c=0;c<f.length;c++)f[c]=d(f[c]);else a[e]=d(f);else if("colorscale"===e.substr(e.length-10)&&Array.isArray(f))for(c=0;c<f.length;c++)Array.isArray(f[c])&&(f[c][1]=d(f[c][1]));else if(Array.isArray(f)){var i=f[0];if(!Array.isArray(i)&&i&&"object"==typeof i)for(c=0;c<f.length;c++)g.clean(f[c])}else f&&"object"==typeof f&&g.clean(f)}}},{"./attributes":298,"fast-isnumeric":74,tinycolor2:229}],300:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/layout_attributes"),e=a("../../plots/font_attributes"),f=a("../../lib/extend").extendFlat;b.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:d.linecolor,outlinewidth:d.linewidth,bordercolor:d.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:d.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:f({},d.ticks,{dflt:""}),ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,showticklabels:d.showticklabels,tickfont:d.tickfont,tickangle:d.tickangle,tickformat:d.tickformat,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,exponentformat:d.exponentformat,showexponent:d.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:f({},e,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":345,"../../plots/cartesian/layout_attributes":376,"../../plots/font_attributes":383}],301:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../plots/cartesian/tick_value_defaults"),f=a("../../plots/cartesian/tick_defaults"),g=a("./attributes");b.exports=function(a,b,c){function h(a,b){return d.coerce(j,i,g,a,b)}var i=b.colorbar={},j=a.colorbar||{},k=h("thicknessmode");h("thickness","fraction"===k?30/(c.width-c.margin.l-c.margin.r):30);var l=h("lenmode");h("len","fraction"===l?1:c.height-c.margin.t-c.margin.b),h("x"),h("xanchor"),h("xpad"),h("y"),h("yanchor"),h("ypad"),d.noneOrAll(j,i,["x","y"]),h("outlinecolor"),h("outlinewidth"),h("bordercolor"),h("borderwidth"),h("bgcolor"),e(j,i,h,"linear"),f(j,i,h,"linear",{outerTicks:!1,font:c.font,noHover:!0}),h("title"),d.coerceFont(h,"titlefont",c.font),h("titleside")}},{"../../lib":349,"../../plots/cartesian/tick_defaults":381,"../../plots/cartesian/tick_value_defaults":382,"./attributes":300}],302:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../plotly"),f=a("../../plots/plots"),g=a("../../plots/cartesian/axes"),h=a("../../plots/cartesian/graph_interact"),i=a("../../lib"),j=a("../drawing"),k=a("../color"),l=a("../titles"),m=a("../../plots/cartesian/axis_defaults"),n=a("../../plots/cartesian/position_defaults"),o=a("../../plots/cartesian/layout_attributes"),p=a("./attributes");b.exports=function(a,b){function c(){function p(a,b){return i.coerce(T,U,o,a,b)}function r(){if(-1!==["top","bottom"].indexOf(q.titleside)){var b=$.select(".cbtitle"),c=b.select("text"),e=[-q.outlinewidth/2,q.outlinewidth/2],f=b.select(".h"+U._id+"title-math-group").node(),h=15.6;if(c.node()&&(h=1.3*parseInt(c.style("font-size"),10)),f?(aa=j.bBox(f).height,aa>h&&(e[1]-=(aa-h)/2)):c.node()&&!c.classed("js-placeholder")&&(aa=j.bBox(b.node()).height),aa){if(aa+=5,"top"===q.titleside)U.domain[1]-=aa/t._size.h,e[1]*=-1;else{U.domain[0]+=aa/t._size.h;var i=Math.max(1,c.selectAll("tspan.line").size());e[1]+=(1-i)*h}b.attr("transform","translate("+e+")"),U.setScale()}}$.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(t._size.h*(1-U.domain[1]))+")");var k=$.select(".cbfills").selectAll("rect.cbfill").data(x);k.enter().append("rect").classed("cbfill",!0).style("stroke","none"),k.exit().remove(),k.each(function(a,b){var c=[0===b?v[0]:(x[b]+x[b-1])/2,b===x.length-1?v[1]:(x[b]+x[b+1])/2].map(U.c2p).map(Math.round);b!==x.length-1&&(c[1]+=c[1]>c[0]?1:-1),d.select(this).attr({x:O,width:Math.max(H,2),y:d.min(c),height:Math.max(d.max(c)-d.min(c),2)}).style("fill",z(a))});var l=$.select(".cblines").selectAll("path.cbline").data(q.line.color&&q.line.width?w:[]);return l.enter().append("path").classed("cbline",!0),l.exit().remove(),l.each(function(a){d.select(this).attr("d","M"+O+","+(Math.round(U.c2p(a))+q.line.width/2%1)+"h"+H).call(j.lineGroupStyle,q.line.width,y(a),q.line.dash)}),U._axislayer.selectAll("g."+U._id+"tick,path").remove(),U._pos=O+H+(q.outlinewidth||0)/2-("outside"===q.ticks?1:0),U.side="right",g.doTicks(a,U)}function s(){var c=H+q.outlinewidth/2+j.bBox(U._axislayer.node()).width;if(E=_.select("text"),E.node()&&!E.classed("js-placeholder")){var d,e=_.select(".h"+U._id+"title-math-group").node();d=e&&-1!==["top","bottom"].indexOf(q.titleside)?j.bBox(e).width:j.bBox(_.node()).right-O-t._size.l,c=Math.max(c,d)}var g=2*q.xpad+c+q.borderwidth+q.outlinewidth/2,h=R-S;$.select(".cbbg").attr({x:O-q.xpad-(q.borderwidth+q.outlinewidth)/2,y:S-M,width:Math.max(g,2),height:Math.max(h+2*M,2)}).call(k.fill,q.bgcolor).call(k.stroke,q.bordercolor).style({"stroke-width":q.borderwidth}),$.selectAll(".cboutline").attr({x:O,y:S+q.ypad+("top"===q.titleside?aa:0),width:Math.max(H,2),height:Math.max(h-2*q.ypad-aa,2)}).call(k.stroke,q.outlinecolor).style({fill:"None","stroke-width":q.outlinewidth});var i=({center:.5,right:1}[q.xanchor]||0)*g;$.attr("transform","translate("+(t._size.l-i)+","+t._size.t+")"),f.autoMargin(a,b,{x:q.x,y:q.y,l:g*({right:1,center:.5}[q.xanchor]||0),r:g*({left:1,center:.5}[q.xanchor]||0),t:h*({bottom:1,middle:.5}[q.yanchor]||0),b:h*({top:1,middle:.5}[q.yanchor]||0)})}var t=a._fullLayout;if("function"!=typeof q.fillcolor&&"function"!=typeof q.line.color)return void t._infolayer.selectAll("g."+b).remove();var u,v=d.extent(("function"==typeof q.fillcolor?q.fillcolor:q.line.color).domain()),w=[],x=[],y="function"==typeof q.line.color?q.line.color:function(){return q.line.color},z="function"==typeof q.fillcolor?q.fillcolor:function(){return q.fillcolor},A=q.levels.end+q.levels.size/100,B=q.levels.size,C=1.001*v[0]-.001*v[1],D=1.001*v[1]-.001*v[0];for(u=q.levels.start;0>(u-A)*B;u+=B)u>C&&D>u&&w.push(u);if("function"==typeof q.fillcolor)if(q.filllevels)for(A=q.filllevels.end+q.filllevels.size/100,B=q.filllevels.size,u=q.filllevels.start;0>(u-A)*B;u+=B)u>v[0]&&u<v[1]&&x.push(u);else x=w.map(function(a){return a-q.levels.size/2}),x.push(x[x.length-1]+q.levels.size);else q.fillcolor&&"string"==typeof q.fillcolor&&(x=[0]);q.levels.size<0&&(w.reverse(),x.reverse());var E,F=t.height-t.margin.t-t.margin.b,G=t.width-t.margin.l-t.margin.r,H=Math.round(q.thickness*("fraction"===q.thicknessmode?G:1)),I=H/t._size.w,J=Math.round(q.len*("fraction"===q.lenmode?F:1)),K=J/t._size.h,L=q.xpad/t._size.w,M=(q.borderwidth+q.outlinewidth)/2,N=q.ypad/t._size.h,O=Math.round(q.x*t._size.w+q.xpad),P=q.x-I*({middle:.5,right:1}[q.xanchor]||0),Q=q.y+K*(({top:-.5,bottom:.5}[q.yanchor]||0)-.5),R=Math.round(t._size.h*(1-Q)),S=R-J,T={type:"linear",range:v,tickmode:q.tickmode,nticks:q.nticks,tick0:q.tick0,dtick:q.dtick,tickvals:q.tickvals,ticktext:q.ticktext,ticks:q.ticks,ticklen:q.ticklen,tickwidth:q.tickwidth,tickcolor:q.tickcolor,showticklabels:q.showticklabels,tickfont:q.tickfont,tickangle:q.tickangle,tickformat:q.tickformat,exponentformat:q.exponentformat,showexponent:q.showexponent,showtickprefix:q.showtickprefix,tickprefix:q.tickprefix,showticksuffix:q.showticksuffix,ticksuffix:q.ticksuffix,title:q.title,titlefont:q.titlefont,anchor:"free",position:1},U={},V={letter:"y",font:t.font,noHover:!0};if(m(T,U,p,V),n(T,U,p,V),U._id="y"+b,U._td=a,U.position=q.x+L+I,c.axis=U,-1!==["top","bottom"].indexOf(q.titleside)&&(U.titleside=q.titleside,U.titlex=q.x+L,U.titley=Q+("top"===q.titleside?K-N:N)),q.line.color&&"auto"===q.tickmode){U.tickmode="linear",U.tick0=q.levels.start;var W=q.levels.size,X=i.constrain((R-S)/50,4,15)+1,Y=(v[1]-v[0])/((q.nticks||X)*W);if(Y>1){var Z=Math.pow(10,Math.floor(Math.log(Y)/Math.LN10));W*=Z*i.roundUp(Y/Z,[2,5,10]),(Math.abs(q.levels.start)/q.levels.size+1e-6)%1<2e-6&&(U.tick0=0)}U.dtick=W}U.domain=[Q+N,Q+K-N],U.setScale();var $=t._infolayer.selectAll("g."+b).data([0]);$.enter().append("g").classed(b,!0).each(function(){var a=d.select(this);a.append("rect").classed("cbbg",!0),a.append("g").classed("cbfills",!0),a.append("g").classed("cblines",!0),a.append("g").classed("cbaxis",!0).classed("crisp",!0),a.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),a.append("rect").classed("cboutline",!0)}),$.attr("transform","translate("+Math.round(t._size.l)+","+Math.round(t._size.t)+")");var _=$.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(t._size.l)+",-"+Math.round(t._size.t)+")");U._axislayer=$.select(".cbaxis");var aa=0;-1!==["top","bottom"].indexOf(q.titleside)&&l.draw(a,U._id+"title");var ba=i.syncOrAsync([f.previousPromises,r,f.previousPromises,s],a);if(ba&&ba.then&&(a._promises||[]).push(ba),a._context.editable){var ca,da,ea;h.dragElement({element:$.node(),prepFn:function(){ca=$.attr("transform"),h.setCursor($)},moveFn:function(b,c){var d=a._fullLayout._size;$.attr("transform",ca+" translate("+b+","+c+")"),da=h.dragAlign(P+b/d.w,I,0,1,q.xanchor),ea=h.dragAlign(Q-c/d.h,K,0,1,q.yanchor); 45 var e=h.dragCursors(da,ea,q.xanchor,q.yanchor);h.setCursor($,e)},doneFn:function(c){if(h.setCursor($),c&&void 0!==da&&void 0!==ea){var d,f=b.substr(2);a._fullData.some(function(a){return a.uid===f?(d=a.index,!0):void 0}),e.restyle(a,{"colorbar.x":da,"colorbar.y":ea},d)}}})}return ba}var q={};return Object.keys(p).forEach(function(a){q[a]=null}),q.fillcolor=null,q.line={color:null,width:null,dash:null},q.levels={start:null,end:null,size:null},q.filllevels=null,Object.keys(q).forEach(function(a){c[a]=function(b){return arguments.length?(q[a]=i.isPlainObject(q[a])?i.extendFlat(q[a],b):b,c):q[a]}}),c.options=function(a){return Object.keys(a).forEach(function(b){"function"==typeof c[b]&&c[b](a[b])}),c},c._opts=q,c}},{"../../lib":349,"../../plotly":366,"../../plots/cartesian/axes":369,"../../plots/cartesian/axis_defaults":370,"../../plots/cartesian/graph_interact":374,"../../plots/cartesian/layout_attributes":376,"../../plots/cartesian/position_defaults":378,"../../plots/plots":413,"../color":299,"../drawing":317,"../titles":332,"./attributes":300,d3:70}],303:[function(a,b,c){"use strict";b.exports=function(a){return"object"==typeof a.colorbar&&null!==a.colorbar}},{}],304:[function(a,b,c){"use strict";c.attributes=a("./attributes"),c.supplyDefaults=a("./defaults"),c.draw=a("./draw"),c.hasColorbar=a("./has_colorbar")},{"./attributes":300,"./defaults":301,"./draw":302,"./has_colorbar":303}],305:[function(a,b,c){"use strict";b.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0},_deprecated:{scl:{valType:"colorscale"},reversescl:{valType:"boolean"}}}},{}],306:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./scales"),f=a("./flip_scale");b.exports=function(a,b,c,g){var h,i;c?(h=d.nestedProperty(a,c).get(),i=d.nestedProperty(a._input,c).get()):(h=a,i=a._input);var j=h[g+"auto"],k=h[g+"min"],l=h[g+"max"],m=h.colorscale;j===!1&&void 0!==k||(k=d.aggNums(Math.min,null,b)),j===!1&&void 0!==l||(l=d.aggNums(Math.max,null,b)),k===l&&(k-=.5,l+=.5),h[g+"min"]=k,h[g+"max"]=l,i[g+"min"]=k,i[g+"max"]=l,h.autocolorscale&&(m=0>k*l?e.RdBu:k>=0?e.Reds:e.Blues,i.colorscale=m,h.reversescale&&(m=f(m)),h.colorscale=m)}},{"../../lib":349,"./flip_scale":309,"./scales":316}],307:[function(a,b,c){"use strict";var d=a("./scales");b.exports=d.RdBu},{"./scales":316}],308:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("../colorbar/has_colorbar"),g=a("../colorbar/defaults"),h=a("./is_valid_scale"),i=a("./flip_scale");b.exports=function(a,b,c,j,k){var l=k.prefix,m=k.cLetter,n=l.slice(0,l.length-1),o=l?e.nestedProperty(a,n).get()||{}:a,p=l?e.nestedProperty(b,n).get()||{}:b,q=o[m+"min"],r=o[m+"max"],s=o.colorscale,t=d(q)&&d(r)&&r>q;j(l+m+"auto",!t),j(l+m+"min"),j(l+m+"max");var u;void 0!==s&&(u=!h(s)),j(l+"autocolorscale",u);var v=j(l+"colorscale"),w=j(l+"reversescale");if(w&&(p.colorscale=i(v)),"marker.line."!==l){var x;l&&(x=f(o));var y=j(l+"showscale",x);y&&g(o,p,c)}}},{"../../lib":349,"../colorbar/defaults":301,"../colorbar/has_colorbar":303,"./flip_scale":309,"./is_valid_scale":313,"fast-isnumeric":74}],309:[function(a,b,c){"use strict";b.exports=function(a){for(var b,c=a.length,d=new Array(c),e=c-1,f=0;e>=0;e--,f++)b=a[e],d[f]=[1-b[0],b[1]];return d}},{}],310:[function(a,b,c){"use strict";var d=a("./scales"),e=a("./default_scale"),f=a("./is_valid_scale_array");b.exports=function(a,b){function c(){try{a=d[a]||JSON.parse(a)}catch(c){a=b}}return b||(b=e),a?("string"==typeof a&&(c(),"string"==typeof a&&c()),f(a)?a:b):b}},{"./default_scale":307,"./is_valid_scale_array":314,"./scales":316}],311:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("./is_valid_scale");b.exports=function(a,b){var c=b?e.nestedProperty(a,b).get()||{}:a,g=c.color,h=!1;if(Array.isArray(g))for(var i=0;i<g.length;i++)if(d(g[i])){h=!0;break}return"object"==typeof c&&null!==c&&(h||c.showscale===!0||d(c.cmin)&&d(c.cmax)||f(c.colorscale)||"object"==typeof c.colorbar&&null!==c.colorbar)}},{"../../lib":349,"./is_valid_scale":313,"fast-isnumeric":74}],312:[function(a,b,c){"use strict";c.scales=a("./scales"),c.defaultScale=a("./default_scale"),c.attributes=a("./attributes"),c.handleDefaults=a("./defaults"),c.calc=a("./calc"),c.hasColorscale=a("./has_colorscale"),c.isValidScale=a("./is_valid_scale"),c.getScale=a("./get_scale"),c.flipScale=a("./flip_scale"),c.makeScaleFunction=a("./make_scale_function")},{"./attributes":305,"./calc":306,"./default_scale":307,"./defaults":308,"./flip_scale":309,"./get_scale":310,"./has_colorscale":311,"./is_valid_scale":313,"./make_scale_function":315,"./scales":316}],313:[function(a,b,c){"use strict";var d=a("./scales"),e=a("./is_valid_scale_array");b.exports=function(a){return void 0!==d[a]?!0:e(a)}},{"./is_valid_scale_array":314,"./scales":316}],314:[function(a,b,c){"use strict";var d=a("tinycolor2");b.exports=function(a){var b,c=!0,e=0;if(Array.isArray(a)){if(0!==+a[0][0]||1!==+a[a.length-1][0])return!1;for(var f=0;f<a.length;f++){if(b=a[f],2!==b.length||+b[0]<e||!d(b[1]).isValid()){c=!1;break}e=+b[0]}return c}return!1}},{tinycolor2:229}],315:[function(a,b,c){"use strict";var d=a("d3"),e=a("tinycolor2"),f=a("fast-isnumeric"),g=a("../color");b.exports=function(a,b,c){for(var h,i=a.length,j=new Array(i),k=new Array(i),l=0;i>l;l++)h=a[l],j[l]=b+h[0]*(c-b),k[l]=h[1];var m=d.scale.linear().domain(j).interpolate(d.interpolateRgb).range(k);return function(a){return f(a)?m(a):e(a).isValid()?a:g.defaultLine}}},{"../color":299,d3:70,"fast-isnumeric":74,tinycolor2:229}],316:[function(a,b,c){"use strict";b.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],317:[function(a,b,c){"use strict";function d(a,b,c,d){var e=a[0]-b[0],g=a[1]-b[1],h=c[0]-b[0],i=c[1]-b[1],j=Math.pow(e*e+g*g,q/2),k=Math.pow(h*h+i*i,q/2),l=(k*k*e-j*j*h)*d,m=(k*k*g-j*j*i)*d,n=3*k*(j+k),o=3*j*(j+k);return[[f.round(b[0]+(n&&l/n),2),f.round(b[1]+(n&&m/n),2)],[f.round(b[0]-(o&&l/o),2),f.round(b[1]-(o&&m/o),2)]]}var e=a("../../plotly"),f=a("d3"),g=a("fast-isnumeric"),h=a("../../constants/xmlns_namespaces"),i=a("../../traces/scatter/subtypes"),j=a("../../traces/scatter/make_bubble_size_func"),k=b.exports={};k.font=function(a,b,c,d){b&&b.family&&(d=b.color,c=b.size,b=b.family),b&&a.style("font-family",b),c+1&&a.style("font-size",c+"px"),d&&a.call(e.Color.fill,d)},k.setPosition=function(a,b,c){a.attr("x",b).attr("y",c)},k.setSize=function(a,b,c){a.attr("width",b).attr("height",c)},k.setRect=function(a,b,c,d,e){a.call(k.setPosition,b,c).call(k.setSize,d,e)},k.translatePoints=function(a,b,c){a.each(function(a){var d=a.xp||b.c2p(a.x),e=a.yp||c.c2p(a.y),h=f.select(this);g(d)&&g(e)?"text"===this.nodeName?h.attr("x",d).attr("y",e):h.attr("transform","translate("+d+","+e+")"):h.remove()})},k.getPx=function(a,b){return Number(a.style(b).replace(/px$/,""))},k.crispRound=function(a,b,c){return b&&g(b)?a._context.staticPlot?b:1>b?1:Math.round(b):c||0},k.lineGroupStyle=function(a,b,c,d){a.style("fill","none").each(function(a){var g=(((a||[])[0]||{}).trace||{}).line||{},h=b||g.width||0,i=d||g.dash||"";f.select(this).call(e.Color.stroke,c||g.color).call(k.dashLine,i,h)})},k.dashLine=function(a,b,c){var d=Math.max(c,3);"solid"===b?b="":"dot"===b?b=d+"px,"+d+"px":"dash"===b?b=3*d+"px,"+3*d+"px":"longdash"===b?b=5*d+"px,"+5*d+"px":"dashdot"===b?b=3*d+"px,"+d+"px,"+d+"px,"+d+"px":"longdashdot"===b&&(b=5*d+"px,"+2*d+"px,"+d+"px,"+2*d+"px"),a.style({"stroke-dasharray":b,"stroke-width":c+"px"})},k.fillGroupStyle=function(a){a.style("stroke-width",0).each(function(b){var c=f.select(this);try{c.call(e.Color.fill,b[0].trace.fillcolor)}catch(d){console.log(d,a),c.remove()}})};var l=a("./symbol_defs");k.symbolNames=[],k.symbolFuncs=[],k.symbolNeedLines={},k.symbolNoDot={},k.symbolList=[],Object.keys(l).forEach(function(a){var b=l[a];k.symbolList=k.symbolList.concat([b.n,a,b.n+100,a+"-open"]),k.symbolNames[b.n]=a,k.symbolFuncs[b.n]=b.f,b.needLine&&(k.symbolNeedLines[b.n]=!0),b.noDot?k.symbolNoDot[b.n]=!0:k.symbolList=k.symbolList.concat([b.n+200,a+"-dot",b.n+300,a+"-open-dot"])});var m=k.symbolNames.length,n="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";k.symbolNumber=function(a){if("string"==typeof a){var b=0;a.indexOf("-open")>0&&(b=100,a=a.replace("-open","")),a.indexOf("-dot")>0&&(b+=200,a=a.replace("-dot","")),a=k.symbolNames.indexOf(a),a>=0&&(a+=b)}return a%100>=m||a>=400?0:Math.floor(Math.max(a,0))},k.pointStyle=function(a,b){if(a.size()){var c=b.marker,d=c.line;if(e.Plots.traceIs(b,"symbols")){var g=j(b);a.attr("d",function(a){var d;d="various"===a.ms||"various"===c.size?3:i.isBubble(b)?g(a.ms):(c.size||6)/2,a.mrc=d;var e=k.symbolNumber(a.mx||c.symbol)||0,f=e%100;return a.om=e%200>=100,k.symbolFuncs[f](d)+(e>=200?n:"")}).style("opacity",function(a){return(a.mo+1||c.opacity+1)-1})}var h=(b._input||{}).marker||{},l=k.tryColorscale(c,h,""),m=k.tryColorscale(c,h,"line.");a.each(function(a){var b,g,h;a.so?(h=d.outlierwidth,g=d.outliercolor,b=c.outliercolor):(h=(a.mlw+1||d.width+1||(a.trace?a.trace.marker.line.width:0)+1)-1,g="mlc"in a?a.mlcc=m(a.mlc):Array.isArray(d.color)?e.Color.defaultLine:d.color,b="mc"in a?a.mcc=l(a.mc):Array.isArray(c.color)?e.Color.defaultLine:c.color||"rgba(0,0,0,0)");var i=f.select(this);a.om?i.call(e.Color.stroke,b).style({"stroke-width":(h||1)+"px",fill:"none"}):(i.style("stroke-width",h+"px").call(e.Color.fill,b),h&&i.call(e.Color.stroke,g))})}},k.tryColorscale=function(a,b,c){var d=e.Lib.nestedProperty(a,c+"color").get(),f=e.Lib.nestedProperty(a,c+"colorscale").get(),h=e.Lib.nestedProperty(a,c+"cauto").get(),i=e.Lib.nestedProperty(a,c+"cmin"),j=e.Lib.nestedProperty(a,c+"cmax"),k=i.get(),l=j.get();return f&&Array.isArray(d)?(!h&&g(k)&&g(l)||(k=1/0,l=-(1/0),d.forEach(function(a){g(a)&&(k>a&&(k=+a),a>l&&(l=+a))}),k>l&&(k=0,l=1),i.set(k),j.set(l),e.Lib.nestedProperty(b,c+"cmin").set(k),e.Lib.nestedProperty(b,c+"cmax").set(l)),e.Colorscale.makeScaleFunction(f,k,l)):e.Lib.identity};var o={start:1,end:-1,middle:0,bottom:1,top:-1},p=1.3;k.textPointStyle=function(a,b){a.each(function(a){var c=f.select(this),d=a.tx||b.text;if(!d||Array.isArray(d))return void c.remove();var h=a.tp||b.textposition,i=-1!==h.indexOf("top")?"top":-1!==h.indexOf("bottom")?"bottom":"middle",j=-1!==h.indexOf("left")?"end":-1!==h.indexOf("right")?"start":"middle",l=a.ts||b.textfont.size,m=a.mrc?a.mrc/.8+1:0;l=g(l)&&l>0?l:0,c.call(k.font,a.tf||b.textfont.family,l,a.tc||b.textfont.color).attr("text-anchor",j).text(d).call(e.util.convertToTspans);var n=f.select(this.parentNode),q=c.selectAll("tspan.line"),r=((q[0].length||1)-1)*p+1,s=o[j]*m,t=.75*l+o[i]*m+(o[i]-1)*r*l/2;n.attr("transform","translate("+s+","+t+")"),r>1&&q.attr({x:c.attr("x"),y:c.attr("y")})})};var q=.5;k.smoothopen=function(a,b){if(a.length<3)return"M"+a.join("L");var c,e="M"+a[0],f=[];for(c=1;c<a.length-1;c++)f.push(d(a[c-1],a[c],a[c+1],b));for(e+="Q"+f[0][0]+" "+a[1],c=2;c<a.length-1;c++)e+="C"+f[c-2][1]+" "+f[c-1][0]+" "+a[c];return e+="Q"+f[a.length-3][1]+" "+a[a.length-1]},k.smoothclosed=function(a,b){if(a.length<3)return"M"+a.join("L")+"Z";var c,e="M"+a[0],f=a.length-1,g=[d(a[f],a[0],a[1],b)];for(c=1;f>c;c++)g.push(d(a[c-1],a[c],a[c+1],b));for(g.push(d(a[f-1],a[f],a[0],b)),c=1;f>=c;c++)e+="C"+g[c-1][1]+" "+g[c][0]+" "+a[c];return e+="C"+g[f][1]+" "+g[0][0]+" "+a[0]+"Z"};var r={hv:function(a,b){return"H"+f.round(b[0],2)+"V"+f.round(b[1],2)},vh:function(a,b){return"V"+f.round(b[1],2)+"H"+f.round(b[0],2)},hvh:function(a,b){return"H"+f.round((a[0]+b[0])/2,2)+"V"+f.round(b[1],2)+"H"+f.round(b[0],2)},vhv:function(a,b){return"V"+f.round((a[1]+b[1])/2,2)+"H"+f.round(b[0],2)+"V"+f.round(b[1],2)}},s=function(a,b){return"L"+f.round(b[0],2)+","+f.round(b[1],2)};k.steps=function(a){var b=r[a]||s;return function(a){for(var c="M"+f.round(a[0][0],2)+","+f.round(a[0][1],2),d=1;d<a.length;d++)c+=b(a[d-1],a[d]);return c}},k.makeTester=function(a){var b=f.select("body").selectAll("#js-plotly-tester").data([0]);b.enter().append("svg").attr("id","js-plotly-tester").attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px"});var c=b.selectAll(".js-reference-point").data([0]);c.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),b.node()._cache||(b.node()._cache={}),a._tester=b,a._testref=c};var t=[],u=1e4;k.bBox=function(a){var b=a.attributes["data-bb"];if(b&&b.value)return e.Lib.extendFlat({},t[b.value]);var c=f.select("#js-plotly-tester"),d=c.node(),g=a.cloneNode(!0);d.appendChild(g),f.select(g).attr({x:0,y:0,transform:""});var h=g.getBoundingClientRect(),i=c.select(".js-reference-point").node().getBoundingClientRect();d.removeChild(g);var j={height:h.height,width:h.width,left:h.left-i.left,top:h.top-i.top,right:h.right-i.left,bottom:h.bottom-i.top};return t.length>=u&&(f.selectAll("[data-bb]").attr("data-bb",null),t=[]),a.setAttribute("data-bb",t.length),t.push(j),e.Lib.extendFlat({},j)},k.setClipUrl=function(a,b){if(!b)return void a.attr("clip-path",null);var c="#"+b,d=f.select("base");d.size()&&d.attr("href")&&(c=window.location.href+c),a.attr("clip-path","url("+c+")")}},{"../../constants/xmlns_namespaces":338,"../../plotly":366,"../../traces/scatter/make_bubble_size_func":514,"../../traces/scatter/subtypes":520,"./symbol_defs":318,d3:70,"fast-isnumeric":74}],318:[function(a,b,c){"use strict";var d=a("d3");b.exports={circle:{n:0,f:function(a){var b=d.round(a,2);return"M"+b+",0A"+b+","+b+" 0 1,1 0,-"+b+"A"+b+","+b+" 0 0,1 "+b+",0Z"}},square:{n:1,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"H-"+b+"V-"+b+"H"+b+"Z"}},diamond:{n:2,f:function(a){var b=d.round(1.3*a,2);return"M"+b+",0L0,"+b+"L-"+b+",0L0,-"+b+"Z"}},cross:{n:3,f:function(a){var b=d.round(.4*a,2),c=d.round(1.2*a,2);return"M"+c+","+b+"H"+b+"V"+c+"H-"+b+"V"+b+"H-"+c+"V-"+b+"H-"+b+"V-"+c+"H"+b+"V-"+b+"H"+c+"Z"}},x:{n:4,f:function(a){var b=d.round(.8*a/Math.sqrt(2),2),c="l"+b+","+b,e="l"+b+",-"+b,f="l-"+b+",-"+b,g="l-"+b+","+b;return"M0,"+b+c+e+f+e+f+g+f+g+c+g+c+"Z"}},"triangle-up":{n:5,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M-"+b+","+c+"H"+b+"L0,-"+e+"Z"}},"triangle-down":{n:6,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M-"+b+",-"+c+"H"+b+"L0,"+e+"Z"}},"triangle-left":{n:7,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M"+c+",-"+b+"V"+b+"L-"+e+",0Z"}},"triangle-right":{n:8,f:function(a){var b=d.round(2*a/Math.sqrt(3),2),c=d.round(a/2,2),e=d.round(a,2);return"M-"+c+",-"+b+"V"+b+"L"+e+",0Z"}},"triangle-ne":{n:9,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M-"+c+",-"+b+"H"+b+"V"+c+"Z"}},"triangle-se":{n:10,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M"+b+",-"+c+"V"+b+"H-"+c+"Z"}},"triangle-sw":{n:11,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M"+c+","+b+"H-"+b+"V-"+c+"Z"}},"triangle-nw":{n:12,f:function(a){var b=d.round(.6*a,2),c=d.round(1.2*a,2);return"M-"+b+","+c+"V-"+b+"H"+c+"Z"}},pentagon:{n:13,f:function(a){var b=d.round(.951*a,2),c=d.round(.588*a,2),e=d.round(-a,2),f=d.round(a*-.309,2),g=d.round(.809*a,2);return"M"+b+","+f+"L"+c+","+g+"H-"+c+"L-"+b+","+f+"L0,"+e+"Z"}},hexagon:{n:14,f:function(a){var b=d.round(a,2),c=d.round(a/2,2),e=d.round(a*Math.sqrt(3)/2,2);return"M"+e+",-"+c+"V"+c+"L0,"+b+"L-"+e+","+c+"V-"+c+"L0,-"+b+"Z"}},hexagon2:{n:15,f:function(a){var b=d.round(a,2),c=d.round(a/2,2),e=d.round(a*Math.sqrt(3)/2,2);return"M-"+c+","+e+"H"+c+"L"+b+",0L"+c+",-"+e+"H-"+c+"L-"+b+",0Z"}},octagon:{n:16,f:function(a){var b=d.round(.924*a,2),c=d.round(.383*a,2);return"M-"+c+",-"+b+"H"+c+"L"+b+",-"+c+"V"+c+"L"+c+","+b+"H-"+c+"L-"+b+","+c+"V-"+c+"Z"}},star:{n:17,f:function(a){var b=1.4*a,c=d.round(.225*b,2),e=d.round(.951*b,2),f=d.round(.363*b,2),g=d.round(.588*b,2),h=d.round(-b,2),i=d.round(b*-.309,2),j=d.round(.118*b,2),k=d.round(.809*b,2),l=d.round(.382*b,2);return"M"+c+","+i+"H"+e+"L"+f+","+j+"L"+g+","+k+"L0,"+l+"L-"+g+","+k+"L-"+f+","+j+"L-"+e+","+i+"H-"+c+"L0,"+h+"Z"}},hexagram:{n:18,f:function(a){var b=d.round(.66*a,2),c=d.round(.38*a,2),e=d.round(.76*a,2);return"M-"+e+",0l-"+c+",-"+b+"h"+e+"l"+c+",-"+b+"l"+c+","+b+"h"+e+"l-"+c+","+b+"l"+c+","+b+"h-"+e+"l-"+c+","+b+"l-"+c+",-"+b+"h-"+e+"Z"}},"star-triangle-up":{n:19,f:function(a){var b=d.round(a*Math.sqrt(3)*.8,2),c=d.round(.8*a,2),e=d.round(1.6*a,2),f=d.round(4*a,2),g="A "+f+","+f+" 0 0 1 ";return"M-"+b+","+c+g+b+","+c+g+"0,-"+e+g+"-"+b+","+c+"Z"}},"star-triangle-down":{n:20,f:function(a){var b=d.round(a*Math.sqrt(3)*.8,2),c=d.round(.8*a,2),e=d.round(1.6*a,2),f=d.round(4*a,2),g="A "+f+","+f+" 0 0 1 ";return"M"+b+",-"+c+g+"-"+b+",-"+c+g+"0,"+e+g+b+",-"+c+"Z"}},"star-square":{n:21,f:function(a){var b=d.round(1.1*a,2),c=d.round(2*a,2),e="A "+c+","+c+" 0 0 1 ";return"M-"+b+",-"+b+e+"-"+b+","+b+e+b+","+b+e+b+",-"+b+e+"-"+b+",-"+b+"Z"}},"star-diamond":{n:22,f:function(a){var b=d.round(1.4*a,2),c=d.round(1.9*a,2),e="A "+c+","+c+" 0 0 1 ";return"M-"+b+",0"+e+"0,"+b+e+b+",0"+e+"0,-"+b+e+"-"+b+",0Z"}},"diamond-tall":{n:23,f:function(a){var b=d.round(.7*a,2),c=d.round(1.4*a,2);return"M0,"+c+"L"+b+",0L0,-"+c+"L-"+b+",0Z"}},"diamond-wide":{n:24,f:function(a){var b=d.round(1.4*a,2),c=d.round(.7*a,2);return"M0,"+c+"L"+b+",0L0,-"+c+"L-"+b+",0Z"}},hourglass:{n:25,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"H-"+b+"L"+b+",-"+b+"H-"+b+"Z"},noDot:!0},bowtie:{n:26,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"V-"+b+"L-"+b+","+b+"V-"+b+"Z"},noDot:!0},"circle-cross":{n:27,f:function(a){var b=d.round(a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b+"M"+b+",0A"+b+","+b+" 0 1,1 0,-"+b+"A"+b+","+b+" 0 0,1 "+b+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(a){var b=d.round(a,2),c=d.round(a/Math.sqrt(2),2);return"M"+c+","+c+"L-"+c+",-"+c+"M"+c+",-"+c+"L-"+c+","+c+"M"+b+",0A"+b+","+b+" 0 1,1 0,-"+b+"A"+b+","+b+" 0 0,1 "+b+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(a){var b=d.round(a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b+"M"+b+","+b+"H-"+b+"V-"+b+"H"+b+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b+"M"+b+","+b+"H-"+b+"V-"+b+"H"+b+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(a){var b=d.round(1.3*a,2);return"M"+b+",0L0,"+b+"L-"+b+",0L0,-"+b+"ZM0,-"+b+"V"+b+"M-"+b+",0H"+b},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(a){var b=d.round(1.3*a,2),c=d.round(.65*a,2);return"M"+b+",0L0,"+b+"L-"+b+",0L0,-"+b+"ZM-"+c+",-"+c+"L"+c+","+c+"M-"+c+","+c+"L"+c+",-"+c},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(a){var b=d.round(1.4*a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b},needLine:!0,noDot:!0},asterisk:{n:35,f:function(a){var b=d.round(1.2*a,2),c=d.round(.85*a,2);return"M0,"+b+"V-"+b+"M"+b+",0H-"+b+"M"+c+","+c+"L-"+c+",-"+c+"M"+c+",-"+c+"L-"+c+","+c},needLine:!0,noDot:!0},hash:{n:36,f:function(a){var b=d.round(a/2,2),c=d.round(a,2);return"M"+b+","+c+"V-"+c+"m-"+c+",0V"+c+"M"+c+","+b+"H-"+c+"m0,-"+c+"H"+c},needLine:!0},"y-up":{n:37,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M-"+b+","+e+"L0,0M"+b+","+e+"L0,0M0,-"+c+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M-"+b+",-"+e+"L0,0M"+b+",-"+e+"L0,0M0,"+c+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M"+e+","+b+"L0,0M"+e+",-"+b+"L0,0M-"+c+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(a){var b=d.round(1.2*a,2),c=d.round(1.6*a,2),e=d.round(.8*a,2);return"M-"+e+","+b+"L0,0M-"+e+",-"+b+"L0,0M"+c+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(a){var b=d.round(1.4*a,2);return"M"+b+",0H-"+b},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(a){var b=d.round(1.4*a,2);return"M0,"+b+"V-"+b},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(a){var b=d.round(a,2);return"M"+b+",-"+b+"L-"+b+","+b},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(a){var b=d.round(a,2);return"M"+b+","+b+"L-"+b+",-"+b},needLine:!0,noDot:!0}}},{d3:70}],319:[function(a,b,c){"use strict";b.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],320:[function(a,b,c){"use strict";function d(a,b,c,d){var f=b["error_"+d]||{},i=f.visible&&-1!==["linear","log"].indexOf(c.type),j=[];if(i){for(var k=h(f),l=0;l<a.length;l++){var m=a[l],n=m[d];if(e(c.c2l(n))){var o=k(n,l);if(e(o[0])&&e(o[1])){var p=m[d+"s"]=n-o[0],q=m[d+"h"]=n+o[1];j.push(p,q)}}}g.expand(c,j,{padded:!0})}}var e=a("fast-isnumeric"),f=a("../../plots/plots"),g=a("../../plots/cartesian/axes"),h=a("./compute_error");b.exports=function(a){for(var b=a.calcdata,c=0;c<b.length;c++){var e=b[c],h=e[0].trace;if(f.traceIs(h,"errorBarsOK")){var i=g.getFromId(a,h.xaxis),j=g.getFromId(a,h.yaxis);d(e,h,i,"x"),d(e,h,j,"y")}}}},{"../../plots/cartesian/axes":369,"../../plots/plots":413,"./compute_error":321,"fast-isnumeric":74}],321:[function(a,b,c){"use strict";function d(a,b){return"percent"===a?function(a){return Math.abs(a*b/100)}:"constant"===a?function(){return Math.abs(b)}:"sqrt"===a?function(a){return Math.sqrt(Math.abs(a))}:void 0}b.exports=function(a){var b=a.type,c=a.symmetric;if("data"===b){var e=a.array,f=a.arrayminus;return c||void 0===f?function(a,b){var c=+e[b];return[c,c]}:function(a,b){return[+f[b],+e[b]]}}var g=d(b,a.value),h=d(b,a.valueminus);return c||void 0===a.valueminus?function(a){var b=g(a);return[b,b]}:function(a){return[h(a),g(a)]}}},{}],322:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/plots"),f=a("../../lib"),g=a("./attributes");b.exports=function(a,b,c,h){function i(a,b){return f.coerce(l,k,g,a,b)}var j="error_"+h.axis,k=b[j]={},l=a[j]||{},m=void 0!==l.array||void 0!==l.value||"sqrt"===l.type,n=i("visible",m);if(n!==!1){var o=i("type","array"in l?"data":"percent"),p=!0;if("sqrt"!==o&&(p=i("symmetric",!(("data"===o?"arrayminus":"valueminus")in l))),"data"===o){var q=i("array");if(q||(k.array=[]),i("traceref"),!p){var r=i("arrayminus");r||(k.arrayminus=[]),i("tracerefminus")}}else"percent"!==o&&"constant"!==o||(i("value"),p||i("valueminus"));var s="copy_"+h.inherit+"style";if(h.inherit){var t=b["error_"+h.inherit];(t||{}).visible&&i(s,!(l.color||d(l.thickness)||d(l.width)))}h.inherit&&k[s]||(i("color",c),i("thickness"),i("width",e.traceIs(b,"gl3d")?0:4))}}},{"../../lib":349,"../../plots/plots":413,"./attributes":319,"fast-isnumeric":74}],323:[function(a,b,c){"use strict";function d(a,b,c){var d={x:b.c2p(a.x),y:c.c2p(a.y)};return void 0!==a.yh&&(d.yh=c.c2p(a.yh),d.ys=c.c2p(a.ys),f(d.ys)||(d.noYS=!0,d.ys=c.c2p(a.ys,!0))),void 0!==a.xh&&(d.xh=b.c2p(a.xh),d.xs=b.c2p(a.xs),f(d.xs)||(d.noXS=!0,d.xs=b.c2p(a.xs,!0))),d}var e=a("d3"),f=a("fast-isnumeric"),g=a("../../lib"),h=a("../color"),i=a("../../traces/scatter/subtypes"),j=b.exports={};j.attributes=a("./attributes"),j.supplyDefaults=a("./defaults"),j.calc=a("./calc"),j.calcFromTrace=function(a,b){for(var c=a.x||[],d=a.y,e=c.length||d.length,f=new Array(e),g=0;e>g;g++)f[g]={x:c[g],y:d[g]};return f[0].trace=a,j.calc({calcdata:[f],_fullLayout:b}),f},j.plot=function(a,b,c){var h=b.x(),j=b.y();b.plot.select(".errorlayer").selectAll("g.errorbars").remove();var k;b.plot.select(".errorlayer").selectAll("g.errorbars").data(c).enter().append("g").attr("class","errorbars").each(function(a){var b=a[0].trace,c=b.error_x,l=b.error_y,m=i.hasMarkers(b)&&b.marker.maxdisplayed>0;(l.visible||c.visible)&&e.select(this).selectAll("g").data(g.identity).enter().append("g").each(function(a){k=d(a,h,j);var b,g=e.select(this);if(!m||a.vis){if(l.visible&&f(k.x)&&f(k.yh)&&f(k.ys)){var i=l.width;b="M"+(k.x-i)+","+k.yh+"h"+2*i+"m-"+i+",0V"+k.ys,k.noYS||(b+="m-"+i+",0h"+2*i),g.append("path").classed("yerror",!0).attr("d",b)}if(c.visible&&f(k.y)&&f(k.xh)&&f(k.xs)){var n=(c.copy_ystyle?l:c).width;b="M"+k.xh+","+(k.y-n)+"v"+2*n+"m0,-"+n+"H"+k.xs,k.noXS||(b+="m0,-"+n+"v"+2*n),g.append("path").classed("xerror",!0).attr("d",b)}}})})},j.style=function(a){e.select(a).selectAll("g.errorbars").each(function(a){var b=e.select(this),c=a[0].trace,d=c.error_y||{},f=c.error_x||{};b.selectAll("g path.yerror").style("stroke-width",d.thickness+"px").call(h.stroke,d.color),f.copy_ystyle&&(f=d),b.selectAll("g path.xerror").style("stroke-width",f.thickness+"px").call(h.stroke,f.color)})},j.hoverInfo=function(a,b,c){b.error_y.visible&&(c.yerr=a.yh-a.y,b.error_y.symmetric||(c.yerrneg=a.y-a.ys)),b.error_x.visible&&(c.xerr=a.xh-a.x,b.error_x.symmetric||(c.xerrneg=a.x-a.xs))}},{"../../lib":349,"../../traces/scatter/subtypes":520,"../color":299,"./attributes":319,"./calc":320,"./defaults":322,d3:70,"fast-isnumeric":74}],324:[function(a,b,c){"use strict";var d=a("../../plots/font_attributes"),e=a("../color/attributes"),f=a("../../lib/extend").extendFlat;b.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:e.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:f({},d,{}),traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":345,"../../plots/font_attributes":383,"../color/attributes":298}],325:[function(a,b,c){"use strict";b.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],326:[function(a,b,c){"use strict";function d(a){return a.visible&&j.traceIs(a,"showLegend")}function e(a){return-1!==(a.traceorder||"").indexOf("grouped")}function f(a){return-1!==(a.traceorder||"").indexOf("reversed")}var g=a("../../plotly"),h=a("d3"),i=a("../../lib"),j=a("../../plots/plots"),k=a("../../plots/cartesian/graph_interact"),l=a("../color"),m=a("../drawing"),n=a("../../traces/scatter/subtypes"),o=a("../../traces/pie/style_one"),p=b.exports={},q=a("./constants");p.layoutAttributes=a("./attributes"),p.supplyLayoutDefaults=function(a,b,c){function g(a,b){return i.coerce(k,l,p.layoutAttributes,a,b)}for(var h,k=a.legend||{},l=b.legend={},m=0,n="normal",o=0;o<c.length;o++)h=c[o],d(h)&&(m++,j.traceIs(h,"pie")&&m++),(j.traceIs(h,"bar")&&"stack"===b.barmode||-1!==["tonextx","tonexty"].indexOf(h.fill))&&(n=e({traceorder:n})?"grouped+reversed":"reversed"),void 0!==h.legendgroup&&""!==h.legendgroup&&(n=f({traceorder:n})?"reversed+grouped":"grouped");var q=i.coerce(a,b,j.layoutAttributes,"showlegend",m>1);q!==!1&&(g("bgcolor",b.paper_bgcolor),g("bordercolor"),g("borderwidth"),i.coerceFont(g,"font",b.font),g("traceorder",n),e(b.legend)&&g("tracegroupgap"),g("x"),g("xanchor"),g("y"),g("yanchor"),i.noneOrAll(k,l,["x","y"]))},p.lines=function(a){var b=a[0].trace,c=b.visible&&b.fill&&"none"!==b.fill,d=n.hasLines(b),e=h.select(this).select(".legendfill").selectAll("path").data(c?[a]:[]);e.enter().append("path").classed("js-fill",!0),e.exit().remove(),e.attr("d","M5,0h30v6h-30z").call(m.fillGroupStyle);var f=h.select(this).select(".legendlines").selectAll("path").data(d?[a]:[]);f.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),f.exit().remove(),f.call(m.lineGroupStyle)},p.points=function(a){function b(a,b,c){var d=i.nestedProperty(g,a).get(),e=Array.isArray(d)&&b?b(d):d;if(c){if(e<c[0])return c[0];if(e>c[1])return c[1]}return e}function c(a){return a[0]}var d,e,f=a[0],g=f.trace,j=n.hasMarkers(g),k=n.hasText(g),l=n.hasLines(g);if(j||k||l){var o={},p={};j&&(o.mc=b("marker.color",c),o.mo=b("marker.opacity",i.mean,[.2,1]),o.ms=b("marker.size",i.mean,[2,16]),o.mlc=b("marker.line.color",c),o.mlw=b("marker.line.width",i.mean,[0,5]),p.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),l&&(p.line={width:b("line.width",c,[0,10])}),k&&(o.tx="Aa",o.tp=b("textposition",c),o.ts=10,o.tc=b("textfont.color",c),o.tf=b("textfont.family",c)),d=[i.minExtend(f,o)],e=i.minExtend(g,p)}var q=h.select(this).select("g.legendpoints"),r=q.selectAll("path.scatterpts").data(j?d:[]);r.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),r.exit().remove(),r.call(m.pointStyle,e),j&&(d[0].mrc=3);var s=q.selectAll("g.pointtext").data(k?d:[]);s.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),s.exit().remove(),s.selectAll("text").call(m.textPointStyle,e)},p.bars=function(a){var b=a[0].trace,c=b.marker||{},d=c.line||{},e=h.select(this).select("g.legendpoints").selectAll("path.legendbar").data(j.traceIs(b,"bar")?[a]:[]); 46 e.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),e.exit().remove(),e.each(function(a){var b=(a.mlw+1||d.width+1)-1,e=h.select(this);e.style("stroke-width",b+"px").call(l.fill,a.mc||c.color),b&&e.call(l.stroke,a.mlc||d.color)})},p.boxes=function(a){var b=a[0].trace,c=h.select(this).select("g.legendpoints").selectAll("path.legendbox").data(j.traceIs(b,"box")&&b.visible?[a]:[]);c.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each(function(a){var c=(a.lw+1||b.line.width+1)-1,d=h.select(this);d.style("stroke-width",c+"px").call(l.fill,a.fc||b.fillcolor),c&&d.call(l.stroke,a.lc||b.line.color)})},p.pie=function(a){var b=a[0].trace,c=h.select(this).select("g.legendpoints").selectAll("path.legendpie").data(j.traceIs(b,"pie")&&b.visible?[a]:[]);c.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()&&c.call(o,a[0],b)},p.style=function(a){a.each(function(a){var b=h.select(this),c=b.selectAll("g.legendfill").data([a]);c.enter().append("g").classed("legendfill",!0);var d=b.selectAll("g.legendlines").data([a]);d.enter().append("g").classed("legendlines",!0);var e=b.selectAll("g.legendsymbols").data([a]);e.enter().append("g").classed("legendsymbols",!0),e.style("opacity",a[0].trace.opacity),e.selectAll("g.legendpoints").data([a]).enter().append("g").classed("legendpoints",!0)}).each(p.bars).each(p.boxes).each(p.pie).each(p.lines).each(p.points)},p.texts=function(a,b,c,d,e){function f(a){g.util.convertToTspans(a,function(){b.firstRender&&p.repositionLegend(b,e)}),a.selectAll("tspan.line").attr({x:a.attr("x")})}var i=b._fullLayout,k=c[0].trace,l=j.traceIs(k,"pie"),n=k.index,o=l?c[0].label:k.name,q=h.select(a).selectAll("text.legendtext").data([0]);q.enter().append("text").classed("legendtext",!0),q.attr({x:40,y:0,"data-unformatted":o}).style({"text-anchor":"start","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}).call(m.font,i.legend.font).text(o),b._context.editable&&!l?q.call(g.util.makeEditable).call(f).on("edit",function(a){this.attr({"data-unformatted":a}),this.text(a).call(f),this.text()||(a=" "),g.restyle(b,"name",a,n)}):q.call(f)},p.getLegendData=function(a,b){function c(a,c){if(""!==a&&e(b))-1===p.indexOf(a)?(p.push(a),q=!0,o[a]=[[c]]):o[a].push([c]);else{var d="~~i"+s;p.push(d),o[d]=[[c]],s++}}var g,h,i,k,l,m,n,o={},p=[],q=!1,r={},s=0;for(l=0;l<a.length;l++)if(g=a[l],h=g[0],i=h.trace,k=i.legendgroup,d(i)&&i.showlegend)if(j.traceIs(i,"pie"))for(r[k]||(r[k]={}),m=0;m<g.length;m++)n=g[m].label,r[k][n]||(c(k,{label:n,color:g[m].color,i:g[m].i,trace:i}),r[k][n]=!0);else c(k,h);if(!p.length)return[];var t,u,v=p.length;if(q&&e(b))for(u=new Array(v),l=0;v>l;l++)t=o[p[l]],u[l]=f(b)?t.reverse():t;else{for(u=[new Array(v)],l=0;v>l;l++)t=o[p[l]][0],u[0][f(b)?v-l-1:l]=t;v=1}return b._lgroupsLength=v,u},p.draw=function(a){function b(a){var b=A-q.scrollBarHeight-2*q.scrollBarMargin,c=s.attr("data-scroll"),e=i.constrain(c-a,Math.min(A-d.height,0),0),f=-e/(d.height-A)*b+q.scrollBarMargin;s.attr("data-scroll",e),s.attr("transform","translate(0, "+e+")"),t.call(m.setRect,d.width-(q.scrollBarWidth+q.scrollBarMargin),f,q.scrollBarWidth,q.scrollBarHeight)}var c=a._fullLayout;if(c._infolayer&&a.calcdata){var d=c.legend,f=c.showlegend&&p.getLegendData(a.calcdata,d),n=c.hiddenlabels||[];if(!c.showlegend||!f.length)return c._infolayer.selectAll(".legend").remove(),void j.autoMargin(a,"legend");"undefined"==typeof a.firstRender?a.firstRender=!0:a.firstRender&&(a.firstRender=!1);var o=c._infolayer.selectAll("svg.legend").data([0]);o.enter().append("svg").attr({"class":"legend","pointer-events":"all"});var r=o.selectAll("rect.bg").data([0]);r.enter().append("rect").attr({"class":"bg","shape-rendering":"crispEdges"}).call(l.stroke,d.bordercolor).call(l.fill,d.bgcolor).style("stroke-width",d.borderwidth+"px");var s=o.selectAll("g.scrollbox").data([0]);s.enter().append("g").attr("class","scrollbox"),s.exit().remove();var t=o.selectAll("rect.scrollbar").data([0]);t.enter().append("rect").attr({"class":"scrollbar",rx:20,ry:2,width:0,height:0}).call(l.fill,"#808BA4");var u=s.selectAll("g.groups").data(f);u.enter().append("g").attr("class","groups"),u.exit().remove(),e(d)&&u.attr("transform",function(a,b){return"translate(0,"+b*d.tracegroupgap+")"});var v=u.selectAll("g.traces").data(i.identity);v.enter().append("g").attr("class","traces"),v.exit().remove(),v.call(p.style).style("opacity",function(a){var b=a[0].trace;return j.traceIs(b,"pie")?-1!==n.indexOf(a[0].label)?.5:1:"legendonly"===b.visible?.5:1}).each(function(b,c){p.texts(this,a,b,c,v);var d=h.select(this).selectAll("rect").data([0]);d.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(l.fill,"rgba(0,0,0,0)"),d.on("click",function(){if(!a._dragged){var c,d,e=a._fullData,f=b[0].trace,h=f.legendgroup,i=[];if(j.traceIs(f,"pie")){var k=b[0].label,l=n.slice(),m=l.indexOf(k);-1===m?l.push(k):l.splice(m,1),g.relayout(a,"hiddenlabels",l)}else{if(""===h)i=[f.index];else for(var o=0;o<e.length;o++)c=e[o],c.legendgroup===h&&i.push(c.index);d=f.visible===!0?"legendonly":!0,g.restyle(a,"visible",d,i)}}})}),p.repositionLegend(a,v);var w=c._size,x=w.l+w.w*d.x,y=w.t+w.h*(1-d.y);"right"===d.xanchor||"auto"===d.xanchor&&d.x>=2/3?x-=d.width:("center"===d.xanchor||"auto"===d.xanchor&&d.x>1/3)&&(x-=d.width/2),"bottom"===d.yanchor||"auto"===d.yanchor&&d.y<=1/3?y-=d.height:("middle"===d.yanchor||"auto"===d.yanchor&&d.y<2/3)&&(y-=d.height/2);var z=c.height-c.margin.b,A=Math.min(z-y,d.height),B=s.attr("data-scroll")?s.attr("data-scroll"):0;if(s.attr("transform","translate(0, "+B+")"),r.attr({width:d.width-2*d.borderwidth,height:A-2*d.borderwidth,x:d.borderwidth,y:d.borderwidth}),o.call(m.setRect,x,y,d.width,A),a.firstRender&&d.height-A>0&&!a._context.staticPlot&&(r.attr({width:d.width-2*d.borderwidth+q.scrollBarWidth}),o.node().addEventListener("wheel",function(a){a.preventDefault(),b(a.deltaY/20)}),t.node().addEventListener("mousedown",function(a){function c(a){1===a.buttons&&b(a.movementY)}function d(){t.node().removeEventListener("mousemove",c),window.removeEventListener("mouseup",d)}a.preventDefault(),window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)}),t.call(m.setRect,d.width-(q.scrollBarWidth+q.scrollBarMargin),q.scrollBarMargin,q.scrollBarWidth,q.scrollBarHeight)),a._context.editable){var C,D,E,F,G,H;k.dragElement({element:o.node(),prepFn:function(){E=Number(o.attr("x")),F=Number(o.attr("y")),G=Number(o.attr("width")),H=Number(o.attr("height")),k.setCursor(o)},moveFn:function(b,c){var e=a._fullLayout._size;o.call(m.setPosition,E+b,F+c),C=k.dragAlign(E+b,G,e.l,e.l+e.w,d.xanchor),D=k.dragAlign(F+c+H,-H,e.t+e.h,e.t,d.yanchor);var f=k.dragCursors(C,D,d.xanchor,d.yanchor);k.setCursor(o,f)},doneFn:function(b){k.setCursor(o),b&&void 0!==C&&void 0!==D&&g.relayout(a,{"legend.x":C,"legend.y":D})}})}}},p.repositionLegend=function(a,b){var c=a._fullLayout,d=c._size,f=c.legend,g=f.borderwidth;f.width=0,f.height=0,b.each(function(a){var b,c,d=a[0].trace,e=h.select(this),i=e.selectAll(".legendtoggle"),j=e.selectAll(".legendtext"),k=e.selectAll(".legendtext>tspan"),l=1.3*f.font.size,n=k[0].length||1,o=j.node()&&m.bBox(j.node()).width,p=e.select("g[class*=math-group]");if(!d.showlegend)return void e.remove();if(p.node()){var q=m.bBox(p.node());l=q.height,o=q.width,p.attr("transform","translate(0,"+l/4+")")}else b=l*(.3+(1-n)/2),j.attr("y",b),k.attr("y",b);c=Math.max(l*n,16)+3,e.attr("transform","translate("+g+","+(5+g+f.height+c/2)+")"),i.attr({x:0,y:-c/2,height:c}),f.height+=c,f.width=Math.max(f.width,o||0)}),f.width+=45+2*g,f.height+=10+2*g,e(f)&&(f.height+=(f._lgroupsLength-1)*f.tracegroupgap),b.selectAll(".legendtoggle").attr("width",(a._context.editable?0:f.width)+40);var i=d.l+d.w*f.x,k=d.t+d.h*(1-f.y),l="left";"right"===f.xanchor||"auto"===f.xanchor&&f.x>=2/3?(i-=f.width,l="right"):("center"===f.xanchor||"auto"===f.xanchor&&f.x>1/3)&&(i-=f.width/2,l="center");var n="top";"bottom"===f.yanchor||"auto"===f.yanchor&&f.y<=1/3?(k-=f.height,n="bottom"):("middle"===f.yanchor||"auto"===f.yanchor&&f.y<2/3)&&(k-=f.height/2,n="middle"),f.width=Math.ceil(f.width),f.height=Math.ceil(f.height),i=Math.round(i),k=Math.round(k),j.autoMargin(a,"legend",{x:f.x,y:f.y,l:f.width*({right:1,center:.5}[l]||0),r:f.width*({left:1,center:.5}[l]||0),b:f.height*({top:1,middle:.5}[n]||0),t:f.height*({bottom:1,middle:.5}[n]||0)})}},{"../../lib":349,"../../plotly":366,"../../plots/cartesian/graph_interact":374,"../../plots/plots":413,"../../traces/pie/style_one":500,"../../traces/scatter/subtypes":520,"../color":299,"../drawing":317,"./attributes":324,"./constants":325,d3:70}],327:[function(a,b,c){"use strict";function d(a,b){var c=b.currentTarget,d=c.getAttribute("data-attr"),e=c.getAttribute("data-val")||!0,f=a._fullLayout,g={};if("zoom"===d)for(var h,i,k,l="in"===e?.5:2,m=(1+l)/2,n=(1-l)/2,p=j.Axes.list(a,null,!0),q=0;q<p.length;q++)h=p[q],h.fixedrange||(i=h._name,"auto"===e?g[i+".autorange"]=!0:"reset"===e?void 0===h._rangeInitial?g[i+".autorange"]=!0:g[i+".range"]=h._rangeInitial.slice():(k=h.range,g[i+".range"]=[m*k[0]+n*k[1],m*k[1]+n*k[0]]));else"hovermode"!==d||"x"!==e&&"y"!==e||(e=f._isHoriz?"y":"x",c.setAttribute("data-val",e)),g[d]=e;j.relayout(a,g).then(function(){"dragmode"===d&&(f._hasCartesian&&j.Fx.setCursor(f._paper.select(".nsewdrag"),o[e]),j.Fx.supplyLayoutDefaults(a.layout,f,a._fullData),j.Fx.init(a))})}function e(a,b){for(var c=b.currentTarget,d=c.getAttribute("data-attr"),e=c.getAttribute("data-val")||!0,f=a._fullLayout,g=j.Plots.getSubplotIds(f,"gl3d"),h={},i=d.split("."),k=0;k<g.length;k++)h[g[k]+"."+i[1]]=e;j.relayout(a,h)}function f(a,b){for(var c=b.currentTarget,d=c.getAttribute("data-attr"),e=a._fullLayout,f=j.Plots.getSubplotIds(e,"gl3d"),g=0;g<f.length;g++){var h=f[g],i=e[h],k=i._scene;"resetDefault"===d?k.setCameraToDefault():"resetLastSave"===d&&k.setCamera(i.camera)}}function g(a,b){var c=b.currentTarget,d=c._previousVal||!1,e=a.layout,f=a._fullLayout,g=j.Plots.getSubplotIds(f,"gl3d"),h=["xaxis","yaxis","zaxis"],i=["showspikes","spikesides","spikethickness","spikecolor"],l={},m={},n={};if(d)n=k.extendDeep(e,d),c._previousVal=null;else{n={"allaxes.showspikes":!1};for(var o=0;o<g.length;o++){var p=g[o],q=f[p],r=l[p]={};r.hovermode=q.hovermode,n[p+".hovermode"]=!1;for(var s=0;3>s;s++){var t=h[s];m=r[t]={};for(var u=0;u<i.length;u++){var v=i[u];m[v]=q[t][v]}}}c._previousVal=k.extendDeep({},l)}j.relayout(a,n)}function h(a,b){for(var c=b.currentTarget,d=c.getAttribute("data-attr"),e=c.getAttribute("data-val")||!0,f=a._fullLayout,g=j.Plots.getSubplotIds(f,"geo"),h=0;h<g.length;h++){var i=f[g[h]]._geo;if("zoom"===d){var k=i.projection.scale(),l="in"===e?2*k:.5*k;i.projection.scale(l),i.zoom.scale(l),i.render()}else"reset"===d&&i.zoomReset()}}function i(a){var b,c=a._fullLayout;b=c._hasCartesian?c._isHoriz?"y":"x":"closest";var d=a._fullLayout.hovermode?!1:b;j.relayout(a,"hovermode",d)}var j=a("../../plotly"),k=a("../../lib"),l=a("../../snapshot"),m=a("../../../build/ploticon"),n=b.exports={};n.toImage={name:"toImage",title:"Download plot as a png",icon:m.camera,click:function(a){var b="png";if(k.isIE())return void k.notifier("Snapshotting is unavailable in Internet Explorer. Consider exporting your images using the Plotly Cloud","long");if(a._snapshotInProgress)return void k.notifier("Snapshotting is still in progress - please hold","long");a._snapshotInProgress=!0,k.notifier("Taking snapshot - this may take a few seconds","long");var c=l.toImage(a,{format:b}),d=a.fn||"newplot";d+="."+b,c.once("success",function(b){a._snapshotInProgress=!1;var e=document.createElement("a");e.href=b,e.download=d,document.body.appendChild(e),e.click(),document.body.removeChild(e),c.clean()}),c.once("error",function(d){a._snapshotInProgress=!1,k.notifier("Sorry there was a problem downloading your "+b,"long"),console.error(d),c.clean()})}},n.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:m.disk,click:function(a){j.Plots.sendDataToCloud(a)}},n.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:m.zoombox,click:d},n.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:m.pan,click:d},n.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:m.selectbox,click:d},n.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:m.lasso,click:d},n.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:m.zoom_plus,click:d},n.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:m.zoom_minus,click:d},n.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:m.autoscale,click:d},n.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:m.home,click:d},n.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:m.tooltip_basic,gravity:"ne",click:d},n.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(a){return a._fullLayout._isHoriz?"y":"x"},icon:m.tooltip_compare,gravity:"ne",click:d};var o={pan:"move",zoom:"crosshair",select:"crosshair",lasso:"crosshair"};n.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:m.zoombox,click:e},n.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:m.pan,click:e},n.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:m["3d_rotate"],click:e},n.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:m["z-axis"],click:e},n.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:m.home,click:f},n.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:m.movie,click:f},n.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:g},n.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:m.zoom_plus,click:h},n.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:m.zoom_minus,click:h},n.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:m.autoscale,click:h},n.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:i},n.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:i},n.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:m.tooltip_basic,gravity:"ne",click:i},n.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:function(a,b){i(a),g(a,b)}},n.resetViews={name:"resetViews",title:"Reset views",icon:m.home,click:function(a,b){var c=b.currentTarget;c.setAttribute("data-attr","zoom"),c.setAttribute("data-val","reset"),d(a,b),c.setAttribute("data-attr","resetLastSave"),f(a,b)}}},{"../../../build/ploticon":2,"../../lib":349,"../../plotly":366,"../../snapshot":420}],328:[function(a,b,c){"use strict";function d(a){this.container=a.container,this.element=document.createElement("div"),this.update(a.graphInfo,a.buttons),this.container.appendChild(this.element)}function e(a,b){var c=a._fullLayout,e=new d({graphInfo:a,container:c._paperdiv.node(),buttons:b});return c._privateplot&&f.select(e.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),e}var f=a("d3"),g=a("../../lib"),h=a("../../../build/ploticon"),i=d.prototype;i.update=function(a,b){this.graphInfo=a;var c=this.graphInfo._context;"hover"===c.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var d=!this.hasButtons(b),e=this.hasLogo!==c.displaylogo;(d||e)&&(this.removeAllButtons(),this.updateButtons(b),c.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},i.updateButtons=function(a){var b=this;this.buttons=a,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(a){var c=b.createGroup();a.forEach(function(a){var d=a.name;if(!d)throw new Error("must provide button 'name' in button config");if(-1!==b.buttonsNames.indexOf(d))throw new Error("button name '"+d+"' is taken");b.buttonsNames.push(d);var e=b.createButton(a);b.buttonElements.push(e),c.appendChild(e)}),b.element.appendChild(c)})},i.createGroup=function(){var a=document.createElement("div");return a.className="modebar-group",a},i.createButton=function(a){var b=this,c=document.createElement("a");c.setAttribute("rel","tooltip"),c.className="modebar-btn";var d=a.title;void 0===d&&(d=a.name),(d||0===d)&&c.setAttribute("data-title",d),void 0!==a.attr&&c.setAttribute("data-attr",a.attr);var e=a.val;void 0!==e&&("function"==typeof e&&(e=e(this.graphInfo)),c.setAttribute("data-val",e));var f=a.click;if("function"!=typeof f)throw new Error("must provide button 'click' function in button config");return c.addEventListener("click",function(c){a.click(b.graphInfo,c),b.updateActiveButton(c.currentTarget)}),c.setAttribute("data-toggle",a.toggle||!1),a.toggle&&c.classList.add("active"),c.appendChild(this.createIcon(a.icon||h.question)),c.setAttribute("data-gravity",a.gravity||"n"),c},i.createIcon=function(a){var b=a.ascent-a.descent,c="http://www.w3.org/2000/svg",d=document.createElementNS(c,"svg"),e=document.createElementNS(c,"path");return d.setAttribute("height","1em"),d.setAttribute("width",a.width/b+"em"),d.setAttribute("viewBox",[0,0,a.width,b].join(" ")),e.setAttribute("d",a.path),e.setAttribute("transform","matrix(1 0 0 -1 0 "+a.ascent+")"),d.appendChild(e),d},i.updateActiveButton=function(a){var b=this.graphInfo._fullLayout,c=void 0!==a?a.getAttribute("data-attr"):null;this.buttonElements.forEach(function(a){var d=a.getAttribute("data-val")||!0,e=a.getAttribute("data-attr"),h="true"===a.getAttribute("data-toggle"),i=f.select(a);if(h)e===c&&i.classed("active",!i.classed("active"));else{var j=null===e?e:g.nestedProperty(b,e).get();i.classed("active",j===d)}})},i.hasButtons=function(a){var b=this.buttons;if(!b)return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;++c){if(a[c].length!==b[c].length)return!1;for(var d=0;d<a[c].length;d++)if(a[c][d].name!==b[c][d].name)return!1}return!0},i.getLogo=function(){var a=this.createGroup(),b=document.createElement("a");return b.href="https://plot.ly/",b.target="_blank",b.setAttribute("data-title","Produced with Plotly"),b.className="modebar-btn plotlyjsicon modebar-btn--logo",b.appendChild(this.createIcon(h.plotlylogo)),a.appendChild(b),a},i.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},i.destroy=function(){g.removeElement(this.container.querySelector(".modebar"))},b.exports=e},{"../../../build/ploticon":2,"../../lib":349,d3:70}],329:[function(a,b,c){"use strict";function d(a,b,c){function d(a){for(var c=[],d=0;d<a.length;d++){var e=a[d];-1===b.indexOf(e)&&c.push(l[e])}p.push(c)}var h=a._fullLayout,i=a._fullData,j=h._hasCartesian,k=h._hasGL3D,m=h._hasGeo,n=h._hasPie,o=h._hasGL2D,p=[];if(d(["toImage","sendDataToCloud"]),(j||o||n)+m+k>1)return d(["resetViews","toggleHover"]),g(p,c);k&&(d(["zoom3d","pan3d","orbitRotation","tableRotation"]),d(["resetCameraDefault3d","resetCameraLastSave3d"]),d(["hoverClosest3d"])),m&&(d(["zoomInGeo","zoomOutGeo","resetGeo"]),d(["hoverClosestGeo"]));var q=e(h),r=[];return!j&&!o||q||(r=["zoom2d","pan2d"]),j&&f(i)&&(r.push("select2d"),r.push("lasso2d")),r.length&&d(r),!j&&!o||q||d(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),j&&n?d(["toggleHover"]):o?d(["hoverClosestGl2d"]):j?d(["hoverClosestCartesian","hoverCompareCartesian"]):n&&d(["hoverClosestPie"]),g(p,c)}function e(a){for(var b=i.Axes.list({_fullLayout:a},null,!0),c=!0,d=0;d<b.length;d++)if(!b[d].fixedrange){c=!1;break}return c}function f(a){for(var b=!1,c=0;c<a.length&&!b;c++){var d=a[c];d._module&&d._module.selectPoints&&("scatter"===d.type?(j.hasMarkers(d)||j.hasText(d))&&(b=!0):b=!0)}return b}function g(a,b){if(b.length)if(Array.isArray(b[0]))for(var c=0;c<b.length;c++)a.push(b[c]);else a.push(b);return a}function h(a){for(var b=0;b<a.length;b++)for(var c=a[b],d=0;d<c.length;d++){var e=c[d];if("string"==typeof e){if(void 0===l[e])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));a[b][d]=l[e]}}return a}var i=a("../../plotly"),j=a("../../traces/scatter/subtypes"),k=a("./"),l=a("./buttons");b.exports=function(a){var b=a._fullLayout,c=a._context,e=b._modeBar;if(!c.displayModeBar)return void(e&&(e.destroy(),delete b._modeBar));if(!Array.isArray(c.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(c.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,g=c.modeBarButtons;f=Array.isArray(g)&&g.length?h(g):d(a,c.modeBarButtonsToRemove,c.modeBarButtonsToAdd),e?e.update(a,f):b._modeBar=k(a,f)}},{"../../plotly":366,"../../traces/scatter/subtypes":520,"./":328,"./buttons":327}],330:[function(a,b,c){"use strict";var d=a("../annotations/attributes"),e=a("../../traces/scatter/attributes"),f=a("../../lib/extend").extendFlat,g=e.line;b.exports={_isLinkedToArray:!0,type:{valType:"enumerated",values:["circle","rect","path","line"]},xref:f({},d.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:f({},d.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:g.color,width:g.width,dash:g.dash},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":345,"../../traces/scatter/attributes":502,"../annotations/attributes":296}],331:[function(a,b,c){"use strict";function d(a,b){function c(b,c){return j.Lib.coerce(a,d,l.layoutAttributes,b,c)}var d={};c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var e=a.path?"path":"rect",g=c("type",e),h=["x","y"],i=0;2>i;i++){var k=h[i],m={_fullLayout:b},n=j.Axes.coerceRef(a,d,m,k);if("path"!==g){var o=.25,p=.75;if("paper"!==n){var q=j.Axes.getFromId(m,n),r=f(q);o=r(q.range[0]+o*(q.range[1]-q.range[0])),p=r(q.range[0]+p*(q.range[1]-q.range[0]))}c(k+"0",o),c(k+"1",p)}}return"path"===g?c("path"):j.Lib.noneOrAll(a,d,["x0","x1","y0","y1"]),d}function e(a){return"category"===a.type?a.c2l:a.d2l}function f(a){return"category"===a.type?a.l2c:a.l2d}function g(a){return function(b){return a(b.replace("_"," "))}}function h(a,b){var c,d,f,h,i=b.type,k=j.Axes.getFromId(a,b.xref),m=j.Axes.getFromId(a,b.yref),n=a._fullLayout._size;if(k?(c=e(k),d=function(a){return k._offset+k.l2p(c(a,!0))}):d=function(a){return n.l+n.w*a},m?(f=e(m),h=function(a){return m._offset+m.l2p(f(a,!0))}):h=function(a){return n.t+n.h*(1-a)},"path"===i)return k&&"date"===k.type&&(d=g(d)),m&&"date"===m.type&&(h=g(h)),l.convertPath(b.path,d,h);var o=d(b.x0),p=d(b.x1),q=h(b.y0),r=h(b.y1);if("line"===i)return"M"+o+","+q+"L"+p+","+r;if("rect"===i)return"M"+o+","+q+"H"+p+"V"+r+"H"+o+"Z";var s=(o+p)/2,t=(q+r)/2,u=Math.abs(s-o),v=Math.abs(t-q),w="A"+u+","+v,x=s+u+","+t,y=s+","+(t-v);return"M"+x+w+" 0 1,1 "+y+w+" 0 0,1 "+x+"Z"}function i(a,b,c,d,e){var f="category"===a.type?Number:a.d2c;if(void 0!==b)return[f(b),f(c)];if(d){var h,i,j,k,l,o=1/0,p=-(1/0),q=d.match(m);for("date"===a.type&&(f=g(f)),h=0;h<q.length;h++)i=q[h],j=e[i.charAt(0)].drawn,void 0!==j&&(k=q[h].substr(1).match(n),!k||k.length<j||(l=f(k[j]),o>l&&(o=l),l>p&&(p=l)));return p>=o?[o,p]:void 0}}var j=a("../../plotly"),k=a("fast-isnumeric"),l=b.exports={};l.layoutAttributes=a("./attributes"),l.supplyLayoutDefaults=function(a,b){for(var c=a.shapes||[],e=b.shapes=[],f=0;f<c.length;f++)e.push(d(c[f]||{},b))},l.drawAll=function(a){var b=a._fullLayout;b._shapelayer.selectAll("path").remove();for(var c=0;c<b.shapes.length;c++)l.draw(a,c)},l.add=function(a){var b=a._fullLayout.shapes.length;j.relayout(a,"shapes["+b+"]","add")},l.draw=function(a,b,c,g){var i,m=a.layout,n=a._fullLayout;if(!k(b)||-1===b){if(!b&&Array.isArray(g))return m.shapes=g,l.supplyLayoutDefaults(m,n),void l.drawAll(a);if("remove"===g)return delete m.shapes,n.shapes=[],void l.drawAll(a);if(c&&"add"!==g){for(i=0;i<n.shapes.length;i++)l.draw(a,i,c,g);return}b=n.shapes.length,n.shapes.push({})}if(!c&&g){if("remove"===g){for(n._shapelayer.selectAll('[data-index="'+b+'"]').remove(),n.shapes.splice(b,1),m.shapes.splice(b,1),i=b;i<n.shapes.length;i++)n._shapelayer.selectAll('[data-index="'+(i+1)+'"]').attr("data-index",String(i)),l.draw(a,i);return}if("add"===g||j.Lib.isPlainObject(g)){n.shapes.splice(b,0,{});var o=j.Lib.isPlainObject(g)?j.Lib.extendFlat({},g):{text:"New text"};for(m.shapes?m.shapes.splice(b,0,o):m.shapes=[o],i=n.shapes.length-1;i>b;i--)n._shapelayer.selectAll('[data-index="'+(i-1)+'"]').attr("data-index",String(i)),l.draw(a,i)}}n._shapelayer.selectAll('[data-index="'+b+'"]').remove();var p=m.shapes[b];if(p){var q={xref:p.xref,yref:p.yref},r={};"string"==typeof c&&c?r[c]=g:j.Lib.isPlainObject(c)&&(r=c);var s=Object.keys(r);for(i=0;i<r.length;i++){var t=s[i];j.Lib.nestedProperty(p,t).set(r[t])}var u=["x0","x1","y0","y1"];for(i=0;4>i;i++){var v=u[i];if(void 0===r[v]&&void 0!==p[v]){var w,x=v.charAt(0),y=j.Axes.getFromId(a,j.Axes.coerceRef(q,{},a,x)),z=j.Axes.getFromId(a,j.Axes.coerceRef(p,{},a,x)),A=p[v];void 0!==r[x+"ref"]&&(y?(w=e(y)(A),A=(w-y.range[0])/(y.range[1]-y.range[0])):A=(A-z.domain[0])/(z.domain[1]-z.domain[0]),z?(w=z.range[0]+A*(z.range[1]-z.range[0]),A=f(z)(w)):A=y.domain[0]+A*(y.domain[1]-y.domain[0])),p[v]=A}}var B=d(p,n);n.shapes[b]=B;var C={"data-index":String(b),"fill-rule":"evenodd",d:h(a,B)},D=(B.xref+B.yref).replace(/paper/g,""),E=B.line.width?B.line.color:"rgba(0,0,0,0)",F=n._shapelayer.append("path").attr(C).style("opacity",B.opacity).call(j.Color.stroke,E).call(j.Color.fill,B.fillcolor).call(j.Drawing.dashLine,B.line.dash,B.line.width);D&&F.call(j.Drawing.setClipUrl,"clip"+n._uid+D)}};var m=/[MLHVQCTSZ][^MLHVQCTSZ]*/g,n=/[^\s,]+/g,o={M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},p={M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},q={M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0};l.convertPath=function(a,b,c){return a.replace(m,function(a){var d=0,e=a.charAt(0),f=o[e],g=p[e],h=q[e],i=a.substr(1).replace(n,function(a){return f[d]?a=b(a):g[d]&&(a=c(a)),d++,d>h&&(a="X"),a});return d>h&&(i=i.replace(/[\s,]*X.*/,""),console.log("ignoring extra params in segment "+a)),e+i})},l.calcAutorange=function(a){var b,c,d,e,f,g=a._fullLayout,h=g.shapes;if(h.length&&a._fullData.length)for(b=0;b<h.length;b++)c=h[b],d=c.line.width/2,"paper"!==c.xref&&(e=j.Axes.getFromId(a,c.xref),f=i(e,c.x0,c.x1,c.path,o),f&&j.Axes.expand(e,f,{ppad:d})),"paper"!==c.yref&&(e=j.Axes.getFromId(a,c.yref),f=i(e,c.y0,c.y1,c.path,p),f&&j.Axes.expand(e,f,{ppad:d}))}},{"../../plotly":366,"./attributes":330,"fast-isnumeric":74}],332:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../plotly"),g=a("../../plots/plots"),h=a("../../lib"),i=a("../drawing"),j=a("../color"),k=a("../../lib/svg_text_utils"),l=a("../../plots/cartesian/axis_ids"),m=b.exports={};m.draw=function(a,b){function c(a){h.syncOrAsync([m,n],a)}function m(b){return b.attr("transform",H?"rotate("+[H.rotate,r.x,r.y]+") translate(0, "+H.offset+")":null),b.style({"font-family":E,"font-size":d.round(F,2)+"px",fill:j.rgb(G),opacity:K*j.opacity(G),"font-weight":g.fontWeight}).attr(r).call(k.convertToTspans).attr(r),b.selectAll("tspan.line").attr(r),g.previousPromises(a)}function n(a){var b=d.select(a.node().parentNode);if(I&&I.selection&&I.side&&M){b.attr("transform",null);var c=0,f={left:"right",right:"left",top:"bottom",bottom:"top"}[I.side],g=-1!==["left","top"].indexOf(I.side)?-1:1,j=e(I.pad)?I.pad:2,k=i.bBox(b.node()),l={left:0,top:0,right:s.width,bottom:s.height},m=v?s.width:(l[I.side]-k[I.side])*("left"===I.side||"top"===I.side?-1:1);if(0>m?c=m:(k.left-=I.offsetLeft,k.right-=I.offsetLeft,k.top-=I.offsetTop,k.bottom-=I.offsetTop,I.selection.each(function(){var a=i.bBox(this);h.bBoxIntersect(k,a,j)&&(c=Math.max(c,g*(a[I.side]-k[f])+j))}),c=Math.min(m,c)),c>0||0>m){var n={left:[-c,0],right:[c,0],top:[0,-c],bottom:[0,c]}[I.side];b.attr("transform","translate("+n+")")}}}function o(){K=0,L=!0,M=Q,s._infolayer.select("."+b).attr({"data-unformatted":M}).text(M).on("mouseover.opacity",function(){d.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(1e3).style("opacity",0)})}var p,q,r,s=a._fullLayout,t=s._size,u=b.charAt(0),v="cb"===b.substr(1,2);if(v){var w=b.substr(3).replace("title","");a._fullData.some(function(b,c){return b.uid===w?(p=c,q=a.calcdata[c][0].t.cb.axis,!0):void 0})}else q=s[l.id2name(b.replace("title",""))]||s;var x,y,z,A,B,C=q===s?"title":q._name+".title",D=v?"colorscale":(q._id||u).toUpperCase()+" axis",E=q.titlefont.family,F=q.titlefont.size,G=q.titlefont.color,H="",I={selection:d.select(a).selectAll("g."+q._id+"tick"),side:q.side},J=v?0:1.5;v?(I.offsetLeft=t.l,I.offsetTop=t.t):I.selection.size()&&(B=d.select(I.selection.node().parentNode).attr("transform").match(/translate\(([-\.\d]+),([-\.\d]+)\)/),B&&(I.offsetLeft=+B[1],I.offsetTop=+B[2])),v&&q.titleside?(x=t.l+q.titlex*t.w,y=t.t+(1-q.titley)*t.h+("top"===q.titleside?3+.75*F:-3-.25*F),r={x:x,y:y,"text-anchor":"start"},I={},b="h"+b):"x"===u?(z=q,A="free"===z.anchor?{_offset:t.t+(1-(z.position||0))*t.h,_length:0}:l.getFromId(a,z.anchor),x=z._offset+z._length/2,y=A._offset+("top"===z.side?-10-F*(J+(z.showticklabels?1:0)):A._length+10+F*(J+(z.showticklabels?1.5:.5))),r={x:x,y:y,"text-anchor":"middle"},I.side||(I.side="bottom")):"y"===u?(A=q,z="free"===A.anchor?{_offset:t.l+(A.position||0)*t.w,_length:0}:l.getFromId(a,A.anchor),y=A._offset+A._length/2,x=z._offset+("right"===A.side?z._length+10+F*(J+(A.showticklabels?1:.5)):-10-F*(J+(A.showticklabels?.5:0))),r={x:x,y:y,"text-anchor":"middle"},H={rotate:"-90",offset:0},I.side||(I.side="left")):(D="Plot",F=s.titlefont.size,x=s.width/2,y=s._size.t/2,r={x:x,y:y,"text-anchor":"middle"},I={});var K=1,L=!1,M=q.title.trim();""===M&&(K=0),M.match(/Click to enter .+ title/)&&(K=.2,L=!0);var N;if(v){N=d.select(a).selectAll("."+q._id.substr(1)+" .cbtitle");var O="h"===b.charAt(0)?b.substr(1):"h"+b;N.selectAll("."+O+",."+O+"-math-group").remove()}else N=s._infolayer.selectAll(".g-"+b).data([0]),N.enter().append("g").classed("g-"+b,!0);var P=N.selectAll("text").data([0]);P.enter().append("text"),P.text(M).attr("class",b),P.attr({"data-unformatted":M}).call(c);var Q="Click to enter "+D.replace(/\d+/,"")+" title";a._context.editable?(M||o(),P.call(k.makeEditable).on("edit",function(b){if(v){var c=a._fullData[p];g.traceIs(c,"markerColorscale")?f.restyle(a,"marker.colorbar.title",b,p):f.restyle(a,"colorbar.title",b,p)}else f.relayout(a,C,b)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(c)}).on("input",function(a){this.text(a||" ").attr(r).selectAll("tspan.line").attr(r)})):M&&!M.match(/Click to enter .+ title/)||P.remove(),P.classed("js-placeholder",L)}},{"../../lib":349,"../../lib/svg_text_utils":360,"../../plotly":366,"../../plots/cartesian/axis_ids":371,"../../plots/plots":413,"../color":299,"../drawing":317,d3:70,"fast-isnumeric":74}],333:[function(a,b,c){"use strict";b.exports={DZA:"algeria", 47 AGO:"angola",EGY:"egypt",BGD:"bangladesh|^(?=.*east).*paki?stan",NER:"\\bniger(?!ia)",LIE:"liechtenstein",NAM:"namibia",BGR:"bulgaria",BOL:"bolivia",GHA:"ghana|gold.?coast",CCK:"\\bcocos|keeling",PAK:"^(?!.*east).*paki?stan",CPV:"verde",JOR:"jordan",LBR:"liberia",LBY:"libya",MYS:"malaysia",IOT:"british.?indian.?ocean",PRI:"puerto.?rico",MYT:"mayotte",PRK:"^(?=.*democrat).*\\bkorea|^(?=.*people).*\\bkorea|^(?=.*north).*\\bkorea|\\bd\\.?p\\.?r\\.?k",PSE:"palestin|\\bgaza|west.?bank",TZA:"tanzania",BWA:"botswana|bechuana",KHM:"cambodia|kampuchea|khmer|^p\\.?r\\.?k\\.?$",UMI:"minor.?outlying.?is",TTO:"trinidad|tobago",PRY:"paraguay",HKG:"hong.?kong",SAU:"\\bsa\\w*.?arabia",LBN:"lebanon",SVN:"slovenia",BFA:"burkina|\\bfaso|upper.?volta",SVK:"^(?!.*cze).*slovak",MRT:"mauritania",HRV:"croatia",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai).*china|^p\\.?r\\.?c\\.?$",KNA:"kitts|\\bnevis",JAM:"jamaica",SMR:"san.?marino",GIB:"gibraltar",DJI:"djibouti",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",FIN:"finland",URY:"uruguay",VAT:"holy.?see|vatican|papal.?st",STP:"\\bs(a|ã)o.?tom(e|é)",SYC:"seychell",NPL:"nepal",CXR:"christmas",LAO:"\\blaos?\\b",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",BVT:"bouvet",ZAF:"\\bs\\w*.?africa",KIR:"kiribati",PHL:"philippines",SXM:"^(?!.*martin)(?!.*saba).*maarten",ROU:"r(o|u|ou)mania",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",SYR:"syria",MAC:"maca(o|u)",NFK:"norfolk",NIC:"nicaragua",MLT:"\\bmalta",KAZ:"kazak",TCA:"turks",PYF:"french.?polynesia|tahiti",NIU:"niue",DMA:"dominica(?!n)",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",BEN:"benin|dahome",GUF:"^(?=.*french).*guiana",BEL:"^(?!.*luxem).*belgium",MSR:"montserrat",TGO:"togo",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GUM:"\\bguam",LKA:"sri.?lanka|ceylon",SSD:"\\bs\\w*.?sudan",FLK:"falkland|malvinas",PCN:"pitcairn",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",GUY:"guyana|british.?guiana",CRI:"costa.?rica",COK:"\\bcook",MAR:"morocco|\\bmaroc",MNP:"mariana",LSO:"lesotho|basuto",HUN:"^(?!.*austr).*hungary",TKM:"turkmen",SUR:"surinam|dutch.?guiana",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",BMU:"bermuda",HMD:"heard.*mcdonald",TCD:"\\bchad",GEO:"^(?!.*south).*georgia",MNE:"^(?!.*serbia).*montenegro",MNG:"mongolia",MHL:"marshall",MTQ:"martinique",CSK:"czechoslovakia",BLZ:"belize|^(?=.*british).*honduras",DDR:"german.?democratic.?republic|^(d|g)\\.?d\\.?r\\.?$|^(?=.*east).*germany",MMR:"myanmar|burma",AFG:"afghan",BDI:"burundi",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",BLR:"belarus|byelo",BLM:"barth(e|é)lemy",GRD:"grenada",TKL:"tokelau",GRC:"greece|hellenic|hellas",GRL:"greenland",SHN:"helena",AND:"andorra",MOZ:"mozambique",TJK:"tajik",THA:"thailand|\\bsiam",HTI:"haiti",MEX:"\\bmexic",ANT:"^(?=.*\\bant).*(nether|dutch)",ZWE:"zimbabwe|^(?!.*northern).*rhodesia",LCA:"\\blucia",IND:"india(?!.*ocea)",LVA:"latvia",BTN:"bhutan",VCT:"vincent",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",NOR:"norway",CZE:"^(?=.*rep).*czech|czechia|bohemia",ATF:"french.?southern|\\bfr.*\\bso.*\\ban.*\\b\\bt",ATG:"antigua",FJI:"fiji",HND:"^(?!.*brit).*honduras",MUS:"mauritius",DOM:"dominican",LUX:"^(?!.*belg).*luxem",ISR:"israel",YUG:"yugoslavia",FSM:"micronesia",PER:"peru",REU:"r(e|é)union",IDN:"indonesia",VUT:"vanuatu|new.?hebrides",MKD:"macedonia|^f\\.?y\\.?r\\.?o\\.?m\\.?$",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bdr|\\bdr.*congo|\\bd\\.?r\\.?c|\\bd\\.?r\\.?o\\.?c|\\br\\.?d\\.?c|belgian.?congo|congo.?free.?state|kinshasa|zaire|l\\w{1,2}opoldville",COG:"^(?!.*\\bdem)(?!.*\\bdr)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l\\w{1,2}opoldville)(?!.*free).*\\bcongo",ISL:"iceland",GLP:"guadeloupe",ETH:"ethiopia|abyssinia",COM:"comoro",COL:"colombia",NGA:"nigeria",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TWN:"taiwan|taipei|formosa",PRT:"portugal",MDA:"moldov|b(a|e)ssarabia",GGY:"guernsey",MDG:"madagascar|malagasy",ATA:"antarctica",ECU:"ecuador",SEN:"senegal",ESH:"sahara",MDV:"maldive",ASM:"^(?=.*americ).*samoa",SPM:"miquelon",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",LTU:"lithuania",RWA:"rwanda",ZMB:"zambia|northern.?rhodesia",GMB:"gambia",WLF:"futuna|wallis",JEY:"jersey",FRO:"faroe|faeroe",GTM:"guatemala",DNK:"denmark",IMN:"^(?=.*isle).*\\bman",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baust.*\\bemp",SJM:"svalbard",VEN:"venezuela",PLW:"palau",KEN:"kenya|british.?east.?africa|east.?africa.?prot",TUR:"turkey",ALB:"albania",OMN:"\\boman|trucial",TUV:"tuvalu",ALA:"\\b(a|Ã¥)land",BRN:"brunei",TUN:"tunisia",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",BRB:"barbados",BRA:"brazil",CIV:"ivoire|ivory",SRB:"^(?!.*monte).*serbia",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",USA:"^(?!.*islands).*united.?states|^u\\.?s\\.?a\\.?$|^u\\.?s\\.?$",QAT:"qatar",WSM:"^(?!.*amer).*samoa",AZE:"azerbaijan",GNB:"bissau|^(?=.*portu).*guinea",SWZ:"swaziland",TON:"tonga",CAN:"canada",UKR:"ukrain",KOR:"^(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea|\\br\\.?o\\.?k\\b",AIA:"anguill?a",CAF:"\\bcen.*\\baf|^c\\.?a\\.?r\\.?$",CHE:"switz|swiss",CYP:"cyprus",BIH:"herzegovina|bosnia",SGP:"singapore",SGS:"south.?georgia|sandwich",SOM:"somali",UZB:"uzbek",CMR:"cameroon",POL:"poland",EAZ:"zanz",KWT:"kuwait",ERI:"eritrea",GAB:"gabon",CYM:"cayman",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",EST:"estonia",MWI:"malawi|nyasa",ESP:"spain",IRQ:"\\biraq|mesopotamia",SLV:"el.?salvador",MLI:"\\bmali\\b",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",IRL:"ireland",IRN:"\\biran|persia",ABW:"^(?!.*bonaire).*\\baruba",SLE:"sierra",PAN:"panama",SDN:"^(?!.*\\bs(?!u)).*sudan",SLB:"solomon",NZL:"new.?zealand",MCO:"monaco",ITA:"italy",JPN:"japan",KGZ:"kyrgyz|kirghiz",UGA:"uganda",NCL:"new.?caledonia",PNG:"papua|\\bp.*\\bn.*\\bguin.*|^p\\.?n\\.?g\\.?$|new.?guinea",ARG:"argentin",SWE:"sweden",BHS:"bahamas",BHR:"bahrain",ARM:"armenia",NRU:"nauru",CUB:"\\bcuba"}},{}],334:[function(a,b,c){"use strict";var d=b.exports={};d.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa"},d.axesNames=["lonaxis","lataxis"],d.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},d.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},d.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},d.clipPad=.001,d.precision=.1,d.landColor="#F0DC82",d.waterColor="#3399FF",d.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},d.sphereSVG={type:"Sphere"},d.fillLayers=["ocean","land","lakes"],d.lineLayers=["subunits","countries","coastlines","rivers","frame"],d.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],d.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},d.baseLayersOverChoropleth=["rivers","lakes"]},{}],335:[function(a,b,c){"use strict";b.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],336:[function(a,b,c){"use strict";b.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],337:[function(a,b,c){"use strict";b.exports={circle:"â","circle-open":"â",square:"â ","square-open":"â¡",diamond:"â","diamond-open":"â",cross:"+",x:"â"}},{}],338:[function(a,b,c){"use strict";c.xmlns="http://www.w3.org/2000/xmlns/",c.svg="http://www.w3.org/2000/svg",c.xlink="http://www.w3.org/1999/xlink",c.svgAttrs={xmlns:c.svg,"xmlns:xlink":c.xlink}},{}],339:[function(a,b,c){"use strict";var d=a("./plotly");c.version="1.6.3",c.plot=d.plot,c.newPlot=d.newPlot,c.restyle=d.restyle,c.relayout=d.relayout,c.redraw=d.redraw,c.extendTraces=d.extendTraces,c.prependTraces=d.prependTraces,c.addTraces=d.addTraces,c.deleteTraces=d.deleteTraces,c.moveTraces=d.moveTraces,c.setPlotConfig=a("./plot_api/set_plot_config"),c.register=d.register,c.Icons=a("../build/ploticon"),c.Plots=d.Plots,c.Fx=d.Fx,c.Snapshot=d.Snapshot,c.PlotSchema=d.PlotSchema,c.Queue=d.Queue,c.d3=a("d3")},{"../build/ploticon":2,"./plot_api/set_plot_config":365,"./plotly":366,d3:70}],340:[function(a,b,c){"use strict";"undefined"!=typeof MathJax?(c.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):c.MathJax=!1},{}],341:[function(a,b,c){"use strict";b.exports=function(a,b,c,d){Array.isArray(a)&&(b[c]=a[d])}},{}],342:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("tinycolor2"),f=a("./nested_property"),g=a("../components/colorscale/get_scale");Object.keys(a("../components/colorscale/scales"));c.valObjects={data_array:{coerceFunction:function(a,b,c){Array.isArray(a)?b.set(a):void 0!==c&&b.set(c)}},enumerated:{coerceFunction:function(a,b,c,d){d.coerceNumber&&(a=+a),-1===d.values.indexOf(a)?b.set(c):b.set(a)}},"boolean":{coerceFunction:function(a,b,c){a===!0||a===!1?b.set(a):b.set(c)}},number:{coerceFunction:function(a,b,c,e){!d(a)||void 0!==e.min&&a<e.min||void 0!==e.max&&a>e.max?b.set(c):b.set(+a)}},integer:{coerceFunction:function(a,b,c,e){a%1||!d(a)||void 0!==e.min&&a<e.min||void 0!==e.max&&a>e.max?b.set(c):b.set(+a)}},string:{coerceFunction:function(a,b,c,d){if(d.strict===!0&&"string"!=typeof a)return void b.set(c);var e=String(a);void 0===a||d.noBlank===!0&&!e?b.set(c):b.set(e)}},color:{coerceFunction:function(a,b,c){e(a).isValid()?b.set(a):b.set(c)}},colorscale:{coerceFunction:function(a,b,c){b.set(g(a,c))}},angle:{coerceFunction:function(a,b,c){"auto"===a?b.set("auto"):d(a)?(Math.abs(a)>180&&(a-=360*Math.round(a/360)),b.set(+a)):b.set(c)}},axisid:{coerceFunction:function(a,b,c){if("string"==typeof a&&a.charAt(0)===c){var d=Number(a.substr(1));if(d%1===0&&d>1)return void b.set(a)}b.set(c)}},sceneid:{coerceFunction:function(a,b,c){if("string"==typeof a&&a.substr(0,5)===c){var d=Number(a.substr(5));if(d%1===0&&d>1)return void b.set(a)}b.set(c)}},geoid:{coerceFunction:function(a,b,c){if("string"==typeof a&&a.substr(0,3)===c){var d=Number(a.substr(3));if(d%1===0&&d>1)return void b.set(a)}b.set(c)}},flaglist:{coerceFunction:function(a,b,c,d){if("string"!=typeof a)return void b.set(c);if(-1!==d.extras.indexOf(a))return void b.set(a);for(var e=a.split("+"),f=0;f<e.length;){var g=e[f];-1===d.flags.indexOf(g)||e.indexOf(g)<f?e.splice(f,1):f++}e.length?b.set(e.join("+")):b.set(c)}},any:{coerceFunction:function(a,b,c){void 0===a?b.set(c):b.set(a)}},info_array:{coerceFunction:function(a,b,d,e){if(!Array.isArray(a))return void b.set(d);var f=e.items,g=[];d=Array.isArray(d)?d:[];for(var h=0;h<f.length;h++)c.coerce(a,g,f,"["+h+"]",d[h]);b.set(g)}}},c.coerce=function(a,b,d,e,g){var h=f(d,e).get(),i=f(a,e),j=f(b,e),k=i.get();return void 0===g&&(g=h.dflt),h.arrayOk&&Array.isArray(k)?(j.set(k),k):(c.valObjects[h.valType].coerceFunction(k,j,g,h),j.get())},c.coerce2=function(a,b,d,e,g){var h=f(a,e),i=c.coerce(a,b,d,e,g);return h.get()?i:!1},c.coerceFont=function(a,b,c){var d={};return c=c||{},d.family=a(b+".family",c.family),d.size=a(b+".size",c.size),d.color=a(b+".color",c.color),d}},{"../components/colorscale/get_scale":310,"../components/colorscale/scales":316,"./nested_property":352,"fast-isnumeric":74,tinycolor2:229}],343:[function(a,b,c){"use strict";function d(a,b){return String(a+Math.pow(10,b)).substr(1)}function e(a){var b;return b=s.test(a)?"Y":"y",b+=t.test(a)?"b":""}function f(a){var b;return b=v.test(a)?u.test(a)?"I":"H":"D"}var g=a("d3"),h=a("fast-isnumeric");c.dateTime2ms=function(a){try{if(a.getTime)return+a}catch(b){return!1}var c,d,e,f,g=String(a).split(" ");if(g.length>2)return!1;var i=g[0].split("-");if(i.length>3||3!==i.length&&g[1])return!1;if(4===i[0].length)c=Number(i[0]);else{if(2!==i[0].length)return!1;var j=(new Date).getFullYear();c=((Number(i[0])-j+70)%100+200)%100+j-70}return h(c)?1===i.length?new Date(c,0,1).getTime():(d=Number(i[1])-1,i[1].length>2||!(d>=0&&11>=d)?!1:2===i.length?new Date(c,d,1).getTime():(e=Number(i[2]),i[2].length>2||!(e>=1&&31>=e)?!1:(e=new Date(c,d,e).getTime(),g[1]?(i=g[1].split(":"),i.length>3?!1:(f=Number(i[0]),i[0].length>2||!(f>=0&&23>=f)?!1:(e+=36e5*f,1===i.length?e:(d=Number(i[1]),i[1].length>2||!(d>=0&&59>=d)?!1:(e+=6e4*d,2===i.length?e:(a=Number(i[2]),a>=0&&60>a?e+1e3*a:!1)))))):e))):!1},c.isDateTime=function(a){return c.dateTime2ms(a)!==!1},c.ms2DateTime=function(a,b){if("undefined"==typeof g)return void console.log("d3 is not defined");b||(b=0);var c=new Date(a),e=g.time.format("%Y-%m-%d")(c);return 7776e6>b?(e+=" "+d(c.getHours(),2),432e6>b&&(e+=":"+d(c.getMinutes(),2),108e5>b&&(e+=":"+d(c.getSeconds(),2),3e5>b&&(e+="."+d(c.getMilliseconds(),3)))),e.replace(/([:\s]00)*\.?[0]*$/,"")):e};var i={H:["%H:%M:%S~%L","%H:%M:%S","%H:%M"],I:["%I:%M:%S~%L%p","%I:%M:%S%p","%I:%M%p"],D:["%H","%I%p","%Hh"]},j={Y:["%Y~%m~%d","%Y%m%d","%y%m%d","%m~%d~%Y","%d~%m~%Y"],Yb:["%b~%d~%Y","%d~%b~%Y","%Y~%d~%b","%Y~%b~%d"],y:["%m~%d~%y","%d~%m~%y","%y~%m~%d"],yb:["%b~%d~%y","%d~%b~%y","%y~%d~%b","%y~%b~%d"]},k=g.time.format.utc,l={Y:{H:["%Y~%m~%dT%H:%M:%S","%Y~%m~%dT%H:%M:%S~%L"].map(k),I:[],D:["%Y%m%d%H%M%S","%Y~%m","%m~%Y"].map(k)},Yb:{H:[],I:[],D:["%Y~%b","%b~%Y"].map(k)},y:{H:[],I:[],D:[]},yb:{H:[],I:[],D:[]}};["Y","Yb","y","yb"].forEach(function(a){j[a].forEach(function(b){l[a].D.push(k(b)),["H","I","D"].forEach(function(c){i[c].forEach(function(d){var e=l[a][c];e.push(k(b+"~"+d)),e.push(k(d+"~"+b))})})})});var m=/[a-z]*/g,n=function(a){return a.substr(0,3)},o=/(mon|tue|wed|thu|fri|sat|sun|the|of|st|nd|rd|th)/g,p=/[\s,\/\-\.\(\)]+/g,q=/~?([ap])~?m(~|$)/,r=function(a,b){return b+"m "},s=/\d\d\d\d/,t=/(^|~)[a-z]{3}/,u=/[ap]m/,v=/:/,w=/q([1-4])/,x=["31~mar","30~jun","30~sep","31~dec"],y=function(a,b){return x[b-1]},z=/ ?([+\-]\d\d:?\d\d|Z)$/;c.parseDate=function(a){if(a.getTime)return a;if("string"!=typeof a)return!1;a=a.toLowerCase().replace(m,n).replace(o,"").replace(p,"~").replace(q,r).replace(w,y).trim().replace(z,"");var b,c,d=null,g=e(a),h=f(a);b=l[g][h],c=b.length;for(var i=0;c>i&&!(d=b[i].parse(a));i++);if(!(d instanceof Date))return!1;var j=d.getTimezoneOffset();return d.setTime(d.getTime()+60*j*1e3),d}},{d3:70,"fast-isnumeric":74}],344:[function(a,b,c){"use strict";var d=a("events").EventEmitter,e={init:function(a){if(a._ev instanceof d)return a;var b=new d;return a._ev=b,a.on=b.on.bind(b),a.once=b.once.bind(b),a.removeListener=b.removeListener.bind(b),a.removeAllListeners=b.removeAllListeners.bind(b),a.emit=function(c,d){"undefined"!=typeof $&&$(a).trigger(c,d),b.emit(c,d)},a},triggerHandler:function(a,b,c){var d,e;"undefined"!=typeof $&&(d=$(a).triggerHandler(b,c));var f=a._ev;if(!f)return d;var g=f._events[b];if(!g)return d;"function"==typeof g&&(g=[g]);for(var h=g.pop(),i=0;i<g.length;i++)g[i](c);return e=h(c),void 0!==d?d:e}};b.exports=e},{events:54}],345:[function(a,b,c){"use strict";function d(a,b,c){for(var g,h,i,j,k,l,m=a[0],n=a.length,o=1;n>o;o++){g=a[o];for(h in g)i=m[h],j=g[h],b&&j&&(e(j)||(k=f(j)))?(k?(k=!1,l=i&&f(i)?i:[]):l=i&&e(i)?i:{},m[h]=d([l,j],b,c)):("undefined"!=typeof j||c)&&(m[h]=j)}return m}var e=a("./is_plain_object.js"),f=Array.isArray;c.extendFlat=function(){return d(arguments,!1,!1)},c.extendDeep=function(){return d(arguments,!0,!1)},c.extendDeepAll=function(){return d(arguments,!0,!0)}},{"./is_plain_object.js":350}],346:[function(a,b,c){"use strict";function d(a,b){var c=j[a];return c(b)}function e(a){for(var b,c,d=0;d<i.length;d++)if(b=i[d],c=new RegExp(h[b]),c.test(a.toLowerCase()))return b;console.warn("unrecognized country name: "+a+".")}var f=b.exports={},g=a("../plotly"),h=a("../constants/country-name_to_iso3"),i=Object.keys(h),j={"ISO-3":g.Lib.identity,"USA-states":g.Lib.identity,"country names":e};f.locationToFeature=function(a,b,c){for(var e,f=d(a,b),g=0;g<c.length;g++)if(e=c[g],e.id===f)return e;console.warn(["location with id",f,"does not have a matching topojson feature at this resolution."].join(" "))}},{"../constants/country-name_to_iso3":333,"../plotly":366}],347:[function(a,b,c){"use strict";function d(a,b){var c=k(a);return c[3]*=b,c}function e(a){return i(a).isValid()?a:l}function f(a){return j(a)?a:m}function g(a,b,c){var g,i,j,k,n,o=a.color,p=Array.isArray(o),q=Array.isArray(b),r=[];if(g=void 0!==a.colorscale?h.Colorscale.makeScaleFunction(a.colorscale,a.cmin,a.cmax):e,i=p?function(a,b){return void 0===a[b]?l:g(a[b])}:e,j=q?function(a,b){return void 0===a[b]?m:f(a[b])}:f,p||q)for(var s=0;c>s;s++)k=i(o,s),n=j(b,s),r[s]=d(k,n);else r=d(o,b);return r}var h=a("../plotly"),i=a("tinycolor2"),j=a("fast-isnumeric"),k=a("./str2rgbarray"),l=a("../components/color/attributes").defaultLine,m=1;b.exports=g},{"../components/color/attributes":298,"../plotly":366,"./str2rgbarray":359,"fast-isnumeric":74,tinycolor2:229}],348:[function(a,b,c){"use strict";function d(a){for(var b=0;(b=a.indexOf("<sup>",b))>=0;){var c=a.indexOf("</sup>",b);if(b>c)break;a=a.slice(0,b)+i(a.slice(b+5,c))+a.slice(c+6)}return a}function e(a){return a.replace(/\<br\>/g,"\n")}function f(a){return a.replace(/\<.*\>/g,"")}function g(a){for(var b=0;(b=a.indexOf("&",b))>=0;){var c=a.indexOf(";",b);if(b>c)b+=1;else{var d=j[a.slice(b+1,c)];a=d?a.slice(0,b)+d+a.slice(c+1):a.slice(0,b)+a.slice(c+1)}}return a}function h(a){return""+g(f(d(e(a))))}var i=a("superscript-text"),j={mu:"ÎŒ",amp:"&",lt:"<",gt:">"};b.exports=h},{"superscript-text":218}],349:[function(a,b,c){"use strict";var d=a("d3"),e=b.exports={};e.nestedProperty=a("./nested_property"),e.isPlainObject=a("./is_plain_object");var f=a("./coerce");e.valObjects=f.valObjects,e.coerce=f.coerce,e.coerce2=f.coerce2,e.coerceFont=f.coerceFont;var g=a("./dates");e.dateTime2ms=g.dateTime2ms,e.isDateTime=g.isDateTime,e.ms2DateTime=g.ms2DateTime,e.parseDate=g.parseDate;var h=a("./search");e.findBin=h.findBin,e.sorterAsc=h.sorterAsc,e.sorterDes=h.sorterDes,e.distinctVals=h.distinctVals,e.roundUp=h.roundUp;var i=a("./stats");e.aggNums=i.aggNums,e.len=i.len,e.mean=i.mean,e.variance=i.variance,e.stdev=i.stdev,e.interp=i.interp;var j=a("./matrix");e.init2dArray=j.init2dArray,e.transposeRagged=j.transposeRagged,e.dot=j.dot,e.translationMatrix=j.translationMatrix,e.rotationMatrix=j.rotationMatrix,e.rotationXYMatrix=j.rotationXYMatrix,e.apply2DTransform=j.apply2DTransform,e.apply2DTransform2=j.apply2DTransform2;var k=a("./extend");e.extendFlat=k.extendFlat,e.extendDeep=k.extendDeep,e.extendDeepAll=k.extendDeepAll,e.notifier=a("./notifier"),e.swapAttrs=function(a,b,c,d){c||(c="x"),d||(d="y");for(var f=0;f<b.length;f++){var g=b[f],h=e.nestedProperty(a,g.replace("?",c)),i=e.nestedProperty(a,g.replace("?",d)),j=h.get();h.set(i.get()),i.set(j)}},e.pauseEvent=function(a){return a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,!1},e.VERBOSE=!1,e.TIMER=(new Date).getTime(),e.log=function(){e.VERBOSE&&console.log.apply(console,arguments)},e.markTime=function(a){if(e.VERBOSE){var b=(new Date).getTime();console.log(a,b-e.TIMER,"(msec)"),"trace"===e.VERBOSE&&console.trace(),e.TIMER=b}},e.constrain=function(a,b,c){return b>c?Math.max(c,Math.min(b,a)):Math.max(b,Math.min(c,a))},e.bBoxIntersect=function(a,b,c){return c=c||0,a.left<=b.right+c&&b.left<=a.right+c&&a.top<=b.bottom+c&&b.top<=a.bottom+c},e.identity=function(a){return a},e.randstr=function l(a,b,c){if(c||(c=16),void 0===b&&(b=24),0>=b)return"0";var d,e,f,g=Math.log(Math.pow(2,b))/Math.log(c),h="";for(d=2;g===1/0;d*=2)g=Math.log(Math.pow(2,b/d))/Math.log(c)*d;var i=g-Math.floor(g);for(d=0;d<Math.floor(g);d++)f=Math.floor(Math.random()*c).toString(c),h=f+h;i&&(e=Math.pow(c,i),f=Math.floor(Math.random()*e).toString(c),h=f+h);var j=parseInt(h,c);return a&&a.indexOf(h)>-1||j!==1/0&&j>=Math.pow(2,b)?l(a,b,c):h},e.OptionControl=function(a,b){a||(a={}),b||(b="opt");var c={};return c.optionList=[],c._newoption=function(d){d[b]=a,c[d.name]=d,c.optionList.push(d)},c["_"+b]=a,c},e.smooth=function(a,b){if(b=Math.round(b)||0,2>b)return a;var c,d,e,f,g=a.length,h=2*g,i=2*b-1,j=new Array(i),k=new Array(g);for(c=0;i>c;c++)j[c]=(1-Math.cos(Math.PI*(c+1)/b))/(2*b);for(c=0;g>c;c++){for(f=0,d=0;i>d;d++)e=c+d+1-b,-g>e?e-=h*Math.round(e/h):e>=h&&(e-=h*Math.floor(e/h)),0>e?e=-1-e:e>=g&&(e=h-1-e),f+=a[e]*j[d];k[c]=f}return k},e.promiseError=function(a){console.log(a,a.stack)},e.syncOrAsync=function(a,b,c){function d(){return e.markTime("async done "+g.name),e.syncOrAsync(a,b,c)}for(var f,g;a.length;){if(g=a.splice(0,1)[0],f=g(b),f&&f.then)return f.then(d).then(void 0,e.promiseError);e.markTime("sync done "+g.name)}return c&&c(b)},e.stripTrailingSlash=function(a){return"/"===a.substr(-1)?a.substr(0,a.length-1):a},e.noneOrAll=function(a,b,c){if(a){var d,e,f=!1,g=!0;for(d=0;d<c.length;d++)e=a[c[d]],void 0!==e&&null!==e?f=!0:g=!1;if(f&&!g)for(d=0;d<c.length;d++)a[c[d]]=b[c[d]]}},e.mergeArray=function(a,b,c){if(Array.isArray(a))for(var d=Math.min(a.length,b.length),e=0;d>e;e++)b[e][c]=a[e]},e.minExtend=function(a,b){var c={};"object"!=typeof b&&(b={});var d,f,g,h=3,i=Object.keys(a);for(d=0;d<i.length;d++)f=i[d],g=a[f],"_"!==f.charAt(0)&&"function"!=typeof g&&("module"===f?c[f]=g:Array.isArray(g)?c[f]=g.slice(0,h):g&&"object"==typeof g?c[f]=e.minExtend(a[f],b[f]):c[f]=g);for(i=Object.keys(b),d=0;d<i.length;d++)f=i[d],g=b[f],"object"==typeof g&&f in c&&"object"==typeof c[f]||(c[f]=g);return c},e.titleCase=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},e.containsAny=function(a,b){for(var c=0;c<b.length;c++)if(-1!==a.indexOf(b[c]))return!0;return!1},e.getPlotDiv=function(a){for(;a&&a.removeAttribute;a=a.parentNode)if(e.isPlotDiv(a))return a},e.isPlotDiv=function(a){var b=d.select(a);return b.size()&&b.classed("js-plotly-plot")},e.removeElement=function(a){var b=a&&a.parentNode;b&&b.removeChild(a)},e.addStyleRule=function(a,b){if(!e.styleSheet){var c=document.createElement("style");c.appendChild(document.createTextNode("")),document.head.appendChild(c),e.styleSheet=c.sheet}var d=e.styleSheet;d.insertRule?d.insertRule(a+"{"+b+"}",0):d.addRule?d.addRule(a,b,0):console.warn("addStyleRule failed")},e.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob}},{"./coerce":342,"./dates":343,"./extend":345,"./is_plain_object":350,"./matrix":351,"./nested_property":352,"./notifier":353,"./search":356,"./stats":358,d3:70}],350:[function(a,b,c){"use strict";b.exports=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&Object.getPrototypeOf(a)===Object.prototype}},{}],351:[function(a,b,c){"use strict";c.init2dArray=function(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=new Array(b);return c},c.transposeRagged=function(a){var b,c,d=0,e=a.length;for(b=0;e>b;b++)d=Math.max(d,a[b].length);var f=new Array(d);for(b=0;d>b;b++)for(f[b]=new Array(e),c=0;e>c;c++)f[b][c]=a[c][b];return f},c.dot=function(a,b){if(!a.length||!b.length||a.length!==b.length)return null;var d,e,f=a.length;if(a[0].length)for(d=new Array(f),e=0;f>e;e++)d[e]=c.dot(a[e],b);else if(b[0].length){var g=c.transposeRagged(b);for(d=new Array(g.length),e=0;e<g.length;e++)d[e]=c.dot(a,g[e])}else for(d=0,e=0;f>e;e++)d+=a[e]*b[e];return d},c.translationMatrix=function(a,b){return[[1,0,a],[0,1,b],[0,0,1]]},c.rotationMatrix=function(a){var b=a*Math.PI/180;return[[Math.cos(b),-Math.sin(b),0],[Math.sin(b),Math.cos(b),0],[0,0,1]]},c.rotationXYMatrix=function(a,b,d){return c.dot(c.dot(c.translationMatrix(b,d),c.rotationMatrix(a)),c.translationMatrix(-b,-d))},c.apply2DTransform=function(a){return function(){var b=arguments;3===b.length&&(b=b[0]);var d=1===arguments.length?b[0]:[b[0],b[1]];return c.dot(a,[d[0],d[1],1]).slice(0,2)}},c.apply2DTransform2=function(a){var b=c.apply2DTransform(a);return function(a){return b(a.slice(0,2)).concat(b(a.slice(2,4)))}}},{}],352:[function(a,b,c){"use strict";function d(a,b){return function(){var c,e,f,g,h,i=a;for(g=0;g<b.length-1;g++){if(c=b[g],-1===c){for(e=!0,f=[],h=0;h<i.length;h++)f[h]=d(i[h],b.slice(g+1))(),f[h]!==f[0]&&(e=!1);return e?f[0]:f}if("number"==typeof c&&!Array.isArray(i))return;if(i=i[c],"object"!=typeof i||null===i)return}if("object"==typeof i&&null!==i&&(f=i[b[g]],null!==f))return f}}function e(a,b){var c=["annotations","shapes","range","domain"],d=-1===c.indexOf(b);return Array.isArray(a)&&d}function f(a,b){return function(c){var d,f,k=a,l=[a],m=j(c)&&!e(c,b[b.length-1]);for(f=0;f<b.length-1;f++){if(d=b[f],"number"==typeof d&&!Array.isArray(k))throw"array index but container is not an array";if(-1===d){if(m=!g(k,b.slice(f+1),c))break;return}if(!h(k,d,b[f+1],m))break;if(k=k[d],"object"!=typeof k||null===k)throw"container is not an object";l.push(k)}m?(f===b.length-1&&delete k[b[f]],i(l)):k[b[f]]=c}}function g(a,b,c){var d,e=Array.isArray(c),g=!0,i=c,k=e?!1:j(c),l=b[0];for(d=0;d<a.length;d++)e&&(i=c[d%c.length],k=j(i)),k&&(g=!1),h(a,d,l,k)&&f(a[d],b)(i);return g}function h(a,b,c,d){if(void 0===a[b]){if(d)return!1;"number"==typeof c?a[b]=[]:a[b]={}}return!0}function i(a){var b,c,d,f,g;for(b=a.length-1;b>=0;b--){if(d=a[b],g=!1,Array.isArray(d))for(c=d.length-1;c>=0;c--)j(d[c])?g?d[c]=void 0:d.pop():g=!0;else if("object"==typeof d&&null!==d)for(f=Object.keys(d),g=!1,c=f.length-1;c>=0;c--)j(d[f[c]])&&!e(d[f[c]],f[c])?delete d[f[c]]:g=!0;if(g)return}}function j(a){return void 0===a||null===a?!0:"object"!=typeof a?!1:Array.isArray(a)?!a.length:!Object.keys(a).length}function k(a,b,c){return{set:function(){throw"bad container"},get:function(){},astr:b,parts:c,obj:a}}var l=a("fast-isnumeric");b.exports=function(a,b){if(l(b))b=String(b);else if("string"!=typeof b||"[-1]"===b.substr(b.length-4))throw"bad property string";for(var c,e,g,h=0,i=b.split(".");h<i.length;){if(c=String(i[h]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(c[1])i[h]=c[1];else{if(0!==h)throw"bad property string";i.splice(0,1)}for(e=c[2].substr(1,c[2].length-2).split("]["),g=0;g<e.length;g++)h++,i.splice(h,0,Number(e[g]))}h++}return"object"!=typeof a?k(a,b,i):{set:f(a,i),get:d(a,i),astr:b,parts:i,obj:a}}},{"fast-isnumeric":74}],353:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=[];b.exports=function(a,b){function c(a){a.duration(700).style("opacity",0).each("end",function(a){var b=f.indexOf(a);-1!==b&&f.splice(b,1),d.select(this).remove()})}if(-1===f.indexOf(a)){f.push(a);var g=1e3;e(b)?g=b:"long"===b&&(g=3e3);var h=d.select("body").selectAll(".plotly-notifier").data([0]);h.enter().append("div").classed("plotly-notifier",!0);var i=h.selectAll(".notifier-note").data(f);i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(a){var b=d.select(this);b.append("button").classed("notifier-close",!0).html("×").on("click",function(){b.transition().call(c)}),b.append("p").html(a),b.transition().duration(700).style("opacity",1).transition().delay(g).call(c)})}}},{d3:70,"fast-isnumeric":74}],354:[function(a,b,c){"use strict";var d=a("./matrix").dot,e=b.exports={};e.tester=function(a){function b(a,b){var c=a[0],d=a[1];return e>c||c>f||g>d||d>h?!1:!b||!j(a)}function c(a,b){var c=a[0],i=a[1];if(e>c||c>f||g>i||i>h)return!1;var j,k,l,m,n,o=d.length,p=d[0][0],q=d[0][1],r=0;for(j=1;o>j;j++)if(k=p,l=q,p=d[j][0],q=d[j][1],m=Math.min(k,p),!(m>c||c>Math.max(k,p)||i>Math.max(l,q)))if(i<Math.min(l,q))c!==m&&r++;else{if(n=p===k?i:l+(c-k)*(q-l)/(p-k),i===n)return 1!==j||!b;n>=i&&c!==m&&r++}return r%2===1}var d=a.slice(),e=d[0][0],f=e,g=d[0][1],h=g;d.push(d[0]);for(var i=1;i<d.length;i++)e=Math.min(e,d[i][0]),f=Math.max(f,d[i][0]),g=Math.min(g,d[i][1]),h=Math.max(h,d[i][1]);var j,k=!1;return 5===d.length&&(d[0][0]===d[1][0]?d[2][0]===d[3][0]&&d[0][1]===d[3][1]&&d[1][1]===d[2][1]&&(k=!0,j=function(a){return a[0]===d[0][0]}):d[0][1]===d[1][1]&&d[2][1]===d[3][1]&&d[0][0]===d[3][0]&&d[1][0]===d[2][0]&&(k=!0,j=function(a){return a[1]===d[0][1]})),{xmin:e,xmax:f,ymin:g,ymax:h,pts:d,contains:k?b:c,isRect:k}};var f=e.isSegmentBent=function(a,b,c,e){var f,g,h,i=a[b],j=[a[c][0]-i[0],a[c][1]-i[1]],k=d(j,j),l=Math.sqrt(k),m=[-j[1]/l,j[0]/l];for(f=b+1;c>f;f++)if(g=[a[f][0]-i[0],a[f][1]-i[1]],h=d(g,j),0>h||h>k||Math.abs(d(g,m))>e)return!0;return!1};e.filter=function(a,b){function c(c){a.push(c);var h=d.length,i=e;d.splice(g+1);for(var j=i+1;j<a.length;j++)(j===a.length-1||f(a,i,j+1,b))&&(d.push(a[j]),d.length<h-2&&(e=j,g=d.length-1),i=j)}var d=[a[0]],e=0,g=0;if(a.length>1){var h=a.pop();c(h)}return{addPt:c,raw:a,filtered:d}}},{"./matrix":351}],355:[function(a,b,c){"use strict";function d(a,b){for(var c,d=[],f=0;f<b.length;f++)c=b[f],c===a?d[f]=c:"object"==typeof c?d[f]=Array.isArray(c)?e.Lib.extendDeep([],c):e.Lib.extendDeepAll({},c):d[f]=c;return d}var e=a("../plotly"),f={};f.add=function(a,b,c,d,e){var f,g;return a.undoQueue=a.undoQueue||{index:0,queue:[],sequence:!1},g=a.undoQueue.index,a.autoplay?void(a.undoQueue.inSequence||(a.autoplay=!1)):(!a.undoQueue.sequence||a.undoQueue.beginSequence?(f={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},a.undoQueue.queue.splice(g,a.undoQueue.queue.length-g,f),a.undoQueue.index+=1):f=a.undoQueue.queue[g-1],a.undoQueue.beginSequence=!1,f.undo.calls.unshift(b),f.undo.args.unshift(c),f.redo.calls.push(d),void f.redo.args.push(e))},f.startSequence=function(a){a.undoQueue=a.undoQueue||{index:0,queue:[],sequence:!1},a.undoQueue.sequence=!0,a.undoQueue.beginSequence=!0},f.stopSequence=function(a){a.undoQueue=a.undoQueue||{index:0,queue:[],sequence:!1},a.undoQueue.sequence=!1,a.undoQueue.beginSequence=!1},f.undo=function(a){var b,c;if(a.framework&&a.framework.isPolar)return void a.framework.undo();if(!(void 0===a.undoQueue||isNaN(a.undoQueue.index)||a.undoQueue.index<=0)){for(a.undoQueue.index--,b=a.undoQueue.queue[a.undoQueue.index],a.undoQueue.inSequence=!0,c=0;c<b.undo.calls.length;c++)f.plotDo(a,b.undo.calls[c],b.undo.args[c]);a.undoQueue.inSequence=!1,a.autoplay=!1}},f.redo=function(a){var b,c;if(a.framework&&a.framework.isPolar)return void a.framework.redo();if(!(void 0===a.undoQueue||isNaN(a.undoQueue.index)||a.undoQueue.index>=a.undoQueue.queue.length)){for(b=a.undoQueue.queue[a.undoQueue.index],a.undoQueue.inSequence=!0,c=0;c<b.redo.calls.length;c++)f.plotDo(a,b.redo.calls[c],b.redo.args[c]);a.undoQueue.inSequence=!1,a.autoplay=!1,a.undoQueue.index++}},f.plotDo=function(a,b,c){a.autoplay=!0,c=d(a,c),b.apply(null,c)},b.exports=f},{"../plotly":366}],356:[function(a,b,c){"use strict";function d(a,b){return b>a}function e(a,b){return b>=a}function f(a,b){return a>b}function g(a,b){return a>=b}var h=a("fast-isnumeric");c.findBin=function(a,b,c){if(h(b.start))return c?Math.ceil((a-b.start)/b.size)-1:Math.floor((a-b.start)/b.size);var i,j,k=0,l=b.length,m=0; 48 for(j=b[b.length-1]>=b[0]?c?d:e:c?g:f;l>k&&m++<100;)i=Math.floor((k+l)/2),j(b[i],a)?k=i+1:l=i;return m>90&&console.log("Long binary search..."),k-1},c.sorterAsc=function(a,b){return a-b},c.sorterDes=function(a,b){return b-a},c.distinctVals=function(a){var b=a.slice();b.sort(c.sorterAsc);for(var d=b.length-1,e=b[d]-b[0]||1,f=e/(d||1)/1e4,g=[b[0]],h=0;d>h;h++)b[h+1]>b[h]+f&&(e=Math.min(e,b[h+1]-b[h]),g.push(b[h+1]));return{vals:g,minDiff:e}},c.roundUp=function(a,b,c){for(var d,e=0,f=b.length-1,g=0,h=c?0:1,i=c?1:0,j=c?Math.ceil:Math.floor;f>e&&g++<100;)d=j((e+f)/2),b[d]<=a?e=d+h:f=d-i;return b[e]}},{"fast-isnumeric":74}],357:[function(a,b,c){"use strict";var d=a("../plotly"),e=function(){};b.exports=function(a){for(var b in a)"function"==typeof a[b]&&(a[b]=e);a.destroy=function(){a.container.parentNode.removeChild(a.container)};var c=document.createElement("div");return c.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",c.style.cursor="pointer",c.style.fontSize="24px",c.style.color=d.Color.defaults[0],a.container.appendChild(c),a.container.style.background="#FFFFFF",a.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../plotly":366}],358:[function(a,b,c){"use strict";var d=a("fast-isnumeric");c.aggNums=function(a,b,e,f){var g,h;if(f||(f=e.length),d(b)||(b=!1),Array.isArray(e[0])){for(h=new Array(f),g=0;f>g;g++)h[g]=c.aggNums(a,b,e[g]);e=h}for(g=0;f>g;g++)d(b)?d(e[g])&&(b=a(+b,+e[g])):b=e[g];return b},c.len=function(a){return c.aggNums(function(a){return a+1},0,a)},c.mean=function(a,b){return b||(b=c.len(a)),c.aggNums(function(a,b){return a+b},0,a)/b},c.variance=function(a,b,e){return b||(b=c.len(a)),d(e)||(e=c.mean(a,b)),c.aggNums(function(a,b){return a+Math.pow(b-e,2)},0,a)/b},c.stdev=function(a,b,d){return Math.sqrt(c.variance(a,b,d))},c.interp=function(a,b){if(!d(b))throw"n should be a finite number";if(b=b*a.length-.5,0>b)return a[0];if(b>a.length-1)return a[a.length-1];var c=b%1;return c*a[Math.ceil(b)]+(1-c)*a[Math.floor(b)]}},{"fast-isnumeric":74}],359:[function(a,b,c){"use strict";function d(a){return a=e(a),f.str2RgbaArray(a.toRgbString())}var e=a("tinycolor2"),f=a("arraytools");b.exports=d},{arraytools:48,tinycolor2:229}],360:[function(a,b,c){"use strict";function d(a,b){return a.node().getBoundingClientRect()[b]}function e(a){return a.replace(/(<|<|<)/g,"\\lt ").replace(/(>|>|>)/g,"\\gt ")}function f(a,b,c){var d="math-output-"+i.Lib.randstr([],64),f=j.select("body").append("div").attr({id:d}).style({visibility:"hidden",position:"absolute"}).style({"font-size":b.fontSize+"px"}).text(e(a));MathJax.Hub.Queue(["Typeset",MathJax.Hub,f.node()],function(){var b=j.select("body").select("#MathJax_SVG_glyphs");if(f.select(".MathJax_SVG").empty()||!f.select("svg").node())console.log("There was an error in the tex syntax.",a),c();else{var d=f.select("svg").node().getBoundingClientRect();c(f.select(".MathJax_SVG"),b,d)}f.remove()})}function g(a){for(var b=i.util.html_entity_decode(a),c=b.split(/(<[^<>]*>)/).map(function(a){var b=a.match(/<(\/?)([^ >]*)\s*(.*)>/i),c=b&&b[2].toLowerCase(),d=m[c];if(void 0!==d){var e=b[1],f=b[3],g=f.match(/^style\s*=\s*"([^"]+)"\s*/i);if("a"===c){if(e)return"</a>";if("href"!==f.substr(0,4).toLowerCase())return"<a>";var h=document.createElement("a");return h.href=f.substr(4).replace(/["'=]/g,""),-1===n.indexOf(h.protocol)?"<a>":'<a xlink:show="new" xlink:href'+f.substr(4)+">"}if("br"===c)return"<br>";if(e)return"sup"===c?'</tspan><tspan dy="0.42em">​</tspan>':"sub"===c?'</tspan><tspan dy="-0.21em">​</tspan>':"</tspan>";var j="<tspan";return"sup"!==c&&"sub"!==c||(j="​"+j),g&&(g=g[1].replace(/(^|;)\s*color:/,"$1 fill:"),d=(d?d+";":"")+g),j+(d?' style="'+d+'"':"")+">"}return i.util.xml_entity_encode(a).replace(/</g,"<")}),d=[],e=c.indexOf("<br>");e>0;e=c.indexOf("<br>",e+1))d.push(e);var f=0;d.forEach(function(a){for(var b=a+f,d=c.slice(0,b),e="",g=d.length-1;g>=0;g--){var h=d[g].match(/<(\/?).*>/i);if(h&&"<br>"!==d[g]){h[1]||(e=d[g]);break}}e&&(c.splice(b+1,0,e),c.splice(b,0,"</tspan>"),f+=2)});var g=c.join(""),h=g.split(/<br>/gi);return h.length>1&&(c=h.map(function(a,b){return'<tspan class="line" dy="'+1.3*b+'em">'+a+"</tspan>"})),c.join("")}function h(a,b,c){var d,e,f,g=c.horizontalAlign,h=c.verticalAlign||"top",i=a.node().getBoundingClientRect(),j=b.node().getBoundingClientRect();return e="bottom"===h?function(){return i.bottom-d.height}:"middle"===h?function(){return i.top+(i.height-d.height)/2}:function(){return i.top},f="right"===g?function(){return i.right-d.width}:"center"===g?function(){return i.left+(i.width-d.width)/2}:function(){return i.left},function(){return d=this.node().getBoundingClientRect(),this.style({top:e()-j.top+"px",left:f()-j.left+"px","z-index":1e3}),this}}var i=a("../plotly"),j=a("d3"),k=a("../constants/xmlns_namespaces"),l=b.exports={};j.selection.prototype.appendSVG=function(a){for(var b=['<svg xmlns="',k.svg,'" ','xmlns:xlink="',k.xlink,'">',a,"</svg>"].join(""),c=(new DOMParser).parseFromString(b,"application/xml"),d=c.documentElement.firstChild;d;)this.node().appendChild(this.node().ownerDocument.importNode(d,!0)),d=d.nextSibling;return c.querySelector("parsererror")?(console.log(c.querySelector("parsererror div").textContent),null):j.select(this.node().lastChild)},l.html_entity_decode=function(a){var b=j.select("body").append("div").style({display:"none"}).html(""),c=a.replace(/(&[^;]*;)/gi,function(a){return"<"===a?"<":"&rt;"===a?">":b.html(a).text()});return b.remove(),c},l.xml_entity_encode=function(a){return a.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")},l.convertToTspans=function(a,b){function c(){n.empty()||(o=k.attr("class")+"-math",n.select("svg."+o).remove()),a.text("").style({visibility:"visible","white-space":"pre"}),m=a.appendSVG(h),m||a.text(e),a.select("a").size()&&a.style("pointer-events","all"),b&&b.call(k)}var e=a.text(),h=g(e),k=a,l=!k.attr("data-notex")&&h.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),m=e,n=j.select(k.node().parentNode);if(!n.empty()){var o=k.attr("class")?k.attr("class").split(" ")[0]:"text";o+="-math",n.selectAll("svg."+o).remove(),n.selectAll("g."+o+"-group").remove(),a.style({visibility:null});for(var p=a.node();p&&p.removeAttribute;p=p.parentNode)p.removeAttribute("data-bb");if(l){var q=i.Lib.getPlotDiv(k.node());(q&&q._promises||[]).push(new Promise(function(a){k.style({visibility:"hidden"});var e={fontSize:parseInt(k.style("font-size"),10)};f(l[2],e,function(e,f,g){n.selectAll("svg."+o).remove(),n.selectAll("g."+o+"-group").remove();var h=e&&e.select("svg");if(!h||!h.node())return c(),void a();var i=n.append("g").classed(o+"-group",!0).attr({"pointer-events":"none"});i.node().appendChild(h.node()),f&&f.node()&&h.node().insertBefore(f.node().cloneNode(!0),h.node().firstChild),h.attr({"class":o,height:g.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var j=k.style("fill")||"black";h.select("g").attr({fill:j,stroke:j});var l=d(h,"width"),m=d(h,"height"),p=+k.attr("x")-l*{start:0,middle:.5,end:1}[k.attr("text-anchor")||"start"],q=parseInt(k.style("font-size"),10)||d(k,"height"),r=-q/4;"y"===o[0]?(i.attr({transform:"rotate("+[-90,+k.attr("x"),+k.attr("y")]+") translate("+[-l/2,r-m/2]+")"}),h.attr({x:+k.attr("x"),y:+k.attr("y")})):"l"===o[0]?h.attr({x:k.attr("x"),y:r-m/2}):"a"===o[0]?h.attr({x:0,y:r}):h.attr({x:p,y:+k.attr("y")+r-m/2}),b&&b.call(k,i),a(i)})}))}else c();return a}};var m={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"",span:"",br:"",em:"font-style:italic;font-weight:bold"},n=["http:","https:","mailto:"],o=new RegExp("</?("+Object.keys(m).join("|")+")( [^>]*)?/?>","g");l.plainText=function(a){return(a||"").replace(o," ")},l.makeEditable=function(a,b,c){function d(){f(),g.style({opacity:0});var a,b=m.attr("class");a=b?"."+b.split(" ")[0]+"-math-group":"[class*=-math-group]",a&&j.select(g.node().parentNode).select(a).style({opacity:0})}function e(a){var b=a.node(),c=document.createRange();c.selectNodeContents(b);var d=window.getSelection();d.removeAllRanges(),d.addRange(c),b.focus()}function f(){var a=j.select(i.Lib.getPlotDiv(g.node())),b=a.select(".svg-container"),d=b.append("div");d.classed("plugin-editable editable",!0).style({position:"absolute","font-family":g.style("font-family")||"Arial","font-size":g.style("font-size")||12,color:c.fill||g.style("fill")||"black",opacity:1,"background-color":c.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(g.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c.text||g.attr("data-unformatted")).call(h(g,b,c)).on("blur",function(){g.text(this.textContent).style({opacity:1});var a,b=j.select(this).attr("class");a=b?"."+b.split(" ")[0]+"-math-group":"[class*=-math-group]",a&&j.select(g.node().parentNode).select(a).style({opacity:0});var c=this.textContent;j.select(this).transition().duration(0).remove(),j.select(document).on("mouseup",null),k.edit.call(g,c)}).on("focus",function(){var a=this;j.select(document).on("mouseup",function(){return j.event.target===a?!1:void(document.activeElement===d.node()&&d.node().blur())})}).on("keyup",function(){27===j.event.which?(g.style({opacity:1}),j.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),k.cancel.call(g,this.textContent)):(k.input.call(g,this.textContent),j.select(this).call(h(g,b,c)))}).on("keydown",function(){13===j.event.which&&this.blur()}).call(e)}c||(c={});var g=this,k=j.dispatch("edit","input","cancel"),l=j.select(this.node()).style({"pointer-events":"all"}),m=b||l;return b&&l.style({"pointer-events":"none"}),c.immediate?d():m.on("click",d),j.rebind(this,k,"on")}},{"../constants/xmlns_namespaces":338,"../plotly":366,d3:70}],361:[function(a,b,c){"use strict";var d=b.exports={},e=a("../constants/geo_constants").locationmodeToLayer,f=a("topojson").feature;d.getTopojsonName=function(a){return[a.scope.replace(/ /g,"-"),"_",a.resolution.toString(),"m"].join("")},d.getTopojsonPath=function(a,b){return a+b+".json"},d.getTopojsonFeatures=function(a,b){var c=e[a.locationmode],d=b.objects[c];return f(b,d).features}},{"../constants/geo_constants":334,topojson:230}],362:[function(a,b,c){"use strict";function d(a){var b;if("string"==typeof a){if(b=document.getElementById(a),null===b)throw new Error("No DOM element with id '"+a+"' exists on the page.");return b}if(null===a||void 0===a)throw new Error("DOM element provided is null or undefined");return a}function e(a,b){a._fullLayout._paperdiv.style("background","white"),F.defaultConfig.setBackground(a,b)}function f(a,b){a._context||(a._context=G.extendFlat({},F.defaultConfig));var c=a._context;b&&(Object.keys(b).forEach(function(a){a in c&&("setBackground"===a&&"opaque"===b[a]?c[a]=e:c[a]=b[a])}),b.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio)),c.staticPlot&&(c.editable=!1,c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1)}function g(a,b,c){var d=C.select(a).selectAll(".plot-container").data([0]);d.enter().insert("div",":first-child").classed("plot-container plotly",!0);var e=d.selectAll(".svg-container").data([0]);e.enter().append("div").classed("svg-container",!0).style("position","relative"),e.html(""),b&&(a.data=b),c&&(a.layout=c),F.micropolar.manager.fillLayout(a),"initial"===a._fullLayout.autosize&&a._context.autosizable&&(w(a,{}),a._fullLayout.autosize=c.autosize=!0),e.style({width:a._fullLayout.width+"px",height:a._fullLayout.height+"px"}),a.framework=F.micropolar.manager.framework(a),a.framework({data:a.data,layout:a.layout},e.node()),a.framework.setUndoPoint();var f=a.framework.svg(),g=1,h=a._fullLayout.title;""!==h&&h||(g=0);var i="Click to enter title",j=function(){this.call(F.util.convertToTspans)},k=f.select(".title-group text").call(j);if(a._context.editable){k.attr({"data-unformatted":h}),h&&h!==i||(g=.2,k.attr({"data-unformatted":i}).text(i).style({opacity:g}).on("mouseover.opacity",function(){C.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){C.select(this).transition().duration(1e3).style("opacity",0)}));var l=function(){this.call(F.util.makeEditable).on("edit",function(b){a.framework({layout:{title:b}}),this.attr({"data-unformatted":b}).text(b).call(j),this.call(l)}).on("cancel",function(){var a=this.attr("data-unformatted");this.text(a).call(j)})};k.call(l)}return a._context.setBackground(a,a._fullLayout.paper_bgcolor),J.addLinks(a),Promise.resolve()}function h(a){var b,c;a||(a={}),a.xaxis1&&(a.xaxis||(a.xaxis=a.xaxis1),delete a.xaxis1),a.yaxis1&&(a.yaxis||(a.yaxis=a.yaxis1),delete a.yaxis1);var d=F.Axes.list({_fullLayout:a});for(b=0;b<d.length;b++){var e=d[b];e.anchor&&"free"!==e.anchor&&(e.anchor=F.Axes.cleanId(e.anchor)),e.overlaying&&(e.overlaying=F.Axes.cleanId(e.overlaying)),e.type||(e.isdate?e.type="date":e.islog?e.type="log":e.isdate===!1&&e.islog===!1&&(e.type="linear")),"withzero"!==e.autorange&&"tozero"!==e.autorange||(e.autorange=!0,e.rangemode="tozero"),delete e.islog,delete e.isdate,delete e.categories,l(e,"domain")&&delete e.domain,void 0!==e.autotick&&(void 0===e.tickmode&&(e.tickmode=e.autotick?"auto":"linear"),delete e.autotick)}void 0===a.annotations||Array.isArray(a.annotations)||(console.log("annotations must be an array"),delete a.annotations);var f=(a.annotations||[]).length;for(b=0;f>b;b++){var g=a.annotations[b];g.ref&&("paper"===g.ref?(g.xref="paper",g.yref="paper"):"data"===g.ref&&(g.xref="x",g.yref="y"),delete g.ref),i(g,"xref"),i(g,"yref")}void 0===a.shapes||Array.isArray(a.shapes)||(console.log("shapes must be an array"),delete a.shapes);var h=(a.shapes||[]).length;for(b=0;h>b;b++){var j=a.shapes[b];i(j,"xref"),i(j,"yref")}var k=a.legend;k&&(k.x>3?(k.x=1.02,k.xanchor="left"):k.x<-2&&(k.x=-.02,k.xanchor="right"),k.y>3?(k.y=1.02,k.yanchor="bottom"):k.y<-2&&(k.y=-.02,k.yanchor="top")),"rotate"===a.dragmode&&(a.dragmode="orbit"),a.scene1&&(a.scene||(a.scene=a.scene1),delete a.scene1);var m=J.getSubplotIds(a,"gl3d");for(b=0;b<m.length;b++){var n=a[m[b]],o=n.cameraposition;if(Array.isArray(o)&&4===o[0].length){var p=o[0],q=o[1],r=o[2],s=D([],p),t=[];for(c=0;3>c;++c)t[c]=q[b]+r*s[2+4*c];n.camera={eye:{x:t[0],y:t[1],z:t[2]},center:{x:q[0],y:q[1],z:q[2]},up:{x:s[1],y:s[5],z:s[9]}},delete n.cameraposition}}return G.markTime("finished rest of cleanLayout, starting color"),L.clean(a),G.markTime("finished cleanLayout color.clean"),a}function i(a,b){var c=a[b],d=b.charAt(0);c&&"paper"!==c&&(a[b]=F.Axes.cleanId(c,d))}function j(a,b){for(var c=[],d=(a.concat(Array.isArray(b)?b:[]).filter(function(a){return"uid"in a}).map(function(a){return a.uid})),e=0;e<a.length;e++){var f=a[e];if(!("uid"in f)||-1!==c.indexOf(f.uid)){var g,h;for(h=0;100>h&&(g=G.randstr(d),-1!==c.indexOf(g));h++);f.uid=G.randstr(d),d.push(f.uid)}if(c.push(f.uid),"histogramy"===f.type&&"xbins"in f&&!("ybins"in f)&&(f.ybins=f.xbins,delete f.xbins),f.error_y&&"opacity"in f.error_y){var i=L.defaults,j=f.error_y.color||(J.traceIs(f,"bar")?L.defaultLine:i[e%i.length]);f.error_y.color=L.addOpacity(L.rgb(j),L.opacity(j)*f.error_y.opacity),delete f.error_y.opacity}if("bardir"in f&&("h"!==f.bardir||!J.traceIs(f,"bar")&&"histogram"!==f.type.substr(0,9)||(f.orientation="h",u(f)),delete f.bardir),"histogramy"===f.type&&u(f),"histogramx"!==f.type&&"histogramy"!==f.type||(f.type="histogram"),"scl"in f&&(f.colorscale=f.scl,delete f.scl),"reversescl"in f&&(f.reversescale=f.reversescl,delete f.reversescl),f.xaxis&&(f.xaxis=F.Axes.cleanId(f.xaxis,"x")),f.yaxis&&(f.yaxis=F.Axes.cleanId(f.yaxis,"y")),J.traceIs(f,"gl3d")&&f.scene&&(f.scene=J.subplotsRegistry.gl3d.cleanId(f.scene)),J.traceIs(f,"pie")||(Array.isArray(f.textposition)?f.textposition=f.textposition.map(k):f.textposition&&(f.textposition=k(f.textposition))),J.traceIs(f,"2dMap")&&("YIGnBu"===f.colorscale&&(f.colorscale="YlGnBu"),"YIOrRd"===f.colorscale&&(f.colorscale="YlOrRd")),J.traceIs(f,"markerColorscale")&&f.marker){var m=f.marker;"YIGnBu"===m.colorscale&&(m.colorscale="YlGnBu"),"YIOrRd"===m.colorscale&&(m.colorscale="YlOrRd")}l(f,"line")&&delete f.line,"marker"in f&&(l(f.marker,"line")&&delete f.marker.line,l(f,"marker")&&delete f.marker),G.markTime("finished rest of cleanData, starting color"),L.clean(f),G.markTime("finished cleanData color.clean")}}function k(a){var b="middle",c="center";return-1!==a.indexOf("top")?b="top":-1!==a.indexOf("bottom")&&(b="bottom"),-1!==a.indexOf("left")?c="left":-1!==a.indexOf("right")&&(c="right"),b+" "+c}function l(a,b){return b in a&&"object"==typeof a[b]&&0===Object.keys(a[b]).length}function m(a){var b,c,d,e,f=F.Axes.list(a),g=a._fullData,h=a._fullLayout,i=a.calcdata=new Array(g.length);for(a.firstscatter=!0,a.numboxes=0,a._hmpixcount=0,a._hmlumcount=0,h._piecolormap={},h._piedefaultcolorcount=0,b=0;b<f.length;b++)f[b]._categories=[];for(b=0;b<g.length;b++)c=g[b],d=c._module,e=[],d&&c.visible===!0&&d.calc&&(e=d.calc(a,c)),Array.isArray(e)&&e[0]||(e=[{x:!1,y:!1}]),e[0].t||(e[0].t={}),e[0].trace=c,G.markTime("done with calcdata for "+b),i[b]=e}function n(a,b){var c,d,e=b+1,f=[];for(c=0;c<a.length;c++)d=a[c],0>d?f.push(e+d):f.push(d);return f}function o(a,b,c){var d,e;for(d=0;d<b.length;d++){if(e=b[d],e!==parseInt(e,10))throw new Error("all values in "+c+" must be integers");if(e>=a.data.length||e<-a.data.length)throw new Error(c+" must be valid indices for gd.data.");if(b.indexOf(e,d+1)>-1||e>=0&&b.indexOf(-a.data.length+e)>-1||0>e&&b.indexOf(a.data.length+e)>-1)throw new Error("each index in "+c+" must be unique.")}}function p(a,b,c){if(!Array.isArray(a.data))throw new Error("gd.data must be an array.");if("undefined"==typeof b)throw new Error("currentIndices is a required argument.");if(Array.isArray(b)||(b=[b]),o(a,b,"currentIndices"),"undefined"==typeof c||Array.isArray(c)||(c=[c]),"undefined"!=typeof c&&o(a,c,"newIndices"),"undefined"!=typeof c&&b.length!==c.length)throw new Error("current and new indices must be of equal length.")}function q(a,b,c){var d,e;if(!Array.isArray(a.data))throw new Error("gd.data must be an array.");if("undefined"==typeof b)throw new Error("traces must be defined.");for(Array.isArray(b)||(b=[b]),d=0;d<b.length;d++)if(e=b[d],"object"!=typeof e||Array.isArray(e)||null===e)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof c||Array.isArray(c)||(c=[c]),"undefined"!=typeof c&&c.length!==b.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function r(a,b,c,d){var e=G.isPlainObject(d);if(!Array.isArray(a.data))throw new Error("gd.data must be an array");if(!G.isPlainObject(b))throw new Error("update must be a key:value object");if("undefined"==typeof c)throw new Error("indices must be an integer or array of integers");o(a,c,"indices");for(var f in b){if(!Array.isArray(b[f])||b[f].length!==c.length)throw new Error("attribute "+f+" must be an array of length equal to indices array length");if(e&&(!(f in d)||!Array.isArray(d[f])||d[f].length!==b[f].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function s(a,b,c,d){var e,f,g,h,i,j=G.isPlainObject(d),k=[];Array.isArray(c)||(c=[c]),c=n(c,a.data.length-1);for(var l in b)for(var m=0;m<c.length;m++){if(e=a.data[c[m]],g=G.nestedProperty(e,l),f=g.get(),h=b[l][m],!Array.isArray(h))throw new Error("attribute: "+l+" index: "+m+" must be an array");if(!Array.isArray(f))throw new Error("cannot extend missing or non-array attribute: "+l);i=j?d[l][m]:d,E(i)||(i=-1),k.push({prop:g,target:f,insert:h,maxp:Math.floor(i)})}return k}function t(a,b,c,d,e,f){r(a,b,c,d);for(var g,h,i,j=s(a,b,c,d),k=[],l={},m={},n=0;n<j.length;n++)h=j[n].prop,i=j[n].maxp,g=e(j[n].target,j[n].insert),i>=0&&i<g.length&&(k=f(g,i)),i=j[n].target.length,h.set(g),Array.isArray(l[h.astr])||(l[h.astr]=[]),Array.isArray(m[h.astr])||(m[h.astr]=[]),l[h.astr].push(k),m[h.astr].push(i);return{update:l,maxPoints:m}}function u(a){var b;if(G.swapAttrs(a,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(a.z)&&Array.isArray(a.z[0])&&(a.transpose?delete a.transpose:a.transpose=!0),a.error_x&&a.error_y){var c=a.error_y,d="copy_ystyle"in c?c.copy_ystyle:!(c.color||c.thickness||c.width);G.swapAttrs(a,["error_?.copy_ystyle"]),d&&G.swapAttrs(a,["error_?.color","error_?.thickness","error_?.width"])}if(a.hoverinfo){var e=a.hoverinfo.split("+");for(b=0;b<e.length;b++)"x"===e[b]?e[b]="y":"y"===e[b]&&(e[b]="x");a.hoverinfo=e.join("+")}}function v(a){var b,c={left:0,right:0,bottom:0,top:0};if(a)for(b in a)a.hasOwnProperty(b)&&(c.left+=a[b].left||0,c.right+=a[b].right||0,c.bottom+=a[b].bottom||0,c.top+=a[b].top||0);return c}function w(a,b){var c,d,e,f=a._fullLayout,g=a._context;if(a.emit("plotly_autosize"),a._context.fillFrame)e=window.innerWidth,d=window.innerHeight,document.body.style.overflow="hidden";else if(E(g.frameMargins)&&g.frameMargins>0){var h=v(a._boundingBoxMargins),i=h.left+h.right,j=h.bottom+h.top,k=f._container.node().getBoundingClientRect(),l=1-2*g.frameMargins;e=Math.round(l*(k.width-i)),d=Math.round(l*(k.height-j))}else c=window.getComputedStyle(a),d=parseFloat(c.height)||f.height,e=parseFloat(c.width)||f.width;return Math.abs(f.width-e)>1||Math.abs(f.height-d)>1?(f.height=a.layout.height=d,f.width=a.layout.width=e):"initial"!==f.autosize&&(delete b.autosize,f.autosize=a.layout.autosize=!0),J.sanitizeMargins(f),b}function x(a){var b=C.select(a),c=a._fullLayout;if(c._hasGL3D&&J.subplotsRegistry.gl3d.initAxes(a),c._container=b.selectAll(".plot-container").data([0]),c._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),c._paperdiv=c._container.selectAll(".svg-container").data([0]),c._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),"initial"===c.autosize&&(w(a,{}),c.autosize=!0,a.layout.autosize=!0),c._glcontainer=c._paperdiv.selectAll(".gl-container").data([0]),c._glcontainer.enter().append("div").classed("gl-container",!0),c._geocontainer=c._paperdiv.selectAll(".geo-container").data([0]),c._geocontainer.enter().append("div").classed("geo-container",!0),c._paperdiv.selectAll(".main-svg").remove(),c._paper=c._paperdiv.insert("svg",":first-child").classed("main-svg",!0),c._toppaper=c._paperdiv.append("svg").classed("main-svg",!0),!c._uid){var d=[];C.selectAll("defs").each(function(){this.id&&d.push(this.id.split("-")[1])}),c._uid=G.randstr(d)}c._paperdiv.selectAll(".main-svg").attr(S.svgAttrs),c._defs=c._paper.append("defs").attr("id","defs-"+c._uid),c._draggers=c._paper.append("g").classed("draglayer",!0);var e=F.Axes.getSubplots(a);e.join("")!==Object.keys(a._fullLayout._plots||{}).join("")&&y(a,e),c._hasCartesian&&z(a,e),c._shapelayer=c._paper.append("g").classed("shapelayer",!0),c._pielayer=c._paper.append("g").classed("pielayer",!0),c._glimages=c._paper.append("g").classed("glimages",!0),c._geoimages=c._paper.append("g").classed("geoimages",!0),c._infolayer=c._toppaper.append("g").classed("infolayer",!0),c._hoverlayer=c._toppaper.append("g").classed("hoverlayer",!0),a.emit("plotly_framework");var f=G.syncOrAsync([A,function(){return F.Axes.doTicks(a,"redraw")},K.init],a);return f&&f.then&&a._promises.push(f),f}function y(a,b){function c(b,c){return function(){return F.Axes.getFromId(a,b,c)}}for(var d,e,f=a._fullLayout._plots={},g=0;g<b.length;g++)d=b[g],e=f[d]={},e.id=d,e.x=c(d,"x"),e.y=c(d,"y"),e.xaxis=e.x(),e.yaxis=e.y()}function z(a,b){function c(a){a.append("g").classed("imagelayer",!0),a.append("g").classed("maplayer",!0),a.append("g").classed("barlayer",!0),a.append("g").classed("errorlayer",!0),a.append("g").classed("boxlayer",!0),a.append("g").classed("scatterlayer",!0)}var d=a._fullLayout,e=[];d._paper.selectAll("g.subplot").data(b).enter().append("g").classed("subplot",!0).each(function(f){var g=d._plots[f],h=g.plotgroup=C.select(this).classed(f,!0),i=g.xaxis,j=g.yaxis;g.overlays=[];var k=F.Axes.getFromId(a,i.overlaying)||i;k!==i&&k.overlaying&&(k=i,i.overlaying=!1);var l=F.Axes.getFromId(a,j.overlaying)||j;l!==j&&l.overlaying&&(l=j,j.overlaying=!1);var m=k._id+l._id;m!==f&&-1!==b.indexOf(m)?(g.mainplot=m,e.push(g),i.domain=k.domain.slice(),j.domain=l.domain.slice()):(g.bg=h.append("rect").style("stroke-width",0),g.gridlayer=h.append("g"),g.overgrid=h.append("g"),g.zerolinelayer=h.append("g"),g.overzero=h.append("g"),g.plot=h.append("svg").call(c),g.overplot=h.append("g"),g.xlines=h.append("path"),g.ylines=h.append("path"),g.overlines=h.append("g"),g.xaxislayer=h.append("g"),g.yaxislayer=h.append("g"),g.overaxes=h.append("g")),g.draglayer=d._draggers.append("g")}),e.forEach(function(a){var b=d._plots[a.mainplot];b.overlays.push(a),a.gridlayer=b.overgrid.append("g"),a.zerolinelayer=b.overzero.append("g"),a.plot=b.overplot.append("svg").call(c),a.xlines=b.overlines.append("path"),a.ylines=b.overlines.append("path"),a.xaxislayer=b.overaxes.append("g"),a.yaxislayer=b.overaxes.append("g")}),b.forEach(function(a){var b=d._plots[a];b.plot.attr("preserveAspectRatio","none").style("fill","none"),b.xlines.style("fill","none").classed("crisp",!0),b.ylines.style("fill","none").classed("crisp",!0)})}function A(a){return G.syncOrAsync([J.doAutoMargin,B],a)}function B(a){var b,c=a._fullLayout,d=c._size,e=F.Axes.list(a);for(b=0;b<e.length;b++)e[b]._linepositions={};c._paperdiv.style({width:c.width+"px",height:c.height+"px"}).selectAll(".main-svg").call(M.setSize,c.width,c.height),a._context.setBackground(a,c.paper_bgcolor);var f=[];return c._paper.selectAll("g.subplot").each(function(b){var e=c._plots[b],g=F.Axes.getFromId(a,b,"x"),h=F.Axes.getFromId(a,b,"y");g.setScale(),h.setScale(),e.bg&&e.bg.call(M.setRect,g._offset-d.p,h._offset-d.p,g._length+2*d.p,h._length+2*d.p).call(L.fill,c.plot_bgcolor),e.plot.call(M.setRect,g._offset,h._offset,g._length,h._length);var i=M.crispRound(a,g.linewidth,1),j=M.crispRound(a,h.linewidth,1),k=d.p+j,l="M"+-k+",",m="h"+(g._length+2*k),n="free"===g.anchor&&-1===f.indexOf(g._id),o=d.h*(1-(g.position||0))+i/2%1,p=g.anchor===h._id&&(g.mirror||"top"!==g.side)||"all"===g.mirror||"allticks"===g.mirror||g.mirrors&&g.mirrors[h._id+"bottom"],q=h._length+d.p+i/2,r=g.anchor===h._id&&(g.mirror||"top"===g.side)||"all"===g.mirror||"allticks"===g.mirror||g.mirrors&&g.mirrors[h._id+"top"],s=-d.p-i/2,t=d.p,u=p?0:i,v=r?0:i,w=","+(-t-v)+"v"+(h._length+2*t+v+u),x="free"===h.anchor&&-1===f.indexOf(h._id),y=d.w*(h.position||0)+j/2%1,z=h.anchor===g._id&&(h.mirror||"right"!==h.side)||"all"===h.mirror||"allticks"===h.mirror||h.mirrors&&h.mirrors[g._id+"left"],A=-d.p-j/2,B=h.anchor===g._id&&(h.mirror||"right"===h.side)||"all"===h.mirror||"allticks"===h.mirror||h.mirrors&&h.mirrors[g._id+"right"],C=g._length+d.p+j/2;g._linepositions[b]=[p?q:void 0,r?s:void 0,n?o:void 0],g.anchor===h._id?g._linepositions[b][3]="top"===g.side?s:q:n&&(g._linepositions[b][3]=o),h._linepositions[b]=[z?A:void 0,B?C:void 0,x?y:void 0],h.anchor===g._id?h._linepositions[b][3]="right"===h.side?C:A:x&&(h._linepositions[b][3]=y);var D="translate("+g._offset+","+h._offset+")",E=D,G=D;n&&(E="translate("+g._offset+","+d.t+")",s+=h._offset-d.t,q+=h._offset-d.t),x&&(G="translate("+d.l+","+h._offset+")",A+=g._offset-d.l,C+=g._offset-d.l),e.xlines.attr("transform",E).attr("d",(p?l+q+m:"")+(r?l+s+m:"")+(n?l+o+m:"")||"M0,0").style("stroke-width",i+"px").call(L.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)"),e.ylines.attr("transform",G).attr("d",(z?"M"+A+w:"")+(B?"M"+C+w:"")+(x?"M"+y+w:"")||"M0,0").attr("stroke-width",j+"px").call(L.stroke,h.showline?h.linecolor:"rgba(0,0,0,0)"),e.xaxislayer.attr("transform",E),e.yaxislayer.attr("transform",G),e.gridlayer.attr("transform",D),e.zerolinelayer.attr("transform",D),e.draglayer.attr("transform",D),n&&f.push(g._id),x&&f.push(h._id)}),F.Axes.makeClipPaths(a),Q.draw(a,"gtitle"),R(a),a._promises.length&&Promise.all(a._promises)}var C=a("d3"),D=a("gl-mat4/fromQuat"),E=a("fast-isnumeric"),F=a("../plotly"),G=a("../lib"),H=a("../lib/events"),I=a("../lib/queue"),J=a("../plots/plots"),K=a("../plots/cartesian/graph_interact"),L=a("../components/color"),M=a("../components/drawing"),N=a("../components/errorbars"),O=a("../components/legend"),P=a("../components/shapes"),Q=a("../components/titles"),R=a("../components/modebar/manage"),S=a("../constants/xmlns_namespaces");F.plot=function(a,b,c,e){function i(){var b,c,d,e=a.calcdata;for(O.draw(a),b=0;b<e.length;b++)c=e[b],d=c[0].trace,d.visible===!0&&d._module.colorbar?d._module.colorbar(a,c):J.autoMargin(a,"cb"+d.uid);return J.doAutoMargin(a),J.previousPromises(a)}function k(){var b=JSON.stringify(z._size)===E?[]:[i,A];return G.syncOrAsync(b.concat(K.init),a)}function l(){if(B){for(var b,c,d=J.getSubplotIds(z,"cartesian"),e=a._modules,f=0;f<d.length;f++){b=z._plots[d[f]];for(var g=0;g<e.length;g++)c=e[g],c.setPositions&&c.setPositions(a,b)}return G.markTime("done with bar/box adjustments"),N.calc(a),G.markTime("done ErrorBars.calc"),G.syncOrAsync([P.calcAutorange,F.Annotations.calcAutorange,n],a)}}function n(){for(var b=F.Axes.list(a,"",!0),c=0;c<b.length;c++)F.Axes.doAutoRange(b[c])}function o(){return F.Axes.doTicks(a,"redraw")}function p(){for(var b=a.calcdata,c=0;c<b.length;c++){var d=b[c][0].trace,e=d.visible===!0,f=d.uid;e&&J.traceIs(d,"2dMap")||z._paper.selectAll(".hm"+f+",.contour"+f+",#clip"+f).remove(),e&&d._module.colorbar||z._infolayer.selectAll(".cb"+f).remove()}var g=J.subplotsRegistry;return z._hasGL3D&&g.gl3d.plot(a),z._hasGeo&&g.geo.plot(a),z._hasGL2D&&g.gl2d.plot(a),(z._hasCartesian||z._hasPie)&&g.cartesian.plot(a),J.style(a),G.markTime("done Plots.style"),P.drawAll(a),F.Annotations.drawAll(a),J.addLinks(a),a._replotting=!1,J.previousPromises(a)}function q(){P.drawAll(a),F.Annotations.drawAll(a),O.draw(a)}function r(){G.markTime("done plot"),a.emit("plotly_afterplot")}G.markTime("in plot"),a=d(a),H.init(a);var s=H.triggerHandler(a,"plotly_beforeplot",[b,c,e]);if(s===!1)return Promise.reject();b||c||G.isPlotDiv(a)||console.log("Warning: calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",a),f(a,e),c||(c={}),C.select(a).classed("js-plotly-plot",!0),M.makeTester(a),a._promises=[];var t=0===(a.data||[]).length&&Array.isArray(b);if(Array.isArray(b)&&(j(b,a.data),t?a.data=b:a.data.push.apply(a.data,b),a.empty=!1),a.layout&&!t||(a.layout=h(c)),a._dragging)return a._replotPending=!0,Promise.reject();if(a._replotPending=!1,J.supplyDefaults(a),b&&b[0]&&b[0].r)return g(a,b,c);a._replotting=!0;var u=a._fullData.length>0,v=F.Axes.getSubplots(a).join(""),w=Object.keys(a._fullLayout._plots||{}).join(""),y=w===v;u?a.framework===x&&!t&&y||(a.framework=x,x(a)):y?t&&x(a):(a.framework=x,x(a));var z=a._fullLayout,B=!a.calcdata||a.calcdata.length!==(a.data||[]).length;B&&(m(a),a._context.doubleClick===!1&&a._context.displayModeBar===!1||F.Axes.saveRangeInitial(a));for(var D=0;D<a.calcdata.length;D++)a.calcdata[D][0].trace=a._fullData[D];var E=JSON.stringify(z._size),I=G.syncOrAsync([J.previousPromises,i,A,k,l,o,p,q],a,r);return I&&I.then?I:Promise.resolve(a)},F.redraw=function(a){return a=d(a),G.isPlotDiv(a)?(a.calcdata=void 0,F.plot(a).then(function(){return a.emit("plotly_redraw"),a})):void console.log("This element is not a Plotly Plot",a)},F.newPlot=function(a,b,c,e){return a=d(a),J.purge(a),F.plot(a,b,c,e)},F.extendTraces=function T(a,b,c,e){a=d(a);var f=t(a,b,c,e,function(a,b){return a.concat(b)},function(a,b){return a.splice(0,a.length-b)}),g=F.redraw(a),h=[a,f.update,c,f.maxPoints];return I&&I.add(a,F.prependTraces,h,T,arguments),g},F.prependTraces=function U(a,b,c,e){a=d(a);var f=t(a,b,c,e,function(a,b){return b.concat(a)},function(a,b){return a.splice(b,a.length)}),g=F.redraw(a),h=[a,f.update,c,f.maxPoints];return I&&I.add(a,F.extendTraces,h,U,arguments),g},F.addTraces=function V(a,b,c){a=d(a);var e,f,g=[],h=F.deleteTraces,i=V,k=[a,g],l=[a,b];for(q(a,b,c),Array.isArray(b)||(b=[b]),j(b,a.data), 49 e=0;e<b.length;e+=1)a.data.push(b[e]);for(e=0;e<b.length;e++)g.push(-b.length+e);if("undefined"==typeof c)return f=F.redraw(a),I&&I.add(a,h,k,i,l),f;Array.isArray(c)||(c=[c]);try{p(a,g,c)}catch(m){throw a.data.splice(a.data.length-b.length,b.length),m}return I&&I.startSequence(a),I&&I.add(a,h,k,i,l),f=F.moveTraces(a,g,c),I&&I.stopSequence(a),f},F.deleteTraces=function W(a,b){a=d(a);var c,e,f=[],g=F.addTraces,h=W,i=[a,f,b],j=[a,b];if("undefined"==typeof b)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(b)||(b=[b]),o(a,b,"indices"),b=n(b,a.data.length-1),b.sort(G.sorterDes),c=0;c<b.length;c+=1)e=a.data.splice(b[c],1)[0],f.push(e);var k=F.redraw(a);return I&&I.add(a,g,i,h,j),k},F.moveTraces=function X(a,b,c){a=d(a);var e,f=[],g=[],h=X,i=X,j=[a,c,b],k=[a,b,c];if(p(a,b,c),b=Array.isArray(b)?b:[b],"undefined"==typeof c)for(c=[],e=0;e<b.length;e++)c.push(-b.length+e);for(c=Array.isArray(c)?c:[c],b=n(b,a.data.length-1),c=n(c,a.data.length-1),e=0;e<a.data.length;e++)-1===b.indexOf(e)&&f.push(a.data[e]);for(e=0;e<b.length;e++)g.push({newIndex:c[e],trace:a.data[b[e]]});for(g.sort(function(a,b){return a.newIndex-b.newIndex}),e=0;e<g.length;e+=1)f.splice(g[e].newIndex,0,g[e].trace);a.data=f;var l=F.redraw(a);return I&&I.add(a,h,j,i,k),l},F.restyle=function Y(a,b,c,e){function f(){return e.map(function(){})}function g(a){var b=F.Axes.id2name(a);-1===o.indexOf(b)&&o.push(b)}function h(a){return"LAYOUT"+a+".autorange"}function i(a){return"LAYOUT"+a+".range"}function j(b,c,d){if(Array.isArray(b))return void b.forEach(function(a){j(a,c,d)});if(!(b in m)){var g;g="LAYOUT"===b.substr(0,6)?G.nestedProperty(a.layout,b.replace("LAYOUT","")):G.nestedProperty(a.data[e[d]],b),b in A||(A[b]=f()),void 0===A[b][d]&&(A[b][d]=g.get()),void 0!==c&&g.set(c)}}a=d(a);var k,l=a._fullLayout,m={};if("string"==typeof b)m[b]=c;else{if(!G.isPlainObject(b))return console.log("restyle fail",b,c,e),Promise.reject();m=b,void 0===e&&(e=c)}Object.keys(m).length&&(a.changed=!0),E(e)?e=[e]:Array.isArray(e)&&e.length||(e=a._fullData.map(function(a,b){return b}));var n=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull"];for(k=0;k<e.length;k++)if(J.traceIs(a._fullData[e[k]],"box")){n.push("name");break}var o,p=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean"],q=["zmin","zmax","zauto","marker.cmin","marker.cmax","marker.cauto","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],r=["type","x","y","x0","y0","orientation","xaxis","yaxis"],s=!1,t=!1,v=!1,w=!1,x=!1,y=!1,z={},A={},B={};(l._hasGL3D||l._hasGeo||l._hasGL2D)&&(v=!0);var C=["zmin","zmax"],D=["xbins.start","xbins.end","xbins.size"],H=["ybins.start","ybins.end","ybins.size"],K=["contours.start","contours.end","contours.size"];for(var L in m){var M,N,P,Q,R,S=m[L];if(z[L]=S,"LAYOUT"!==L.substr(0,6)){for(A[L]=f(),k=0;k<e.length;k++){if(M=a.data[e[k]],N=a._fullData[e[k]],P=G.nestedProperty(M,L),Q=P.get(),R=Array.isArray(S)?S[k%S.length]:S,-1!==C.indexOf(L))j("zauto",!1,k);else if("colorscale"===L)j("autocolorscale",!1,k);else if("autocolorscale"===L)j("colorscale",void 0,k);else if("marker.colorscale"===L)j("marker.autocolorscale",!1,k);else if("marker.autocolorscale"===L)j("marker.colorscale",void 0,k);else if("zauto"===L)j(C,void 0,k);else if(-1!==D.indexOf(L))j("autobinx",!1,k);else if("autobinx"===L)j(D,void 0,k);else if(-1!==H.indexOf(L))j("autobiny",!1,k);else if("autobiny"===L)j(H,void 0,k);else if(-1!==K.indexOf(L))j("autocontour",!1,k);else if("autocontour"===L)j(K,void 0,k);else if(-1!==["x0","dx"].indexOf(L)&&N.x&&"scaled"!==N.xtype)j("xtype","scaled",k);else if(-1!==["y0","dy"].indexOf(L)&&N.y&&"scaled"!==N.ytype)j("ytype","scaled",k);else if("colorbar.thicknessmode"===L&&P.get()!==R&&-1!==["fraction","pixels"].indexOf(R)&&N.colorbar){var T=-1!==["top","bottom"].indexOf(N.colorbar.orient)?l.height-l.margin.t-l.margin.b:l.width-l.margin.l-l.margin.r;j("colorbar.thickness",N.colorbar.thickness*("fraction"===R?1/T:T),k)}else if("colorbar.lenmode"===L&&P.get()!==R&&-1!==["fraction","pixels"].indexOf(R)&&N.colorbar){var U=-1!==["top","bottom"].indexOf(N.colorbar.orient)?l.width-l.margin.l-l.margin.r:l.height-l.margin.t-l.margin.b;j("colorbar.len",N.colorbar.len*("fraction"===R?1/U:U),k)}else"colorbar.tick0"===L||"colorbar.dtick"===L?j("colorbar.tickmode","linear",k):"colorbar.tickmode"===L&&j(["colorbar.tick0","colorbar.dtick"],void 0,k);if("type"===L&&"pie"===R!=("pie"===Q)){var V="x",W="y";"bar"!==R&&"bar"!==Q||"h"!==M.orientation||(V="y",W="x"),G.swapAttrs(M,["?","?src"],"labels",V),G.swapAttrs(M,["d?","?0"],"label",V),G.swapAttrs(M,["?","?src"],"values",W),"pie"===Q?(G.nestedProperty(M,"marker.color").set(G.nestedProperty(M,"marker.colors").get()),l._pielayer.selectAll("g.trace").remove()):J.traceIs(M,"cartesian")&&(G.nestedProperty(M,"marker.colors").set(G.nestedProperty(M,"marker.color").get()),B[M.xaxis||"x"]=!0,B[M.yaxis||"y"]=!0)}A[L][k]=Q;var X=["swapxy","swapxyaxes","orientation","orientationaxes"];if(-1!==X.indexOf(L)){if("orientation"===L){if(P.set(R),P.get()===A[L][k])continue}else"orientationaxes"===L&&(M.orientation={v:"h",h:"v"}[N.orientation]);u(M)}else P.set(R)}if(-1!==["swapxyaxes","orientationaxes"].indexOf(L)&&F.Axes.swap(a,e),"orientationaxes"===L){var Z=G.nestedProperty(a.layout,"hovermode");"x"===Z.get()?Z.set("y"):"y"===Z.get()&&Z.set("x")}if(-1!==e.indexOf(0)&&-1!==r.indexOf(L)&&(F.Axes.clearTypes(a,e),s=!0),-1!==["autobinx","autobiny","zauto"].indexOf(L)&&R===!1||(x=!0),(-1!==["colorbar","line"].indexOf(P.parts[0])||"marker"===P.parts[0]&&"colorbar"===P.parts[1])&&(y=!0),-1!==n.indexOf(L)){if(-1!==["orientation","type"].indexOf(L)){for(o=[],k=0;k<e.length;k++){var $=a.data[e[k]];J.traceIs($,"cartesian")&&(g($.xaxis||"x"),g($.yaxis||"y"),"type"===b&&j(["autobinx","autobiny"],!0,k))}j(o.map(h),!0,0),j(o.map(i),[0,1],0)}s=!0}else-1!==q.indexOf(L)?v=!0:-1!==p.indexOf(L)&&(t=!0)}else P=G.nestedProperty(a.layout,L.replace("LAYOUT","")),A[L]=[P.get()],P.set(Array.isArray(S)?S[0]:S),s=!0}var _=Object.keys(B);a:for(k=0;k<_.length;k++){for(var aa=_[k],ba=aa.charAt(0),ca=ba+"axis",da=0;da<a.data.length;da++)if(J.traceIs(a.data[da],"cartesian")&&(a.data[da][ca]||ba)===aa)continue a;j("LAYOUT"+F.Axes.id2name(aa),null,0)}I&&I.add(a,Y,[a,A,e],Y,[a,z,e]);var ea=!1;F.Axes.list(a).forEach(function(a){a.autorange&&(ea=!0)}),(s||w||t&&ea)&&(a.calcdata=void 0);var fa;w?fa=[function(){var b=a.layout;return a.layout=void 0,F.plot(a,"",b)}]:s||v||t?fa=[F.plot]:(J.supplyDefaults(a),fa=[J.previousPromises],x&&fa.push(function(){var b,c,d;for(b=0;b<a.calcdata.length;b++)c=a.calcdata[b],d=(((c[0]||{}).trace||{})._module||{}).arraysToCalcdata,d&&d(c);return J.style(a),O.draw(a),J.previousPromises(a)}),y&&fa.push(function(){return a.calcdata.forEach(function(a){if((a[0].t||{}).cb){var b=a[0].trace,c=a[0].t.cb;J.traceIs(b,"contour")&&c.line({width:b.contours.showlines!==!1?b.line.width:0,dash:b.line.dash,color:"line"===b.contours.coloring?c._opts.line.color:b.line.color}),J.traceIs(b,"markerColorscale")?c.options(b.marker.colorbar)():c.options(b.colorbar)()}}),J.previousPromises(a)}));var ga=G.syncOrAsync(fa,a);return ga&&ga.then||(ga=Promise.resolve()),ga.then(function(){return a.emit("plotly_restyle",G.extendDeep([],[z,e])),a})},F.relayout=function Z(a,b,c){function e(a,b){if(Array.isArray(a))return void a.forEach(function(a){e(a,b)});if(!(a in p)){var c=G.nestedProperty(n,a);a in z||(z[a]=c.get()),void 0!==b&&c.set(b)}}function f(a,b){var c=F.Axes.id2name(a[b+"ref"]||b);return(o[c]||{}).autorange}if(a=d(a),a.framework&&a.framework.isPolar)return Promise.resolve(a);var g,h,i,j,k,l,m,n=a.layout,o=a._fullLayout,p={},q=!1,r=!1,s=!1,t=!1,u=!1,v=!1;if("string"==typeof b)p[b]=c;else{if(!G.isPlainObject(b))return console.log("relayout fail",b,c),Promise.reject();p=b}for(Object.keys(p).length&&(a.changed=!0),i=Object.keys(p),h=F.Axes.list(a),m=0;m<i.length;m++){if(0===i[m].indexOf("allaxes")){for(var x=0;x<h.length;x++)k=h[x]._id.substr(1),l=-1!==k.indexOf("scene")?k+".":"",g=i[m].replace("allaxes",l+h[x]._name),p[g]||(p[g]=p[i[m]]);delete p[i[m]]}i[m].match(/^annotations\[[0-9-]+\].ref$/)&&(j=p[i[m]].split("y"),p[i[m].replace("ref","xref")]=j[0],p[i[m].replace("ref","yref")]=2===j.length?"y"+j[1]:"paper",delete p[i[m]])}var y={},z={},B=["height","width"];for(var C in p){var D=G.nestedProperty(n,C),E=p[C],H=D.parts.length,K="string"==typeof D.parts[H-1]?H-1:H-2,L=D.parts[K],M=D.parts[K-1]+"."+L,N=D.parts.slice(0,K).join("."),P=G.nestedProperty(a.layout,N).get(),S=G.nestedProperty(o,N).get();if(y[C]=E,z[C]="reverse"===L?E:D.get(),-1!==B.indexOf(C)?e("autosize",!1):"autosize"===C?e(B,void 0):M.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?e(N+".autorange",!1):M.match(/^[xyz]axis[0-9]*\.autorange$/)?e([N+".range[0]",N+".range[1]"],void 0):M.match(/^aspectratio\.[xyz]$/)?e(D.parts[0]+".aspectmode","manual"):M.match(/^aspectmode$/)?e([N+".x",N+".y",N+".z"],void 0):"tick0"===L||"dtick"===L?e(N+".tickmode","linear"):"tickmode"===L?e([N+".tick0",N+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(L)&&!Object.keys(E||{}).length&&(u=!0),"type"===L&&"log"===S.type!=("log"===E)){var T=P;if(T&&T.range)if(S.autorange)"log"===E&&(T.range=T.range[1]>T.range[0]?[1,2]:[2,1]);else{var U=T.range[0],V=T.range[1];"log"===E?(0>=U&&0>=V&&e(N+".autorange",!0),0>=U?U=V/1e6:0>=V&&(V=U/1e6),e(N+".range[0]",Math.log(U)/Math.LN10),e(N+".range[1]",Math.log(V)/Math.LN10)):(e(N+".range[0]",Math.pow(10,U)),e(N+".range[1]",Math.pow(10,V)))}else e(N+".autorange",!0)}if("reverse"===L)P.range?P.range.reverse():(e(N+".autorange",!0),P.range=[1,0]),S.autorange?u=!0:t=!0;else if("annotations"===D.parts[0]||"shapes"===D.parts[0]){var W=D.parts[1],X=D.parts[0],Y=n[X]||[],$=F[G.titleCase(X)],_=Y[W]||{};2===D.parts.length&&("add"===p[C]||G.isPlainObject(p[C])?z[C]="remove":"remove"===p[C]?-1===W?(z[X]=Y,delete z[C]):z[C]=_:console.log("???",p)),!f(_,"x")&&!f(_,"y")||G.containsAny(C,["color","opacity","align","dash"])||(u=!0),$.draw(a,W,D.parts.slice(2).join("."),p[C]),delete p[C]}else 0===D.parts[0].indexOf("scene")?t=!0:0===D.parts[0].indexOf("geo")?t=!0:!o._hasGL2D||-1===C.indexOf("axis")&&"plot_bgcolor"!==D.parts[0]?"hiddenlabels"===C?u=!0:-1!==D.parts[0].indexOf("legend")?q=!0:-1!==C.indexOf("title")?r=!0:-1!==D.parts[0].indexOf("bgcolor")?s=!0:D.parts.length>1&&G.containsAny(D.parts[1],["tick","exponent","grid","zeroline"])?r=!0:-1!==C.indexOf(".linewidth")&&-1!==C.indexOf("axis")?r=s=!0:D.parts.length>1&&-1!==D.parts[1].indexOf("line")?s=!0:D.parts.length>1&&"mirror"===D.parts[1]?r=s=!0:"margin.pad"===C?r=s=!0:"margin"===D.parts[0]||"autorange"===D.parts[1]||"rangemode"===D.parts[1]||"type"===D.parts[1]||"domain"===D.parts[1]||C.match(/^(bar|box|font)/)?u=!0:-1!==["hovermode","dragmode"].indexOf(C)?v=!0:-1===["hovermode","dragmode","height","width","autosize"].indexOf(C)&&(t=!0):t=!0,D.set(E)}I&&I.add(a,Z,[a,z],Z,[a,y]),p.autosize&&(p=w(a,p)),(p.height||p.width||p.autosize)&&(u=!0);var aa=Object.keys(p),ba=[J.previousPromises];if(t||u)ba.push(function(){return a.layout=void 0,u&&(a.calcdata=void 0),F.plot(a,"",n)});else if(aa.length&&(J.supplyDefaults(a),o=a._fullLayout,q&&ba.push(function(){return O.draw(a),J.previousPromises(a)}),s&&ba.push(A),r&&ba.push(function(){return F.Axes.doTicks(a,"redraw"),Q.draw(a,"gtitle"),J.previousPromises(a)}),v)){var ca;for(R(a),ca=J.getSubplotIds(o,"gl3d"),m=0;m<ca.length;m++)k=o[ca[m]]._scene,k.updateFx(o.dragmode,o.hovermode);for(ca=J.getSubplotIds(o,"gl2d"),m=0;m<ca.length;m++)k=o._plots[ca[m]]._scene2d,k.updateFx(o);for(ca=J.getSubplotIds(o,"geo"),m=0;m<ca.length;m++){var da=o[ca[m]]._geo;da.updateFx(o.hovermode)}}var ea=G.syncOrAsync(ba,a);return ea&&ea.then||(ea=Promise.resolve(a)),ea.then(function(){return a.emit("plotly_relayout",G.extendDeep({},y)),a})}},{"../components/color":299,"../components/drawing":317,"../components/errorbars":323,"../components/legend":326,"../components/modebar/manage":329,"../components/shapes":331,"../components/titles":332,"../constants/xmlns_namespaces":338,"../lib":349,"../lib/events":344,"../lib/queue":355,"../plotly":366,"../plots/cartesian/graph_interact":374,"../plots/plots":413,d3:70,"fast-isnumeric":74,"gl-mat4/fromQuat":91}],363:[function(a,b,c){"use strict";function d(a,b){try{a._fullLayout._paper.style("background",b)}catch(c){console.log(c)}}b.exports={staticPlot:!1,editable:!1,autosizable:!1,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:d,topojsonURL:"https://cdn.plot.ly/"}},{}],364:[function(a,b,c){"use strict";function d(a){var b=q.attributes,c=i({type:a}),d=k(a),e=m(a),f={},l={};f.type=null,t(f,b),f=g(c.attributes,f,"attributes",a),void 0!==e.attributes&&t(f,e.attributes),f.type=a,f=j(f),h(f),B.traces[a]=s({},d,{attributes:f}),void 0!==c.layoutAttributes&&(l=g(c.layoutAttributes,l,"layoutAttributes",a),h(l),B.traces[a].layoutAttributes=l)}function e(){var a=q.layoutAttributes,b={};b=g(a,b,"layoutAttributes","*"),b=l(b),b=n(b),b=j(b),h(b),b=o(b),B.layout={layoutAttributes:b}}function f(){B.defs={valObjects:r.valObjects,metaKeys:A.concat(["description","role"])}}function g(a,b,c,d){var e,f,h,j,k;return Object.keys(a).forEach(function(l){return l===v?void Object.keys(a[l]).forEach(function(j){e=i({module:a[l][j]}),void 0!==e&&(f=e[c],h=g(f,{},c,d),r.nestedProperty(b,j).set(t({},h)))}):l===w?void Object.keys(a[l]).forEach(function(e){e===d&&(j=i({module:a[l][e]}),void 0!==j&&(k=j[c],k=g(k,{},c,d),u(b,k)))}):void(b[l]=r.isPlainObject(a[l])?u({},a[l]):a[l])}),b}function h(a){function b(a){return{valType:"string"}}function c(a,c,d){E.isValObject(a)?"data_array"===a.valType?(a.role="data",d[c+"src"]=b(c)):a.arrayOk===!0&&(d[c+"src"]=b(c)):r.isPlainObject(a)&&(a.role="object")}E.crawl(a,c)}function i(a){if("type"in a)return"area"===a.type?{attributes:C}:q.getModule({type:a.type});var b=q.subplotsRegistry,c=a.module;return b[c]?b[c]:"module"in a?p[c]:void 0}function j(a){return Object.keys(a).forEach(function(b){"_"===b.charAt(0)&&-1===A.indexOf(b)&&delete a[b]}),a}function k(a){return"area"===a?{}:q.modules[a].meta||{}}function l(a){return s(a,{radialaxis:D.radialaxis,angularaxis:D.angularaxis}),s(a,D.layout),a}function m(a){if("area"===a)return{};var b=q.subplotsRegistry,c=Object.keys(b).filter(function(b){return q.traceIs({type:a},b)})[0];return void 0===c?{}:b[c]}function n(a){var b=q.subplotsRegistry;return Object.keys(a).forEach(function(c){Object.keys(b).forEach(function(d){var e,f=b[d];e="cartesian"===d||"gl2d"===d?f.attrRegex.x.test(c)||f.attrRegex.y.test(c):f.attrRegex.test(c),e&&(a[c][x]=!0)})}),a}function o(a){return Object.keys(a).forEach(function(b){var c=t({},a[b]);if(c[y]===!0){var d=b.substr(0,b.length-1);delete c[y],a[b]={items:{}},a[b].items[d]=c,a[b].role="object"}}),a}var p=a("../plotly"),q=a("../plots/plots"),r=a("../lib"),s=r.extendFlat,t=r.extendDeep,u=r.extendDeepAll,v="_nestedModules",w="_composedModules",x="_isSubplotObj",y="_isLinkedToArray",z="_deprecated",A=[x,y,z],B={traces:{},layout:{},defs:{}},C=a("../plots/polar/area_attributes"),D=a("../plots/polar/axis_attributes"),E=b.exports={};E.get=function(){return q.allTypes.concat("area").forEach(d),e(),f(),B},E.crawl=function(a,b){Object.keys(a).forEach(function(c){var d=a[c];-1===A.indexOf(c)&&(b(d,c,a),E.isValObject(d)||r.isPlainObject(d)&&E.crawl(d,b))})},E.isValObject=function(a){return a&&void 0!==a.valType}},{"../lib":349,"../plotly":366,"../plots/plots":413,"../plots/polar/area_attributes":414,"../plots/polar/axis_attributes":415}],365:[function(a,b,c){"use strict";var d=a("../plotly");b.exports=function(a){return d.Lib.extendFlat(d.defaultConfig,a)}},{"../plotly":366}],366:[function(a,b,c){"use strict";a("es6-promise").polyfill(),c.Lib=a("./lib"),c.util=a("./lib/svg_text_utils"),c.Queue=a("./lib/queue"),a("../build/plotcss"),c.MathJaxConfig=a("./fonts/mathjax_config"),c.defaultConfig=a("./plot_api/plot_config");var d=c.Plots=a("./plots/plots");c.Axes=a("./plots/cartesian/axes"),c.Fx=a("./plots/cartesian/graph_interact"),c.micropolar=a("./plots/polar/micropolar"),c.Color=a("./components/color"),c.Drawing=a("./components/drawing"),c.Colorscale=a("./components/colorscale"),c.Colorbar=a("./components/colorbar"),c.ErrorBars=a("./components/errorbars"),c.Annotations=a("./components/annotations"),c.Shapes=a("./components/shapes"),c.Legend=a("./components/legend"),c.ModeBar=a("./components/modebar"),c.register=function(a){if(!a)throw new Error("No argument passed to Plotly.register.");a&&!Array.isArray(a)&&(a=[a]);for(var b=0;b<a.length;b++){var c=a[b];if(c&&"trace"!==c.moduleType)throw new Error("Invalid module was attempted to be registered!");d.register(c,c.name,c.categories,c.meta),d.subplotsRegistry[c.basePlotModule.name]||d.registerSubplot(c.basePlotModule)}},c.register(a("./traces/scatter")),a("./plot_api/plot_api"),c.PlotSchema=a("./plot_api/plot_schema"),c.Snapshot=a("./snapshot")},{"../build/plotcss":1,"./components/annotations":297,"./components/color":299,"./components/colorbar":304,"./components/colorscale":312,"./components/drawing":317,"./components/errorbars":323,"./components/legend":326,"./components/modebar":328,"./components/shapes":331,"./fonts/mathjax_config":340,"./lib":349,"./lib/queue":355,"./lib/svg_text_utils":360,"./plot_api/plot_api":362,"./plot_api/plot_config":363,"./plot_api/plot_schema":364,"./plots/cartesian/axes":369,"./plots/cartesian/graph_interact":374,"./plots/plots":413,"./plots/polar/micropolar":416,"./snapshot":420,"./traces/scatter":511,"es6-promise":73}],367:[function(a,b,c){"use strict";b.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none"],dflt:"all"},stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0}}}},{}],368:[function(a,b,c){"use strict";b.exports={xaxis:{valType:"axisid",dflt:"x"},yaxis:{valType:"axisid",dflt:"y"}}},{}],369:[function(a,b,c){"use strict";function d(a){var b,c,d=a.tickvals,e=a.ticktext,f=new Array(d.length),g=1.0001*a.range[0]-1e-4*a.range[1],i=1.0001*a.range[1]-1e-4*a.range[0],j=Math.min(g,i),k=Math.max(g,i),l=0;for(Array.isArray(e)||(e=[]),c=0;c<d.length;c++)b=a.d2l(d[c]),b>j&&k>b&&(void 0===e[c]?f[l]=x.tickText(a,b):f[l]=h(a,b,String(e[c])),l++);return l<d.length&&f.splice(l,d.length-l),f}function e(a,b,c){return b*v.Lib.roundUp(a/b,c)}function f(a){var b,c=a.dtick;if(a._tickexponent=0,u(c)||"string"==typeof c||(c=1),"category"===a.type)a._tickround=null;else if(u(c)||"L"===c.charAt(0))if("date"===a.type)c>=864e5?a._tickround="d":c>=36e5?a._tickround="H":c>=6e4?a._tickround="M":c>=1e3?a._tickround="S":a._tickround=3-Math.round(Math.log(c/2)/Math.LN10);else{u(c)||(c=Number(c.substr(1))),a._tickround=2-Math.floor(Math.log(c)/Math.LN10+.01),b="log"===a.type?Math.pow(10,Math.max(a.range[0],a.range[1])):Math.max(Math.abs(a.range[0]),Math.abs(a.range[1]));var d=Math.floor(Math.log(b)/Math.LN10+.01);Math.abs(d)>3&&("SI"===a.exponentformat||"B"===a.exponentformat?a._tickexponent=3*Math.round((d-1)/3):a._tickexponent=d)}else"M"===c.charAt(0)?a._tickround=2===c.length?"m":"y":a._tickround=null}function g(a,b){var c=a.match(M),d=new Date(b);if(c){var e=Math.min(+c[1]||6,6),f=String(b/1e3%1+2.0000005).substr(2,e).replace(/0+$/,"")||"0";return t.time.format(a.replace(M,f))(d)}return t.time.format(a)(d)}function h(a,b,c){var d=a.tickfont||a._td._fullLayout.font;return{x:b,dx:0,dy:0,text:c||"",fontSize:d.size,font:d.family,fontColor:d.color}}function i(a,b,c,d){var e,f=b.x,h=a._tickround,i=new Date(f),j="";c&&a.hoverformat?e=g(a.hoverformat,f):a.tickformat?e=g(a.tickformat,f):(d&&(u(h)?h+=2:h={y:"m",m:"d",d:"H",H:"M",M:"S",S:2}[h]),"y"===h?e=G(i):"m"===h?e=H(i):(f!==a._tmin||c||(j="<br>"+G(i)),"d"===h?e=I(i):"H"===h?e=J(i):(f!==a._tmin||c||(j="<br>"+I(i)+", "+G(i)),e=K(i),"M"!==h&&(e+=L(i),"S"!==h&&(e+=m(s(f/1e3,1),a,"none",c).substr(1)))))),b.text=e+j}function j(a,b,c,d,e){var f=a.dtick,g=b.x;if(!d||"string"==typeof f&&"L"===f.charAt(0)||(f="L3"),a.tickformat||"string"==typeof f&&"L"===f.charAt(0))b.text=m(Math.pow(10,g),a,e,d);else if(u(f)||"D"===f.charAt(0)&&s(g+.01,1)<.1)if(-1!==["e","E","power"].indexOf(a.exponentformat)){var h=Math.round(g);0===h?b.text=1:1===h?b.text="10":h>1?b.text="10<sup>"+h+"</sup>":b.text="10<sup>â"+-h+"</sup>",b.fontSize*=1.25}else b.text=m(Math.pow(10,g),a,"","fakehover"),"D1"===f&&"y"===a._id.charAt(0)&&(b.dy-=b.fontSize/6);else{if("D"!==f.charAt(0))throw"unrecognized dtick "+String(f);b.text=String(Math.round(Math.pow(10,s(g,1)))),b.fontSize*=.75}if("D1"===a.dtick){var i=String(b.text).charAt(0);"0"!==i&&"1"!==i||("y"===a._id.charAt(0)?b.dx-=b.fontSize/4:(b.dy+=b.fontSize/2,b.dx+=(a.range[1]>a.range[0]?1:-1)*b.fontSize*(0>g?.5:.25)))}}function k(a,b){var c=a._categories[Math.round(b.x)];void 0===c&&(c=""),b.text=String(c)}function l(a,b,c,d,e){"all"===a.showexponent&&Math.abs(b.x/a.dtick)<1e-6&&(e="hide"),b.text=m(b.x,a,e,d)}function m(a,b,c,d){var e=0>a,g=b._tickround,h=c||b.exponentformat||"B",i=b._tickexponent,j=b.tickformat;if(d){var k={exponentformat:b.exponentformat,dtick:"none"===b.showexponent?b.dtick:u(a)?Math.abs(a)||1:1,range:"none"===b.showexponent?b.range:[0,a||1]};f(k),g=(Number(k._tickround)||0)+4,i=k._tickexponent,b.hoverformat&&(j=b.hoverformat)}if(j)return t.format(j)(a).replace(/-/g,"â");var l=Math.pow(10,-g)/2;if("none"===h&&(i=0),a=Math.abs(a),l>a)a="0",e=!1;else{if(a+=l,i&&(a*=Math.pow(10,-i),g+=i),0===g)a=String(Math.floor(a));else if(0>g){a=String(Math.round(a)),a=a.substr(0,a.length+g);for(var m=g;0>m;m++)a+="0"}else{a=String(a);var o=a.indexOf(".")+1;o&&(a=a.substr(0,o+g).replace(/\.?0+$/,""))}a=n(a,b._td._fullLayout.separators)}if(i&&"hide"!==h){var p;p=0>i?"â"+-i:"power"!==h?"+"+i:String(i),"e"===h||("SI"===h||"B"===h)&&(i>12||-15>i)?a+="e"+p:"E"===h?a+="E"+p:"power"===h?a+="×10<sup>"+p+"</sup>":"B"===h&&9===i?a+="B":"SI"!==h&&"B"!==h||(a+=N[i/3+5])}return e?"â"+a:a}function n(a,b){var c=b.charAt(0),d=b.charAt(1),e=a.split("."),f=e[0],g=e.length>1?c+e[1]:"";if(d&&(e.length>1||f.length>4))for(;O.test(f);)f=f.replace(O,"$1"+d+"$2");return f+g}function o(a,b){var c,d,e=[];for(c=0;c<b.length;c++){var f=[],g=a._fullData[b[c]].xaxis,h=a._fullData[b[c]].yaxis;if(g&&h){for(d=0;d<e.length;d++)-1===e[d].x.indexOf(g)&&-1===e[d].y.indexOf(h)||f.push(d);if(f.length){var i,j=e[f[0]];if(f.length>1)for(d=1;d<f.length;d++)i=e[f[d]],p(j.x,i.x),p(j.y,i.y);p(j.x,[g]),p(j.y,[h])}else e.push({x:[g],y:[h]})}}return e}function p(a,b){for(var c=0;c<b.length;c++)-1===a.indexOf(b[c])&&a.push(b[c])}function q(a,b,c){var d,e,f=[],g=[],h=a.layout;for(d=0;d<b.length;d++)f.push(x.getFromId(a,b[d]));for(d=0;d<c.length;d++)g.push(x.getFromId(a,c[d]));var i=Object.keys(f[0]),j=["anchor","domain","overlaying","position","side","tickangle"],k=["linear","log"];for(d=0;d<i.length;d++){var l=i[d],m=f[0][l],n=g[0][l],o=!0,p=!1,q=!1;if("_"!==l.charAt(0)&&"function"!=typeof m&&-1===j.indexOf(l)){for(e=1;e<f.length&&o;e++){var s=f[e][l];"type"===l&&-1!==k.indexOf(m)&&-1!==k.indexOf(s)&&m!==s?p=!0:s!==m&&(o=!1)}for(e=1;e<g.length&&o;e++){var t=g[e][l];"type"===l&&-1!==k.indexOf(n)&&-1!==k.indexOf(t)&&n!==t?q=!0:g[e][l]!==n&&(o=!1)}o&&(p&&(h[f[0]._name].type="linear"),q&&(h[g[0]._name].type="linear"),r(h,l,f,g))}}for(d=0;d<a._fullLayout.annotations.length;d++){var u=a._fullLayout.annotations[d];-1!==b.indexOf(u.xref)&&-1!==c.indexOf(u.yref)&&v.Lib.swapAttrs(h.annotations[d],["?"])}}function r(a,b,c,d){var e,f=v.Lib.nestedProperty,g=f(a[c[0]._name],b).get(),h=f(a[d[0]._name],b).get();for("title"===b&&("Click to enter X axis title"===g&&(g="Click to enter Y axis title"),"Click to enter Y axis title"===h&&(h="Click to enter X axis title")),e=0;e<c.length;e++)f(a,c[e]._name+"."+b).set(h);for(e=0;e<d.length;e++)f(a,d[e]._name+"."+b).set(g)}function s(a,b){return(a%b+b)%b}var t=a("d3"),u=a("fast-isnumeric"),v=a("../../plotly"),w=a("../../components/titles"),x=b.exports={};x.layoutAttributes=a("./layout_attributes"),x.supplyLayoutDefaults=a("./layout_defaults"),x.setConvert=a("./set_convert");var y=a("./axis_ids");x.id2name=y.id2name,x.cleanId=y.cleanId,x.list=y.list,x.listIds=y.listIds,x.getFromId=y.getFromId,x.getFromTrace=y.getFromTrace,x.coerceRef=function(a,b,c,d){var e=c._fullLayout._hasGL2D?[]:x.listIds(c,d),f=d+"ref",g={};return g[f]={valType:"enumerated",values:e.concat(["paper"]),dflt:e[0]||"paper"},v.Lib.coerce(a,b,g,f)},x.clearTypes=function(a,b){Array.isArray(b)&&b.length||(b=a._fullData.map(function(a,b){return b})),b.forEach(function(b){var c=a.data[b];delete(x.getFromId(a,c.xaxis)||{}).type,delete(x.getFromId(a,c.yaxis)||{}).type})},x.counterLetter=function(a){var b=a.charAt(0);return"x"===b?"y":"y"===b?"x":void 0},x.minDtick=function(a,b,c,d){-1===["log","category"].indexOf(a.type)&&d?null===a._minDtick?(a._minDtick=b,a._forceTick0=c):a._minDtick&&((a._minDtick/b+1e-6)%1<2e-6&&((c-a._forceTick0)/b%1+1.000001)%1<2e-6?(a._minDtick=b,a._forceTick0=c):((b/a._minDtick+1e-6)%1>2e-6||((c-a._forceTick0)/a._minDtick%1+1.000001)%1>2e-6)&&(a._minDtick=0)):a._minDtick=0},x.doAutoRange=function(a){if(a._length||a.setScale(),a.autorange&&a._min&&a._max&&a._min.length&&a._max.length){var b,c=a._min[0].val,d=a._max[0].val;for(b=1;b<a._min.length&&c===d;b++)c=Math.min(c,a._min[b].val);for(b=1;b<a._max.length&&c===d;b++)d=Math.max(d,a._max[b].val);var e,f,g,h,i,j,k,l=0,m=a.range&&a.range[1]<a.range[0];for("reversed"===a.autorange&&(m=!0,a.autorange=!0),b=0;b<a._min.length;b++)for(f=a._min[b],e=0;e<a._max.length;e++)g=a._max[e],k=g.val-f.val,j=a._length-f.pad-g.pad,k>0&&j>0&&k/j>l&&(h=f,i=g,l=k/j);c===d?a.range=m?[c+1,"normal"!==a.rangemode?0:c-1]:["normal"!==a.rangemode?0:c-1,c+1]:l&&("linear"!==a.type&&"-"!==a.type||("tozero"===a.rangemode&&h.val>=0?h={val:0,pad:0}:"nonnegative"===a.rangemode&&(h.val-l*h.pad<0&&(h={val:0,pad:0}),i.val<0&&(i={val:1,pad:0})),l=(i.val-h.val)/(a._length-h.pad-i.pad)),a.range=[h.val-l*h.pad,i.val+l*i.pad],a.range[0]===a.range[1]&&(a.range=[a.range[0]-1,a.range[0]+1]),m&&a.range.reverse());var n=a._td.layout[a._name];n||(a._td.layout[a._name]=n={}),n!==a&&(n.range=a.range.slice(),n.autorange=a.autorange)}},x.saveRangeInitial=function(a,b){for(var c=x.list(a,"",!0),d=!1,e=0;e<c.length;e++){var f=c[e],g=void 0===f._rangeInitial,h=g||!(f.range[0]===f._rangeInitial[0]&&f.range[1]===f._rangeInitial[1]);(g&&f.autorange===!1||b&&h)&&(f._rangeInitial=f.range.slice(),d=!0)}return d};var z=Number.MAX_VALUE/2;x.expand=function(a,b,c){function d(a){if(Array.isArray(a))return function(b){return Math.max(Number(a[b]||0),0)};var b=Math.max(Number(a||0),0);return function(){return b}}function e(c){function d(a){return u(a)&&Math.abs(a)<z}if(i=b[c],u(i)){if(l=t(c)+r,m=v(c)+r,o=i-x(c),p=i+w(c),"log"===a.type&&p/10>o&&(o=p/10),j=a.c2l(o),k=a.c2l(p),s&&(j=Math.min(0,j),k=Math.max(0,k)),d(j)){for(n=!0,g=0;g<a._min.length&&n;g++)h=a._min[g],h.val<=j&&h.pad>=m?n=!1:h.val>=j&&h.pad<=m&&(a._min.splice(g,1),g--);n&&a._min.push({val:j,pad:s&&0===j?0:m})}if(d(k)){for(n=!0,g=0;g<a._max.length&&n;g++)h=a._max[g],h.val>=k&&h.pad>=l?n=!1:h.val<=k&&h.pad<=l&&(a._max.splice(g,1),g--);n&&a._max.push({val:k,pad:s&&0===k?0:l})}}}if(a.autorange&&b){a._min||(a._min=[]),a._max||(a._max=[]),c||(c={}),a._m||a.setScale();var f,g,h,i,j,k,l,m,n,o,p,q=b.length,r=c.padded?.05*a._length:0,s=c.tozero&&("linear"===a.type||"-"===a.type),t=d((a._m>0?c.ppadplus:c.ppadminus)||c.ppad||0),v=d((a._m>0?c.ppadminus:c.ppadplus)||c.ppad||0),w=d(c.vpadplus||c.vpad),x=d(c.vpadminus||c.vpad);for(f=0;6>f;f++)e(f);for(f=q-1;f>5;f--)e(f)}},x.autoBin=function(a,b,c,d){function e(a){return(1+100*(a-n)/l.dtick)%100<2}var f=v.Lib.aggNums(Math.min,null,a),g=v.Lib.aggNums(Math.max,null,a);if("category"===b.type)return{start:f-.5,end:g+.5,size:1};var h;if(c)h=(g-f)/c;else{var i=v.Lib.distinctVals(a),j=Math.pow(10,Math.floor(Math.log(i.minDiff)/Math.LN10)),k=j*v.Lib.roundUp(i.minDiff/j,[.9,1.9,4.9,9.9],!0);h=Math.max(k,2*v.Lib.stdev(a)/Math.pow(a.length,d?.25:.4))}var l={type:"log"===b.type?"linear":b.type,range:[f,g]};x.autoTicks(l,h);var m,n=x.tickIncrement(x.tickFirst(l),l.dtick,"reverse");if("number"==typeof l.dtick){for(var o=0,p=0,q=0,r=0,s=0;s<a.length;s++)a[s]%1===0?q++:u(a[s])||r++,e(a[s])&&o++,e(a[s]+l.dtick/2)&&p++;var t=a.length-r;if(q===t&&"date"!==b.type)l.dtick<1?n=f-.5*l.dtick:n-=.5;else if(.1*t>p&&(o>.3*t||e(f)||e(g))){var w=l.dtick/2;n+=f>n+w?w:-w}var y=1+Math.floor((g-n)/l.dtick);m=n+y*l.dtick}else for(m=n;g>=m;)m=x.tickIncrement(m,l.dtick);return{start:n,end:m,size:l.dtick}},x.calcTicks=function(a){if("array"===a.tickmode)return d(a);if("auto"===a.tickmode||!a.dtick){var b,c=a.nticks;c||("category"===a.type?(b=a.tickfont?1.2*(a.tickfont.size||12):15,c=a._length/b):(b="y"===a._id.charAt(0)?40:80,c=v.Lib.constrain(a._length/b,4,9)+1)),x.autoTicks(a,Math.abs(a.range[1]-a.range[0])/c),a._minDtick>0&&a.dtick<2*a._minDtick&&(a.dtick=a._minDtick,a.tick0=a._forceTick0)}a.tick0||(a.tick0="date"===a.type?new Date(2e3,0,1).getTime():0),f(a),a._tmin=x.tickFirst(a);var e=a.range[1]<a.range[0],g=[],h=1.0001*a.range[1]-1e-4*a.range[0];"category"===a.type&&(h=e?Math.max(-.5,h):Math.min(a._categories.length-.5,h));for(var i=a._tmin;(e?i>=h:h>=i)&&(g.push(i),!(g.length>1e3));i=x.tickIncrement(i,a.dtick,e));a._tmax=g[g.length-1];for(var j=new Array(g.length),k=0;k<g.length;k++)j[k]=x.tickText(a,g[k]);return j};var A=[2,5,10],B=[1,2,3,6,12],C=[1,2,5,10,15,30],D=[1,2,3,7,14],E=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],F=[-.301,0,.301,.699,1];x.autoTicks=function(a,b){var c;if("date"===a.type)a.tick0=new Date(2e3,0,1).getTime(),b>157788e5?(b/=315576e5,c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick="M"+12*e(b,c,A)):b>12096e5?(b/=26298e5,a.dtick="M"+e(b,1,B)):b>432e5?(a.dtick=e(b,864e5,D),a.tick0=new Date(2e3,0,2).getTime()):b>18e5?a.dtick=e(b,36e5,B):b>3e4?a.dtick=e(b,6e4,C):b>500?a.dtick=e(b,1e3,C):(c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick=e(b,c,A));else if("log"===a.type)if(a.tick0=0,b>.7)a.dtick=Math.ceil(b);else if(Math.abs(a.range[1]-a.range[0])<1){var d=1.5*Math.abs((a.range[1]-a.range[0])/b);b=Math.abs(Math.pow(10,a.range[1])-Math.pow(10,a.range[0]))/d,c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)), 50 a.dtick="L"+e(b,c,A)}else a.dtick=b>.3?"D2":"D1";else"category"===a.type?(a.tick0=0,a.dtick=Math.ceil(Math.max(b,1))):(a.tick0=0,c=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),a.dtick=e(b,c,A));if(0===a.dtick&&(a.dtick=1),!u(a.dtick)&&"string"!=typeof a.dtick){var f=a.dtick;throw a.dtick=1,"ax.dtick error: "+String(f)}},x.tickIncrement=function(a,b,c){var d=c?-1:1;if(u(b))return a+d*b;var e=b.charAt(0),f=d*Number(b.substr(1));if("M"===e){var g=new Date(a);return g.setMonth(g.getMonth()+f)}if("L"===e)return Math.log(Math.pow(10,a)+f)/Math.LN10;if("D"===e){var h="D2"===b?F:E,i=a+.01*d,j=v.Lib.roundUp(s(i,1),h,c);return Math.floor(i)+Math.log(t.round(Math.pow(10,j),1))/Math.LN10}throw"unrecognized dtick "+String(b)},x.tickFirst=function(a){var b=a.range[1]<a.range[0],c=b?Math.floor:Math.ceil,d=1.0001*a.range[0]-1e-4*a.range[1],e=a.dtick,f=a.tick0;if(u(e)){var g=c((d-f)/e)*e+f;return"category"===a.type&&(g=v.Lib.constrain(g,0,a._categories.length-1)),g}var h,i,j,k=e.charAt(0),l=Number(e.substr(1));if("M"===k){for(h=new Date(f),d=new Date(d),i=12*(d.getFullYear()-h.getFullYear())+d.getMonth()-h.getMonth(),j=h.setMonth(h.getMonth()+(Math.round(i/l)+(b?1:-1))*l);b?j>d:d>j;)j=x.tickIncrement(j,e,b);return j}if("L"===k)return Math.log(c((Math.pow(10,d)-f)/l)*l+f)/Math.LN10;if("D"===k){var m="D2"===e?F:E,n=v.Lib.roundUp(s(d,1),m,b);return Math.floor(d)+Math.log(t.round(Math.pow(10,n),1))/Math.LN10}throw"unrecognized dtick "+String(e)};var G=t.time.format("%Y"),H=t.time.format("%b %Y"),I=t.time.format("%b %-d"),J=t.time.format("%b %-d %Hh"),K=t.time.format("%H:%M"),L=t.time.format(":%S"),M=/%(\d?)f/g;x.tickText=function(a,b,c){function d(d){var e;return void 0===d?!0:c?"none"===d:(e={first:a._tmin,last:a._tmax}[d],"all"!==d&&b!==e)}var e,f,g=h(a,b),m="array"===a.tickmode,n=c||m;if(m&&Array.isArray(a.ticktext)){var o=Math.abs(a.range[1]-a.range[0])/1e4;for(f=0;f<a.ticktext.length&&!(Math.abs(b-a.d2l(a.tickvals[f]))<o);f++);if(f<a.ticktext.length)return g.text=String(a.ticktext[f]),g}return e="none"!==a.exponentformat&&d(a.showexponent)?"hide":"","date"===a.type?i(a,g,c,n):"log"===a.type?j(a,g,c,n,e):"category"===a.type?k(a,g):l(a,g,c,n,e),a.tickprefix&&!d(a.showtickprefix)&&(g.text=a.tickprefix+g.text),a.ticksuffix&&!d(a.showticksuffix)&&(g.text+=a.ticksuffix),g};var N=["f","p","n","μ","m","","k","M","G","T"],O=/(\d+)(\d{3})/;x.subplotMatch=/^x([0-9]*)y([0-9]*)$/,x.getSubplots=function(a,b){function c(a,b){return-1!==a.indexOf(b._id)}var d,e,f,g=[],h=a.data||[];for(d=0;d<h.length;d++){var i=h[d];if(i.visible!==!1&&"legendonly"!==i.visible&&(v.Plots.traceIs(i,"cartesian")||v.Plots.traceIs(i,"gl2d"))){var j=i.xaxis||"x",k=i.yaxis||"y";f=j+k,-1===g.indexOf(f)&&g.push(f)}}var l=x.list(a,"",!0);for(d=0;d<l.length;d++){var m=l[d],n=m._id.charAt(0),o="free"===m.anchor?"x"===n?"y":"x":m.anchor,p=x.getFromId(a,o),q=!1;for(e=0;e<g.length;e++)if(c(g[e],m)){q=!0;break}"free"===m.anchor&&q||p&&(f="x"===n?m._id+p._id:p._id+m._id,-1===g.indexOf(f)&&g.push(f))}var r=x.subplotMatch,s=[];for(d=0;d<g.length;d++)f=g[d],r.test(f)&&s.push(f);return s.sort(function(a,b){var c=a.match(r),d=b.match(r);return c[1]===d[1]?+(c[2]||1)-(d[2]||1):+(c[1]||0)-(d[1]||0)}),b?x.findSubplotsWithAxis(s,b):s},x.findSubplotsWithAxis=function(a,b){for(var c=new RegExp("x"===b._id.charAt(0)?"^"+b._id+"y":b._id+"$"),d=[],e=0;e<a.length;e++){var f=a[e];c.test(f)&&d.push(f)}return d},x.makeClipPaths=function(a){var b,c,d=a._fullLayout,e=d._defs,f={_offset:0,_length:d.width,_id:""},g={_offset:0,_length:d.height,_id:""},h=x.list(a,"x",!0),i=x.list(a,"y",!0),j=[];for(b=0;b<h.length;b++)for(j.push({x:h[b],y:g}),c=0;c<i.length;c++)0===b&&j.push({x:f,y:i[c]}),j.push({x:h[b],y:i[c]});var k=e.selectAll("g.clips").data([0]);k.enter().append("g").classed("clips",!0);var l=k.selectAll(".axesclip").data(j,function(a){return a.x._id+a.y._id});l.enter().append("clipPath").classed("axesclip",!0).attr("id",function(a){return"clip"+d._uid+a.x._id+a.y._id}).append("rect"),l.exit().remove(),l.each(function(a){t.select(this).select("rect").attr({x:a.x._offset||0,y:a.y._offset||0,width:a.x._length||1,height:a.y._length||1})})},x.doTicks=function(a,b,c){function d(a){var b=i.l2p(a.x);return b>1&&b<i._length-1}function e(a,b){var c=a.selectAll("path."+z).data("inside"===i.ticks?J:s,y);b&&i.ticks?(c.enter().append("path").classed(z,1).classed("ticks",1).classed("crisp",1).call(v.Color.stroke,i.tickcolor).style("stroke-width",G+"px").attr("d",b),c.attr("transform",m),c.exit().remove()):c.remove()}function f(d,e){function f(a,b){a.each(function(a){var c=n(b),d=t.select(this),e=d.select(".text-math-group"),f=m(a)+(u(b)&&0!==+b?" rotate("+b+","+k(a)+","+(l(a)-a.fontSize/2)+")":"");if(e.empty()){var g=d.select("text").attr({transform:f,"text-anchor":c});g.empty()||g.selectAll("tspan.line").attr({x:g.attr("x"),y:g.attr("y")})}else{var h=v.Drawing.bBox(e.node()).width*{end:-.5,start:.5}[c];e.attr("transform",f+(h?"translate("+h+",0)":""))}})}function g(){return B.length&&Promise.all(B)}function h(){if(f(j,i.tickangle),"x"===q&&!u(i.tickangle)&&("log"!==i.type||"D"!==String(i.dtick).charAt(0))){var d=[];for(j.each(function(a){var b=t.select(this),c=b.select(".text-math-group"),e=i.l2p(a.x);c.empty()&&(c=b.select("text"));var f=v.Drawing.bBox(c.node());d.push({top:0,bottom:10,height:10,left:e-f.width/2,right:e+f.width/2+2,width:f.width+2})}),p=0;p<d.length-1;p++)if(v.Lib.bBoxIntersect(d[p],d[p+1])){A=30;break}if(A){var e=Math.abs((s[s.length-1].x-s[0].x)*i._m)/(s.length-1);2.5*x>e&&(A=90),f(j,A)}i._lastangle=A}return c||w.draw(a,b+"title"),b+" done"}var j=d.selectAll("g."+z).data(s,y);if(!i.showticklabels||!u(e))return j.remove(),void w.draw(a,b+"title");var k,l,n,o;if("x"===q){var r="bottom"===H?1:-1;k=function(a){return a.dx},o=e+(D+C)*r,l=function(a){return a.dy+o+a.fontSize*("bottom"===H?1:-.5)},n=function(a){return u(a)&&0!==a&&180!==a?0>a*r?"end":"start":"middle"}}else l=function(a){return a.dy+a.fontSize/2},k=function(a){return a.dx+e+(D+C+(90===Math.abs(i.tickangle)?a.fontSize/2:0))*("right"===H?1:-1)},n=function(a){return u(a)&&90===Math.abs(a)?"middle":"right"===H?"start":"end"};var x=0,A=0,B=[];j.enter().append("g").classed(z,1).append("text").attr("text-anchor","middle").each(function(b){var c=t.select(this),d=a._promises.length;c.call(v.Drawing.setPosition,k(b),l(b)).call(v.Drawing.font,b.font,b.fontSize,b.fontColor).text(b.text).call(v.util.convertToTspans),d=a._promises[d],d?B.push(a._promises.pop().then(function(){f(c,i.tickangle)})):f(c,i.tickangle)}),j.exit().remove(),j.each(function(a){x=Math.max(x,a.fontSize)}),f(j,i._lastangle||i.tickangle);var E=v.Lib.syncOrAsync([g,h]);return E&&E.then&&a._promises.push(E),E}function g(a,b){return a.visible!==!0||a.xaxis+a.yaxis!==b?!1:v.Plots.traceIs(a,"bar")&&a.orientation==={x:"h",y:"v"}[q]?!0:a.fill&&a.fill.charAt(a.fill.length-1)===q}function h(b,c,e){var f=b.gridlayer,h=b.zerolinelayer,j=b["hidegrid"+q]?[]:J,k="M0,0"+("x"===q?"v":"h")+c._length,l=f.selectAll("path."+A).data(i.showgrid===!1?[]:j,y);l.enter().append("path").classed(A,1).classed("crisp",1).attr("d",k).each(function(a){i.zeroline&&("linear"===i.type||"-"===i.type)&&Math.abs(a.x)<i.dtick/100&&t.select(this).remove()}),l.attr("transform",m).call(v.Color.stroke,i.gridcolor||"#ddd").style("stroke-width",E+"px"),l.exit().remove();for(var n=!1,o=0;o<a._fullData.length;o++)if(g(a._fullData[o],e)){n=!0;break}var p=i.range[0]*i.range[1]<=0&&i.zeroline&&("linear"===i.type||"-"===i.type)&&j.length&&(n||d({x:0})||!i.showline),r=h.selectAll("path."+B).data(p?[{x:0}]:[]);r.enter().append("path").classed(B,1).classed("zl",1).classed("crisp",1).attr("d",k),r.attr("transform",m).call(v.Color.stroke,i.zerolinecolor||v.Color.defaultLine).style("stroke-width",F+"px"),r.exit().remove()}var i,j=a._fullLayout,k=!1;if("object"==typeof b)i=b,b=i._id,k=!0;else if(i=x.getFromId(a,b),"redraw"===b&&j._paper.selectAll("g.subplot").each(function(a){var b=j._plots[a],c=b.x(),d=b.y();b.plot.attr("viewBox","0 0 "+c._length+" "+d._length),b.xaxislayer.selectAll("."+c._id+"tick").remove(),b.yaxislayer.selectAll("."+d._id+"tick").remove(),b.gridlayer.selectAll("path").remove(),b.zerolinelayer.selectAll("path").remove()}),!b||"redraw"===b)return v.Lib.syncOrAsync(x.list(a,"",!0).map(function(c){return function(){if(c._id){var d=x.doTicks(a,c._id);return"redraw"===b&&(c._r=c.range.slice()),d}}}));i.tickformat||(-1===["none","e","E","power","SI","B"].indexOf(i.exponentformat)&&(i.exponentformat="e"),-1===["all","first","last","none"].indexOf(i.showexponent)&&(i.showexponent="all")),i.range=[+i.range[0],+i.range[1]],i.setScale();var l,m,n,o,p,q=b.charAt(0),r=x.counterLetter(b),s=x.calcTicks(i),y=function(a){return a.text+a.x+i.mirror},z=b+"tick",A=b+"grid",B=b+"zl",C=(i.linewidth||1)/2,D=("outside"===i.ticks?i.ticklen:1)+(i.linewidth||0),E=v.Drawing.crispRound(a,i.gridwidth,1),F=v.Drawing.crispRound(a,i.zerolinewidth,E),G=v.Drawing.crispRound(a,i.tickwidth,1);if("x"===q)l=["bottom","top"],m=function(a){return"translate("+i.l2p(a.x)+",0)"},n="M0,",o="v";else{if("y"!==q)return void console.log("unrecognized doTicks axis",b);l=["left","right"],m=function(a){return"translate(0,"+i.l2p(a.x)+")"},n="M",o=",0h"}var H=i.side||l[0],I=[-1,1,H===l[1]?1:-1];"inside"!==i.ticks==("x"===q)&&(I=I.map(function(a){return-a}));var J=s.filter(d);if(k)return e(i._axislayer,n+(i._pos+C*I[2])+o+I[2]*i.ticklen),f(i._axislayer,i._pos);var K=x.getSubplots(a,i).map(function(a){var b=j._plots[a];if(j._hasCartesian){var c=b[q+"axislayer"],d=i._linepositions[a]||[],g=b[r](),k=g._id===i.anchor,m=[!1,!1,!1],s="";if("allticks"===i.mirror?m=[!0,!0,!1]:k&&("ticks"===i.mirror?m=[!0,!0,!1]:m[l.indexOf(H)]=!0),i.mirrors)for(p=0;2>p;p++){var t=i.mirrors[g._id+l[p]];"ticks"!==t&&"labels"!==t||(m[p]=!0)}return void 0!==d[2]&&(m[2]=!0),m.forEach(function(a,b){var c=d[b],e=I[b];a&&u(c)&&(s+=n+(c+C*e)+o+e*i.ticklen)}),e(c,s),h(b,g,a),f(c,d[3])}}).filter(function(a){return a&&a.then});return K.length?Promise.all(K):0},x.swap=function(a,b){for(var c=o(a,b),d=0;d<c.length;d++)q(a,c[d].x,c[d].y)}},{"../../components/titles":332,"../../plotly":366,"./axis_ids":371,"./layout_attributes":376,"./layout_defaults":377,"./set_convert":380,d3:70,"fast-isnumeric":74}],370:[function(a,b,c){"use strict";function d(a,b){if("-"===a.type){var c=a._id,d=c.charAt(0);-1!==c.indexOf("scene")&&(c=d);var i=h(b,c,d);if(i){if("histogram"===i.type&&d==={v:"y",h:"x"}[i.orientation||"v"])return void(a.type="linear");if(f(i,d)){for(var j,k=e(i),l=[],m=0;m<b.length;m++)j=b[m],n.traceIs(j,"box")&&(j[d+"axis"]||d)===c&&(void 0!==j[k]?l.push(j[k][0]):void 0!==j.name?l.push(j.name):l.push("text"));a.type=g(l)}else a.type=g(i[d]||[i[d+"0"]])}}}function e(a){return{v:"x",h:"y"}[a.orientation||"v"]}function f(a,b){var c=e(a);return n.traceIs(a,"box")&&b===c&&void 0===a[c]&&void 0===a[c+"0"]}function g(a){return j(a)?"date":k(a)?"category":i(a)?"linear":"-"}function h(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];if((e[c+"axis"]||c)===b){if(f(e,c))return e;if((e[c]||[]).length||e[c+"0"])return e}}}function i(a){if(!a)return!1;for(var b=0;b<a.length;b++)if(l(a[b]))return!0;return!1}function j(a){for(var b,c=0,d=0,e=Math.max(1,(a.length-1)/1e3),f=0;f<a.length;f+=e)b=a[Math.round(f)],m.isDateTime(b)&&(c+=1),l(b)&&(d+=1);return c>2*d}function k(a){for(var b,c=Math.max(1,(a.length-1)/1e3),d=0,e=0,f=0;f<a.length;f+=c)b=s(a[Math.round(f)]),l(b)?d++:"string"==typeof b&&""!==b&&"None"!==b&&e++;return e>2*d}var l=a("fast-isnumeric"),m=a("../../lib"),n=a("../plots"),o=a("./layout_attributes"),p=a("./tick_value_defaults"),q=a("./tick_defaults"),r=a("./set_convert"),s=a("./clean_datum"),t=a("./axis_ids");b.exports=function(a,b,c,e){var f=e.letter,g=e.font||{},h="Click to enter "+(e.title||f.toUpperCase()+" axis")+" title";e.name&&(b._name=e.name,b._id=t.name2id(e.name));var i=c("type");"-"===i&&(d(b,e.data),"-"===b.type?b.type="linear":i=a.type=b.type),r(b),c("title",h),m.coerceFont(c,"titlefont",{family:g.family,size:Math.round(1.2*g.size),color:g.color});var j=2===(a.range||[]).length&&l(a.range[0])&&l(a.range[1]),k=c("autorange",!j);k&&c("rangemode");var n=c("range",[-1,"x"===f?6:4]);n[0]===n[1]&&(b.range=[n[0]-1,n[0]+1]),m.noneOrAll(a.range,b.range,[0,1]),c("fixedrange"),p(a,b,c,i),q(a,b,c,i,e);var s=m.coerce2(a,b,o,"linecolor"),u=m.coerce2(a,b,o,"linewidth"),v=c("showline",!!s||!!u);v||(delete b.linecolor,delete b.linewidth),(v||b.ticks)&&c("mirror");var w=m.coerce2(a,b,o,"gridcolor"),x=m.coerce2(a,b,o,"gridwidth"),y=c("showgrid",e.showGrid||!!w||!!x);y||(delete b.gridcolor,delete b.gridwidth);var z=m.coerce2(a,b,o,"zerolinecolor"),A=m.coerce2(a,b,o,"zerolinewidth"),B=c("zeroline",e.showGrid||!!z||!!A);return B||(delete b.zerolinecolor,delete b.zerolinewidth),b}},{"../../lib":349,"../plots":413,"./axis_ids":371,"./clean_datum":372,"./layout_attributes":376,"./set_convert":380,"./tick_defaults":381,"./tick_value_defaults":382,"fast-isnumeric":74}],371:[function(a,b,c){"use strict";function d(a,b,c){function d(a,c){for(var d=Object.keys(a),e=/^[xyz]axis[0-9]*/,f=[],g=0;g<d.length;g++){var h=d[g];b&&h.charAt(0)!==b||e.test(h)&&f.push(c+h)}return f.sort()}var f=a._fullLayout;if(!f)return[];var g=d(f,"");if(c)return g;for(var h=e.getSubplotIds(f,"gl3d")||[],i=0;i<h.length;i++){var j=h[i];g=g.concat(d(f[j],j+"."))}return g}var e=a("../plots"),f=a("../../lib"),g=a("./constants");c.id2name=function(a){if("string"==typeof a&&a.match(g.AX_ID_PATTERN)){var b=a.substr(1);return"1"===b&&(b=""),a.charAt(0)+"axis"+b}},c.name2id=function(a){if(a.match(g.AX_NAME_PATTERN)){var b=a.substr(5);return"1"===b&&(b=""),a.charAt(0)+b}},c.cleanId=function(a,b){if(a.match(g.AX_ID_PATTERN)&&(!b||a.charAt(0)===b)){var c=a.substr(1).replace(/^0+/,"");return"1"===c&&(c=""),a.charAt(0)+c}},c.list=function(a,b,c){return d(a,b,c).map(function(b){return f.nestedProperty(a._fullLayout,b).get()})},c.listIds=function(a,b){return d(a,b,!0).map(c.name2id)},c.getFromId=function(a,b,d){var e=a._fullLayout;return"x"===d?b=b.replace(/y[0-9]*/,""):"y"===d&&(b=b.replace(/x[0-9]*/,"")),e[c.id2name(b)]},c.getFromTrace=function(a,b,d){var f=a._fullLayout,g=null;if(e.traceIs(b,"gl3d")){var h=b.scene;"scene"===h.substr(0,5)&&(g=f[h][d+"axis"])}else g=c.getFromId(a,b[d+"axis"]||d);return g}},{"../../lib":349,"../plots":413,"./constants":373}],372:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib");b.exports=function(a){try{if("object"==typeof a&&null!==a&&a.getTime)return e.ms2DateTime(a);if("string"!=typeof a&&!d(a))return"";a=a.toString().replace(/['"%,$# ]/g,"")}catch(b){console.log(b,a)}return a}},{"../../lib":349,"fast-isnumeric":74}],373:[function(a,b,c){"use strict";b.exports={BADNUM:void 0,xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,DBLCLICKDELAY:600,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:100,BENDPX:1.5}},{}],374:[function(a,b,c){"use strict";function d(a,b){for(var c=[],d=a.length;d>0;d--)c.push(b);return c}function e(a,b){for(var c=[],d=0;d<a.length;d++)c.push(a[d].p2c(b));return c}function f(a,b){return function(c){var d=a(c),e=b(c);return Math.sqrt(d*d+e*e)}}function g(a,b,c){if("pie"===c)return void a.emit("plotly_hover",{points:[b]});c||(c="xy");var f=a._fullLayout,g=f._plots[c],n=[c].concat(g.overlays.map(function(a){return a.id})),o=n.map(function(b){return x.Axes.getFromId(a,b,"x")}),p=n.map(function(b){return x.Axes.getFromId(a,b,"y")}),q=b.hovermode||f.hovermode;if(-1===["x","y","closest"].indexOf(q)||!a.calcdata||a.querySelector(".zoombox")||a._dragging)return m(a,b);var r,s,t,u,v,y,A,C,D,E,F,G,H=[],I=[];if(Array.isArray(b))for(q="array",t=0;t<b.length;t++)v=a.calcdata[b[t].curveNumber||0],"none"!==v[0].trace.hoverinfo&&I.push(v);else{for(u=0;u<a.calcdata.length;u++)v=a.calcdata[u],y=v[0].trace,"none"!==y.hoverinfo&&-1!==n.indexOf(y.xaxis+y.yaxis)&&I.push(v);var J,K;if(b.target&&"clientX"in b&&"clientY"in b){if(z.triggerHandler(a,"plotly_beforehover",b)===!1)return;var L=b.target.getBoundingClientRect();if(J=b.clientX-L.left,K=b.clientY-L.top,0>J||J>L.width||0>K||K>L.height)return m(a,b)}else J="xpx"in b?b.xpx:o[0]._length/2,K="ypx"in b?b.ypx:p[0]._length/2;if(r="xval"in b?d(n,b.xval):e(o,J),s="yval"in b?d(n,b.yval):e(p,K),!w(r[0])||!w(s[0]))return console.log("Plotly.Fx.hover failed",b,a),m(a,b)}var M=1/0;for(u=0;u<I.length;u++)if(v=I[u],v&&v[0]&&v[0].trace&&v[0].trace.visible===!0){if(y=v[0].trace,A=n.indexOf(y.xaxis+y.yaxis),C=q,F={cd:v,trace:y,xa:o[A],ya:p[A],name:a.data.length>1||-1!==y.hoverinfo.indexOf("name")?y.name:void 0,index:!1,distance:Math.min(M,B.MAXDIST),color:x.Color.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},G=H.length,"array"===C){var N=b[u];"pointNumber"in N?(F.index=N.pointNumber,C="closest"):(C="","xval"in N&&(D=N.xval,C="x"),"yval"in N&&(E=N.yval,C=C?"closest":"y"))}else D=r[A],E=s[A];if(y._module&&y._module.hoverPoints){var O=y._module.hoverPoints(F,D,E,C);if(O)for(var P,Q=0;Q<O.length;Q++)P=O[Q],w(P.x0)&&w(P.y0)&&H.push(h(P,q))}else console.log("unrecognized trace type in hover",y);"closest"===q&&H.length>G&&(H.splice(0,G),M=H[0].distance)}if(0===H.length)return m(a,b);var R="y"===q&&I.length>1;H.sort(function(a,b){return a.distance-b.distance});var S={hovermode:q,rotateLabels:R,bgColor:x.Color.combine(f.plot_bgcolor,f.paper_bgcolor),container:f._hoverlayer,outerContainer:f._paperdiv},T=i(H,S);j(H,R?o[0]:p[0]),k(T,R);var U=a._hoverdata,V=[];for(t=0;t<H.length;t++){var W=H[t],X={data:W.trace._input,fullData:W.trace,curveNumber:W.trace.index,pointNumber:W.index,x:W.xVal,y:W.yVal,xaxis:W.xa,yaxis:W.ya};void 0!==W.zLabelVal&&(X.z=W.zLabelVal),V.push(X)}a._hoverdata=V,l(a,b,U)&&(U&&a.emit("plotly_unhover",{points:U}),a.emit("plotly_hover",{points:a._hoverdata,xaxes:o,yaxes:p,xvals:r,yvals:s}))}function h(a,b){a.posref="y"===b?(a.x0+a.x1)/2:(a.y0+a.y1)/2,a.x0=x.Lib.constrain(a.x0,0,a.xa._length),a.x1=x.Lib.constrain(a.x1,0,a.xa._length),a.y0=x.Lib.constrain(a.y0,0,a.ya._length),a.y1=x.Lib.constrain(a.y1,0,a.ya._length);var c;if(void 0!==a.xLabelVal){c="log"===a.xa.type&&a.xLabelVal<=0;var d=x.Axes.tickText(a.xa,a.xa.c2l(c?-a.xLabelVal:a.xLabelVal),"hover");c?0===a.xLabelVal?a.xLabel="0":a.xLabel="-"+d.text:a.xLabel=d.text,a.xVal=a.xa.c2d(a.xLabelVal)}if(void 0!==a.yLabelVal){c="log"===a.ya.type&&a.yLabelVal<=0;var e=x.Axes.tickText(a.ya,a.ya.c2l(c?-a.yLabelVal:a.yLabelVal),"hover");c?0===a.yLabelVal?a.yLabel="0":a.yLabel="-"+e.text:a.yLabel=e.text,a.yVal=a.ya.c2d(a.yLabelVal)}if(void 0!==a.zLabelVal&&(a.zLabel=String(a.zLabelVal)),void 0!==a.xerr){var f=x.Axes.tickText(a.xa,a.xa.c2l(a.xerr),"hover").text;void 0!==a.xerrneg?a.xLabel+=" +"+f+" / -"+x.Axes.tickText(a.xa,a.xa.c2l(a.xerrneg),"hover").text:a.xLabel+=" ± "+f,"x"===b&&(a.distance+=1)}if(void 0!==a.yerr){var g=x.Axes.tickText(a.ya,a.ya.c2l(a.yerr),"hover").text;void 0!==a.yerrneg?a.yLabel+=" +"+g+" / -"+x.Axes.tickText(a.ya,a.ya.c2l(a.yerrneg),"hover").text:a.yLabel+=" ± "+g,"y"===b&&(a.distance+=1)}var h=a.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(a.xLabel=void 0),-1===h.indexOf("y")&&(a.yLabel=void 0),-1===h.indexOf("z")&&(a.zLabel=void 0),-1===h.indexOf("text")&&(a.text=void 0),-1===h.indexOf("name")&&(a.name=void 0)),a}function i(a,b){var c,d,e=b.hovermode,f=b.rotateLabels,g=b.bgColor,h=b.container,i=b.outerContainer,j=a[0],k=j.xa,l=j.ya,m="y"===e?"yLabel":"xLabel",n=j[m],o=(String(n)||"").split(" ")[0],p=i.node().getBoundingClientRect(),q=p.top,r=p.width,s=p.height,t=j.distance<=B.MAXDIST&&("x"===e||"y"===e);for(c=0;c<a.length;c++){d=a[c].trace.hoverinfo;var w=d.split("+");if(-1===w.indexOf("all")&&-1===w.indexOf(e)){t=!1;break}}var y=h.selectAll("g.axistext").data(t?[0]:[]);y.enter().append("g").classed("axistext",!0),y.exit().remove(),y.each(function(){var b=u.select(this),c=b.selectAll("path").data([0]),d=b.selectAll("text").data([0]);c.enter().append("path").style({fill:x.Color.defaultLine,"stroke-width":"1px",stroke:x.Color.background}),d.enter().append("text").call(x.Drawing.font,L,K,x.Color.background).attr("data-notex",1),d.text(n).call(x.util.convertToTspans).call(x.Drawing.setPosition,0,0).selectAll("tspan.line").call(x.Drawing.setPosition,0,0),b.attr("transform","");var f=d.node().getBoundingClientRect();if("x"===e){d.attr("text-anchor","middle").call(x.Drawing.setPosition,0,"top"===k.side?q-f.bottom-I-J:q-f.top+I+J).selectAll("tspan.line").attr({x:d.attr("x"),y:d.attr("y")});var g="top"===k.side?"-":"";c.attr("d","M0,0L"+I+","+g+I+"H"+(J+f.width/2)+"v"+g+(2*J+f.height)+"H-"+(J+f.width/2)+"V"+g+I+"H-"+I+"Z"),b.attr("transform","translate("+(k._offset+(j.x0+j.x1)/2)+","+(l._offset+("top"===k.side?0:l._length))+")")}else{d.attr("text-anchor","right"===l.side?"start":"end").call(x.Drawing.setPosition,("right"===l.side?1:-1)*(J+I),q-f.top-f.height/2).selectAll("tspan.line").attr({x:d.attr("x"),y:d.attr("y")});var h="right"===l.side?"":"-";c.attr("d","M0,0L"+h+I+","+I+"V"+(J+f.height/2)+"h"+h+(2*J+f.width)+"V-"+(J+f.height/2)+"H"+h+I+"V-"+I+"Z"),b.attr("transform","translate("+(k._offset+("right"===l.side?k._length:0))+","+(l._offset+(j.y0+j.y1)/2)+")")}a=a.filter(function(a){return void 0!==a.zLabelVal||(a[m]||"").split(" ")[0]===o})});var z=h.selectAll("g.hovertext").data(a,function(a){return[a.trace.index,a.index,a.x0,a.y0,a.name,a.attr||""].join(",")});return z.enter().append("g").classed("hovertext",!0).each(function(){var a=u.select(this);a.append("rect").call(x.Color.fill,x.Color.addOpacity(g,.8)),a.append("text").classed("name",!0).call(x.Drawing.font,L,K),a.append("path").style("stroke-width","1px"),a.append("text").classed("nums",!0).call(x.Drawing.font,L,K)}),z.exit().remove(),z.each(function(a){var b=u.select(this).attr("transform",""),c="",d="",h=x.Color.opacity(a.color)?a.color:x.Color.defaultLine,i=x.Color.combine(h,g),j=v(i).getBrightness()>128?"#000":x.Color.background;if(a.name&&void 0===a.zLabelVal){var m=document.createElement("p");m.innerHTML=a.name,c=m.textContent||"",c.length>15&&(c=c.substr(0,12)+"...")}void 0!==a.zLabel?(void 0!==a.xLabel&&(d+="x: "+a.xLabel+"<br>"),void 0!==a.yLabel&&(d+="y: "+a.yLabel+"<br>"),d+=(d?"z: ":"")+a.zLabel):t&&a[e+"Label"]===n?d=a[("x"===e?"y":"x")+"Label"]||"":void 0===a.xLabel?void 0!==a.yLabel&&(d=a.yLabel):d=void 0===a.yLabel?a.xLabel:"("+a.xLabel+", "+a.yLabel+")",a.text&&!Array.isArray(a.text)&&(d+=(d?"<br>":"")+a.text),""===d&&(""===c&&b.remove(),d=c);var o=b.select("text.nums").style("fill",j).call(x.Drawing.setPosition,0,0).text(d).attr("data-notex",1).call(x.util.convertToTspans);o.selectAll("tspan.line").call(x.Drawing.setPosition,0,0);var p=b.select("text.name"),w=0;c&&c!==d?(p.style("fill",i).text(c).call(x.Drawing.setPosition,0,0).attr("data-notex",1).call(x.util.convertToTspans),p.selectAll("tspan.line").call(x.Drawing.setPosition,0,0),w=p.node().getBoundingClientRect().width+2*J):(p.remove(),b.select("rect").remove()),b.select("path").style({fill:i,stroke:j});var y,z,A=o.node().getBoundingClientRect(),B=k._offset+(a.x0+a.x1)/2,C=l._offset+(a.y0+a.y1)/2,E=Math.abs(a.x1-a.x0),F=Math.abs(a.y1-a.y0),G=A.width+I+J+w;a.ty0=q-A.top,a.bx=A.width+2*J,a.by=A.height+2*J,a.anchor="start",a.txwidth=A.width,a.tx2width=w,a.offset=0,f?(a.pos=B,y=s>=C+F/2+G,z=C-F/2-G>=0,"top"!==a.idealAlign&&y||!z?y?(C+=F/2,a.anchor="start"):a.anchor="middle":(C-=F/2,a.anchor="end")):(a.pos=C,y=r>=B+E/2+G,z=B-E/2-G>=0,"left"!==a.idealAlign&&y||!z?y?(B+=E/2,a.anchor="start"):a.anchor="middle":(B-=E/2,a.anchor="end")),o.attr("text-anchor",a.anchor),w&&p.attr("text-anchor",a.anchor),b.attr("transform","translate("+B+","+C+")"+(f?"rotate("+D+")":""))}),z}function j(a,b){function c(a){var b=a[0],c=a[a.length-1];if(e=l-b.pos-b.dp+b.size,f=c.pos+c.dp+c.size-m,e>.01){for(h=a.length-1;h>=0;h--)a[h].dp+=e;d=!1}if(!(.01>f)){if(-.01>e){for(h=a.length-1;h>=0;h--)a[h].dp-=f;d=!1}if(d){var j=0;for(g=0;g<a.length;g++)i=a[g],i.pos+i.dp+i.size>m&&j++;for(g=a.length-1;g>=0&&!(0>=j);g--)i=a[g],i.pos>m-1&&(i.del=!0,j--);for(g=0;g<a.length&&!(0>=j);g++)if(i=a[g],i.pos<l+1)for(i.del=!0,j--,f=2*i.size,h=a.length-1;h>=0;h--)a[h].dp-=f;for(g=a.length-1;g>=0&&!(0>=j);g--)i=a[g],i.pos+i.dp+i.size>m&&(i.del=!0,j--)}}}for(var d,e,f,g,h,i,j,k=0,l=b._offset,m=b._offset+b._length,n=a.map(function(a,c){return[{i:c,dp:0,pos:a.pos,posref:a.posref,size:a.by*("x"===b._id.charAt(0)?F:1)/2}]}).sort(function(a,b){return a[0].posref-b[0].posref});!d&&k<=a.length;){for(k++,d=!0,g=0;g<n.length-1;){var o=n[g],p=n[g+1],q=o[o.length-1],r=p[0];if(e=q.pos+q.dp+q.size-r.pos-r.dp+r.size,e>.01){for(h=p.length-1;h>=0;h--)p[h].dp+=e;for(o.push.apply(o,p),n.splice(g+1,1),j=0,h=o.length-1;h>=0;h--)j+=o[h].dp;for(f=j/o.length,h=o.length-1;h>=0;h--)o[h].dp-=f;d=!1}else g++}n.forEach(c)}for(g=n.length-1;g>=0;g--){var s=n[g];for(h=s.length-1;h>=0;h--){var t=s[h],u=a[t.i];u.offset=t.dp,u.del=t.del}}}function k(a,b){a.each(function(a){var c=u.select(this);if(a.del)return void c.remove();var d="end"===a.anchor?-1:1,e=c.select("text.nums"),f={start:1,end:-1,middle:0}[a.anchor],g=f*(I+J),h=g+f*(a.txwidth+J),i=0,j=a.offset;"middle"===a.anchor&&(g-=a.tx2width/2,h-=a.tx2width/2),b&&(j*=-H,i=a.offset*G),c.select("path").attr("d","middle"===a.anchor?"M-"+a.bx/2+",-"+a.by/2+"h"+a.bx+"v"+a.by+"h-"+a.bx+"Z":"M0,0L"+(d*I+i)+","+(I+j)+"v"+(a.by/2-I)+"h"+d*a.bx+"v-"+a.by+"H"+(d*I+i)+"V"+(j-I)+"Z"),e.call(x.Drawing.setPosition,g+i,j+a.ty0-a.by/2+J).selectAll("tspan.line").attr({x:e.attr("x"),y:e.attr("y")}),a.tx2width&&(c.select("text.name, text.name tspan.line").call(x.Drawing.setPosition,h+f*J+i,j+a.ty0-a.by/2+J),c.select("rect").call(x.Drawing.setRect,h+(f-1)*a.tx2width/2+i,j-a.by/2-1,a.tx2width,a.by+2))})}function l(a,b,c){if(!b.target)return!1;if(!c||c.length!==a._hoverdata.length)return!0;for(var d=c.length-1;d>=0;d--){var e=c[d],f=a._hoverdata[d];if(e.curveNumber!==f.curveNumber||String(e.pointNumber)!==String(f.pointNumber))return!0}return!1}function m(a,b){var c=a._fullLayout;b||(b={}),b.target&&z.triggerHandler(a,"plotly_beforehover",b)===!1||(c._hoverlayer.selectAll("g").remove(),b.target&&a._hoverdata&&a.emit("plotly_unhover",{points:a._hoverdata}),a._hoverdata=void 0)}function n(a,b){return a?"nsew"===a?"pan"===b?"move":"crosshair":a.toLowerCase()+"-resize":"pointer"}function o(a,b,c,d,e,f,g,h){function i(a,b){for(F=0;F<a.length;F++)if(!a[F].fixedrange)return b;return""}function j(a){a[0]=Number(a[0]),a[1]=Number(a[1])}function k(c,d,e){var f=X.getBoundingClientRect();for(Z=d-f.left,$=e-f.top,_={l:Z,r:Z,w:0,t:$,b:$,h:0},aa=a._hmpixcount?a._hmlumcount/a._hmpixcount:v(a._fullLayout.plot_bgcolor).getLuminance(),ba=ba="M0,0H"+N+"V"+O+"H0V0",ca=!1,da="xy",ea=b.plot.append("path").attr("class","zoombox").style({fill:aa>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ba+"Z"),fa=b.plot.append("path").attr("class","zoombox-corners").style({fill:x.Color.background,stroke:x.Color.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),l(),F=0;F<R.length;F++)j(R[F].range)}function l(){b.plot.selectAll(".select-outline").remove()}function m(a,b){var c=Math.max(0,Math.min(N,a+Z)),d=Math.max(0,Math.min(O,b+$)),e=Math.abs(c-Z),f=Math.abs(d-$),g=Math.floor(Math.min(f,e,Q)/2);_.l=Math.min(Z,c),_.r=Math.max(Z,c),_.t=Math.min($,d),_.b=Math.max($,d),!T||f<Math.min(Math.max(.6*e,P),Q)?P>e?(da="",_.r=_.l,_.t=_.b,fa.attr("d","M0,0Z")):(_.t=0,_.b=O,da="x",fa.attr("d","M"+(_.l-.5)+","+($-Q-.5)+"h-3v"+(2*Q+1)+"h3ZM"+(_.r+.5)+","+($-Q-.5)+"h3v"+(2*Q+1)+"h-3Z")):!S||e<Math.min(.6*f,Q)?(_.l=0,_.r=N,da="y",fa.attr("d","M"+(Z-Q-.5)+","+(_.t-.5)+"v-3h"+(2*Q+1)+"v3ZM"+(Z-Q-.5)+","+(_.b+.5)+"v3h"+(2*Q+1)+"v-3Z")):(da="xy",fa.attr("d","M"+(_.l-3.5)+","+(_.t-.5+g)+"h3v"+-g+"h"+g+"v-3h-"+(g+3)+"ZM"+(_.r+3.5)+","+(_.t-.5+g)+"h-3v"+-g+"h"+-g+"v-3h"+(g+3)+"ZM"+(_.r+3.5)+","+(_.b+.5-g)+"h-3v"+g+"h"+-g+"v3h"+(g+3)+"ZM"+(_.l-3.5)+","+(_.b+.5-g)+"h3v"+g+"h"+g+"v3h-"+(g+3)+"Z")),_.w=_.r-_.l,_.h=_.b-_.t,ea.attr("d",ba+"M"+_.l+","+_.t+"v"+_.h+"h"+_.w+"v-"+_.h+"h-"+_.w+"Z"),ca||(ea.transition().style("fill",aa>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),fa.transition().style("opacity",1).duration(200),ca=!0)}function o(a,b,c){var d,e,f;for(d=0;d<a.length;d++)e=a[d],e.fixedrange||(f=e.range,e.range=[f[0]+(f[1]-f[0])*b,f[0]+(f[1]-f[0])*c])}function r(b,c){return Math.min(_.h,_.w)<2*P?(2===c?z():q(a),s(a)):("xy"!==da&&"x"!==da||o(K,_.l/N,_.r/N),"xy"!==da&&"y"!==da||o(L,(O-_.b)/O,(O-_.t)/O),s(a),D(da),void(M&&a.data&&a._context.showTips&&(x.Lib.notifier("Double-click to<br>zoom back out","long"),M=!1)))}function t(b,c){var d=1===(g+h).length;if(b)D();else if(2!==c||d)if(1===c&&d){var e=g?L[0]:K[0],f="s"===g||"w"===h?0:1,i=e._name+".range["+f+"]",j=p(e,f),k="left",l="middle";if(e.fixedrange)return;g?(l="n"===g?"top":"bottom","right"===e.side&&(k="right")):"e"===h&&(k="right"),W.call(x.util.makeEditable,null,{immediate:!0,background:I.paper_bgcolor,text:String(j),fill:e.tickfont?e.tickfont.color:"#444",horizontalAlign:k,verticalAlign:l}).on("edit",function(b){var c="category"===e.type?e.c2l(b):e.d2l(b);void 0!==c&&x.relayout(a,i,c)})}else q(a);else z()}function u(b){function c(a,b,c){if(!a.fixedrange){j(a.range);var d=a.range,e=d[0]+(d[1]-d[0])*b;a.range=[e+(d[0]-e)*c,e+(d[1]-e)*c]}}if(a._context.scrollZoom||I._enablescrollzoom){var d=a.querySelector(".plotly");if(!(d.scrollHeight-d.clientHeight>10||d.scrollWidth-d.clientWidth>10)){clearTimeout(ha);var e=-b.deltaY;if(isFinite(e)||(e=b.wheelDelta/10),!isFinite(e))return void console.log("did not find wheel motion attributes",b);var f,i=Math.exp(-Math.min(Math.max(e,-20),20)/100),k=ja.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(b.clientX-k.left)/k.width,m=ga[0]+ga[2]*l,n=(k.bottom-b.clientY)/k.height,o=ga[1]+ga[3]*(1-n);if(h){for(f=0;f<K.length;f++)c(K[f],l,i);ga[2]*=i,ga[0]=m-ga[2]*l}if(g){for(f=0;f<L.length;f++)c(L[f],n,i);ga[3]*=i,ga[1]=o-ga[3]*(1-n)}return E(ga),y(g,h),ha=setTimeout(function(){ga=[0,0,N,O],D()},ia),x.Lib.pauseEvent(b)}}}function w(a,b){function c(a,b){for(var c=0;c<a.length;c++){var d=a[c];d.fixedrange||(d.range=[d._r[0]-b/d._m,d._r[1]-b/d._m])}}function d(a){return 1-(a>=0?Math.min(a,.9):1/(1/Math.max(a,-.3)+3.222))}function e(a,b,c){for(var e=1-b,f=0,g=0;g<a.length;g++){var h=a[g];h.fixedrange||(f=g,h.range[b]=h._r[e]+(h._r[b]-h._r[e])/d(c/h._length))}return a[f]._length*(a[f]._r[b]-a[f].range[b])/(a[f]._r[b]-a[f]._r[e])}return"ew"===S||"ns"===T?(S&&c(K,a),T&&c(L,b),E([S?-a:0,T?-b:0,N,O]),void y(T,S)):("w"===S?a=e(K,0,a):"e"===S?a=e(K,1,-a):S||(a=0),"n"===T?b=e(L,1,b):"s"===T?b=e(L,0,-b):T||(b=0),E(["w"===S?a:0,"n"===T?b:0,N-a,O-b]),void y(T,S))}function y(b,c){function d(a){for(f=0;f<a.length;f++)a[f].fixedrange||g.push(a[f]._id)}function e(d,e){var h;for(f=0;f<d.length;f++)h=d[f],(c&&-1!==g.indexOf(h.xref)||b&&-1!==g.indexOf(h.yref))&&e.draw(a,f)}var f,g=[];for(c&&d(K),b&&d(L),f=0;f<g.length;f++)x.Axes.doTicks(a,g[f],!0);e(I.annotations||[],x.Annotations),e(I.shapes||[],x.Shapes)}function z(){var b,c,d=a._context.doubleClick,e=(S?K:[]).concat(T?L:[]),f={};if("autosize"===d)for(c=0;c<e.length;c++)b=e[c],b.fixedrange||(f[b._name+".autorange"]=!0);else if("reset"===d)for(c=0;c<e.length;c++)b=e[c],b._rangeInitial?f[b._name+".range"]=b._rangeInitial.slice():f[b._name+".autorange"]=!0;else if("reset+autosize"===d)for(c=0;c<e.length;c++)b=e[c],b.fixedrange||(void 0===b._rangeInitial||b.range[0]===b._rangeInitial[0]&&b.range[1]===b._rangeInitial[1]?f[b._name+".autorange"]=!0:f[b._name+".range"]=b._rangeInitial.slice());a.emit("plotly_doubleclick",null),x.relayout(a,f)}function D(b){for(var c={},d=0;d<R.length;d++){var e=R[d];b&&-1===b.indexOf(e._id.charAt(0))||(e._r[0]!==e.range[0]&&(c[e._name+".range[0]"]=e.range[0]),e._r[1]!==e.range[1]&&(c[e._name+".range[1]"]=e.range[1]),e.range=e._r.slice())}E([0,0,N,O]),x.relayout(a,c)}function E(a){var b,c,d,e,f,i,j=I._plots,k=Object.keys(j);for(b=0;b<k.length;b++)if(c=j[k[b]],d=c.x(),e=c.y(),f=h&&-1!==K.indexOf(d)&&!d.fixedrange, 51 i=g&&-1!==L.indexOf(e)&&!e.fixedrange,f||i){var l=[0,0,d._length,e._length];f&&(l[0]=a[0],l[2]=a[2]),i&&(l[1]=a[1],l[3]=a[3]),c.plot.attr("viewBox",l.join(" "))}}var F,G,H,I=a._fullLayout,J=[b].concat(g&&h?b.overlays:[]),K=[b.x()],L=[b.y()],N=K[0]._length,O=L[0]._length,P=B.MINDRAG,Q=B.MINZOOM;for(F=1;F<J.length;F++)G=J[F].x(),H=J[F].y(),-1===K.indexOf(G)&&K.push(G),-1===L.indexOf(H)&&L.push(H);var R=K.concat(L),S=i(K,h),T=i(L,g),U=n(T+S,I.dragmode),V=g+h+"drag",W=b.draglayer.selectAll("."+V).data([0]);W.enter().append("rect").classed("drag",!0).classed(V,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",b.id),W.call(x.Drawing.setRect,c,d,e,f).call(C.setCursor,U);var X=W.node();if(!T&&!S)return X.onmousedown=null,X.style.pointerEvents=g+h==="nsew"?"all":"none",X;var Y={element:X,gd:a,plotinfo:b,xaxes:K,yaxes:L,doubleclick:z,prepFn:function(b,c,d){var e=a._fullLayout.dragmode;g+h==="nsew"?b.shiftKey&&(e="pan"===e?"zoom":"pan"):e="pan","lasso"===e?Y.minDrag=1:Y.minDrag=void 0,"zoom"===e?(Y.moveFn=m,Y.doneFn=r,k(b,c,d)):"pan"===e?(Y.moveFn=w,Y.doneFn=t,l()):"select"!==e&&"lasso"!==e||A(b,c,d,Y,e)}};C.dragElement(Y);var Z,$,_,aa,ba,ca,da,ea,fa,ga=[0,0,N,O],ha=null,ia=300,ja=b.mainplot?I._plots[b.mainplot]:b;return g.length*h.length!==1&&(void 0!==X.onwheel?X.onwheel=u:void 0!==X.onmousewheel&&(X.onmousewheel=u)),X}function p(a,b){var c,d=a.range[b],e=Math.abs(d-a.range[1-b]);return"date"===a.type?x.Lib.ms2DateTime(d,e):"log"===a.type?(c=Math.ceil(Math.max(0,-Math.log(e)/Math.LN10))+3,u.format("."+c+"g")(Math.pow(10,d))):(c=Math.floor(Math.log(Math.abs(d))/Math.LN10)-Math.floor(Math.log(e)/Math.LN10)+4,u.format("."+String(c)+"g")(d))}function q(a){a._dragging=!0;var b=a._replotPending;a._replotPending=!1,setTimeout(function(){a._replotPending=b,r(a)},B.DBLCLICKDELAY)}function r(a){a._dragging=!1,a._replotPending&&x.plot(a)}function s(a){u.select(a).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function t(){var a=document.createElement("div");a.className="dragcover";var b=a.style;return b.position="fixed",b.left=0,b.right=0,b.top=0,b.bottom=0,b.zIndex=999999999,b.background="none",document.body.appendChild(a),a}var u=a("d3"),v=a("tinycolor2"),w=a("fast-isnumeric"),x=a("../../plotly"),y=a("../../lib"),z=a("../../lib/events"),A=a("./select"),B=a("./constants"),C=b.exports={};C.layoutAttributes={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]}},C.supplyLayoutDefaults=function(a,b,c){function d(c,d){return y.coerce(a,b,C.layoutAttributes,c,d)}d("dragmode");var e;if(b._hasCartesian){var f=b._isHoriz=C.isHoriz(c);e=f?"y":"x"}else e="closest";d("hovermode",e)},C.isHoriz=function(a){for(var b=!0,c=0;c<a.length;c++){var d=a[c];if("h"!==d.orientation){b=!1;break}}return b},C.init=function(a){var b=a._fullLayout;if(b._hasCartesian&&!a._context.staticPlot){var c=Object.keys(b._plots||{}).sort(function(a,c){if((b._plots[a].mainplot&&!0)===(b._plots[c].mainplot&&!0)){var d=a.split("y"),e=c.split("y");return d[0]===e[0]?Number(d[1]||1)-Number(e[1]||1):Number(d[0]||1)-Number(e[0]||1)}return b._plots[a].mainplot?1:-1});c.forEach(function(c){var d=b._plots[c];if(b._hasCartesian){var e=d.x(),f=d.y(),g=(e._linepositions[c]||[])[3],h=(f._linepositions[c]||[])[3],i=B.DRAGGERSIZE;if(w(g)&&"top"===e.side&&(g-=i),w(h)&&"right"!==f.side&&(h-=i),!d.mainplot){var j=o(a,d,0,0,e._length,f._length,"ns","ew");j.onmousemove=function(d){C.hover(a,d,c),b._lasthover=j,b._hoversubplot=c},j.onmouseout=function(b){a._dragging||C.unhover(a,b)},j.onclick=function(b){C.click(a,b)},o(a,d,-i,-i,i,i,"n","w"),o(a,d,e._length,-i,i,i,"n","e"),o(a,d,-i,f._length,i,i,"s","w"),o(a,d,e._length,f._length,i,i,"s","e")}w(g)&&("free"===e.anchor&&(g-=b._size.h*(1-f.domain[1])),o(a,d,.1*e._length,g,.8*e._length,i,"","ew"),o(a,d,0,g,.1*e._length,i,"","w"),o(a,d,.9*e._length,g,.1*e._length,i,"","e")),w(h)&&("free"===f.anchor&&(h-=b._size.w*e.domain[0]),o(a,d,h,.1*f._length,i,.8*f._length,"ns",""),o(a,d,h,.9*f._length,i,.1*f._length,"s",""),o(a,d,h,0,i,.1*f._length,"n",""))}});var d=b._hoverlayer.node();d.onmousemove=function(c){c.target=b._lasthover,C.hover(a,c,b._hoversubplot)},d.onclick=function(c){c.target=b._lasthover,C.click(a,c)},d.onmousedown=function(a){b._lasthover.onmousedown(a)}}};var D=B.YANGLE,E=Math.PI*D/180,F=1/Math.sin(E),G=Math.cos(E),H=Math.sin(E),I=B.HOVERARROWSIZE,J=B.HOVERTEXTPAD,K=B.HOVERFONTSIZE,L=B.HOVERFONT;C.hover=function(a,b,c){return"string"==typeof a&&(a=document.getElementById(a)),void 0===a._lastHoverTime&&(a._lastHoverTime=0),void 0!==a._hoverTimer&&(clearTimeout(a._hoverTimer),a._hoverTimer=void 0),Date.now()>a._lastHoverTime+B.HOVERMINTIME?(g(a,b,c),void(a._lastHoverTime=Date.now())):void(a._hoverTimer=setTimeout(function(){g(a,b,c),a._lastHoverTime=Date.now(),a._hoverTimer=void 0},B.HOVERMINTIME))},C.unhover=function(a,b,c){"string"==typeof a&&(a=document.getElementById(a)),a._hoverTimer&&(clearTimeout(a._hoverTimer),a._hoverTimer=void 0),m(a,b,c)},C.getDistanceFunction=function(a,b,c,d){return"closest"===a?d||f(b,c):"x"===a?b:c},C.getClosest=function(a,b,c){if(c.index!==!1)c.index>=0&&c.index<a.length?c.distance=0:c.index=!1;else for(var d=0;d<a.length;d++){var e=b(a[d]);e<c.distance&&(c.index=d,c.distance=e)}return c},C.loneHover=function(a,b){var c={color:a.color||x.Color.defaultLine,x0:a.x0||a.x||0,x1:a.x1||a.x||0,y0:a.y0||a.y||0,y1:a.y1||a.y||0,xLabel:a.xLabel,yLabel:a.yLabel,zLabel:a.zLabel,text:a.text,name:a.name,idealAlign:a.idealAlign,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},d=u.select(b.container),e=b.outerContainer?u.select(b.outerContainer):d,f={hovermode:"closest",rotateLabels:!1,bgColor:b.bgColor||x.Color.background,container:d,outerContainer:e},g=i([c],f);return k(g,f.rotateLabels),g.node()},C.loneUnhover=function(a){var b=a instanceof u.selection?a:u.select(a);b.selectAll("g.hovertext").remove()},C.click=function(a,b){a._hoverdata&&b&&b.target&&(a.emit("plotly_click",{points:a._hoverdata}),b.stopImmediatePropagation&&b.stopImmediatePropagation())};var M=!0;C.dragAlign=function(a,b,c,d,e){var f=(a-c)/(d-c),g=f+b/(d-c),h=(f+g)/2;return"left"===e||"bottom"===e?f:"center"===e||"middle"===e?h:"right"===e||"top"===e?g:2/3-h>f?f:g>4/3-h?g:h};var N=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];C.dragCursors=function(a,b,c,d){return a="left"===c?0:"center"===c?1:"right"===c?2:x.Lib.constrain(Math.floor(3*a),0,2),b="bottom"===d?0:"middle"===d?1:"top"===d?2:x.Lib.constrain(Math.floor(3*b),0,2),N[b][a]},C.dragElement=function(a){function b(b){var m=document.querySelector(".plugin-editable");return m&&u.select(m).on("blur").call(m),j._dragged=!1,j._dragging=!0,e=b.clientX,f=b.clientY,i=b.target,g=(new Date).getTime(),g-j._mouseDownTime<l?k+=1:(k=1,j._mouseDownTime=g),a.prepFn&&a.prepFn(b,e,f),h=t(),h.onmousemove=c,h.onmouseup=d,h.onmouseout=d,h.style.cursor=window.getComputedStyle(a.element).cursor,x.Lib.pauseEvent(b)}function c(b){var c=b.clientX-e,d=b.clientY-f,g=a.minDrag||B.MINDRAG;return Math.abs(c)<g&&(c=0),Math.abs(d)<g&&(d=0),(c||d)&&(j._dragged=!0,C.unhover(j)),a.moveFn&&a.moveFn(c,d,j._dragged),x.Lib.pauseEvent(b)}function d(b){if(h.onmousemove=null,h.onmouseup=null,h.onmouseout=null,x.Lib.removeElement(h),!j._dragging)return void(j._dragged=!1);if(j._dragging=!1,(new Date).getTime()-j._mouseDownTime>l&&(k=Math.max(k-1,1)),a.doneFn&&a.doneFn(j._dragged,k),!j._dragged){var c=document.createEvent("MouseEvents");c.initEvent("click",!0,!0),i.dispatchEvent(c)}return r(j),j._dragged=!1,x.Lib.pauseEvent(b)}var e,f,g,h,i,j=x.Lib.getPlotDiv(a.element)||{},k=1,l=B.DBLCLICKDELAY;j._mouseDownTime||(j._mouseDownTime=0),a.element.onmousedown=b,a.element.style.pointerEvents="all"},C.setCursor=function(a,b){(a.attr("class")||"").split(" ").forEach(function(b){0===b.indexOf("cursor-")&&a.classed(b,!1)}),b&&a.classed("cursor-"+b,!0)},C.inbox=function(a,b){return 0>a*b||0===a?B.MAXDIST*(.6-.3/Math.max(3,Math.abs(a-b))):1/0}},{"../../lib":349,"../../lib/events":344,"../../plotly":366,"./constants":373,"./select":379,d3:70,"fast-isnumeric":74,tinycolor2:229}],375:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../plots"),f=a("../../components/errorbars");c.name="cartesian",c.attr=["xaxis","yaxis"],c.idRoot=["x","y"],c.attributes=a("./attributes"),c.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},c.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},c.plot=function(a){function b(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],f=e[0].trace;f.xaxis+f.yaxis===b&&c.push(e)}return c}function c(a,b){for(var c=[],d=0;d<a.length;d++){var e=a[d],f=e[0].trace;f._module===b&&f.visible===!0&&c.push(e)}return c}for(var g=a._fullLayout,h=e.getSubplotIds(g,"cartesian"),i=a.calcdata,j=a._modules,k=0;k<h.length;k++){var l=h[k],m=g._plots[l],n=b(i,l),o=[];m.plot&&m.plot.selectAll("g.trace").remove();for(var p=0;p<j.length;p++){var q=j[p];if("cartesian"===q.basePlotModule.name&&"pie"!==q.name){var r=c(n,q);q.plot(a,m,r),d.markTime("done "+(r[0]&&r[0][0].trace.type)),r[0]&&r[0][0].trace&&e.traceIs(r[0][0].trace,"errorBarsOK")&&(o=o.concat(r))}}f.plot(a,m,o),d.markTime("done ErrorBars")}if(g._hasPie){var s=e.getModule("pie"),t=c(i,s);t.length&&s.plot(a,t)}},c.clean=function(a,b,c,d){d._hasPie&&!b._hasPie&&d._pielayer.selectAll("g.trace").remove()}},{"../../components/errorbars":323,"../../lib":349,"../plots":413,"./attributes":368}],376:[function(a,b,c){"use strict";var d=a("./index"),e=a("../font_attributes"),f=a("../../components/color/attributes"),g=a("../../lib/extend").extendFlat;b.exports={title:{valType:"string"},titlefont:g({},e,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},fixedrange:{valType:"boolean",dflt:!1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"number",dflt:0},dtick:{valType:"any",dflt:1},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:f.defaultLine},showticklabels:{valType:"boolean",dflt:!0},tickfont:g({},e,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:f.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:f.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:f.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",d.idRegex.x.toString(),d.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",d.idRegex.x.toString(),d.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":298,"../../lib/extend":345,"../font_attributes":383,"./index":375}],377:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../plots"),f=a("./constants"),g=a("./layout_attributes"),h=a("./axis_defaults"),i=a("./position_defaults"),j=a("./axis_ids");b.exports=function(a,b,c){function k(a,b){var c=Number(a.substr(5)||1),d=Number(b.substr(5)||1);return c-d}var l,m=Object.keys(a),n=[],o=[],p=[],q=[],r={},s={};for(l=0;l<c.length;l++){var t,u,v=c[l];if(e.traceIs(v,"cartesian"))t=n,u=o;else{if(!e.traceIs(v,"gl2d"))continue;t=p,u=q}var w=j.id2name(v.xaxis),x=j.id2name(v.yaxis);if(w&&-1===t.indexOf(w)&&t.push(w),x&&-1===u.indexOf(x)&&u.push(x),e.traceIs(v,"2dMap")&&(r[w]=!0,r[x]=!0),e.traceIs(v,"oriented")){var y="h"===v.orientation?x:w;s[y]=!0}}var z=b._hasGL3D||b._hasGeo;if(!z)for(l=0;l<m.length;l++){var A=m[l];-1===p.indexOf(A)&&-1===n.indexOf(A)&&f.xAxisMatch.test(A)?n.push(A):-1===q.indexOf(A)&&-1===o.indexOf(A)&&f.yAxisMatch.test(A)&&o.push(A)}n.length&&o.length&&(b._hasCartesian=!0);var B=n.concat(p).sort(k),C=o.concat(q).sort(k);B.concat(C).forEach(function(e){function f(a,b){return d.coerce(l,m,g,a,b)}var k=e.charAt(0),l=a[e]||{},m={},n={letter:k,font:b.font,outerTicks:r[e],showGrid:!s[e],name:e,data:c},o={letter:k,counterAxes:{x:C,y:B}[k].map(j.name2id),overlayableAxes:{x:B,y:C}[k].filter(function(b){return b!==e&&!(a[b]||{}).overlaying}).map(j.name2id)};h(l,m,f,n),i(l,m,f,o),b[e]=m,a[e]||"-"===l.type||(a[e]={type:l.type})}),B.length&&C.length&&d.coerce(a,b,e.layoutAttributes,"plot_bgcolor")}},{"../../lib":349,"../plots":413,"./axis_defaults":370,"./axis_ids":371,"./constants":373,"./layout_attributes":376,"./position_defaults":378}],378:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib");b.exports=function(a,b,c,f){var g=f.counterAxes||[],h=f.overlayableAxes||[],i=f.letter,j=e.coerce(a,b,{anchor:{valType:"enumerated",values:["free"].concat(g),dflt:d(a.position)?"free":g[0]||"free"}},"anchor");"free"===j&&c("position"),e.coerce(a,b,{side:{valType:"enumerated",values:"x"===i?["bottom","top"]:["left","right"],dflt:"x"===i?"bottom":"left"}},"side");var k=!1;if(h.length&&(k=e.coerce(a,b,{overlaying:{valType:"enumerated",values:[!1].concat(h),dflt:!1}},"overlaying")),!k){var l=c("domain");l[0]>l[1]-.01&&(b.domain=[0,1]),e.noneOrAll(a.domain,b.domain,[0,1])}return b}},{"../../lib":349,"fast-isnumeric":74}],379:[function(a,b,c){"use strict";function d(a){return a._id}var e=a("../../lib/polygon"),f=a("../../components/color"),g=a("./axes"),h=a("./constants"),i=e.filter,j=e.tester,k=h.MINSELECT;b.exports=function(a,b,c,e,l){function m(a){var b="y"===a._id.charAt(0)?1:0;return function(c){return a.p2d(c[b])}}function n(a,b){return a-b}var o,p=e.plotinfo.plot,q=e.element.getBoundingClientRect(),r=b-q.left,s=c-q.top,t=r,u=s,v="M"+r+","+s,w=e.xaxes[0]._length,x=e.yaxes[0]._length,y=e.xaxes.map(d),z=e.yaxes.map(d),A=e.xaxes.concat(e.yaxes);"lasso"===l&&(o=i([[r,s]],h.BENDPX));var B=p.selectAll("path.select-outline").data([1,2]);B.enter().append("path").attr("class",function(a){return"select-outline select-outline-"+a}).attr("d",v+"Z");var C,D,E,F,G,H=p.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1}).attr("d","M0,0Z"),I=[],J=e.gd,K=[];for(C=0;C<J.calcdata.length;C++)D=J.calcdata[C],E=D[0].trace,E._module&&E._module.selectPoints&&-1!==y.indexOf(E.xaxis)&&-1!==z.indexOf(E.yaxis)&&I.push({selectPoints:E._module.selectPoints,cd:D,xaxis:g.getFromId(J,E.xaxis),yaxis:g.getFromId(J,E.yaxis)});e.moveFn=function(a,b){var c,d;t=Math.max(0,Math.min(w,a+r)),u=Math.max(0,Math.min(x,b+s));var f=Math.abs(t-r),g=Math.abs(u-s);for("select"===l?(g<Math.min(.6*f,k)?(c=j([[r,0],[r,x],[t,x],[t,0]]),H.attr("d","M"+c.xmin+","+(s-k)+"h-4v"+2*k+"h4ZM"+(c.xmax-1)+","+(s-k)+"h4v"+2*k+"h-4Z")):f<Math.min(.6*g,k)?(c=j([[0,s],[0,u],[w,u],[w,s]]),H.attr("d","M"+(r-k)+","+c.ymin+"v-4h"+2*k+"v4ZM"+(r-k)+","+(c.ymax-1)+"v4h"+2*k+"v-4Z")):(c=j([[r,s],[r,u],[t,u],[t,s]]),H.attr("d","M0,0Z")),B.attr("d","M"+c.xmin+","+c.ymin+"H"+(c.xmax-1)+"V"+(c.ymax-1)+"H"+c.xmin+"Z")):"lasso"===l&&(o.addPt([t,u]),c=j(o.filtered),B.attr("d","M"+o.filtered.join("L")+"Z")),K=[],C=0;C<I.length;C++)F=I[C],[].push.apply(K,F.selectPoints(F,c));if(G={points:K},"select"===l){var h,i=G.range={};for(C=0;C<A.length;C++)d=A[C],h=d._id.charAt(0),i[d._id]=[d.p2d(c[h+"min"]),d.p2d(c[h+"max"])].sort(n)}else{var p=G.lassoPoints={};for(C=0;C<A.length;C++)d=A[C],p[d._id]=o.filtered.map(m(d))}e.gd.emit("plotly_selecting",G)},e.doneFn=function(a,b){if(a||2!==b)e.gd.emit("plotly_selected",G);else{for(B.remove(),C=0;C<I.length;C++)F=I[C],F.selectPoints(F,!1);J.emit("plotly_deselect",null)}H.remove()}}},{"../../components/color":299,"../../lib/polygon":354,"./axes":369,"./constants":373}],380:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("./constants"),h=a("./clean_datum"),i=a("./axis_ids");b.exports=function(a){function b(b,c){if(b>0)return Math.log(b)/Math.LN10;if(0>=b&&c&&a.range&&2===a.range.length){var d=a.range[0],e=a.range[1];return.5*(d+e-3*k*Math.abs(d-e))}return g.BADNUM}function c(a){return Math.pow(10,a)}function j(a){return e(a)?Number(a):g.BADNUM}var k=10;if(a.c2l="log"===a.type?b:j,a.l2c="log"===a.type?c:j,a.l2d=function(b){return a.c2d(a.l2c(b))},a.p2d=function(b){return a.l2d(a.p2l(b))},a.setScale=function(){var b,c=a._td._fullLayout._size;if(a._categories||(a._categories=[]),a.overlaying){var d=i.getFromId(a._td,a.overlaying);a.domain=d.domain}for(a.range&&2===a.range.length&&a.range[0]!==a.range[1]||(a.range=[-1,1]),b=0;2>b;b++)e(a.range[b])||(a.range[b]=e(a.range[1-b])?a.range[1-b]*(b?10:.1):b?1:-1),a.range[b]<-(Number.MAX_VALUE/2)?a.range[b]=-(Number.MAX_VALUE/2):a.range[b]>Number.MAX_VALUE/2&&(a.range[b]=Number.MAX_VALUE/2);if("y"===a._id.charAt(0)?(a._offset=c.t+(1-a.domain[1])*c.h,a._length=c.h*(a.domain[1]-a.domain[0]),a._m=a._length/(a.range[0]-a.range[1]),a._b=-a._m*a.range[1]):(a._offset=c.l+a.domain[0]*c.w,a._length=c.w*(a.domain[1]-a.domain[0]),a._m=a._length/(a.range[1]-a.range[0]),a._b=-a._m*a.range[0]),!isFinite(a._m)||!isFinite(a._b))throw f.notifier("Something went wrong with axis scaling","long"),a._td._replotting=!1,new Error("axis scaling")},a.l2p=function(b){return e(b)?d.round(f.constrain(a._b+a._m*b,-k*a._length,(1+k)*a._length),2):g.BADNUM},a.p2l=function(b){return(b-a._b)/a._m},a.c2p=function(b,c){return a.l2p(a.c2l(b,c))},a.p2c=function(b){return a.l2c(a.p2l(b))},-1!==["linear","log","-"].indexOf(a.type))a.c2d=j,a.d2c=function(a){return a=h(a),e(a)?Number(a):g.BADNUM},a.d2l=function(b,c){return"log"===a.type?a.c2l(a.d2c(b),c):a.d2c(b)};else if("date"===a.type){if(a.c2d=function(a){return e(a)?f.ms2DateTime(a):g.BADNUM},a.d2c=function(a){return e(a)?Number(a):f.dateTime2ms(a)},a.d2l=a.d2c,a.range&&a.range.length>1)try{var l=a.range.map(f.dateTime2ms);!e(a.range[0])&&e(l[0])&&(a.range[0]=l[0]),!e(a.range[1])&&e(l[1])&&(a.range[1]=l[1])}catch(m){console.log(m,a.range)}}else"category"===a.type&&(a.c2d=function(b){return a._categories[Math.round(b)]},a.d2c=function(b){null!==b&&void 0!==b&&-1===a._categories.indexOf(b)&&a._categories.push(b);var c=a._categories.indexOf(b);return-1===c?g.BADNUM:c},a.d2l=a.d2c);a.makeCalcdata=function(b,c){var d,e,f;if(c in b)for(d=b[c],e=new Array(d.length),f=0;f<d.length;f++)e[f]=a.d2c(d[f]);else{var g=c+"0"in b?a.d2c(b[c+"0"]):0,h=b["d"+c]?Number(b["d"+c]):1;for(d=b[{x:"y",y:"x"}[c]],e=new Array(d.length),f=0;f<d.length;f++)e[f]=g+f*h}return e},a._min=[],a._max=[],a._minDtick=null,a._forceTick0=null}},{"../../lib":349,"./axis_ids":371,"./clean_datum":372,"./constants":373,d3:70,"fast-isnumeric":74}],381:[function(a,b,c){"use strict";function d(a){var b=["showexponent","showtickprefix","showticksuffix"],c=b.filter(function(b){return void 0!==a[b]}),d=function(b){return a[b]===a[c[0]]};return c.every(d)||1===c.length?a[c[0]]:void 0}var e=a("../../lib"),f=a("./layout_attributes");b.exports=function(a,b,c,g,h){var i=e.coerce2(a,b,f,"ticklen"),j=e.coerce2(a,b,f,"tickwidth"),k=e.coerce2(a,b,f,"tickcolor"),l=c("ticks",h.outerTicks||i||j||k?"outside":"");l||(delete b.ticklen,delete b.tickwidth,delete b.tickcolor);var m=d(a),n=c("tickprefix");n&&c("showtickprefix",m);var o=c("ticksuffix");o&&c("showticksuffix",m);var p=c("showticklabels");if(p&&(e.coerceFont(c,"tickfont",h.font||{}),c("tickangle"),"category"!==g)){var q=c("tickformat");q||"date"===g||(c("showexponent",m),c("exponentformat"))}"category"===g||h.noHover||c("hoverformat")}},{"../../lib":349,"./layout_attributes":376}],382:[function(a,b,c){"use strict";var d=a("fast-isnumeric");b.exports=function(a,b,c,e){var f="auto";"array"!==a.tickmode||"log"!==e&&"date"!==e||(a.tickmode="auto"),Array.isArray(a.tickvals)?f="array":a.dtick&&d(a.dtick)&&(f="linear");var g=c("tickmode",f);if("auto"===g)c("nticks");else if("linear"===g)c("tick0"),c("dtick");else{var h=c("tickvals");void 0===h?b.tickmode="auto":c("ticktext")}}},{"fast-isnumeric":74}],383:[function(a,b,c){"use strict";b.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],384:[function(a,b,c){"use strict";function d(a,b){this.id=a.id,this.graphDiv=a.graphDiv,this.container=a.container,this.topojsonURL=a.topojsonURL,o(),this.hoverContainer=null,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework(),this.updateFx(b.hovermode),this.traceHash={}}function e(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];d.visible===!0&&b.push(d)}return b}function f(a,b,c){return k.geo.graticule().extent([[a[0],b[0]],[a[1],b[1]]]).step(c)}function g(a,b,c){var d=t.layerNameToAdjective[b];a.select("."+b).selectAll("path").attr("stroke","none").call(l.fill,c[d+"color"])}function h(a,b,c){var d=t.layerNameToAdjective[b];a.select("."+b).selectAll("path").attr("fill","none").call(l.stroke,c[d+"color"]).call(m.dashLine,"",c[d+"width"])}function i(a,b,c){a.select("."+b+"graticule").selectAll("path").attr("fill","none").call(l.stroke,c[b].gridcolor).call(m.dashLine,"",c[b].gridwidth)}function j(a){var b={type:"linear",showexponent:"all",exponentformat:n.layoutAttributes.exponentformat.dflt,_td:{_fullLayout:a}};return n.setConvert(b),b}var k=a("d3"),l=a("../../components/color"),m=a("../../components/drawing"),n=a("../../plots/cartesian/axes"),o=a("./projections"),p=a("./set_scale"),q=a("./zoom"),r=a("./zoom_reset"),s=a("../../constants/xmlns_namespaces"),t=a("../../constants/geo_constants"),u=a("../../lib/topojson_utils"),v=a("topojson").feature;b.exports=d;var w=d.prototype;w.plot=function(a,b,c){var d,e,f=this,g=b[f.id],h=b._size;f.projection=null,f.setScale=p(g,h),f.makeProjection(g),f.makePath(),f.adjustLayout(g,h),f.zoom=q(f,g),f.zoomReset=r(f,g),f.mockAxis=j(b),f.framework.call(f.zoom).on("dblclick.zoom",f.zoomReset),d=u.getTopojsonName(g),null===f.topojson||d!==f.topojsonName?(f.topojsonName=d,void 0!==PlotlyGeoAssets.topojson[f.topojsonName]?(f.topojson=PlotlyGeoAssets.topojson[f.topojsonName],f.onceTopojsonIsLoaded(a,g)):(e=u.getTopojsonPath(f.topojsonURL,f.topojsonName),c.push(new Promise(function(b,c){k.json(e,function(d,h){return d?void c(404===d.status?new Error(["plotly.js could not find topojson file at",e,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",e].join(" "))):(f.topojson=h,PlotlyGeoAssets.topojson[f.topojsonName]=h,f.onceTopojsonIsLoaded(a,g),void b())})})))):f.onceTopojsonIsLoaded(a,g)},w.onceTopojsonIsLoaded=function(a,b){var c;this.drawLayout(b);var d=this.traceHash,f={};for(c=0;c<a.length;c++){var g=a[c];f[g.type]=f[g.type]||[],f[g.type].push(g)}var h=Object.keys(d),i=Object.keys(f);for(c=0;c<h.length;c++){var j=h[c];if(-1===i.indexOf(j)){var k=d[j][0];k.visible=!1,f[j]=[k]}}for(i=Object.keys(f),c=0;c<i.length;c++){var l=f[i[c]],m=l[0]._module;m.plot(this,e(l),b)}this.traceHash=f,this.render()},w.updateFx=function(a){this.showHover=a!==!1},w.makeProjection=function(a){var b,c=a.projection,d=c.type,e=null===this.projection||d!==this.projectionType;e?(this.projectionType=d,b=this.projection=k.geo[t.projNames[d]]()):b=this.projection,b.translate(c._translate0).precision(t.precision),a._isAlbersUsa||b.rotate(c._rotate).center(c._center),a._clipAngle?(this.clipAngle=a._clipAngle,b.clipAngle(a._clipAngle-t.clipPad)):this.clipAngle=null,c.parallels&&b.parallels(c.parallels),e&&this.setScale(b),b.translate(c._translate).scale(c._scale)},w.makePath=function(){this.path=k.geo.path().projection(this.projection)},w.makeFramework=function(){var a=this.geoDiv=k.select(this.container).append("div");a.attr("id",this.id).style("position","absolute");var b=this.hoverContainer=a.append("svg");b.attr(s.svgAttrs).style({position:"absolute","z-index":20,"pointer-events":"none"});var c=this.framework=a.append("svg");c.attr(s.svgAttrs).attr({position:"absolute",preserveAspectRatio:"none"}),c.append("g").attr("class","bglayer").append("rect"),c.append("g").attr("class","baselayer"),c.append("g").attr("class","choroplethlayer"),c.append("g").attr("class","baselayeroverchoropleth"),c.append("g").attr("class","scattergeolayer"),c.on("dblclick.zoom",null)},w.adjustLayout=function(a,b){var c=a.domain;this.geoDiv.style({left:b.l+b.w*c.x[0]+a._marginX+"px",top:b.t+b.h*(1-c.y[1])+a._marginY+"px",width:a._width+"px",height:a._height+"px"}),this.hoverContainer.attr({width:a._width,height:a._height}),this.framework.attr({width:a._width,height:a._height}),this.framework.select(".bglayer").select("rect").attr({width:a._width,height:a._height}).style({fill:a.bgcolor,"stroke-width":0})},w.drawTopo=function(a,b,c){if(c["show"+b]===!0){var d=this.topojson,e="frame"===b?t.sphereSVG:v(d,d.objects[b]);a.append("g").datum(e).attr("class",b).append("path").attr("class","basepath")}},w.drawGraticule=function(a,b,c){var d=c[b];if(d.showgrid===!0){var e=t.scopeDefaults[c.scope],g=e.lonaxisRange,h=e.lataxisRange,i="lonaxis"===b?[d.dtick]:[0,d.dtick],j=f(g,h,i);a.append("g").datum(j).attr("class",b+"graticule").append("path").attr("class","graticulepath")}},w.drawLayout=function(a){var b,c=this.framework.select("g.baselayer"),d=t.baseLayers,e=t.axesNames;c.selectAll("*").remove();for(var f=0;f<d.length;f++)b=d[f],-1!==e.indexOf(b)?this.drawGraticule(c,b,a):this.drawTopo(c,b,a);this.styleLayout(a)},w.styleLayer=function(a,b,c){var d=t.fillLayers,e=t.lineLayers;-1!==d.indexOf(b)?g(a,b,c):-1!==e.indexOf(b)&&h(a,b,c)},w.styleLayout=function(a){for(var b,c=this.framework.select("g.baselayer"),d=t.baseLayers,e=t.axesNames,f=0;f<d.length;f++)b=d[f],-1!==e.indexOf(b)?i(c,b,a):this.styleLayer(c,b,a)},w.render=function(){function a(a){var b=f([a.lon,a.lat]);return b?"translate("+b[0]+","+b[1]+")":null}function b(a){var b=f.rotate(),c=k.geo.distance([a.lon,a.lat],[-b[0],-b[1]]),d=h*Math.PI/180;return c>d?"0":"1.0"}var c=this.framework,d=c.select("g.choroplethlayer"),e=c.select("g.scattergeolayer"),f=this.projection,g=this.path,h=this.clipAngle;c.selectAll("path.basepath").attr("d",g),c.selectAll("path.graticulepath").attr("d",g),d.selectAll("path.choroplethlocation").attr("d",g),d.selectAll("path.basepath").attr("d",g),e.selectAll("path.js-line").attr("d",g),null!==h?(e.selectAll("path.point").style("opacity",b).attr("transform",a),e.selectAll("text").style("opacity",b).attr("transform",a)):(e.selectAll("path.point").attr("transform",a),e.selectAll("text").attr("transform",a))}},{"../../components/color":299,"../../components/drawing":317,"../../constants/geo_constants":334,"../../constants/xmlns_namespaces":338,"../../lib/topojson_utils":361,"../../plots/cartesian/axes":369,"./projections":391,"./set_scale":392,"./zoom":393,"./zoom_reset":394,d3:70,topojson:230}],385:[function(a,b,c){"use strict";var d=a("./geo"),e=a("../../plots/plots");c.name="geo",c.attr="geo",c.idRoot="geo",c.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,c.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,c.attributes=a("./layout/attributes"),c.layoutAttributes=a("./layout/layout_attributes"),c.supplyLayoutDefaults=a("./layout/defaults"),c.plot=function(a){var b=a._fullLayout,c=a._fullData,f=e.getSubplotIds(b,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var g=0;g<f.length;g++){var h=f[g],i=e.getSubplotData(c,"geo",h),j=b[h]._geo;void 0===j&&(j=new d({id:h,graphDiv:a,container:b._geocontainer.node(),topojsonURL:a._context.topojsonURL},b),b[h]._geo=j),j.plot(i,b,a._promises)}},c.clean=function(a,b,c,d){for(var f=e.getSubplotIds(d,"geo"),g=0;g<f.length;g++){var h=f[g],i=d[h]._geo;!b[h]&&i&&i.geoDiv.remove()}}},{"../../plots/plots":413,"./geo":384,"./layout/attributes":386,"./layout/defaults":389,"./layout/layout_attributes":390}],386:[function(a,b,c){"use strict";b.exports={geo:{valType:"geoid",dflt:"geo"}}},{}],387:[function(a,b,c){"use strict";var d=a("../../../components/color/attributes");b.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":298}],388:[function(a,b,c){"use strict";var d=a("../../../lib"),e=a("../../../constants/geo_constants"),f=a("./axis_attributes");b.exports=function(a,b){function c(a,b){return d.coerce(h,i,f,a,b)}function g(a){var c,d,f,g,h,i,j=b.scope;return"world"===j?(c=b.projection,d=c.type,f=c.rotation,h=e[a+"Span"],i=void 0!==h[d]?h[d]/2:h["*"]/2,g="lonaxis"===a?f.lon:f.lat,[g-i,g+i]):e.scopeDefaults[j][a+"Range"]}for(var h,i,j=e.axesNames,k=0;k<j.length;k++){var l=j[k];h=a[l]||{},i={};var m=g(l),n=c("range",m);d.noneOrAll(h.range,i.range,[0,1]),c("tick0",n[0]),c("dtick","lonaxis"===l?30:10);var o=c("showgrid");o&&(c("gridcolor"),c("gridwidth")),b[l]=i,b[l]._fullRange=m}}},{"../../../constants/geo_constants":334,"../../../lib":349,"./axis_attributes":387}],389:[function(a,b,c){"use strict";function d(a,b,c){var d,e=c("scope"),f="world"!==e,h=g.scopeDefaults[e],j=c("resolution"),k=c("projection.type",h.projType),l="albers usa"===k,m=-1!==k.indexOf("conic");if(m){var n=h.projParallels||[0,60];c("projection.parallels",n)}if(l)b.scope="usa";else{var o=h.projRotate||[0,0,0];c("projection.rotation.lon",o[0]),c("projection.rotation.lat",o[1]),c("projection.rotation.roll",o[2]),d=c("showcoastlines",!f),d&&(c("coastlinecolor"),c("coastlinewidth")),d=c("showocean"),d&&c("oceancolor")}c("projection.scale"),d=c("showland"),d&&c("landcolor"),d=c("showlakes"),d&&c("lakecolor"),d=c("showrivers"),d&&(c("rivercolor"),c("riverwidth")),d=c("showcountries",f),d&&(c("countrycolor"),c("countrywidth")),("usa"===e||"north america"===e&&50===j)&&(c("showsubunits",!0),c("subunitcolor"),c("subunitwidth")),f||(d=c("showframe",!0),d&&(c("framecolor"),c("framewidth"))),c("bgcolor"),i(a,b),b._isHighRes=50===j,b._clipAngle=g.lonaxisSpan[k]/2,b._isAlbersUsa=l,b._isConic=m,b._isScoped=f;var p=b.projection.rotation||{};b.projection._rotate=[-p.lon||0,-p.lat||0,p.roll||0]}var e=a("../../../lib"),f=a("../../plots"),g=a("../../../constants/geo_constants"),h=a("./layout_attributes"),i=a("./axis_defaults");b.exports=function(a,b,c){function g(a,b){return e.coerce(i,j,h,a,b)}if(b._hasGeo)for(var i,j,k=f.findSubplotIds(c,"geo"),l=k.length,m=0;l>m;m++){var n=k[m];i=a[n]?a[n]:a[n]={},i=a[n],j={},g("domain.x"),g("domain.y",[m/l,(m+1)/l]),d(i,j,g),b[n]=j}}},{"../../../constants/geo_constants":334,"../../../lib":349,"../../plots":413,"./axis_defaults":388,"./layout_attributes":390}],390:[function(a,b,c){"use strict";var d=a("../../../components/color/attributes"),e=a("../../../constants/geo_constants"),f=a("./axis_attributes");b.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{ 52 valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(e.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(e.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:e.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:e.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:e.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:e.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:f,lataxis:f}},{"../../../components/color/attributes":298,"../../../constants/geo_constants":334,"./axis_attributes":387}],391:[function(a,b,c){function d(){function a(a,c){return{type:"Feature",id:a.id,properties:a.properties,geometry:b(a.geometry,c)}}function b(a,c){if(!a)return null;if("GeometryCollection"===a.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(a){return b(a,c)})};if(!y.hasOwnProperty(a.type))return null;var d=y[a.type];return e.geo.stream(a,c(d)),d.result()}function c(){}function d(a){if((b=a.length)<4)return!1;for(var b,c=0,d=a[b-1][1]*a[0][0]-a[b-1][0]*a[0][1];++c<b;)d+=a[c-1][1]*a[c][0]-a[c-1][0]*a[c][1];return 0>=d}function f(a,b){for(var c=b[0],d=b[1],e=!1,f=0,g=a.length,h=g-1;g>f;h=f++){var i=a[f],j=i[0],k=i[1],l=a[h],m=l[0],n=l[1];k>d^n>d&&(m-j)*(d-k)/(n-k)+j>c&&(e=!e)}return e}function g(a){return a>1?C:-1>a?-C:Math.asin(a)}function h(a,b){var c=(2+C)*Math.sin(b);b/=2;for(var d=0,e=1/0;10>d&&Math.abs(e)>z;d++){var f=Math.cos(b);b-=e=(b+Math.sin(b)*(f+2)-c)/(2*f*(1+f))}return[2/Math.sqrt(B*(4+B))*a*(1+Math.cos(b)),2*Math.sqrt(B/(4+B))*Math.sin(b)]}function i(a,b){function c(c,d){var e=H(c/b,d);return e[0]*=a,e}return arguments.length<2&&(b=a),1===b?H:b===1/0?k:(c.invert=function(c,d){var e=H.invert(c/a,d);return e[0]*=b,e},c)}function j(){var a=2,b=G(i),c=b(a);return c.coefficient=function(c){return arguments.length?b(a=+c):a},c}function k(a,b){return[a*Math.cos(b)/Math.cos(b/=2),2*Math.sin(b)]}function l(a,b){return[3*a/(2*B)*Math.sqrt(B*B/3-b*b),b]}function m(a,b){return[a,1.25*Math.log(Math.tan(B/4+.4*b))]}function n(a){return function(b){var c,d=a*Math.sin(b),e=30;do b-=c=(b+Math.sin(b)-d)/(1+Math.cos(b));while(Math.abs(c)>z&&--e>0);return b/2}}function o(a,b,c){function d(c,d){return[a*c*Math.cos(d=e(d)),b*Math.sin(d)]}var e=n(c);return d.invert=function(d,e){var f=g(e/b);return[d/(a*Math.cos(f)),g((2*f+Math.sin(2*f))/c)]},d}function p(a,b){var c=b*b,d=c*c;return[a*(.8707-.131979*c+d*(-.013791+d*(.003971*c-.001529*d))),b*(1.007226+c*(.015085+d*(-.044475+.028874*c-.005916*d)))]}function q(a,b){var c,d=Math.min(18,36*Math.abs(b)/B),e=Math.floor(d),f=d-e,g=(c=J[e])[0],h=c[1],i=(c=J[++e])[0],j=c[1],k=(c=J[Math.min(19,++e)])[0],l=c[1];return[a*(i+f*(k-g)/2+f*f*(k-2*i+g)/2),(b>0?C:-C)*(j+f*(l-h)/2+f*f*(l-2*j+h)/2)]}function r(a,b){return[a*Math.cos(b),b]}e.geo.project=function(a,c){var d=c.stream;if(!d)throw new Error("not yet supported");return(a&&s.hasOwnProperty(a.type)?s[a.type]:b)(a,d)};var s={Feature:a,FeatureCollection:function(b,c){return{type:"FeatureCollection",features:b.features.map(function(b){return a(b,c)})}}},t=[],u=[],v={point:function(a,b){t.push([a,b])},result:function(){var a=t.length?t.length<2?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}:null;return t=[],a}},w={lineStart:c,point:function(a,b){t.push([a,b])},lineEnd:function(){t.length&&(u.push(t),t=[])},result:function(){var a=u.length?u.length<2?{type:"LineString",coordinates:u[0]}:{type:"MultiLineString",coordinates:u}:null;return u=[],a}},x={polygonStart:c,lineStart:c,point:function(a,b){t.push([a,b])},lineEnd:function(){var a=t.length;if(a){do t.push(t[0].slice());while(++a<4);u.push(t),t=[]}},polygonEnd:c,result:function(){if(!u.length)return null;var a=[],b=[];return u.forEach(function(c){d(c)?a.push([c]):b.push(c)}),b.forEach(function(b){var c=b[0];a.some(function(a){return f(a[0],c)?(a.push(b),!0):void 0})||a.push([b])}),u=[],a.length?a.length>1?{type:"MultiPolygon",coordinates:a}:{type:"Polygon",coordinates:a[0]}:null}},y={Point:v,MultiPoint:v,LineString:w,MultiLineString:w,Polygon:x,MultiPolygon:x,Sphere:x},z=1e-6,A=z*z,B=Math.PI,C=B/2,D=(Math.sqrt(B),B/180),E=180/B,F=e.geo.projection,G=e.geo.projectionMutator;e.geo.interrupt=function(a){function b(b,c){for(var d=0>c?-1:1,e=i[+(0>c)],f=0,g=e.length-1;g>f&&b>e[f][2][0];++f);var h=a(b-e[f][1][0],c);return h[0]+=a(e[f][1][0],d*c>d*e[f][0][1]?e[f][0][1]:c)[0],h}function c(){h=i.map(function(b){return b.map(function(b){var c,d=a(b[0][0],b[0][1])[0],e=a(b[2][0],b[2][1])[0],f=a(b[1][0],b[0][1])[1],g=a(b[1][0],b[1][1])[1];return f>g&&(c=f,f=g,g=c),[[d,f],[e,g]]})})}function d(){for(var a=1e-6,b=[],c=0,d=i[0].length;d>c;++c){var g=i[0][c],h=180*g[0][0]/B,j=180*g[0][1]/B,k=180*g[1][1]/B,l=180*g[2][0]/B,m=180*g[2][1]/B;b.push(f([[h+a,j+a],[h+a,k-a],[l-a,k-a],[l-a,m+a]],30))}for(var c=i[1].length-1;c>=0;--c){var g=i[1][c],h=180*g[0][0]/B,j=180*g[0][1]/B,k=180*g[1][1]/B,l=180*g[2][0]/B,m=180*g[2][1]/B;b.push(f([[l-a,m-a],[l-a,k+a],[h+a,k+a],[h+a,j-a]],30))}return{type:"Polygon",coordinates:[e.merge(b)]}}function f(a,b){for(var c,d,e,f=-1,g=a.length,h=a[0],i=[];++f<g;){c=a[f],d=(c[0]-h[0])/b,e=(c[1]-h[1])/b;for(var j=0;b>j;++j)i.push([h[0]+j*d,h[1]+j*e]);h=c}return i.push(c),i}function g(a,b){return Math.abs(a[0]-b[0])<z&&Math.abs(a[1]-b[1])<z}var h,i=[[[[-B,0],[0,C],[B,0]]],[[[-B,0],[0,-C],[B,0]]]];a.invert&&(b.invert=function(c,d){for(var e=h[+(0>d)],f=i[+(0>d)],j=0,k=e.length;k>j;++j){var l=e[j];if(l[0][0]<=c&&c<l[1][0]&&l[0][1]<=d&&d<l[1][1]){var m=a.invert(c-a(f[j][1][0],0)[0],d);return m[0]+=f[j][1][0],g(b(m[0],m[1]),[c,d])?m:null}}});var j=e.geo.projection(b),k=j.stream;return j.stream=function(a){var b=j.rotate(),c=k(a),f=(j.rotate([0,0]),k(a));return j.rotate(b),c.sphere=function(){e.geo.stream(d(),f)},c},j.lobes=function(a){return arguments.length?(i=a.map(function(a){return a.map(function(a){return[[a[0][0]*B/180,a[0][1]*B/180],[a[1][0]*B/180,a[1][1]*B/180],[a[2][0]*B/180,a[2][1]*B/180]]})}),c(),j):i.map(function(a){return a.map(function(a){return[[180*a[0][0]/B,180*a[0][1]/B],[180*a[1][0]/B,180*a[1][1]/B],[180*a[2][0]/B,180*a[2][1]/B]]})})},j},h.invert=function(a,b){var c=.5*b*Math.sqrt((4+B)/B),d=g(c),e=Math.cos(d);return[a/(2/Math.sqrt(B*(4+B))*(1+e)),g((d+c*(e+2))/(2+C))]},(e.geo.eckert4=function(){return F(h)}).raw=h;var H=e.geo.azimuthalEqualArea.raw;k.invert=function(a,b){var c=2*g(b/2);return[a*Math.cos(c/2)/Math.cos(c),c]},(e.geo.hammer=j).raw=i,l.invert=function(a,b){return[2/3*B*a/Math.sqrt(B*B/3-b*b),b]},(e.geo.kavrayskiy7=function(){return F(l)}).raw=l,m.invert=function(a,b){return[a,2.5*Math.atan(Math.exp(.8*b))-.625*B]},(e.geo.miller=function(){return F(m)}).raw=m;var I=(n(B),o(Math.SQRT2/C,Math.SQRT2,B));(e.geo.mollweide=function(){return F(I)}).raw=I,p.invert=function(a,b){var c,d=b,e=25;do{var f=d*d,g=f*f;d-=c=(d*(1.007226+f*(.015085+g*(-.044475+.028874*f-.005916*g)))-b)/(1.007226+f*(.045255+g*(-0.311325+.259866*f-.005916*11*g)))}while(Math.abs(c)>z&&--e>0);return[a/(.8707+(f=d*d)*(-.131979+f*(-.013791+f*f*f*(.003971-.001529*f)))),d]},(e.geo.naturalEarth=function(){return F(p)}).raw=p;var J=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];J.forEach(function(a){a[1]*=1.0144}),q.invert=function(a,b){var c=b/C,d=90*c,e=Math.min(18,Math.abs(d/5)),f=Math.max(0,Math.floor(e));do{var g=J[f][1],h=J[f+1][1],i=J[Math.min(19,f+2)][1],j=i-g,k=i-2*h+g,l=2*(Math.abs(c)-h)/j,m=k/j,n=l*(1-m*l*(1-2*m*l));if(n>=0||1===f){d=(b>=0?5:-5)*(n+e);var o,p=50;do e=Math.min(18,Math.abs(d)/5),f=Math.floor(e),n=e-f,g=J[f][1],h=J[f+1][1],i=J[Math.min(19,f+2)][1],d-=(o=(b>=0?C:-C)*(h+n*(i-g)/2+n*n*(i-2*h+g)/2)-b)*E;while(Math.abs(o)>A&&--p>0);break}}while(--f>=0);var q=J[f][0],r=J[f+1][0],s=J[Math.min(19,f+2)][0];return[a/(r+n*(s-q)/2+n*n*(s-2*r+q)/2),d*D]},(e.geo.robinson=function(){return F(q)}).raw=q,r.invert=function(a,b){return[a/Math.cos(b),b]},(e.geo.sinusoidal=function(){return F(r)}).raw=r}var e=a("d3");b.exports=d},{d3:70}],392:[function(a,b,c){"use strict";function d(a,b){var c=a.projection,d=a.lonaxis,g=a.lataxis,i=a.domain,j=a.framewidth||0,k=b.w*(i.x[1]-i.x[0]),l=b.h*(i.y[1]-i.y[0]),m=d.range[0]+h,n=d.range[1]-h,o=g.range[0]+h,p=g.range[1]-h,q=d._fullRange[0]+h,r=d._fullRange[1]-h,s=g._fullRange[0]+h,t=g._fullRange[1]-h;c._translate0=[b.l+k/2,b.t+l/2];var u=n-m,v=p-o,w=[m+u/2,o+v/2],x=c._rotate;c._center=[w[0]+x[0],w[1]+x[1]];var y=function(b){function d(a){return Math.min(v*k/(a[1][0]-a[0][0]),v*l/(a[1][1]-a[0][1]))}var g,h,i,u,v=b.scale(),w=c._translate0,x=e(m,o,n,p),y=e(q,s,r,t);i=f(b,x),g=d(i),u=f(b,y),c._fullScale=d(u),b.scale(g),i=f(b,x),h=[w[0]-i[0][0]+j,w[1]-i[0][1]+j],c._translate=h,b.translate(h),i=f(b,x),a._isAlbersUsa||b.clipExtent(i),g=c.scale*g,c._scale=g,a._width=Math.round(i[1][0])+j,a._height=Math.round(i[1][1])+j,a._marginX=(k-Math.round(i[1][0]))/2,a._marginY=(l-Math.round(i[1][1]))/2};return y}function e(a,b,c,d){var e=(c-a)/4;return{type:"Polygon",coordinates:[[[a,b],[a,d],[a+e,d],[a+2*e,d],[a+3*e,d],[c,d],[c,b],[c-e,b],[c-2*e,b],[c-3*e,b],[a,b]]]}}function f(a,b){return g.geo.path().projection(a).bounds(b)}var g=a("d3"),h=a("../../constants/geo_constants").clipPad;b.exports=d},{"../../constants/geo_constants":334,d3:70}],393:[function(a,b,c){"use strict";function d(a,b){var c;return(c=b._isScoped?f:b._clipAngle?h:g)(a,b.projection)}function e(a,b){var c=b._fullScale;return v.behavior.zoom().translate(a.translate()).scale(a.scale()).scaleExtent([.5*c,100*c])}function f(a,b){function c(){v.select(this).style(y)}function d(){g.scale(v.event.scale).translate(v.event.translate),a.render()}function f(){v.select(this).style(z)}var g=a.projection,h=e(g,b);return h.on("zoomstart",c).on("zoom",d).on("zoomend",f),h}function g(a,b){function c(a){return q.invert(a)}function d(a){var b=q(c(a));return Math.abs(b[0]-a[0])>s||Math.abs(b[1]-a[1])>s}function f(){v.select(this).style(y),i=v.mouse(this),j=q.rotate(),k=q.translate(),l=j,m=c(i)}function g(){return n=v.mouse(this),d(i)?(r.scale(q.scale()),void r.translate(q.translate())):(q.scale(v.event.scale),q.translate([k[0],v.event.translate[1]]),m?c(n)&&(p=c(n),o=[l[0]+(p[0]-m[0]),j[1],j[2]],q.rotate(o),l=o):(i=n,m=c(i)),void a.render())}function h(){v.select(this).style(z)}var i,j,k,l,m,n,o,p,q=a.projection,r=e(q,b),s=2;return r.on("zoomstart",f).on("zoom",g).on("zoomend",h),r}function h(a,b){function c(a){r++||a({type:"zoomstart"})}function d(a){a({type:"zoom"})}function f(a){--r||a({type:"zoomend"})}var g,h=a.projection,n={r:h.rotate(),k:h.scale()},o=e(h,b),p=u(o,"zoomstart","zoom","zoomend"),r=0,s=o.on;return o.on("zoomstart",function(){v.select(this).style(y);var a=v.mouse(this),b=h.rotate(),e=b,f=h.translate(),r=j(b);g=i(h,a),s.call(o,"zoom",function(){var c=v.mouse(this);if(h.scale(n.k=v.event.scale),g){if(i(h,c)){h.rotate(b).translate(f);var j=i(h,c),o=l(g,j),s=q(k(r,o)),t=n.r=m(s,g,e);isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])||(t=e),h.rotate(t),e=t}}else a=c,g=i(h,a);d(p.of(this,arguments))}),c(p.of(this,arguments))}).on("zoomend",function(){v.select(this).style(z),s.call(o,"zoom",null),f(p.of(this,arguments))}).on("zoom.redraw",function(){a.render()}),v.rebind(o,p,"on")}function i(a,b){var c=a.invert(b);return c&&isFinite(c[0])&&isFinite(c[1])&&r(c)}function j(a){var b=.5*a[0]*w,c=.5*a[1]*w,d=.5*a[2]*w,e=Math.sin(b),f=Math.cos(b),g=Math.sin(c),h=Math.cos(c),i=Math.sin(d),j=Math.cos(d);return[f*h*j+e*g*i,e*h*j-f*g*i,f*g*j+e*h*i,f*h*i-e*g*j]}function k(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=b[0],h=b[1],i=b[2],j=b[3];return[c*g-d*h-e*i-f*j,c*h+d*g+e*j-f*i,c*i-d*j+e*g+f*h,c*j+d*i-e*h+f*g]}function l(a,b){if(a&&b){var c=t(a,b),d=Math.sqrt(s(c,c)),e=.5*Math.acos(Math.max(-1,Math.min(1,s(a,b)))),f=Math.sin(e)/d;return d&&[Math.cos(e),c[2]*f,-c[1]*f,c[0]*f]}}function m(a,b,c){var d=p(b,2,a[0]);d=p(d,1,a[1]),d=p(d,0,a[2]-c[2]);var e,f,g=b[0],h=b[1],i=b[2],j=d[0],k=d[1],l=d[2],m=Math.atan2(h,g)*x,o=Math.sqrt(g*g+h*h);Math.abs(k)>o?(f=(k>0?90:-90)-m,e=0):(f=Math.asin(k/o)*x-m,e=Math.sqrt(o*o-k*k));var q=180-f-2*m,r=(Math.atan2(l,j)-Math.atan2(i,e))*x,s=(Math.atan2(l,j)-Math.atan2(i,-e))*x,t=n(c[0],c[1],f,r),u=n(c[0],c[1],q,s);return u>=t?[f,r,c[2]]:[q,s,c[2]]}function n(a,b,c,d){var e=o(c-a),f=o(d-b);return Math.sqrt(e*e+f*f)}function o(a){return(a%360+540)%360-180}function p(a,b,c){var d=c*w,e=a.slice(),f=0===b?1:0,g=2===b?1:2,h=Math.cos(d),i=Math.sin(d);return e[f]=a[f]*h-a[g]*i,e[g]=a[g]*h+a[f]*i,e}function q(a){return[Math.atan2(2*(a[0]*a[1]+a[2]*a[3]),1-2*(a[1]*a[1]+a[2]*a[2]))*x,Math.asin(Math.max(-1,Math.min(1,2*(a[0]*a[2]-a[3]*a[1]))))*x,Math.atan2(2*(a[0]*a[3]+a[1]*a[2]),1-2*(a[2]*a[2]+a[3]*a[3]))*x]}function r(a){var b=a[0]*w,c=a[1]*w,d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function s(a,b){for(var c=0,d=0,e=a.length;e>d;++d)c+=a[d]*b[d];return c}function t(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function u(a){for(var b=0,c=arguments.length,d=[];++b<c;)d.push(arguments[b]);var e=v.dispatch.apply(null,d);return e.of=function(b,c){return function(d){var f;try{f=d.sourceEvent=v.event,d.target=a,v.event=d,e[d.type].apply(b,c)}finally{v.event=f}}},e}var v=a("d3"),w=Math.PI/180,x=180/Math.PI,y={cursor:"pointer"},z={cursor:"auto"};b.exports=d},{d3:70}],394:[function(a,b,c){"use strict";function d(a,b){var c=a.projection,d=a.zoom,f=function(){a.makeProjection(b),a.makePath(),d.scale(c.scale()),d.translate(c.translate()),e.loneUnhover(a.hoverContainer),a.render()};return f}var e=a("../cartesian/graph_interact");b.exports=d},{"../cartesian/graph_interact":374}],395:[function(a,b,c){"use strict";function d(a,b){this.element=a,this.plot=b,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxStart=[0,0],this.boxEnd=[0,0]}function e(a){var b=a.mouseContainer,c=a.glplot,e=new d(b,c);return e.mouseListener=f(b,function(b,d,f){function g(b,c,d){var f=Math.min(c,d),g=Math.max(c,d);f!==g?(b[0]=f,b[1]=g,e.dataBox=b):(a.selectBox.selectBox=[0,0,1,1],a.glplot.setDirty())}var h=a.xaxis.range,i=a.yaxis.range,j=c.viewBox,k=e.lastPos[0],l=e.lastPos[1];switch(d*=c.pixelRatio,f*=c.pixelRatio,f=j[3]-j[1]-f,a.fullLayout.dragmode){case"zoom":if(b){var m=d/(j[2]-j[0])*(h[1]-h[0])+h[0],n=f/(j[3]-j[1])*(i[1]-i[0])+i[0];e.boxEnabled||(e.boxStart[0]=m,e.boxStart[1]=n),e.boxEnd[0]=m,e.boxEnd[1]=n,e.boxEnabled=!0}else e.boxEnabled&&(g(h,e.boxStart[0],e.boxEnd[0]),g(i,e.boxStart[1],e.boxEnd[1]),e.boxEnabled=!1);break;case"pan":if(e.boxEnabled=!1,b){var o=(k-d)*(h[1]-h[0])/(c.viewBox[2]-c.viewBox[0]),p=(l-f)*(i[1]-i[0])/(c.viewBox[3]-c.viewBox[1]);h[0]+=o,h[1]+=o,i[0]+=p,i[1]+=p,e.lastInputTime=Date.now(),a.cameraChanged()}}e.lastPos[0]=d,e.lastPos[1]=f}),e.wheelListener=g(b,function(b,d){var f=a.xaxis.range,g=a.yaxis.range,h=c.viewBox,i=e.lastPos[0],j=e.lastPos[1];switch(a.fullLayout.dragmode){case"zoom":break;case"pan":var k=Math.exp(.1*d/(h[3]-h[1])),l=i/(h[2]-h[0])*(f[1]-f[0])+f[0],m=j/(h[3]-h[1])*(g[1]-g[0])+g[0];f[0]=(f[0]-l)*k+l,f[1]=(f[1]-l)*k+l,g[0]=(g[0]-m)*k+m,g[1]=(g[1]-m)*k+m,e.lastInputTime=Date.now(),a.cameraChanged()}return!0}),e}var f=a("mouse-change"),g=a("mouse-wheel");b.exports=e},{"mouse-change":196,"mouse-wheel":200}],396:[function(a,b,c){"use strict";function d(a){this.scene=a,this.gl=a.gl,this.pixelRatio=a.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0]}function e(a){return new d(a)}var f=a("../../plotly"),g=a("../../lib/html2unicode"),h=a("../../lib/str2rgbarray"),i=d.prototype,j=["xaxis","yaxis"];i.merge=function(a){this.titleEnable=!1,this.backgroundColor=h(a.plot_bgcolor);var b,c,d,e,f,i,k,l,m,n,o;for(n=0;2>n;++n){for(b=j[n],c=a[this.scene[b]._name],d=/Click to enter .+ title/.test(c.title)?"":c.title,o=0;2>=o;o+=2)this.labelEnable[n+o]=!1,this.labels[n+o]=g(d),this.labelColor[n+o]=h(c.titlefont.color),this.labelFont[n+o]=c.titlefont.family,this.labelSize[n+o]=c.titlefont.size,this.labelPad[n+o]=this.getLabelPad(b,c),this.tickEnable[n+o]=!1,this.tickColor[n+o]=h((c.tickfont||{}).color),this.tickAngle[n+o]="auto"===c.tickangle?0:Math.PI*-c.tickangle/180,this.tickPad[n+o]=this.getTickPad(c),this.tickMarkLength[n+o]=0,this.tickMarkWidth[n+o]=c.tickwidth||0,this.tickMarkColor[n+o]=h(c.tickcolor),this.borderLineEnable[n+o]=!1,this.borderLineColor[n+o]=h(c.linecolor),this.borderLineWidth[n+o]=c.linewidth||0;k=this.hasSharedAxis(c),f=this.hasAxisInDfltPos(b,c)&&!k,i=this.hasAxisInAltrPos(b,c)&&!k,e=c.mirror||!1,l=k?-1!==String(e).indexOf("all"):!!e,m=k?"allticks"===e:-1!==String(e).indexOf("ticks"),f?this.labelEnable[n]=!0:i&&(this.labelEnable[n+2]=!0),f?this.tickEnable[n]=c.showticklabels:i&&(this.tickEnable[n+2]=c.showticklabels),(f||l)&&(this.borderLineEnable[n]=c.showline),(i||l)&&(this.borderLineEnable[n+2]=c.showline),(f||m)&&(this.tickMarkLength[n]=this.getTickMarkLength(c)),(i||m)&&(this.tickMarkLength[n+2]=this.getTickMarkLength(c)),this.gridLineEnable[n]=c.showgrid,this.gridLineColor[n]=h(c.gridcolor),this.gridLineWidth[n]=c.gridwidth,this.zeroLineEnable[n]=c.zeroline,this.zeroLineColor[n]=h(c.zerolinecolor),this.zeroLineWidth[n]=c.zerolinewidth}},i.hasSharedAxis=function(a){var b=this.scene,c=f.Plots.getSubplotIds(b.fullLayout,"gl2d"),d=f.Axes.findSubplotsWithAxis(c,a);return 0!==d.indexOf(b.id)},i.hasAxisInDfltPos=function(a,b){var c=b.side;return"xaxis"===a?"bottom"===c:"yaxis"===a?"left"===c:void 0},i.hasAxisInAltrPos=function(a,b){var c=b.side;return"xaxis"===a?"top"===c:"yaxis"===a?"right"===c:void 0},i.getLabelPad=function(a,b){var c=1.5,d=b.titlefont.size,e=b.showticklabels;return"xaxis"===a?"top"===b.side?-10+d*(c+(e?1:0)):-10+d*(c+(e?.5:0)):"yaxis"===a?"right"===b.side?10+d*(c+(e?1:.5)):10+d*(c+(e?.5:0)):void 0},i.getTickPad=function(a){return"outside"===a.ticks?10+a.ticklen:15},i.getTickMarkLength=function(a){if(!a.ticks)return 0;var b=a.ticklen;return"inside"===a.ticks?-b:b},b.exports=e},{"../../lib/html2unicode":348,"../../lib/str2rgbarray":359,"../../plotly":366}],397:[function(a,b,c){"use strict";var d=a("../../plotly"),e=a("./scene2d"),f=d.Plots;c.name="gl2d",c.attr=["xaxis","yaxis"],c.idRoot=["x","y"],c.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},c.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},c.attributes=a("../cartesian/attributes"),c.plot=function(a){for(var b=a._fullLayout,c=a._fullData,d=f.getSubplotIds(b,"gl2d"),g=0;g<d.length;g++){var h=d[g],i=b._plots[h],j=f.getSubplotData(c,"gl2d",h),k=i._scene2d;void 0===k&&(k=new e({container:a.querySelector(".gl-container"),id:h,staticPlot:a._context.staticPlot,plotGlPixelRatio:a._context.plotGlPixelRatio},b),i._scene2d=k),k.plot(j,b,a.layout)}}},{"../../plotly":366,"../cartesian/attributes":368,"./scene2d":398}],398:[function(a,b,c){"use strict";function d(a,b){this.container=a.container,this.pixelRatio=a.plotGlPixelRatio||window.devicePixelRatio,this.id=a.id,this.staticPlot=!!a.staticPlot,this.fullLayout=b,this.updateAxes(b),this.makeFramework(),this.glplotOptions=n(this),this.glplotOptions.merge(b),this.glplot=k(this.glplotOptions),this.camera=o(this),this.traces={},this.spikes=l(this.glplot),this.selectBox=m(this.glplot,{innerFill:!1,outerFill:!0}),this.pickResult=null,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function e(a,b){for(var c=0;2>c;++c){var d=a[c],e=b[c];if(d.length!==e.length)return!0;for(var f=0;f<d.length;++f)if(d[f].x!==e[f].x)return!0}return!1}var f,g,h=a("../../plots/plots"),i=a("../../plots/cartesian/axes"),j=a("../../plots/cartesian/graph_interact"),k=a("gl-plot2d"),l=a("gl-spikes2d"),m=a("gl-select-box"),n=a("./convert"),o=a("./camera"),p=a("../../lib/html2unicode"),q=a("../../lib/show_no_webgl_msg"),r=["xaxis","yaxis"];b.exports=d;var s=d.prototype;s.makeFramework=function(){if(this.staticPlot){if(!g){f=document.createElement("canvas");try{g=f.getContext("webgl",{preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0})}catch(a){throw new Error(["Error creating static canvas/context for image server"].join(" "))}}this.canvas=f,this.gl=g}else{var b,c=document.createElement("canvas"),d={premultipliedAlpha:!0};try{b=c.getContext("webgl",d)}catch(a){}if(!b)try{b=c.getContext("experimental-webgl",d)}catch(a){}b||q(this),this.canvas=c,this.gl=b}var e=this.canvas,h=this.pixelRatio,i=this.fullLayout;e.width=0|Math.ceil(h*i.width),e.height=0|Math.ceil(h*i.height),e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style["pointer-events"]="none";var j=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");j.style.position="absolute",j.style.top=j.style.left="0px",j.style.width=j.style.height="100%",j.style["z-index"]=20,j.style["pointer-events"]="none";var k=this.mouseContainer=document.createElement("div");k.style.position="absolute";var l=this.container;l.appendChild(e),l.appendChild(j),l.appendChild(k)},s.toImage=function(a){a||(a="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(f),this.glplot.setDirty(!0),this.glplot.draw();var b=this.glplot.gl,c=b.drawingBufferWidth,d=b.drawingBufferHeight;b.bindFramebuffer(b.FRAMEBUFFER,null);var e=new Uint8Array(c*d*4);b.readPixels(0,0,c,d,b.RGBA,b.UNSIGNED_BYTE,e);for(var g=0,h=d-1;h>g;++g,--h)for(var i=0;c>i;++i)for(var j=0;4>j;++j){var k=e[4*(c*g+i)+j];e[4*(c*g+i)+j]=e[4*(c*h+i)+j],e[4*(c*h+i)+j]=k}var l=document.createElement("canvas");l.width=c,l.height=d;var m=l.getContext("2d"),n=m.createImageData(c,d);n.data.set(e),m.putImageData(n,0,0);var o;switch(a){case"jpeg":o=l.toDataURL("image/jpeg");break;case"webp":o=l.toDataURL("image/webp");break;default:o=l.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(f),o},s.computeTickMarks=function(){this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var a=[i.calcTicks(this.xaxis),i.calcTicks(this.yaxis)],b=0;2>b;++b)for(var c=0;c<a[b].length;++c)a[b][c].text=p(a[b][c].text+"").replace(/\n/g," ");return a},s.updateAxes=function(a){var b=i.subplotMatch,c="xaxis"+this.id.match(b)[1],d="yaxis"+this.id.match(b)[2];this.xaxis=a[c],this.yaxis=a[d]},s.updateFx=function(a){var b=this.fullLayout;b.dragmode=a.dragmode,b.hovermode=a.hovermode},s.cameraChanged=function(){var a=this.camera,b=this.xaxis.range,c=this.yaxis.range;this.glplot.setDataBox([b[0],c[0],b[1],c[1]]);var d=this.computeTickMarks(),f=this.glplotOptions.ticks;e(d,f)&&(this.glplotOptions.ticks=d,this.glplotOptions.dataBox=a.dataBox,this.glplot.update(this.glplotOptions))},s.destroy=function(){this.glplot.dispose()},s.plot=function(a,b){var c,d,e=this.glplot,f=this.pixelRatio;this.fullLayout=b,this.updateAxes(b);var g=b.width,j=b.height,k=0|Math.ceil(f*g),l=0|Math.ceil(f*j),m=this.canvas;m.width===k&&m.height===l||(m.width=k,m.height=l),a?Array.isArray(a)||(a=[a]):a=[];var n,o;for(c=0;c<a.length;++c){if(n=a[c],o=this.traces[n.uid])o.update(n);else{var p=h.getModule(n.type);o=p.plot(this,n)}this.traces[n.uid]=o}var q=Object.keys(this.traces);a:for(c=0;c<q.length;++c){for(d=0;d<a.length;++d)if(a[d].uid===q[c])continue a;o=this.traces[q[c]],o.dispose(),delete this.traces[q[c]]}var s=this.glplotOptions;s.merge(b),s.screenBox=[0,0,g,j];var t=b._size,u=this.xaxis.domain,v=this.yaxis.domain;s.viewBox=[t.l+u[0]*t.w,t.b+v[0]*t.h,g-t.r-(1-u[1])*t.w,j-t.t-(1-v[1])*t.h],this.mouseContainer.style.width=t.w*(u[1]-u[0])+"px",this.mouseContainer.style.height=t.h*(v[1]-v[0])+"px",this.mouseContainer.height=t.h*(v[1]-v[0]),this.mouseContainer.style.left=t.l+u[0]*t.w+"px",this.mouseContainer.style.top=t.t+(1-v[1])*t.h+"px";var w=this.bounds;for(w[0]=w[1]=1/0,w[2]=w[3]=-(1/0),q=Object.keys(this.traces),c=0;c<q.length;++c){o=this.traces[q[c]];for(var x=0;2>x;++x)w[x]=Math.min(w[x],o.bounds[x]),w[x+2]=Math.max(w[x+2],o.bounds[x+2])}var y;for(c=0;2>c;++c)w[c]>w[c+2]&&(w[c]=-1,w[c+2]=1),y=this[r[c]],y._length=s.viewBox[c+2]-s.viewBox[c],i.doAutoRange(y);s.ticks=this.computeTickMarks();var z=this.xaxis.range,A=this.yaxis.range;s.dataBox=[z[0],A[0],z[1],A[1]],s.merge(b),e.update(s)},s.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var a=this.glplot,b=this.camera,c=b.mouseListener,d=this.fullLayout;this.cameraChanged();var e=c.x*a.pixelRatio,f=this.canvas.height-a.pixelRatio*c.y;if(b.boxEnabled&&"zoom"===d.dragmode)this.selectBox.enabled=!0,this.selectBox.selectBox=[Math.min(b.boxStart[0],b.boxEnd[0]),Math.min(b.boxStart[1],b.boxEnd[1]),Math.max(b.boxStart[0],b.boxEnd[0]),Math.max(b.boxStart[1],b.boxEnd[1])],a.setDirty();else{this.selectBox.enabled=!1;var g=d._size,h=this.xaxis.domain,i=this.yaxis.domain,k=a.pick(e/a.pixelRatio+g.l+h[0]*g.w,f/a.pixelRatio-(g.t+(1-i[1])*g.h));if(k&&d.hovermode){var l=k.object._trace.handlePick(k);if(l&&(!this.lastPickResult||this.lastPickResult.trace!==l.trace||this.lastPickResult.dataCoord[0]!==l.dataCoord[0]||this.lastPickResult.dataCoord[1]!==l.dataCoord[1])){var m=this.lastPickResult=l;this.spikes.update({center:k.dataCoord}),m.screenCoord=[((a.viewBox[2]-a.viewBox[0])*(k.dataCoord[0]-a.dataBox[0])/(a.dataBox[2]-a.dataBox[0])+a.viewBox[0])/a.pixelRatio,(this.canvas.height-(a.viewBox[3]-a.viewBox[1])*(k.dataCoord[1]-a.dataBox[1])/(a.dataBox[3]-a.dataBox[1])-a.viewBox[1])/a.pixelRatio];var n=m.hoverinfo;if("all"!==n){var o=n.split("+");-1===o.indexOf("x")&&(m.traceCoord[0]=void 0),-1===o.indexOf("y")&&(m.traceCoord[1]=void 0),-1===o.indexOf("text")&&(m.textLabel=void 0),-1===o.indexOf("name")&&(m.name=void 0)}j.loneHover({x:m.screenCoord[0],y:m.screenCoord[1],xLabel:this.hoverFormatter("xaxis",m.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",m.traceCoord[1]),text:m.textLabel,name:m.name,color:m.color},{container:this.svgContainer}),this.lastPickResult={dataCoord:k.dataCoord}}}else!k&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,j.loneUnhover(this.svgContainer))}a.draw()}},s.hoverFormatter=function(a,b){if(void 0!==b){var c=this[a];return i.tickText(c,c.c2l(b),"hover").text}}},{"../../lib/html2unicode":348,"../../lib/show_no_webgl_msg":357,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"../../plots/plots":413,"./camera":395,"./convert":396,"gl-plot2d":122,"gl-select-box":152,"gl-spikes2d":178}],399:[function(a,b,c){"use strict";function d(a,b){a=a||document.body,b=b||{};var c=[.01,1/0];"distanceLimits"in b&&(c[0]=b.distanceLimits[0],c[1]=b.distanceLimits[1]),"zoomMin"in b&&(c[0]=b.zoomMin),"zoomMax"in b&&(c[1]=b.zoomMax);var d=f({center:b.center||[0,0,0],up:b.up||[0,1,0],eye:b.eye||[0,0,10],mode:b.mode||"orbit",distanceLimits:c}),i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=0,k=a.clientWidth,l=a.clientHeight,m={keyBindingMode:"rotate",view:d,element:a,delay:b.delay||16,rotateSpeed:b.rotateSpeed||1,zoomSpeed:b.zoomSpeed||1,translateSpeed:b.translateSpeed||1,flipX:!!b.flipX,flipY:!!b.flipY,modes:d.modes,tick:function(){var b=e(),c=this.delay,f=b-2*c;d.idle(b-c),d.recalcMatrix(f),d.flush(b-(100+2*c));for(var g=!0,h=d.computedMatrix,m=0;16>m;++m)g=g&&i[m]===h[m],i[m]=h[m];var n=a.clientWidth===k&&a.clientHeight===l;return k=a.clientWidth,l=a.clientHeight,g?!n:(j=Math.exp(d.computedRadius[0]),!0)},lookAt:function(a,b,c){d.lookAt(d.lastT(),a,b,c)},rotate:function(a,b,c){d.rotate(d.lastT(),a,b,c)},pan:function(a,b,c){d.pan(d.lastT(),a,b,c)},translate:function(a,b,c){d.translate(d.lastT(),a,b,c)}};Object.defineProperties(m,{matrix:{get:function(){return d.computedMatrix},set:function(a){return d.setMatrix(d.lastT(),a),d.computedMatrix},enumerable:!0},mode:{get:function(){return d.getMode()},set:function(a){var b=d.computedUp.slice(),c=d.computedEye.slice(),f=d.computedCenter.slice();if(d.setMode(a),"turntable"===a){var g=e();d._active.lookAt(g,c,f,b),d._active.lookAt(g+500,c,f,[0,0,1]),d._active.flush(g)}return d.getMode()},enumerable:!0},center:{get:function(){return d.computedCenter},set:function(a){return d.lookAt(d.lastT(),null,a),d.computedCenter},enumerable:!0},eye:{get:function(){return d.computedEye},set:function(a){return d.lookAt(d.lastT(),a),d.computedEye},enumerable:!0},up:{get:function(){return d.computedUp},set:function(a){return d.lookAt(d.lastT(),null,null,a),d.computedUp},enumerable:!0},distance:{get:function(){return j},set:function(a){return d.setDistance(d.lastT(),a),a},enumerable:!0},distanceLimits:{get:function(){return d.getDistanceLimits(c)},set:function(a){return d.setDistanceLimits(a),a},enumerable:!0}}),a.addEventListener("contextmenu",function(a){return a.preventDefault(),!1});var n=0,o=0;return g(a,function(b,c,f,g){var h="rotate"===m.keyBindingMode,i="pan"===m.keyBindingMode,k="zoom"===m.keyBindingMode,l=!!g.control,p=!!g.alt,q=!!g.shift,r=!!(1&b),s=!!(2&b),t=!!(4&b),u=1/a.clientHeight,v=u*(c-n),w=u*(f-o),x=m.flipX?1:-1,y=m.flipY?1:-1,z=e(),A=Math.PI*m.rotateSpeed;if((h&&r&&!l&&!p&&!q||r&&!l&&!p&&q)&&d.rotate(z,x*A*v,-y*A*w,0),(i&&r&&!l&&!p&&!q||s||r&&l&&!p&&!q)&&d.pan(z,-m.translateSpeed*v*j,m.translateSpeed*w*j,0),k&&r&&!l&&!p&&!q||t||r&&!l&&p&&!q){var B=-m.zoomSpeed*w/window.innerHeight*(z-d.lastT())*100;d.pan(z,0,0,j*(Math.exp(B)-1))}return n=c,o=f,!0}),h(a,function(a,b){var c=m.flipX?1:-1,f=m.flipY?1:-1,g=e();if(Math.abs(a)>Math.abs(b))d.rotate(g,0,0,-a*c*Math.PI*m.rotateSpeed/window.innerWidth);else{var h=-m.zoomSpeed*f*b/window.innerHeight*(g-d.lastT())/100;d.pan(g,0,0,j*(Math.exp(h)-1))}},!0),m}b.exports=d;var e=a("right-now"),f=a("3d-view"),g=a("mouse-change"),h=a("mouse-wheel")},{"3d-view":38,"mouse-change":196,"mouse-wheel":200,"right-now":210}],400:[function(a,b,c){"use strict";var d=a("./scene"),e=a("../plots"),f=["xaxis","yaxis","zaxis"];c.name="gl3d",c.attr="scene",c.idRoot="scene",c.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,c.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,c.attributes=a("./layout/attributes"),c.layoutAttributes=a("./layout/layout_attributes"),c.supplyLayoutDefaults=a("./layout/defaults"), 53 c.plot=function(a){var b=a._fullLayout,c=a._fullData,f=e.getSubplotIds(b,"gl3d");b._paperdiv.style({width:b.width+"px",height:b.height+"px"}),a._context.setBackground(a,b.paper_bgcolor);for(var g=0;g<f.length;g++){var h=f[g],i=e.getSubplotData(c,"gl3d",h),j=b[h]._scene;void 0===j&&(j=new d({id:h,graphDiv:a,container:a.querySelector(".gl-container"),staticPlot:a._context.staticPlot,plotGlPixelRatio:a._context.plotGlPixelRatio},b),b[h]._scene=j),j.plot(i,b,a.layout)}},c.clean=function(a,b,c,d){for(var f=e.getSubplotIds(d,"gl3d"),g=0;g<f.length;g++){var h=f[g];!b[h]&&d[h]._scene&&d[h]._scene.destroy()}},c.cleanId=function(a){if(a.match(/^scene[0-9]*$/)){var b=a.substr(5);return"1"===b&&(b=""),"scene"+b}},c.setConvert=a("./set_convert"),c.initAxes=function(a){for(var b=a._fullLayout,c=e.getSubplotIds(b,"gl3d"),d=0;d<c.length;++d)for(var g=c[d],h=b[g],i=0;3>i;++i){var j=f[i],k=h[j];k._td=a}}},{"../plots":413,"./layout/attributes":401,"./layout/defaults":405,"./layout/layout_attributes":406,"./scene":410,"./set_convert":411}],401:[function(a,b,c){"use strict";b.exports={scene:{valType:"sceneid",dflt:"scene"}}},{}],402:[function(a,b,c){"use strict";var d=a("../../cartesian/layout_attributes"),e=a("../../../lib/extend").extendFlat;b.exports={showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:"rgb(0,0,0)"},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},title:d.title,titlefont:d.titlefont,type:d.type,autorange:d.autorange,rangemode:d.rangemode,range:d.range,fixedrange:d.fixedrange,tickmode:d.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:d.ticks,mirror:d.mirror,ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,showticklabels:d.showticklabels,tickfont:d.tickfont,tickangle:d.tickangle,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,showexponent:d.showexponent,exponentformat:d.exponentformat,tickformat:d.tickformat,hoverformat:d.hoverformat,showline:d.showline,linecolor:d.linecolor,linewidth:d.linewidth,showgrid:d.showgrid,gridcolor:e({},d.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:d.gridwidth,zeroline:d.zeroline,zerolinecolor:d.zerolinecolor,zerolinewidth:d.zerolinewidth}},{"../../../lib/extend":345,"../../cartesian/layout_attributes":376}],403:[function(a,b,c){"use strict";var d=a("../../../lib"),e=a("./axis_attributes"),f=a("../../cartesian/axis_defaults"),g=["xaxis","yaxis","zaxis"],h=function(){};b.exports=function(a,b,c){function i(a,b){return d.coerce(j,k,e,a,b)}for(var j,k,l=0;l<g.length;l++){var m=g[l];j=a[m]||{},k={_id:m[0]+c.scene,_name:m},b[m]=k=f(j,k,i,{font:c.font,letter:m[0],data:c.data,showGrid:!0}),i("gridcolor"),i("title",m[0]),k.setScale=h,i("showspikes")&&(i("spikesides"),i("spikethickness"),i("spikecolor")),i("showbackground")&&i("backgroundcolor"),i("showaxeslabels")}}},{"../../../lib":349,"../../cartesian/axis_defaults":370,"./axis_attributes":402}],404:[function(a,b,c){"use strict";function d(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=i(this.tickPad),this._defaultLabelPad=i(this.labelPad),this._defaultLineTickLength=i(this.lineTickLength)}function e(a){var b=new d;return b.merge(a),b}var f=a("arraytools"),g=a("../../../lib/html2unicode"),h=a("../../../lib/str2rgbarray"),i=f.copy1D,j=["xaxis","yaxis","zaxis"],k=d.prototype;k.merge=function(a){for(var b=this,c=0;3>c;++c){var d=a[j[c]];b.labels[c]=g(d.title),"titlefont"in d&&(d.titlefont.color&&(b.labelColor[c]=h(d.titlefont.color)),d.titlefont.family&&(b.labelFont[c]=d.titlefont.family),d.titlefont.size&&(b.labelSize[c]=d.titlefont.size)),"showline"in d&&(b.lineEnable[c]=d.showline),"linecolor"in d&&(b.lineColor[c]=h(d.linecolor)),"linewidth"in d&&(b.lineWidth[c]=d.linewidth),"showgrid"in d&&(b.gridEnable[c]=d.showgrid),"gridcolor"in d&&(b.gridColor[c]=h(d.gridcolor)),"gridwidth"in d&&(b.gridWidth[c]=d.gridwidth),"log"===d.type?b.zeroEnable[c]=!1:"zeroline"in d&&(b.zeroEnable[c]=d.zeroline),"zerolinecolor"in d&&(b.zeroLineColor[c]=h(d.zerolinecolor)),"zerolinewidth"in d&&(b.zeroLineWidth[c]=d.zerolinewidth),"ticks"in d&&d.ticks?b.lineTickEnable[c]=!0:b.lineTickEnable[c]=!1,"ticklen"in d&&(b.lineTickLength[c]=b._defaultLineTickLength[c]=d.ticklen),"tickcolor"in d&&(b.lineTickColor[c]=h(d.tickcolor)),"tickwidth"in d&&(b.lineTickWidth[c]=d.tickwidth),"tickangle"in d&&(b.tickAngle[c]="auto"===d.tickangle?0:Math.PI*-d.tickangle/180),"showticklabels"in d&&(b.tickEnable[c]=d.showticklabels),"tickfont"in d&&(d.tickfont.color&&(b.tickColor[c]=h(d.tickfont.color)),d.tickfont.family&&(b.tickFont[c]=d.tickfont.family),d.tickfont.size&&(b.tickSize[c]=d.tickfont.size)),"mirror"in d?-1!==["ticks","all","allticks"].indexOf(d.mirror)?(b.lineTickMirror[c]=!0,b.lineMirror[c]=!0):d.mirror===!0?(b.lineTickMirror[c]=!1,b.lineMirror[c]=!0):(b.lineTickMirror[c]=!1,b.lineMirror[c]=!1):b.lineMirror[c]=!1,"showbackground"in d&&d.showbackground!==!1?(b.backgroundEnable[c]=!0,b.backgroundColor[c]=h(d.backgroundcolor)):b.backgroundEnable[c]=!1}},b.exports=e},{"../../../lib/html2unicode":348,"../../../lib/str2rgbarray":359,arraytools:48}],405:[function(a,b,c){"use strict";var d=a("../../../lib"),e=a("../../plots"),f=a("./layout_attributes"),g=a("./axis_defaults");b.exports=function(a,b,c){function h(a,b){return d.coerce(j,k,f,a,b)}function i(c){var d=!(b._hasCartesian||b._hasGeo||b._hasGL2D||b._hasPie),e=-1!==f[c].values.indexOf(a[c]);return d&&e?a[c]:void 0}if(b._hasGL3D)for(var j,k,l=e.findSubplotIds(c,"gl3d"),m=l.length,n=0;m>n;n++){var o=l[n];a[o]?j=a[o]:a[o]=j={},k=b[o]||{},h("bgcolor");for(var p=Object.keys(f.camera),q=0;q<p.length;q++)h("camera."+p[q]+".x"),h("camera."+p[q]+".y"),h("camera."+p[q]+".z");h("domain.x",[n/m,(n+1)/m]),h("domain.y");var r=!!h("aspectratio.x")&&!!h("aspectratio.y")&&!!h("aspectratio.z"),s=r?"manual":"auto",t=h("aspectmode",s);r||(j.aspectratio=k.aspectratio={x:1,y:1,z:1},"manual"===t&&(k.aspectmode="auto")),g(j,k,{font:b.font,scene:o,data:c}),h("dragmode",i("dragmode")),h("hovermode",i("hovermode")),b[o]=k}}},{"../../../lib":349,"../../plots":413,"./axis_defaults":403,"./layout_attributes":406}],406:[function(a,b,c){"use strict";function d(a,b,c){return{x:{valType:"number",dflt:a},y:{valType:"number",dflt:b},z:{valType:"number",dflt:c}}}var e=a("./axis_attributes"),f=a("../../../lib/extend").extendFlat;b.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:f(d(0,0,1),{}),center:f(d(0,0,0),{}),eye:f(d(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:e,yaxis:e,zaxis:e,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan"],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":345,"./axis_attributes":402}],407:[function(a,b,c){"use strict";function d(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function e(a){var b=new d;return b.merge(a),b}var f=a("../../../lib/str2rgbarray"),g=["xaxis","yaxis","zaxis"],h=d.prototype;h.merge=function(a){for(var b=0;3>b;++b){var c=a[g[b]];this.enabled[b]=c.showspikes,this.colors[b]=f(c.spikecolor),this.drawSides[b]=c.spikesides,this.lineWidth[b]=c.spikethickness}},b.exports=e},{"../../../lib/str2rgbarray":359}],408:[function(a,b,c){"use strict";function d(a){for(var b=new Array(3),c=0;3>c;++c){for(var d=a[c],e=new Array(d.length),f=0;f<d.length;++f)e[f]=d[f].x;b[c]=e}return b}function e(a){for(var b=a.axesOptions,c=a.glplot.axesPixels,e=a.fullSceneLayout,j=[[],[],[]],k=0;3>k;++k){var l=e[h[k]];if(l._length=(c[k].hi-c[k].lo)*c[k].pixelsPerDataUnit/a.dataScale[k],Math.abs(l._length)===1/0)j[k]=[];else{l.range[0]=c[k].lo/a.dataScale[k],l.range[1]=c[k].hi/a.dataScale[k],l._m=1/(a.dataScale[k]*c[k].pixelsPerDataUnit),l.range[0]===l.range[1]&&(l.range[0]-=1,l.range[1]+=1);var m=l.tickmode;if("auto"===l.tickmode){l.tickmode="linear";var n=l.nticks||f.Lib.constrain(l._length/40,4,9);f.Axes.autoTicks(l,Math.abs(l.range[1]-l.range[0])/n)}for(var o=f.Axes.calcTicks(l),p=0;p<o.length;++p)o[p].x=o[p].x*a.dataScale[k],o[p].text=g(o[p].text);j[k]=o,l.tickmode=m}}b.ticks=j;for(var k=0;3>k;++k){i[k]=.5*(a.glplot.bounds[0][k]+a.glplot.bounds[1][k]);for(var p=0;2>p;++p)b.bounds[p][k]=a.glplot.bounds[p][k]}a.contourLevels=d(j)}b.exports=e;var f=a("../../../plotly"),g=a("../../../lib/html2unicode"),h=["xaxis","yaxis","zaxis"],i=[0,0,0]},{"../../../lib/html2unicode":348,"../../../plotly":366}],409:[function(a,b,c){"use strict";function d(a,b){var c,d,e=[0,0,0,0];for(c=0;4>c;++c)for(d=0;4>d;++d)e[d]+=a[4*c+d]*b[c];return e}function e(a,b){var c=d(a.projection,d(a.view,d(a.model,[b[0],b[1],b[2],1])));return c}b.exports=e},{}],410:[function(a,b,c){"use strict";function d(a){function b(b,c){if("string"==typeof c)return c;var d=a.fullSceneLayout[b];return n.tickText(d,d.c2l(c),"hover").text}var c=a.svgContainer,d=a.container.getBoundingClientRect(),e=d.width,f=d.height;c.setAttributeNS(null,"viewBox","0 0 "+e+" "+f),c.setAttributeNS(null,"width",e),c.setAttributeNS(null,"height",f),w(a),a.glplot.axes.update(a.axesOptions);for(var g=Object.keys(a.traces),h=null,i=a.glplot.selection,j=0;j<g.length;++j){var k=a.traces[g[j]];k.handlePick(i)&&(h=k),k.setContourLevels&&k.setContourLevels()}var l;if(null!==h){var m=s(a.glplot.cameraParams,i.dataCoordinate),k=h.data,p=k.hoverinfo,q=b("xaxis",i.traceCoordinate[0]),r=b("yaxis",i.traceCoordinate[1]),t=b("zaxis",i.traceCoordinate[2]);if("all"!==p){var u=p.split("+");-1===u.indexOf("x")&&(q=void 0),-1===u.indexOf("y")&&(r=void 0),-1===u.indexOf("z")&&(t=void 0),-1===u.indexOf("text")&&(i.textLabel=void 0),-1===u.indexOf("name")&&(h.name=void 0)}a.fullSceneLayout.hovermode&&o.loneHover({x:(.5+.5*m[0]/m[3])*e,y:(.5-.5*m[1]/m[3])*f,xLabel:q,yLabel:r,zLabel:t,text:i.textLabel,name:h.name,color:h.color},{container:c});var v={points:[{x:q,y:r,z:t,data:k._input,fullData:k,curveNumber:k.index,pointNumber:i.data.index}]};i.buttons&&i.distance<5?a.graphDiv.emit("plotly_click",v):a.graphDiv.emit("plotly_hover",v),l=v}else o.loneUnhover(c),a.graphDiv.emit("plotly_unhover",l)}function e(a,b,c,e){var f={canvas:c,gl:e,container:a.container,axes:a.axesOptions,spikes:a.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(a.staticMode){if(!j){i=document.createElement("canvas");try{j=i.getContext("webgl",{preserveDrawingBuffer:!0,premultipliedAlpha:!0})}catch(g){throw new Error("error creating static canvas/context for image server")}}f.pixelRatio=a.pixelRatio,f.gl=j,f.canvas=i}try{a.glplot=k(f)}catch(g){q(a)}if(a.staticMode||a.glplot.canvas.addEventListener("webglcontextlost",function(a){console.log("lost context"),a.preventDefault()}),!a.camera){var h=a.fullSceneLayout.camera;a.camera=r(a.container,{center:[h.center.x,h.center.y,h.center.z],eye:[h.eye.x,h.eye.y,h.eye.z],up:[h.up.x,h.up.y,h.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return a.glplot.mouseListener.enabled=!1,a.glplot.camera=a.camera,a.glplot.oncontextloss=function(){a.recoverContext()},a.glplot.onrender=d.bind(null,a),a.traces={},!0}function f(a,b){var c=document.createElement("div"),d=a.container;this.graphDiv=a.graphDiv;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.style.position="absolute",f.style.top=f.style.left="0px",f.style.width=f.style.height="100%",f.style["z-index"]=20,f.style["pointer-events"]="none",c.appendChild(f),this.svgContainer=f,c.id=a.id,c.style.position="absolute",c.style.top=c.style.left="0px",c.style.width=c.style.height="100%",d.appendChild(c),this.fullLayout=b,this.id=a.id||"scene",this.fullSceneLayout=b[this.id],this.plotArgs=[[],{},{}],this.axesOptions=u(b[this.id]),this.spikeOptions=v(b[this.id]),this.container=c,this.staticMode=!!a.staticPlot,this.pixelRatio=a.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],!e(this,b)}function g(a,b,c,d){for(var e=0;e<b.length;++e)if(Array.isArray(b[e]))for(var f=0;f<b[e].length;++f){var g=a.d2l(b[e][f]);!isNaN(g)&&isFinite(g)&&(d[0][c]=Math.min(d[0][c],g),d[1][c]=Math.max(d[1][c],g))}else{var g=a.d2l(b[e]);!isNaN(g)&&isFinite(g)&&(d[0][c]=Math.min(d[0][c],g),d[1][c]=Math.max(d[1][c],g))}}function h(a,b,c){var d=a.fullSceneLayout;g(d.xaxis,b.x,0,c),g(d.yaxis,b.y,1,c),g(d.zaxis,b.z,2,c)}var i,j,k=a("gl-plot3d"),l=a("../../lib"),m=a("../../plots/plots"),n=a("../../plots/cartesian/axes"),o=a("../../plots/cartesian/graph_interact"),p=a("../../lib/str2rgbarray"),q=a("../../lib/show_no_webgl_msg"),r=a("./camera"),s=a("./project"),t=a("./set_convert"),u=a("./layout/convert"),v=a("./layout/spikes"),w=a("./layout/tick_marks"),x=f.prototype;x.recoverContext=function(){function a(){return c.isContextLost()?void requestAnimationFrame(a):e(b,b.fullLayout,d,c)?void b.plot.apply(b,b.plotArgs):void console.error("catastrophic/unrecoverable webgl error. context lost.")}var b=this,c=this.glplot.gl,d=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(a)};var y=["xaxis","yaxis","zaxis"];x.plot=function(a,b,c){if(this.plotArgs=[a,b,c],!this.glplot.contextLost){var d,e,f,g,i=b[this.id],j=c[this.id];for(i.bgcolor?this.glplot.clearColor=p(i.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullSceneLayout=i,this.glplotLayout=i,this.axesOptions.merge(i),this.spikeOptions.merge(i),this.updateFx(i.dragmode,i.hovermode),this.glplot.update({}),f=0;3>f;++f){var k=i[y[f]];t(k)}a?Array.isArray(a)||(a=[a]):a=[];for(var l=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],f=0;f<a.length;++f){var d=a[f];d.visible===!0&&h(this,d,l)}for(var n=[1,1,1],g=0;3>g;++g)l[0][g]>l[1][g]?n[g]=1:l[1][g]===l[0][g]?n[g]=1:n[g]=1/(l[1][g]-l[0][g]);this.dataScale=n;for(var f=0;f<a.length;++f)if(d=a[f],d.visible===!0){if(e=this.traces[d.uid])e.update(d);else{var o=m.getModule(d.type);e=o.plot(this,d),this.traces[d.uid]=e}e.name=d.name}var q=Object.keys(this.traces);a:for(f=0;f<q.length;++f){for(g=0;g<a.length;++g)if(a[g].uid===q[f]&&a[g].visible===!0)continue a;e=this.traces[q[f]],e.dispose(),delete this.traces[q[f]]}var r=[[0,0,0],[0,0,0]],s=[],u={};for(f=0;3>f;++f){var k=i[y[f]],v=k.type;if(v in u?(u[v].acc*=n[f],u[v].count+=1):u[v]={acc:n[f],count:1},k.autorange){for(r[0][f]=1/0,r[1][f]=-(1/0),g=0;g<this.glplot.objects.length;++g){var w=this.glplot.objects[g].bounds;r[0][f]=Math.min(r[0][f],w[0][f]/n[f]),r[1][f]=Math.max(r[1][f],w[1][f]/n[f])}if("rangemode"in k&&"tozero"===k.rangemode&&(r[0][f]=Math.min(r[0][f],0),r[1][f]=Math.max(r[1][f],0)),r[0][f]>r[1][f])r[0][f]=-1,r[1][f]=1;else{var x=r[1][f]-r[0][f];r[0][f]-=x/32,r[1][f]+=x/32}}else{var z=i[y[f]].range;r[0][f]=z[0],r[1][f]=z[1]}r[0][f]===r[1][f]&&(r[0][f]-=1,r[1][f]+=1),s[f]=r[1][f]-r[0][f],this.glplot.bounds[0][f]=r[0][f]*n[f],this.glplot.bounds[1][f]=r[1][f]*n[f]}for(var A=[1,1,1],f=0;3>f;++f){var k=i[y[f]],v=k.type,B=u[v];A[f]=Math.pow(B.acc,1/B.count)/n[f]}var C,D=4;if("auto"===i.aspectmode)C=Math.max.apply(null,A)/Math.min.apply(null,A)<=D?A:[1,1,1];else if("cube"===i.aspectmode)C=[1,1,1];else if("data"===i.aspectmode)C=A;else{if("manual"!==i.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var E=i.aspectratio;C=[E.x,E.y,E.z]}i.aspectratio.x=j.aspectratio.x=C[0],i.aspectratio.y=j.aspectratio.y=C[1],i.aspectratio.z=j.aspectratio.z=C[2],this.glplot.aspect=C;var F=i.domain||null,G=b._size||null;if(F&&G){var H=this.container.style;H.position="absolute",H.left=G.l+F.x[0]*G.w+"px",H.top=G.t+(1-F.y[1])*G.h+"px",H.width=G.w*(F.x[1]-F.x[0])+"px",H.height=G.h*(F.y[1]-F.y[0])+"px"}}},x.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},x.setCameraToDefault=function(){this.glplot.camera.lookAt([1.25,1.25,1.25],[0,0,0],[0,0,1])},x.getCamera=function(){this.glplot.camera.view.recalcMatrix(this.camera.view.lastT());var a=this.glplot.camera.up,b=this.glplot.camera.center,c=this.glplot.camera.eye;return{up:{x:a[0],y:a[1],z:a[2]},center:{x:b[0],y:b[1],z:b[2]},eye:{x:c[0],y:c[1],z:c[2]}}},x.setCamera=function(a){var b=a.up,c=a.center,d=a.eye;this.glplot.camera.lookAt([d.x,d.y,d.z],[c.x,c.y,c.z],[b.x,b.y,b.z])},x.saveCamera=function(a){function b(a,b,c,d){var e=["up","center","eye"],f=["x","y","z"];return a[e[c]][f[d]]===b[e[c]][f[d]]}var c=this.getCamera(),d=l.nestedProperty(a,this.id+".camera"),e=d.get(),f=!1;if(void 0===e)f=!0;else for(var g=0;3>g;g++)for(var h=0;3>h;h++)if(!b(c,e,g,h)){f=!0;break}return f&&d.set(c),f},x.updateFx=function(a,b){var c=this.camera;c&&("orbit"===a?(c.mode="orbit",c.keyBindingMode="rotate"):"turntable"===a?(c.up=[0,0,1],c.mode="turntable",c.keyBindingMode="rotate"):c.keyBindingMode=a),this.fullSceneLayout.hovermode=b},x.toImage=function(a){a||(a="png"),this.staticMode&&this.container.appendChild(i),this.glplot.redraw();var b=this.glplot.gl,c=b.drawingBufferWidth,d=b.drawingBufferHeight;b.bindFramebuffer(b.FRAMEBUFFER,null);var e=new Uint8Array(c*d*4);b.readPixels(0,0,c,d,b.RGBA,b.UNSIGNED_BYTE,e);for(var f=0,g=d-1;g>f;++f,--g)for(var h=0;c>h;++h)for(var j=0;4>j;++j){var k=e[4*(c*f+h)+j];e[4*(c*f+h)+j]=e[4*(c*g+h)+j],e[4*(c*g+h)+j]=k}var l=document.createElement("canvas");l.width=c,l.height=d;var m=l.getContext("2d"),n=m.createImageData(c,d);n.data.set(e),m.putImageData(n,0,0);var o;switch(a){case"jpeg":o=l.toDataURL("image/jpeg");break;case"webp":o=l.toDataURL("image/webp");break;default:o=l.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(i),o},b.exports=f},{"../../lib":349,"../../lib/show_no_webgl_msg":357,"../../lib/str2rgbarray":359,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"../../plots/plots":413,"./camera":399,"./layout/convert":404,"./layout/spikes":407,"./layout/tick_marks":408,"./project":409,"./set_convert":411,"gl-plot3d":140}],411:[function(a,b,c){"use strict";var d=a("../cartesian/axes"),e=function(){};b.exports=function(a){d.setConvert(a),a.setScale=e}},{"../cartesian/axes":369}],412:[function(a,b,c){"use strict";var d=a("../plotly"),e=a("./font_attributes"),f=a("../components/color/attributes"),g=d.Lib.extendFlat;b.exports={font:{family:g({},e.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:g({},e.size,{dflt:12}),color:g({},e.color,{dflt:f.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:g({},e,{}),autosize:{valType:"enumerated",values:[!0,!1,"initial"]},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:f.background},plot_bgcolor:{valType:"color",dflt:f.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"},_hasCartesian:{valType:"boolean",dflt:!1},_hasGL3D:{valType:"boolean",dflt:!1},_hasGeo:{valType:"boolean",dflt:!1},_hasPie:{valType:"boolean",dflt:!1},_hasGL2D:{valType:"boolean",dflt:!1},_composedModules:{"*":"Fx"},_nestedModules:{xaxis:"Axes",yaxis:"Axes",scene:"gl3d",geo:"geo",legend:"Legend",annotations:"Annotations",shapes:"Shapes"}}},{"../components/color/attributes":298,"../plotly":366,"./font_attributes":383}],413:[function(a,b,c){"use strict";function d(a){return"object"==typeof a&&(a=a.type),a}function e(a,b){b.text("");var c=b.append("a").attr({"xlink:xlink:href":"#","class":"link--impt link--embedview","font-weight":"bold"}).text(a._context.linkText+" "+String.fromCharCode(187));if(a._context.sendData)c.on("click",function(){l.sendDataToCloud(a)});else{var d=window.location.pathname.split("/"),e=window.location.search;c.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+d[2].split(".")[0]+"/"+d[1]+e})}}function f(a,b,c,d){var e,f,g=Object.keys(p);for(e=0;e<g.length;e++){var h=p[g[e]];h.clean&&h.clean(a,b,c,d)}var i=!!d._paper,j=!!d._infolayer;a:for(e=0;e<c.length;e++){var k=c[e],l=k.uid;for(f=0;f<a.length;f++){var m=a[f];if(l===m.uid)continue a}i&&d._paper.selectAll(".hm"+l+",.contour"+l+",#clip"+l).remove(),j&&d._infolayer.selectAll(".cb"+l).remove()}}function g(a,b){for(var c,d=Object.keys(b),e=0;e<d.length;++e){var f=d[e];if("_"===f.charAt(0)||"function"==typeof b[f]){if(f in a)continue;a[f]=b[f]}else if(Array.isArray(b[f])&&Array.isArray(a[f])&&b[f].length&&k.isPlainObject(b[f][0])){if(b[f].length!==a[f].length)throw new Error("relinkPrivateKeys needs equal length arrays");for(c=0;c<b[f].length;c++)g(a[f][c],b[f][c])}else k.isPlainObject(b[f])&&k.isPlainObject(a[f])&&(g(a[f],b[f]),Object.keys(a[f]).length||delete a[f])}}var h=a("../plotly"),i=a("d3"),j=a("fast-isnumeric"),k=a("../lib"),l=b.exports={},m=l.modules={},n=l.allTypes=[],o=l.allCategories={},p=l.subplotsRegistry={};l.attributes=a("./attributes"),l.attributes.type.values=n,l.fontAttrs=a("./font_attributes"),l.layoutAttributes=a("./layout_attributes"),l.fontWeight="normal",l.register=function(a,b,c,d){if(m[b])return void console.log("type "+b+" already registered");for(var e={},f=0;f<c.length;f++)e[c[f]]=!0,o[c[f]]=!0;m[b]={_module:a,categories:e},d&&Object.keys(d).length&&(m[b].meta=d),n.push(b)},l.getModule=function(a){if(void 0!==a.r)return console.log("Oops, tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",a),!1;var b=m[d(a)];return b?b._module:!1},l.traceIs=function(a,b){if(a=d(a),"various"===a)return!1;var c=m[a];return c||(void 0!==a&&console.warn("unrecognized trace type "+a),c=m[l.attributes.type.dflt]),!!c.categories[b]},l.registerSubplot=function(a){var b=a.name;return p[b]?void console.log("plot type "+b+" already registered"):void(p[b]=a)},l.findSubplotIds=function(a,b){var c=[];if(void 0===l.subplotsRegistry[b])return c;for(var d=l.subplotsRegistry[b].attr,e=0;e<a.length;e++){var f=a[e];l.traceIs(f,b)&&-1===c.indexOf(f[d])&&c.push(f[d])}return c},l.getSubplotIds=function(a,b){var c=l.subplotsRegistry[b];if(void 0===c)return[];if("cartesian"===b&&!a._hasCartesian)return[];if("gl2d"===b&&!a._hasGL2D)return[];if("cartesian"===b||"gl2d"===b)return Object.keys(a._plots);for(var d=c.idRegex,e=Object.keys(a),f=[],g=0;g<e.length;g++){var h=e[g];d.test(h)&&f.push(h)}var i=c.idRoot.length;return f.sort(function(a,b){var c=+(a.substr(i)||1),d=+(b.substr(i)||1);return c-d}),f},l.getSubplotData=function(a,b,c){if(void 0===l.subplotsRegistry[b])return[];for(var d,e=l.subplotsRegistry[b].attr,f=[],g=0;g<a.length;g++)if(d=a[g],"gl2d"===b&&l.traceIs(d,"gl2d")){var i=h.Axes.subplotMatch,j="x"+c.match(i)[1],k="y"+c.match(i)[2];d[e[0]]===j&&d[e[1]]===k&&f.push(d)}else d[e]===c&&f.push(d);return f},l.redrawText=function(a){return a._fullLayout._hasGL3D||a.data&&a.data[0]&&a.data[0].r?void 0:new Promise(function(b){setTimeout(function(){h.Annotations.drawAll(a),h.Legend.draw(a),(a.calcdata||[]).forEach(function(a){a[0]&&a[0].t&&a[0].t.cb&&a[0].t.cb()}),b(l.previousPromises(a))},300)})},l.resize=function(a){return new Promise(function(b,c){a&&"none"!==i.select(a).style("display")||c(new Error("Resize must be passed a plot div element.")),a._redrawTimer&&clearTimeout(a._redrawTimer),a._redrawTimer=setTimeout(function(){if((a._fullLayout||{}).autosize){var c=a.changed;a.autoplay=!0,h.relayout(a,{autosize:!0}),a.changed=c,b(a)}},100)})},l.previousPromises=function(a){return(a._promises||[]).length?Promise.all(a._promises).then(function(){a._promises=[]}):void 0},l.addLinks=function(a){var b=a._fullLayout,c=b._paper.selectAll("text.js-plot-link-container").data([0]);c.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.Color.defaultLine,"pointer-events":"all"}).each(function(){var a=i.select(this);a.append("tspan").classed("js-link-to-tool",!0),a.append("tspan").classed("js-link-spacer",!0),a.append("tspan").classed("js-sourcelinks",!0)});var d=c.node(),f={y:b._paper.attr("height")-9};d&&d.getComputedTextLength()>=b.width-20?(f["text-anchor"]="start",f.x=5):(f["text-anchor"]="end",f.x=b._paper.attr("width")-7),c.attr(f);var g=c.select(".js-link-to-tool"),j=c.select(".js-link-spacer"),k=c.select(".js-sourcelinks");a._context.showSources&&a._context.showSources(a),a._context.showLink&&e(a,g),j.text(g.text()&&k.text()?" - ":"")},l.sendDataToCloud=function(a){a.emit("plotly_beforeexport");var b=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",c=i.select(a).append("div").attr("id","hiddenform").style("display","none"),d=c.append("form").attr({action:b+"/external",method:"post",target:"_blank"}),e=d.append("input").attr({type:"text",name:"data"});return e.node().value=l.graphJson(a,!1,"keepdata"),d.node().submit(),c.remove(),a.emit("plotly_afterexport"),!1},l.supplyDefaults=function(a){var b,c,d,e,i,j,k=a._fullLayout||{},m=a._fullLayout={},n=a.layout||{},o=a._fullData||[],p=a._fullData=[],q=a.data||[],r=a._modules=[];for(l.supplyLayoutGlobalDefaults(n,m),m._dataLength=q.length,b=0;b<q.length;b++)c=q[b],d=l.supplyDataDefaults(c,b,m),p.push(d),l.traceIs(d,"cartesian")?m._hasCartesian=!0:l.traceIs(d,"gl3d")?m._hasGL3D=!0:l.traceIs(d,"geo")?m._hasGeo=!0:l.traceIs(d,"pie")?m._hasPie=!0:l.traceIs(d,"gl2d")?m._hasGL2D=!0:"r"in d&&(m._hasPolar=!0),e=d._module,e&&-1===r.indexOf(e)&&r.push(e);for(b=0;b<r.length;b++)e=r[b],e.cleanData&&e.cleanData(p);if(o.length===q.length)for(b=0;b<p.length;b++)g(p[b],o[b]);for(l.supplyLayoutModuleDefaults(n,m,p),f(p,m,o,k),g(m,k),l.doAutoMargin(a),i=h.Axes.list(a),b=0;b<i.length;b++)j=i[b],j._td=a,j.setScale();if((a.calcdata||[]).length===p.length)for(b=0;b<p.length;b++)c=p[b],(a.calcdata[b][0]||{}).trace=c},l.supplyDataDefaults=function(a,b,c){function d(b,c){return k.coerce(a,f,l.attributes,b,c)}function e(b,c){return l.traceIs(f,b)?k.coerce(a,f,l.subplotsRegistry[b].attributes,c):void 0}var f={},g=h.Color.defaults[b%h.Color.defaults.length];f.index=b;var i,j,m=d("visible");return d("type"),d("uid"),e("gl3d","scene"),e("geo","geo"),(m||i)&&(j=l.getModule(f),f._module=j),m&&d("hoverinfo",1===c._dataLength?"x+y+z+text":void 0),j&&m&&j.supplyDefaults(a,f,g,c),m&&(d("name","trace "+b),l.traceIs(f,"noOpacity")||d("opacity"),e("cartesian","xaxis"),e("cartesian","yaxis"),e("gl2d","xaxis"),e("gl2d","yaxis"),l.traceIs(f,"showLegend")&&(d("showlegend"),d("legendgroup"))),f._input=a,f},l.supplyLayoutGlobalDefaults=function(a,b){function c(c,d){return k.coerce(a,b,l.layoutAttributes,c,d)}var d=k.coerceFont(c,"font");c("title"),k.coerceFont(c,"titlefont",{family:d.family,size:Math.round(1.4*d.size),color:d.color});var e=c("autosize",a.width&&a.height?!1:"initial");c("width"),c("height"),c("margin.l"),c("margin.r"),c("margin.t"),c("margin.b"),c("margin.pad"),c("margin.autoexpand"),"initial"!==e&&l.sanitizeMargins(b),c("paper_bgcolor"),c("separators"),c("hidesources"),c("smith"),c("_hasCartesian"),c("_hasGL3D"),c("_hasGeo"),c("_hasPie"),c("_hasGL2D")},l.supplyLayoutModuleDefaults=function(a,b,c){var d,e;h.Axes.supplyLayoutDefaults(a,b,c);var f=Object.keys(p);for(d=0;d<f.length;d++)e=p[f[d]],e.supplyLayoutDefaults&&e.supplyLayoutDefaults(a,b,c);var g=Object.keys(m);for(d=0;d<g.length;d++)e=m[n[d]]._module,e.supplyLayoutDefaults&&e.supplyLayoutDefaults(a,b,c);var i=["Fx","Annotations","Shapes","Legend"];for(d=0;d<i.length;d++)e=i[d],h[e]&&h[e].supplyLayoutDefaults(a,b,c)},l.purge=function(a){var b=a._fullLayout||{};void 0!==b._glcontainer&&b._glcontainer.remove(),void 0!==b._geocontainer&&b._geocontainer.remove(),b._modeBar&&b._modeBar.destroy(),delete a.data,delete a.layout,delete a._fullData,delete a._fullLayout,delete a.calcdata,delete a.framework,delete a.empty,delete a.fid,delete a.undoqueue,delete a.undonum,delete a.autoplay,delete a.changed,delete a._modules,delete a._tester,delete a._testref,delete a._promises,delete a._redrawTimer,delete a._replotting,delete a.firstscatter,delete a.hmlumcount,delete a.hmpixcount,delete a.numboxes,delete a._hoverTimer,delete a._lastHoverTime,a.removeAllListeners&&a.removeAllListeners()},l.style=function(a){for(var b=a._modules.concat(h.ErrorBars),c=0;c<b.length;c++){var d=b[c];d.style&&d.style(a)}},l.sanitizeMargins=function(a){if(a&&a.margin){var b,c=a.width,d=a.height,e=a.margin,f=c-(e.l+e.r),g=d-(e.t+e.b);0>f&&(b=(c-1)/(e.l+e.r),e.l=Math.floor(b*e.l),e.r=Math.floor(b*e.r)),0>g&&(b=(d-1)/(e.t+e.b),e.t=Math.floor(b*e.t),e.b=Math.floor(b*e.b))}},l.autoMargin=function(a,b,c){var d=a._fullLayout;if(d._pushmargin||(d._pushmargin={}),d.margin.autoexpand!==!1){if(c){var e=c.pad||12;c.l+c.r>.5*d.width&&(c.l=c.r=0),c.b+c.t>.5*d.height&&(c.b=c.t=0),d._pushmargin[b]={l:{val:c.x,size:c.l+e},r:{val:c.x,size:c.r+e},b:{val:c.y,size:c.b+e},t:{val:c.y,size:c.t+e}}}else delete d._pushmargin[b];a._replotting||l.doAutoMargin(a)}},l.doAutoMargin=function(a){var b=a._fullLayout;b._size||(b._size={}),b._pushmargin||(b._pushmargin={});var c=b._size,d=JSON.stringify(c),e=Math.max(b.margin.l||0,0),f=Math.max(b.margin.r||0,0),g=Math.max(b.margin.t||0,0),i=Math.max(b.margin.b||0,0),k=b._pushmargin;return b.margin.autoexpand!==!1&&(k.base={l:{val:0,size:e},r:{val:1,size:f},t:{val:1,size:g},b:{val:0,size:i}},Object.keys(k).forEach(function(a){var c=k[a].l||{},d=k[a].b||{},h=c.val,l=c.size,m=d.val,n=d.size;Object.keys(k).forEach(function(a){if(j(l)&&k[a].r){var c=k[a].r.val,d=k[a].r.size;if(c>h){var o=(l*c+(d-b.width)*h)/(c-h),p=(d*(1-h)+(l-b.width)*(1-c))/(c-h);o>=0&&p>=0&&o+p>e+f&&(e=o,f=p)}}if(j(n)&&k[a].t){var q=k[a].t.val,r=k[a].t.size;if(q>m){var s=(n*q+(r-b.height)*m)/(q-m),t=(r*(1-m)+(n-b.height)*(1-q))/(q-m);s>=0&&t>=0&&s+t>i+g&&(i=s,g=t)}}})})),c.l=Math.round(e),c.r=Math.round(f),c.t=Math.round(g),c.b=Math.round(i),c.p=Math.round(b.margin.pad),c.w=Math.round(b.width)-c.l-c.r,c.h=Math.round(b.height)-c.t-c.b,a._replotting||"{}"===d||d===JSON.stringify(b._size)?void 0:h.plot(a)},l.graphJson=function(a,b,c,d,e){function f(a){if("function"==typeof a)return null;if(k.isPlainObject(a)){var b,d,e={};for(b in a)if("function"!=typeof a[b]&&-1===["_","["].indexOf(b.charAt(0))){if("keepdata"===c){if("src"===b.substr(b.length-3))continue}else if("keepstream"===c){if(d=a[b+"src"],"string"==typeof d&&d.indexOf(":")>0&&!k.isPlainObject(a.stream))continue}else if("keepall"!==c&&(d=a[b+"src"],"string"==typeof d&&d.indexOf(":")>0))continue;e[b]=f(a[b])}return e}return Array.isArray(a)?a.map(f):a&&a.getTime?k.ms2DateTime(a):a}(e&&b&&!a._fullData||e&&!b&&!a._fullLayout)&&l.supplyDefaults(a); 54 var g=e?a._fullData:a.data,h=e?a._fullLayout:a.layout,i={data:(g||[]).map(function(a){var c=f(a);return b&&delete c.fit,c})};return b||(i.layout=f(h)),a.framework&&a.framework.isPolar&&(i=a.framework.getConfig()),"object"===d?i:JSON.stringify(i)}},{"../lib":349,"../plotly":366,"./attributes":367,"./font_attributes":383,"./layout_attributes":412,d3:70,"fast-isnumeric":74}],414:[function(a,b,c){"use strict";var d=a("../../traces/scatter/attributes"),e=d.marker;b.exports={r:d.r,t:d.t,marker:{color:e.color,size:e.size,symbol:e.symbol,opacity:e.opacity}}},{"../../traces/scatter/attributes":502}],415:[function(a,b,c){"use strict";function d(a,b){var c={showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}};return f({},b,c)}var e=a("../cartesian/layout_attributes"),f=a("../../lib/extend").extendFlat,g=f({},e.domain,{});b.exports={radialaxis:d("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:g,orientation:{valType:"number"}}),angularaxis:d("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:g}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":345,"../cartesian/layout_attributes":376}],416:[function(a,b,c){var d=a("../../plotly"),e=a("d3"),f=b.exports={version:"0.2.2",manager:a("./micropolar_manager")},g=d.Lib.extendDeepAll;f.Axis=function(){function a(a){c=a||c;var j=i.data,l=i.layout;return("string"==typeof c||c.nodeName)&&(c=e.select(c)),c.datum(j).each(function(a,c){function i(a,b){return h(a)%360+l.orientation}var j=a.slice();k={data:f.util.cloneJson(j),layout:f.util.cloneJson(l)};var m=0;j.forEach(function(a,b){a.color||(a.color=l.defaultColorRange[m],m=(m+1)%l.defaultColorRange.length),a.strokeColor||(a.strokeColor="LinePlot"===a.geometry?a.color:e.rgb(a.color).darker().toString()),k.data[b].color=a.color,k.data[b].strokeColor=a.strokeColor,k.data[b].strokeDash=a.strokeDash,k.data[b].strokeSize=a.strokeSize});var n=j.filter(function(a,b){var c=a.visible;return"undefined"==typeof c||c===!0}),o=!1,p=n.map(function(a,b){return o=o||"undefined"!=typeof a.groupId,a});if(o){var q=e.nest().key(function(a,b){return"undefined"!=typeof a.groupId?a.groupId:"unstacked"}).entries(p),r=[],s=q.map(function(a,b){if("unstacked"===a.key)return a.values;var c=a.values[0].r.map(function(a,b){return 0});return a.values.forEach(function(a,b,d){a.yStack=[c],r.push(c),c=f.util.sumArrays(a.r,c)}),a.values});n=e.merge(s)}n.forEach(function(a,b){a.t=Array.isArray(a.t[0])?a.t:[a.t],a.r=Array.isArray(a.r[0])?a.r:[a.r]});var t=Math.min(l.width-l.margin.left-l.margin.right,l.height-l.margin.top-l.margin.bottom)/2;t=Math.max(10,t);var u,v=[l.margin.left+t,l.margin.top+t];if(o){var w=e.max(f.util.sumArrays(f.util.arrayLast(n).r[0],f.util.arrayLast(r)));u=[0,w]}else u=e.extent(f.util.flattenArray(n.map(function(a,b){return a.r})));l.radialAxis.domain!=f.DATAEXTENT&&(u[0]=0),d=e.scale.linear().domain(l.radialAxis.domain!=f.DATAEXTENT&&l.radialAxis.domain?l.radialAxis.domain:u).range([0,t]),k.layout.radialAxis.domain=d.domain();var x,y=f.util.flattenArray(n.map(function(a,b){return a.t})),z="string"==typeof y[0];z&&(y=f.util.deduplicate(y),x=y.slice(),y=e.range(y.length),n=n.map(function(a,b){var c=a;return a.t=[y],o&&(c.yStack=a.yStack),c}));var A=n.filter(function(a,b){return"LinePlot"===a.geometry||"DotPlot"===a.geometry}).length===n.length,B=null===l.needsEndSpacing?z||!A:l.needsEndSpacing,C=l.angularAxis.domain&&l.angularAxis.domain!=f.DATAEXTENT&&!z&&l.angularAxis.domain[0]>=0,D=C?l.angularAxis.domain:e.extent(y),E=Math.abs(y[1]-y[0]);A&&!z&&(E=0);var F=D.slice();B&&z&&(F[1]+=E);var G=l.angularAxis.ticksCount||4;G>8&&(G=G/(G/8)+G%8),l.angularAxis.ticksStep&&(G=(F[1]-F[0])/G);var H=l.angularAxis.ticksStep||(F[1]-F[0])/(G*(l.minorTicks+1));x&&(H=Math.max(Math.round(H),1)),F[2]||(F[2]=H);var I=e.range.apply(this,F);if(I=I.map(function(a,b){return parseFloat(a.toPrecision(12))}),h=e.scale.linear().domain(F.slice(0,2)).range("clockwise"===l.direction?[0,360]:[360,0]),k.layout.angularAxis.domain=h.domain(),k.layout.angularAxis.endPadding=B?E:0,b=e.select(this).select("svg.chart-root"),"undefined"==typeof b||b.empty()){var J="<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>",K=(new DOMParser).parseFromString(J,"application/xml"),L=this.appendChild(this.ownerDocument.importNode(K.documentElement,!0));b=e.select(L)}b.select(".guides-group").style({"pointer-events":"none"}),b.select(".angular.axis-group").style({"pointer-events":"none"}),b.select(".radial.axis-group").style({"pointer-events":"none"});var M,N=b.select(".chart-group"),O={fill:"none",stroke:l.tickColor},P={"font-size":l.font.size,"font-family":l.font.family,fill:l.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(a,b){return" "+a+" 0 "+l.font.outlineColor}).join(",")};if(l.showLegend){M=b.select(".legend-group").attr({transform:"translate("+[t,l.margin.top]+")"}).style({display:"block"});var Q=n.map(function(a,b){var c=f.util.cloneJson(a);return c.symbol="DotPlot"===a.geometry?a.dotType||"circle":"LinePlot"!=a.geometry?"square":"line",c.visibleInLegend="undefined"==typeof a.visibleInLegend||a.visibleInLegend,c.color="LinePlot"===a.geometry?a.strokeColor:a.color,c});f.Legend().config({data:n.map(function(a,b){return a.name||"Element"+b}),legendConfig:g({},f.Legend.defaultConfig().legendConfig,{container:M,elements:Q,reverseOrder:l.legend.reverseOrder})})();var R=M.node().getBBox();t=Math.min(l.width-R.width-l.margin.left-l.margin.right,l.height-l.margin.top-l.margin.bottom)/2,t=Math.max(10,t),v=[l.margin.left+t,l.margin.top+t],d.range([0,t]),k.layout.radialAxis.domain=d.domain(),M.attr("transform","translate("+[v[0]+t,v[1]-t]+")")}else M=b.select(".legend-group").style({display:"none"});b.attr({width:l.width,height:l.height}).style({opacity:l.opacity}),N.attr("transform","translate("+v+")").style({cursor:"crosshair"});var S=[(l.width-(l.margin.left+l.margin.right+2*t+(R?R.width:0)))/2,(l.height-(l.margin.top+l.margin.bottom+2*t))/2];if(S[0]=Math.max(0,S[0]),S[1]=Math.max(0,S[1]),b.select(".outer-group").attr("transform","translate("+S+")"),l.title){var T=b.select("g.title-group text").style(P).text(l.title),U=T.node().getBBox();T.attr({x:v[0]-U.width/2,y:v[1]-t-20})}var V=b.select(".radial.axis-group");if(l.radialAxis.gridLinesVisible){var W=V.selectAll("circle.grid-circle").data(d.ticks(5));W.enter().append("circle").attr({"class":"grid-circle"}).style(O),W.attr("r",d),W.exit().remove()}V.select("circle.outside-circle").attr({r:t}).style(O);var X=b.select("circle.background-circle").attr({r:t}).style({fill:l.backgroundColor,stroke:l.stroke});if(l.radialAxis.visible){var Y=e.svg.axis().scale(d).ticks(5).tickSize(5);V.call(Y).attr({transform:"rotate("+l.radialAxis.orientation+")"}),V.selectAll(".domain").style(O),V.selectAll("g>text").text(function(a,b){return this.textContent+l.radialAxis.ticksSuffix}).style(P).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(a,b){return"horizontal"===l.radialAxis.tickOrientation?"rotate("+-l.radialAxis.orientation+") translate("+[0,P["font-size"]]+")":"translate("+[0,P["font-size"]]+")"}}),V.selectAll("g>line").style({stroke:"black"})}var Z=b.select(".angular.axis-group").selectAll("g.angular-tick").data(I),$=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(a,b){return"rotate("+i(a,b)+")"}}).style({display:l.angularAxis.visible?"block":"none"}),Z.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(a,b){return b%(l.minorTicks+1)==0}).classed("minor",function(a,b){return!(b%(l.minorTicks+1)==0)}).style(O),$.selectAll(".minor").style({stroke:l.minorTickColor}),Z.select("line.grid-line").attr({x1:l.tickLength?t-l.tickLength:0,x2:t}).style({display:l.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(P);var _=Z.select("text.axis-text").attr({x:t+l.labelOffset,dy:".35em",transform:function(a,b){var c=i(a,b),d=t+l.labelOffset,e=l.angularAxis.tickOrientation;return"horizontal"==e?"rotate("+-c+" "+d+" 0)":"radial"==e?270>c&&c>90?"rotate(180 "+d+" 0)":null:"rotate("+(180>=c&&c>0?-90:90)+" "+d+" 0)"}}).style({"text-anchor":"middle",display:l.angularAxis.labelsVisible?"block":"none"}).text(function(a,b){return b%(l.minorTicks+1)!=0?"":x?x[a]+l.angularAxis.ticksSuffix:a+l.angularAxis.ticksSuffix}).style(P);l.angularAxis.rewriteTicks&&_.text(function(a,b){return b%(l.minorTicks+1)!=0?"":l.angularAxis.rewriteTicks(this.textContent,b)});var aa=e.max(N.selectAll(".angular-tick text")[0].map(function(a,b){return a.getCTM().e+a.getBBox().width}));M.attr({transform:"translate("+[t+aa,l.margin.top]+")"});var ba=b.select("g.geometry-group").selectAll("g").size()>0,ca=b.select("g.geometry-group").selectAll("g.geometry").data(n);if(ca.enter().append("g").attr({"class":function(a,b){return"geometry geometry"+b}}),ca.exit().remove(),n[0]||ba){var da=[];n.forEach(function(a,b){var c={};c.radialScale=d,c.angularScale=h,c.container=ca.filter(function(a,c){return c==b}),c.geometry=a.geometry,c.orientation=l.orientation,c.direction=l.direction,c.index=b,da.push({data:a,geometryConfig:c})});var ea=e.nest().key(function(a,b){return"undefined"!=typeof a.data.groupId||"unstacked"}).entries(da),fa=[];ea.forEach(function(a,b){"unstacked"===a.key?fa=fa.concat(a.values.map(function(a,b){return[a]})):fa.push(a.values)}),fa.forEach(function(a,b){var c;c=Array.isArray(a)?a[0].geometryConfig.geometry:a.geometryConfig.geometry;var d=a.map(function(a,b){return g(f[c].defaultConfig(),a)});f[c]().config(d)()})}var ga,ha,ia=b.select(".guides-group"),ja=b.select(".tooltips-group"),ka=f.tooltipPanel().config({container:ja,fontSize:8})(),la=f.tooltipPanel().config({container:ja,fontSize:8})(),ma=f.tooltipPanel().config({container:ja,hasTick:!0})();if(!z){var na=ia.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(a,b){var c=f.util.getMousePos(X).angle;na.attr({x2:-t,transform:"rotate("+c+")"}).style({opacity:.5});var d=(c+180+360-l.orientation)%360;ga=h.invert(d);var e=f.util.convertToCartesian(t+12,c+180);ka.text(f.util.round(ga)).move([e[0]+v[0],e[1]+v[1]])}).on("mouseout.angular-guide",function(a,b){ia.select("line").style({opacity:0})})}var oa=ia.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(a,b){var c=f.util.getMousePos(X).radius;oa.attr({r:c}).style({opacity:.5}),ha=d.invert(f.util.getMousePos(X).radius);var e=f.util.convertToCartesian(c,l.radialAxis.orientation);la.text(f.util.round(ha)).move([e[0]+v[0],e[1]+v[1]])}).on("mouseout.radial-guide",function(a,b){oa.style({opacity:0}),ma.hide(),ka.hide(),la.hide()}),b.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(a,c){var d=e.select(this),g=d.style("fill"),h="black",i=d.style("opacity")||1;if(d.attr({"data-opacity":i}),"none"!=g){d.attr({"data-fill":g}),h=e.hsl(g).darker().toString(),d.style({fill:h,opacity:1});var j={t:f.util.round(a[0]),r:f.util.round(a[1])};z&&(j.t=x[a[0]]);var k="t: "+j.t+", r: "+j.r,l=this.getBoundingClientRect(),m=b.node().getBoundingClientRect(),n=[l.left+l.width/2-S[0]-m.left,l.top+l.height/2-S[1]-m.top];ma.config({color:h}).text(k),ma.move(n)}else g=d.style("stroke"),d.attr({"data-stroke":g}),h=e.hsl(g).darker().toString(),d.style({stroke:h,opacity:1})}).on("mousemove.tooltip",function(a,b){return 0!=e.event.which?!1:void(e.select(this).attr("data-fill")&&ma.show())}).on("mouseout.tooltip",function(a,b){ma.hide();var c=e.select(this),d=c.attr("data-fill");d?c.style({fill:d,opacity:c.attr("data-opacity")}):c.style({stroke:c.attr("data-stroke"),opacity:c.attr("data-opacity")})})}),m}var b,c,d,h,i={data:[],layout:{}},j={},k={},l=e.dispatch("hover"),m={};return m.render=function(b){return a(b),this},m.config=function(a){if(!arguments.length)return i;var b=f.util.cloneJson(a);return b.data.forEach(function(a,b){i.data[b]||(i.data[b]={}),g(i.data[b],f.Axis.defaultConfig().data[0]),g(i.data[b],a)}),g(i.layout,f.Axis.defaultConfig().layout),g(i.layout,b.layout),this},m.getLiveConfig=function(){return k},m.getinputConfig=function(){return j},m.radialScale=function(a){return d},m.angularScale=function(a){return h},m.svg=function(){return b},e.rebind(m,l,"on"),m},f.Axis.defaultConfig=function(a,b){var c={data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:e.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}};return c},f.util={},f.DATAEXTENT="dataExtent",f.AREA="AreaChart",f.LINE="LinePlot",f.DOT="DotPlot",f.BAR="BarChart",f.util._override=function(a,b){for(var c in a)c in b&&(b[c]=a[c])},f.util._extend=function(a,b){for(var c in a)b[c]=a[c]},f.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},f.util.dataFromEquation2=function(a,b){var c=b||6,d=e.range(0,360+c,c).map(function(b,c){var d=b*Math.PI/180,e=a(d);return[b,e]});return d},f.util.dataFromEquation=function(a,b,c){var d=b||6,f=[],g=[];e.range(0,360+d,d).forEach(function(b,c){var d=b*Math.PI/180,e=a(d);f.push(b),g.push(e)});var h={t:f,r:g};return c&&(h.name=c),h},f.util.ensureArray=function(a,b){if("undefined"==typeof a)return null;var c=[].concat(a);return e.range(b).map(function(a,b){return c[b]||c[0]})},f.util.fillArrays=function(a,b,c){return b.forEach(function(b,d){a[b]=f.util.ensureArray(a[b],c)}),a},f.util.cloneJson=function(a){return JSON.parse(JSON.stringify(a))},f.util.validateKeys=function(a,b){"string"==typeof b&&(b=b.split("."));var c=b.shift();return a[c]&&(!b.length||objHasKeys(a[c],b))},f.util.sumArrays=function(a,b){return e.zip(a,b).map(function(a,b){return e.sum(a)})},f.util.arrayLast=function(a){return a[a.length-1]},f.util.arrayEqual=function(a,b){for(var c=Math.max(a.length,b.length,1);c-- >=0&&a[c]===b[c];);return-2===c},f.util.flattenArray=function(a){for(var b=[];!f.util.arrayEqual(b,a);)b=a,a=[].concat.apply([],a);return a},f.util.deduplicate=function(a){return a.filter(function(a,b,c){return c.indexOf(a)==b})},f.util.convertToCartesian=function(a,b){var c=b*Math.PI/180,d=a*Math.cos(c),e=a*Math.sin(c);return[d,e]},f.util.round=function(a,b){var c=b||2,d=Math.pow(10,c);return Math.round(a*d)/d},f.util.getMousePos=function(a){var b=e.mouse(a.node()),c=b[0],d=b[1],f={};return f.x=c,f.y=d,f.pos=b,f.angle=180*(Math.atan2(d,c)+Math.PI)/Math.PI,f.radius=Math.sqrt(c*c+d*d),f},f.util.duplicatesCount=function(a){for(var b,c={},d={},e=0,f=a.length;f>e;e++)b=a[e],b in c?(c[b]++,d[b]=c[b]):c[b]=1;return d},f.util.duplicates=function(a){return Object.keys(f.util.duplicatesCount(a))},f.util.translator=function(a,b,c,d){if(d){var e=c.slice();c=b,b=e}var f=b.reduce(function(a,b){return"undefined"!=typeof a?a[b]:void 0},a);"undefined"!=typeof f&&(b.reduce(function(a,c,d){return"undefined"!=typeof a?(d===b.length-1&&delete a[c],a[c]):void 0},a),c.reduce(function(a,b,d){return"undefined"==typeof a[b]&&(a[b]={}),d===c.length-1&&(a[b]=f),a[b]},a))},f.PolyChart=function(){function a(){var a=c[0].geometryConfig,b=a.container;"string"==typeof b&&(b=e.select(b)),b.datum(c).each(function(b,c){function d(b,c){var d=a.radialScale(b[1]),e=(a.angularScale(b[0])+a.orientation)*Math.PI/180;return{r:d,t:e}}function f(a){var b=a.r*Math.cos(a.t),c=a.r*Math.sin(a.t);return{x:b,y:c}}var g=!!b[0].data.yStack,i=b.map(function(a,b){return g?e.zip(a.data.t[0],a.data.r[0],a.data.yStack[0]):e.zip(a.data.t[0],a.data.r[0])}),j=a.angularScale,k=a.radialScale.domain()[0],l={};l.bar=function(c,d,f){var g=b[f].data,h=a.radialScale(c[1])-a.radialScale(0),i=a.radialScale(c[2]||0),k=g.barWidth;e.select(this).attr({"class":"mark bar",d:"M"+[[h+i,-k/2],[h+i,k/2],[i,k/2],[i,-k/2]].join("L")+"Z",transform:function(b,c){return"rotate("+(a.orientation+j(b[0]))+")"}})},l.dot=function(a,c,g){var h=a[2]?[a[0],a[1]+a[2]]:a,i=e.svg.symbol().size(b[g].data.dotSize).type(b[g].data.dotType)(a,c);e.select(this).attr({"class":"mark dot",d:i,transform:function(a,b){var c=f(d(h));return"translate("+[c.x,c.y]+")"}})};var m=e.svg.line.radial().interpolate(b[0].data.lineInterpolation).radius(function(b){return a.radialScale(b[1])}).angle(function(b){return a.angularScale(b[0])*Math.PI/180});l.line=function(c,d,f){var g=c[2]?i[f].map(function(a,b){return[a[0],a[1]+a[2]]}):i[f];if(e.select(this).each(l.dot).style({opacity:function(a,c){return+b[f].data.dotVisible},fill:q.stroke(c,d,f)}).attr({"class":"mark dot"}),!(d>0)){var h=e.select(this.parentNode).selectAll("path.line").data([0]);h.enter().insert("path"),h.attr({"class":"line",d:m(g),transform:function(b,c){return"rotate("+(a.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(a,b){return q.fill(c,d,f)},"fill-opacity":0,stroke:function(a,b){return q.stroke(c,d,f)},"stroke-width":function(a,b){return q["stroke-width"](c,d,f)},"stroke-dasharray":function(a,b){return q["stroke-dasharray"](c,d,f)},opacity:function(a,b){return q.opacity(c,d,f)},display:function(a,b){return q.display(c,d,f)}})}};var n=a.angularScale.range(),o=Math.abs(n[1]-n[0])/i[0].length*Math.PI/180,p=e.svg.arc().startAngle(function(a){return-o/2}).endAngle(function(a){return o/2}).innerRadius(function(b){return a.radialScale(k+(b[2]||0))}).outerRadius(function(b){return a.radialScale(k+(b[2]||0))+a.radialScale(b[1])});l.arc=function(b,c,d){e.select(this).attr({"class":"mark arc",d:p,transform:function(b,c){return"rotate("+(a.orientation+j(b[0])+90)+")"}})};var q={fill:function(a,c,d){return b[d].data.color},stroke:function(a,c,d){return b[d].data.strokeColor},"stroke-width":function(a,c,d){return b[d].data.strokeSize+"px"},"stroke-dasharray":function(a,c,d){return h[b[d].data.strokeDash]},opacity:function(a,c,d){return b[d].data.opacity},display:function(a,c,d){return"undefined"==typeof b[d].data.visible||b[d].data.visible?"block":"none"}},r=e.select(this).selectAll("g.layer").data(i);r.enter().append("g").attr({"class":"layer"});var s=r.selectAll("path.mark").data(function(a,b){return a});s.enter().append("path").attr({"class":"mark"}),s.style(q).each(l[a.geometryType]),s.exit().remove(),r.exit().remove()})}var b,c=[f.PolyChart.defaultConfig()],d=e.dispatch("hover"),h={solid:"none",dash:[5,2],dot:[2,5]};return a.config=function(a){return arguments.length?(a.forEach(function(a,b){c[b]||(c[b]={}),g(c[b],f.PolyChart.defaultConfig()),g(c[b],a)}),this):c},a.getColorScale=function(){return b},e.rebind(a,d,"on"),a},f.PolyChart.defaultConfig=function(){var a={data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:e.scale.category20()}};return a},f.BarChart=function(){return f.PolyChart()},f.BarChart.defaultConfig=function(){var a={geometryConfig:{geometryType:"bar"}};return a},f.AreaChart=function(){return f.PolyChart()},f.AreaChart.defaultConfig=function(){var a={geometryConfig:{geometryType:"arc"}};return a},f.DotPlot=function(){return f.PolyChart()},f.DotPlot.defaultConfig=function(){var a={geometryConfig:{geometryType:"dot",dotType:"circle"}};return a},f.LinePlot=function(){return f.PolyChart()},f.LinePlot.defaultConfig=function(){var a={geometryConfig:{geometryType:"line"}};return a},f.Legend=function(){function a(){var c=b.legendConfig,d=b.data.map(function(a,b){return[].concat(a).map(function(a,d){var e=g({},c.elements[b]);return e.name=a,e.color=[].concat(c.elements[b].color)[d],e})}),f=e.merge(d);f=f.filter(function(a,b){return c.elements[b]&&(c.elements[b].visibleInLegend||"undefined"==typeof c.elements[b].visibleInLegend)}),c.reverseOrder&&(f=f.reverse());var h=c.container;("string"==typeof h||h.nodeName)&&(h=e.select(h));var i=f.map(function(a,b){return a.color}),j=c.fontSize,k=null==c.isContinuous?"number"==typeof f[0]:c.isContinuous,l=k?c.height:j*f.length,m=h.classed("legend-group",!0),n=m.selectAll("svg").data([0]),o=n.enter().append("svg").attr({width:300,height:l+j,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});o.append("g").classed("legend-axis",!0),o.append("g").classed("legend-marks",!0);var p=e.range(f.length),q=e.scale[k?"linear":"ordinal"]().domain(p).range(i),r=e.scale[k?"linear":"ordinal"]().domain(p)[k?"range":"rangePoints"]([0,l]),s=function(a,b){var c=3*b;return"line"===a?"M"+[[-b/2,-b/12],[b/2,-b/12],[b/2,b/12],[-b/2,b/12]]+"Z":-1!=e.svg.symbolTypes.indexOf(a)?e.svg.symbol().type(a).size(c)():e.svg.symbol().type("square").size(c)()};if(k){var t=n.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(i);t.enter().append("stop"),t.attr({offset:function(a,b){return b/(i.length-1)*100+"%"}}).style({"stop-color":function(a,b){return a}}),n.append("rect").classed("legend-mark",!0).attr({height:c.height,width:c.colorBandWidth,fill:"url(#grad1)"})}else{var u=n.select(".legend-marks").selectAll("path.legend-mark").data(f);u.enter().append("path").classed("legend-mark",!0),u.attr({transform:function(a,b){return"translate("+[j/2,r(b)+j/2]+")"},d:function(a,b){var c=a.symbol;return s(c,j)},fill:function(a,b){return q(b)}}),u.exit().remove()}var v=e.svg.axis().scale(r).orient("right"),w=n.select("g.legend-axis").attr({transform:"translate("+[k?c.colorBandWidth:j,j/2]+")"}).call(v);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:k?c.textColor:"none"}),w.selectAll("text").style({fill:c.textColor,"font-size":c.fontSize}).text(function(a,b){return f[b].name}),a}var b=f.Legend.defaultConfig(),c=e.dispatch("hover");return a.config=function(a){return arguments.length?(g(b,a),this):b},e.rebind(a,c,"on"),a},f.Legend.defaultConfig=function(a,b){var c={data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}};return c},f.tooltipPanel=function(){var a,b,c,d={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},h="tooltip-"+f.tooltipPanel.uid++,i=10,j=function(){a=d.container.selectAll("g."+h).data([0]);var e=a.enter().append("g").classed(h,!0).style({"pointer-events":"none",display:"none"});return c=e.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),b=e.append("text").attr({dx:d.padding+i,dy:.3*+d.fontSize}),j};return j.text=function(f){var g=e.hsl(d.color).l,h=g>=.5?"#aaa":"white",k=g>=.5?"black":"white",l=f||"";b.style({fill:k,"font-size":d.fontSize+"px"}).text(l);var m=d.padding,n=b.node().getBBox(),o={fill:d.color,stroke:h,"stroke-width":"2px"},p=n.width+2*m+i,q=n.height+2*m;return c.attr({d:"M"+[[i,-q/2],[i,-q/4],[d.hasTick?0:i,0],[i,q/4],[i,q/2],[p,q/2],[p,-q/2]].join("L")+"Z"}).style(o),a.attr({transform:"translate("+[i,-q/2+2*m]+")"}),a.style({display:"block"}),j},j.move=function(b){return a?(a.attr({transform:"translate("+[b[0],b[1]]+")"}).style({display:"block"}),j):void 0},j.hide=function(){return a?(a.style({display:"none"}),j):void 0},j.show=function(){return a?(a.style({display:"block"}),j):void 0},j.config=function(a){return g(d,a),j},j},f.tooltipPanel.uid=1,f.adapter={},f.adapter.plotly=function(){var a={};return a.convert=function(a,b){var c={};if(a.data&&(c.data=a.data.map(function(a,c){var d=g({},a),e=[[d,["marker","color"],["color"]],[d,["marker","opacity"],["opacity"]],[d,["marker","line","color"],["strokeColor"]],[d,["marker","line","dash"],["strokeDash"]],[d,["marker","line","width"],["strokeSize"]],[d,["marker","symbol"],["dotType"]],[d,["marker","size"],["dotSize"]],[d,["marker","barWidth"],["barWidth"]],[d,["line","interpolation"],["lineInterpolation"]],[d,["showlegend"],["visibleInLegend"]]];return e.forEach(function(a,c){f.util.translator.apply(null,a.concat(b))}),b||delete d.marker,b&&delete d.groupId,b?("LinePlot"===d.geometry?(d.type="scatter",d.dotVisible===!0?(delete d.dotVisible,d.mode="lines+markers"):d.mode="lines"):"DotPlot"===d.geometry?(d.type="scatter",d.mode="markers"):"AreaChart"===d.geometry?d.type="area":"BarChart"===d.geometry&&(d.type="bar"),delete d.geometry):("scatter"===d.type?"lines"===d.mode?d.geometry="LinePlot":"markers"===d.mode?d.geometry="DotPlot":"lines+markers"===d.mode&&(d.geometry="LinePlot",d.dotVisible=!0):"area"===d.type?d.geometry="AreaChart":"bar"===d.type&&(d.geometry="BarChart"),delete d.mode,delete d.type),d}),!b&&a.layout&&"stack"===a.layout.barmode)){var d=f.util.duplicates(c.data.map(function(a,b){return a.geometry}));c.data.forEach(function(a,b){var e=d.indexOf(a.geometry);-1!=e&&(c.data[b].groupId=e)})}if(a.layout){var h=g({},a.layout),i=[[h,["plot_bgcolor"],["backgroundColor"]],[h,["showlegend"],["showLegend"]],[h,["radialaxis"],["radialAxis"]],[h,["angularaxis"],["angularAxis"]],[h.angularaxis,["showline"],["gridLinesVisible"]],[h.angularaxis,["showticklabels"],["labelsVisible"]],[h.angularaxis,["nticks"],["ticksCount"]],[h.angularaxis,["tickorientation"],["tickOrientation"]],[h.angularaxis,["ticksuffix"],["ticksSuffix"]],[h.angularaxis,["range"],["domain"]],[h.angularaxis,["endpadding"],["endPadding"]],[h.radialaxis,["showline"],["gridLinesVisible"]],[h.radialaxis,["tickorientation"],["tickOrientation"]],[h.radialaxis,["ticksuffix"],["ticksSuffix"]],[h.radialaxis,["range"],["domain"]],[h.angularAxis,["showline"],["gridLinesVisible"]],[h.angularAxis,["showticklabels"],["labelsVisible"]],[h.angularAxis,["nticks"],["ticksCount"]],[h.angularAxis,["tickorientation"],["tickOrientation"]],[h.angularAxis,["ticksuffix"],["ticksSuffix"]],[h.angularAxis,["range"],["domain"]],[h.angularAxis,["endpadding"],["endPadding"]],[h.radialAxis,["showline"],["gridLinesVisible"]],[h.radialAxis,["tickorientation"],["tickOrientation"]],[h.radialAxis,["ticksuffix"],["ticksSuffix"]],[h.radialAxis,["range"],["domain"]],[h.font,["outlinecolor"],["outlineColor"]],[h.legend,["traceorder"],["reverseOrder"]],[h,["labeloffset"],["labelOffset"]],[h,["defaultcolorrange"],["defaultColorRange"]]];if(i.forEach(function(a,c){f.util.translator.apply(null,a.concat(b))}),b?("undefined"!=typeof h.tickLength&&(h.angularaxis.ticklen=h.tickLength,delete h.tickLength),h.tickColor&&(h.angularaxis.tickcolor=h.tickColor,delete h.tickColor)):(h.angularAxis&&"undefined"!=typeof h.angularAxis.ticklen&&(h.tickLength=h.angularAxis.ticklen),h.angularAxis&&"undefined"!=typeof h.angularAxis.tickcolor&&(h.tickColor=h.angularAxis.tickcolor)),h.legend&&"boolean"!=typeof h.legend.reverseOrder&&(h.legend.reverseOrder="normal"!=h.legend.reverseOrder),h.legend&&"boolean"==typeof h.legend.traceorder&&(h.legend.traceorder=h.legend.traceorder?"reversed":"normal",delete h.legend.reverseOrder),h.margin&&"undefined"!=typeof h.margin.t){var j=["t","r","b","l","pad"],k=["top","right","bottom","left","pad"],l={};e.entries(h.margin).forEach(function(a,b){l[k[j.indexOf(a.key)]]=a.value}),h.margin=l}b&&(delete h.needsEndSpacing,delete h.minorTickColor,delete h.minorTicks,delete h.angularaxis.ticksCount,delete h.angularaxis.ticksCount,delete h.angularaxis.ticksStep,delete h.angularaxis.rewriteTicks,delete h.angularaxis.nticks,delete h.radialaxis.ticksCount,delete h.radialaxis.ticksCount,delete h.radialaxis.ticksStep,delete h.radialaxis.rewriteTicks,delete h.radialaxis.nticks),c.layout=h}return c},a}},{"../../plotly":366,"./micropolar_manager":417,d3:70}],417:[function(a,b,c){"use strict";var d=a("../../plotly"),e=a("d3"),f=a("./undo_manager"),g=b.exports={},h=d.Lib.extendDeepAll;g.framework=function(a){function b(b,f){return f&&(l=f),e.select(e.select(l).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),c=c?h(c,b):b,j||(j=d.micropolar.Axis()),k=d.micropolar.adapter.plotly().convert(c),j.config(k).render(l),a.data=c.data,a.layout=c.layout,g.fillLayout(a),c}var c,i,j,k,l,m=new f;return b.isPolar=!0,b.svg=function(){return j.svg()},b.getConfig=function(){return c},b.getLiveConfig=function(){return d.micropolar.adapter.plotly().convert(j.getLiveConfig(),!0)},b.getLiveScales=function(){return{t:j.angularScale(),r:j.radialScale()}},b.setUndoPoint=function(){var a=this,b=d.micropolar.util.cloneJson(c);!function(b,c){m.add({undo:function(){c&&a(c)},redo:function(){a(b)}})}(b,i),i=d.micropolar.util.cloneJson(b)},b.undo=function(){m.undo()},b.redo=function(){m.redo()},b},g.fillLayout=function(a){var b=e.select(a).selectAll(".plot-container"),c=b.selectAll(".svg-container"),f=a.framework&&a.framework.svg&&a.framework.svg(),g={width:800,height:600,paper_bgcolor:d.Color.background,_container:b,_paperdiv:c,_paper:f};a._fullLayout=h(g,a.layout)}},{"../../plotly":366,"./undo_manager":418,d3:70}],418:[function(a,b,c){"use strict";b.exports=function(){function a(a,b){return a?(e=!0,a[b](),e=!1,this):this}var b,c=[],d=-1,e=!1;return{add:function(a){return e?this:(c.splice(d+1,c.length-d),c.push(a),d=c.length-1,this)},setCallback:function(a){b=a},undo:function(){var e=c[d];return e?(a(e,"undo"),d-=1,b&&b(e.undo),this):this},redo:function(){var e=c[d+1];return e?(a(e,"redo"),d+=1,b&&b(e.redo),this):this},clear:function(){c=[],d=-1},hasUndo:function(){return-1!==d},hasRedo:function(){return d<c.length-1},getCommands:function(){return c},getPreviousCommand:function(){return c[d-1]},getIndex:function(){return d}}}},{}],419:[function(a,b,c){"use strict";function d(a){var b;switch(a){case"themes__thumb":b={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":b={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:b={}}return b}function e(a){var b=["xaxis","yaxis","zaxis"];return b.indexOf(a.slice(0,5))>-1}var f=a("../plotly"),g=f.Lib.extendFlat,h=f.Lib.extendDeep;b.exports=function(a,b){a.framework&&a.framework.isPolar&&(a=a.framework.getConfig());var c,i=a.data,j=a.layout,k=h([],i),l=h({},j,d(b.tileClass));if(b.width&&(l.width=b.width),b.height&&(l.height=b.height),"thumbnail"===b.tileClass||"themes__thumb"===b.tileClass){l.annotations=[];var m=Object.keys(l);for(c=0;c<m.length;c++)e(m[c])&&(l[m[c]].title="");for(c=0;c<k.length;c++){var n=k[c];n.showscale=!1,n.marker&&(n.marker.showscale=!1),"pie"===n.type&&(n.textposition="none")}}if(Array.isArray(b.annotations))for(c=0;c<b.annotations.length;c++)l.annotations.push(b.annotations[c]); 55 var o=f.Plots.getSubplotIds(l,"gl3d");if(o.length){var p={};for("thumbnail"===b.tileClass&&(p={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),c=0;c<o.length;c++){var q=o[c];g(l[q].xaxis,p),g(l[q].yaxis,p),g(l[q].zaxis,p),l[q]._scene=null}}var r=document.createElement("div");b.tileClass&&(r.className=b.tileClass);var s={td:r,layout:l,data:k,config:{staticPlot:void 0===b.staticPlot?!0:b.staticPlot,plotGlPixelRatio:void 0===b.plotGlPixelRatio?2:b.plotGlPixelRatio,displaylogo:b.displaylogo||!1,showLink:b.showLink||!1,showTips:b.showTips||!1}};return"transparent"!==b.setBackground&&(s.config.setBackground=b.setBackground||"opaque"),s.td.defaultLayout=d(b.tileClass),s}},{"../plotly":366}],420:[function(a,b,c){"use strict";function d(a){return a._hasGL3D||a._hasGL2D?500:0}function e(a){return function(){var b=a._fullLayout;b._hasGL3D||b._hasGL2D||a.data&&a.data[0]&&a.data[0].r||(a.calcdata||[]).forEach(function(a){a[0]&&a[0].t&&a[0].t.cb&&a[0].t.cb()})}}var f={getDelay:d,getRedrawFunc:e,clone:a("./cloneplot"),toSVG:a("./tosvg"),svgToImg:a("./svgtoimg"),toImage:a("./toimage")};b.exports=f},{"./cloneplot":419,"./svgtoimg":421,"./toimage":422,"./tosvg":423}],421:[function(a,b,c){"use strict";function d(a){var b=a.emitter?a.emitter:new e,c=window.Image,d=window.Blob,f=a.svg,g=a.format||"png",h=a.canvas,i=h.getContext("2d"),j=new c,k=window.URL||window.webkitURL,l=new d([f],{type:"image/svg+xml;charset=utf-8"}),m=k.createObjectURL(l);return h.height=a.height||150,h.width=a.width||300,j.onload=function(){var a;switch(k.revokeObjectURL(m),i.drawImage(j,0,0),g){case"jpeg":a=h.toDataURL("image/jpeg");break;case"png":a=h.toDataURL("image/png");break;case"webp":a=h.toDataURL("image/webp");break;case"svg":a=f;break;default:return b.emit("error","Image format is not jpeg, png or svg")}b.emit("success",a)},j.onerror=function(a){return k.revokeObjectURL(m),b.emit("error",a)},j.src=m,b}var e=a("events").EventEmitter;b.exports=d},{events:54}],422:[function(a,b,c){"use strict";function d(a,b){function c(){var a=d.getDelay(i._fullLayout);setTimeout(function(){var a=f.Snapshot.toSVG(i),c=window.document.createElement("div"),d=window.document.createElement("canvas");c.appendChild(d),c.id=f.Lib.randstr(),d.id=f.Lib.randstr(),g=f.Snapshot.svgToImg({format:b.format,width:i._fullLayout.width,height:i._fullLayout.height,canvas:d,emitter:g,svg:a}),g.clean=function(){i&&i.remove()}},a)}var d=f.Snapshot,g=new e,h=d.clone(a,{format:"png"}),i=h.td;i.style.position="absolute",i.style.left="-5000px",document.body.appendChild(i);var j=d.getRedrawFunc(i);return f.plot(i,h.data,h.layout,h.config).then(j).then(c)["catch"](function(a){g.emit("error",a)}),g}var e=a("events").EventEmitter,f=a("../plotly");b.exports=d},{"../plotly":366,events:54}],423:[function(a,b,c){"use strict";function d(a,b,c){var d=b.toImage("png");a._glimages.append("svg:image").attr({xmlns:g.svg,"xlink:href":d,x:c.x,y:c.y,width:c.width,height:c.height,preserveAspectRatio:"none"}),b.destroy()}var e=a("../plotly"),f=a("d3"),g=a("../constants/xmlns_namespaces");b.exports=function(a,b){var c,h,i=a._fullLayout,j=i._paper,k=i._size;j.insert("rect",":first-child").call(e.Drawing.setRect,0,0,i.width,i.height).call(e.Color.fill,i.paper_bgcolor);var l,m=e.Plots.getSubplotIds(i,"gl3d");for(h=0;h<m.length;h++)l=i[m[h]],c=l.domain,d(i,l._scene,{x:k.l+k.w*c.x[0],y:k.t+k.h*(1-c.y[1]),width:k.w*(c.x[1]-c.x[0]),height:k.h*(c.y[1]-c.y[0])});var n,o=e.Plots.getSubplotIds(i,"gl2d");for(h=0;h<o.length;h++)n=i._plots[o[h]],d(i,n._scene2d,{x:k.l,y:k.t,width:k.w,height:k.h});var p,q,r=e.Plots.getSubplotIds(i,"geo");for(h=0;h<r.length;h++)p=i[r[h]],c=p.domain,q=p._geo.framework,q.attr("style",null),q.attr({x:k.l+k.w*c.x[0]+p._marginX,y:k.t+k.h*(1-c.y[1])+p._marginY,width:p._width,height:p._height}),i._geoimages.node().appendChild(q.node());if(i._toppaper){var s,t=i._toppaper.node().childNodes;for(h=0;h<t.length;h++)s=t[h],s.childNodes.length&&j.node().appendChild(s)}j.node().style.background="",j.selectAll("text").attr({"data-unformatted":null}).style({"-webkit-user-select":null,"-moz-user-select":null,"-ms-user-select":null}).each(function(){var a=f.select(this);if("hidden"===a.style("visibility"))return void a.remove();var b=a.style("font-family");b&&-1!==b.indexOf('"')&&a.style("font-family",b.replace(/"/g,"\\'"))}),"pdf"!==b&&"eps"!==b||j.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),j.node().setAttributeNS(g.xmlns,"xmlns",g.svg),j.node().setAttributeNS(g.xmlns,"xmlns:xlink",g.xlink);var u=(new window.XMLSerializer).serializeToString(j.node());return u=e.util.html_entity_decode(u),u=e.util.xml_entity_encode(u)}},{"../constants/xmlns_namespaces":338,"../plotly":366,d3:70}],424:[function(a,b,c){"use strict";var d=a("../../lib").mergeArray;b.exports=function(a){var b=a[0].trace,c=b.marker,e=c.line;d(b.text,a,"tx"),d(c.opacity,a,"mo"),d(c.color,a,"mc"),d(e.color,a,"mlc"),d(e.width,a,"mlw")}},{"../../lib":349}],425:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=d.marker,f=e.line;b.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:d.text,orientation:{valType:"enumerated",values:["v","h"]},marker:{color:e.color,colorscale:e.colorscale,cauto:e.cauto,cmax:e.cmax,cmin:e.cmin,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,line:{color:f.color,colorscale:f.colorscale,cauto:f.cauto,cmax:f.cmax,cmin:f.cmin,width:f.width,autocolorscale:f.autocolorscale,reversescale:f.reversescale}},r:d.r,t:d.t,_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../scatter/attributes":502}],426:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/cartesian/axes"),f=a("../../components/colorscale/has_colorscale"),g=a("../../components/colorscale/calc");b.exports=function(a,b){var c,h,i,j=e.getFromId(a,b.xaxis||"x"),k=e.getFromId(a,b.yaxis||"y"),l=b.orientation||(b.x&&!b.y?"h":"v");"h"===l?(h=j.makeCalcdata(b,"x"),c=k.makeCalcdata(b,"y")):(h=k.makeCalcdata(b,"y"),c=j.makeCalcdata(b,"x"));var m=Math.min(c.length,h.length),n=[];for(i=0;m>i;i++)d(c[i])&&d(h[i])&&n.push({p:c[i],s:h[i],b:0});return f(b,"marker")&&g(b,b.marker.color,"marker","c"),f(b,"marker.line")&&g(b,b.marker.line.color,"marker.line","c"),n}},{"../../components/colorscale/calc":306,"../../components/colorscale/has_colorscale":311,"../../plots/cartesian/axes":369,"fast-isnumeric":74}],427:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/color"),f=a("../scatter/xy_defaults"),g=a("../bar/style_defaults"),h=a("../../components/errorbars/defaults"),i=a("./attributes");b.exports=function(a,b,c,j){function k(c,e){return d.coerce(a,b,i,c,e)}var l=f(a,b,k);return l?(k("orientation",b.x&&!b.y?"h":"v"),k("text"),g(a,b,k,c,j),h(a,b,e.defaultLine,{axis:"y"}),void h(a,b,e.defaultLine,{axis:"x",inherit:"y"})):void(b.visible=!1)}},{"../../components/color":299,"../../components/errorbars/defaults":322,"../../lib":349,"../bar/style_defaults":435,"../scatter/xy_defaults":522,"./attributes":425}],428:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/graph_interact"),e=a("../../components/errorbars"),f=a("../../components/color");b.exports=function(a,b,c,g){var h,i=a.cd,j=i[0].trace,k=i[0].t,l=a.xa,m=a.ya,n="closest"===g?k.barwidth/2:k.dbar*(1-l._td._fullLayout.bargap)/2;h="closest"!==g?function(a){return a.p}:"h"===j.orientation?function(a){return a.y}:function(a){return a.x};var o,p;"h"===j.orientation?(o=function(a){return d.inbox(a.b-b,a.x-b)+(a.x-b)/(a.x-a.b)},p=function(a){var b=h(a)-c;return d.inbox(b-n,b+n)}):(p=function(a){return d.inbox(a.b-c,a.y-c)+(a.y-c)/(a.y-a.b)},o=function(a){var c=h(a)-b;return d.inbox(c-n,c+n)});var q=d.getDistanceFunction(g,o,p);if(d.getClosest(i,q,a),a.index!==!1){var r=i[a.index],s=r.mcc||j.marker.color,t=r.mlcc||j.marker.line.color,u=r.mlw||j.marker.line.width;return f.opacity(s)?a.color=s:f.opacity(t)&&u&&(a.color=t),"h"===j.orientation?(a.x0=a.x1=l.c2p(r.x,!0),a.xLabelVal=r.s,a.y0=m.c2p(h(r)-n,!0),a.y1=m.c2p(h(r)+n,!0),a.yLabelVal=r.p):(a.y0=a.y1=m.c2p(r.y,!0),a.yLabelVal=r.s,a.x0=l.c2p(h(r)-n,!0),a.x1=l.c2p(h(r)+n,!0),a.xLabelVal=r.p),r.tx&&(a.text=r.tx),e.hoverInfo(r,j,a),[a]}}},{"../../components/color":299,"../../components/errorbars":323,"../../plots/cartesian/graph_interact":374}],429:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.layoutAttributes=a("./layout_attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("./layout_defaults"),d.calc=a("./calc"),d.setPositions=a("./set_positions"),d.colorbar=a("../scatter/colorbar"),d.arraysToCalcdata=a("./arrays_to_calcdata"),d.plot=a("./plot"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="bar",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../scatter/colorbar":505,"./arrays_to_calcdata":424,"./attributes":425,"./calc":426,"./defaults":427,"./hover":428,"./layout_attributes":430,"./layout_defaults":431,"./plot":432,"./set_positions":433,"./style":434}],430:[function(a,b,c){"use strict";b.exports={barmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],431:[function(a,b,c){"use strict";var d=a("../../plots/plots"),e=a("../../plots/cartesian/axes"),f=a("../../lib"),g=a("./layout_attributes");b.exports=function(a,b,c){function h(c,d){return f.coerce(a,b,g,c,d)}for(var i=!1,j=!1,k=!1,l={},m=0;m<c.length;m++){var n=c[m];if(d.traceIs(n,"bar")){if(i=!0,"overlay"!==a.barmode&&"stack"!==a.barmode){var o=n.xaxis+n.yaxis;l[o]&&(k=!0),l[o]=!0}if(n.visible&&"histogram"===n.type){var p=e.getFromId({_fullLayout:b},n["v"===n.orientation?"xaxis":"yaxis"]);"category"!==p.type&&(j=!0)}}}if(i){var q=h("barmode");"overlay"!==q&&h("barnorm"),h("bargap",j&&!k?0:.2),h("bargroupgap")}}},{"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413,"./layout_attributes":430}],432:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("../../components/color"),h=a("./arrays_to_calcdata");b.exports=function(a,b,c){var i=b.x(),j=b.y(),k=a._fullLayout,l=b.plot.select(".barlayer").selectAll("g.trace.bars").data(c).enter().append("g").attr("class","trace bars");l.append("g").attr("class","points").each(function(b){var c=b[0].t,l=b[0].trace;h(b),d.select(this).selectAll("path").data(f.identity).enter().append("path").each(function(b){function f(a){return 0===k.bargap&&0===k.bargroupgap?d.round(Math.round(a)-r,2):a}function h(a,b){return Math.abs(a-b)>=2?f(a):a>b?Math.ceil(a):Math.floor(a)}var m,n,o,p;if("h"===l.orientation?(o=j.c2p(c.poffset+b.p,!0),p=j.c2p(c.poffset+b.p+c.barwidth,!0),m=i.c2p(b.b,!0),n=i.c2p(b.s+b.b,!0)):(m=i.c2p(c.poffset+b.p,!0),n=i.c2p(c.poffset+b.p+c.barwidth,!0),p=j.c2p(b.s+b.b,!0),o=j.c2p(b.b,!0)),!(e(m)&&e(n)&&e(o)&&e(p)&&m!==n&&o!==p))return void d.select(this).remove();var q=(b.mlw+1||l.marker.line.width+1||(b.trace?b.trace.marker.line.width:0)+1)-1,r=d.round(q/2%1,2);if(!a._context.staticPlot){var s=g.opacity(b.mc||l.marker.color),t=1>s||q>.01?f:h;m=t(m,n),n=t(n,m),o=t(o,p),p=t(p,o)}d.select(this).attr("d","M"+m+","+o+"V"+p+"H"+n+"V"+o+"Z")})})}},{"../../components/color":299,"../../lib":349,"./arrays_to_calcdata":424,d3:70,"fast-isnumeric":74}],433:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/plots"),f=a("../../plots/cartesian/axes"),g=a("../../lib");b.exports=function(a,b){var c,h,i=a._fullLayout,j=b.x(),k=b.y();["v","h"].forEach(function(l){function m(b){function c(a){a[o]=a.p+m}var d=[];b.forEach(function(b){a.calcdata[b].forEach(function(a){d.push(a.p)})});var e=g.distinctVals(d),h=e.vals,j=e.minDiff,k=!1,l=[];"group"===i.barmode&&b.forEach(function(b){k||(a.calcdata[b].forEach(function(a){k||l.forEach(function(b){Math.abs(a.p-b)<j&&(k=!0)})}),k||a.calcdata[b].forEach(function(a){l.push(a.p)}))}),f.minDtick(q,j,h[0],k),f.expand(q,h,{vpad:j/2}),j*=1-i.bargap,k&&(j/=n.length);for(var m,p=0;p<b.length;p++){var r=a.calcdata[b[p]][0].t;r.barwidth=j*(1-i.bargroupgap),r.poffset=((k?(2*p+1-b.length)*j:0)-r.barwidth)/2,r.dbar=e.minDiff,m=r.poffset+r.barwidth/2,a.calcdata[b[p]].forEach(c)}}var n=[],o={v:"x",h:"y"}[l],p={v:"y",h:"x"}[l],q=b[o](),r=b[p]();if(a._fullData.forEach(function(a,b){a.visible===!0&&e.traceIs(a,"bar")&&a.orientation===l&&a.xaxis===j._id&&a.yaxis===k._id&&n.push(b)}),n.length){"overlay"===i.barmode?n.forEach(function(a){m([a])}):m(n);var s="stack"===i.barmode,t=i.barnorm;if(s||t){var u,v,w,x=r.l2c(r.c2l(0)),y=x,z={},A=a.calcdata[n[0]][0].t.barwidth/100,B=0,C=!0;for(c=0;c<n.length;c++)for(v=a.calcdata[n[c]],h=0;h<v.length;h++){B=Math.round(v[h].p/A);var D=z[B]||0;s&&(v[h].b=D),u=v[h].b+v[h].s,z[B]=D+v[h].s,s&&(v[h][p]=u,!t&&d(r.c2l(u))&&(x=Math.max(x,u),y=Math.min(y,u)))}if(t){C=!1;var E="fraction"===t?1:100,F=E/1e9;for(y=0,x=s?E:0,c=0;c<n.length;c++)for(v=a.calcdata[n[c]],h=0;h<v.length;h++)w=E/z[Math.round(v[h].p/A)],v[h].b*=w,v[h].s*=w,u=v[h].b+v[h].s,v[h][p]=u,d(r.c2l(u))&&(y-F>u&&(C=!0,y=u),u>x+F&&(C=!0,x=u))}f.expand(r,[y,x],{tozero:!0,padded:C})}else{var G=function(a){return a[p]=a.s,a.s};for(c=0;c<n.length;c++)f.expand(r,a.calcdata[n[c]].map(G),{tozero:!0,padded:!0})}}})}},{"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413,"fast-isnumeric":74}],434:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/color"),f=a("../../components/drawing");b.exports=function(a){var b=d.select(a).selectAll("g.trace.bars"),c=b.size(),g=a._fullLayout;b.style("opacity",function(a){return a[0].trace.opacity}).each(function(a){("stack"===g.barmode&&c>1||0===g.bargap&&0===g.bargroupgap&&!a[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),b.selectAll("g.points").each(function(a){var b=a[0].trace,c=b.marker,g=c.line,h=(b._input||{}).marker||{},i=f.tryColorscale(c,h,""),j=f.tryColorscale(c,h,"line.");d.select(this).selectAll("path").each(function(a){var b,f,h=(a.mlw+1||g.width+1)-1,k=d.select(this);b="mc"in a?a.mcc=i(a.mc):Array.isArray(c.color)?e.defaultLine:c.color,k.style("stroke-width",h+"px").call(e.fill,b),h&&(f="mlc"in a?a.mlcc=j(a.mlc):Array.isArray(g.color)?e.defaultLine:g.color,k.call(e.stroke,f))})})}},{"../../components/color":299,"../../components/drawing":317,d3:70}],435:[function(a,b,c){"use strict";var d=a("../../components/color"),e=a("../../components/colorscale/has_colorscale"),f=a("../../components/colorscale/defaults");b.exports=function(a,b,c,g,h){c("marker.color",g),e(a,"marker")&&f(a,b,h,c,{prefix:"marker.",cLetter:"c"}),c("marker.line.color",d.defaultLine),e(a,"marker.line")&&f(a,b,h,c,{prefix:"marker.line.",cLetter:"c"}),c("marker.line.width")}},{"../../components/color":299,"../../components/colorscale/defaults":308,"../../components/colorscale/has_colorscale":311}],436:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../components/color/attributes"),f=a("../../lib/extend").extendFlat,g=d.marker,h=g.line;b.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:f({},g.symbol,{arrayOk:!1}),opacity:f({},g.opacity,{arrayOk:!1,dflt:1}),size:f({},g.size,{arrayOk:!1}),color:f({},g.color,{arrayOk:!1}),line:{color:f({},h.color,{arrayOk:!1,dflt:e.defaultLine}),width:f({},h.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:d.fillcolor}},{"../../components/color/attributes":298,"../../lib/extend":345,"../scatter/attributes":502}],437:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("../../plots/cartesian/axes");b.exports=function(a,b){function c(a,b,c,f,g){var h;return c in b?o=f.makeCalcdata(b,c):(h=c+"0"in b?b[c+"0"]:"name"in b&&("category"===f.type||d(b.name)&&-1!==["linear","log"].indexOf(f.type)||e.isDateTime(b.name)&&"date"===f.type)?b.name:a.numboxes,h=f.d2c(h),o=g.map(function(){return h})),o}function g(a,b,c,f,g){var h,i,j,k,l=f.length,m=b.length,n=[],o=[];for(h=0;l>h;++h)i=f[h],a[h]={pos:i},o[h]=i-g,n[h]=[];for(o.push(f[l-1]+g),h=0;m>h;++h)k=b[h],d(k)&&(j=e.findBin(c[h],o),j>=0&&m>j&&n[j].push(k));return n}function h(a,b){var c,d,f,g;for(g=0;g<b.length;++g)c=b[g].sort(e.sorterAsc),d=c.length,f=a[g],f.val=c,f.min=c[0],f.max=c[d-1],f.mean=e.mean(c,d),f.sd=e.stdev(c,d,f.mean),f.q1=e.interp(c,.25),f.med=e.interp(c,.5),f.q3=e.interp(c,.75),f.lf=Math.min(f.q1,c[Math.min(e.findBin(2.5*f.q1-1.5*f.q3,c,!0)+1,d-1)]),f.uf=Math.max(f.q3,c[Math.max(e.findBin(2.5*f.q3-1.5*f.q1,c),0)]),f.lo=4*f.q1-3*f.q3,f.uo=4*f.q3-3*f.q1}var i,j,k,l,m,n,o,p,q,r=f.getFromId(a,b.xaxis||"x"),s=f.getFromId(a,b.yaxis||"y"),t=b.orientation,u=[];"h"===t?(i=r,j="x",m=s,n="y"):(i=s,j="y",m=r,n="x"),k=i.makeCalcdata(b,j),f.expand(i,k,{padded:!0}),o=c(a,b,n,m,k);var v=e.distinctVals(o);return p=v.vals,q=v.minDiff/2,l=g(u,k,o,p,q),h(u,l),u=u.filter(function(a){return a.val&&a.val.length}),u.length?(u[0].t={boxnum:a.numboxes,dPos:q},a.numboxes++,u):[{t:{emptybox:!0}}]}},{"../../lib":349,"../../plots/cartesian/axes":369,"fast-isnumeric":74}],438:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/color"),f=a("./attributes");b.exports=function(a,b,c){function g(c,e){return d.coerce(a,b,f,c,e)}var h,i=g("y"),j=g("x");if(i&&i.length)h="v",j||g("x0");else{if(!j||!j.length)return void(b.visible=!1);h="h",g("y0")}g("orientation",h),g("line.color",(a.marker||{}).color||c),g("line.width",2),g("fillcolor",e.addOpacity(b.line.color,.5)),g("whiskerwidth"),g("boxmean");var k=d.coerce2(a,b,f,"marker.outliercolor"),l=g("marker.line.outliercolor"),m=k||l?g("boxpoints","suspectedoutliers"):g("boxpoints");m&&(g("jitter","all"===m?.3:0),g("pointpos","all"===m?-1.5:0),g("marker.symbol"),g("marker.opacity"),g("marker.size"),g("marker.color",b.line.color),g("marker.line.color"),g("marker.line.width"),"suspectedoutliers"===m&&(g("marker.line.outliercolor",b.marker.color),g("marker.line.outlierwidth")))}},{"../../components/color":299,"../../lib":349,"./attributes":436}],439:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/axes"),e=a("../../plots/cartesian/graph_interact"),f=a("../../lib"),g=a("../../components/color");b.exports=function(a,b,c,h){var i,j,k,l,m,n,o,p,q,r=a.cd,s=r[0].trace,t=r[0].t,u=a.xa,v=a.ya,w=[];if(l="closest"===h?2.5*t.bdPos:t.bdPos,"h"===s.orientation?(i=function(a){return e.inbox(a.min-b,a.max-b)},j=function(a){var b=a.pos+t.bPos-c;return e.inbox(b-l,b+l)},m="y",n=v,p="x",q=u):(i=function(a){var c=a.pos+t.bPos-b;return e.inbox(c-l,c+l)},j=function(a){return e.inbox(a.min-c,a.max-c)},m="x",n=u,p="y",q=v),k=e.getDistanceFunction(h,i,j),e.getClosest(r,k,a),a.index!==!1){var x=r[a.index],y=s.line.color,z=(s.marker||{}).color;g.opacity(y)&&s.line.width?a.color=y:g.opacity(z)&&s.boxpoints?a.color=z:a.color=s.fillcolor,a[m+"0"]=n.c2p(x.pos+t.bPos-t.bdPos,!0),a[m+"1"]=n.c2p(x.pos+t.bPos+t.bdPos,!0),d.tickText(n,n.c2l(x.pos),"hover").text,a[m+"LabelVal"]=x.pos;var A,B,C={},D=["med","min","q1","q3","max"];s.boxmean&&D.push("mean"),s.boxpoints&&[].push.apply(D,["lf","uf"]);for(var E=0;E<D.length;E++)A=D[E],A in x&&!(x[A]in C)&&(C[x[A]]=!0,o=q.c2p(x[A],!0),B=f.extendFlat({},a),B[p+"0"]=B[p+"1"]=o,B[p+"LabelVal"]=x[A],B.attr=A,"mean"===A&&"sd"in x&&"sd"===s.boxmean&&(B[p+"err"]=x.sd),a.name="",w.push(B));return w}}},{"../../components/color":299,"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374}],440:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.layoutAttributes=a("./layout_attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("./layout_defaults"),d.calc=a("./calc"),d.setPositions=a("./set_positions"),d.plot=a("./plot"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="box",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","symbols","oriented","box","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":436,"./calc":437,"./defaults":438,"./hover":439,"./layout_attributes":441,"./layout_defaults":442,"./plot":443,"./set_positions":444,"./style":445}],441:[function(a,b,c){"use strict";b.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay"},boxgap:{valType:"number",min:0,max:1,dflt:.3},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3}}},{}],442:[function(a,b,c){"use strict";var d=a("../../plots/plots"),e=a("../../lib"),f=a("./layout_attributes");b.exports=function(a,b,c){function g(c,d){return e.coerce(a,b,f,c,d)}for(var h,i=0;i<c.length;i++)if(d.traceIs(c[i],"box")){h=!0;break}h&&(g("boxmode"),g("boxgap"),g("boxgroupgap"))}},{"../../lib":349,"../../plots/plots":413,"./layout_attributes":441}],443:[function(a,b,c){"use strict";function d(){i=2e9}function e(){var a=i;return i=(69069*i+1)%4294967296,Math.abs(i-a)<429496729?e():i/4294967296}var f=a("d3"),g=a("../../lib"),h=a("../../components/drawing"),i=2e9,j=5,k=.01;b.exports=function(a,b,c){var i,l,m=a._fullLayout,n=b.x(),o=b.y(),p=b.plot.select(".boxlayer").selectAll("g.trace.boxes").data(c).enter().append("g").attr("class","trace boxes");p.each(function(b){var c=b[0].t,p=b[0].trace,q="group"===m.boxmode&&a.numboxes>1,r=c.dPos*(1-m.boxgap)*(1-m.boxgroupgap)/(q?a.numboxes:1),s=q?2*c.dPos*(-.5+(c.boxnum+.5)/a.numboxes)*(1-m.boxgap):0,t=r*p.whiskerwidth;return p.visible!==!0||c.emptybox?void f.select(this).remove():("h"===p.orientation?(i=o,l=n):(i=n,l=o),c.bPos=s,c.bdPos=r,d(),f.select(this).selectAll("path.box").data(g.identity).enter().append("path").attr("class","box").each(function(a){var b=i.c2p(a.pos+s,!0),c=i.c2p(a.pos+s-r,!0),d=i.c2p(a.pos+s+r,!0),e=i.c2p(a.pos+s-t,!0),h=i.c2p(a.pos+s+t,!0),j=l.c2p(a.q1,!0),k=l.c2p(a.q3,!0),m=g.constrain(l.c2p(a.med,!0),Math.min(j,k)+1,Math.max(j,k)-1),n=l.c2p(p.boxpoints===!1?a.min:a.lf,!0),o=l.c2p(p.boxpoints===!1?a.max:a.uf,!0);"h"===p.orientation?f.select(this).attr("d","M"+m+","+c+"V"+d+"M"+j+","+c+"V"+d+"H"+k+"V"+c+"ZM"+j+","+b+"H"+n+"M"+k+","+b+"H"+o+(0===p.whiskerwidth?"":"M"+n+","+e+"V"+h+"M"+o+","+e+"V"+h)):f.select(this).attr("d","M"+c+","+m+"H"+d+"M"+c+","+j+"H"+d+"V"+k+"H"+c+"ZM"+b+","+j+"V"+n+"M"+b+","+k+"V"+o+(0===p.whiskerwidth?"":"M"+e+","+n+"H"+h+"M"+e+","+o+"H"+h))}),p.boxpoints&&f.select(this).selectAll("g.points").data(function(a){return a.forEach(function(a){a.t=c,a.trace=p}),a}).enter().append("g").attr("class","points").selectAll("path").data(function(a){var b,c,d,f,h,i,l,m="all"===p.boxpoints?a.val:a.val.filter(function(b){return b<a.lf||b>a.uf}),n=(a.q3-a.q1)*k,o=[],q=0;if(p.jitter){for(b=0;b<m.length;b++)c=Math.max(0,b-j),f=m[c],d=Math.min(m.length-1,b+j),h=m[d],"all"!==p.boxpoints&&(m[b]<a.lf?h=Math.min(h,a.lf):f=Math.max(f,a.uf)),i=Math.sqrt(n*(d-c)/(h-f))||0,i=g.constrain(Math.abs(i),0,1),o.push(i),q=Math.max(i,q);l=2*p.jitter/q}return m.map(function(b,c){var d,f=p.pointpos;return p.jitter&&(f+=l*o[c]*(e()-.5)),d="h"===p.orientation?{y:a.pos+f*r+s,x:b}:{x:a.pos+f*r+s,y:b},"suspectedoutliers"===p.boxpoints&&b<a.uo&&b>a.lo&&(d.so=!0),d})}).enter().append("path").call(h.translatePoints,n,o),void(p.boxmean&&f.select(this).selectAll("path.mean").data(g.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(a){var b=i.c2p(a.pos+s,!0),c=i.c2p(a.pos+s-r,!0),d=i.c2p(a.pos+s+r,!0),e=l.c2p(a.mean,!0),g=l.c2p(a.mean-a.sd,!0),h=l.c2p(a.mean+a.sd,!0);"h"===p.orientation?f.select(this).attr("d","M"+e+","+c+"V"+d+("sd"!==p.boxmean?"":"m0,0L"+g+","+b+"L"+e+","+c+"L"+h+","+b+"Z")):f.select(this).attr("d","M"+c+","+e+"H"+d+("sd"!==p.boxmean?"":"m0,0L"+b+","+g+"L"+c+","+e+"L"+b+","+h+"Z"))})))})}},{"../../components/drawing":317,"../../lib":349,d3:70}],444:[function(a,b,c){"use strict";var d=a("../../plots/plots"),e=a("../../plots/cartesian/axes"),f=a("../../lib");b.exports=function(a,b){var c,g,h,i,j=a._fullLayout,k=b.x(),l=b.y(),m=["v","h"];for(g=0;g<m.length;++g){var n,o,p,q=m[g],r=[],s=[],t=0,u=0;for(c="h"===q?l:k,h=0;h<a.calcdata.length;++h)n=a.calcdata[h],o=n[0].t,p=n[0].trace,p.visible===!0&&d.traceIs(p,"box")&&!o.emptybox&&p.orientation===q&&p.xaxis===k._id&&p.yaxis===l._id&&(r.push(h),p.boxpoints!==!1&&(t=Math.max(t,p.jitter-p.pointpos-1),u=Math.max(u,p.jitter+p.pointpos-1)));for(h=0;h<r.length;h++)for(n=a.calcdata[r[h]],i=0;i<n.length;i++)s.push(n[i].pos);if(s.length){var v=f.distinctVals(s),w=v.minDiff/2;for(s.length===v.vals.length&&(a.numboxes=1),e.minDtick(c,v.minDiff,v.vals[0],!0),g=0;g<r.length;++g)a.calcdata[g][0].t.dPos=w;var x=(1-j.boxgap)*(1-j.boxgroupgap)*w/a.numboxes;e.expand(c,v.vals,{vpadminus:w+t*x,vpadplus:w+u*x})}}}},{"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413}],445:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/color"),f=a("../../components/drawing");b.exports=function(a){var b=d.select(a).selectAll("g.trace.boxes");b.style("opacity",function(a){return a[0].trace.opacity}).each(function(a){var b=a[0].trace,c=b.line.width;d.select(this).selectAll("path.box").style("stroke-width",c+"px").call(e.stroke,b.line.color).call(e.fill,b.fillcolor),d.select(this).selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(e.stroke,b.line.color),d.select(this).selectAll("g.points path").call(f.pointStyle,b)})}},{"../../components/color":299,"../../components/drawing":317,d3:70}],446:[function(a,b,c){"use strict";var d=a("../scattergeo/attributes"),e=a("../../components/colorscale/attributes"),f=a("../../plots/attributes"),g=a("../../lib/extend").extendFlat,h=d.marker.line;b.exports={locations:{valType:"data_array"},locationmode:d.locationmode,z:{valType:"data_array"},text:{valType:"data_array"},marker:{line:{color:h.color,width:h.width}},zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,hoverinfo:g({},f.hoverinfo,{flags:["location","z","text","name"]}),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345,"../../plots/attributes":367,"../scattergeo/attributes":529}],447:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/colorscale/defaults"),f=a("./attributes");b.exports=function(a,b,c,g){function h(c,e){return d.coerce(a,b,f,c,e)}var i,j=h("locations");if(j&&(i=j.length),!j||!i)return void(b.visible=!1);var k=h("z");return Array.isArray(k)?(k.length>i&&(b.z=k.slice(0,i)),h("locationmode"),h("text"),h("marker.line.color"),h("marker.line.width"),e(a,b,g,h,{prefix:"",cLetter:"z"}),void h("hoverinfo",1===g._dataLength?"location+z+text":void 0)):void(b.visible=!1)}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":446}],448:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../heatmap/colorbar"),d.calc=a("../surface/calc"),d.plot=a("./plot").plot,d.moduleType="trace",d.name="choropleth",d.basePlotModule=a("../../plots/geo"),d.categories=["geo","noOpacity"],d.meta={},b.exports=d},{"../../plots/geo":385,"../heatmap/colorbar":461,"../surface/calc":539,"./attributes":446,"./defaults":447,"./plot":449}],449:[function(a,b,c){"use strict";function d(a,b){function c(b){var c=a.mockAxis;return g.tickText(c,c.c2l(b),"hover").text}var d=b.hoverinfo;if("none"===d)return function(a){delete a.nameLabel,delete a.textLabel};var e="all"===d?q.hoverinfo.flags:d.split("+"),f=-1!==e.indexOf("name"),h=-1!==e.indexOf("location"),i=-1!==e.indexOf("z"),j=-1!==e.indexOf("text"),k=!f&&h;return function(a){var d=[];k?a.nameLabel=a.id:(f&&(a.nameLabel=b.name),h&&d.push(a.id)),i&&d.push(c(a.z)),j&&d.push(a.tx),a.textLabel=d.join("<br>")}}function e(a){return function(b,c){return{points:[{data:a._input,fullData:a,curveNumber:a.index,pointNumber:c,location:b.id,z:b.z}]}}}var f=a("d3"),g=a("../../plots/cartesian/axes"),h=a("../../plots/cartesian/graph_interact"),i=a("../../components/color"),j=a("../../components/drawing"),k=a("../../components/colorscale/get_scale"),l=a("../../components/colorscale/make_scale_function"),m=a("../../lib/topojson_utils").getTopojsonFeatures,n=a("../../lib/geo_location_utils").locationToFeature,o=a("../../lib/array_to_calc_item"),p=a("../../constants/geo_constants"),q=a("./attributes"),r=b.exports={};r.calcGeoJSON=function(a,b){for(var c,d=[],e=a.locations,f=e.length,g=m(a,b),h=(a.marker||{}).line||{},i=0;f>i;i++)c=n(a.locationmode,e[i],g),void 0!==c&&(c.z=a.z[i],void 0!==a.text&&(c.tx=a.text[i]),o(h.color,c,"mlc",i),o(h.width,c,"mlw",i),d.push(c));return d.length>0&&(d[0].trace=a),d},r.plot=function(a,b,c){var g,i=a.framework,j=i.select("g.choroplethlayer"),k=i.select("g.baselayer"),l=i.select("g.baselayeroverchoropleth"),m=p.baseLayersOverChoropleth,n=j.selectAll("g.trace.choropleth").data(b,function(a){return a.uid});n.enter().append("g").attr("class","trace choropleth"),n.exit().remove(),n.each(function(b){function c(b,c){if(a.showHover){var d=a.projection(b.properties.ct);j(b),h.loneHover({x:d[0],y:d[1],name:b.nameLabel,text:b.textLabel},{container:a.hoverContainer.node()}),a.graphDiv.emit("plotly_hover",k(b,c))}}function g(b,c){a.graphDiv.emit("plotly_click",k(b,c))}var i=r.calcGeoJSON(b,a.topojson),j=d(a,b),k=e(b);f.select(this).selectAll("path.choroplethlocation").data(i).enter().append("path").attr("class","choroplethlocation").on("mouseover",c).on("click",g).on("mouseout",function(){h.loneUnhover(a.hoverContainer)}).on("mousedown",function(){h.loneUnhover(a.hoverContainer)}).on("mouseup",c)}),l.selectAll("*").remove();for(var o=0;o<m.length;o++)g=m[o],k.select("g."+g).remove(),a.drawTopo(l,g,c),a.styleLayer(l,g,c);r.style(a)},r.style=function(a){a.framework.selectAll("g.trace.choropleth").each(function(a){var b=f.select(this),c=a.marker||{},d=c.line||{},e=a.zmin,g=a.zmax,h=k(a.colorscale),m=l(h,e,g);b.selectAll("path.choroplethlocation").each(function(a){f.select(this).attr("fill",function(a){return m(a.z)}).call(i.stroke,a.mlc||d.color).call(j.dashLine,"",a.mlw||d.width)})})}},{"../../components/color":299,"../../components/colorscale/get_scale":310,"../../components/colorscale/make_scale_function":315,"../../components/drawing":317,"../../constants/geo_constants":334,"../../lib/array_to_calc_item":341,"../../lib/geo_location_utils":346,"../../lib/topojson_utils":361,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"./attributes":446,d3:70}],450:[function(a,b,c){"use strict";var d=a("../heatmap/attributes"),e=a("../scatter/attributes"),f=a("../../lib/extend").extendFlat,g=e.line;b.exports={z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:d.text,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,zauto:d.zauto,zmin:d.zmin,zmax:d.zmax,colorscale:d.colorscale,autocolorscale:d.autocolorscale,reversescale:d.reversescale,showscale:d.showscale,connectgaps:d.connectgaps,autocontour:{valType:"boolean",dflt:!0},ncontours:{valType:"integer",dflt:0},contours:{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"number",dflt:null},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill"},showlines:{valType:"boolean",dflt:!0}},line:{color:f({},g.color,{}),width:g.width,dash:g.dash,smoothing:f({},g.smoothing,{})},_nestedModules:{colorbar:"Colorbar"}}},{"../../lib/extend":345,"../heatmap/attributes":459,"../scatter/attributes":502}],451:[function(a,b,c){ 56 "use strict";var d=a("../../plots/cartesian/axes"),e=a("../heatmap/calc");b.exports=function(a,b){var c=e(a,b),f=b.contours;if(b.autocontour!==!1){var g={type:"linear",range:[b.zmin,b.zmax]};d.autoTicks(g,(b.zmax-b.zmin)/(b.ncontours||15)),f.start=d.tickFirst(g),f.size=g.dtick,g.range.reverse(),f.end=d.tickFirst(g),f.start===b.zmin&&(f.start+=f.size),f.end===b.zmax&&(f.end-=f.size),f.end+=f.size/100,b._input.contours=f}return c}},{"../../plots/cartesian/axes":369,"../heatmap/calc":460}],452:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../plots/plots"),f=a("../../components/colorscale/get_scale"),g=a("../../components/colorbar/draw");b.exports=function(a,b){var c=b[0].trace,h="cb"+c.uid;if(a._fullLayout._infolayer.selectAll("."+h).remove(),c.showscale===!1)return void e.autoMargin(a,h);var i=g(a,h);b[0].t.cb=i;var j=c.contours,k=c.line,l=j.size||1,m=Math.floor((j.end+l/10-j.start)/l)+1,n=f(c.colorscale),o="lines"===j.coloring?0:1,p=d.scale.linear().interpolate(d.interpolateRgb),q=n.map(function(a){return(a[0]*(m+o-1)-o/2)*l+j.start}),r=n.map(function(a){return a[1]});if("heatmap"===j.coloring){c.zauto&&c.autocontour===!1&&(c.zmin=j.start-l/2,c.zmax=c.zmin+m*l),i.filllevels({start:c.zmin,end:c.zmax,size:(c.zmax-c.zmin)/254}),q=n.map(function(a){return a[0]*(c.zmax-c.zmin)+c.zmin});var s=d.extent([c.zmin,c.zmax,j.start,j.start+l*(m-1)]),t=s[c.zmin<c.zmax?0:1],u=s[c.zmin<c.zmax?1:0];t!==c.zmin&&(q.splice(0,0,t),r.splice(0,0,r[0])),u!==c.zmax&&(q.push(u),r.push(r[r.length-1]))}p.domain(q).range(r),i.fillcolor("fill"===j.coloring||"heatmap"===j.coloring?p:"").line({color:"lines"===j.coloring?p:k.color,width:j.showlines!==!1?k.width:0,dash:k.dash}).levels({start:j.start,end:j.end,size:l}).options(c.colorbar)()}},{"../../components/colorbar/draw":302,"../../components/colorscale/get_scale":310,"../../plots/plots":413,d3:70}],453:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../heatmap/has_columns"),f=a("../heatmap/xyz_defaults"),g=a("../contour/style_defaults"),h=a("./attributes");b.exports=function(a,b,c,i){function j(c,e){return d.coerce(a,b,h,c,e)}var k=f(a,b,j);if(!k)return void(b.visible=!1);j("text"),j("connectgaps",e(b));var l=d.coerce2(a,b,h,"contours.start"),m=d.coerce2(a,b,h,"contours.end"),n=j("autocontour",!(l&&m));j(n?"ncontours":"contours.size"),g(a,b,j,i)}},{"../../lib":349,"../contour/style_defaults":458,"../heatmap/has_columns":464,"../heatmap/xyz_defaults":470,"./attributes":450}],454:[function(a,b,c){"use strict";var d=a("../heatmap/hover");b.exports=function(a,b,c,e){return d(a,b,c,e,!0)}},{"../heatmap/hover":465}],455:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("./calc"),d.plot=a("./plot"),d.style=a("./style"),d.colorbar=a("./colorbar"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="contour",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap","contour"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":450,"./calc":451,"./colorbar":452,"./defaults":453,"./hover":454,"./plot":456,"./style":457}],456:[function(a,b,c){"use strict";function d(a,b,c){v.markTime("in Contour.plot");var d=c[0].trace,f=c[0].x,h=c[0].y,j=d.contours,k=d.uid,l=b.x(),m=b.y(),q=a._fullLayout,t="contour"+k,u=e(j,b,c[0]);if(d.visible!==!0)return q._paper.selectAll("."+t+",.hm"+k).remove(),void q._infolayer.selectAll(".cb"+k).remove();"heatmap"===j.coloring?(d.zauto&&d.autocontour===!1&&(d._input.zmin=d.zmin=j.start-j.size/2,d._input.zmax=d.zmax=d.zmin+u.length*j.size),x(a,b,[c])):q._paper.selectAll(".hm"+k).remove(),g(u),i(u);var w=l.c2p(f[0],!0),y=l.c2p(f[f.length-1],!0),z=m.c2p(h[0],!0),A=m.c2p(h[h.length-1],!0),B=[[w,A],[y,A],[y,z],[w,z]],C=n(b,c,t);o(C,B,j),p(C,u,B,j),r(C,u,j),s(C,b,c[0],B),v.markTime("done Contour.plot")}function e(a,b,c){for(var d=a.size||1,e=[],f=a.start;f<a.end+d/10;f+=d)e.push({level:f,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:b.x(),yaxis:b.y(),x:c.x,y:c.y,z:c.z,smoothing:c.trace.line.smoothing});return e}function f(a,b){var c=(b[0][0]>a?0:1)+(b[0][1]>a?0:2)+(b[1][1]>a?0:4)+(b[1][0]>a?0:8);if(5===c||10===c){var d=(b[0][0]+b[0][1]+b[1][0]+b[1][1])/4;return a>d?5===c?713:1114:5===c?104:208}return 15===c?0:c}function g(a){var b,c,d,e,g,h,i,j,k,l=a[0].z,m=l.length,n=l[0].length,o=2===m||2===n;for(c=0;m-1>c;c++)for(e=[],0===c&&(e=e.concat(y)),c===m-2&&(e=e.concat(z)),b=0;n-1>b;b++)for(d=e.slice(),0===b&&(d=d.concat(A)),b===n-2&&(d=d.concat(B)),g=b+","+c,h=[[l[c][b],l[c][b+1]],[l[c+1][b],l[c+1][b+1]]],k=0;k<a.length;k++)j=a[k],i=f(j.level,h),i&&(j.crossings[g]=i,-1!==d.indexOf(i)&&(j.starts.push([b,c]),o&&-1!==d.indexOf(i,d.indexOf(i)+1)&&j.starts.push([b,c])))}function h(a,b,c){function d(a){return n[a%n.length]}var e,f=b.join(","),g=f,h=a.crossings[g],i=j(h,c,b),n=[m(a,b,[-i[0],-i[1]])],o=i.join(","),p=a.z.length,q=a.z[0].length;for(e=0;1e4>e;e++){if(h>20?(h=D[h][(i[0]||i[1])<0?0:1],a.crossings[g]=E[h]):delete a.crossings[g],i=C[h],!i){console.log("found bad marching index",h,b,a.level);break}if(n.push(m(a,b,i)),b[0]+=i[0],b[1]+=i[1],k(n[n.length-1],n[n.length-2])&&n.pop(),g=b.join(","),g===f&&i.join(",")===o||c&&(i[0]&&(b[0]<0||b[0]>q-2)||i[1]&&(b[1]<0||b[1]>p-2)))break;h=a.crossings[g]}1e4===e&&console.log("Infinite loop in contour?");var r,s,t,u,v,w,x,y=k(n[0],n[n.length-1]),z=0,A=.2*a.smoothing,B=[],F=0;for(e=1;e<n.length;e++)x=l(n[e],n[e-1]),z+=x,B.push(x);var G=z/B.length*A;for(e=n.length-2;e>=F;e--)if(r=B[e],G>r){for(t=0,s=e-1;s>=F&&r+B[s]<G;s--)r+=B[s];if(y&&e===n.length-2)for(t=0;s>t&&r+B[t]<G;t++)r+=B[t];v=e-s+t+1,w=Math.floor((e+s+t+2)/2),u=y||e!==n.length-2?y||-1!==s?v%2?d(w):[(d(w)[0]+d(w+1)[0])/2,(d(w)[1]+d(w+1)[1])/2]:n[0]:n[n.length-1],n.splice(s+1,e-s+1,u),e=s+1,t&&(F=t),y&&(e===n.length-2?n[t]=n[n.length-1]:0===e&&(n[n.length-1]=n[0]))}if(n.splice(0,F),!(n.length<2))if(y)n.pop(),a.paths.push(n);else{c||console.log("unclosed interior contour?",a.level,f,n.join("L"));var H=!1;a.edgepaths.forEach(function(b,c){if(!H&&k(b[0],n[n.length-1])){n.pop(),H=!0;var d=!1;a.edgepaths.forEach(function(b,e){!d&&k(b[b.length-1],n[0])&&(d=!0,n.splice(0,1),a.edgepaths.splice(c,1),e===c?a.paths.push(n.concat(b)):a.edgepaths[e]=a.edgepaths[e].concat(n,b))}),d||(a.edgepaths[c]=n.concat(b))}}),a.edgepaths.forEach(function(b,c){!H&&k(b[b.length-1],n[0])&&(n.splice(0,1),a.edgepaths[c]=b.concat(n),H=!0)}),H||a.edgepaths.push(n)}}function i(a){var b,c,d,e,f;for(d=0;d<a.length;d++){for(e=a[d],f=0;f<e.starts.length;f++)c=e.starts[f],h(e,c,"edge");for(b=0;Object.keys(e.crossings).length&&1e4>b;)b++,c=Object.keys(e.crossings)[0].split(",").map(Number),h(e,c);1e4===b&&console.log("Infinite loop in contour?")}}function j(a,b,c){var d=0,e=0;return a>20&&b?208===a||1114===a?d=0===c[0]?1:-1:e=0===c[1]?1:-1:-1!==y.indexOf(a)?e=1:-1!==A.indexOf(a)?d=1:-1!==z.indexOf(a)?e=-1:d=-1,[d,e]}function k(a,b){return Math.abs(a[0]-b[0])<.01&&Math.abs(a[1]-b[1])<.01}function l(a,b){var c=a[0]-b[0],d=a[1]-b[1];return Math.sqrt(c*c+d*d)}function m(a,b,c){var d=b[0]+Math.max(c[0],0),e=b[1]+Math.max(c[1],0),f=a.z[e][d],g=a.xaxis,h=a.yaxis;if(c[1]){var i=(a.level-f)/(a.z[e][d+1]-f);return[g.c2p((1-i)*a.x[d]+i*a.x[d+1],!0),h.c2p(a.y[e],!0)]}var j=(a.level-f)/(a.z[e+1][d]-f);return[g.c2p(a.x[d],!0),h.c2p((1-j)*a.y[e]+j*a.y[e+1],!0)]}function n(a,b,c){var d=a.plot.select(".maplayer").selectAll("g.contour."+c).data(b);return d.enter().append("g").classed("contour",!0).classed(c,!0),d.exit().remove(),d}function o(a,b,c){var d=a.selectAll("g.contourbg").data([0]);d.enter().append("g").classed("contourbg",!0);var e=d.selectAll("path").data("fill"===c.coloring?[0]:[]);e.enter().append("path"),e.exit().remove(),e.attr("d","M"+b.join("L")+"Z").style("stroke","none")}function p(a,b,c,d){var e=a.selectAll("g.contourfill").data([0]);e.enter().append("g").classed("contourfill",!0);var f=e.selectAll("path").data("fill"===d.coloring?b:[]);f.enter().append("path"),f.exit().remove(),f.each(function(a){var b=q(a,c);b?u.select(this).attr("d",b).style("stroke","none"):u.select(this).remove()})}function q(a,b){function c(a){return Math.abs(a[1]-b[0][1])<.01}function d(a){return Math.abs(a[1]-b[2][1])<.01}function e(a){return Math.abs(a[0]-b[0][0])<.01}function f(a){return Math.abs(a[0]-b[2][0])<.01}for(var g,h,i,j,k,l,m=a.edgepaths.length||a.z[0][0]<a.level?"":"M"+b.join("L")+"Z",n=0,o=a.edgepaths.map(function(a,b){return b}),p=!0;o.length;){for(l=w.smoothopen(a.edgepaths[n],a.smoothing),m+=p?l:l.replace(/^M/,"L"),o.splice(o.indexOf(n),1),g=a.edgepaths[n][a.edgepaths[n].length-1],j=-1,i=0;4>i;i++){if(!g){console.log("missing end?",n,a);break}for(c(g)&&!f(g)?h=b[1]:e(g)?h=b[0]:d(g)?h=b[3]:f(g)&&(h=b[2]),k=0;k<a.edgepaths.length;k++){var q=a.edgepaths[k][0];Math.abs(g[0]-h[0])<.01?Math.abs(g[0]-q[0])<.01&&(q[1]-g[1])*(h[1]-q[1])>=0&&(h=q,j=k):Math.abs(g[1]-h[1])<.01?Math.abs(g[1]-q[1])<.01&&(q[0]-g[0])*(h[0]-q[0])>=0&&(h=q,j=k):console.log("endpt to newendpt is not vert. or horz.",g,h,q)}if(g=h,j>=0)break;m+="L"+h}if(j===a.edgepaths.length){console.log("unclosed perimeter path");break}n=j,p=-1===o.indexOf(n),p&&(n=o[0],m+="Z")}for(n=0;n<a.paths.length;n++)m+=w.smoothclosed(a.paths[n],a.smoothing);return m}function r(a,b,c){var d=b[0].smoothing,e=a.selectAll("g.contourlevel").data(c.showlines===!1?[]:b);e.enter().append("g").classed("contourlevel",!0),e.exit().remove();var f=e.selectAll("path.openline").data(function(a){return a.edgepaths});f.enter().append("path").classed("openline",!0),f.exit().remove(),f.attr("d",function(a){return w.smoothopen(a,d)}).style("stroke-miterlimit",1);var g=e.selectAll("path.closedline").data(function(a){return a.paths});g.enter().append("path").classed("closedline",!0),g.exit().remove(),g.attr("d",function(a){return w.smoothclosed(a,d)}).style("stroke-miterlimit",1)}function s(a,b,c,d){var e="clip"+c.trace.uid,f=b.plot.selectAll("defs").data([0]);f.enter().append("defs");var h=f.selectAll("#"+e).data(c.trace.connectgaps?[]:[0]);if(h.enter().append("clipPath").attr("id",e),h.exit().remove(),c.trace.connectgaps===!1){var j={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:b.x(),yaxis:b.y(),x:c.x,y:c.y,z:t(c),smoothing:0};g([j]),i([j]);var k=q(j,d),l=h.selectAll("path").data([0]);l.enter().append("path"),l.attr("d",k)}else e=null;a.call(w.setClipUrl,e),b.plot.selectAll(".hm"+c.trace.uid).call(w.setClipUrl,e)}function t(a){var b,c,d=a.trace._emptypoints,e=[],f=a.z.length,g=a.z[0].length,h=[];for(b=0;g>b;b++)h.push(1);for(b=0;f>b;b++)e.push(h.slice());for(b=0;b<d.length;b++)c=d[b],e[c[0]][c[1]]=0;return a.zmask=e,e}var u=a("d3"),v=a("../../lib"),w=a("../../components/drawing"),x=a("../heatmap/plot");b.exports=function(a,b,c){for(var e=0;e<c.length;e++)d(a,b,c[e])};var y=[1,9,13,104,713],z=[4,6,7,104,713],A=[8,12,14,208,1114],B=[2,3,11,208,1114],C=[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],D={104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},E={1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11}},{"../../components/drawing":317,"../../lib":349,"../heatmap/plot":468,d3:70}],457:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/drawing"),f=a("../../components/colorscale/get_scale"),g=a("../heatmap/style");b.exports=function(a){d.select(a).selectAll("g.contour").style("opacity",function(a){return a.trace.opacity}).each(function(a){var b=d.select(this),c=a.trace,g=c.contours,h=c.line,i="lines"===g.coloring,j=g.size||1,k=Math.floor((g.end+j/10-g.start)/j)+1,l=f(c.colorscale),m=i?0:1,n=d.scale.linear().domain(l.map(function(a){return(a[0]*(k+m-1)-m/2)*j+g.start})).interpolate(d.interpolateRgb).range(l.map(function(a){return a[1]}));b.selectAll("g.contourlevel").each(function(a,b){d.select(this).selectAll("path").call(e.lineGroupStyle,h.width,i?n(g.start+b*j):h.color,h.dash)}),b.selectAll("g.contourbg path").style("fill",n(g.start-j/2)),b.selectAll("g.contourfill path").style("fill",function(a,b){return n(g.start+(b+.5)*j)})}),g(a)}},{"../../components/colorscale/get_scale":310,"../../components/drawing":317,"../heatmap/style":469,d3:70}],458:[function(a,b,c){"use strict";var d=a("../../components/colorscale/defaults");b.exports=function(a,b,c,e){var f,g=c("contours.coloring");"fill"===g&&(f=c("contours.showlines")),f!==!1&&("lines"!==g&&c("line.color","#000"),c("line.width",.5),c("line.dash")),c("line.smoothing"),"none"!==(b.contours||{}).coloring&&d(a,b,e,c,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":308}],459:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../components/colorscale/attributes"),f=a("../../lib/extend").extendFlat;b.exports={z:{valType:"data_array"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:{valType:"data_array"},transpose:{valType:"boolean",dflt:!1},xtype:{valType:"enumerated",values:["array","scaled"]},ytype:{valType:"enumerated",values:["array","scaled"]},zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:f({},e.autocolorscale,{dflt:!1}),reversescale:e.reversescale,showscale:e.showscale,zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1},connectgaps:{valType:"boolean",dflt:!1},_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345,"../scatter/attributes":502}],460:[function(a,b,c){"use strict";function d(a){function b(a){return j(a)?+a:void 0}var c,d,e,f,g,h,i=a.z;if(a.transpose){for(c=0,g=0;g<i.length;g++)c=Math.max(c,i[g].length);if(0===c)return!1;e=function(a){return a.length},f=function(a,b,c){return a[c][b]}}else c=i.length,e=function(a,b){return a[b].length},f=function(a,b,c){return a[b][c]};var k=new Array(c);for(g=0;c>g;g++)for(d=e(i,g),k[g]=new Array(d),h=0;d>h;h++)k[g][h]=b(f(i,g,h));return k}function e(a,b,c,d,e,f){var g,h,i,j=[],k=m.traceIs(a,"contour"),l=m.traceIs(a,"histogram");if(Array.isArray(b)&&!l&&"category"!==f.type){b=b.map(f.d2c);var n=b.length;if(!(e>=n))return k?b.slice(0,e):b.slice(0,e+1);if(k)j=b.slice(0,e);else if(1===e)j=[b[0]-.5,b[0]+.5];else{for(j=[1.5*b[0]-.5*b[1]],i=1;n>i;i++)j.push(.5*(b[i-1]+b[i]));j.push(1.5*b[n-1]-.5*b[n-2])}if(e>n){var o=j[j.length-1],p=o-j[j.length-2];for(i=n;e>i;i++)o+=p,j.push(o)}}else for(h=d||1,g=void 0===c?0:l||"category"===f.type?c:f.d2c(c),i=k?0:-.5;e>i;i++)j.push(g+h*i);return j}function f(a){return.5-.25*Math.min(1,.5*a)}function g(a,b,c){var d,e,g=1;if(Array.isArray(c))for(d=0;d<b.length;d++)e=b[d],a[e[0]][e[1]]=c[e[0]][e[1]];else i(a,b);for(d=0;d<b.length&&!(b[d][2]<4);d++);for(b=b.slice(d),d=0;100>d&&g>s;d++)g=i(a,b,f(g));return g>s&&console.log("interp2d didn't converge quickly",g),a}function h(a){var b,c,d,e,f,g,h,i,j=[],k={},l=[],m=a[0],n=[],o=[0,0,0],p=r(a);for(c=0;c<a.length;c++)for(b=n,n=m,m=a[c+1]||[],d=0;p>d;d++)void 0===n[d]&&(g=(void 0!==n[d-1]?1:0)+(void 0!==n[d+1]?1:0)+(void 0!==b[d]?1:0)+(void 0!==m[d]?1:0),g?(0===c&&g++,0===d&&g++,c===a.length-1&&g++,d===n.length-1&&g++,4>g&&(k[[c,d]]=[c,d,g]),j.push([c,d,g])):l.push([c,d]));for(;l.length;){for(h={},i=!1,f=l.length-1;f>=0;f--)e=l[f],c=e[0],d=e[1],g=((k[[c-1,d]]||o)[2]+(k[[c+1,d]]||o)[2]+(k[[c,d-1]]||o)[2]+(k[[c,d+1]]||o)[2])/20,g&&(h[e]=[c,d,g],l.splice(f,1),i=!0);if(!i)throw"findEmpties iterated with no new neighbors";for(e in h)k[e]=h[e],j.push(h[e])}return j.sort(function(a,b){return b[2]-a[2]})}function i(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q=0;for(g=0;g<b.length;g++){for(d=b[g],e=d[0],f=d[1],n=a[e][f],m=0,l=0,h=0;4>h;h++)i=t[h],j=a[e+i[0]],j&&(k=j[f+i[1]],void 0!==k&&(0===m?o=p=k:(o=Math.min(o,k),p=Math.max(p,k)),l++,m+=k));if(0===l)throw"iterateInterp2d order is wrong: no defined neighbors";a[e][f]=m/l,void 0===n?4>l&&(q=1):(a[e][f]=(1+c)*a[e][f]-c*n,p>o&&(q=Math.max(q,Math.abs(a[e][f]-n)/(p-o))))}return q}var j=a("fast-isnumeric"),k=a("../../lib"),l=a("../../plots/cartesian/axes"),m=a("../../plots/plots"),n=a("../histogram2d/calc"),o=a("../../components/colorscale/calc"),p=a("./has_columns"),q=a("./convert_column_xyz"),r=a("./max_row_length");b.exports=function(a,b){function c(a){B=b._input.zsmooth=b.zsmooth=!1,k.notifier("cannot fast-zsmooth: "+a)}k.markTime("start convert x&y");var f,i,j,s,t,u,v,w,x=l.getFromId(a,b.xaxis||"x"),y=l.getFromId(a,b.yaxis||"y"),z=m.traceIs(b,"contour"),A=m.traceIs(b,"histogram"),B=z?"best":b.zsmooth;if(x._minDtick=0,y._minDtick=0,k.markTime("done convert x&y"),A){var C=n(a,b);f=C.x,i=C.x0,j=C.dx,s=C.y,t=C.y0,u=C.dy,v=C.z}else p(b)&&q(b,x,y),f=b.x?x.makeCalcdata(b,"x"):[],s=b.y?y.makeCalcdata(b,"y"):[],i=b.x0||0,j=b.dx||1,t=b.y0||0,u=b.dy||1,v=d(b),(z||b.connectgaps)&&(b._emptypoints=h(v),b._interpz=g(v,b._emptypoints,b._interpz));if("fast"===B)if("log"===x.type||"log"===y.type)c("log axis found");else if(!A){if(f.length){var D=(f[f.length-1]-f[0])/(f.length-1),E=Math.abs(D/100);for(w=0;w<f.length-1;w++)if(Math.abs(f[w+1]-f[w]-D)>E){c("x scale is not linear");break}}if(s.length&&"fast"===B){var F=(s[s.length-1]-s[0])/(s.length-1),G=Math.abs(F/100);for(w=0;w<s.length-1;w++)if(Math.abs(s[w+1]-s[w]-F)>G){c("y scale is not linear");break}}}var H=r(v),I="scaled"===b.xtype?"":b.x,J=e(b,I,i,j,H,x),K="scaled"===b.ytype?"":b.y,L=e(b,K,t,u,v.length,y);l.expand(x,J),l.expand(y,L);var M={x:J,y:L,z:v};if(o(b,v,"","z"),z&&b.contours&&"heatmap"===b.contours.coloring){var N="contour"===b.type?"heatmap":"histogram2d";M.xfill=e(N,I,i,j,H,x),M.yfill=e(N,K,t,u,v.length,y)}return[M]};var s=.01,t=[[-1,0],[1,0],[0,-1],[0,1]]},{"../../components/colorscale/calc":306,"../../lib":349,"../../plots/cartesian/axes":369,"../../plots/plots":413,"../histogram2d/calc":480,"./convert_column_xyz":462,"./has_columns":464,"./max_row_length":467,"fast-isnumeric":74}],461:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("../../plots/plots"),h=a("../../components/colorscale/get_scale"),i=a("../../components/colorbar/draw");b.exports=function(a,b){var c=b[0].trace,j="cb"+c.uid,k=h(c.colorscale),l=c.zmin,m=c.zmax;if(e(l)||(l=f.aggNums(Math.min,null,c.z)),e(m)||(m=f.aggNums(Math.max,null,c.z)),a._fullLayout._infolayer.selectAll("."+j).remove(),!c.showscale)return void g.autoMargin(a,j);var n=b[0].t.cb=i(a,j);n.fillcolor(d.scale.linear().domain(k.map(function(a){return l+a[0]*(m-l)})).range(k.map(function(a){return a[1]}))).filllevels({start:l,end:m,size:(m-l)/254}).options(c.colorbar)(),f.markTime("done colorbar")}},{"../../components/colorbar/draw":302,"../../components/colorscale/get_scale":310,"../../lib":349,"../../plots/plots":413,d3:70,"fast-isnumeric":74}],462:[function(a,b,c){"use strict";var d=a("../../lib");b.exports=function(a,b,c){var e,f=a.x.slice(),g=a.y.slice(),h=a.z,i=a.text,j=Math.min(f.length,g.length,h.length),k=void 0!==i&&!Array.isArray(i[0]);for(j<f.length&&(f=f.slice(0,j)),j<g.length&&(g=g.slice(0,j)),e=0;j>e;e++)f[e]=b.d2c(f[e]),g[e]=c.d2c(g[e]);var l,m,n,o=d.distinctVals(f),p=o.vals,q=d.distinctVals(g),r=q.vals,s=d.init2dArray(r.length,p.length);for(k&&(n=d.init2dArray(r.length,p.length)),e=0;j>e;e++)l=d.findBin(f[e]+o.minDiff/2,p),m=d.findBin(g[e]+q.minDiff/2,r),s[m][l]=h[e],k&&(n[m][l]=i[e]);a.x=p,a.y=r,a.z=s,k&&(a.text=n)}},{"../../lib":349}],463:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./has_columns"),f=a("./xyz_defaults"),g=a("../../components/colorscale/defaults"),h=a("./attributes");b.exports=function(a,b,c,i){function j(c,e){return d.coerce(a,b,h,c,e)}var k=f(a,b,j);return k?(j("text"),j("zsmooth"),j("connectgaps",e(b)&&b.zsmooth!==!1),void g(a,b,i,j,{prefix:"",cLetter:"z"})):void(b.visible=!1)}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":459,"./has_columns":464,"./xyz_defaults":470}],464:[function(a,b,c){"use strict";b.exports=function(a){return!Array.isArray(a.z[0])}},{}],465:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/graph_interact"),e=a("../../lib");b.exports=function(a,b,c,f,g){if(!(a.distance<d.MAXDIST)){var h,i,j,k,l=a.cd[0],m=l.trace,n=a.xa,o=a.ya,p=l.x,q=l.y,r=l.z,s=l.zmask,t=p,u=q;if(a.index!==!1){try{j=Math.round(a.index[1]),k=Math.round(a.index[0])}catch(v){return void console.log("Error hovering on heatmap, pointNumber must be [row,col], found:",a.index)}if(0>j||j>=r[0].length||0>k||k>r.length)return}else{if(d.inbox(b-p[0],b-p[p.length-1])>d.MAXDIST||d.inbox(c-q[0],c-q[q.length-1])>d.MAXDIST)return;if(g){var w;for(t=[2*p[0]-p[1]],w=1;w<p.length;w++)t.push((p[w]+p[w-1])/2);for(t.push([2*p[p.length-1]-p[p.length-2]]),u=[2*q[0]-q[1]],w=1;w<q.length;w++)u.push((q[w]+q[w-1])/2);u.push([2*q[q.length-1]-q[q.length-2]])}j=Math.max(0,Math.min(t.length-2,e.findBin(b,t))),k=Math.max(0,Math.min(u.length-2,e.findBin(c,u)))}var x=n.c2p(p[j]),y=n.c2p(p[j+1]),z=o.c2p(q[k]),A=o.c2p(q[k+1]);g?(y=x,h=p[j],A=z,i=q[k]):(h=(p[j]+p[j+1])/2,i=(q[k]+q[k+1])/2,m.zsmooth&&(x=y=(x+y)/2,z=A=(z+A)/2));var B=r[k][j];s&&!s[k][j]&&(B=void 0);var C;return Array.isArray(m.text)&&Array.isArray(m.text[k])&&(C=m.text[k][j]),[e.extendFlat(a,{index:[k,j],distance:d.MAXDIST+10,x0:x,x1:y,y0:z,y1:A,xLabelVal:h,yLabelVal:i,zLabelVal:B,text:C})]}}},{"../../lib":349,"../../plots/cartesian/graph_interact":374}],466:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("./calc"),d.plot=a("./plot"),d.colorbar=a("./colorbar"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.moduleType="trace",d.name="heatmap",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":459,"./calc":460,"./colorbar":461,"./defaults":463,"./hover":465,"./plot":468,"./style":469}],467:[function(a,b,c){"use strict";b.exports=function(a){for(var b=0,c=0;c<a.length;c++)b=Math.max(b,a[c].length);return b}},{}],468:[function(a,b,c){"use strict";function d(a,b,c){function d(a,b){var c=b.length-2,d=g.constrain(g.findBin(a,b),0,c),e=b[d],f=b[d+1],h=g.constrain(d+(a-e)/(f-e)-.5,0,c),i=Math.round(h),j=Math.abs(h-i);return h&&h!==c&&j?{bin0:i,frac:j,bin1:Math.round(i+j/(h-i))}:{bin0:i,bin1:i,frac:0}}function l(a,b){if(void 0!==a){var c=V((a-B)/(C-B));return c[0]=Math.round(c[0]),c[1]=Math.round(c[1]),c[2]=Math.round(c[2]),ea+=b,fa+=c[0]*b,ga+=c[1]*b,ha+=c[2]*b,c}return[0,0,0,0]}function m(a,b,c){a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=Math.round(255*c[3])}function n(a,b,c,d){var e=a[c.bin0];if(void 0===e)return l(void 0,1);var f,g=a[c.bin1],h=b[c.bin0],i=b[c.bin1],j=g-e||0,k=h-e||0;return f=void 0===g?void 0===i?0:void 0===h?2*(i-e):2*(2*i-h-e)/3:void 0===i?void 0===h?0:2*(2*e-g-h)/3:void 0===h?2*(2*i-g-e)/3:i+e-g-h,l(e+c.frac*j+d.frac*(k+c.frac*f))}g.markTime("in Heatmap.plot");var o=c[0].trace,p=o.uid,q=b.x(),r=b.y(),s=a._fullLayout,t="hm"+p;if(s._paper.selectAll(".contour"+p).remove(),o.visible!==!0)return s._paper.selectAll("."+t).remove(),void s._infolayer.selectAll(".cb"+p).remove();var u,v,w,x,y,z,A=c[0].z,B=o.zmin,C=o.zmax,D=i(o.colorscale),E=c[0].x,F=c[0].y,G=h.traceIs(o,"contour"),H=G?"best":o.zsmooth,I=A.length,J=k(A),K=!1,L=!1;for(z=0;void 0===u&&z<E.length-1;)u=q.c2p(E[z]),z++;for(z=E.length-1;void 0===v&&z>0;)v=q.c2p(E[z]),z--;for(u>v&&(w=v,v=u,u=w,K=!0),z=0;void 0===x&&z<F.length-1;)x=r.c2p(F[z]),z++;for(z=F.length-1;void 0===y&&z>0;)y=r.c2p(F[z]),z--;if(x>y&&(w=x,x=y,y=w,L=!0),G&&(E=c[0].xfill,F=c[0].yfill),"fast"!==H){var M="best"===H?0:.5;u=Math.max(-M*q._length,u),v=Math.min((1+M)*q._length,v),x=Math.max(-M*r._length,x),y=Math.min((1+M)*r._length,y)}var N=Math.round(v-u),O=Math.round(y-x);if(!(0>=N||0>=O)){var P,Q;"fast"===H?(P=J,Q=I):(P=N,Q=O);var R=document.createElement("canvas");R.width=P,R.height=Q;var S,T,U=R.getContext("2d"),V=e.scale.linear().domain(D.map(function(a){return a[0]})).range(D.map(function(a){var b=f(a[1]).toRgb();return[b.r,b.g,b.b,b.a]})).clamp(!0);"fast"===H?(S=K?function(a){return J-1-a}:g.identity,T=L?function(a){return I-1-a}:g.identity):(S=function(a){return g.constrain(Math.round(q.c2p(E[a])-u),0,N)},T=function(a){return g.constrain(Math.round(r.c2p(F[a])-x),0,O)});var W,X,Y,Z,$,_,aa=T(0),ba=[aa,aa],ca=K?0:1,da=L?0:1,ea=0,fa=0,ga=0,ha=0;if(g.markTime("done init png"),H){var ia=0,ja=new Uint8Array(N*O*4);if("best"===H){var ka,la,ma,na=new Array(E.length),oa=new Array(F.length),pa=new Array(N);for(z=0;z<E.length;z++)na[z]=Math.round(q.c2p(E[z])-u);for(z=0;z<F.length;z++)oa[z]=Math.round(r.c2p(F[z])-x);for(z=0;N>z;z++)pa[z]=d(z,na);for(X=0;O>X;X++)for(ka=d(X,oa),la=A[ka.bin0],ma=A[ka.bin1],z=0;N>z;z++,ia+=4)_=n(la,ma,pa[z],ka),m(ja,ia,_)}else for(X=0;I>X;X++)for($=A[X],ba=T(X),z=0;J>z;z++)_=l($[z],1),ia=4*(ba*N+S(z)),m(ja,ia,_);var qa=U.createImageData(N,O);qa.data.set(ja),U.putImageData(qa,0,0)}else for(X=0;I>X;X++)if($=A[X],ba.reverse(),ba[da]=T(X+1),ba[0]!==ba[1]&&void 0!==ba[0]&&void 0!==ba[1])for(Y=S(0),W=[Y,Y],z=0;J>z;z++)W.reverse(),W[ca]=S(z+1),W[0]!==W[1]&&void 0!==W[0]&&void 0!==W[1]&&(Z=$[z],_=l(Z,(W[1]-W[0])*(ba[1]-ba[0])),U.fillStyle="rgba("+_.join(",")+")",U.fillRect(W[0],ba[0],W[1]-W[0],ba[1]-ba[0]));g.markTime("done filling png"),fa=Math.round(fa/ea),ga=Math.round(ga/ea),ha=Math.round(ha/ea);var ra=f("rgb("+fa+","+ga+","+ha+")");a._hmpixcount=(a._hmpixcount||0)+ea,a._hmlumcount=(a._hmlumcount||0)+ea*ra.getLuminance();var sa=b.plot.select(".imagelayer").selectAll("g.hm."+t).data([0]);sa.enter().append("g").classed("hm",!0).classed(t,!0),sa.exit().remove();var ta=sa.selectAll("image").data(c);ta.enter().append("svg:image"),ta.exit().remove(),ta.attr({xmlns:j.svg,"xlink:href":R.toDataURL("image/png"),height:O,width:N,x:u,y:x,preserveAspectRatio:"none"}),g.markTime("done showing png")}}var e=a("d3"),f=a("tinycolor2"),g=a("../../lib"),h=a("../../plots/plots"),i=a("../../components/colorscale/get_scale"),j=a("../../constants/xmlns_namespaces"),k=a("./max_row_length");b.exports=function(a,b,c){for(var e=0;e<c.length;e++)d(a,b,c[e])}},{"../../components/colorscale/get_scale":310,"../../constants/xmlns_namespaces":338,"../../lib":349,"../../plots/plots":413,"./max_row_length":467,d3:70,tinycolor2:229}],469:[function(a,b,c){"use strict";var d=a("d3");b.exports=function(a){d.select(a).selectAll("image").style("opacity",function(a){return a.trace.opacity})}},{d3:70}],470:[function(a,b,c){"use strict";function d(a,b){var c=b(a),d=c?b(a+"type","array"):"scaled";return"scaled"===d&&(b(a+"0"),b("d"+a)),c}function e(a){for(var b,c=!0,d=!1,e=!1,g=0;g<a.length;g++){if(b=a[g],!Array.isArray(b)){c=!1;break}b.length>0&&(d=!0);for(var h=0;h<b.length;h++)if(f(b[h])){e=!0;break}}return c&&d&&e}var f=a("fast-isnumeric"),g=a("./has_columns");b.exports=function(a,b,c){var f,h,i=c("z");if(void 0===i||!i.length)return 0;if(g(a)){if(f=c("x"),h=c("y"),!f||!h)return 0}else{if(f=d("x",c),h=d("y",c),!e(i))return 0;c("transpose")}return b.z.length}},{"./has_columns":464,"fast-isnumeric":74}],471:[function(a,b,c){"use strict";function d(a){return{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"any",dflt:1}}}var e=a("../bar/attributes"),f=a("../../lib").extendFlat,g=e.marker,h=g.line;b.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:e.text,orientation:e.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},autobinx:{valType:"boolean",dflt:!0},nbinsx:{valType:"integer",min:0,dflt:0},xbins:d("x"),autobiny:{valType:"boolean",dflt:!0},nbinsy:{valType:"integer",min:0,dflt:0},ybins:d("y"),marker:{color:g.color,colorscale:g.colorscale,cauto:g.cauto,cmax:g.cmax,cmin:g.cmin,autocolorscale:g.autocolorscale,reversescale:g.reversescale,showscale:g.showscale,line:{color:h.color,colorscale:h.colorscale,cauto:h.cauto,cmax:h.cmax,cmin:h.cmin,autocolorscale:h.autocolorscale,reversescale:h.reversescale,width:f({},h.width,{dflt:0})}},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"},_deprecated:{bardir:e._deprecated.bardir}}},{"../../lib":349,"../bar/attributes":425}],472:[function(a,b,c){"use strict";b.exports=function(a,b){for(var c=a.length,d=0,e=0;c>e;e++)b[e]?(a[e]/=b[e],d+=a[e]):a[e]=null;return d}},{}],473:[function(a,b,c){"use strict";b.exports=function(a,b,c,d){return c("histnorm"),d.forEach(function(a){var b=c(a+"bins.start"),d=c(a+"bins.end"),e=c("autobin"+a,!(b&&d));c(e?"nbins"+a:a+"bins.size")}),b}},{}],474:[function(a,b,c){"use strict";var d=a("fast-isnumeric");b.exports={count:function(a,b,c){return c[a]++,1},sum:function(a,b,c,e){var f=e[b];return d(f)?(f=Number(f),c[a]+=f,f):0},avg:function(a,b,c,e,f){var g=e[b];return d(g)&&(g=Number(g),c[a]+=g,f[a]++),0},min:function(a,b,c,e){var f=e[b];if(d(f)){if(f=Number(f),!d(c[a]))return c[a]=f,f;if(c[a]>f)return c[a]=f,f-c[a]}return 0},max:function(a,b,c,e){var f=e[b];if(d(f)){if(f=Number(f),!d(c[a]))return c[a]=f,f;if(c[a]<f)return c[a]=f,f-c[a]}return 0}}},{"fast-isnumeric":74}],475:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../lib"),f=a("../../plots/cartesian/axes"),g=a("./bin_functions"),h=a("./norm_functions"),i=a("./average");b.exports=function(a,b){if(b.visible===!0){var c,j=[],k=[],l=f.getFromId(a,"h"===b.orientation?b.yaxis||"y":b.xaxis||"x"),m="h"===b.orientation?"y":"x",n={x:"y",y:"x"}[m],o=l.makeCalcdata(b,m);b["autobin"+m]===!1&&m+"bins"in b||(b[m+"bins"]=f.autoBin(o,l,b["nbins"+m]),b._input[m+"bins"]=b[m+"bins"]);var p,q,r,s,t=b[m+"bins"],u="string"==typeof t.size,v=u?[]:t,w=[],x=[],y=0,z=b.histnorm,A=b.histfunc,B=-1!==z.indexOf("density"),C="max"===A||"min"===A,D=C?null:0,E=g.count,F=h[z],G=!1;for(Array.isArray(b[n])&&"count"!==A&&(s=b[n],G="avg"===A,E=g[A]),c=t.start,q=t.end+(t.start-f.tickIncrement(t.start,t.size))/1e6;q>c&&j.length<5e3;)p=f.tickIncrement(c,t.size),j.push((c+p)/2),k.push(D),u&&v.push(c),B&&w.push(1/(p-c)),G&&x.push(0),c=p;var H=k.length;for(c=0;c<o.length;c++)r=e.findBin(o[c],v),r>=0&&H>r&&(y+=E(r,c,k,s,x));G&&(y=i(k,x)),F&&F(k,y,w);var I=Math.min(j.length,k.length),J=[],K=0,L=I-1;for(c=0;I>c;c++)if(k[c]){K=c;break}for(c=I-1;c>K;c--)if(k[c]){L=c;break}for(c=K;L>=c;c++)d(j[c])&&d(k[c])&&J.push({p:j[c],s:k[c],b:0});return J}}},{"../../lib":349,"../../plots/cartesian/axes":369,"./average":472,"./bin_functions":474,"./norm_functions":478,"fast-isnumeric":74}],476:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/color"),f=a("./bin_defaults"),g=a("../bar/style_defaults"),h=a("../../components/errorbars/defaults"),i=a("./attributes");b.exports=function(a,b,c,j){function k(c,e){return d.coerce(a,b,i,c,e)}var l=k("x"),m=k("y");k("text");var n=k("orientation",m&&!l?"h":"v"),o=b["v"===n?"x":"y"];if(!o||!o.length)return void(b.visible=!1);var p=b["h"===n?"x":"y"];p&&k("histfunc");var q="h"===n?["y"]:["x"];f(a,b,k,q),g(a,b,k,c,j),h(a,b,e.defaultLine,{axis:"y"}),h(a,b,e.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":299,"../../components/errorbars/defaults":322,"../../lib":349,"../bar/style_defaults":435,"./attributes":471,"./bin_defaults":473}],477:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.layoutAttributes=a("../bar/layout_attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("../bar/layout_defaults"),d.calc=a("./calc"),d.setPositions=a("../bar/set_positions"),d.plot=a("../bar/plot"),d.style=a("../bar/style"),d.colorbar=a("../scatter/colorbar"),d.hoverPoints=a("../bar/hover"),d.moduleType="trace",d.name="histogram",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../bar/hover":428,"../bar/layout_attributes":430,"../bar/layout_defaults":431,"../bar/plot":432,"../bar/set_positions":433,"../bar/style":434,"../scatter/colorbar":505,"./attributes":471,"./calc":475,"./defaults":476}],478:[function(a,b,c){"use strict";b.exports={percent:function(a,b){for(var c=a.length,d=100/b,e=0;c>e;e++)a[e]*=d},probability:function(a,b){for(var c=a.length,d=0;c>d;d++)a[d]/=b},density:function(a,b,c,d){var e=a.length;d=d||1;for(var f=0;e>f;f++)a[f]*=c[f]*d},"probability density":function(a,b,c,d){var e=a.length;d&&(b/=d);for(var f=0;e>f;f++)a[f]*=c[f]/b}}},{}],479:[function(a,b,c){"use strict"; 57 var d=a("../histogram/attributes"),e=a("../heatmap/attributes");b.exports={x:d.x,y:d.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:d.histnorm,histfunc:d.histfunc,autobinx:d.autobinx,nbinsx:d.nbinsx,xbins:d.xbins,autobiny:d.autobiny,nbinsy:d.nbinsy,ybins:d.ybins,zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,zsmooth:e.zsmooth,_nestedModules:{colorbar:"Colorbar"}}},{"../heatmap/attributes":459,"../histogram/attributes":471}],480:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../plots/cartesian/axes"),f=a("../histogram/bin_functions"),g=a("../histogram/norm_functions"),h=a("../histogram/average");b.exports=function(a,b){var c,i,j,k,l,m,n=e.getFromId(a,b.xaxis||"x"),o=b.x?n.makeCalcdata(b,"x"):[],p=e.getFromId(a,b.yaxis||"y"),q=b.y?p.makeCalcdata(b,"y"):[],r=Math.min(o.length,q.length);o.length>r&&o.splice(r,o.length-r),q.length>r&&q.splice(r,q.length-r),d.markTime("done convert data"),!b.autobinx&&"xbins"in b||(b.xbins=e.autoBin(o,n,b.nbinsx,"2d"),"histogram2dcontour"===b.type&&(b.xbins.start-=b.xbins.size,b.xbins.end+=b.xbins.size),b._input.xbins=b.xbins),!b.autobiny&&"ybins"in b||(b.ybins=e.autoBin(q,p,b.nbinsy,"2d"),"histogram2dcontour"===b.type&&(b.ybins.start-=b.ybins.size,b.ybins.end+=b.ybins.size),b._input.ybins=b.ybins),d.markTime("done autoBin"),l=[];var s,t,u=[],v=[],w="string"==typeof b.xbins.size?[]:b.xbins,x="string"==typeof b.xbins.size?[]:b.ybins,y=0,z=[],A=b.histnorm,B=b.histfunc,C=-1!==A.indexOf("density"),D="max"===B||"min"===B,E=D?null:0,F=f.count,G=g[A],H=!1,I=[],J=[],K="z"in b?b.z:"marker"in b&&Array.isArray(b.marker.color)?b.marker.color:"";K&&"count"!==B&&(H="avg"===B,F=f[B]);var L=b.xbins,M=L.end+(L.start-e.tickIncrement(L.start,L.size))/1e6;for(m=L.start;M>m;m=e.tickIncrement(m,L.size))u.push(E),Array.isArray(w)&&w.push(m),H&&v.push(0);Array.isArray(w)&&w.push(m);var N=u.length;for(c=b.xbins.start,i=(m-c)/N,c+=i/2,L=b.ybins,M=L.end+(L.start-e.tickIncrement(L.start,L.size))/1e6,m=L.start;M>m;m=e.tickIncrement(m,L.size))l.push(u.concat()),Array.isArray(x)&&x.push(m),H&&z.push(v.concat());Array.isArray(x)&&x.push(m);var O=l.length;for(j=b.ybins.start,k=(m-j)/O,j+=k/2,C&&(I=u.map(function(a,b){return Array.isArray(w)?1/(w[b+1]-w[b]):1/i}),J=l.map(function(a,b){return Array.isArray(x)?1/(x[b+1]-x[b]):1/k})),d.markTime("done making bins"),m=0;r>m;m++)s=d.findBin(o[m],w),t=d.findBin(q[m],x),s>=0&&N>s&&t>=0&&O>t&&(y+=F(s,m,l[t],K,z[t]));if(H)for(t=0;O>t;t++)y+=h(l[t],z[t]);if(G)for(t=0;O>t;t++)G(l[t],y,I,J[t]);return d.markTime("done binning"),{x:o,x0:c,dx:i,y:q,y0:j,dy:k,z:l}}},{"../../lib":349,"../../plots/cartesian/axes":369,"../histogram/average":472,"../histogram/bin_functions":474,"../histogram/norm_functions":478}],481:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./sample_defaults"),f=a("../../components/colorscale/defaults"),g=a("./attributes");b.exports=function(a,b,c){function h(c,e){return d.coerce(a,b,g,c,e)}e(a,b,h),h("zsmooth"),f(a,b,c,h,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":479,"./sample_defaults":483}],482:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("../heatmap/calc"),d.plot=a("../heatmap/plot"),d.colorbar=a("../heatmap/colorbar"),d.style=a("../heatmap/style"),d.hoverPoints=a("../heatmap/hover"),d.moduleType="trace",d.name="histogram2d",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap","histogram"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../heatmap/calc":460,"../heatmap/colorbar":461,"../heatmap/hover":465,"../heatmap/plot":468,"../heatmap/style":469,"./attributes":479,"./defaults":481}],483:[function(a,b,c){"use strict";var d=a("../histogram/bin_defaults");b.exports=function(a,b,c){var e=c("x"),f=c("y");if(!(e&&e.length&&f&&f.length))return void(b.visible=!1);var g=c("z")||c("marker.color");g&&c("histfunc");var h=["x","y"];d(a,b,c,h)}},{"../histogram/bin_defaults":473}],484:[function(a,b,c){"use strict";var d=a("../histogram2d/attributes"),e=a("../contour/attributes");b.exports={x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,autobinx:d.autobinx,nbinsx:d.nbinsx,xbins:d.xbins,autobiny:d.autobiny,nbinsy:d.nbinsy,ybins:d.ybins,zauto:e.zauto,zmin:e.zmin,zmax:e.zmax,colorscale:e.colorscale,autocolorscale:e.autocolorscale,reversescale:e.reversescale,showscale:e.showscale,autocontour:e.autocontour,ncontours:e.ncontours,contours:e.contours,line:e.line,_nestedModules:{colorbar:"Colorbar"}}},{"../contour/attributes":450,"../histogram2d/attributes":479}],485:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../histogram2d/sample_defaults"),f=a("../contour/style_defaults"),g=a("./attributes");b.exports=function(a,b,c,h){function i(c,e){return d.coerce(a,b,g,c,e)}e(a,b,i);var j=d.coerce2(a,b,g,"contours.start"),k=d.coerce2(a,b,g,"contours.end"),l=i("autocontour",!(j&&k));i(l?"ncontours":"contours.size"),f(a,b,i,h)}},{"../../lib":349,"../contour/style_defaults":458,"../histogram2d/sample_defaults":483,"./attributes":484}],486:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.calc=a("../contour/calc"),d.plot=a("../contour/plot"),d.style=a("../contour/style"),d.colorbar=a("../contour/colorbar"),d.hoverPoints=a("../contour/hover"),d.moduleType="trace",d.name="histogram2dcontour",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","2dMap","contour","histogram"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"../contour/calc":451,"../contour/colorbar":452,"../contour/hover":454,"../contour/plot":456,"../contour/style":457,"./attributes":484,"./defaults":485}],487:[function(a,b,c){"use strict";var d=a("../../components/colorscale/attributes"),e=a("../surface/attributes"),f=a("../../lib/extend").extendFlat;b.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:f({},e.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:f({},e.contours.x.show,{}),color:f({},e.contours.x.color),width:f({},e.contours.x.width)},colorscale:d.colorscale,reversescale:d.reversescale,showscale:d.showscale,lighting:f({},e.lighting),_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345,"../surface/attributes":538}],488:[function(a,b,c){"use strict";function d(a,b,c){this.scene=a,this.uid=c,this.mesh=b,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function e(a){return a.map(function(a){var b=a[0],c=j(a[1]),d=c.toRgb();return{index:b,rgb:[d.r,d.g,d.b,1]}})}function f(a){return a.map(n)}function g(a,b,c){for(var d=new Array(a.length),e=0;e<a.length;++e)d[e]=[a[e],b[e],c[e]];return d}function h(a,b){var c=a.glplot.gl,e=i({gl:c}),f=new d(a,e,b.uid);return f.update(b),a.glplot.add(e),f}var i=a("gl-mesh3d"),j=a("tinycolor2"),k=a("delaunay-triangulate"),l=a("alpha-shape"),m=a("convex-hull"),n=a("../../lib/str2rgbarray"),o=d.prototype;o.handlePick=function(a){if(a.object===this.mesh){var b=a.data.index;return a.traceCoordinate=[this.data.x[b],this.data.y[b],this.data.z[b]],!0}},o.update=function(a){function b(a,b,c){return b.map(function(b){return a.d2l(b)*c})}var c=this.scene,d=c.fullSceneLayout;this.data=a;var h,i=g(b(d.xaxis,a.x,c.dataScale[0]),b(d.yaxis,a.y,c.dataScale[1]),b(d.zaxis,a.z,c.dataScale[2]));if(a.i&&a.j&&a.k)h=g(a.i,a.j,a.k);else if(0===a.alphahull)h=m(i);else if(a.alphahull>0)h=l(a.alphahull,i);else{var j=["x","y","z"].indexOf(a.delaunayaxis);h=k(i.map(function(a){return[a[(j+1)%3],a[(j+2)%3]]}))}var o={positions:i,cells:h,ambient:a.lighting.ambient,diffuse:a.lighting.diffuse,specular:a.lighting.specular,roughness:a.lighting.roughness,fresnel:a.lighting.fresnel,opacity:a.opacity,contourEnable:a.contour.show,contourColor:n(a.contour.color).slice(0,3),contourWidth:a.contour.width,useFacetNormals:a.flatshading};a.intensity?(this.color="#fff",o.vertexIntensity=a.intensity,o.colormap=e(a.colorscale)):a.vertexcolor?(this.color=a.vertexcolors[0],o.vertexColors=f(a.vertexcolor)):a.facecolor?(this.color=a.facecolor[0],o.cellColors=f(a.facecolor)):(this.color=a.color,o.meshColor=n(a.color)),this.mesh.update(o)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},b.exports=h},{"../../lib/str2rgbarray":359,"alpha-shape":39,"convex-hull":60,"delaunay-triangulate":71,"gl-mesh3d":107,tinycolor2:229}],489:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/colorbar/defaults"),f=a("./attributes");b.exports=function(a,b,c,g){function h(c,e){return d.coerce(a,b,f,c,e)}function i(a){var b=a.map(function(a){var b=h(a);return b&&Array.isArray(b)?b:null});return b.every(function(a){return a&&a.length===b[0].length})&&b}var j=i(["x","y","z"]),k=i(["i","j","k"]);return j?(k&&k.forEach(function(a){for(var b=0;b<a.length;++b)a[b]|=0}),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","contour.show","contour.color","contour.width","colorscale","reversescale","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(a){h(a)}),"intensity"in a?(h("intensity"),h("showscale",!0)):(b.showscale=!1,"vertexcolor"in a?h("vertexcolor"):"facecolor"in a?h("facecolor"):h("color",c)),b.reversescale&&(b.colorscale=b.colorscale.map(function(a){return[1-a[0],a[1]]}).reverse()),void(b.showscale&&e(a,b,g))):void(b.visible=!1)}},{"../../components/colorbar/defaults":301,"../../lib":349,"./attributes":487}],490:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../heatmap/colorbar"),d.plot=a("./convert"),d.moduleType="trace",d.name="mesh3d",d.basePlotModule=a("../../plots/gl3d"),d.categories=["gl3d"],d.meta={},b.exports=d},{"../../plots/gl3d":400,"../heatmap/colorbar":461,"./attributes":487,"./convert":488,"./defaults":489}],491:[function(a,b,c){"use strict";var d=a("../../components/color/attributes"),e=a("../../plots/font_attributes"),f=a("../../plots/attributes"),g=a("../../lib/extend").extendFlat;b.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:d.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:g({},f.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:g({},e,{}),insidetextfont:g({},e,{}),outsidetextfont:g({},e,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":298,"../../lib/extend":345,"../../plots/attributes":367,"../../plots/font_attributes":383}],492:[function(a,b,c){"use strict";function d(a){if(!i){var b=g.defaults;i=b.slice();var c;for(c=0;c<b.length;c++)i.push(f(b[c]).lighten(20).toHexString());for(c=0;c<g.defaults.length;c++)i.push(f(b[c]).darken(20).toHexString())}return i[a%i.length]}var e=a("fast-isnumeric"),f=a("tinycolor2"),g=a("../../components/color"),h=a("./helpers");b.exports=function(a,b){var c,i,j,k,l,m,n=b.values,o=b.labels,p=[],q=a._fullLayout,r=q._piecolormap,s={},t=!1,u=0,v=q.hiddenlabels||[];if(b.dlabel)for(o=new Array(n.length),c=0;c<n.length;c++)o[c]=String(b.label0+c*b.dlabel);for(c=0;c<n.length;c++)i=n[c],e(i)&&(i=+i,0>i||(j=o[c],void 0!==j&&""!==j||(j=c),j=String(j),void 0===s[j]&&(s[j]=!0,k=f(b.marker.colors[c]),k.isValid()?(k=g.addOpacity(k,k.getAlpha()),r[j]||(r[j]=k)):r[j]?k=r[j]:(k=!1,t=!0),l=-1!==v.indexOf(j),l||(u+=i),p.push({v:i,label:j,color:k,i:c,hidden:l}))));if(b.sort&&p.sort(function(a,b){return b.v-a.v}),t)for(c=0;c<p.length;c++)m=p[c],m.color===!1&&(r[m.label]=m.color=d(q._piedefaultcolorcount),q._piedefaultcolorcount++);if(p[0]&&(p[0].vTotal=u),b.textinfo&&"none"!==b.textinfo){var w,x=-1!==b.textinfo.indexOf("label"),y=-1!==b.textinfo.indexOf("text"),z=-1!==b.textinfo.indexOf("value"),A=-1!==b.textinfo.indexOf("percent");for(c=0;c<p.length;c++)m=p[c],w=x?[m.label]:[],y&&b.text[m.i]&&w.push(b.text[m.i]),z&&w.push(h.formatPieValue(m.v)),A&&w.push(h.formatPiePercent(m.v/u)),m.text=w.join("<br>")}return p};var i},{"../../components/color":299,"./helpers":494,"fast-isnumeric":74,tinycolor2:229}],493:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./attributes");b.exports=function(a,b,c,f){function g(c,f){return d.coerce(a,b,e,c,f)}var h=d.coerceFont,i=g("values");if(!Array.isArray(i)||!i.length)return void(b.visible=!1);var j=g("labels");Array.isArray(j)||(g("label0"),g("dlabel"));var k=g("marker.line.width");k&&g("marker.line.color");var l=g("marker.colors");Array.isArray(l)||(b.marker.colors=[]),g("scalegroup");var m=g("text"),n=g("textinfo",Array.isArray(m)?"text+percent":"percent");if(g("hoverinfo",1===f._dataLength?"label+text+value+percent":void 0),n&&"none"!==n){var o=g("textposition"),p=Array.isArray(o)||"auto"===o,q=p||"inside"===o,r=p||"outside"===o;if(q||r){var s=h(g,"textfont",f.font);q&&h(g,"insidetextfont",s),r&&h(g,"outsidetextfont",s)}}g("domain.x"),g("domain.y"),g("hole"),g("sort"),g("direction"),g("rotation"),g("pull")}},{"../../lib":349,"./attributes":491}],494:[function(a,b,c){"use strict";c.formatPiePercent=function(a){var b=(100*a).toPrecision(3);return-1!==b.indexOf(".")?b.replace(/[.]?0+$/,"")+"%":b+"%"},c.formatPieValue=function(a){var b=a.toPrecision(10);return-1!==b.indexOf(".")?b.replace(/[.]?0+$/,""):b}},{}],495:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.supplyLayoutDefaults=a("./layout_defaults"),d.layoutAttributes=a("./layout_attributes"),d.calc=a("./calc"),d.plot=a("./plot"),d.style=a("./style"),d.styleOne=a("./style_one"),d.moduleType="trace",d.name="pie",d.basePlotModule=a("../../plots/cartesian"),d.categories=["pie","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./attributes":491,"./calc":492,"./defaults":493,"./layout_attributes":496,"./layout_defaults":497,"./plot":498,"./style":499,"./style_one":500}],496:[function(a,b,c){"use strict";b.exports={hiddenlabels:{valType:"data_array"}}},{}],497:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("./layout_attributes");b.exports=function(a,b){function c(c,f){return d.coerce(a,b,e,c,f)}c("hiddenlabels")}},{"../../lib":349,"./layout_attributes":496}],498:[function(a,b,c){"use strict";function d(a,b,c){var d=Math.sqrt(a.width*a.width+a.height*a.height),f=a.width/a.height,g=Math.PI*Math.min(b.v/c.vTotal,.5),h=1-c.trace.hole,i=e(b,c),j={scale:i*c.r*2/d,rCenter:1-i,rotate:0};if(j.scale>=1)return j;var k=f+1/(2*Math.tan(g)),l=c.r*Math.min(1/(Math.sqrt(k*k+.5)+k),h/(Math.sqrt(f*f+h/2)+f)),m={scale:2*l/a.height,rCenter:Math.cos(l/c.r)-l*f/c.r,rotate:(180/Math.PI*b.midangle+720)%180-90},n=1/f,o=n+1/(2*Math.tan(g)),p=c.r*Math.min(1/(Math.sqrt(o*o+.5)+o),h/(Math.sqrt(n*n+h/2)+n)),q={scale:2*p/a.width,rCenter:Math.cos(p/c.r)-p/f/c.r,rotate:(180/Math.PI*b.midangle+810)%180-90},r=q.scale>m.scale?q:m;return j.scale<1&&r.scale>j.scale?r:j}function e(a,b){if(a.v===b.vTotal&&!b.trace.hole)return 1;var c=Math.PI*Math.min(a.v/b.vTotal,.5);return Math.min(1/(1+1/Math.sin(c)),(1-b.trace.hole)/2)}function f(a,b){var c=b.pxmid[0],d=b.pxmid[1],e=a.width/2,f=a.height/2;return 0>c&&(e*=-1),0>d&&(f*=-1),{scale:1,rCenter:1,rotate:0,x:e+Math.abs(f)*(e>0?1:-1)/2,y:f/(1+c*c/(d*d)),outside:!0}}function g(a,b){function c(a,b){return a.pxmid[1]-b.pxmid[1]}function d(a,b){return b.pxmid[1]-a.pxmid[1]}function e(a,c){c||(c={});var d,e,f,h,m,n,p=c.labelExtraY+(g?c.yLabelMax:c.yLabelMin),q=g?a.yLabelMin:a.yLabelMax,r=g?a.yLabelMax:a.yLabelMin,s=a.cyFinal+j(a.px0[1],a.px1[1]),t=p-q;if(t*l>0&&(a.labelExtraY=t),Array.isArray(b.pull))for(e=0;e<o.length;e++)f=o[e],f===a||(b.pull[a.i]||0)>=b.pull[f.i]||((a.pxmid[1]-f.pxmid[1])*l>0?(h=f.cyFinal+j(f.px0[1],f.px1[1]),t=h-q-a.labelExtraY,t*l>0&&(a.labelExtraY+=t)):(r+a.labelExtraY-s)*l>0&&(d=3*k*Math.abs(e-o.indexOf(a)),m=f.cxFinal+i(f.px0[0],f.px1[0]),n=m+d-(a.cxFinal+a.pxmid[0])-a.labelExtraX,n*k>0&&(a.labelExtraX+=n)))}var f,g,h,i,j,k,l,m,n,o,p,q,r;for(g=0;2>g;g++)for(h=g?c:d,j=g?Math.max:Math.min,l=g?1:-1,f=0;2>f;f++){for(i=f?Math.max:Math.min,k=f?1:-1,m=a[g][f],m.sort(h),n=a[1-g][f],o=n.concat(m),q=[],p=0;p<m.length;p++)void 0!==m[p].yLabelMid&&q.push(m[p]);for(r=!1,p=0;g&&p<n.length;p++)if(void 0!==n[p].yLabelMid){r=n[p];break}for(p=0;p<q.length;p++){var s=p&&q[p-1];r&&!p&&(s=r),e(q[p],s)}}}function h(a,b){var c,d,e,f,g,h,i,k,l,m,n=[];for(e=0;e<a.length;e++){if(g=a[e][0],h=g.trace,c=b.w*(h.domain.x[1]-h.domain.x[0]),d=b.h*(h.domain.y[1]-h.domain.y[0]),i=h.tiltaxis*Math.PI/180,k=h.pull,Array.isArray(k))for(k=0,f=0;f<h.pull.length;f++)h.pull[f]>k&&(k=h.pull[f]);g.r=Math.min(c/j(h.tilt,Math.sin(i),h.depth),d/j(h.tilt,Math.cos(i),h.depth))/(2+2*k),g.cx=b.l+b.w*(h.domain.x[1]+h.domain.x[0])/2,g.cy=b.t+b.h*(2-h.domain.y[1]-h.domain.y[0])/2,h.scalegroup&&-1===n.indexOf(h.scalegroup)&&n.push(h.scalegroup)}for(f=0;f<n.length;f++){for(m=1/0,l=n[f],e=0;e<a.length;e++)g=a[e][0],g.trace.scalegroup===l&&(m=Math.min(m,g.r*g.r/g.vTotal));for(e=0;e<a.length;e++)g=a[e][0],g.trace.scalegroup===l&&(g.r=Math.sqrt(m*g.vTotal))}}function i(a){function b(a){var b=l.r*Math.sin(a),c=-l.r*Math.cos(a);return n?[b*(1-h*d*d)+c*g*h,b*g*h+c*(1-h*e*e),Math.sin(f)*(c*e-b*d)]:[b,c]}var c,d,e,f,g,h,i,j,k,l=a[0],m=l.trace,n=m.tilt,o=m.rotation*Math.PI/180,p=2*Math.PI/l.vTotal,q="px0",r="px1";if("counterclockwise"===m.direction){for(i=0;i<a.length&&a[i].hidden;i++);if(i===a.length)return;o+=p*a[i].v,p*=-1,q="px1",r="px0"}for(n&&(f=n*Math.PI/180,c=m.tiltaxis*Math.PI/180,g=Math.sin(c)*Math.cos(c),h=1-Math.cos(f),d=Math.sin(c),e=Math.cos(c)),k=b(o),i=0;i<a.length;i++)j=a[i],j.hidden||(j[q]=k,o+=p*j.v/2,j.pxmid=b(o),j.midangle=o,o+=p*j.v/2,k=b(o),j[r]=k,j.largeArc=j.v>l.vTotal/2?1:0)}function j(a,b,c){if(!a)return 1;var d=Math.sin(a*Math.PI/180);return Math.max(.01,c*d*Math.abs(b)+2*Math.sqrt(1-d*d*b*b))}var k=a("d3"),l=a("../../plots/cartesian/graph_interact"),m=a("../../components/color"),n=a("../../components/drawing"),o=a("../../lib/svg_text_utils"),p=a("./helpers");b.exports=function(a,b){var c=a._fullLayout;h(b,c._size);var j=c._pielayer.selectAll("g.trace").data(b);j.enter().append("g").attr({"stroke-linejoin":"round","class":"trace"}),j.exit().remove(),j.order(),j.each(function(b){var h=k.select(this),j=b[0],q=j.trace,r=0,s=(q.depth||0)*j.r*Math.sin(r)/2,t=q.tiltaxis||0,u=t*Math.PI/180,v=[s*Math.sin(u),s*Math.cos(u)],w=j.r*Math.cos(r),x=h.selectAll("g.part").data(q.tilt?["top","sides"]:["top"]);x.enter().append("g").attr("class",function(a){return a+" part"}),x.exit().remove(),x.order(),i(b),h.selectAll(".top").each(function(){var h=k.select(this).selectAll("g.slice").data(b);h.enter().append("g").classed("slice",!0),h.exit().remove();var i=[[[],[]],[[],[]]],r=!1;h.each(function(g){function h(b){var c=a._fullLayout,d=a._fullData[q.index],f=d.hoverinfo;if("all"===f&&(f="label+text+value+percent+name"),!a._dragging&&c.hovermode!==!1&&"none"!==f&&f){var h=e(g,j),i=x+g.pxmid[0]*(1-h),k=y+g.pxmid[1]*(1-h),m=[];-1!==f.indexOf("label")&&m.push(g.label),d.text&&d.text[g.i]&&-1!==f.indexOf("text")&&m.push(d.text[g.i]),-1!==f.indexOf("value")&&m.push(p.formatPieValue(g.v)),-1!==f.indexOf("percent")&&m.push(p.formatPiePercent(g.v/j.vTotal)),l.loneHover({x0:i-h*j.r,x1:i+h*j.r,y:k,text:m.join("<br>"),name:-1!==f.indexOf("name")?d.name:void 0,color:g.color,idealAlign:g.pxmid[0]<0?"left":"right"},{container:c._hoverlayer.node(),outerContainer:c._paper.node()}),l.hover(a,b,"pie"),B=!0}}function m(){B&&(l.loneUnhover(c._hoverlayer.node()),B=!1)}function s(){a._hoverdata=[g],a._hoverdata.trace=b.trace,l.click(a,{target:!0})}function u(a,b,c,d){return"a"+d*j.r+","+d*w+" "+t+" "+g.largeArc+(c?" 1 ":" 0 ")+d*(b[0]-a[0])+","+d*(b[1]-a[1])}if(g.hidden)return void k.select(this).selectAll("path,g").remove();i[g.pxmid[1]<0?0:1][g.pxmid[0]<0?0:1].push(g);var x=j.cx+v[0],y=j.cy+v[1],z=k.select(this),A=z.selectAll("path.surface").data([g]),B=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),z.select("path.textline").remove(),z.on("mouseover",h).on("mouseout",m).on("click",s),q.pull){var C=+(Array.isArray(q.pull)?q.pull[g.i]:q.pull)||0;C>0&&(x+=C*g.pxmid[0],y+=C*g.pxmid[1])}g.cxFinal=x,g.cyFinal=y;var D=q.hole;if(g.v===j.vTotal){var E="M"+(x+g.px0[0])+","+(y+g.px0[1])+u(g.px0,g.pxmid,!0,1)+u(g.pxmid,g.px0,!0,1)+"Z";D?A.attr("d","M"+(x+D*g.px0[0])+","+(y+D*g.px0[1])+u(g.px0,g.pxmid,!1,D)+u(g.pxmid,g.px0,!1,D)+"Z"+E):A.attr("d",E)}else{var F=u(g.px0,g.px1,!0,1);if(D){var G=1-D;A.attr("d","M"+(x+D*g.px1[0])+","+(y+D*g.px1[1])+u(g.px1,g.px0,!1,D)+"l"+G*g.px0[0]+","+G*g.px0[1]+F+"Z")}else A.attr("d","M"+x+","+y+"l"+g.px0[0]+","+g.px0[1]+F+"Z")}var H=Array.isArray(q.textposition)?q.textposition[g.i]:q.textposition,I=z.selectAll("g.slicetext").data(g.text&&"none"!==H?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each(function(){var a=k.select(this).selectAll("text").data([0]);a.enter().append("text").attr("data-notex",1),a.exit().remove(),a.text(g.text).attr({"class":"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(n.font,"outside"===H?q.outsidetextfont:q.insidetextfont).call(o.convertToTspans),a.selectAll("tspan.line").attr({x:0,y:0});var b,c=n.bBox(a.node());"outside"===H?b=f(c,g):(b=d(c,g,j),"auto"===H&&b.scale<1&&(a.call(n.font,q.outsidetextfont),q.outsidetextfont.family===q.insidetextfont.family&&q.outsidetextfont.size===q.insidetextfont.size||(a.attr({"data-bb":""}),c=n.bBox(a.node())),b=f(c,g)));var e=x+g.pxmid[0]*b.rCenter+(b.x||0),h=y+g.pxmid[1]*b.rCenter+(b.y||0);b.outside&&(g.yLabelMin=h-c.height/2,g.yLabelMid=h,g.yLabelMax=h+c.height/2,g.labelExtraX=0,g.labelExtraY=0,r=!0),a.attr("transform","translate("+e+","+h+")"+(b.scale<1?"scale("+b.scale+")":"")+(b.rotate?"rotate("+b.rotate+")":"")+"translate("+-(c.left+c.right)/2+","+-(c.top+c.bottom)/2+")")})}),r&&g(i,q),h.each(function(a){if(a.labelExtraX||a.labelExtraY){var b=k.select(this),c=b.select("g.slicetext text");c.attr("transform","translate("+a.labelExtraX+","+a.labelExtraY+")"+c.attr("transform"));var d=a.cxFinal+a.pxmid[0],e=a.cyFinal+a.pxmid[1],f="M"+d+","+e,g=(a.yLabelMax-a.yLabelMin)*(a.pxmid[0]<0?-1:1)/4;if(a.labelExtraX){var h=a.labelExtraX*a.pxmid[1]/a.pxmid[0],i=a.yLabelMid+a.labelExtraY-(a.cyFinal+a.pxmid[1]);f+=Math.abs(h)>Math.abs(i)?"l"+i*a.pxmid[0]/a.pxmid[1]+","+i+"H"+(d+a.labelExtraX+g):"l"+a.labelExtraX+","+h+"v"+(i-h)+"h"+g}else f+="V"+(a.yLabelMid+a.labelExtraY)+"h"+g;b.append("path").classed("textline",!0).call(m.stroke,q.outsidetextfont.color).attr({"stroke-width":Math.min(2,q.outsidetextfont.size/8),d:f,fill:"none"})}})})}),setTimeout(function(){j.selectAll("tspan").each(function(){var a=k.select(this);a.attr("dy")&&a.attr("dy",a.attr("dy"))})},0)}},{"../../components/color":299,"../../components/drawing":317,"../../lib/svg_text_utils":360,"../../plots/cartesian/graph_interact":374,"./helpers":494,d3:70}],499:[function(a,b,c){"use strict";var d=a("d3"),e=a("./style_one");b.exports=function(a){a._fullLayout._pielayer.selectAll(".trace").each(function(a){var b=a[0],c=b.trace,f=d.select(this);f.style({opacity:c.opacity}),f.selectAll(".top path.surface").each(function(a){d.select(this).call(e,a,c)})})}},{"./style_one":500,d3:70}],500:[function(a,b,c){"use strict";var d=a("../../components/color");b.exports=function(a,b,c){var e=c.marker.line.color;Array.isArray(e)&&(e=e[b.i]||d.defaultLine);var f=c.marker.line.width||0;Array.isArray(f)&&(f=f[b.i]||0),a.style({"stroke-width":f,fill:b.color}).call(d.stroke,e)}},{"../../components/color":299}],501:[function(a,b,c){"use strict";var d=a("../../lib");b.exports=function(a){var b=a[0].trace,c=b.marker;if(d.mergeArray(b.text,a,"tx"),d.mergeArray(b.textposition,a,"tp"),b.textfont&&(d.mergeArray(b.textfont.size,a,"ts"),d.mergeArray(b.textfont.color,a,"tc"),d.mergeArray(b.textfont.family,a,"tf")),c&&c.line){var e=c.line;d.mergeArray(c.opacity,a,"mo"),d.mergeArray(c.symbol,a,"mx"),d.mergeArray(c.color,a,"mc"),d.mergeArray(e.color,a,"mlc"),d.mergeArray(e.width,a,"mlw")}}},{"../../lib":349}],502:[function(a,b,c){"use strict";var d=a("../../components/drawing");a("./constants");b.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},dy:{valType:"number",dflt:1},text:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:{valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx"],dflt:"none"},fillcolor:{valType:"color"},marker:{symbol:{valType:"enumerated",values:d.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},color:{valType:"color",arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!1},line:{color:{valType:"color",arrayOk:!0},width:{valType:"number",min:0,arrayOk:!0},colorscale:{valType:"colorscale"},cauto:{valType:"boolean",dflt:!0},cmax:{valType:"number",dflt:null},cmin:{valType:"number",dflt:null},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1}}},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},_nestedModules:{error_y:"ErrorBars",error_x:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../components/drawing":317,"./constants":506}],503:[function(a,b,c){"use strict";var d=a("fast-isnumeric"),e=a("../../plots/cartesian/axes"),f=a("../../lib"),g=a("./subtypes"),h=a("./marker_colorscale_calc");b.exports=function(a,b){var c=e.getFromId(a,b.xaxis||"x"),i=e.getFromId(a,b.yaxis||"y");f.markTime("in Scatter.calc");var j=c.makeCalcdata(b,"x");f.markTime("finished convert x");var k=i.makeCalcdata(b,"y");f.markTime("finished convert y");var l,m,n,o=Math.min(j.length,k.length);c._minDtick=0,i._minDtick=0,j.length>o&&j.splice(o,j.length-o),k.length>o&&k.splice(o,k.length-o);var p={padded:!0},q={padded:!0};if(g.hasMarkers(b)){if(l=b.marker,m=l.size,Array.isArray(m)){var r={type:"linear"};e.setConvert(r),m=r.makeCalcdata(b.marker,"size"),m.length>o&&m.splice(o,m.length-o)}var s,t=1.6*(b.marker.sizeref||1);s="area"===b.marker.sizemode?function(a){return Math.max(Math.sqrt((a||0)/t),3)}:function(a){return Math.max((a||0)/t,3)},p.ppad=q.ppad=Array.isArray(m)?m.map(s):s(m)}h(b),!("tozerox"===b.fill||"tonextx"===b.fill&&a.firstscatter)||j[0]===j[o-1]&&k[0]===k[o-1]?b.error_y.visible||-1===["tonexty","tozeroy"].indexOf(b.fill)&&(g.hasMarkers(b)||g.hasText(b))||(p.padded=!1,p.ppad=0):p.tozero=!0,!("tozeroy"===b.fill||"tonexty"===b.fill&&a.firstscatter)||j[0]===j[o-1]&&k[0]===k[o-1]?-1!==["tonextx","tozerox"].indexOf(b.fill)&&(q.padded=!1):q.tozero=!0,f.markTime("ready for Axes.expand"),e.expand(c,j,p),f.markTime("done expand x"),e.expand(i,k,q),f.markTime("done expand y");var u=new Array(o);for(n=0;o>n;n++)u[n]=d(j[n])&&d(k[n])?{x:j[n],y:k[n]}:{x:!1,y:!1};return void 0!==typeof m&&f.mergeArray(m,u,"ms"),a.firstscatter=!1,u}},{"../../lib":349,"../../plots/cartesian/axes":369,"./marker_colorscale_calc":515,"./subtypes":520,"fast-isnumeric":74}],504:[function(a,b,c){"use strict";b.exports=function(a){var b,c,d,e,f;for(b=0;b<a.length;b++)if(c=a[b],d=c.fill,"none"!==d&&"scatter"===c.type&&(c.opacity=void 0,"tonexty"===d||"tonextx"===d))for(e=b-1;e>=0;e--)if(f=a[e],"scatter"===f.type&&f.xaxis===c.xaxis&&f.yaxis===c.yaxis){f.opacity=void 0;break}}},{}],505:[function(a,b,c){"use strict";var d=a("d3"),e=a("fast-isnumeric"),f=a("../../lib"),g=a("../../plots/plots"),h=a("../../components/colorscale/get_scale"),i=a("../../components/colorbar/draw");b.exports=function(a,b){var c=b[0].trace,j=c.marker,k="cb"+c.uid;if(a._fullLayout._infolayer.selectAll("."+k).remove(),void 0===j||!j.showscale)return void g.autoMargin(a,k);var l=h(j.colorscale),m=j.color,n=j.cmin,o=j.cmax;e(n)||(n=f.aggNums(Math.min,null,m)),e(o)||(o=f.aggNums(Math.max,null,m));var p=b[0].t.cb=i(a,k);p.fillcolor(d.scale.linear().domain(l.map(function(a){return n+a[0]*(o-n)})).range(l.map(function(a){return a[1]}))).filllevels({start:n,end:o,size:(o-n)/254}).options(j.colorbar)(),f.markTime("done colorbar")}},{"../../components/colorbar/draw":302,"../../components/colorscale/get_scale":310,"../../lib":349,"../../plots/plots":413,d3:70,"fast-isnumeric":74}],506:[function(a,b,c){"use strict";b.exports={PTS_LINESONLY:20}},{}],507:[function(a,b,c){"use strict";function d(a,b,c){var d=c("line.shape");"spline"===d&&c("line.smoothing")}var e=a("../../lib"),f=a("./attributes"),g=a("./constants"),h=a("./subtypes"),i=a("./xy_defaults"),j=a("./marker_defaults"),k=a("./line_defaults"),l=a("./text_defaults"),m=a("./fillcolor_defaults"),n=a("../../components/errorbars/defaults");b.exports=function(a,b,c,o){function p(c,d){return e.coerce(a,b,f,c,d)}var q=i(a,b,p),r=q<g.PTS_LINESONLY?"lines+markers":"lines";return q?(p("text"),p("mode",r),h.hasLines(b)&&(k(a,b,c,p),d(a,b,p),p("connectgaps")),h.hasMarkers(b)&&j(a,b,c,o,p),h.hasText(b)&&l(a,b,o,p),(h.hasMarkers(b)||h.hasText(b))&&p("marker.maxdisplayed"),p("fill"),"none"!==b.fill&&(m(a,b,c,p),h.hasLines(b)||d(a,b,p)),n(a,b,c,{axis:"y"}),void n(a,b,c,{axis:"x",inherit:"y"})):void(b.visible=!1)}},{"../../components/errorbars/defaults":322,"../../lib":349,"./attributes":502,"./constants":506,"./fillcolor_defaults":508,"./line_defaults":512,"./marker_defaults":516,"./subtypes":520,"./text_defaults":521,"./xy_defaults":522}],508:[function(a,b,c){"use strict";var d=a("../../components/color");b.exports=function(a,b,c,e){var f=!1;if(b.marker){var g=b.marker.color,h=(b.marker.line||{}).color;g&&!Array.isArray(g)?f=g:h&&!Array.isArray(h)&&(f=h)}e("fillcolor",d.addOpacity((b.line||{}).color||f||c,.5))}},{"../../components/color":299}],509:[function(a,b,c){"use strict";var d=a("../../components/color"),e=a("./subtypes");b.exports=function(a,b){var c,f;if("lines"===a.mode)return c=a.line.color,c&&d.opacity(c)?c:a.fillcolor; 58 if("none"===a.mode)return a.fill?a.fillcolor:"";var g=b.mcc||(a.marker||{}).color,h=b.mlcc||((a.marker||{}).line||{}).color;return f=g&&d.opacity(g)?g:h&&d.opacity(h)&&(b.mlw||((a.marker||{}).line||{}).width)?h:"",f?d.opacity(f)<.3?d.addOpacity(f,.3):f:(c=(a.line||{}).color,c&&d.opacity(c)&&e.hasLines(a)&&a.line.width?c:a.fillcolor)}},{"../../components/color":299,"./subtypes":520}],510:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/graph_interact"),e=a("../../components/errorbars"),f=a("./get_trace_color");b.exports=function(a,b,c,g){var h=a.cd,i=h[0].trace,j=a.xa,k=a.ya,l=function(a){var c=Math.max(3,a.mrc||0);return Math.max(Math.abs(j.c2p(a.x)-j.c2p(b))-c,1-3/c)},m=function(a){var b=Math.max(3,a.mrc||0);return Math.max(Math.abs(k.c2p(a.y)-k.c2p(c))-b,1-3/b)},n=function(a){var d=Math.max(3,a.mrc||0),e=Math.abs(j.c2p(a.x)-j.c2p(b)),f=Math.abs(k.c2p(a.y)-k.c2p(c));return Math.max(Math.sqrt(e*e+f*f)-d,1-3/d)},o=d.getDistanceFunction(g,l,m,n);if(d.getClosest(h,o,a),a.index!==!1){var p=h[a.index],q=j.c2p(p.x,!0),r=k.c2p(p.y,!0),s=p.mrc||1;return a.color=f(i,p),a.x0=q-s,a.x1=q+s,a.xLabelVal=p.x,a.y0=r-s,a.y1=r+s,a.yLabelVal=p.y,p.tx?a.text=p.tx:i.text&&(a.text=i.text),e.hoverInfo(p,i,a),[a]}}},{"../../components/errorbars":323,"../../plots/cartesian/graph_interact":374,"./get_trace_color":509}],511:[function(a,b,c){"use strict";var d={},e=a("./subtypes");d.hasLines=e.hasLines,d.hasMarkers=e.hasMarkers,d.hasText=e.hasText,d.isBubble=e.isBubble,d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.cleanData=a("./clean_data"),d.calc=a("./calc"),d.arraysToCalcdata=a("./arrays_to_calcdata"),d.plot=a("./plot"),d.colorbar=a("./colorbar"),d.style=a("./style"),d.hoverPoints=a("./hover"),d.selectPoints=a("./select"),d.moduleType="trace",d.name="scatter",d.basePlotModule=a("../../plots/cartesian"),d.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],d.meta={},b.exports=d},{"../../plots/cartesian":375,"./arrays_to_calcdata":501,"./attributes":502,"./calc":503,"./clean_data":504,"./colorbar":505,"./defaults":507,"./hover":510,"./plot":517,"./select":518,"./style":519,"./subtypes":520}],512:[function(a,b,c){"use strict";b.exports=function(a,b,c,d){var e=(a.marker||{}).color;d("line.color",(Array.isArray(e)?!1:e)||c),d("line.width"),d("line.dash")}},{}],513:[function(a,b,c){"use strict";var d=a("../../plots/cartesian/axes");b.exports=function(a,b){function c(b){var c=w.c2p(a[b].x),d=x.c2p(a[b].y);return c===C||d===C?!1:[c,d]}function e(a){var b=a[0]/w._length,c=a[1]/x._length;return(1+10*Math.max(0,-b,b-1,-c,c-1))*z}function f(a,b){var c=a[0]-b[0],d=a[1]-b[1];return Math.sqrt(c*c+d*d)}var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w=b.xaxis,x=b.yaxis,y=b.connectGaps,z=b.baseTolerance,A=b.linear,B=[],C=d.BADNUM,D=.2,E=new Array(a.length),F=0;for(g=0;g<a.length;g++)if(h=c(g)){for(F=0,E[F++]=h,g++;g<a.length;g++){if(j=c(g),!j){if(y)continue;break}if(A){if(m=f(j,h),!(m<e(j)*D)){for(o=[(j[0]-h[0])/m,(j[1]-h[1])/m],k=h,q=m,r=t=u=0,n=!1,i=j,g++;g<a.length;g++){if(l=c(g),!l){if(y)continue;break}if(p=[l[0]-h[0],l[1]-h[1]],v=p[0]*o[1]-p[1]*o[0],t=Math.min(t,v),u=Math.max(u,v),u-t>e(l))break;i=l,s=p[0]*o[0]+p[1]*o[1],s>q?(q=s,j=l,n=!1):r>s&&(r=s,k=l,n=!0)}if(n?(E[F++]=j,i!==k&&(E[F++]=k)):(k!==h&&(E[F++]=k),i!==j&&(E[F++]=j)),E[F++]=i,g>=a.length||!l)break;E[F++]=l,h=l}}else E[F++]=j}B.push(E.slice(0,F))}return B}},{"../../plots/cartesian/axes":369}],514:[function(a,b,c){"use strict";var d=a("fast-isnumeric");b.exports=function(a){var b=a.marker,c=b.sizeref||1,e=b.sizemin||0,f="area"===b.sizemode?function(a){return Math.sqrt(a/c)}:function(a){return a/c};return function(a){var b=f(a/2);return d(b)&&b>0?Math.max(b,e):0}}},{"fast-isnumeric":74}],515:[function(a,b,c){"use strict";var d=a("../../components/colorscale/has_colorscale"),e=a("../../components/colorscale/calc"),f=a("./subtypes");b.exports=function(a){if(f.hasMarkers(a)){var b=a.marker;d(a,"marker")&&e(a,b.color,"marker","c"),d(a,"marker.line")&&e(a,b.line.color,"marker.line","c")}}},{"../../components/colorscale/calc":306,"../../components/colorscale/has_colorscale":311,"./subtypes":520}],516:[function(a,b,c){"use strict";var d=a("../../components/color"),e=a("../../components/colorscale/has_colorscale"),f=a("../../components/colorscale/defaults"),g=a("./subtypes");b.exports=function(a,b,c,h,i){var j,k=g.isBubble(a),l=(a.line||{}).color;l&&(c=l),i("marker.symbol"),i("marker.opacity",k?.7:1),i("marker.size"),i("marker.color",c),e(a,"marker")&&f(a,b,h,i,{prefix:"marker.",cLetter:"c"}),j=l&&b.marker.color!==l?l:k?d.background:d.defaultLine,i("marker.line.color",j),e(a,"marker.line")&&f(a,b,h,i,{prefix:"marker.line.",cLetter:"c"}),i("marker.line.width",k?1:0),k&&(i("marker.sizeref"),i("marker.sizemin"),i("marker.sizemode"))}},{"../../components/color":299,"../../components/colorscale/defaults":308,"../../components/colorscale/has_colorscale":311,"./subtypes":520}],517:[function(a,b,c){"use strict";function d(a,b,c){var d=b.x(),f=b.y(),g=e.extent(d.range.map(d.l2c)),i=e.extent(f.range.map(f.l2c));c.forEach(function(a,b){var d=a[0].trace;if(h.hasMarkers(d)){var e=d.marker.maxdisplayed;if(0!==e){var f=a.filter(function(a){return a.x>=g[0]&&a.x<=g[1]&&a.y>=i[0]&&a.y<=i[1]}),j=Math.ceil(f.length/e),k=0;c.forEach(function(a,c){var d=a[0].trace;h.hasMarkers(d)&&d.marker.maxdisplayed>0&&b>c&&k++});var l=Math.round(k*j/3+Math.floor(k/3)*j/7.1);a.forEach(function(a){delete a.vis}),f.forEach(function(a,b){0===Math.round((b+l)%j)&&(a.vis=!0)})}}})}var e=a("d3"),f=a("../../lib"),g=a("../../components/drawing"),h=a("./subtypes"),i=a("./arrays_to_calcdata"),j=a("./line_points");b.exports=function(a,b,c){function k(a){return a.filter(function(a){return a.vis})}d(a,b,c);var l=b.x(),m=b.y(),n=b.plot.select(".scatterlayer").selectAll("g.trace.scatter").data(c);n.enter().append("g").attr("class","trace scatter").style("stroke-miterlimit",2);var o,p,q,r="";n.each(function(a){var b=a[0].trace,c=b.line,d=e.select(this);if(b.visible===!0&&(a[0].node3=d,i(a),h.hasLines(b)||"none"!==b.fill)){var f,k,n,s,t="",u="";o="tozero"===b.fill.substr(0,6)||"to"===b.fill.substr(0,2)&&!r?d.append("path").classed("js-fill",!0):null,q&&(p=q.datum(a)),q=d.append("path").classed("js-fill",!0),-1!==["hv","vh","hvh","vhv"].indexOf(c.shape)?(k=g.steps(c.shape),n=g.steps(c.shape.split("").reverse().join(""))):k=n="spline"===c.shape?function(a){return g.smoothopen(a,c.smoothing)}:function(a){return"M"+a.join("L")},s=function(a){return"L"+n(a.reverse()).substr(1)};var v=j(a,{xaxis:l,yaxis:m,connectGaps:b.connectgaps,baseTolerance:Math.max(c.width||1,3)/4,linear:"linear"===c.shape});if(v.length){for(var w=v[0][0],x=v[v.length-1],y=x[x.length-1],z=0;z<v.length;z++){var A=v[z];f=k(A),t+=t?"L"+f.substr(1):f,u=s(A)+u,h.hasLines(b)&&A.length>1&&d.append("path").classed("js-line",!0).attr("d",f)}o?w&&y&&("y"===b.fill.charAt(b.fill.length-1)?w[1]=y[1]=m.c2p(0,!0):w[0]=y[0]=l.c2p(0,!0),o.attr("d",t+"L"+y+"L"+w+"Z")):"tonext"===b.fill.substr(0,6)&&t&&r&&p.attr("d",t+r+"Z"),r=u}}}),n.selectAll("path:not([d])").remove(),n.append("g").attr("class","points").each(function(a){var b=a[0].trace,c=e.select(this),d=h.hasMarkers(b),i=h.hasText(b);!d&&!i||b.visible!==!0?c.remove():(d&&c.selectAll("path.point").data(b.marker.maxdisplayed?k:f.identity).enter().append("path").classed("point",!0).call(g.translatePoints,l,m),i&&c.selectAll("g").data(b.marker.maxdisplayed?k:f.identity).enter().append("g").append("text").call(g.translatePoints,l,m))})}},{"../../components/drawing":317,"../../lib":349,"./arrays_to_calcdata":501,"./line_points":513,"./subtypes":520,d3:70}],518:[function(a,b,c){"use strict";var d=a("./subtypes"),e=.2;b.exports=function(a,b){var c,f,g,h,i=a.cd,j=a.xaxis,k=a.yaxis,l=[],m=i[0].trace,n=m.index,o=m.marker;if(d.hasMarkers(m)||d.hasText(m)){var p=Array.isArray(o.opacity)?1:o.opacity;if(b===!1)for(c=0;c<i.length;c++)i[c].dim=0;else for(c=0;c<i.length;c++)f=i[c],g=j.c2p(f.x),h=k.c2p(f.y),b.contains([g,h])?(l.push({curveNumber:n,pointNumber:c,x:f.x,y:f.y}),f.dim=0):f.dim=1;return i[0].node3.selectAll("path.point").style("opacity",function(a){return((a.mo+1||p+1)-1)*(a.dim?e:1)}),i[0].node3.selectAll("text").style("opacity",function(a){return a.dim?e:1}),l}}},{"./subtypes":520}],519:[function(a,b,c){"use strict";var d=a("d3"),e=a("../../components/drawing");b.exports=function(a){var b=d.select(a).selectAll("g.trace.scatter");b.style("opacity",function(a){return a[0].trace.opacity}),b.selectAll("g.points").each(function(a){d.select(this).selectAll("path.point").call(e.pointStyle,a.trace||a[0].trace),d.select(this).selectAll("text").call(e.textPointStyle,a.trace||a[0].trace)}),b.selectAll("g.trace path.js-line").call(e.lineGroupStyle),b.selectAll("g.trace path.js-fill").call(e.fillGroupStyle)}},{"../../components/drawing":317,d3:70}],520:[function(a,b,c){"use strict";b.exports={hasLines:function(a){return a.visible&&a.mode&&-1!==a.mode.indexOf("lines")},hasMarkers:function(a){return a.visible&&a.mode&&-1!==a.mode.indexOf("markers")},hasText:function(a){return a.visible&&a.mode&&-1!==a.mode.indexOf("text")},isBubble:function(a){return"object"==typeof a.marker&&Array.isArray(a.marker.size)}}},{}],521:[function(a,b,c){"use strict";var d=a("../../lib");b.exports=function(a,b,c,e){e("textposition"),d.coerceFont(e,"textfont",c.font)}},{"../../lib":349}],522:[function(a,b,c){"use strict";b.exports=function(a,b,c){var d,e=c("x"),f=c("y");if(e)f?(d=Math.min(e.length,f.length),d<e.length&&(b.x=e.slice(0,d)),d<f.length&&(b.y=f.slice(0,d))):(d=e.length,c("y0"),c("dy"));else{if(!f)return 0;d=b.y.length,c("x0"),c("dx")}return d}},{}],523:[function(a,b,c){"use strict";function d(a){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var e=a("../scatter/attributes"),f=a("../../constants/gl_markers"),g=a("../../lib/extend").extendFlat,h=e.line,i=e.marker,j=i.line;b.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:g({},e.text,{}),mode:g({},e.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:d("x"),y:d("y"),z:d("z")},line:{color:h.color,width:h.width,dash:h.dash},marker:{color:i.color,symbol:{valType:"enumerated",values:Object.keys(f),dflt:"circle",arrayOk:!0},size:g({},i.size,{dflt:8}),sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,opacity:g({},i.opacity,{arrayOk:!1}),colorscale:i.colorscale,cauto:i.cauto,cmax:i.cmax,cmin:i.cmin,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,line:{color:j.color,width:g({},j.width,{arrayOk:!1}),colorscale:j.colorscale,cauto:j.cauto,cmax:j.cmax,cmin:j.cmin,autocolorscale:j.autocolorscale,reversescale:j.reversescale}},textposition:g({},e.textposition,{dflt:"top center"}),textfont:e.textfont,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars",error_z:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl_markers":337,"../../lib/extend":345,"../scatter/attributes":502}],524:[function(a,b,c){"use strict";var d=a("../scatter/arrays_to_calcdata"),e=a("../scatter/marker_colorscale_calc");b.exports=function(a,b){var c=[{x:!1,y:!1,trace:b,t:{}}];return d(c),e(b),c}},{"../scatter/arrays_to_calcdata":501,"../scatter/marker_colorscale_calc":515}],525:[function(a,b,c){"use strict";function d(a,b,c){if(!b||!b.visible)return null;for(var d=g(b),e=new Array(a.length),f=0;f<a.length;f++){var h=d(+a[f],f);e[f]=[-h[0]*c,h[1]*c]}return e}function e(a){for(var b=0;b<a.length;b++)if(a[b])return a[b].length;return 0}function f(a,b){var c=[d(a.x,a.error_x,b[0]),d(a.y,a.error_y,b[1]),d(a.z,a.error_z,b[2])],f=e(c);if(0===f)return null;for(var g=new Array(f),h=0;f>h;h++){for(var i=[[0,0,0],[0,0,0]],j=0;3>j;j++)if(c[j])for(var k=0;2>k;k++)i[k][j]=c[j][h][k];g[h]=i}return g}var g=a("../../components/errorbars/compute_error");b.exports=f},{"../../components/errorbars/compute_error":321}],526:[function(a,b,c){"use strict";function d(a,b){this.scene=a,this.uid=b,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-(1/0),-(1/0),-(1/0)],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function e(a,b,c){var d,e=(c+1)%3,f=(c+2)%3,g=[],h=[];for(d=0;d<a.length;++d){var i=a[d];!isNaN(i[e])&&isFinite(i[e])&&!isNaN(i[f])&&isFinite(i[f])&&(g.push([i[e],i[f]]),h.push(d))}var j=r(g);for(d=0;d<j.length;++d)for(var k=j[d],l=0;l<k.length;++l)k[l]=h[k[l]];return{positions:a,cells:j,meshColor:b}}function f(a){for(var b=[0,0,0],c=[[0,0,0],[0,0,0],[0,0,0]],d=[0,0,0],e=0;3>e;e++){var f=a[e];f&&f.copy_zstyle!==!1&&(f=a[2]),f&&(b[e]=f.width/2,c[e]=t(f.color),d=f.thickness)}return{capSize:b,color:c,lineWidth:d}}function g(a){var b=[0,0];return Array.isArray(a)?[0,-1]:(a.indexOf("bottom")>=0&&(b[1]+=1),a.indexOf("top")>=0&&(b[1]-=1),a.indexOf("left")>=0&&(b[0]-=1),a.indexOf("right")>=0&&(b[0]+=1),b)}function h(a,b){return b(4*a)}function i(a){return x[a]}function j(a,b,c,d,e){var f=null;if(Array.isArray(a)){f=[];for(var g=0;b>g;g++)void 0===a[g]?f[g]=d:f[g]=c(a[g],e)}else f=c(a,s.identity);return f}function k(a,b){var c,d,e,k,l,m,n=[],o=a.fullSceneLayout,p=a.dataScale,q=o.xaxis,r=o.yaxis,w=o.zaxis,x=b.marker,z=b.line,A=b.x||[],B=b.y||[],C=b.z||[],D=A.length;for(d=0;D>d;d++)e=q.d2l(A[d])*p[0],k=r.d2l(B[d])*p[1],l=w.d2l(C[d])*p[2],n[d]=[e,k,l];if(Array.isArray(b.text))m=b.text;else if(void 0!==b.text)for(m=new Array(D),d=0;D>d;d++)m[d]=b.text;if(c={position:n,mode:b.mode,text:m},"line"in b&&(c.lineColor=t(z.color),c.lineWidth=z.width,c.lineDashes=z.dash),"marker"in b){var E=v(b);c.scatterColor=u(x,1,D),c.scatterSize=j(x.size,D,h,20,E),c.scatterMarker=j(x.symbol,D,i,"â"),c.scatterLineWidth=x.line.width,c.scatterLineColor=u(x.line,1,D),c.scatterAngle=0}"textposition"in b&&(c.textOffset=g(b.textposition),c.textColor=u(b.textfont,1,D),c.textSize=j(b.textfont.size,D,s.identity,12),c.textFont=b.textfont.family,c.textAngle=0);var F=["x","y","z"];for(c.project=[!1,!1,!1],c.projectScale=[1,1,1],c.projectOpacity=[1,1,1],d=0;3>d;++d){var G=b.projection[F[d]];(c.project[d]=G.show)&&(c.projectOpacity[d]=G.opacity,c.projectScale[d]=G.scale)}c.errorBounds=y(b,p);var H=f([b.error_x,b.error_y,b.error_z]);return c.errorColor=H.color,c.errorLineWidth=H.lineWidth,c.errorCapSize=H.capSize,c.delaunayAxis=b.surfaceaxis,c.delaunayColor=t(b.surfacecolor),c}function l(a){if(Array.isArray(a)){var b=a[0];return Array.isArray(b)&&(a=b),"rgb("+a.slice(0,3).map(function(a){return Math.round(255*a)})+")"}return null}function m(a,b){var c=new d(a,b.uid);return c.update(b),c}var n=a("gl-line3d"),o=a("gl-scatter3d"),p=a("gl-error3d"),q=a("gl-mesh3d"),r=a("delaunay-triangulate"),s=a("../../lib"),t=a("../../lib/str2rgbarray"),u=a("../../lib/gl_format_color"),v=a("../scatter/make_bubble_size_func"),w=a("../../constants/gl3d_dashes"),x=a("../../constants/gl_markers"),y=a("./calc_errors"),z=d.prototype;z.handlePick=function(a){if(a.object&&(a.object===this.linePlot||a.object===this.delaunayMesh||a.object===this.textMarkers||a.object===this.scatterPlot)){a.object.highlight&&a.object.highlight(null),this.scatterPlot&&(a.object=this.scatterPlot,this.scatterPlot.highlight(a.data)),this.textLabels&&void 0!==this.textLabels[a.data.index]?a.textLabel=this.textLabels[a.data.index]:a.textLabel="";var b=a.data.index;return a.traceCoordinate=[this.data.x[b],this.data.y[b],this.data.z[b]],!0}},z.update=function(a){var b,c,d,f,g=this.scene.glplot.gl,h=w.solid;this.data=a;var i=k(this.scene,a);"mode"in i&&(this.mode=i.mode),"lineDashes"in i&&i.lineDashes in w&&(h=w[i.lineDashes]),this.color=l(i.scatterColor)||l(i.lineColor),this.dataPoints=i.position,b={gl:g,position:i.position,color:i.lineColor,lineWidth:i.lineWidth||1,dashes:h[0],dashScale:h[1],opacity:a.opacity},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(b):(this.linePlot=n(b),this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var j=a.opacity;if(a.marker&&a.marker.opacity&&(j*=a.marker.opacity),c={gl:g,position:i.position,color:i.scatterColor,size:i.scatterSize,glyph:i.scatterMarker,opacity:j,orthographic:!0,lineWidth:i.scatterLineWidth,lineColor:i.scatterLineColor,project:i.project,projectScale:i.projectScale,projectOpacity:i.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(c):(this.scatterPlot=o(c),this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),f={gl:g,position:i.position,glyph:i.text,color:i.textColor,size:i.textSize,angle:i.textAngle,alignment:i.textOffset,font:i.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:a.opacity},this.textLabels=i.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(f):(this.textMarkers=o(f),this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),d={gl:g,position:i.position,color:i.errorColor,error:i.errorBounds,lineWidth:i.errorLineWidth,capSize:i.errorCapSize,opacity:a.opacity},this.errorBars?i.errorBounds?this.errorBars.update(d):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):i.errorBounds&&(this.errorBars=p(d),this.scene.glplot.add(this.errorBars)),i.delaunayAxis>=0){var m=e(i.position,i.delaunayColor,i.delaunayAxis);this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=g,this.delaunayMesh=q(m),this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},z.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.textMarkers),this.delaunayMesh.dispose())},b.exports=m},{"../../constants/gl3d_dashes":336,"../../constants/gl_markers":337,"../../lib":349,"../../lib/gl_format_color":347,"../../lib/str2rgbarray":359,"../scatter/make_bubble_size_func":514,"./calc_errors":525,"delaunay-triangulate":71,"gl-error3d":78,"gl-line3d":84,"gl-mesh3d":107,"gl-scatter3d":150}],527:[function(a,b,c){"use strict";function d(a,b,c){var d=0,e=c("x"),f=c("y"),g=c("z");return e&&f&&g&&(d=Math.min(e.length,f.length,g.length),d<e.length&&(b.x=e.slice(0,d)),d<f.length&&(b.y=f.slice(0,d)),d<g.length&&(b.z=g.slice(0,d))),d}var e=a("../../lib"),f=a("../scatter/subtypes"),g=a("../scatter/marker_defaults"),h=a("../scatter/line_defaults"),i=a("../scatter/text_defaults"),j=a("../../components/errorbars/defaults"),k=a("./attributes");b.exports=function(a,b,c,l){function m(c,d){return e.coerce(a,b,k,c,d)}var n=d(a,b,m);if(!n)return void(b.visible=!1);m("text"),m("mode"),f.hasLines(b)&&h(a,b,c,m),f.hasMarkers(b)&&g(a,b,c,l,m),f.hasText(b)&&i(a,b,l,m);var o=(b.line||{}).color,p=(b.marker||{}).color;m("surfaceaxis")>=0&&m("surfacecolor",o||p);for(var q=["x","y","z"],r=0;3>r;++r){var s="projection."+q[r];m(s+".show")&&(m(s+".opacity"),m(s+".scale"))}j(a,b,c,{axis:"z"}),j(a,b,c,{axis:"y",inherit:"z"}),j(a,b,c,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":322,"../../lib":349,"../scatter/line_defaults":512,"../scatter/marker_defaults":516,"../scatter/subtypes":520,"../scatter/text_defaults":521,"./attributes":523}],528:[function(a,b,c){"use strict";var d={};d.plot=a("./convert"),d.attributes=a("./attributes"),d.markerSymbols=a("../../constants/gl_markers"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../scatter/colorbar"),d.calc=a("./calc"),d.moduleType="trace",d.name="scatter3d",d.basePlotModule=a("../../plots/gl3d"),d.categories=["gl3d","symbols","markerColorscale","showLegend"],d.meta={},b.exports=d},{"../../constants/gl_markers":337,"../../plots/gl3d":400,"../scatter/colorbar":505,"./attributes":523,"./calc":524,"./convert":526,"./defaults":527}],529:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../plots/attributes"),f=a("../../lib/extend").extendFlat,g=d.marker,h=d.line,i=g.line;b.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:f({},d.mode,{dflt:"markers"}),text:f({},d.text,{}),line:{color:h.color,width:h.width,dash:h.dash},marker:{symbol:g.symbol,opacity:g.opacity,size:g.size,sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode,color:g.color,colorscale:g.colorscale,cauto:g.cauto,cmax:g.cmax,cmin:g.cmin,autocolorscale:g.autocolorscale,reversescale:g.reversescale,showscale:g.showscale,line:{color:i.color,width:i.width,colorscale:i.colorscale,cauto:i.cauto,cmax:i.cmax,cmin:i.cmin,autocolorscale:i.autocolorscale,reversescale:i.reversescale}},textfont:d.textfont,textposition:d.textposition,hoverinfo:f({},e.hoverinfo,{flags:["lon","lat","location","text","name"]}),_nestedModules:{"marker.colorbar":"Colorbar"}}},{"../../lib/extend":345,"../../plots/attributes":367,"../scatter/attributes":502}],530:[function(a,b,c){"use strict";var d=a("../scatter/marker_colorscale_calc");b.exports=function(a,b){var c=[{x:!1,y:!1,trace:b,t:{}}];return d(b),c}},{"../scatter/marker_colorscale_calc":515}],531:[function(a,b,c){"use strict";function d(a,b,c){var d,e,f=0,g=c("locations");return g?(c("locationmode"),f=g.length):(d=c("lon")||[],e=c("lat")||[],f=Math.min(d.length,e.length),f<d.length&&(b.lon=d.slice(0,f)),f<e.length&&(b.lat=e.slice(0,f)),f)}var e=a("../../lib"),f=a("../scatter/subtypes"),g=a("../scatter/marker_defaults"),h=a("../scatter/line_defaults"),i=a("../scatter/text_defaults"),j=a("./attributes");b.exports=function(a,b,c,k){function l(c,d){return e.coerce(a,b,j,c,d)}var m=d(a,b,l);return m?(l("text"),l("mode"),f.hasLines(b)&&h(a,b,c,l),f.hasMarkers(b)&&g(a,b,c,k,l),f.hasText(b)&&i(a,b,k,l),void l("hoverinfo",1===k._dataLength?"lon+lat+location+text":void 0)):void(b.visible=!1)}},{"../../lib":349,"../scatter/line_defaults":512,"../scatter/marker_defaults":516,"../scatter/subtypes":520,"../scatter/text_defaults":521,"./attributes":529}],532:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../scatter/colorbar"),d.calc=a("./calc"),d.plot=a("./plot").plot,d.moduleType="trace",d.name="scattergeo",d.basePlotModule=a("../../plots/geo"),d.categories=["geo","symbols","markerColorscale","showLegend"],d.meta={},b.exports=d},{"../../plots/geo":385,"../scatter/colorbar":505,"./attributes":529,"./calc":530,"./defaults":531,"./plot":533}],533:[function(a,b,c){"use strict";function d(a,b,c){function d(a,d){m(a,b,d,c)}var e=a.marker;if(d(a.text,"tx"),d(a.textposition,"tp"),a.textfont&&(d(a.textfont.size,"ts"),d(a.textfont.color,"tc"),d(a.textfont.family,"tf")),e&&e.line){var f=e.line;d(e.opacity,"mo"),d(e.symbol,"mx"),d(e.color,"mc"),d(e.size,"ms"),d(f.color,"mlc"),d(f.width,"mlw")}}function e(a){for(var b=a.lon.length,c=new Array(b),d=0;b>d;d++)c[d]=[a.lon[d],a.lat[d]];return{type:"LineString",coordinates:c,trace:a}}function f(a,b){function c(b){var c=a.mockAxis;return j.tickText(c,c.c2l(b),"hover").text+"°"}var d=b.hoverinfo;if("none"===d)return function(a){delete a.textLabel};var e="all"===d?q.hoverinfo.flags:d.split("+"),f=-1!==e.indexOf("location")&&Array.isArray(b.locations),g=-1!==e.indexOf("lon"),h=-1!==e.indexOf("lat"),i=-1!==e.indexOf("text");return function(a){var d=[];f?d.push(a.location):g&&h?d.push("("+c(a.lon)+", "+c(a.lat)+")"):g?d.push("lon: "+c(a.lon)):h&&d.push("lat: "+c(a.lat)),i&&d.push(a.tx||b.text),a.textLabel=d.join("<br>")}}function g(a){var b=Array.isArray(a.locations);return function(c,d){return{points:[{data:a._input,fullData:a,curveNumber:a.index,pointNumber:d,lon:c.lon,lat:c.lat,location:b?c.location:null}]}}}var h=a("d3"),i=a("../../plots/cartesian/graph_interact"),j=a("../../plots/cartesian/axes"),k=a("../../lib/topojson_utils").getTopojsonFeatures,l=a("../../lib/geo_location_utils").locationToFeature,m=a("../../lib/array_to_calc_item"),n=a("../../components/color"),o=a("../../components/drawing"),p=a("../scatter/subtypes"),q=a("./attributes"),r=b.exports={};r.calcGeoJSON=function(a,b){var c,e,f,g,h=[],i=Array.isArray(a.locations);i?(g=a.locations,c=g.length,e=k(a,b),f=function(a,b){var c=l(a.locationmode,g[b],e);return void 0!==c?c.properties.ct:void 0}):(c=a.lon.length,f=function(a,b){return[a.lon[b],a.lat[b]]});for(var j=0;c>j;j++){var m=f(a,j);if(m){var n={lon:m[0],lat:m[1],location:i?a.locations[j]:null};d(a,n,j),h.push(n)}}return h.length>0&&(h[0].trace=a),h},r.plot=function(a,b){var c=a.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(b,function(a){return a.uid});c.enter().append("g").attr("class","trace scattergeo"),c.exit().remove(),c.each(function(a){p.hasLines(a)&&h.select(this).append("path").datum(e(a)).attr("class","js-line")}),c.append("g").attr("class","points").each(function(b){function c(c,d){if(a.showHover){var e=a.projection([c.lon,c.lat]);m(c),i.loneHover({x:e[0],y:e[1],name:q?b.name:void 0,text:c.textLabel,color:c.mc||(b.marker||{}).color},{container:a.hoverContainer.node()}),a.graphDiv.emit("plotly_hover",n(c,d))}}function d(b,c){a.graphDiv.emit("plotly_click",n(b,c))}var e=h.select(this),j=p.hasMarkers(b),k=p.hasText(b);if(j||k){var l=r.calcGeoJSON(b,a.topojson),m=f(a,b),n=g(b),o=b.hoverinfo,q="all"===o||-1!==o.indexOf("name");j&&e.selectAll("path.point").data(l).enter().append("path").attr("class","point").on("mouseover",c).on("click",d).on("mouseout",function(){i.loneUnhover(a.hoverContainer)}).on("mousedown",function(){i.loneUnhover(a.hoverContainer)}).on("mouseup",c),k&&e.selectAll("g").data(l).enter().append("g").append("text")}}),r.style(a)},r.style=function(a){var b=a.framework.selectAll("g.trace.scattergeo");b.style("opacity",function(a){return a.opacity}),b.selectAll("g.points").each(function(a){h.select(this).selectAll("path.point").call(o.pointStyle,a),h.select(this).selectAll("text").call(o.textPointStyle,a)}),b.selectAll("path.js-line").style("fill","none").each(function(a){var b=a.trace,c=b.line||{};h.select(this).call(n.stroke,c.color).call(o.dashLine,c.dash||"",c.width||0)})}},{"../../components/color":299,"../../components/drawing":317,"../../lib/array_to_calc_item":341,"../../lib/geo_location_utils":346,"../../lib/topojson_utils":361,"../../plots/cartesian/axes":369,"../../plots/cartesian/graph_interact":374,"../scatter/subtypes":520,"./attributes":529,d3:70}],534:[function(a,b,c){"use strict";var d=a("../scatter/attributes"),e=a("../../constants/gl2d_dashes"),f=a("../../constants/gl_markers"),g=a("../../lib/extend").extendFlat,h=d.line,i=d.marker,j=i.line;b.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,text:g({},d.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:h.color,width:h.width,dash:{valType:"enumerated",values:Object.keys(e),dflt:"solid"}},marker:{color:i.color,symbol:{valType:"enumerated",values:Object.keys(f),dflt:"circle",arrayOk:!0},size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,opacity:i.opacity,colorscale:i.colorscale,cauto:i.cauto,cmax:i.cmax,cmin:i.cmin,autocolorscale:i.autocolorscale,reversescale:i.reversescale,showscale:i.showscale,line:{color:j.color,width:j.width,colorscale:j.colorscale,cauto:j.cauto,cmax:j.cmax,cmin:j.cmin,autocolorscale:j.autocolorscale,reversescale:j.reversescale}},fill:g({},d.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:d.fillcolor,_nestedModules:{error_x:"ErrorBars",error_y:"ErrorBars","marker.colorbar":"Colorbar"}}},{"../../constants/gl2d_dashes":335,"../../constants/gl_markers":337,"../../lib/extend":345,"../scatter/attributes":502}],535:[function(a,b,c){"use strict";function d(a,b){this.scene=a,this.uid=b,this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=[],this.bounds=[0,0,0,0],this.hasLines=!1,this.lineOptions={positions:new Float32Array,color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},this.line=n(a.glplot,this.lineOptions),this.line._trace=this,this.hasErrorX=!1,this.errorXOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorX=o(a.glplot,this.errorXOptions),this.errorX._trace=this,this.hasErrorY=!1,this.errorYOptions={positions:new Float32Array,errors:new Float32Array,lineWidth:1,capSize:0,color:[0,0,0,1]},this.errorY=o(a.glplot,this.errorYOptions),this.errorY._trace=this,this.hasMarkers=!1,this.scatterOptions={positions:new Float32Array,sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]},this.scatter=l(a.glplot,this.scatterOptions),this.scatter._trace=this,this.fancyScatter=m(a.glplot,this.scatterOptions),this.fancyScatter._trace=this}function e(a,b,c){return Array.isArray(b)||(b=[b]),f(a,b,c)}function f(a,b,c){for(var d=new Array(c),e=b[0],f=0;c>f;++f)d[f]=a(f>=b.length?e:b[f]);return d}function g(a,b,c){return i(D(a,c),C(b,c),c)}function h(a,b,c,d){var e=u(a,b,d);return e=Array.isArray(e[0])?e:f(q.identity,[e],d),i(e,C(c,d),d)}function i(a,b,c){for(var d=new Array(4*c),e=0;c>e;++e){for(var f=0;3>f;++f)d[4*e+f]=a[e][f];d[4*e+3]=a[e][3]*b[e]}return d}function j(a,b){if(void 0===Float32Array.slice){for(var c=new Float32Array(b),d=0;b>d;d++)c[d]=a[d];return c}return a.slice(0,b)}function k(a,b){var c=new d(a,b.uid);return c.update(b),c}var l=a("gl-scatter2d"),m=a("gl-scatter2d-fancy"),n=a("gl-line2d"),o=a("gl-error2d"),p=a("fast-isnumeric"),q=a("../../lib"),r=a("../../plots/cartesian/axes"),s=a("../../components/errorbars"),t=a("../../lib/str2rgbarray"),u=a("../../lib/gl_format_color"),v=a("../scatter/subtypes"),w=a("../scatter/make_bubble_size_func"),x=a("../scatter/get_trace_color"),y=a("../../constants/gl_markers"),z=a("../../constants/gl2d_dashes"),A=["xaxis","yaxis"],B=d.prototype;B.handlePick=function(a){var b=this.idToIndex[a.pointId];return{trace:this,dataCoord:a.dataCoord,traceCoord:[this.xData[b],this.yData[b]],textLabel:Array.isArray(this.textLabels)?this.textLabels[b]:this.textLabels,color:Array.isArray(this.color)?this.color[b]:this.color,name:this.name,hoverinfo:this.hoverinfo}},B.isFancy=function(a){if("linear"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!a.x||!a.y)return!0;var b=a.marker||{};if(Array.isArray(b.symbol)||"circle"!==b.symbol||Array.isArray(b.size)||Array.isArray(b.line.width)||Array.isArray(b.opacity))return!0;var c=b.color;if(Array.isArray(c))return!0;var d=Array.isArray(b.line.color);return Array.isArray(d)?!0:this.hasErrorX?!0:!!this.hasErrorY};var C=e.bind(null,function(a){return+a}),D=e.bind(null,t),E=e.bind(null,function(a){return y[a]||"â"});B.update=function(a){a.visible!==!0?(this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.hasLines=v.hasLines(a),this.hasErrorX=a.error_x.visible===!0,this.hasErrorY=a.error_y.visible===!0,this.hasMarkers=v.hasMarkers(a)),this.textLabels=a.text,this.name=a.name,this.hoverinfo=a.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.isFancy(a)?this.updateFancy(a):this.updateFast(a),this.color=x(a,{})},B.updateFast=function(a){for(var b,c,d=this.xData=a.x,e=this.yData=a.y,f=d.length,g=new Array(f),h=new Float32Array(2*f),i=this.bounds,k=0,l=0,m=0;f>m;++m)b=d[m],c=e[m],p(b)&&p(c)&&(g[k++]=m,h[l++]=b,h[l++]=c,i[0]=Math.min(i[0],b),i[1]=Math.min(i[1],c),i[2]=Math.max(i[2],b),i[3]=Math.max(i[3],c));h=j(h,l),this.idToIndex=g,this.updateLines(a,h),this.updateError("X",a),this.updateError("Y",a); 59 var n;if(this.hasMarkers){this.scatterOptions.positions=h;var o=t(a.marker.color),q=t(a.marker.line.color),r=a.opacity*a.marker.opacity;o[3]*=r,this.scatterOptions.color=o,q[3]*=r,this.scatterOptions.borderColor=q,n=a.marker.size,this.scatterOptions.size=n,this.scatterOptions.borderSize=a.marker.line.width,this.scatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions),this.expandAxesFast(i,n)},B.updateFancy=function(a){var b,c,d,f,g,i,k,l,m=this.scene,n=m.xaxis,o=m.yaxis,p=this.bounds,q=this.xData=n.makeCalcdata(a,"x"),r=this.yData=o.makeCalcdata(a,"y"),t=s.calcFromTrace(a,m.fullLayout),u=q.length,v=new Array(u),x=new Float32Array(2*u),y=new Float32Array(4*u),z=new Float32Array(4*u),A=0,B=0,D=0,F=0,G="log"===n.type?function(a){return n.d2l(a)}:function(a){return a},H="log"===o.type?function(a){return o.d2l(a)}:function(a){return a};for(b=0;u>b;++b)d=G(q[b]),f=H(r[b]),isNaN(d)||isNaN(f)||(v[A++]=b,x[B++]=d,x[B++]=f,g=y[D++]=d-t[b].xs||0,i=y[D++]=t[b].xh-d||0,y[D++]=0,y[D++]=0,z[F++]=0,z[F++]=0,k=z[F++]=f-t[b].ys||0,l=z[F++]=t[b].yh-f||0,p[0]=Math.min(p[0],d-g),p[1]=Math.min(p[1],f-k),p[2]=Math.max(p[2],d+i),p[3]=Math.max(p[3],f+l));x=j(x,B),this.idToIndex=v,this.updateLines(a,x),this.updateError("X",a,x,y),this.updateError("Y",a,x,z);var I;if(this.hasMarkers){this.scatterOptions.positions=x,this.scatterOptions.sizes=new Array(A),this.scatterOptions.glyphs=new Array(A),this.scatterOptions.borderWidths=new Array(A),this.scatterOptions.colors=new Array(4*A),this.scatterOptions.borderColors=new Array(4*A);var J,K=w(a),L=a.marker,M=L.opacity,N=a.opacity,O=h(L,M,N,u),P=E(L.symbol,u),Q=C(L.line.width,u),R=h(L.line,M,N,u);for(I=e(K,L.size,u),b=0;A>b;++b)for(J=v[b],this.scatterOptions.sizes[b]=4*I[J],this.scatterOptions.glyphs[b]=P[J],this.scatterOptions.borderWidths[b]=.5*Q[J],c=0;4>c;++c)this.scatterOptions.colors[4*b+c]=O[4*J+c],this.scatterOptions.borderColors[4*b+c]=R[4*J+c];this.fancyScatter.update(this.scatterOptions)}else this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.fancyScatter.update(this.scatterOptions);this.scatterOptions.positions=new Float32Array,this.scatterOptions.glyphs=[],this.scatter.update(this.scatterOptions),this.expandAxesFancy(q,r,I)},B.updateLines=function(a,b){if(this.hasLines){this.lineOptions.positions=b;var c=t(a.line.color);this.hasMarkers&&(c[3]*=a.marker.opacity);for(var d=Math.round(.5*this.lineOptions.width),e=(z[a.line.dash]||[1]).slice(),f=0;f<e.length;++f)e[f]*=d;switch(a.fill){case"tozeroy":this.lineOptions.fill=[!1,!0,!1,!1];break;case"tozerox":this.lineOptions.fill=[!0,!1,!1,!1];break;default:this.lineOptions.fill=[!1,!1,!1,!1]}var g=t(a.fillcolor);this.lineOptions.color=c,this.lineOptions.width=2*a.line.width,this.lineOptions.dashes=e,this.lineOptions.fillColor=[g,g,g,g]}else this.lineOptions.positions=new Float32Array;this.line.update(this.lineOptions)},B.updateError=function(a,b,c,d){var e=this["error"+a],f=b["error_"+a.toLowerCase()],h=this["error"+a+"Options"];"x"===a.toLowerCase()&&f.copy_ystyle&&(f=b.error_y),this["hasError"+a]?(h.positions=c,h.errors=d,h.capSize=f.width,h.lineWidth=f.thickness/2,h.color=g(f.color,1,1)):h.positions=new Float32Array,e.update(h)},B.expandAxesFast=function(a,b){for(var c,d,e,f=b||10,g=0;2>g;g++)c=this.scene[A[g]],d=c._min,d||(d=[]),d.push({val:a[g],pad:f}),e=c._max,e||(e=[]),e.push({val:a[g+2],pad:f})},B.expandAxesFancy=function(a,b,c){var d=this.scene,e={padded:!0,ppad:c};r.expand(d.xaxis,a,e),r.expand(d.yaxis,b,e)},B.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},b.exports=k},{"../../components/errorbars":323,"../../constants/gl2d_dashes":335,"../../constants/gl_markers":337,"../../lib":349,"../../lib/gl_format_color":347,"../../lib/str2rgbarray":359,"../../plots/cartesian/axes":369,"../scatter/get_trace_color":509,"../scatter/make_bubble_size_func":514,"../scatter/subtypes":520,"fast-isnumeric":74,"gl-error2d":76,"gl-line2d":82,"gl-scatter2d":147,"gl-scatter2d-fancy":142}],536:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../scatter/constants"),f=a("../scatter/subtypes"),g=a("../scatter/xy_defaults"),h=a("../scatter/marker_defaults"),i=a("../scatter/line_defaults"),j=a("../scatter/fillcolor_defaults"),k=a("../../components/errorbars/defaults"),l=a("./attributes");b.exports=function(a,b,c,m){function n(c,e){return d.coerce(a,b,l,c,e)}var o=g(a,b,n);return o?(n("text"),n("mode",o<e.PTS_LINESONLY?"lines+markers":"lines"),f.hasLines(b)&&i(a,b,c,n),f.hasMarkers(b)&&h(a,b,c,m,n),n("fill"),"none"!==b.fill&&j(a,b,c,n),k(a,b,c,{axis:"y"}),void k(a,b,c,{axis:"x",inherit:"y"})):void(b.visible=!1)}},{"../../components/errorbars/defaults":322,"../../lib":349,"../scatter/constants":506,"../scatter/fillcolor_defaults":508,"../scatter/line_defaults":512,"../scatter/marker_defaults":516,"../scatter/subtypes":520,"../scatter/xy_defaults":522,"./attributes":534}],537:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../scatter/colorbar"),d.calc=a("../scatter3d/calc"),d.plot=a("./convert"),d.moduleType="trace",d.name="scattergl",d.basePlotModule=a("../../plots/gl2d"),d.categories=["gl2d","symbols","errorBarsOK","markerColorscale","showLegend"],d.meta={},b.exports=d},{"../../plots/gl2d":397,"../scatter/colorbar":505,"../scatter3d/calc":524,"./attributes":534,"./convert":535,"./defaults":536}],538:[function(a,b,c){"use strict";function d(a){return{valType:"boolean",dflt:!1}}function e(a){return{show:{valType:"boolean",dflt:!1},project:{x:d("x"),y:d("y"),z:d("z")},color:{valType:"color",dflt:"#000"},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!1},highlightColor:{valType:"color",dflt:"#000"},highlightWidth:{valType:"number",min:1,max:16,dflt:2}}}var f=a("../../components/colorscale/attributes"),g=a("../../lib/extend").extendFlat;b.exports={z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},zauto:f.zauto,zmin:f.zmin,zmax:f.zmax,colorscale:f.colorscale,autocolorscale:g({},f.autocolorscale,{dflt:!1}),reversescale:f.reversescale,showscale:f.showscale,contours:{x:e("x"),y:e("y"),z:e("z")},hidesurface:{valType:"boolean",dflt:!1},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_nestedModules:{colorbar:"Colorbar"}}},{"../../components/colorscale/attributes":305,"../../lib/extend":345}],539:[function(a,b,c){"use strict";var d=a("../../components/colorscale/calc");b.exports=function(a,b){d(b,b.z,"","z")}},{"../../components/colorscale/calc":306}],540:[function(a,b,c){"use strict";function d(a,b,c){this.scene=a,this.uid=c,this.surface=b,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function e(a,b){return void 0===b&&(b=1),a.map(function(a){var c=a[0],d=n(a[1]),e=d.toRgb();return{index:c,rgb:[e.r,e.g,e.b,b]}})}function f(a){var b=a.shape,c=[b[0]+2,b[1]+2],d=j(new Float32Array(c[0]*c[1]),c);return m.assign(d.lo(1,1).hi(b[0],b[1]),a),m.assign(d.lo(1).hi(b[0],1),a.hi(b[0],1)),m.assign(d.lo(1,c[1]-1).hi(b[0],1),a.lo(0,b[1]-1).hi(b[0],1)),m.assign(d.lo(0,1).hi(1,b[1]),a.hi(1)),m.assign(d.lo(c[0]-1,1).hi(1,b[1]),a.lo(b[0]-1)),d.set(0,0,a.get(0,0)),d.set(0,c[1]-1,a.get(0,b[1]-1)),d.set(c[0]-1,0,a.get(b[0]-1,0)),d.set(c[0]-1,c[1]-1,a.get(b[0]-1,b[1]-1)),d}function g(a){var b=Math.max(a[0].shape[0],a[0].shape[1]);if(p>b){for(var c=p/b,d=[0|Math.floor(a[0].shape[0]*c+1),0|Math.floor(a[0].shape[1]*c+1)],e=d[0]*d[1],g=0;3>g;++g){var h=f(a[g]),i=j(new Float32Array(e),d);k(i,h,[c,0,0,0,c,0,0,0,1]),a[g]=i}return c}return 1}function h(a,b){var c=a.glplot.gl,e=i({gl:c}),f=new d(a,e,b.uid);return f.update(b),a.glplot.add(e),f}var i=a("gl-surface3d"),j=a("ndarray"),k=a("ndarray-homography"),l=a("ndarray-fill"),m=a("ndarray-ops"),n=a("tinycolor2"),o=a("../../lib/str2rgbarray"),p=128,q=d.prototype;q.handlePick=function(a){if(a.object===this.surface){var b=[Math.min(0|Math.round(a.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(a.data.index[1]/this.dataScale-1),this.data.z.length-1)],c=[0,0,0];Array.isArray(this.data.x[0])?c[0]=this.data.x[b[1]][b[0]]:c[0]=this.data.x[b[0]],Array.isArray(this.data.y[0])?c[1]=this.data.y[b[1]][b[0]]:c[1]=this.data.y[b[1]],c[2]=this.data.z[b[1]][b[0]],a.traceCoordinate=c;var d=this.scene.fullSceneLayout;a.dataCoordinate=[d.xaxis.d2l(c[0])*this.scene.dataScale[0],d.yaxis.d2l(c[1])*this.scene.dataScale[1],d.zaxis.d2l(c[2])*this.scene.dataScale[2]];var e=this.data.text;return e&&e[b[1]]&&void 0!==e[b[1]][b[0]]?a.textLabel=e[b[1]][b[0]]:a.textLabel="",a.data.dataCoordinate=a.dataCoordinate.slice(),this.surface.highlight(a.data),this.scene.glplot.spikes.position=a.dataCoordinate,!0}},q.setContourLevels=function(){for(var a=[[],[],[]],b=!1,c=0;3>c;++c)this.showContour[c]&&(b=!0,a[c]=this.scene.contourLevels[c]);b&&this.surface.update({levels:a})},q.update=function(a){var b,c=this.scene,d=c.fullSceneLayout,f=this.surface,h=a.opacity,i=e(a.colorscale,h),k=a.z,m=a.x,n=a.y,p=d.xaxis,q=d.yaxis,r=d.zaxis,s=c.dataScale,t=k[0].length,u=k.length,v=[j(new Float32Array(t*u),[t,u]),j(new Float32Array(t*u),[t,u]),j(new Float32Array(t*u),[t,u])],w=v[0],x=v[1],y=c.contourLevels;this.data=a,l(v[2],function(a,b){return r.d2l(k[b][a])*s[2]}),Array.isArray(m[0])?l(w,function(a,b){return p.d2l(m[b][a])*s[0]}):l(w,function(a){return p.d2l(m[a])*s[0]}),Array.isArray(n[0])?l(x,function(a,b){return q.d2l(n[b][a])*s[1]}):l(x,function(a,b){return q.d2l(n[b])*s[1]}),this.dataScale=g(v);var z={colormap:i,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!a.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:1,colorBounds:[a.zmin*s[2],a.zmax*s[2]]};"opacity"in a&&a.opacity<1&&(z.opacity=.25*a.opacity);var A=[!0,!0,!0],B=[!0,!0,!0],C=["x","y","z"];for(b=0;3>b;++b){var D=a.contours[C[b]];A[b]=D.highlight,B[b]=D.show,z.showContour[b]=D.show||D.highlight,z.showContour[b]&&(z.contourProject[b]=[D.project.x,D.project.y,D.project.z],D.show?(this.showContour[b]=!0,z.levels[b]=y[b],f.highlightColor[b]=z.contourColor[b]=o(D.color),D.usecolormap?f.highlightTint[b]=z.contourTint[b]=0:f.highlightTint[b]=z.contourTint[b]=1,z.contourWidth[b]=D.width):this.showContour[b]=!1,D.highlight&&(z.dynamicColor[b]=o(D.highlightColor),z.dynamicWidth[b]=D.highlightWidth))}z.coords=v,f.update(z),f.highlightEnable=A,f.contourEnable=B,f.visible=a.visible,f.snapToData=!0,"lighting"in a&&(f.ambientLight=a.lighting.ambient,f.diffuseLight=a.lighting.diffuse,f.specularLight=a.lighting.specular,f.roughness=a.lighting.roughness,f.fresnel=a.lighting.fresnel),h&&1>h&&(f.supportsTransparency=!0)},q.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},b.exports=h},{"../../lib/str2rgbarray":359,"gl-surface3d":184,ndarray:208,"ndarray-fill":201,"ndarray-homography":206,"ndarray-ops":207,tinycolor2:229}],541:[function(a,b,c){"use strict";var d=a("../../lib"),e=a("../../components/colorscale/defaults"),f=a("./attributes");b.exports=function(a,b,c,g){function h(c,e){return d.coerce(a,b,f,c,e)}var i,j,k=h("z");if(!k)return void(b.visible=!1);var l=k[0].length,m=k.length;if(h("x"),h("y"),!Array.isArray(b.x))for(b.x=[],i=0;l>i;++i)b.x[i]=i;if(h("text"),!Array.isArray(b.y))for(b.y=[],i=0;m>i;++i)b.y[i]=i;h("lighting.ambient"),h("lighting.diffuse"),h("lighting.specular"),h("lighting.roughness"),h("lighting.fresnel"),h("hidesurface"),h("opacity"),h("colorscale");var n=["x","y","z"];for(i=0;3>i;++i){var o="contours."+n[i],p=h(o+".show"),q=h(o+".highlight");if(p||q)for(j=0;3>j;++j)h(o+".project."+n[j]);p&&(h(o+".color"),h(o+".width"),h(o+".usecolormap")),q&&(h(o+".highlightColor"),h(o+".highlightWidth"))}e(a,b,g,h,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":308,"../../lib":349,"./attributes":538}],542:[function(a,b,c){"use strict";var d={};d.attributes=a("./attributes"),d.supplyDefaults=a("./defaults"),d.colorbar=a("../heatmap/colorbar"),d.calc=a("./calc"),d.plot=a("./convert"),d.moduleType="trace",d.name="surface",d.basePlotModule=a("../../plots/gl3d"),d.categories=["gl3d","noOpacity"],d.meta={},b.exports=d},{"../../plots/gl3d":400,"../heatmap/colorbar":461,"./attributes":538,"./calc":539,"./convert":540,"./defaults":541}]},{},[12])(12)}),angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(l(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",to:{height:f[0].scrollHeight+"px"}}).start()["finally"](i):a.addClass(f,"in",{to:{height:f[0].scrollHeight+"px"}}).then(i)})}function i(){f.removeClass("collapsing").addClass("collapse").css({height:"auto"}),m(d)}function j(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(n(d)).then(function(){f.css({height:f[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:{height:"0"}}).start()["finally"](k):a.removeClass(f,"in",{to:{height:"0"}}).then(k)}):k()}function k(){f.css({height:"0"}),f.removeClass("collapsing").addClass("collapse"),o(d)}var l=c(g.expanding),m=c(g.expanded),n=c(g.collapsing),o=c(g.collapsed);d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css({height:"auto"}),d.$watch(g.uibCollapse,function(a){a?j():h()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.uibAccordionTransclude]},function(a){if(a){var c=angular.element(b[0].querySelector("[uib-accordion-header]"));c.html(""),c.append(a)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;t.length;)t.shift()}function g(a){for(var b=0;b<q.length;b++)q[b].slide.active=b===a}function h(c,d,i){if(!u){if(angular.extend(c,{direction:i}),angular.extend(q[s].slide||{},{direction:i}),e.enabled(b)&&!a.$currentTransition&&q[d].element&&p.slides.length>1){q[d].element.data(r,c.direction);var j=p.getCurrentIndex();angular.isNumber(j)&&q[j].element&&q[j].element.data(r,c.direction),a.$currentTransition=!0,e.on("addClass",q[d].element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),t.length)){var d=t.pop().slide,g=d.index,i=g>p.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})}a.active=c.index,s=c.index,g(d),l()}}function i(a){for(var b=0;b<q.length;b++)if(q[b].slide===a)return b}function j(){n&&(c.cancel(n),n=null)}function k(b){b.length||(a.$currentTransition=null,f())}function l(){j();var b=+a.interval;!isNaN(b)&&b>0&&(n=c(m,b))}function m(){var b=+a.interval;o&&!isNaN(b)&&b>0&&q.length?a.next():a.pause()}var n,o,p=this,q=p.slides=a.slides=[],r="uib-slideDirection",s=a.active,t=[],u=!1;p.addSlide=function(b,c){q.push({slide:b,element:c}),q.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===q.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),s=b.index,a.active=b.index,g(s),p.select(q[i(b)]),1===q.length&&a.play())},p.getCurrentIndex=function(){for(var a=0;a<q.length;a++)if(q[a].slide.index===s)return a},p.next=a.next=function(){var b=(p.getCurrentIndex()+1)%q.length;return 0===b&&a.noWrap()?void a.pause():p.select(q[b],"next")},p.prev=a.prev=function(){var b=p.getCurrentIndex()-1<0?q.length-1:p.getCurrentIndex()-1;return a.noWrap()&&b===q.length-1?void a.pause():p.select(q[b],"prev")},p.removeSlide=function(b){var c=i(b),d=t.indexOf(q[c]);-1!==d&&t.splice(d,1),q.splice(c,1),q.length>0&&s===c?c>=q.length?(s=q.length-1,a.active=s,g(s),p.select(q[q.length-1])):(s=c,a.active=s,g(s),p.select(q[c])):s>c&&(s--,a.active=s),0===q.length&&(s=null,a.active=null,f())},p.select=a.select=function(b,c){var d=i(b.slide);void 0===c&&(c=d>p.getCurrentIndex()?"next":"prev"),b.slide.index===s||a.$currentTransition?b&&b.slide.index!==s&&a.$currentTransition&&t.push(q[d]):h(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===q.length-1&&a.noWrap()},a.pause=function(){a.noPause||(o=!1,j())},a.play=function(){o||(o=!0,l())},a.$on("$destroy",function(){u=!0,j()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",l),a.$watchCollection("slides",k),a.$watch("active",function(a){if(angular.isNumber(a)&&s!==a){for(var b=0;b<q.length;b++)if(q[b].slide.index===a){a=b;break}var c=q[a];c&&(g(a),p.select(q[a]),s=a)}})}]).directive("uibCarousel",function(){return{transclude:!0,replace:!0,controller:"UibCarouselController",controllerAs:"carousel",templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/carousel.html"},scope:{active:"=",interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",function(){return{require:"^uibCarousel",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/slide.html"},scope:{actual:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)})}}}).animation(".item",["$animateCss",function(a){function b(a,b,c){a.removeClass(b),c&&c()}var c="uib-slideDirection";return{beforeAddClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i+" "+h,f);return d.addClass(h),a(d,{addClass:i}).start().done(j),function(){g=!0}}f()},beforeRemoveClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i,f);return a(d,{addClass:i}).start().done(j),function(){g=!0}}f()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter",function(a,b,c,d){function e(a,b){var c=[],e=a.split(""),f=a.indexOf("'");if(f>-1){var g=!1;a=a.split("");for(var h=f;h<a.length;h++)g?("'"===a[h]&&(h+1<a.length&&"'"===a[h+1]?(a[h+1]="$",e[h+1]=""):(e[h]="",g=!1)),a[h]="$"):"'"===a[h]&&(a[h]="$",e[h]="",g=!0);a=a.join("")}return angular.forEach(n,function(d){var f=a.indexOf(d.key);if(f>-1){a=a.split(""),e[f]="("+d.regex+")",a[f]="$";for(var g=f+1,h=f+d.key.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,key:d.key,apply:d[b],matcher:d.regex})}}),{regex:new RegExp("^"+e.join("")+"$"),map:d(c,"index")}}function f(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function g(a){return parseInt(a,10)}function h(a,b){return a&&b?l(a,b):a}function i(a,b){return a&&b?l(a,b,!0):a}function j(a,b){var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function k(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function l(a,b,c){c=c?-1:1;var d=j(b,a.getTimezoneOffset());return k(a,c*(d-a.getTimezoneOffset()))}var m,n,o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=b.id,this.parsers={},this.formatters={},n=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=g(c+d),this.minutes+=g(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}]},this.init(),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==m&&this.init(),this.formatters[c]||(this.formatters[c]=e(c,"formatter"));var d=this.formatters[c],f=d.map,g=c;return f.reduce(function(b,c,d){var e=g.match(new RegExp("(.*)"+c.key));e&&angular.isString(e[1])&&(b+=e[1],g=g.replace(e[1]+c.key,""));var h=d===f.length-1?g:"";return c.apply?b+c.apply.call(null,a)+h:b+h},"")},this.parse=function(c,d,g){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(o,"\\$&"),b.id!==m&&this.init(),this.parsers[d]||(this.parsers[d]=e(d,"apply"));var h=this.parsers[d],i=h.regex,j=h.map,k=c.match(i),l=!1;if(k&&k.length){var n,p;angular.isDate(g)&&!isNaN(g.getTime())?n={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),n={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(l=!0),s.apply&&s.apply.call(n,k[q])}var t=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return f(n.year,n.month,n.date)&&(!angular.isDate(g)||isNaN(g.getTime())||l?(p=new Date(0),t.call(p,n.year,n.month,n.date),u.call(p,n.hours||0,n.minutes||0,n.seconds||0,n.milliseconds||0)):(p=new Date(g),t.call(p,n.year,n.month,n.date),u.call(p,n.hours,n.minutes,n.seconds,n.milliseconds))),p}},this.toTimezone=h,this.fromTimezone=i,this.timezoneToOffset=j,this.addDateMinutes=k,this.convertTimezoneToLocal=l}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}var m=this,n={$setViewValue:angular.noop},o={},p=[];!!b.datepickerOptions;a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:h.datepickerMode;break;case"formatDay": 60 case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":m[b]=angular.isDefined(a.datepickerOptions[b])?d(a.datepickerOptions[b])(a.$parent):h[b];break;case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":m[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:h[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?m.startingDay=a.datepickerOptions.startingDay:angular.isNumber(h.startingDay)?m.startingDay=h.startingDay:m.startingDay=(e.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?m[b]=k.fromTimezone(new Date(a),o.timezone):(i&&f.warn("Literal date support has been deprecated, please switch to date object usage"),m[b]=new Date(g(a,"medium"))):m[b]=h[b]?k.fromTimezone(new Date(h[b]),o.timezone):null,m.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){m[b]=a[b]=angular.isDefined(c)?c:datepickerOptions[b],("minMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)<m.modes.indexOf(m[b])||"maxMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)>m.modes.indexOf(m[b]))&&(a.datepickerMode=m[b],a.datepickerOptions.datepickerMode=m[b])}):m[b]=a[b]=h[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&p.push(a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,m.refreshView()})),a.isActive=function(b){return 0===m.compare(b.date,m.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){n=b,o=b.$options||h.ngModelOptions,a.datepickerOptions.initDate?(m.activeDate=k.fromTimezone(a.datepickerOptions.initDate,o.timezone)||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(n.$isEmpty(n.$modelValue)||n.$invalid)&&(m.activeDate=k.fromTimezone(a,o.timezone),m.refreshView())})):m.activeDate=new Date,this.activeDate=n.$modelValue?k.fromTimezone(new Date(n.$modelValue),o.timezone):k.fromTimezone(new Date,o.timezone),n.$render=function(){m.render()}},this.render=function(){if(n.$viewValue){var a=new Date(n.$viewValue),b=!isNaN(a);b?this.activeDate=k.fromTimezone(a,o.timezone):j||f.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=n.$viewValue?new Date(n.$viewValue):null;b=k.fromTimezone(b,o.timezone),n.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=n.$viewValue?new Date(n.$viewValue):null;d=k.fromTimezone(d,o.timezone);var e=new Date;e=k.fromTimezone(e,o.timezone);var f=this.compare(b,e),g={date:b,label:k.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),m.activeDate&&0===this.compare(g.date,m.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===m.minMode){var c=n.$viewValue?k.fromTimezone(new Date(n.$viewValue),o.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=k.toTimezone(c,o.timezone),n.$setViewValue(c),n.$render()}else m.activeDate=b,l(m.modes[m.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode")},a.move=function(a){var b=m.activeDate.getFullYear()+a*(m.step.years||0),c=m.activeDate.getMonth()+a*(m.step.months||0);m.activeDate.setFullYear(b,c,1),m.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===m.maxMode&&1===b||a.datepickerMode===m.minMode&&-1===b||(l(m.modes[m.modes.indexOf(a.datepickerMode)+b]),a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var q=function(){m.element[0].focus()};a.$on("uib:datepicker.focus",q),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),m.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(m.isDisabled(m.activeDate))return;a.select(m.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(m.handleKeyDown(c,b),m.refreshView()):a.toggleMode("up"===c?1:-1)},a.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('<div class="uib-position-scrollbar-measure"></div>');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(f,g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight,bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX)},scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,w,a.date);if(isNaN(c))for(var d=0;d<I.length;d++)if(c=l.parse(b,I[d],a.date),!isNaN(c))return c;return c}function r(a){if(angular.isNumber(a)&&(a=new Date(a)),!a)return null;if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=q(a);if(!isNaN(b))return l.toTimezone(b,J)}return F.$options&&F.$options.allowInvalid?a:void 0}function s(a,b){var d=a||b;return c.ngRequired||d?(angular.isNumber(d)&&(d=new Date(d)),d?angular.isDate(d)&&!isNaN(d)?!0:angular.isString(d)?!isNaN(q(b)):!1:!0):!0}function t(c){if(a.isOpen||!a.disabled){var d=H[0],e=b[0].contains(c.target),f=void 0!==d.contains&&d.contains(c.target);!a.isOpen||e||f||a.$apply(function(){a.isOpen=!1})}}function u(c){27===c.which&&a.isOpen?(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!1}),b[0].focus()):40!==c.which||a.isOpen||(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!0}))}function v(){if(a.isOpen){var d=angular.element(H[0].querySelector(".uib-datepicker-popup")),e=c.popupPlacement?c.popupPlacement:m.placement,f=j.positionElements(b,d,e,y);d.css({top:f.top+"px",left:f.left+"px"}),d.hasClass("uib-position-measure")&&d.removeClass("uib-position-measure")}}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K=!1,L=[];this.init=function(e){if(F=e,G=e.$options,x=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):m.closeOnDateSelection,y=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):m.appendToBody,z=angular.isDefined(c.onOpenFocus)?a.$parent.$eval(c.onOpenFocus):m.onOpenFocus,A=angular.isDefined(c.datepickerPopupTemplateUrl)?c.datepickerPopupTemplateUrl:m.datepickerPopupTemplateUrl,B=angular.isDefined(c.datepickerTemplateUrl)?c.datepickerTemplateUrl:m.datepickerTemplateUrl,I=angular.isDefined(c.altInputFormats)?a.$parent.$eval(c.altInputFormats):m.altInputFormats,a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):m.showButtonBar,m.html5Types[c.type]?(w=m.html5Types[c.type],K=!0):(w=c.uibDatepickerPopup||m.datepickerPopup,c.$observe("uibDatepickerPopup",function(a,b){var c=a||m.datepickerPopup;if(c!==w&&(w=c,F.$modelValue=null,!w))throw new Error("uibDatepickerPopup must have a date format specified.")})),!w)throw new Error("uibDatepickerPopup must have a date format specified.");if(K&&c.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");C=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"),G?(J=G.timezone,a.ngModelOptions=angular.copy(G),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),C.attr("ng-model-options","ngModelOptions")):J=null,C.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":A}),D=angular.element(C.children()[0]),D.attr("template-url",B),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),D.attr("datepicker-options","datepickerOptions"),K?F.$formatters.push(function(b){return a.date=l.fromTimezone(b,J),b}):(F.$$parserName="date",F.$validators.date=s,F.$parsers.unshift(r),F.$formatters.push(function(b){return F.$isEmpty(b)?(a.date=b,b):(a.date=l.fromTimezone(b,J),angular.isNumber(a.date)&&(a.date=new Date(a.date)),l.filter(a.date,w))})),F.$viewChangeListeners.push(function(){a.date=q(F.$viewValue)}),b.on("keydown",u),H=d(C)(a),C.remove(),y?h.find("body").append(H):b.after(H),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),H.remove(),b.off("keydown",u),h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,J));var c={};return angular.forEach(["minDate","maxDate"],function(b){null===a.datepickerOptions[b]?c[b]=null:angular.isDate(a.datepickerOptions[b])?c[b]=l.fromTimezone(new Date(a.datepickerOptions[b]),J):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium")))}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?l.filter(a.date,w):null;b.val(d),F.$setViewValue(d),x&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):b=new Date(d.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),z&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;y||j.parsePlacement(d)[2]?(E=E||angular.element(j.scrollParent(b)),E&&E.on("scroll",v)):E=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b){c||(a.on("click",d),a.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b){c===b&&(c=null,a.off("click",d),a.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen,angular.isFunction(r)&&r(o,o.isOpen),o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:m.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",e.right=window.innerWidth-(m.left+b.prop("offsetWidth"))+"px"):(e.left=m.left+"px",e.right="auto"),!t){var v=h.offset(u);e.top=m.top-v.top+"px",i?e.right=window.innerWidth-(m.left-v.left+b.prop("offsetWidth"))+"px":e.left=m.left-v.left+"px"}n.dropdownMenu.css(e)}var w=u?u:b,x=w.hasClass(u?p:q);if(x===!c&&g[c?"addClass":"removeClass"](w,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var y=angular.element('<ul class="dropdown-menu"></ul>');n.dropdownMenu.replaceWith(y),n.dropdownMenu=y}f.close(o),n.selectedOption=null}angular.isFunction(r)&&r(a,c)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b===a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b===a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.stackedMap","ui.bootstrap.position"]).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}).provider("$uibResolve",function(){var a=this;this.resolver=null,this.setResolver=function(a){this.resolver=a},this.$get=["$injector","$q",function(b,c){var d=a.resolver?b.get(a.resolver):null;return{resolve:function(a,e,f,g){if(d)return d.resolve(a,e,f,g);var h=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?h.push(c.resolve(b.invoke(a))):angular.isString(a)?h.push(c.resolve(b.get(a))):h.push(c.resolve(a))}),c.all(h).then(function(b){var c={},d=0;return angular.forEach(a,function(a,e){c[e]=b[d++]}),c})}}}]}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(a,b,c){function d(b,d,e){e.modalInClass&&(a.addClass(d,e.modalInClass),b.$on(c.NOW_CLOSING_EVENT,function(c,f){var g=f();b.modalOptions.animation?a.removeClass(d,e.modalInClass).then(g):g()}))}return{replace:!0,templateUrl:"uib/template/modal/backdrop.html",compile:function(a,b){return a.addClass(b.backdropClass),d}}}]).directive("uibModalWindow",["$uibModalStack","$q","$animateCss","$document",function(a,b,c,d){return{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/modal/window.html"},link:function(e,f,g){f.addClass(g.windowClass||""),f.addClass(g.windowTopClass||""),e.size=g.size,e.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!==c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},f.on("click",e.close),e.$isRendered=!0;var h=b.defer();g.$observe("modalRender",function(a){"true"===a&&h.resolve()}),h.promise.then(function(){var h=null;g.modalInClass&&(h=c(f,{addClass:g.modalInClass}).start(),e.$on(a.NOW_CLOSING_EVENT,function(a,b){var d=b();c(f,{removeClass:g.modalInClass}).start().then(d)})),b.when(h).then(function(){var b=a.getTop();if(b&&a.modalRendered(b.key),!d[0].activeElement||!f[0].contains(d[0].activeElement)){var c=f[0].querySelector("[autofocus]");c?c.focus():f[0].focus()}})})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.uibModalAnimationClass)}}}).directive("uibModalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap","$uibPosition",function(a,b,c,d,e,f,g,h,i){function j(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function k(){for(var a=-1,b=v.keys(),c=0;c<b.length;c++)v.get(b[c]).value.backdrop&&(a=c);return a>-1&&y>a&&(a=y),a}function l(a,b){var c=v.get(a).value,d=c.appendTo;v.remove(a), 61 z=v.top(),z&&(y=parseInt(z.value.modalDomEl.attr("index"),10)),o(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||u;w.remove(b,a),d.toggleClass(b,w.hasKey(b)),t&&t.heightOverflow&&t.scrollbarWidth&&(t.originalRight?d.css({paddingRight:t.originalRight+"px"}):d.css({paddingRight:""}),t=null),m(!0)},c.closedDeferred),n(),b&&b.focus?b.focus():d.focus&&d.focus()}function m(a){var b;v.length()>0&&(b=v.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function n(){if(r&&-1===k()){var a=s;o(r,s,function(){a=null}),r=void 0,s=void 0}}function o(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){b.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(x.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function p(a){if(a.isDefaultPrevented())return a;var b=v.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){x.dismiss(b.key,"escape key press")}));break;case 9:var c=x.loadFocusElementList(b),d=!1;a.shiftKey?(x.isFocusInFirstItem(a,c)||x.isModalFocused(a,b))&&(d=x.focusLastFocusableElement(c)):x.isFocusInLastItem(a,c)&&(d=x.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function q(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var r,s,t,u="modal-open",v=h.createNew(),w=g.createNew(),x={NOW_CLOSING_EVENT:"modal.stack.now-closing"},y=0,z=null,A="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(k,function(a){s&&(s.index=a)}),c.on("keydown",p),e.$on("$destroy",function(){c.off("keydown",p)}),x.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||u;m(!1),z=v.top(),v.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),w.put(h,b);var j=f.appendTo,l=k();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!r&&(s=e.$new(!0),s.modalOptions=f,s.index=l,r=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>'),r.attr("backdrop-class",f.backdropClass),f.animation&&r.attr("modal-animation","true"),d(r)(s),a.enter(r,j)),y=z?parseInt(z.value.modalDomEl.attr("index"),10)+1:0;var n=angular.element('<div uib-modal-window="modal-window"></div>');n.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:y,animate:"animate"}).html(f.content),f.animation&&n.attr("modal-animation","true"),t=i.scrollbarPadding(j),t.heightOverflow&&t.scrollbarWidth&&j.css({paddingRight:t.right+"px"}),j.addClass(h),a.enter(d(n)(f.scope),j),v.top().value.modalDomEl=n,v.top().value.modalOpener=g},x.close=function(a,b){var c=v.get(a);return c&&q(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),l(a,c.value.modalOpener),!0):!c},x.dismiss=function(a,b){var c=v.get(a);return c&&q(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),l(a,c.value.modalOpener),!0):!c},x.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},x.getTop=function(){return v.top()},x.modalRendered=function(a){var b=v.get(a);b&&b.value.renderDeferred.resolve()},x.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},x.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},x.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},x.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},x.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},x.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(A);return c?Array.prototype.filter.call(c,function(a){return j(a)}):c}}},x}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i,j={};e.controller&&(j.$scope=d,j.$uibModalInstance=p,angular.forEach(a[1],function(a,b){j[b]=a}),i=f(e.controller,j,!0),e.controllerAs?(g=i.instance,e.bindToController&&(g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,c)),g=i(),d[e.controllerAs]=g):g=i(),angular.isFunction(g.$onInit)&&g.$onInit()),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup uib-title="'+r+"title"+s+'" '+(n.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen" origin-scope="origScope" class="uib-position-measure"></div>';return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){N.isOpen?q():m()}function m(){M&&!a.$eval(d[k+"Enable"])||(u(),x(),N.popupDelay?G||(G=g(r,N.popupDelay,!1)):r())}function q(){s(),N.popupCloseDelay?H||(H=g(t,N.popupCloseDelay,!1)):t()}function r(){return s(),u(),N.content?(v(),void N.$evalAsync(function(){N.isOpen=!0,y(!0),S()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){N&&N.$evalAsync(function(){N&&(N.isOpen=!1,y(!1),N.animation?F||(F=g(w,150,!1)):w())})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=N.$new(),D=c(E,function(a){K?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null)}function x(){N.title=d[k+"Title"],Q?N.content=Q(a):N.content=d[e],N.popupClass=d[k+"Class"],N.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);N.popupDelay=isNaN(c)?n.popupDelay:c,N.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){P&&angular.isFunction(P.assign)&&P.assign(a,b)}function z(){R.length=0,Q?(R.push(a.$watch(Q,function(a){N.content=a,!a&&N.isOpen&&t()})),R.push(E.$watch(function(){O||(O=!0,E.$$postDigest(function(){O=!1,N&&N.isOpen&&S()}))}))):R.push(d.$observe(e,function(a){N.content=a,!a&&N.isOpen?t():S()})),R.push(d.$observe(k+"Title",function(a){N.title=a,N.isOpen&&S()})),R.push(d.$observe(k+"Placement",function(a){N.placement=a?a:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0],N.isOpen&&S()}))}function A(){R.length&&(angular.forEach(R,function(a){a()}),R.length=0)}function B(a){N&&N.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];T(),L=p(a),"none"!==L.show&&L.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===L.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(L.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J,K=angular.isDefined(n.appendToBody)?n.appendToBody:!1,L=p(void 0),M=angular.isDefined(d[k+"Enable"]),N=a.$new(!0),O=!1,P=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,Q=n.useContentExp?l(d[e]):!1,R=[],S=function(){D&&D.html()&&(I||(I=g(function(){var a=i.positionElements(b,D,N.placement,K);D.css({top:a.top+"px",left:a.left+"px"}),D.hasClass(a.placement.split("-")[0])||(D.removeClass(J.split("-")[0]),D.addClass(a.placement.split("-")[0])),D.hasClass(n.placementClassPrefix+a.placement)||(D.removeClass(n.placementClassPrefix+J),D.addClass(n.placementClassPrefix+a.placement)),D.hasClass("uib-position-measure")?(i.positionArrow(D,a.placement),D.removeClass("uib-position-measure")):J!==a.placement&&i.positionArrow(D,a.placement),J=a.placement,I=null},0,!1)))};N.origScope=a,N.isOpen=!1,o.add(N,{close:t}),N.contentExp=function(){return N.content},d.$observe("disabled",function(a){a&&s(),a&&N.isOpen&&t()}),P&&a.$watch(P,function(a){N&&!a===N.isOpen&&j()});var T=function(){L.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),L.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var U=a.$eval(d[k+"Animation"]);N.animation=angular.isDefined(U)?!!U:n.animation;var V,W=k+"AppendToBody";V=W in d&&void 0===d[W]?!0:a.$eval(d[W]),K=angular.isDefined(V)?V:K,a.$on("$destroy",function(){T(),w(),o.remove(N),N=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{uibTitle:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",uibTitle:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{uibTitle:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;b<d.tabs.length;b++)if(d.tabs[b].index===a)return b}var c,d=this;d.tabs=[],d.select=function(a,f){if(!e){var g=b(c),h=d.tabs[g];if(h){if(h.tab.onDeselect({$event:f}),f&&f.isDefaultPrevented())return;h.tab.active=!1}var i=d.tabs[a];i?(i.tab.onSelect({$event:f}),i.tab.active=!0,d.active=i.index,c=i.index):!i&&angular.isNumber(c)&&(d.active=null,c=null)}},d.addTab=function(a){if(d.tabs.push({tab:a,index:a.index}),d.tabs.sort(function(a,b){return a.index>b.index?1:a.index<b.index?-1:0}),a.index===d.active||!angular.isNumber(d.active)&&1===d.tabs.length){var c=b(a.index);d.select(c)}},d.removeTab=function(a){for(var b,c=0;c<d.tabs.length;c++)if(d.tabs[c].tab===a){b=c;break}if(d.tabs[b].index===d.active){var e=b===d.tabs.length-1?b-1:b+1%d.tabs.length;d.select(e)}d.tabs.splice(b,1)},a.$watch("tabset.active",function(a){angular.isNumber(a)&&a!==c&&d.select(b(a))});var e;a.$on("$destroy",function(){e=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tabset.html"},link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1,angular.isUndefined(c.active)&&(a.active=0)}}}).directive("uibTab",["$parse",function(a){return{require:"^uibTabset",replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(b,c,d,e,f){b.disabled=!1,d.disable&&b.$parent.$watch(a(d.disable),function(a){b.disabled=!!a}),angular.isUndefined(d.index)&&(e.tabs&&e.tabs.length?b.index=Math.max.apply(null,e.tabs.map(function(a){return a.index}))+1:b.index=0),angular.isUndefined(d.classes)&&(b.classes=""),b.select=function(a){if(!b.disabled){for(var c,d=0;d<e.tabs.length;d++)if(e.tabs[d].tab===b){c=d;break}e.select(c,a)}},e.addTab(b),b.$on("$destroy",function(){e.removeTab(b)}),b.$transcludeFn=f}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("uibTabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("uib-tab-heading")||a.hasAttribute("data-uib-tab-heading")||a.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===a.tagName.toLowerCase()||"data-uib-tab-heading"===a.tagName.toLowerCase()||"x-uib-tab-heading"===a.tagName.toLowerCase()||"uib:tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^uibTabset",link:function(b,c,d){var e=b.$eval(d.uibTabContentTransclude).tab;e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(a,b,c,d,e,f,g){function h(){var b=+a.hours,c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===v[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),u.$setViewValue(new Date(s)),n(a)}function m(){u.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(u.$modelValue){var c=s.getHours(),d=s.getMinutes(),e=s.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!w),"m"!==b&&(a.minutes=k(d)),a.meridian=s.getHours()<12?v[0]:v[1],"s"!==b&&(a.seconds=k(e)),a.meridian=s.getHours()<12?v[0]:v[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=v[0]}function o(a){s=q(s,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s=new Date,t=[],u={$setViewValue:angular.noop},v=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,w=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){u=b,u.$render=this.render,u.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var x=g.hourStep;c.hourStep&&t.push(a.$parent.$watch(d(c.hourStep),function(a){x=+a}));var y=g.minuteStep;c.minuteStep&&t.push(a.$parent.$watch(d(c.minuteStep),function(a){y=+a}));var z;t.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);z=isNaN(b)?void 0:b}));var A;t.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);A=isNaN(b)?void 0:b}));var B=!1;c.ngDisabled&&t.push(a.$parent.$watch(d(c.ngDisabled),function(a){B=a})),a.noIncrementHours=function(){var a=p(s,60*x);return B||a>A||s>a&&z>a},a.noDecrementHours=function(){var a=p(s,60*-x);return B||z>a||a>s&&a>A},a.noIncrementMinutes=function(){var a=p(s,y);return B||a>A||s>a&&z>a},a.noDecrementMinutes=function(){var a=p(s,-y);return B||z>a||a>s&&a>A},a.noIncrementSeconds=function(){var a=q(s,C);return B||a>A||s>a&&z>a},a.noDecrementSeconds=function(){var a=q(s,-C);return B||z>a||a>s&&a>A},a.noToggleMeridian=function(){return s.getHours()<12?B||p(s,720)>A:B||p(s,-720)<z};var C=g.secondStep;c.secondStep&&t.push(a.$parent.$watch(d(c.secondStep),function(a){C=+a})),a.showSeconds=g.showSeconds,c.showSeconds&&t.push(a.$parent.$watch(d(c.showSeconds),function(b){a.showSeconds=!!b})),a.showMeridian=g.showMeridian,c.showMeridian&&t.push(a.$parent.$watch(d(c.showMeridian),function(b){if(a.showMeridian=!!b,u.$error.time){var c=h(),d=i();angular.isDefined(c)&&angular.isDefined(d)&&(s.setHours(c),l())}else n()})),this.setupMousewheelEvents=function(b,c,d){var e=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){u.$setViewValue(null),u.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(a),s.setMinutes(b),z>s||s>A?e(!0):l("h")):e(!0)},b.bind("blur",function(b){u.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!w)})}),a.updateMinutes=function(){var a=i(),b=h();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(b),s.setMinutes(a),z>s||s>A?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){u.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();u.$setDirty(),angular.isDefined(a)?(s.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=u.$viewValue;isNaN(b)?(u.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(s=b),z>s||s>A?(u.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*x*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-x*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*y)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-y)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(C)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-C)},a.toggleMeridian=function(){var b=i(),c=h(); 62 a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(s.getHours()<12?60:-60)):a.meridian=a.meridian===v[0]?v[1]:v[0])},a.blur=function(){u.$setTouched()},a.$on("$destroy",function(){for(;t.length;)t.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){N.moveInProgress||(N.moveInProgress=!0,N.$digest()),Y()}function o(){N.position=D?l.offset(b):l.position(b),N.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1),a.$watch(c.typeaheadMinLength,function(a){t=a||0===a?a:1});var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=e(c.typeaheadOnSelect),A=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,B=e(c.typeaheadNoResults).assign||angular.noop,C=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,D=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,E=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,F=a.$eval(c.typeaheadFocusFirst)!==!1,G=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,H=e(c.typeaheadIsOpen).assign||angular.noop,I=a.$eval(c.typeaheadShowHint)||!1,J=e(c.ngModel),K=e(c.ngModel+"($$$p)"),L=function(b,c){return angular.isFunction(J(a))&&q&&q.$options&&q.$options.getterSetter?K(b,{$$$p:c}):J.assign(b,c)},M=m.parse(c.uibTypeahead),N=a.$new(),O=a.$on("$destroy",function(){N.$destroy()});N.$on("$destroy",O);var P="typeahead-"+N.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":P});var Q,R;I&&(Q=angular.element("<div></div>"),Q.css("position","relative"),b.after(Q),R=b.clone(),R.attr("placeholder",""),R.attr("tabindex","-1"),R.val(""),R.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),Q.append(R),R.after(b));var S=angular.element("<div uib-typeahead-popup></div>");S.attr({id:P,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&S.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&S.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var T=function(){I&&R.val("")},U=function(){N.matches=[],N.activeIdx=-1,b.attr("aria-expanded",!1),T()},V=function(a){return P+"-option-"+a};N.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",V(a))});var W=function(a,b){return N.matches.length>b&&a?a.toUpperCase()===N.matches[b].label.toUpperCase():!1},X=function(c,d){var e={$viewValue:c};y(a,!0),B(a,!1),f.when(M.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){N.activeIdx=F?0:-1,B(a,!1),N.matches.length=0;for(var h=0;h<f.length;h++)e[M.itemName]=f[h],N.matches.push({id:V(h),label:M.viewMapper(N,e),model:f[h]});if(N.query=c,o(),b.attr("aria-expanded",!0),G&&1===N.matches.length&&W(c,0)&&(angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(0,d)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(0,d)),I){var i=N.matches[0].label;angular.isString(c)&&c.length>0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?R.val(c+i.slice(c.length)):R.val("")}}else U(),B(a,!0);g&&y(a,!1)},function(){U(),y(a,!1),B(a,!0)})};D&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Y=k(function(){N.matches.length&&o(),N.moveInProgress=!1},s);N.moveInProgress=!1,N.query=void 0;var Z,$=function(a){Z=g(function(){X(a)},u)},_=function(){Z&&g.cancel(Z)};U(),N.assignIsOpen=function(b){H(a,b)},N.select=function(d,e){var f,h,i={};x=!0,i[M.itemName]=h=N.matches[d].model,f=M.modelMapper(a,i),L(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),z(a,{$item:h,$model:f,$label:M.viewMapper(a,i),$event:e}),U(),N.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==N.matches.length&&-1!==r.indexOf(b.which)){if(-1===N.activeIdx&&(9===b.which||13===b.which)||9===b.which&&b.shiftKey)return U(),void N.$digest();b.preventDefault();var c;switch(b.which){case 9:case 13:N.$apply(function(){angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(N.activeIdx,b)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(N.activeIdx,b)});break;case 27:b.stopPropagation(),U(),a.$digest();break;case 38:N.activeIdx=(N.activeIdx>0?N.activeIdx:N.matches.length)-1,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop;break;case 40:N.activeIdx=(N.activeIdx+1)%N.matches.length,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){X(p.$viewValue,a)},0)}),b.bind("blur",function(a){A&&N.matches.length&&-1!==N.activeIdx&&!x&&(x=!0,N.$apply(function(){angular.isObject(N.debounceUpdate)&&angular.isNumber(N.debounceUpdate.blur)?k(function(){N.select(N.activeIdx,a)},N.debounceUpdate.blur):N.select(N.activeIdx,a)})),!v&&p.$error.editable&&(p.$viewValue="",p.$setValidity("editable",!0),p.$setValidity("parse",!0),b.val("")),w=!1,x=!1});var aa=function(c){b[0]!==c.target&&3!==c.which&&0!==N.matches.length&&(U(),j.$$phase||a.$digest())};h.on("click",aa),a.$on("$destroy",function(){h.off("click",aa),(D||E)&&ba.remove(),D&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),S.remove(),I&&Q.remove()});var ba=d(S)(N);D?h.find("body").append(ba):E?angular.element(E).eq(0).append(ba):b.after(ba),this.init=function(b,c){p=b,q=c,N.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(_(),$(b)):X(b):(y(a,!1),_(),U()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),C?(e.$model=b,C(a,e)):(e[M.itemName]=b,c=M.viewMapper(a,e),e[M.itemName]=void 0,d=M.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-time input{width:50px;}</style>'),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'),angular.$$uibTypeaheadCss=!0}),angular.module("ui.calendar",[]).constant("uiCalendarConfig",{calendars:{}}).controller("uiCalendarCtrl",["$scope","$locale",function(a,b){var c=a.eventSources,d=a.calendarWatchEvent?a.calendarWatchEvent:angular.noop,e=function(b){return function(){if(a.$root.$$phase)return b.apply(this,arguments);var c=arguments,d=this;return a.$root.$apply(function(){return b.apply(d,c)})}},f=1;this.eventFingerprint=function(a){a._id||(a._id=f++);var b=d({event:a})||"",c=moment.isMoment(a.start)?a.start.unix():a.start?moment(a.start).unix():"",e=moment.isMoment(a.end)?a.end.unix():a.end?moment(a.end).unix():"";return""+a._id+(a.id||"")+(a.title||"")+(a.url||"")+c+e+(a.allDay||"")+(a.className||"")+b};var g=1,h=1;this.sourceFingerprint=function(a){var b=""+(a.__id||(a.__id=g++)),c=angular.isObject(a)&&a.events;return c&&(b=b+"-"+(c.__id||(c.__id=h++))),b},this.allEvents=function(){for(var a=[],b=0,d=c.length;d>b;b++){var e=c[b];if(angular.isArray(e))a.push(e);else if(angular.isObject(e)&&angular.isArray(e.events)){var f={};for(var g in e)"_id"!==g&&"events"!==g&&(f[g]=e[g]);for(var h=0;h<e.events.length;h++)angular.extend(e.events[h],f);a.push(e.events)}}return Array.prototype.concat.apply([],a)},this.changeWatcher=function(a,b){var c,d=function(){for(var c,d,e=angular.isFunction(a)?a():a,g=[],h=0,i=e.length;i>h;h++)d=e[h],c=b(d),f[c]=d,g.push(c);return g},e=function(a,b){var c,d,e=[],f={};for(c=0,d=b.length;d>c;c++)f[b[c]]=!0;for(c=0,d=a.length;d>c;c++)f[a[c]]||e.push(a[c]);return e},f={},g=function(a,d){var g,h,i,j,k={},l=e(d,a);for(g=0,h=l.length;h>g;g++){var m=l[g];i=f[m],delete f[m];var n=b(i);n===m?c.onRemoved(i):(k[n]=m,c.onChanged(i))}var o=e(a,d);for(g=0,h=o.length;h>g;g++)j=o[g],i=f[j],k[j]||c.onAdded(i)};return c={subscribe:function(a,b){a.$watch(d,function(a,c){var d=!(b&&b(a,c)===!1);d&&g(a,c)},!0)},onAdded:angular.noop,onChanged:angular.noop,onRemoved:angular.noop}},this.getFullCalendarConfig=function(a,b){var c={};return angular.extend(c,b),angular.extend(c,a),angular.forEach(c,function(a,b){"function"==typeof a&&(c[b]=e(c[b]))}),c},this.getLocaleConfig=function(a){if(!a.lang||a.useNgLocale){var c=function(a){var b,c;b=[];for(c in a)b[c]=a[c];return b},d=b.DATETIME_FORMATS;return{monthNames:c(d.MONTH),monthNamesShort:c(d.SHORTMONTH),dayNames:c(d.DAY),dayNamesShort:c(d.SHORTDAY)}}return{}}}]).directive("uiCalendar",["uiCalendarConfig",function(a){return{restrict:"A",scope:{eventSources:"=ngModel",calendarWatchEvent:"&"},controller:"uiCalendarCtrl",link:function(b,c,d,e){function f(){var c,f=d.uiCalendar?b.$parent.$eval(d.uiCalendar):{};c=e.getFullCalendarConfig(f,a);var g=e.getLocaleConfig(c);angular.extend(g,c),l={eventSources:h},angular.extend(l,g),l.calendars=null;var i={};for(var j in l)"eventSources"!==j&&(i[j]=l[j]);return JSON.stringify(i)}var g,h=b.eventSources,i=!1,j=e.changeWatcher(h,e.sourceFingerprint),k=e.changeWatcher(e.allEvents,e.eventFingerprint),l=null;b.destroyCalendar=function(){g&&g.fullCalendar&&g.fullCalendar("destroy"),g=d.calendar?a.calendars[d.calendar]=$(c).html(""):$(c).html("")},b.initCalendar=function(){g||(g=angular.element(c).html("")),g.fullCalendar(l),d.calendar&&(a.calendars[d.calendar]=g)},b.$on("$destroy",function(){b.destroyCalendar()}),j.onAdded=function(b){g&&g.fullCalendar&&(g.fullCalendar(l),d.calendar&&(a.calendars[d.calendar]=g),g.fullCalendar("addEventSource",b),i=!0)},j.onRemoved=function(a){g&&g.fullCalendar&&(g.fullCalendar("removeEventSource",a),i=!0)},j.onChanged=function(){g&&g.fullCalendar&&(g.fullCalendar("refetchEvents"),i=!0)},k.onAdded=function(a){g&&g.fullCalendar&&g.fullCalendar("renderEvent",a,!!a.stick)},k.onRemoved=function(a){g&&g.fullCalendar&&g.fullCalendar("removeEvents",a._id)},k.onChanged=function(a){if(g&&g.fullCalendar)for(var b=g.fullCalendar("clientEvents",a._id),c=0;c<b.length;c++){var d=b[c];d=angular.extend(d,a),g.fullCalendar("updateEvent",d)}},j.subscribe(b),k.subscribe(b,function(){return i===!0?(i=!1,!1):void 0}),b.$watch(f,function(a,c){a!==c?(b.destroyCalendar(),b.initCalendar()):a&&angular.isUndefined(g)&&b.initCalendar()})}}}]),function(a,b){"undefined"!=typeof module&&module.exports?(b("undefined"==typeof angular?require("angular"):angular),module.exports="ngDialog"):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(this,function(a){"use strict";var b=a.module("ngDialog",[]),c=a.element,d=a.isDefined,e=(document.body||document.documentElement).style,f=d(e.animation)||d(e.WebkitAnimation)||d(e.MozAnimation)||d(e.MsAnimation)||d(e.OAnimation),g="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",h="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",i="ngdialog-disabled-animation",j={html:!1,body:!1},k={},l=[],m=!1,n=!1;return b.provider("ngDialog",function(){var b=this.defaults={className:"ngdialog-theme-default",appendClassName:"",disableAnimation:!1,plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,overlay:!0,cache:!0,trapFocus:!0,preserveFocus:!0,ariaAuto:!0,ariaRole:null,ariaLabelledById:null,ariaLabelledBySelector:null,ariaDescribedById:null,ariaDescribedBySelector:null,bodyClassName:"ngdialog-open"};this.setForceHtmlReload=function(a){j.html=a||!1},this.setForceBodyReload=function(a){j.body=a||!1},this.setDefaults=function(c){a.extend(b,c)},this.setOpenOnePerName=function(a){n=a||!1};var d,e=0,o=0,p={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller","$injector",function(q,r,s,t,u,v,w,x,y,z){var A=[],B={onDocumentKeydown:function(a){27===a.keyCode&&C.close("$escape")},activate:function(a){var b=a.data("$ngDialogOptions");b.trapFocus&&(a.on("keydown",B.onTrapFocusKeydown),A.body.on("keydown",B.onTrapFocusKeydown))},deactivate:function(a){a.off("keydown",B.onTrapFocusKeydown),A.body.off("keydown",B.onTrapFocusKeydown)},deactivateAll:function(b){a.forEach(b,function(b){var c=a.element(b);B.deactivate(c)})},setBodyPadding:function(a){var b=parseInt(A.body.css("padding-right")||0,10);A.body.css("padding-right",b+a+"px"),A.body.data("ng-dialog-original-padding",b),v.$broadcast("ngDialog.setPadding",a)},resetBodyPadding:function(){var a=A.body.data("ng-dialog-original-padding");a?A.body.css("padding-right",a+"px"):A.body.css("padding-right",""),v.$broadcast("ngDialog.setPadding",0)},performCloseDialog:function(a,b){var c=a.data("$ngDialogOptions"),e=a.attr("id"),h=k[e];if(h){if("undefined"!=typeof x.Hammer){var i=h.hammerTime;i.off("tap",d),i.destroy&&i.destroy(),delete h.hammerTime}else a.unbind("click");1===o&&A.body.unbind("keydown",B.onDocumentKeydown),a.hasClass("ngdialog-closing")||(o-=1);var j=a.data("$ngDialogPreviousFocus");j&&j.focus&&j.focus(),v.$broadcast("ngDialog.closing",a,b),o=0>o?0:o,f&&!c.disableAnimation?(h.$destroy(),a.unbind(g).bind(g,function(){B.closeDialogElement(a,b)}).addClass("ngdialog-closing")):(h.$destroy(),B.closeDialogElement(a,b)),p[e]&&(p[e].resolve({id:e,value:b,$dialog:a,remainingDialogs:o}),delete p[e]),k[e]&&delete k[e],l.splice(l.indexOf(e),1),l.length||(A.body.unbind("keydown",B.onDocumentKeydown),m=!1)}},closeDialogElement:function(a,b){var c=a.data("$ngDialogOptions");a.remove(),0===o&&(A.html.removeClass(c.bodyClassName),A.body.removeClass(c.bodyClassName),B.resetBodyPadding()),v.$broadcast("ngDialog.closed",a,b)},closeDialog:function(b,c){var d=b.data("$ngDialogPreCloseCallback");if(d&&a.isFunction(d)){var e=d.call(b,c);a.isObject(e)?e.closePromise?e.closePromise.then(function(){B.performCloseDialog(b,c)}):e.then(function(){B.performCloseDialog(b,c)},function(){}):e!==!1&&B.performCloseDialog(b,c)}else B.performCloseDialog(b,c)},onTrapFocusKeydown:function(b){var c,d=a.element(b.currentTarget);if(d.hasClass("ngdialog"))c=d;else if(c=B.getActiveDialog(),null===c)return;var e=9===b.keyCode,f=b.shiftKey===!0;e&&B.handleTab(c,b,f)},handleTab:function(a,b,c){var d=B.getFocusableElements(a);if(0===d.length)return void(document.activeElement&&document.activeElement.blur());var e=document.activeElement,f=Array.prototype.indexOf.call(d,e),g=-1===f,h=0===f,i=f===d.length-1,j=!1;c?(g||h)&&(d[d.length-1].focus(),j=!0):(g||i)&&(d[0].focus(),j=!0),j&&(b.preventDefault(),b.stopPropagation())},autoFocus:function(a){var b=a[0],d=b.querySelector("*[autofocus]");if(null===d||(d.focus(),document.activeElement!==d)){var e=B.getFocusableElements(a);if(e.length>0)return void e[0].focus();var f=B.filterVisibleElements(b.querySelectorAll("h1,h2,h3,h4,h5,h6,p,span"));if(f.length>0){var g=f[0];c(g).attr("tabindex","-1").css("outline","0"),g.focus()}}},getFocusableElements:function(a){var b=a[0],c=b.querySelectorAll(h),d=B.filterTabbableElements(c);return B.filterVisibleElements(d)},filterTabbableElements:function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d];"-1"!==c(e).attr("tabindex")&&b.push(e)}return b},filterVisibleElements:function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];(d.offsetWidth>0||d.offsetHeight>0)&&b.push(d)}return b},getActiveDialog:function(){var a=document.querySelectorAll(".ngdialog");return 0===a.length?null:c(a[a.length-1])},applyAriaAttributes:function(a,b){if(b.ariaAuto){if(!b.ariaRole){var c=B.getFocusableElements(a).length>0?"dialog":"alertdialog";b.ariaRole=c}b.ariaLabelledBySelector||(b.ariaLabelledBySelector="h1,h2,h3,h4,h5,h6"),b.ariaDescribedBySelector||(b.ariaDescribedBySelector="article,section,p")}b.ariaRole&&a.attr("role",b.ariaRole),B.applyAriaAttribute(a,"aria-labelledby",b.ariaLabelledById,b.ariaLabelledBySelector),B.applyAriaAttribute(a,"aria-describedby",b.ariaDescribedById,b.ariaDescribedBySelector)},applyAriaAttribute:function(a,b,d,e){if(d&&a.attr(b,d),e){var f=a.attr("id"),g=a[0].querySelector(e);if(!g)return;var h=f+"-"+b;return c(g).attr("id",h),a.attr(b,h),h}},detectUIRouter:function(){try{return a.module("ui.router"),!0}catch(b){return!1}},getRouterLocationEventName:function(){return B.detectUIRouter()?"$stateChangeSuccess":"$locationChangeSuccess"}},C={__PRIVATE__:B,open:function(f){function g(a,b){return v.$broadcast("ngDialog.templateLoading",a),u.get(a,b||{}).then(function(b){return v.$broadcast("ngDialog.templateLoaded",a),b.data||""})}function h(b){return b?a.isString(b)&&q.plain?b:"boolean"!=typeof q.cache||q.cache?g(b,{cache:r}):g(b,{cache:!1}):"Empty template"}var j=null;if(f=f||{},!(n&&f.name&&(j=f.name+" dialog",this.isOpen(j)))){var q=a.copy(b),D=++e;j=j||"ngdialog"+D,l.push(j),"undefined"!=typeof q.data&&("undefined"==typeof f.data&&(f.data={}),f.data=a.merge(a.copy(q.data),f.data)),a.extend(q,f);var E;p[j]=E=t.defer();var F;k[j]=F=a.isObject(q.scope)?q.scope.$new():v.$new();var G,H,I=a.extend({},q.resolve);return a.forEach(I,function(b,c){I[c]=a.isString(b)?z.get(b):z.invoke(b,null,null,c)}),t.all({template:h(q.template||q.templateUrl),locals:t.all(I)}).then(function(b){var e=b.template,f=b.locals;q.showClose&&(e+='<div class="ngdialog-close"></div>');var g=q.overlay?"":" ngdialog-no-overlay";if(G=c('<div id="'+j+'" class="ngdialog'+g+'"></div>'),G.html(q.overlay?'<div class="ngdialog-overlay"></div><div class="ngdialog-content" role="document">'+e+"</div>":'<div class="ngdialog-content" role="document">'+e+"</div>"),G.data("$ngDialogOptions",q),F.ngDialogId=j,q.data&&a.isString(q.data)){var h=q.data.replace(/^\s*/,"")[0];F.ngDialogData="{"===h||"["===h?a.fromJson(q.data):new String(q.data),F.ngDialogData.ngDialogId=j}else q.data&&a.isObject(q.data)&&(F.ngDialogData=q.data,F.ngDialogData.ngDialogId=j);if(q.className&&G.addClass(q.className),q.appendClassName&&G.addClass(q.appendClassName),q.disableAnimation&&G.addClass(i),H=q.appendTo&&a.isString(q.appendTo)?a.element(document.querySelector(q.appendTo)):A.body,B.applyAriaAttributes(G,q),q.preCloseCallback){var k;a.isFunction(q.preCloseCallback)?k=q.preCloseCallback:a.isString(q.preCloseCallback)&&F&&(a.isFunction(F[q.preCloseCallback])?k=F[q.preCloseCallback]:F.$parent&&a.isFunction(F.$parent[q.preCloseCallback])?k=F.$parent[q.preCloseCallback]:v&&a.isFunction(v[q.preCloseCallback])&&(k=v[q.preCloseCallback])),k&&G.data("$ngDialogPreCloseCallback",k)}if(F.closeThisDialog=function(a){B.closeDialog(G,a)},q.controller&&(a.isString(q.controller)||a.isArray(q.controller)||a.isFunction(q.controller))){var l;q.controllerAs&&a.isString(q.controllerAs)&&(l=q.controllerAs);var n=y(q.controller,a.extend(f,{$scope:F,$element:G}),!0,l);q.bindToController&&a.extend(n.instance,{ngDialogId:F.ngDialogId,ngDialogData:F.ngDialogData,closeThisDialog:F.closeThisDialog}),G.data("$ngDialogControllerController",n())}if(w(function(){var a=document.querySelectorAll(".ngdialog");B.deactivateAll(a),s(G)(F);var b=x.innerWidth-A.body.prop("clientWidth");A.html.addClass(q.bodyClassName),A.body.addClass(q.bodyClassName);var c=b-(x.innerWidth-A.body.prop("clientWidth"));c>0&&B.setBodyPadding(c),H.append(G),B.activate(G),q.trapFocus&&B.autoFocus(G),q.name?v.$broadcast("ngDialog.opened",{dialog:G,name:q.name}):v.$broadcast("ngDialog.opened",G)}),m||(A.body.bind("keydown",B.onDocumentKeydown),m=!0),q.closeByNavigation){var p=B.getRouterLocationEventName();v.$on(p,function(){B.closeDialog(G)})}if(q.preserveFocus&&G.data("$ngDialogPreviousFocus",document.activeElement),d=function(a){var b=q.closeByDocument?c(a.target).hasClass("ngdialog-overlay"):!1,d=c(a.target).hasClass("ngdialog-close");(b||d)&&C.close(G.attr("id"),d?"$closeButton":"$document")},"undefined"!=typeof x.Hammer){var r=F.hammerTime=x.Hammer(G[0]);r.on("tap",d)}else G.bind("click",d);return o+=1,C}),{id:j,closePromise:E.promise,close:function(a){B.closeDialog(G,a)}}}},openConfirm:function(d){var e=t.defer(),f=a.copy(b);d=d||{},"undefined"!=typeof f.data&&("undefined"==typeof d.data&&(d.data={}),d.data=a.merge(a.copy(f.data),d.data)),a.extend(f,d),f.scope=a.isObject(f.scope)?f.scope.$new():v.$new(),f.scope.confirm=function(a){e.resolve(a);var b=c(document.getElementById(g.id));B.performCloseDialog(b,a)};var g=C.open(f);return g?(g.closePromise.then(function(a){return a?e.reject(a.value):e.reject()}),e.promise):void 0},isOpen:function(a){var b=c(document.getElementById(a));return b.length>0},close:function(a,b){var d=c(document.getElementById(a));if(d.length)B.closeDialog(d,b);else if("$escape"===a){var e=l[l.length-1];d=c(document.getElementById(e)),d.data("$ngDialogOptions").closeByEscape&&B.closeDialog(d,"$escape")}else C.closeAll(b);return C},closeAll:function(a){for(var b=document.querySelectorAll(".ngdialog"),d=b.length-1;d>=0;d--){var e=b[d];B.closeDialog(c(e),a)}},getOpenDialogs:function(){return l},getDefaults:function(){return b}};return a.forEach(["html","body"],function(a){if(A[a]=q.find(a),j[a]){var b=B.getRouterLocationEventName();v.$on(b,function(){A[a]=q.find(a)})}}),C}]}),b.directive("ngDialog",["ngDialog",function(b){return{restrict:"A",scope:{ngDialogScope:"="},link:function(c,d,e){d.on("click",function(d){d.preventDefault();var f=a.isDefined(c.ngDialogScope)?c.ngDialogScope:"noScope";a.isDefined(e.ngDialogClosePrevious)&&b.close(e.ngDialogClosePrevious);var g=b.getDefaults();b.open({template:e.ngDialog,className:e.ngDialogClass||g.className,appendClassName:e.ngDialogAppendClass,controller:e.ngDialogController,controllerAs:e.ngDialogControllerAs,bindToController:e.ngDialogBindToController,scope:f,data:e.ngDialogData,showClose:"false"===e.ngDialogShowClose?!1:"true"===e.ngDialogShowClose?!0:g.showClose,closeByDocument:"false"===e.ngDialogCloseByDocument?!1:"true"===e.ngDialogCloseByDocument?!0:g.closeByDocument,closeByEscape:"false"===e.ngDialogCloseByEscape?!1:"true"===e.ngDialogCloseByEscape?!0:g.closeByEscape,overlay:"false"===e.ngDialogOverlay?!1:"true"===e.ngDialogOverlay?!0:g.overlay,preCloseCallback:e.ngDialogPreCloseCallback||g.preCloseCallback,bodyClassName:e.ngDialogBodyClass||g.bodyClassName})})}}}]),b}),function(a,b,c){function d(b,c){if(a.isArray(b)){for(var d=b.length-1;d>=0;d--){var e=b[d];"string"===a.type(e)&&i.transports[e]||(c.log("Invalid transport: "+e+", removing it from the transports list."),b.splice(d,1))}0===b.length&&(c.log("No transports remain within the specified transport array."),b=null)}else if(i.transports[b]||"auto"===b){if("auto"===b&&i._.ieVersion<=8)return["longPolling"]}else c.log("Invalid transport: "+b.toString()+"."),b=null;return b}function e(a){return"http:"===a?80:"https:"===a?443:void 0}function f(a,b){return b.match(/:\d+$/)?b:b+":"+e(a)}function g(b,c){var d=this,e=[];d.tryBuffer=function(c){return b.state===a.signalR.connectionState.connecting?(e.push(c),!0):!1},d.drain=function(){if(b.state===a.signalR.connectionState.connected)for(;e.length>0;)c(e.shift())},d.clear=function(){e=[]}}var h={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.", 63 sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if("function"!=typeof a)throw new Error(h.nojQuery);var i,j,k="complete"===b.document.readyState,l=a(b),m="__Negotiate Aborted__",n={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},o={processData:!0,timeout:null,async:!0,global:!1,cache:!1},p=function(a,c){if(c!==!1){var d;"undefined"!=typeof b.console&&(d="["+(new Date).toTimeString()+"] SignalR: "+a,b.console.debug?b.console.debug(d):b.console.log&&b.console.log(d))}},q=function(b,c,d){return c===b.state?(b.state=d,a(b).triggerHandler(n.onStateChanged,[{oldState:c,newState:d}]),!0):!1},r=function(a){return a.state===i.connectionState.disconnected},s=function(a){return a._.keepAliveData.activated&&a.transport.supportsKeepAlive(a)},t=function(c){var d,e;c._.configuredStopReconnectingTimeout||(e=function(b){var c=i._.format(i.resources.reconnectTimeout,b.disconnectTimeout);b.log(c),a(b).triggerHandler(n.onError,[i._.error(c,"TimeoutException")]),b.stop(!1,!1)},c.reconnecting(function(){var a=this;a.state===i.connectionState.reconnecting&&(d=b.setTimeout(function(){e(a)},a.disconnectTimeout))}),c.stateChanged(function(a){a.oldState===i.connectionState.reconnecting&&b.clearTimeout(d)}),c._.configuredStopReconnectingTimeout=!0)};i=function(a,b,c){return new i.fn.init(a,b,c)},i._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var a,c;return"Microsoft Internet Explorer"===b.navigator.appName&&(c=/MSIE ([0-9]+\.[0-9]+)/.exec(b.navigator.userAgent),c&&(a=b.parseFloat(c[1]))),a}(),error:function(a,b,c){var d=new Error(a);return d.source=b,"undefined"!=typeof c&&(d.context=c),d},transportError:function(a,b,d,e){var f=this.error(a,d,e);return f.transport=b?b.name:c,f},format:function(){for(var a=arguments[0],b=0;b<arguments.length-1;b++)a=a.replace("{"+b+"}",arguments[b+1]);return a},firefoxMajorVersion:function(a){var b=a.match(/Firefox\/(\d+)/);return!b||!b.length||b.length<2?0:parseInt(b[1],10)},configurePingInterval:function(c){var d=c._.config,e=function(b){a(c).triggerHandler(n.onError,[b])};d&&!c._.pingIntervalId&&d.pingInterval&&(c._.pingIntervalId=b.setInterval(function(){i.transports._logic.pingServer(c).fail(e)},d.pingInterval))}},i.events=n,i.resources=h,i.ajaxDefaults=o,i.changeState=q,i.isDisconnecting=r,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'></script>.")}},l.load(function(){k=!0}),i.fn=i.prototype={init:function(b,c,d){var e=a(this);this.url=b,this.qs=c,this.lastError=null,this._={keepAliveData:{},connectingMessageBuffer:new g(this,function(a){e.triggerHandler(n.onReceived,[a])}),lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0},"boolean"==typeof d&&(this.logging=d)},_parseResponse:function(a){var b=this;return a&&"string"==typeof a?b.json.parse(a):a},_originalJson:b.JSON,json:b.JSON,isCrossDomain:function(c,d){var e;return c=a.trim(c),d=d||b.location,0!==c.indexOf("http")?!1:(e=b.document.createElement("a"),e.href=c,e.protocol+f(e.protocol,e.host)!==d.protocol+f(d.protocol,d.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:i.connectionState.disconnected,clientProtocol:"1.5",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(c,e){var f,g=this,j={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},o=g._deferral||a.Deferred(),p=b.document.createElement("a");if(g.lastError=null,g._deferral=o,!g.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if("function"===a.type(c)?e=c:"object"===a.type(c)&&(a.extend(j,c),"function"===a.type(j.callback)&&(e=j.callback)),j.transport=d(j.transport,g),!j.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");if(g._.config=j,!k&&j.waitForPageLoad===!0)return g._.deferredStartHandler=function(){g.start(c,e)},l.bind("load",g._.deferredStartHandler),o.promise();if(g.state===i.connectionState.connecting)return o.promise();if(q(g,i.connectionState.disconnected,i.connectionState.connecting)===!1)return o.resolve(g),o.promise();t(g),p.href=g.url,p.protocol&&":"!==p.protocol?(g.protocol=p.protocol,g.host=p.host):(g.protocol=b.document.location.protocol,g.host=p.host||b.document.location.host),g.baseUrl=g.protocol+"//"+g.host,g.wsProtocol="https:"===g.protocol?"wss://":"ws://","auto"===j.transport&&j.jsonp===!0&&(j.transport="longPolling"),0===g.url.indexOf("//")&&(g.url=b.location.protocol+g.url,g.log("Protocol relative URL detected, normalizing it to '"+g.url+"'.")),this.isCrossDomain(g.url)&&(g.log("Auto detected cross domain url."),"auto"===j.transport&&(j.transport=["webSockets","serverSentEvents","longPolling"]),"undefined"==typeof j.withCredentials&&(j.withCredentials=!0),j.jsonp||(j.jsonp=!a.support.cors,j.jsonp&&g.log("Using jsonp because this browser doesn't support CORS.")),g.contentType=i._.defaultContentType),g.withCredentials=j.withCredentials,g.ajaxDataType=j.jsonp?"jsonp":"text",a(g).bind(n.onStart,function(b,c){"function"===a.type(e)&&e.call(g),o.resolve(g)}),g._.initHandler=i.transports._logic.initHandler(g),f=function(c,d){var e=i._.error(h.noTransportOnInit);if(d=d||0,d>=c.length)return 0===d?g.log("No transports supported by the server were selected."):1===d?g.log("No fallback transports were selected."):g.log("Fallback transports exhausted."),a(g).triggerHandler(n.onError,[e]),o.reject(e),void g.stop();if(g.state!==i.connectionState.disconnected){var j=c[d],k=i.transports[j],m=function(){f(c,d+1)};g.transport=k;try{g._.initHandler.start(k,function(){var c=i._.firefoxMajorVersion(b.navigator.userAgent)>=11,d=!!g.withCredentials&&c;g.log("The start request succeeded. Transitioning to the connected state."),s(g)&&i.transports._logic.monitorKeepAlive(g),i.transports._logic.startHeartbeat(g),i._.configurePingInterval(g),q(g,i.connectionState.connecting,i.connectionState.connected)||g.log("WARNING! The connection was not in the connecting state."),g._.connectingMessageBuffer.drain(),a(g).triggerHandler(n.onStart),l.bind("unload",function(){g.log("Window unloading, stopping the connection."),g.stop(d)}),c&&l.bind("beforeunload",function(){b.setTimeout(function(){g.stop(d)},0)})},m)}catch(p){g.log(k.name+" transport threw '"+p.message+"' when attempting to start."),m()}}};var r=g.url+"/negotiate",u=function(b,c){var d=i._.error(h.errorOnNegotiate,b,c._.negotiateRequest);a(c).triggerHandler(n.onError,d),o.reject(d),c.stop()};return a(g).triggerHandler(n.onStarting),r=i.transports._logic.prepareQueryString(g,r),g.log("Negotiating with '"+r+"'."),g._.negotiateRequest=i.transports._logic.ajax(g,{url:r,error:function(a,b){b!==m?u(a,g):o.reject(i._.error(h.stoppedWhileNegotiating,null,g._.negotiateRequest))},success:function(b){var c,d,e,k=[],l=[];try{c=g._parseResponse(b)}catch(m){return void u(i._.error(h.errorParsingNegotiateResponse,m),g)}return d=g._.keepAliveData,g.appRelativeUrl=c.Url,g.id=c.ConnectionId,g.token=c.ConnectionToken,g.webSocketServerUrl=c.WebSocketServerUrl,g._.pollTimeout=1e3*c.ConnectionTimeout+1e4,g.disconnectTimeout=1e3*c.DisconnectTimeout,g._.totalTransportConnectTimeout=g.transportConnectTimeout+1e3*c.TransportConnectTimeout,c.KeepAliveTimeout?(d.activated=!0,d.timeout=1e3*c.KeepAliveTimeout,d.timeoutWarning=d.timeout*g.keepAliveWarnAt,g._.beatInterval=(d.timeout-d.timeoutWarning)/3):d.activated=!1,g.reconnectWindow=g.disconnectTimeout+(d.timeout||0),c.ProtocolVersion&&c.ProtocolVersion===g.clientProtocol?(a.each(i.transports,function(a){return 0===a.indexOf("_")||"webSockets"===a&&!c.TryWebSockets?!0:void l.push(a)}),a.isArray(j.transport)?a.each(j.transport,function(b,c){a.inArray(c,l)>=0&&k.push(c)}):"auto"===j.transport?k=l:a.inArray(j.transport,l)>=0&&k.push(j.transport),void f(k)):(e=i._.error(i._.format(h.protocolIncompatible,g.clientProtocol,c.ProtocolVersion)),a(g).triggerHandler(n.onError,[e]),void o.reject(e))}}),o.promise()},starting:function(b){var c=this;return a(c).bind(n.onStarting,function(a,d){b.call(c)}),c},send:function(a){var b=this;if(b.state===i.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(b.state===i.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return b.transport.send(b,a),b},received:function(b){var c=this;return a(c).bind(n.onReceived,function(a,d){b.call(c,d)}),c},stateChanged:function(b){var c=this;return a(c).bind(n.onStateChanged,function(a,d){b.call(c,d)}),c},error:function(b){var c=this;return a(c).bind(n.onError,function(a,d,e){c.lastError=d,b.call(c,d,e)}),c},disconnected:function(b){var c=this;return a(c).bind(n.onDisconnect,function(a,d){b.call(c)}),c},connectionSlow:function(b){var c=this;return a(c).bind(n.onConnectionSlow,function(a,d){b.call(c)}),c},reconnecting:function(b){var c=this;return a(c).bind(n.onReconnecting,function(a,d){b.call(c)}),c},reconnected:function(b){var c=this;return a(c).bind(n.onReconnect,function(a,d){b.call(c)}),c},stop:function(c,d){var e=this,f=e._deferral;return e._.deferredStartHandler&&l.unbind("load",e._.deferredStartHandler),delete e._.config,delete e._.deferredStartHandler,k||e._.config&&e._.config.waitForPageLoad!==!0?e.state!==i.connectionState.disconnected?(e.log("Stopping connection."),q(e,e.state,i.connectionState.disconnected),b.clearTimeout(e._.beatHandle),b.clearInterval(e._.pingIntervalId),e.transport&&(e.transport.stop(e),d!==!1&&e.transport.abort(e,c),s(e)&&i.transports._logic.stopMonitoringKeepAlive(e),e.transport=null),e._.negotiateRequest&&(e._.negotiateRequest.abort(m),delete e._.negotiateRequest),e._.initHandler&&e._.initHandler.stop(),a(e).triggerHandler(n.onDisconnect),delete e._deferral,delete e.messageId,delete e.groupsToken,delete e.id,delete e._.pingIntervalId,delete e._.lastMessageAt,delete e._.lastActiveAt,e._.connectingMessageBuffer.clear(),e):void 0:(e.log("Stopping connection prior to negotiate."),void(f&&f.reject(i._.error(h.stoppedWhileLoading))))},log:function(a){p(a,this.logging)}},i.fn.init.prototype=i.fn,i.noConflict=function(){return a.connection===i&&(a.connection=j),i},a.connection&&(j=a.connection),a.connection=a.signalR=i}(window.jQuery,window),function(a,b,c){function d(a){a._.keepAliveData.monitoring&&e(a),h.markActive(a)&&(a._.beatHandle=b.setTimeout(function(){d(a)},a._.beatInterval))}function e(b){var c,d=b._.keepAliveData;b.state===i.connectionState.connected&&(c=(new Date).getTime()-b._.lastMessageAt,c>=d.timeout?(b.log("Keep alive timed out. Notifying transport that connection has been lost."),b.transport.lostConnection(b)):c>=d.timeoutWarning?d.userNotified||(b.log("Keep alive has been missed, connection may be dead/slow."),a(b).triggerHandler(j.onConnectionSlow),d.userNotified=!0):d.userNotified=!1)}function f(a,b){var c=a.url+b;return a.transport&&(c+="?transport="+a.transport.name),h.prepareQueryString(a,c)}function g(a){this.connection=a,this.startRequested=!1,this.startCompleted=!1,this.connectionStopped=!1}var h,i=a.signalR,j=a.signalR.events,k=a.signalR.changeState,l="__Start Aborted__";i.transports={},g.prototype={start:function(a,d,e){var f=this,g=f.connection,h=!1;return f.startRequested||f.connectionStopped?void g.log("WARNING! "+a.name+" transport cannot be started. Initialization ongoing or completed."):(g.log(a.name+" transport starting."),f.transportTimeoutHandle=b.setTimeout(function(){h||(h=!0,g.log(a.name+" transport timed out when trying to connect."),f.transportFailed(a,c,e))},g._.totalTransportConnectTimeout),void a.start(g,function(){h||f.initReceived(a,d)},function(b){return h||(h=!0,f.transportFailed(a,b,e)),!f.startCompleted||f.connectionStopped}))},stop:function(){this.connectionStopped=!0,b.clearTimeout(this.transportTimeoutHandle),i.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(a,c){var d=this,e=d.connection;return d.startRequested?void e.log("WARNING! The client received multiple init messages."):void(d.connectionStopped||(d.startRequested=!0,b.clearTimeout(d.transportTimeoutHandle),e.log(a.name+" transport connected. Initiating start request."),i.transports._logic.ajaxStart(e,function(){d.startCompleted=!0,c()})))},transportFailed:function(c,d,e){var f,g=this.connection,h=g._deferral;this.connectionStopped||(b.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||(f=i._.error(i.resources.errorDuringStartRequest,d),g.log(c.name+" transport failed during the start request. Stopping the connection."),a(g).triggerHandler(j.onError,[f]),h&&h.reject(f),g.stop()):(c.stop(g),g.log(c.name+" transport failed to connect. Attempting to fall back."),e()))}},h=i.transports._logic={ajax:function(b,c){return a.ajax(a.extend(!0,{},a.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:b.withCredentials},contentType:b.contentType,dataType:b.ajaxDataType},c))},pingServer:function(b){var c,d,e=a.Deferred();return b.transport?(c=b.url+"/ping",c=h.addQs(c,b.qs),d=h.ajax(b,{url:c,success:function(a){var c;try{c=b._parseResponse(a)}catch(f){return e.reject(i._.transportError(i.resources.pingServerFailedParse,b.transport,f,d)),void b.stop()}"pong"===c.Response?e.resolve():e.reject(i._.transportError(i._.format(i.resources.pingServerFailedInvalidResponse,a),b.transport,null,d))},error:function(a){401===a.status||403===a.status?(e.reject(i._.transportError(i._.format(i.resources.pingServerFailedStatusCode,a.status),b.transport,a,d)),b.stop()):e.reject(i._.transportError(i.resources.pingServerFailed,b.transport,a,d))}})):e.reject(i._.transportError(i.resources.noConnectionTransport,b.transport)),e.promise()},prepareQueryString:function(a,c){var d;return d=h.addQs(c,"clientProtocol="+a.clientProtocol),d=h.addQs(d,a.qs),a.token&&(d+="&connectionToken="+b.encodeURIComponent(a.token)),a.data&&(d+="&connectionData="+b.encodeURIComponent(a.data)),d},addQs:function(b,c){var d,e=-1!==b.indexOf("?")?"&":"?";if(!c)return b;if("object"==typeof c)return b+e+a.param(c);if("string"==typeof c)return d=c.charAt(0),"?"!==d&&"&"!==d||(e=""),b+e+c;throw new Error("Query string property must be either a string or object.")},getUrl:function(a,c,d,e,f){var g="webSockets"===c?"":a.baseUrl,i=g+a.appRelativeUrl,j="transport="+c;return!f&&a.groupsToken&&(j+="&groupsToken="+b.encodeURIComponent(a.groupsToken)),d?(i+=e?"/poll":"/reconnect",!f&&a.messageId&&(j+="&messageId="+b.encodeURIComponent(a.messageId))):i+="/connect",i+="?"+j,i=h.prepareQueryString(a,i),f||(i+="&tid="+Math.floor(11*Math.random())),i},maximizePersistentResponse:function(a){return{MessageId:a.C,Messages:a.M,Initialized:"undefined"!=typeof a.S,ShouldReconnect:"undefined"!=typeof a.T,LongPollDelay:a.L,GroupsToken:a.G}},updateGroups:function(a,b){b&&(a.groupsToken=b)},stringifySend:function(a,b){return"string"==typeof b||"undefined"==typeof b||null===b?b:a.json.stringify(b)},ajaxSend:function(b,c){var d,e=h.stringifySend(b,c),g=f(b,"/send"),k=function(b,e){a(e).triggerHandler(j.onError,[i._.transportError(i.resources.sendFailed,e.transport,b,d),c])};return d=h.ajax(b,{url:g,type:"jsonp"===b.ajaxDataType?"GET":"POST",contentType:i._.defaultContentType,data:{data:e},success:function(a){var c;if(a){try{c=b._parseResponse(a)}catch(d){return k(d,b),void b.stop()}h.triggerReceived(b,c)}},error:function(a,c){"abort"!==c&&"parsererror"!==c&&k(a,b)}})},ajaxAbort:function(a,b){if("undefined"!=typeof a.transport){b="undefined"==typeof b?!0:b;var c=f(a,"/abort");h.ajax(a,{url:c,async:b,timeout:1e3,type:"POST"}),a.log("Fired ajax abort async = "+b+".")}},ajaxStart:function(b,c){var d=function(a){var c=b._deferral;c&&c.reject(a)},e=function(c){b.log("The start request failed. Stopping the connection."),a(b).triggerHandler(j.onError,[c]),d(c),b.stop()};b._.startRequest=h.ajax(b,{url:f(b,"/start"),success:function(a,d,f){var g;try{g=b._parseResponse(a)}catch(h){return void e(i._.error(i._.format(i.resources.errorParsingStartResponse,a),h,f))}"started"===g.Response?c():e(i._.error(i._.format(i.resources.invalidStartResponse,a),null,f))},error:function(a,c,f){c!==l?e(i._.error(i.resources.errorDuringStartRequest,f,a)):(b.log("The start request aborted because connection.stop() was called."),d(i._.error(i.resources.stoppedDuringStartRequest,null,a)))}})},tryAbortStartRequest:function(a){a._.startRequest&&(a._.startRequest.abort(l),delete a._.startRequest)},tryInitialize:function(a,b){a.Initialized&&b()},triggerReceived:function(b,c){b._.connectingMessageBuffer.tryBuffer(c)||a(b).triggerHandler(j.onReceived,[c])},processMessages:function(b,c,d){var e;h.markLastMessage(b),c&&(e=h.maximizePersistentResponse(c),h.updateGroups(b,e.GroupsToken),e.MessageId&&(b.messageId=e.MessageId),e.Messages&&(a.each(e.Messages,function(a,c){h.triggerReceived(b,c)}),h.tryInitialize(e,d)))},monitorKeepAlive:function(b){var c=b._.keepAliveData;c.monitoring?b.log("Tried to monitor keep alive but it's already being monitored."):(c.monitoring=!0,h.markLastMessage(b),b._.keepAliveData.reconnectKeepAliveUpdate=function(){h.markLastMessage(b)},a(b).bind(j.onReconnect,b._.keepAliveData.reconnectKeepAliveUpdate),b.log("Now monitoring keep alive with a warning timeout of "+c.timeoutWarning+", keep alive timeout of "+c.timeout+" and disconnecting timeout of "+b.disconnectTimeout))},stopMonitoringKeepAlive:function(b){var c=b._.keepAliveData;c.monitoring&&(c.monitoring=!1,a(b).unbind(j.onReconnect,b._.keepAliveData.reconnectKeepAliveUpdate),b._.keepAliveData={},b.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(a){a._.lastActiveAt=(new Date).getTime(),d(a)},markLastMessage:function(a){a._.lastMessageAt=(new Date).getTime()},markActive:function(a){return h.verifyLastActive(a)?(a._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(a){return a.state===i.connectionState.connected||a.state===i.connectionState.reconnecting},ensureReconnectingState:function(b){return k(b,i.connectionState.connected,i.connectionState.reconnecting)===!0&&a(b).triggerHandler(j.onReconnecting),b.state===i.connectionState.reconnecting},clearReconnectTimeout:function(a){a&&a._.reconnectTimeout&&(b.clearTimeout(a._.reconnectTimeout),delete a._.reconnectTimeout)},verifyLastActive:function(b){if((new Date).getTime()-b._.lastActiveAt>=b.reconnectWindow){var c=i._.format(i.resources.reconnectWindowTimeout,new Date(b._.lastActiveAt),b.reconnectWindow);return b.log(c),a(b).triggerHandler(j.onError,[i._.error(c,"TimeoutException")]),b.stop(!1,!1),!1}return!0},reconnect:function(a,c){var d=i.transports[c];if(h.isConnectedOrReconnecting(a)&&!a._.reconnectTimeout){if(!h.verifyLastActive(a))return;a._.reconnectTimeout=b.setTimeout(function(){h.verifyLastActive(a)&&(d.stop(a),h.ensureReconnectingState(a)&&(a.log(c+" reconnecting."),d.start(a)))},a.reconnectDelay)}},handleParseFailure:function(b,c,d,e,f){var g=i._.transportError(i._.format(i.resources.parseFailed,c),b.transport,d,f);e&&e(g)?b.log("Failed to parse server response while attempting to connect."):(a(b).triggerHandler(j.onError,[g]),b.stop())},initHandler:function(a){return new g(a)},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=d.transports._logic;d.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(b,c){var f=g.stringifySend(b,c);try{b.socket.send(f)}catch(h){a(b).triggerHandler(e.onError,[d._.transportError(d.resources.webSocketsInvalidState,b.transport,h,b.socket),c])}},start:function(c,h,i){var j,k=!1,l=this,m=!h,n=a(c);return b.WebSocket?void(c.socket||(j=c.webSocketServerUrl?c.webSocketServerUrl:c.wsProtocol+c.host,j+=g.getUrl(c,this.name,m),c.log("Connecting to websocket endpoint '"+j+"'."),c.socket=new b.WebSocket(j),c.socket.onopen=function(){k=!0,c.log("Websocket opened."),g.clearReconnectTimeout(c),f(c,d.connectionState.reconnecting,d.connectionState.connected)===!0&&n.triggerHandler(e.onReconnect)},c.socket.onclose=function(b){var f;this===c.socket&&(k&&"undefined"!=typeof b.wasClean&&b.wasClean===!1?(f=d._.transportError(d.resources.webSocketClosed,c.transport,b),c.log("Unclean disconnect from websocket: "+(b.reason||"[no reason given]."))):c.log("Websocket closed."),i&&i(f)||(f&&a(c).triggerHandler(e.onError,[f]),l.reconnect(c)))},c.socket.onmessage=function(b){var d;try{d=c._parseResponse(b.data)}catch(e){return void g.handleParseFailure(c,b.data,e,i,b)}d&&(a.isEmptyObject(d)||d.M?g.processMessages(c,d,h):g.triggerReceived(c,d))})):void i()},reconnect:function(a){g.reconnect(a,this.name)},lostConnection:function(a){this.reconnect(a)},stop:function(a){g.clearReconnectTimeout(a),a.socket&&(a.log("Closing the Websocket."),a.socket.close(),a.socket=null)},abort:function(a,b){g.ajaxAbort(a,b)}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=d.transports._logic,h=function(a){b.clearTimeout(a._.reconnectAttemptTimeoutHandle),delete a._.reconnectAttemptTimeoutHandle};d.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(c,i,j){var k,l=this,m=!1,n=a(c),o=!i;if(c.eventSource&&(c.log("The connection already has an event source. Stopping it."),c.stop()),!b.EventSource)return void(j&&(c.log("This browser doesn't support SSE."),j()));k=g.getUrl(c,this.name,o);try{c.log("Attempting to connect to SSE endpoint '"+k+"'."),c.eventSource=new b.EventSource(k,{withCredentials:c.withCredentials})}catch(p){return c.log("EventSource failed trying to connect with error "+p.Message+"."),void(j?j():(n.triggerHandler(e.onError,[d._.transportError(d.resources.eventSourceFailedToConnect,c.transport,p)]),o&&l.reconnect(c)))}o&&(c._.reconnectAttemptTimeoutHandle=b.setTimeout(function(){m===!1&&c.eventSource.readyState!==b.EventSource.OPEN&&l.reconnect(c)},l.timeOut)),c.eventSource.addEventListener("open",function(a){c.log("EventSource connected."),h(c),g.clearReconnectTimeout(c),m===!1&&(m=!0,f(c,d.connectionState.reconnecting,d.connectionState.connected)===!0&&n.triggerHandler(e.onReconnect))},!1),c.eventSource.addEventListener("message",function(a){var b;if("initialized"!==a.data){try{b=c._parseResponse(a.data)}catch(d){return void g.handleParseFailure(c,a.data,d,j,a)}g.processMessages(c,b,i)}},!1),c.eventSource.addEventListener("error",function(a){var f=d._.transportError(d.resources.eventSourceError,c.transport,a);this===c.eventSource&&(j&&j(f)||(c.log("EventSource readyState: "+c.eventSource.readyState+"."),a.eventPhase===b.EventSource.CLOSED?(c.log("EventSource reconnecting due to the server connection ending."),l.reconnect(c)):(c.log("EventSource error."),n.triggerHandler(e.onError,[f]))))},!1)},reconnect:function(a){g.reconnect(a,this.name)},lostConnection:function(a){this.reconnect(a)},send:function(a,b){g.ajaxSend(a,b)},stop:function(a){h(a),g.clearReconnectTimeout(a),a&&a.eventSource&&(a.log("EventSource calling close()."),a.eventSource.close(),a.eventSource=null,delete a.eventSource)},abort:function(a,b){g.ajaxAbort(a,b)}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=d.transports._logic,h=function(){var a=b.document.createElement("iframe");return a.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),a},i=function(){var a=null,c=1e3,e=0;return{prevent:function(){d._.ieVersion<=8&&(0===e&&(a=b.setInterval(function(){var a=h();b.document.body.appendChild(a),b.document.body.removeChild(a),a=null},c)),e++)},cancel:function(){1===e&&b.clearInterval(a),e>0&&e--}}}();d.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(a,c,d){var e,f=this,j=g.foreverFrame.count+=1,k=h(),l=function(){a.log("Forever frame iframe finished loading and is no longer receiving messages."),d&&d()||f.reconnect(a)};return b.EventSource?void(d&&(a.log("Forever Frame is not supported by SignalR on browsers with SSE support."),d())):(k.setAttribute("data-signalr-connection-id",a.id),i.prevent(),e=g.getUrl(a,this.name),e+="&frameId="+j,b.document.documentElement.appendChild(k),a.log("Binding to iframe's load event."),k.addEventListener?k.addEventListener("load",l,!1):k.attachEvent&&k.attachEvent("onload",l),k.src=e,g.foreverFrame.connections[j]=a,a.frame=k,a.frameId=j,void(c&&(a.onSuccess=function(){a.log("Iframe transport started."),c()})))},reconnect:function(a){var c=this;g.isConnectedOrReconnecting(a)&&g.verifyLastActive(a)&&b.setTimeout(function(){if(g.verifyLastActive(a)&&a.frame&&g.ensureReconnectingState(a)){var b=a.frame,d=g.getUrl(a,c.name,!0)+"&frameId="+a.frameId;a.log("Updating iframe src to '"+d+"'."),b.src=d}},a.reconnectDelay)},lostConnection:function(a){this.reconnect(a)},send:function(a,b){g.ajaxSend(a,b)},receive:function(b,c){var e,f,h;if(b.json!==b._originalJson&&(c=b._originalJson.stringify(c)),h=b._parseResponse(c),g.processMessages(b,h,b.onSuccess),b.state===a.signalR.connectionState.connected&&(b.frameMessageCount=(b.frameMessageCount||0)+1,b.frameMessageCount>d.transports.foreverFrame.iframeClearThreshold&&(b.frameMessageCount=0,e=b.frame.contentWindow||b.frame.contentDocument,e&&e.document&&e.document.body)))for(f=e.document.body;f.firstChild;)f.removeChild(f.firstChild)},stop:function(a){var c=null;if(i.cancel(),a.frame){if(a.frame.stop)a.frame.stop();else try{c=a.frame.contentWindow||a.frame.contentDocument,c.document&&c.document.execCommand&&c.document.execCommand("Stop")}catch(d){a.log("Error occured when stopping foreverFrame transport. Message = "+d.message+".")}a.frame.parentNode===b.document.body&&b.document.body.removeChild(a.frame),delete g.foreverFrame.connections[a.frameId],a.frame=null,a.frameId=null,delete a.frame,delete a.frameId,delete a.onSuccess,delete a.frameMessageCount,a.log("Stopping forever frame.")}},abort:function(a,b){g.ajaxAbort(a,b)},getConnection:function(a){return g.foreverFrame.connections[a]},started:function(b){f(b,d.connectionState.reconnecting,d.connectionState.connected)===!0&&a(b).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(a,b,c){var d=a.signalR,e=a.signalR.events,f=a.signalR.changeState,g=a.signalR.isDisconnecting,h=d.transports._logic;d.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(c,i,j){var k=this,l=function(){l=a.noop,c.log("LongPolling connected."),i()},m=function(a){return j(a)?(c.log("LongPolling failed to connect."),!0):!1},n=c._,o=0,p=function(c){b.clearTimeout(n.reconnectTimeoutId),n.reconnectTimeoutId=null,f(c,d.connectionState.reconnecting,d.connectionState.connected)===!0&&(c.log("Raising the reconnect event"),a(c).triggerHandler(e.onReconnect))},q=36e5;c.pollXhr&&(c.log("Polling xhr requests already exists, aborting."),c.stop()),c.messageId=null,n.reconnectTimeoutId=null,n.pollTimeoutId=b.setTimeout(function(){!function f(i,j){var r=i.messageId,s=null===r,t=!s,u=!j,v=h.getUrl(i,k.name,t,u,!0),w={};i.messageId&&(w.messageId=i.messageId),i.groupsToken&&(w.groupsToken=i.groupsToken),g(i)!==!0&&(c.log("Opening long polling request to '"+v+"'."),i.pollXhr=h.ajax(c,{xhrFields:{onprogress:function(){h.markLastMessage(c)}},url:v,type:"POST",contentType:d._.defaultContentType,data:w,timeout:c._.pollTimeout,success:function(d){var e,j,k,q=0;c.log("Long poll complete."),o=0;try{e=c._parseResponse(d)}catch(r){return void h.handleParseFailure(i,d,r,m,i.pollXhr)}null!==n.reconnectTimeoutId&&p(i),e&&(j=h.maximizePersistentResponse(e)),h.processMessages(i,e,l),j&&"number"===a.type(j.LongPollDelay)&&(q=j.LongPollDelay),g(i)!==!0&&(k=j&&j.ShouldReconnect,k&&!h.ensureReconnectingState(i)||(q>0?n.pollTimeoutId=b.setTimeout(function(){f(i,k)},q):f(i,k)))},error:function(g,j){var l=d._.transportError(d.resources.longPollFailed,c.transport,g,i.pollXhr);if(b.clearTimeout(n.reconnectTimeoutId),n.reconnectTimeoutId=null,"abort"===j)return void c.log("Aborted xhr request.");if(!m(l)){if(o++,c.state!==d.connectionState.reconnecting&&(c.log("An error occurred using longPolling. Status = "+j+". Response = "+g.responseText+"."),a(i).triggerHandler(e.onError,[l])),(c.state===d.connectionState.connected||c.state===d.connectionState.reconnecting)&&!h.verifyLastActive(c))return;if(!h.ensureReconnectingState(i))return;n.pollTimeoutId=b.setTimeout(function(){f(i,!0)},k.reconnectDelay)}}}),t&&j===!0&&(n.reconnectTimeoutId=b.setTimeout(function(){p(i)},Math.min(1e3*(Math.pow(2,o)-1),q))))}(c)},250)},lostConnection:function(a){a.pollXhr&&a.pollXhr.abort("lostConnection")},send:function(a,b){h.ajaxSend(a,b)},stop:function(a){b.clearTimeout(a._.pollTimeoutId),b.clearTimeout(a._.reconnectTimeoutId),delete a._.pollTimeoutId,delete a._.reconnectTimeoutId,a.pollXhr&&(a.pollXhr.abort(),a.pollXhr=null,delete a.pollXhr)},abort:function(a,b){h.ajaxAbort(a,b)}}}(window.jQuery,window),function(a,b,c){function d(a){return a+k}function e(a,b,c){var d,e=a.length,f=[];for(d=0;e>d;d+=1)a.hasOwnProperty(d)&&(f[d]=b.call(c,a[d],d,a));return f}function f(b){return a.isFunction(b)?null:"undefined"===a.type(b)?null:b}function g(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1}function h(a,b){var c,d=a._.invocationCallbacks;g(d)&&a.log("Clearing hub invocation callbacks with error: "+b+"."),a._.invocationCallbackId=0,delete a._.invocationCallbacks,a._.invocationCallbacks={};for(var e in d)c=d[e],c.method.call(c.scope,{E:b})}function i(a,b){return new i.fn.init(a,b)}function j(b,c){var d={qs:null,logging:!1,useDefaultPath:!0};return a.extend(d,c),b&&!d.useDefaultPath||(b=(b||"")+"/signalr"),new j.fn.init(b,d)}var k=".hubProxy",l=a.signalR;i.fn=i.prototype={init:function(a,b){this.state={},this.connection=a,this.hubName=b,this._={callbackMap:{}}},constructor:i,hasSubscriptions:function(){return g(this._.callbackMap)},on:function(b,c){var e=this,f=e._.callbackMap;return b=b.toLowerCase(),f[b]||(f[b]={}),f[b][c]=function(a,b){c.apply(e,b)},a(e).bind(d(b),f[b][c]),e},off:function(b,c){var e,f=this,h=f._.callbackMap;return b=b.toLowerCase(),e=h[b],e&&(e[c]?(a(f).unbind(d(b),e[c]),delete e[c],g(e)||delete h[b]):c||(a(f).unbind(d(b)),delete h[b])),f},invoke:function(b){var c=this,d=c.connection,g=a.makeArray(arguments).slice(1),h=e(g,f),i={H:c.hubName,M:b,A:h,I:d._.invocationCallbackId},j=a.Deferred(),k=function(e){var f,g,h=c._maximizeHubResponse(e);a.extend(c.state,h.State),h.Progress?j.notifyWith?j.notifyWith(c,[h.Progress.Data]):d._.progressjQueryVersionLogged||(d.log("A hub method invocation progress update was received but the version of jQuery in use ("+a.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."), 64 d._.progressjQueryVersionLogged=!0):h.Error?(h.StackTrace&&d.log(h.Error+"\n"+h.StackTrace+"."),f=h.IsHubException?"HubException":"Exception",g=l._.error(h.Error,f),g.data=h.ErrorData,d.log(c.hubName+"."+b+" failed to execute. Error: "+g.message),j.rejectWith(c,[g])):(d.log("Invoked "+c.hubName+"."+b),j.resolveWith(c,[h.Result]))};return d._.invocationCallbacks[d._.invocationCallbackId.toString()]={scope:c,method:k},d._.invocationCallbackId+=1,a.isEmptyObject(c.state)||(i.S=c.state),d.log("Invoking "+c.hubName+"."+b),d.send(i),j.promise()},_maximizeHubResponse:function(a){return{State:a.S,Result:a.R,Progress:a.P?{Id:a.P.I,Data:a.P.D}:null,Id:a.I,IsHubException:a.H,Error:a.E,StackTrace:a.T,ErrorData:a.D}}},i.fn.init.prototype=i.fn,j.fn=j.prototype=a.connection(),j.fn.init=function(b,c){var e={qs:null,logging:!1,useDefaultPath:!0},f=this;a.extend(e,c),a.signalR.fn.init.call(f,b,e.qs,e.logging),f.proxies={},f._.invocationCallbackId=0,f._.invocationCallbacks={},f.received(function(b){var c,e,g,h,i,j;b&&("undefined"!=typeof b.P?(g=b.P.I.toString(),h=f._.invocationCallbacks[g],h&&h.method.call(h.scope,b)):"undefined"!=typeof b.I?(g=b.I.toString(),h=f._.invocationCallbacks[g],h&&(f._.invocationCallbacks[g]=null,delete f._.invocationCallbacks[g],h.method.call(h.scope,b))):(c=this._maximizeClientHubInvocation(b),f.log("Triggering client hub event '"+c.Method+"' on hub '"+c.Hub+"'."),i=c.Hub.toLowerCase(),j=c.Method.toLowerCase(),e=this.proxies[i],a.extend(e.state,c.State),a(e).triggerHandler(d(j),[c.Args])))}),f.error(function(a,b){var c,d;b&&(c=b.I,d=f._.invocationCallbacks[c],d&&(f._.invocationCallbacks[c]=null,delete f._.invocationCallbacks[c],d.method.call(d.scope,{E:a})))}),f.reconnecting(function(){f.transport&&"webSockets"===f.transport.name&&h(f,"Connection started reconnecting before invocation result was received.")}),f.disconnected(function(){h(f,"Connection was disconnected before invocation result was received.")})},j.fn._maximizeClientHubInvocation=function(a){return{Hub:a.H,Method:a.M,Args:a.A,State:a.S}},j.fn._registerSubscribedHubs=function(){var b=this;b._subscribedToHubs||(b._subscribedToHubs=!0,b.starting(function(){var c=[];a.each(b.proxies,function(a){this.hasSubscriptions()&&(c.push({name:a}),b.log("Client subscribed to hub '"+a+"'."))}),0===c.length&&b.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to."),b.data=b.json.stringify(c)}))},j.fn.createHubProxy=function(a){a=a.toLowerCase();var b=this.proxies[a];return b||(b=i(this,a),this.proxies[a]=b),this._registerSubscribedHubs(),b},j.fn.init.prototype=j.fn,a.hubConnection=j}(window.jQuery,window),function(a,b){a.signalR.version="2.2.0"}(window.jQuery);
Note: See TracChangeset
for help on using the changeset viewer.