import{m as w}from"./vendor-apexcharts-Dhew1LZV.js";import{u as o,C as S}from"./index-BzV9LDkq.js";import{g as B,a as G}from"./periods-BQA0Ghpg.js";import{S as P}from"./Skeleton-DgK7k6Ot.js";import{d as z,e as n,a as L,f as h,i as d,k as D,t as m,x as t,j as f}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as N,r as p,u as i}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as O,a as b}from"./vendor-vue-shared-DrzsEcag.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";import"./analytics-DsW96Oy3.js";import"./vendor-vue-runtime-dom-B2rky8vu.js";import"./vendor-pinia-BSPefQhS.js";/* empty css               */import"./vendor-vue3-html2pdf-KR020wX8.js";import"./vendor-html2pdf.js-B-tok4Ns.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-html2canvas-BfYXEYrK.js";import"./vendor-datepicker--1DmXemW.js";import"./vendor-date-fns-DoIqsk4U.js";import"./vendor-axios-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"},j={class:"ccb-dashboard-large-chart"},re=z({__name:"ColumnsChart",props:{chart:{},page:{}},setup(g){const v=g,{chart:s,page:y}=N(v),r=p("week"),_=p({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}}),C=p([{name:s.value.title,data:s.value.series}]),u=n(()=>{const e=o(),a=B(e.getPeriod);return a.map(l=>l.value).includes(r.value)||(r.value=G(a)),a}),x=e=>{const a=o(),l=e;a.updateChartsGrouping(s.value.key,l)},k=n(()=>{const e=o();return u.value.length>0&&s.value.key in e.getDashboardChartsGrouping}),c=n(()=>o().isLoading);return L(()=>{const e=o();r.value=y.value==="dashboard"?e.getDashboardChartsGrouping[s.value.key]:e.getSingleChartsGrouping[s.value.key]}),(e,a)=>(d(),h("div",V,[c.value?(d(),D(i(P),{key:0})):m("",!0),t("div",{class:b(["ccb-dashboard-card-wrapper",{"ccb-is-loading":c.value}])},[t("div",A,[t("div",R,[t("span",null,O(i(s).title),1)]),k.value?(d(),h("div",W,[f(i(S),{items:u.value,current:r.value,placeholder:"",onUpdate:x,class:b({"ccb-is-loading":c.value})},null,8,["items","current","class"])])):m("",!0)]),t("div",j,[f(i(w),{type:"bar",height:"100%",width:"100%",options:_.value,series:C.value},null,8,["options","series"])])],2)]))}});export{re as default};
//# sourceMappingURL=ColumnsChart-BgimGlXh.js.map
