import{_ as m,n as f}from"./currency-Dtag6qPd.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as d,o as e,c as t,a as s,t as r,f as _,F as p,b as x,e as a}from"./runtime-core.esm-bundler-VrNrzzXC.js";const y={name:"ns-best-customers",data(){return{subscription:null,cashiers:[],hasLoaded:!1}},mounted(){this.hasLoaded=!1,this.subscription=Dashboard.bestCashiers.subscribe(c=>{this.hasLoaded=!0,this.cashiers=c})},methods:{__:m,nsCurrency:f},unmounted(){this.subscription.unsubscribe()}},v={id:"ns-best-cashiers",class:"flex flex-auto flex-col shadow rounded-lg overflow-hidden"},g={class:"flex-auto"},k={class:"head text-center border-b w-full flex justify-between items-center p-2"},C={class:"body"},w={key:0,class:"table w-full"},j={class:"p-2"},L={class:"-mx-1 flex justify-start items-center"},B={class:"px-1 justify-center"},N={class:"font-semibold items-center"},V={class:"flex justify-end p-2"},D={key:0},F={colspan:"2"},z={key:1,class:"h-56 flex items-center justify-center"},E={key:2,class:"h-56 flex items-center justify-center flex-col"},R={class:"text-sm text-center"};function S(c,n,W,q,o,l){const u=d("ns-close-button"),h=d("ns-spinner");return e(),t("div",v,[s("div",g,[s("div",k,[s("h5",null,r(l.__("Best Cashiers")),1),s("div",null,[_(u,{onClick:n[0]||(n[0]=i=>c.$emit("onRemove"))})])]),s("div",C,[o.cashiers.length>0?(e(),t("table",w,[s("thead",null,[(e(!0),t(p,null,x(o.cashiers,i=>(e(),t("tr",{key:i.id,class:"entry border-b text-sm"},[s("th",j,[s("div",L,[n[1]||(n[1]=s("div",{class:"px-1"},[s("div",{class:"rounded-full"},[s("i",{class:"las la-user-circle text-xl"})])],-1)),s("div",B,[s("h3",N,r(i.username),1)])])]),s("th",V,r(l.nsCurrency(i.total_sales,"abbreviate")),1)]))),128)),o.cashiers.length===0?(e(),t("tr",D,[s("th",F,r(l.__("No result to display.")),1)])):a("",!0)])])):a("",!0),o.hasLoaded?a("",!0):(e(),t("div",z,[_(h,{size:"8",border:"4"})])),o.hasLoaded&&o.cashiers.length===0?(e(),t("div",E,[n[2]||(n[2]=s("i",{class:"las la-grin-beam-sweat text-6xl"},null,-1)),s("p",R,r(l.__("Well.. nothing to show for the meantime.")),1)])):a("",!0)])])])}const I=b(y,[["render",S]]);export{I as default};
