(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{arOB:function(t,e,n){"use strict";n.r(e),n.d(e,"PdpPageModule",function(){return nn});var i=n("sYmb"),c=n("AcyG"),a=n("PCNd"),s=n("2qik"),o=n("0zz2"),l=n("r6SO"),d=n("4mdi"),r=n("ZD0A"),u=n("A7ro"),b=n("gSya"),p=n("KrAf"),h=n("tyNb"),g=n("9NBX"),v=n("mrSG"),m=n("quSY"),f=n("2Vo4"),y=n("/z64"),S=n("MuyG"),T=n("0HVQ"),E=n("1ylV"),A=n("2Njn"),O=n("rhm1"),C=n("8slg"),k=n("fXoL"),M=n("9IMQ"),I=n("3Yxx"),w=n("K8J1"),P=n("2hg7"),L=n("3jvs"),B=n("yydN"),D=n("EP1h"),U=n("SJeB"),_=n("+hSf"),x=n("VHwl"),R=n("ofXK"),Q=n("gCTF"),V=n("MYMn"),z=n("QxsG"),F=n("XkHM");let N=(()=>{class t{constructor(t,e){this.store=t,this.uihelper=e,this.product=null,this.bundleQuantitySelectionMap=new Map,this.open=!1,this.closeModalEvent=new k.n,this.shopList=new z.a,this.isModalClassAlreadyApplied=!1}ngOnChanges(t){t&&t.open&&this.applyModalClass()}applyModalClass(){this.open?(this.isModalClassAlreadyApplied=this.uihelper.isModalClassApplied(),this.isModalClassAlreadyApplied||this.uihelper.onInitPopup()):this.isModalClassAlreadyApplied||this.uihelper.onClosePopup()}addShopListHandler(t){if(t)if(this.product.isBundleProduct){const e=new T.a(null);e.parentProduct=new S.a(this.product.code,1);for(const t of this.bundleQuantitySelectionMap.keys())for(const n of this.bundleQuantitySelectionMap.get(t))e.kitChildProducts.push(new S.a(n.code,n.quantity,n.kitProductIdentifier));this.store.dispatch(new O.f({shopList:t,bundle:e}))}else this.store.dispatch(new O.e({shopList:t,productList:this.product?[this.product]:[]}))}closeModalEventHandler(t){this.closeModalEvent.emit(t)}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(c.f),k.Nb(I.a))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-create-new-list"]],inputs:{product:"product",bundleQuantitySelectionMap:"bundleQuantitySelectionMap",open:"open"},outputs:{closeModalEvent:"closeModalEvent"},features:[k.yb],decls:1,vars:2,consts:[[3,"open","shopList","updatedShopListDetails","closeModalEvent"]],template:function(t,e){1&t&&(k.Tb(0,"app-shop-list-form",0),k.ac("updatedShopListDetails",function(t){return e.addShopListHandler(t)})("closeModalEvent",function(t){return e.closeModalEventHandler(t)}),k.Sb()),2&t&&k.gc("open",e.open)("shopList",e.shopList)},directives:[F.a],styles:[""],changeDetection:0}),t})();var H=n("vzU1"),$=n("668k"),j=n("pCJ9");function q(t,e){if(1&t&&(k.Tb(0,"div",7),k.Bc(1),k.Sb()),2&t){const t=k.cc().$implicit;k.Ab(1),k.Dc(" ",t.label,"")}}function G(t,e){if(1&t){const t=k.Ub();k.Tb(0,"a",8),k.ac("click",function(){k.tc(t);const e=k.cc().$implicit;return k.cc(2).navigate(e)}),k.Bc(1),k.Sb()}if(2&t){const t=k.cc().$implicit;k.Bb("aria-label","navigate to"+(null==t?null:t.label)),k.Ab(1),k.Dc(" ",t.label,"")}}const J=function(t){return{active:t}};function K(t,e){if(1&t&&(k.Rb(0),k.Tb(1,"div",4),k.zc(2,q,2,1,"div",5),k.zc(3,G,2,2,"ng-template",null,6,k.Ac),k.Sb(),k.Qb()),2&t){const t=e.$implicit,n=k.rc(4);k.Ab(1),k.gc("ngClass",k.lc(3,J,t.isActive)),k.Ab(1),k.gc("ngIf",t.isActive)("ngIfElse",n)}}function Y(t,e){if(1&t&&(k.Tb(0,"div",2),k.zc(1,K,5,5,"ng-container",3),k.Sb()),2&t){const t=k.cc();k.Ab(1),k.gc("ngForOf",t.history)}}function X(t,e){if(1&t&&(k.Rb(0),k.Tb(1,"div",11),k.Bc(2),k.Sb(),k.Qb()),2&t){const t=e.$implicit;k.Ab(1),k.gc("ngClass",k.lc(2,J,t.isActive)),k.Ab(1),k.Cc(t.label)}}function W(t,e){if(1&t){const t=k.Ub();k.Tb(0,"div",9),k.zc(1,X,3,4,"ng-container",3),k.Sb(),k.Tb(2,"div",10),k.ac("click",function(){return k.tc(t),k.cc().navigateToPreviousRoute()}),k.Sb()}if(2&t){const t=k.cc();k.Ab(1),k.gc("ngForOf",t.history)}}let Z=(()=>{class t{constructor(t){this.router=t,this.isPdpBreadcrumb=!1}ngOnInit(){}navigate(t){t&&t.value&&this.router.navigateByUrl(t.value)}navigateToPreviousRoute(){const t=this.history.findIndex(t=>!0===t.isActive);t>0&&this.router.navigateByUrl(this.history[t-1].value)}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(h.g))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-breadcrumb"]],inputs:{history:"history",isPdpBreadcrumb:"isPdpBreadcrumb"},decls:3,vars:2,consts:[["class","breadcrumb-bar visible-desktop",4,"ngIf","ngIfElse"],["nonPdpBreadcrumb",""],[1,"breadcrumb-bar","visible-desktop"],[4,"ngFor","ngForOf"],[1,"breadcrumb-bar-list",3,"ngClass"],["class","breadcrumb-bar-list-text",4,"ngIf","ngIfElse"],["nonactive",""],[1,"breadcrumb-bar-list-text"],[1,"breadcrumb-bar-list-text",3,"click"],[1,"amway-breadcrumb","visible-desktop"],[1,"shop-list-btn-back","visible-mobile",3,"click"],[1,"amway-bc-list",3,"ngClass"]],template:function(t,e){if(1&t&&(k.zc(0,Y,2,1,"div",0),k.zc(1,W,3,1,"ng-template",null,1,k.Ac)),2&t){const t=k.rc(2);k.gc("ngIf",e.isPdpBreadcrumb)("ngIfElse",t)}},directives:[R.l,R.k,R.j],styles:[""]}),t})();var tt=n("+nbM"),et=n("pWfY"),nt=n("bhfF"),it=n("O0k0");const ct=["carousel"],at=function(t){return{"is-active":t}};function st(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"div",6),k.ac("click",function(){k.tc(t);const n=e.index;return k.cc().onThumbnailClick(n)}),k.Tb(2,"div",7),k.Ob(3,"app-image-loader",8),k.Sb(),k.Sb(),k.Qb()}if(2&t){const t=e.$implicit,n=e.index,i=k.cc();k.Ab(1),k.gc("ngClass",k.lc(4,at,i.clickedIndex===n)),k.Ab(2),k.Db("amway-dic-img"),k.gc("src",null==t?null:t.url)}}function ot(t,e){if(1&t&&(k.Tb(0,"div",10),k.Tb(1,"div",11),k.Ob(2,"app-image-loader",8),k.Sb(),k.Sb()),2&t){const t=k.cc().$implicit;k.Ab(2),k.Db("amway-dic-img"),k.gc("src",null==t?null:t.url)}}function lt(t,e){1&t&&(k.Rb(0),k.zc(1,ot,3,3,"ng-template",9),k.Qb())}let dt=(()=>{class t{constructor(){this.images=[],this.thumbImages=[],this.productImages=[],this.productDetailImageCarousel=tt.Q,this.clickedIndex=0}ngOnInit(){this.setImages()}setImages(){const t=this.images.filter(t=>t.imageType===et.a.GALLERY&&t.format===et.a.THUMBNAIL),e=t.find(t=>0===t.galleryIndex),n=t.find(t=>1===t.galleryIndex);this.thumbImages=[],e&&this.thumbImages.push(e),n&&this.thumbImages.push(n);const i=this.images.filter(t=>t.imageType===et.a.GALLERY&&t.format===et.a.PRODUCT),c=i.find(t=>0===t.galleryIndex),a=i.find(t=>1===t.galleryIndex);this.productImages=[],c&&this.productImages.push(c),a&&this.productImages.push(a)}onThumbnailClick(t){const e=t-this.clickedIndex;this.slideTo(Math.abs(e),e>0?"next":"prev"),this.clickedIndex=t}slideTo(t,e){if("next"===e)for(let n=0;n<t;n++)this.carousel.next();else for(let n=0;n<t;n++)this.carousel.prev()}afterImageChange(t){t&&null!=t.startPosition&&this.onThumbnailClick(t.startPosition)}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=k.Hb({type:t,selectors:[["app-product-detail-image"]],viewQuery:function(t,e){if(1&t&&k.Hc(ct,!0),2&t){let t;k.qc(t=k.bc())&&(e.carousel=t.first)}},inputs:{images:"images"},decls:7,vars:3,consts:[[1,"amway-detail-img-box"],[1,"amway-detail-img-list"],[4,"ngFor","ngForOf"],[1,"amway-detail-img"],[3,"options","changed"],["carousel",""],[1,"item","slick-active",3,"ngClass","click"],[1,"amway-detail-img-card-list"],[3,"src"],["carouselSlide",""],[1,"item"],[1,"amway-detail-img-card"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.zc(2,st,4,6,"ng-container",2),k.Sb(),k.Tb(3,"div",3),k.Tb(4,"owl-carousel-o",4,5),k.ac("changed",function(t){return e.afterImageChange(t)}),k.zc(6,lt,2,0,"ng-container",2),k.Sb(),k.Sb(),k.Sb()),2&t&&(k.Ab(2),k.gc("ngForOf",e.thumbImages),k.Ab(2),k.gc("options",e.productDetailImageCarousel),k.Ab(2),k.gc("ngForOf",e.productImages))},directives:[R.k,nt.a,R.j,it.a,nt.c],styles:[""],changeDetection:0}),t})();var rt=n("LyJQ"),ut=n("z21p"),bt=n("VOyT"),pt=n("Ba6S"),ht=n("Vurf"),gt=n("/rjk"),vt=n("jhN1");const mt=function(t){return{"--selected":t}};function ft(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"div",6),k.ac("click",function(){k.tc(t);const n=e.$implicit;return k.cc().updateSelectedVariantOption(n)}),k.Ob(2,"app-image-loader",7),k.Sb(),k.Qb()}if(2&t){const t=e.$implicit,n=k.cc();k.Ab(1),k.gc("ngClass",k.lc(6,mt,(null==n.selectedVariantOption?null:n.selectedVariantOption.name)===(null==t?null:t.name))),k.Bb("data-value",null==t?null:t.name)("data-text",null==t?null:t.name),k.Ab(1),k.Db("mz-image sco-img"),k.gc("src",null==t?null:t.variantOptionQualifierImageUrl)}}let yt=(()=>{class t{constructor(){this.product=new E.a,this.variantSelectionEvent=new k.n,this.selectedVariantOption=null}ngOnInit(){this.setSelectedVariantOption()}setSelectedVariantOption(){this.product&&this.product.code&&this.product.variantOptions&&this.product.variantOptions.length>0&&(this.selectedVariantOption=this.product.variantOptions.find(t=>t.isSelected)),this.variantSelectionEvent.emit(this.selectedVariantOption)}updateSelectedVariantOption(t){t&&this.product&&this.product.variantOptions&&this.product.variantOptions.length>0&&this.product.variantOptions.forEach(e=>{e.code===t.code?(e.isSelected=!0,this.selectedVariantOption=e):e.isSelected=!1}),this.variantSelectionEvent.emit(this.selectedVariantOption)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=k.Hb({type:t,selectors:[["app-color-variant-product-detail"]],inputs:{product:"product"},outputs:{variantSelectionEvent:"variantSelectionEvent"},decls:9,vars:5,consts:[[1,"amway-dt-select-color"],[1,"amway-dt-select-color-header"],[1,"amway-dt-select-color-title"],[1,"amway-dt-select-color-text"],[1,"amway-dt-select-color-menu"],[4,"ngFor","ngForOf"],[1,"amway-dt-select-color-option",3,"ngClass","click"],[3,"src"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.Tb(2,"div",2),k.Bc(3),k.dc(4,"translate"),k.Sb(),k.Tb(5,"div",3),k.Bc(6),k.Sb(),k.Sb(),k.Tb(7,"div",4),k.zc(8,ft,3,8,"ng-container",5),k.Sb(),k.Sb()),2&t&&(k.Ab(3),k.Dc(" ",k.ec(4,3,"PRODUCT_DETAIL.choose_color")," : "),k.Ab(3),k.Dc(" ",null==e.selectedVariantOption?null:e.selectedVariantOption.name," "),k.Ab(2),k.gc("ngForOf",null==e.product?null:e.product.variantOptions))},directives:[R.k,R.j,it.a],pipes:[i.c],styles:[""],changeDetection:0}),t})();var St=n("k5B0"),Tt=n("3Pt+");function Et(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-dropdown",5),k.ac("ngModelChange",function(e){return k.tc(t),k.cc().selectedVariantOption=e})("changeEvent",function(){return k.tc(t),k.cc().onVariantChange()}),k.Sb()}if(2&t){const t=k.cc();k.gc("options",t.product.variantOptions)("ngModel",t.selectedVariantOption)}}let At=(()=>{class t{constructor(){this.product=new E.a,this.variantSelectionEvent=new k.n,this.selectedVariantOption=null}ngOnInit(){this.setSelectedVariantOption()}setSelectedVariantOption(){this.product&&this.product.code&&this.product.variantOptions&&this.product.variantOptions.length>0&&(this.selectedVariantOption=this.product.variantOptions.find(t=>t.isSelected)),this.variantSelectionEvent.emit(this.selectedVariantOption)}onVariantChange(){this.selectedVariantOption&&this.product&&this.product.variantOptions&&this.product.variantOptions.length>0&&this.product.variantOptions.forEach(t=>{t.isSelected=t.code===this.selectedVariantOption.code}),this.variantSelectionEvent.emit(this.selectedVariantOption)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=k.Hb({type:t,selectors:[["app-non-color-variant-product-detail"]],inputs:{product:"product"},outputs:{variantSelectionEvent:"variantSelectionEvent"},decls:7,vars:4,consts:[[1,"amway-dt-select-flavour"],[1,"amway-dt-select-flavour-header"],[1,"amway-dt-select-flavour-title"],[1,"mz-cart-item__left-section"],["optionLabel","name",3,"options","ngModel","ngModelChange","changeEvent",4,"ngIf"],["optionLabel","name",3,"options","ngModel","ngModelChange","changeEvent"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.Tb(2,"div",2),k.Bc(3),k.dc(4,"translate"),k.Sb(),k.Sb(),k.Tb(5,"section",3),k.zc(6,Et,1,2,"app-dropdown",4),k.Sb(),k.Sb()),2&t&&(k.Ab(3),k.Dc(" ",k.ec(4,2,"PRODUCT_DETAIL.choose_flavor")," "),k.Ab(3),k.gc("ngIf",null==e.product?null:e.product.variantOptions))},directives:[R.l,St.a,Tt.i,Tt.l],pipes:[i.c],styles:[""],changeDetection:0}),t})();function Ot(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-color-variant-product-detail",1),k.ac("variantSelectionEvent",function(e){return k.tc(t),k.cc().onVariantChange(e)}),k.Sb()}if(2&t){const t=k.cc();k.gc("product",t.product)}}function Ct(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-non-color-variant-product-detail",1),k.ac("variantSelectionEvent",function(e){return k.tc(t),k.cc().onVariantChange(e)}),k.Sb()}if(2&t){const t=k.cc();k.gc("product",t.product)}}let kt=(()=>{class t{constructor(){this.product=new E.a,this.variantSelectionEvent=new k.n}ngOnInit(){}onVariantChange(t){this.variantSelectionEvent.emit(t)}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=k.Hb({type:t,selectors:[["app-variant-product-detail"]],inputs:{product:"product"},outputs:{variantSelectionEvent:"variantSelectionEvent"},decls:2,vars:2,consts:[[3,"product","variantSelectionEvent",4,"ngIf"],[3,"product","variantSelectionEvent"]],template:function(t,e){1&t&&(k.zc(0,Ot,1,1,"app-color-variant-product-detail",0),k.zc(1,Ct,1,1,"app-non-color-variant-product-detail",0)),2&t&&(k.gc("ngIf",null==e.product?null:e.product.isColorVariant),k.Ab(1),k.gc("ngIf",!(null!=e.product&&e.product.isColorVariant)))},directives:[R.l,yt,At],styles:[""],changeDetection:0}),t})();var Mt=n("4Kj8"),It=n("nCwy"),wt=n("Sx+G");function Pt(t,e){if(1&t&&(k.Tb(0,"div",11),k.Ob(1,"div",12),k.Tb(2,"div",13),k.Bc(3),k.dc(4,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc().$implicit;k.gc("ngClass",null==t?null:t.stockLevelStyle),k.Ab(3),k.Ec(" ",k.ec(4,3,"SHOPLIST_DETAIL."+(null==t?null:t.stockLevelStatus))," ",null==t?null:t.deliveryDate," ")}}function Lt(t,e){if(1&t&&(k.Rb(0),k.Tb(1,"div",5),k.Tb(2,"div",6),k.Tb(3,"div",7),k.Bc(4),k.Sb(),k.zc(5,Pt,5,5,"div",8),k.Sb(),k.Tb(6,"div",9),k.Bc(7),k.dc(8,"translate"),k.Sb(),k.Tb(9,"div",10),k.Bc(10),k.dc(11,"priceFormatter"),k.dc(12,"translate"),k.dc(13,"priceFormatter"),k.dc(14,"translate"),k.Sb(),k.Sb(),k.Qb()),2&t){const t=e.$implicit,n=k.cc();k.Ab(4),k.Dc(" ",null==t?null:t.description," "),k.Ab(1),k.gc("ngIf",null==t?null:t.stockLevelStatus),k.Ab(2),k.Ec(" ",k.ec(8,6,"COMMON.multiplier"),"",t.quantity," "),k.Ab(2),k.gc("ngClass",n.isCustomerLoggedIn?t.retailPriceValue>0?"":"free":t.priceValue>0?"":"free"),k.Ab(1),k.Dc(" ",n.isCustomerLoggedIn?t.totalRetailPrice>0?k.ec(13,12,t.totalRetailPrice):k.ec(14,14,"COMMON.free"):t.totalPrice>0?k.ec(11,8,t.totalPrice):k.ec(12,10,"COMMON.free")," ")}}const Bt=function(t){return{selected:t}};let Dt=(()=>{class t{constructor(t){this.authService=t,this.expanded=!0,this.isCustomerLoggedIn=!1}ngOnInit(){this.isCustomerLoggedIn=this.authService.isRoleAvailable(rt.a.CUSTOMER)}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(ht.a))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-bundle-product-detail-summary"]],inputs:{bundleSummaryItems:"bundleSummaryItems"},decls:7,vars:10,consts:[[1,"selected-item-bundle"],[1,"selected-item-bundle-header",3,"ngClass","click"],[1,"selected-item-bundle-title"],[1,"selected-item-bundle-content",3,"ngClass"],[4,"ngFor","ngForOf"],[1,"selected-item-bundle-list"],[1,"selected-item-bundle-list-info"],[1,"selected-item-bundle-list-name"],["class","select-bundle-status",3,"ngClass",4,"ngIf"],[1,"selected-item-bundle-list-count"],[1,"selected-item-bundle-list-price",3,"ngClass"],[1,"select-bundle-status",3,"ngClass"],[1,"select-bundle-status-icon"],[1,"select-bundle-status-text"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.ac("click",function(){return e.isCustomerLoggedIn?"":e.expanded=!e.expanded}),k.Tb(2,"div",2),k.Bc(3),k.dc(4,"translate"),k.Sb(),k.Sb(),k.Tb(5,"div",3),k.zc(6,Lt,15,16,"ng-container",4),k.Sb(),k.Sb()),2&t&&(k.Ab(1),k.gc("ngClass",k.lc(6,Bt,e.expanded)),k.Ab(2),k.Dc(" ",k.ec(4,4,"PRODUCT_DETAIL.summary_header")," "),k.Ab(2),k.gc("ngClass",k.lc(8,Bt,e.expanded)),k.Ab(1),k.gc("ngForOf",e.bundleSummaryItems))},directives:[R.j,R.k,R.l],pipes:[i.c,wt.a],styles:[".select-bundle-status.--available[_ngcontent-%COMP%]   .select-bundle-status-icon[_ngcontent-%COMP%]{background:url(available-mb.bd2c70d7b8038945429d.svg)}.select-bundle-status.--onShop[_ngcontent-%COMP%]   .select-bundle-status-icon[_ngcontent-%COMP%]{background:url(shop-only.4adc9c21a1121a93548e.svg)}.select-bundle-status.--onShop[_ngcontent-%COMP%]{color:#38539a}"],changeDetection:0}),t})();function Ut(t,e){if(1&t&&(k.Tb(0,"div",11),k.Ob(1,"div",12),k.Tb(2,"div",13),k.Bc(3),k.dc(4,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc();k.gc("ngClass",null==t.childEntry?null:t.childEntry.stockLevelStyle),k.Ab(3),k.Ec(" ",k.ec(4,3,"SHOPLIST_DETAIL."+(null==t.childEntry?null:t.childEntry.stockLevelStatus))," ",null==t.childEntry?null:t.childEntry.deliveryDate," ")}}const _t=function(t){return{set_zero:t}},xt=function(t,e){return{"disable-up":t,"disable-down":e}};let Rt=(()=>{class t{constructor(t){this.cd=t,this.childEntry=null,this.maxQtyReached=!1,this.value=0,this.updateBundleVariantChildQuantityEvent=new k.n,this.min=0,this.disableUp=!1,this.disableDown=!1}ngOnInit(){this.updateStepperState()}ngOnChanges(){this.updateStepperState()}changeChildEntryQuantity(t){null!=t&&(this.updateBundleVariantChildQuantityEvent.emit({variantCode:this.childEntry.code,variantQty:t}),this.updateStepperState())}updateStepperState(){this.disableUp=this.maxQtyReached,this.disableDown=this.value<=0}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(k.h))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-bundle-product-multi-variant-child-detail"]],inputs:{childEntry:"childEntry",maxQtyReached:"maxQtyReached",max:"max",value:"value"},outputs:{updateBundleVariantChildQuantityEvent:"updateBundleVariantChildQuantityEvent"},features:[k.yb],decls:12,vars:18,consts:[[1,"select-bundle-select-content-input"],[1,"select-bundle-select-detail"],[1,"select-bundle-select-detail-pic"],[3,"src"],[1,"select-bundle-select-detail-info"],[1,"select-bundle-select-detail-name"],["class","select-bundle-status",3,"ngClass",4,"ngIf"],[1,"select-bundle-select-input"],[1,"mz-integer-input"],[1,"bundle_input","--active","sop_dt","stepH3em",3,"ngClass"],[3,"min","value","max","isDebounceReq","ngClass","disabled","showDeleteButton","changeEvent"],[1,"select-bundle-status",3,"ngClass"],[1,"select-bundle-status-icon"],[1,"select-bundle-status-text"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.Tb(2,"div",2),k.Ob(3,"app-image-loader",3),k.Sb(),k.Tb(4,"div",4),k.Tb(5,"div",5),k.Bc(6),k.Sb(),k.zc(7,Ut,5,5,"div",6),k.Sb(),k.Sb(),k.Tb(8,"div",7),k.Tb(9,"div",8),k.Tb(10,"div",9),k.Tb(11,"app-spinner",10),k.ac("changeEvent",function(t){return e.changeChildEntryQuantity(t)}),k.Sb(),k.Sb(),k.Sb(),k.Sb(),k.Sb()),2&t&&(k.Ab(3),k.Db("select-bundle-select-detail-img"),k.gc("src",null==e.childEntry?null:e.childEntry.imageUrl),k.Ab(3),k.Dc(" ",null==e.childEntry?null:e.childEntry.description," "),k.Ab(1),k.gc("ngIf",null==e.childEntry?null:e.childEntry.stockLevelStatus),k.Ab(3),k.gc("ngClass",k.lc(13,_t,0===e.value)),k.Ab(1),k.gc("min",e.min)("value",e.value)("max",e.max)("isDebounceReq",!1)("ngClass",k.mc(15,xt,e.disableUp&&!e.disableDown,e.disableDown&&!e.disableUp))("disabled",e.disableUp&&e.disableDown)("showDeleteButton",!1))},directives:[it.a,R.l,R.j,Mt.a],pipes:[i.c],styles:[".select-bundle-status.--available[_ngcontent-%COMP%]   .select-bundle-status-icon[_ngcontent-%COMP%]{background:url(available-mb.bd2c70d7b8038945429d.svg)}.select-bundle-status.--onShop[_ngcontent-%COMP%]   .select-bundle-status-icon[_ngcontent-%COMP%]{background:url(shop-only.4adc9c21a1121a93548e.svg)}.select-bundle-status.--onShop[_ngcontent-%COMP%]{color:#38539a}"],changeDetection:0}),t})();function Qt(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"app-bundle-product-multi-variant-child-detail",11),k.ac("updateBundleVariantChildQuantityEvent",function(e){return k.tc(t),k.cc(2).updateBundleVariantChildQty(e)}),k.Sb(),k.Qb()}if(2&t){const t=e.$implicit,n=k.cc(2);k.Ab(1),k.gc("childEntry",t)("max",(null==n.kitEntry?null:n.kitEntry.configuredQty)-n.usedQty+t.quantity)("maxQtyReached",n.usedQty===n.kitEntry.configuredQty||n.isMaxQtyReached)("value",t.quantity)}}function Vt(t,e){if(1&t&&(k.Rb(0),k.zc(1,Qt,2,4,"ng-container",10),k.Qb()),2&t){const t=k.cc();k.Ab(1),k.gc("ngForOf",t.bundleChildEntries)}}let zt=(()=>{class t{constructor(t){this.cd=t,this.kitEntry=null,this.bundleMultiVariantQuantityUpdateEvent=new k.n,this.usedQty=0,this.isMaxQtyReached=!1,this.bundleChildEntries=[],this.subscriptions=new m.a}ngOnInit(){if(this.kitEntry&&this.kitEntry.entry&&this.kitEntry.entry.variants&&this.kitEntry.entry.variants.length>0)for(const t of this.kitEntry.entry.variants)this.bundleChildEntries.push(new It.a(t,0,this.kitEntry.code));this.calcualteUsedQuantity()}calcualteUsedQuantity(){let t=0;for(const e of this.bundleChildEntries)t+=e.quantity;this.usedQty=t,this.cd.detectChanges()}updateBundleVariantChildQty(t){this.bundleChildEntries.filter(e=>e.code===t.variantCode).forEach(e=>e.quantity=t.variantQty),this.calcualteUsedQuantity(),this.bundleMultiVariantQuantityUpdateEvent.emit(this.bundleChildEntries)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(k.h))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-bundle-product-multi-variant-detail"]],inputs:{kitEntry:"kitEntry"},outputs:{bundleMultiVariantQuantityUpdateEvent:"bundleMultiVariantQuantityUpdateEvent"},decls:17,vars:11,consts:[[1,"select-bundle-selector"],["type","hidden","min","0","max","3","value","0","id","set-01",1,"select-bundle-count-input"],[1,"select-bundle-title"],[1,"select-bundle-count-area"],[1,"select-bundle-count"],[1,"select-bundle-count-select"],[1,"select-bundle-count-total"],[1,"select-bundle-detail"],[1,"select-bundle-select-content"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"childEntry","max","maxQtyReached","value","updateBundleVariantChildQuantityEvent"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Ob(1,"input",1),k.Tb(2,"div",2),k.Bc(3),k.Sb(),k.Tb(4,"div",3),k.Tb(5,"div",4),k.Tb(6,"div",5),k.Bc(7),k.Sb(),k.Bc(8,"/ "),k.Tb(9,"div",6),k.Bc(10),k.Sb(),k.Sb(),k.Sb(),k.Tb(11,"div",7),k.Bc(12),k.dc(13,"translate"),k.dc(14,"translate"),k.Sb(),k.Tb(15,"div",8),k.zc(16,Vt,2,1,"ng-container",9),k.Sb(),k.Sb()),2&t&&(k.Ab(3),k.Dc(" ",null==e.kitEntry||null==e.kitEntry.entry?null:e.kitEntry.entry.description," "),k.Ab(4),k.Cc(e.usedQty),k.Ab(3),k.Cc(null==e.kitEntry?null:e.kitEntry.configuredQty),k.Ab(2),k.Fc(" ",k.ec(13,7,"PRODUCT_DETAIL.select_total")," ",null==e.kitEntry?null:e.kitEntry.configuredQty," ",k.ec(14,9,"PRODUCT_DETAIL.products")," "),k.Ab(4),k.gc("ngIf",null==e.kitEntry||null==e.kitEntry.entry||null==e.kitEntry.entry.variants?null:e.kitEntry.entry.variants.length))},directives:[R.l,R.k,Rt],pipes:[i.c],styles:[""],changeDetection:0}),t})();function Ft(t,e){if(1&t&&(k.Tb(0,"div",12),k.Ob(1,"div",13),k.Tb(2,"div",14),k.Bc(3),k.dc(4,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc();k.gc("ngClass",null==t.kitEntry||null==t.kitEntry.entry?null:t.kitEntry.entry.stockLevelStyle),k.Ab(3),k.Ec("",k.ec(4,3,"SHOPLIST_DETAIL."+(null==t.kitEntry||null==t.kitEntry.entry?null:t.kitEntry.entry.stockLevelStatus))," ",null==t.kitEntry||null==t.kitEntry.entry?null:t.kitEntry.entry.deliveryDate," ")}}function Nt(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-dropdown",15),k.ac("ngModelChange",function(e){return k.tc(t),k.cc().selectedVariantOption=e})("changeEvent",function(){return k.tc(t),k.cc().onVariantChange()}),k.Sb()}if(2&t){const t=k.cc();k.gc("options",t.kitEntry.entry.variantOptions)("ngModel",t.selectedVariantOption)}}let Ht=(()=>{class t{constructor(){this.kitEntry=null,this.bundleSingleVariantUpdateEvent=new k.n,this.selectedVariantOption=null,this.subscriptions=new m.a}ngOnInit(){this.setInitialSelectedVariantOption()}setInitialSelectedVariantOption(){this.kitEntry&&this.kitEntry.entry&&this.kitEntry.entry.variantOptions&&this.kitEntry.entry.variantOptions.length>0&&(this.selectedVariantOption=this.kitEntry.entry.variantOptions.find(t=>t.isSelected),this.selectedVariantOption||(this.selectedVariantOption=this.kitEntry.entry.variantOptions[0],this.selectedVariantOption.isSelected=!0),this.onVariantChange())}onVariantChange(){this.selectedVariantOption&&this.kitEntry.entry&&this.kitEntry.entry.variantOptions&&this.kitEntry.entry.variantOptions.length>0&&this.kitEntry.entry.variantOptions.forEach(t=>{if(t.code===this.selectedVariantOption.code){t.isSelected=!0;const e=this.kitEntry.entry.variants.find(t=>t.code===this.selectedVariantOption.code),n=new It.a(e,1,this.kitEntry.code);this.bundleSingleVariantUpdateEvent.emit(n)}else t.isSelected=!1})}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=k.Hb({type:t,selectors:[["app-bundle-product-single-variant-detail"]],inputs:{kitEntry:"kitEntry"},outputs:{bundleSingleVariantUpdateEvent:"bundleSingleVariantUpdateEvent"},decls:18,vars:20,consts:[[1,"select-bundle-selector"],[1,"select-bundle-title"],["class","select-bundle-status",3,"ngClass",4,"ngIf"],[1,"select-bundle-detail"],[1,"select-bundle-select-content"],[1,"select-bundle-select-content-free"],[1,"select-bundle-select-detail"],[1,"select-bundle-select-detail-pic"],[3,"src"],[1,"select-bundle-select-detail-dd"],[1,"mz-cart-item__left-section"],["optionLabel","name",3,"options","ngModel","ngModelChange","changeEvent",4,"ngIf"],[1,"select-bundle-status",3,"ngClass"],[1,"select-bundle-status-icon"],[1,"select-bundle-status-text"],["optionLabel","name",3,"options","ngModel","ngModelChange","changeEvent"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.Bc(2),k.dc(3,"translate"),k.Sb(),k.zc(4,Ft,5,5,"div",2),k.Tb(5,"div",3),k.Bc(6),k.dc(7,"translate"),k.dc(8,"translate"),k.dc(9,"translate"),k.Sb(),k.Tb(10,"div",4),k.Tb(11,"div",5),k.Tb(12,"div",6),k.Tb(13,"div",7),k.Ob(14,"app-image-loader",8),k.Sb(),k.Tb(15,"div",9),k.Tb(16,"section",10),k.zc(17,Nt,1,2,"app-dropdown",11),k.Sb(),k.Sb(),k.Sb(),k.Sb(),k.Sb(),k.Sb()),2&t&&(k.Ab(2),k.Fc(" ",null==e.kitEntry||null==e.kitEntry.entry?null:e.kitEntry.entry.description," ",null==e.kitEntry?null:e.kitEntry.configuredQty," ",k.ec(3,12,"PRODUCT_DETAIL.piece")," "),k.Ab(2),k.gc("ngIf",null==e.kitEntry||null==e.kitEntry.entry?null:e.kitEntry.entry.stockLevelStatus),k.Ab(2),k.Gc(" ",k.ec(7,14,"PRODUCT_DETAIL.please_select"),", ",k.ec(8,16,"PRODUCT_DETAIL.amount")," ",null==e.kitEntry?null:e.kitEntry.configuredQty," ",k.ec(9,18,"PRODUCT_DETAIL.piece")," "),k.Ab(8),k.Db("select-bundle-select-detail-img"),k.gc("src",null!=e.kitEntry&&null!=e.kitEntry.entry&&e.kitEntry.entry.imageUrl?null==e.kitEntry||null==e.kitEntry.entry?null:e.kitEntry.entry.imageUrl:null!=e.kitEntry&&null!=e.kitEntry.entry&&null!=e.kitEntry.entry.variants&&e.kitEntry.entry.variants.length&&null!=e.kitEntry&&null!=e.kitEntry.entry&&null!=e.kitEntry.entry.variants[0]&&e.kitEntry.entry.variants[0].imageUrl?null==e.kitEntry||null==e.kitEntry.entry||null==e.kitEntry.entry.variants[0]?null:e.kitEntry.entry.variants[0].imageUrl:""),k.Ab(3),k.gc("ngIf",null==e.kitEntry||null==e.kitEntry.entry?null:e.kitEntry.entry.variantOptions))},directives:[R.l,it.a,R.j,St.a,Tt.i,Tt.l],pipes:[i.c],styles:[".select-bundle-status.--available[_ngcontent-%COMP%]   .select-bundle-status-icon[_ngcontent-%COMP%]{background:url(available-mb.bd2c70d7b8038945429d.svg)}.select-bundle-status.--onShop[_ngcontent-%COMP%]   .select-bundle-status-icon[_ngcontent-%COMP%]{background:url(shop-only.4adc9c21a1121a93548e.svg)}.select-bundle-status.--onShop[_ngcontent-%COMP%]{color:#38539a}"],changeDetection:0}),t})();function $t(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-bundle-product-multi-variant-detail",24),k.ac("bundleMultiVariantQuantityUpdateEvent",function(e){return k.tc(t),k.cc(4).onBundleMultiVariantQtyUpdate(e)}),k.Sb()}if(2&t){const t=k.cc(3).$implicit;k.gc("kitEntry",t)}}function jt(t,e){if(1&t&&(k.Rb(0),k.zc(1,$t,1,1,"app-bundle-product-multi-variant-detail",23),k.Qb()),2&t){const t=k.cc(2).$implicit;k.Ab(1),k.gc("ngIf",t)}}function qt(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-bundle-product-single-variant-detail",26),k.ac("bundleSingleVariantUpdateEvent",function(e){return k.tc(t),k.cc(4).onBundleSingleVariantUpdate(e)}),k.Sb()}if(2&t){const t=k.cc(3).$implicit;k.gc("kitEntry",t)}}function Gt(t,e){if(1&t&&k.zc(0,qt,1,1,"app-bundle-product-single-variant-detail",25),2&t){const t=k.cc(2).$implicit;k.gc("ngIf",t)}}function Jt(t,e){if(1&t&&(k.Rb(0),k.zc(1,jt,2,1,"ng-container",21),k.zc(2,Gt,1,1,"ng-template",null,22,k.Ac),k.Qb()),2&t){const t=k.rc(3),e=k.cc().$implicit;k.Ab(1),k.gc("ngIf",(null==e?null:e.configuredQty)>1)("ngIfElse",t)}}function Kt(t,e){if(1&t&&(k.Rb(0),k.zc(1,Jt,4,2,"ng-container",20),k.Qb()),2&t){const t=e.$implicit;k.Ab(1),k.gc("ngIf",null==t||null==t.entry||null==t.entry.variants?null:t.entry.variants.length)}}function Yt(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"button",27),k.ac("click",function(){return k.tc(t),k.cc().openShareInfoModal()}),k.dc(2,"async"),k.Ob(3,"div",28),k.Tb(4,"div",29),k.Bc(5),k.dc(6,"translate"),k.dc(7,"translate"),k.Sb(),k.Sb(),k.Qb()}if(2&t){const t=k.cc();k.Ab(1),k.gc("disabled",!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(2,3,t.loading$)),k.Ab(2),k.gc("ngClass",null!=t.product&&t.product.is3EProduct?"btn-share2earn-icon":"btn-share-rec-icon"),k.Ab(2),k.Dc(" ",null!=t.product&&t.product.is3EProduct?k.ec(6,5,"PRODUCT_DETAIL.foa_share_text"):k.ec(7,7,"PRODUCT_DETAIL.normal_share_text")," ")}}function Xt(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"button",30),k.ac("click",function(){return k.tc(t),k.cc().addProductToCart()}),k.dc(2,"async"),k.Sb(),k.Qb()}if(2&t){const t=k.cc();k.Ab(1),k.gc("disabled",!t.enableShareButtons||-1!==t.stockUnavailableStyles.indexOf(null==t.product?null:t.product.stockLevelStyle)||t.isOutOfStockChildSelected||!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(2,1,t.loading$))}}function Wt(t,e){if(1&t&&(k.Rb(0),k.Bc(1),k.dc(2,"priceFormatter"),k.Qb()),2&t){const t=k.cc();k.Ab(1),k.Dc(" ",k.ec(2,1,t.bundleTotalPrice)," ")}}function Zt(t,e){if(1&t&&(k.Rb(0),k.Bc(1),k.dc(2,"priceFormatter"),k.Qb()),2&t){const t=k.cc();k.Ab(1),k.Dc(" ",k.ec(2,1,t.bundleTotalRetailPrice)," ")}}function te(t,e){if(1&t&&(k.Rb(0),k.Tb(1,"div",31),k.Bc(2),k.dc(3,"translate"),k.dc(4,"priceFormatter"),k.dc(5,"translate"),k.dc(6,"priceFormatter"),k.Sb(),k.Qb()),2&t){const t=k.cc();k.Ab(2),k.Gc(" ",k.ec(3,4,"COMMON.pv_label")," ",k.fc(4,6,t.bundleTotalPv,"false")," / ",k.ec(5,9,"COMMON.bv_label")," ",k.fc(6,11,t.bundleTotalBv,"false")," ")}}function ee(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"button",32),k.ac("click",function(){return k.tc(t),k.cc().openAddToListModal()}),k.dc(2,"async"),k.Tb(3,"div",33),k.Bc(4),k.dc(5,"translate"),k.Ob(6,"i"),k.Sb(),k.Sb(),k.Tb(7,"button",34),k.ac("click",function(){return k.tc(t),k.cc().openShareInfoModal()}),k.Ob(8,"div",28),k.Tb(9,"div",29),k.Bc(10),k.dc(11,"translate"),k.dc(12,"translate"),k.Sb(),k.Sb(),k.Qb()}if(2&t){const t=k.cc();k.Ab(1),k.gc("disabled",!t.enableShareButtons||!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(2,5,t.loading$)),k.Ab(3),k.Dc(" ",k.ec(5,7,"PRODUCT_DETAIL.add_in_my_list")," "),k.Ab(3),k.gc("disabled",!(null!=t.product&&t.product.isEligibleForMyList)),k.Ab(1),k.gc("ngClass",null!=t.product&&t.product.is3EProduct?"btn-share2earn-icon":"btn-share-rec-icon"),k.Ab(2),k.Dc(" ",null!=t.product&&t.product.is3EProduct?k.ec(11,9,"PRODUCT_DETAIL.foa_share_text"):k.ec(12,11,"PRODUCT_DETAIL.normal_share_text")," ")}}function ne(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Ob(1,"div",35),k.Tb(2,"button",36),k.ac("click",function(){return k.tc(t),k.cc().addProductToCart()}),k.dc(3,"async"),k.Bc(4),k.dc(5,"translate"),k.Sb(),k.Qb()}if(2&t){const t=k.cc();k.Ab(2),k.gc("disabled",!t.enableShareButtons||-1!==t.stockUnavailableStyles.indexOf(null==t.product?null:t.product.stockLevelStyle)||t.isOutOfStockChildSelected||!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(3,2,t.loading$)),k.Ab(2),k.Cc(k.ec(5,4,"PRODUCT_DETAIL.buy_now"))}}let ie=(()=>{class t{constructor(t,e){this.cd=t,this.productService=e,this.product=null,this.openShareInfoModalEvent=new k.n,this.openAddToListModalEvent=new k.n,this.addBundleProductToCartEvent=new k.n,this.updateBundleMapEvent=new k.n,this.updateBundleSummaryItemsEvent=new k.n,this.subscriptions=new m.a,this.bundleQuantitySelectionMap=new Map,this.enableShareButtons=!1,this.bundleTotalRetailPrice=0,this.bundleTotalPrice=0,this.bundleTotalPv=0,this.bundleTotalBv=0,this.isOutOfStockChildSelected=!1,this.stockUnavailableStyles=tt.U}ngOnInit(){this.subscriptions.add(this.productService.isBundleProductAdded$.subscribe(t=>{t&&this.productService.isBundleProductAdded$.next(!1)})),this.setBundleSelectionMap()}setBundleSelectionMap(){var t,e;if(this.product&&this.product.kitEntries&&this.product.kitEntries.length)for(const n of this.product.kitEntries)this.bundleQuantitySelectionMap.has(n.code)||((null===(e=null===(t=n.entry)||void 0===t?void 0:t.variants)||void 0===e?void 0:e.length)?1===n.configuredQty&&this.bundleQuantitySelectionMap.set(n.code,[new It.a(n.entry.variants[0],n.configuredQty,n.code)]):this.bundleQuantitySelectionMap.set(n.code,[new It.a(n.entry,n.configuredQty,n.code)]));this.updateBundleSummary()}onBundleMultiVariantQtyUpdate(t){const e=t.filter(t=>t.quantity>0);this.bundleQuantitySelectionMap.set(t[0].kitProductIdentifier,e),this.updateBundleSummary()}onBundleSingleVariantUpdate(t){this.bundleQuantitySelectionMap.set(t.kitProductIdentifier,[t]),this.updateBundleSummary()}updateBundleSummary(){this.bundleTotalPrice=0,this.bundleTotalRetailPrice=0,this.bundleTotalPv=0,this.bundleTotalBv=0,this.isOutOfStockChildSelected=!1;const t=[];for(const e of this.bundleQuantitySelectionMap.keys())for(const n of this.bundleQuantitySelectionMap.get(e))n.totalPrice=n.priceValue*n.quantity,n.totalRetailPrice=n.retailPriceValue*n.quantity,this.bundleTotalPrice+=n.totalPrice,this.bundleTotalRetailPrice+=n.totalRetailPrice,this.bundleTotalPv+=n.pdpPv*n.quantity,this.bundleTotalBv+=n.pdpBv*n.quantity,t.push(n);this.isOutOfStockChildSelected=t.some(t=>-1!==tt.U.indexOf(t.stockLevelStyle)),this.bundleSummaryItems=t,this.validateBundleSelection(),this.cd.markForCheck(),this.updateBundleSummaryItemsEvent.emit(this.bundleSummaryItems),this.updateBundleMapEvent.emit(this.bundleQuantitySelectionMap)}validateBundleSelection(){var t,e,n;let i=!0;if(null===(e=null===(t=this.product)||void 0===t?void 0:t.kitEntries)||void 0===e?void 0:e.length)for(const c of this.product.kitEntries)if(i=c.configuredQty===(null===(n=this.bundleQuantitySelectionMap.get(c.code))||void 0===n?void 0:n.reduce((t,e)=>t+e.quantity,0)),!i)break;this.enableShareButtons=i}openShareInfoModal(){this.openShareInfoModalEvent.emit(!0)}openAddToListModal(){this.enableShareButtons&&this.openAddToListModalEvent.emit(!0)}addProductToCart(){this.addBundleProductToCartEvent.emit(this.bundleQuantitySelectionMap)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(k.h),k.Nb(M.a))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-bundle-product-detail"]],inputs:{product:"product"},outputs:{openShareInfoModalEvent:"openShareInfoModalEvent",openAddToListModalEvent:"openAddToListModalEvent",addBundleProductToCartEvent:"addBundleProductToCartEvent",updateBundleMapEvent:"updateBundleMapEvent",updateBundleSummaryItemsEvent:"updateBundleSummaryItemsEvent"},decls:30,vars:19,consts:[[1,"amway-dt-sub-title"],[1,"select-bundle","detail-page","mt-0"],["type","text","value","",1,"select-bundle-input-id"],[1,"select-bundle-content"],[4,"ngFor","ngForOf"],[3,"bundleSummaryItems"],[1,"twentyfour"],[1,"amway-dt-line","my-4"],[1,"amway-dt-btn-bar","visible-mobile","pdp-bundle-bar"],[1,"amway-dt-btn-add-list","visible-mobile","mr-3",3,"disabled","click"],[4,"appRole"],["id","addToCart",1,"amway-pdp-bundle-bar","visible-desktop"],[1,"amway-pdp-bundle-bar-content"],[1,"aba-img-box"],[3,"src"],[1,"aba-detail"],[1,"aba-name"],[1,"aba-detail-price"],[1,"aba-price"],[1,"amway-pdp-bundle-bar-tool"],[4,"ngIf"],[4,"ngIf","ngIfElse"],["singleQtyVariantTemplate",""],[3,"kitEntry","bundleMultiVariantQuantityUpdateEvent",4,"ngIf"],[3,"kitEntry","bundleMultiVariantQuantityUpdateEvent"],[3,"kitEntry","bundleSingleVariantUpdateEvent",4,"ngIf"],[3,"kitEntry","bundleSingleVariantUpdateEvent"],["aria-label","open share info modal",1,"btn-black","btn-share2earn","btn-pdp-add-to-cart","btn-share2earn-mylist",3,"disabled","click"],[3,"ngClass"],[1,"btn-share2earn-title"],["aria-label","add product to cart",1,"btn-black","btn-pdp-add-to-cart",3,"disabled","click"],[1,"aba-score","aba-score-point"],[1,"amway-dt-btn-add-list","tooltip-mod","mr-3",3,"disabled","click"],[1,"top"],["aria-label","open share info modal",1,"btn-black","btn-share2earn","confirm","cart","btn-share2earn-mylist",3,"disabled","click"],[1,"amway-dt-share-bar","visible-desktop"],["aria-label","add product to cart",1,"btn-black","confirm","cart",3,"disabled","click"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Bc(1),k.dc(2,"translate"),k.Sb(),k.Tb(3,"div",1),k.Ob(4,"input",2),k.Tb(5,"div",3),k.zc(6,Kt,2,1,"ng-container",4),k.Sb(),k.Sb(),k.Ob(7,"app-bundle-product-detail-summary",5),k.Tb(8,"div",6),k.Ob(9,"div",7),k.Sb(),k.Tb(10,"div",8),k.Tb(11,"button",9),k.ac("click",function(){return e.openAddToListModal()}),k.dc(12,"async"),k.Sb(),k.zc(13,Yt,8,9,"ng-container",10),k.zc(14,Xt,3,3,"ng-container",10),k.Sb(),k.Tb(15,"div",11),k.Tb(16,"form",12),k.Tb(17,"div",13),k.Ob(18,"app-image-loader",14),k.Sb(),k.Tb(19,"div",15),k.Tb(20,"div",16),k.Bc(21),k.Sb(),k.Sb(),k.Tb(22,"div",17),k.Tb(23,"div",18),k.zc(24,Wt,3,3,"ng-container",10),k.zc(25,Zt,3,3,"ng-container",10),k.Sb(),k.zc(26,te,7,14,"ng-container",10),k.Sb(),k.Tb(27,"div",19),k.zc(28,ee,13,13,"ng-container",10),k.zc(29,ne,6,6,"ng-container",10),k.Sb(),k.Sb(),k.Sb()),2&t&&(k.Ab(1),k.Dc(" ",k.ec(2,15,"PRODUCT_DETAIL.bundle_product_detail_header"),"\n"),k.Ab(5),k.gc("ngForOf",null==e.product?null:e.product.kitEntries),k.Ab(1),k.gc("bundleSummaryItems",e.bundleSummaryItems),k.Ab(4),k.gc("disabled",!e.enableShareButtons||!(null!=e.product&&e.product.isEligibleForMyList)||k.ec(12,17,e.loading$)),k.Ab(2),k.gc("appRole","shopOwner"),k.Ab(1),k.gc("appRole","customer"),k.Ab(4),k.Db("aba-img"),k.gc("src",null==e.product?null:e.product.imageUrl),k.Ab(3),k.Dc(" ",null==e.product?null:e.product.description," "),k.Ab(3),k.gc("appRole","shopOwner"),k.Ab(1),k.gc("appRole","customer"),k.Ab(1),k.gc("appRole","shopOwner"),k.Ab(2),k.gc("appRole","shopOwner"),k.Ab(1),k.gc("appRole","customer"))},directives:[R.k,Dt,j.a,Tt.q,Tt.j,Tt.k,it.a,R.l,zt,Ht,R.j],pipes:[i.c,R.b,wt.a],styles:[""],changeDetection:0}),Object(v.a)([Object(c.c)(u.a.getLoader)],t.prototype,"loading$",void 0),t})();function ce(t,e){if(1&t&&(k.Tb(0,"span"),k.Bc(1),k.dc(2,"priceFormatter"),k.dc(3,"priceFormatter"),k.Sb()),2&t){const t=k.cc(4);k.Ab(1),k.Ec(" ",k.fc(2,2,null==t.product?null:t.product.minPv,"false")," - ",k.fc(3,5,null==t.product?null:t.product.maxPv,"false")," ")}}function ae(t,e){if(1&t&&(k.Tb(0,"span"),k.Bc(1),k.dc(2,"priceFormatter"),k.Sb()),2&t){const t=k.cc(4);k.Ab(1),k.Dc(" ",k.fc(2,1,null==t.product?null:t.product.minPv,"false")," ")}}function se(t,e){if(1&t&&(k.Tb(0,"span"),k.zc(1,ce,4,8,"span",6),k.zc(2,ae,3,4,"span",6),k.Sb()),2&t){const t=k.cc(3);k.Ab(1),k.gc("ngIf",null==t.product?null:t.product.maxPv),k.Ab(1),k.gc("ngIf",!(null!=t.product&&t.product.maxPv))}}function oe(t,e){if(1&t&&(k.Tb(0,"span"),k.Bc(1),k.dc(2,"priceFormatter"),k.Sb()),2&t){const t=k.cc(3);k.Ab(1),k.Dc(" ",k.fc(2,1,null==t.product?null:t.product.pointValue,"false")," ")}}function le(t,e){if(1&t&&(k.Tb(0,"span"),k.Bc(1),k.dc(2,"priceFormatter"),k.dc(3,"priceFormatter"),k.Sb()),2&t){const t=k.cc(4);k.Ab(1),k.Ec(" ",k.fc(2,2,null==t.product?null:t.product.minBv,"false")," - ",k.fc(3,5,null==t.product?null:t.product.maxBv,"false")," ")}}function de(t,e){if(1&t&&(k.Tb(0,"span"),k.Bc(1),k.dc(2,"priceFormatter"),k.Sb()),2&t){const t=k.cc(4);k.Ab(1),k.Dc(" ",k.fc(2,1,null==t.product?null:t.product.minBv,"false")," ")}}function re(t,e){if(1&t&&(k.Tb(0,"span"),k.zc(1,le,4,8,"span",6),k.zc(2,de,3,4,"span",6),k.Sb()),2&t){const t=k.cc(3);k.Ab(1),k.gc("ngIf",null==t.product?null:t.product.maxBv),k.Ab(1),k.gc("ngIf",!(null!=t.product&&t.product.maxBv))}}function ue(t,e){if(1&t&&(k.Tb(0,"span"),k.Bc(1),k.dc(2,"priceFormatter"),k.Sb()),2&t){const t=k.cc(3);k.Ab(1),k.Dc(" ",k.fc(2,1,null==t.product?null:t.product.businessVolume,"false")," ")}}function be(t,e){if(1&t&&(k.Tb(0,"div",21),k.Tb(1,"div",22),k.Bc(2),k.dc(3,"priceFormatter"),k.Sb(),k.Tb(4,"div",23),k.Bc(5),k.dc(6,"translate"),k.zc(7,se,3,2,"span",6),k.zc(8,oe,3,4,"span",6),k.Bc(9),k.dc(10,"translate"),k.zc(11,re,3,2,"span",6),k.zc(12,ue,3,4,"span",6),k.Sb(),k.Sb()),2&t){const t=k.cc(2);k.Ab(2),k.Dc(" ",null!=t.product&&t.product.bundleABOPriceRange?null==t.product?null:t.product.bundleABOPriceRange:k.ec(3,7,null==t.product?null:t.product.priceValue)," "),k.Ab(3),k.Dc(" ",k.ec(6,9,"SHOPLIST_DETAIL.pv_label")," "),k.Ab(2),k.gc("ngIf",null==t.product?null:t.product.minPv),k.Ab(1),k.gc("ngIf",!(null!=t.product&&t.product.minPv)),k.Ab(1),k.Dc(" / ",k.ec(10,11,"SHOPLIST_DETAIL.bv_label")," "),k.Ab(2),k.gc("ngIf",null==t.product?null:t.product.minBv),k.Ab(1),k.gc("ngIf",!(null!=t.product&&t.product.minBv))}}function pe(t,e){if(1&t&&(k.Tb(0,"div",24),k.Tb(1,"div",25),k.Bc(2),k.dc(3,"priceFormatter"),k.Sb(),k.Tb(4,"div",26),k.Bc(5),k.dc(6,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc(2);k.Ab(2),k.Dc(" ",null!=t.product&&t.product.bundleABOPriceRange?null==t.product?null:t.product.bundleABOPriceRange:k.ec(3,2,null==t.product?null:t.product.priceValue)," "),k.Ab(3),k.Dc(" ",k.ec(6,4,"PRODUCT_DETAIL.member_price")," ")}}function he(t,e){if(1&t&&(k.Tb(0,"div",27),k.Tb(1,"div",25),k.Bc(2),k.dc(3,"priceFormatter"),k.Sb(),k.Tb(4,"div",26),k.Bc(5),k.dc(6,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc(2);k.Ab(2),k.Dc(" ",null!=t.product&&t.product.bundleRetailPriceRange?null==t.product?null:t.product.bundleRetailPriceRange:k.ec(3,2,null==t.product?null:t.product.retailPriceValue)," "),k.Ab(3),k.Dc(" ",k.ec(6,4,"PRODUCT_DETAIL.retail_price")," ")}}function ge(t,e){1&t&&(k.Rb(0),k.Tb(1,"div",17),k.zc(2,be,13,13,"div",18),k.zc(3,pe,7,6,"div",19),k.zc(4,he,7,6,"div",20),k.Sb(),k.Qb()),2&t&&(k.Ab(2),k.gc("appRole","shopOwner"),k.Ab(1),k.gc("appRole","customer"),k.Ab(1),k.gc("appRole","customer"))}function ve(t,e){if(1&t&&(k.Tb(0,"div",21),k.Tb(1,"div",22),k.Bc(2),k.dc(3,"priceFormatter"),k.Sb(),k.Tb(4,"div",23),k.Bc(5),k.dc(6,"translate"),k.dc(7,"priceFormatter"),k.dc(8,"translate"),k.dc(9,"priceFormatter"),k.Sb(),k.Sb()),2&t){const t=k.cc(2);k.Ab(2),k.Dc(" ",k.ec(3,5,null==t.product?null:t.product.priceValue)," "),k.Ab(3),k.Gc(" ",k.ec(6,7,"SHOPLIST_DETAIL.pv_label")," ",k.fc(7,9,null==t.product?null:t.product.pointValue,"false")," / ",k.ec(8,12,"SHOPLIST_DETAIL.bv_label")," ",k.fc(9,14,null==t.product?null:t.product.businessVolume,"false")," ")}}function me(t,e){if(1&t&&(k.Tb(0,"div",24),k.Tb(1,"div",25),k.Bc(2),k.dc(3,"priceFormatter"),k.Sb(),k.Tb(4,"div",26),k.Bc(5),k.dc(6,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc(2);k.Ab(2),k.Dc(" ",k.ec(3,2,null==t.product?null:t.product.priceValue)," "),k.Ab(3),k.Dc(" ",k.ec(6,4,"PRODUCT_DETAIL.member_price")," ")}}function fe(t,e){if(1&t&&(k.Tb(0,"div",27),k.Tb(1,"div",25),k.Bc(2),k.dc(3,"priceFormatter"),k.Sb(),k.Tb(4,"div",26),k.Bc(5),k.dc(6,"translate"),k.Sb(),k.Sb()),2&t){const t=k.cc(2);k.Ab(2),k.Dc(" ",k.ec(3,2,null==t.product?null:t.product.retailPriceValue)," "),k.Ab(3),k.Dc(" ",k.ec(6,4,"PRODUCT_DETAIL.retail_price")," ")}}function ye(t,e){1&t&&(k.Rb(0),k.Tb(1,"div",17),k.zc(2,ve,10,17,"div",18),k.zc(3,me,7,6,"div",19),k.zc(4,fe,7,6,"div",20),k.Sb(),k.Qb()),2&t&&(k.Ab(2),k.gc("appRole","shopOwner"),k.Ab(1),k.gc("appRole","customer"),k.Ab(1),k.gc("appRole","customer"))}function Se(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"app-variant-product-detail",28),k.ac("variantSelectionEvent",function(e){return k.tc(t),k.cc().onVariantChange(e)}),k.Sb(),k.Tb(2,"div",8),k.Ob(3,"div",9),k.Sb(),k.Qb()}if(2&t){const t=k.cc();k.Ab(1),k.gc("product",t.product)}}function Te(t,e){if(1&t){const t=k.Ub();k.Tb(0,"div",30),k.Tb(1,"div",31),k.Tb(2,"button",32),k.ac("click",function(){return k.tc(t),k.cc(2).toggleAddToListModal(!0)}),k.dc(3,"async"),k.Sb(),k.Sb(),k.Tb(4,"button",33),k.ac("click",function(){return k.tc(t),k.cc(2).openShareInfoModal()}),k.Ob(5,"div",34),k.Tb(6,"div",35),k.Bc(7),k.dc(8,"translate"),k.dc(9,"translate"),k.Sb(),k.Sb(),k.Tb(10,"div",36),k.Tb(11,"button",37),k.ac("click",function(){return k.tc(t),k.cc(2).toggleAddToListModal(!0)}),k.dc(12,"async"),k.Tb(13,"div",38),k.Bc(14),k.dc(15,"translate"),k.Ob(16,"i"),k.Sb(),k.Sb(),k.Sb(),k.Sb()}if(2&t){const t=k.cc(2);k.Ab(2),k.gc("disabled",!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(3,6,t.loading$)),k.Ab(2),k.gc("disabled",!(null!=t.product&&t.product.isEligibleForMyList)),k.Ab(1),k.gc("ngClass",null!=t.product&&t.product.is3EProduct?"btn-share2earn-icon":"btn-share-rec-icon"),k.Ab(2),k.Dc(" ",null!=t.product&&t.product.is3EProduct?k.ec(8,8,"PRODUCT_DETAIL.foa_share_text"):k.ec(9,10,"PRODUCT_DETAIL.normal_share_text")," "),k.Ab(4),k.gc("disabled",!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(12,12,t.loading$)),k.Ab(3),k.Dc(" ",k.ec(15,14,"PRODUCT_DETAIL.add_in_my_list")," ")}}function Ee(t,e){1&t&&(k.Rb(0),k.zc(1,Te,17,16,"div",29),k.Qb()),2&t&&(k.Ab(1),k.gc("appRole","shopOwner"))}function Ae(t,e){if(1&t){const t=k.Ub();k.Tb(0,"div",30),k.Tb(1,"div",40),k.Tb(2,"app-spinner",41),k.ac("changeEvent",function(e){return k.tc(t),k.cc(2).changeProductQuantity(e)}),k.Sb(),k.Sb(),k.Tb(3,"button",42),k.ac("click",function(){return k.tc(t),k.cc(2).addProductToCart()}),k.dc(4,"async"),k.Bc(5),k.dc(6,"translate"),k.Sb(),k.Sb()}if(2&t){const t=k.cc(2);k.Ab(2),k.gc("min",t.min)("value",t.qtySelected)("max",t.max)("isDebounceReq",!1)("ngClass",t.getStepperClasses())("showDeleteButton",!1),k.Ab(1),k.gc("disabled",!t.qtySelected||-1!==t.stockUnavailableStyles.indexOf(t.stockStyle)||!(null!=t.product&&t.product.isEligibleForMyList)||k.ec(4,8,t.loading$)),k.Ab(2),k.Dc(" ",k.ec(6,10,"PRODUCT_DETAIL.buy_now")," ")}}function Oe(t,e){1&t&&(k.Rb(0),k.zc(1,Ae,7,12,"div",39),k.Qb()),2&t&&(k.Ab(1),k.gc("appRole","customer"))}function Ce(t,e){1&t&&(k.Rb(0),k.Tb(1,"div",43),k.Ob(2,"div",9),k.Sb(),k.Qb())}function ke(t,e){1&t&&(k.Tb(0,"div",43),k.Ob(1,"div",9),k.Sb())}function Me(t,e){if(1&t&&(k.Rb(0),k.Tb(1,"div",44),k.Tb(2,"div",45),k.Tb(3,"div",46),k.Ob(4,"div",47),k.Tb(5,"div",48),k.Bc(6),k.dc(7,"translate"),k.Sb(),k.Sb(),k.Sb(),k.Sb(),k.zc(8,ke,2,0,"div",49),k.Qb()),2&t){const t=k.cc();k.Ab(1),k.gc("ngClass",t.stockStyle),k.Ab(5),k.Ec(" ",k.ec(7,4,"SHOPLIST_DETAIL."+(null==t.product?null:t.product.stockLevelStatus))," ",null==t.product||null==t.product.stock?null:t.product.stock.deliveryDate," "),k.Ab(2),k.gc("ngIf",!(null!=t.product&&t.product.isBundleProduct))}}function Ie(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"div",43),k.Ob(2,"div",9),k.Sb(),k.Tb(3,"app-bundle-product-detail",50),k.ac("openShareInfoModalEvent",function(){return k.tc(t),k.cc().openShareInfoModal()})("openAddToListModalEvent",function(){return k.tc(t),k.cc().toggleAddToListModal(!0)})("addBundleProductToCartEvent",function(){return k.tc(t),k.cc().addBundleProductToCart()})("updateBundleMapEvent",function(e){return k.tc(t),k.cc().onUpdateBundleMapEvent(e)})("updateBundleSummaryItemsEvent",function(e){return k.tc(t),k.cc().onUpdateBundleSummaryItemsEvent(e)}),k.Sb(),k.Qb()}if(2&t){const t=k.cc();k.Ab(3),k.gc("product",t.product)}}let we=(()=>{class t{constructor(t,e,n,i,c,a,s){this.authService=t,this.cartDetailService=e,this.store=n,this.productService=i,this.sanitizer=c,this.messageService=a,this.uiHelper=s,this.product=null,this.shopUid="",this.openShareInfoModalEvent=new k.n,this.toggleAddToListModalEvent=new k.n,this.updateBundleMapEvent=new k.n,this.variantSelectionEvent=new k.n,this.min=0,this.max=0,this.qtySelected=0,this.bundleQuantitySelectionMap=new Map,this.subscriptions=new m.a,this.stockStyle="",this.stockUnavailableStyles=tt.U,this.priorityStockStyles=tt.P,this.bundleSummaryItems=[]}ngOnChanges(t){t&&t.product&&(this.setStockStyle(),this.setMinAndMaxValues(),this.setQtySelected())}ngOnInit(){this.subscribeForCurrentAction()}setStockStyle(){this.product&&(this.stockStyle=this.product.stockLevelStyle)}setMinAndMaxValues(){this.authService.isRoleAvailable(rt.a.CUSTOMER)&&(this.min=tt.J,this.max=tt.H),this.product&&(this.product.isBundleProduct||this.product.stock&&this.product.stock.stockLevel>0&&(this.max=this.product.stock.stockLevel<this.max?this.product.stock.stockLevel:this.max))}setQtySelected(){var t,e,n;this.qtySelected=(null===(t=this.product)||void 0===t?void 0:t.qty)<this.min?this.min:(null===(e=this.product)||void 0===e?void 0:e.qty)>this.max?this.max:null===(n=this.product)||void 0===n?void 0:n.qty}subscribeForCurrentAction(){this.subscriptions.add(this.currentAction$.subscribe(t=>{if("productAddedToCart"===t){const t="/"+this.shopUid+this.uiHelper.getRoutePathForCartPage();this.messageService.showSuccess({message:"SHOP_FOA.product_added_notification",routeTo:t,linkMessage:"SHOP_FOA.goto_basket"})}}))}openShareInfoModal(){this.openShareInfoModalEvent.emit(!0)}toggleAddToListModal(t){this.toggleAddToListModalEvent.emit(t)}changeProductQuantity(t){this.qtySelected=t,this.setMinAndMaxValues()}getStepperClasses(){if(!this.product.isBundleProduct)return{"disable-up":this.max<=this.qtySelected||this.product.stock.stockLevel<=this.qtySelected,"disable-down":this.min>=this.qtySelected}}addProductToCart(){const t=this.cartDetailService.getCartInfoFromSession();t&&t.cartId?this.addProductToExistingCart():this.addProductToNewCart()}addProductToExistingCart(){if(this.product.isBundleProduct){const t=this.getBundleProductEntries();this.store.dispatch(new C.d({bundledEntries:t,remainingBundleEntries:[],nonBundledEntries:[]})),this.productService.isBundleProductAdded$.next(!0)}else this.store.dispatch(new C.e({nonBundledEntries:[this.createCustomNonBundledProduct()]}))}addProductToNewCart(){this.product.isBundleProduct?(this.store.dispatch(new C.j({bundledEntries:[this.getBundleProductEntries()],nonBundledEntries:[]})),this.productService.isBundleProductAdded$.next(!0)):this.store.dispatch(new C.j({bundledEntries:[],nonBundledEntries:[this.createCustomNonBundledProduct()]}))}getBundleProductEntries(){const t=[];for(const n of this.bundleQuantitySelectionMap.keys())for(const e of this.bundleQuantitySelectionMap.get(n)){const n=new ut.a;n.isKitProduct=!1,n.kitEntryCode=e.kitProductIdentifier,n.quantity=e.quantity,n.product=new bt.a,n.product.code=e.code,t.push(n)}const e=new ut.a;return e.isKitProduct=!0,e.kitEntryCode="",e.quantity=1,e.product=new bt.a,e.product.code=this.product.code,t.push(e),t}createCustomNonBundledProduct(){const t=new pt.a;t.quantity=this.qtySelected;const e=new bt.a;return e.code=this.product.code,e.alias=this.product.aliasCode,t.product=e,t}addBundleProductToCart(){this.addProductToCart()}onVariantChange(t){t&&this.variantSelectionEvent.emit(t),this.changeProductQuantity(tt.J)}onUpdateBundleMapEvent(t){this.bundleQuantitySelectionMap=t,this.updateBundleMapEvent.emit(t)}onUpdateBundleSummaryItemsEvent(t){this.bundleSummaryItems=t,this.updateBundleEntryStockStatus()}updateBundleEntryStockStatus(){let t;for(const e of this.priorityStockStyles)if(t=this.bundleSummaryItems.find(t=>t.stockLevelStyle===e&&this.product.kitEntries.some(e=>e.isMajor&&(e.entry.code===t.code||e.entry.variants.length&&e.entry.variants.some(e=>e.code===t.code)||e.entry.variantOptions.length&&e.entry.variantOptions.some(e=>e.code===t.code)))),t)break;(!t||this.priorityStockStyles.indexOf(t.stockLevelStyle)===this.priorityStockStyles.length-1&&this.product.kitEntries.some(t=>!t.isMajor)&&this.bundleSummaryItems.some(t=>t.stockLevelStyle===tt.j))&&(t=this.bundleSummaryItems.find(t=>t.stockLevelStyle===tt.j&&this.product.kitEntries.some(e=>!e.isMajor&&(e.entry.code===t.code||e.entry.variants.length&&e.entry.variants.some(e=>e.code===t.code)||e.entry.variantOptions.length&&e.entry.variantOptions.some(e=>e.code===t.code))))),t&&this.product&&(this.product.stockLevelStatus=t.stockLevelStatus,this.product.stockLevelStyle=t.stockLevelStyle,this.product.stock&&(this.product.stock.stockLevelStatus=t.stockLevelStatus,this.product.stock.deliveryDate=t.deliveryDate)),this.setStockStyle()}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(ht.a),k.Nb(gt.a),k.Nb(c.f),k.Nb(M.a),k.Nb(vt.b),k.Nb(L.a),k.Nb(I.a))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-product-detail-info"]],inputs:{product:"product",shopUid:"shopUid"},outputs:{openShareInfoModalEvent:"openShareInfoModalEvent",toggleAddToListModalEvent:"toggleAddToListModalEvent",updateBundleMapEvent:"updateBundleMapEvent",variantSelectionEvent:"variantSelectionEvent"},features:[k.yb],decls:42,vars:33,consts:[[1,"amway-detail-text-box"],[1,"amway-detail-bar"],[1,"amway-dt-text-bar"],[1,"amway-dt-card-code"],[1,"amway-dt-name"],[1,"amway-dt-sub-name","visible-desktop",3,"innerHTML"],[4,"ngIf"],[1,"amway-dt-sub-name","visible-mobile",3,"innerHTML"],[1,"twentyfour","visible-desktop"],[1,"amway-dt-line","my-4"],[1,"amway-dt-icon-content"],[1,"adt-ic-icon"],[3,"src"],[1,"adt-ic-text"],[1,"adt-ic-text-title"],[1,"adt-ic-text-detail"],[3,"cover","visible"],[1,"amway-dt-price-bar"],["class","amway-dt-price-member",4,"appRole"],["class","amway-dt-price-area",4,"appRole"],["class","amway-dt-price-area gray",4,"appRole"],[1,"amway-dt-price-member"],[1,"amway-dt-price"],[1,"amway-dt-score-title"],[1,"amway-dt-price-area"],[1,"adtp-price"],[1,"adtp-title"],[1,"amway-dt-price-area","gray"],[3,"product","variantSelectionEvent"],["class","amway-dt-btn-bar",4,"appRole"],[1,"amway-dt-btn-bar"],[1,"amway-dt-share-bar","visible-mobile","mr-3"],["aria-label","add product to list",1,"amway-dt-btn-add-list",3,"disabled","click"],["aria-label","open share info modal",1,"btn-black","btn-share2earn","btn-share2earn-mylist","mr-3-dt",3,"disabled","click"],[3,"ngClass"],[1,"btn-share2earn-title"],[1,"amway-dt-share-bar","visible-desktop"],["aria-label","add product to list",1,"amway-dt-btn-add-list","tooltip-mod",3,"disabled","click"],[1,"top"],["class","amway-dt-btn-bar ",4,"appRole"],[1,"mz-integer-input","mz-cart-item__quantity","input-pdp-q","mr-3","stepH3em"],[3,"min","value","max","isDebounceReq","ngClass","showDeleteButton","changeEvent"],["aria-label","add product to cart",1,"btn-black","btn-pdp-add-to-cart",3,"disabled","click"],[1,"twentyfour"],[1,"amway-dt-chx-stock",3,"ngClass"],[1,"amway-dt-chx-stock-detail"],[1,"amway-dt-chx-stock-detail-status"],[1,"amway-dt-chx-stock-detail-status-icon"],[1,"amway-dt-chx-stock-detail-status-text"],["class","twentyfour ",4,"ngIf"],[3,"product","openShareInfoModalEvent","openAddToListModalEvent","addBundleProductToCartEvent","updateBundleMapEvent","updateBundleSummaryItemsEvent"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.Tb(2,"div",2),k.Tb(3,"div",3),k.Bc(4),k.dc(5,"translate"),k.Sb(),k.Sb(),k.Tb(6,"div",4),k.Bc(7),k.Sb(),k.Ob(8,"div",5),k.zc(9,ge,5,3,"ng-container",6),k.zc(10,ye,5,3,"ng-container",6),k.Sb(),k.Ob(11,"div",7),k.Tb(12,"div",8),k.Ob(13,"div",9),k.Sb(),k.zc(14,Se,4,1,"ng-container",6),k.zc(15,Ee,2,1,"ng-container",6),k.zc(16,Oe,2,1,"ng-container",6),k.zc(17,Ce,3,0,"ng-container",6),k.zc(18,Me,9,6,"ng-container",6),k.zc(19,Ie,4,1,"ng-container",6),k.Tb(20,"div",10),k.Tb(21,"div",11),k.Ob(22,"app-image-loader",12),k.Sb(),k.Tb(23,"div",13),k.Tb(24,"div",14),k.Bc(25),k.dc(26,"translate"),k.Sb(),k.Tb(27,"div",15),k.Bc(28),k.dc(29,"translate"),k.Sb(),k.Sb(),k.Sb(),k.Tb(30,"div",10),k.Tb(31,"div",11),k.Ob(32,"app-image-loader",12),k.Sb(),k.Tb(33,"div",13),k.Tb(34,"div",14),k.Bc(35),k.dc(36,"translate"),k.Sb(),k.Tb(37,"div",15),k.Bc(38),k.dc(39,"translate"),k.Sb(),k.Sb(),k.Sb(),k.Ob(40,"app-loader",16),k.dc(41,"async"),k.Sb()),2&t&&(k.Ab(4),k.Ec("",k.ec(5,21,"PRODUCT_DETAIL.code"),"",null==e.product?null:e.product.pdpAliasCode,""),k.Ab(3),k.Cc(null==e.product?null:e.product.name),k.Ab(1),k.gc("innerHTML",e.product?e.sanitizer.bypassSecurityTrustHtml(e.product.summary):"",k.uc),k.Ab(1),k.gc("ngIf",!(null!=e.product&&e.product.isVariantProduct)),k.Ab(1),k.gc("ngIf",null==e.product?null:e.product.isVariantProduct),k.Ab(1),k.gc("innerHTML",e.product?e.sanitizer.bypassSecurityTrustHtml(e.product.summary):"",k.uc),k.Ab(3),k.gc("ngIf",null==e.product?null:e.product.isVariantProduct),k.Ab(1),k.gc("ngIf",!(null!=e.product&&e.product.isBundleProduct)),k.Ab(1),k.gc("ngIf",!(null!=e.product&&e.product.isBundleProduct)),k.Ab(1),k.gc("ngIf",!(null!=e.product&&e.product.isBundleProduct)),k.Ab(1),k.gc("ngIf",null==e.product?null:e.product.stockLevelStatus),k.Ab(1),k.gc("ngIf",null==e.product?null:e.product.isBundleProduct),k.Ab(3),k.gc("src","assets/image/icon/icon_content/icon-free-b.svg"),k.Ab(3),k.Cc(k.ec(26,23,"PRODUCT_DETAIL.free_delivery")),k.Ab(3),k.Dc("",k.ec(29,25,"PRODUCT_DETAIL.free_delivery_subtext")," "),k.Ab(4),k.gc("src","assets/image/icon/icon_content/icon-refund-b.svg"),k.Ab(3),k.Cc(k.ec(36,27,"PRODUCT_DETAIL.satisfaction_guarantee")),k.Ab(3),k.Cc(k.ec(39,29,"PRODUCT_DETAIL.satisfaction_guarantee_subtext")),k.Ab(2),k.gc("cover",!0)("visible",k.ec(41,31,e.loading$)))},directives:[R.l,it.a,$.a,j.a,kt,R.j,Mt.a,ie],pipes:[i.c,R.b,wt.a],styles:[".--available[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-icon[_ngcontent-%COMP%]{background:url(available-mb.bd2c70d7b8038945429d.svg);background-size:16px}.--available[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-text[_ngcontent-%COMP%]{color:#107f47}.--backOrder[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-icon[_ngcontent-%COMP%]{background:url(backOrder-mb.d050362af7ae13820c14.svg);background-size:16px}.--backOrder[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-text[_ngcontent-%COMP%]{color:#f0bd1f}.--outOfStock[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-icon[_ngcontent-%COMP%]{background:url(outOfStock-mb.87a52e0519b2af38af84.svg);background-size:16px}.--outOfStock[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-text[_ngcontent-%COMP%]{color:#d91734}.--soon[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-icon[_ngcontent-%COMP%]{background:url(soon.9d83795252c0c40ea373.svg);background-size:16px}.--soon[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-text[_ngcontent-%COMP%]{color:#e38a62}.--onShop[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-icon[_ngcontent-%COMP%]{background:url(shop-only.4adc9c21a1121a93548e.svg);background-size:16px}.--onShop[_ngcontent-%COMP%]   .amway-dt-chx-stock-detail-status-text[_ngcontent-%COMP%]{color:#38539a}"],changeDetection:0}),Object(v.a)([Object(c.c)(u.a.getLoader)],t.prototype,"loading$",void 0),Object(v.a)([Object(c.c)(u.a.getCurrentAction)],t.prototype,"currentAction$",void 0),t})();function Pe(t,e){1&t&&k.Pb(0)}const Le=function(t,e,n,i){return{header:t,value:e,href:n,collapsed:i}};function Be(t,e){if(1&t&&(k.Rb(0),k.zc(1,Pe,1,0,"ng-container",4),k.Qb()),2&t){const t=e.$implicit;k.cc();const n=k.rc(4);k.Ab(1),k.gc("ngTemplateOutlet",n)("ngTemplateOutletContext",k.nc(2,Le,t.header,t.value,t.href,t.collapsed))}}const De=function(t){return{collapsed:t}},Ue=function(t){return{in:t}};function _e(t,e){if(1&t){const t=k.Ub();k.Tb(0,"div",5),k.ac("click",function(){k.tc(t);const n=e.header;return k.cc().updateCollapsedState(n)}),k.Tb(1,"div",6),k.Bc(2),k.dc(3,"translate"),k.Sb(),k.Tb(4,"div",7),k.Ob(5,"div",8),k.Sb(),k.Sb()}if(2&t){const t=e.header,n=e.value,i=e.href,c=e.collapsed;k.Ab(1),k.Cb("href","#",i,""),k.hc("id",i+"-head"),k.gc("ngClass",k.lc(10,De,c)),k.Ab(1),k.Dc(" ",k.ec(3,8,t)," "),k.Ab(2),k.hc("id",i),k.gc("ngClass",k.lc(12,Ue,!c)),k.Bb("aria-labelledby",i+"-head"),k.Ab(1),k.gc("innerHTML",n,k.uc)}}let xe=(()=>{class t{constructor(t,e){this.cd=t,this.sanitizer=e,this.product=null,this.accordianList=[]}ngOnInit(){this.setAccordianList()}setAccordianList(){if(this.accordianList=[],this.product){if(this.product.information){const t={header:"PRODUCT_DETAIL.product_details",value:this.product.information?this.sanitizer.bypassSecurityTrustHtml(this.product.information):"",href:"amway-dt-detail",collapsed:!1};this.accordianList.push(t)}if(this.product.ingredientBadgeInfo){const t={header:"PRODUCT_DETAIL.ingredient",value:this.product.ingredientBadgeInfo?this.sanitizer.bypassSecurityTrustHtml(this.product.ingredientBadgeInfo):"",href:"amway-dt-ingredient",collapsed:!0};this.accordianList.push(t)}}}updateCollapsedState(t){if(t){const e=this.accordianList.findIndex(e=>e.header===t);-1!==e&&(this.accordianList[e].collapsed=!this.accordianList[e].collapsed)}this.cd.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(k.h),k.Nb(vt.b))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-product-detail-additional-info"]],inputs:{product:"product"},decls:5,vars:1,consts:[[1,"amway-dt-accordion-area"],["id","amway-dt-accordion","role","tablist","aria-multiselectable","true",1,"amway-dt-accordion"],[4,"ngFor","ngForOf"],["accordianTemplate",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"amway-dt-accordion-list",3,"click"],["role","button","data-toggle","collapse","aria-expanded","true","aria-controls","amway-dt-detail",1,"amway-dt-accordion-title",3,"ngClass","id"],["role","tabpanel",1,"panel-collapse","collapse",3,"id","ngClass"],[1,"panel-body",3,"innerHTML"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.zc(2,Be,2,7,"ng-container",2),k.Sb(),k.zc(3,_e,6,14,"ng-template",null,3,k.Ac),k.Sb()),2&t&&(k.Ab(2),k.gc("ngForOf",e.accordianList))},directives:[R.k,R.n,R.j],pipes:[i.c],styles:[""],changeDetection:0}),t})();var Re=n("iJbF"),Qe=n("HDdC"),Ve=n("gg4E"),ze=n("xIUe"),Fe=n("Kjkz");let Ne=(()=>{class t{constructor(){this.item=null,this.listSelectionChageEvent=new k.n}ngOnInit(){}onListSelectionChange(t){this.listSelectionChageEvent.emit(t)}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=k.Hb({type:t,selectors:[["app-add-product-to-list-item"]],inputs:{item:"item"},outputs:{listSelectionChageEvent:"listSelectionChageEvent"},decls:5,vars:5,consts:[[1,"add-to-share-list"],["type","checkbox",1,"add-to-share-input",3,"id","name","value","change"],[1,"add-to-share-label",3,"for"],[1,"add-to-share-label-text"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"input",1),k.ac("change",function(t){return e.onListSelectionChange(t)}),k.Sb(),k.Tb(2,"label",2),k.Tb(3,"div",3),k.Bc(4),k.Sb(),k.Sb(),k.Sb()),2&t&&(k.Ab(1),k.hc("id",e.item.uid),k.hc("name",e.item.uid),k.hc("value",e.item.uid),k.Ab(1),k.hc("for",e.item.uid),k.Ab(2),k.Cc(null==e.item?null:e.item.name))},styles:[""],changeDetection:0}),t})();function He(t,e){if(1&t){const t=k.Ub();k.Rb(0),k.Tb(1,"app-add-product-to-list-item",15),k.ac("listSelectionChageEvent",function(e){return k.tc(t),k.cc(2).onListSelectionChange(e)}),k.Sb(),k.Qb()}if(2&t){const t=e.$implicit;k.Ab(1),k.gc("item",t)}}function $e(t,e){if(1&t&&(k.Rb(0),k.zc(1,He,2,1,"ng-container",14),k.dc(2,"async"),k.Qb()),2&t){const t=k.cc();k.Ab(1),k.gc("ngForOf",k.ec(2,1,t.shopList$))}}const je=function(t){return{"has-morethan-four":t}};let qe=(()=>{class t{constructor(t,e,n,i){this.uiHelperService=t,this.store=e,this.route=n,this.config=i,this.closeAddToListModalEvent=new k.n,this.openCreateNewListModalEvent=new k.n,this.addProductToListsEvent=new k.n,this.shopUid="",this.subscriptions=new m.a,this.isModalClassAlreadyApplied=!1,this.selectedShopListUids=[],this.currentPage=0,this.numberOfPages=0,this.isModalClassAlreadyApplied=this.uiHelperService.isModalClassApplied(),this.isModalClassAlreadyApplied||this.uiHelperService.onInitPopup(),this.shoplistScrollCallback=this.handleScrollEvent.bind(this)}ngOnInit(){this.getRouteParams(),this.subscribeForNumberOfPages()}getRouteParams(){this.subscriptions.add(this.route.params.subscribe(t=>{this.shopUid=t&&t.shopUid?t.shopUid:this.shopUid,this.store.dispatch(new O.h(this.shopUid,this.currentPage)),this.store.dispatch(new ze.a)}))}subscribeForNumberOfPages(){this.subscriptions.add(this.numbeOfPages$.subscribe(t=>{this.numberOfPages=t}))}handleScrollEvent(){return this.currentPage+1<this.numberOfPages?(this.currentPage++,this.scrollObservable=this.store.dispatch(new O.h(this.shopUid,this.currentPage))):this.scrollObservable=new Qe.a(t=>{t.next(""),t.complete()}),this.scrollObservable}closeAddToListModal(){this.closeAddToListModalEvent.emit(!0)}openCreateNewListModal(){this.openCreateNewListModalEvent.emit(!0)}onListSelectionChange(t){const e=t.srcElement.value;t.srcElement.checked?this.isItemAlreadyPresent(e)||this.selectedShopListUids.push(e):this.isItemAlreadyPresent(e)&&(this.selectedShopListUids=this.selectedShopListUids.filter(t=>t!==e))}isItemAlreadyPresent(t){return-1!==this.selectedShopListUids.findIndex(e=>e===t)}addProductToLists(){this.addProductToListsEvent.emit(this.selectedShopListUids)}ngOnDestroy(){this.isModalClassAlreadyApplied||this.uiHelperService.onClosePopup(),this.store.dispatch(new O.g),this.scrollObservable=null,this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(I.a),k.Nb(c.f),k.Nb(h.a),k.Nb(Ve.a))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-add-product-to-list"]],outputs:{closeAddToListModalEvent:"closeAddToListModalEvent",openCreateNewListModalEvent:"openCreateNewListModalEvent",addProductToListsEvent:"addProductToListsEvent"},decls:23,vars:23,consts:[["id","Thelist",1,"amway-modal","active"],[1,"bg-modal",3,"click"],[1,"amway-modal-content","ListShop"],[1,"title-bar-with-close","mb-3"],[1,"amway-modal-content-title","my-list"],[1,"btn-close-modal","visible-desktop",3,"click"],["data-typeList","shop",1,"content-list","--selected"],["appInfiniteScroller","","scrollPerecnt","70","isElementScroll","true",1,"add-to-share",3,"scrollCallback","ngClass"],[4,"ngIf"],[1,"footer-ListShop","padding-for-mobile"],[1,"two-btn"],["aria-label","open create new list modal",1,"btn-outline-black","btn-modal","btn-mod-double",3,"click"],["aria-label","add product to list",1,"btn-black","btn-modal","btn-mod-double",3,"disabled","click"],[3,"visible","cover"],[4,"ngFor","ngForOf"],[3,"item","listSelectionChageEvent"]],template:function(t,e){if(1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.ac("click",function(){return e.closeAddToListModal()}),k.Sb(),k.Tb(2,"div",2),k.Tb(3,"div",3),k.Tb(4,"div",4),k.Bc(5),k.dc(6,"translate"),k.Sb(),k.Tb(7,"div",5),k.ac("click",function(){return e.closeAddToListModal()}),k.Sb(),k.Sb(),k.Tb(8,"div",6),k.Tb(9,"div",7),k.dc(10,"async"),k.zc(11,$e,3,3,"ng-container",8),k.dc(12,"async"),k.Sb(),k.Tb(13,"div",9),k.Tb(14,"div",10),k.Tb(15,"button",11),k.ac("click",function(){return e.openCreateNewListModal()}),k.Bc(16),k.dc(17,"translate"),k.Sb(),k.Tb(18,"button",12),k.ac("click",function(){return e.addProductToLists()}),k.Bc(19),k.dc(20,"translate"),k.Sb(),k.Sb(),k.Sb(),k.Ob(21,"app-loader",13),k.dc(22,"async"),k.Sb(),k.Sb(),k.Sb()),2&t){let t=null,n=null;k.Ab(5),k.Cc(k.ec(6,9,"ADD_FOA_LIST.my_list")),k.Ab(4),k.gc("scrollCallback",e.shoplistScrollCallback)("ngClass",k.lc(21,je,(null==(t=k.ec(10,11,e.shopList$))?null:t.length)>4)),k.Ab(2),k.gc("ngIf",null==(n=k.ec(12,13,e.shopList$))?null:n.length),k.Ab(5),k.Dc("+ ",k.ec(17,15,"ADD_FOA_LIST.create_list"),""),k.Ab(2),k.gc("disabled",!(null!=e.selectedShopListUids&&e.selectedShopListUids.length)),k.Ab(1),k.Cc(k.ec(20,17,"COMMON.save")),k.Ab(2),k.gc("visible",k.ec(22,19,e.loading$))("cover",!0)}},directives:[Fe.a,R.j,R.l,$.a,R.k,Ne],pipes:[i.c,R.b],styles:[""],changeDetection:0}),Object(v.a)([Object(c.c)(r.a.getShopList)],t.prototype,"shopList$",void 0),Object(v.a)([Object(c.c)(r.a.getNumberOfPages)],t.prototype,"numbeOfPages$",void 0),Object(v.a)([Object(c.c)(r.a.getLoader)],t.prototype,"loading$",void 0),t})();function Ge(t,e){if(1&t&&k.Ob(0,"app-breadcrumb",23),2&t){const t=k.cc(2);k.gc("isPdpBreadcrumb",!0)("history",t.history)}}function Je(t,e){1&t&&(k.Rb(0),k.zc(1,Ge,1,2,"app-breadcrumb",22),k.Qb()),2&t&&(k.Ab(1),k.gc("appRole","shopOwner"))}function Ke(t,e){if(1&t&&k.Ob(0,"app-product-detail-image",24),2&t){const t=k.cc();k.gc("images",null==t.product?null:t.product.images)}}function Ye(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-product-detail-info",25),k.ac("openShareInfoModalEvent",function(){return k.tc(t),k.cc().openShareInfoModal()})("toggleAddToListModalEvent",function(e){return k.tc(t),k.cc().toggleAddToListModal(e)})("updateBundleMapEvent",function(e){return k.tc(t),k.cc().onBundleSelectionMapUpdate(e)})("variantSelectionEvent",function(e){return k.tc(t),k.cc().onVariantChange(e)}),k.Sb()}if(2&t){const t=k.cc();k.gc("product",t.product)("shopUid",t.shopUid)}}function Xe(t,e){if(1&t&&k.Ob(0,"app-product-detail-additional-info",26),2&t){const t=k.cc();k.gc("product",t.product)}}function We(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-email",27),k.ac("closeModalEvent",function(e){return k.tc(t),k.cc().toggleEmailModal(e)}),k.Sb()}if(2&t){const t=k.cc();k.gc("product",t.product)}}function Ze(t,e){if(1&t){const t=k.Ub();k.Tb(0,"app-add-product-to-list",28),k.ac("closeAddToListModalEvent",function(){return k.tc(t),k.cc().toggleAddToListModal(!1)})("openCreateNewListModalEvent",function(){return k.tc(t),k.cc().openCreateNewListModal()})("addProductToListsEvent",function(e){return k.tc(t),k.cc().addProductToLists(e)}),k.Sb()}}const tn=[{path:"",component:(()=>{class t{constructor(t,e,n,i,c,a,s,o,l,d,r,u){this.route=t,this.router=e,this.productService=n,this.uiHelperService=i,this.store=c,this.shopInfoService=a,this.headerService=s,this.messaeService=o,this.sessionStorage=l,this.localStorage=d,this.metadataService=r,this.shopUid="",this.listId="",this.aliasCode="",this.product=new E.a,this.subscriptions=new m.a,this.history=[],this.isShareItemInfoModalOpen=!1,this.isAddToListModalOpen=!1,this.openEmailModal=!1,this.showProductInfo=!1,this.isCreateNewListModalOpen=!1,this.loading$=new f.a(!1),this.bundleQuantitySelectionMap=new Map,this.cartItemCount$=new f.a(0),this.openUserModal=!1,this.userName$=new f.a(""),u.removePreviousStyles()}ngOnInit(){this.getRouteParams(),this.getRouteData(),this.subscribeForShopListCurrentAction(),this.subscribeForCurrentAction(),this.uiHelperService.roleUpdate(!0),this.cartItemCount$=this.headerService.cartItemCount$,this.userName$=this.headerService.loggedInUserFullName$}getRouteParams(){this.subscriptions.add(this.route.queryParamMap.subscribe(t=>{const e=t.get("sbc");e&&this.sessionStorage.setItem(y.o,e)})),this.subscriptions.add(this.route.params.subscribe(t=>{this.shopUid=t&&t.shopUid?t.shopUid:this.shopUid,this.aliasCode=t&&t.aliasCode?t.aliasCode:this.aliasCode,this.getProductDetails()}))}getRouteData(){this.subscriptions.add(this.route.data.subscribe(t=>{t&&(null!=t.showCartIcon&&(t.showCartIcon&&this.uiHelperService.doesCartExist()&&this.store.dispatch(new A.e),this.headerService.showCartIcon$.next(t.showCartIcon)),null!=t.showHomeIcon&&this.headerService.showHomeIcon$.next(t.showHomeIcon)),null!=t.showHomeIcon&&this.headerService.showHomeIcon$.next(t.showHomeIcon)}))}subscribeForShopListCurrentAction(){this.subscriptions.add(this.shopListCurrentAction$.subscribe(t=>{switch(t){case"productAddedToLists":this.messaeService.showSuccess({message:"COMMON.added_to_my_list",routeTo:"/"+this.shopUid+"/"+this.listId,linkMessage:"COMMON.view_list"});break;case"newListCreated":this.messaeService.showSuccess({message:"COMMON.successfully_added_list",viewCloseIcon:!0})}}))}subscribeForCurrentAction(){this.subscriptions.add(this.currentAction$.subscribe(t=>{"productAddedToLists"===t&&this.messaeService.showSuccess({message:"COMMON.added_to_my_list",routeTo:"/"+this.shopUid+"/"+this.listId,linkMessage:"COMMON.view_list"})}))}getProductDetails(){this.loading$.next(!0),this.subscriptions.add(this.productService.getProductDetailsFromAliasCode(this.aliasCode).subscribe(t=>{t&&(this.product=t,this.setMetaData(this.product),this.loading$.next(!1))},()=>{this.loading$.next(!1),this.metadataService.updateMetadata({title:"No content",description:"Product not found",image:""})}))}setMetaData(t){this.metadataService.updateMetadata({title:t.description.trim(),description:t.summary,image:t.imageUrl})}setHistoryForBreadcrumb(){const t=this.uiHelperService.getTranslation("SHOPLIST_BANNER","main_page");this.history=[{label:t,value:"/"+this.shopUid,isActive:!1},{label:this.product.description,value:`/${this.shopUid}/products/${this.aliasCode}`,isActive:!0}]}openShareInfoModal(){this.showProductInfo=!(!this.product||!this.product.is3EProduct)&&this.product.is3EProduct,this.isShareItemInfoModalOpen=!0}closeShareInfoModal(){this.showProductInfo=!1,this.isShareItemInfoModalOpen=!1}toggleEmailModal(t){this.openEmailModal=t}toggleAddToListModal(t){this.isAddToListModalOpen=t}openCreateNewListModal(){this.isCreateNewListModalOpen=!0,this.toggleAddToListModal(!1)}closeCreateNewListModal(){this.isCreateNewListModalOpen=!1}onBundleSelectionMapUpdate(t){this.bundleQuantitySelectionMap=t}addProductToLists(t){if(t&&t.length>0){if(this.listId=1===t.length?t[0]:"",this.product.isBundleProduct){const e=new T.a(null);e.parentProduct=new S.a(this.product.code,1);for(const t of this.bundleQuantitySelectionMap.keys())for(const n of this.bundleQuantitySelectionMap.get(t))e.kitChildProducts.push(new S.a(n.code,n.quantity,n.kitProductIdentifier));const n=this.shopInfoService.getShopInfoFromSession(),i=this.localStorage.getItem(y.k);this.store.dispatch(new C.c({accountId:null==i?void 0:i.aboid,shopId:n.shopUid,shoplistUids:t},e))}else this.store.dispatch(new O.c(t,[this.product]));this.toggleAddToListModal(!1)}}navigateBack(){this.uiHelperService.navigateToLandingPage()}onVariantChange(t){this.router.navigateByUrl(this.shopUid+"/products/"+t.pdpAliasCode)}viewCartPage(){if(this.uiHelperService.doesCartExist()){const t=this.sessionStorage.getItem(y.q);t&&t.shopUid&&this.router.navigateByUrl(""+(t.shopUid+this.uiHelperService.getRoutePathForCartPage()))}}navigateToLandingPage(){this.router.navigateByUrl(""+this.shopUid)}toggleUserModal(t){this.openUserModal=t}ngOnDestroy(){this.subscriptions.unsubscribe(),this.loading$.unsubscribe(),this.headerService.showCartIcon$.next(!1),this.headerService.showHomeIcon$.next(!1)}}return t.\u0275fac=function(e){return new(e||t)(k.Nb(h.a),k.Nb(h.g),k.Nb(M.a),k.Nb(I.a),k.Nb(c.f),k.Nb(w.a),k.Nb(P.a),k.Nb(L.a),k.Nb(B.a),k.Nb(D.a),k.Nb(U.a),k.Nb(_.a))},t.\u0275cmp=k.Hb({type:t,selectors:[["app-pdp-page"]],decls:30,vars:28,consts:[[1,"amway-main-layout","step-creator"],[1,"amway-main-layout__content"],[1,"amway-container"],[3,"header","openUserModalEvent"],[1,"pdp-back-btn","visible-desktop"],[1,"pdp-back-btn-icon",3,"click"],[1,"pdp-back-btn-text"],[1,"amway-detail"],[1,"detail-sticky","clearfix"],[1,"left"],[1,"left-child"],[4,"ngIf"],[3,"images",4,"ngIf"],[1,"right","padding-on-mb"],[3,"product","shopUid","openShareInfoModalEvent","toggleAddToListModalEvent","updateBundleMapEvent","variantSelectionEvent",4,"ngIf"],[3,"product",4,"ngIf"],[3,"open","fullName","closeUserModalEvent"],[3,"open","showProductInfo","product","sendEmailEvent","closeModalEvent"],[3,"product","closeModalEvent",4,"ngIf"],[3,"closeAddToListModalEvent","openCreateNewListModalEvent","addProductToListsEvent",4,"ngIf"],[3,"open","product","bundleQuantitySelectionMap","closeModalEvent"],[3,"visible","cover"],[3,"isPdpBreadcrumb","history",4,"appRole"],[3,"isPdpBreadcrumb","history"],[3,"images"],[3,"product","shopUid","openShareInfoModalEvent","toggleAddToListModalEvent","updateBundleMapEvent","variantSelectionEvent"],[3,"product"],[3,"product","closeModalEvent"],[3,"closeAddToListModalEvent","openCreateNewListModalEvent","addProductToListsEvent"]],template:function(t,e){1&t&&(k.Tb(0,"div",0),k.Tb(1,"div",1),k.Tb(2,"div",2),k.Tb(3,"app-mob-header",3),k.ac("openUserModalEvent",function(){return e.toggleUserModal(!0)}),k.Sb(),k.Tb(4,"a",4),k.Tb(5,"div",5),k.ac("click",function(){return e.navigateToLandingPage()}),k.Sb(),k.Tb(6,"div",6),k.Bc(7),k.dc(8,"translate"),k.Sb(),k.Sb(),k.Tb(9,"div",7),k.Tb(10,"section",8),k.Tb(11,"div",9),k.Tb(12,"div",10),k.zc(13,Je,2,1,"ng-container",11),k.zc(14,Ke,1,1,"app-product-detail-image",12),k.Sb(),k.Sb(),k.Tb(15,"div",13),k.zc(16,Ye,1,2,"app-product-detail-info",14),k.Sb(),k.Sb(),k.Tb(17,"section"),k.zc(18,Xe,1,1,"app-product-detail-additional-info",15),k.Sb(),k.Sb(),k.Sb(),k.Sb(),k.Sb(),k.Tb(19,"app-header-user-info-sidebar",16),k.ac("closeUserModalEvent",function(){return e.toggleUserModal(!1)}),k.dc(20,"async"),k.Sb(),k.Tb(21,"app-sharebar",17),k.ac("sendEmailEvent",function(t){return e.toggleEmailModal(t)})("closeModalEvent",function(){return e.closeShareInfoModal()}),k.Sb(),k.zc(22,We,1,1,"app-email",18),k.zc(23,Ze,1,0,"app-add-product-to-list",19),k.Tb(24,"app-create-new-list",20),k.ac("closeModalEvent",function(){return e.closeCreateNewListModal()}),k.Sb(),k.Ob(25,"app-contact-footer"),k.Ob(26,"app-loader",21),k.dc(27,"async"),k.dc(28,"async"),k.dc(29,"async")),2&t&&(k.Ab(3),k.gc("header","pdp"),k.Ab(4),k.Dc(" ",k.ec(8,18,"HEADER.back")," "),k.Ab(6),k.gc("ngIf",null==e.history?null:e.history.length),k.Ab(1),k.gc("ngIf",null==e.product?null:e.product.code),k.Ab(2),k.gc("ngIf",null==e.product?null:e.product.code),k.Ab(2),k.gc("ngIf",null==e.product?null:e.product.code),k.Ab(1),k.gc("open",e.openUserModal)("fullName",k.ec(20,20,e.userName$)),k.Ab(2),k.gc("open",e.isShareItemInfoModalOpen)("showProductInfo",e.showProductInfo)("product",e.product),k.Ab(1),k.gc("ngIf",e.openEmailModal),k.Ab(1),k.gc("ngIf",e.isAddToListModalOpen),k.Ab(1),k.gc("open",e.isCreateNewListModalOpen)("product",e.product)("bundleQuantitySelectionMap",e.bundleQuantitySelectionMap),k.Ab(2),k.gc("visible",k.ec(27,22,e.loading$)||k.ec(28,24,e.isLoading$)||k.ec(29,26,e.fetching$))("cover",!0))},directives:[x.a,R.l,Q.a,V.a,N,H.a,$.a,j.a,Z,dt,we,xe,Re.a,qe],pipes:[i.c,R.b],styles:[""],changeDetection:0}),Object(v.a)([Object(c.c)(r.a.getShopListCurrentAction)],t.prototype,"shopListCurrentAction$",void 0),Object(v.a)([Object(c.c)(u.a.getCurrentAction)],t.prototype,"currentAction$",void 0),Object(v.a)([Object(c.c)(r.a.getLoader)],t.prototype,"isLoading$",void 0),Object(v.a)([Object(c.c)(u.a.getLoader)],t.prototype,"fetching$",void 0),t})(),resolve:{shopInfo:g.a},data:{showCartIcon:!0,showHomeIcon:!0}}];let en=(()=>{class t{}return t.\u0275mod=k.Lb({type:t}),t.\u0275inj=k.Kb({factory:function(e){return new(e||t)},imports:[[h.i.forChild(tn)],h.i]}),t})(),nn=(()=>{class t{}return t.\u0275mod=k.Lb({type:t}),t.\u0275inj=k.Kb({factory:function(e){return new(e||t)},imports:[[en,a.a,i.b.forChild(),c.b.forFeature([d.a,r.a,b.a,s.a,p.a,l.a,u.a,o.a])]]}),t})()}}]);