import{a as We,c as Ye}from"./chunk-GSLPDASC.js";import{a as re}from"./chunk-B4H3G55F.js";import{b as je}from"./chunk-5OZTUYJC.js";import{a as qe}from"./chunk-FKH74CIW.js";import{J as oe}from"./chunk-CWWVHRJU.js";import{c as ke}from"./chunk-QMZQK3O6.js";import{a as Ve,b as Le}from"./chunk-NLWV7OZT.js";import{a as ne}from"./chunk-RU43IR5J.js";import{a as De}from"./chunk-Y7IP5WLG.js";import{a as Ne}from"./chunk-LY6HB4BL.js";import{r as He,s as Ue}from"./chunk-L7CU4UNF.js";import{a as Oe}from"./chunk-NFSBDFF3.js";import{a as $e}from"./chunk-VQWPF2OP.js";import{T as Re,U as Y,m as Ae}from"./chunk-FBI7JGZC.js";import{a as H}from"./chunk-ILYMG6ZI.js";import{U as Me,V as we,f as Ee,r as te,s as ie,x as Be}from"./chunk-MXUIPT66.js";import{Aa as x,Ab as s,Ba as v,Bb as g,Cb as B,Db as M,Dc as Z,Eb as fe,Fb as P,Ha as J,Ka as y,Kb as S,Kd as Ie,Lb as c,Na as de,Nd as W,Ob as z,Og as ee,Q as pe,Ua as r,Va as q,Vc as L,Wc as xe,Wg as Se,Xb as D,Xc as ve,Xg as Fe,Yb as h,Zb as Q,_b as u,a as le,ad as ye,bd as R,d as w,db as j,dd as Te,gc as A,gd as be,ib as _,jc as T,kc as k,lc as X,nb as _e,ob as p,oc as ge,pa as b,pb as Ce,qb as ae,rc as m,rg as Pe,s as me,sc as d,t as G,ta as I,tc as F,ub as f,vc as ce,wa as K,wc as V,xb as he,yb as ue,yh as N,zb as l,zh as O}from"./chunk-N6B2OJOY.js";var ot=(e,i)=>({currency:e,locale:i}),rt=e=>({"shift-gap":e}),at=(e,i)=>[0,e,"symbol","1.0",i],ct=(e,i,t)=>[e,i,"symbol","1.2",t];function st(e,i){if(e&1&&(l(0,"div"),h(1),m(2,"currency"),s()),e&2){let t=c(2);r(),u(" ",ce(2,1,k(7,at,t.currency,t.locale))," ")}}function lt(e,i){if(e&1&&(h(0),m(1,"currency")),e&2){let t=c(3),n=c();u(" ",ce(1,1,X(7,ct,n.half(),t.currency,t.locale))," ")}}function mt(e,i){if(e&1&&(l(0,"div",3),_(1,lt,2,11),s()),e&2){let t=c(3);r(),f(1,t.half()!==0?1:-1)}}function pt(e,i){if(e&1&&(l(0,"div",2),_(1,st,3,10,"div")(2,mt,2,1,"div",3),l(3,"div",4),h(4),s()()),e&2){let t,n=c(2);r(),f(1,n.isFirst?1:-1),r(),f(2,n.isSingle?2:-1),r(),p("ngClass",T(4,rt,n.isSingle===!1&&n.isLast===!1)),r(),u(" ",(t=n.threshold())==null?null:t.formattedValue," ")}}function dt(e,i){if(e&1&&(l(0,"div",0),g(1,"div",1),s(),_(2,pt,5,6,"div",2)),e&2){let t=c();_e("aria-valuenow",t.progress()),r(),Ce("width",t.progress()+"%"),r(),f(2,t.showAxisCaption?2:-1)}}var Ge=(()=>{let i=class i{constructor(){this._currencyService=b(Pe),this._currencyLocaleService=b(je),this._breakpointService=b(Be),this._destroyRef=b(J),this.isFirst=!1,this.isLast=!1,this.isSingle=!1,this.startValue=0,this.currency$=this._currencyService.getActive(),this.locale$=this._currencyLocaleService.getActiveLocaleForCurrencyPipe(),this.progress=j(void 0),this.half=j(void 0),this.threshold=j(null),this.isMobile=j(!1),this._promotion$=new w({})}set promotion(n){this._promotion$.next(n)}get showAxisCaption(){return this.isMobile()===!0&&this.isSingle||this.isMobile()===!1}ngOnInit(){this._breakpointService.breakpoint$.pipe(W(this._destroyRef)).subscribe(n=>{this.isMobile.set(n===Ee.xs)}),G([this._promotion$,this.nextPromoIndex$]).pipe(W(this._destroyRef),pe()).subscribe(([n,o])=>{let a=n?.threshold??null,C=n?.thresholdDifference??null;this.threshold.set(a),this.isSingle===!0&&this.half.set(this.getHalf(a)),this.index<o?this.progress.set(100):this.index>o?this.progress.set(0):this.progress.set(this.getProgress(a,C))})}getProgress(n,o){if(!(n?.value&&isNaN(o?.value)===!1))return 0;let a=n.value-this.startValue;return Math.min(100,(a-o.value)*100/a)}getHalf(n){return n?.value?n.value/2:0}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=I({type:i,selectors:[["foerch-promotion-bar"]],inputs:{promotion:"promotion",isFirst:"isFirst",isLast:"isLast",isSingle:"isSingle",index:"index",startValue:"startValue",nextPromoIndex$:"nextPromoIndex$"},standalone:!0,features:[A],decls:3,vars:8,consts:[["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress","mb-1","mt-1"],[1,"progress-bar"],[1,"d-flex","justify-content-between","text-small"],[1,"ms-auto"],[1,"ms-auto",3,"ngClass"]],template:function(o,a){if(o&1&&(_(0,dt,3,4),m(1,"async"),m(2,"async")),o&2){let C;f(0,(C=k(5,ot,d(1,1,a.currency$),d(2,3,a.locale$)))?0:-1,C)}},dependencies:[R,be,L],encapsulation:2,changeDetection:0});let e=i;return e})();function Ct(e,i){return this.$index}var ht=(e,i,t,n,o,a)=>({nextPromoThreshold:e,nextPromoThresholdDiff:i,nextPromoProgress:t,potentialOrderPromotion:n,isFirstPromoThresholdReached:o,isLastPromoThresholdReached:a}),ut=e=>({thresholdDiff:e}),ft=(e,i,t)=>({isFirst:e,isLast:i,isSingle:t});function gt(e,i){e&1&&fe(0)}function xt(e,i){e&1&&(l(0,"p",10),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"promotion.itemSelection")," "))}function vt(e,i){if(e&1&&(l(0,"p",10),h(1),m(2,"cxTranslate"),s()),e&2){let t=c(3);r(),u(" ",F(2,1,t.isFirstPromoThresholdReached?"promotion.campaignProgress":"promotion.campaignProgressFirstPromo",T(4,ut,t.nextPromoThresholdDiff==null?null:t.nextPromoThresholdDiff.formattedValue))," ")}}function yt(e,i){if(e&1&&_(0,vt,3,6,"p",10),e&2){let t=c(2);f(0,t.nextPromoThresholdDiff!=null&&t.nextPromoThresholdDiff.formattedValue?0:-1)}}function Tt(e,i){if(e&1&&(l(0,"div",9),g(1,"foerch-promotion-bar",11),s()),e&2){let t=i.$implicit,n=i.$index,o=i.$index,a=i.$count,C=c(2),E=c();p("ngClass",X(8,ft,o===0,o===a-1,o===0&&o===a-1)),r(),p("index",n)("isFirst",o===0)("isLast",o===a-1)("isSingle",o===0&&o===a-1)("nextPromoIndex$",E.nextPromoIndex$)("promotion",t)("startValue",o===0?0:(C.potentialOrderPromotion[n-1].threshold==null?null:C.potentialOrderPromotion[n-1].threshold.value)||0)}}function bt(e,i){if(e&1&&(l(0,"div",2)(1,"div",3)(2,"div",4),g(3,"cx-icon",5),s()(),l(4,"div",3)(5,"div",6)(6,"div",7),h(7),m(8,"cxTranslate"),s(),_(9,gt,1,0,"ng-container",8)(10,xt,3,3,"ng-template",null,0,V)(12,yt,1,1,"ng-template",null,1,V),s()(),l(14,"div",3),he(15,Tt,2,12,"div",9,Ct,!0),s()()),e&2){let t=D(11),n=D(13),o=c(),a=c();r(3),p("type",a.icons.MARKER),r(4),Q(d(8,3,"promotion.campaign")),r(2),p("ngTemplateOutlet",o.isLastPromoThresholdReached?t:n),r(6),ue(o.potentialOrderPromotion)}}function It(e,i){e&1&&_(0,bt,17,5,"div",2),e&2&&f(0,i.nextPromoThreshold?0:-1)}var Ke=(()=>{let i=class i{constructor(){this._promotionsService=b(re),this._destroyRef=b(J),this.nextPromoThreshold$=new w(null),this.nextPromoThresholdDiff$=new w(null),this.nextPromoProgress$=new w(0),this.nextPromoIndex$=new w(0),this.potentialOrderPromotion$=new w([]),this.isFirstPromoThresholdReached$=this._promotionsService.isFirstPromoThresholdReached(),this.isLastPromoThresholdReached$=this._promotionsService.isLastPromoThresholdReached(),this.icons=H}ngOnInit(){G([this._promotionsService.getNextValidPotentialOrderPromotion(),this._promotionsService.getPotentialOrderPromotions()]).pipe(W(this._destroyRef)).subscribe(([n,o])=>{let a=n?.threshold??null,C=n?.thresholdDifference??null,E=o.map(nt=>JSON.stringify(nt)).indexOf(JSON.stringify(n));this.potentialOrderPromotion$.next(o),this.nextPromoThreshold$.next(a),this.nextPromoThresholdDiff$.next(C),this.nextPromoIndex$.next(E),this.nextPromoProgress$.next(this.getNextPromoProgress(a,C))})}getNextPromoProgress(n,o){return n?.value&&isNaN(o?.value)===!1?Math.min(100,(n.value-o.value)*100/n.value):0}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=I({type:i,selectors:[["foerch-promotion-progress-bar"]],standalone:!0,features:[A],decls:7,vars:20,consts:[["lastWording",""],["standardWording",""],[1,"promotions-wrapper"],[1,"row"],[1,"col-12","promotions-marker"],[1,"promotions-marker",3,"type"],[1,"col-12"],[1,"h4"],[4,"ngTemplateOutlet"],[1,"col","shrink-gap-progress-bar",3,"ngClass"],[1,"text-small","mb-1"],[3,"index","isFirst","isLast","isSingle","nextPromoIndex$","promotion","startValue"]],template:function(o,a){if(o&1&&(_(0,It,1,1),m(1,"async"),m(2,"async"),m(3,"async"),m(4,"async"),m(5,"async"),m(6,"async")),o&2){let C;f(0,(C=ge(13,ht,d(1,1,a.nextPromoThreshold$),d(2,3,a.nextPromoThresholdDiff$),d(3,5,a.nextPromoProgress$),d(4,7,a.potentialOrderPromotion$),d(5,9,a.isFirstPromoThresholdReached$),d(6,11,a.isLastPromoThresholdReached$)))?0:-1,C)}},dependencies:[R,Ge,O,N,ie,te,L,ye],encapsulation:2,changeDetection:0});let e=i;return e})();var St=e=>({unqualifiedArticles:e}),Ft=e=>({articles:e});function Et(e,i){e&1&&(l(0,"h4",0),h(1),m(2,"cxTranslate"),s(),l(3,"p",1),h(4),m(5,"cxTranslate"),s()),e&2&&(r(),Q(d(2,2,"promotion.unqualifiedBoxTitle")),r(3),u(" ",F(5,4,"promotion.unqualifiedBoxText",T(7,Ft,i.unqualifiedArticles))," "))}var Je=(()=>{let i=class i{constructor(){this._promotionsService=b(re),this.unqualifiedArticles$=this._promotionsService.getNextUnqualifiedEntries().pipe(me(n=>n.map(o=>o.product.supplierAlternativeAID||o.product.code.split("-")[0]).join(", ")))}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=I({type:i,selectors:[["foerch-promotion-unqualified-hint-box"]],standalone:!0,features:[A],decls:2,vars:5,consts:[[1,"mb-2"],[1,"text-small"]],template:function(o,a){if(o&1&&(_(0,Et,6,9),m(1,"async")),o&2){let C;f(0,(C=T(3,St,d(1,1,a.unqualifiedArticles$)))?0:-1,C)}},dependencies:[R,O,N],encapsulation:2,changeDetection:0});let e=i;return e})();var Mt=["foerch-promotion-cart-item",""],ze=(e,i)=>({code:e,name:i}),Qe=e=>({cxRoute:"product",params:e});function wt(e,i){if(e&1&&(l(0,"td",0),g(1,"cx-icon",11),s()),e&2){let t=c(2);r(),p("type",t.icons.MARKER)}}function At(e,i){if(e&1&&(l(0,"div",4),h(1),s()),e&2){let t=c(2);r(),u(" ",t.foerchArticleCode," ")}}function Rt(e,i){if(e&1&&(l(0,"div",6),h(1),s()),e&2){let t=c(2);r(),u(" ",t.item.product.customArticleCode," ")}}function Nt(e,i){if(e&1&&(l(0,"div"),h(1),s()),e&2){let t=c(3);r(),u(" ",t.item.costCenter==null?null:t.item.costCenter.name," ")}}function $t(e,i){if(e&1&&(l(0,"div"),h(1),s()),e&2){let t=c(3);r(),u(" ",t.item.orderReason==null?null:t.item.orderReason.name," ")}}function Dt(e,i){e&1&&(l(0,"div"),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"cartDetails.proceedToCheckoutCcHint")," "))}function Vt(e,i){if(e&1){let t=P();l(0,"button",14),m(1,"cxTranslate"),S("click",function(){x(t);let o=c(3);return v(o.openCostCenterDialog())}),g(2,"cx-icon",15),s()}if(e&2){let t=c(3);p("title",d(1,2,"cartItems.icons.ccmEdit")),r(2),p("type",t.icons.EDIT)}}function kt(e,i){if(e&1&&(l(0,"td"),B(1),l(2,"div",12),_(3,Nt,2,1,"div")(4,$t,2,1,"div")(5,Dt,3,3,"div")(6,Vt,3,4,"button",13),s(),M(),s()),e&2){let t=c(2);r(2),ae("costCenterMissing",t.isCostCenterMissing),r(),f(3,t.cartConfig.isEditable||t.item.costCenter!=null&&t.item.costCenter.name?3:-1),r(),f(4,t.cartConfig.isEditable||t.item.orderReason!=null&&t.item.orderReason.name?4:-1),r(),f(5,t.cartConfig.isEditable&&t.isCostCenterMissing?5:-1),r(),f(6,t.cartConfig.isEditable?6:-1)}}function Lt(e,i){if(e&1&&(l(0,"td",9),h(1),s()),e&2){let t=c(2);p("colSpan",t.cartConfig.isAnonymousUser!==!0?3:2),r(),u(" ",t.amountAndUnit," ")}}function Ot(e,i){e&1&&g(0,"td")}function Ht(e,i){e&1&&(l(0,"td",16),h(1),m(2,"cxTranslate"),s(),l(3,"td",16)(4,"span",17),h(5),m(6,"cxTranslate"),m(7,"uppercase"),s()()),e&2&&(r(),u(" ",d(2,2,"promotionItem.freeOfCharge")," "),r(4),u(" ",d(7,6,d(6,4,"promotionItem.freeOfCharge"))," "))}function Ut(e,i){if(e&1){let t=P();l(0,"button",20),S("click",function(){x(t);let o=c(3);return v(o.removeItem())}),g(1,"cx-icon",15),s()}if(e&2){let t=c(3);ae("disabled",t.isLoading===!0),p("disabled",t.isLoading===!0),r(),p("type",t.icons.DELETE)}}function qt(e,i){if(e&1&&(l(0,"td",10)(1,"div",18),_(2,Ut,2,4,"button",19),s()()),e&2){let t=c(2);r(2),f(2,t.cartConfig.isEditable?2:-1)}}function jt(e,i){if(e&1&&(_(0,wt,2,1,"td",0),l(1,"td",1)(2,"a",2),m(3,"foerchStrip"),m(4,"cxUrl"),g(5,"cx-media",3),_(6,At,2,1,"div",4),s()(),l(7,"td")(8,"a",5),m(9,"foerchStrip"),m(10,"cxUrl"),h(11),s(),_(12,Rt,2,1,"div",6),g(13,"div",7),m(14,"safe"),l(15,"div",8),h(16),m(17,"cxTranslate"),s()(),_(18,kt,7,6,"td")(19,Lt,2,2,"td",9)(20,Ot,1,0,"td")(21,Ht,8,8)(22,qt,3,1,"td",10)),e&2){let t=c();f(0,t.cartConfig.isEditable||t.cartConfig.isSelectable?0:-1),r(2),p("routerLink",d(4,16,T(30,Qe,k(27,ze,t.item.product.baseProduct,d(3,14,t.item.product.baseProductName))))),r(3),p("container",t.item.product.images&&t.item.product.images.PRIMARY),r(),f(6,t.foerchArticleCode&&(t.articleNumberMode!==t.articleNumberModes.CUSTOMER||!t.item.product.customArticleCode)?6:-1),r(2),p("routerLink",d(10,20,T(35,Qe,k(32,ze,t.item.product.baseProduct,d(9,18,t.item.product.baseProductName))))),r(3),u(" ",t.item.product.baseProductName," "),r(),f(12,t.articleNumberMode!==t.articleNumberModes.FOERCH&&t.item.product.customArticleCode?12:-1),r(),p("innerHTML",F(14,22,t.item.product.nameHtml||t.item.product.name,"html"),de),r(3),u(" ",d(17,25,"promotionItem.promotionArticle")," "),r(2),f(18,t.cartConfig.showCCM?18:-1),r(),f(19,t.cartConfig.showVPE?19:-1),r(),f(20,t.cartConfig.showRememberedAt?20:-1),r(),f(21,t.cartConfig.showPrice?21:-1),r(),f(22,t.isActionColumnNeeded?22:-1)}}var Xe=(()=>{let i=class i{constructor(){this.modalService=b(De),this.isLoading=!1,this.isActionColumnNeeded=!0,this.articleNumberMode=Y.FOERCH,this.shouldHighlightMissingCc=!1,this.remove=new y,this.applyCCM=new y,this.icons=H,this.articleNumberModes=Y}get foerchArticleCode(){return this.item?this.item.product.supplierAlternativeAID?this.item.product.supplierAlternativeAID:this.item.product.code:""}get isCostCenterMissing(){return this.shouldHighlightMissingCc&&!(this.item&&this.item.costCenter)}get amountAndUnit(){let n=this.item.product,o=n.packagingUnits,C=(o&&o.length?o[0].numberContentUnit:1)*this.item.quantity,E=C>1?n.quantityUnit.plural:n.quantityUnit.singular;return`${C} ${E}`}removeItem(){this.remove.emit()}openCostCenterDialog(){this.modalRef=this.modalService.open(We);let n=this.modalRef.componentInstance;n.apply=this.applyCCM,n.selectedCostCenter=this.item.costCenter?this.item.costCenter.code:null,n.selectedOrderReason=this.item.orderReason?this.item.orderReason.code:null}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=I({type:i,selectors:[["","foerch-promotion-cart-item",""]],inputs:{item:"item",isLoading:"isLoading",isActionColumnNeeded:"isActionColumnNeeded",cartConfig:"cartConfig",articleNumberMode:"articleNumberMode",shouldHighlightMissingCc:"shouldHighlightMissingCc"},outputs:{remove:"remove",applyCCM:"applyCCM"},standalone:!0,features:[A],attrs:Mt,decls:1,vars:1,consts:[[1,"cartTable-selectColumn"],[1,"cartTable-imgColumn"],[1,"d-block","text-decoration-none",3,"routerLink"],["format","thumbnail",3,"container"],[1,"cartTable-code"],[1,"cartTable-name",3,"routerLink"],[1,"cartTable-customCode"],[1,"cartTable-desc",3,"innerHTML"],[1,"cartTable-promotionArticle"],[3,"colSpan"],[1,"cartTable-actionColumn"],[1,"promotion-marker",3,"type"],[1,"cartTable-ccm"],[1,"btn-icon","cartTable-ccm-edit",3,"title"],[1,"btn-icon","cartTable-ccm-edit",3,"click","title"],[3,"type"],[1,"text-end"],[1,"cartTable-total"],[1,"action-wrapper"],[1,"btn-icon","cartTable-remove",3,"disabled"],[1,"btn-icon","cartTable-remove",3,"click","disabled"]],template:function(o,a){o&1&&_(0,jt,23,37),o&2&&f(0,a.item&&a.item.product?0:-1)},dependencies:[qe,$e,Oe,O,N,ie,te,we,Me,Ie,Te,Fe,Se],encapsulation:2,changeDetection:0});let e=i;return e})();var Ze=(()=>{let i=class i{transform(n,o){return(o||[]).some(a=>a.pk===n.pk)}};i.\u0275fac=function(o){return new(o||i)},i.\u0275pipe=K({name:"foerchUnqualifiedForThreshold",type:i,pure:!0,standalone:!0});let e=i;return e})();var et=(()=>{let i=class i{transform(n,o){return n.filter(a=>a.giveAway===o)}};i.\u0275fac=function(o){return new(o||i)},i.\u0275pipe=K({name:"foerchGiveaway",type:i,pure:!0,standalone:!0});let e=i;return e})();var Kt=function(e,i,t,n){var o=arguments.length,a=o<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,t):n,C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,i,t,n);else for(var E=e.length-1;E>=0;E--)(C=e[E])&&(a=(o<3?C(a):o>3?C(i,t,a):C(i,t))||a);return o>3&&a&&Object.defineProperty(i,t,a),a},Jt=function(e,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,i)},zt=e=>({isLoading:e}),Qt=e=>({"is-unqualified-for-promotion-threshold":e});function Xt(e,i){if(e&1&&g(0,"foerch-checkout-info",13),e&2){let t=c();p("checkoutInfo",t.checkoutInfo)}}function Zt(e,i){e&1&&(l(0,"div",17),g(1,"foerch-promotion-unqualified-hint-box"),s())}function ei(e,i){if(e&1&&(l(0,"div",14)(1,"div",15),g(2,"foerch-promotion-progress-bar"),s(),_(3,Zt,2,0,"div",16),s()),e&2){let t=c();r(),p("ngClass",t.shouldShowPromotionHintBox?"col-12 col-lg-9":"col"),r(2),p("ngIf",t.shouldShowPromotionHintBox)}}function ti(e,i){e&1&&g(0,"th")}function ii(e,i){e&1&&(B(0),h(1),m(2,"cxTranslate"),M()),e&2&&(r(),u(" ",d(2,1,"cartItems.id")," "))}function ni(e,i){if(e&1){let t=P();l(0,"foerch-table-sort",18),m(1,"cxTranslate"),S("changeSorting",function(o){x(t);let a=c();return v(a.onSortingChange(o))}),s()}if(e&2){let t=c();z("title",d(1,2,"cartItems.id")),p("sortModel",t.sortModel)}}function oi(e,i){e&1&&(B(0),h(1),m(2,"cxTranslate"),M()),e&2&&(r(),u(" ",d(2,1,"cartItems.description")," "))}function ri(e,i){if(e&1){let t=P();l(0,"foerch-table-sort",19),m(1,"cxTranslate"),S("changeSorting",function(o){x(t);let a=c();return v(a.onSortingChange(o))}),s()}if(e&2){let t=c();z("title",d(1,2,"cartItems.description")),p("sortModel",t.sortModel)}}function ai(e,i){e&1&&(l(0,"th"),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"cartItems.costCenterLabel")," "))}function ci(e,i){e&1&&(l(0,"th"),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"common.vpeFormula")," "))}function si(e,i){e&1&&(l(0,"th"),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"cartItems.amountUnit")," "))}function li(e,i){e&1&&(l(0,"th"),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"cartItems.priceUnit")," "))}function mi(e,i){e&1&&(l(0,"th"),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"cartItems.rememberedAt")," "))}function pi(e,i){e&1&&(l(0,"th",20),h(1),m(2,"cxTranslate"),s()),e&2&&(r(),u(" ",d(2,1,"cartItems.itemPrice")," "))}function di(e,i){e&1&&(B(0),h(1),m(2,"cxTranslate"),M()),e&2&&(r(),u(" ",d(2,1,"cartItems.total")," "))}function _i(e,i){if(e&1){let t=P();l(0,"foerch-table-sort",21),m(1,"cxTranslate"),S("changeSorting",function(o){x(t);let a=c(2);return v(a.onSortingChange(o))}),s()}if(e&2){let t=c(2);z("title",d(1,2,"cartItems.total")),p("sortModel",t.sortModel)}}function Ci(e,i){if(e&1&&(l(0,"th",20),_(1,di,3,3,"ng-container",10)(2,_i,2,4,"ng-template",null,2,V),s()),e&2){let t=D(3),n=c();r(),p("ngIf",!(n.sortModel&&n.isColumnSortable(n.sortableColumn.TOTAL)))("ngIfElse",t)}}function hi(e,i){e&1&&g(0,"th",22)}function ui(e,i){if(e&1){let t=P();l(0,"tr",25),m(1,"foerchCheckoutDisallowedCostCenter"),S("applyCCM",function(o){x(t);let a=c().$implicit,C=c(2);return v(C.applyCostCenterReason(o,a))})("remove",function(){x(t);let o=c().$implicit,a=c(2);return v(a.removeItem(o))}),s()}if(e&2){let t=c().$implicit,n=c().ngIf,o=c();p("articleNumberMode",o.articleNumberMode)("cartConfig",o.cartConfig)("isActionColumnNeeded",o.isActionColumnNeeded)("isLoading",n.isLoading)("item",t)("shouldHighlightMissingCc",d(1,6,o.checkoutInfo))}}function fi(e,i){if(e&1&&(B(0),_(1,ui,2,8,"tr",24),M()),e&2){let t=i.$implicit;r(),p("ngIf",!t.entryDeleted)}}function gi(e,i){if(e&1){let t=P();l(0,"tr",27),m(1,"foerchUnqualifiedForThreshold"),m(2,"foerchCheckoutDisallowedCostCenter"),S("addToCart",function(){x(t);let o=c().$implicit,a=c(2);return v(a.onAddToCart(o))})("applyCCM",function(o){x(t);let a=c().$implicit,C=c(2);return v(C.applyCostCenterReason(o,a))})("articleReplaced",function(o){x(t);let a=c().$implicit,C=c(2);return v(C.onArticleReplaced(o,a))})("itemToggled",function(){x(t);let o=c().$implicit,a=c(2);return v(a.cartEntryToggled(o))})("remove",function(){x(t);let o=c().$implicit,a=c(2);return v(a.removeItem(o))})("updateComment",function(o){x(t);let a=c().$implicit,C=c(2);return v(C.updateItemComment(o,a))})("vpeAnyChanged",function(o){x(t);let a=c(3);return v(a.onVpeChange(o))}),s()}if(e&2){let t=c().$implicit,n=c().ngIf,o=c();p("articleNumberMode",o.articleNumberMode)("cartConfig",o.cartConfig)("isActionColumnNeeded",o.isActionColumnNeeded)("isLoading",n.isLoading)("item",t)("markItem",o.selectionHelper.getItemStatus(t.pk))("ngClass",T(13,Qt,F(1,8,t,o.unqualifiedEntriesForPromotion)))("shouldHighlightMissingCc",d(2,11,o.checkoutInfo))}}function xi(e,i){if(e&1&&(B(0),_(1,gi,3,15,"tr",26),M()),e&2){let t=i.$implicit;r(),p("ngIf",!t.entryDeleted)}}function vi(e,i){if(e&1&&(l(0,"tbody"),_(1,fi,2,1,"ng-container",23),m(2,"foerchGiveaway"),_(3,xi,2,1,"ng-container",23),m(4,"foerchGiveaway"),s()),e&2){let t=c();r(),p("ngForOf",F(2,4,t.items,!0))("ngForTrackBy",t.trackByOrderEntry),r(2),p("ngForOf",F(4,7,t.items,!1))("ngForTrackBy",t.trackByOrderEntry)}}var it=function(e){return e.ARTICLE_NUMBER="cartItems.id",e.ARTICLE_NAME="cartItems.description",e.TOTAL="cartItems.total",e}(it||{}),$,tt=($=class{constructor(i,t,n,o){this.activeCartService=i,this.permissionsService=t,this.translationService=n,this.cd=o,this.sortableColumns=[],this.shouldShowPromotionHintBox=!1,this.unqualifiedEntriesForPromotion=[],this.isLoading$=this.activeCartService.isLoading(),this.applyCostCenterToEntry=new y,this.updateComment=new y,this.removeEntry=new y,this.markEntry=new y,this.addEntryToCart=new y,this.vpeChange=new y,this.sortingChange=new y,this.sortingReset=new y,this.replaceArticle=new y,this.cartModes=Ae,this.sortableColumn=it,this.hasActiveSorting=!1,this.articleNumberMode=Y.FOERCH,this.iconTypes=H,this._subs$=new le}get isActionColumnNeeded(){return this.cartConfig.isEditable||this.cartConfig.showAddToCart}ngOnInit(){this.cartConfig.isAnonymousUser||this._subs$.add(this.permissionsService.getPermissionValue(Re.ACTIVATE_WEBSHOP_ARTICLE_NUMBER).subscribe(i=>{i&&(this.articleNumberMode=i,this.cd.detectChanges())}))}ngOnDestroy(){}trackByOrderEntry(i,t){return t.product.code}applyCostCenterReason(i,t){this.applyCostCenterToEntry.emit({costCenter:i.costCenter,orderReason:i.orderReason,item:t})}updateItemComment(i,t){this.updateComment.emit({comment:i,item:t})}removeItem(i){this.removeEntry.emit({item:i})}cartEntryToggled(i){this.markEntry.emit({item:i})}isColumnSortable(i){return this.sortableColumns?this.sortableColumns.indexOf(i)!==-1:!1}onAddToCart(i){this.addEntryToCart.emit({item:i})}onVpeChange(i){this.vpeChange.emit(i)}onArticleReplaced(i,t){this.replaceArticle.emit({item:t,replacement:i})}onSortingChange(i){this.hasActiveSorting=!0,this.sortingChange.emit(i)}onSortingReset(){this.hasActiveSorting=!1,this.sortingReset.emit()}},$.\u0275fac=function(t){return new(t||$)(q(oe),q(ne),q(ee),q(Z))},$.\u0275cmp=I({type:$,selectors:[["foerch-cart-body"]],inputs:{items:"items",promotions:"promotions",totalPrice:"totalPrice",selectionHelper:"selectionHelper",cartConfig:"cartConfig",sortableColumns:"sortableColumns",sortModel:"sortModel",shouldShowPromotionHintBox:"shouldShowPromotionHintBox",checkoutInfo:"checkoutInfo",unqualifiedEntriesForPromotion:"unqualifiedEntriesForPromotion",isLoading$:"isLoading$"},outputs:{applyCostCenterToEntry:"applyCostCenterToEntry",updateComment:"updateComment",removeEntry:"removeEntry",markEntry:"markEntry",addEntryToCart:"addEntryToCart",vpeChange:"vpeChange",sortingChange:"sortingChange",sortingReset:"sortingReset",replaceArticle:"replaceArticle"},decls:29,vars:23,consts:[["sortArticleNumber",""],["sortDescription",""],["sortTotal",""],[1,"cart-details-wrapper"],["class","mb-2 mt-4",3,"checkoutInfo",4,"ngIf"],["class","row g-0 mt-2",4,"ngIf"],[3,"resetSorting","enabled"],[1,"cartTable"],[4,"ngIf"],[1,"cartTable-imgColumn"],[4,"ngIf","ngIfElse"],["class","text-end",4,"ngIf"],["class","cartTable-actionColumn",4,"ngIf"],[1,"mb-2","mt-4",3,"checkoutInfo"],[1,"row","g-0","mt-2"],[3,"ngClass"],["class","col-12 col-lg-3",4,"ngIf"],[1,"col-12","col-lg-3"],["sortBy","code",3,"changeSorting","title","sortModel"],["sortBy","title",3,"changeSorting","title","sortModel"],[1,"text-end"],["sortBy","total",3,"changeSorting","title","sortModel"],[1,"cartTable-actionColumn"],[4,"ngFor","ngForOf","ngForTrackBy"],["foerch-promotion-cart-item","",3,"articleNumberMode","cartConfig","isActionColumnNeeded","isLoading","item","shouldHighlightMissingCc","applyCCM","remove",4,"ngIf"],["foerch-promotion-cart-item","",3,"applyCCM","remove","articleNumberMode","cartConfig","isActionColumnNeeded","isLoading","item","shouldHighlightMissingCc"],["foerch-cart-item","",3,"articleNumberMode","cartConfig","isActionColumnNeeded","isLoading","item","markItem","ngClass","shouldHighlightMissingCc","addToCart","applyCCM","articleReplaced","itemToggled","remove","updateComment","vpeAnyChanged",4,"ngIf"],["foerch-cart-item","",3,"addToCart","applyCCM","articleReplaced","itemToggled","remove","updateComment","vpeAnyChanged","articleNumberMode","cartConfig","isActionColumnNeeded","isLoading","item","markItem","ngClass","shouldHighlightMissingCc"]],template:function(t,n){if(t&1){let o=P();B(0),l(1,"div",3)(2,"div"),_(3,Xt,1,1,"foerch-checkout-info",4),m(4,"foerchCheckoutDisplayHint"),_(5,ei,4,2,"div",5),s(),l(6,"foerch-table-reset",6),S("resetSorting",function(){return x(o),v(n.onSortingReset())}),s(),l(7,"table",7)(8,"thead")(9,"tr"),_(10,ti,1,0,"th",8),l(11,"th",9),_(12,ii,3,3,"ng-container",10)(13,ni,2,4,"ng-template",null,0,V),s(),l(15,"th"),_(16,oi,3,3,"ng-container",10)(17,ri,2,4,"ng-template",null,1,V),s(),_(19,ai,3,3,"th",8)(20,ci,3,3,"th",8)(21,si,3,3,"th",8)(22,li,3,3,"th",8)(23,mi,3,3,"th",8)(24,pi,3,3,"th",11)(25,Ci,4,2,"th",11)(26,hi,1,0,"th",12),s()(),_(27,vi,5,10,"tbody",8),m(28,"async"),s()(),M()}if(t&2){let o=D(14),a=D(18);r(3),p("ngIf",n.cartConfig.cartMode===n.cartModes.CART&&d(4,17,n.checkoutInfo)),r(2),p("ngIf",n.cartConfig.showPromotions),r(),p("enabled",n.hasActiveSorting),r(4),p("ngIf",n.cartConfig.isEditable||n.cartConfig.isSelectable),r(2),p("ngIf",!(n.sortModel&&n.isColumnSortable(n.sortableColumn.ARTICLE_NUMBER)))("ngIfElse",o),r(4),p("ngIf",!(n.sortModel&&n.isColumnSortable(n.sortableColumn.ARTICLE_NAME)))("ngIfElse",a),r(3),p("ngIf",n.cartConfig.showCCM),r(),p("ngIf",n.cartConfig.showVPE),r(),p("ngIf",n.cartConfig.showVPE),r(),p("ngIf",n.cartConfig.showVPE&&n.cartConfig.isAnonymousUser!==!0),r(),p("ngIf",n.cartConfig.showRememberedAt),r(),p("ngIf",n.cartConfig.showPrice),r(),p("ngIf",n.cartConfig.showPrice),r(),p("ngIf",n.isActionColumnNeeded),r(),p("ngIf",T(21,zt,d(28,19,n.isLoading$)))}},dependencies:[Ye,L,xe,ve,Le,Ve,ke,Xe,Ke,Je,N,R,Ue,He,Ze,et],encapsulation:2,changeDetection:0}),$);tt=Kt([Ne(),Jt("design:paramtypes",[oe,ne,ee,Z])],tt);export{et as a,Ze as b,Xe as c,Ke as d,Je as e,it as f,tt as g};