function OpenWindow(n,t,i,r){var f=(screen.width-t)/2,e=(screen.height-i)/2,u="resizable=yes, height="+i+",width="+t+",top="+e+",left="+f+"w",o;r&&(u+=",scrollbars=1");o=window.open(n,"_blank",u)}function setLocation(n){window.location.href=n}function stringFormat(n){for(var t=1;t<arguments.length;t++)n=n.replace("{"+(t-1)+"}",arguments[t]);return n}function displayAjaxLoading(n,t){var i=".ajax-loading-block-window";t===undefined||(i="."+t);n?$(i).show():$(i).hide()}function updateTopUserSection(n){if(!n.isAuthenticated){var t=$("div.user-login a");t.text()=="Logout"&&(t.attr("href",apmex_app_base+"/login"),t.text("Login"),$("div.user-register").html('<a href="/account/register" title="Register to win a 1oz Gold Eagle">REGISTER TO WIN A 1oz GOLD EAGLE<\/a><a href="/account/register" title="Create A Free Account" class="btn btn-orange">Create A Free Account<\/a>'))}}function updateTopCartSection(n,t){n.updatetopcartsectionhtml&&$('div.cart-counter a[data-toggle="cart-popover"]').html(n.updatetopcartsectionhtml);n.updateflyoutcartsectionhtml&&($("#cart-popover .popover-content").html(n.updateflyoutcartsectionhtml),t&&($("#modal-added-to-cart div.modal-content").html(n.updatepopupcartsectionhtml),$("#modal-added-to-cart").modal("show")))}function ShowUserMessage(n,t,i){var u,r,f;if((i==null||i=="")&&(i="alert-warning"),i=="alert-error"&&(i="alert-danger"),t!=null&&$(t).hide(),n!=null&&n!=""){if(u=$("#jsquickmessage"),t!=null&&(u=$(t)),r="",typeof n=="string")r='<div class="alert '+i+' fade in"><a href="#" data-dismiss="alert" class="close">&times;<\/a><strong>'+n+"<\/strong><\/div>";else for(f=0;f<n.length;f++)r=r+'<div class="alert '+i+' fade in"><a href="#" data-dismiss="alert" class="close">&times;<\/a><strong>'+n[f]+"<\/strong><\/div>";u.html(r);u.show()}}function defer(n,t){document.cookie.indexOf("__utma=")!=-1||apmex_app_ppctrycount>25?setTimeout(function(){n()},t):(apmex_app_ppctrycount=apmex_app_ppctrycount+1,setTimeout(function(){defer(n)},1e3))}function IsEmail(n){return/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(n)}function sendGAEvent(n,t,i){ga("CPwrapperUA.send","event",n,t,i)}function loadDailySpotPriceChart(n,t){$.ajax({cache:!1,url:n,type:"get",success:function(n){drawDailySpotPriceChart(n.chartdata,t)}})}function drawDailySpotPriceChart(n,t){var i,r,u;Highcharts.setOptions({chart:{style:{fontFamily:"Arial,sans-serif",color:"#032638"}}});i="Gold";r="#FDBA35";switch(t){case"1":i="Gold";$("a.historical-charts").attr("href","/spotprices/gold-price");$(".historical-charts .metal-chart").text("Gold Price");break;case"2":i="Silver";r="#d3d3d3";$("a.historical-charts").attr("href","/spotprices/silver-prices");$(".historical-charts .metal-chart").text("Silver Price");break;case"3":i="Platinum";r="#008FBE";$("a.historical-charts").attr("href","/spotprices/platinum-price");$(".historical-charts .metal-chart").text("Platinum Price");break;case"4":i="Palladium";r="#25a187";$("a.historical-charts").attr("href","/spotprices/palladium-price");$(".historical-charts .metal-chart").text("Palladium Price")}u=new Highcharts.Chart({chart:{renderTo:"historical-charts-gold",type:"area",height:195,borderRadius:0},credits:{enabled:!1},title:{text:""},subtitle:{text:"",y:0},xAxis:{gridLineWidth:1,gridLineColor:"#eee",lineWidth:1,lineColor:"#eee",type:"datetime",dateTimeLabelFormats:{hour:"%l %p",day:"%e %b"},labels:{style:{fontSize:"8px"}},tickInterval:216e5},yAxis:{title:{text:""},lineColor:"#eee",lineWidth:1,labels:{style:{fontSize:"10px"},formatter:function(){return t==2?"$"+Highcharts.numberFormat(this.value,2):"$"+Highcharts.numberFormat(this.value,0)}},gridLineWidth:1,gridLineColor:"#eee"},tooltip:{shared:!0,enabled:!0,valueDecimals:2,followTouchMove:!1,xDateFormat:"%b %e, %Y %l:%M %p",pointFormat:'<span style="color:{series.color}">{series.name}<\/span>: <b> ${point.y}<\/b><br/>'},plotOptions:{series:{lineWidth:1.5,marker:{enabled:!1}},area:{fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,Highcharts.getOptions().colors[0]],[1,Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get("rgba")]]},lineWidth:1,marker:{enabled:!1},shadow:!1,states:{hover:{lineWidth:1}},threshold:null}},series:[{name:i,showInLegend:!1,type:"area",fillColor:r,data:n,color:r}]})}if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t()})}(jQuery);+function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.prototype.close=function(t){function f(){i.trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));i=n(r);t&&t.preventDefault();i.length||(i=u.hasClass("alert")?u:u.parent());i.trigger(t=n.Event("close.bs.alert"));t.isDefaultPrevented()||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one(n.support.transition.end,f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},i;t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,u=i.is("input")?"val":"html",f=i.data();t+="Text";f.resetText||i.data("resetText",i[u]());i[u](f[t]||this.options[t]);setTimeout(n.proxy(function(){"loadingText"==t?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};i=n.fn.button;n.fn.button=function(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})};n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=i,this};n(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var i=n(t.target);i.hasClass("btn")||(i=i.closest(".btn"));i.button("toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;"hover"==this.options.pause&&this.$element.on("mouseenter",n.proxy(this.pause,this)).on("mouseleave",n.proxy(this.cycle,this))},i;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)};t.prototype.to=function(t){var r=this,i=this.getActiveIndex();if(!(t>this.$items.length-1)&&!(0>t))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),s=this.interval,f="next"==t?"left":"right",h="next"==t?"first":"last",e=this,o;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[h]()}return r.hasClass("active")?this.sliding=!1:(o=n.Event("slide.bs.carousel",{relatedTarget:r[0],direction:f}),this.$element.trigger(o),o.isDefaultPrevented()?void 0:(this.sliding=!0,s&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=n(e.$indicators.children()[e.getActiveIndex()]);t&&t.addClass("active")})),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one(n.support.transition.end,function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));e.sliding=!1;setTimeout(function(){e.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*u.css("transition-duration").slice(0,-1))):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),s&&this.cycle(),this))};i=n.fn.carousel;n.fn.carousel=function(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})};n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=i,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var f,i=n(this),r=n(i.attr("data-target")||(f=i.attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")),e=n.extend({},r.data(),i.data()),u=i.attr("data-slide-to");u&&(e.interval=!1);r.carousel(e);(u=i.attr("data-slide-to"))&&r.data("bs.carousel").to(u);t.preventDefault()});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);t.carousel(t.data())})})}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},i;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var u,t,r,i,f,e;if(!this.transitioning&&!this.$element.hasClass("in")&&(u=n.Event("show.bs.collapse"),this.$element.trigger(u),!u.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(r=t.data("bs.collapse"),r&&r.transitioning)return;t.collapse("hide");r||t.data("bs.collapse",null)}if(i=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1,f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[i]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return f.call(this);e=n.camelCase(["scroll",i].join("-"));this.$element.one(n.support.transition.end,n.proxy(f,this)).emulateTransitionEnd(350)[i](this.$element[0][e])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented()))return t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},n.support.transition?void this.$element[t](0).one(n.support.transition.end,n.proxy(r,this)).emulateTransitionEnd(350):r.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};i=n.fn.collapse;n.fn.collapse=function(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&"show"==i&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=i,this};n(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var e,i=n(this),s=i.attr("data-target")||t.preventDefault()||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""),r=n(s),u=r.data("bs.collapse"),h=u?"toggle":i.data(),f=i.attr("data-parent"),o=f&&n(f);u&&u.transitioning||(o&&o.find('[data-toggle=collapse][data-parent="'+f+'"]').not(i).addClass("collapsed"),i[r.hasClass("in")?"addClass":"removeClass"]("collapsed"));r.collapse(h)})}(jQuery);+function(n){"use strict";function r(t){n(e).remove();n(i).each(function(){var i=u(n(this)),r={relatedTarget:this};i.hasClass("open")&&(i.trigger(t=n.Event("hide.bs.dropdown",r)),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",r))})}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var e=".dropdown-backdrop",i="[data-toggle=dropdown]",t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;i.toggleClass("open").trigger("shown.bs.dropdown",e);f.focus()}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&27==t.keyCode)return 27==t.which&&o.find(i).focus(),e.click();h=" li:not(.divider):visible a";f=o.find("[role=menu]"+h+", [role=listbox]"+h);f.length&&(r=f.index(f.filter(":focus")),38==t.keyCode&&r>0&&r--,40==t.keyCode&&r<f.length-1&&r++,~r||(r=0),f.eq(r).focus())}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+", [role=menu], [role=listbox]",t.prototype.keydown)}(jQuery);+function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$backdrop=this.isShown=null;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},i;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this[this.isShown?"hide":"show"](n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);this.isShown||r.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(document.body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one(n.support.transition.end,function(){i.$element.focus().trigger(r)}).emulateTransitionEnd(300):i.$element.focus().trigger(r)}))};t.prototype.hide=function(t){t&&t.preventDefault();t=n.Event("hide.bs.modal");this.$element.trigger(t);this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one(n.support.transition.end,n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.focus()},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.removeBackdrop();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var r=this.$element.hasClass("fade")?"fade":"",i;if(this.isShown&&this.options.backdrop){if(i=n.support.transition&&r,this.$backdrop=n('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};i=n.fn.modal;n.fn.modal=function(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})};n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=i,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());i.is("a")&&t.preventDefault();u.modal(f,this).one("hide",function(){i.is(":visible")&&i.focus()})});n(document).on("show.bs.modal",".modal",function(){n(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){n(document.body).removeClass("modal-open")})}(jQuery);+function(n){"use strict";var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),u,i,v,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;u=this;i=this.tip();this.setContent();this.options.animation&&i.addClass("fade");var t="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,c=/\s?auto?\s?/i,l=c.test(t);l&&(t=t.replace(c,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),f=i[0].offsetWidth,e=i[0].offsetHeight;if(l){var o=this.$element.parent(),y=t,a=document.documentElement.scrollTop||document.body.scrollTop,p="body"==this.options.container?window.innerWidth:o.outerWidth(),w="body"==this.options.container?window.innerHeight:o.outerHeight(),b="body"==this.options.container?0:o.offset().left;t="bottom"==t&&r.top+r.height+e-a>w?"top":"top"==t&&r.top-a-e<0?"bottom":"right"==t&&r.right+f>p?"left":"left"==t&&r.left-f<b?"right":t;i.removeClass(y).addClass(t)}v=this.getCalculatedOffset(t,r,f,e);this.applyPlacement(v,t);this.hoverState=null;s=function(){u.$element.trigger("shown.bs."+u.type)};n.support.transition&&this.$tip.hasClass("fade")?i.one(n.support.transition.end,s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var c,r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),f,u,h;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");f=r[0].offsetWidth;u=r[0].offsetHeight;("top"==i&&u!=e&&(c=!0,t.top=t.top+e-u),/bottom|top/.test(i))?(h=0,t.left<0&&(h=-2*t.left,t.left=0,r.offset(t),f=r[0].offsetWidth,u=r[0].offsetHeight),this.replaceArrow(h-l+f,f,"left")):this.replaceArrow(u-e,u,"top");c&&r.offset(t)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function r(){"in"!=t.hoverState&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),u=n.Event("hide.bs."+this.type);return this.$element.trigger(u),u.isDefaultPrevented()?void 0:(i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one(n.support.transition.end,r).emulateTransitionEnd(150):r(),this.hoverState=null,this)};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(){var t=this.$element[0];return n.extend({},"function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=t?n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;(r||"destroy"!=i)&&(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content")[this.options.html?"string"==typeof t?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;(r||"destroy"!=i)&&(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){var u,f=n.proxy(this.process,this);this.$element=n(n(i).is("body")?window:i);this.$body=n("body");this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||(u=n(i).attr("href"))&&u.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.offsets=n([]);this.targets=n([]);this.activeTarget=null;this.refresh();this.process()}t.DEFAULTS={offset:10};t.prototype.refresh=function(){var i=this.$element[0]==window?"offset":"position",t;this.offsets=n([]);this.targets=n([]);t=this;this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),r=/^#./.test(u)&&n(u);return r&&r.length&&r.is(":visible")&&[[r[i]().top+(!n.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,e=f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(i>=e)return u!=(n=r.last()[0])&&this.activate(n);if(u&&i<=t[0])return u!=(n=r[0])&&this.activate(n);for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(!t[n+1]||i<=t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=i,this};n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(jQuery);+function(n){"use strict";var t=function(t){this.element=n(t)},i;t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),(t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.parent("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})})))};t.prototype.activate=function(t,i,r){function f(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");e?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),e=r&&n.support.transition&&u.hasClass("fade");e?u.one(n.support.transition.end,f).emulateTransitionEnd(150):f();u.removeClass("in")};i=n.fn.tab;n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})};n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=i,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();n(this).tab("show")})}(jQuery);+function(n){"use strict";var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$window=n(window).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},i;t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$window.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,h;if(this.$element.is(":visible")){var c=n(document).height(),o=this.$window.scrollTop(),s=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;"top"==this.affixed&&(s.top+=o);"object"!=typeof r&&(u=f=r);"function"==typeof f&&(f=r.top(this.$element));"function"==typeof u&&(u=r.bottom(this.$element));i=null!=this.unpin&&o+this.unpin<=s.top?!1:null!=u&&s.top+this.$element.height()>=c-u?"bottom":null!=f&&f>=o?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),h=n.Event(e+".bs.affix"),this.$element.trigger(h),h.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-u-this.$element.height()})))}};i=n.fn.affix;n.fn.affix=function(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=i,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var i=n(this),t=i.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.affix(t)})})}(jQuery),function(n){function i(n,t){return n.nodeType==3?e(n,t):f(n,t)}function f(t,r){var t=n(t),u=t.clone().empty(),f;return t.contents().each(function(){var n=r-u.text().length;n!=0&&(f=i(this,n),f&&u.append(f))}),u}function e(i,u){var f=r(i.data);return t&&(f=f.replace(/^ /,"")),t=!!f.match(/ $/),f=f.slice(0,u),n("<div/>").text(f).html()}function r(n){return n.replace(/\s+/g," ")}function u(t){var f=n(t),i=f.children(":last"),r;return i?(r=i.css("display"),!r||r=="inline")?f:u(i):t}function o(t){var r=n(t),i=r.children(":last");return i&&i.is("p")?i:t}var t=!0;n.fn.truncate=function(t){var f=n.extend({},n.fn.truncate.defaults,t);n(this).each(function(){var s=n.trim(r(n(this).text())).length;if(s<=f.max_length){n(this).show();return}var h=f.max_length-f.more.length-f.link_prefix.length-f.link_suffix.length,t=i(this,h),e=n(this).hide();t.show();t.insertAfter(e);u(t).append("..."+f.link_prefix+'<a href="#more" class="'+f.css_more_class+'">'+f.more+"<\/a>"+f.link_suffix);o(e).append(f.link_prefix+'<a href="#less" class="'+f.css_less_class+'">'+f.less+"<\/a>"+f.link_suffix);t.find("a:last").click(function(){return t.hide(),e.show(),!1});e.find("a:last").click(function(){return t.show(),e.hide(),!1})})};n.fn.truncate.defaults={max_length:100,more:"Read More",less:"read less",css_more_class:"truncator-link truncator-more",css_less_class:"truncator-link truncator-less",link_prefix:"<br/> [",link_suffix:"]"}}(jQuery);!function(n){"use strict";var t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.typeahead.defaults,i);this.matcher=this.options.matcher||this.matcher;this.sorter=this.options.sorter||this.sorter;this.select=this.options.select||this.select;this.autoSelect="boolean"==typeof this.options.autoSelect?this.options.autoSelect:!0;this.highlighter=this.options.highlighter||this.highlighter;this.updater=this.options.updater||this.updater;this.source=this.options.source;this.$menu=n(this.options.menu);this.shown=!1;this.listen();this.showHintOnFocus="boolean"==typeof this.options.showHintOnFocus?this.options.showHintOnFocus:!1},i;t.prototype={constructor:t,select:function(){var n=this.$menu.find(".active").data("value");return(this.autoSelect||n)&&this.$element.val(this.updater(n)).change(),this.hide()},updater:function(n){return n},setSource:function(n){this.source=n},show:function(){var i,t=n.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return i="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight,this.$menu.insertAfter(this.$element).css({top:t.top+t.height+i,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var i;return this.query="undefined"!=typeof t&&null!==t?t:this.$element.val()||"",this.query.length<this.options.minLength?this.shown?this.hide():this:(i=n.isFunction(this.source)?this.source(this.query,n.proxy(this.process,this)):this.source,i?this.process(i):this)},process:function(t){var i=this;return t=n.grep(t,function(n){return i.matcher(n)}),t=this.sorter(t),t.length?"all"==this.options.items||0===this.options.minLength&&!this.$element.val()?this.render(t).show():this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(n){return~n.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(n){for(var t,i=[],r=[],u=[];t=n.shift();)t.toLowerCase().indexOf(this.query.toLowerCase())?~t.indexOf(this.query)?r.push(t):u.push(t):i.push(t);return i.concat(r,u)},highlighter:function(n){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return n.replace(new RegExp("("+t+")","ig"),function(n,t){return"<strong>"+t+"<\/strong>"})},render:function(t){var i=this;return t=n(t).map(function(t,r){return t=n(i.options.item).data("value",r),t.find("a").html(i.highlighter(r)),t[0]}),this.autoSelect&&t.first().addClass("active"),this.$menu.html(t),this},next:function(){var i=this.$menu.find(".active").removeClass("active"),t=i.next();t.length||(t=n(this.$menu.find("li")[0]));t.addClass("active")},prev:function(){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last());n.addClass("active")},listen:function(){this.$element.on("focus",n.proxy(this.focus,this)).on("blur",n.proxy(this.blur,this)).on("keypress",n.proxy(this.keypress,this)).on("keyup",n.proxy(this.keyup,this));this.eventSupported("keydown")&&this.$element.on("keydown",n.proxy(this.keydown,this));this.$menu.on("click",n.proxy(this.click,this)).on("mouseenter","li",n.proxy(this.mouseenter,this)).on("mouseleave","li",n.proxy(this.mouseleave,this))},destroy:function(){this.$element.data("typeahead",null);this.$element.off("focus").off("blur").off("keypress").off("keyup");this.eventSupported("keydown")&&this.$element.off("keydown");this.$menu.remove()},eventSupported:function(n){var t=n in this.$element;return t||(this.$element.setAttribute(n,"return;"),t="function"==typeof this.$element[n]),t},move:function(n){if(this.shown){switch(n.keyCode){case 9:case 13:case 27:n.preventDefault();break;case 38:n.preventDefault();this.prev();break;case 40:n.preventDefault();this.next()}n.stopPropagation()}},keydown:function(t){this.suppressKeyPressRepeat=~n.inArray(t.keyCode,[40,38,9,13,27]);this.shown||40!=t.keyCode?this.move(t):this.lookup("")},keypress:function(n){this.suppressKeyPressRepeat||this.move(n)},keyup:function(n){switch(n.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}n.stopPropagation();n.preventDefault()},focus:function(){this.focused||(this.focused=!0,(0===this.options.minLength&&!this.$element.val()||this.options.showHintOnFocus)&&this.lookup())},blur:function(){this.focused=!1;!this.mousedover&&this.shown&&this.hide()},click:function(n){n.stopPropagation();n.preventDefault();this.select();this.$element.focus()},mouseenter:function(t){this.mousedover=!0;this.$menu.find(".active").removeClass("active");n(t.currentTarget).addClass("active")},mouseleave:function(){this.mousedover=!1;!this.focused&&this.shown&&this.hide()}};i=n.fn.typeahead;n.fn.typeahead=function(i){var r=arguments;return this.each(function(){var f=n(this),u=f.data("typeahead"),e="object"==typeof i&&i;u||f.data("typeahead",u=new t(this,e));"string"==typeof i&&(r.length>1?u[i].apply(u,Array.prototype.slice.call(r,1)):u[i]())})};n.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"><\/ul>',item:'<li><a href="#"><\/a><\/li>',minLength:1,scrollHeight:0,autoSelect:!0};n.fn.typeahead.Constructor=t;n.fn.typeahead.noConflict=function(){return n.fn.typeahead=i,this};n(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(){var t=n(this);t.data("typeahead")||t.typeahead(t.data())})}(window.jQuery),function(n,t,i,r){var u=n(t);n.fn.lazyload=function(i){function o(){var t=0;e.each(function(){var i=n(this);if((!f.skip_invisible||i.is(":visible"))&&!n.abovethetop(this,f)&&!n.leftofbegin(this,f))if(n.belowthefold(this,f)||n.rightoffold(this,f)){if(++t>f.failure_limit)return!1}else i.trigger("appear"),t=0})}var e=this,s,f={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:t,data_attribute:"original",skip_invisible:!0,appear:null,load:null};return i&&(r!==i.failurelimit&&(i.failure_limit=i.failurelimit,delete i.failurelimit),r!==i.effectspeed&&(i.effect_speed=i.effectspeed,delete i.effectspeed),n.extend(f,i)),s=f.container===r||f.container===t?u:n(f.container),0===f.event.indexOf("scroll")&&s.bind(f.event,function(){return o()}),this.each(function(){var t=this,i=n(t);t.loaded=!1;i.one("appear",function(){if(!this.loaded){if(f.appear){var r=e.length;f.appear.call(t,r,f)}n("<img />").bind("load",function(){var r,u;i.hide().attr("src",i.data(f.data_attribute))[f.effect](f.effect_speed);t.loaded=!0;r=n.grep(e,function(n){return!n.loaded});e=n(r);f.load&&(u=e.length,f.load.call(t,u,f))}).attr("src",i.data(f.data_attribute))}});0!==f.event.indexOf("scroll")&&i.bind(f.event,function(){t.loaded||i.trigger("appear")})}),u.bind("resize",function(){o()}),/iphone|ipod|ipad.*os 5/gi.test(navigator.appVersion)&&u.bind("pageshow",function(t){t.originalEvent.persisted&&e.each(function(){n(this).trigger("appear")})}),n(t).load(function(){o()}),this};n.belowthefold=function(i,f){var e;return e=f.container===r||f.container===t?u.height()+u.scrollTop():n(f.container).offset().top+n(f.container).height(),e<=n(i).offset().top-f.threshold};n.rightoffold=function(i,f){var e;return e=f.container===r||f.container===t?u.width()+u.scrollLeft():n(f.container).offset().left+n(f.container).width(),e<=n(i).offset().left-f.threshold};n.abovethetop=function(i,f){var e;return e=f.container===r||f.container===t?u.scrollTop():n(f.container).offset().top,e>=n(i).offset().top+f.threshold+n(i).height()};n.leftofbegin=function(i,f){var e;return e=f.container===r||f.container===t?u.scrollLeft():n(f.container).offset().left,e>=n(i).offset().left+f.threshold+n(i).width()};n.inviewport=function(t,i){return!n.rightoffold(t,i)&&!n.leftofbegin(t,i)&&!n.belowthefold(t,i)&&!n.abovethetop(t,i)};n.extend(n.expr[":"],{"below-the-fold":function(t){return n.belowthefold(t,{threshold:0})},"above-the-top":function(t){return!n.belowthefold(t,{threshold:0})},"right-of-screen":function(t){return n.rightoffold(t,{threshold:0})},"left-of-screen":function(t){return!n.rightoffold(t,{threshold:0})},"in-viewport":function(t){return n.inviewport(t,{threshold:0})},"above-the-fold":function(t){return!n.belowthefold(t,{threshold:0})},"right-of-fold":function(t){return n.rightoffold(t,{threshold:0})},"left-of-fold":function(t){return!n.rightoffold(t,{threshold:0})}})}(jQuery,window,document),function(n){n.fn.hoverIntent=function(t,i,r){var u={interval:100,sensitivity:7,timeout:0};u=typeof t=="object"?n.extend(u,t):n.isFunction(i)?n.extend(u,{over:t,out:i,selector:r}):n.extend(u,{over:t,out:t,selector:i});var f,e,o,s,h=function(n){f=n.pageX;e=n.pageY},c=function(t,i){if(i.hoverIntent_t=clearTimeout(i.hoverIntent_t),Math.abs(o-f)+Math.abs(s-e)<u.sensitivity)return n(i).off("mousemove.hoverIntent",h),i.hoverIntent_s=1,u.over.apply(i,[t]);o=f;s=e;i.hoverIntent_t=setTimeout(function(){c(t,i)},u.interval)},a=function(n,t){return t.hoverIntent_t=clearTimeout(t.hoverIntent_t),t.hoverIntent_s=0,u.out.apply(t,[n])},l=function(t){var r=jQuery.extend({},t),i=this;if(i.hoverIntent_t&&(i.hoverIntent_t=clearTimeout(i.hoverIntent_t)),t.type=="mouseenter"){o=r.pageX;s=r.pageY;n(i).on("mousemove.hoverIntent",h);i.hoverIntent_s!=1&&(i.hoverIntent_t=setTimeout(function(){c(r,i)},u.interval))}else n(i).off("mousemove.hoverIntent",h),i.hoverIntent_s==1&&(i.hoverIntent_t=setTimeout(function(){a(r,i)},u.timeout))};return this.on({"mouseenter.hoverIntent":l,"mouseleave.hoverIntent":l},u.selector)}}(jQuery),function(){var t,n;jQuery.uaMatch=function(n){n=n.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}};t=jQuery.uaMatch(navigator.userAgent);n={};t.browser&&(n[t.browser]=!0,n.version=t.version);n.chrome?n.webkit=!0:n.webkit&&(n.safari=!0);jQuery.browser=n}();$(document).ready(function(){var t,r,n,i;$.ajaxSetup({cache:!1});jQuery.uaMatch=function(n){n=n.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}};jQuery.browser||(matched=jQuery.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser);$("input[type=text][data-placeholder]").focus(function(){var n=$(this);n.val()==n.data("placeholder")&&n.val("")}).blur(function(){var n=$(this);n.val()==""&&n.val(n.data("placeholder"))});$("#user-cart-menu-close").click(function(n){return n.stopPropagation(),$("#cart-popover").fadeOut("fast"),!1});$(".popover-control").popover({trigger:"hover",html:!0});$('[data-toggle="popover"]').popover();$(".apmex-buyprice").popover({trigger:"hover",container:"body",placement:"top",title:'<div style="text-align:center; font-size:14px;">APMEX Buy Price<\/div>',html:!0,content:'<div id="popOverBox" style="color:#000000;font-weight:normal;"><p>The buy price is for transactions exceeding $10,000.00. For transaction of less than $10,000.00 the price paid will be at the discretion of APMEX and may be less than what is displayed here. If you own these items and would like to sell them to APMEX, please call 1(800) 375-9006 and ask to speak with someone in our product purchasing department.<\/p><p>Prices subject to change without notice. Prices paid may be more or less than displayed here and subject to quantity limitations.<\/p><\/div>'});$(".apmex-buyprice-call").popover({trigger:"hover",container:"body",placement:"top",title:'<div style="text-align:center; font-size:14px;">APMEX Buy Price<\/div>',html:!0,content:'<div id="popOverBox" style="color:#000000;font-weight:normal;"><p>Buy prices for certain products can vary considerably in many cases. For this product, it is best to call our Purchasing team for our most current prices we are willing to pay based upon the quantity you are wanting to sell. Please call <b>(405) 595-2100<\/b> and speak with our purchasing team for our buy price.<\/p><p>Prices quoted are subject to change without notice.<\/p><\/div>'});$(".apmex-cashdiscount").popover({trigger:"hover",placement:"top",container:"body",title:'<div style="text-align:center; font-size:14px;">Cash Discount<\/div>',html:!0,content:'<div id="popOverBox" style="color:#000000;font-weight:normal;"><p>We provide a <b>4.0% cash discount<\/b> to our customers if they pay for their orders by check, bank wire or trade. The prices shown for each product under Check/Wire include the 4.0% cash discount. The prices shown for each product under CC/PayPal are the full list price.<\/p><\/div>'});$(".apmex-satisfaction").popover({trigger:"hover",placement:"top",title:'<div style="text-align:center; font-size:14px;">Satisfaction Guaranteed<\/div>',html:!0,content:'<div id="popOverBox" style="color:#000000;font-weight:normal;"><p>We provide all our customers with a refund, return and/or exchange policy on everything we sell including all bullion and certified coins. If for any reason you have a problem, please feel free to call our offices. We will always do our best to accommodate you.<\/p><\/div>'});$(".product-quickshipeligible").popover({trigger:"hover",container:"body",placement:"top",html:!0,content:'<div id="popOverBox" style="color:#000000; font-weight:normal; max-width: 130px; text-align: center;"><p>Credit Card, PayPal and Bank Wire orders ship next business day guaranteed.<\/p><\/div>'});$(".accordion").on("show",function(n){$(n.target).prev(".accordion-heading").find(".accordion-toggle").addClass("active")});$(".accordion").on("hide",function(n){$(this).find(".accordion-toggle").not($(n.target)).removeClass("active")});$.browser.msie&&($(".custom-select").addClass("ie-select"),$('input[type="checkbox"], input[type="radio"]').addClass("ie-input"));$(".search-filter-body div.checkbox input[type=checkbox]").click(function(){window.location.href=$(this).next("a").attr("href")});$("#searchform input[type=submit]").click(function(){$("#q").val()=="Product Name, Mint, Gold, Silver, etc."&&$("#q").val("")});$("#q,#tippytop-q").typeahead({minLength:2,items:18,source:function(n,t){return $.get(apmex_app_base+"/search/autocomplete",{query:n},function(n){return t(n.message)})},matcher:function(){return!0},updater:function(n){return document.location=apmex_app_base+"/search?q="+encodeURIComponent(n),n},sorter:function(n){return n.unshift(this.query),n}});$(document).on("click","a.load-module-content",function(n){var t=$(this).attr("data-title"),i=$(this).attr("data-modulename"),r=apmex_app_base+"/contentpage/getmodule?modulename="+i;return $("#modal-module-content .modal-header h4").text(t),$.ajax({cache:!1,url:r,type:"get",success:function(n){$("#modal-module-content .modal-body").html(n);$("#modal-module-content").modal("show")},error:function(){alert("Error Loading Module Popups")}}),n.preventDefault(),!1});$(document).on("keyup",'input[type="text"].numericbox',function(){var n=$(this).val();(!$.isNumeric(n)||n<=0)&&$(this).val("")});$(document).on("keyup",'input[type="text"].wholenumericbox',function(){var n=$(this).val();n=n.replace(/[- ]+/g,"");$(this).val(n);(!$.isNumeric(n)||n<0)&&$(this).val("")});$(document).on("keypress",'input[type="text"].qty-cart',function(n){if(n.keyCode==13)return $(this).closest("form").find('button[type="submit"]').trigger("click"),!1});$(document).on("keypress",'div.product-added-qty input[type="text"].qty-cart',function(n){n.keyCode==13&&$("a#product-added-update-qty").trigger("click")});$("a.captcha-refresh").click(function(n){var t=$(this).attr("data-captcha")+"r="+Math.random();return $("img.captcha-image").attr("src",t),$("#Captcha").val(""),n.preventDefault(),!1});$("img.lazy").lazyload({effect:"fadeIn",threshold:600,skip_invisible:!1});$("#recommended-carousel").carousel({interval:!1});t=apmex_app_base+"/chart?width=720&height=360&metalId={0}&themeId=2&type={1}";r=apmex_app_base+"/spotprice/GetDayChart?width=250&height=200&metalId={0}&themeId=2&type=day";$("ul#historical-charts-tabs li a").click(function(n){$("ul#historical-charts-tabs li").removeClass("active");$(this).parent().addClass("active");loadDailySpotPriceChart(stringFormat(r,this.rel),this.rel);n.preventDefault()});$("#modal-historicalCharts").on("shown.bs.modal",function(){$("#modal-charts-display-img").attr("src",stringFormat(t,1,"day"))});if($("div.modal-body .time-period li a").click(function(n){$("div.modal-body .time-period li").removeClass("active");$(this).parent().addClass("active");var i=$("ul#historical-charts-detail-tabs.charts-tabs li.active a"),r=i.attr("rel");$("#modal-charts-display-img").attr("src",stringFormat(t,r,this.rel));n.preventDefault()}),$(document).ajaxError(function(){}),n=window.location.hash,i=$('a[href$="'+n+'"]'),i.length>0&&i.click(),$(n).length)return $("html,body").animate({scrollTop:$(n).offset().top-100},1e3),!1;$("ul.nav.navbar-nav a").on("click",function(){var n=$(this).attr("data-action"),t=$(this).attr("data-label");ga("CPwrapperUA.send","event","Top Navigation Menu",n,t)});$("form#register-form button#btn-register-form").click(function(){ga("CPwrapperUA.send","event","Email","Email Submission","Default Account")})});var ShoppingCart={loadWaiting:!1,init:function(){this.loadWaiting=!1},setLoadWaiting:function(n){displayAjaxLoading(n);this.loadWaiting=n},showQuickView:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n.productdetails);$("#modal-product-quickview").modal("show")},complete:this.resetLoadWaiting}))},saveWatchList:function(n){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#modal-watchlist .modal-body").html(n.message);$("#modal-watchlist").modal("show")},complete:this.resetLoadWaiting});return}},showMarketAlert:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-alertme .modal-content").html(n);$("#modal-alertme").modal("show")},complete:this.resetLoadWaiting}))},showProductAlert:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-alertme .modal-content").html(n);$("#modal-alertme").modal("show")},complete:this.resetLoadWaiting}))},showAlertMe:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-alertme .modal-content").html(n);$("#modal-alertme").modal("show")},complete:this.resetLoadWaiting}))},saveAlertMe:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#modal-alertme .modal-content").html(n.message);$("#modal-alertme").modal("show")},complete:this.resetLoadWaiting});return}},deleteAlertMe:function(n,t){if(this.loadWaiting==!1){var i=confirm("Are you sure you want to delete the Alert?");i&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,data:$(t).serialize(),type:"post",success:function(n){$("#modal-alertme .modal-content").html(n.message);$("#modal-alertme").modal("hide")},complete:this.resetLoadWaiting}))}},notifyAllowedMaxQty:function(n,t,i,r,u,f,e){var o,s,h,c;this.loadWaiting==!1&&(o="#product-addtocart-qty-"+n,typeof f!="undefined"&&(o=f),e==""&&(e="image-coming-soon.jpg"),s=$(o).val(),s>i&&!u&&(this.setLoadWaiting(!0),h="mailto:salesquestions@apmex.com?subject=Customer interest in more "+t+"(Product ID: "+n+")&body=Hello, I am interested in more "+t+"(Product ID: "+n+"). Please reply and let me know if you can locate more.",c='<div style="float: left; margin: 5px 0px 0px 0px;"><img src="http://www.images-apmex.com/images/Catalog%20Images/Products/'+e+'?width=120&height=120" /><\/div><div style="float: right; width: 320px;"><p><strong>Unfortunately, we only have '+i.toString().replace(/\B(?=(\d{3})+\b)/g,",")+' of this item in stock.<\/strong><\/p>Please call a Sales Account Manager at 800.375.9006 or email us at <a href="'+h+'">salesquestions@apmex.com<\/a> if you wish to purchase a larger quantity than what we have available on our website. We can often locate additional quantities.<\/div><div style="clear:both;"><\/div>',$("#modal-notify-maxqty .modal-body").html(c),$("#modal-notify-maxqty").modal("show"),$(o).val(i),this.resetLoadWaiting()))},addproducttocart:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);var i="";i=t=="viewcart"||t=="viewcart-opc"?{qty:1,returnUrl:t}:$(t).serialize();$.ajax({cache:!1,url:n,data:i,contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){if(t=="viewcart"||t=="viewcart-opc")ShoppingCart.successUpdateCart(n),$("#modal-product-quickview").modal("hide");else{if(n.redirect)return location.href=n.redirect,!0;updateTopCartSection(n,!0)}try{oAPMEX_CPwrapGA.onItemAddedToCart(n.addedItem.ProductName,n.addedItem.SalesPrice,n.addedItem.ProductID,n.addedItem.Qty+"")}catch(i){}return!1},complete:this.resetLoadWaiting})}},changeCurrency:function(n,t){if(this.loadWaiting==!1){var i=$("#selectedCurrency option:selected").data("currencyicon"),r=$("#selectedCurrency option:selected").data("shortcode");this.setLoadWaiting(!0);$.ajax({cache:!1,url:t,data:{selectedCurrency:n},contentType:"application/x-www-form-urlencoded",type:"post",success:function(t){$("#cart-items").html(t);$("div.currency-selected img").attr({src:i,alt:n,title:n});$("div.currency-selected span.shortcode").html(r)},complete:this.resetLoadWaiting})}},changePayment:function(n,t){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:t,data:{selectedPayment:n},contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#cart-items").html(n)},complete:this.resetLoadWaiting}))},removeCartItem:function(n,t,i){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:t,data:{selectedProductId:n},contentType:"application/x-www-form-urlencoded",type:"post",success:this.successUpdateCart,complete:this.resetLoadWaiting}),i!=""&&(this.setLoadWaiting(!1),this.saveWatchList(i)))},updateCartItem:function(n,t){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:t,data:$(n).find("input[type=text]").serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:this.successUpdateCart,complete:this.resetLoadWaiting}))},validateCoupon:function(n,t){var i=$(n).val();if(i!=""){if(this.loadWaiting!=!1)return;this.setLoadWaiting(!0);$.ajax({cache:!1,url:t,data:{coupon:i},contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return ShowUserMessage(n.message,"#cart-message",n.messagetype),n.success==!0?($("#cart-items").html(n.cartitems),ShowUserMessage(n.message,"#coupon-message",n.messagetype)):ShowUserMessage("Invalid promo code.","#coupon-message",n.messagetype),!1},complete:this.resetLoadWaiting})}return},selectPaymentOption:function(n,t,i,r){if(this.loadWaiting==!1){if(i==15){var u=$("label[for='PaymentModel_CreditCard_AgreeCreditCard']").html();$("#checkout-echeck-order").hide();$("#checkout-secure-order").hide();n==1?($("#checkout-secure-order").show(),$("#cart-cc-instruction").show(),u=u.replace("NOT","")):n==19?$("#checkout-echeck-order").show():($("#cart-cc-instruction").hide(),u=u.replace("NOT","").replace("WILL","WILL NOT"),r?$("#checkout-secure-order").show():$("#checkout-secure-order").hide());$("label[for='PaymentModel_CreditCard_AgreeCreditCard']").html(u)}this.setLoadWaiting(!0);$.ajax({cache:!1,url:t,data:{paymentId:n},contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){n.shippingOptions==""?$("#ship-options").hide():$("#ship-options").html(n.shippingOptions).show();$("#cart-items").html(n.cartitems)},complete:this.resetLoadWaiting})}},selectShippingOption:function(n,t,i){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:t,data:{ShippingId:n,shipCharge:i},contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#cart-items").html(n)},complete:this.resetLoadWaiting}))},selectCitadelOption:function(n,t){this.loadWaiting==!1&&(n||(this.setLoadWaiting(!0),$.ajax({cache:!1,url:t,type:"get",success:function(n){$("#modal-choosecitadel .modal-content").html(n);$("#modal-choosecitadel").modal("show")},complete:this.resetLoadWaiting})))},citadelLogin:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return n.success==!0?n.type=="advisor"?$("#modal-choosecitadel .modal-content").html(n.message):($("#modal-choosecitadel").modal("hide"),$("#user-address-list input:radio").attr("checked",!1),$("#user-choose-citadel").html(n.message)):$("#modal-choosecitadel .modal-content").html(n.message),!1},complete:this.resetLoadWaiting});return}},citadelChooseInvestor:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);var i=$(t).find("input[name=citadelInvestorSAN]:checked").val();$.ajax({cache:!1,url:n,data:{subAccountNumber:i},contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return n.success==!0?($("#modal-choosecitadel").modal("hide"),$("#user-address-list input:radio").attr("checked",!1),$("#user-choose-citadel").html(n.message)):$("#modal-choosecitadel .modal-content").html(n.message),!1},complete:this.resetLoadWaiting});return}},citadelRegisterStep1:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-choosecitadel .modal-content").html(n)},complete:this.resetLoadWaiting}))},citadelRegisterStep1Submit:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return n.success==!0?$("#modal-choosecitadel .modal-content").html(n.message):$("#modal-choosecitadel .modal-content").html(n.message),!1},complete:this.resetLoadWaiting});return}},citadelRegisterStep2Submit:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return n.success==!0?($("#modal-choosecitadel").modal("hide"),$("#user-address-list input:radio").attr("checked",!1),$("#user-choose-citadel").html(n.message)):$("#modal-choosecitadel .modal-content").html(n.message),!1},complete:this.resetLoadWaiting});return}},successUpdateCart:function(n){return $("div.flash-message").hide(),n.success==!0&&(n.redirect&&location.reload(),updateTopCartSection(n,!1)),ShowUserMessage(n.message,"#cart-message",n.messagetype),$("#cart-items").html(n.cartitems),!1},getProductDetails:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n);$("#modal-product-quickview").modal("show");$(".popover-control").popover({trigger:"hover",html:!0})},complete:this.resetLoadWaiting}))},showPresentationBoxes:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n);$("#modal-product-quickview").modal("show")},complete:this.resetLoadWaiting}))},beginCheckout:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){n.redirect?location.href=n.redirectUrl:($("#modal-product-quickview .modal-content").html(""),$("#modal-product-quickview .modal-content").html(n.viewdata),$("#modal-product-quickview").modal("show"))},complete:this.resetLoadWaiting}))},beginCheckoutPost:function(n,t){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,data:$(t).serialize(),type:"post",success:function(n){t=="#form-login-guest-popup"&&ga("CPwrapperUA.send","event","Email","Email Submission","Guest Account");n.redirect?location.href=n.redirectUrl:($("#modal-product-quickview .modal-content").html(""),$("#modal-product-quickview .modal-content").html(n.viewdata),$("#modal-product-quickview").modal("show"))},complete:this.resetLoadWaiting}))},resetLoadWaitingTest:function(){ShoppingCart.setLoadWaiting(!1)},resetLoadWaiting:function(){ShoppingCart.setLoadWaiting(!1)}},MyAccount={loadWaiting:!1,init:function(){this.loadWaiting=!1},setLoadWaiting:function(n){displayAjaxLoading(n);this.loadWaiting=n},addShippingAddress:function(n,t){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",data:{returnUrl:t},success:function(n){$("#modal-addshipping .modal-content").html(n);$("#modal-addshipping").modal("show")},complete:this.resetLoadWaiting}))},editShippingAddress:function(n,t,i){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",data:{addressId:t,returnUrl:i},success:function(n){$("#modal-addshipping .modal-content").html(n);$("#modal-addshipping").modal("show")},complete:this.resetLoadWaiting}))},deleteShippingAddress:function(n,t,i){if(this.loadWaiting==!1){var r=confirm("Are you sure you want to delete the address?");r&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"post",data:{addressId:t,returnUrl:i},success:function(n){$("#user-address-list").html(n.message)},complete:this.resetLoadWaiting}))}},saveShippingAddress:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).find("input[type='hidden'], :input:not(:hidden)").serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return n.success==!0?n.recommendedAddress?($("#modal-addshipping .modal-content").html(n.message),$("#modal-addshipping").modal("show")):($("#modal-addshipping").modal("hide"),$("#user-address-list").html(n.message)):$("#modal-addshipping .modal-content").html(n.message),!1},complete:this.resetLoadWaiting});return}},saveRecommendedAddress:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return n.success==!0?($("#modal-addshipping").modal("hide"),$("#user-address-list").html(n.message)):$("#modal-addshipping .modal-content").html(n.message),!1},complete:this.resetLoadWaiting});return}},getUserStatus:function(n,t){$.ajax({cache:!1,url:n,data:{requestUrl:t},contentType:"application/x-www-form-urlencoded",type:"get",success:function(n){return n.success==!0&&(n.redirect?window.location=n.redirectUrl:updateTopUserSection(n,!1)),!1}})},getWidgetCode:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",data:{widgettheme:$("#hdnWidgetUrl").val()},success:function(n){$("#modal-widgetcode .modal-body").html(n);$("#modal-widgetcode").modal("show")},complete:this.resetLoadWaiting}))},getWidgetCodePost:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return $("#modal-widgetcode .modal-body").html(n),$("#modal-widgetcode").modal("show"),!1},complete:this.resetLoadWaiting});return}},subscribeNewsLetter:function(n,t){var r=$(t).val(),i=$("#redirectURL").val();if(!IsEmail(r)){alert("Please enter a valid email address");return}if(this.loadWaiting==!1&&r!=""){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).parents("form").serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){return t=="#newsletter-email-popup"?ga("CPwrapperUA.send","event","Email","Email Submission","Popup1"):ga("CPwrapperUA.send","event","Email","Email Submission","Footer"),i!=null&&i!=""?window.location.href=i:($("#modal-register-popup").modal("hide"),$("#modal-module-content .modal-header h4").text("Thank You"),$("#modal-module-content .modal-body").html(n),$("#modal-module-content").modal("show")),!1},complete:this.resetLoadWaiting});return}},showPopcornFeedbackPopup:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){return $("#modal-module-content .modal-header h4").text("Share Your Love Of Popcorn"),$("#modal-module-content .modal-body").html(n),$("#modal-module-content").modal("show"),!1},complete:this.resetLoadWaiting}))},savePopcornFeedbackPopup:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#modal-module-content .modal-body").html(n);$("#modal-module-content").modal("show")},complete:this.resetLoadWaiting});return}},showReviewPopup:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(){return $("#modal-showReviewPopup").modal("show"),!1},complete:this.resetLoadWaiting}))},showSweepstakesEntry:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n);$("#modal-product-quickview").modal("show")},complete:this.resetLoadWaiting}))},addSweepstakesEntry:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n);$("#modal-product-quickview").modal("show")},complete:this.resetLoadWaiting});return}},resetLoadWaiting:function(){MyAccount.setLoadWaiting(!1)},showSurveyFeedbackEntry:function(n){this.loadWaiting==!1&&(this.setLoadWaiting(!0),$.ajax({cache:!1,url:n,type:"get",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n);$("#modal-product-quickview").modal("show")},complete:this.resetLoadWaiting}))},addSurveyFeedback:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("#modal-product-quickview .modal-content").html("");$("#modal-product-quickview .modal-content").html(n);$("#modal-product-quickview").modal("show")},complete:this.resetLoadWaiting});return}},showContactUs:function(n,t,i,r,u,f){var h=$(t).val(),e,o,s;if(h==null||h==""){alert("Please enter a valid name");return}if(e=$(i).val(),!IsEmail(e)){alert("Please enter a valid email address");return}if(e!=""){if(o=$(f).val(),o==null||o==""){alert("Please select how we can help you");return}if(s=$(f).val(),s==null||s==""){alert("Please your message is required");return}if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(i).parents("form").serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(){return $("#modal-module-content .modal-header h4").text("Thank You"),$("#modal-module-content .modal-body").html("<p>Thank you for using the APMEX Customer Care Center for assistance. We have received your inquiry and will respond as soon as possible. If you are contacting us Sunday &ndash; Thursday, you can expect to receive a reply before the end of the next business day, at the very latest. <br /> <br />APMEX is closed on weekends, so inquiries not responded to by 6 p.m. (ET) Friday, or submitted Saturday, will be answered the following Monday unless it is a holiday. <br /> <br />We value your business and we thank you for choosing APMEX! <br /> <br /> <strong>APMEX Customer Service Hours:<\/strong> <br />8 a.m. &ndash; 8 p.m. (ET) Monday &ndash; Thursday <br />8 a.m. &ndash; 6 p.m. (ET) Friday <br />Closed on weekends and holidays<\/p>"),$("#modal-module-content").modal("show"),!1},complete:this.resetLoadWaiting});return}}},saveSMSOrderSubscription:function(n,t){if(this.loadWaiting==!1){this.setLoadWaiting(!0);$.ajax({cache:!1,url:n,data:$(t).serialize(),contentType:"application/x-www-form-urlencoded",type:"post",success:function(n){$("div#section-smsordertracking-subscription").html(n)},complete:this.resetLoadWaiting});return}}};(function(n,t,i,r){var h=i(n),e=i(t),u=i.fancybox=function(){u.open.apply(this,arguments)},y=navigator.userAgent.match(/msie/),v=null,o=t.createTouch!==r,a=function(n){return n&&n.hasOwnProperty&&n instanceof i},c=function(n){return n&&"string"===i.type(n)},l=function(n){return c(n)&&0<n.indexOf("%")},f=function(n,t){var i=parseInt(n,10)||0;return t&&l(n)&&(i*=u.getViewport()[t]/100),Math.ceil(i)},s=function(n,t){return f(n,t)+"px"};i.extend(u,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!o,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"><\/div><\/div><\/div><\/div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(y?' allowtransparency="true"':"")+"><\/iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.<\/p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"><\/a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span><\/span><\/a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span><\/span><\/a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(n,t){if(n&&(i.isPlainObject(t)||(t={}),!1!==u.close(!0)))return i.isArray(n)||(n=a(n)?i(n).get():[n]),i.each(n,function(f,e){var h={},s,y,l,o,v;"object"===i.type(e)&&(e.nodeType&&(e=i(e)),a(e)?(h={href:e.data("fancybox-href")||e.attr("href"),title:e.data("fancybox-title")||e.attr("title"),isDom:!0,element:e},i.metadata&&i.extend(!0,h,e.metadata())):h=e);s=t.href||h.href||(c(e)?e:null);y=t.title!==r?t.title:h.title||"";o=(l=t.content||h.content)?"html":t.type||h.type;!o&&h.isDom&&(o=e.data("fancybox-type"),o||(o=(o=e.prop("class").match(/fancybox\.(\w+)/))?o[1]:null));c(s)&&(o||(u.isImage(s)?o="image":u.isSWF(s)?o="swf":"#"===s.charAt(0)?o="inline":c(e)&&(o="html",l=e)),"ajax"===o&&(v=s.split(/\s+/,2),s=v.shift(),v=v.shift()));l||("inline"===o?s?l=i(c(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):h.isDom&&(l=e):"html"===o?l=s:!o&&!s&&h.isDom&&(o="inline",l=e));i.extend(h,{href:s,type:o,content:l,title:y,selector:v});n[f]=h}),u.opts=i.extend(!0,{},u.defaults,t),t.keys!==r&&(u.opts.keys=t.keys?i.extend({},u.defaults.keys,t.keys):!1),u.group=n,u._start(u.opts.index)},cancel:function(){var n=u.coming;n&&!1!==u.trigger("onCancel")&&(u.hideLoading(),u.ajaxLoad&&u.ajaxLoad.abort(),u.ajaxLoad=null,u.imgPreload&&(u.imgPreload.onload=u.imgPreload.onerror=null),n.wrap&&n.wrap.stop(!0,!0).trigger("onReset").remove(),u.coming=null,u.current||u._afterZoomOut(n))},close:function(n){u.cancel();!1!==u.trigger("beforeClose")&&(u.unbindEvents(),u.isActive&&(!u.isOpen||!0===n?(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),u._afterZoomOut()):(u.isOpen=u.isOpened=!1,u.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),u.wrap.stop(!0,!0).removeClass("fancybox-opened"),u.transitions[u.current.closeMethod]())))},play:function(n){var t=function(){clearTimeout(u.player.timer)},r=function(){t();u.current&&u.player.isActive&&(u.player.timer=setTimeout(u.next,u.current.playSpeed))},f=function(){t();i("body").unbind(".player");u.player.isActive=!1;u.trigger("onPlayEnd")};!0!==n&&(u.player.isActive||!1===n)?f():u.current&&(u.current.loop||u.current.index<u.group.length-1)&&(u.player.isActive=!0,i("body").bind({"afterShow.player onUpdate.player":r,"onCancel.player beforeClose.player":f,"beforeLoad.player":t}),r(),u.trigger("onPlayStart"))},next:function(n){var t=u.current;t&&(c(n)||(n=t.direction.next),u.jumpto(t.index+1,n,"next"))},prev:function(n){var t=u.current;t&&(c(n)||(n=t.direction.prev),u.jumpto(t.index-1,n,"prev"))},jumpto:function(n,t,i){var e=u.current;e&&(n=f(n),u.direction=t||e.direction[n>=e.index?"next":"prev"],u.router=i||"jumpto",e.loop&&(0>n&&(n=e.group.length+n%e.group.length),n%=e.group.length),e.group[n]!==r&&(u.cancel(),u._start(n)))},reposition:function(n,t){var f=u.current,e=f?f.wrap:null,r;e&&(r=u._getPosition(t),n&&"scroll"===n.type?(delete r.position,e.stop(!0,!0).animate(r,200)):(e.css(r),f.pos=i.extend({},f.dim,r)))},update:function(n){var t=n&&n.type,i=!t||"orientationchange"===t;i&&(clearTimeout(v),v=null);u.isOpen&&!v&&(v=setTimeout(function(){var r=u.current;r&&!u.isClosing&&(u.wrap.removeClass("fancybox-tmp"),(i||"load"===t||"resize"===t&&r.autoResize)&&u._setDimension(),"scroll"===t&&r.canShrink||u.reposition(n),u.trigger("onUpdate"),v=null)},i&&!o?0:300))},toggle:function(n){u.isOpen&&(u.current.fitToView="boolean"===i.type(n)?n:!u.current.fitToView,o&&(u.wrap.removeAttr("style").addClass("fancybox-tmp"),u.trigger("onUpdate")),u.update())},hideLoading:function(){e.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var t,n;u.hideLoading();t=i('<div id="fancybox-loading"><div><\/div><\/div>').click(u.cancel).appendTo("body");e.bind("keydown.loading",function(n){27===(n.which||n.keyCode)&&(n.preventDefault(),u.cancel())});u.defaults.fixed||(n=u.getViewport(),t.css({position:"absolute",top:.5*n.h+n.y,left:.5*n.w+n.x}))},getViewport:function(){var i=u.current&&u.current.locked||!1,t={x:h.scrollLeft(),y:h.scrollTop()};return i?(t.w=i[0].clientWidth,t.h=i[0].clientHeight):(t.w=o&&n.innerWidth?n.innerWidth:h.width(),t.h=o&&n.innerHeight?n.innerHeight:h.height()),t},unbindEvents:function(){u.wrap&&a(u.wrap)&&u.wrap.unbind(".fb");e.unbind(".fb");h.unbind(".fb")},bindEvents:function(){var n=u.current,t;n&&(h.bind("orientationchange.fb"+(o?"":" resize.fb")+(n.autoCenter&&!n.locked?" scroll.fb":""),u.update),(t=n.keys)&&e.bind("keydown.fb",function(f){var e=f.which||f.keyCode,o=f.target||f.srcElement;if(27===e&&u.coming)return!1;f.ctrlKey||f.altKey||f.shiftKey||f.metaKey||o&&(o.type||i(o).is("[contenteditable]"))||i.each(t,function(t,o){return 1<n.group.length&&o[e]!==r?(u[t](o[e]),f.preventDefault(),!1):-1<i.inArray(e,o)?(u[t](),f.preventDefault(),!1):void 0})}),i.fn.mousewheel&&n.mouseWheel&&u.wrap.bind("mousewheel.fb",function(t,r,f,e){for(var o=i(t.target||null),s=!1;o.length&&!s&&!o.is(".fancybox-skin")&&!o.is(".fancybox-wrap");)s=o[0]&&!(o[0].style.overflow&&"hidden"===o[0].style.overflow)&&(o[0].clientWidth&&o[0].scrollWidth>o[0].clientWidth||o[0].clientHeight&&o[0].scrollHeight>o[0].clientHeight),o=i(o).parent();0!==r&&!s&&1<u.group.length&&!n.canShrink&&(0<e||0<f?u.prev(0<e?"down":"left"):(0>e||0>f)&&u.next(0>e?"up":"right"),t.preventDefault())}))},trigger:function(n,t){var f,r=t||u.coming||u.current;if(r){if(i.isFunction(r[n])&&(f=r[n].apply(r,Array.prototype.slice.call(arguments,1))),!1===f)return!1;r.helpers&&i.each(r.helpers,function(t,f){f&&u.helpers[t]&&i.isFunction(u.helpers[t][n])&&(f=i.extend(!0,{},u.helpers[t].defaults,f),u.helpers[t][n](f,r))});i.event.trigger(n+".fb")}},isImage:function(n){return c(n)&&n.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(n){return c(n)&&n.match(/\.(swf)((\?|#).*)?$/i)},_start:function(n){var t={},e,r;if(n=f(n),e=u.group[n]||null,!e)return!1;if(t=i.extend(!0,{},u.opts,e),e=t.margin,r=t.padding,"number"===i.type(e)&&(t.margin=[e,e,e,e]),"number"===i.type(r)&&(t.padding=[r,r,r,r]),t.modal&&i.extend(!0,t,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),t.autoSize&&(t.autoWidth=t.autoHeight=!0),"auto"===t.width&&(t.autoWidth=!0),"auto"===t.height&&(t.autoHeight=!0),t.group=u.group,t.index=n,u.coming=t,!1===u.trigger("beforeLoad"))u.coming=null;else{if(r=t.type,e=t.href,!r)return u.coming=null,u.current&&u.router&&"jumpto"!==u.router?(u.current.index=n,u[u.router](u.direction)):!1;if(u.isActive=!0,("image"===r||"swf"===r)&&(t.autoHeight=t.autoWidth=!1,t.scrolling="visible"),"image"===r&&(t.aspectRatio=!0),"iframe"===r&&o&&(t.scrolling="scroll"),t.wrap=i(t.tpl.wrap).addClass("fancybox-"+(o?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+t.wrapCSS).appendTo(t.parent||"body"),i.extend(t,{skin:i(".fancybox-skin",t.wrap),outer:i(".fancybox-outer",t.wrap),inner:i(".fancybox-inner",t.wrap)}),i.each(["Top","Right","Bottom","Left"],function(n,i){t.skin.css("padding"+i,s(t.padding[n]))}),u.trigger("onReady"),"inline"===r||"html"===r){if(!t.content||!t.content.length)return u._error("content")}else if(!e)return u._error("href");"image"===r?u._loadImage():"ajax"===r?u._loadAjax():"iframe"===r?u._loadIframe():u._afterLoad()}},_error:function(n){i.extend(u.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:n,content:u.coming.tpl.error});u._afterLoad()},_loadImage:function(){var n=u.imgPreload=new Image;n.onload=function(){this.onload=this.onerror=null;u.coming.width=this.width;u.coming.height=this.height;u._afterLoad()};n.onerror=function(){this.onload=this.onerror=null;u._error("image")};n.src=u.coming.href;!0!==n.complete&&u.showLoading()},_loadAjax:function(){var n=u.coming;u.showLoading();u.ajaxLoad=i.ajax(i.extend({},n.ajax,{url:n.href,error:function(n,t){u.coming&&"abort"!==t?u._error("ajax",n):u.hideLoading()},success:function(t,i){"success"===i&&(n.content=t,u._afterLoad())}}))},_loadIframe:function(){var n=u.coming,t=i(n.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",o?"auto":n.iframe.scrolling).attr("src",n.href);i(n.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(n){}});n.iframe.preload&&(u.showLoading(),t.one("load",function(){i(this).data("ready",1);o||i(this).bind("load.fb",u.update);i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();u._afterLoad()}));n.content=t.appendTo(n.inner);n.iframe.preload||u._afterLoad()},_preloadImages:function(){for(var r=u.group,i=u.current,f=r.length,e=i.preload?Math.min(i.preload,f-1):0,n,t=1;t<=e;t+=1)n=r[(i.index+t)%f],"image"===n.type&&n.href&&((new Image).src=n.href)},_afterLoad:function(){var n=u.coming,r=u.current,t,s,f,e,o;if(u.hideLoading(),n&&!1!==u.isActive)if(!1===u.trigger("afterLoad",n,r))n.wrap.stop(!0).trigger("onReset").remove(),u.coming=null;else{r&&(u.trigger("beforeChange",r),r.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());u.unbindEvents();t=n.content;s=n.type;f=n.scrolling;i.extend(u,{wrap:n.wrap,skin:n.skin,outer:n.outer,inner:n.inner,current:n,previous:r});e=n.href;switch(s){case"inline":case"ajax":case"html":n.selector?t=i("<div>").html(t).find(n.selector):a(t)&&(t.data("fancybox-placeholder")||t.data("fancybox-placeholder",i('<div class="fancybox-placeholder"><\/div>').insertAfter(t).hide()),t=t.show().detach(),n.wrap.bind("onReset",function(){i(this).find(t).length&&t.hide().replaceAll(t.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":t=n.tpl.image.replace("{href}",e);break;case"swf":t='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+e+'"><\/param>';o="";i.each(n.swf,function(n,i){t+='<param name="'+n+'" value="'+i+'"><\/param>';o+=" "+n+'="'+i+'"'});t+='<embed src="'+e+'" type="application/x-shockwave-flash" width="100%" height="100%"'+o+"><\/embed><\/object>"}a(t)&&t.parent().is(n.inner)||n.inner.append(t);u.trigger("beforeShow");n.inner.css("overflow","yes"===f?"scroll":"no"===f?"hidden":f);u._setDimension();u.reposition();u.isOpen=!1;u.coming=null;u.bindEvents();u.isOpened?r.prevMethod&&u.transitions[r.prevMethod]():i(".fancybox-wrap").not(n.wrap).stop(!0).trigger("onReset").remove();u.transitions[u.isOpened?n.nextMethod:n.openMethod]();u._preloadImages()}},_setDimension:function(){var o=u.getViewport(),st=0,h=!1,n=!1,h=u.wrap,nt=u.skin,e=u.inner,r=u.current,n=r.width,t=r.height,c=r.minWidth,a=r.minHeight,v=r.maxWidth,y=r.maxHeight,ht=r.scrolling,ft=r.scrollOutside?r.scrollbarWidth:0,p=r.margin,w=f(p[1]+p[3]),tt=f(p[0]+p[2]),et,b,rt,d,k,it,ot,g,ut;if(h.add(nt).add(e).width("auto").height("auto").removeClass("fancybox-tmp"),p=f(nt.outerWidth(!0)-nt.width()),et=f(nt.outerHeight(!0)-nt.height()),b=w+p,rt=tt+et,d=l(n)?(o.w-b)*f(n)/100:n,k=l(t)?(o.h-rt)*f(t)/100:t,"iframe"===r.type){if(ut=r.content,r.autoHeight&&1===ut.data("ready"))try{ut[0].contentWindow.document.location&&(e.width(d).height(9999),it=ut.contents().find("body"),ft&&it.css("overflow-x","hidden"),k=it.height())}catch(ct){}}else(r.autoWidth||r.autoHeight)&&(e.addClass("fancybox-tmp"),r.autoWidth||e.width(d),r.autoHeight||e.height(k),r.autoWidth&&(d=e.width()),r.autoHeight&&(k=e.height()),e.removeClass("fancybox-tmp"));if(n=f(d),t=f(k),g=d/k,c=f(l(c)?f(c,"w")-b:c),v=f(l(v)?f(v,"w")-b:v),a=f(l(a)?f(a,"h")-rt:a),y=f(l(y)?f(y,"h")-rt:y),it=v,ot=y,r.fitToView&&(v=Math.min(o.w-b,v),y=Math.min(o.h-rt,y)),b=o.w-w,tt=o.h-tt,r.aspectRatio?(n>v&&(n=v,t=f(n/g)),t>y&&(t=y,n=f(t*g)),n<c&&(n=c,t=f(n/g)),t<a&&(t=a,n=f(t*g))):(n=Math.max(c,Math.min(n,v)),r.autoHeight&&"iframe"!==r.type&&(e.width(n),t=e.height()),t=Math.max(a,Math.min(t,y))),r.fitToView)if(e.width(n).height(t),h.width(n+p),o=h.width(),w=h.height(),r.aspectRatio)for(;(o>b||w>tt)&&n>c&&t>a&&!(19<st++);)t=Math.max(a,Math.min(y,t-10)),n=f(t*g),n<c&&(n=c,t=f(n/g)),n>v&&(n=v,t=f(n/g)),e.width(n).height(t),h.width(n+p),o=h.width(),w=h.height();else n=Math.max(c,Math.min(n,n-(o-b))),t=Math.max(a,Math.min(t,t-(w-tt)));ft&&"auto"===ht&&t<k&&n+p+ft<b&&(n+=ft);e.width(n).height(t);h.width(n+p);o=h.width();w=h.height();h=(o>b||w>tt)&&n>c&&t>a;n=r.aspectRatio?n<it&&t<ot&&n<d&&t<k:(n<it||t<ot)&&(n<d||t<k);i.extend(r,{dim:{width:s(o),height:s(w)},origWidth:d,origHeight:k,canShrink:h,canExpand:n,wPadding:p,hPadding:et,wrapSpace:w-nt.outerHeight(!0),skinSpace:nt.height()-t});!ut&&r.autoHeight&&t>a&&t<y&&!n&&e.height("auto")},_getPosition:function(n){var i=u.current,r=u.getViewport(),t=i.margin,f=u.wrap.width()+t[1]+t[3],e=u.wrap.height()+t[0]+t[2],t={position:"absolute",top:t[0],left:t[3]};return i.autoCenter&&i.fixed&&!n&&e<=r.h&&f<=r.w?t.position="fixed":i.locked||(t.top+=r.y,t.left+=r.x),t.top=s(Math.max(t.top,t.top+(r.h-e)*i.topRatio)),t.left=s(Math.max(t.left,t.left+(r.w-f)*i.leftRatio)),t},_afterZoomIn:function(){var n=u.current;n&&(u.isOpen=u.isOpened=!0,u.wrap.css("overflow","visible").addClass("fancybox-opened"),u.update(),(n.closeClick||n.nextClick&&1<u.group.length)&&u.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),u[n.closeClick?"close":"next"]())}),n.closeBtn&&i(n.tpl.closeBtn).appendTo(u.skin).bind("click.fb",function(n){n.preventDefault();u.close()}),n.arrows&&1<u.group.length&&((n.loop||0<n.index)&&i(n.tpl.prev).appendTo(u.outer).bind("click.fb",u.prev),(n.loop||n.index<u.group.length-1)&&i(n.tpl.next).appendTo(u.outer).bind("click.fb",u.next)),u.trigger("afterShow"),!n.loop&&n.index===n.group.length-1?u.play(!1):u.opts.autoPlay&&!u.player.isActive&&(u.opts.autoPlay=!1,u.play()))},_afterZoomOut:function(n){n=n||u.current;i(".fancybox-wrap").trigger("onReset").remove();i.extend(u,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});u.trigger("afterClose",n)}});u.transitions={getOrigPosition:function(){var n=u.current,f=n.element,t=n.orig,i={},e=50,o=50,h=n.hPadding,c=n.wPadding,r=u.getViewport();return!t&&n.isDom&&f.is(":visible")&&(t=f.find("img:first"),t.length||(t=f)),a(t)?(i=t.offset(),t.is("img")&&(e=t.outerWidth(),o=t.outerHeight())):(i.top=r.y+(r.h-o)*n.topRatio,i.left=r.x+(r.w-e)*n.leftRatio),("fixed"===u.wrap.css("position")||n.locked)&&(i.top-=r.y,i.left-=r.x),{top:s(i.top-h*n.topRatio),left:s(i.left-c*n.leftRatio),width:s(e+c),height:s(o+h)}},step:function(n,t){var e,i,r=t.prop,o,s;i=u.current;o=i.wrapSpace;s=i.skinSpace;("width"===r||"height"===r)&&(e=t.end===t.start?1:(n-t.start)/(t.end-t.start),u.isClosing&&(e=1-e),i="width"===r?i.wPadding:i.hPadding,i=n-i,u.skin[r](f("width"===r?i:i-o*e)),u.inner[r](f("width"===r?i:i-o*e-s*e)))},zoomIn:function(){var n=u.current,t=n.pos,r=n.openEffect,f="elastic"===r,e=i.extend({opacity:1},t);delete e.position;f?(t=this.getOrigPosition(),n.openOpacity&&(t.opacity=.1)):"fade"===r&&(t.opacity=.1);u.wrap.css(t).animate(e,{duration:"none"===r?0:n.openSpeed,easing:n.openEasing,step:f?this.step:null,complete:u._afterZoomIn})},zoomOut:function(){var n=u.current,i=n.closeEffect,r="elastic"===i,t={opacity:.1};r&&(t=this.getOrigPosition(),n.closeOpacity&&(t.opacity=.1));u.wrap.animate(t,{duration:"none"===i?0:n.closeSpeed,easing:n.closeEasing,step:r?this.step:null,complete:u._afterZoomOut})},changeIn:function(){var i=u.current,o=i.nextEffect,t=i.pos,e={opacity:1},r=u.direction,n;t.opacity=.1;"elastic"===o&&(n="down"===r||"up"===r?"top":"left","down"===r||"right"===r?(t[n]=s(f(t[n])-200),e[n]="+=200px"):(t[n]=s(f(t[n])+200),e[n]="-=200px"));"none"===o?u._afterZoomIn():u.wrap.css(t).animate(e,{duration:i.nextSpeed,easing:i.nextEasing,complete:u._afterZoomIn})},changeOut:function(){var n=u.previous,r=n.prevEffect,f={opacity:.1},t=u.direction;"elastic"===r&&(f["down"===t||"up"===t?"top":"left"]=("up"===t||"left"===t?"-":"+")+"=200px");n.wrap.animate(f,{duration:"none"===r?0:n.prevSpeed,easing:n.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}};u.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!o,fixed:!0},overlay:null,fixed:!1,create:function(n){n=i.extend({},this.defaults,n);this.overlay&&this.close();this.overlay=i('<div class="fancybox-overlay"><\/div>').appendTo("body");this.fixed=!1;n.fixed&&u.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(n){var t=this;n=i.extend({},this.defaults,n);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(n);this.fixed||(h.bind("resize.overlay",i.proxy(this.update,this)),this.update());n.closeClick&&this.overlay.bind("click.overlay",function(n){i(n.target).hasClass("fancybox-overlay")&&(u.isActive?u.close():t.close())});this.overlay.css(n.css).show()},close:function(){i(".fancybox-overlay").remove();h.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(i("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var n="100%",i;this.overlay.width(n).height("100%");y?(i=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),e.width()>i&&(n=e.width())):e.width()>h.width()&&(n=e.width());this.overlay.width(n).height(e.height())},onReady:function(n,r){i(".fancybox-overlay").stop(!0,!0);this.overlay||(this.margin=e.height()>h.height()||"scroll"===i("body").css("overflow-y")?i("body").css("margin-right"):!1,this.el=t.all&&!t.querySelector?i("html"):i("body"),this.create(n));n.locked&&this.fixed&&(r.locked=this.overlay.append(r.wrap),r.fixed=!1);!0===n.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(n,t){t.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&i("body").css("margin-right",f(this.margin)+t.scrollbarWidth));this.open(n)},onUpdate:function(){this.fixed||this.update()},afterClose:function(n){this.overlay&&!u.isActive&&this.overlay.fadeOut(n.speedOut,i.proxy(this.close,this))}};u.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(n){var t=u.current,e=t.title,r=n.type;if(i.isFunction(e)&&(e=e.call(t.element,t)),c(e)&&""!==i.trim(e)){t=i('<div class="fancybox-title fancybox-title-'+r+'-wrap">'+e+"<\/div>");switch(r){case"inside":r=u.skin;break;case"outside":r=u.wrap;break;case"over":r=u.inner;break;default:r=u.skin;t.appendTo("body");y&&t.width(t.width());t.wrapInner('<span class="child"><\/span>');u.current.margin[2]+=Math.abs(f(t.css("margin-bottom")))}t["top"===n.position?"prependTo":"appendTo"](r)}}};i.fn.fancybox=function(n){var r,f=i(this),t=this.selector||"",o=function(e){var o=i(this).blur(),c=r,h,s;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||o.is(".fancybox-wrap")||(h=n.groupAttr||"data-fancybox-group",s=o.attr(h),s||(h="rel",s=o.get(0)[h]),s&&""!==s&&"nofollow"!==s&&(o=t.length?i(t):f,o=o.filter("["+h+'="'+s+'"]'),c=o.index(this)),n.index=c,!1!==u.open(o,n)&&e.preventDefault())};return n=n||{},r=n.index||0,!t||!1===n.live?f.unbind("click.fb-start").bind("click.fb-start",o):e.undelegate(t,"click.fb-start").delegate(t+":not('.fancybox-item, .fancybox-nav')","click.fb-start",o),this.filter("[data-fancybox-start=1]").trigger("click"),this};e.ready(function(){if(i.scrollbarWidth===r&&(i.scrollbarWidth=function(){var t=i('<div style="width:50px;height:50px;overflow:auto"><div/><\/div>').appendTo("body"),n=t.children(),n=n.innerWidth()-n.height(99).innerWidth();return t.remove(),n}),i.support.fixedPosition===r){var t=i.support,n=i('<div style="position:fixed;top:20px;"><\/div>').appendTo("body"),f=20===n[0].offsetTop||15===n[0].offsetTop;n.remove();t.fixedPosition=f}i.extend(u.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")})})})(window,document,jQuery),function(){function e(n,t){var i;n||(n={});for(i in t)n[i]=t[i];return n}function o(){var t,n=arguments,r,i={},u=function(n,t){var r,i;typeof n!="object"&&(n={});for(i in t)t.hasOwnProperty(i)&&(r=t[i],n[i]=r&&typeof r=="object"&&Object.prototype.toString.call(r)!=="[object Array]"&&i!=="renderTo"&&typeof r.nodeType!="number"?u(n[i]||{},r):t[i]);return n};for(n[0]===!0&&(i=n[1],n=Array.prototype.slice.call(n,2)),r=n.length,t=0;t<r;t++)i=u(i,n[t]);return i}function a(n,t){return parseInt(n,t||10)}function vr(n){return typeof n=="string"}function kt(n){return n&&typeof n=="object"}function rr(n){return Object.prototype.toString.call(n)==="[object Array]"}function ui(n){return typeof n=="number"}function ur(n){return st.log(n)/st.LN10}function si(n){return st.pow(10,n)}function hi(n,t){for(var i=n.length;i--;)if(n[i]===t){n.splice(i,1);break}}function u(n){return n!==i&&n!==null}function ot(n,t,i){var r,f;if(vr(t))u(i)?n.setAttribute(t,i):n&&n.getAttribute&&(f=n.getAttribute(t));else if(u(t)&&kt(t))for(r in t)n.setAttribute(r,t[r]);return f}function fi(n){return rr(n)?n:[n]}function n(){for(var r=arguments,t,u=r.length,n=0;n<u;n++)if(t=r[n],t!==i&&t!==null)return t}function p(n,t){sr&&!wt&&t&&t.opacity!==i&&(t.filter="alpha(opacity="+t.opacity*100+")");e(n.style,t)}function lt(n,t,i,r,u){return n=c.createElement(n),t&&e(n,t),u&&p(n,{padding:0,border:ct,margin:0}),i&&p(n,i),r&&r.appendChild(n),n}function dt(n,t){var r=function(){return i};return r.prototype=new n,e(r.prototype,t),r}function ki(n,t,i,r){var h=g.numberFormat,e=w.lang,u=+n||0,o=t===-1?(u.toString().split(".")[1]||"").length:isNaN(t=d(t))?2:t,c=i===void 0?e.decimalPoint:i,e=r===void 0?e.thousandsSep:r,l=u<0?"-":"",f=String(a(u=d(u).toFixed(o))),s=f.length>3?f.length%3:0;return h!==ki?h(n,t,i,r):l+(s?f.substr(0,s)+e:"")+f.substr(s).replace(/(\d{3})(?=\d)/g,"$1"+e)+(o?c+d(u-f).toFixed(o).slice(2):"")}function yr(n,t){return Array((t||2)+1-String(n).length).join(0)+n}function tt(n,t,i){var r=n[t];n[t]=function(){var n=Array.prototype.slice.call(arguments);return n.unshift(r),i.apply(this,n)}}function fr(n,t){for(var e="{",s=!1,i,r,o,u,f,h=[];(e=n.indexOf(e))!==-1;){if(i=n.slice(0,e),s){for(r=i.split(":"),o=r.shift().split("."),f=o.length,i=t,u=0;u<f;u++)i=i[o[u]];r.length&&(r=r.join(":"),o=/\.([0-9])/,u=w.lang,f=void 0,/f$/.test(r)?(f=(f=r.match(o))?f[1]:-1,i!==null&&(i=ki(i,f,u.decimalPoint,r.indexOf(",")>-1?u.thousandsSep:""))):i=pi(r,i))}h.push(i);n=n.slice(e+1);e=(s=!s)?"}":"{"}return h.push(n),h.join("")}function nf(n){return st.pow(10,et(st.log(n)/st.LN10))}function tf(t,i,r,u){var f,r=n(r,1);for(f=t/r,i||(i=[1,2,2.5,5,10],u===!1&&(r===1?i=[1,2,5,10]:r<=.1&&(i=[1/r]))),u=0;u<i.length;u++)if(t=i[u],f<=(i[u]+(i[u+1]||i[u]))/2)break;return t*r}function rf(n,t){for(var u=n.length,r,i=0;i<u;i++)n[i].ss_i=i;for(n.sort(function(n,i){return r=t(n,i),r===0?n.ss_i-i.ss_i:r}),i=0;i<u;i++)delete n[i].ss_i}function pr(n){for(var t=n.length,i=n[0];t--;)n[t]<i&&(i=n[t]);return i}function di(n){for(var t=n.length,i=n[0];t--;)n[t]>i&&(i=n[t]);return i}function er(n,t){for(var i in n)n[i]&&n[i]!==t&&n[i].destroy&&n[i].destroy(),delete n[i]}function wr(n){vu||(vu=lt(dr));n&&vu.appendChild(n);vu.innerHTML=""}function ni(n){return parseFloat(n.toPrecision(14))}function nu(t,i){tr=n(t,i.animation)}function pf(){var r=w.global.useUTC,t=r?"getUTC":"get",i=r?"setUTC":"set";vt=w.global.Date||window.Date;hr=(r&&w.global.timezoneOffset||0)*6e4;yu=r?vt.UTC:function(t,i,r,u,f,e){return new vt(t,i,n(r,1),n(u,0),n(f,0),n(e,0)).getTime()};hf=t+"Minutes";cf=t+"Hours";lf=t+"Day";gr=t+"Date";pu=t+"Month";wu=t+"FullYear";df=i+"Minutes";gf=i+"Hours";af=i+"Date";ne=i+"Month";te=i+"FullYear"}function ht(){}function tu(n,t,i,r){this.axis=n;this.pos=t;this.type=i||"";this.isNew=!0;i||r||this.addLabel()}function k(){this.init.apply(this,arguments)}function yi(){this.init.apply(this,arguments)}function wf(t,i,r,u,f){var e=t.chart.inverted;this.axis=t;this.isNegative=r;this.options=i;this.x=u;this.total=null;this.points={};this.stack=f;this.alignOptions={align:i.align||(e?r?"left":"right":"center"),verticalAlign:i.verticalAlign||(e?"middle":r?"bottom":"top"),y:n(i.y,e?4:r?14:-6),x:n(i.x,e?r?-6:6:0)};this.textAlign=i.textAlign||(e?r?"right":"left":"center")}function uf(n){var t=n.options,i=t.navigator,r=i.enabled,t=t.scrollbar,u=t.enabled,f=r?i.height:0,e=u?t.height:0;this.handles=[];this.scrollbarButtons=[];this.elementsToDestroy=[];this.chart=n;this.setBaseSeries();this.height=f;this.scrollbarHeight=e;this.scrollbarEnabled=u;this.navigatorEnabled=r;this.navigatorOptions=i;this.scrollbarOptions=t;this.outlineHeight=f+e;this.init()}function ff(n){this.init(n)}var i,c=document,it=window,st=Math,r=st.round,et=st.floor,br=st.ceil,f=st.max,s=st.min,d=st.abs,pt=st.cos,ti=st.sin,ci=st.PI,or=ci/180,gi=navigator.userAgent,bf=it.opera,sr=/msie/i.test(gi)&&!bf,au=c.documentMode===8,ef=/AppleWebKit/.test(gi),iu=/Firefox/.test(gi),fu=/(Mobile|Android|Windows Phone)/.test(gi),nr="http://www.w3.org/2000/svg",wt=!!c.createElementNS&&!!c.createElementNS(nr,"svg").createSVGRect,fe=iu&&parseInt(gi.split("Firefox/")[1],10)<4,ii=!wt&&!sr&&!!c.createElement("canvas").getContext,kr,ru,kf={},of=0,vu,w,pi,tr,sf,l,ri,ei=function(){return i},at=[],eu=0,dr="div",ct="none",ee=/^[0-9]+$/,oe="stroke-width",vt,yu,hr,hf,cf,lf,gr,pu,wu,df,gf,af,ne,te,v={},g,rt,ft,gt,su,bt,ie,gu,li,lr,hu,ai,y,vi,oi,uu,cu,nt,lu;it.Highcharts?ri(16,!0):g=it.Highcharts={};pi=function(t,i,f){if(!u(i)||isNaN(i))return"Invalid date";var t=n(t,"%Y-%m-%d %H:%M:%S"),o=new vt(i-hr),s,h=o[cf](),a=o[lf](),v=o[gr](),c=o[pu](),y=o[wu](),l=w.lang,p=l.weekdays,o=e({a:p[a].substr(0,3),A:p[a],d:yr(v),e:v,b:l.shortMonths[c],B:l.months[c],m:yr(c+1),y:y.toString().substr(2,2),Y:y,H:yr(h),I:yr(h%12||12),l:h%12||12,M:yr(o[hf]()),p:h<12?"AM":"PM",P:h<12?"am":"pm",S:yr(o.getSeconds()),L:yr(r(i%1e3),3)},g.dateFormats);for(s in o)for(;t.indexOf("%"+s)!==-1;)t=t.replace("%"+s,typeof o[s]=="function"?o[s](i):o[s]);return f?t.substr(0,1).toUpperCase()+t.substr(1):t};ri=function(n,t){var i="Highcharts error #"+n+": www.highcharts.com/errors/"+n;if(t)throw i;it.console&&console.log(i)};l={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:26784e5,year:31556952e3};sf={init:function(n,t,i){var t=t||"",r=n.shift,e=t.indexOf("C")>-1,u=e?7:3,f,t=t.split(" "),i=[].concat(i),o,s,h=function(n){for(f=n.length;f--;)n[f]==="M"&&n.splice(f+1,0,n[f+1],n[f+2],n[f+1],n[f+2])};if(e&&(h(t),h(i)),n.isArea&&(o=t.splice(t.length-6,6),s=i.splice(i.length-6,6)),r<=i.length/u&&t.length===i.length)for(;r--;)i=[].concat(i).splice(0,u).concat(i);if(n.shift=0,t.length)for(n=i.length;t.length<n;)r=[].concat(t).splice(t.length-u,u),e&&(r[u-6]=r[u-2],r[u-5]=r[u-1]),t=t.concat(r);return o&&(t=t.concat(o),i=i.concat(s)),[t,i]},step:function(n,t,i,r){var f=[],u=n.length;if(i===1)f=r;else if(u===t.length&&i<1)for(;u--;)r=parseFloat(n[u]),f[u]=isNaN(r)?n[u]:i*parseFloat(t[u]-r)+r;else f=t;return f}},function(n){it.HighchartsAdapter=it.HighchartsAdapter||n&&{init:function(t){var r=n.fx;n.extend(n.easing,{easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i}});n.each(["cur","_default","width","height","opacity"],function(t,u){var f=r.step,e;u==="cur"?f=r.prototype:u==="_default"&&n.Tween&&(f=n.Tween.propHooks[u],u="set");(e=f[u])&&(f[u]=function(n){var r,n=t?n:this;if(n.prop!=="align")return r=n.elem,r.attr?r.attr(n.prop,u==="cur"?i:n.now):e.apply(this,arguments)})});tt(n.cssHooks.opacity,"get",function(n,t,i){return t.attr?t.opacity||0:n.call(this,t,i)});this.addAnimSetter("d",function(n){var i=n.elem,r;n.started||(r=t.init(i,i.d,i.toD),n.start=r[0],n.end=r[1],n.started=!0);i.attr("d",t.step(n.start,n.end,n.pos,i.toD))});this.each=Array.prototype.forEach?function(n,t){return Array.prototype.forEach.call(n,t)}:function(n,t){for(var r=n.length,i=0;i<r;i++)if(t.call(n[i],n[i],i,n)===!1)return i};n.fn.highcharts=function(){var u="Chart",t=arguments,n,r;return this[0]&&(vr(t[0])&&(u=t[0],t=Array.prototype.slice.call(t,1)),n=t[0],n!==i&&(n.chart=n.chart||{},n.chart.renderTo=this[0],new g[u](n,t[1]),r=this),n===i&&(r=at[ot(this[0],"data-highcharts-chart")])),r}},addAnimSetter:function(t,i){n.Tween?n.Tween.propHooks[t]={set:i}:n.fx.step[t]=i},getScript:n.getScript,inArray:n.inArray,adapterRun:function(t,i){return n(t)[i]()},grep:n.grep,map:function(n,t){for(var r=[],i=0,u=n.length;i<u;i++)r[i]=t.call(n[i],n[i],i,n);return r},offset:function(t){return n(t).offset()},addEvent:function(t,i,r){n(t).bind(i,r)},removeEvent:function(t,i,r){var u=c.removeEventListener?"removeEventListener":"detachEvent";c[u]&&t&&!t[u]&&(t[u]=function(){});n(t).unbind(i,r)},fireEvent:function(t,i,r,u){var f=n.Event(i),o="detached"+i,s;!sr&&r&&(delete r.layerX,delete r.layerY,delete r.returnValue);e(f,r);t[i]&&(t[o]=t[i],t[i]=null);n.each(["preventDefault","stopPropagation"],function(n,t){var i=f[t];f[t]=function(){try{i.call(f)}catch(n){t==="preventDefault"&&(s=!0)}}});n(t).trigger(f);t[o]&&(t[i]=t[o],t[o]=null);!u||f.isDefaultPrevented()||s||u(f)},washMouseEvent:function(n){var t=n.originalEvent||n;return t.pageX===i&&(t.pageX=n.pageX,t.pageY=n.pageY),t},animate:function(t,r,u){var f=n(t);t.style||(t.style={});r.d&&(t.toD=r.d,r.d=1);f.stop();r.opacity!==i&&t.attr&&(r.opacity+="px");t.hasAnim=1;f.animate(r,u)},stop:function(t){t.hasAnim&&n(t).stop()}}}(it.jQuery);nt=it.HighchartsAdapter;rt=nt||{};nt&&nt.init.call(nt,sf);var bu=rt.adapterRun,se=rt.getScript,cr=rt.inArray,t=rt.each,ku=rt.grep,he=rt.offset,wi=rt.map,h=rt.addEvent,ut=rt.removeEvent,b=rt.fireEvent,ce=rt.washMouseEvent,du=rt.animate,ou=rt.stop,rt={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};w={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/stock/2.0.4/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/stock/2.0.4/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1e3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:o(rt,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":ki(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1e3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:wt,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}<\/span><br/>',pointFormat:'<span style="color:{series.color}">●<\/span> {series.name}: <b>{point.y}<\/b><br/>',shadow:!0,snap:fu?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};ft=w.plotOptions;nt=ft.line;pf();var le=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,ae=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,ve=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,ir=function(n){var i=[],r,u;return function(n){n&&n.stops?u=wi(n.stops,function(n){return ir(n[1])}):(r=le.exec(n))?i=[a(r[1]),a(r[2]),a(r[3]),parseFloat(r[4],10)]:(r=ae.exec(n))?i=[a(r[1],16),a(r[2],16),a(r[3],16),1]:(r=ve.exec(n))&&(i=[a(r[1]),a(r[2]),a(r[3]),1])}(n),{get:function(r){var f;return u?(f=o(n),f.stops=[].concat(f.stops),t(u,function(n,t){f.stops[t]=[f.stops[t][0],n.get(r)]})):f=i&&!isNaN(i[0])?r==="rgb"?"rgb("+i[0]+","+i[1]+","+i[2]+")":r==="a"?i[3]:"rgba("+i.join(",")+")":n,f},brighten:function(n){if(u)t(u,function(t){t.brighten(n)});else if(ui(n)&&n!==0)for(var r=0;r<3;r++)i[r]+=a(n*255),i[r]<0&&(i[r]=0),i[r]>255&&(i[r]=255);return this},rgba:i,setOpacity:function(n){return i[3]=n,this}}};if(ht.prototype={opacity:1,textProps:"fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow,HcTextStroke".split(","),init:function(n,t){this.element=t==="span"?lt(t):c.createElementNS(nr,t);this.renderer=n},animate:function(t,i,r){return i=n(i,tr,!0),ou(this),i?(i=o(i,{}),r&&(i.complete=r),du(this,t,i)):(this.attr(t),r&&r()),this},colorGradient:function(n,i,r){var l=this.renderer,p,s,f,a,v,y,w,b,e,c,h=[];if(n.linearGradient?s="linearGradient":n.radialGradient&&(s="radialGradient"),s){f=n[s];a=l.gradients;y=n.stops;e=r.radialReference;rr(f)&&(n[s]=f={x1:f[0],y1:f[1],x2:f[2],y2:f[3],gradientUnits:"userSpaceOnUse"});s==="radialGradient"&&e&&!u(f.gradientUnits)&&(f=o(f,{cx:e[0]-e[2]/2+f.cx*e[2],cy:e[1]-e[2]/2+f.cy*e[2],r:f.r*e[2],gradientUnits:"userSpaceOnUse"}));for(c in f)c!=="id"&&h.push(c,f[c]);for(c in y)h.push(y[c]);h=h.join(",");a[h]?n=a[h].attr("id"):(f.id=n="highcharts-"+of++,a[h]=v=l.createElement(s).attr(f).add(l.defs),v.stops=[],t(y,function(n){n[1].indexOf("rgba")===0?(p=ir(n[1]),w=p.get("rgb"),b=p.get("a")):(w=n[1],b=1);n=l.createElement("stop").attr({offset:n[0],"stop-color":w,"stop-opacity":b}).add(v);v.stops.push(n)}));r.setAttribute(i,"url("+l.url+"#"+n+")")}},attr:function(n,t){var r,u,e=this.element,o,s=this,f;if(typeof n=="string"&&t!==i&&(r=n,n={},n[r]=t),typeof n=="string")s=(this[n+"Getter"]||this._defaultGetter).call(this,n,e);else{for(r in n)u=n[r],f=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(r)&&(o||(this.symbolAttr(n),o=!0),f=!0),this.rotation&&(r==="x"||r==="y")&&(this.doTransform=!0),f||(this[r+"Setter"]||this._defaultSetter).call(this,u,r,e),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(r)&&this.updateShadows(r,u);this.doTransform&&(this.updateTransform(),this.doTransform=!1)}return s},updateShadows:function(n,t){for(var i=this.shadows,r=i.length;r--;)i[r].setAttribute(n,n==="height"?f(t-(i[r].cutHeight||0),0):n==="d"?this.d:t)},addClass:function(n){var t=this.element,i=ot(t,"class")||"";return i.indexOf(n)===-1&&ot(t,"class",i+" "+n),this},symbolAttr:function(i){var r=this;t("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(t){r[t]=n(i[t],r[t])});r.attr({d:r.renderer.symbols[r.symbolName](r.x,r.y,r.width,r.height,r)})},clip:function(n){return this.attr("clip-path",n?"url("+this.renderer.url+"#"+n.id+")":ct)},crisp:function(n){var t,u={},i,f=n.strokeWidth||this.strokeWidth||0;i=r(f)%2/2;n.x=et(n.x||this.x||0)+i;n.y=et(n.y||this.y||0)+i;n.width=et((n.width||this.width||0)-2*i);n.height=et((n.height||this.height||0)-2*i);n.strokeWidth=f;for(t in n)this[t]!==n[t]&&(this[t]=u[t]=n[t]);return u},css:function(n){var i=this.styles,u={},f=this.element,r,t,o="";if(r=!i,n&&n.color&&(n.fill=n.color),i)for(t in n)n[t]!==i[t]&&(u[t]=n[t],r=!0);if(r){if(r=this.textWidth=n&&n.width&&f.nodeName.toLowerCase()==="text"&&a(n.width),i&&(n=e(i,u)),this.styles=n,r&&(ii||!wt&&this.renderer.forExport)&&delete n.width,sr&&!wt)p(this.element,n);else{i=function(n,t){return"-"+t.toLowerCase()};for(t in n)o+=t.replace(/([A-Z])/g,i)+":"+n[t]+";";ot(f,"style",o)}r&&this.added&&this.renderer.buildText(this)}return this},on:function(n,t){var r=this,i=r.element;return ru&&n==="click"?(i.ontouchstart=function(n){r.touchEventFired=vt.now();n.preventDefault();t.call(i,n)},i.onclick=function(n){(gi.indexOf("Android")===-1||vt.now()-(r.touchEventFired||0)>1100)&&t.call(i,n)}):i["on"+n]=t,this},setRadialReference:function(n){return this.element.radialReference=n,this},translate:function(n,t){return this.attr({translateX:n,translateY:t})},invert:function(){return this.inverted=!0,this.updateTransform(),this},updateTransform:function(){var t=this.translateX||0,r=this.translateY||0,f=this.scaleX,e=this.scaleY,o=this.inverted,s=this.rotation,i=this.element;o&&(t+=this.attr("width"),r+=this.attr("height"));t=["translate("+t+","+r+")"];o?t.push("rotate(90) scale(-1,1)"):s&&t.push("rotate("+s+" "+(i.getAttribute("x")||0)+" "+(i.getAttribute("y")||0)+")");(u(f)||u(e))&&t.push("scale("+n(f,1)+" "+n(e,1)+")");t.length&&i.setAttribute("transform",t.join(" "))},toFront:function(){var n=this.element;return n.parentNode.appendChild(n),this},align:function(t,i,u){var e,f,o,h,s={};return f=this.renderer,o=f.alignedObjects,t?(this.alignOptions=t,this.alignByTranslate=i,!u||vr(u))&&(this.alignTo=e=u||"renderer",hi(o,this),o.push(this),u=null):(t=this.alignOptions,i=this.alignByTranslate,e=this.alignTo),u=n(u,f[e],f),e=t.align,f=t.verticalAlign,o=(u.x||0)+(t.x||0),h=(u.y||0)+(t.y||0),(e==="right"||e==="center")&&(o+=(u.width-(t.width||0))/{right:1,center:2}[e]),s[i?"translateX":"x"]=r(o),(f==="bottom"||f==="middle")&&(h+=(u.height-(t.height||0))/({bottom:1,middle:2}[f]||1)),s[i?"translateY":"y"]=r(h),this[this.placed?"animate":"attr"](s),this.placed=!0,this.alignAttr=s,this},getBBox:function(){var n=this.bBox,o=this.renderer,t,i,s=this.rotation,r,u,f;if(t=this.element,r=this.styles,u=s*or,i=this.textStr,(i===""||ee.test(i))&&(f="num."+i.toString().length+(r?"|"+r.fontSize+"|"+r.fontFamily:"")),f&&(n=o.cache[f]),!n){if(t.namespaceURI===nr||o.forExport){try{n=t.getBBox?e({},t.getBBox()):{width:t.offsetWidth,height:t.offsetHeight}}catch(h){}(!n||n.width<0)&&(n={width:0,height:0})}else n=this.htmlGetBBox();o.isSVG&&(t=n.width,i=n.height,sr&&r&&r.fontSize==="11px"&&i.toPrecision(3)==="16.9"&&(n.height=i=14),s&&(n.width=d(i*ti(u))+d(t*pt(u)),n.height=d(i*pt(u))+d(t*ti(u))));this.bBox=n;f&&(o.cache[f]=n)}return n},show:function(n){return n&&this.element.namespaceURI===nr?this.element.removeAttribute("visibility"):this.attr({visibility:n?"inherit":"visible"}),this},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(n){var t=this;t.animate({opacity:0},{duration:n||150,complete:function(){t.attr({y:-9999})}})},add:function(n){var t=this.renderer,i=n||t,e=i.element||t.box,o=this.element,r=this.zIndex,f,s;if(n&&(this.parentGroup=n),this.parentInverted=n&&n.inverted,this.textStr!==void 0&&t.buildText(this),r&&(i.handleZ=!0,r=a(r)),i.handleZ)for(n=e.childNodes,f=0;f<n.length;f++)if(t=n[f],i=ot(t,"zIndex"),t!==o&&(a(i)>r||!u(r)&&u(i))){e.insertBefore(o,t);s=!0;break}return s||e.appendChild(o),this.added=!0,this.onAdd&&this.onAdd(),this},safeRemoveChild:function(n){var t=n.parentNode;t&&t.removeChild(n)},destroy:function(){var n=this,i=n.element||{},f=n.shadows,r=n.renderer.isSVG&&i.nodeName==="SPAN"&&n.parentGroup,e,u;if(i.onclick=i.onmouseout=i.onmouseover=i.onmousemove=i.point=null,ou(n),n.clipPath&&(n.clipPath=n.clipPath.destroy()),n.stops){for(u=0;u<n.stops.length;u++)n.stops[u]=n.stops[u].destroy();n.stops=null}for(n.safeRemoveChild(i),f&&t(f,function(t){n.safeRemoveChild(t)});r&&r.div&&r.div.childNodes.length===0;)i=r.parentGroup,n.safeRemoveChild(r.div),delete r.div,r=i;n.alignTo&&hi(n.renderer.alignedObjects,n);for(e in n)delete n[e];return null},shadow:function(t,i,r){var c=[],e,u,h=this.element,o,s,l,a;if(t){for(s=n(t.width,3),l=(t.opacity||.15)/s,a=this.parentInverted?"(-1,-1)":"("+n(t.offsetX,1)+", "+n(t.offsetY,1)+")",e=1;e<=s;e++)u=h.cloneNode(0),o=s*2+1-2*e,ot(u,{isShadow:"true",stroke:t.color||"black","stroke-opacity":l*e,"stroke-width":o,transform:"translate"+a,fill:ct}),r&&(ot(u,"height",f(ot(u,"height")-o,0)),u.cutHeight=o),i?i.element.appendChild(u):h.parentNode.insertBefore(u,h),c.push(u);this.shadows=c}return this},xGetter:function(n){return this.element.nodeName==="circle"&&(n={x:"cx",y:"cy"}[n]||n),this._defaultGetter(n)},_defaultGetter:function(t){return t=n(this[t],this.element?this.element.getAttribute(t):null,0),/^[\-0-9\.]+$/.test(t)&&(t=parseFloat(t)),t},dSetter:function(n,t,i){n&&n.join&&(n=n.join(" "));/(NaN| {2}|^$)/.test(n)&&(n="M 0 0");i.setAttribute(t,n);this[t]=n},dashstyleSetter:function(n){var t;if(n=n&&n.toLowerCase()){for(n=n.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(","),t=n.length;t--;)n[t]=a(n[t])*this["stroke-width"];n=n.join(",").replace("NaN","none");this.element.setAttribute("stroke-dasharray",n)}},alignSetter:function(n){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[n])},opacitySetter:function(n,t,i){this[t]=n;i.setAttribute(t,n)},titleSetter:function(t){var i=this.element.getElementsByTagName("title")[0];i||(i=c.createElementNS(nr,"title"),this.element.appendChild(i));i.textContent=n(t,"").replace(/<[^>]*>/g,"")},textSetter:function(n){n!==this.textStr&&(delete this.bBox,this.textStr=n,this.added&&this.renderer.buildText(this))},fillSetter:function(n,t,i){typeof n=="string"?i.setAttribute(t,n):n&&this.colorGradient(n,t,i)},zIndexSetter:function(n,t,i){i.setAttribute(t,n);this[t]=n},_defaultSetter:function(n,t,i){i.setAttribute(t,n)}},ht.prototype.yGetter=ht.prototype.xGetter,ht.prototype.translateXSetter=ht.prototype.translateYSetter=ht.prototype.rotationSetter=ht.prototype.verticalAlignSetter=ht.prototype.scaleXSetter=ht.prototype.scaleYSetter=function(n,t){this[t]=n;this.doTransform=!0},ht.prototype["stroke-widthSetter"]=ht.prototype.strokeSetter=function(n,t,i){this[t]=n;this.stroke&&this["stroke-width"]?(this.strokeWidth=this["stroke-width"],ht.prototype.fillSetter.call(this,this.stroke,"stroke",i),i.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):t==="stroke-width"&&n===0&&this.hasStroke&&(i.removeAttribute("stroke"),this.hasStroke=!1)},gt=function(){this.init.apply(this,arguments)},gt.prototype={Element:ht,init:function(n,t,i,r,u){var o=location,e,r=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(r)),f;e=r.element;n.appendChild(e);n.innerHTML.indexOf("xmlns")===-1&&ot(e,"xmlns",nr);this.isSVG=!0;this.box=e;this.boxWrapper=r;this.alignedObjects=[];this.url=(iu||ef)&&c.getElementsByTagName("base").length?o.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(c.createTextNode("Created with Highstock 2.0.4"));this.defs=this.createElement("defs").add();this.forExport=u;this.gradients={};this.cache={};this.setSize(t,i,!1);iu&&n.getBoundingClientRect&&(this.subPixelFix=t=function(){p(n,{left:0,top:0});f=n.getBoundingClientRect();p(n,{left:br(f.left)-f.left+"px",top:br(f.top)-f.top+"px"})},t(),h(it,"resize",t))},getStyle:function(n){return this.style=e({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},n)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var n=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),er(this.gradients||{}),this.gradients=null,n&&(this.defs=n.destroy()),this.subPixelFix&&ut(it,"resize",this.subPixelFix),this.alignedObjects=null},createElement:function(n){var t=new this.Element;return t.init(this,n),t},draw:function(){},buildText:function(i){for(var f=i.element,e=this,v=e.forExport,r=n(i.textStr,"").toString(),y=r.indexOf("<")!==-1,w=f.childNodes,s,h,l=ot(f,"x"),u=i.styles,o=i.textWidth,b=u&&u.lineHeight,g=u&&u.HcTextStroke,k=w.length,d=function(n){return b?a(b):e.fontMetrics(/(px|em)$/.test(n&&n.style.fontSize)?n.style.fontSize:u&&u.fontSize||e.style.fontSize||12,n).h};k--;)f.removeChild(w[k]);!y&&!g&&r.indexOf(" ")===-1?f.appendChild(c.createTextNode(r)):(s=/<.*style="([^"]+)".*>/,h=/<.*href="(http[^"]+)".*>/,o&&!i.added&&this.box.appendChild(f),r=y?r.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"<\/span>").split(/<br.*?>/g):[r],r[r.length-1]===""&&r.pop(),t(r,function(n,r){var a,y=0,n=n.replace(/<span/g,"|||<span").replace(/<\/span>/g,"<\/span>|||");a=n.split("|||");t(a,function(n){var w,t,k;if((n!==""||a.length===1)&&(w={},t=c.createElementNS(nr,"tspan"),s.test(n)&&(k=n.match(s)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),ot(t,"style",k)),h.test(n)&&!v&&(ot(t,"onclick",'location.href="'+n.match(h)[1]+'"'),p(t,{cursor:"pointer"})),n=(n.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">"),n!==" ")){if(t.appendChild(c.createTextNode(n)),y?w.dx=0:r&&l!==null&&(w.x=l),ot(t,w),f.appendChild(t),!y&&r&&(!wt&&v&&p(t,{display:"block"}),ot(t,"dy",d(t))),o)for(var n=n.replace(/([^\^])-/g,"$1- ").split(" "),w=a.length>1||n.length>1&&u.whiteSpace!=="nowrap",g,b,tt=u.HcHeight,nt=[],it=d(t),rt=1;w&&(n.length||nt.length);)delete i.bBox,g=i.getBBox(),b=g.width,!wt&&e.forExport&&(b=e.measureSpanWidth(t.firstChild.data,i.styles)),g=b>o,!g||n.length===1?(n=nt,nt=[],n.length&&(rt++,tt&&rt*it>tt?(n=["..."],i.attr("title",i.textStr)):(t=c.createElementNS(nr,"tspan"),ot(t,{dy:it,x:l}),k&&ot(t,"style",k),f.appendChild(t))),b>o&&(o=b)):(t.removeChild(t.firstChild),nt.unshift(n.pop())),n.length&&t.appendChild(c.createTextNode(n.join(" ").replace(/- /g,"-")));y++}})}))},button:function(n,t,i,r,u,f,s,c,l){var a=this.label(n,t,i,l,null,null,null,null,"button"),v=0,b,k,y,p,w,d,n={x1:0,y1:0,x2:0,y2:1},u=o({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:n,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},u);return y=u.style,delete u.style,f=o(u,{stroke:"#68A",fill:{linearGradient:n,stops:[[0,"#FFF"],[1,"#ACF"]]}},f),p=f.style,delete f.style,s=o(u,{stroke:"#68A",fill:{linearGradient:n,stops:[[0,"#9BD"],[1,"#CDF"]]}},s),w=s.style,delete s.style,c=o(u,{style:{color:"#CCC"}},c),d=c.style,delete c.style,h(a.element,sr?"mouseover":"mouseenter",function(){v!==3&&a.attr(f).css(p)}),h(a.element,sr?"mouseout":"mouseleave",function(){v!==3&&(b=[u,f,s][v],k=[y,p,w][v],a.attr(b).css(k))}),a.setState=function(n){(a.state=v=n)?n===2?a.attr(s).css(w):n===3&&a.attr(c).css(d):a.attr(u).css(y)},a.on("click",function(){v!==3&&r.call(a)}).attr(u).css(e({cursor:"default"},y))},crispLine:function(n,t){return n[1]===n[4]&&(n[1]=n[4]=r(n[1])-t%2/2),n[2]===n[5]&&(n[2]=n[5]=r(n[2])+t%2/2),n},path:function(n){var t={fill:ct};return rr(n)?t.d=n:kt(n)&&e(t,n),this.createElement("path").attr(t)},circle:function(n,t,i){return n=kt(n)?n:{x:n,y:t,r:i},t=this.createElement("circle"),t.xSetter=function(n){this.element.setAttribute("cx",n)},t.ySetter=function(n){this.element.setAttribute("cy",n)},t.attr(n)},arc:function(n,t,i,r,u,f){return kt(n)&&(t=n.y,i=n.r,r=n.innerR,u=n.start,f=n.end,n=n.x),n=this.symbol("arc",n||0,t||0,i||0,i||0,{innerR:r||0,start:u||0,end:f||0}),n.r=i,n},rect:function(n,t,r,u,e,o){var e=kt(n)?n.r:e,s=this.createElement("rect"),n=kt(n)?n:n===i?{}:{x:n,y:t,width:f(r,0),height:f(u,0)};return o!==i&&(n.strokeWidth=o,n=s.crisp(n)),e&&(n.r=e),s.rSetter=function(n){ot(this.element,{rx:n,ry:n})},s.attr(n)},setSize:function(t,i,r){var u=this.alignedObjects,f=u.length;for(this.width=t,this.height=i,this.boxWrapper[n(r,!0)?"animate":"attr"]({width:t,height:i});f--;)u[f].align()},g:function(n){var t=this.createElement("g");return u(n)?t.attr({"class":"highcharts-"+n}):t},image:function(n,t,i,r,u){var f={preserveAspectRatio:ct};return arguments.length>1&&e(f,{x:t,y:i,width:r,height:u}),f=this.createElement("image").attr(f),f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",n):f.element.setAttribute("hc-svg-href",n),f},symbol:function(n,t,i,u,f,o){var s,c=this.symbols[n],c=c&&c(r(t),r(i),u,f,o),a=/^url\((.*?)\)$/,h,l;return c?(s=this.path(c),e(s,{symbolName:n,x:t,y:i,width:u,height:f}),o&&e(s,o)):a.test(n)&&(l=function(n,t){n.element&&(n.attr({width:t[0],height:t[1]}),n.alignByTranslate||n.translate(r((u-t[0])/2),r((f-t[1])/2)))},h=n.match(a)[1],n=kf[h]||o&&o.width&&o.height&&[o.width,o.height],s=this.image(h).attr({x:t,y:i}),s.isImg=!0,n?l(s,n):(s.attr({width:0,height:0}),lt("img",{onload:function(){l(s,kf[h]=[this.width,this.height])},src:h}))),s},symbols:{circle:function(n,t,i,r){var u=.166*i;return["M",n+i/2,t,"C",n+i+u,t,n+i+u,t+r,n+i/2,t+r,"C",n-u,t+r,n-u,t,n+i/2,t,"Z"]},square:function(n,t,i,r){return["M",n,t,"L",n+i,t,n+i,t+r,n,t+r,"Z"]},triangle:function(n,t,i,r){return["M",n+i/2,t,"L",n+i,t+r,n,t+r,"Z"]},"triangle-down":function(n,t,i,r){return["M",n,t,"L",n+i,t,n+i/2,t+r,"Z"]},diamond:function(n,t,i,r){return["M",n+i/2,t,"L",n+i,t+r/2,n+i/2,t+r,n,t+r/2,"Z"]},arc:function(n,t,i,r,u){var e=u.start,i=u.r||i||r,f=u.end-.001,r=u.innerR,o=u.open,s=pt(e),h=ti(e),c=pt(f),f=ti(f),u=u.end-e<ci?0:1;return["M",n+i*s,t+i*h,"A",i,i,0,u,1,n+i*c,t+i*f,o?"M":"L",n+r*c,t+r*f,"A",r,r,0,u,0,n+r*s,t+r*h,o?"":"Z"]},callout:function(n,t,i,u,f){var e=s(f&&f.r||0,i,u),c=e+6,o=f&&f.anchorX,h=f&&f.anchorY,f=r(f.strokeWidth||0)%2/2;return n+=f,t+=f,f=["M",n+e,t,"L",n+i-e,t,"C",n+i,t,n+i,t,n+i,t+e,"L",n+i,t+u-e,"C",n+i,t+u,n+i,t+u,n+i-e,t+u,"L",n+e,t+u,"C",n,t+u,n,t+u,n,t+u-e,"L",n,t+e,"C",n,t,n,t,n+e,t],o&&o>i&&h>t+c&&h<t+u-c?f.splice(13,3,"L",n+i,h-6,n+i+6,h,n+i,h+6,n+i,t+u-e):o&&o<0&&h>t+c&&h<t+u-c?f.splice(33,3,"L",n,h+6,n-6,h,n,h-6,n,t+e):h&&h>u&&o>n+c&&o<n+i-c?f.splice(23,3,"L",o+6,t+u,o,t+u+6,o-6,t+u,n+e,t+u):h&&h<0&&o>n+c&&o<n+i-c&&f.splice(3,3,"L",o-6,t,o,t-6,o+6,t,i-e,t),f}},clipRect:function(n,t,i,r){var u="highcharts-"+of++,f=this.createElement("clipPath").attr({id:u}).add(this.defs),n=this.rect(n,t,i,r,0).add(f);return n.id=u,n.clipPath=f,n},text:function(n,t,i,r){var f=ii||!wt&&this.forExport,u={};return r&&!this.forExport?this.html(n,t,i):(u.x=Math.round(t||0),i&&(u.y=Math.round(i)),(n||n===0)&&(u.text=n),n=this.createElement("text").attr(u),f&&n.css({position:"absolute"}),r||(n.xSetter=function(n,t,i){for(var f=i.getElementsByTagName("tspan"),u,e=i.getAttribute(t),r=0;r<f.length;r++)u=f[r],u.getAttribute(t)===e&&u.setAttribute(t,n);i.setAttribute(t,n)}),n)},fontMetrics:function(n,t){n=n||this.style.fontSize;t&&it.getComputedStyle&&(t=t.element||t,n=it.getComputedStyle(t,"").fontSize);var n=/px/.test(n)?a(n):/em/.test(n)?parseFloat(n)*12:12,i=n<24?n+4:r(n*1.2),u=r(i*.8);return{h:i,b:u,f:n}},label:function(n,f,s,h,c,l,a,v,y){function yt(){var n,t;n=w.element.style;d=(nt===void 0||ot===void 0||p.styles.textAlign)&&w.textStr&&w.getBBox();p.width=(nt||d.width||0)+2*k+et;p.height=(ot||d.height||0)+2*k;at=k+g.fontMetrics(n&&n.fontSize,w).b;vt&&(b||(n=r(-it*k),t=v?-at:0,p.box=b=h?g.symbol(h,n,t,p.width,p.height,rt):g.rect(n,t,p.width,p.height,0,rt[oe]),b.attr("fill",ct).add(p)),b.isImg||b.attr(e({width:r(p.width),height:r(p.height)},rt)),rt=null)}function ft(){var n=p.styles,n=n&&n.textAlign,r=et+k*(1-it),t;t=v?0:at;u(nt)&&d&&(n==="center"||n==="right")&&(r+={center:.5,right:1}[n]*(nt-d.width));(r!==w.x||t!==w.y)&&(w.attr("x",r),t!==i&&w.attr("y",t));w.x=r;w.y=t}function tt(n,t){b?b.attr(n,t):rt[n]=t}var g=this,p=g.g(y),w=g.text("",0,0,a).attr({zIndex:1}),b,d,it=0,k=3,et=0,nt,ot,st,lt,pt=0,rt={},at,vt,wt;return p.onAdd=function(){w.add(p);p.attr({text:n||n===0?n:"",x:f,y:s});b&&u(c)&&p.attr({anchorX:c,anchorY:l})},p.widthSetter=function(n){nt=n},p.heightSetter=function(n){ot=n},p.paddingSetter=function(n){u(n)&&n!==k&&(k=n,ft())},p.paddingLeftSetter=function(n){u(n)&&n!==et&&(et=n,ft())},p.alignSetter=function(n){it={left:0,center:.5,right:1}[n]},p.textSetter=function(n){n!==i&&w.textSetter(n);yt();ft()},p["stroke-widthSetter"]=function(n,t){n&&(vt=!0);pt=n%2/2;tt(t,n)},p.strokeSetter=p.fillSetter=p.rSetter=function(n,t){t==="fill"&&n&&(vt=!0);tt(t,n)},p.anchorXSetter=function(n,t){c=n;tt(t,n+pt-st)},p.anchorYSetter=function(n,t){l=n;tt(t,n-lt)},p.xSetter=function(n){p.x=n;it&&(n-=it*((nt||d.width)+k));st=r(n);p.attr("translateX",st)},p.ySetter=function(n){lt=p.y=r(n);p.attr("translateY",lt)},wt=p.css,e(p,{css:function(n){if(n){var r={},n=o(n);t(p.textProps,function(t){n[t]!==i&&(r[t]=n[t],delete n[t])});w.css(r)}return wt.call(p,n)},getBBox:function(){return{width:d.width+2*k,height:d.height+2*k,x:d.x-k,y:d.y-k}},shadow:function(n){return b&&b.shadow(n),p},destroy:function(){ut(p.element,"mouseenter");ut(p.element,"mouseleave");w&&(w=w.destroy());b&&(b=b.destroy());ht.prototype.destroy.call(p);p=g=yt=ft=tt=null}})}},kr=gt,e(ht.prototype,{htmlCss:function(n){var t=this.element;return(t=n&&t.tagName==="SPAN"&&n.width)&&(delete n.width,this.textWidth=t,this.updateTransform()),this.styles=e(this.styles,n),p(this.element,n),this},htmlGetBBox:function(){var n=this.element,t=this.bBox;return t||(n.nodeName==="text"&&(n.style.position="absolute"),t=this.bBox={x:n.offsetLeft,y:n.offsetTop,width:n.offsetWidth,height:n.offsetHeight}),t},htmlUpdateTransform:function(){if(this.added){var h=this.renderer,i=this.element,c=this.translateX||0,l=this.translateY||0,w=this.x||0,b=this.y||0,o=this.textAlign||"left",v={left:0,center:.5,right:1}[o],r=this.shadows;if(p(i,{marginLeft:c,marginTop:l}),r&&t(r,function(n){p(n,{marginLeft:c+1,marginTop:l+1})}),this.inverted&&t(i.childNodes,function(n){h.invertChild(n,i)}),i.tagName==="SPAN"){var f=this.rotation,e,s=a(this.textWidth),y=[f,o,i.innerHTML,this.textWidth].join(",");y!==this.cTT&&(e=h.fontMetrics(i.style.fontSize).b,u(f)&&this.setSpanRotation(f,v,e),r=n(this.elemWidth,i.offsetWidth),r>s&&/[ \-]/.test(i.textContent||i.innerText)&&(p(i,{width:s+"px",display:"block",whiteSpace:"normal"}),r=s),this.getSpanCorrection(r,e,v,f,o));p(i,{left:w+(this.xCorr||0)+"px",top:b+(this.yCorr||0)+"px"});ef&&(e=i.offsetHeight);this.cTT=y}}else this.alignOnAdd=!0},setSpanRotation:function(n,t,i){var r={},u=sr?"-ms-transform":ef?"-webkit-transform":iu?"MozTransform":bf?"-o-transform":"";r[u]=r.transform="rotate("+n+"deg)";r[u+(iu?"Origin":"-origin")]=r.transformOrigin=t*100+"% "+i+"px";p(this.element,r)},getSpanCorrection:function(n,t,i){this.xCorr=-n*i;this.yCorr=-t}}),e(gt.prototype,{html:function(n,i,u){var f=this.createElement("span"),o=f.element,s=f.renderer;return f.textSetter=function(n){n!==o.innerHTML&&delete this.bBox;o.innerHTML=this.textStr=n},f.xSetter=f.ySetter=f.alignSetter=f.rotationSetter=function(n,t){t==="align"&&(t="textAlign");f[t]=n;f.htmlUpdateTransform()},f.attr({text:n,x:r(i),y:r(u)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),f.css=f.htmlCss,s.isSVG&&(f.add=function(n){var i,r=s.box.parentNode,u=[];if(this.parentGroup=n){if(i=n.div,!i){for(;n;)u.push(n),n=n.parentGroup;t(u.reverse(),function(n){var t;i=n.div=n.div||lt(dr,{className:ot(n.element,"class")},{position:"absolute",left:(n.translateX||0)+"px",top:(n.translateY||0)+"px"},i||r);t=i.style;e(n,{translateXSetter:function(i,r){t.left=i+"px";n[r]=i;n.doTransform=!0},translateYSetter:function(i,r){t.top=i+"px";n[r]=i;n.doTransform=!0},visibilitySetter:function(n,i){t[i]=n}})})}}else i=r;return i.appendChild(o),f.added=!0,f.alignOnAdd&&f.htmlUpdateTransform(),f}),f}}),wt||ii||(bt={init:function(n,t){var i=["<",t,' filled="f" stroked="f"'],r=["position: ","absolute",";"],u=t===dr;(t==="shape"||u)&&r.push("left:0;top:0;width:1px;height:1px;");r.push("visibility: ",u?"hidden":"visible");i.push(' style="',r.join(""),'"/>');t&&(i=u||t==="span"||t==="img"?i.join(""):n.prepVML(i),this.element=lt(i));this.renderer=n},add:function(n){var i=this.renderer,r=this.element,t=i.box,t=n?n.element||n:t;return n&&n.inverted&&i.invertChild(r,t),t.appendChild(r),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this},updateTransform:ht.prototype.htmlUpdateTransform,setSpanRotation:function(){var n=this.rotation,t=pt(n*or),i=ti(n*or);p(this.element,{filter:n?["progid:DXImageTransform.Microsoft.Matrix(M11=",t,", M12=",-i,", M21=",i,", M22=",t,", sizingMethod='auto expand')"].join(""):ct})},getSpanCorrection:function(t,i,r,u,f){var e=u?pt(u*or):1,o=u?ti(u*or):0,h=n(this.elemHeight,this.element.offsetHeight),s;this.xCorr=e<0&&-t;this.yCorr=o<0&&-h;s=e*o<0;this.xCorr+=o*i*(s?1-r:r);this.yCorr-=e*i*(u?s?r:1-r:1);f&&f!=="left"&&(this.xCorr-=t*r*(e<0?-1:1),u&&(this.yCorr-=h*r*(o<0?-1:1)),p(this.element,{textAlign:f}))},pathToVML:function(n){for(var t=n.length,i=[];t--;)ui(n[t])?i[t]=r(n[t]*10)-5:n[t]==="Z"?i[t]="x":(i[t]=n[t],n.isArc&&(n[t]==="wa"||n[t]==="at"))&&(i[t+5]===i[t+7]&&(i[t+7]+=n[t+7]>n[t+5]?1:-1),i[t+6]===i[t+8]&&(i[t+8]+=n[t+8]>n[t+6]?1:-1));return i.join(" ")||"x"},clip:function(n){var t=this,i;return n?(i=n.members,hi(i,t),i.push(t),t.destroyClip=function(){hi(i,t)},n=n.getCSS(t)):(t.destroyClip&&t.destroyClip(),n={clip:au?"inherit":"rect(auto)"}),t.css(n)},css:ht.prototype.htmlCss,safeRemoveChild:function(n){n.parentNode&&wr(n)},destroy:function(){return this.destroyClip&&this.destroyClip(),ht.prototype.destroy.apply(this)},on:function(n,t){return this.element["on"+n]=function(){var n=it.event;n.target=n.srcElement;t(n)},this},cutOffPath:function(n,t){var i,n=n.split(/[ ,]/);return i=n.length,(i===9||i===11)&&(n[i-4]=n[i-2]=a(n[i-2])-10*t),n.join(" ")},shadow:function(t,i,r){var v=[],f,e=this.element,y=this.renderer,u,p=e.style,s,o=e.path,h,c,l,w;if(o&&typeof o.value!="string"&&(o="x"),c=o,t){for(l=n(t.width,3),w=(t.opacity||.15)/l,f=1;f<=3;f++)h=l*2+1-2*f,r&&(c=this.cutOffPath(o.value,h+.5)),s=['<shape isShadow="true" strokeweight="',h,'" filled="false" path="',c,'" coordsize="10 10" style="',e.style.cssText,'" />'],u=lt(y.prepVML(s),null,{left:a(p.left)+n(t.offsetX,1),top:a(p.top)+n(t.offsetY,1)}),r&&(u.cutOff=h+1),s=['<stroke color="',t.color||"black",'" opacity="',w*f,'"/>'],lt(y.prepVML(s),null,null,u),i?i.element.appendChild(u):e.parentNode.insertBefore(u,e),v.push(u);this.shadows=v}return this},updateShadows:ei,setAttr:function(n,t){au?this.element[n]=t:this.element.setAttribute(n,t)},classSetter:function(n){this.element.className=n},dashstyleSetter:function(n,t,i){(i.getElementsByTagName("stroke")[0]||lt(this.renderer.prepVML(["<stroke/>"]),null,null,i))[t]=n||"solid";this[t]=n},dSetter:function(n,t,i){var r=this.shadows,n=n||[];if(this.d=n.join&&n.join(" "),i.path=n=this.pathToVML(n),r)for(i=r.length;i--;)r[i].path=r[i].cutOff?this.cutOffPath(n,r[i].cutOff):n;this.setAttr(t,n)},fillSetter:function(n,t,i){var r=i.nodeName;r==="SPAN"?i.style.color=n:r!=="IMG"&&(i.filled=n!==ct,this.setAttr("fillcolor",this.renderer.color(n,i,t,this)))},opacitySetter:ei,rotationSetter:function(n,t,i){i=i.style;this[t]=i[t]=n;i.left=-r(ti(n*or)+1)+"px";i.top=r(pt(n*or))+"px"},strokeSetter:function(n,t,i){this.setAttr("strokecolor",this.renderer.color(n,i,t))},"stroke-widthSetter":function(n,t,i){i.stroked=!!n;this[t]=n;ui(n)&&(n+="px");this.setAttr("strokeweight",n)},titleSetter:function(n,t){this.setAttr(t,n)},visibilitySetter:function(n,i,r){n==="inherit"&&(n="visible");this.shadows&&t(this.shadows,function(t){t.style[i]=n});r.nodeName==="DIV"&&(n=n==="hidden"?"-999em":0,au||(r.style[i]=n?"visible":"hidden"),i="top");r.style[i]=n},xSetter:function(n,t,i){this[t]=n;t==="x"?t="left":t==="y"&&(t="top");this.updateClipping?(this[t]=n,this.updateClipping()):i.style[t]=n},zIndexSetter:function(n,t,i){i.style[t]=n}},g.VMLElement=bt=dt(ht,bt),bt.prototype.ySetter=bt.prototype.widthSetter=bt.prototype.heightSetter=bt.prototype.xSetter,bt={Element:bt,isIE8:gi.indexOf("MSIE 8.0")>-1,init:function(n,t,i,r){var u;if(this.alignedObjects=[],r=this.createElement(dr).css(e(this.getStyle(r),{position:"relative"})),u=r.element,n.appendChild(r.element),this.isVML=!0,this.box=u,this.boxWrapper=r,this.cache={},this.setSize(t,i,!1),!c.namespaces.hcv){c.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{c.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){c.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(n,i,u,f){var s=this.createElement(),o=kt(n);return e(s,{members:[],left:(o?n.x:n)+1,top:(o?n.y:i)+1,width:(o?n.width:u)-1,height:(o?n.height:f)-1,getCSS:function(n){var t=n.element,o=t.nodeName,n=n.inverted,i=this.top-(o==="shape"?t.offsetTop:0),u=this.left,t=u+this.width,f=i+this.height,i={clip:"rect("+r(n?u:i)+"px,"+r(n?f:t)+"px,"+r(n?t:f)+"px,"+r(n?i:u)+"px)"};return!n&&au&&o==="DIV"&&e(i,{width:t+"px",height:f+"px"}),i},updateClipping:function(){t(s.members,function(n){n.element&&n.css(s.getCSS(n))})}})},color:function(n,i,r,u){var ht=this,s,k=/^rgba/,v,c,f=ct;if(n&&n.linearGradient?c="gradient":n&&n.radialGradient&&(c="pattern"),c){var h,y,e=n.linearGradient||n.radialGradient,l,d,g,nt,tt,p="",n=n.stops,b,it=[],rt=function(){v=['<fill colors="'+it.join(",")+'" opacity="',g,'" o:opacity2="',d,'" type="',c,'" ',p,'focus="100%" method="any" />'];lt(ht.prepVML(v),null,null,i)};if(l=n[0],b=n[n.length-1],l[0]>0&&n.unshift([0,l[1]]),b[0]<1&&n.push([1,b[1]]),t(n,function(n,t){k.test(n[1])?(s=ir(n[1]),h=s.get("rgb"),y=s.get("a")):(h=n[1],y=1);it.push(n[0]*100+"% "+h);t?(g=y,nt=h):(d=y,tt=h)}),r==="fill")if(c==="gradient")r=e.x1||e[0]||0,n=e.y1||e[1]||0,l=e.x2||e[2]||0,e=e.y2||e[3]||0,p='angle="'+(90-st.atan((e-n)/(l-r))*180/ci)+'"',rt();else{var f=e.r,ut=f*2,ft=f*2,et=e.cx,ot=e.cy,a=i.radialReference,o,f=function(){a&&(o=u.getBBox(),et+=(a[0]-o.x)/o.width-.5,ot+=(a[1]-o.y)/o.height-.5,ut*=a[2]/o.width,ft*=a[2]/o.height);p='src="'+w.global.VMLRadialGradientURL+'" size="'+ut+","+ft+'" origin="0.5,0.5" position="'+et+","+ot+'" color2="'+tt+'" ';rt()};u.added?f():u.onAdd=f;f=nt}else f=h}else k.test(n)&&i.tagName!=="IMG"?(s=ir(n),v=["<",r,' opacity="',s.get("a"),'"/>'],lt(this.prepVML(v),null,null,i),f=s.get("rgb")):(f=i.getElementsByTagName(r),f.length&&(f[0].opacity=1,f[0].type="solid"),f=n);return f},prepVML:function(n){var t=this.isIE8,n=n.join("");return t?(n=n.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),n=n.indexOf('style="')===-1?n.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):n.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):n=n.replace("<","<hcv:"),n},text:gt.prototype.html,path:function(n){var t={coordsize:"10 10"};return rr(n)?t.d=n:kt(n)&&e(t,n),this.createElement("shape").attr(t)},circle:function(n,t,i){var r=this.symbol("circle");return kt(n)&&(i=n.r,t=n.y,n=n.x),r.isCircle=!0,r.r=i,r.attr({x:n,y:t})},g:function(n){var t;return n&&(t={className:"highcharts-"+n,"class":"highcharts-"+n}),this.createElement(dr).attr(t)},image:function(n,t,i,r,u){var f=this.createElement("img").attr({src:n});return arguments.length>1&&f.attr({x:t,y:i,width:r,height:u}),f},createElement:function(n){return n==="rect"?this.symbol(n):gt.prototype.createElement.call(this,n)},invertChild:function(n,i){var f=this,u=i.style,r=n.tagName==="IMG"&&n.style;p(n,{flip:"x",left:a(u.width)-(r?a(r.top):1),top:a(u.height)-(r?a(r.left):1),rotation:-90});t(n.childNodes,function(t){f.invertChild(t,n)})},symbols:{arc:function(n,t,i,r,u){var f=u.start,o=u.end,e=u.r||i||r,i=u.innerR,r=pt(f),s=ti(f),h=pt(o),c=ti(o);return o-f==0?["x"]:(f=["wa",n-e,t-e,n+e,t+e,n+e*r,t+e*s,n+e*h,t+e*c],u.open&&!i&&f.push("e","M",n,t),f.push("at",n-i,t-i,n+i,t+i,n+i*h,t+i*c,n+i*r,t+i*s,"x","e"),f.isArc=!0,f)},circle:function(n,t,i,r,u){return u&&(i=r=2*u.r),u&&u.isCircle&&(n-=i/2,t-=r/2),["wa",n,t,n+i,t+r,n+i,t+r/2,n+i,t+r/2,"e"]},rect:function(n,t,i,r,f){return gt.prototype.symbols[!u(f)||!f.r?"square":"callout"].call(0,n,t,i,r,f)}}},g.VMLRenderer=su=function(){this.init.apply(this,arguments)},su.prototype=o(gt.prototype,bt),kr=su),gt.prototype.measureSpanWidth=function(n,t){var i=c.createElement("span"),r;return r=c.createTextNode(n),i.appendChild(r),p(i,t),this.box.appendChild(i),r=i.offsetWidth,wr(i),r},ii&&(g.CanVGRenderer=bt=function(){nr="http://www.w3.org/1999/xhtml"},bt.prototype.symbols={},ie=function(){function t(){for(var i=n.length,t=0;t<i;t++)n[t]();n=[]}var n=[];return{push:function(i,r){n.length===0&&se(r,t);n.push(i)}}}(),kr=bt),tu.prototype={addLabel:function(){var t=this.axis,h=t.options,c=t.chart,a=t.horiz,s=t.categories,p=t.names,i=this.pos,o=h.labels,y=o.rotation,l=t.tickPositions,a=a&&s&&!o.step&&!o.staggerLines&&!o.rotation&&c.plotWidth/l.length||!a&&(c.margin[3]||c.chartWidth*.33),b=i===l[0],k=i===l[l.length-1],v,p=s?n(s[i],p[i],i):i,s=this.label,w=l.info;t.isDatetimeAxis&&w&&(v=h.dateTimeLabelFormats[w.higherRanks[i]||w.unitName]);this.isFirst=b;this.isLast=k;h=t.labelFormatter.call({axis:t,chart:c,isFirst:b,isLast:k,dateTimeLabelFormat:v,value:t.isLog?ni(si(p)):p});i=a&&{width:f(1,r(a-2*(o.padding||10)))+"px"};u(s)?s&&s.attr({text:h}).css(i):(v={align:t.labelAlign},ui(y)&&(v.rotation=y),a&&o.ellipsis&&(i.HcHeight=t.len/l.length),this.label=s=u(h)&&o.enabled?c.renderer.text(h,0,0,o.useHTML).attr(v).css(e(i,o.style)).add(t.labelGroup):null,t.tickBaseline=c.renderer.fontMetrics(o.style.fontSize,s).b,y&&t.side===2&&(t.tickBaseline*=pt(y*or)));this.yOffset=s?n(o.y,t.tickBaseline+(t.side===2?8:-(s.getBBox().height/2))):0},getLabelSize:function(){var n=this.label,t=this.axis;return n?n.getBBox()[t.horiz?"height":"width"]:0},getLabelSides:function(){var n=this.label.getBBox(),t=this.axis,i=t.horiz,r=t.options.labels,n=i?n.width:n.height,t=i?r.x-n*{left:0,center:.5,right:1}[t.labelAlign]:0;return[t,i?n+t:n]},handleOverflow:function(n,t){var h=!0,r=this.axis,c=this.isFirst,a=this.isLast,f=r.horiz?t.x:t.y,v=r.reversed,y=r.tickPositions,s=this.getLabelSides(),l=s[0],s=s[1],o,e,u,p=this.label.line;if(o=p||0,e=r.labelEdge,u=r.justifyLabels&&(c||a),e[o]===i||f+l>e[o]?e[o]=f+s:u||(h=!1),u){o=(e=r.justifyToPlot)?r.pos:0;e=e?o+r.len:r.chart.chartWidth;do n+=c?1:-1,u=r.ticks[y[n]];while(y[n]&&(!u||!u.label||u.label.line!==p));r=u&&u.label.xy&&u.label.xy.x+u.getLabelSides()[c?0:1];c&&!v||a&&v?f+l<o&&(f=o-l,u&&f+s>r&&(h=!1)):f+s>e&&(f=e-s,u&&f+l<r&&(h=!1));t.x=f}return h},getPosition:function(n,t,i,r){var u=this.axis,f=u.chart,e=r&&f.oldChartHeight||f.chartHeight;return{x:n?u.translate(t+i,null,null,r)+u.transB:u.left+u.offset+(u.opposite?(r&&f.oldChartWidth||f.chartWidth)-u.right-u.left:0),y:n?e-u.bottom+u.offset-(u.opposite?u.height:0):e-u.translate(t+i,null,null,r)-u.transB}},getLabelPosition:function(n,t,i,r,u,f,e,o){var s=this.axis,c=s.transA,l=s.reversed,h=s.staggerLines,n=n+u.x-(f&&r?f*c*(l?-1:1):0),t=t+this.yOffset-(f&&!r?f*c*(l?1:-1):0);return h&&(i.line=e/(o||1)%h,t+=i.line*(s.labelOffset/h)),{x:n,y:t}},getMarkPath:function(n,t,i,r,u,f){return f.crispLine(["M",n,t,"L",n+(u?0:-i),t+(u?i:0)],r)},render:function(t,r,u){var f=this.axis,e=f.options,g=f.chart.renderer,y=f.horiz,h=this.type,p=this.label,c=this.pos,w=e.labels,s=this.gridLine,l=h?h+"Grid":"grid",a=h?h+"Tick":"tick",b=e[l+"LineWidth"],ut=e[l+"LineColor"],it=e[l+"LineDashStyle"],v=e[a+"Length"],l=e[a+"Width"]||0,ft=e[a+"Color"],et=e[a+"Position"],a=this.mark,nt=w.step,k=!0,tt=f.tickmarkOffset,o=this.getPosition(y,c,tt,r),d=o.x,o=o.y,rt=y&&d===f.pos+f.len||!y&&o===f.pos?-1:1,u=n(u,1);this.isActive=!0;b&&(c=f.getPlotLinePath(c+tt,b*rt,r,!0),s===i&&(s={stroke:ut,"stroke-width":b},it&&(s.dashstyle=it),h||(s.zIndex=1),r&&(s.opacity=0),this.gridLine=s=b?g.path(c).attr(s).add(f.gridGroup):null),!r&&s&&c&&s[this.isNew?"attr":"animate"]({d:c,opacity:u}));l&&v&&(et==="inside"&&(v=-v),f.opposite&&(v=-v),h=this.getMarkPath(d,o,v,l*rt,y,g),a?a.animate({d:h,opacity:u}):this.mark=g.path(h).attr({stroke:ft,"stroke-width":l,opacity:u}).add(f.axisGroup));p&&!isNaN(d)&&(p.xy=o=this.getLabelPosition(d,o,p,y,w,tt,t,nt),this.isFirst&&!this.isLast&&!n(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!n(e.showLastLabel,1)?k=!1:!f.isRadial&&!w.step&&!w.rotation&&!r&&u!==0&&(k=this.handleOverflow(t,o)),nt&&t%nt&&(k=!1),k&&!isNaN(o.y)?(o.opacity=u,p[this.isNew?"attr":"animate"](o),this.isNew=!1):p.attr("y",-9999))},destroy:function(){er(this,this.axis)}},g.PlotLineOrBand=function(n,t){this.axis=n;t&&(this.options=t,this.id=t.id)},g.PlotLineOrBand.prototype={render:function(){var c=this,t=c.axis,a=t.horiz,w=(t.pointRange||0)/2,i=c.options,e=i.label,l=c.label,k=i.width,y=i.to,p=i.from,r=u(p)&&u(y),d=i.value,tt=i.dashStyle,v=c.svgElem,n=[],it,g=i.color,b=i.zIndex,nt=i.events,h={},rt=t.chart.renderer;if(t.isLog&&(p=ur(p),y=ur(y),d=ur(d)),k)(n=t.getPlotLinePath(d,k),h={stroke:g,"stroke-width":k},tt)&&(h.dashstyle=tt);else if(r)p=f(p,t.min-w),y=s(y,t.max+w),n=t.getPlotBandPath(p,y,i),g&&(h.fill=g),i.borderWidth&&(h.stroke=i.borderColor,h["stroke-width"]=i.borderWidth);else return;if(u(b)&&(h.zIndex=b),v)n?v.animate({d:n},null,v.onGetPath):(v.hide(),v.onGetPath=function(){v.show()},l)&&(c.label=l=l.destroy());else if(n&&n.length&&(c.svgElem=v=rt.path(n).attr(h).add(),nt))for(it in w=function(n){v.on(n,function(t){nt[n].apply(c,[t])})},nt)w(it);return e&&u(e.text)&&n&&n.length&&t.width>0&&t.height>0?(e=o({align:a&&r&&"center",x:a?!r&&4:10,verticalAlign:!a&&r&&"middle",y:a?r?16:10:r?6:-4,rotation:a&&!r&&90},e),l||(h={align:e.textAlign||e.align,rotation:e.rotation},u(b)&&(h.zIndex=b),c.label=l=rt.text(e.text,0,0,e.useHTML).attr(h).css(e.style).add()),t=[n[1],n[4],r?n[6]:n[1]],r=[n[2],n[5],r?n[7]:n[2]],n=pr(t),a=pr(r),l.align(e,!1,{x:n,y:a,width:di(t)-n,height:di(r)-a}),l.show()):l&&l.hide(),c},destroy:function(){hi(this.axis.plotLinesAndBands,this);delete this.axis;er(this)}},k.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:rt,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return ki(this.total,-1)},style:rt.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(t,r){var e=r.isX,o,s,f;this.horiz=t.inverted?!e:e;this.coll=(this.isXAxis=e)?"xAxis":"yAxis";this.opposite=r.opposite;this.side=r.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(r);f=this.options;o=f.type;this.labelFormatter=f.labels.formatter||this.defaultLabelFormatter;this.userOptions=r;this.minPixelPadding=0;this.chart=t;this.reversed=f.reversed;this.zoomEnabled=f.zoomEnabled!==!1;this.categories=f.categories||o==="category";this.names=[];this.isLog=o==="logarithmic";this.isDatetimeAxis=o==="datetime";this.isLinked=u(f.linkedTo);this.tickmarkOffset=this.categories&&f.tickmarkPlacement==="between"&&n(f.tickInterval,1)===1?.5:0;this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=f.minRange||f.maxZoom;this.range=f.range;this.offset=f.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=n(f.crosshair,fi(t.options.tooltip.crosshairs)[e?0:1],!1);f=this.options.events;cr(this,t.axes)===-1&&(e&&!this.isColorAxis?t.axes.splice(t.xAxis.length,0,this):t.axes.push(this),t[this.coll].push(this));this.series=this.series||[];t.inverted&&e&&this.reversed===i&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(s in f)h(this,s,f[s]);this.isLog&&(this.val2lin=ur,this.lin2val=si)},setOptions:function(n){this.options=o(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],o(w[this.coll],n))},defaultLabelFormatter:function(){var r=this.axis,t=this.value,f=r.categories,o=this.dateTimeLabelFormat,e=w.lang.numericSymbols,u=e&&e.length,n,s=r.options.labels.format,r=r.isLog?t:r.tickInterval;if(s)n=fr(s,this);else if(f)n=t;else if(o)n=pi(o,t);else if(u&&r>=1e3)for(;u--&&n===i;)f=Math.pow(1e3,u+1),r>=f&&e[u]!==null&&(n=ki(t/f,-1)+e[u]);return n===i&&(n=d(t)>=1e4?ki(t,0):ki(t,-1,i,"")),n},getSeriesExtremes:function(){var i=this,r=i.chart;i.hasVisibleSeries=!1;i.dataMin=i.dataMax=i.ignoreMinPadding=i.ignoreMaxPadding=null;i.buildStacks&&i.buildStacks();t(i.series,function(t){var e,o;(t.visible||!r.options.chart.ignoreHiddenSeries)&&(e=t.options.threshold,i.hasVisibleSeries=!0,i.isLog&&e<=0&&(e=null),i.isXAxis?(e=t.xData,e.length)&&(i.dataMin=s(n(i.dataMin,e[0]),pr(e)),i.dataMax=f(n(i.dataMax,e[0]),di(e))):(t.getExtremes(),o=t.dataMax,t=t.dataMin,u(t)&&u(o)&&(i.dataMin=s(n(i.dataMin,t),t),i.dataMax=f(n(i.dataMax,o),o)),u(e)&&(i.dataMin>=e?(i.dataMin=e,i.ignoreMinPadding=!0):i.dataMax<e&&(i.dataMax=e,i.ignoreMaxPadding=!0))))})},translate:function(n,t,i,r,u,f){var e=1,s=0,o=r?this.oldTransA:this.transA,r=r?this.oldMin:this.min,h=this.minPixelPadding,u=(this.options.ordinal||this.isLog&&u)&&this.lin2val;return o||(o=this.transA),i&&(e*=-1,s=this.len),this.reversed&&(e*=-1,s-=e*(this.sector||this.len)),t?(n=n*e+s,n-=h,n=n/o+r,u&&(n=this.lin2val(n))):(u&&(n=this.val2lin(n)),f==="between"&&(f=.5),n=e*(n-r)*o+s+e*h+(ui(f)?o*f*this.pointRange:0)),n},toPixels:function(n,t){return this.translate(n,!1,!this.horiz,null,!0)+(t?0:this.pos)},toValue:function(n,t){return this.translate(n-(t?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(t,i,u,f,e){var s=this.chart,c=this.left,l=this.top,o,a,v=u&&s.oldChartHeight||s.chartHeight,y=u&&s.oldChartWidth||s.chartWidth,h;return o=this.transB,e=n(e,this.translate(t,null,null,u)),t=u=r(e+o),o=a=r(v-e-o),isNaN(e)?h=!0:this.horiz?(o=l,a=v-this.bottom,t<c||t>c+this.width)&&(h=!0):(t=c,u=y-this.right,o<l||o>l+this.height)&&(h=!0),h&&!f?null:s.renderer.crispLine(["M",t,o,"L",u,a],i||1)},getLinearTickPositions:function(n,t,i){var r,f=ni(et(t/n)*n),e=ni(br(i/n)*n),u=[];if(t===i&&ui(t))return[t];for(t=f;t<=e;){if(u.push(t),t=ni(t+n),t===r)break;r=t}return u},getMinorTickPositions:function(){var i=this.options,n=this.tickPositions,r=this.minorTickInterval,t=[],u;if(this.isLog)for(u=n.length,i=1;i<u;i++)t=t.concat(this.getLogTickPositions(r,n[i-1],n[i],!0));else if(this.isDatetimeAxis&&i.minorTickInterval==="auto")t=t.concat(this.getTimeTicks(this.normalizeTimeTickInterval(r),this.min,this.max,i.startOfWeek)),t[0]<this.min&&t.shift();else for(n=this.min+(n[0]-this.min)%r;n<=this.max;n+=r)t.push(n);return t},adjustForMinRange:function(){var h=this.options,r=this.min,f=this.max,e,y=this.dataMax-this.dataMin>=this.minRange,l,c,v,a,p,o;this.isXAxis&&this.minRange===i&&!this.isLog&&(u(h.min)||u(h.max)?this.minRange=null:(t(this.series,function(n){for(a=n.xData,c=p=n.xIncrement?1:a.length-1;c>0;c--)(v=a[c]-a[c-1],l===i||v<l)&&(l=v)}),this.minRange=s(l*5,this.dataMax-this.dataMin)));f-r<this.minRange&&(o=this.minRange,e=(o-f+r)/2,e=[r-e,n(h.min,r-e)],y&&(e[2]=this.dataMin),r=di(e),f=[r+o,n(h.max,r+o)],y&&(f[2]=this.dataMax),f=pr(f),f-r<o&&(e[0]=f-o,e[1]=n(h.min,f-o),r=di(e)));this.min=r;this.max=f},setAxisTranslation:function(n){var i=this,l=i.max-i.min,c=i.axisPointRange||0,r,o=0,h=0,e=i.linkedParent,v=!!i.categories,a=i.transA;(i.isXAxis||v||c)&&(e?(o=e.minPointOffset,h=e.pointRangePadding):t(i.series,function(n){var t=v?1:i.isXAxis?n.pointRange:i.axisPointRange||0,a=n.options.pointPlacement,e=n.closestPointRange;t>l&&(t=0);c=f(c,t);o=f(o,vr(a)?0:t/2);h=f(h,a==="on"?0:t);!n.noSharedTooltip&&u(e)&&(r=u(r)?s(r,e):e)}),e=i.ordinalSlope&&r?i.ordinalSlope/r:1,i.minPointOffset=o*=e,i.pointRangePadding=h*=e,i.pointRange=s(c,l),i.closestPointRange=r);n&&(i.oldTransA=a);i.translationSlope=i.transA=a=i.len/(l+h||1);i.transB=i.horiz?i.left:i.bottom;i.minPixelPadding=a*o},setTickPositions:function(i){var r=this,o=r.chart,e=r.options,c=e.startOnTick,w=e.endOnTick,h=r.isLog,l=r.isDatetimeAxis,it=r.isXAxis,v=r.isLinked,b=r.options.tickPositioner,k=e.maxPadding,g=e.minPadding,a=e.tickInterval,nt=e.minTickInterval,y=e.tickPixelInterval,tt,p=r.categories;v?(r.linkedParent=o[r.coll][e.linkedTo],o=r.linkedParent.getExtremes(),r.min=n(o.min,o.dataMin),r.max=n(o.max,o.dataMax),e.type!==r.linkedParent.options.type&&ri(11,1)):(r.min=n(r.userMin,e.min,r.dataMin),r.max=n(r.userMax,e.max,r.dataMax));h&&(!i&&s(r.min,n(r.dataMin,r.min))<=0&&ri(10,1),r.min=ni(ur(r.min)),r.max=ni(ur(r.max)));r.range&&u(r.max)&&(r.userMin=r.min=f(r.min,r.max-r.range),r.userMax=r.max,r.range=null);r.beforePadding&&r.beforePadding();r.adjustForMinRange();p||r.axisPointRange||r.usePercentage||v||!u(r.min)||!u(r.max)||!(o=r.max-r.min)||(!u(e.min)&&!u(r.userMin)&&g&&(r.dataMin<0||!r.ignoreMinPadding)&&(r.min-=o*g),!u(e.max)&&!u(r.userMax)&&k&&(r.dataMax>0||!r.ignoreMaxPadding)&&(r.max+=o*k));ui(e.floor)&&(r.min=f(r.min,e.floor));ui(e.ceiling)&&(r.max=s(r.max,e.ceiling));r.min===r.max||r.min===void 0||r.max===void 0?r.tickInterval=1:v&&!a&&y===r.linkedParent.options.tickPixelInterval?r.tickInterval=r.linkedParent.tickInterval:(r.tickInterval=n(a,p?1:(r.max-r.min)*y/f(r.len,y)),!u(a)&&r.len<y&&!this.isRadial&&!this.isLog&&!p&&c&&w&&(tt=!0,r.tickInterval/=4));it&&!i&&t(r.series,function(n){n.processData(r.min!==r.oldMin||r.max!==r.oldMax)});r.setAxisTranslation(!0);r.beforeSetTickPositions&&r.beforeSetTickPositions();r.postProcessTickInterval&&(r.tickInterval=r.postProcessTickInterval(r.tickInterval));r.pointRange&&(r.tickInterval=f(r.pointRange,r.tickInterval));!a&&r.tickInterval<nt&&(r.tickInterval=nt);l||h||a||(r.tickInterval=tf(r.tickInterval,null,nf(r.tickInterval),n(e.allowDecimals,!(r.tickInterval>1&&r.tickInterval<5&&r.max>1e3&&r.max<9999))));r.minorTickInterval=e.minorTickInterval==="auto"&&r.tickInterval?r.tickInterval/5:e.minorTickInterval;r.tickPositions=i=e.tickPositions?[].concat(e.tickPositions):b&&b.apply(r,[r.min,r.max]);i||(!r.ordinalPositions&&(r.max-r.min)/r.tickInterval>f(2*r.len,200)&&ri(19,!0),i=l?r.getTimeTicks(r.normalizeTimeTickInterval(r.tickInterval,e.units),r.min,r.max,e.startOfWeek,r.ordinalPositions,r.closestPointRange,!0):h?r.getLogTickPositions(r.tickInterval,r.min,r.max):r.getLinearTickPositions(r.tickInterval,r.min,r.max),tt&&i.splice(1,i.length-2),r.tickPositions=i);v||(e=i[0],h=i[i.length-1],l=r.minPointOffset||0,c?r.min=e:r.min-l>e&&i.shift(),w?r.max=h:r.max+l<h&&i.pop(),i.length===0&&u(e)&&i.push((h+e)/2),i.length===1&&(c=d(r.max)>1e13?1:.001,r.min-=c,r.max+=c))},setMaxTicks:function(){var i=this.chart,n=i.maxTicks||{},t=this.tickPositions,r=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");!this.isLinked&&!this.isDatetimeAxis&&t&&t.length>(n[r]||0)&&this.options.alignTicks!==!1&&(n[r]=t.length);i.maxTicks=n},adjustTickAmount:function(){var n=this._maxTicksKey,t=this.tickPositions,r=this.chart.maxTicks,f,e;if(r&&r[n]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==i){if(f=this.tickAmount,e=t.length,this.tickAmount=n=r[n],e<n){for(;t.length<n;)t.push(ni(t[t.length-1]+this.tickInterval));this.transA*=(e-1)/(n-1);this.max=t[t.length-1]}u(f)&&n!==f&&(this.isDirty=!0)}},setScale:function(){var n=this.stacks,i,r,f,u;if(this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),u=this.len!==this.oldAxisLength,t(this.series,function(n){(n.isDirtyData||n.isDirty||n.xAxis.isDirty)&&(f=!0)}),u||f||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(i in n)for(r in n[i])n[i][r].total=null,n[i][r].cum=0;this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;this.isDirty||(this.isDirty=u||this.min!==this.oldMin||this.max!==this.oldMax)}else if(!this.isXAxis){this.oldStacks&&(n=this.stacks=this.oldStacks);for(i in n)for(r in n[i])n[i][r].cum=n[i][r].total}this.setMaxTicks()},setExtremes:function(t,i,r,u,f){var o=this,s=o.chart,r=n(r,!0),f=e(f,{min:t,max:i});b(o,"setExtremes",f,function(){o.userMin=t;o.userMax=i;o.eventArgs=f;o.isDirtyExtremes=!0;r&&s.redraw(u)})},zoom:function(t,r){var e=this.dataMin,o=this.dataMax,h=this.options;return this.allowZoomOutside||(u(e)&&t<=s(e,n(h.min,e))&&(t=i),u(o)&&r>=f(o,n(h.max,o))&&(r=i)),this.displayBtn=t!==i||r!==i,this.setExtremes(t,r,!1,i,{trigger:"zoom"}),!0},setAxisSize:function(){var t=this.chart,i=this.options,e=i.offsetLeft||0,s=this.horiz,o=n(i.width,t.plotWidth-e+(i.offsetRight||0)),r=n(i.height,t.plotHeight),u=n(i.top,t.plotTop),i=n(i.left,t.plotLeft+e),e=/%$/;e.test(r)&&(r=parseInt(r,10)/100*t.plotHeight);e.test(u)&&(u=parseInt(u,10)/100*t.plotHeight+t.plotTop);this.left=i;this.top=u;this.width=o;this.height=r;this.bottom=t.chartHeight-r-u;this.right=t.chartWidth-o-i;this.len=f(s?o:r,0);this.pos=s?i:u},getExtremes:function(){var n=this.isLog;return{min:n?ni(si(this.min)):this.min,max:n?ni(si(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(n){var t=this.isLog,i=t?si(this.min):this.min,t=t?si(this.max):this.max;return i>n||n===null?n=i:t<n&&(n=t),this.translate(n,0,1,0,1)},autoLabelAlign:function(t){return t=(n(t,0)-this.side*90+720)%360,t>15&&t<165?"right":t>195&&t<345?"left":"center"},getOffset:function(){var r=this,v=r.chart,y=v.renderer,l=r.options,k=r.tickPositions,s=r.ticks,p=r.horiz,o=r.side,st=v.inverted?[1,0,3,2][o]:o,w,it,ht=0,rt,ct=0,e=l.title,h=l.labels,b=0,ut=v.axisOffset,v=v.clipOffset,ft=[-1,1,1,-1][o],c,d=1,lt=n(h.maxStaggerLines,5),nt,ot,a,g,tt;if(r.hasData=w=r.hasVisibleSeries||u(r.min)&&u(r.max)&&!!k,r.showAxis=it=w||n(l.showEmpty,!0),r.staggerLines=r.horiz&&h.staggerLines,r.axisGroup||(r.gridGroup=y.g("grid").attr({zIndex:l.gridZIndex||1}).add(),r.axisGroup=y.g("axis").attr({zIndex:l.zIndex||2}).add(),r.labelGroup=y.g("axis-labels").attr({zIndex:h.zIndex||7}).addClass("highcharts-"+r.coll.toLowerCase()+"-labels").add()),w||r.isLinked){if(r.labelAlign=n(h.align||r.autoLabelAlign(h.rotation)),t(k,function(n){s[n]?s[n].addLabel():s[n]=new tu(r,n)}),r.horiz&&!r.staggerLines&&lt&&!h.rotation){for(w=r.reversed?[].concat(k).reverse():k;d<lt;){for(nt=[],ot=!1,c=0;c<w.length;c++)a=w[c],g=(g=s[a].label&&s[a].label.getBBox())?g.width:0,tt=c%d,g&&(a=r.translate(a),nt[tt]!==i&&a<nt[tt]&&(ot=!0),nt[tt]=a+g);if(ot)d++;else break}d>1&&(r.staggerLines=d)}t(k,function(n){(o===0||o===2||{1:"left",3:"right"}[o]===r.labelAlign)&&(b=f(s[n].getLabelSize(),b))});r.staggerLines&&(b*=r.staggerLines,r.labelOffset=b)}else for(c in s)s[c].destroy(),delete s[c];e&&e.text&&e.enabled!==!1&&(r.axisTitle||(r.axisTitle=y.text(e.text,0,0,e.useHTML).attr({zIndex:7,rotation:e.rotation||0,align:e.textAlign||{low:"left",middle:"center",high:"right"}[e.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(e.style).add(r.axisGroup),r.axisTitle.isNew=!0),it&&(ht=r.axisTitle.getBBox()[p?"height":"width"],rt=e.offset,ct=u(rt)?0:n(e.margin,p?5:10)),r.axisTitle[it?"show":"hide"]());r.offset=ft*n(l.offset,ut[o]);y=o===2?r.tickBaseline:0;p=b+ct+(b&&ft*(p?n(h.y,r.tickBaseline+8):h.x)-y);r.axisTitleMargin=n(rt,p);ut[o]=f(ut[o],r.axisTitleMargin+ht+ft*r.offset,p);v[st]=f(v[st],et(l.lineWidth/2)*2)},getLinePath:function(n){var t=this.chart,u=this.opposite,i=this.offset,r=this.horiz,f=this.left+(u?this.width:0)+i,i=t.chartHeight-this.bottom-(u?this.height:0)+i;return u&&(n*=-1),t.renderer.crispLine(["M",r?this.left:f,r?i:this.top,"L",r?t.chartWidth-this.right:f,r?i:t.chartHeight-this.bottom],n)},getTitlePosition:function(){var n=this.horiz,i=this.left,e=this.top,t=this.len,r=this.options.title,u=n?i:e,f=this.opposite,o=this.offset,s=a(r.style.fontSize||12),t={low:u+(n?0:t),middle:u+t/2,high:u+(n?t:0)}[r.align],i=(n?e+this.height:i)+(n?1:-1)*(f?-1:1)*this.axisTitleMargin+(this.side===2?s:0);return{x:n?t:i+(f?this.width:0)+o+(r.x||0),y:n?i-(f?this.height:0)+o:t+(r.y||0)}},render:function(){var n=this,h=n.horiz,b=n.reversed,a=n.chart,et=a.renderer,e=n.options,k=n.isLog,d=n.isLinked,c=n.tickPositions,o,l=n.axisTitle,r=n.ticks,s=n.minorTicks,f=n.alternateBands,nt=e.stackLabels,tt=e.alternateGridColor,v=n.tickmarkOffset,y=e.lineWidth,it=a.hasRendered&&u(n.oldMin)&&!isNaN(n.oldMin),ot=n.hasData,rt=n.showAxis,p,ut=e.labels.overflow,ft=n.justifyLabels=h&&ut!==!1,w;n.labelEdge.length=0;n.justifyToPlot=ut==="justify";t([r,s,f],function(n){for(var t in n)n[t].isActive=!1});(ot||d)&&((n.minorTickInterval&&!n.categories&&t(n.getMinorTickPositions(),function(t){s[t]||(s[t]=new tu(n,t,"minor"));it&&s[t].isNew&&s[t].render(null,!0);s[t].render(null,!1,1)}),c.length&&(o=c.slice(),(h&&b||!h&&!b)&&o.reverse(),ft&&(o=o.slice(1).concat([o[0]])),t(o,function(t,i){ft&&(i=i===o.length-1?0:i+1);(!d||t>=n.min&&t<=n.max)&&(r[t]||(r[t]=new tu(n,t)),it&&r[t].isNew&&r[t].render(i,!0,.1),r[t].render(i))}),v&&n.min===0&&(r[-1]||(r[-1]=new tu(n,-1,null,!0)),r[-1].render(-1))),tt&&t(c,function(t,r){r%2==0&&t<n.max&&(f[t]||(f[t]=new g.PlotLineOrBand(n)),p=t+v,w=c[r+1]!==i?c[r+1]+v:n.max,f[t].options={from:k?si(p):p,to:k?si(w):w,color:tt},f[t].render(),f[t].isActive=!0)}),n._addedPlotLB)||(t((e.plotLines||[]).concat(e.plotBands||[]),function(t){n.addPlotBandOrLine(t)}),n._addedPlotLB=!0));t([r,s,f],function(n){var t,i,r=[],u=tr?tr.duration||500:0,e=function(){for(i=r.length;i--;)n[r[i]]&&!n[r[i]].isActive&&(n[r[i]].destroy(),delete n[r[i]])};for(t in n)n[t].isActive||(n[t].render(t,!1,0),n[t].isActive=!1,r.push(t));n===f||!a.hasRendered||!u?e():u&&setTimeout(e,u)});y&&(h=n.getLinePath(y),n.axisLine?n.axisLine.animate({d:h}):n.axisLine=et.path(h).attr({stroke:e.lineColor,"stroke-width":y,zIndex:7}).add(n.axisGroup),n.axisLine[rt?"show":"hide"]());l&&rt&&(l[l.isNew?"attr":"animate"](n.getTitlePosition()),l.isNew=!1);nt&&nt.enabled&&n.renderStackTotals();n.isDirty=!1},redraw:function(){this.render();t(this.plotLinesAndBands,function(n){n.render()});t(this.series,function(n){n.isDirty=!0})},destroy:function(n){var i=this,r=i.stacks,u,f=i.plotLinesAndBands;n||ut(i);for(u in r)er(r[u]),r[u]=null;for(t([i.ticks,i.minorTicks,i.alternateBands],function(n){er(n)}),n=f.length;n--;)f[n].destroy();t("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(n){i[n]&&(i[n]=i[n].destroy())});this.cross&&this.cross.destroy()},drawCrosshair:function(t,i){if(this.crosshair)if((u(i)||!n(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var r,f=this.crosshair,e=f.animation;n(f.snap,!0)?u(i)&&(r=this.chart.inverted!=this.horiz?i.plotX:this.len-i.plotY):r=this.horiz?t.chartX-this.pos:this.len-t.chartY+this.pos;r=this.isRadial?this.getPlotLinePath(this.isXAxis?i.x:n(i.stackY,i.y)):this.getPlotLinePath(null,null,null,null,r);r===null?this.hideCrosshair():this.cross?this.cross.attr({visibility:"visible"})[e?"animate":"attr"]({d:r},e):(e={"stroke-width":f.width||1,stroke:f.color||"#C0C0C0",zIndex:f.zIndex||2},f.dashStyle&&(e.dashstyle=f.dashStyle),this.cross=this.chart.renderer.path(r).attr(e).add())}},hideCrosshair:function(){this.cross&&this.cross.hide()}},e(k.prototype,{getPlotBandPath:function(n,t){var i=this.getPlotLinePath(t),r=this.getPlotLinePath(n);return r&&i?r.push(i[4],i[5],i[1],i[2]):r=null,r},addPlotBand:function(n){return this.addPlotBandOrLine(n,"plotBands")},addPlotLine:function(n){return this.addPlotBandOrLine(n,"plotLines")},addPlotBandOrLine:function(n,t){var i=new g.PlotLineOrBand(this,n).render(),r=this.userOptions;return i&&(t&&(r[t]=r[t]||[],r[t].push(n)),this.plotLinesAndBands.push(i)),i},removePlotBandOrLine:function(n){for(var r=this.plotLinesAndBands,u=this.options,f=this.userOptions,i=r.length;i--;)r[i].id===n&&r[i].destroy();t([u.plotLines||[],f.plotLines||[],u.plotBands||[],f.plotBands||[]],function(t){for(i=t.length;i--;)t[i].id===n&&hi(t,t[i])})}}),k.prototype.getTimeTicks=function(i,r,f,o){var v=[],y={},p=w.global.useUTC,a,s=new vt(r-hr),h=i.unitRange,c=i.count;if(u(r)){h>=l.second&&(s.setMilliseconds(0),s.setSeconds(h>=l.minute?0:c*et(s.getSeconds()/c)));h>=l.minute&&s[df](h>=l.hour?0:c*et(s[hf]()/c));h>=l.hour&&s[gf](h>=l.day?0:c*et(s[cf]()/c));h>=l.day&&s[af](h>=l.month?1:c*et(s[gr]()/c));h>=l.month&&(s[ne](h>=l.year?0:c*et(s[pu]()/c)),a=s[wu]());h>=l.year&&(a-=a%c,s[te](a));h===l.week&&s[af](s[gr]()-s[lf]()+n(o,1));r=1;hr&&(s=new vt(s.getTime()+hr));a=s[wu]();for(var o=s.getTime(),b=s[pu](),k=s[gr](),d=(l.day+(p?hr:s.getTimezoneOffset()*6e4))%l.day;o<f;)v.push(o),h===l.year?o=yu(a+r*c,0):h===l.month?o=yu(a,b+r*c):!p&&(h===l.day||h===l.week)?o=yu(a,b,k+r*c*(h===l.day?1:7)):o+=h*c,r++;v.push(o);t(ku(v,function(n){return h<=l.hour&&n%l.day===d}),function(n){y[n]="day"})}return v.info=e(i,{higherRanks:y,totalRange:h*c}),v},k.prototype.normalizeTimeTickInterval=function(n,t){for(var i=t||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],r=i[i.length-1],u=l[r[0]],o=r[1],e=0;e<i.length;e++)if(r=i[e],u=l[r[0]],o=r[1],i[e+1]&&n<=(u*o[o.length-1]+l[i[e+1][0]])/2)break;return u===l.year&&n<5*u&&(o=[1,2,5]),i=tf(n/u,o,r[0]==="year"?f(nf(n/u),1):1),{unitRange:u,count:i,unitName:r[0]}},k.prototype.getLogTickPositions=function(t,u,f,e){var s=this.options,o=this.len,c=[],l,y,a,h,v;if(e||(this._minorAutoInterval=null),t>=.5)t=r(t),c=this.getLinearTickPositions(t,u,f);else if(t>=.08)for(o=et(u),s=t>.3?[1,2,4]:t>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];o<f+1&&!v;o++)for(y=s.length,l=0;l<y&&!v;l++)a=ur(si(o)*s[l]),a>u&&(!e||h<=f)&&h!==i&&c.push(h),h>f&&(v=!0),h=a;else(u=si(u),f=si(f),t=s[e?"minorTickInterval":"tickInterval"],t=n(t==="auto"?null:t,this._minorAutoInterval,(f-u)*(s.tickPixelInterval/(e?5:1))/((e?o/this.tickPositions.length:o)||1)),t=tf(t,null,nf(t)),c=wi(this.getLinearTickPositions(t,u,f),ur),e)||(this._minorAutoInterval=t/5);return e||(this.tickInterval=t),c},gu=g.Tooltip=function(){this.init.apply(this,arguments)},gu.prototype={init:function(n,t){var r=t.borderWidth,i=t.style,u=a(i.padding);this.chart=n;this.options=t;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=n.renderer.label("",0,0,t.shape||"callout",null,null,t.useHTML,null,"tooltip").attr({padding:u,fill:t.backgroundColor,"stroke-width":r,r:t.borderRadius,zIndex:8}).css(i).css({padding:0}).add().attr({y:-9999});ii||this.label.shadow(t.shadow);this.shared=t.shared},destroy:function(){this.label&&(this.label=this.label.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(n,t,r,u){var f=this,o=f.now,s=f.options.animation!==!1&&!f.isHidden&&(d(n-o.x)>1||d(t-o.y)>1),h=f.followPointer||f.len>1;e(o,{x:s?(2*o.x+n)/3:n,y:s?(o.y+t)/2:t,anchorX:h?i:s?(2*o.anchorX+r)/3:r,anchorY:h?i:s?(o.anchorY+u)/2:u});f.label.attr(o);s&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){f&&f.move(n,t,r,u)},32))},hide:function(i){var u=this,r;clearTimeout(this.hideTimer);this.isHidden||(r=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){u.label.fadeOut();u.isHidden=!0},n(i,this.options.hideDelay,500)),r&&t(r,function(n){n.setState()}),this.chart.hoverPoints=null)},getAnchor:function(n,u){var e,f=this.chart,o=f.inverted,c=f.plotTop,s=0,h=0,l,n=fi(n);return e=n[0].tooltipPos,this.followPointer&&u&&(u.chartX===i&&(u=f.pointer.normalize(u)),e=[u.chartX-f.plotLeft,u.chartY-c]),e||(t(n,function(n){l=n.series.yAxis;s+=n.plotX;h+=(n.plotLow?(n.plotLow+n.plotHigh)/2:n.plotY)+(!o&&l?l.top-c:0)}),s/=n.length,h/=n.length,e=[o?f.plotWidth-h:s,this.shared&&!o&&n.length>1&&u?u.chartY-c:o?f.plotHeight-s:h]),wi(e,r)},getPosition:function(n,t,i){var u=this.chart,f=this.distance,r={},e,o=["y",u.chartHeight,t,i.plotY+u.plotTop],s=["x",u.chartWidth,n,i.plotX+u.plotLeft],l=i.ttBelow||u.inverted&&!i.negative||!u.inverted&&i.negative,a=function(n,t,i,u){var e=i<u-f,t=u+f+i<t,i=u-f-i;if(u+=f,l&&t)r[n]=u;else if(!l&&e)r[n]=i;else if(e)r[n]=i;else if(t)r[n]=u;else return!1},v=function(n,t,i,u){if(u<f||u>t-f)return!1;r[n]=u<i/2?1:u>t-i/2?t-i-2:u-i/2},h=function(n){var t=o;o=s;s=t;e=n},c=function(){a.apply(0,o)!==!1?v.apply(0,s)===!1&&!e&&(h(!0),c()):e?r.x=r.y=0:(h(!0),c())};return(u.inverted||this.len>1)&&h(),c(),r},defaultFormatter:function(n){var u=this.points||fi(this),i=u[0].series,r;return r=[n.tooltipHeaderFormatter(u[0])],t(u,function(n){i=n.series;r.push(i.tooltipFormatter&&i.tooltipFormatter(n)||n.point.tooltipFormatter(i.tooltipOptions.pointFormat))}),r.push(n.options.footerFormat||""),r.join("")},refresh:function(i,r){var o=this.chart,s=this.label,a=this.options,h,f,u={},e,c=[],l,v;e=a.formatter||this.defaultFormatter;u=o.hoverPoints;v=this.shared;clearTimeout(this.hideTimer);this.followPointer=fi(i)[0].series.tooltipOptions.followPointer;f=this.getAnchor(i,r);h=f[0];f=f[1];v&&(!i.series||!i.series.noSharedTooltip)?(o.hoverPoints=i,u&&t(u,function(n){n.setState()}),t(i,function(n){n.setState("hover");c.push(n.getLabelConfig())}),u={x:i[0].category,y:i[0].y},u.points=c,this.len=c.length,i=i[0]):u=i.getLabelConfig();e=e.call(u,this);u=i.series;this.distance=n(u.tooltipOptions.distance,16);e===!1?this.hide():(this.isHidden&&(ou(s),s.attr("opacity",1).show()),s.attr({text:e}),l=a.borderColor||i.color||u.color||"#606060",s.attr({stroke:l}),this.updatePosition({plotX:h,plotY:f,negative:i.negative,ttBelow:i.ttBelow}),this.isHidden=!1);b(o,"tooltipRefresh",{text:e,x:h+o.plotLeft,y:f+o.plotTop,borderColor:l})},updatePosition:function(n){var i=this.chart,t=this.label,t=(this.options.positioner||this.getPosition).call(this,t.width,t.height,n);this.move(r(t.x),r(t.y),n.plotX+i.plotLeft,n.plotY+i.plotTop)},tooltipHeaderFormatter:function(n){var f=n.series,i=f.tooltipOptions,e=i.dateTimeLabelFormats,t=i.xDateFormat,r=f.xAxis,o=r&&r.options.type==="datetime"&&ui(n.key),i=i.headerFormat,r=r&&r.closestPointRange,u;if(o&&!t){if(r){for(u in l)if(l[u]>=r||l[u]<=l.day&&n.key%l[u]>0){t=e[u];break}}else t=e.day;t=t||e.year}return o&&t&&(i=i.replace("{point.key}","{point.key:"+t+"}")),fr(i,{point:n,series:f})}},ru=c.documentElement.ontouchstart!==i,lr=g.Pointer=function(n,t){this.init(n,t)},lr.prototype={init:function(n,t){var i=t.chart,f=i.events,r=ii?"":i.zoomType,i=n.inverted,u;this.options=t;this.chart=n;this.zoomX=u=/x/.test(r);this.zoomY=r=/y/.test(r);this.zoomHor=u&&!i||r&&i;this.zoomVert=r&&!i||u&&i;this.hasZoom=u||r;this.runChartClick=f&&!!f.click;this.pinchDown=[];this.lastValidTouch={};g.Tooltip&&t.tooltip.enabled&&(n.tooltip=new gu(n,t.tooltip),this.followTouchMove=t.tooltip.followTouchMove);this.setDOMEvents()},normalize:function(n,t){var o,u,n=n||window.event,n=ce(n);return n.target||(n.target=n.srcElement),u=n.touches?n.touches.length?n.touches.item(0):n.changedTouches[0]:n,t||(this.chartPosition=t=he(this.chart.container)),u.pageX===i?(o=f(n.x,n.clientX-t.left),u=n.y):(o=u.pageX-t.left,u=u.pageY-t.top),e(n,{chartX:r(o),chartY:r(u)})},getCoordinates:function(n){var i={xAxis:[],yAxis:[]};return t(this.chart.axes,function(t){i[t.isXAxis?"xAxis":"yAxis"].push({axis:t,value:t.toValue(n[t.horiz?"chartX":"chartY"])})}),i},getIndex:function(n){var t=this.chart;return t.inverted?t.plotHeight+t.plotTop-n.chartY:n.chartX-t.plotLeft},runPointActions:function(i){var a=this.chart,r=a.series,l=a.tooltip,u,e,w=a.hoverPoint,f=a.hoverSeries,v,o,y=a.chartWidth,p=this.getIndex(i);if(l&&this.options.tooltip.shared&&(!f||!f.noSharedTooltip)){for(e=[],v=r.length,o=0;o<v;o++)r[o].visible&&r[o].options.enableMouseTracking!==!1&&!r[o].noSharedTooltip&&r[o].singularTooltips!==!0&&r[o].tooltipPoints.length&&(u=r[o].tooltipPoints[p])&&u.series&&(u._dist=d(p-u.clientX),y=s(y,u._dist),e.push(u));for(v=e.length;v--;)e[v]._dist>y&&e.splice(v,1);e.length&&e[0].clientX!==this.hoverX&&(l.refresh(e,i),this.hoverX=e[0].clientX)}if(r=f&&f.tooltipOptions.followPointer,f&&f.tracker&&!r){if((u=f.tooltipPoints[p])&&u!==w)u.onMouseOver(i)}else l&&r&&!l.isHidden&&(f=l.getAnchor([{}],i),l.updatePosition({plotX:f[0],plotY:f[1]}));l&&!this._onDocumentMouseMove&&(this._onDocumentMouseMove=function(n){if(at[li])at[li].pointer.onDocumentMouseMove(n)},h(c,"mousemove",this._onDocumentMouseMove));t(a.axes,function(t){t.drawCrosshair(i,n(u,w))})},reset:function(n,r){var e=this.chart,s=e.hoverSeries,u=e.hoverPoint,f=e.tooltip,o=f&&f.shared?e.hoverPoints:u;(n=n&&f&&o)&&fi(o)[0].plotX===i&&(n=!1);n?(f.refresh(o),u&&u.setState(u.state,!0)):(u&&u.onMouseOut(),s&&s.onMouseOut(),f&&f.hide(r),this._onDocumentMouseMove&&(ut(c,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null),t(e.axes,function(n){n.hideCrosshair()}),this.hoverX=null)},scaleGroups:function(n,i){var r=this.chart,u;t(r.series,function(t){u=n||t.getPlotBox();t.xAxis&&t.xAxis.zoomEnabled&&(t.group.attr(u),t.markerGroup&&(t.markerGroup.attr(u),t.markerGroup.clip(i?r.clipRect:null)),t.dataLabelsGroup&&t.dataLabelsGroup.attr(u))});r.clipRect.attr(i||r.clipBox)},dragStart:function(n){var t=this.chart;t.mouseIsDown=n.type;t.cancelClick=!1;t.mouseDownX=this.mouseDownX=n.chartX;t.mouseDownY=this.mouseDownY=n.chartY},drag:function(n){var i=this.chart,e=i.options.chart,t=n.chartX,r=n.chartY,a=this.zoomHor,v=this.zoomVert,u=i.plotLeft,f=i.plotTop,h=i.plotWidth,c=i.plotHeight,l,o=this.mouseDownX,s=this.mouseDownY,y=e.panKey&&n[e.panKey+"Key"];t<u?t=u:t>u+h&&(t=u+h);r<f?r=f:r>f+c&&(r=f+c);this.hasDragged=Math.sqrt(Math.pow(o-t,2)+Math.pow(s-r,2));this.hasDragged>10&&(l=i.isInsidePlot(o-u,s-f),i.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!y&&!this.selectionMarker&&(this.selectionMarker=i.renderer.rect(u,f,a?1:h,v?1:c,0).attr({fill:e.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add()),this.selectionMarker&&a&&(t-=o,this.selectionMarker.attr({width:d(t),x:(t>0?0:t)+o})),this.selectionMarker&&v&&(t=r-s,this.selectionMarker.attr({height:d(t),y:(t>0?0:t)+s})),l&&!this.selectionMarker&&e.panning&&i.pan(n,e.panning))},drop:function(n){var r=this.chart,u=this.hasPinched;if(this.selectionMarker){var o={xAxis:[],yAxis:[],originalEvent:n.originalEvent||n},i=this.selectionMarker,h=i.attr?i.attr("x"):i.x,c=i.attr?i.attr("y"):i.y,a=i.attr?i.attr("width"):i.width,v=i.attr?i.attr("height"):i.height,l;(this.hasDragged||u)&&(t(r.axes,function(t){if(t.zoomEnabled){var i=t.horiz,u=n.type==="touchend"?t.minPixelPadding:0,r=t.toValue((i?h:c)+u),i=t.toValue((i?h+a:c+v)-u);isNaN(r)||isNaN(i)||(o[t.coll].push({axis:t,min:s(r,i),max:f(r,i)}),l=!0)}}),l&&b(r,"selection",o,function(n){r.zoom(e(n,u?{animation:!1}:null))}));this.selectionMarker=this.selectionMarker.destroy();u&&this.scaleGroups()}r&&(p(r.container,{cursor:r._cursor}),r.cancelClick=this.hasDragged>10,r.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(n){n=this.normalize(n);n.preventDefault&&n.preventDefault();this.dragStart(n)},onDocumentMouseUp:function(n){at[li]&&at[li].pointer.drop(n)},onDocumentMouseMove:function(n){var t=this.chart,i=this.chartPosition,r=t.hoverSeries,n=this.normalize(n,i);i&&r&&!this.inClass(n.target,"highcharts-tracker")&&!t.isInsidePlot(n.chartX-t.plotLeft,n.chartY-t.plotTop)&&this.reset()},onContainerMouseLeave:function(){var n=at[li];n&&(n.pointer.reset(),n.pointer.chartPosition=null)},onContainerMouseMove:function(n){var t=this.chart;li=t.index;n=this.normalize(n);n.returnValue=!1;t.mouseIsDown==="mousedown"&&this.drag(n);(this.inClass(n.target,"highcharts-tracker")||t.isInsidePlot(n.chartX-t.plotLeft,n.chartY-t.plotTop))&&!t.openMenu&&this.runPointActions(n)},inClass:function(n,t){for(var i;n;){if(i=ot(n,"class")){if(i.indexOf(t)!==-1)return!0;if(i.indexOf("highcharts-container")!==-1)return!1}n=n.parentNode}},onTrackerMouseOut:function(n){var t=this.chart.hoverSeries,i=(n=n.relatedTarget||n.toElement)&&n.point&&n.point.series;!t||t.options.stickyTracking||this.inClass(n,"highcharts-tooltip")||i===t||t.onMouseOut()},onContainerClick:function(n){var t=this.chart,i=t.hoverPoint,r=t.plotLeft,u=t.plotTop,n=this.normalize(n);n.cancelBubble=!0;t.cancelClick||(i&&this.inClass(n.target,"highcharts-tracker")?(b(i.series,"click",e(n,{point:i})),t.hoverPoint&&i.firePointEvent("click",n)):(e(n,this.getCoordinates(n)),t.isInsidePlot(n.chartX-r,n.chartY-u)&&b(t,"click",n)))},setDOMEvents:function(){var n=this,t=n.chart.container;t.onmousedown=function(t){n.onContainerMouseDown(t)};t.onmousemove=function(t){n.onContainerMouseMove(t)};t.onclick=function(t){n.onContainerClick(t)};h(t,"mouseleave",n.onContainerMouseLeave);eu===1&&h(c,"mouseup",n.onDocumentMouseUp);ru&&(t.ontouchstart=function(t){n.onContainerTouchStart(t)},t.ontouchmove=function(t){n.onContainerTouchMove(t)},eu===1&&h(c,"touchend",n.onDocumentTouchEnd))},destroy:function(){var n;ut(this.chart.container,"mouseleave",this.onContainerMouseLeave);eu||(ut(c,"mouseup",this.onDocumentMouseUp),ut(c,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(n in this)this[n]=null}},e(g.Pointer.prototype,{pinchTranslate:function(n,t,i,r,u,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,n,t,i,r,u,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,n,t,i,r,u,f)},pinchTranslateDirection:function(n,t,i,r,u,f,e,o){var a=this.chart,c=n?"x":"y",k=n?"X":"Y",v="chart"+k,rt=n?"width":"height",g=a["plot"+(n?"Left":"Top")],l,nt,s=o||1,tt=a.inverted,y=a.bounds[n?"h":"v"],p=t.length===1,w=t[0][v],h=i[0][v],ut=!p&&t[1][v],b=!p&&i[1][v],it,i=function(){!p&&d(w-ut)>20&&(s=o||d(h-b)/d(w-ut));nt=(g-h)/s+w;l=a["plot"+(n?"Width":"Height")]/s};i();t=nt;t<y.min?(t=y.min,it=!0):t+l>y.max&&(t=y.max-l,it=!0);it?(h-=.8*(h-e[c][0]),p||(b-=.8*(b-e[c][1])),i()):e[c]=[h,b];tt||(f[c]=nt-g,f[rt]=l);f=tt?1/s:s;u[rt]=l;u[c]=t;r[tt?n?"scaleY":"scaleX":"scale"+k]=s;r["translate"+k]=f*g+(h-f*w)},pinch:function(i){var r=this,o=r.chart,u=r.pinchDown,v=r.followTouchMove,h=i.touches,y=h.length,c=r.lastValidTouch,l=r.hasZoom,a=r.selectionMarker,p={},b=y===1&&(r.inClass(i.target,"highcharts-tracker")&&o.runTrackerClick||r.runChartClick),w={};(l||v)&&!b&&i.preventDefault();wi(h,function(n){return r.normalize(n)});i.type==="touchstart"?(t(h,function(n,t){u[t]={chartX:n.chartX,chartY:n.chartY}}),c.x=[u[0].chartX,u[1]&&u[1].chartX],c.y=[u[0].chartY,u[1]&&u[1].chartY],t(o.axes,function(t){if(t.zoomEnabled){var r=o.bounds[t.horiz?"h":"v"],u=t.minPixelPadding,i=t.toPixels(n(t.options.min,t.dataMin)),e=t.toPixels(n(t.options.max,t.dataMax)),h=s(i,e),i=f(i,e);r.min=s(t.pos,h-u);r.max=f(t.pos+t.len,i+u)}}),r.res=!0):u.length&&(a||(r.selectionMarker=a=e({destroy:ei},o.plotBox)),r.pinchTranslate(u,h,p,a,w,c),r.hasPinched=l,r.scaleGroups(p,w),!l&&v&&y===1?this.runPointActions(r.normalize(i)):r.res&&(r.res=!1,this.reset(!1,0)))},onContainerTouchStart:function(n){var t=this.chart;li=t.index;n.touches.length===1?(n=this.normalize(n),t.isInsidePlot(n.chartX-t.plotLeft,n.chartY-t.plotTop)?(this.runPointActions(n),this.pinch(n)):this.reset()):n.touches.length===2&&this.pinch(n)},onContainerTouchMove:function(n){(n.touches.length===1||n.touches.length===2)&&this.pinch(n)},onDocumentTouchEnd:function(n){at[li]&&at[li].pointer.drop(n)}}),it.PointerEvent||it.MSPointerEvent){var bi={},vf=!!it.PointerEvent,ye=function(){var n,t=[];t.item=function(n){return this[n]};for(n in bi)bi.hasOwnProperty(n)&&t.push({pageX:bi[n].pageX,pageY:bi[n].pageY,target:bi[n].target});return t},yf=function(n,t,i,r){n=n.originalEvent||n;(n.pointerType==="touch"||n.pointerType===n.MSPOINTER_TYPE_TOUCH)&&at[li]&&(r(n),r=at[li].pointer,r[t]({type:i,target:n.currentTarget,preventDefault:ei,touches:ye()}))};e(lr.prototype,{onContainerPointerDown:function(n){yf(n,"onContainerTouchStart","touchstart",function(n){bi[n.pointerId]={pageX:n.pageX,pageY:n.pageY,target:n.currentTarget}})},onContainerPointerMove:function(n){yf(n,"onContainerTouchMove","touchmove",function(n){bi[n.pointerId]={pageX:n.pageX,pageY:n.pageY};bi[n.pointerId].target||(bi[n.pointerId].target=n.currentTarget)})},onDocumentPointerUp:function(n){yf(n,"onContainerTouchEnd","touchend",function(n){delete bi[n.pointerId]})},batchMSEvents:function(n){n(this.chart.container,vf?"pointerdown":"MSPointerDown",this.onContainerPointerDown);n(this.chart.container,vf?"pointermove":"MSPointerMove",this.onContainerPointerMove);n(c,vf?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});tt(lr.prototype,"init",function(n,t,i){n.call(this,t,i);(this.hasZoom||this.followTouchMove)&&p(t.container,{"-ms-touch-action":ct,"touch-action":ct})});tt(lr.prototype,"setDOMEvents",function(n){n.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(h)});tt(lr.prototype,"destroy",function(n){this.batchMSEvents(ut);n.call(this)})}hu=g.Legend=function(n,t){this.init(n,t)};hu.prototype={init:function(t,i){var r=this,f=i.itemStyle,u=n(i.padding,8),e=i.itemMarginTop||0;this.options=i;i.enabled&&(r.itemStyle=f,r.itemHiddenStyle=o(f,i.itemHiddenStyle),r.itemMarginTop=e,r.padding=u,r.initialItemX=u,r.initialItemY=u-5,r.maxItemWidth=0,r.chart=t,r.itemHeight=0,r.lastLineHeight=0,r.symbolWidth=n(i.symbolWidth,16),r.pages=[],r.render(),h(r.chart,"endResize",function(){r.positionCheckboxes()}))},colorizeItem:function(n,t){var f=this.options,u=n.legendItem,c=n.legendLine,e=n.legendSymbol,r=this.itemHiddenStyle.color,f=t?f.itemStyle.color:r,o=t?n.legendColor||n.color||"#CCC":r,r=n.options&&n.options.marker,s={fill:o},h;if(u&&u.css({fill:f,color:f}),c&&c.attr({stroke:o}),e){if(r&&e.isMarker)for(h in s.stroke=o,r=n.convertAttribs(r),r)u=r[h],u!==i&&(s[h]=u);e.attr(s)}},positionItem:function(n){var i=this.options,f=i.symbolPadding,i=!i.rtl,t=n._legendItemPos,r=t[0],t=t[1],u=n.checkbox;n.legendGroup&&n.legendGroup.translate(i?r:this.legendWidth-r-2*f-4,t);u&&(u.x=r,u.y=t)},destroyItem:function(n){var i=n.checkbox;t(["legendItem","legendLine","legendSymbol","legendGroup"],function(t){n[t]&&(n[t]=n[t].destroy())});i&&wr(n.checkbox)},destroy:function(){var n=this.group,t=this.box;t&&(this.box=t.destroy());n&&(this.group=n.destroy())},positionCheckboxes:function(n){var r=this.group.alignAttr,i,u=this.clipHeight||this.legendHeight;r&&(i=r.translateY,t(this.allItems,function(t){var f=t.checkbox,e;f&&(e=i+f.y+(n||0)+3,p(f,{left:r.translateX+t.checkboxOffset+f.x-20+"px",top:e+"px",display:e>i-6&&e<i+u-6?"":ct}))}))},renderTitle:function(){var n=this.padding,t=this.options.title,i=0;t.text&&(this.title||(this.title=this.chart.renderer.label(t.text,n-3,n-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(t.style).add(this.group)),n=this.title.getBBox(),i=n.height,this.offsetWidth=n.width,this.contentGroup.attr({translateY:i}));this.titleHeight=i},renderItem:function(t){var w=this.chart,s=w.renderer,i=this.options,c=i.layout==="horizontal",u=this.symbolWidth,e=i.symbolPadding,y=this.itemStyle,b=this.itemHiddenStyle,k=this.padding,d=c?n(i.itemDistance,20):0,g=!i.rtl,nt=i.width,p=i.itemMarginBottom||0,l=this.itemMarginTop,a=this.initialItemX,h=t.legendItem,tt=t.series&&t.series.drawLegendSymbol?t.series:t,v=tt.options,v=this.createCheckboxForItem&&v&&v.showCheckbox,it=i.useHTML;h||(t.legendGroup=s.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),t.legendItem=h=s.text(i.labelFormat?fr(i.labelFormat,t):i.labelFormatter.call(t),g?u+e:-e,this.baseline||0,it).css(o(t.visible?y:b)).attr({align:g?"left":"right",zIndex:2}).add(t.legendGroup),this.baseline||(this.baseline=s.fontMetrics(y.fontSize,h).f+3+l,h.attr("y",this.baseline)),tt.drawLegendSymbol(this,t),this.setItemEvents&&this.setItemEvents(t,h,it,y,b),this.colorizeItem(t,t.visible),v&&this.createCheckboxForItem(t));s=h.getBBox();u=t.checkboxOffset=i.itemWidth||t.legendItemWidth||u+e+s.width+d+(v?20:0);this.itemHeight=e=r(t.legendItemHeight||s.height);c&&this.itemX-a+u>(nt||w.chartWidth-2*k-a-i.x)&&(this.itemX=a,this.itemY+=l+this.lastLineHeight+p,this.lastLineHeight=0);this.maxItemWidth=f(this.maxItemWidth,u);this.lastItemY=l+this.itemY+p;this.lastLineHeight=f(e,this.lastLineHeight);t._legendItemPos=[this.itemX,this.itemY];c?this.itemX+=u:(this.itemY+=l+e+p,this.lastLineHeight=e);this.offsetWidth=nt||f((c?this.itemX-a-d:u)+k,this.offsetWidth)},getAllItems:function(){var r=[];return t(this.chart.series,function(t){var f=t.options;n(f.showInLegend,u(f.linkedTo)?!1:i,!0)&&(r=r.concat(t.legendItems||(f.legendType==="point"?t.data:t)))}),r},render:function(){var n=this,a=n.chart,h=a.renderer,s=n.group,f,c,o,i,r=n.box,u=n.options,v=n.padding,l=u.borderWidth,y=u.backgroundColor;n.itemX=n.initialItemX;n.itemY=n.initialItemY;n.offsetWidth=0;n.lastItemY=0;s||(n.group=s=h.g("legend").attr({zIndex:7}).add(),n.contentGroup=h.g().attr({zIndex:1}).add(s),n.scrollGroup=h.g().add(n.contentGroup));n.renderTitle();f=n.getAllItems();rf(f,function(n,t){return(n.options&&n.options.legendIndex||0)-(t.options&&t.options.legendIndex||0)});u.reversed&&f.reverse();n.allItems=f;n.display=c=!!f.length;t(f,function(t){n.renderItem(t)});o=u.width||n.offsetWidth;i=n.lastItemY+n.lastLineHeight+n.titleHeight;i=n.handleOverflow(i);(l||y)&&(o+=v,i+=v,r?o>0&&i>0&&(r[r.isNew?"attr":"animate"](r.crisp({width:o,height:i})),r.isNew=!1):(n.box=r=h.rect(0,0,o,i,u.borderRadius,l||0).attr({stroke:u.borderColor,"stroke-width":l||0,fill:y||ct}).add(s).shadow(u.shadow),r.isNew=!0),r[c?"show":"hide"]());n.legendWidth=o;n.legendHeight=i;t(f,function(t){n.positionItem(t)});c&&s.align(e({width:o,height:i},u),!0,"spacingBox");a.isResizing||this.positionCheckboxes()},handleOverflow:function(i){var c=this,w=this.chart,l=w.renderer,h=this.options,u=h.y,u=w.spacingBox.height+(h.verticalAlign==="top"?-u:u)-this.padding,k=h.maxHeight,v,a=this.clipRect,b=h.navigation,d=n(b.animation,!0),y=b.arrowSize||12,e=this.nav,o=this.pages,p,g=this.allItems;return h.layout==="horizontal"&&(u/=2),k&&(u=s(u,k)),o.length=0,i>u&&!h.useHTML?(this.clipHeight=v=f(u-20-this.titleHeight-this.padding,0),this.currentPage=n(this.currentPage,1),this.fullHeight=i,t(g,function(n,t){var i=n._legendItemPos[1],f=r(n.legendItem.getBBox().height),u=o.length;(!u||i-o[u-1]>v&&(p||i)!==o[u-1])&&(o.push(p||i),u++);t===g.length-1&&i+f-o[u-1]>v&&o.push(i);i!==p&&(p=i)}),a||(a=c.clipRect=l.clipRect(0,this.padding,9999,0),c.contentGroup.clip(a)),a.attr({height:v}),e||(this.nav=e=l.g().attr({zIndex:1}).add(this.group),this.up=l.symbol("triangle",0,0,y,y).on("click",function(){c.scroll(-1,d)}).add(e),this.pager=l.text("",15,10).css(b.style).add(e),this.down=l.symbol("triangle-down",0,0,y,y).on("click",function(){c.scroll(1,d)}).add(e)),c.scroll(0),i=u):e&&(a.attr({height:w.chartHeight}),e.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),i},scroll:function(n,t){var u=this.pages,f=u.length,r=this.currentPage+n,s=this.clipHeight,e=this.options.navigation,o=e.activeColor,e=e.inactiveColor,h=this.pager,c=this.padding;r>f&&(r=f);r>0&&(t!==i&&nu(t,this.chart),this.nav.attr({translateX:c,translateY:s+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:r===1?e:o}).css({cursor:r===1?"default":"pointer"}),h.attr({text:r+"/"+f}),this.down.attr({x:18+this.pager.getBBox().width,fill:r===f?e:o}).css({cursor:r===f?"default":"pointer"}),u=-u[r-1]+this.initialItemY,this.scrollGroup.animate({translateY:u}),this.currentPage=r,this.positionCheckboxes(u))}};rt=g.LegendSymbolMixin={drawRectangle:function(n,t){var i=n.options.symbolHeight||12;t.legendSymbol=this.chart.renderer.rect(0,n.baseline-5-i/2,n.symbolWidth,i,n.options.symbolRadius||0).attr({zIndex:3}).add(t.legendGroup)},drawLineMarker:function(n){var t=this.options,u=t.marker,i=n.symbolWidth;var f=this.chart.renderer,o=this.legendGroup,n=n.baseline-r(f.fontMetrics(n.options.itemStyle.fontSize,this.legendItem).b*.3),e;t.lineWidth&&(e={"stroke-width":t.lineWidth},t.dashStyle&&(e.dashstyle=t.dashStyle),this.legendLine=f.path(["M",0,n,"L",i,n]).attr(e).add(o));u&&u.enabled!==!1&&(t=u.radius,this.legendSymbol=i=f.symbol(this.symbol,i/2-t,n-t,2*t,2*t).add(o),i.isMarker=!0)}};(/Trident\/7\.0/.test(gi)||iu)&&tt(hu.prototype,"positionItem",function(n,t){var r=this,i=function(){t._legendItemPos&&n.call(r,t)};i();setTimeout(i)});yi.prototype={init:function(t,i){var f,u=t.series,e,r,s;if(t.series=null,f=o(w,t),f.series=t.series=u,this.userOptions=t,u=f.chart,this.margin=this.splashArray("margin",u),this.spacing=this.splashArray("spacing",u),e=u.events,this.bounds={h:{},v:{}},this.callback=i,this.isResizing=0,this.options=f,this.axes=[],this.series=[],this.hasCartesianSeries=u.showAxes,r=this,r.index=at.length,at.push(r),eu++,u.reflow!==!1&&h(r,"load",function(){r.initReflow()}),e)for(s in e)h(r,s,e[s]);r.xAxis=[];r.yAxis=[];r.animation=ii?!1:n(u.animation,!0);r.pointCount=r.colorCounter=r.symbolCounter=0;r.firstRender()},initSeries:function(n){var t=this.options.chart;return(t=v[n.type||t.type||t.defaultSeriesType])||ri(17,!0),t=new t,t.init(this,n),t},isInsidePlot:function(n,t,i){var r=i?t:n,n=i?n:t;return r>=0&&r<=this.plotWidth&&n>=0&&n<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&t(this.axes,function(n){n.adjustTickAmount()});this.maxTicks=null},redraw:function(n){var u=this.axes,i=this.series,s=this.pointer,h=this.legend,c=this.isDirtyLegend,f,l,a=this.hasCartesianSeries,o=this.isDirtyBox,v=i.length,r=v,y=this.renderer,p=y.isHidden(),w=[];for(nu(n,this),p&&this.cloneRenderTo(),this.layOutTitles();r--;)if(n=i[r],n.options.stacking&&(f=!0,n.isDirty)){l=!0;break}if(l)for(r=v;r--;)(n=i[r],n.options.stacking)&&(n.isDirty=!0);t(i,function(n){n.isDirty&&n.options.legendType==="point"&&(c=!0)});c&&h.options.enabled&&(h.render(),this.isDirtyLegend=!1);f&&this.getStacks();a&&(this.isResizing||(this.maxTicks=null,t(u,function(n){n.setScale()})),this.adjustTickAmounts());this.getMargins();a&&(t(u,function(n){n.isDirty&&(o=!0)}),t(u,function(n){n.isDirtyExtremes&&(n.isDirtyExtremes=!1,w.push(function(){b(n,"afterSetExtremes",e(n.eventArgs,n.getExtremes()));delete n.eventArgs}));(o||f)&&n.redraw()}));o&&this.drawChartBox();t(i,function(n){n.isDirty&&n.visible&&(!n.isCartesian||n.xAxis)&&n.redraw()});s&&s.reset(!0);y.draw();b(this,"redraw");p&&this.cloneRenderTo(!0);t(w,function(n){n.call()})},get:function(n){for(var i=this.axes,r=this.series,u,t=0;t<i.length;t++)if(i[t].options.id===n)return i[t];for(t=0;t<r.length;t++)if(r[t].options.id===n)return r[t];for(t=0;t<r.length;t++)for(u=r[t].points||[],i=0;i<u.length;i++)if(u[i].id===n)return u[i];return null},getAxes:function(){var r=this,n=this.options,i=n.xAxis=fi(n.xAxis||{}),n=n.yAxis=fi(n.yAxis||{});t(i,function(n,t){n.index=t;n.isX=!0});t(n,function(n,t){n.index=t});i=i.concat(n);t(i,function(n){new k(r,n)});r.adjustTickAmounts()},getSelectedPoints:function(){var n=[];return t(this.series,function(t){n=n.concat(ku(t.points||[],function(n){return n.selected}))}),n},getSelectedSeries:function(){return ku(this.series,function(n){return n.selected})},getStacks:function(){var i=this;t(i.yAxis,function(n){n.stacks&&n.hasVisibleSeries&&(n.oldStacks=n.stacks)});t(i.series,function(t){t.options.stacking&&(t.visible===!0||i.options.chart.ignoreHiddenSeries===!1)&&(t.stackKey=t.type+n(t.options.stack,""))})},setTitle:function(n,i,r){var e,u=this,f=u.options,s;s=f.title=o(f.title,n);e=f.subtitle=o(f.subtitle,i);f=e;t([["title",n,s],["subtitle",i,f]],function(n){var t=n[0],i=u[t],r=n[1],n=n[2];i&&r&&(u[t]=i=i.destroy());n&&n.text&&!i&&(u[t]=u.renderer.text(n.text,0,0,n.useHTML).attr({align:n.align,"class":"highcharts-"+t,zIndex:n.zIndex||4}).css(n.style).add())});u.layOutTitles(r)},layOutTitles:function(t){var u=0,i=this.title,o=this.subtitle,f=this.options,r=f.title,f=f.subtitle,s=this.renderer,h=this.spacingBox.width-44;!i||(i.css({width:(r.width||h)+"px"}).align(e({y:s.fontMetrics(r.style.fontSize,i).b-3},r),!1,"spacingBox"),r.floating||r.verticalAlign)||(u=i.getBBox().height);o&&(o.css({width:(f.width||h)+"px"}).align(e({y:u+(r.margin-13)+s.fontMetrics(r.style.fontSize,o).b},f),!1,"spacingBox"),!f.floating&&!f.verticalAlign&&(u=br(u+o.getBBox().height)));i=this.titleOffset!==u;this.titleOffset=u;!this.isDirtyBox&&i&&(this.isDirtyBox=i,this.hasRendered&&n(t,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var t=this.options.chart,i=t.width,t=t.height,r=this.renderToClone||this.renderTo;u(i)||(this.containerWidth=bu(r,"width"));u(t)||(this.containerHeight=bu(r,"height"));this.chartWidth=f(0,i||this.containerWidth||600);this.chartHeight=f(0,n(t,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(n){var t=this.renderToClone,i=this.container;n?t&&(this.renderTo.appendChild(i),wr(t),delete this.renderToClone):(i&&i.parentNode===this.renderTo&&this.renderTo.removeChild(i),this.renderToClone=t=this.renderTo.cloneNode(0),p(t,{position:"absolute",top:"-9999px",display:"block"}),t.style.setProperty&&t.style.setProperty("display","block","important"),c.body.appendChild(t),i&&t.appendChild(i))},getContainer:function(){var n,i=this.options.chart,t,r,u;this.renderTo=n=i.renderTo;u="highcharts-"+of++;vr(n)&&(this.renderTo=n=c.getElementById(n));n||ri(13,!0);t=a(ot(n,"data-highcharts-chart"));!isNaN(t)&&at[t]&&at[t].hasRendered&&at[t].destroy();ot(n,"data-highcharts-chart",this.index);n.innerHTML="";i.skipClone||n.offsetWidth||this.cloneRenderTo();this.getChartSize();t=this.chartWidth;r=this.chartHeight;this.container=n=lt(dr,{className:"highcharts-container"+(i.className?" "+i.className:""),id:u},e({position:"relative",overflow:"hidden",width:t+"px",height:r+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},i.style),this.renderToClone||n);this._cursor=n.style.cursor;this.renderer=i.forExport?new gt(n,t,r,i.style,!0):new kr(n,t,r,i.style);ii&&this.renderer.create(this,n,t,r)},getMargins:function(){var e=this.spacing,o,s=this.legend,i=this.margin,r=this.options.legend,h=n(r.margin,20),c=r.x,l=r.y,a=r.align,v=r.verticalAlign,y=this.titleOffset;this.resetMargins();o=this.axisOffset;y&&!u(i[0])&&(this.plotTop=f(this.plotTop,y+this.options.title.margin+e[0]));s.display&&!r.floating&&(a==="right"?u(i[1])||(this.marginRight=f(this.marginRight,s.legendWidth-c+h+e[1])):a==="left"?u(i[3])||(this.plotLeft=f(this.plotLeft,s.legendWidth+c+h+e[3])):v==="top"?u(i[0])||(this.plotTop=f(this.plotTop,s.legendHeight+l+h+e[0])):v!=="bottom"||u(i[2])||(this.marginBottom=f(this.marginBottom,s.legendHeight-l+h+e[2])));this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&t(this.axes,function(n){n.getOffset()});u(i[3])||(this.plotLeft+=o[3]);u(i[0])||(this.plotTop+=o[0]);u(i[2])||(this.marginBottom+=o[2]);u(i[1])||(this.marginRight+=o[1]);this.setChartSize()},reflow:function(n){var t=this,i=t.options.chart,r=t.renderTo,u=i.width||bu(r,"width"),f=i.height||bu(r,"height"),i=n?n.target:it,r=function(){t.container&&(t.setSize(u,f,!1),t.hasUserSize=null)};!t.hasUserSize&&u&&f&&(i===it||i===c)&&((u!==t.containerWidth||f!==t.containerHeight)&&(clearTimeout(t.reflowTimeout),n?t.reflowTimeout=setTimeout(r,100):r()),t.containerWidth=u,t.containerHeight=f)},initReflow:function(){var n=this,t=function(t){n.reflow(t)};h(it,"resize",t);h(n,"destroy",function(){ut(it,"resize",t)})},setSize:function(n,i,e){var o=this,s,h,c;o.isResizing+=1;c=function(){o&&b(o,"endResize",null,function(){o.isResizing-=1})};nu(e,o);o.oldChartHeight=o.chartHeight;o.oldChartWidth=o.chartWidth;u(n)&&(o.chartWidth=s=f(0,r(n)),o.hasUserSize=!!s);u(i)&&(o.chartHeight=h=f(0,r(i)));(tr?du:p)(o.container,{width:s+"px",height:h+"px"},tr);o.setChartSize(!0);o.renderer.setSize(s,h,e);o.maxTicks=null;t(o.axes,function(n){n.isDirty=!0;n.setScale()});t(o.series,function(n){n.isDirty=!0});o.isDirtyLegend=!0;o.isDirtyBox=!0;o.layOutTitles();o.getMargins();o.redraw(e);o.oldChartHeight=null;b(o,"resize");tr===!1?c():setTimeout(c,tr&&tr.duration||500)},setChartSize:function(n){var e=this.inverted,o=this.renderer,i=this.chartWidth,v=this.chartHeight,y=this.options.chart,u=this.spacing,s=this.clipOffset,l,a,h,c;this.plotLeft=l=r(this.plotLeft);this.plotTop=a=r(this.plotTop);this.plotWidth=h=f(0,r(i-l-this.marginRight));this.plotHeight=c=f(0,r(v-a-this.marginBottom));this.plotSizeX=e?c:h;this.plotSizeY=e?h:c;this.plotBorderWidth=y.plotBorderWidth||0;this.spacingBox=o.spacingBox={x:u[3],y:u[0],width:i-u[3]-u[1],height:v-u[0]-u[2]};this.plotBox=o.plotBox={x:l,y:a,width:h,height:c};i=2*et(this.plotBorderWidth/2);e=br(f(i,s[3])/2);o=br(f(i,s[0])/2);this.clipBox={x:e,y:o,width:et(this.plotSizeX-f(i,s[1])/2-e),height:f(0,et(this.plotSizeY-f(i,s[2])/2-o))};n||t(this.axes,function(n){n.setAxisSize();n.setAxisTranslation()})},resetMargins:function(){var t=this.spacing,i=this.margin;this.plotTop=n(i[0],t[0]);this.marginRight=n(i[1],t[1]);this.marginBottom=n(i[2],t[2]);this.plotLeft=n(i[3],t[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var n=this.options.chart,r=this.renderer,a=this.chartWidth,v=this.chartHeight,t=this.chartBackground,y=this.plotBackground,c=this.plotBorder,p=this.plotBGImage,u=n.borderWidth||0,w=n.backgroundColor,b=n.plotBackgroundColor,k=n.plotBackgroundImage,f=n.plotBorderWidth||0,i,e=this.plotLeft,o=this.plotTop,s=this.plotWidth,h=this.plotHeight,d=this.plotBox,g=this.clipRect,l=this.clipBox;i=u+(n.shadow?8:0);(u||w)&&(t?t.animate(t.crisp({width:a-i,height:v-i})):(t={fill:w||ct},u&&(t.stroke=n.borderColor,t["stroke-width"]=u),this.chartBackground=r.rect(i/2,i/2,a-i,v-i,n.borderRadius,u).attr(t).addClass("highcharts-background").add().shadow(n.shadow)));b&&(y?y.animate(d):this.plotBackground=r.rect(e,o,s,h,0).attr({fill:b}).add().shadow(n.plotShadow));k&&(p?p.animate(d):this.plotBGImage=r.image(k,e,o,s,h).add());g?g.animate({width:l.width,height:l.height}):this.clipRect=r.clipRect(l);f&&(c?c.animate(c.crisp({x:e,y:o,width:s,height:h,strokeWidth:-f})):this.plotBorder=r.rect(e,o,s,h,0,-f).attr({stroke:n.plotBorderColor,"stroke-width":f,fill:ct,zIndex:1}).add());this.isDirtyBox=!1},propFromSeries:function(){var i=this,u=i.options.chart,n,f=i.options.series,e,r;t(["inverted","angular","polar"],function(t){for(n=v[u.type||u.defaultSeriesType],r=i[t]||u[t]||n&&n.prototype[t],e=f&&f.length;!r&&e--;)(n=v[f[e].type])&&n.prototype[t]&&(r=!0);i[t]=r})},linkSeries:function(){var n=this,i=n.series;t(i,function(n){n.linkedSeries.length=0});t(i,function(t){var i=t.options.linkedTo;vr(i)&&(i=i===":previous"?n.series[t.index-1]:n.get(i))&&(i.linkedSeries.push(t),t.linkedParent=i)})},renderSeries:function(){t(this.series,function(n){n.translate();n.setTooltipPoints&&n.setTooltipPoints();n.render()})},renderLabels:function(){var n=this,i=n.options.labels;i.items&&t(i.items,function(t){var r=e(i.style,t.style),u=a(r.left)+n.plotLeft,f=a(r.top)+n.plotTop+12;delete r.left;delete r.top;n.renderer.text(t.html,u,f).attr({zIndex:2}).css(r).add()})},render:function(){var n=this.axes,r=this.renderer,i=this.options;this.setTitle();this.legend=new hu(this,i.legend);this.getStacks();t(n,function(n){n.setScale()});this.getMargins();this.maxTicks=null;t(n,function(n){n.setTickPositions(!0);n.setMaxTicks()});this.adjustTickAmounts();this.getMargins();this.drawChartBox();this.hasCartesianSeries&&t(n,function(n){n.render()});this.seriesGroup||(this.seriesGroup=r.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.showCredits(i.credits);this.hasRendered=!0},showCredits:function(n){n.enabled&&!this.credits&&(this.credits=this.renderer.text(n.text,0,0).on("click",function(){n.href&&(location.href=n.href)}).attr({align:n.position.align,zIndex:8}).css(n.style).add().align(n.position))},destroy:function(){var n=this,f=n.axes,e=n.series,u=n.container,r,o=u&&u.parentNode;for(b(n,"destroy"),at[n.index]=i,eu--,n.renderTo.removeAttribute("data-highcharts-chart"),ut(n),r=f.length;r--;)f[r]=f[r].destroy();for(r=e.length;r--;)e[r]=e[r].destroy();t("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(t){var i=n[t];i&&i.destroy&&(n[t]=i.destroy())});u&&(u.innerHTML="",ut(u),o&&wr(u));for(r in n)delete n[r]},isReadyToRender:function(){var n=this;return!wt&&it==it.top&&c.readyState!=="complete"||ii&&!it.canvg?(ii?ie.push(function(){n.firstRender()},n.options.global.canvasToolsURL):c.attachEvent("onreadystatechange",function(){c.detachEvent("onreadystatechange",n.firstRender);c.readyState==="complete"&&n.firstRender()}),!1):!0},firstRender:function(){var n=this,i=n.options,r=n.callback;n.isReadyToRender()&&(n.getContainer(),b(n,"init"),n.resetMargins(),n.setChartSize(),n.propFromSeries(),n.getAxes(),t(i.series||[],function(t){n.initSeries(t)}),n.linkSeries(),b(n,"beforeRender"),g.Pointer&&(n.pointer=new lr(n,i)),n.render(),n.renderer.draw(),r&&r.apply(n,[n]),t(n.callbacks,function(t){t.apply(n,[n])}),n.cloneRenderTo(!0),b(n,"load"))},splashArray:function(t,i){var r=i[t],r=kt(r)?r:[r,r,r,r];return[n(i[t+"Top"],r[0]),n(i[t+"Right"],r[1]),n(i[t+"Bottom"],r[2]),n(i[t+"Left"],r[3])]}};yi.prototype.callbacks=[];bt=g.CenteredSeriesMixin={getCenter:function(){var t=this.options,i=this.chart,r=2*(t.slicedOffset||0),f,e=i.plotWidth-2*r,o=i.plotHeight-2*r,i=t.center,t=[n(i[0],"50%"),n(i[1],"50%"),t.size||"100%",t.innerSize||0],h=s(e,o),u;return wi(t,function(n,t){return u=/%$/.test(n),f=t<2||t===2&&u,(u?[e,o,h,h][t]*a(n)/100:n)+(f?r:0)})}};ai=function(){};ai.prototype={init:function(n,t,i){return this.series=n,this.applyOptions(t,i),this.pointAttr={},n.options.colorByPoint&&(t=n.options.colors||n.chart.options.colors,this.color=this.color||t[n.colorCounter++],n.colorCounter===t.length)&&(n.colorCounter=0),n.chart.pointCount++,this},applyOptions:function(n,t){var r=this.series,u=r.options.pointValKey||r.pointValKey,n=ai.prototype.optionsToObject.call(this,n);return e(this,n),this.options=this.options?e(this.options,n):n,u&&(this.y=this[u]),this.x===i&&r&&(this.x=t===i?r.autoIncrement():t),this},optionsToObject:function(n){var t={},i=this.series,r=i.pointArrayMap||["y"],u=r.length,f=0,e=0;if(typeof n=="number"||n===null)t[r[0]]=n;else if(rr(n))for(n.length>u&&(i=typeof n[0],i==="string"?t.name=n[0]:i==="number"&&(t.x=n[0]),f++);e<u;)t[r[e++]]=n[f++];else typeof n=="object"&&(t=n,n.dataLabels&&(i._hasPointLabels=!0),n.marker&&(i._hasPointMarkers=!0));return t},destroy:function(){var n=this.series.chart,t=n.hoverPoints,i;n.pointCount--;t&&(this.setState(),hi(t,this),!t.length)&&(n.hoverPoints=null);this===n.hoverPoint&&this.onMouseOut();(this.graphic||this.dataLabel)&&(ut(this),this.destroyElements());this.legendItem&&n.legend.destroyItem(this);for(i in this)this[i]=null},destroyElements:function(){for(var i="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),n,t=6;t--;)n=i[t],this[n]&&(this[n]=this[n].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(i){var u=this.series,r=u.tooltipOptions,o=n(r.valueDecimals,""),f=r.valuePrefix||"",e=r.valueSuffix||"";return t(u.pointArrayMap||["y"],function(n){n="{point."+n;(f||e)&&(i=i.replace(n+"}",f+n+"}"+e));i=i.replace(n+"}",n+":,."+o+"f}")}),fr(i,{point:this,series:this.series})},firePointEvent:function(n,t,i){var r=this,u=this.series.options;(u.point.events[n]||r.options&&r.options.events&&r.options.events[n])&&this.importEvents();n==="click"&&u.allowPointSelect&&(i=function(n){r.select(null,n.ctrlKey||n.metaKey||n.shiftKey)});b(this,n,t,i)}};y=function(){};y.prototype={isCartesian:!0,type:"line",pointClass:ai,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(i,r){var u=this,s,f,o=i.series,c=function(t,i){return n(t.options.index,t._i)-n(i.options.index,i._i)};u.chart=i;u.options=r=u.setOptions(r);u.linkedSeries=[];u.bindAxes();e(u,{name:r.name,state:"",pointAttr:{},visible:r.visible!==!1,selected:r.selected===!0});ii&&(r.animation=!1);f=r.events;for(s in f)h(u,s,f[s]);(f&&f.click||r.point&&r.point.events&&r.point.events.click||r.allowPointSelect)&&(i.runTrackerClick=!0);u.getColor();u.getSymbol();t(u.parallelArrays,function(n){u[n+"Data"]=[]});u.setData(r.data,!1);u.isCartesian&&(i.hasCartesianSeries=!0);o.push(u);u._i=o.length-1;rf(o,c);this.yAxis&&rf(this.yAxis.series,c);t(o,function(n,t){n.index=t;n.name=n.name||"Series "+(t+1)})},bindAxes:function(){var n=this,r=n.options,f=n.chart,u;t(n.axisTypes||[],function(e){t(f[e],function(t){u=t.options;(r[e]===u.index||r[e]!==i&&r[e]===u.id||r[e]===i&&u.index===0)&&(t.series.push(n),n[e]=t,t.isDirty=!0)});n[e]||n.optionalAxis===e||ri(18,!0)})},updateParallelArrays:function(n,i){var r=n.series,u=arguments;t(r.parallelArrays,typeof i=="number"?function(t){var u=t==="y"&&r.toYData?r.toYData(n):n[t];r[t+"Data"][i]=u}:function(n){Array.prototype[i].apply(r[n+"Data"],Array.prototype.slice.call(u,2))})},autoIncrement:function(){var i=this.options,t=this.xIncrement,t=n(t,i.pointStart,0);return this.pointInterval=n(this.pointInterval,i.pointInterval,1),this.xIncrement=t+this.pointInterval,t},getSegments:function(){var i=-1,r=[],u,n=this.points,f=n.length;if(f)if(this.options.connectNulls){for(u=f;u--;)n[u].y===null&&n.splice(u,1);n.length&&(r=[n])}else t(n,function(t,u){t.y===null?(u>i+1&&r.push(n.slice(i+1,u)),i=u):u===f-1&&r.push(n.slice(i+1,u+1))});this.segments=r},setOptions:function(n){var i=this.chart,t=i.options.plotOptions,i=i.userOptions||{},r=i.plotOptions||{},u=t[this.type];return this.userOptions=n,t=o(u,t.series,n),this.tooltipOptions=o(w.tooltip,w.plotOptions[this.type].tooltip,i.tooltip,r.series&&r.series.tooltip,r[this.type]&&r[this.type].tooltip,n.tooltip),u.marker===null&&delete t.marker,t},getCyclic:function(n,t,i){var r=this.userOptions,f="_"+n+"Index",e=n+"Counter";t||(u(r[f])?t=r[f]:(r[f]=t=this.chart[e]%i.length,this.chart[e]+=1),t=i[t]);this[n]=t},getColor:function(){this.options.colorByPoint||this.getCyclic("color",this.options.color||ft[this.type].color,this.chart.options.colors)},getSymbol:function(){var n=this.options.marker;this.getCyclic("symbol",n.symbol,this.chart.options.symbols);/^url/.test(this.symbol)&&(n.radius=0)},drawLegendSymbol:rt.drawLineMarker,setData:function(r,u,f,e){var o=this,c=o.points,w=c&&c.length||0,h,s=o.options,b=o.chart,v=null,l=o.xAxis,a=l&&!!l.categories,k=o.tooltipPoints,d=s.turboThreshold,p=this.xData,y=this.yData,g=(h=o.pointArrayMap)&&h.length,r=r||[];if(h=r.length,u=n(u,!0),e===!1||!h||w!==h||o.cropped||o.hasGroupedData){if(o.xIncrement=null,o.pointRange=a?1:s.pointRange,o.colorCounter=0,t(this.parallelArrays,function(n){o[n+"Data"].length=0}),d&&h>d){for(f=0;v===null&&f<h;)v=r[f],f++;if(ui(v)){for(a=n(s.pointStart,0),s=n(s.pointInterval,1),f=0;f<h;f++)p[f]=a,y[f]=r[f],a+=s;o.xIncrement=a}else if(rr(v))if(g)for(f=0;f<h;f++)s=r[f],p[f]=s[0],y[f]=s.slice(1,g+1);else for(f=0;f<h;f++)s=r[f],p[f]=s[0],y[f]=s[1];else ri(12)}else for(f=0;f<h;f++)r[f]!==i&&(s={series:o},o.pointClass.prototype.applyOptions.apply(s,[r[f]]),o.updateParallelArrays(s,f),a&&s.name)&&(l.names[s.x]=s.name);for(vr(y[0])&&ri(14,!0),o.data=[],o.options.data=r,f=w;f--;)c[f]&&c[f].destroy&&c[f].destroy();k&&(k.length=0);l&&(l.minRange=l.userMinRange);o.isDirty=o.isDirtyData=b.isDirtyBox=!0;f=!1}else t(r,function(n,t){c[t].update(n,!1,null,!1)});u&&b.redraw(f)},processData:function(n){var t=this.xData,l=this.yData,u=t.length,e,a,o,h,r,v,c,y,f,s;if(e=0,h=this.xAxis,v=this.options,r=v.cropThreshold,c=0,y=this.isCartesian,y&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!n)return!1;for(h&&(f=h.getExtremes(),s=f.min,f=f.max),y&&this.sorted&&(!r||u>r||this.forceCrop)&&(t[u-1]<s||t[0]>f?(t=[],l=[]):(t[0]<s||t[u-1]>f)&&(e=this.cropData(this.xData,this.yData,s,f),t=e.xData,l=e.yData,e=e.start,a=!0,c=t.length)),r=t.length-1;r>=0;r--)u=t[r]-t[r-1],!a&&t[r]>s&&t[r]<f&&c++,u>0&&(o===i||u<o)?o=u:u<0&&this.requireSorting&&ri(15);this.cropped=a;this.cropStart=e;this.processedXData=t;this.processedYData=l;this.activePointCount=c;v.pointRange===null&&(this.pointRange=o||1);this.closestPointRange=o},cropData:function(t,i,r,u){for(var h=t.length,o=0,s=h,c=n(this.cropShoulder,1),e=0;e<h;e++)if(t[e]>=r){o=f(0,e-c);break}for(;e<h;e++)if(t[e]>u){s=e+c;break}return{xData:t.slice(o,s),yData:i.slice(o,s),start:o,end:s}},generatePoints:function(){var e=this.options.data,t=this.data,c,o=this.processedXData,v=this.processedYData,l=this.pointClass,s=o.length,a=this.cropStart||0,r,u=this.hasGroupedData,h,f=[],n;for(t||u||(t=[],t.length=e.length,t=this.data=t),n=0;n<s;n++)r=a+n,u?f[n]=(new l).init(this,[o[n]].concat(fi(v[n]))):(t[r]?h=t[r]:e[r]!==i&&(t[r]=h=(new l).init(this,e[r],o[n])),f[n]=h),f[n].index=r;if(t&&(s!==(c=t.length)||u))for(n=0;n<c;n++)(n===a&&!u&&(n+=s),t[n])&&(t[n].destroyElements(),t[n].plotX=i);this.data=t;this.points=f},getExtremes:function(t){var l=this.yAxis,h=this.processedXData,e,s=[],c=0;e=this.xAxis.getExtremes();var a=e.min,v=e.max,f,o,r,u,t=t||this.stackedYData||this.processedYData;for(e=t.length,u=0;u<e;u++)if(o=h[u],r=t[u],f=r!==null&&r!==i&&(!l.isLog||r.length||r>0),o=this.getExtremesFromAll||this.cropped||(h[u+1]||o)>=a&&(h[u-1]||o)<=v,f&&o)if(f=r.length)for(;f--;)r[f]!==null&&(s[c++]=r[f]);else s[c++]=r;this.dataMin=n(void 0,pr(s));this.dataMax=n(void 0,di(s))},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var e=this.options,y=e.stacking,c=this.xAxis,l=c.categories,s=this.yAxis,p=this.points,w=p.length,b=!!this.modifyValue,a=e.pointPlacement,k=a==="between"||ui(a),v=e.threshold,e=0;e<w;e++){var t=p[e],h=t.x,r=t.y,o=t.low,f=y&&s.stacks[(this.negStacks&&r<v?"-":"")+this.stackKey];s.isLog&&r<=0&&(t.y=r=null,ri(10));t.plotX=c.translate(h,0,0,0,1,a,this.type==="flags");y&&this.visible&&f&&f[h]&&(f=f[h],r=f.points[this.index+","+e],o=r[0],r=r[1],o===0&&(o=n(v,s.min)),s.isLog&&o<=0&&(o=null),t.total=t.stackTotal=f.total,t.percentage=f.total&&t.y/f.total*100,t.stackY=r,f.setOffset(this.pointXOffset||0,this.barW||0));t.yBottom=u(o)?s.translate(o,0,1,0,1):null;b&&(r=this.modifyValue(r,t));t.plotY=typeof r=="number"&&r!==Infinity?s.translate(r,0,1,0,1):i;t.clientX=k?c.translate(h,0,0,0,1):t.plotX;t.negative=t.y<(v||0);t.category=l&&l[t.x]!==i?l[t.x]:t.x}this.getSegments()},animate:function(n){var t=this.chart,o=t.renderer,i,u,f,r;i=this.options.animation;u=this.clipBox||t.clipBox;f=t.inverted;i&&!kt(i)&&(i=ft[this.type].animation);r=["_sharedClip",i.duration,i.easing,u.height].join(",");n?(n=t[r],i=t[r+"m"],n||(t[r]=n=o.clipRect(e(u,{width:0})),t[r+"m"]=i=o.clipRect(-99,f?-t.plotLeft:-t.plotTop,99,f?t.chartWidth:t.chartHeight)),this.group.clip(n),this.markerGroup.clip(i),this.sharedClipKey=r):((n=t[r])&&n.animate({width:t.plotSizeX},i),t[r+"m"]&&t[r+"m"].animate({width:t.plotSizeX+99},i),this.animate=null)},afterAnimate:function(){var n=this.chart,t=this.sharedClipKey,r=this.group,i=this.clipBox;r&&this.options.clip!==!1&&(t&&i||r.clip(i?n.renderer.clipRect(i):n.clipRect),this.markerGroup.clip());b(this,"afterAnimate");setTimeout(function(){t&&n[t]&&(i||(n[t]=n[t].destroy()),n[t+"m"]&&(n[t+"m"]=n[t+"m"].destroy()))},100)},drawPoints:function(){var s,w=this.points,a=this.chart,c,f,v,t,u,y,b,o,l=this.options.marker,d=this.pointAttr[""],h,k,p,g=this.markerGroup,nt=n(l.enabled,!this.requireSorting||this.activePointCount<.5*this.xAxis.len/l.radius);if(l.enabled!==!1||this._hasPointMarkers)for(v=w.length;v--;)(t=w[v],c=et(t.plotX),f=t.plotY,o=t.graphic,h=t.marker||{},k=!!t.marker,s=nt&&h.enabled===i||h.enabled,p=a.isInsidePlot(r(c),f,a.inverted),s&&f!==i&&!isNaN(f)&&t.y!==null)?(s=t.pointAttr[t.selected?"select":""]||d,u=s.r,y=n(h.symbol,this.symbol),b=y.indexOf("url")===0,o)?o[p?"show":"hide"](!0).animate(e({x:c-u,y:f-u},o.symbolName?{width:2*u,height:2*u}:{})):p&&(u>0||b)&&(t.graphic=a.renderer.symbol(y,c-u,f-u,2*u,2*u,k?h:l).attr(s).add(g)):o&&(t.graphic=o.destroy())},convertAttribs:function(t,i,r,u){var e=this.pointAttrToOptions,f,o,s={},t=t||{},i=i||{},r=r||{},u=u||{};for(f in e)o=e[f],s[f]=n(t[o],i[f],r[f],u[f]);return s},getAttribs:function(){var f=this,c=f.options,i=ft[f.type].marker?c.marker:c,l=i.states,o=l.hover,s,a=f.color,w;s={stroke:a,fill:a};var v=f.points||[],n,h=[],r,y=f.pointAttrToOptions;r=f.hasPointSpecificOptions;var p=c.negativeColor,b=i.lineColor,k=i.fillColor;if(n=c.turboThreshold,c.marker?(o.radius=o.radius||i.radius+o.radiusPlus,o.lineWidth=o.lineWidth||i.lineWidth+o.lineWidthPlus):o.color=o.color||ir(o.color||a).brighten(o.brightness).get(),h[""]=f.convertAttribs(i,s),t(["hover","select"],function(n){h[n]=f.convertAttribs(l[n],h[""])}),f.pointAttr=h,a=v.length,!n||a<n||r)for(;a--;){if(n=v[a],(i=n.options&&n.options.marker||n.options)&&i.enabled===!1&&(i.radius=0),n.negative&&p&&(n.color=n.fillColor=p),r=c.colorByPoint||n.color,n.options)for(w in y)u(i[y[w]])&&(r=!0);r?(i=i||{},r=[],l=i.states||{},s=l.hover=l.hover||{},c.marker||(s.color=s.color||!n.options.color&&o.color||ir(n.color).brighten(s.brightness||o.brightness).get()),s={color:n.color},k||(s.fillColor=n.color),b||(s.lineColor=n.color),r[""]=f.convertAttribs(e(s,i),h[""]),r.hover=f.convertAttribs(l.hover,h.hover,r[""]),r.select=f.convertAttribs(l.select,h.select,r[""])):r=h;n.pointAttr=r}},destroy:function(){var n=this,r=n.chart,h=/AppleWebKit\/533/.test(gi),e,u,o=n.data||[],f,s,i;for(b(n,"destroy"),ut(n),t(n.axisTypes||[],function(t){(i=n[t])&&(hi(i.series,n),i.isDirty=i.forceRedraw=!0)}),n.legendItem&&n.chart.legend.destroyItem(n),u=o.length;u--;)(f=o[u])&&f.destroy&&f.destroy();n.points=null;clearTimeout(n.animationTimeout);t("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(t){n[t]&&(e=h&&t==="group"?"hide":"destroy",n[t][e]())});r.hoverSeries===n&&(r.hoverSeries=null);hi(r.series,n);for(s in n)delete n[s]},getSegmentPath:function(n){var r=this,i=[],u=r.options.step;return t(n,function(t,f){var o=t.plotX,s=t.plotY,e;r.getPointSpline?i.push.apply(i,r.getPointSpline(n,t,f)):(i.push(f?"L":"M"),u&&f&&(e=n[f-1],u==="right"?i.push(e.plotX,s):u==="center"?i.push((e.plotX+o)/2,e.plotY,(e.plotX+o)/2,s):i.push(o,e.plotY)),i.push(t.plotX,t.plotY))}),i},getGraphPath:function(){var n=this,i=[],r,u=[];return t(n.segments,function(t){r=n.getSegmentPath(t);t.length>1?i=i.concat(r):u.push(t[0])}),n.singlePoints=u,n.graphPath=i},drawGraph:function(){var i=this,n=this.options,u=[["graph",n.lineColor||this.color]],f=n.lineWidth,e=n.dashStyle,s=n.linecap!=="square",r=this.getGraphPath(),o=n.negativeColor;o&&u.push(["graphNeg",o]);t(u,function(t,u){var h=t[0],o=i[h];o?(ou(o),o.animate({d:r})):f&&r.length&&(o={stroke:t[1],"stroke-width":f,fill:ct,zIndex:1},e?o.dashstyle=e:s&&(o["stroke-linecap"]=o["stroke-linejoin"]="round"),i[h]=i.chart.renderer.path(r).attr(o).add(i.group).shadow(!u&&n.shadow))})},clipNeg:function(){var e=this.options,n=this.chart,h=n.renderer,t=e.negativeColor||e.negativeFillColor,i,c=this.graph,l=this.area,o=this.posClip,s=this.negClip;i=n.chartWidth;var a=n.chartHeight,u=f(i,a),v=this.yAxis;t&&(c||l)&&(t=r(v.toPixels(e.threshold||0,!0)),t<0&&(u-=t),e={x:0,y:0,width:u,height:t},u={x:0,y:t,width:u,height:u},n.inverted&&(e.height=u.y=n.plotWidth-t,h.isVML&&(e={x:n.plotWidth-t-n.plotLeft,y:0,width:i,height:a},u={x:t+n.plotLeft-i,y:0,width:n.plotLeft+t,height:i})),v.reversed?(n=u,i=e):(n=e,i=u),o?(o.animate(n),s.animate(i)):(this.posClip=o=h.clipRect(n),this.negClip=s=h.clipRect(i),c&&this.graphNeg&&(c.clip(o),this.graphNeg.clip(s)),l&&(l.clip(o),this.areaNeg.clip(s))))},invertGroups:function(){function i(){var i={width:n.yAxis.len,height:n.xAxis.len};t(["group","markerGroup"],function(t){n[t]&&n[t].attr(i).invert()})}var n=this,r=n.chart;n.xAxis&&(h(r,"resize",i),h(n,"destroy",function(){ut(r,"resize",i)}),i(),n.invertGroups=i)},plotGroup:function(n,t,i,r,u){var f=this[n],e=!f;return e&&(this[n]=f=this.chart.renderer.g(t).attr({visibility:i,zIndex:r||.1}).add(u)),f[e?"attr":"animate"](this.getPlotBox()),f},getPlotBox:function(){var t=this.chart,i=this.xAxis,n=this.yAxis;return t.inverted&&(i=n,n=this.xAxis),{translateX:i?i.left:t.plotLeft,translateY:n?n.top:t.plotTop,scaleX:1,scaleY:1}},render:function(){var i=this,r=i.chart,u,e=i.options,f=(u=e.animation)&&!!i.animate&&r.renderer.isSVG&&n(u.duration,500)||0,o=i.visible?"visible":"hidden",s=e.zIndex,h=i.hasRendered,c=r.seriesGroup;u=i.plotGroup("group","series",o,s,c);i.markerGroup=i.plotGroup("markerGroup","markers",o,s,c);f&&i.animate(!0);i.getAttribs();u.inverted=i.isCartesian?r.inverted:!1;i.drawGraph&&(i.drawGraph(),i.clipNeg());t(i.points,function(n){n.redraw&&n.redraw()});i.drawDataLabels&&i.drawDataLabels();i.visible&&i.drawPoints();i.drawTracker&&i.options.enableMouseTracking!==!1&&i.drawTracker();r.inverted&&i.invertGroups();e.clip===!1||i.sharedClipKey||h||u.clip(r.clipRect);f&&i.animate();h||(f?i.animationTimeout=setTimeout(function(){i.afterAnimate()},f):i.afterAnimate());i.isDirty=i.isDirtyData=!1;i.hasRendered=!0},redraw:function(){var t=this.chart,f=this.isDirtyData,i=this.group,r=this.xAxis,u=this.yAxis;i&&(t.inverted&&i.attr({width:t.plotWidth,height:t.plotHeight}),i.animate({translateX:n(r&&r.left,t.plotLeft),translateY:n(u&&u.top,t.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0);this.render();f&&b(this,"updatedData")}};wf.prototype={destroy:function(){er(this,this.axis)},render:function(n){var t=this.options,i=t.format,i=i?fr(i,this):t.formatter.call(this);this.label?this.label.attr({text:i,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(i,null,null,t.useHTML).css(t.style).attr({align:this.textAlign,rotation:t.rotation,visibility:"hidden"}).add(n)},setOffset:function(n,t){var i=this.axis,e=i.chart,r=e.inverted,u=this.isNegative,f=i.translate(i.usePercentage?100:this.total,0,0,0,1),i=i.translate(0),i=d(f-i),s=e.xAxis[0].translate(this.x)+n,o=e.plotHeight,u={x:r?u?f:f-i:s,y:r?o-s-t:u?o-f-i:o-f,width:r?i:t,height:r?t:i};(r=this.label)&&(r.align(this.alignOptions,null,u),u=r.alignAttr,r[this.options.crop===!1||e.isInsidePlot(u.x,u.y)?"show":"hide"](!0))}};k.prototype.buildStacks=function(){var i=this.series,r=n(this.options.reversedStacks,!0),t=i.length;if(!this.isXAxis){for(this.usePercentage=!1;t--;)i[r?t:i.length-t-1].setStackedPoints();if(this.usePercentage)for(t=0;t<i.length;t++)i[t].setPercentStacks()}};k.prototype.renderStackTotals=function(){var n=this.chart,f=n.renderer,i=this.stacks,r,u,t=this.stackTotalGroup;t||(this.stackTotalGroup=t=f.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());t.translate(n.plotLeft,n.plotTop);for(r in i)for(u in n=i[r],n)n[u].render(t)};y.prototype.setStackedPoints=function(){if(this.options.stacking&&!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){for(var w=this.processedXData,a=this.processedYData,v=[],b=a.length,s=this.options,k=s.threshold,g=s.stack,s=s.stacking,h=this.stackKey,y="-"+h,p=this.negStacks,e=this.yAxis,i=e.stacks,c=e.oldStacks,r,n,l,t,o,u=0;u<b;u++)t=w[u],o=a[u],l=this.index+","+u,n=(r=p&&o<k)?y:h,i[n]||(i[n]={}),i[n][t]||(c[n]&&c[n][t]?(i[n][t]=c[n][t],i[n][t].total=null):i[n][t]=new wf(e,e.options.stackLabels,r,t,g)),n=i[n][t],n.points[l]=[n.cum||0],s==="percent"?(r=r?h:y,p&&i[r]&&i[r][t]?(r=i[r][t],n.total=r.total=f(r.total,n.total)+d(o)||0):n.total=ni(n.total+(d(o)||0))):n.total=ni(n.total+(o||0)),n.cum=(n.cum||0)+(o||0),n.points[l].push(n.cum),v[u]=n.cum;s==="percent"&&(e.usePercentage=!0);this.stackedYData=v;e.oldStacks={}}};y.prototype.setPercentStacks=function(){var n=this,i=n.stackKey,r=n.yAxis.stacks,u=n.processedXData;t([i,"-"+i],function(t){for(var o,e=u.length,i,f;e--;)(i=u[e],o=(f=r[t]&&r[t][i])&&f.points[n.index+","+e],i=o)&&(f=f.total?100/f.total:0,i[0]=ni(i[0]*f),i[1]=ni(i[1]*f),n.stackedYData[e]=i[1])})};e(yi.prototype,{addSeries:function(t,i,r){var f,u=this;return t&&(i=n(i,!0),b(u,"addSeries",{options:t},function(){f=u.initSeries(t);u.isDirtyLegend=!0;u.linkSeries();i&&u.redraw(r)})),f},addAxis:function(t,i,r,u){var f=i?"xAxis":"yAxis",e=this.options;new k(this,o(t,{index:this[f].length,isX:i}));e[f]=fi(e[f]||{});e[f].push(t);n(r,!0)&&this.redraw(u)},showLoading:function(n){var t=this,u=t.options,i=t.loadingDiv,r=u.loading,f=function(){i&&p(i,{left:t.plotLeft+"px",top:t.plotTop+"px",width:t.plotWidth+"px",height:t.plotHeight+"px"})};i||(t.loadingDiv=i=lt(dr,{className:"highcharts-loading"},e(r.style,{zIndex:10,display:ct}),t.container),t.loadingSpan=lt("span",null,r.labelStyle,i),h(t,"redraw",f));t.loadingSpan.innerHTML=n||u.lang.loading;t.loadingShown||(p(i,{opacity:0,display:""}),du(i,{opacity:r.style.opacity},{duration:r.showDuration||0}),t.loadingShown=!0);f()},hideLoading:function(){var t=this.options,n=this.loadingDiv;n&&du(n,{opacity:0},{duration:t.loading.hideDuration||100,complete:function(){p(n,{display:ct})}});this.loadingShown=!1}});e(ai.prototype,{update:function(t,i,r,u){function c(){f.applyOptions(t);kt(t)&&!rr(t)&&(f.redraw=function(){o&&(t&&t.marker&&t.marker.symbol?f.graphic=o.destroy():o.attr(f.pointAttr[f.state||""]));t&&t.dataLabels&&f.dataLabel&&(f.dataLabel=f.dataLabel.destroy());f.redraw=null});s=f.index;e.updateParallelArrays(f,s);l.data[s]=f.options;e.isDirty=e.isDirtyData=!0;!e.fixedBox&&e.hasCartesianSeries&&(h.isDirtyBox=!0);l.legendType==="point"&&h.legend.destroyItem(f);i&&h.redraw(r)}var f=this,e=f.series,o=f.graphic,s,h=e.chart,l=e.options,i=n(i,!0);u===!1?c():f.firePointEvent("update",{options:t},c)},remove:function(t,i){var u=this,r=u.series,o=r.points,s=r.chart,f,e=r.data;nu(i,s);t=n(t,!0);u.firePointEvent("remove",null,function(){f=cr(u,e);e.length===o.length&&o.splice(f,1);e.splice(f,1);r.options.data.splice(f,1);r.updateParallelArrays(u,"splice",f,1);u.destroy();r.isDirty=!0;r.isDirtyData=!0;t&&s.redraw()})}});e(y.prototype,{addPoint:function(i,r,u,f){var c=this.options,s=this.data,o=this.graph,e=this.area,l=this.chart,a=this.xAxis&&this.xAxis.names,p=o&&o.shift||0,v=c.data,y,h=this.xData;if(nu(f,l),u&&t([o,e,this.graphNeg,this.areaNeg],function(n){n&&(n.shift=p+1)}),e&&(e.isArea=!0),r=n(r,!0),f={series:this},this.pointClass.prototype.applyOptions.apply(f,[i]),o=f.x,e=h.length,this.requireSorting&&o<h[e-1])for(y=!0;e&&h[e-1]>o;)e--;this.updateParallelArrays(f,"splice",e,0,0);this.updateParallelArrays(f,e);a&&f.name&&(a[o]=f.name);v.splice(e,0,i);y&&(this.data.splice(e,0,null),this.processData());c.legendType==="point"&&this.generatePoints();u&&(s[0]&&s[0].remove?s[0].remove(!1):(s.shift(),this.updateParallelArrays(f,"shift"),v.shift()));this.isDirtyData=this.isDirty=!0;r&&(this.getAttribs(),l.redraw())},remove:function(t,i){var r=this,u=r.chart,t=n(t,!0);r.isRemoving||(r.isRemoving=!0,b(r,"remove",null,function(){r.destroy();u.isDirtyLegend=u.isDirtyBox=!0;u.linkSeries();t&&u.redraw(i)}));r.isRemoving=!1},update:function(r,u){var s=this,h=this.chart,y=this.userOptions,l=this.type,a=v[l].prototype,f=["group","markerGroup","dataLabelsGroup"],c;t(f,function(n){f[n]=s[n];delete s[n]});r=o(y,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},r);this.remove(!1);for(c in a)a.hasOwnProperty(c)&&(this[c]=i);e(this,v[r.type||l].prototype);t(f,function(n){s[n]=f[n]});this.init(h,r);h.linkSeries();n(u,!0)&&h.redraw(!1)}});e(k.prototype,{update:function(t,r){var u=this.chart,t=u.options[this.coll][this.options.index]=o(this.userOptions,t);this.destroy(!0);this._addedPlotLB=i;this.init(u,e(t,{events:i}));u.isDirtyBox=!0;n(r,!0)&&u.redraw()},remove:function(i){for(var r=this.chart,u=this.coll,f=this.series,e=f.length;e--;)f[e]&&f[e].remove(!1);hi(r.axes,this);hi(r[u],this);r.options[u].splice(this.options.index,1);t(r[u],function(n,t){n.options.index=t});this.destroy();r.isDirtyBox=!0;n(i,!0)&&r.redraw()},setTitle:function(n,t){this.update({title:n},t)},setCategories:function(n,t){this.update({categories:n},t)}});vi=dt(y);v.line=vi;ft.area=o(nt,{threshold:0});oi=dt(y,{type:"area",getSegments:function(){var a=this,u=[],r=[],f=[],v=this.xAxis,e=this.yAxis,o=e.stacks[this.stackKey],i={},s,h,c=this.points,p=this.options.connectNulls,n,l;if(this.options.stacking&&!this.cropped){for(n=0;n<c.length;n++)i[c[n].x]=c[n];for(l in o)o[l].total!==null&&f.push(+l);f.sort(function(n,t){return n-t});t(f,function(t){var u=0,f;if(!p||i[t]&&i[t].y!==null)if(i[t])r.push(i[t]);else{for(n=a.index;n<=e.series.length;n++)if(f=o[t].points[n+","+t]){u=f[1];break}s=v.translate(t);h=e.toPixels(u,!0);r.push({y:null,plotX:s,clientX:s,plotY:h,yBottom:h,onMouseOver:ei})}});r.length&&u.push(r)}else y.prototype.getSegments.call(this),u=this.segments;this.segments=u},getSegmentPath:function(t){var r=y.prototype.getSegmentPath.call(this,t),u=[].concat(r),i,f=this.options,e,o;if(i=r.length,e=this.yAxis.getThreshold(f.threshold),i===3&&u.push("L",r[1],r[2]),f.stacking&&!this.closedStacks)for(i=t.length-1;i>=0;i--)o=n(t[i].yBottom,e),i<t.length-1&&f.step&&u.push(t[i+1].plotX,o),u.push(t[i].plotX,o);else this.closeSegment(u,t,e);return this.areaPath=this.areaPath.concat(u),r},closeSegment:function(n,t,i){n.push("L",t[t.length-1].plotX,i,"L",t[0].plotX,i)},drawGraph:function(){this.areaPath=[];y.prototype.drawGraph.apply(this);var i=this,u=this.areaPath,r=this.options,f=r.negativeColor,e=r.negativeFillColor,o=[["area",this.color,r.fillColor]];(f||e)&&o.push(["areaNeg",f,e]);t(o,function(t){var f=t[0],e=i[f];e?e.animate({d:u}):i[f]=i.chart.renderer.path(u).attr({fill:n(t[2],ir(t[1]).setOpacity(n(r.fillOpacity,.75)).get()),zIndex:0}).add(i.group)})},drawLegendSymbol:rt.drawRectangle});v.area=oi;ft.spline=o(nt);vi=dt(y,{type:"spline",getPointSpline:function(n,t,i){var c=t.plotX,r=t.plotY,o=n[i-1],h=n[i+1],a,e,l,u,v;return o&&h&&(n=o.plotY,l=h.plotX,h=h.plotY,a=(1.5*c+o.plotX)/2.5,e=(1.5*r+n)/2.5,l=(1.5*c+l)/2.5,u=(1.5*r+h)/2.5,v=(u-e)*(l-c)/(l-a)+r-u,e+=v,u+=v,e>n&&e>r?(e=f(n,r),u=2*r-e):e<n&&e<r&&(e=s(n,r),u=2*r-e),u>h&&u>r?(u=f(h,r),e=2*r-u):u<h&&u<r&&(u=s(h,r),e=2*r-u),t.rightContX=l,t.rightContY=u),i?(t=["C",o.rightContX||o.plotX,o.rightContY||o.plotY,a||c,e||r,c,r],o.rightContX=o.rightContY=null):t=["M",c,r],t}});v.spline=vi;ft.areaspline=o(ft.area);oi=oi.prototype;vi=dt(vi,{type:"areaspline",closedStacks:!0,getSegmentPath:oi.getSegmentPath,closeSegment:oi.closeSegment,drawGraph:oi.drawGraph,drawLegendSymbol:rt.drawRectangle});v.areaspline=vi;ft.column=o(nt,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0});vi=dt(y,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){y.prototype.init.apply(this,arguments);var n=this,i=n.chart;i.hasRendered&&t(i.series,function(t){t.type===n.type&&(t.isDirty=!0)})},getColumnMetrics:function(){var f=this,e=f.options,r=f.xAxis,y=f.yAxis,p=r.reversed,h,a={},v,o=0;e.grouping===!1?o=1:t(f.chart.series,function(n){var t=n.options,r=n.yAxis;n.type===f.type&&n.visible&&y.len===r.len&&y.pos===r.pos&&(t.stacking?(h=n.stackKey,a[h]===i&&(a[h]=o++),v=a[h]):t.grouping!==!1&&(v=o++),n.columnIndex=v)});var r=s(d(r.transA)*(r.ordinalSlope||e.pointRange||r.closestPointRange||r.tickInterval||1),r.len),w=r*e.groupPadding,c=(r-2*w)/o,l=e.pointWidth,e=u(l)?(c-l)/2:c*e.pointPadding,l=n(l,c-2*e);return f.columnMetrics={width:l,offset:e+(w+((p?o-(f.columnIndex||0):f.columnIndex)||0)*c-r/2)*(p?-1:1)}},translate:function(){var i=this,o=i.chart,h=i.options,l=i.borderWidth=n(h.borderWidth,i.activePointCount>.5*i.xAxis.len?0:1),e=i.yAxis,c=i.translatedThreshold=e.getThreshold(h.threshold),u=n(h.minPointLength,5),p=i.getColumnMetrics(),w=p.width,a=i.barW=f(w,1+2*l),k=i.pointXOffset=p.offset,b=-(l%2?.5:0),v=l%2?.5:1;o.renderer.isVML&&o.inverted&&(v+=1);h.pointPadding&&(a=br(a));y.prototype.translate.apply(i);t(i.points,function(t){var p=n(t.yBottom,c),nt=s(f(-999-p,t.plotY),e.len+999+p),l=t.plotX+k,g=a,h=s(nt,p),y;y=f(nt,p)-h;d(y)<u&&u&&(y=u,h=r(d(h-c)>u?p-u:c-(e.translate(t.y,0,1,0,1)<=c?u:0)));t.barX=l;t.pointWidth=w;t.tooltipPos=o.inverted?[e.len-nt,i.xAxis.len-l-g/2]:[l+g/2,nt+e.pos-o.plotTop];g=r(l+g)+b;l=r(l)+b;g-=l;p=d(h)<.5;y=r(h+y)+v;h=r(h)+v;y-=h;p&&(h-=1,y+=1);t.shapeType="rect";t.shapeArgs={x:l,y:h,width:g,height:y}})},getSymbol:ei,drawLegendSymbol:rt.drawRectangle,drawGraph:ei,drawPoints:function(){var n=this,e=this.chart,r=n.options,h=e.renderer,c=r.animationLimit||250,f,s;t(n.points,function(t){var l=t.plotY,a=t.graphic;l===i||isNaN(l)||t.y===null?a&&(t.graphic=a.destroy()):(f=t.shapeArgs,l=u(n.borderWidth)?{"stroke-width":n.borderWidth}:{},s=t.pointAttr[t.selected?"select":""]||n.pointAttr[""],a?(ou(a),a.attr(l)[e.pointCount<c?"animate":"attr"](o(f))):t.graphic=h[t.shapeType](f).attr(s).attr(l).add(n.group).shadow(r.shadow,null,r.stacking&&!r.borderRadius))})},animate:function(n){var i=this.yAxis,u=this.options,r=this.chart.inverted,t={};wt&&(n?(t.scaleY=.001,n=s(i.pos+i.len,f(i.pos,i.toPixels(u.threshold))),r?t.translateX=n-i.len:t.translateY=n,this.group.attr(t)):(t.scaleY=1,t[r?"translateX":"translateY"]=i.pos,this.group.animate(t,this.options.animation),this.animate=null))},remove:function(){var n=this,i=n.chart;i.hasRendered&&t(i.series,function(t){t.type===n.type&&(t.isDirty=!0)});y.prototype.remove.apply(n,arguments)}});v.column=vi;ft.bar=o(ft.column);oi=dt(vi,{type:"bar",inverted:!0});v.bar=oi;ft.scatter=o(nt,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●<\/span> <span style="font-size: 10px;"> {series.name}<\/span><br/>',pointFormat:"x: <b>{point.x}<\/b><br/>y: <b>{point.y}<\/b><br/>"},stickyTracking:!1});oi=dt(y,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&y.prototype.drawGraph.call(this)}});v.scatter=oi;ft.pie=o(nt,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});nt={type:"pie",isCartesian:!1,pointClass:dt(ai,{init:function(){ai.prototype.init.apply(this,arguments);var t=this,i;return t.y<0&&(t.y=null),e(t,{visible:t.visible!==!1,name:n(t.name,"Slice")}),i=function(n){t.slice(n.type==="select")},h(t,"select",i),h(t,"unselect",i),t},setVisible:function(n){var r=this,u=r.series,f=u.chart;r.visible=r.options.visible=n=n===i?!r.visible:n;u.options.data[cr(r,u.data)]=r.options;t(["graphic","dataLabel","connector","shadowGroup"],function(t){r[t]&&r[t][n?"show":"hide"](!0)});r.legendItem&&f.legend.colorizeItem(r,n);!u.isDirty&&u.options.ignoreHiddenPoint&&(u.isDirty=!0,f.redraw())},slice:function(t,i,r){var f=this.series;nu(r,f.chart);n(i,!0);this.sliced=this.options.sliced=t=u(t)?t:!this.sliced;f.options.data[cr(this,f.data)]=this.options;t=t?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(t);this.shadowGroup&&this.shadowGroup.animate(t)},haloPath:function(n){var t=this.shapeArgs,i=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(i.plotLeft+t.x,i.plotTop+t.y,t.r+n,t.r+n,{innerR:this.shapeArgs.r,start:t.start,end:t.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:ei,animate:function(n){var i=this,u=i.points,r=i.startAngleRad;n||(t(u,function(n){var t=n.graphic,n=n.shapeArgs;t&&(t.attr({r:i.center[3]/2,start:r,end:r}),t.animate({r:n.r,start:n.start,end:n.end},i.options.animation))}),i.animate=null)},setData:function(t,i,r,u){y.prototype.setData.call(this,t,!1,r,u);this.processData();this.generatePoints();n(i,!0)&&this.chart.redraw(r)},generatePoints:function(){var n,i=0,r,u,t,f=this.options.ignoreHiddenPoint;for(y.prototype.generatePoints.call(this),r=this.points,u=r.length,n=0;n<u;n++)t=r[n],i+=f&&!t.visible?0:t.y;for(this.total=i,n=0;n<u;n++)t=r[n],t.percentage=i>0?t.y/i*100:0,t.total=i},translate:function(t){this.generatePoints();var v=0,o=this.options,y=o.slicedOffset,c=y+o.borderWidth,f,e,i,l=o.startAngle||0,p=this.startAngleRad=ci/180*(l-90),l=(this.endAngleRad=ci/180*(n(o.endAngle,l+360)-90))-p,w=this.points,h=o.dataLabels.distance,o=o.ignoreHiddenPoint,a,b=w.length,u;for(t||(this.center=t=this.getCenter()),this.getX=function(n,r){return i=st.asin(s((n-t[1])/(t[2]/2+h),1)),t[0]+(r?-1:1)*pt(i)*(t[2]/2+h)},a=0;a<b;a++)u=w[a],f=p+v*l,(!o||u.visible)&&(v+=u.percentage/100),e=p+v*l,u.shapeType="arc",u.shapeArgs={x:t[0],y:t[1],r:t[2]/2,innerR:t[3]/2,start:r(f*1e3)/1e3,end:r(e*1e3)/1e3},i=(e+f)/2,i>1.5*ci?i-=2*ci:i<-ci/2&&(i+=2*ci),u.slicedTranslation={translateX:r(pt(i)*y),translateY:r(ti(i)*y)},f=pt(i)*t[2]/2,e=ti(i)*t[2]/2,u.tooltipPos=[t[0]+f*.7,t[1]+e*.7],u.half=i<-ci/2||i>ci/2?1:0,u.angle=i,c=s(c,h/2),u.labelPos=[t[0]+f+pt(i)*h,t[1]+e+ti(i)*h,t[0]+f+pt(i)*c,t[1]+e+ti(i)*c,t[0]+f,t[1]+e,h<0?"center":u.half?"right":"left",i]},drawGraph:null,drawPoints:function(){var n=this,f=n.chart.renderer,r,u,o=n.options.shadow,i,s;o&&!n.shadowGroup&&(n.shadowGroup=f.g("shadow").add(n.group));t(n.points,function(t){u=t.graphic;s=t.shapeArgs;i=t.shadowGroup;o&&!i&&(i=t.shadowGroup=f.g("shadow").add(n.shadowGroup));r=t.sliced?t.slicedTranslation:{translateX:0,translateY:0};i&&i.attr(r);u?u.animate(e(s,r)):t.graphic=u=f[t.shapeType](s).setRadialReference(n.center).attr(t.pointAttr[t.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(r).add(n.group).shadow(o,i);t.visible!==void 0&&t.setVisible(t.visible)})},sortByAngle:function(n,t){n.sort(function(n,i){return n.angle!==void 0&&(i.angle-n.angle)*t})},drawLegendSymbol:rt.drawRectangle,getCenter:bt.getCenter,getSymbol:ei};nt=dt(y,nt);v.pie=nt;y.prototype.drawDataLabels=function(){var f=this,a=f.options,y=a.cursor,r=a.dataLabels,w=f.points,l,v,p=f.hasRendered||0,s,c;(r.enabled||f._hasPointLabels)&&(f.dlProcessOptions&&f.dlProcessOptions(r),c=f.plotGroup("dataLabelsGroup","data-labels",r.defer?"hidden":"visible",r.zIndex||6),n(r.defer,!0)&&(c.attr({opacity:+p}),p||h(f,"afterAnimate",function(){f.visible&&c.show();c[a.animation?"animate":"attr"]({opacity:1},{duration:200})})),v=r,t(w,function(t){var a,h=t.dataLabel,p,w,b=t.connector,k=!0;if(l=t.options&&t.options.dataLabels,a=n(l&&l.enabled,v.enabled),h&&!a)t.dataLabel=h.destroy();else if(a){if(r=o(v,l),a=r.rotation,p=t.getLabelConfig(),s=r.format?fr(r.format,p):r.formatter.call(p,r),r.style.color=n(r.color,r.style.color,f.color,"black"),h)u(s)?(h.attr({text:s}),k=!1):(t.dataLabel=h=h.destroy(),b)&&(t.connector=b.destroy());else if(u(s)){h={fill:r.backgroundColor,stroke:r.borderColor,"stroke-width":r.borderWidth,r:r.borderRadius||0,rotation:a,padding:r.padding,zIndex:1};for(w in h)h[w]===i&&delete h[w];h=t.dataLabel=f.chart.renderer[a?"text":"label"](s,0,-999,null,null,null,r.useHTML).attr(h).css(e(r.style,y&&{cursor:y})).add(c).shadow(r.shadow)}h&&f.alignDataLabel(t,h,r,null,k)}}))};y.prototype.alignDataLabel=function(t,i,u,f,o){var h=this.chart,s=h.inverted,l=n(t.plotX,-999),a=n(t.plotY,-999),c=i.getBBox();(t=this.visible&&(t.series.forceDL||h.isInsidePlot(l,r(a),s)||f&&h.isInsidePlot(l,s?f.x+1:f.y+f.height-1,s)))&&(f=e({x:s?h.plotWidth-a:l,y:r(s?h.plotHeight-l:a),width:0,height:0},f),e(u,{width:c.width,height:c.height}),u.rotation?i[o?"attr":"animate"]({x:f.x+u.x+f.width/2,y:f.y+u.y+f.height/2}).attr({align:u.align}):(i.align(u,null,f),s=i.alignAttr,n(u.overflow,"justify")==="justify"?this.justifyDataLabel(i,u,s,c,f,o):n(u.crop,!0)&&(t=h.isInsidePlot(s.x,s.y)&&h.isInsidePlot(s.x+c.width,s.y+c.height))));t||(i.attr({y:-999}),i.placed=!1)};y.prototype.justifyDataLabel=function(n,t,i,r,u,f){var s=this.chart,h=t.align,c=t.verticalAlign,e,o;e=i.x;e<0&&(h==="right"?t.align="left":t.x=-e,o=!0);e=i.x+r.width;e>s.plotWidth&&(h==="left"?t.align="right":t.x=s.plotWidth-e,o=!0);e=i.y;e<0&&(c==="bottom"?t.verticalAlign="top":t.y=-e,o=!0);e=i.y+r.height;e>s.plotHeight&&(c==="top"?t.verticalAlign="bottom":t.y=s.plotHeight-e,o=!0);o&&(n.placed=!f,n.align(t,null,u))};v.pie&&(v.pie.prototype.drawDataLabels=function(){var a=this,k=a.data,e,st=a.chart,g=a.options.dataLabels,rt=n(g.connectorPadding,10),yt=n(g.connectorWidth,1),pt=st.plotWidth,wt=st.plotHeight,it,ct,dt=n(g.softConnector,!0),tt=g.distance,lt=a.center,ft=lt[2]/2,ht=lt[1],gt=tt>0,v,h,u,bt=[[],[]],p,o,et,ut,i,w=[0,0,0,0],kt=function(n,t){return t.y-n.y},vt,ot;if(a.visible&&(g.enabled||a._hasPointLabels)){for(y.prototype.drawDataLabels.apply(a),t(k,function(n){n.dataLabel&&n.visible&&bt[n.half].push(n)}),ut=2;ut--;){var b=[],at=[],l=bt[ut],nt=l.length,c;if(nt){for(a.sortByAngle(l,ut-.5),i=k=0;!k&&l[i];)k=l[i]&&l[i].dataLabel&&(l[i].dataLabel.getBBox().height||21),i++;if(tt>0){for(h=s(ht+ft+tt,st.plotHeight),i=f(0,ht-ft-tt);i<=h;i+=k)b.push(i);if(h=b.length,nt>h){for(e=[].concat(l),e.sort(kt),i=nt;i--;)e[i].rank=i;for(i=nt;i--;)l[i].rank>=h&&l.splice(i,1);nt=l.length}for(i=0;i<nt;i++){for(e=l[i],u=e.labelPos,e=9999,ot=0;ot<h;ot++)vt=d(b[ot]-u[1]),vt<e&&(e=vt,c=ot);if(c<i&&b[i]!==null)c=i;else for(h<nt-i+c&&b[i]!==null&&(c=h-nt+i);b[c]===null;)c++;at.push({i:c,y:b[c]});b[c]=null}at.sort(kt)}for(i=0;i<nt;i++)e=l[i],u=e.labelPos,v=e.dataLabel,et=e.visible===!1?"hidden":"visible",e=u[1],tt>0?(h=at.pop(),c=h.i,o=h.y,e>o&&b[c+1]!==null||e<o&&b[c-1]!==null)&&(o=s(f(0,e),st.plotHeight)):o=e,p=g.justify?lt[0]+(ut?-1:1)*(ft+tt):a.getX(o===ht-ft-tt||o===ht+ft+tt?e:o,ut),v._attr={visibility:et,align:u[6]},v._pos={x:p+g.x+({left:rt,right:-rt}[u[6]]||0),y:o+g.y-10},v.connX=p,v.connY=o,this.options.size===null&&(h=v.width,p-h<rt?w[3]=f(r(h-p+rt),w[3]):p+h>pt-rt&&(w[1]=f(r(p+h-pt+rt),w[1])),o-k/2<0?w[0]=f(r(-o+k/2),w[0]):o+k/2>wt&&(w[2]=f(r(o+k/2-wt),w[2])))}}(di(w)===0||this.verifyDataLabelOverflow(w))&&(this.placeDataLabels(),gt&&yt&&t(this.points,function(n){it=n.connector;u=n.labelPos;(v=n.dataLabel)&&v._pos?(et=v._attr.visibility,p=v.connX,o=v.connY,ct=dt?["M",p+(u[6]==="left"?5:-5),o,"C",p,o,2*u[2]-u[4],2*u[3]-u[5],u[2],u[3],"L",u[4],u[5]]:["M",p+(u[6]==="left"?5:-5),o,"L",u[2],u[3],"L",u[4],u[5]],it?(it.animate({d:ct}),it.attr("visibility",et)):n.connector=it=a.chart.renderer.path(ct).attr({"stroke-width":yt,stroke:g.connectorColor||n.color||"#606060",visibility:et}).add(a.dataLabelsGroup)):it&&(n.connector=it.destroy())}))}},v.pie.prototype.placeDataLabels=function(){t(this.points,function(n){var n=n.dataLabel,t;n&&((t=n._pos)?(n.attr(n._attr),n[n.moved?"animate":"attr"](t),n.moved=!0):n&&n.attr({y:-999}))})},v.pie.prototype.alignDataLabel=ei,v.pie.prototype.verifyDataLabelOverflow=function(n){var i=this.center,u=this.options,e=u.center,r=u=u.minSize||80,o;return e[0]!==null?r=f(i[2]-f(n[1],n[3]),u):(r=f(i[2]-n[1]-n[3],u),i[0]+=(n[3]-n[1])/2),e[1]!==null?r=f(s(r,i[2]-f(n[0],n[2])),u):(r=f(s(r,i[2]-n[0]-n[2]),u),i[1]+=(n[0]-n[2])/2),r<i[2]?(i[2]=r,this.translate(i),t(this.points,function(n){n.dataLabel&&(n.dataLabel._pos=null)}),this.drawDataLabels&&this.drawDataLabels()):o=!0,o});v.column&&(v.column.prototype.alignDataLabel=function(t,i,r,u,f){var e=this.chart,s=e.inverted,l=t.dlBox||t.shapeArgs,h=t.below||t.plotY>n(this.translatedThreshold,e.plotSizeY),c=n(r.inside,!!this.options.stacking);l&&(u=o(l),s&&(u={x:e.plotWidth-u.y-u.height,y:e.plotHeight-u.x-u.width,width:u.height,height:u.width}),!c)&&(s?(u.x+=h?0:u.width,u.width=0):(u.y+=h?u.height:0,u.height=0));r.align=n(r.align,!s||c?"center":h?"right":"left");r.verticalAlign=n(r.verticalAlign,s||c?"middle":h?"top":"bottom");y.prototype.alignDataLabel.call(this,t,i,r,u,f)});uu=g.TrackerMixin={drawTrackerPoint:function(){var n=this,r=n.chart,e=r.pointer,u=n.options.cursor,o=u&&{cursor:u},f=function(t){var f=t.target,u;for(r.hoverSeries!==n&&n.onMouseOver();f&&!u;)u=f.point,f=f.parentNode;if(u!==i&&u!==r.hoverPoint)u.onMouseOver(t)};t(n.points,function(n){n.graphic&&(n.graphic.element.point=n);n.dataLabel&&(n.dataLabel.element.point=n)});n._hasTracking||(t(n.trackerGroups,function(t){if(n[t]&&(n[t].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(n){e.onTrackerMouseOut(n)}).css(o),ru))n[t].on("touchstart",f)}),n._hasTracking=!0)},drawTrackerGraph:function(){var i=this,h=i.options,e=h.trackByArea,r=[].concat(e?i.areaPath:i.graphPath),u=r.length,o=i.chart,v=o.pointer,y=o.renderer,f=o.options.tooltip.snap,c=i.tracker,s=h.cursor,p=s&&{cursor:s},s=i.singlePoints,n,l=function(){o.hoverSeries!==i&&i.onMouseOver()},a="rgba(192,192,192,"+(wt?.0001:.002)+")";if(u&&!e)for(n=u+1;n--;)r[n]==="M"&&r.splice(n+1,0,r[n+1]-f,r[n+2],"L"),(n&&r[n]==="M"||n===u)&&r.splice(n,0,"L",r[n-2]+f,r[n-1]);for(n=0;n<s.length;n++)u=s[n],r.push("M",u.plotX-f,u.plotY,"L",u.plotX+f,u.plotY);c?c.attr({d:r}):(i.tracker=y.path(r).attr({"stroke-linejoin":"round",visibility:i.visible?"visible":"hidden",stroke:a,fill:e?a:ct,"stroke-width":h.lineWidth+(e?0:2*f),zIndex:2}).add(i.group),t([i.tracker,i.markerGroup],function(n){if(n.addClass("highcharts-tracker").on("mouseover",l).on("mouseout",function(n){v.onTrackerMouseOut(n)}).css(p),ru)n.on("touchstart",l)}))}};v.column&&(vi.prototype.drawTracker=uu.drawTrackerPoint);v.pie&&(v.pie.prototype.drawTracker=uu.drawTrackerPoint);v.scatter&&(oi.prototype.drawTracker=uu.drawTrackerPoint);e(hu.prototype,{setItemEvents:function(n,t,i,r,u){var f=this;(i?t:n.legendGroup).on("mouseover",function(){n.setState("hover");t.css(f.options.itemHoverStyle)}).on("mouseout",function(){t.css(n.visible?r:u);n.setState()}).on("click",function(t){var i=function(){n.setVisible()},t={browserEvent:t};n.firePointEvent?n.firePointEvent("legendItemClick",t,i):b(n,"legendItemClick",t,i)})},createCheckboxForItem:function(n){n.checkbox=lt("input",{type:"checkbox",checked:n.selected,defaultChecked:n.selected},this.options.itemCheckboxStyle,this.chart.container);h(n.checkbox,"click",function(t){b(n,"checkboxClick",{checked:t.target.checked},function(){n.select()})})}});w.legend.itemStyle.cursor="pointer";e(yi.prototype,{showResetZoom:function(){var t=this,i=w.lang,n=t.options.chart.resetZoomButton,r=n.theme,u=r.states,f=n.relativeTo==="chart"?null:"plotBox";this.resetZoomButton=t.renderer.button(i.resetZoom,null,null,function(){t.zoomOut()},r,u&&u.hover).attr({align:n.position.align,title:i.resetZoomTitle}).add().align(n.position,!1,f)},zoomOut:function(){var n=this;b(n,"selection",{resetSelection:!0},function(){n.zoom()})},zoom:function(i){var u,e=this.pointer,f=!1,r;!i||i.resetSelection?t(this.axes,function(n){u=n.zoom()}):t(i.xAxis.concat(i.yAxis),function(n){var t=n.axis,i=t.isXAxis;(e[i?"zoomX":"zoomY"]||e[i?"pinchX":"pinchY"])&&(u=t.zoom(n.min,n.max),t.displayBtn&&(f=!0))});r=this.resetZoomButton;f&&!r?this.showResetZoom():!f&&kt(r)&&(this.resetZoomButton=r.destroy());u&&this.redraw(n(this.options.chart.animation,i&&i.animation,this.pointCount<100))},pan:function(n,i){var r=this,u=r.hoverPoints,e;u&&t(u,function(n){n.setState()});t(i==="xy"?[1,0]:[1],function(t){var h=n[t?"chartX":"chartY"],i=r[t?"xAxis":"yAxis"][0],u=r[t?"mouseDownX":"mouseDownY"],c=(i.pointRange||0)/2,o=i.getExtremes(),l=i.toValue(u-h,!0)+c,u=i.toValue(u+r[t?"plotWidth":"plotHeight"]-h,!0)-c;i.series.length&&l>s(o.dataMin,o.min)&&u<f(o.dataMax,o.max)&&(i.setExtremes(l,u,!1,!1,{trigger:"pan"}),e=!0);r[t?"mouseDownX":"mouseDownY"]=h});e&&r.redraw(!1);p(r.container,{cursor:"move"})}});e(ai.prototype,{select:function(i,r){var u=this,f=u.series,e=f.chart,i=n(i,!u.selected);u.firePointEvent(i?"select":"unselect",{accumulate:r},function(){u.selected=u.options.selected=i;f.options.data[cr(u,f.data)]=u.options;u.setState(i&&"select");r||t(e.getSelectedPoints(),function(n){n.selected&&n!==u&&(n.selected=n.options.selected=!1,f.options.data[cr(n,f.data)]=n.options,n.setState(""),n.firePointEvent("unselect"))})})},onMouseOver:function(n){var u=this.series,t=u.chart,i=t.tooltip,r=t.hoverPoint;r&&r!==this&&r.onMouseOut();this.firePointEvent("mouseOver");i&&(!i.shared||u.noSharedTooltip)&&i.refresh(this,n);this.setState("hover");t.hoverPoint=this},onMouseOut:function(){var n=this.series.chart,t=n.hoverPoints;this.firePointEvent("mouseOut");t&&cr(this,t)!==-1||(this.setState(),n.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var n=o(this.series.options.point,this.options).events,t;this.events=n;for(t in n)h(this,t,n[t]);this.hasImportedEvents=!0}},setState:function(n,t){var f=this.plotX,l=this.plotY,r=this.series,a=r.options.states,i=ft[r.type].marker&&r.options.marker,p=i&&!i.enabled,h=i&&i.states[n],w=h&&h.enabled===!1,u=r.stateMarkerGraphic,s=this.marker||{},v=r.chart,c=r.halo,y,n=n||"";y=this.pointAttr[n]||r.pointAttr[n];n===this.state&&!t||this.selected&&n!=="select"||a[n]&&a[n].enabled===!1||n&&(w||p&&h.enabled===!1)||n&&s.states&&s.states[n]&&s.states[n].enabled===!1||(this.graphic?(i=i&&this.graphic.symbolName&&y.r,this.graphic.attr(o(y,i?{x:f-i,y:l-i,width:2*i,height:2*i}:{})),u&&u.hide()):(n&&h&&((i=h.radius,s=s.symbol||r.symbol,u&&u.currentSymbol!==s&&(u=u.destroy()),u)?u[t?"animate":"attr"]({x:f-i,y:l-i}):s&&(r.stateMarkerGraphic=u=v.renderer.symbol(s,f-i,l-i,2*i,2*i).attr(y).add(r.markerGroup),u.currentSymbol=s)),u&&u[n&&v.isInsidePlot(f,l,v.inverted)?"show":"hide"]()),(f=a[n]&&a[n].halo)&&f.size?(c||(r.halo=c=v.renderer.path().add(r.seriesGroup)),c.attr(e({fill:ir(this.color||r.color).setOpacity(f.opacity).get()},f.attributes))[t?"animate":"attr"]({d:this.haloPath(f.size)})):c&&c.attr({d:[]}),this.state=n)},haloPath:function(n){var t=this.series,i=t.chart,r=t.getPlotBox(),u=i.inverted;return i.renderer.symbols.circle(r.translateX+(u?t.yAxis.len-this.plotY:this.plotX)-n,r.translateY+(u?t.xAxis.len-this.plotX:this.plotY)-n,n*2,n*2)}});e(y.prototype,{onMouseOver:function(){var t=this.chart,n=t.hoverSeries;n&&n!==this&&n.onMouseOut();this.options.events.mouseOver&&b(this,"mouseOver");this.setState("hover");t.hoverSeries=this},onMouseOut:function(){var i=this.options,n=this.chart,t=n.tooltip,r=n.hoverPoint;r&&r.onMouseOut();this&&i.events.mouseOut&&b(this,"mouseOut");t&&!i.stickyTracking&&(!t.shared||this.noSharedTooltip)&&t.hide();this.setState();n.hoverSeries=null},setState:function(n){var t=this.options,r=this.graph,u=this.graphNeg,i=t.states,t=t.lineWidth,n=n||"";this.state!==n&&(this.state=n,i[n]&&i[n].enabled===!1||(n&&(t=i[n].lineWidth||t+(i[n].lineWidthPlus||0)),r&&!r.dashstyle&&(n={"stroke-width":t},r.attr(n),u&&u.attr(n))))},setVisible:function(n,r){var u=this,f=u.chart,o=u.legendItem,e,s=f.options.chart.ignoreHiddenSeries,h=u.visible;e=(u.visible=n=u.userOptions.visible=n===i?!h:n)?"show":"hide";t(["group","dataLabelsGroup","markerGroup","tracker"],function(n){u[n]&&u[n][e]()});f.hoverSeries===u&&u.onMouseOut();o&&f.legend.colorizeItem(u,n);u.isDirty=!0;u.options.stacking&&t(f.series,function(n){n.options.stacking&&n.visible&&(n.isDirty=!0)});t(u.linkedSeries,function(t){t.setVisible(n,!1)});s&&(f.isDirtyBox=!0);r!==!1&&f.redraw();b(u,e)},setTooltipPoints:function(n){var u=[],e,h,r=this.xAxis,a=r&&r.getExtremes(),l=r?r.tooltipLen||r.len:this.chart.plotSizeX,c,o,v=[];if(!(this.options.enableMouseTracking===!1||this.singularTooltips)){for(n&&(this.tooltipPoints=null),t(this.segments||this.points,function(n){u=u.concat(n)}),r&&r.reversed&&(u=u.reverse()),this.orderTooltipPoints&&this.orderTooltipPoints(u),n=u.length,o=0;o<n;o++)if(r=u[o],e=r.x,e>=a.min&&e<=a.max)for(c=u[o+1],e=h===i?0:h+1,h=u[o+1]?s(f(0,et((r.clientX+(c?c.wrappedClientX||c.clientX:l))/2)),l):l;e>=0&&e<=h;)v[e++]=r;this.tooltipPoints=v}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(n){this.selected=n=n===i?!this.selected:n;this.checkbox&&(this.checkbox.checked=n);b(this,n?"select":"unselect")},drawTracker:uu.drawTrackerGraph});tt(y.prototype,"init",function(n){var t;n.apply(this,Array.prototype.slice.call(arguments,1));(t=this.xAxis)&&t.options.ordinal&&h(this,"updatedData",function(){delete t.ordinalIndex})});tt(k.prototype,"getTimeTicks",function(n,t,r,f,e,o,s,h){var a=0,c=0,p,b={},y,k,d,v=[],g=-Number.MAX_VALUE,nt=this.options.tickPixelInterval,h,w;if(!this.options.ordinal||!o||o.length<3||r===i)return n.call(this,t,r,f,e);for(k=o.length;c<k;c++){if(d=c&&o[c-1]>f,o[c]<r&&(a=c),c===k-1||o[c+1]-o[c]>s*5||d){if(o[c]>g){for(p=n.call(this,t,o[a],o[c],e);p.length&&p[0]<=g;)p.shift();p.length&&(g=p[p.length-1]);v=v.concat(p)}a=c+1}if(d)break}if(n=p.info,h&&n.unitRange<=l.hour){for(c=v.length-1,a=1;a<c;a++)new vt(v[a]-hr)[gr]()!==new vt(v[a-1]-hr)[gr]()&&(b[v[a]]="day",y=!0);y&&(b[v[0]]="day");n.higherRanks=b}if(v.info=n,h&&u(nt)){for(h=n=v.length,c=[],y=[];h--;)a=this.translate(v[h]),w&&(y[h]=w-a),c[h]=w=a;for(y.sort(),y=y[et(y.length/2)],y<nt*.6&&(y=null),h=v[n-1]>f?n-1:n,w=void 0;h--;)a=c[h],f=w-a,w&&f<nt*.8&&(y===null||f<y*.8)?(b[v[h]]&&!b[v[h+1]]?(f=h+1,w=a):f=h,v.splice(f,1)):w=a}return v});e(k.prototype,{beforeSetTickPositions:function(){var e,n=[],r=!1,o,u=this.getExtremes(),h=u.min,u=u.max,c;if(this.options.ordinal){if(t(this.series,function(t,i){if(t.visible!==!1&&t.takeOrdinalPosition!==!1&&(n=n.concat(t.processedXData),e=n.length,n.sort(function(n,t){return n-t}),e))for(i=e-1;i--;)n[i]===n[i+1]&&n.splice(i,1)}),e=n.length,e>2){for(o=n[1]-n[0],c=e-1;c--&&!r;)n[c+1]-n[c]!==o&&(r=!0);!this.options.keepOrdinalPadding&&(n[0]-h>o||u-n[n.length-1]>o)&&(r=!0)}r?(this.ordinalPositions=n,r=this.val2lin(f(h,n[0]),!0),o=f(this.val2lin(s(u,n[n.length-1]),!0),1),this.ordinalSlope=u=(u-h)/(o-r),this.ordinalOffset=h-r*u):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=i}this.groupIntervalFactor=null},val2lin:function(n,t){var r=this.ordinalPositions,f,i,u;if(r){for(f=r.length,i=f;i--;)if(r[i]===n){u=i;break}for(i=f-1;i--;)if(n>r[i]||i===0){r=(n-r[i])/(r[i+1]-r[i]);u=i+r;break}return t?u:this.ordinalSlope*(u||0)+this.ordinalOffset}return n},lin2val:function(n,t){var u=this.ordinalPositions;if(u){var e=this.ordinalSlope,s=this.ordinalOffset,r=u.length-1,o,f;if(t)n<0?n=u[0]:n>r?n=u[r]:(r=et(n),f=n-r);else for(;r--;)if(o=e*r+s,n>=o){e=e*(r+1)+s;f=(n-o)/(e-o);break}return f!==i&&u[r]!==i?u[r]+(f?f*(u[r+1]-u[r]):0):n}return n},getExtendedPositions:function(){var o=this.chart,n=this.series[0].currentDataGrouping,i=this.ordinalIndex,f=n?n.count+n.unitName:"raw",e=this.getExtremes(),r,u;return i||(i=this.ordinalIndex={}),i[f]||(r={series:[],getExtremes:function(){return{min:e.dataMin,max:e.dataMax}},options:{ordinal:!0},val2lin:k.prototype.val2lin},t(this.series,function(t){u={xAxis:r,xData:t.xData,chart:o,destroyGroupedData:ei};u.options={dataGrouping:n?{enabled:!0,forced:!0,approximation:"open",units:[[n.unitName,[n.count]]]}:{enabled:!1}};t.processData.apply(u);r.series.push(u)}),this.beforeSetTickPositions.apply(r),i[f]=r.ordinalPositions),i[f]},getGroupIntervalFactor:function(n,t,i){var r=0,i=i.processedXData,u=i.length,e=[],o=this.groupIntervalFactor;if(!o){for(;r<u-1;r++)e[r]=i[r+1]-i[r];e.sort(function(n,t){return n-t});r=e[et(u/2)];n=f(n,i[0]);t=s(t,i[u-1]);this.groupIntervalFactor=o=u*r/(t-n)}return o},postProcessTickInterval:function(n){var t=this.ordinalSlope;return t?n/(t/this.closestPointRange):n}});tt(yi.prototype,"pan",function(n,i){var r=this.xAxis[0],b=i.chartX,l=!1;if(r.options.ordinal&&r.series.length){var u=this.mouseDownX,c=r.getExtremes(),a=c.dataMax,v=c.min,y=c.max,o=this.hoverPoints,w=r.closestPointRange,u=(u-b)/(r.translationSlope*(r.ordinalSlope||w)),e={ordinalPositions:r.getExtendedPositions()},w=r.lin2val,k=r.val2lin,h;e.ordinalPositions?d(u)>1&&(o&&t(o,function(n){n.setState()}),u<0?(o=e,h=r.ordinalPositions?r:e):(o=r.ordinalPositions?r:e,h=e),e=h.ordinalPositions,a>e[e.length-1]&&e.push(a),this.fixedRange=y-v,u=r.toFixedRange(null,null,w.apply(o,[k.apply(o,[v,!0])+u,!0]),w.apply(h,[k.apply(h,[y,!0])+u,!0])),u.min>=s(c.dataMin,v)&&u.max<=f(a,y)&&r.setExtremes(u.min,u.max,!0,!1,{trigger:"pan"}),this.mouseDownX=b,p(this.container,{cursor:"move"})):l=!0}else l=!0;l&&n.apply(this,Array.prototype.slice.call(arguments,1))});tt(y.prototype,"getSegments",function(n){var i,r=this.options.gapSize,u=this.xAxis;n.apply(this,Array.prototype.slice.call(arguments,1));r&&(i=this.segments,t(i,function(n,t){for(var f=n.length-1;f--;)n[f+1].x-n[f].x>u.closestPointRange*r&&i.splice(t+1,0,n.splice(f+1,n.length-f))}))});var yt=y.prototype,nt=gu.prototype,pe=yt.processData,we=yt.generatePoints,be=yt.destroy,ke=nt.tooltipHeaderFormatter,de={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},re={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},ue=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],ar={sum:function(n){var t=n.length,i;if(!t&&n.hasNulls)i=null;else if(t)for(i=0;t--;)i+=n[t];return i},average:function(n){var t=n.length,n=ar.sum(n);return typeof n=="number"&&t&&(n/=t),n},open:function(n){return n.length?n[0]:n.hasNulls?null:i},high:function(n){return n.length?di(n):n.hasNulls?null:i},low:function(n){return n.length?pr(n):n.hasNulls?null:i},close:function(n){return n.length?n[n.length-1]:n.hasNulls?null:i},ohlc:function(n,t,i,r){return n=ar.open(n),t=ar.high(t),i=ar.low(i),r=ar.close(r),typeof n=="number"||typeof t=="number"||typeof i=="number"||typeof r=="number"?[n,t,i,r]:void 0},range:function(n,t){return n=ar.low(n),t=ar.high(t),typeof n=="number"||typeof t=="number"?[n,t]:void 0}};yt.groupData=function(n,t,r,u){for(var a=this.data,p=this.options.data,v=[],y=[],h=n.length,e,o,w=!!t,s=[[],[],[],[]],u=typeof u=="function"?u:ar[u],c=this.pointArrayMap,b=c&&c.length,l,f=0;f<=h;f++)if(n[f]>=r[0])break;for(;f<=h;f++){for(;r[1]!==i&&n[f]>=r[1]||f===h;)if(e=r.shift(),o=u.apply(0,s),o!==i&&(v.push(e),y.push(o)),s[0]=[],s[1]=[],s[2]=[],s[3]=[],f===h)break;if(f===h)break;if(c)for(e=this.cropStart+f,e=a&&a[e]||this.pointClass.prototype.applyOptions.apply({series:this},[p[e]]),o=0;o<b;o++)(l=e[c[o]],typeof l=="number")?s[o].push(l):l===null&&(s[o].hasNulls=!0);else(e=w?t[f]:null,typeof e=="number")?s[0].push(e):e===null&&(s[0].hasNulls=!0)}return[v,y]};yt.processData=function(){var t=this.chart,c=this.options,i=c.dataGrouping,f=this.allowDG!==!1&&i&&n(i.enabled,t.options._stock),l;if(this.forceCrop=f,this.groupPixelWidth=null,this.hasProcessed=!0,pe.apply(this,arguments)!==!1&&f){this.destroyGroupedData();var r=this.processedXData,s=this.processedYData,h=t.plotSizeX,t=this.xAxis,a=t.options.ordinal,e=this.groupPixelWidth=t.getGroupPixelWidth&&t.getGroupPixelWidth(),f=this.pointRange;if(e){l=!0;this.points=null;var o=t.getExtremes(),f=o.min,o=o.max,a=a&&t.getGroupIntervalFactor(f,o,this)||1,h=e*(o-f)/h*a,e=t.getTimeTicks(t.normalizeTimeTickInterval(h,i.units||ue),f,o,t.options.startOfWeek,r,this.closestPointRange),s=yt.groupData.apply(this,[r,s,e,i.approximation]),r=s[0],s=s[1];if(i.smoothed){for(i=r.length-1,r[i]=o;i--&&i>0;)r[i]+=h/2;r[0]=f}this.currentDataGrouping=e.info;c.pointRange===null&&(this.pointRange=e.info.totalRange);this.closestPointRange=e.info.totalRange;u(r[0])&&r[0]<t.dataMin&&(t.dataMin=r[0]);this.processedXData=r;this.processedYData=s}else this.currentDataGrouping=null,this.pointRange=f;this.hasGroupedData=l}};yt.destroyGroupedData=function(){var n=this.groupedData;t(n||[],function(t,i){t&&(n[i]=t.destroy?t.destroy():null)});this.groupedData=null};yt.generatePoints=function(){we.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};nt.tooltipHeaderFormatter=function(n){var t=n.series,o=t.tooltipOptions,u=t.options.dataGrouping,i=o.xDateFormat,e,r=t.xAxis,f;if(r&&r.options.type==="datetime"&&u&&ui(n.key)){if(t=t.currentDataGrouping,u=u.dateTimeLabelFormats,t)r=u[t.unitName],t.count===1?i=r[0]:(i=r[1],e=r[2]);else if(!i&&u)for(f in l)if(l[f]>=r.closestPointRange||l[f]<=l.day&&n.key%l[f]>0){i=u[f][0];break}i=pi(i,n.key);e&&(i+=pi(e,n.key+t.totalRange-1));n=o.headerFormat.replace("{point.key}",i)}else n=ke.call(this,n);return n};yt.destroy=function(){for(var n=this.groupedData||[],t=n.length;t--;)n[t]&&n[t].destroy();be.apply(this)};tt(yt,"setOptions",function(n,t){var f=n.call(this,t),i=this.type,r=this.chart.options.plotOptions,u=ft[i].dataGrouping;return re[i]&&(u||(u=o(de,re[i])),f.dataGrouping=o(u,r.series&&r.series.dataGrouping,r[i].dataGrouping,t.dataGrouping)),this.chart.options._stock&&(this.requireSorting=!0),f});tt(k.prototype,"setScale",function(n){n.call(this);t(this.series,function(n){n.hasProcessed=!1})});k.prototype.getGroupPixelWidth=function(){for(var t=this.series,i=t.length,r=0,e=!1,u,n=i;n--;)(u=t[n].options.dataGrouping)&&(r=f(r,u.groupPixelWidth));for(n=i;n--;)(u=t[n].options.dataGrouping)&&t[n].hasProcessed&&(i=(t[n].processedXData||t[n].data).length,t[n].groupPixelWidth||i>this.chart.plotSizeX/r||i&&u.forced)&&(e=!0);return e?r:0};ft.ohlc=o(ft.column,{lineWidth:1,tooltip:{pointFormat:'<span style="color:{series.color}">●<\/span> <b> {series.name}<\/b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},states:{hover:{lineWidth:3}},threshold:null});nt=dt(v.column,{type:"ohlc",pointArrayMap:["open","high","low","close"],toYData:function(n){return[n.open,n.high,n.low,n.close]},pointValKey:"high",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},upColorProp:"stroke",getAttribs:function(){v.column.prototype.getAttribs.apply(this,arguments);var n=this.options,u=n.states,n=n.upColor||this.color,i=o(this.pointAttr),r=this.upColorProp;i[""][r]=n;i.hover[r]=u.hover.upColor||n;i.select[r]=u.select.upColor||n;t(this.points,function(n){n.open<n.close&&(n.pointAttr=i)})},translate:function(){var n=this.yAxis;v.column.prototype.translate.apply(this);t(this.points,function(t){t.open!==null&&(t.plotOpen=n.translate(t.open,0,1,0,1));t.close!==null&&(t.plotClose=n.translate(t.close,0,1,0,1))})},drawPoints:function(){var f=this,a=f.chart,o,s,h,e,c,u,l,n;t(f.points,function(t){t.plotY!==i&&(l=t.graphic,o=t.pointAttr[t.selected?"selected":""]||f.pointAttr[""],e=o["stroke-width"]%2/2,n=r(t.plotX)-e,c=r(t.shapeArgs.width/2),u=["M",n,r(t.yBottom),"L",n,r(t.plotY)],t.open!==null&&(s=r(t.plotOpen)+e,u.push("M",n,s,"L",n-c,s)),t.close!==null&&(h=r(t.plotClose)+e,u.push("M",n,h,"L",n+c,h)),l?l.animate({d:u}):t.graphic=a.renderer.path(u).attr(o).add(f.group))})},animate:null});v.ohlc=nt;ft.candlestick=o(ft.column,{lineColor:"black",lineWidth:1,states:{hover:{lineWidth:2}},tooltip:ft.ohlc.tooltip,threshold:null,upColor:"white"});nt=dt(nt,{type:"candlestick",pointAttrToOptions:{fill:"color",stroke:"lineColor","stroke-width":"lineWidth"},upColorProp:"fill",getAttribs:function(){v.ohlc.prototype.getAttribs.apply(this,arguments);var n=this.options,r=n.states,i=n.upLineColor||n.lineColor,u=r.hover.upLineColor||i,f=r.select.upLineColor||i;t(this.points,function(n){n.open<n.close&&(n.pointAttr[""].stroke=i,n.pointAttr.hover.stroke=u,n.pointAttr.select.stroke=f)})},drawPoints:function(){var e=this,w=e.chart,h,b=e.pointAttr[""],c,l,u,f,y,p,s,n,a,v,o;t(e.points,function(t){a=t.graphic;t.plotY!==i&&(h=t.pointAttr[t.selected?"selected":""]||b,s=h["stroke-width"]%2/2,n=r(t.plotX)-s,c=t.plotOpen,l=t.plotClose,u=st.min(c,l),f=st.max(c,l),o=r(t.shapeArgs.width/2),y=r(u)!==r(t.plotY),p=f!==t.yBottom,u=r(u)+s,f=r(f)+s,v=["M",n-o,f,"L",n-o,u,"L",n+o,u,"L",n+o,f,"Z","M",n,u,"L",n,y?r(t.plotY):u,"M",n,f,"L",n,p?r(t.yBottom):f],a?a.animate({d:v}):t.graphic=w.renderer.path(v).attr(h).add(e.group).shadow(e.options.shadow))})}});v.candlestick=nt;cu=gt.prototype.symbols;ft.flags=o(ft.column,{fillColor:"white",lineWidth:1,pointRange:0,shape:"flag",stackDistance:12,states:{hover:{lineColor:"black",fillColor:"#FCFFC5"}},style:{fontSize:"11px",fontWeight:"bold",textAlign:"center"},tooltip:{pointFormat:"{point.text}<br/>"},threshold:null,y:-30});v.flags=dt(v.column,{type:"flags",sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:y.prototype.init,pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth",r:"radius"},translate:function(){v.column.prototype.translate.apply(this);var l=this.chart,u=this.points,h=u.length-1,n,e,a=this.options.onSeries,a=(n=a&&l.get(a))&&n.options.step,o=n&&n.points,f=o&&o.length,s=this.xAxis,y=s.getExtremes(),r,p,c;if(n&&n.visible&&f)for(n=n.currentDataGrouping,p=o[f-1].x+(n?n.totalRange:0),u.sort(function(n,t){return n.x-t.x});f--&&u[h];)if((n=u[h],r=o[f],r.x<=n.x&&r.plotY!==i)&&(n.x<=p&&(n.plotY=r.plotY,r.x<n.x&&!a&&(c=o[f+1])&&c.plotY!==i&&(n.plotY+=(n.x-r.x)/(c.x-r.x)*(c.plotY-r.plotY))),h--,f++,h<0))break;t(u,function(n,t){n.plotY===i&&(n.x>=y.min&&n.x<=y.max?n.plotY=l.chartHeight-s.bottom-(s.opposite?s.height:0)+s.offset-l.plotTop:n.shapeArgs={});(e=u[t-1])&&e.plotX===n.plotX&&(e.stackIndex===i&&(e.stackIndex=0),n.stackIndex=e.stackIndex+1)})},drawPoints:function(){for(var f,y=this.pointAttr[""],v=this.points,p=this.chart.renderer,e,u,t=this.options,w=t.y,h,n,r,s=t.lineWidth%2/2,l,a,c=v.length;c--;)(n=v[c],f=n.plotX>this.xAxis.len,e=n.plotX+(f?s:-s),r=n.stackIndex,h=n.options.shape||t.shape,u=n.plotY,u!==i&&(u=n.plotY+w+s-(r!==i&&r*t.stackDistance)),l=r?i:n.plotX+s,a=r?i:n.plotY,r=n.graphic,u!==i&&e>=0&&!f)?(f=n.pointAttr[n.selected?"select":""]||y,r?r.attr({x:e,y:u,r:f.r,anchorX:l,anchorY:a}):n.graphic=p.label(n.options.title||t.title||"A",e,u,h,l,a,t.useHTML).css(o(t.style,n.style)).attr(f).attr({align:h==="flag"?"left":"center",width:t.width,height:t.height}).add(this.markerGroup).shadow(t.shadow),n.tooltipPos=[e,u]):r&&(n.graphic=r.destroy())},drawTracker:function(){var n=this.points;uu.drawTrackerPoint.apply(this);t(n,function(i){var r=i.graphic;r&&h(r.element,"mouseover",function(){i.stackIndex>0&&!i.raised&&(i._y=r.y,r.attr({y:i._y-8}),i.raised=!0);t(n,function(n){n!==i&&n.raised&&n.graphic&&(n.graphic.attr({y:n._y}),n.raised=!1)})})})},animate:ei});cu.flag=function(n,t,i,r,u){var f=u&&u.anchorX||n,u=u&&u.anchorY||t;return["M",f,u,"L",n,t+r,n,t,n+i,t,n+i,t+r,n,t+r,"M",f,u,"Z"]};t(["circle","square"],function(n){cu[n+"pin"]=function(t,i,r,u,f){var e=f&&f.anchorX,f=f&&f.anchorY,t=cu[n](t,i,r,u);return e&&f&&t.push("M",e,i>f?i:i+u,"L",e,f),t}});kr===g.VMLRenderer&&t(["flag","circlepin","squarepin"],function(n){su.prototype.symbols[n]=cu[n]});nt=[].concat(ue);lu=function(n){return Math[n].apply(0,ku(arguments,function(n){return typeof n=="number"}))};nt[4]=["day",[1,2,3,4]];nt[5]=["week",[1,2,3]];e(w,{navigator:{handles:{backgroundColor:"#ebe7e8",borderColor:"#b2b1b6"},height:40,margin:25,maskFill:"rgba(128,179,236,0.3)",maskInside:!0,outlineColor:"#b2b1b6",outlineWidth:1,series:{type:v.areaspline===i?"line":"areaspline",color:"#4572A7",compare:null,fillOpacity:.05,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:nt},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",lineColor:"#4572A7",lineWidth:1,marker:{enabled:!1},pointRange:0,shadow:!1,threshold:null},xAxis:{tickWidth:0,lineWidth:0,gridLineColor:"#EEE",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#888"},x:3,y:-4},crosshair:!1},yAxis:{gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickWidth:0}},scrollbar:{height:fu?20:14,barBackgroundColor:"#bfc8d1",barBorderRadius:0,barBorderWidth:1,barBorderColor:"#bfc8d1",buttonArrowColor:"#666",buttonBackgroundColor:"#ebe7e8",buttonBorderColor:"#bbb",buttonBorderRadius:0,buttonBorderWidth:1,minWidth:6,rifleColor:"#666",trackBackgroundColor:"#eeeeee",trackBorderColor:"#eeeeee",trackBorderWidth:1,liveRedraw:wt&&!fu}});uf.prototype={drawHandle:function(n,t){var e=this.chart,f=e.renderer,o=this.elementsToDestroy,i=this.handles,r=this.navigatorOptions.handles,r={fill:r.backgroundColor,stroke:r.borderColor,"stroke-width":1},u;this.rendered||(i[t]=f.g("navigator-handle-"+["left","right"][t]).css({cursor:"e-resize"}).attr({zIndex:4-t}).add(),u=f.rect(-4.5,0,9,16,0,1).attr(r).add(i[t]),o.push(u),u=f.path(["M",-1.5,4,"L",-1.5,12,"M",.5,4,"L",.5,12]).attr(r).add(i[t]),o.push(u));i[t][e.isResizing?"animate":"attr"]({translateX:this.scrollerLeft+this.scrollbarHeight+parseInt(n,10),translateY:this.top+this.height/2-8})},drawScrollbarButton:function(n){var f=this.chart.renderer,e=this.elementsToDestroy,r=this.scrollbarButtons,t=this.scrollbarHeight,i=this.scrollbarOptions,u;this.rendered||(r[n]=f.g().add(this.scrollbarGroup),u=f.rect(-.5,-.5,t+1,t+1,i.buttonBorderRadius,i.buttonBorderWidth).attr({stroke:i.buttonBorderColor,"stroke-width":i.buttonBorderWidth,fill:i.buttonBackgroundColor}).add(r[n]),e.push(u),u=f.path(["M",t/2+(n?-1:1),t/2-3,"L",t/2+(n?-1:1),t/2+3,t/2+(n?2:-2),t/2]).attr({fill:i.buttonArrowColor}).add(r[n]),e.push(u));n&&r[n].attr({translateX:this.scrollerWidth-t})},render:function(t,i,u,e){var l=this.chart,b=l.renderer,o,y,rt,nt,g=this.scrollbarGroup,h=this.navigatorGroup,tt=this.scrollbar,h=this.xAxis,ht=this.scrollbarTrack,c=this.scrollbarHeight,ct=this.scrollbarEnabled,k=this.navigatorOptions,a=this.scrollbarOptions,v=a.minWidth,ut=this.height,ft=this.top,lt=this.navigatorEnabled,at=k.outlineWidth,p=at/2,ot=0,vt=this.outlineHeight,yt=a.barBorderRadius,st=a.barBorderWidth,w=ft+p,it;isNaN(t)||(this.navigatorLeft=o=n(h.left,l.plotLeft+c),this.navigatorWidth=y=n(h.len,l.plotWidth-2*c),this.scrollerLeft=rt=o-c,this.scrollerWidth=nt=nt=y+2*c,h.getExtremes&&(it=this.getUnionExtremes(!0))&&(it.dataMin!==h.min||it.dataMax!==h.max)&&h.setExtremes(it.dataMin,it.dataMax,!0,!1),u=n(u,h.translate(t)),e=n(e,h.translate(i)),(isNaN(u)||d(u)===Infinity)&&(u=0,e=nt),h.translate(e,!0)-h.translate(u,!0)<l.xAxis[0].minRange||(this.zoomedMax=s(f(u,e),y),this.zoomedMin=f(this.fixedWidth?this.zoomedMax-this.fixedWidth:s(u,e),0),this.range=this.zoomedMax-this.zoomedMin,u=r(this.zoomedMax),i=r(this.zoomedMin),t=u-i,this.rendered||(lt&&(this.navigatorGroup=h=b.g("navigator").attr({zIndex:3}).add(),this.leftShade=b.rect().attr({fill:k.maskFill}).add(h),k.maskInside||(this.rightShade=b.rect().attr({fill:k.maskFill}).add(h)),this.outline=b.path().attr({"stroke-width":at,stroke:k.outlineColor}).add(h)),ct&&(this.scrollbarGroup=g=b.g("scrollbar").add(),tt=a.trackBorderWidth,this.scrollbarTrack=ht=b.rect().attr({x:0,y:-tt%2/2,fill:a.trackBackgroundColor,stroke:a.trackBorderColor,"stroke-width":tt,r:a.trackBorderRadius||0,height:c}).add(g),this.scrollbar=tt=b.rect().attr({y:-st%2/2,height:c,fill:a.barBackgroundColor,stroke:a.barBorderColor,"stroke-width":st,r:yt}).add(g),this.scrollbarRifles=b.path().attr({stroke:a.rifleColor,"stroke-width":1}).add(g))),l=l.isResizing?"animate":"attr",lt&&(this.leftShade[l](k.maskInside?{x:o+i,y:ft,width:u-i,height:ut}:{x:o,y:ft,width:i,height:ut}),this.rightShade&&this.rightShade[l]({x:o+u,y:ft,width:y-u,height:ut}),this.outline[l]({d:["M",rt,w,"L",o+i+p,w,o+i+p,w+vt,"L",o+u-p,w+vt,"L",o+u-p,w,rt+nt,w].concat(k.maskInside?["M",o+i+p,w,"L",o+u-p,w]:[])}),this.drawHandle(i+p,0),this.drawHandle(u+p,1)),ct&&g&&(this.drawScrollbarButton(0),this.drawScrollbarButton(1),g[l]({translateX:rt,translateY:r(w+ut)}),ht[l]({width:nt}),o=c+i,y=t-st,y<v&&(ot=(v-y)/2,y=v,o-=ot),this.scrollbarPad=ot,tt[l]({x:et(o)+st%2/2,width:y}),v=c+i+t/2-.5,this.scrollbarRifles.attr({visibility:t>12?"visible":"hidden"})[l]({d:["M",v-3,c/4,"L",v-3,2*c/3,"M",v,c/4,"L",v,2*c/3,"M",v+3,c/4,"L",v+3,2*c/3]})),this.scrollbarPad=ot,this.rendered=!0))},addEvents:function(){var n=this.chart.container,r=this.mouseDownHandler,u=this.mouseMoveHandler,f=this.mouseUpHandler,i;i=[[n,"mousedown",r],[n,"mousemove",u],[document,"mouseup",f]];ru&&i.push([n,"touchstart",r],[n,"touchmove",u],[document,"touchend",f]);t(i,function(n){h.apply(null,n)});this._events=i},removeEvents:function(){t(this._events,function(n){ut.apply(null,n)});this._events=i;this.navigatorEnabled&&this.baseSeries&&ut(this.baseSeries,"updatedData",this.updatedDataHandler)},init:function(){var t=this,i=t.chart,r,e,c=t.scrollbarHeight,s=t.navigatorOptions,h=t.height,v=t.top,u,f,l=document.body.style,y,a=t.baseSeries,p,w;t.mouseDownHandler=function(n){var n=i.pointer.normalize(n),f=t.zoomedMin,e=t.zoomedMax,a=t.top,w=t.scrollbarHeight,v=t.scrollerLeft,b=t.scrollerWidth,c=t.navigatorLeft,k=t.navigatorWidth,d=t.scrollbarPad,s=t.range,o=n.chartX,p=n.chartY,n=i.xAxis[0],g,nt=fu?10:7;p>a&&p<a+h+w&&((a=!t.scrollbarEnabled||p<a+h)&&st.abs(o-f-c)<nt?(t.grabbedLeft=!0,t.otherHandlePos=e,t.fixedExtreme=n.max,i.fixedRange=null):a&&st.abs(o-e-c)<nt?(t.grabbedRight=!0,t.otherHandlePos=f,t.fixedExtreme=n.min,i.fixedRange=null):o>c+f-d&&o<c+e+d?(t.grabbedCenter=o,t.fixedWidth=s,i.renderer.isSVG&&(y=l.cursor,l.cursor="ew-resize"),u=o-f):o>v&&o<v+b&&(e=a?o-c-s/2:o<c?f-s*.2:o>v+b-w?f+s*.2:o<c+f?f-s:e,e<0?e=0:e+s>=k&&(e=k-s,g=r.dataMax),e!==f&&(t.fixedWidth=s,f=r.toFixedRange(e,e+s,null,g),n.setExtremes(f.min,f.max,!0,!1,{trigger:"navigator"}))))};t.mouseMoveHandler=function(n){var s=t.scrollbarHeight,e=t.navigatorLeft,h=t.navigatorWidth,c=t.scrollerLeft,l=t.scrollerWidth,o=t.range,r;n.pageX!==0&&(n=i.pointer.normalize(n),r=n.chartX,r<e?r=e:r>c+l-s&&(r=c+l-s),t.grabbedLeft?(f=!0,t.render(0,0,r-e,t.otherHandlePos)):t.grabbedRight?(f=!0,t.render(0,0,t.otherHandlePos,r-e)):t.grabbedCenter&&(f=!0,r<u?r=u:r>h+u-o&&(r=h+u-o),t.render(0,0,r-u,r-u+o)),f&&t.scrollbarOptions.liveRedraw&&setTimeout(function(){t.mouseUpHandler(n)},0))};t.mouseUpHandler=function(n){var e,o;f&&(t.zoomedMin===t.otherHandlePos?e=t.fixedExtreme:t.zoomedMax===t.otherHandlePos&&(o=t.fixedExtreme),e=r.toFixedRange(t.zoomedMin,t.zoomedMax,e,o),i.xAxis[0].setExtremes(e.min,e.max,!0,!1,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:n}));n.type!=="mousemove"&&(t.grabbedLeft=t.grabbedRight=t.grabbedCenter=t.fixedWidth=t.fixedExtreme=t.otherHandlePos=f=u=null,l.cursor=y||"")};p=i.xAxis.length;w=i.yAxis.length;i.extraBottomMargin=t.outlineHeight+s.margin;t.navigatorEnabled?(t.xAxis=r=new k(i,o({ordinal:a&&a.xAxis.options.ordinal},s.xAxis,{id:"navigator-x-axis",isX:!0,type:"datetime",index:p,height:h,offset:0,offsetLeft:c,offsetRight:-c,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1})),t.yAxis=e=new k(i,o(s.yAxis,{id:"navigator-y-axis",alignTicks:!1,height:h,offset:0,index:w,zoomEnabled:!1})),a||s.series.data?t.addBaseSeries():i.series.length===0&&tt(i,"redraw",function(n,r){i.series.length>0&&!t.series&&(t.setBaseSeries(),i.redraw=n);n.call(i,r)})):t.xAxis=r={translate:function(n,t){var r=i.xAxis[0],f=r.getExtremes(),e=i.plotWidth-2*c,u=lu("min",r.options.min,f.dataMin),r=lu("max",r.options.max,f.dataMax)-u;return t?n*r/e+u:e*(n-u)/r},toFixedRange:k.prototype.toFixedRange};tt(i,"getMargins",function(i){var f=this.legend,u=f.options;i.call(this);t.top=v=t.navigatorOptions.top||this.chartHeight-t.height-t.scrollbarHeight-this.spacing[2]-(u.verticalAlign==="bottom"&&u.enabled&&!u.floating?f.legendHeight+n(u.margin,10):0);r&&e&&(r.options.top=e.options.top=v,r.setAxisSize(),e.setAxisSize())});t.addEvents()},getUnionExtremes:function(n){var t=this.chart.xAxis[0],r=this.xAxis,i=r.options,u=t.options;if(!n||t.dataMin!==null)return{dataMin:lu("min",i&&i.min,u.min,t.dataMin,r.dataMin),dataMax:lu("max",i&&i.max,u.max,t.dataMax,r.dataMax)}},setBaseSeries:function(n){var t=this.chart,n=n||t.options.navigator.baseSeries;this.series&&this.series.remove();this.baseSeries=t.series[n]||typeof n=="string"&&t.get(n)||t.series[0];this.xAxis&&this.addBaseSeries()},addBaseSeries:function(){var n=this.baseSeries,t=n?n.options:{},u=t.data,r=this.navigatorOptions.series,i;i=r.data;this.hasNavigatorData=!!i;t=o(t,r,{enableMouseTracking:!1,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",name:"Navigator",showInLegend:!1,isInternal:!0,visible:!0});t.data=i||u;this.series=this.chart.initSeries(t);n&&this.navigatorOptions.adaptToUpdatedData!==!1&&(h(n,"updatedData",this.updatedDataHandler),n.userOptions.events=e(n.userOptions.event,{updatedData:this.updatedDataHandler}))},updatedDataHandler:function(){var r=this.chart.scroller,o=r.baseSeries,h=o.xAxis,t=h.getExtremes(),c=t.min,l=t.max,a=t.dataMin,t=t.dataMax,y=l-c,n,v,u,i,p,e=r.series,w;n=e.xData;w=!!h.setExtremes;v=l>=n[n.length-1]-(this.closestPointRange||0);n=c<=a;r.hasNavigatorData||(e.options.pointStart=o.xData[0],e.setData(o.options.data,!1),p=!0);n&&(i=a,u=i+y);v&&(u=t,n||(i=f(u-y,e.xData[0])));w&&(n||v)?isNaN(i)||h.setExtremes(i,u,!0,!1,{trigger:"updatedData"}):(p&&this.chart.redraw(!1),r.render(f(c,a),s(l,t)))},destroy:function(){this.removeEvents();t([this.xAxis,this.yAxis,this.leftShade,this.rightShade,this.outline,this.scrollbarTrack,this.scrollbarRifles,this.scrollbarGroup,this.scrollbar],function(n){n&&n.destroy&&n.destroy()});this.xAxis=this.yAxis=this.leftShade=this.rightShade=this.outline=this.scrollbarTrack=this.scrollbarRifles=this.scrollbarGroup=this.scrollbar=null;t([this.scrollbarButtons,this.handles,this.elementsToDestroy],function(n){er(n)})}};g.Scroller=uf;tt(k.prototype,"zoom",function(n,t,r){var f=this.chart,e=f.options,o=e.chart.zoomType,h=e.navigator,e=e.rangeSelector,s;return this.isXAxis&&(h&&h.enabled||e&&e.enabled)&&(o==="x"?f.resetZoomButton="blocked":o==="y"?s=!1:o==="xy"&&(f=this.previousZoom,u(t)?this.previousZoom=[this.min,this.max]:f&&(t=f[0],r=f[1],delete this.previousZoom))),s!==i?s:n.call(this,t,r)});tt(yi.prototype,"init",function(n,t,i){h(this,"beforeRender",function(){var n=this.options;(n.navigator.enabled||n.scrollbar.enabled)&&(this.scroller=new uf(this))});n.call(this,t,i)});tt(y.prototype,"addPoint",function(n,t,i,r,u){var f=this.options.turboThreshold;f&&this.xData.length>f&&kt(t)&&!rr(t)&&this.chart.scroller&&ri(20,!0);n.call(this,t,i,r,u)});e(w,{rangeSelector:{buttonTheme:{width:28,height:18,fill:"#f7f7f7",padding:2,r:0,"stroke-width":0,style:{color:"#444",cursor:"pointer",fontWeight:"normal"},zIndex:7,states:{hover:{fill:"#e7e7e7"},select:{fill:"#e7f0f9",style:{color:"black",fontWeight:"bold"}}}},inputPosition:{align:"right"},labelStyle:{color:"#666"}}});w.lang=o(w.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});ff.prototype={clickButton:function(u,e){var w=this,k=w.selected,b=w.chart,g=w.buttons,nt=w.buttonOptions[u],p=b.xAxis[0],y=b.scroller&&b.scroller.getUnionExtremes()||p||{},a=y.dataMin,v=y.dataMax,c,l=p&&r(s(p.max,n(v,p.max))),it=new vt(l),d=nt.type,rt=nt.count,y=nt._range,tt;if(!(a===null||v===null||u===w.selected)){if(d==="month"||d==="year")c={month:"Month",year:"FullYear"}[d],it["set"+c](it["get"+c]()-rt),c=it.getTime(),a=n(a,Number.MIN_VALUE),isNaN(c)||c<a?(c=a,l=s(c+y,v)):y=l-c;else if(y)c=f(l-y,a),l=s(c+y,v);else if(d==="ytd")if(p)v===i&&(a=Number.MAX_VALUE,v=Number.MIN_VALUE,t(b.series,function(n){n=n.xData;a=s(n[0],a);v=f(n[n.length-1],v)}),e=!1),l=new vt(v),tt=l.getFullYear(),c=tt=f(a||0,vt.UTC(tt,0,1)),l=l.getTime(),l=s(v||l,l);else{h(b,"beforeRender",function(){w.clickButton(u)});return}else d==="all"&&p&&(c=a,l=v);g[k]&&g[k].setState(0);g[u]&&g[u].setState(2);b.fixedRange=y;p?p.setExtremes(c,l,n(e,1),0,{trigger:"rangeSelectorButton",rangeSelectorButton:nt}):(k=b.options.xAxis,k[0]=o(k[0],{range:y,min:tt}));w.setSelected(u)}},setSelected:function(n){this.selected=this.options.selected=n},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(n){var r=this,u=n.options.rangeSelector,f=u.buttons||[].concat(r.defaultButtons),e=u.selected,o=r.blurInputs=function(){var n=r.minInput,t=r.maxInput;n&&n.blur&&b(n,"blur");t&&t.blur&&b(t,"blur")};r.chart=n;r.options=u;r.buttons=[];n.extraTopMargin=35;r.buttonOptions=f;h(n.container,"mousedown",o);h(n,"resize",o);t(f,r.computeButtonRange);e!==i&&f[e]&&this.clickButton(e,!1);h(n,"load",function(){h(n.xAxis[0],"afterSetExtremes",function(){r.updateButtonStates(!0)})})},updateButtonStates:function(n){var f=this,e=this.chart,i=e.xAxis[0],c=e.scroller&&e.scroller.getUnionExtremes()||i,o=c.dataMin,s=c.dataMax,h=f.selected,l=f.options.allButtonsEnabled,u=f.buttons;n&&e.fixedRange!==r(i.max-i.min)&&(u[h]&&u[h].setState(0),f.setSelected(null));t(f.buttonOptions,function(n,t){var e=n._range,c=e>s-o,a=e<i.minRange,v=n.type==="all"&&i.max-i.min>=s-o&&u[t].state!==2,y=n.type==="ytd"&&pi("%Y",o)===pi("%Y",s);e===r(i.max-i.min)&&t!==h?(f.setSelected(t),u[t].setState(2)):!l&&(c||a||v||y)?u[t].setState(3):u[t].state===3&&u[t].setState(0)})},computeButtonRange:function(n){var t=n.type,i=n.count||1,r={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5};r[t]?n._range=r[t]*i:(t==="month"||t==="year")&&(n._range={month:30,year:365}[t]*864e5*i)},setInputValue:function(n,t){var i=this.chart.options.rangeSelector;u(t)&&(this[n+"Input"].HCTime=t);this[n+"Input"].value=pi(i.inputEditDateFormat||"%Y-%m-%d",this[n+"Input"].HCTime);this[n+"DateBox"].attr({text:pi(i.inputDateFormat||"%b %e, %Y",this[n+"Input"].HCTime)})},drawInput:function(n){var u=this,f=u.chart,l=f.renderer.style,v=f.renderer,t=f.options.rangeSelector,b=u.div,s=n==="min",h,y,c,r=this.inputGroup;this[n+"Label"]=y=v.label(w.lang[s?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).attr({padding:2}).css(o(l,t.labelStyle)).add(r);r.offset+=y.width+5;this[n+"DateBox"]=c=v.label("",r.offset).attr({padding:2,width:t.inputBoxWidth||90,height:t.inputBoxHeight||17,stroke:t.inputBoxBorderColor||"silver","stroke-width":1}).css(o({textAlign:"center",color:"#444"},l,t.inputStyle)).on("click",function(){u[n+"Input"].focus()}).add(r);r.offset+=c.width+(s?10:0);this[n+"Input"]=h=lt("input",{name:n,className:"highcharts-range-selector",type:"text"},e({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:l.fontSize,fontFamily:l.fontFamily,top:f.plotTop+"px"},t.inputStyle),b);h.onfocus=function(){p(this,{left:r.translateX+c.x+"px",top:r.translateY+"px",width:c.width-2+"px",height:c.height-2+"px",border:"2px solid silver"})};h.onblur=function(){p(this,{border:0,width:"1px",height:"1px"});u.setInputValue(n)};h.onchange=function(){var e=h.value,n=(t.inputDateParser||vt.parse)(e),r=f.xAxis[0],o=r.dataMin,c=r.dataMax;isNaN(n)&&(n=e.split("-"),n=vt.UTC(a(n[0]),a(n[1])-1,a(n[2])));isNaN(n)||(w.global.useUTC||(n+=(new vt).getTimezoneOffset()*6e4),s?n>u.maxInput.HCTime?n=i:n<o&&(n=o):n<u.minInput.HCTime?n=i:n>c&&(n=c),n!==i&&f.xAxis[0].setExtremes(s?n:r.min,s?r.max:n,i,i,{trigger:"rangeSelectorInput"}))}},render:function(i,r){var u=this,f=u.chart,a=f.renderer,s=f.container,h=f.options,v=h.exporting&&h.navigation&&h.navigation.buttonOptions,c=h.rangeSelector,y=u.buttons,h=w.lang,o=u.div,o=u.inputGroup,p=c.buttonTheme,k=c.inputEnabled!==!1,l=p&&p.states,d=f.plotLeft,b;!u.rendered&&(u.zoomText=a.text(h.rangeSelectorZoom,d,f.plotTop-20).css(c.labelStyle).add(),b=d+u.zoomText.getBBox().width+5,t(u.buttonOptions,function(t,i){y[i]=a.button(t.text,b,f.plotTop-35,function(){u.clickButton(i);u.isActive=!0},p,l&&l.hover,l&&l.select).css({textAlign:"center"}).add();b+=y[i].width+n(c.buttonSpacing,5);u.selected===i&&y[i].setState(2)}),u.updateButtonStates(),k)&&(u.div=o=lt("div",null,{position:"relative",height:0,zIndex:1}),s.parentNode.insertBefore(o,s),u.inputGroup=o=a.g("input-group").add(),o.offset=0,u.drawInput("min"),u.drawInput("max"));k&&(s=f.plotTop-45,o.align(e({y:s,width:o.offset,x:v&&s<(v.y||0)+v.height-f.spacing[0]?-40:0},c.inputPosition),!0,f.spacingBox),u.setInputValue("min",i),u.setInputValue("max",r));u.rendered=!0},destroy:function(){var t=this.minInput,i=this.maxInput,r=this.chart,u=this.blurInputs,n;ut(r.container,"mousedown",u);ut(r,"resize",u);er(this.buttons);t&&(t.onfocus=t.onblur=t.onchange=null);i&&(i.onfocus=i.onblur=i.onchange=null);for(n in this)this[n]&&n!=="chart"&&(this[n].destroy?this[n].destroy():this[n].nodeType&&wr(this[n])),this[n]=null}};k.prototype.toFixedRange=function(t,i,r,u){var f=this.chart&&this.chart.fixedRange,t=n(r,this.translate(t,!0)),i=n(u,this.translate(i,!0)),r=f&&(i-t)/f;return r>.7&&r<1.3&&(u?t=i-f:i=t+f),{min:t,max:i}};tt(yi.prototype,"init",function(n,t,i){h(this,"init",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=new ff(this))});n.call(this,t,i)});g.RangeSelector=ff;yi.prototype.callbacks.push(function(n){function f(){t=n.xAxis[0].getExtremes();i.render(t.min,t.max)}function u(){t=n.xAxis[0].getExtremes();isNaN(t.min)||r.render(t.min,t.max)}function e(n){n.triggerOp!=="navigator-drag"&&i.render(n.min,n.max)}function o(n){r.render(n.min,n.max)}var t,i=n.scroller,r=n.rangeSelector;i&&(h(n.xAxis[0],"afterSetExtremes",e),tt(n,"drawChartBox",function(n){var t=this.isDirtyBox;n.call(this);t&&f()}),f());r&&(h(n.xAxis[0],"afterSetExtremes",o),h(n,"resize",u),u());h(n,"destroy",function(){i&&ut(n.xAxis[0],"afterSetExtremes",e);r&&(ut(n,"resize",u),ut(n.xAxis[0],"afterSetExtremes",o))})});g.StockChart=function(t,i){var e=t.series,f,s=n(t.navigator&&t.navigator.enabled,!0)?{startOnTick:!1,endOnTick:!1}:null,r={marker:{enabled:!1,radius:2},states:{hover:{lineWidth:2}}},u={shadow:!1,borderWidth:0};return t.xAxis=wi(fi(t.xAxis||{}),function(n){return o({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},n,{type:"datetime",categories:null},s)}),t.yAxis=wi(fi(t.yAxis||{}),function(t){return f=n(t.opposite,!0),o({labels:{y:-2},opposite:f,showLastLabel:!1,title:{text:null}},t)}),t.series=null,t=o({chart:{panning:!0,pinchType:"x"},navigator:{enabled:!0},scrollbar:{enabled:!0},rangeSelector:{enabled:!0},title:{text:null,style:{fontSize:"16px"}},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:r,spline:r,area:r,areaspline:r,arearange:r,areasplinerange:r,column:u,columnrange:u,candlestick:u,ohlc:u}},t,{_stock:!0,chart:{inverted:!1}}),t.series=e,new yi(t,i)};tt(lr.prototype,"init",function(n,t,i){var r=i.chart.pinchType||"";n.call(this,t,i);this.pinchX=this.pinchHor=r.indexOf("x")!==-1;this.pinchY=this.pinchVert=r.indexOf("y")!==-1;this.hasZoom=this.hasZoom||this.pinchHor||this.pinchVert});tt(k.prototype,"autoLabelAlign",function(n){var r=this.chart,t=this.options,r=r._labelPanes=r._labelPanes||{},i=this.options.labels;return this.chart.options._stock&&this.coll==="yAxis"&&(t=t.top+","+t.height,!r[t]&&i.enabled)?(i.x===15&&(i.x=0),i.align===void 0&&(i.align="right"),r[t]=1,"right"):n.call(this,[].slice.call(arguments,1))});k.prototype.getPlotLinePath=function(i,f,e,o,s){var h=this,d=this.isLinked&&!this.series?this.linkedParent.series:this.series,c=h.chart,nt=c.renderer,g=h.left,k=h.top,l,a,y,p,w=[],b,v;return(h.coll==="xAxis"||h.coll==="yAxis")&&(b=h.isXAxis?u(h.options.yAxis)?[c.yAxis[h.options.yAxis]]:wi(d,function(n){return n.yAxis}):u(h.options.xAxis)?[c.xAxis[h.options.xAxis]]:wi(d,function(n){return n.xAxis})),t(h.isXAxis?c.yAxis:c.xAxis,function(n){if(u(n.options.id)?n.options.id.indexOf("navigator")===-1:1){var t=n.isXAxis?"yAxis":"xAxis",t=u(n.options[t])?c[t][n.options[t]]:c[t][0];h===t&&b.push(n)}}),v=b.length?[]:[h],t(b,function(n){cr(n,v)===-1&&v.push(n)}),s=n(s,h.translate(i,null,null,e)),isNaN(s)||(h.horiz?t(v,function(n){a=n.top;p=a+n.len;l=y=r(s+h.transB);(l>=g&&l<=g+h.width||o)&&w.push("M",l,a,"L",y,p)}):t(v,function(n){l=n.left;y=l+n.width;a=p=r(k+h.height-s);(a>=k&&a<=k+h.height||o)&&w.push("M",l,a,"L",y,p)})),w.length>0?nt.crispPolyLine(w,f||1):void 0};k.prototype.getPlotBandPath=function(n,t){var u=this.getPlotLinePath(t),r=this.getPlotLinePath(n),f=[],i;if(r&&u)for(i=0;i<r.length;i+=6)f.push("M",r[i+1],r[i+2],"L",r[i+4],r[i+5],u[i+4],u[i+5],u[i+1],u[i+2]);else f=null;return f};gt.prototype.crispPolyLine=function(n,t){for(var i=0;i<n.length;i+=6)n[i+1]===n[i+4]&&(n[i+1]=n[i+4]=r(n[i+1])-t%2/2),n[i+2]===n[i+5]&&(n[i+2]=n[i+5]=r(n[i+2])+t%2/2);return n};kr===g.VMLRenderer&&(su.prototype.crispPolyLine=gt.prototype.crispPolyLine);tt(k.prototype,"hideCrosshair",function(n,i){n.call(this,i);u(this.crossLabelArray)&&(u(i)?this.crossLabelArray[i]&&this.crossLabelArray[i].hide():t(this.crossLabelArray,function(n){n.hide()}))});tt(k.prototype,"drawCrosshair",function(t,r,f){var v,y;if(t.call(this,r,f),u(this.crosshair.label)&&this.crosshair.label.enabled&&u(f)){var t=this.chart,s=this.options.crosshair.label,k=this.isXAxis?"x":"y",r=this.horiz,a=this.opposite,c=this.left,p=this.top,o=this.crossLabel,l,h,w=s.format,b="";o||(o=this.crossLabel=t.renderer.label().attr({align:s.align||(r?"center":a?this.labelAlign==="right"?"right":"left":this.labelAlign==="left"?"left":"center"),zIndex:12,height:r?16:i,fill:s.backgroundColor||this.series[0]&&this.series[0].color||"gray",padding:n(s.padding,2),stroke:s.borderColor||null,"stroke-width":s.borderWidth||0}).css(e({color:"white",fontWeight:"normal",fontSize:"11px",textAlign:"center"},s.style)).add());r?(l=f.plotX+c,h=p+(a?0:this.height)):(l=a?this.width+c:0,h=f.plotY+p);h<p||h>p+this.height?this.hideCrosshair():(w||s.formatter||(this.isDatetimeAxis&&(b="%b %d, %Y"),w="{value"+(b?":"+b:"")+"}"),o.attr({text:w?fr(w,{value:f[k]}):s.formatter.call(this,f[k]),x:l,y:h,visibility:"visible"}),f=o.getBBox(),r?(this.options.tickPosition==="inside"&&!a||this.options.tickPosition!=="inside"&&a)&&(h=o.y-f.height):h=o.y-f.height/2,r?(v=c-f.x,y=c+this.width-f.x):(v=this.labelAlign==="left"?c:0,y=this.labelAlign==="right"?c+this.width:t.chartWidth),o.translateX<v&&(l+=v-o.translateX),o.translateX+f.width>=y&&(l-=o.translateX+f.width-y),o.attr({x:l,y:h,visibility:"visible"}))}});var ge=yt.init,no=yt.processData,to=ai.prototype.tooltipFormatter;yt.init=function(){ge.apply(this,arguments);this.setCompare(this.options.compare)};yt.setCompare=function(n){this.modifyValue=n==="value"||n==="percent"?function(t,r){var u=this.compareValue;return t!==i&&(t=n==="value"?t-u:t=100*(t/u)-100,r)&&(r.change=t),t}:null;this.chart.hasRendered&&(this.isDirty=!0)};yt.processData=function(){var n=0,i,t,r;if(no.apply(this,arguments),this.xAxis&&this.processedYData)for(i=this.processedXData,t=this.processedYData,r=t.length;n<r;n++)if(typeof t[n]=="number"&&i[n]>=this.xAxis.min){this.compareValue=t[n];break}};tt(yt,"getExtremes",function(n){n.apply(this,[].slice.call(arguments,1));this.modifyValue&&(this.dataMax=this.modifyValue(this.dataMax),this.dataMin=this.modifyValue(this.dataMin))});k.prototype.setCompare=function(i,r){this.isXAxis||(t(this.series,function(n){n.setCompare(i)}),n(r,!0)&&this.chart.redraw())};ai.prototype.tooltipFormatter=function(t){return t=t.replace("{point.change}",(this.change>0?"+":"")+ki(this.change,n(this.series.tooltipOptions.changeDecimals,2))),to.apply(this,[t])};tt(y.prototype,"render",function(n){this.chart.options._stock&&(!this.clipBox&&this.animate&&this.animate.toString().indexOf("sharedClip")!==-1?(this.clipBox=o(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]&&this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len}));n.call(this)});e(g,{Axis:k,Chart:yi,Color:ir,Point:ai,Tick:tu,Renderer:kr,Series:y,SVGElement:ht,SVGRenderer:gt,arrayMin:pr,arrayMax:di,charts:at,dateFormat:pi,format:fr,pathAnim:sf,getOptions:function(){return w},hasBidiBug:fe,isTouchDevice:fu,numberFormat:ki,seriesTypes:v,setOptions:function(n){return w=o(!0,w,n),pf(),w},addEvent:h,removeEvent:ut,createElement:lt,discardElement:wr,css:p,each:t,extend:e,map:wi,merge:o,pick:n,splat:fi,extendClass:dt,pInt:a,wrap:tt,svg:wt,canvas:ii,vml:!wt&&!ii,product:"Highstock",version:"2.0.4"})}(),function(n,t,i){typeof define=="function"&&define.amd?define(["jquery"],function(r){return i(r,n,t),r.mobile}):i(n.jQuery,n,t)}(this,document,function(n,t,i){(function(n,t,i,r){function h(n){while(n&&typeof n.originalEvent!="undefined")n=n.originalEvent;return n}function vt(t,i){var u=t.type,e,o,l,f,s,a,v,c,y;if(t=n.Event(t),t.type=i,e=t.originalEvent,o=n.event.props,u.search(/^(mouse|click)/)>-1&&(o=gt),e)for(v=o.length,f;v;)f=o[--v],t[f]=e[f];if(u.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1),u.search(/^touch/)!==-1&&(l=h(e),u=l.touches,s=l.changedTouches,a=u&&u.length?u[0]:s&&s.length?s[0]:r,a))for(c=0,y=ct.length;c<y;c++)f=ct[c],t[f]=a[f];return t}function v(t){for(var i={},r,u;t;){r=n.data(t,o);for(u in r)r[u]&&(i[u]=i.hasVirtualBinding=!0);t=t.parentNode}return i}function yt(t,i){for(var r;t;){if(r=n.data(t,o),r&&(!i||r[i]))return t;t=t.parentNode}return null}function pt(){l=!1}function tt(){l=!0}function wt(){s=0;y.length=0;d=!1;tt()}function bt(){pt()}function w(){it();c=setTimeout(function(){c=0;wt()},n.vmouse.resetTimerDuration)}function it(){c&&(clearTimeout(c),c=0)}function f(t,i,r){var u;return(r&&r[t]||!r&&yt(i.target,t))&&(u=vt(i,t),n(i.target).trigger(u)),u}function rt(t){var r=n.data(t.target,b),i;d||s&&s===r||(i=f("v"+t.type,t),i&&(i.isDefaultPrevented()&&t.preventDefault(),i.isPropagationStopped()&&t.stopPropagation(),i.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function ut(t){var o=h(t).touches,r,i,u;o&&o.length===1&&(r=t.target,i=v(r),i.hasVirtualBinding&&(s=ni++,n.data(r,b,s),it(),bt(),e=!1,u=h(t).touches[0],lt=u.pageX,at=u.pageY,f("vmouseover",t,i),f("vmousedown",t,i)))}function ft(n){l||(e||f("vmousecancel",n,v(n.target)),e=!0,w())}function et(t){if(!l){var i=h(t).touches[0],o=e,r=n.vmouse.moveDistanceThreshold,u=v(t.target);e=e||Math.abs(i.pageX-lt)>r||Math.abs(i.pageY-at)>r;e&&!o&&f("vmousecancel",t,u);f("vmousemove",t,u);w()}}function ot(n){if(!l){tt();var t=v(n.target),i,r;f("vmouseup",n,t);e||(i=f("vclick",n,t),i&&i.isDefaultPrevented()&&(r=h(n).changedTouches[0],y.push({touchID:s,x:r.clientX,y:r.clientY}),d=!0));f("vmouseout",n,t);e=!1;w()}}function st(t){var i=n.data(t,o),r;if(i)for(r in i)if(i[r])return!0;return!1}function ht(){}function kt(t){var i=t.substr(1);return{setup:function(){st(this)||n.data(this,o,{});var r=n.data(this,o);r[t]=!0;u[t]=(u[t]||0)+1;u[t]===1&&p.bind(i,rt);n(this).bind(i,ht);g&&(u.touchstart=(u.touchstart||0)+1,u.touchstart===1&&p.bind("touchstart",ut).bind("touchend",ot).bind("touchmove",et).bind("scroll",ft))},teardown:function(){--u[t];u[t]||p.unbind(i,rt);g&&(--u.touchstart,u.touchstart||p.unbind("touchstart",ut).unbind("touchmove",et).unbind("touchend",ot).unbind("scroll",ft));var r=n(this),f=n.data(this,o);f&&(f[t]=!1);r.unbind(i,ht);st(this)||r.removeData(o)}}}var o="virtualMouseBindings",b="virtualTouchID",k="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),ct="clientX clientY pageX pageY screenX screenY".split(" "),dt=n.event.mouseHooks?n.event.mouseHooks.props:[],gt=n.event.props.concat(dt),u={},c=0,lt=0,at=0,e=!1,y=[],d=!1,l=!1,g="addEventListener"in i,p=n(i),ni=1,s=0,nt,a;for(n.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500},a=0;a<k.length;a++)n.event.special[k[a]]=kt(k[a]);g&&i.addEventListener("click",function(t){var f=y.length,e=t.target,o,s,i,r,u,h;if(f)for(o=t.clientX,s=t.clientY,nt=n.vmouse.clickDistanceThreshold,i=e;i;){for(r=0;r<f;r++)if(u=y[r],h=0,i===e&&Math.abs(u.x-o)<nt&&Math.abs(u.y-s)<nt||n.data(i,b)===u.touchID){t.preventDefault();t.stopPropagation();return}i=i.parentNode}},!0)})(n,t,i),function(n){n.mobile={}}(n),function(n){var t={touch:"ontouchend"in i};n.mobile.support=n.mobile.support||{};n.extend(n.support,t);n.extend(n.mobile.support,t)}(n),function(n,t,r){function f(t,i,u,f){var e=u.type;u.type=i;f?n.event.trigger(u,r,t):n.event.dispatch.call(t,u);u.type=e}var u=n(i),e=n.mobile.support.touch,s="touchmove scroll",h=e?"touchstart":"mousedown",c=e?"touchend":"mouseup",o=e?"touchmove":"mousemove";n.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,i){n.fn[i]=function(n){return n?this.bind(i,n):this.trigger(i)};n.attrFn&&(n.attrFn[i]=!0)});n.event.special.scrollstart={enabled:!0,setup:function(){function i(n,i){t=i;f(r,t?"scrollstart":"scrollstop",n)}var r=this,e=n(r),t,u;e.bind(s,function(r){n.event.special.scrollstart.enabled&&(t||i(r,!0),clearTimeout(u),u=setTimeout(function(){i(r,!1)},50))})},teardown:function(){n(this).unbind(s)}};n.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var i=this,r=n(i),t=!1;r.bind("vmousedown",function(e){function o(){clearTimeout(l)}function s(){o();r.unbind("vclick",h).unbind("vmouseup",o);u.unbind("vmousecancel",s)}function h(n){s();!t&&c===n.target?f(i,"tap",n):t&&n.stopPropagation()}if(t=!1,e.which&&e.which!==1)return!1;var c=e.target,l;r.bind("vmouseup",o).bind("vclick",h);u.bind("vmousecancel",s);l=setTimeout(function(){n.event.special.tap.emitTapOnTaphold||(t=!0);f(i,"taphold",n.Event("taphold",{target:c}))},n.event.special.tap.tapholdThreshold)})},teardown:function(){n(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup");u.unbind("vmousecancel")}};n.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(n){var u=t.pageXOffset,f=t.pageYOffset,i=n.clientX,r=n.clientY;return n.pageY===0&&Math.floor(r)>Math.floor(n.pageY)||n.pageX===0&&Math.floor(i)>Math.floor(n.pageX)?(i-=u,r-=f):(r<n.pageY-f||i<n.pageX-u)&&(i=n.pageX-u,r=n.pageY-f),{x:i,y:r}},start:function(t){var r=t.originalEvent.touches?t.originalEvent.touches[0]:t,i=n.event.special.swipe.getLocation(r);return{time:(new Date).getTime(),coords:[i.x,i.y],origin:n(t.target)}},stop:function(t){var r=t.originalEvent.touches?t.originalEvent.touches[0]:t,i=n.event.special.swipe.getLocation(r);return{time:(new Date).getTime(),coords:[i.x,i.y]}},handleSwipe:function(t,i,r,u){if(i.time-t.time<n.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-i.coords[0])>n.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-i.coords[1])<n.event.special.swipe.verticalDistanceThreshold){var e=t.coords[0]>i.coords[0]?"swipeleft":"swiperight";return f(r,"swipe",n.Event("swipe",{target:u,swipestart:t,swipestop:i}),!0),f(r,e,n.Event(e,{target:u,swipestart:t,swipestop:i}),!0),!0}return!1},eventInProgress:!1,setup:function(){var i,r=this,f=n(r),t={};i=n.data(this,"mobile-events");i||(i={length:0},n.data(this,"mobile-events",i));i.length++;i.swipe=t;t.start=function(i){if(!n.event.special.swipe.eventInProgress){n.event.special.swipe.eventInProgress=!0;var e,s=n.event.special.swipe.start(i),h=i.target,f=!1;t.move=function(t){s&&(e=n.event.special.swipe.stop(t),f||(f=n.event.special.swipe.handleSwipe(s,e,r,h),f&&(n.event.special.swipe.eventInProgress=!1)),Math.abs(s.coords[0]-e.coords[0])>n.event.special.swipe.scrollSupressionThreshold&&t.preventDefault())};t.stop=function(){f=!0;n.event.special.swipe.eventInProgress=!1;u.off(o,t.move);t.move=null};u.on(o,t.move).one(c,t.stop)}};f.on(h,t.start)},teardown:function(){var i,t;i=n.data(this,"mobile-events");i&&(t=i.swipe,delete i.swipe,i.length--,i.length===0&&n.removeData(this,"mobile-events"));t&&(t.start&&n(this).off(h,t.start),t.move&&u.off(o,t.move),t.stop&&u.off(c,t.stop))}};n.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(t,i){n.event.special[t]={setup:function(){n(this).bind(i,n.noop)},teardown:function(){n(this).unbind(i)}}})}(n,this)})