1import{a as j}from"./chunk-KIC5ECNQ.js";import{a as P}from"./chunk-35SGRMS4.js";import"./chunk-XXNHHJZC.js";import"./chunk-IWECOY4K.js";import"./chunk-2UUDP47Z.js";import{b as B,k as F,l as G}from"./chunk-PWZFPB6M.js";import"./chunk-G6TSCUPF.js";import"./chunk-BQXTRCFG.js";import"./chunk-RHUCFSJQ.js";import"./chunk-L7X23K65.js";import{a as N}from"./chunk-HG5CHN5K.js";import{a as U}from"./chunk-6ZQAITSH.js";import"./chunk-J6GQJU72.js";import{e as R}from"./chunk-5SFETNG4.js";import"./chunk-ZBNCHSP7.js";import"./chunk-WRDJVH5Q.js";import{a as z}from"./chunk-DKTYVUZB.js";import"./chunk-4YT5MHXL.js";import"./chunk-ORWH74JT.js";import"./chunk-Z6LSDNUE.js";import"./chunk-DGJ3K2BY.js";import"./chunk-6MVXVXS4.js";import"./chunk-E2VIPH2W.js";import{b as S,c as E}from"./chunk-YDV2Y5JY.js";import"./chunk-PFQBNJ2W.js";import"./chunk-GI65VDHJ.js";import"./chunk-UE6TEYQD.js";import{b as w,c as M,d as D}from"./chunk-W5YNDQA3.js";import"./chunk-44UTOCO3.js";import"./chunk-6UPYPU4G.js";import"./chunk-EFVQNVGF.js";import"./chunk-IWSPSW5O.js";import{b as v}from"./chunk-DEPGJGBR.js";import{y as L}from"./chunk-ERR6X27Y.js";import{Ac as T,Bc as A,Cc as b,Ec as I,Ic as k,Jc as x,Xc as u,ad as d,b as C,bd as h,cd as _,eb as f,ec as a,fc as p,gc as c,hc as s,jb as o,tb as l,uc as g,zb as O}from"./chunk-5UMF6ZTD.js";import"./chunk-EQDQRRRY.js";var V=r=>({gift_name:r}),q=r=>({value:r}),ve=(()=>{class r{constructor(i,t,e,n,m){this._orderService=i,this._bodyScrollService=t,this._translateService=e,this._localStorageService=n,this._piwikService=m,this.isDelivery=this._orderService.orderDeliveryTypeSignal()===z.Delivery,this.language=this._translateService.currentLang?.toUpperCase(),this.domain=v.domain.toUpperCase(),this.cdnUrl=v.cdnUrl,this._popupAnalyticalName="AfterLocalizationGift",this._subscriptions=new C}ngOnInit(){this._piwikService.pushViewPopup(this._popupAnalyticalName),this._orderService.afterLocalizationGiftInfo&&this._orderService.afterLocalizationGiftInfo.forEach(i=>{if(i.deliveryType.includes(this._orderService.orderDeliveryTypeSignal())){this.giftName=i.name,this.giftImage=i.image,this.giftPromoCode=i.promocode;let t=this._getPromoCodeRequestPayload();this._orderService.postPromoCode(t).subscribe({next:e=>{e&&e.minimalOrderValue&&(this.minOrderValue=e.minimalOrderValue)},error:e=>{console.log("Error: ",e)}})}})}popupClose(){this._giftAddedToBasket||this._piwikService.pushClickPopup(this._popupAnalyticalName,"exit"),this._bodyScrollService.unblockBodyScroll()}addToBasket(){this._piwikService.pushClickPopup(this._popupAnalyticalName,"AFTER_LOCALIZATION_GIFT.POPUP.ADD_TO_BASKET_"+this.domain);let i=this._getPromoCodeRequestPayload();this._subscriptions.add(this._orderService.postPromoCode(i).subscribe({next:t=>{t&&(this._evaluateBasket(t),this._giftAddedToBasket=!0)},error:t=>{console.log("Error: ",t)}}))}_getPromoCodeRequestPayload(){let i=new j;return i.restaurantId=this._orderService.restaurantSignal()?.id,i.publicCode=this.giftPromoCode,i.deliveryType=this._orderService.orderDeliveryTypeSignal(),i}_evaluateBasket(i){let t=!1,e=i?.type!=="CLAIM",n={basket:{basketLines:[],discounts:[{type:F.Promocode,promoCode:this.giftPromoCode}]},deliveryType:this._orderService.orderDeliveryTypeSignal(),restaurantId:this._orderService.restaurantSignal()?.id,deliveryAddress:this._orderService.orderDeliveryAddressSignal()};this._localStorageService.set(S.MYOLYP_PROMO_BLOCKED,!0),!this.isDelivery&&this.minOrderValue&&this._localStorageService.set(S.TRY_TO_ADD_GIFT,this.giftPromoCode),this._subscriptions.add(this._orderService.evaluateOrder(n).subscribe(m=>{if(m){let y=m.basket.discounts.find(H=>H?.promoCode.toUpperCase()===this.giftPromoCode?.toUpperCase());y&&y.status===B.Accepted&&(this._piwikService.pushCheckoutAddDiscountCode(i),i.product.price&&(this._orderService.addBasketLine(i.product),this._orderService.setDiscount(+i.product.price,"PRODUCT",e),this._piwikService.pushAddPromocodeProduct(i.product,!0),t=!0),t&&this._orderService.setPromoCode(this.giftPromoCode)),this._orderService.evaluateCurrentOrder(),this.popup.close()}}))}static{this.\u0275fac=function(t){return new(t||r)(l(G),l(N),l(w),l(E),l(R))}}static{this.\u0275cmp=O({type:r,selectors:[["kfc-after-localization-gift-info-popup"]],viewQuery:function(t,e){if(t&1&&T(P,5),t&2){let n;A(n=b())&&(e.popup=n.first)}},decls:20,vars:25,consts:[[1,"after-localization-gift-popup"],[3,"popupClose"],[1,"gift-images-container"],[1,"title-container"],["alt","","width","256","height","52",3,"ngSrc"],[1,"g
1ift-image-container"],["width","180","height","180",1,"gift-image",3,"ngSrc","alt"],[1,"gift-image-for-free-wrapper"],["alt","green-star","width","103","height","103",3,"ngSrc"],[1,"font-weight-500","text-uppercase"],["alt","pink-background","width","254","height","254",1,"gift-pink-bgc",3,"ngSrc"],[1,"gift-info-container"],[1,"big-text",3,"innerHTML"],[3,"click","label"],[1,"small-text","text-font-14-line-18",3,"innerHTML"]],template:function(t,e){t&1&&(p(0,"div",0)(1,"popup-outlet",1),g("popupClose",function(){return e.popupClose()}),p(2,"div",2)(3,"div",3),s(4,"img",4),c(),p(5,"div",5),s(6,"img",6),p(7,"div",7),s(8,"img",8),p(9,"span",9),k(10),d(11,"translate"),c()(),s(12,"img",10),c()(),p(13,"div",11),s(14,"span",12),d(15,"translate"),p(16,"kfc-button",13),d(17,"translate"),g("click",function(){return e.addToBasket()}),c(),s(18,"span",14),d(19,"translate"),c()()()),t&2&&(o(4),a("ngSrc",e.cdnUrl+"assets/img/afterLocalizationGift/after-localization-gift-popup-title-"+e.domain+"-"+e.language+".svg"),o(2),a("ngSrc",e.giftImage)("alt",e.giftName),o(2),a("ngSrc",e.cdnUrl+"assets/img/afterLocalizationGift/green-star.svg"),o(2),x(h(11,11,"AFTER_LOCALIZATION_GIFT.POPUP.FOR_FREE_"+e.domain)),o(2),a("ngSrc",e.cdnUrl+"assets/img/afterLocalizationGift/pink-background.svg"),o(2),a("innerHTML",_(15,13,"AFTER_LOCALIZATION_GIFT.POPUP.PRODUCT_FOR_FREE_"+e.domain,u(21,V,e.giftName)),f),o(2),I("width","100%"),a("label",h(17,16,"AFTER_LOCALIZATION_GIFT.POPUP.ADD_TO_BASKET_"+e.domain)),o(2),a("innerHTML",_(19,18,"AFTER_LOCALIZATION_GIFT.POPUP.PROMO_INFO_"+(e.minOrderValue?"WITH_MIN_ORDER_VALUE_":"")+e.domain,u(23,q,e.minOrderValue)),f))},dependencies:[P,D,U,L,M],styles:["[_nghost-%COMP%] .popup-outlet{display:flex;justify-content:center;align-items:center}[_nghost-%COMP%] .popup-outlet-dialog{width:328px;height:572px}@media screen and (max-width:767px){[_nghost-%COMP%] .popup-outlet-dialog{width:calc(100% - 32px)!important;height:calc(100% - 64px)!important;max-height:572px}}[_nghost-%COMP%] .popup-outlet-dialog .popup-outlet-close{right:0;top:0}[_nghost-%COMP%] .popup-outlet-dialog .popup-outlet-content{padding:24px;border:3px solid #E4002B;border-radius:8px}[_nghost-%COMP%] .popup-outlet-dialog .popup-outlet-content .title-container{display:flex;justify-content:center}[_nghost-%COMP%] .gift-images-container{height:342px}[_nghost-%COMP%] .gift-info-container{display:flex;flex-direction:column;justify-content:flex-end}[_nghost-%COMP%] .gift-info-container .big-text{font-family:National Bold,Roboto,Arial,Helvetica,sans-serif;margin:0 auto 24px;display:block;text-align:center;width:100%;max-width:257px;font-size:20px;letter-spacing:.3px;line-height:normal;font-weight:700}[_nghost-%COMP%] .gift-info-container .small-text{display:block;width:100%;text-align:center;margin-top:16px}[_nghost-%COMP%] .gift-image-container{height:254px;width:254px;position:relative;margin:-8px auto 0}[_nghost-%COMP%] .gift-image-container .gift-pink-bgc{position:absolute}[_nghost-%COMP%] .gift-image-container .gift-image{position:absolute;left:37px;top:37px;z-index:1}[_nghost-%COMP%] .gift-image-container .gift-image-for-free-wrapper{bottom:-5px;position:absolute;z-index:2;top:170px;left:-20px;display:flex;justify-content:center;align-content:center}[_nghost-%COMP%] .gift-image-container .gift-image-for-free-wrapper span{transform:rotate(-15deg);position:absolute;top:50%;font-size:17px;height:17px;line-height:17px;color:#fff;z-index:1}[_nghost-%COMP%] kfc-button{font-family:National Bold,Roboto,Arial,Helvetica,sans-serif;letter-spacing:1px}"]})}}return r})();export{ve as AfterLocalizationGiftInfoPopupComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.