import{S as w,m as S}from"./vue3-apexcharts-DJaiVsL5.js";import{u as o,C as B}from"./index-BzKDSPoe.js";import{g as G,a as P}from"./periods-CPwunCIo.js";import{a as z,C as D,k as n,b as d,o as L,m as p,g as u,f as N,q as b,p as t,u as i,D as O,n as g,I as m}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./analytics-CiIjvCz9.js";/* empty css               */import"./vue-datepicker-DJOolBJW.js";/* empty css             */import"./index-xsH4HHeE.js";const V={class:"ccb-dashboard-card ccb-dashboard-card-chart ccb-columns-chart"},A={class:"ccb-dashboard-chart-header"},R={class:"ccb-dashboard-chart-controls"},W={key:0,class:"ccb-dashboard-chart-periods"},q={class:"ccb-dashboard-large-chart"},K=z({__name:"ColumnsChart",props:{chart:{},page:{}},setup(f){const v=f,{chart:s,page:y}=D(v),r=n("week"),C=n({chart:{type:"bar",height:260,toolbar:{show:!1}},plotOptions:{bar:{horizontal:!1,columnWidth:"37px",borderRadius:6,distributed:!1,dataLabels:{position:"center"}}},dataLabels:{enabled:!0,style:{fontSize:"13px",colors:["#fff"],fontWeight:500}},xaxis:{categories:s.value.categories,labels:{style:{colors:"#888",fontSize:"13px"}},axisBorder:{show:!0,offsetY:5},axisTicks:{show:!1}},yaxis:{show:!1},grid:{borderColor:"#f1f1f1",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},padding:{left:22,right:22}},colors:["#27ae60"],tooltip:{enabled:!0},legend:{show:!1}}),_=n([{name:s.value.title,data:s.value.series}]),h=d(()=>{const e=o(),a=G(e.getPeriod);return a.map(l=>l.value).includes(r.value)||(r.value=P(a)),a}),k=e=>{const a=o(),l=e;a.updateChartsGrouping(s.value.key,l)},x=d(()=>{const e=o();return h.value.length>0&&s.value.key in e.getDashboardChartsGrouping}),c=d(()=>o().isLoading);return L(()=>{const e=o();r.value=y.value==="dashboard"?e.getDashboardChartsGrouping[s.value.key]:e.getSingleChartsGrouping[s.value.key]}),(e,a)=>(u(),p("div",V,[c.value?(u(),N(i(w),{key:0})):b("",!0),t("div",{class:m(["ccb-dashboard-card-wrapper",{"ccb-is-loading":c.value}])},[t("div",A,[t("div",R,[t("span",null,O(i(s).title),1)]),x.value?(u(),p("div",W,[g(i(B),{items:h.value,current:r.value,placeholder:"",onUpdate:k,class:m({"ccb-is-loading":c.value})},null,8,["items","current","class"])])):b("",!0)]),t("div",q,[g(i(S),{type:"bar",height:"100%",width:"100%",options:C.value,series:_.value},null,8,["options","series"])])],2)]))}});export{K as default};
//# sourceMappingURL=ColumnsChart-CFKCTwkX.js.map
