import{a as vt}from"./chunk-V2JS4THH.js";import{a as gt}from"./chunk-B4H3G55F.js";import{a as xt}from"./chunk-C22Z5TAF.js";import{a as ft}from"./chunk-FKH74CIW.js";import{J as B}from"./chunk-CWWVHRJU.js";import{a as Ct}from"./chunk-77BJAEIL.js";import{a as _t}from"./chunk-RU43IR5J.js";import{d as dt}from"./chunk-ZSVIZXE3.js";import{a as ht}from"./chunk-Y7IP5WLG.js";import{I as ut}from"./chunk-SLGBXDUF.js";import{T as N}from"./chunk-FBI7JGZC.js";import{a as O}from"./chunk-ILYMG6ZI.js";import{M as mt,r as M,s as I,t as st}from"./chunk-MXUIPT66.js";import{C as pt,b as at,f as lt,l as ct}from"./chunk-DX7LHTFF.js";import{Aa as v,Ab as a,Ba as b,Bb as g,Eb as j,Fb as P,Ia as y,Ka as S,Kb as x,Kd as it,Lb as c,Na as L,Ua as n,Wg as nt,Xb as Y,Xg as rt,Yb as C,Zb as q,_b as h,ad as tt,bd as et,cc as G,dc as J,ec as K,gc as E,gf as ot,ib as _,ic as k,jb as W,lc as Q,mb as H,mc as X,o as $,ob as u,pa as f,qb as U,rc as p,s as V,sa as F,sc as s,t as R,ta as T,tb as z,ub as m,wc as Z,yh as w,zb as l,zh as A}from"./chunk-N6B2OJOY.js";var bt=(()=>{let i=class i{constructor(){this._activeCartService=f(B),this.iconTypes=O,this.sortModel=y()}printCart(){this._activeCartService.printCart(this.sortModel())}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=T({type:i,selectors:[["foerch-cart-print-button"]],inputs:{sortModel:[F.SignalBased,"sortModel"]},standalone:!0,features:[E],decls:4,vars:4,consts:[["type","button",1,"btn","btn-secondary","btn-icon_left",3,"click"],[3,"type"]],template:function(r,d){r&1&&(l(0,"button",0),x("click",function(){return d.printCart()}),g(1,"cx-icon",1),C(2),p(3,"cxTranslate"),a()),r&2&&(n(),u("type",d.iconTypes.PRINT),n(),h(" ",s(3,2,"cartDetails.printCart"),`
`))},dependencies:[A,w,I,M],encapsulation:2,changeDetection:0});let t=i;return t})();var Pt=()=>[import("./chunk-OLAOE2ES.js").then(t=>t.FoerchPromotionCodeFieldComponent)],Et=(t,i,e,o)=>({shouldShowPromotionElements:t,isLoggedIn:i,activeVoucherCode:e,isCouponEnabled:o}),kt=()=>({marginClass:"",showCheckoutButton:!0,showPrintButton:!0}),wt=(t,i,e)=>({onlyEProcurementOrders:t,eProcurementIDSWithOrder:i,isCartLoading:e}),Ft=()=>({cxRoute:"checkout"});function At(t,i){if(t&1&&(l(0,"div",10)(1,"div",14)(2,"span",15),C(3),p(4,"cxTranslate"),a(),l(5,"strong"),C(6),a()()()),t&2){let e=c(2);n(3),h("",s(4,2,"common.intermediateAmount"),": "),n(3),h(" ",e.totalPrice==null?null:e.totalPrice.formattedValue," ")}}function Mt(t,i){t&1&&(l(0,"div",11)(1,"div",16),g(2,"hr",17),a()())}function It(t,i){t&1&&g(0,"foerch-potential-promotions",12),t&2&&u("isMobile",!1)}function Ot(t,i){t&1&&g(0,"foerch-foerch-promotion-code-field")}function Bt(t,i){t&1&&(l(0,"div",11)(1,"div",23,1),_(3,Ot,1,0),W(4,3,Pt),H(1),a()())}function Dt(t,i){if(t&1&&_(0,Bt,6,0,"div",11),t&2){let e=c(2);m(0,e.isCouponEnabled?0:-1)}}function Vt(t,i){if(t&1&&(l(0,"div",11)(1,"div",20),C(2),p(3,"cxTranslate"),a(),l(4,"div",21),C(5),a()(),l(6,"div",19)(7,"div",20),C(8),p(9,"cxTranslate"),a(),l(10,"div",25),C(11),a()()),t&2){let e=c(2),o=c();n(2),h(" ",s(3,4,"common.intermediateAmount"),": "),n(3),h(" ",o.totalPrice==null?null:o.totalPrice.formattedValue," "),n(3),h(" ",s(9,6,"cartDetails.appliedCoupon"),": "),n(3),h(" ",e.activeVoucherCode||"\u2014"," ")}}function Lt(t,i){t&1&&j(0)}function Nt(t,i){if(t&1&&(l(0,"div",13)(1,"div",18),_(2,Dt,1,1)(3,Vt,12,8),l(4,"div",19)(5,"div",20),C(6),p(7,"cxTranslate"),a(),l(8,"div",21)(9,"strong"),C(10),a()()(),l(11,"div",22)(12,"div",23),_(13,Lt,1,0,"ng-container",24),a()()()()),t&2){let e=c(),o=c(),r=Y(6);n(2),m(2,e.isLoggedIn?2:-1),n(),m(3,e.isCouponEnabled?3:-1),n(3),h(" ",s(7,6,"common.netTotal"),": "),n(4),q(o.totalPrice==null?null:o.totalPrice.formattedValue),n(3),u("ngTemplateOutlet",r)("ngTemplateOutletContext",k(8,kt))}}function $t(t,i){if(t&1){let e=P();l(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"input",7),K("ngModelChange",function(r){v(e);let d=c();return J(d.selectAll,r)||(d.selectAll=r),b(r)}),x("click",function(){v(e);let r=c();return b(r.toggleSelectAll())}),a(),l(5,"label",8),C(6),p(7,"cxTranslate"),a()()(),l(8,"foerch-bulk-action",9),x("changed",function(r){v(e);let d=c();return b(d.applyAction(r))}),a(),_(9,At,7,4,"div",10),a(),_(10,Mt,3,0,"div",11)(11,It,1,1,"foerch-potential-promotions",12)(12,Nt,14,9,"div",13),a()}if(t&2){let e=c();n(4),u("disabled",e.footerConfig.disableAll),G("ngModel",e.selectAll),n(2),h(" ",s(7,9,"common.selectAll")," "),n(2),u("disableAll",e.footerConfig.disableAll)("options",e.bulkOptions),n(),m(9,e.footerConfig.showTotal?9:-1),n(),m(10,e.footerConfig.showTotal||e.footerConfig.showCheckout?10:-1),n(),m(11,i.shouldShowPromotionElements?11:-1),n(),m(12,e.footerConfig.showCheckout?12:-1)}}function Rt(t,i){if(t&1&&g(0,"foerch-cart-print-button",26),t&2){let e=c(2);u("sortModel",e.sortModel)}}function Wt(t,i){if(t&1&&(l(0,"button",27,2),p(2,"cxTranslate"),g(3,"cx-icon",29),a()),t&2){let e=c(4);u("ngbPopover",s(2,2,"cartDetails.cartContainsNonPurchasableProducts")),n(3),u("type",e.iconTypes.INFO)}}function Ht(t,i){t&1&&g(0,"cx-spinner",31)}function Ut(t,i){if(t&1&&(l(0,"button",30),p(1,"cxUrl"),_(2,Ht,1,0,"cx-spinner",31),C(3),p(4,"cxTranslate"),a()),t&2){let e=c(2),o=c(2);U("btn-loading",e.isCartLoading||o.isNavigatingToCheckout()),u("disabled",e.isCartLoading||o.isNavigatingToCheckout()||o.footerConfig.disableAll||o.hasAnyDeletedArticle||!o.footerConfig.showCheckout||o.shouldDisableElements)("routerLink",s(1,6,k(10,Ft))),n(2),m(2,e.isCartLoading||o.isNavigatingToCheckout()?2:-1),n(),h(" ",s(4,8,"cartDetails.proceedToCheckout")," ")}}function zt(t,i){if(t&1&&_(0,Wt,4,4,"button",27)(1,Ut,5,11,"button",28),t&2){let e=c(2).showCheckoutButton,o=c();m(0,o.hasAnyDeletedArticle?0:-1),n(),m(1,e?1:-1)}}function jt(t,i){if(t&1){let e=P();l(0,"button",33),x("click",function(){v(e);let r=c(4);return b(r.transferCart())}),C(1),p(2,"cxTranslate"),a()}t&2&&(n(),h(" ",s(2,1,"cartDetails.transferCart")," "))}function Yt(t,i){if(t&1){let e=P();l(0,"button",34),p(1,"cxTranslate"),x("click",function(){v(e);let r=c(4);return b(r.transferCart())}),a(),g(2,"button",35),p(3,"cxTranslate"),p(4,"cxUrl")}if(t&2){let e=c(4);u("innerHTML",s(1,4,"cartDetails.transferCartWithoutOrder"),L),n(2),u("disabled",e.footerConfig.disableAll||e.hasAnyDeletedArticle||e.isNavigatingToCheckout())("innerHTML",s(3,6,"cartDetails.transferCartWithOrder"),L)("routerLink",s(4,8,k(10,Ft)))}}function qt(t,i){if(t&1&&_(0,jt,3,3,"button",32)(1,Yt,5,11),t&2){let e=c();m(0,e.eProcurementIDSWithOrder?-1:0),n(),m(1,e.eProcurementIDSWithOrder?1:-1)}}function Gt(t,i){if(t&1&&_(0,zt,2,2)(1,qt,2,2),t&2){let e=c(2);m(0,e.isEProcurementCart||i.onlyEProcurementOrders?1:0)}}function Jt(t,i){if(t&1&&(l(0,"div"),_(1,Rt,1,1,"foerch-cart-print-button",26)(2,Gt,2,1),p(3,"async"),p(4,"async"),p(5,"async"),a()),t&2){let e,o=i.marginClass,r=i.showPrintButton,d=c();z("text-end ",o,""),n(),m(1,r?1:-1),n(),m(2,(e=Q(11,wt,s(3,5,d.onlyEProcurementOrders$),s(4,7,d.canEProcurementIDSWithOrder$),s(5,9,d.isCartLoading$)))?2:-1,e)}}var we=(()=>{let i=class i{constructor(){this.modalService=f(ht),this.activeCartService=f(B),this.promotionsService=f(gt),this.permissionService=f(_t),this.authService=f(ot),this.voucherService=f(xt),this.baseSiteService=f(dt),this.iconTypes=O,this.selectAll=!1,this.hasAnyDeletedArticle=!1,this.isEProcurementCart=!1,this.shouldDisableElements=!1,this.applyBulkAction=new S,this.markToggle=new S,this.transferEProcurementCart=new S,this.isNavigatingToCheckout=y(!1),this.onlyEProcurementOrders$=this.permissionService.getPermissionValueAsBoolean(N.EPROCUREMENT_ORDERS),this.canEProcurementIDSWithOrder$=this.permissionService.getPermissionValueAsBoolean(N.EPROCUREMENT_IDS_WITH_ORDER),this.isCartLoading$=this.activeCartService.isLoading(),this.isLoggedIn$=this.authService.isUserLoggedIn(),this.activeVoucherCode$=this.voucherService.getAppliedVoucherCode(),this.isCouponEnabled$=this.baseSiteService.isCouponCodeEnabledForBaseSite()}set footerConfig(o){this._footerConfig=o,this._configShowPromotions$=$(o.showPromotions||!1)}get footerConfig(){return this._footerConfig}ngOnInit(){this._hasPromotionItems$=this.promotionsService.getFreeProductsFromPotentialOrderPromotions().pipe(V(o=>!!o&&o.length>0)),this.shouldShowPromotionElements$=R([this._hasPromotionItems$,this._configShowPromotions$]).pipe(V(([o,r])=>o&&r))}applyAction(o){this.applyBulkAction.emit(o)}toggleSelectAll(){this.markToggle.emit()}transferCart(){this.transferEProcurementCart.emit()}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=T({type:i,selectors:[["foerch-cart-footer"]],inputs:{bulkOptions:"bulkOptions",totalPrice:"totalPrice",selectAll:"selectAll",sortModel:"sortModel",footerConfig:"footerConfig",hasAnyDeletedArticle:"hasAnyDeletedArticle",isEProcurementCart:"isEProcurementCart",shouldDisableElements:"shouldDisableElements",isNavigatingToCheckout:[F.SignalBased,"isNavigatingToCheckout"]},outputs:{applyBulkAction:"applyBulkAction",markToggle:"markToggle",transferEProcurementCart:"transferEProcurementCart"},standalone:!0,features:[E],decls:7,vars:14,consts:[["buttons",""],["checkoutBlock",""],["p","ngbPopover"],[1,"container"],[1,"row","mt-2","align-items-center"],[1,"col-auto"],[1,"form-check","form-checkbox"],["id","markAll","name","markAll","type","checkbox","role","checkbox",1,"form-check-input",3,"ngModelChange","click","disabled","ngModel"],["for","markAll",1,"form-check-label"],[3,"changed","disableAll","options"],[1,"col-auto","ms-auto","align-self-start"],[1,"row"],[3,"isMobile"],[1,"row","cart-summary-row"],[1,"cartTotal","text-end","mt-1"],[1,"cartTotal-label"],[1,"col-12"],[1,"cart-hr"],[1,"col-4","offset-md-8","cart-summary"],[1,"row","mt-1"],[1,"col-8","cartTotal-label","text-end"],[1,"col-4","cartTotal","text-end"],[1,"row","mt-2"],[1,"col"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"col-4","cartTotal-label","text-end"],[1,"me-2",3,"sortModel"],["container","body","placement","left","triggers","mouseenter:mouseleave:click","type","button",1,"btn-icon","me-2",3,"ngbPopover"],["type","button",1,"btn","btn-commerce",3,"btn-loading","disabled","routerLink"],[3,"type"],["type","button",1,"btn","btn-commerce",3,"disabled","routerLink"],[1,"spinner_small"],["type","button",1,"btn","btn-primary"],["type","button",1,"btn","btn-primary",3,"click"],["type","button",1,"btn","btn-primary","me-1",3,"click","innerHTML"],["type","button",1,"btn","btn-primary","toDelivery",3,"disabled","innerHTML","routerLink"]],template:function(r,d){if(r&1&&(_(0,$t,13,11,"div",3),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),_(5,Jt,6,15,"ng-template",null,0,Z)),r&2){let D;m(0,(D=X(9,Et,s(1,1,d.shouldShowPromotionElements$),s(2,3,d.isLoggedIn$),s(3,5,d.activeVoucherCode$),s(4,7,d.isCouponEnabled$)))?0:-1,D)}},dependencies:[et,bt,vt,ft,Ct,pt,at,lt,ct,A,w,I,M,ut,tt,it,mt,st,rt,nt],styles:[".form-checkbox[_ngcontent-%COMP%]{margin-bottom:0;margin-left:16px}.cartTotal[_ngcontent-%COMP%]{font-size:18px;margin-top:2px;line-height:22px;vertical-align:baseline}.cartTotal[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-weight:300;margin-right:16px}@media (max-width: 991.98px){.cartTotal[_ngcontent-%COMP%]{line-height:1.43;padding:16px 0;display:flex;justify-content:space-between;align-items:center}}.cartTotal-label[_ngcontent-%COMP%]{font-size:14px;line-height:22px;margin-top:2px}.cart-hr[_ngcontent-%COMP%]{margin:16px 0 0;border:0 #999999;border-top:1px solid;opacity:.4}.cart-summary[_ngcontent-%COMP%]{background-color:#fff;padding:16px;margin-top:16px}.cart-summary-row[_ngcontent-%COMP%]{margin-right:0}"],changeDetection:0});let t=i;return t})();export{bt as a,we as b};