function getChartColorsArray(e){if(null!==document.getElementById(e)){var t=document.getElementById(e).getAttribute("data-colors");return(t=JSON.parse(t)).map((function(e){var t=e.replace(" ","");if(-1===t.indexOf(",")){var r=getComputedStyle(document.documentElement).getPropertyValue(t);return r||t}var a=e.split(",");if(2==a.length){var o=getComputedStyle(document.documentElement).getPropertyValue(a[0]);return o="rgba("+o+","+a[1]+")"}return t}))}}function createSparkline(e,t,r){var a=getChartColorsArray(e);if(a){var o={chart:{type:"line",height:120,sparkline:{enabled:!0}},series:[{name:r,data:t}],stroke:{curve:"smooth",width:2},tooltip:{enabled:!0,x:{show:!1},y:{formatter:function(e,t){return t.w.globals.seriesNames+": "+e}}},fill:{type:"gradient",gradient:{shade:"light",type:"vertical",shadeIntensity:.4,gradientToColors:a,opacityFrom:1,opacityTo:.2,stops:[0,100]}},colors:a};new ApexCharts(document.querySelector("#"+e),o).render()}}createSparkline("spark1",[10,10,85],"Total Invoices"),createSparkline("spark2",[10,10,75],"Paid Invoices"),createSparkline("spark3",[10,10,80],"Pending Invoices"),createSparkline("spark4",[10,10,70],"Overdue Invoices"),createSparkline("spark5",[10,10,78],"Total Revenue");var invoiceStatusColors=getChartColorsArray("invoiceStatus");if(invoiceStatusColors){function renderCharts(){var e={series:[{name:"Domestic Revenue",data:[3.5,4.5,2.1,3.5,1.8,5,2,3,4.1,2,4.5,3.6]},{name:"International Revenue",data:[-3,-2,-2,-3,-1.9,-2.6,-2.2,-1.7,-1,-2.5,-3,-2]}],chart:{type:"bar",height:318,stacked:!0,toolbar:{show:!1}},colors:invoiceStatusColors,plotOptions:{bar:{borderRadius:4,columnWidth:"16%",horizontal:!1}},legend:{show:!1},dataLabels:{enabled:!1},stroke:{width:1,colors:["#fff"]},grid:{yaxis:{lines:{show:!1}}},yaxis:{min:-4,max:5,tickAmount:9,labels:{formatter:function(e){return e+"%"}}},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},tooltip:{shared:!1,y:{formatter:function(e){return Math.abs(e)+"%"}}},title:{show:!1}};invoiceStatus=new ApexCharts(document.querySelector("#invoiceStatus"),e),invoiceStatus.render()}window.addEventListener("DOMContentLoaded",renderCharts)}var salesRevenueColors=getChartColorsArray("salesRevenue");if(salesRevenueColors){var options={series:[65,25],chart:{type:"donut",height:220},plotOptions:{pie:{donut:{size:"60%"}}},dataLabels:{enabled:!1},legend:{show:!1},colors:salesRevenueColors,responsive:[{breakpoint:480,options:{chart:{width:200},legend:{position:"bottom"}}}]},chart=new ApexCharts(document.querySelector("#salesRevenue"),options);chart.render()}$((function(){var e="rtl"===$("html").attr("dir")?"rtl":"ltr";$("#transferClient").select2({dir:e,dropdownAutoWidth:!0,minimumResultsForSearch:1/0})}));