PageSourceSearch

https://shoclifestyle.no/6415.0fbc2a8d0284b714.js

js shoclifestyle.no collected 2026-10-08 11:40:55 UTC 91,643 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkeSusoft=self.webpackChunkeSusoft||[]).push([[6415],{6071:(E,y,s)=>{s.d(y,{Z:()=>g});var p=s(17705),u=s(13630);let g=(()=>{var _;class C{constructor(d){this.networkRepository=d}execute(){return this.networkRepository.getCustomerSettings()}}return(_=C).\u0275fac=function(d){return new(d||_)(p.KVO(u.M))},_.\u0275prov=p.jDH({token:_,factory:_.\u0275fac}),C})()},13630:(E,y,s)=>{s.d(y,{M:()=>C});var p=s(18370),u=s(50297),g=s(17705),_=s(21626);let C=(()=>{var i;class d extends p.Y{constructor(l,h){super(l),this.userStorage=l,this.httpClient=h}getCustomerSettings(){return this.call(this.httpClient.get("admin/customer/settings"))}createInterest(l){return this.call(this.httpClient.post("admin/customer/settings",l))}}return(i=d).\u0275fac=function(l){return new(l||i)(g.KVO(u.q),g.KVO(_.Qq))},i.\u0275prov=g.jDH({token:i,factory:i.\u0275fac}),d})()},75239:(E,y,s)=>{s.r(y),s.d(y,{DashboardModule:()=>no});var p=s(60177),u=s(25596),g=s(99213),_=s(224),C=s(9183),i=s(9159),d=s(41780),D=s(99437),l=s(7673),h=s(21626),t=s(17705),R=s(51548);let M=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a){return this.networkRepository.getOrdersCountInDateRange(a).pipe((0,D.W)(r=>{if(r instanceof h.yz&&404===r.status)return(0,l.of)(0);throw r}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(R.m))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})(),$=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a){return this.networkRepository.getSalesTotal(a).pipe((0,D.W)(r=>{if(r instanceof h.yz&&404===r.status)return(0,l.of)(0);throw r}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(R.m))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var x=s(94364),G=s(89417);let V=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a){return this.networkRepository.getCustomerRegistrations(a).pipe((0,D.W)(r=>{if(r instanceof h.yz&&404===r.status)return(0,l.of)(0);throw r}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(R.m))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var w=s(44437),k=s(96354),O=s(72692),W=s(67374),f=s.n(W);let $t=(()=>{var e;class n{constructor(a){this.networkRepository=a}static getMonthFormat(a){return a.split("/").slice(0,2).join("/")}execute(a){return(0,w.y)(this.networkRepository.getChartOrdersCount(a),this.networkRepository.getChartOrdersSales(a)).pipe((0,D.W)(r=>{if(r instanceof h.yz&&404===r.status)return(0,w.y)((0,l.of)({rows:[]}),(0,l.of)({rows:[]}));throw r})).pipe((0,k.T)(([r,c])=>[r[0],c[0]]),(0,k.T)(([r,c])=>{const m=f()(a.fromDate,O.nu),b=f()(a.fromDate,O.nu),v={},P=b.diff(m,"days");if(P<=40){var F;null===(F=r.rows)||void 0===F||F.forEach(S=>{const T=c.rows.find(L=>L.date===S.date);v[S.date]={ordersCount:S.number,sales:T?T.number:0}});for(let S=0;S<P;S++){const T=(0,O.Ay)(f()(m).add(S,"days"),"YYYY/MM/DD");v[T]||(v[T]={ordersCount:0,sales:0})}}else{r.rows.forEach(S=>{v[n.getMonthFormat(S.date)]||(v[n.getMonthFormat(S.date)]={sales:0,ordersCount:0});const T=v[n.getMonthFormat(S.date)],L=c.rows.find(so=>so.date===S.date);T.ordersCount+=S.number,T.sales+=L?L.number:0});for(let S=0;S<b.diff(m,"months");S++){const T=n.getMonthFormat((0,O.Ay)(f()(m).add(S,"months"),"YYYY/MM/DD"));v[T]||(v[T]={ordersCount:0,sales:0})}}return v}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(R.m))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var Gt=s(47410),A=s(52168),jt=s(74547),dt=s(18370),mt=s(50297),ut=s(214);let j=(()=>{var e;class n extends dt.Y{constructor(a,r){super(a),this.userStorage=a,this.httpClient=r}getYearlySaleByMonths(a,r="MONTHS"){return this.httpClient.post("reporting/budget/sales/history",{...a,timeUnit:r})}getCountTurnoverVat(a,r="YEARS"){return this.httpClient.post("reporting/count/turnover/vat",{...a,timeUnit:r})}getCategoryDashboardData(a,r,c){return this.httpClient.get("reporting/stat/dashboard/category/sum",{params:(0,ut.$I)({year:a,shopId:r,timeUnit:c})})}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(mt.q),t.KVO(h.Qq))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var N=s(34018);
1class wt{static organiseRow(n){return n.budget=n.numbers[0],n.sale=n.numbers[1],n.historySale=n.numbers[2],n.percentOfBudget=N.z.calculatePercent(n.sale,n.budget,100),n.percentOfLastYearSale=N.z.calculatePercent(n.sale-n.historySale,n.historySale,n.sale?100:0),n}}var B=s(11840);let z=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a){return this.networkRepository.getYearlySaleByMonths(a).pipe((0,k.T)(r=>(r.forEach(c=>{c.rows.sort((m,b)=>B.D.compareDates(f()(m.date,"YYYY/MM/DD").toDate(),f()(b.date,"YYYY/MM/DD").toDate())),c.rows.forEach(m=>{m=wt.organiseRow(m);const b=f()(m.date,"YYYY/MM/DD").format("MMM");"Invalid date"!==b&&(m.date=b)})}),r)))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(j))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();class Nt{static organiseRow(n){return n.unitsSold=n.numbers[0],n.sale=n.numbers[1],n.vat=n.numbers[2],n}}let ht=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a){return this.networkRepository.getCountTurnoverVat(a).pipe((0,k.T)(r=>r[0]),(0,k.T)(r=>(r.rows.sort((c,m)=>B.D.compareDates(f()(c.date,"YYYY/MM/DD").toDate(),f()(m.date,"YYYY/MM/DD").toDate())),r.rows.forEach(c=>{(c=Nt.organiseRow(c)).date=f()(c.date,"YYYY/MM/DD").format("YYYY")}),r)))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(j))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var Bt=s(63315);let pt=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a,r){return this.networkRepository.getCategoryDashboardData(a,r)}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(j))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var Q=s(79519),gt=s(88588),_t=s(44613),U=s(85956);let ft=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({providers:[j,Bt.l,z,ht,pt],imports:[p.MD,d.h,A.iI,_t.C,gt.kg,_.mz,G.YN,jt.B,x.dV,C.D6,u.Hu,Q.H,g.m_,U.wG]}),n})();var Xt=s(4375),Vt=s(52693),Ut=s(80963),Kt=s(49977),Ht=s(3624),K=s(78287),tt=s(84572),X=s(84135),bt=s(33425),Wt=s(80419),I=s(26184),J=s(97268),Y=s(2134),zt=s(59459),H=s(70521),Z=s(42353),Ct=s(99379),vt=s(92113);let Dt=(()=>{var e;class n{constructor(a){this.networkRepository=a}execute(a,r=10){return this.networkRepository.getLastXDaySales(a,r).pipe((0,k.T)(c=>{const m=f()().subtract(1,"d").startOf("day");for(let v=f()().subtract(r+1,"d").startOf("day").clone();v.isSame(m)||v.isBefore(m);v=v.add(1,"day"))c.some(F=>F.dateTime===v.format(I.lS))||c.push({amount:0,costAmount:0,costInAmount:0,vatPercent:0,shopName:"",dateTime:v.format(I.lS),discountAmount:0,productsQuantity:0,vatAmount:0,lastYearAmount:0,lastYearCostAmount:0,lastYearDiscountAmount:0,lastYearOrderCount:0,lastYearProductsQuantity:0,lastYearVatAmount:0});return c.sort((v,P)=>B.D.compareMoments(f()(v.dateTime,I.lS),f()(P.dateTime,I.lS)))}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(R.m))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var Qt=s(1443),yt=s(88834),et=s(41584),St=s(270),at=s(10119),xt=s(17238),It=s(34006),Jt=s(92629),ot=s(17776);const Zt=["comboChartContainer"];function qt(e,n){if(1&e){const o=t.RV6();t.j41(0,"div",24)(1,"span",25),t.EFF(2),t.k0s(),t.j41(3,"button",26),t.bIt("click",function(){t.eBV(o);const r=t.XpG(2);return t.Njj(r.closeDialog())}),t.j41(4,"mat-icon"),t.EFF(5,"close"),t.k0s()()()}if(2&e){const o=t.XpG(2);t.R7$(2),t.SpI(" ",o.shopName," ")}}const te=function(e,n){return[e,n]};function ee(e,n){if(1&e){const o=t.RV6();t.j41(0,"combo-chart-component",27),t.bIt("select",function(r){t.eBV(o);const c=t.XpG(2);return t.Njj(c.onYearSelect(r))}),t.nI1(1,"translate"),t.nI1(2,"translate"),t.nI1(3,"translate"),t.k0s()}if(2&e){const o=t.XpG(2);t.Y8G("scheme",o.chartColorScheme)("colorSchemeLine",o.chartLineColorScheme)("view",t.l_i(24,te,o.comboChartWidth,o.comboChartHeight))("results",o.yearlySalesBarChartData)("animations",!0)("lineChart",o.yearlyUnitsSoldLineChartData)("gradient",!1)("xAxis",!0)("yAxis",!0)("autoScale",!1)("legend",!1)("showGridLines",!0)("showXAxisLabel",!0)("showYAxisLabel",!0)("showRightYAxisLabel",!0)("xAxisLabel",t.bMT(1,18,"admin.reports.year"))("yAxisLabel",t.bMT(2,20,"admin.reports.sales"))("yAxisLabelRight",t.bMT(3,22,"admin.reports.units_sold"))}}const Rt=function(e){return{height:"1rem",width:"1rem",background:e}},Ft=function(){return{x:10}};function ae(e,n){if(1&e&&(t.qex(0),t.DNE(1,qt,6,1,"div",2),t.j41(2,"div",3)(3,"div",4)(4,"mat-card",5)(5,"mat-card-title")(6,"div",6),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"div",7),t.EFF(10),t.nI1(11,"translate"),t.k0s()(),t.j41(12,"mat-card-content")(13,"div",8,9),t.DNE(15,ee,4,27,"combo-chart-component",10),t.k0s(),t.j41(16,"div",11),t.nrm(17,"div",12),t.j41(18,"div"),t.EFF(19),t.nI1(20,"translate"),t.k0s(),t.nrm(21,"div",13),t.j41(22,"div"),t.EFF(23),t.nI1(24,"translate"),t.k0s()()()()(),t.j41(25,"div",4)(26,"mat-card",14)(27,"mat-card-title")(28,"div",15),t.EFF(29),t.nI1(30,"translate"),t.k0s(),t.j41(31,"div",16),t.EFF(32),t.k0s()(),t.j41(33,"mat-card-content",17)(34,"div",18),t.nrm(35,"ngx-charts-pie-chart",19),t.k0s()()()(),t.j41(36,"div",20)(37,"mat-card",21)(38,"mat-card-title",22)(39,"div",6),t.EFF(40),t.nI1(41,"translate"),t.k0s(),t.j41(42,"div",7),t.EFF(43),t.k0s()(),t.j41(44,"mat-card-content",17),t.nrm(45,"ngx-charts-line-chart",23),t.nI1(46,"translate"),t.nI1(47,"translate"),t.k0s()()()(),t.bVm()),2&e){const o=t.XpG();t.R7$(1),t.Y8G("ngIf",o.isPopup),t.R7$(6),t.SpI(" ",t.bMT(8,36,"admin.dashboard.yearly_sales_comparison")," "),t.R7$(3),t.SpI(" ",t.bMT(11,38,"admin.dashboard.click_on_chart_to_see_details")," "),t.R7$(5),t.Y8G("ngIf",!!o.comboChartWidth&&!!o.comboChartHeight),t.R7$(2),t.Aen(t.eq3(54,Rt,o.barBackgroun
1dColor)),t.R7$(2),t.JRh(t.bMT(20,40,"admin.reports.sales")),t.R7$(2),t.Aen(t.eq3(56,Rt,o.lineColor)),t.R7$(2),t.JRh(t.bMT(24,42,"admin.reports.units_sold")),t.R7$(6),t.SpI(" ",t.i5U(30,44,"admin.dashboard.top_x_categories",t.lJ4(58,Ft))," "),t.R7$(3),t.SpI(" ",o.selectedYear," "),t.R7$(3),t.Y8G("results",o.categoryPieChartData)("customColors",o.categoresPieChartColorScheme)("labels",!1)("legendTitle","")("legend",!0)("legendPosition",o.LegendPosition.Right)("explodeSlices",!0)("doughnut",!0)("gradient",!0)("animations",!0),t.R7$(5),t.SpI(" ",t.i5U(41,47,"admin.dashboard.monthly_sales_budget",t.lJ4(59,Ft))," "),t.R7$(3),t.SpI(" ",o.selectedYear," "),t.R7$(2),t.Y8G("scheme",o.salesBudgetColorScheme)("results",o.budgetSaleHistroyData)("gradient",!1)("xAxis",!0)("yAxis",!0)("legend",!0)("autoScale",!1)("showXAxisLabel",!0)("showYAxisLabel",!1)("xAxisLabel",t.bMT(46,50,"admin.reports.month"))("yAxisLabel",t.bMT(47,52,"admin.reports.sales"))("animations",!0)}}let Et=(()=>{var e;class n extends X.${constructor(a,r,c,m,b,v,P,F,S,T,L){super(a),this.cdk=a,this.translateService=r,this.getMonthlySalesInteractor=c,this.getCategoryDashboardKprDataInteractor=m,this.dialogRef=b,this.getCountSalesVatInteractor=v,this.shopService=P,this.router=F,this.activatedRoute=S,this.snackbarService=T,this.shopInfoService=L,this.LegendPosition=x.PA,this.selectedYear=f()().year(),this.beginningOfYear=f()((new Date).setMonth(0,1)).format("YYYYMMDD"),this.endOfYear=f()((new Date).setMonth(11,31)).format("YYYYMMDD"),this.date14YearsAgo=f()((new Date).setMonth(0,1)).subtract(14,"years").format("YYYYMMDD"),this.barBackgroundColor=Y.t1[0],this.lineColor=Y.t1[1],this.categoresPieChartColorScheme={domain:[this.barBackgroundColor,this.lineColor]},this.salesBudgetColorScheme={domain:Y.t1},this.chartColorScheme={domain:[this.barBackgroundColor]},this.chartLineColorScheme={domain:[this.lineColor]},this.Source=J.kc,this.budgetSaleHistroyData=[],this.categoryPieChartData=[],this.yearlySalesBarChartData=[],this.yearlyUnitsSoldLineChartData=[],this.filters={source:this.Source.ANY,timeUnit:at.y.years,fromDate:this.beginningOfYear,toDate:this.endOfYear}}ngOnInit(){this.isLoading=!0,this.addSubscription(this.shopInfoService.getGeneralInfo().subscribe(a=>{this.generalInfo=a,this.filters.shops=xt.$.isNotBlank(this.shopId)?[this.shopId]:[this.generalInfo.shops[0].shopNo],this.updateData()}))}getBudgetSaleHistoryData(){const a={name:this.translateService.instant("admin.reports.last_year_sales"),series:[]},r={name:this.translateService.instant("admin.reports.this_year_sales"),series:[]},c={name:this.translateService.instant("admin.reports.this_year_budget"),series:[]};this.budgetSaleHistory.rows.forEach(m=>{a.series.push({name:m.date,value:m.historySale}),r.series.push({name:m.date,value:m.sale}),c.series.push({name:m.date,value:m.budget})}),this.budgetSaleHistroyData=[r,a,c],this.markForCheck()}getCategoryDataForPieChart(){const a=[];this.categoryResponse.slice(0,10).forEach(r=>a.push({name:r.categoryName||"",value:r.amount})),this.categoryPieChartData=a,this.markForCheck()}getYearlySalesBarChartData(){const a=[];(new Date).getFullYear(),this.countSalesVatResponse.rows.forEach(c=>a.push({name:c.date,value:c.sale})),a.sort((c,m)=>B.D.compareNumbers(+c.name,+m.name)),this.yearlySalesBarChartData=a,this.markForCheck()}getYearlyUnitsSoldLineChartData(){const a={name:this.translateService.instant("admin.reports.units_sold"),series:[]};(new Date).getFullYear(),this.countSalesVatResponse.rows.forEach(c=>a.series.push({name:c.date,value:c.unitsSold})),a.series.sort((c,m)=>B.D.compareNumbers(+c.name,+m.name)),this.yearlyUnitsSoldLineChartData=[a],this.markForCheck()}updateData(){this.addSubscription(this.getCountSalesVatInteractor.execute({...this.filters,fromDate:this.date14YearsAgo}).subscribe(a=>{this.countSalesVatResponse=a,this.loadDataPerYear()},a=>{console.log(a),this.isLoading=!1,this.snackbarService.error("error_reloading_data"),this.markForCheck()}))}loadDataPerYear(){const a=this.selectedYear+"0101",r=this.selectedYear+"1231";this.isLoading=!0,this.markForCheck(),this.addSubscription((0,w.y)(this.getMonthlySalesInteractor.execute({...this.filters,fromDate:a,toDate:r}),this.getCategoryDashboardKprDataInteractor.execute(this.selectedYear,this.shopI
1d)).subscribe(([c,m])=>{this.budgetSaleHistory=c[0],this.categoryResponse=m,this.isLoading=!1,this.updateCharts(),this.markForCheck()},c=>{console.log(c),this.isLoading=!1,this.snackbarService.error("error_reloading_data"),this.markForCheck()}))}updateCharts(){this.getBudgetSaleHistoryData(),this.getCategoryDataForPieChart(),this.getYearlySalesBarChartData(),this.getYearlyUnitsSoldLineChartData(),this.updateComboChartDimensions()}updateComboChartDimensions(){this.addSubscription((0,et.O)(150).subscribe(()=>{this.comboChartHeight=this.comboChartContainer.nativeElement.getBoundingClientRect().height,this.comboChartWidth=this.comboChartContainer.nativeElement.getBoundingClientRect().width,this.markForCheck()}))}onYearSelect(a){this.selectedYear!=a&&(this.selectedYear=a,this.markForCheck(),this.loadDataPerYear())}closeDialog(){var a;null===(a=this.dialogRef)||void 0===a||a.close()}}return(e=n).\u0275fac=function(a){return new(a||e)(t.rXU(t.gRc),t.rXU(d.c$),t.rXU(z),t.rXU(pt),t.rXU(It.CP),t.rXU(ht),t.rXU(St.L),t.rXU(A.Ix),t.rXU(A.nX),t.rXU(H.z),t.rXU(Z.W))},e.\u0275cmp=t.VBU({type:e,selectors:[["webshop-kpr-summary"]],viewQuery:function(a,r){if(1&a&&t.GBs(Zt,5),2&a){let c;t.mGM(c=t.lsd())&&(r.comboChartContainer=c.first)}},inputs:{isPopup:"isPopup",shopId:"shopId",shopName:"shopName"},features:[t.Vt3],decls:2,vars:2,consts:[[4,"ngIf"],[3,"isLoading"],["class","dialog-header",4,"ngIf"],[1,"grid-container","gap-3","mb-3"],[1,"g-col-12","g-col-lg-6"],[1,"mw-100","w-100","h-100","mat-elevation-z0","chart-rounded"],[1,"font-medium-2","text-center"],[1,"font-medium-1","text-center"],[1,"display-inline-flex","mw-100",2,"min-height","400px","width","100%","max-height","650px"],["comboChartContainer",""],["class","mw-100 w-100 h-100",3,"scheme","colorSchemeLine","view","results","animations","lineChart","gradient","xAxis","yAxis","autoScale","legend","showGridLines","showXAxisLabel","showYAxisLabel","showRightYAxisLabel","xAxisLabel","yAxisLabel","yAxisLabelRight","select",4,"ngIf"],[1,"w-100","d-flex","align-items-center","justify-content-center"],[1,"mx-1"],[1,"ms-2","me-1"],[1,"mw-100","w-100","mh-100","h-100","pt-0","mat-elevation-z0","rounded","p-2"],[1,"font-medium-2"],[1,"font-medium-1"],[1,"h-100"],[2,"max-height","330px"],[1,"mw-100","w-100","h-100",3,"results","customColors","labels","legendTitle","legend","legendPosition","explodeSlices","doughnut","gradient","animations"],[1,"g-col-12"],[1,"full-width","mw-100","mh-100","mat-elevation-z0","chart-rounded",2,"min-height","330px"],[1,""],["legendPosition","below","legendTitle","",1,"full-width","full-height",3,"scheme","results","gradient","xAxis","yAxis","legend","autoScale","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","animations"],[1,"dialog-header"],[1,"m-0","title"],["color","accent","mat-icon-button","",1,"close-btn",3,"click"],[1,"mw-100","w-100","h-100",3,"scheme","colorSchemeLine","view","results","animations","lineChart","gradient","xAxis","yAxis","autoScale","legend","showGridLines","showXAxisLabel","showYAxisLabel","showRightYAxisLabel","xAxisLabel","yAxisLabel","yAxisLabelRight","select"]],template:function(a,r){1&a&&(t.DNE(0,ae,48,60,"ng-container",0),t.nrm(1,"webshop-loading",1)),2&a&&(t.Y8G("ngIf",!r.isLoading),t.R7$(1),t.Y8G("isLoading",r.isLoading))},dependencies:[p.bT,Jt.y,x.Il,x.km,u.RN,u.m2,u.dh,ot.q,g.An,U.iV,d.D9],styles:["[_nghost-%COMP%]  .legend-labels{display:flex;flex-direction:row;flex-wrap:wrap;white-space:normal!important}[_nghost-%COMP%]  .ngx-charts-outer{max-height:100%!important}[_nghost-%COMP%]  svg{max-height:100%!important}"]}),n})();var oe=s(34552),rt=s(10357);let re=(()=>{var e;class n extends X.${constructor(a){super(a),this.cdk=a}ngOnInit(){}}return(e=n).\u0275fac=function(a){return new(a||e)(t.rXU(t.gRc))},e.\u0275cmp=t.VBU({type:e,selectors:[["webshop-dashboard-card-1"]],inputs:{title:"title",subtitle:"subtitle",value:"value",numberFormat:"numberFormat",currency:"currency",isPercent:"isPercent"},features:[t.Vt3],decls:13,vars:11,consts:[[1,"w-100","h-100","d-flex","flex-column","justify-content-between"],[1,"text-capitalize"],[1,"text-black-50"],[1,"mb-0"],[1,"font-small-4"]],template:function(a,r){1&a&&(t.j41(0,"div",0)(1,"div")(2,"div",1),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"div",2),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.j41(8,"h3",3),t.EFF(9),t.nI1(10,"numFormat"),t.j41(11,"span",4),t.EFF(12),t.k0s()()()),2&a&&(t.R
17$(3),t.SpI(" ",t.bMT(4,5,r.title)," "),t.R7$(3),t.SpI(" ",t.bMT(7,7,r.subtitle)," "),t.R7$(3),t.SpI(" ",r.numberFormat?t.bMT(10,9,r.value):r.value," "),t.R7$(3),t.Lme("",r.isPercent?"%":""," ",r.currency?r.currency:"",""))},dependencies:[d.D9,rt.N],changeDetection:0}),n})();var nt=s(96850),q=s(59115),Pt=s(12502);let Tt=(()=>{var e;class n{constructor(a,r){this.networkRepository=a,this.translateService=r}execute(a,r){return this.networkRepository.getCategoryDashboardData(a,r,at.y.months).pipe((0,k.T)(c=>{c.forEach(b=>{xt.$.isBlank(b.categoryId1)&&(b.categoryName=this.translateService.instant("admin.reports.no_category"))});const m=new Pt.L;return m.rows=c,m.rowsOrganised=Pt.L.getRowsOrganised(m).filter(b=>!b.isTotalRow),m}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(j),t.KVO(d.c$))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();function ne(e,n){if(1&e&&(t.nrm(0,"ngx-charts-bar-vertical-2d",19),t.nI1(1,"translate"),t.nI1(2,"translate")),2&e){const o=t.XpG(3);t.Y8G("gradient",!0)("legend",!0)("results",o.barChartData)("scheme",o.categoresPieChartColorScheme)("showXAxisLabel",!0)("showYAxisLabel",!0)("xAxisLabel",t.bMT(1,10,"admin.reports.month"))("xAxis",!0)("yAxisLabel",t.bMT(2,12,"admin.reports.sales"))("yAxis",!0)}}const se=function(e){return{name:e}};function ie(e,n){if(1&e&&(t.j41(0,"mat-card",14)(1,"mat-card-title",15)(2,"div",16),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"mat-card-content",17),t.DNE(6,ne,3,14,"ngx-charts-bar-vertical-2d",18),t.nrm(7,"webshop-loading",1),t.k0s()()),2&e){const o=t.XpG(2);t.R7$(3),t.SpI(" ",t.i5U(4,3,"admin.dashboard.monthly_sales_for",t.eq3(6,se,o.selectedCategoryName))," "),t.R7$(3),t.Y8G("ngIf",!o.isLoadingChartData),t.R7$(1),t.Y8G("isLoading",o.isLoadingChartData)}}const le=function(e){return{x:10,year:e}};function ce(e,n){if(1&e){const o=t.RV6();t.qex(0),t.j41(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"mat-card",6)(6,"mat-card-title")(7,"div",7),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.j41(10,"div",8),t.EFF(11),t.nI1(12,"translate"),t.k0s()(),t.j41(13,"mat-card-content",9)(14,"div",10)(15,"ngx-charts-pie-chart",11),t.bIt("select",function(r){t.eBV(o);const c=t.XpG();return t.Njj(c.onCategorySelect(r))}),t.k0s()()()()(),t.j41(16,"div",12),t.DNE(17,ie,8,8,"mat-card",13),t.k0s()()()(),t.bVm()}if(2&e){const o=t.XpG();t.R7$(8),t.SpI(" ",t.i5U(9,13,"admin.dashboard.top_x_sales_by_category_for_year",t.eq3(18,le,o.selectedYear))," "),t.R7$(3),t.SpI(" ",t.bMT(12,16,"admin.dashboard.click_on_category_to_see_monthly_view")," "),t.R7$(4),t.Y8G("results",o.categoryPieChartData)("customColors",o.categoresPieChartColorScheme)("labels",!1)("legendTitle","")("legendPosition",o.LegendPosition.Right)("legend",!0)("explodeSlices",!0)("doughnut",!0)("gradient",!0)("animations",!0),t.R7$(2),t.Y8G("ngIf",!(null==o.selectedCategoryName||!o.selectedCategoryName.length||null==o.barChartData||!o.barChartData.length))}}let de=(()=>{var e;class n extends X.${constructor(a,r,c,m){super(a),this.cdk=a,this.translateService=r,this.getCategoryMonthlySumInteractor=c,this.snackbarService=m,this.LegendPosition=x.PA,this.selectedYear=f()().year(),this.categoresPieChartColorScheme={domain:[Y.t1[0],Y.t1[1]]},this.Source=J.kc,this.categoryPieChartData=[],this.barChartData=[]}ngOnInit(){this.isLoading=!0,this.updateData()}getCategoryDataForPieChart(){const a=[];this.categoryResponse.rowsOrganised.slice(0,10).forEach(r=>a.push({name:r.categoryName||"",value:r.amount})),this.categoryPieChartData=a,this.markForCheck()}getMonthlySalesBarChartData(){var a;this.isLoadingChartData=!0,this.barChartData=[],this.markForCheck();const r=new Map;null===(a=this.categoryResponse.rows.filter(b=>b.categoryName===this.selectedCategoryName))||void 0===a||a.sort((b,v)=>B.D.compareMoments(f()(b.dateTime,I.lS),f()(v.dateTime,I.lS))).forEach(b=>{const v=f()(b.dateTime,I.lS).format(I.wk);r.set(v,{name:v,series:[{name:this.translateService.instant("admin.dashboard.current_year"),value:b.amount||0},{name:this.translateService.instant("admin.reports.last_year"),value:b.lastYearAmount||0}]})});const m=Array.from({length:12},(b,v)=>f()().month(v).format(I.wk)).map(b=>r.get(b)||{name:b,series:[{name:this.translateService.instant("admin.dashboard.current_year"),value:0},{name:this.translateService.instant("admin.reports.last_year"),value:0}]});this.barChartData=m,this.markForCheck(),this.addSubscription((0,et.O)(350).subscribe(()=>{this.isLoadingChartData=!1,this.markForCheck()}))}updateData(){this.addSubscription(this.getCategoryMonthlySumInteractor.execute(this.selectedYear,this.shopI
1d).subscribe(a=>{var r;this.categoryResponse=a,this.selectedCategoryName=null!==(r=this.categoryResponse)&&void 0!==r&&null!==(r=r.rowsOrganised)&&void 0!==r&&r.length?this.categoryResponse.rowsOrganised[0].categoryName:void 0,this.isLoading=!1,this.updateCharts(),this.markForCheck()},a=>{console.log(a),this.isLoading=!1,this.snackbarService.error("error_reloading_data"),this.markForCheck()}))}updateCharts(){this.getCategoryDataForPieChart(),this.getMonthlySalesBarChartData()}onCategorySelect(a){const r="string"==typeof a?a:a.name;this.selectedCategoryName!==r&&(this.selectedCategoryName=r,this.getMonthlySalesBarChartData(),this.markForCheck())}}return(e=n).\u0275fac=function(a){return new(a||e)(t.rXU(t.gRc),t.rXU(d.c$),t.rXU(Tt),t.rXU(H.z))},e.\u0275cmp=t.VBU({type:e,selectors:[["webshop-category-sum"]],inputs:{shopId:"shopId"},features:[t.Vt3],decls:2,vars:2,consts:[[4,"ngIf"],[3,"isLoading"],[1,"row","mx-0"],[1,"col-12","mt-3","mw-100","px-0"],[1,"row","mw-100","w-100","mx-0"],[1,"col-lg-5","col-12","pe-0"],[1,"mw-100","w-100","mh-100","h-100","pt-0","mat-elevation-z0","rounded","p-2"],[1,"font-medium-2"],[1,"font-medium-1"],[1,"h-100"],[2,"max-height","330px"],[1,"mw-100","w-100","h-100",3,"results","customColors","labels","legendTitle","legendPosition","legend","explodeSlices","doughnut","gradient","animations","select"],[1,"col-lg-7","col-12"],["class","full-width mw-100 mh-100 mat-elevation-z0 chart-rounded",4,"ngIf"],[1,"full-width","mw-100","mh-100","mat-elevation-z0","chart-rounded"],[1,""],[1,"font-medium-2","text-center"],[1,"h-100",2,"min-height","450px"],["legendPosition","below","legendTitle","","class","mw-100 w-100 h-100",3,"gradient","legend","results","scheme","showXAxisLabel","showYAxisLabel","xAxisLabel","xAxis","yAxisLabel","yAxis",4,"ngIf"],["legendPosition","below","legendTitle","",1,"mw-100","w-100","h-100",3,"gradient","legend","results","scheme","showXAxisLabel","showYAxisLabel","xAxisLabel","xAxis","yAxisLabel","yAxis"]],template:function(a,r){1&a&&(t.DNE(0,ce,18,20,"ng-container",0),t.nrm(1,"webshop-loading",1)),2&a&&(t.Y8G("ngIf",!r.isLoading),t.R7$(1),t.Y8G("isLoading",r.isLoading))},dependencies:[p.bT,x.Dl,x.km,u.RN,u.m2,u.dh,ot.q,d.D9],styles:["[_nghost-%COMP%]  .legend-labels{display:flex;flex-direction:row;flex-wrap:wrap;white-space:normal!important}[_nghost-%COMP%]  .ngx-charts-outer{max-height:100%!important}[_nghost-%COMP%]  svg{max-height:100%!important}"]}),n})();var me=s(97928),ue=s(83940);function he(e,n){if(1&e){const o=t.RV6();t.j41(0,"button",17),t.bIt("click",function(){t.eBV(o);const r=t.XpG(3);return t.Njj(r.toggleCompareToBudget())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&e){const o=t.XpG(3);t.R7$(1),t.SpI(" ",t.bMT(2,1,o.compareToBudget?"admin.dashboard.compare_to_last_year":"admin.dashboard.compare_to_budget")," ")}}function pe(e,n){if(1&e&&(t.j41(0,"th",15),t.DNE(1,he,3,3,"button",16),t.k0s()),2&e){const o=t.XpG(2);t.R7$(1),t.Y8G("ngIf",o.showBudgetOption)}}function ge(e,n){if(1&e&&(t.j41(0,"td",18),t.EFF(1),t.k0s()),2&e){const o=n.$implicit;t.R7$(1),t.SpI(" ",o.shopName," ")}}function _e(e,n){1&e&&(t.j41(0,"th",26),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.JRh(t.bMT(2,1,"admin.dashboard.sales")))}function fe(e,n){if(1&e&&(t.j41(0,"td",27),t.EFF(1),t.nI1(2,"numFormat"),t.k0s()),2&e){const o=n.$implicit,a=t.XpG().$implicit,r=t.XpG
1(2);t.AVh("bg-gray",a%2==0),t.R7$(1),t.SpI(" ",t.i5U(2,3,o.rows[a].sale,r.numberFormat)," ")}}function be(e,n){1&e&&(t.j41(0,"th",28),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.JRh(t.bMT(2,1,"admin.dashboard.budget")))}function Ce(e,n){if(1&e&&(t.j41(0,"td",29),t.EFF(1),t.nI1(2,"numFormat"),t.k0s()),2&e){const o=n.$implicit,a=t.XpG().$implicit,r=t.XpG(2);t.AVh("bg-gray",a%2==0),t.R7$(1),t.SpI(" ",t.i5U(2,3,o.rows[a].budget,r.numberFormat)," ")}}function ve(e,n){1&e&&(t.j41(0,"th",30),t.EFF(1," % "),t.k0s())}function De(e,n){if(1&e&&(t.j41(0,"td",31),t.EFF(1),t.nI1(2,"numFormat"),t.k0s()),2&e){const o=n.$implicit,a=t.XpG().$implicit,r=t.XpG(2);t.AVh("percent-success",o.rows[a].percentOfBudget>=100)("percent-warn",o.rows[a].percentOfBudget>=80&&o.rows[a].percentOfBudget<100)("percent-error",o.rows[a].percentOfBudget<80)("bg-gray",a%2==0),t.R7$(1),t.SpI(" ",t.i5U(2,9,o.rows[a].percentOfBudget,r.numberFormat),"% ")}}function ye(e,n){1&e&&(t.j41(0,"th",28),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.JRh(t.bMT(2,1,"admin.dashboard.last_year")))}function Se(e,n){if(1&e&&(t.j41(0,"td",29),t.EFF(1),t.nI1(2,"numFormat"),t.k0s()),2&e){const o=n.$implicit,a=t.XpG().$implicit,r=t.XpG
1(2);t.AVh("bg-gray",a%2==0),t.R7$(1),t.SpI(" ",t.i5U(2,3,o.rows[a].historySale,r.numberFormat)," ")}}function xe(e,n){1&e&&(t.j41(0,"th",30),t.EFF(1," % "),t.k0s())}function Ie(e,n){if(1&e&&(t.j41(0,"td",31),t.EFF(1),t.nI1(2,"numFormat"),t.k0s()),2&e){const o=n.$implicit,a=t.XpG().$implicit,r=t.XpG(2);t.AVh("percent-success",o.rows[a].percentOfLastYearSale>=0)("percent-error",o.rows[a].percentOfLastYearSale<0)("bg-gray",a%2==0),t.R7$(1),t.SpI(" ",t.i5U(2,7,o.rows[a].percentOfLastYearSale,r.numberFormat),"% ")}}function Re(e,n){if(1&e&&(t.qex(0)(1,19),t.DNE(2,_e,3,3,"th",20),t.DNE(3,fe,3,6,"td",21),t.bVm(),t.qex(4,19),t.DNE(5,be,3,3,"th",11),t.DNE(6,Ce,3,6,"td",22),t.bVm(),t.qex(7,19),t.DNE(8,ve,2,0,"th",23),t.DNE(9,De,3,12,"td",24),t.bVm(),t.qex(10,19),t.DNE(11,ye,3,3,"th",11),t.DNE(12,Se,3,6,"td",22),t.bVm(),t.qex(13,19),t.DNE(14,xe,2,0,"th",23),t.DNE(15,Ie,3,10,"td",25),t.bVm()()),2&e){const o=n.$implicit;t.R7$(1),t.FS9("matColumnDef","month-"+o+"-sale"),t.R7$(3),t.FS9("matColumnDef","month-"+o+"-budget"),t.R7$(3),t.FS9("matColumnDef","month-"+o+"-budget-percent"),t.R7$(3),t.FS9("matColumnDef","month-"+o+"-last-year"),t.R7$(3),t.FS9("matColumnDef","month-"+o+"-last-year-percent")}}function Fe(e,n){1&e&&(t.j41(0,"th",28),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.shop")," "))}function Ee(e,n){if(1&e&&(t.j41(0,"th",33),t.EFF(1),t.k0s()),2&e){const o=t.XpG().$implicit;t.BMQ("colspan",3),t.R7$(1),t.SpI(" ",o," ")}}function Pe(e,n){1&e&&(t.qex(0,19),t.DNE(1,Ee,2,2,"th",32),t.bVm()),2&e&&t.FS9("matColumnDef",n.$implicit)}function Te(e,n){1&e&&t.nrm(0,"tr",34)}function Me(e,n){1&e&&t.nrm(0,"tr",34)}function ke(e,n){if(1&e){const o=t.RV6();t.j41(0,"tr",35),t.bIt("click",function(){const c=t.eBV(o).$implicit,m=t.XpG(2);return t.Njj(m.openShopDetails(c))}),t.k0s()}}const Ye=function(){return[0,1,2,3,4,5,6,7,8,9,10,11]};function Oe(e,n){if(1&e&&(t.qex(0),t.j41(1,"div",2)(2,"div",3)(3,"div",4)(4,"table",5),t.qex(5,6),t.DNE(6,pe,2,1,"th",7),t.DNE(7,ge,2,1,"td",8),t.bVm(),t.DNE(8,Re,16,5,"ng-container",9),t.qex(9,10),t.DNE(10,Fe,3,3,"th",11),t.bVm(),t.DNE(11,Pe,2,1,"ng-container",12),t.DNE(12,Te,1,0,"tr",13),t.DNE(13,Me,1,0,"tr",13),t.DNE(14,ke,1,0,"tr",14),t.k0s()()()(),t.bVm()),2&e){const o=t.XpG();t.R7$(4),t.Y8G("dataSource",o.shopsSalesBudget),t.R7$(4),t.Y8G("ngForOf",t.lJ4(8,Ye)),t.R7$(3),t.Y8G("ngForOf",o.monthsColumns),t.R7$(1),t.Y8G("matHeaderRowDef",o.monthHeaders)("matHeaderRowDefSticky",!0),t.R7$(1),t.Y8G("matHeaderRowDef",o.displayedColumns)("matHeaderRowDefSticky",!0),t.R7$(1),t.Y8G("matRowDefColumns",o.displayedColumns)}}let Ae=(()=>{var e;class n extends X.${constructor(a,r,c,m,b,v){super(a),this.cdk=a,this.translateService=r,this.shopInfoService=c,this.dialog=m,this.getMonthlySalesBudgetHistoryInteractor=b,this.snackbarService=v,this.monthsColumns=["January","February","March","April","May","June","July","August","September","Octomber","November","December"],this.monthHeaders=["header-row-first-group",...this.monthsColumns],this.displayedColumns=["shopName",...this.monthsColumns.flatMap((P,F)=>[`month-${F}-sale`,`month-${F}-budget`,`month-${F}-budget-percent`])],this.showBudgetOption=!1,this.compareToBudget=!0,this.shopsSalesBudget=[],this.beginningOfYear=f()((new Date).setMonth(0,1)).format("YYYYMMDD"),this.endOfYear=f()((new Date).setMonth(11,31)).format("YYYYMMDD"),this.filters={source:J.kc.ANY,timeUnit:at.y.years,fromDate:this.beginningOfYear,toDate:this.endOfYear}}ngOnInit(){this.isLoading=!0,this.markForCheck(),this.addSubscription(this.shopInfoService.getGeneralInfo().subscribe(a=>{this.generalInfo=a,this.numberFormat=this.generalInfo.numberFormat,this.filters.shops=this.generalInfo.shops.map(r=>r.shopNo),this.updateData()}))}updateData(){this.addSubscription(this.getMonthlySalesBudgetHistoryInteractor.execute(this.filters).subscribe(a=>{this.shopsSalesBudget=a.filter(r=>{var c;return!!(null===(c=r.rows)||void 0===c?void 0:c.find(b=>!!b.sale))}),this.showBudgetOption=!!this.shopsSalesBudget.find(r=>!!r.rows.find(m=>!!m.budget)),this.compareToBudget=this.showBudgetOption,this.updateDisplayedColumns()},a=>{console.log(a),this.isLoading=!1,this.snackbarService.error("error_reloading_data"),this.markForCheck()}))}toggleCompareToBudget(){this.compareToBudget=!this.compareToBudget,this.isLoading=!0,this.markForCheck(),this.updateDisplayedColumns()}updateDisplayedColumns(){this.displayedColumns=this.compareToBudget?["shopName",...this.monthsColumns.flatMap((a,r)=>
1[`month-${r}-sale`,`month-${r}-budget`,`month-${r}-budget-percent`])]:["shopName",...this.monthsColumns.flatMap((a,r)=>[`month-${r}-sale`,`month-${r}-last-year`,`month-${r}-last-year-percent`])],this.markForCheck(),this.addSubscription((0,et.O)(350).subscribe(()=>{this.isLoading=!1,this.markForCheck()}))}openShopDetails(a){const r=this.dialog.open(Et,{minHeight:400,minWidth:400,maxHeight:"80%",panelClass:"overflow-y-auto"});r.componentInstance.isPopup=!0,r.componentInstance.shopId=a.shopId,r.componentInstance.shopName=a.shopName}}return(e=n).\u0275fac=function(a){return new(a||e)(t.rXU(t.gRc),t.rXU(d.c$),t.rXU(Z.W),t.rXU(It.bZ),t.rXU(z),t.rXU(H.z))},e.\u0275cmp=t.VBU({type:e,selectors:[["webshop-shop-sales-budget"]],features:[t.Vt3],decls:2,vars:2,consts:[[4,"ngIf"],[3,"isLoading"],[1,"grid-container","gap-3"],[1,"g-col-12"],[1,"table-container","d-flex","overflow-auto","w-100"],["mat-table","",1,"w-100","overflow-y-auto",3,"dataSource"],["matColumnDef","shopName","sticky","sticky"],["mat-header-cell","","style","min-width: 250px",4,"matHeaderCellDef"],["mat-cell","","class","fw-bold",4,"matCellDef"],[4,"ngFor","ngForOf"],["matColumnDef","header-row-first-group","sticky","sticky"],["mat-header-cell","","class","text-center",4,"matHeaderCellDef"],[3,"matColumnDef",4,"ngFor","ngForOf"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","","class","clickable-row",3,"click",4,"matRowDef","matRowDefColumns"],["mat-header-cell","",2,"min-width","250px"],["mat-button","","color","accent","class","ws-normal text-center w-100",3,"click",4,"ngIf"],["mat-button","","color","accent",1,"ws-normal","text-center","w-100",3,"click"],["mat-cell","",1,"fw-bold"],[3,"matColumnDef"],["mat-header-cell","","class","text-center border-left",4,"matHeaderCellDef"],["mat-cell","","class","text-right border-left",3,"bg-gray",4,"matCellDef"],["mat-cell","","class","text-right",3,"bg-gray",4,"matCellDef"],["mat-header-cell","","class","text-center border-right",4,"matHeaderCellDef"],["mat-cell","","class","text-right border-right",3,"percent-success","percent-warn","percent-error","bg-gray",4,"matCellDef"],["mat-cell","","class","text-right border-right",3,"percent-success","percent-error","bg-gray",4,"matCellDef"],["mat-header-cell","",1,"text-center","border-left"],["mat-cell","",1,"text-right","border-left"],["mat-header-cell","",1,"text-center"],["mat-cell","",1,"text-right"],["mat-header-cell","",1,"text-center","border-right"],["mat-cell","",1,"text-right","border-right"],["mat-header-cell","","class","text-center border-left border-right",4,"matHeaderCellDef"],["mat-header-cell","",1,"text-center","border-left","border-right"],["mat-header-row",""],["mat-row","",1,"clickable-row",3,"click"]],template:function(a,r){1&a&&(t.DNE(0,Oe,15,9,"ng-container",0),t.nrm(1,"webshop-loading",1)),2&a&&(t.Y8G("ngIf",!r.isLoading),t.R7$(1),t.Y8G("isLoading",r.isLoading))},dependencies:[p.Sq,p.bT,ot.q,i.Zl,i.tL,i.ji,i.cC,i.YV,i.iL,i.KS,i.$R,i.YZ,i.NB,U.iV,d.D9,rt.N],styles:["@media (max-height: 800px){.table-container[_ngcontent-%COMP%]{max-height:85%}}@media (min-height: 800px){.table-container[_ngcontent-%COMP%]{max-height:calc(100vh - 270px)}}@media (min-height: 1900px){.table-container[_ngcontent-%COMP%]{max-height:calc(100vh - 350px)}}.border-right[_ngcontent-%COMP%]{border-right:.5px solid var(--bs-gray-600)}.border-left[_ngcontent-%COMP%]{border-left:.5px solid var(--bs-gray-600)}.percent-success[_ngcontent-%COMP%]{color:var(--default-success)}.percent-warn[_ngcontent-%COMP%]{color:var(--default-caution)}.percent-error[_ngcontent-%COMP%]{color:var(--default-danger)}"]}),n})();var st=s(10514),Le=s(25789),it=function(e){return e.DISCOUNT="discount",e.PRICEBOOK="pricebook",e}(it||{}),Mt=s(59035),kt=s(80251);let Yt=(()=>{var e;class n extends dt.Y{constructor(a,r){super(a),this.userStorage=a,this.httpClient=r}getCampaignSummary(a,r){return this.httpClient.post("reporting/campaign/summary",void 0,{params:(0,ut.$I)({type:a,id:r})})}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(mt.q),t.KVO(h.Qq))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})(),Ot=(()=>{var e;class n{constructor(a){this.campaignNetworkRepository=a}execute(a,r){return this.campaignNetworkRepository.getCampaignSummary(a,r).pipe((0,D.W)(c=>{if(c instanceof h.yz&&404===c.status)return(0,l.of)(null);throw c}))}}return(e=n).\u0275fac=function(a){return new(a||e)(t.KVO(Yt))},e.\u0275prov=t.jDH({token:e,factory:e.\u0275fac}),n})();var At=s(32102),Lt=s(82798),$e=s(86600);function Ge(e,n){if(1&e&&(t.j41(0,"mat-option",8),t.EFF(1),t.k0s()),2&e){const o=n.$implicit;t.Y8G("value",o),t.R7$(1),t.SpI(" ",o.discountName," ")}}function je(e,n){if(1&e&&(t.j41(0,"mat-option",8),t.EFF(1),t.k0s()),2&e){const o=n.$implicit;t.Y8G("value",o),t.R7$(1),t.SpI(" ",o.name," ")}}function we(e,n){1&e&&(t.j41(0,"span",12),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.JRh(t.bMT(2,1,"admin.dashboard.select_campaign")))}function Ne(e,n){1&e&&(t.j41(0,"div",9)(1,"span",12),t.EFF(2),t.nI1(3,"translate"),t.k0s()()),2&e&&(t.R7$(2),t.JRh(t.bMT(3,1,"admin.dashboard.no_data_message")))}function Be(e,n){if(1&e&&(t.j41(0,"div",9),t.DNE(1,we,3,3,"span",10),t.DNE(2,Ne,4,3,"ng-template",null,11,t.C5r),t.k0s()),2&e){const o=t.sdS(3),a=t.XpG(2);t.R7$(1),t.Y8G("ngIf",!a.selectedDiscount&&!a.selectedPricebook)("ngIfElse",o)}}function Xe(e,n){1&e&&t.nrm(0,"th",55)}function Ve(e,n){if(1&e&&(t.j41(0,"td",56),t.EFF(1),t.k0s()),2&e){const o=n.$implicit;t.R7$(1),t.SpI(" ",o.productName," ")}}function Ue(e,n){1&e&&(t.j41(0,"th",57),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.sales")," "))}function Ke(e,n){if(1&e&&(t.j41(0,"td",58),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(3);
1t.R7$(1),t.SpI(" ",o.beforeSales.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function He(e,n){1&e&&(t.j41(0,"th",59),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.difference_before")," "))}function We(e,n){if(1&e&&(t.j41(0,"td",60),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(3);t.AVh("success",o.beforeSalesPercent>0)("warning",o.beforeSalesPercent<=0),t.R7$(1),t.SpI(" ",o.beforeSalesPercent.toLocaleString(a.numberFormat,a.decimalPlacesFormat),"% ")}}function ze(e,n){1&e&&(t.j41(0,"th",61),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.sales")," "))}function Qe(e,n){if(1&e&&(t.j41(0,"td",62),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(3);t.R7$(1),t.SpI(" ",o.duringSales.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function Je(e,n){1&e&&(t.j41(0,"th",57),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.sales")," "))}function Ze(e,n){if(1&e&&(t.j41(0,"td",58),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(3);t.R7$(1),t.SpI(" ",o.afterSales.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function qe(e,n){1&e&&(t.j41(0,"th",63),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.difference_after")," "))}function ta(e,n){if(1&e&&(t.j41(0,"td",64),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(3);t.AVh("success",o.afterSalesPercent>0)("warning",o.afterSalesPercent<=0),t.R7$(1),t.SpI(" ",o.afterSalesPercent.toLocaleString(a.numberFormat,a.decimalPlacesFormat),"% ")}}function ea(e,n){1&e&&(t.j41(0,"th",65),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.dashboard.product")," "))}function aa(e,n){if(1&e&&(t.j41(0,"th",66),t.EFF(1),t.nI1(2,"translate"),t.nrm(3,"br"),t.j41(4,"small"),t.EFF(5),t.k0s()()),2&e){const o=t.XpG(3);t.BMQ("colspan",2),t.R7$(1),t.SpI(" ",t.bMT(2,4,"admin.dashboard.before_sales"),""),t.R7$(4),t.Lme("",null==o.campaignDates?null:o.campaignDates.firstBeforeDate," / ",null==o.campaignDates?null:o.campaignDates.firstCampaignDate,"")}}function oa(e,n){if(1&e&&(t.j41(0,"th",61),t.EFF(1),t.nI1(2,"translate"),t.nrm(3,"br"),t.j41(4,"small"),t.EFF(5),t.k0s()()),2&e){const o=t.XpG(3);t.BMQ("colspan",1),t.R7$(1),t.SpI(" ",t.bMT(2,4,"admin.dashboard.during_sales"),""),t.R7$(4),t.Lme("",null==o.campaignDates?null:o.campaignDates.firstCampaignDate," / ",null==o.campaignDates?null:o.campaignDates.lastCampaignDate,"")}}function ra(e,n){if(1&e&&(t.j41(0,"th",61),t.EFF(1),t.nI1(2,"translate"),t.nrm(3,"br"),t.j41(4,"small"),t.EFF(5),t.k0s()()),2&e){const o=t.XpG(3);t.BMQ("colspan",2),t.R7$(1),t.SpI(" ",t.bMT(2,4,"admin.dashboard.after_sales"),""),t.R7$(4),t.Lme("",null==o.campaignDates?null:o.campaignDates.lastCampaignDate," / ",null==o.campaignDates?null:o.campaignDates.lastAfterDate,"")}}function na(e,n){1&e&&t.nrm(0,"tr",67)}function sa(e,n){1&e&&t.nrm(0,"tr",67)}function ia(e,n){if(1&e){const o=t.RV6();t.j41(0,"tr",68),t.bIt("click",function(){const c=t.eBV(o).$implicit,m=t.XpG(3);return t.Njj(m.onProductSelect(c))}),t.k0s()}if(2&e){const o=n.$implicit,a=t.XpG(3);t.AVh("selected-row",o.productId===a.selectedProductId)("total-row","total"===o.productId)}}function la(e,n){if(1&e&&(t.j41(0,"div",50),t.nrm(1,"span",69),t.j41(2,"span",52),t.EFF(3),t.nI1(4,"translate"),t.k0s()()),2&e){const o=t.XpG(3);t.R7$(3),t.E5c(" ",t.bMT(4,3,"admin.dashboard.after_sales"),": ",null==o.campaignDates?null:o.campaignDates.lastCampaignDate," / ",null==o.campaignDates?null:o.campaignDates.lastAfterDate," ")}}function ca(e,n){if(1&e&&(t.j41(0,"div",13)(1,"div",14)(2,"mat-card",15)(3,"mat-card-title")(4,"div",16),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"div",17),t.EFF(8),t.nI1(9,"translate"),t.k0s()(),t.j41(10,"mat-card-content")(11,"div",18)(12,"table",19),t.qex(13,20),t.DNE(14,Xe,1,0,"th",21),t.DNE(15,Ve,2,1,"td",22),t.bVm(),t.qex(16,23),t.DNE(17,Ue,3,3,"th",24),t.DNE(18,Ke,2,1,"td",25),t.bVm(),t.qex(19,26),t.DNE(20,He,3,3,"th",27),t.DNE(21,We,2,5,"td",28),t.bVm(),t.qex(22,29),t.DNE(23,ze,3,3,"th",30),t.DNE(24,Qe,2,1,"td",31),t.bVm(),t.qex(25,32),t.DNE(26,Je,3,3,"th",24),t.DNE(27,Ze,2,1,"td",25),t.bVm(),t.qex(28,33),t.DNE(29,qe,3,3,"th",34),t.DNE(30,ta,2,5,"td",35),t.bVm(),t.qex(31,36),t.DNE(32,ea,3,3,"th",37),t.bVm(),t.qex(33,38),t.DNE(34,aa,6,6,"th",39),t.bVm(),t.qex(35,40),t.DNE(36,oa,6,6,"th",30),t.bVm(),t.qex(37,41),t.DNE(38,ra,6,6,"th",30),t.bVm(),t.DNE(39,na,1,0,"tr",42),t.DNE(40,sa,1,0,"tr",42),t.DNE(41,ia,1,4,"tr",43),t.k0s()()()()(),t.j41(42,"div",44)(43,"mat-card",15)(44,"mat-card-title")(45,"div",45),t.EFF(46),t.nI1(47,"translate"),t.k0s(),t.j41(48,"div",46),t.EFF(49),t.k0s()(),t.j41(50,"mat-card-content")(51,"div",47),t.nrm(52,"ngx-charts-bar-vertical",48),t.nI1(53,"translate"),t.nI1(54,"translate"),t.k0s(),t.j41(55,"div",49)(56,"div",50),t.nrm(57,"span",51),t.j41(58,"span",52),t.EFF(59),t.nI1(60,"translate"),t.k0s()(),t.j41(61,"div",50),t.nrm(62,"span",53),t.j41(63,"span",52),t.EFF(64),t.nI1(65,"translate"),t.k0s()(),t.DNE(66,la,5,5,"div",54),t.k0s()()()()()),2&e){const o=t.XpG(2);t.R7$(5),t.SpI(" ",t.bMT(6,25,"admin.dashboard.campaign_sales_title")," "),t.R7$(3),t.SpI(" ",t.bMT(9,27,"admin.dashboard.click_on_prodcut_to_see_details")," "),t.R7$(4),t.Y8G("dataSource",o.campaignSalesData),t.R7$(27),t.Y8G("matHeaderRowDef",o.periodHeaders),t.R7$(1),t.Y8G("matHeaderRowDef",o.tableColumns),t.R7$(1),t.Y8G("matRowDefColumns",o.tableColumns),t.R7$(5),t.SpI(" ",t.bMT(47,29,"admin.dashboard.campaign_graph_description")," "),t.R7$(3),t.SpI(" ",o.selectedProductName," "),t.R7$(3),t.Y8G("gradient",!0)("legend",!0)("results",o.barChartData)("scheme",o.chartColorScheme)("showXAxisLabel",!0)("showYAxisLabel",!0)("xAxisLabel",t.bMT(53,31,"admin.reports.period"))("xAxis",!0)("yAxisLabel",t.bMT(54,33,"admin.reports.sales"))("yAxis",!0),t.R7$(7),t.E5c(" ",t.bMT(60,35,"admin.dashboard.before_sales"),": ",null==o.campaignDates?null:o.campaignDates.firstBeforeDate," / ",null==o.campaignDates?null:o.campaignDates.firstCampaignDate," "),t.R7$(5),t.E5c(" ",t.bMT(65,37,"admin.dashboard.during_sales"),": ",null==o.campaignDates?null:o.campaignDates.firstCampaignDate," / ",null==o.campaignDates?null:o.campaignDates.lastCampaignDate," "),t.R7$(2),t.Y8G("ngIf",o.showAfterColumns)}}
1function da(e,n){if(1&e){const o=t.RV6();t.j41(0,"div")(1,"div",2)(2,"mat-form-field",3)(3,"mat-label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"mat-select",4),t.bIt("valueChange",function(r){t.eBV(o);const c=t.XpG();return t.Njj(c.selectedDiscount=r)})("selectionChange",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.onDiscountChange())}),t.DNE(7,Ge,2,2,"mat-option",5),t.k0s()(),t.j41(8,"mat-form-field",3)(9,"mat-label"),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"mat-select",4),t.bIt("valueChange",function(r){t.eBV(o);const c=t.XpG();return t.Njj(c.selectedPricebook=r)})("selectionChange",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.onPricebookChange())}),t.DNE(13,je,2,2,"mat-option",5),t.k0s()()(),t.DNE(14,Be,4,2,"div",6),t.DNE(15,ca,67,39,"div",7),t.k0s()}if(2&e){const o=t.XpG();t.R7$(4),t.JRh(t.bMT(5,8,"admin.dashboard.select_discount")),t.R7$(2),t.Y8G("value",o.selectedDiscount),t.R7$(1),t.Y8G("ngForOf",o.discounts),t.R7$(3),t.JRh(t.bMT(11,10,"admin.dashboard.select_pricebook")),t.R7$(2),t.Y8G("value",o.selectedPricebook),t.R7$(1),t.Y8G("ngForOf",o.priceBooks),t.R7$(1),t.Y8G("ngIf",!o.selectedDiscount&&!o.selectedPricebook||0===o.campaignSalesData.length),t.R7$(1),t.Y8G("ngIf",o.campaignSalesData.length)}}function ma(e,n){1&e&&(t.j41(0,"div",70),t.nrm(1,"mat-spinner",71),t.k0s())}let ua=(()=>{var e;class n extends X.${constructor(a,r,c,m,b,v,P,F){super(a),this.cdk=a,this.shopService=r,this.snackbarService=c,this.shopInfoService=m,this.getDiscountsInteractor=b,this.getPricebooksInteractor=v,this.getCampaignSummaryInteractor=P,this.translateService=F,this.isLoading=!1,this.decimalPlacesFormat=new bt.PM,this.periodHeaders=["product","before","during","after"],this.tableColumns=["productName","beforeSales","beforeSalesPercent","duringSales"],this.discountActivityFilter=st.W$.ALL,this.discountContextFilter=[st.n1.REGULAR,st.n1.COUPON],this.discounts=[],this.priceBooks=[],this.selectedDiscount=null,this.selectedPricebook=null,this.campaignSalesData=[],this.selectedProductName="",this.barChartData=[],this.chartColorScheme={domain:Y.t1},this.campaignDates=null,this.showAfterColumns=!0,this.totalRow=null}ngOnInit(){this.isLoading=!0,this.addSubscription(this.shopInfoService.getGeneralInfo().subscribe(a=>{this.generalInfo=a,this.numberFormat=a.numberFormat,this.initData()}))}initData(){this.addSubscription((0,tt.z)([this.getDiscountsInteractor.execute(this.discountActivityFilter,this.discountContextFilter),this.getPricebooksInteractor.execute(this.generalInfo,Le.Lb.ALL,!0)]).subscribe(([a,r])=>{this.discounts=a,this.priceBooks=r,this.isLoading=!1,this.markForCheck()}))}onDiscountChange(){this.selectedDiscount&&(this.selectedPricebook=null,this.fetchCampaignSummary(it.DISCOUNT,this.selectedDiscount.id))}onPricebookChange(){this.selectedPricebook&&(this.selectedDiscount=null,this.fetchCampaignSummary(it.PRICEBOOK,this.selectedPricebook.id))}fetchCampaignSummary(a,r){this.isLoading=!0,this.addSubscription(this.getCampaignSummaryInteractor.execute(a,r).subscribe({next:c=>{if(c.lines&&0!==c.lines.length){const m=f()().format(I.Dd);this.campaignDates={firstBeforeDate:f()(c.dates.firstBeforeDate).format(I.Dd),firstCampaignDate:f()(c.dates.firstCampaignDate).format(I.Dd),lastCampaignDate:(f()(c.dates.lastCampaignDate).isBefore(f()(m))?f()(c.dates.lastCampaignDate):f()(m)).format(I.Dd),lastAfterDate:(f()(c.dates.lastCampaignDate).isBefore(f()(m))?f()(c.dates.lastAfterDate):f()(m)).format(I.Dd)},this.showAfterColumns=f()(m).isAfter(c.dates.lastCampaignDate),this.updateTableColumns(),this.processCampaignSummaryResponse(c)}else this.campaignSalesData=[],this.barChartData=[];this.isLoading=!1,this.markForCheck()},error:()=>{this.snackbarService.error("admin.dashboard.error_occurred"),this.isLoading=!1}}))}updateTableColumns(){this.tableColumns=["productName","beforeSales","beforeSalesPercent","duringSales"],this.periodHeaders=["product","before","during"],this.showAfterColumns&&(this.tableColumns.push("afterSales","afterSalesPercent"),this.periodHeaders.push("after"))}processCampaignSummaryResponse(a){const r=f()().format(I.Dd);if(this.campaignSalesData=a.lines.map(c=>({productId:c.productId,productName:c.productName,beforeSales:c.beforeSales,beforeSalesPercent:N.z.calculatePercent(c.beforeSales-c.duringSales,c.duringSales),duringSales:f(
1)(r).isBefore(this.campaignDates.firstCampaignDate)?0:c.duringSales,afterSales:this.showAfterColumns?c.afterSales:0,afterSalesPercent:this.showAfterColumns?N.z.calculatePercent(c.afterSales-c.duringSales,c.duringSales):0})),this.barChartData=[{name:this.translateService.instant("admin.dashboard.before_sales"),value:a.lines.reduce((c,m)=>c+m.beforeSales,0)},{name:this.translateService.instant("admin.dashboard.during_sales"),value:a.lines.reduce((c,m)=>c+(f()(r).isBefore(this.campaignDates.firstCampaignDate)?0:m.duringSales),0)},...this.showAfterColumns?[{name:this.translateService.instant("admin.dashboard.after_sales"),value:a.lines.reduce((c,m)=>c+m.afterSales,0)}]:[]],this.calculateTotals(),this.campaignSalesData.length>0){const c=this.campaignSalesData[this.campaignSalesData.length-1];this.selectedProductId=c.productId,this.selectedProductName=c.productName,this.updateSalesChart()}}calculateTotals(){if(!this.campaignSalesData.length)return void(this.totalRow=null);const a=this.campaignSalesData.reduce((m,b)=>m+(b.beforeSales||0),0),r=this.campaignSalesData.reduce((m,b)=>m+(b.duringSales||0),0),c=this.showAfterColumns?this.campaignSalesData.reduce((m,b)=>m+(b.afterSales||0),0):null;this.totalRow={productId:"total",productName:this.translateService.instant("admin.reports.total"),beforeSales:a,beforeSalesPercent:r>0?N.z.calculatePercent(a-r,r):null,duringSales:r,afterSales:c,afterSalesPercent:this.showAfterColumns&&r>0?N.z.calculatePercent(c-r,r):null},this.campaignSalesData.push(this.totalRow)}onProductSelect(a){this.selectedProductId=a.productId,this.updateSalesChart()}updateSalesChart(){if(!this.selectedProductId||!this.campaignDates)return;const a=f()().format(I.Dd),r=this.campaignSalesData.find(P=>P.productId===this.selectedProductId);if(!r)return;const{productName:c,beforeSales:m,duringSales:b,afterSales:v}=r;this.selectedProductName=c,this.barChartData=[{name:this.translateService.instant("admin.dashboard.before_sales"),value:m},{name:this.translateService.instant("admin.dashboard.during_sales"),value:f()(a).isBefore(this.campaignDates.firstCampaignDate)?0:b},...this.showAfterColumns?[{name:this.translateService.instant("admin.dashboard.after_sales"),value:v}]:[]]}}return(e=n).\u0275fac=function(a){return new(a||e)(t.rXU(t.gRc),t.rXU(St.L),t.rXU(H.z),t.rXU(Z.W),t.rXU(Mt.s),t.rXU(kt.B),t.rXU(Ot),t.rXU(d.c$))},e.\u0275cmp=t.VBU({type:e,selectors:[["webshop-campaigns"]],features:[t.Vt3],decls:2,vars:2,consts:[[4,"ngIf"],["class","loading-overlay",4,"ngIf"],[1,"dropdown-container"],["appearance","fill"],[3,"value","valueChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["class","col-12 px-3 py-5 text-center d-flex align-items-center justify-content-center font-medium-4 bg-white",4,"ngIf"],["class","grid-container gap-3 mb-3",4,"ngIf"],[3,"value"],[1,"col-12","px-3","py-5","text-center","d-flex","align-items-center","justify-content-center","font-medium-4","bg-white"],["class","text-danger bold",4,"ngIf","ngIfElse"],["noData",""],[1,"text-danger","bold"],[1,"grid-container","gap-3","mb-3"],[1,"g-col-12","g-col-lg-7"],[1,"w-100","h-100","mat-elevation-z0","chart-rounded","pb-4"],[1,"mb-4","font-medium-2","text-center"],[1,"font-medium-1","text-center"],[1,"table-container"],["mat-table","",1,"w-100","overflow-y-auto",3,"dataSource"],["matColumnDef","productName"],["mat-header-cell","","class","border-right",4,"matHeaderCellDef"],["mat-cell","","class","fw-bold border-right",4,"matCellDef"],["matColumnDef","beforeSales"],["mat-header-cell","","class","text-right border-left",4,"matHeaderCellDef"],["mat-cell","","class","text-right border-left",4,"matCellDef"],["matColumnDef","beforeSalesPercent"],["mat-header-cell","","class","text-right border-right",4,"matHeaderCellDef"],["mat-cell","","class","text-right border-right",3,"success","warning",4,"matCellDef"],["matColumnDef","duringSales"],["mat-header-cell","","class","text-center border-left",4,"matHeaderCellDef"],["mat-cell","","class","text-center border-left",4,"matCellDef"],["matColumnDef","afterSales"],["matColumnDef","afterSalesPercent"],["mat-header-cell","","class","text-right",4,"matHeaderCellDef"],["mat-cell","","class","text-right",3,"success","warning",4,"matCellDef"],["matColumnDef","product"],["mat-header-cell","","class","text-center border-right",4,"matHeaderCellDef"],["matColumnDef","before"],["mat-header-cell","","class","text-center border-left border-right",4,"matHeaderCellDef"],["matColumnDef","during"],["matColumnDef","after"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","clickable-row",3,"selected-row","total-row","click",4,"matRowDef","matRowDefColumns"],[1,"g-col-12","g-col-lg-5"],[1,"font-medium-2","text-center"],[1,"font-medium-1","text-center","chart
1-title"],[1,"chart-container"],["legendPosition","below","legendTitle","",1,"mw-100","w-100","h-100",3,"gradient","legend","results","scheme","showXAxisLabel","showYAxisLabel","xAxisLabel","xAxis","yAxisLabel","yAxis"],[1,"custom-legend","mt-3"],[1,"legend-item"],[1,"legend-color-box","before-sales"],[1,"legend-label"],[1,"legend-color-box","during-sales"],["class","legend-item",4,"ngIf"],["mat-header-cell","",1,"border-right"],["mat-cell","",1,"fw-bold","border-right"],["mat-header-cell","",1,"text-right","border-left"],["mat-cell","",1,"text-right","border-left"],["mat-header-cell","",1,"text-right","border-right"],["mat-cell","",1,"text-right","border-right"],["mat-header-cell","",1,"text-center","border-left"],["mat-cell","",1,"text-center","border-left"],["mat-header-cell","",1,"text-right"],["mat-cell","",1,"text-right"],["mat-header-cell","",1,"text-center","border-right"],["mat-header-cell","",1,"text-center","border-left","border-right"],["mat-header-row",""],["mat-row","",1,"clickable-row",3,"click"],[1,"legend-color-box","after-sales"],[1,"loading-overlay"],["color","accent"]],template:function(a,r){1&a&&(t.DNE(0,da,16,12,"div",0),t.DNE(1,ma,2,0,"div",1)),2&a&&(t.Y8G("ngIf",!r.isLoading),t.R7$(1),t.Y8G("ngIf",r.isLoading))},dependencies:[p.Sq,p.bT,C.LG,u.RN,u.m2,u.dh,i.Zl,i.tL,i.ji,i.cC,i.YV,i.iL,i.KS,i.$R,i.YZ,i.NB,At.rl,At.nJ,Lt.VO,$e.wT,x.L8,d.D9],styles:[".dropdown-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:16px;margin:5px}.selected-row[_ngcontent-%COMP%]{background-color:#f5f5f5}.table-container[_ngcontent-%COMP%]{max-height:500px;overflow-y:auto}table[_ngcontent-%COMP%]{width:100%;min-width:600px}.chart-title[_ngcontent-%COMP%]{text-align:center;font-size:1.8rem;font-weight:700;margin-bottom:1rem}.chart-container[_ngcontent-%COMP%]{width:100%;height:400px;overflow:hidden;display:flex;justify-content:center;align-items:center}.border-right[_ngcontent-%COMP%]{border-right:.5px solid var(--bs-gray-600)}.border-left[_ngcontent-%COMP%]{border-left:.5px solid var(--bs-gray-600)}.custom-legend[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin-top:16px}.custom-legend[_ngcontent-%COMP%]   .legend-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.custom-legend[_ngcontent-%COMP%]   .legend-item[_ngcontent-%COMP%]   .legend-color-box[_ngcontent-%COMP%]{width:16px;height:16px;border-radius:4px}.custom-legend[_ngcontent-%COMP%]   .legend-item[_ngcontent-%COMP%]   .legend-label[_ngcontent-%COMP%]{font-size:.9rem;color:var(--bs-gray-800)}.before-sales[_ngcontent-%COMP%]{background-color:#80b2c9}.during-sales[_ngcontent-%COMP%]{background-color:#cda8a8}.after-sales[_ngcontent-%COMP%]{background-color:#acc9c1}.total-row[_ngcontent-%COMP%]{font-weight:700;background-color:var(--bs-gray-300)}"]}),n})();function ha(e,n){if(1&e){const o=t.RV6();t.j41(0,"div",16)(1,"div",17)(2,"webshop-shop-selector",18),t.bIt("selectedShopChangedEventEmitter",function(r){t.eBV(o);const c=t.XpG(2);return t.Njj(c.selectedShopChange(r))}),t.k0s()()()}if(2&e){const o=t.XpG(2);t.R7$(2),t.Y8G("shops",o.filters.shops)("allShops",o.generalInfo.shops)("multipleShopSelection",!1)}}function pa(e,n){if(1&e){const o=t.RV6();t.j41(0,"a",7),t.bIt("click",function(){t.eBV(o);const r=t.XpG(2);return t.Njj(r.activeTabChange(r.DashboardTab.SHOP_SALES))}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&e){const o=t.XpG(2);t.AVh("active-tab",o.currentTab===o.DashboardTab.SHOP_SALES),t.R7$(1),t.SpI(" ",t.bMT(2,3,"admin.dashboard.sales_by_shop")," ")}}function ga(e,n){if(1&e&&(t.j41(0,"div",45),t.nrm(1,"webshop-report-widget",46),t.k0s()),2&e){const o=n.$implicit;t.R7$(1),t.Y8G("widgetData",o.value)}}function _a(e,n){if(1&e&&(t.j41(0,"div",43),t.DNE(1,ga,2,1,"div",44),t.nI1(2,"keyvalue"),t.k0s()),2&e){const o=t.XpG(3);t.R7$(1),t.Y8G("ngForOf",t.i5U(2,1,o.cardsReportDataWidgets,o.returnZero))}}function fa(e,n){if(1&e&&t.nrm(0,"webshop-dashboard-card-1",33),2&e){const o=t.XpG(3);t.Y8G("title","admin.dashboard.turnover")("subtitle","admin.dashboard.today")("value",o.dashboard.total)("numberFormat",o.numberFormat)("currency",o.currency)}}function ba(e,n){if(1&e&&t.nrm(0,"webshop-dashboard-card-1",47),2&e){const o=t.XpG(3);t.Y8G("title","admin.dashboard.saved_tables_orders")("value",o.dashboard.totalParkedOrders
1)("numberFormat",o.numberFormat)}}function Ca(e,n){if(1&e&&(t.j41(0,"div",48)(1,"div",49)(2,"div",50),t.EFF(3),t.k0s(),t.j41(4,"div",51),t.EFF(5),t.nI1(6,"numFormat"),t.k0s()(),t.j41(7,"div",48),t.nrm(8,"webshop-progress-bar",52),t.k0s()()),2&e){const o=n.$implicit,a=t.XpG(3);t.R7$(3),t.SpI(" ",o.productName," "),t.R7$(2),t.Lme(" ",t.i5U(6,6,o.amount,a.numberFormat)," ",a.currency," "),t.R7$(3),t.Y8G("percent",o.percentFromTotal)("backgroundColor","var(--admin-primary-light)")("progressBarColor","var(--admin-primary-light)")}}const lt=function(){return{x:10}};function va(e,n){if(1&e&&(t.j41(0,"div",19),t.DNE(1,_a,3,4,"div",20),t.j41(2,"div",16)(3,"div",21)(4,"div",22)(5,"div")(6,"div",23),t.EFF(7),t.nI1(8,"translate"),t.nI1(9,"numFormat"),t.k0s(),t.j41(10,"div",23),t.EFF(11),t.nI1(12,"translate"),t.nI1(13,"numFormat"),t.k0s(),t.j41(14,"div",24),t.EFF(15),t.nI1(16,"translate"),t.k0s()(),t.j41(17,"div",25)(18,"div",26),t.nrm(19,"ngx-charts-pie-chart",27),t.k0s()()()(),t.j41(20,"div",28)(21,"div",29),t.DNE(22,fa,1,5,"webshop-dashboard-card-1",30),t.DNE(23,ba,1,3,"webshop-dashboard-card-1",31),t.k0s(),t.j41(24,"div",32),t.nrm(25,"webshop-dashboard-card-1",33),t.k0s(),t.j41(26,"div",32),t.nrm(27,"webshop-dashboard-card-1",34),t.k0s(),t.j41(28,"div",32),t.nrm(29,"webshop-dashboard-card-1",35),t.k0s(),t.j41(30,"div",32),t.nrm(31,"webshop-dashboard-card-1",35),t.k0s(),t.j41(32,"div",32),t.nrm(33,"webshop-dashboard-card-1",36),t.k0s(),t.j41(34,"div",32),t.nrm(35,"webshop-dashboard-card-1",36),t.k0s()(),t.j41(36,"div",21)(37,"div",37)(38,"div")(39,"div",23),t.EFF(40),t.nI1(41,"translate"),t.k0s(),t.j41(42,"div",24),t.EFF(43),t.nI1(44,"translate"),t.k0s()(),t.j41(45,"div",38),t.DNE(46,Ca,9,9,"div",39),t.k0s()()()(),t.j41(47,"div",16)(48,"div",40)(49,"div",22)(50,"div")(51,"div",23),t.EFF(52),t.nI1(53,"translate"),t.k0s(),t.j41(54,"div",24),t.EFF(55),t.nI1(56,"translate"),t.k0s()(),t.j41(57,"div",25)(58,"div",26),t.nrm(59,"ngx-charts-area-chart",41),t.nI1(60,"translate"),t.nI1(61,"translate"),t.k0s()()()(),t.j41(62,"div",40)(63,"div",22)(64,"div")(65,"div",23),t.EFF(66),t.nI1(67,"translate"),t.k0s(),t.j41(68,"div",24),t.EFF(69),t.nI1(70,"translate"),t.k0s()(),t.j41(71,"div",25)(72,"div",26),t.nrm(73,"ngx-charts-pie-chart",42),t.k0s()()()()()()),2&e){const o=t.XpG(2);t.R7$(1),t.Y8G("ngIf",o.cardsReportDataWidgets),t.R7$(6),t.E5c(" ",t.bMT(8,69,"admin.dashboard.contribution_amount")," : ",t.i5U(9,71,o.dashboard.contributionMargin,o.numberFormat)," ",o.currency," "),t.R7$(4),t.E5c(" ",t.bMT(12,74,"admin.dashboard.cost_amount")," : ",t.i5U(13,76,o.dashboard.totalCost,o.numberFormat)," ",o.currency," "),t.R7$(4),t.SpI(" ",t.bMT(16,79,"admin.dashboard.today")," "),t.R7$(4),t.Y8G("results",o.turnoverPieData)("customColors",o.turnoverPieChartColorScheme)("labels",!1)("doughnut",!0)("gradient",!0)("animations",!0),t.R7$(3),t.Y8G("ngIf",!(null!=o.generalInfo&&o.generalInfo.isRestaurant)),t.R7$(1),t.Y8G("ngIf",null==o.generalInfo?null:o.generalInfo.isRestaurant),t.R7$(2),t.Y8G("title","admin.dashboard.average_sales_per_order")("subtitle","admin.dashboard.today")("value",o.dashboard.avgSalesPerOrder)("numberFormat",o.numberFormat)("currency",o.currency),t.R7$(2),t.Y8G("title","admin.dashboard.contribution_margin_ratio")("subtitle","admin.dashboard.today")("value",o.dashboard.contributionMarginRatio)("numberFormat",o.numberFormat)("isPercent",!0),t.R7$(2),t.Y8G("title","admin.dashboard.number_of_sales")("subtitle","admin.dashboard.today")("value",o.dashboard.orderCount),t.R7$(2),t.Y8G("title","admin.dashboard.number_of_refunds")("subtitle","admin.dashboard.today")("value",o.dashboard.refundsCount),t.R7$(2),t.Y8G("title","admin.dashboard.number_of_products")("subtitle","admin.dashboard.today")("value",o.dashboard.productCount)("numberFormat",o.numberFormat),t.R7$(2),t.Y8G("title","admin.dashboard.average_products_per_order")("subtitle","admin.dashboard.today")("value",o.dashboard.avgProductsPerOrder)("numberFormat",o.numberFormat),t.R7$(5),t.SpI(" ",t.i5U(41,81,"admin.dashboard.top_x_products",t.lJ4(99,lt))," "),t.R7$(3),t.SpI(" ",t.bMT(44,84,"admin.dashboard.today")," "),t.R7$(3),t.Y8G("ngForOf",o.dashboard.top10ProductSales),t.R7$(6),t.SpI(" ",t.bMT(53,86,"admin.dashboard.sales_per_hour")," "),t.R7$(3),t.SpI(" ",t.bMT(56,88,"admin.dashboard.today")," "),t.R7$(4),t.Y8G("results",o.dashboard.salesByHour)("legend",!1)("animations",!0)("showGridLines",!0)("showXAxisLabel",!0)("xAxis",!0)("xAxisLabel",t.bMT(60,90,"admin.reports.time"))("showYAxisLabel",!0)("yAxis",!0)("yAxisLabel",t.bMT(61,92,"admin.reports.sales"))("timeline",!0)("gradient",!0),t.R7$(7),t.SpI(" ",t.i5U(67,94,"admin.dashboard.top_x_categories",t.lJ4(100,lt))," "),t.R7$(3),t.SpI(" ",t.bMT(70,97,"admin.dashboard.today")," "),t.R7$(4),t.Y8G("results",o.categoriesSalesPieData)("customColors",o.categoresPieChartColorScheme)("labels",!1)("legendTitle","")("legend",!0)("legendPosition",o.LegendPosition.Right)("explodeSlices",!0)("doughnut",!0)("gradient",!0)("animations",!0)}}function Da(e,n){1&e&&(t.j41(0,"th",73),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.date_table_header")," "))}function ya(e,n){if(1&e&&(t.j41(0,"td",74),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",a.formatDayOfWeek(o.dateTime)," ")}}function Sa(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.gross_
1sale_table_header")," "))}function xa(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.amount.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function Ia(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.last_year_gross_sale_table_header")," "))}function Ra(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.lastYearAmount?o.lastYearAmount.toLocaleString(a.numberFormat,a.decimalPlacesFormat):0," ")}}function Fa(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.vat_amount_table_header")," "))}function Ea(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.vatAmount.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function Pa(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.last_year_vat_amount_table_header")," "))}function Ta(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.lastYearVatAmount?o.lastYearVatAmount.toLocaleString(a.numberFormat,a.decimalPlacesFormat):0," ")}}function Ma(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.discount_amount_table_header")," "))}function ka(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.discountAmount.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function Ya(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.last_year_discount_amount_table_header")," "))}function Oa(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.lastYearDiscountAmount?o.lastYearDiscountAmount.toLocaleString(a.numberFormat,a.decimalPlacesFormat):0," ")}}function Aa(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.quantity_table_header")," "))}function La(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.productsQuantity.toLocaleString(a.numberFormat,a.decimalPlacesFormat)," ")}}function $a(e,n){1&e&&(t.j41(0,"th",75),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&e&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"admin.reports.last_year_products_qty_table_header")," "))}function Ga(e,n){if(1&e&&(t.j41(0,"td",76),t.EFF(1),t.k0s()),2&e){const o=n.$implicit,a=t.XpG(4);t.R7$(1),t.SpI(" ",o.lastYearProductsQuantity?o.lastYearProductsQuantity.toLocaleString(a.numberFormat,a.decimalPlacesFormat):0," ")}}function ja(e,n){1&e&&t.nrm(0,"tr",77)}function wa(e,n){1&e&&t.nrm(0,"tr",78)}function Na(e,n){if(1&e&&(t.j41(0,"div",16)(1,"div",40)(2,"div",53)(3,"table",54),t.qex(4,55),t.DNE(5,Da,3,3,"th",56),t.DNE(6,ya,2,1,"td",57),t.bVm(),t.qex(7,58),t.DNE(8,Sa,3,3,"th",59),t.DNE(9,xa,2,1,"td",60),t.bVm(),t.qex(10,61),t.DNE(11,Ia,3,3,"th",59),t.DNE(12,Ra,2,1,"td",60),t.bVm(),t.qex(13,62),t.DNE(14,Fa,3,3,"th",59),t.DNE(15,Ea,2,1,"td",60),t.bVm(),t.qex(16,63),t.DNE(17,Pa,3,3,"th",59),t.DNE(18,Ta,2,1,"td",60),t.bVm(),t.qex(19,64),t.DNE(20,Ma,3,3,"th",59),t.DNE(21,ka,2,1,"td",60),t.bVm(),t.qex(22,65),t.DNE(23,Ya,3,3,"th",59),t.DNE(24,Oa,2,1,"td",60),t.bVm(),t.qex(25,66),t.DNE(26,Aa,3,3,"th",59),t.DNE(27,La,2,1,"td",60),t.bVm(),t.qex(28,67),t.DNE(29,$a,3,3,"th",59),t.DNE(30,Ga,2,1,"td",60),t.bVm(),t.DNE(31,ja,1,0,"tr",68),t.DNE(32,wa,1,0,"tr",69),t.k0s()()(),t.j41(33,"div",40)(34,"mat-card",70)(35,"mat-card-content",71),t.nrm(36,"ngx-charts-line-chart",72),t.nI1(37,"translate"),t.nI1(38,"translate"),t.k0s()()()()),2&e){const o=t.XpG(3);t.R7$(3),t.Y8G("dataSource",o.lastXDaysSalesTableData),t.R7$(28),t.Y8G("matHeaderRowDef",o.lastXDaysSalesTableColumns),t.R7$(1),t.Y8G("matRowDefColumns",o.lastXDaysSalesTableColumns),t.R7$(4),t.Y8G("scheme",o.xDaySalesChartColorScheme)("results",o.xDaySalesChartData)("gradient",!1)("xAxis",!0)("yAxis",!0)("legend",!0)("autoScale",!1)("showXAxisLabel",!0)("showYAxisLabel",!1)("xAxisLabel",t.bMT(37,15,"admin.reports.date"))("yAxisLabel",t.bMT(38,17,"admin.reports.sales"))("animations",!0)}}function Ba(e,n){if(1&e&&(t.j41(0,"div",19),t.DNE(1,Na,39,19,"div",3),t.k0s()),2&e){const o=t.XpG(2);t.R7$(1),t.Y8G("ngIf",!(null==o.lastXDaysSales||!o.lastXDaysSales.length))}}function Xa(e,n){if(1&e&&(t.j41(0,"div",19)(1,"div",25),t.nrm(2,"webshop-kpr-summary",79),t.k0s()()),2&e){const o=t.XpG(2);
1t.R7$(2),t.Y8G("shopId",null==o.filters[0]?null:o.filters[0].shopId)}}function Va(e,n){1&e&&(t.j41(0,"div",19)(1,"div",25),t.nrm(2,"webshop-category-sum",80),t.k0s()())}function Ua(e,n){1&e&&(t.j41(0,"div",19),t.nrm(1,"webshop-shop-sales-budget",80),t.k0s())}function Ka(e,n){1&e&&(t.j41(0,"div",19),t.nrm(1,"webshop-campaigns",80),t.k0s())}function Ha(e,n){if(1&e){const o=t.RV6();t.j41(0,"div",2),t.DNE(1,ha,3,3,"div",3),t.j41(2,"div",4)(3,"div",5)(4,"nav",6)(5,"a",7),t.bIt("click",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.activeTabChange(r.DashboardTab.TODAY))}),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"a",7),t.bIt("click",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.activeTabChange(r.DashboardTab.X_DAY_SALES))}),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"a",7),t.bIt("click",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.activeTabChange(r.DashboardTab.KPR_SUMMARY))}),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"a",7),t.bIt("click",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.activeTabChange(r.DashboardTab.CATEGORY_SALES))}),t.EFF(15),t.nI1(16,"translate"),t.k0s(),t.DNE(17,pa,3,5,"a",8),t.j41(18,"button",9)(19,"mat-icon",10),t.EFF(20,"more_vert"),t.k0s()(),t.j41(21,"mat-menu",null,11)(23,"button",12),t.bIt("click",function(){t.eBV(o);const r=t.XpG();return t.Njj(r.activeTabChange(r.DashboardTab.CAMPAIGNS))}),t.j41(24,"mat-icon"),t.EFF(25,"campaign"),t.k0s(),t.j41(26,"span"),t.EFF(27),t.nI1(28,"translate"),t.k0s()()()(),t.j41(29,"div",13,14),t.DNE(31,va,74,101,"div",15),t.DNE(32,Ba,2,1,"div",15),t.DNE(33,Xa,3,1,"div",15),t.DNE(34,Va,3,0,"div",15),t.DNE(35,Ua,2,0,"div",15),t.DNE(36,Ka,2,0,"div",15),t.k0s()()()()}if(2&e){const o=t.sdS(22),a=t.sdS(30),r=t.XpG();t.R7$(1),t.Y8G("ngIf",(null==r.generalInfo||null==r.generalInfo.shops?null:r.generalInfo.shops.length)>1&&r.currentTab!==r.DashboardTab.SHOP_SALES),t.R7$(3),t.Y8G("tabPanel",a),t.R7$(1),t.AVh("active-tab",r.currentTab===r.DashboardTab.TODAY),t.R7$(1),t.SpI(" ",t.bMT(7,23,"admin.dashboard.today")," "),t.R7$(2),t.AVh("active-tab",r.currentTab===r.DashboardTab.X_DAY_SALES),t.R7$(1),t.SpI(" ",t.i5U(10,25,"admin.dashboard.x_day_sales",t.lJ4(34,lt))," "),t.R7$(2),t.AVh("active-tab",r.currentTab===r.DashboardTab.KPR_SUMMARY),t.R7$(1),t.SpI(" ",t.bMT(13,28,"admin.dashboard.summary")," "),t.R7$(2),t.AVh("active-tab",r.currentTab===r.DashboardTab.CATEGORY_SALES),t.R7$(1),t.SpI(" ",t.bMT(16,30,"admin.dashboard.sales_by_category")," "),t.R7$(2),t.Y8G("ngIf",(null==r.generalInfo||null==r.generalInfo.shops?null:r.generalInfo.shops.length)>1),t.R7$(1),t.Y8G("matMenuTriggerFor",o),t.R7$(9),t.JRh(t.bMT(28,32,"admin.dashboard.campaigns")),t.R7$(4),t.Y8G("ngIf",r.currentTab===r.DashboardTab.TODAY),t.R7$(1),t.Y8G("ngIf",r.currentTab===r.DashboardTab.X_DAY_SALES),t.R7$(1),t.Y8G("ngIf",r.currentTab===r.DashboardTab.KPR_SUMMARY),t.R7$(1),t.Y8G("ngIf",r.currentTab===r.DashboardTab.CATEGORY_SALES),t.R7$(1),t.Y8G("ngIf",r.currentTab===r.DashboardTab.SHOP_SALES),t.R7$(1),t.Y8G("ngIf",r.currentTab===r.DashboardTab.CAMPAIGNS)}}function Wa(e,n){1&e&&(t.j41(0,"div",81),t.nrm(1,"mat-spinner",82),t.k0s())}var ct=function(e){return e[e.TODAY=0]="TODAY",e[e.X_DAY_SALES=1]="X_DAY_SALES",e[e.KPR_SUMMARY=2]="KPR_SUMMARY",e[e.CATEGORY_SALES=3]="CATEGORY_SALES",e[e.SHOP_SALES=4]="SHOP_SALES",e[e.CAMPAIGNS=5]="CAMPAIGNS",e}(ct||{});const za=[{path:"",component:(()=>{var e;class n extends X.${constructor(a,r,c,m,b,v,P,F,S){super(S),this.deviceInfoService=a,this.snackbarService=r,this.shopInfoService=c,this.getPosSettingsInteractor=m,this.getDashboardInfoInteractor=b,this.getLastXDaysSales=v,this.adminPanelService=P,this.translateService=F,this.cdk=S,this.LegendPosition=x.PA,this.currency="NOK",this.decimalPlacesFormat=new bt.PM,this.filters={fromDate:f()().format(I.nk),toDate:f()().format(I.nk),source:J.kc.ANY,saleType:Wt.GV.Sale},this.DashboardTab=ct,this.currentTab=ct.TODAY,this.cardsReportDataWidgets={},this.lastXDaysSales=[],this.lastXDaysSalesTableData=[],this.lastXDaysSalesTableColumns=["date","amount","lasyYearAmount","productsQuantity","lastYearProductsQuantity"],this.turnoverPieData=[],this.turnoverPieChartColorScheme={domain:["var(--default-warn)","var(--default-success)"]},this.categoriesSalesPieData=[],this.categoresPieChartColorScheme={domain:[Y.t1[0],Y.t1[1]]},this.xDaySalesChartColorScheme={domain:Y.t1},this.xDaySalesChartData=[],this.adminPanelService.setCurrentRouteInfo("admin.dashboard.title","dashboard")}ngOnInit(){this.isLoading=!0,this.markForCheck(),this.addSubscription((0,tt.z)([this.shopInfoService.getGeneralInfo(),this.shopInfoService.getShopInfo(),this.getPosSettingsInteractor.execute()]).subscribe(([a,r,c])=>{this.generalInfo=a,this.useParkOnServer=c.parkOnServer,this.currency=r.currency,this.numberFormat=a.numberFormat,this.dateFormat=a.dateFormat,this.filters.allShops=a.shops,this.filters.shops=[a.shops[0].shopNo],this.markForCheck(),this.detectChanges(),this.loadData()})),this.addSubscription(this.deviceInfoService.getIsHandset$().subscribe(a=>{this.isHandset=a,this.markForCheck()}))}loadData(){this.isLoading=!0,this.markForCheck(),this.addSubscription((0,tt.z)([this.getDashboardInfoInteractor.execute(this.filters),this.getLastXD
1aysSales.execute(this.filters.shops[0],10)]).subscribe({next:([a,r])=>{var c;this.lastXDaysSales=r,this.dashboard=a,this.turnoverPieData.push({name:this.translateService.instant("admin.dashboard.cost_amount"),value:this.dashboard.totalCost}),this.turnoverPieData.push({name:this.translateService.instant("admin.dashboard.contribution_amount"),value:this.dashboard.contributionMargin}),null===(c=this.dashboard.top10CategorySales)||void 0===c||c.forEach(m=>{var b;const v=m.categoryName+" "+(null===(b=m.percentFromTotal)||void 0===b?void 0:b.toFixed(2))+"%";this.categoriesSalesPieData.push({name:v,value:m.amount})}),this.fillCardsData(),this.fillXDaysSalesChartData(),this.isLoading=!1,this.markForCheck()},error:a=>{console.log("Error on getting data in dashboard",a),this.snackbarService.error("loading_error")}}))}selectedShopChange(a){this.filters.shops=a,this.loadData()}fillCardsData(){const a={currency:this.currency,numberFormat:this.numberFormat,textColor:"white",appearance:"fill"};this.cardsReportDataWidgets={todayTurnover:{...a,title:"admin.dashboard.turnover_today",value:this.dashboard.total,color:"#6d9f92"},yesterdayTurnover:{...a,title:"admin.dashboard.turnover_yesterday",value:this.dashboard.totalYesterday,color:"#8baeb7"},monthTurnover:{...a,title:"admin.dashboard.turnover_this_month",value:this.dashboard.totalCurrentMonth,color:"#9b8265"},yearTurnover:{...a,title:"admin.dashboard.turnover_this_year",value:this.dashboard.totalCurrentYear,color:"#847484"}}}fillXDaysSalesChartData(){const a={name:this.translateService.instant("admin.reports.last_year_sales"),series:[]},r={name:this.translateService.instant("admin.reports.this_year_sales"),series:[]};this.lastXDaysSales.forEach(c=>{const m=this.formatDayOfWeek(c.dateTime);a.series.push({name:m,value:c.lastYearAmount||0}),r.series.push({name:m,value:c.amount||0})}),this.lastXDaysSalesTableData=this.lastXDaysSales.reverse(),this.xDaySalesChartData=[r,a],this.markForCheck()}formatDayOfWeek(a){return f()(a,I.lS).format(I.GP)}activeTabChange(a){this.currentTab=a,this.markForCheck()}}return(e=n).\u0275fac=function(a){return new(a||e)(t.rXU(zt.E),t.rXU(H.z),t.rXU(Z.W),t.rXU(Ct.r),t.rXU(vt.k),t.rXU(Dt),t.rXU(Qt.f),t.rXU(d.c$),t.rXU(t.gRc))},e.\u0275cmp=t.VBU({type:e,selectors:[["webshop-dashboard"]],features:[t.Vt3],decls:2,vars:2,consts:[["class","m-3",4,"ngIf"],["class","loading-overlay",4,"ngIf"],[1,"m-3"],["class","grid-container gap-3 mb-3",4,"ngIf"],[1,"d-flex","mb-3"],[1,"col-12"],["mat-tab-nav-bar","","color","accent",1,"mw-100","mb-2",2,"background","white","flex-grow","1",3,"tabPanel"],["mat-tab-link","",3,"click"],["mat-tab-link","",3,"active-tab","click",4,"ngIf"],["mat-stroked-button","",1,"with-icon",2,"height","auto",3,"matMenuTriggerFor"],[1,"m-1"],["menu","matMenu"],["mat-menu-item","",3,"click"],[1,"mw-100","w-100","mh-100"],["tabPanel",""],["class","mw-100 w-100 mh-100 h-100",4,"ngIf"],[1,"grid-container","gap-3","mb-3"],[1,"g-col-12","g-col-lg-4"],[3,"shops","allShops","multipleShopSelection","selectedShopChangedEventEmitter"],[1,"mw-100","w-100","mh-100","h-100"],["class","row gap-3 m-auto mb-3 w-100",4,"ngIf"],[1,"g-col-12","g-col-lg-3"],[1,"dashboard-card"],[1,""],[1,"text-black-50"],[1,"h-100"],[2,"max-height","330px"],[1,"mw-100","w-100","h-100",3,"results","customColors","labels","doughnut","gradient","animations"],[1,"g-col-12","g-col-lg-6","grid-container","gap-3"],[1,"g-col-6","dashboard-card"],[3,"title","subtitle","value","numberFormat","currency",4,"ngIf"],[3,"title","value","numberFormat",4,"ngIf"],[1,"g-col-3","dashboard-card"],[3,"title","subtitle","value","numberFormat","currency"],[3,"title","subtitle","value","numberFormat","isPercent"],[3,"title","subtitle","value"],[3,"title","subtitle","value","numberFormat"],[1,"dashboard-card","h-100"],[1,"d-flex","flex-column","gap-3","my-3"],["class","w-100",4,"ngFor","ngForOf"],[1,"g-col-12","g-col-lg-6"],[3,"results","legend","animations","showGridLines","showXAxisLabel","xAxis","xAxisLabel","showYAxisLabel","yAxis","yAxisLabel","timeline","gradient"],[1,"mw-100","w-100","h-100",3,"results","customColors","labels","legendTitle","legend","legendPosition","explodeSlices","doughnut","gradient","animations"],[1,"row","gap-3","m-auto","mb-3","w-100"],["class","col-md p-0",4,"ngFor","ngForOf"],[1,"col-md","p-0"],[3,"widgetData"],[3,"title","value","numberFormat"],[1,"w-100"],[1,"align-items-end","d-flex","justify-content-between","w-100"],[1,"col-8"],[1,"col","text-center","font-small-4"],[1,"w-100",3,"percent","backgroundColor","progressBarColor"],[1,"d-flex","overflow-y-hidden"],["mat-table","",1,"w-100","overflow-y-auto",3,"dataSource"],["matColumnDef","date","sticky","sticky"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","amount"],["mat-header-cell","","class","text-end",4,"matHeaderCellDef"],["mat-cell","","class","text-end",4,"matCellDef"],["matColumnDef","lasyYearAmount"],["matColumnDef","vatAmount"],["matColumnDef","lastYearVatAmount"],["matColumnDef","discountAmount"],["matColumnDef","lastYeatDiscountAmount"],["matColumnDef","productsQuantity"],["matColumnDef","lastYearProductsQuantity"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"w-100","h-100","mat-elevation-z0","chart-rounded","pb-4"],[2,"height","95%"],["legendPosition","below","legendTitle","",3,"scheme","results","gradient","xAxis","yAxis","legend","autoScale","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","animations"],["mat-header-cell",""],["mat-cell",""],["mat-header-cell","",1,"text-end"],["mat-cell","",1,"text-end"],["mat-header-row",""],["mat-row",""],[1,"w-100","h-100",3,"shopId"],[1,"w-100","h-100"],[1,"loading-overlay"],["color","accent"]],template:function(a,r){1&a&&(t.DNE(0,Ha,37,35,"div",0),t.DNE(1,Wa,2,0,"div",1)),2&a&&(t.Y8G("ngIf",!r.isLoading),t.R7$(1),t.Y8G("ngIf",r.isLoading))},dependencies:[p.Sq,p.bT,i.Zl,i.tL,i.ji,i.cC,i.YV,i.iL,i.KS,i.$R,i.YZ,i.NB,C.LG,u.RN,u.m2,yt.$z,g.An,x.X4,x.Il,x.km,Et,oe.a,re,nt.Bu,nt.Ql,q.kk,q.fb,q.Cp,de,me.Q,ue.F,Ae,ua,p.lG,d.D9,rt.N],styles:[".dashboard-card[_ngcontent-%COMP%]{border-radius:5px;background-color:#fff;padding:1rem}[_nghost-%COMP%]  ul.legend-labels.horizontal-legend{display:flex;justify-content:center;align-items:center;background:transparent}[_nghost-%COMP%]  .mat-form-field-appearance-fill .mat-form-field-flex{background-color:#fff}[_nghost-%COMP%]  .rounded-card{border-radius:15px!important}[_nghost-%COMP%]  .chart-legend .legend-label-text{white-space:normal!important}"],changeDetection:0}),n})()}];let Qa=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({imports:[A.iI.forChild(za),A.iI]}),n})(),Ja=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({imports:[p.MD,d.h,K.d,K.d]}),n})(),Za=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({providers:[j,Tt],imports:[p.MD,d.h,A.iI,_t.C,gt.kg,_.mz,G.YN,x.dV,C.D6,u.Hu,Q.H]}),n})();var qa=s(86087),to=s(57283);let eo=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({providers:[j,z],imports:[p.MD,d.h,A.iI,C.D6,u.Hu,Q.H,i.tP,
1K.d,g.m_,U.wG,ft]}),n})();var ao=s(13317),oo=s(13957);let ro=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({providers:[Mt.s,ao.Q,kt.B,oo.T,Ot,Yt],imports:[p.MD,d.h,A.iI,C.D6,u.Hu,i.tP,Lt.Ve,Q.H,K.d,g.m_,x.dV,U.wG]}),n})(),no=(()=>{var e;class n{}return(e=n).\u0275fac=function(a){return new(a||e)},e.\u0275mod=t.$C({type:e}),e.\u0275inj=t.G2t({providers:[M,$,V,$t,Kt.w,Ct.r,Ht.H,vt.k,$,Dt],imports:[p.MD,Qa,i.tP,d.h,C.D6,u.Hu,yt.Hl,g.m_,x.dV,_.mz,Gt.Y3,G.X1,ft,Xt.d,Vt.G,Ut.M,K.d,Ja,nt.RI,q.Cn,Za,qa.P,to.o,eo,ro]}),n})()},72667:(E,y,s)=>{s.d(y,{j:()=>D});var p=s(93981),u=s(85096),g=s(17573),_=s(50297),C=s(26184),i=s(17705),d=s(95892);let D=(()=>{var l;class h{constructor(R,M){this.customerNetworkRepository=R,this.userStorage=M}execute(R,M,$,x,G,V,w,k){var O;x||(x=null===(O=g.K.getDecodedToken(this.userStorage.getCustomerToken()))||void 0===O?void 0:O.SHOP_NUMBER),$=p.n.removePrefixes($);const W=null==G?void 0:G.startOf("day").format(C.DJ),f=null==V?void 0:V.endOf("day").format(C.DJ);return(0,u.A)(this.customerNetworkRepository.getShopCustomers(R,M,$,x,W,f,w,k),this.customerNetworkRepository.getShopCustomersCount(x,$,W,f,w,k))}}return(l=h).\u0275fac=function(R){return new(R||l)(i.KVO(d.S),i.KVO(_.q))},l.\u0275prov=i.jDH({token:l,factory:l.\u0275fac}),h})()},12502:(E,y,s)=>{s.d(y,{L:()=>g,f:()=>_});var p=s(11840),u=s(34018);class g{static getRowsOrganised(i){const d=[],D=new _(!0);return i.rows.forEach(l=>{const h=d.filter(t=>_.isSameCategory(l,t))[0];h?_.sumUpRows(h,l):(l.productPerOrder=0,l.salePerOrder=0,l.lastYearProductPerOrder=0,l.lastYearSalePerOrder=0,l.orderCount&&(l.productPerOrder=u.z.calculateRatio(l.productsQuantity,l.orderCount),l.salePerOrder=u.z.calculateRatio(l.amount,l.orderCount)),l.lastYearOrderCount&&(l.lastYearProductPerOrder=u.z.calculateRatio(l.lastYearProductsQuantity,l.lastYearOrderCount),l.lastYearSalePerOrder=u.z.calculateRatio(l.lastYearAmount,l.lastYearOrderCount)),l.profitPercent=u.z.roundToDecimals(u.z.calculatePercent(l.profit,l.netAmount,l.profit?100:0),2),d.push({...l})),_.sumUpRows(D,l)}),d.sort((l,h)=>p.D.compareNumbers(l.amount,h.amount)).reverse(),d.length>0&&d.push(D),d}}class _{static isSameCategory(i,d){return!i.categoryId1&&!d.categoryId1||i.categoryId1===d.categoryId1&&i.categoryId2===d.categoryId2&&i.categoryId3===d.categoryId3&&i.categoryId4===d.categoryId4&&i.categoryId5===d.categoryId5}static sumUpRows(i,d){return i.amount+=d.amount,i.lastYearAmount+=d.lastYearAmount,i.vatAmou
1nt+=d.vatAmount,i.discountAmount+=d.discountAmount,i.profit+=d.profit,i.costAmount+=d.costAmount,i.costInAmount+=d.costInAmount,i.netAmount+=d.netAmount,i.profitPercent=u.z.roundToDecimals(u.z.calculatePercent(i.profit,i.netAmount,i.profit?100:0),2),i.lastYearOrderCount+=d.lastYearOrderCount,i.lastYearProductsQuantity+=d.lastYearProductsQuantity,i.orderCount+=d.orderCount,i.productsQuantity+=d.productsQuantity,i.grossPercentComparedToLastYear=_.calculateGrossPercentComparedToLastYear(i),i.productPerOrder=0,i.salePerOrder=0,i.lastYearProductPerOrder=0,i.lastYearSalePerOrder=0,i.orderCount&&(i.productPerOrder=u.z.calculateRatio(i.productsQuantity,i.orderCount),i.salePerOrder=u.z.calculateRatio(i.amount,i.orderCount)),i.lastYearOrderCount&&(i.lastYearProductPerOrder=u.z.calculateRatio(i.lastYearProductsQuantity,i.lastYearOrderCount),i.lastYearSalePerOrder=u.z.calculateRatio(i.lastYearAmount,i.lastYearOrderCount)),i}static getRowByCategoryKey(i,d){var D,l,h;let t={categoryId1:i.categoryId1,categoryId2:i.categoryId2,categoryId3:i.categoryId3,categoryId4:i.categoryId4,categoryId5:i.categoryId5};return null!=d&&null!==(D=d.categoryFilter)&&void 0!==D&&D.level&&!(null!=d&&null!==(l=d.categoryFilter)&&void 0!==l&&l.cat1)&&!i["categoryId"+(null==d||null===(h=d.categoryFilter)||void 0===h?void 0:h.level)]&&(t={categoryId1:void 0,categoryId2:void 0,categoryId3:void 0,categoryId4:void 0,categoryId5:void 0}),t}constructor(i,d){this.isTotalRow=i,this.isTitleRow=!!d,this.amount=0,this.lastYearAmount=0,this.vatAmount=0,this.discountAmount=0,this.profit=0,this.profitPercent=0,this.costAmount=0,this.costInAmount=0,this.netAmount=0,this.grossPercentComparedToLastYear=0,this.lastYearOrderCount=0,this.lastYearProductsQuantity=0,this.orderCount=0,this.productsQuantity=0,this.salePerOrder=0,this.productPerOrder=0,this.lastYearSalePerOrder=0,this.lastYearProductPerOrder=0}static calculateGrossPercentComparedToLastYear(i){return u.z.calculatePercent(i.amount-i.lastYearAmount,i.lastYearAmount,i.amount?100:0)}}},63315:(E,y,s)=>{s.d(y,{l:()=>C});var p=s(18370),u=s(50297),g=s(17705),_=s(21626);let C=(()=>{var i;class d extends p.Y{constructor(l,h){super(h),this.httpClient=l,this.userStorage=h}getShopSalesReports(l){return this.httpClient.post("reporting/stat/sales/shop",{shops:l.shops,categoryFilter:l.categoryFilter,fromDate:l.fromDate,toDate:l.toDate})}getCategorySalesReports(l){return this.httpClient.post("reporting/sales/category",{shops:l.shops,categoryFilter:l.categoryFilter,source:l.source,posNo:l.posNo,departmentId:l.departmentId,fromDate:l.fromDate,toDate:l.toDate,creditSales:l.creditSales})}getSalesReportsByDay(l){return this.httpClient.post("reporting/sales-by-day",{shops:l.shops,fromDate:l.fromDate,toDate:l.toDate,departmentId:l.departmentId,posNo:l.posNo,categoryFilter:l.categoryFilter,source:l.source})}getSalesTotalReportsByDay(l){return this.httpClient.post("reporting/sales-totals-by-day/",{shops:l.shops,fromDate:l.fromDate,toDate:l.toDate,departmentId:l.departmentId,posNo:l.posNo,categoryFilter:l.categoryFilter,source:l.source})}getSalesReports(l){let h=[];return l.productsSelected&&l.productsSelected.forEach(t=>{h.push(t.id)}),this.httpClient.post("reporting/reportv5",{shops:l.shops,categoryFilter:l.categoryFilter,groupByLevel1:l.groupByLevel1,groupByLevel2:l.groupByLevel2,groupByLevel3:l.groupByLevel3,categories1Selected:l.categories1Selected,categories2Selected:l.categories2Selected,categories3Selected:l.categories3Selected,productsSelected:h,includeFiguresForLastYear:l.includeFiguresForLastYear,compareByDay:l.compareByDay,fromDate:l.fromDate,toDate:l.toDate,reportType:l.reportTitleGroupType?l.reportTitleGroupType:"ST"})}}return(i=d).\u0275fac=function(l){return new(l||i)(g.KVO(_.Qq),g.KVO(u.q))},i.\u0275prov=g.jDH({token:i,factory:i.\u0275fac}),d})()},13957:(E,y,s)=>{s.d(y,{T:()=>i});var p=s(50297),u=s(18370),g=s(214),_=s(17705),C=s(21626);let i=(()=>{var d;class D extends u.Y{constructor(h,t){super(h),this.userStorage=h,this.httpClient=t}getPricebooks(h,t){return this.call(this.httpClient.get("admin/pricebook/list",{params:{pricebookStatus:h,showPassed:t}}))}getPricebookById(h){return this.call(this.httpClient.get("admin/pricebook",{params:{id:h}}))}createPricebook(h){return this.call(this.httpClient.post("admin/pricebook",h))}updatePricebook(h){return this.call(this.httpClient.put("admin/pricebook",h))}deletePricebook(h){return this.call(this.httpClient.delete("admin/pricebook",{params:{id:h.toString()}}))}getPricebooksForProduct(h,t){return this.call(this.httpClient.get(`admin/pricebook/list/product/${h}`,{params:(0,g.$I)({shopIds:t})}))}updatePricebookLine(h,t){return this.call(this.httpClient.put(`admin/pricebook/line/${h}`,t))}}return(d=D).\u0275fac=function(h){return new(h||d)(_.KVO(p.q),_.KVO(C.Qq))},d.\u0275prov=_.jDH({token:d,factory:d.\u0275fac}),D})()},17776:(E,y,s)=>{s.d(y,{q:()=>C});var p=s(17705),u=s(60177),g=s(9183);function _(i,d){1&i&&(p.j41(0,"div",1),p.nrm(1,"mat-spinner",2),p.k0s())}let C=(()=>{var i;class d{constructor(){this.isLoading=!1}ngOnInit(){}}return(i=d).\u0275fac=function(l){return new(l||i)},i.\u0275cmp=p.VBU({type:i,selectors:[["webshop-loading"]],inputs:{isLoading:"isLoading"},decls:1,vars:1,consts:[["class","loading-overlay",4,"ngIf"],[1,"loading-overlay"],["color","accent"]],template:function(l,h){1&l&&p.DNE(0,_,2,0,"div",0),2&l&&p.Y8G("ngIf",h.isLoading)},dependencies:[u.bT,g.LG]}),d})()},79519:(E,y,s)=>{s.d(y,{H:()=>_});var p=s(60177),u=s(9183),g=s(17705);let _=(()=>{var C;class i{}return(C=i).\u0275fac=function(D){return new(D||C)},C.\u0275mod=g.$C({type:C}),C.\u0275inj=g.G2t({imports:[p.MD,u.D6]}),i})()},10357:(E,y,s)=>{s.d(y,{N:()=>g});var p=s(33425),u=s(17705);let g=(()=>{var _;class C{constructor(){this.decimalNumberFormat=new p.PM}
1transform(d,D="us-US",l){return null==d?void 0:d.toLocaleString(D,void 0===l?this.decimalNumberFormat:{minimumFractionDigits:l,maximumFractionDigits:l})}}return(_=C).\u0275fac=function(d){return new(d||_)},_.\u0275pipe=u.EJ8({name:"numFormat",type:_,pure:!0,standalone:!0}),C})()},34552:(E,y,s)=>{s.d(y,{a:()=>D});var p=s(84135),u=s(34018),g=s(17705),_=s(60177),C=s(14823);const i=function(l){return{height:l}},d=function(l,h){return{width:l,background:h}};let D=(()=>{var l;class h extends p.${constructor(R){super(R),this.cdk=R,this.height=8,this.percent=0,this.borderRadius="full",this.backgroundColor="#d8d4d8",this.progressBarColor="white"}ngOnInit(){this.percent=this.percent?this.percent>100?100:u.z.roundToDecimals(this.percent,2):0}}return(l=h).\u0275fac=function(R){return new(R||l)(g.rXU(g.gRc))},l.\u0275cmp=g.VBU({type:l,selectors:[["webshop-progress-bar"]],inputs:{height:"height",percent:"percent",borderRadius:"borderRadius",backgroundColor:"backgroundColor",progressBarColor:"progressBarColor"},features:[g.Vt3],decls:3,vars:15,consts:[[3,"matTooltip","ngStyle"],[1,"h-100","w-100","background"],[1,"h-100",3,"ngStyle"]],template:function(R,M){1&R&&(g.j41(0,"div",0),g.nrm(1,"div",1)(2,"div",2),g.k0s()),2&R&&(g.ZvI("w-100 rounded-pill bar position-relative ",M.borderRadius,""),g.Y8G("matTooltip",M.percent+"%")("ngStyle",g.eq3(10,i,M.height+"px")),g.R7$(1),g.xc7("background-color",M.backgroundColor)("opacity",.7),g.R7$(1),g.Y8G("ngStyle",g.l_i(12,d,M.percent+"%",M.progressBarColor)))},dependencies:[_.B3,C.oV],styles:[".bar[_ngcontent-%COMP%] > div.background[_ngcontent-%COMP%]{position:absolute;top:0;left:0;bottom:0;right:0}.bar.full[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-radius:50px!important}.bar.right[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-top-right-radius:50px!important;border-bottom-right-radius:50px!important}.bar.left[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{border-top-right-radius:50px!important;border-bottom-right-radius:50px!important}"],changeDetection:0}),h})()},4375:(E,y,s)=>{s.d(y,{d:()=>C});var p=s(60177),u=s(41780),g=s(14823),_=s(17705);let C=(()=>{var i;class d{}return(i=d).\u0275fac=function(l){return new(l||i)},i.\u0275mod=_.$C({type:i}),i.\u0275inj=_.G2t({imports:[p.MD,u.h,g.uc]}),d})()},60821:(E,y,s)=>{s.d(y,{$:()=>g});var p=s(17705),u=s(345);let g=(()=>{var _;class C{constructor(d){this.sanitized=d}transform(d){return this.sanitized.bypassSecurityTrustHtml(d)}}return(_=C).\u0275fac=function(d){return new(d||_)(p.rXU(u.up,16))},_.\u0275pipe=p.EJ8({name:"safeHtml",type:_,pure:!0,standalone:!0}),C})()},2134:(E,y,s)=>{s.d(y,{P5:()=>g,ZE:()=>u,lZ:()=>C,t1:()=>p,z_:()=>_});const p=["#80B2C9","#cda8a8","#acc9c1","#d3d0d5","#e7d8d7","#83748a","#3d549b","#d4d092"],u=["#444444","#a49673","#ffffff","#000000"],g=["#FFBA0D","#415DAA","#ffffff","#000000"],_=["#FFD0D0","#6EAA7F","#ffffff","#000000"],C=["#FDB315","#ffffff","#000000"]},10119:(E,y,s)=>{s.d(y,{y:()=>p});var p=function(u){return u.hours="HOURS",u.days="DAYS",u.weeks="WEEKS",u.months="MONTHS",u.years="YEARS",u}(p||{})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.