1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[24135],{24135:(Y,f,o)=>{o.r(f),o.d(f,{UserPurchasesModule:()=>k});var D=o(97144),h=o(38132),p=o(10467),I=o(30720),b=o(69915),R=o(68010),y=o(25615),t=o(73664),m=o(2615),g=o(91029),v=o(72200),S=o(93692),E=o(23620),T=o(3543),N=o(82966),M=o(10957),P=o(77540),U=o(69415),O=o(68018);function F(a,d){if(1&a&&(t.j41(0,"mat-option",11),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a){const e=d.$implicit;t.Y8G("value",e.value),t.R7$(),t.JRh(t.bMT(2,2,e.name))}}function x(a,d){if(1&a&&(t.j41(0,"div",12),t.nrm(1,"app-empty-space",13),t.k0s()),2&a){const e=t.XpG();t.R7$(),t.Y8G("noButton",!0)("isMedium",!0)("textArray",e.textArray)}}function A(a,d){if(1&a){const e=t.RV6();t.j41(0,"div",15),t.nI1(1,"translate"),t.bIt("click",function(){const s=m.eBV(e).$implicit,n=t.XpG(2);return m.Njj(n.goToPurchase(s.id,s.referenceIdentifier))}),t.j41(2,"div",16)(3,"div",17),t.EFF(4),t.k0s(),t.j41(5,"div",18),t.EFF(6),t.k0s()(),t.j41(7,"div",19)(8,"div",20),t.EFF(9),t.k0s(),t.j41(10,"div",21),t.EFF(11),t.nI1(12,"translate"),t.k0s()(),t.j41(13,"div",22)(14,"div",23),t.EFF(15),t.k0s(),t.nrm(16,"app-clupik-state-tag",24),t.k0s()()}
1if(2&a){const e=d.$implicit,r=t.XpG(2);t.BMQ("aria-label",t.bMT(1,9,"user.go_to_purchase")),t.R7$(4),t.JRh(e.day),t.R7$(2),t.JRh(e.month),t.R7$(3),t.SpI("N\xba ",e.referenceIdentifier),t.R7$(2),t.Lme("",e.articleNumber," ",t.bMT(12,11,"module.store.articles")),t.R7$(4),t.JRh(r.globalVars.getFormattedStringMoney(e.price)),t.R7$(),t.Y8G("state","RECEIVED"===e.status||"PENDING"===e.status||"PROCESSING"===e.status||"PICKUP"===e.status?"info":"CANCELED"===e.status||"RETURNED"===e.status||"VOIDED"===e.status?"danger":"FINISHED"===e.status?"success":"grey")("value","module.store.purchase_status_table."+e.status)}}function G(a,d){if(1&a&&(t.j41(0,"div",12),t.DNE(1,A,17,13,"div",14),t.k0s()),2&a){const e=t.XpG();t.R7$(),t.Y8G("ngForOf",e.purchases)}}function V(a,d){1&a&&(t.j41(0,"div",25),t.nrm(1,"app-skeleton-block"),t.k0s())}const j=[{path:"",component:(()=>{class a{globalVars;appService;apiStoreService;authService;router;activatedRoute;textArray=["global.search.nothing_found","module.store.no_purchases_yet"];limit=20;offset=0;currentOrder;moment;orderTypes=[{name:"module.store.most_recent_orders",value:{column:"created_at",direction:"DESC"}},{name:"module.store.older_orders",value:{column:"created_at",direction:"ASC"}}];purchases=[];dataLoaded;constructor(e,r,s,n,i,u){this.globalVars=e,this.appService=r,this.apiStoreService=s,this.authService=n,this.router=i,this.activatedRoute=u,this.moment=this.globalVars.getMoment()}ngOnInit(){var e=this;return(0,p.A)(function*(){e.appService.broadcast("changeTitleAppNav",{title:"module.store.my_orders"}),setTimeout(()=>{e.globalVars.navbarTop.title="module.store.my_orders",e.globalVars.navbarTop.bgClass="bg-primary",e.globalVars.navbarTop.backLink=!0,e.globalVars.navbarTop.customBackLink="",e.globalVars.navbarTop.image=null,e.globalVars.navbarTop.rightIcon=null,e.globalVars.navbarTop.rightLink=null,e.globalVars.navbarBottom.status=!0,e.globalVars.navbarBottom.activeItem=null}),e.currentOrder=e.orderTypes[0].value,e.purchases=yield e.getPurchases();for(let r of e.purchases){r.day=e.moment(r.createdAt).format("DD"),r.month=e.moment(r.createdAt).format("MMM").toUpperCase().split(".")[0],r.articleNumber=r.productPrices.length,r.price=0;let s=0,n=0,i=0,u=0;for(let l of r.productPrices)r.price+=l.value,["PENDING","PAYED"].includes(l.status)&&s++,["DELIVERED"].includes(l.status)&&n++,["CANCELED"].includes(l.status)&&i++,["RETURNED"].includes(l.status)&&u++;for(let l of r.shippings)r.price+=l.value;r.status=s===r.productPrices.length?"RECEIVED":i===r.productPrices.length?"CANCELED":u===r.productPrices.length?"RETURNED":n===r.productPrices.length||n+i+u===r.productPrices.length?"FINISHED":"PROCESSING"}e.dataLoaded=!0})()}getPurchases(){var e=this;return(0,p.A)(function*(){return yield e.apiStoreService.getPurchasesOfUser(e.authService.getId(),e.limit,e.offset,e.currentOrder).toPromise()})()}scrollTest(){var e=this;return(0,p.A)(function*(){if(e.dataLoaded){e.offset+=e.limit,e.dataLoaded=!1;let r=yield e.getPurchases();e.purchases=e.purchases.concat(r);for(let s of e.purchases){s.day=e.moment(s.createdAt).format("DD"),s.month=e.moment(s.createdAt).format("MMM").toUpperCase(),s.articleNumber=s.productPrices.length,s.price=0;let n=0,i=0,u=0,l=0;for(let c of s.productPrices)s.price+=c.value,["PENDING","PAYED"].includes(c.status)&&n++,["DELIVERED"].includes(c.status)&&i++,["CANCELED"].includes(c.status)&&u++,["RETURNED"].includes(c.status)&&l++;for(let c of s.shippings)s.price+=c.value;s.status=n===s.productPrices.length?"RECEIVED":u===s.productPrices.length?"CANCELED":l===s.productPrices.length?"RETURNED":i===s.productPrices.length||i+u+l===s.productPrices.length?"FINISHED":"PROCESSING"}e.dataLoaded=!0}})()}goToPurchase(e,r){this.router.navigate([`./${e}`],{relativeTo:this.activatedRoute,queryParams:{reference:r}})}changeOrder(e){var r=this;return(0,p.A)(function*(){r.currentOrder=e,r.offset=0,r.purchases=[],r.dataLoaded=!1,r.purchases=yield r.getPurchases();for(let s of r.purchases){s.day=r.moment(s.createdAt).format("DD"),s.month=r.moment(s.createdAt).format("MMM").toUpperCase(),s.articleNumber=s.productPrices.length,s.price=0;let n=0,i=0,u=0,l=0;for(let c of s.productPrices)s.price+=c.value,["PENDING","PAYED"].includes(c.status)&&n++,["DELIVERED"].includes(c.status)&&i++,["CANCELED"].includes(c.status)&&u++,["RETURNED"].includes(c.status)&&l++;for(let c of s.shippings)s.price+=c.value;s.status=n===s.productPrices.length?"RECEIVED":u===s.productPrices.length?"CA
1NCELED":l===s.productPrices.length?"RETURNED":i===s.productPrices.length||i+u+l===s.productPrices.length?"FINISHED":"PROCESSING"}r.dataLoaded=!0})()}static \u0275fac=function(r){return new(r||a)(t.rXU(y.Y),t.rXU(b.d),t.rXU(I.d),t.rXU(R.u),t.rXU(g.Ix),t.rXU(g.nX))};static \u0275cmp=t.VBU({type:a,selectors:[["app-user-purchases"]],standalone:!1,decls:16,vars:13,consts:[["infiniteScroll","",1,"dashboard","public-dashboard","white",3,"scrolled","infiniteScrollDistance","infiniteScrollThrottle"],["id","user-edit-basics"],[1,"new-actions"],[1,"actions-right"],[1,"form-row-outlined","forty"],["appearance","outline"],["id","season-select",3,"selectionChange","placeholder","value"],[3,"value",4,"ngFor","ngForOf"],[1,"content"],["class","main-content",4,"ngIf"],["class","app-skeleton-block",4,"ngIf"],[3,"value"],[1,"main-content"],["svgImage","empty_search",3,"noButton","isMedium","textArray"],["class","row clickable","role","button","tabindex","0",3,"click",4,"ngFor","ngForOf"],["role","button","tabindex","0",1,"row","clickable",3,"click"],[1,"day-column"],[1,"day"],[1,"month"],[1,"article-column"],[1,"article-ref"],[1,"article-number"],[1,"price-column"],[1,"price"],[3,"state","value"],[1,"app-skeleton-block"]],template:function(r,s){1&r&&(t.j41(0,"div",0),t.bIt("scrolled",function(){return s.scrollTest()}),t.j41(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-form-field",5)(6,"mat-label"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"mat-select",6),t.nI1(10,"translate"),t.bIt("selectionChange",function(i){return s.changeOrder(i.value)}),t.DNE(11,F,3,4,"mat-option",7),t.k0s()()()()(),t.j41(12,"div",8),t.DNE(13,x,2,3,"div",9)(14,G,2,1,"div",9)(15,V,2,0,"div",10),t.k0s()()()),2&r&&(t.Y8G("infiniteScrollDistance",.1)("infiniteScrollThrottle",150),t.R7$(7),t.JRh(t.bMT(8,9,"global.placeholder.order_by")),t.R7$(2),t.Y8G("placeholder",t.bMT(10,11,"global.placeholder.order_by"))("value",s.orderTypes[0].value),t.R7$(2),t.Y8G("ngForOf",s.orderTypes),t.R7$(2),t.Y8G("ngIf",0===s.purchases.length),t.R7$(),t.Y8G("ngIf",s.purchases.length>0),t.R7$(),t.Y8G("ngIf",!s.dataLoaded))},dependencies:[v.Sq,v.bT,S.M,E.j,E.M,T.g,N.K,M.F,P.D,U.p,O.D9],styles:[".row[_ngcontent-%COMP%]{display:flex;width:100%;border-top:1px solid #e6e6e6;padding-top:1em;padding-bottom:1em;margin:0!important}.row[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #e6e6e6}.price-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;padding-right:1em}.price-column[_ngcontent-%COMP%] .price[_ngcontent-%COMP%]{text-align:right;margin-bottom:5px}.price-column[_ngcontent-%COMP%] .clupik-tag[_ngcontent-%COMP%]{text-transform:capitalize}.day-column[_ngcontent-%COMP%]{font-weight:600;font-size:1.2em;border-right:2px solid var(--link-color);display:flex;flex-direction:column;align-items:center;justify-content:center;width:70px}.article-column[_ngcontent-%COMP%]{padding-left:1em;flex-grow:1;display:flex;flex-direction:column;justify-content:center}.article-column[_ngcontent-%COMP%] .article-ref[_ngcontent-%COMP%]{font-weight:600;text-transform:uppercase;margin-bottom:5px}.article-column[_ngcontent-%COMP%] .article-number[_ngcontent-%COMP%]{font-size:.9em;color:#979797}"]})}return a})()},{path:":purchaseId",loadChildren:()=>o.e(4322).then(o.bind(o,4322)).then(a=>a.UserPurchaseModule)}];let C=(()=>{class a{static \u0275fac=function(r){return new(r||a)};static \u0275mod=t.$C({type:a});static \u0275inj=m.G2t({imports:[h.iI.forChild(j),h.iI]})}return a})();var L=o(7030),$=o(37808);let k=(()=>{class a{static \u0275fac=function(r){return new(r||a)};static \u0275mod=t.$C({type:a});static \u0275inj=m.G2t({imports:[D.d,C,P.e,L.g,$.c,C]})}return a})()}}]);
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.