import{b as q}from"./chunk-5OZTUYJC.js";import{J as z}from"./chunk-CWWVHRJU.js";import{a as b}from"./chunk-3UAMWNPB.js";import{d as U}from"./chunk-ZSVIZXE3.js";import{Ab as s,Bb as $,Cb as S,Db as g,E as B,Eb as P,Lb as v,Na as w,Ua as r,Va as f,Wc as L,Xb as C,Xc as V,Yb as m,Zb as h,_b as _,a as T,ad as D,bd as R,ga as k,gd as H,ib as d,lc as x,ob as u,oc as j,qb as A,rc as a,rg as M,s as y,sc as o,t as E,ta as O,vc as F,wc as I,yh as N,zb as p}from"./chunk-N6B2OJOY.js";var K=(t,i,e,n,c,l)=>({cart:t,areFeesEnabled:i,hasFees:e,isAustrianCustomer:n,locale:c,currency:l}),G=(t,i,e)=>[t,i,"symbol","1.2",e];function Q(t,i){t&1&&P(0)}function W(t,i){t&1&&(p(0,"div",5)(1,"div",6),$(2,"span",9),a(3,"cxTranslate"),s()()),t&2&&(r(2),u("innerHTML",o(3,1,"checkout.plusOptionalFreightPackagingToll"),w))}function X(t,i){if(t&1&&(S(0),p(1,"div",3),m(2),a(3,"cxTranslate"),s(),d(4,Q,1,0,"ng-container",4),p(5,"div",5)(6,"div",6)(7,"span",7),m(8),a(9,"cxTranslate"),s()()(),d(10,W,4,3,"div",8),g()),t&2){let e=v().ngIf,n=C(3),c=C(5);r(2),_(" ",o(3,4,"checkout.summaryTitle")," "),r(2),u("ngTemplateOutlet",e.hasFees?n:c),r(4),h(o(9,6,"checkout.exclVat")),r(2),u("ngIf",e.areFeesEnabled===!0&&e.hasFees===!1&&e.isAustrianCustomer===!0)}}function Y(t,i){if(t&1&&(p(0,"div",10)(1,"div",11)(2,"span",16),m(3),s()(),p(4,"div",11)(5,"span",17),m(6),s()()()),t&2){let e=i.$implicit;r(3),_("",e.type.name,":"),r(3),_(" ",e.value==null?null:e.value.formattedValue," ")}}function Z(t,i){if(t&1&&(S(0),d(1,Y,7,2,"div",15),g()),t&2){let e=v(2).ngIf,n=v();r(),u("ngForOf",e.cart.fees)("ngForTrackBy",n.trackByIndex)}}function ee(t,i){if(t&1&&(p(0,"div",10)(1,"div",11)(2,"span",12),m(3),a(4,"cxTranslate"),s()(),p(5,"div",11)(6,"span",13),m(7),s()()(),d(8,Z,2,2,"ng-container",2),p(9,"div",14)(10,"div",11)(11,"span",12),m(12),a(13,"cxTranslate"),s()(),p(14,"div",11)(15,"span",13),m(16),a(17,"currency"),s()()()),t&2){let e=v().ngIf;A("mb-1",e.hasFees),r(3),_("",o(4,7,"checkout.sum"),":"),r(4),h(e.cart.subTotal==null?null:e.cart.subTotal.formattedValue),r(),u("ngIf",e.hasFees),r(4),_("",o(13,9,"checkout.total"),":"),r(4),h((e.cart.totalPrice==null?null:e.cart.totalPrice.formattedValue)||F(17,11,x(17,G,e.cart.totalPrice==null?null:e.cart.totalPrice.value,e.currency,e.locale)))}}function te(t,i){if(t&1&&(p(0,"div",18)(1,"div",11)(2,"span",12),m(3),a(4,"cxTranslate"),s()(),p(5,"div",11)(6,"span",13),m(7),a(8,"currency"),s()()()),t&2){let e=v().ngIf;r(3),_("",o(4,2,"checkout.sum"),":"),r(4),h((e.cart.totalPrice==null?null:e.cart.totalPrice.formattedValue)||F(8,4,x(10,G,e.cart.totalPrice==null?null:e.cart.totalPrice.value,e.currency,e.locale)))}}function ie(t,i){if(t&1&&(S(0),d(1,X,11,8,"ng-container",2)(2,ee,18,21,"ng-template",null,0,I)(4,te,9,14,"ng-template",null,1,I),g()),t&2){let e=i.ngIf;r(),u("ngIf",e.cart)}}var he=(()=>{let i=class i{constructor(n,c,l,J){this._activeCartService=n,this._baseSiteService=c,this._currencyService=l,this._currencyLocaleService=J,this.locale$=this._currencyLocaleService.getActiveLocaleForCurrencyPipe(),this.currency$=this._currencyService.getActive(),this._subs$=new T}ngOnInit(){this.cart$=this._activeCartService.getActive(),this.hasFees$=E([this.cart$,this._baseSiteService.getActive()]).pipe(B(([n,c])=>!!n&&!!c),y(([n,c])=>{switch(c){case b.AUSTRIA:return(n.fees||[]).some(l=>l.value.value>0);default:return(n.fees||[]).length>0}})),this.areFeesEnabled$=this._baseSiteService.isCartFeesEnabledForBaseSite().pipe(k(n=>{n&&this._activeCartService.getCartFees()})),this.isAustrianCustomer$=this._baseSiteService.getActive().pipe(y(n=>n===b.AUSTRIA))}ngOnDestroy(){this._subs$.unsubscribe()}trackByIndex(n){return n}};i.\u0275fac=function(c){return new(c||i)(f(z),f(U),f(M),f(q))},i.\u0275cmp=O({type:i,selectors:[["foerch-checkout-order-summary"]],decls:7,vars:20,consts:[["withFees",""],["withoutFees",""],[4,"ngIf"],[1,"multiStepCheckout-subheadline"],[4,"ngTemplateOutlet"],[1,"row","text-end"],[1,"col"],[1,"orderSummary-footnote"],["class","row text-end",4,"ngIf"],[1,"orderSummary-footnote",3,"innerHTML"],[1,"row","justify-content-between"],[1,"col-auto"],[1,"orderSummary-label"],[1,"orderSummary-price"],[1,"row","justify-content-between","mt-1"],["class","row justify-content-between",4,"ngFor","ngForOf","ngForTrackBy"],[1,"orderSummary-label","orderSummary-label-fee"],[1,"orderSummary-price","orderSummary-price-fee"],[1,"row","justify-content-between","mt-6"]],template:function(c,l){c&1&&(d(0,ie,6,1,"ng-container",2),a(1,"async"),a(2,"async"),a(3,"async"),a(4,"async"),a(5,"async"),a(6,"async")),c&2&&u("ngIf",j(13,K,o(1,1,l.cart$),o(2,3,l.areFeesEnabled$),o(3,5,l.hasFees$),o(4,7,l.isAustrianCustomer$),o(5,9,l.locale$),o(6,11,l.currency$)))},dependencies:[L,V,D,R,H,N],encapsulation:2,changeDetection:0});let t=i;return t})();export{he as a};