!function(c){"use strict";var r=function(){this.$body=c("body"),this.charts=[]};r.prototype.respChart=function(t,a,e,o){var n=Chart.controllers.line.prototype.draw;Chart.controllers.line.prototype.draw=function(){n.apply(this,arguments);var r=this.chart.chart.ctx,t=r.stroke;r.stroke=function(){r.save(),r.shadowColor="rgba(0,0,0,0.01)",r.shadowBlur=20,r.shadowOffsetX=0,r.shadowOffsetY=5,t.apply(this,arguments),r.restore()}};var s=Chart.controllers.doughnut.prototype.draw;Chart.controllers.doughnut=Chart.controllers.doughnut.extend({draw:function(){s.apply(this,arguments);var r=this.chart.chart.ctx,t=r.fill;r.fill=function(){r.save(),r.shadowColor="rgba(0,0,0,0.03)",r.shadowBlur=4,r.shadowOffsetX=0,r.shadowOffsetY=3,t.apply(this,arguments),r.restore()}}});var l=Chart.controllers.bar.prototype.draw;Chart.controllers.bar=Chart.controllers.bar.extend({draw:function(){l.apply(this,arguments);var r=this.chart.chart.ctx,t=r.fill;r.fill=function(){r.save(),r.shadowColor="rgba(0,0,0,0.01)",r.shadowBlur=20,r.shadowOffsetX=4,r.shadowOffsetY=5,t.apply(this,arguments),r.restore()}}}),Chart.defaults.global.defaultFontColor="#8391a2",Chart.defaults.scale.gridLines.color="#8391a2";var i=t.get(0).getContext("2d"),d=c(t).parent();return function(){var r;switch(t.attr("width",c(d).width()),a){case"Line":r=new Chart(i,{type:"line",data:e,options:o});break;case"Doughnut":r=new Chart(i,{type:"doughnut",data:e,options:o});break;case"Pie":r=new Chart(i,{type:"pie",data:e,options:o});break;case"Bar":r=new Chart(i,{type:"bar",data:e,options:o});break;case"Radar":r=new Chart(i,{type:"radar",data:e,options:o});break;case"PolarArea":r=new Chart(i,{data:e,type:"polarArea",options:o})}return r}()},r.prototype.initCharts=function(){var r=[];if(0<c("#revenue-chart").length){r.push(this.respChart(c("#revenue-chart"),"Line",{labels:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],datasets:[{label:"Current Week",backgroundColor:"transparent",borderColor:"#727cf5",data:[32,42,42,62,52,75,62]},{label:"Previous Week",fill:!0,backgroundColor:"transparent",borderColor:"#0acf97",data:[42,58,66,93,82,105,92]}]},{maintainAspectRatio:!1,legend:{display:!1},tooltips:{backgroundColor:"#727cf5",titleFontColor:"#fff",bodyFontColor:"#fff",bodyFontSize:14,displayColors:!1},hover:{intersect:!0},plugins:{filler:{propagate:!1}},scales:{xAxes:[{reverse:!0,gridLines:{color:"rgba(0,0,0,0.05)"}}],yAxes:[{ticks:{stepSize:20},display:!0,borderDash:[5,5],gridLines:{color:"rgba(0,0,0,0.01)",fontColor:"#fff"}}]}}))}if(0<c("#high-performing-product").length){var t=document.getElementById("high-performing-product").getContext("2d").createLinearGradient(0,500,0,150);t.addColorStop(0,"#fa5c7c"),t.addColorStop(1,"#727cf5");var a={labels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],datasets:[{label:"Sales Analytics",backgroundColor:t,borderColor:t,hoverBackgroundColor:t,hoverBorderColor:t,data:[65,59,80,81,56,89,40,32,65,59,80,81]},{label:"Dollar Rate",backgroundColor:"#e3eaef",borderColor:"#e3eaef",hoverBackgroundColor:"#e3eaef",hoverBorderColor:"#e3eaef",data:[89,40,32,65,59,80,81,56,89,40,65,59]}]};r.push(this.respChart(c("#high-performing-product"),"Bar",a,{maintainAspectRatio:!1,legend:{display:!1},tooltips:{backgroundColor:"#727cf5",titleFontColor:"#fff",bodyFontColor:"#fff",bodyFontSize:14,displayColors:!1},scales:{yAxes:[{gridLines:{display:!1,color:"rgba(0,0,0,0.05)"},stacked:!1,ticks:{stepSize:20}}],xAxes:[{barPercentage:.7,categoryPercentage:.5,stacked:!1,gridLines:{color:"rgba(0,0,0,0.01)"}}]}}))}if(0<c("#average-sales").length){r.push(this.respChart(c("#average-sales"),"Doughnut",{labels:["Direct","Affilliate","Sponsored","E-mail"],datasets:[{data:[300,135,48,154],backgroundColor:["#727cf5","#fa5c7c","#0acf97","#ebeff2"],borderColor:"transparent",borderWidth:"3"}]},{maintainAspectRatio:!1,cutoutPercentage:60,legend:{display:!1}}))}return r},r.prototype.initMaps=function(){0<c("#world-map-markers").length&&c("#world-map-markers").vectorMap({map:"world_mill_en",normalizeFunction:"polynomial",hoverOpacity:.7,hoverColor:!1,regionStyle:{initial:{fill:"#e3eaef"}},markerStyle:{initial:{r:9,fill:"#727cf5","fill-opacity":.9,stroke:"#fff","stroke-width":7,"stroke-opacity":.4},hover:{stroke:"#fff","fill-opacity":1,"stroke-width":1.5}},backgroundColor:"transparent",markers:[{latLng:[40.71,-74],name:"New York"},{latLng:[37.77,-122.41],name:"San Francisco"},{latLng:[-33.86,151.2],name:"Sydney"},{latLng:[1.3,103.8],name:"Singapore"}],zoomOnScroll:!1})},r.prototype.init=function(){var t=this;Chart.defaults.global.defaultFontFamily='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif',c("#dash-daterange").daterangepicker({singleDatePicker:!0}),t.charts=this.initCharts(),this.initMaps(),c(window).on("resize",function(r){c.each(t.charts,function(r,t){try{t.destroy()}catch(r){}}),t.charts=t.initCharts()})},c.Dashboard=new r,c.Dashboard.Constructor=r}(window.jQuery),function(r){"use strict";window.jQuery.Dashboard.init()}();