"use strict";(globalThis.zipifyJsonp=globalThis.zipifyJsonp||[]).push([["157"],{67648:function(t,e,i){i.r(e),i.d(e,{default:()=>F});var s=i(20629),o=i(86232),n=i(51090);let r={name:"ProductTitle",components:{Wysiwyg:()=>Promise.all([i.e("572"),i.e("309"),i.e("473")]).then(i.bind(i,36621))},props:{index:Number,isInlineTextEditorEligible:Boolean},data:()=>({tempKey:0}),mounted(){this.editMode&&this.$proxy.subscribe("MultipleRepresentation/FontColor",this.forceUpdate)},computed:{...(0,s.Se)({offers:`${o.Fm}/offers`,offerData:`${o.Fm}/offerProducts`,editableClasses:`${o.Fm}/editableClasses`,highlightable:`${o.Fm}/highlightable`,editMode:`${o.Fm}/editMode`}),title(){var t;return null==(t=this.offers[this.index])?void 0:t.product_title},titleContent(){var t,e;return(null==(e=this.offers[this.index])||null==(t=e.inline_product_title)?void 0:t.inline_content)||this.title},upgradeWithOutVariables(){var t,e,i,s;return(null==(e=this.offers[this.index])||null==(t=e.inline_product_title)?void 0:t.inline_content)?this.replaceText(null==(s=this.offers[this.index])||null==(i=s.inline_product_title)?void 0:i.inline_content):this.title},offerId(){return this.offerData[this.index].offer_id}},methods:{onClick(){if(!this.editMode)return;let t={tab:"offers",type:"product_title",index:this.index,id:this.offerId};this.$proxy.publish("buybox:render",this.index),this.$proxy.publish("wysiwyg",t)},saveWysiwyg(t){let{key:e,content:i}=t,s={section:"offers",data:{key:"inline_product_title",value:{[e]:i},index:this.index,id:this.offerId}};this.$store.commit("multipleUpsells/setSection",{...s}),this.$proxy.publish("MultipleRepresentation",s)},replaceText(t){return this.$utils.editorVariableFinder(t,"text",n.Z,this.$store.state.multipleUpsellsModule,this.offerId)},forceUpdate(){this.tempKey+=1}}};var l=i(51900);let a=(0,l.Z)(r,function(){var t=this._self._c;return this.isInlineTextEditorEligible?t("div",{class:this.highlightable},[t("h3",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:this.title,expression:"title"}],staticClass:"ocu-upsell-title",class:this.editableClasses,attrs:{tabindex:"0"},on:{click:this.onClick}})]):t("Wysiwyg",{key:this.tempKey,class:this.editableClasses,attrs:{tabindex:"0",offerIndex:this.index,content:this.titleContent,contentWithoutVariables:this.upgradeWithOutVariables,editable:this.editMode,isEmptyValidation:!0,toolbarWidth:"ocu-toolbar--wide",type:"pre",hasPortal:!0,position:"centered",layoutType:"HEADLINE_TITLE",fieldName:"headline"},on:{"save:content":this.saveWysiwyg}})},[],!1,null,"34a41631",null).exports;var d=i(5483),u=i(12224);let c={name:"PriceBreakdown",props:{index:Number,isInlineTextEditorEligible:Boolean},data:()=>({isUpdated:!0,sanitizeConfig:{allowedTags:["span"]}}),components:{Wysiwyg:()=>Promise.all([i.e("572"),i.e("309"),i.e("473")]).then(i.bind(i,36621))},computed:{...(0,s.Se)({offers:`${o.Fm}/offerProducts`,offerData:`${o.Fm}/offers`,discountData:`${o.Fm}/discountData`,editableClasses:`${o.Fm}/editableClasses`,editMode:`${o.Fm}/editMode`,highlightable:`${o.Fm}/highlightable`,isMobileView:`${o.Fm}/isMobileView`,isPreviewMode:`${o.Fm}/isPreviewMode`,representation:`${o.Fm}/representation`,statuses:"statuses",showSCAppendPrice:"multipleUpsellsModule/showSCAppendPrice",showSCAddPrice:"multipleUpsellsModule/showSCAddPrice",scPriceAdjustmentRule:"multipleUpsellsModule/scPriceAdjustmentRule",scAdjustmentsPrice:"multipleUpsellsModule/scAdjustmentsPrice"}),...(0,s.rn)({moneyFormat:t=>t[o.Fm].moneyFormat,currencyCode:t=>t[o.Fm].currencyCode,hasDraftOrdersLive:t=>t[o.Fm].hasDraftOrdersLive}),offer(){var t;return null==(t=this.offers)?void 0:t[this.index]},discount(){return this.offerData[this.index].discount},variant(){var t;return null==(t=this.offer)?void 0:t.variant},savingsEnabled(){var t;return null==(t=this.offerData[this.index])?void 0:t.savings.enabled},savingsText(){var t;return null==(t=this.offerData[this.index])?void 0:t.savings.text},prices(){return d.Z.countPrices(this.discount,this.offer.prices,this.moneyFormat,this.currencyCode)},nowPrice(){return this.showDiscount?this.prices._discountedPrice:this.prices._price},scPrice(){return this.scAdjustmentsPrice[this.scFormId]},realPrice(){let t=this.prices._price;if("compare_at_price"===this.discountType){let{_compareAtPrice:e,_price:i}=this.prices;t=e-i<=0?i:e}let e=this.isSCPOAdd&&this.scPrice?t+this.scPrice:t;return(0,u.ZP)(e,this.moneyFormat,this.currencyCode)},realNowPrice(){let t=this.isSCPOAdd&&this.scPrice?this.nowPrice+this.scPrice:this.nowPrice;return(0,u.ZP)(t,this.moneyFormat,this.currencyCode)},realAdjustmentPrice(){return(0,u.ZP)(this.scPrice,this.moneyFormat,this.currencyCode)},isSCPOAppend(){return this.showSCAppendPrice(this.scFormId)},isSCPOAdd(){return this.showSCAddPrice(this.scFormId)},scFormId(){return`ocu-scpo-${this.offer.productId}-${this.index}`},scAdjustmentOptions(){var t;return null==(t=this.scPriceAdjustmentRule)?void 0:t.frontend},scPriceClass(){var t;return null==(t=this.scAdjustmentOptions)?void 0:t.option_price_display_class},discountType(){var t;return null==(t=this.discount)?void 0:t.type},isDiscounted(){var t,e;return!!("none"!==this.discountType&&(null==(t=this.prices)?void 0:t._discountedPrice)!==null&&(null==(e=this.prices)?void 0:e._discountedPrice)>=0)},offerReferenceId(){var t;return null==(t=this.representation.offers[this.index])?void 0:t._ocu_offer_reference_id},offerDiscountData(){var t;return null==(t=this.discountData)?void 0:t.ocu[this.offerReferenceId]},isLive(){return!this.editMode&&!this.isPreviewMode},isAvailableDiscount(){var t,e,i;return this.isLive?this.hasDraftOrdersLive||!!this.offerDiscountData:!(null==(t=this.statuses)?void 0:t.pre_checkout_automatic_discount)||(null==(i=this.statuses)||null==(e=i.features)?void 0:e.automatic_discount)},isCompareAtPrice(){return"compare_at_price"===this.discountType},showDiscount(){return this.isDiscounted&&(this.isAvailableDiscount||this.isCompareAtPrice)},showSavings(){return!this.isInlineTextEditorEligible&&this.showDiscount&&this.savingsEnabled},savingsAmount(){let t=this.discount.value>100?100:this.discount.value;return"percent"===this.discount.type?`${t}%`:this.prices.savings},savings(){return`(${this.savingsAmount} ${this.savingsText})`},savingsSettings(){return this.offerData[this.index].savings},savingsStyles(){return{color:this.savingsSettings.color,fontSize:this.savingsSettings.size,fontStyle:this.savingsSettings.italic,fontWeight:this.savingsSettings.emphasized?"700":"400",fontFamily:this.savingsSettings.font,textDecoration:this.savingsSettings.underline}},savingsAmountSettings(){return this.offerData[this.index].savings_amount},savingsAmountStyles(){return{color:this.savingsAmountSettings.color,fontSize:this.savingsAmountSettings.size,fontStyle:this.savingsAmountSettings.italic,fontWeight:this.savingsAmountSettings.emphasized?"700":"400",fontFamily:this.savingsAmountSettings.font,textDecoration:this.savingsAmountSettings.underline}},savingsContent(){let{savingsAmount:t,savingsAmountStyles:e}=this,{color:i,fontSize:s,fontFamily:o,fontWeight:n,fontStyle:r,textDecoration:l}=e;return`
${t}
`},labelContent(){let{savingsText:t,savingsStyles:e}=this,{color:i,fontSize:s,fontFamily:o,fontWeight:n,fontStyle:r,textDecoration:l}=e,a=`
${t}
`;return this.savingsSettings.inline_content||a},fontColor(){return this.$store.getters["multipleUpsellsModule/general"].font_color||"#262626"},oldPriceStyles(){let t=this.fontColor.slice(0,7);return{color:`${t}b3`}},currentPriceStyles(){return{color:this.fontColor}}},watch:{nowPrice(){this.$store.commit(`${o.Fm}/setPrices`,{index:this.index,prices:this.prices})},scAdjustmentsPrice(){this.isUpdated=!1,this.$nextTick(()=>this.isUpdated=!0)}},methods:{onClick(){if(!this.editMode)return;let t={tab:"offers",text:!0,type:"savings",index:this.index,id:this.offers[this.index].offer_id};this.$proxy.publish("buybox:render",this.index),this.$proxy.publish("decorator",t)},saveContent(t){let e,{key:i,content:s,isClearFormatting:o=!1,type:n,sizes:r}=t;if(o)return this.clearFormatting(s,n);"size"===i&&(e=`${r[s]}px`);let l={section:"offers",data:{key:n,value:{...this.offerData[this.index][n],[i]:e||s},index:this.index,id:this.offers[this.index].offer_id}};this.$store.commit("multipleUpsells/setSection",{...l}),this.$proxy.publish("MultipleRepresentation",l)},clearFormatting(t,e){let i={section:"offers",data:{key:e,value:Object.keys(t).reduce((e,i)=>(e[i]=t[i],e),{}),index:this.index,id:this.offers[this.index].offer_id}};this.$store.commit("multipleUpsells/setSection",{...i}),this.$proxy.publish("MultipleRepresentation",i)}}},h=(0,l.Z)(c,function(){var t=this,e=t._self._c;return t.offer?e("div",{staticClass:"ocu-upsell-price__wrap flex--wrap",class:t.isMobileView?"ocu-upsell-price__mobile":"ocu-upsell-price"},[e("div",{staticClass:"ocu-upsell-price__container"},[t.showDiscount?e("div",{staticClass:"ocu-upsell-price__was"},[e("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.realPrice,expression:"realPrice"}],staticClass:"ocu-upsell-price__inline",style:t.oldPriceStyles,attrs:{tabindex:"0","data-ocu-price-was-variant-id":t.offer.variantId,"data-ocu-price-was-product-id":t.offer.productId,"data-testid":"price-static"}}),t._v(" "),t.isSCPOAppend&&t.isUpdated?e("div",{staticClass:"ocu-upsell-price__inline",class:t.scPriceClass,style:t.oldPriceStyles},[t._v("\n + "),e("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.realAdjustmentPrice,expression:"realAdjustmentPrice"}],staticClass:"ocu-upsell-price__inline"})]):t._e()]):t._e(),t._v(" "),e("div",{staticClass:"ocu-upsell-price__now"},[e("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.realNowPrice,expression:"realNowPrice"}],staticClass:"ocu-upsell-price__now ocu-upsell-price__inline",class:{"ocu-upsell-price__scpo":t.isSCPOAppend},style:t.currentPriceStyles,attrs:{tabindex:"0","data-testid":"price-discount","data-ocu-price-now-variant-id":t.offer.variantId,"data-ocu-price-now-product-id":t.offer.productId}}),t._v(" "),t.isSCPOAppend&&t.isUpdated?e("div",{staticClass:"ocu-upsell-price__inline",class:t.scPriceClass,style:t.currentPriceStyles},[t._v("\n + "),e("div",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.realAdjustmentPrice,expression:"realAdjustmentPrice"}],staticClass:"ocu-upsell-price__inline"})]):t._e()]),t._v(" "),t.isInlineTextEditorEligible?e("span",{staticClass:"ocu-upsell-price__saving-wrap",class:t.highlightable,attrs:{"data-testid":"savings-border"}},[t.showDiscount?e("span",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.savings,expression:"savings"}],staticClass:"ocu-upsell-price__saving",class:t.editableClasses,style:t.savingsStyles,attrs:{tabindex:"0","data-testid":"savings"},on:{click:t.onClick}}):t._e()]):t._e(),t._v(" "),t.showSavings?e("span",{staticClass:"ocu-savings--flex"},[e("Wysiwyg",{staticClass:"ocu-offset-right--xs",attrs:{tabindex:"0",content:t.savingsContent,editable:t.editMode,type:"pre",hasPortal:!0,readOnly:!0,layoutType:"DECORATOR_2",fieldName:"savings",position:"centered",isDecorator:""},on:{"save:content":function(e){return t.saveContent({...e,type:"savings_amount"})}}}),t._v(" "),e("Wysiwyg",{staticClass:"ocu-saving-label",attrs:{tabindex:"0",content:t.labelContent,editable:t.editMode,type:"pre",hasPortal:!0,limit:25,toolbarWidth:"ocu-toolbar--wide ocu-toolbar--price",layoutType:"DECORATOR_3",fieldName:"savings",position:"centered"},on:{"save:content":function(e){return t.saveContent({...e,type:"savings"})}}})],1):t._e()])]):t._e()},[],!1,null,"6b4fb665",null).exports,p={name:"Description",props:{index:Number,product:Object,isInlineTextEditorEligible:Boolean},components:{Wysiwyg:()=>Promise.all([i.e("572"),i.e("309"),i.e("473")]).then(i.bind(i,36621))},computed:{...(0,s.Se)({offers:`${o.Fm}/offers`,offerData:`${o.Fm}/offerProducts`,editableClasses:`${o.Fm}/editableClasses`,highlightable:`${o.Fm}/highlightable`,editMode:`${o.Fm}/editMode`,offerDescription:`${o.Fm}/offerDescription`}),offer(){return this.offers[this.index]},description(){var t;return null==(t=this.offer)?void 0:t.description.text},isDescriptionEnabled(){var t;return null==(t=this.offer)?void 0:t.description.enabled},inlineDescription(){var t,e;return null==(e=this.offer)||null==(t=e.description)?void 0:t.inline_content},id(){return Object.keys(this.product)[0]},productId(){return this.product[this.id].id},isOptionSingle(){return 0===this.product[this.id].options.filter(t=>{let{values:e}=t;return!e.every(t=>/Default(\sTitle)?/.test(t))}).length},needMargin(){return this.isOptionSingle?"offset-bottom--sm":"offset-bottom--xs"},importedDescription(){var t;return null==(t=this.offerData[this.index])?void 0:t.description},descriptionContent(){return this.inlineDescription?this.$utils.inlineEntitiesReplacer(this.inlineDescription):this.description},contentWithOutVariables(){return this.inlineDescription?this.$utils.editorVariableFinder(this.inlineDescription,"text",n.Z,this.$store.state.multipleUpsellsModule,this.offerData[this.index].offer_id):this.offerDescription(this.description,this.id)}},methods:{onClick(){if(!this.editMode)return;let t={tab:"offers",type:"description",index:this.index,id:this.offerData[this.index].offer_id,product_id:this.productId};this.$proxy.publish("buybox:render",this.index),this.$proxy.publish("wysiwyg",t)},saveWysiwyg(t){var e;let{key:i,content:s}=t,o={section:"offers",data:{key:"description",value:{...null==(e=this.offer)?void 0:e.description,[i]:s},index:this.index,id:this.offerData[this.index].offer_id}};this.$store.commit("multipleUpsells/setSection",{...o}),this.$proxy.publish("MultipleRepresentation",o)},async updateDescription(){return this.$store.dispatch("getProductDescription",this.productId)}}},f=(0,l.Z)(p,function(){var t=this._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:this.isDescriptionEnabled,expression:"isDescriptionEnabled"}],staticClass:"ocu-description"},[this.isInlineTextEditorEligible?t("div",{staticClass:"ocu-description-highlight",class:[this.highlightable,this.needMargin]},[t("div",{staticClass:"ocu-description-editable",class:this.editableClasses,attrs:{"data-testid":"ocu-description-editable"}}),this._v(" "),t("div",{staticClass:"ocu-upsell-description"},[t("p",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:this.offerDescription(this.description,this.id),expression:"offerDescription(description, id)"}],attrs:{tabindex:"0","data-testid":"description-text"},on:{click:this.onClick}})])]):t("Wysiwyg",{class:this.needMargin,attrs:{tabindex:"0",offerIndex:this.index,content:this.descriptionContent,contentWithoutVariables:this.contentWithOutVariables,editable:this.editMode,productDescription:this.updateDescription,toolbarWidth:"ocu-toolbar--wide",type:"pre",hasPortal:!0,layoutType:"DESCRIPTION",fieldName:"description",contentTestId:"description-text",position:"centered",hasOverflow:""},on:{"save:content":this.saveWysiwyg}})],1)},[],!1,null,"35986606",null).exports,m={name:"Variants",components:{OptionsSelector:i(76066).Z},props:["product","index"],computed:{...(0,s.Se)({offers:`${o.Fm}/offers`,isPreviewMode:`${o.Fm}/isPreviewMode`,editMode:`${o.Fm}/editMode`,offerProducts:`${o.Fm}/offerProducts`,buyBoxRenderingConfig:`${o.Fm}/buyBoxRenderingConfig`,representation:"multipleUpsellsModule/representation"}),id(){return Object.keys(this.product)[0]},allowedVariants(){return this.offers[this.index].variants},shopifyProduct(){return this.product[this.id]},hideVariant(){var t;return null==(t=this.offers[this.index])?void 0:t.hide_variant_selector},fontColor(){var t;return null!=(t=this.representation.general.font_color)?t:"#262626"},selectorsColor(){var t;return null!=(t=this.representation.general.selectors_color)?t:"#9b9b9b"},backgroundColor(){var t,e;return null!=(e=null==(t=this.representation.general.background)?void 0:t.slice(0,7))?e:"#fafafa"},selectorStyles(){let{buyBoxRendered:t}=this.buyBoxRenderingConfig;return{...this.isPreviewMode&&!t?{pointerEvents:"none"}:{},title:{color:this.fontColor},select:{color:this.fontColor,borderColor:this.selectorsColor,backgroundColor:this.backgroundColor},selectOption:{color:"#000000",backgroundColor:"#fafafa"},selectIcon:{fillColor:this.selectorsColor}}},previewMode(){return this.$store.state[o.Fm].previewMode},isDisabled(){return this.offerProducts[this.index].selected}},methods:{onChange(t){if(t||!this.editMode){if(!t&&!this.editMode)return this.$store.dispatch(`${o.Fm}/log`,{onchange:t});this.$store.commit(`${o.Fm}/setVariant`,{productId:this.index,variant:t}),this.$store.commit(`${o.Fm}/setPrices`,{index:this.index,prices:{_price:t.price/100,_compareAtPrice:t.compare_at_price/100}})}},showTab(){this.isPreviewMode&&this.editMode&&this.$proxy.publish("buybox:render",this.index)}}},v=(0,l.Z)(m,function(){var t=this;return(0,t._self._c)("OptionsSelector",{directives:[{name:"show",rawName:"v-show",value:!t.hideVariant,expression:"!hideVariant"}],attrs:{product:t.shopifyProduct,allowedVariants:t.allowedVariants,unavailableVariants:t.previewMode,isDisabled:t.isDisabled,styles:t.selectorStyles},on:{"change:variant":t.onChange},nativeOn:{mousedown:function(e){return t.showTab.apply(null,arguments)}}})},[],!1,null,"7b5308a8",null).exports,b={name:"StarIcon",components:{Icon:(0,l.Z)({name:"Icon",props:{iconName:{type:String},iconTitle:{type:String},iconClass:{type:[String,Array],default:""}},computed:{iconId(){return`#${this.iconName}`}}},function(){var t=this._self._c;return t("svg",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{content:this.iconTitle,targetClasses:[this.iconClass,"icon"]},expression:"{ content: iconTitle, targetClasses: [iconClass, 'icon'] }"}],class:this.iconClass},[t("use",this._b({attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink"}},"use",{"xlink:href":this.iconId},!1))])},[],!1,null,"385eef5e",null).exports},props:{index:Number,indexOffer:Number},computed:{...(0,s.Se)({starRating:`${o.Fm}/starRating`}),starRatingSettings(){return this.starRating[this.indexOffer]},filledColor(){return this.starRatingSettings.star_color.filled},emptyColor(){return this.starRatingSettings.star_color.empty},ratingValue(){return this.starRatingSettings.value},fillStars(){let t=(this.ratingValue-this.index).toFixed(2);return{fill:t<.3?this.emptyColor:this.filledColor,color:t>=.8?this.filledColor:this.emptyColor}}}},g={name:"ProductRating",components:{StarIcon:(0,l.Z)(b,function(){return(0,this._self._c)("icon",{staticClass:"ocu-star-icon",style:this.fillStars,attrs:{"icon-name":"ty_star_rating"}})},[],!1,null,"a3490bf8",null).exports,Wysiwyg:()=>Promise.all([i.e("572"),i.e("309"),i.e("473")]).then(i.bind(i,36621))},props:{index:Number,isInlineTextEditorEligible:Boolean},data:()=>({blockHeight:0}),computed:{...(0,s.Se)({offers:`${o.Fm}/offers`,offerData:`${o.Fm}/offerProducts`,editableClasses:`${o.Fm}/editableClasses`,highlightable:`${o.Fm}/highlightable`,editMode:`${o.Fm}/editMode`,starRating:`${o.Fm}/starRating`,general:"multipleUpsellsModule/general"}),starRatingSettings(){return this.starRating[this.index]},ratingText(){var t;return null==(t=this.starRatingSettings)?void 0:t.text},ratingValue(){var t;return null==(t=this.starRatingSettings)?void 0:t.value},isRatingTextEnabled(){var t;return null==(t=this.starRatingSettings)?void 0:t.enabled},ratingContent(){var t;return(null==(t=this.starRatingSettings)?void 0:t.inline_content)||this.ratingText},ratingWithOutVariables(){var t,e;return(null==(t=this.starRatingSettings)?void 0:t.inline_content)?this.replaceText(null==(e=this.starRatingSettings)?void 0:e.inline_content):this.ratingText},offerId(){return this.offerData[this.index].offer_id},ratingStyles(){var t,e;return{color:null!=(e=null==(t=this.general)?void 0:t.font_color)?e:"#262626"}},ratingAriaLabel(){return`Product rating is ${this.ratingValue} out of 5`}},methods:{onClick(){if(!this.editMode)return;let t={tab:"offers",type:"star_rating",index:this.index,id:this.offerId};this.$proxy.publish("buybox:render",this.index),this.$proxy.publish("wysiwyg",t)},saveWysiwyg(t){var e;let{key:i,content:s}=t;this.blockHeight=(null==(e=this.$refs.rating)?void 0:e.$el.offsetHeight)||0;let o={section:"offers",data:{key:"star_rating",value:{...this.starRatingSettings,[i]:s},index:this.index,id:this.offerId}};this.$store.commit("multipleUpsells/setSection",{...o}),this.$proxy.publish("MultipleRepresentation",o)},replaceText(t){return this.$utils.editorVariableFinder(t,"text",n.Z,this.$store.state.multipleUpsellsModule,this.offerId)}}},y=(0,l.Z)(g,function(){var t=this,e=t._self._c;return t.isRatingTextEnabled?e("div",{staticClass:"ocu-rating-wrap"},[e("div",{staticClass:"ocu-rating-star"},t._l(5,function(i,s){return e("div",{key:s,staticClass:"ocu-rating-star_item"},[e("star-icon",{attrs:{index:s,indexOffer:t.index}})],1)}),0),t._v(" "),e("span",{staticClass:"ocu-rating-value",style:t.ratingStyles,attrs:{tabindex:"0","aria-label":t.ratingAriaLabel,"data-testid":"rating-value"}},[t._v(t._s(t.ratingValue))]),t._v(" "),t.isInlineTextEditorEligible?e("div",{class:["ocu-rating-highlight",t.highlightable],attrs:{"data-testid":"rating-highlight"},on:{click:t.onClick}},[e("div",{staticClass:"ocu-rating-editable",class:t.editableClasses,attrs:{"data-testid":"rating-editable"}}),t._v(" "),e("div",{staticClass:"ocu-rating-description",attrs:{"data-testid":"rating-description"}},[e("p",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:t.ratingText,expression:"ratingText"}],attrs:{tabindex:"0"}})])]):e("Wysiwyg",{ref:"rating",staticClass:"ocu-rating-inline ocu-label--width",class:t.editableClasses,attrs:{tabindex:"0",offerIndex:t.index,content:t.ratingContent,contentWithoutVariables:t.ratingWithOutVariables,editable:t.editMode,toolbarWidth:"ocu-toolbar--wide",isEmptyValidation:!0,hasOverflow:t.blockHeight>110,position:"centered",type:"pre",hasPortal:!0,layoutType:"HEADLINE_RATING",fieldName:"headline",contentTestId:"rating-description"},on:{"save:content":t.saveWysiwyg}})],1):t._e()},[],!1,null,"6df624a3",null).exports,x={name:"SCProductOptions",props:{index:{type:Number,required:!0},product:{type:Object,required:!0}},data:()=>({inited:!0,stylesURL:null,stylesLoaded:null,stylesData:"",containerWidth:270,isUpdating:!1}),created(){if(!this.allowed)return},mounted(){this.$nextTick(()=>{if(this.allowed&&this.productId>0){if(!this.scScriptLoaded){var t;this.initSCState({boldEl:this.$refs.boldBlock,innerProductId:this.id,index:this.productId,formId:this.formId,isLive:this.isLive,variants:null==(t=this.currentProduct)?void 0:t.variants,allowed:this.allowed})}this.setupSCPO(),this.stylesLoaded||this.loadStyles()}else this.productId<0&&this.setSCEmptyState(this.index);this.setAllowed({allowed:this.allowed,index:this.formId})})},destroyed(){var t,e,i;this.setSCEmptyAll(),this.isPreviewMode&&(null==(i=window.BOLD)||null==(e=i.options)||null==(t=e.app)||t.unload()),this.setSCScriptStatus(!1)},computed:{...(0,s.rn)({scScriptStatus:t=>t.multipleUpsellsModule.scScriptStatus,hasOptions:t=>t.multipleUpsellsModule.hasOptions,scScriptLoaded:t=>t.multipleUpsellsModule.scScriptLoaded,representation:t=>t.multipleUpsellsModule}),...(0,s.Se)({isPreviewMode:"multipleUpsellsModule/isPreviewMode",isMobileView:"multipleUpsellsModule/isMobileView",isTabletView:"multipleUpsellsModule/isTabletView",isEditMode:"multipleUpsellsModule/editMode",offers:"multipleUpsellsModule/offers",general:"multipleUpsellsModule/general",showSCDefaultPrice:"multipleUpsellsModule/showSCDefaultPrice",scAdjustmentsPrice:"multipleUpsellsModule/scAdjustmentsPrice"}),allowed(){var t;return null==(t=this.offer)?void 0:t.allow_product_options_app},id(){return Object.keys(this.product)[0]},currentProduct(){return this.product[this.id]},productId(){return"string"==typeof this.currentProduct.id?+this.currentProduct.id.match(/\d+/)[0]:this.currentProduct.id},offer(){return this.offers[this.index]},checkBreakpoints:()=>window.matchMedia("(max-width: 767px)").matches,hasTopOffset(){var t,e;return(null==(e=this.currentProduct)||null==(t=e.variants)?void 0:t.length)>0},cssVars(){return{"--ocuSCContainerWidth":this.containerWidth&&!(this.isMobileView||this.checkBreakpoints)?`${!this.isTabletView?this.containerWidth:244}px`:"100%","font-family":this.general.font}},isLive(){return!this.editMode&&!this.isPreviewMode},formId(){var t,e,i;return null==(i=this.$refs)||null==(e=i.scpoForm)||null==(t=e.dataset)?void 0:t.formId}},methods:{...(0,s.nv)({getStyles:"getSCPOStyles",initSCState:"multipleUpsellsModule/initSCState",setupApp:"multipleUpsellsModule/setupApp",getSCPOStylesFile:"multipleUpsellsModule/getSCPOStylesFile",listenSCEvents:"multipleUpsellsModule/listenSCEvents",optionsChanged:"multipleUpsellsModule/optionsChanged",inputChanged:"multipleUpsellsModule/inputChanged",updateAdjustments:"multipleUpsellsModule/updateAdjustments",getSCPOStylesMetafields:"multipleUpsellsModule/getSCPOStylesMetafields",unloadSCPO:"multipleUpsellsModule/unloadSCPO"}),...(0,s.OI)({setSCSettings:"multipleUpsellsModule/setSCSettings",setSCScriptStatus:"multipleUpsellsModule/setSCScriptStatus",setSCEmptyState:"multipleUpsellsModule/setSCEmptyState",setSCEmptyAll:"multipleUpsellsModule/setSCEmptyAll",setAllowed:"multipleUpsellsModule/setAllowed"}),init(){this.isPreviewMode||this.setupSCPO()},async loadStyles(){if(!this.hasOptions)return;let t=null;if(this.isPreviewMode){let{data:e}=await this.getStyles();t=null==e?void 0:e.asset_url}else t=this._parseBoldStylesFromDOM();let e=null;if(t||this.isPreviewMode)if(t){let i=await this.getSCPOStylesFile(t);e=await i.text()}else e=this.isLive?e:await this.getSCPOStylesMetafields();else{let t=document.querySelector("[ocu-scpo-styles-data]");e=null==t?void 0:t.innerText}if(!e)return;let i=` .ocu-popup { ${e} } `,s=document.createElement("style");s.innerText=i,this.$el.appendChild(s),this.stylesLoaded=!0},refreshSCPO(){this.unloadSCPO(this.formId),this.$nextTick(()=>this.initState())},setupSCPO(){var t;this.setupApp({boldEl:this.$refs.boldBlock,innerProductId:this.id,index:this.productId,formId:this.formId,isLive:this.isLive,variants:null==(t=this.currentProduct)?void 0:t.variants,allowed:this.allowed})},initState(){var t;this.initSCState({boldEl:this.$refs.boldBlock,innerProductId:this.id,index:this.productId,formId:this.formId,isLive:this.isLive,variants:null==(t=this.currentProduct)?void 0:t.variants,allowed:this.allowed})},_parseBoldStylesFromDOM(){let t=document.querySelector("link[href*='bold-options.css']");return null==t?void 0:t.href},changed(){var t,e;this.optionsChanged(null==(e=this.$refs)||null==(t=e.scpoForm.dataset)?void 0:t.formId)},inputChange(){this.inputChanged(this.formId)}},watch:{allowed(t,e){this.$nextTick(()=>{this.setAllowed({allowed:t,index:this.formId}),t&&this.updateAdjustments(this.formId)}),t||(this.stylesLoaded=!1),this.stylesLoaded||this.loadStyles(),t&&!this.scScriptStatus&&this.refreshSCPO()},productId(t){if("string"==typeof t&&(t=+t.match(/\d+/)[0]),t>0)return this.stylesLoaded||this.loadStyles(),this.refreshSCPO();this.setSCEmptyState(this.index),this.stylesLoaded=!1},hasOptions(t){t&&!this.stylesLoaded&&this.loadStyles()},scAdjustmentsPrice:{handler(){let t=this.$el.querySelector(".bold_option_total > div");t&&(t.style.display=this.showSCDefaultPrice?"block":"none")}}}},_={name:"HeroSection",props:{product:Object,index:Number,isInlineTextEditorEligible:Boolean},components:{ProductTitle:a,PriceBreakdown:h,Description:f,Variants:v,ProductRating:y,SCProductOptions:(0,l.Z)(x,function(){var t=this._self._c;return t("div",[t("div",{directives:[{name:"show",rawName:"v-show",value:this.allowed,expression:"allowed"}],class:{"ocu-scpo__container":this.hasOptions,"ocu-hidden":!this.hasOptions,"ocu-scpo_container--offset-top":this.hasTopOffset},style:this.cssVars},[t("form",{directives:[{name:"show",rawName:"v-show",value:this.stylesLoaded,expression:"stylesLoaded"}],ref:"scpoForm",attrs:{"data-ocu-scpo-form":"true","data-form-id":`ocu-scpo-${this.productId}-${this.index}`},on:{change:this.changed,input:this.inputChange}},[t("input",{attrs:{type:"hidden",name:"id"},domProps:{value:this.productId}}),this._v(" "),t("div",{ref:"boldBlock",staticClass:"bold_options",attrs:{"data-product-id":this.productId}})])])])},[],!1,null,"4fe128ea",null).exports},data:()=>({isSCPOMetafieldsAvailable:!1}),computed:{...(0,s.Se)({offers:"multipleUpsellsModule/offers",isTabletView:"multipleUpsellsModule/isTabletView",isMobileView:"multipleUpsellsModule/isMobileView",isPreviewMode:"multipleUpsellsModule/isPreviewMode",isEditMode:"multipleUpsellsModule/editMode"}),offer(){return this.offers[this.index]},isLive(){return!this.editMode&&!this.isPreviewMode},isSCPOInstalled(){var t,e,i,s;if(!this.isLive)return!0;let o=document.querySelector("link[href*='bold-options.css']")||document.querySelector("[ocu-scpo-styles-data]")||this.isSCPOMetafieldsAvailable,n=!!o;return!n&&((null==(t=window)?void 0:t.BOLD)||(null==(s=window)||null==(i=s.BOLD)||null==(e=i.options)?void 0:e.app)||o)&&console.warn("You have to finish installing SC Product Options first to see options form"),n}},methods:{...(0,s.nv)({getSCPOStylesMetafields:"multipleUpsellsModule/getSCPOStylesMetafields"}),async getSCPOMetafield(){this.isLive?this.isSCPOMetafieldsAvailable=!1:this.isSCPOMetafieldsAvailable=!!await this.getSCPOStylesMetafields()}}},C=(0,l.Z)(_,function(){var t=this._self._c;return t("div",{staticClass:"ocu-upsell__main",class:{"ocu-upsell__main-tablet":this.isTabletView,"ocu-upsell__main-mobile":this.isMobileView}},[t("ProductRating",{attrs:{index:this.index,isInlineTextEditorEligible:this.isInlineTextEditorEligible}}),this._v(" "),t("ProductTitle",{attrs:{index:this.index,isInlineTextEditorEligible:this.isInlineTextEditorEligible}}),this._v(" "),t("PriceBreakdown",{attrs:{isInlineTextEditorEligible:this.isInlineTextEditorEligible,index:this.index}}),this._v(" "),t("Description",{attrs:{index:this.index,product:this.product,isInlineTextEditorEligible:this.isInlineTextEditorEligible}}),this._v(" "),t("Variants",{staticClass:"ocu-upsell__variants",attrs:{index:this.index,product:this.product}}),this._v(" "),this.isSCPOInstalled?t("SCProductOptions",{attrs:{index:this.index,product:this.product}}):this._e()],1)},[],!1,null,null,null).exports,S={name:"HeroImage",props:{index:Number},computed:{...(0,s.Se)({isMobileView:`${o.Fm}/isMobileView`,editMode:`${o.Fm}/editMode`,offerProducts:`${o.Fm}/offerProducts`,offers:`${o.Fm}/offers`,products:`${o.Fm}/products`}),product(){return this.products[this.index][`${this.offerProducts[this.index].offer_id}`]},variant(){var t;return null==(t=this.offerProducts[this.index])?void 0:t.variant},imageBorder(){return this.offers[this.index].image_border},heroType(){return this.offers[this.index].hero_section_type},isHeroTypeNone(){return"none"===this.heroType},customImage(){let t=this.offers[this.index].images.find(t=>"image"===t.kind);return(null==t?void 0:t.delete)||!t||this.isHeroTypeNone?`${o.G3}/no_image.svg`:null==t?void 0:t.src},shopifyImage(){var t;let e=this.variant&&(null==(t=this.variant)?void 0:t.featured_image);return"string"==typeof(e=e||this.product.featured_image)?e:null==e?void 0:e.src},image(){return this.isHeroTypeNone&&this.shopifyImage?this.shopifyImage:this.customImage},customImageTitle(){var t;return null==(t=this.offers[this.index].image)?void 0:t.title},shopifyImageTitle(){return this.variant&&this.variant.title},title(){return this.isHeroTypeNone?this.shopifyImageTitle:this.customImageTitle},classes(){return[{"ocu-upsell__image--bordered":this.imageBorder},this.isMobileView?"ocu-upsell__image-mobile":"ocu-upsell__image",{"ocu-upsell__image-rtl":this.isRightToLeftDirection}]},isRightToLeftDirection(){let t=document.querySelector(":root");return t.hasAttribute("dir")&&"rtl"===t.getAttribute("dir")}},methods:{onClick(){this.editMode&&this.$proxy.publish("buybox:render",this.index)}}},w=(0,l.Z)(S,function(){var t=this._self._c;return this.variant?t("div",{staticClass:"ocu-upsell__image-wrap",class:this.classes},[t("img",{staticClass:"ocu-upsell__img",attrs:{src:this.image,alt:this.title,tabindex:"0","data-testid":"multiple-image"},on:{click:this.onClick}})]):this._e()},[],!1,null,"7eac3388",null).exports,P=null,$=(t,e)=>function(){for(var i=arguments.length,s=Array(i),o=0;o{t.apply(this,s),P=null},e)},M={name:"HeroQuantity",props:{index:Number,isInlineTextEditorEligible:Boolean},components:{Wysiwyg:()=>Promise.all([i.e("572"),i.e("309"),i.e("473")]).then(i.bind(i,36621))},data:()=>({timer:{slow:null,medium:null,fast:null},interval:{slow:null,medium:null,fast:null},priority:{input:{min:1,max:99999}},events:{mouseenter:"hover",mouseleave:"background",mousedown:"pressed",mouseup:"background"},btnState:"background",innerWidth:window.innerWidth}),created(){window.addEventListener("resize",this.resizeHandler)},destroyed(){window.removeEventListener("resize",this.resizeHandler)},computed:{...(0,s.Se)({general:`${o.Fm}/general`,buttons:`${o.Fm}/buttons`,editableClasses:`${o.Fm}/editableClasses`,isMobileView:`${o.Fm}/isMobileView`,highlightable:`${o.Fm}/highlightable`,editMode:`${o.Fm}/editMode`,offers:`${o.Fm}/offers`,offerProducts:`${o.Fm}/offerProducts`,isPreviewMode:`${o.Fm}/isPreviewMode`,representation:"multipleUpsellsModule/representation"}),...(0,s.rn)({isAnyEditorOpened:t=>t.wysiwyg.isAnyEditorOpened}),buttonOrder(){return`button-order${this.index}`},buttonNotSelected(){return`button-not-selected${this.index}`},buttonColor(){return this.offers[this.index].accept_button.color},buttonStyles(){let t=this.isDisabledButton&&this.isLive?"#D9D9D9":this.buttons.buy[this.btnState];return{color:`${this.buttonColor} !important`,backgroundColor:t,cursor:this.isDisabledButton&&this.isLive?"not-allowed":"default"}},inlineButtonStyles(){return{backgroundColor:this.isDisabledButton&&this.isLive?"#D9D9D9":this.buttons.buy[this.btnState],cursor:this.isDisabledButton&&this.isLive?"not-allowed":"default"}},acceptButtonSettings(){return this.offers[this.index].accept_button},hideQuantity(){return this.offers[this.index].hide_quantity?this.offers[this.index].hide_quantity&&(this.isLive&&this.innerWidth>=768||this.editMode||this.isPreviewMode&&!this.isMobileView)?"ocu-quantity-range__hidden":"ocu-quantity-range__none":"ocu-quantity-range__block"},quantityClasses(){return[this.hideQuantity,{"ocu-quantity-range--disabled":this.isPredefinedQuantityEnabled}]},isPredefinedQuantityEnabled(){var t,e,i;return null!=(i=null==(e=this.offers[this.index])||null==(t=e.predefined_quantity)?void 0:t.enabled)&&i},isLive(){return!this.editMode&&!this.isPreviewMode},buttonTitleStyles(){return{fontSize:this.acceptButtonSettings.size,fontStyle:this.acceptButtonSettings.italic,fontFamily:this.acceptButtonSettings.font,fontWeight:this.acceptButtonSettings.weight||(this.acceptButtonSettings.emphasized?"700":"400"),textDecoration:this.acceptButtonSettings.underline,color:this.buttonColor}},bgColorPressed(){return{...this.dividerColor,backgroundColor:this.buttons.buy.pressed,color:`${this.buttonColor} !important`}},crossButtonColor(){return{fill:this.buttonColor}},dividerColor(){return{"--divider":this.buttonColor}},buttonTitle(){return this.acceptButtonSettings.text},isSelected(){return this.offerProducts[this.index].selected},predefinedQuantity(){var t;return null==(t=this.offers[this.index])?void 0:t.predefined_quantity.quantity},quantity(){return this.isPredefinedQuantityEnabled?this.predefinedQuantity:this.offerProducts[this.index].quantity},buttonFullWidth(){return(this.isMobile||this.isLive&&this.innerWidth<768)&&!this.hideQuantity},selectedProducts(){let t=!1;for(let e in this.offerProducts)this.offerProducts[e].selected&&t++;return t},isDisabledButton(){var t;return+(null==(t=this.general)?void 0:t.products_limit)===this.selectedProducts&&!this.isSelected},addButtonContent(){var t,e;let{buttonTitleStyles:i,buttonTitle:s}=this,{fontSize:o,fontStyle:n,fontFamily:r,fontWeight:l,textDecoration:a,color:d}=i,u=d.replace(/\s*!important/,""),c=` ${s} `;return(null==(t=this.acceptButtonSettings)?void 0:t.inline_content)?{...null==(e=this.acceptButtonSettings)?void 0:e.inline_content}:c},fontColor(){var t;return null!=(t=this.representation.general.font_color)?t:"#262626"},selectorsColor(){var t;return null!=(t=this.representation.general.selectors_color)?t:"#9b9b9b"},inputStyles(){return{color:this.fontColor,"border-color":this.selectorsColor}},inputButtonStyles(){return{"background-color":this.selectorsColor}},formId(){return`ocu-scpo-${this.offerProducts[this.index].productId}-${this.index}`}},methods:{...(0,s.nv)({validateOptionsOnAddToCart:"multipleUpsellsModule/validateOptionsOnAddToCart"}),...(0,s.OI)({setSelectedProduct:`${o.Fm}/setSelectedProduct`,setQuantity:`${o.Fm}/setQuantity`,setSCSelected:"multipleUpsellsModule/setSCSelected"}),resizeHandler(t){this.isLive&&(this.innerWidth=t.target.innerWidth)},checkPriority(t){let e=this.priority.input,i=e.min,s=e.max,o=+t.target.value;isNaN(o)?o=1:os&&(o=s),t.target.value=this.quantity,$(()=>{this.setQuantity({index:this.index,quantity:o})},100)()},changePriority(t,e){if("mousedown"!==t.type&&13!==t.keyCode||this.isPredefinedQuantityEnabled)return;let i=i=>{let s=this.quantity;"increment"===e?s++:"decrement"===e&&s--,t.target.value=s,this.checkPriority(i)};i(t),this.autoChangePriority(i,t)},autoChangePriority:function(t,e){this.timer.slow||(this.timer.slow=setTimeout(()=>{this.interval.slow=setInterval(()=>t(e),50)},100),this.timer.medium=setTimeout(()=>{this.interval.medium=setInterval(()=>t(e),25)},1e3),this.timer.fast=setTimeout(()=>{this.interval.fast=setInterval(()=>t(e),4)},2500))},clearTimers(){for(let t in this.interval)Object.prototype.hasOwnProperty.call(this.interval,t)&&clearInterval(this.interval[t]);for(let t in this.timer)Object.prototype.hasOwnProperty.call(this.timer,t)&&clearTimeout(this.timer[t]);this.timer.slow=null},changeBtnState(t){this.btnState=this.events[t.type]},setSelected(t){this.setSelectedProduct({index:this.index,selected:t}),this.setSCSelected({selected:t,formId:this.formId}),t&&this.validateOptionsOnAddToCart({productId:this.offerProducts[this.index].productId,formId:this.formId})},setFocusButtonOrder(){setTimeout(()=>this.$refs[`button-order${this.index}`].focus(),0)},setFocusButtonNotSelected(){setTimeout(()=>this.$refs[`button-not-selected${this.index}`].focus(),0)},async onClick(t){if(!this.editMode)return;t.stopPropagation();let e={tab:"offers",type:"accept_button",text:!0,index:this.index,id:this.offerProducts[this.index].offer_id};this.$proxy.publish("buybox:close"),await this.$nextTick(),this.$proxy.publish("change:tab","buttons"),this.$proxy.publish("decorator",e)},saveWysiwyg(t){let{key:e,content:i}=t,s={section:"offers",data:{key:"accept_button",value:{...this.acceptButtonSettings,[e]:i},index:this.index,id:this.offerProducts[this.index].offer_id}};this.$store.commit("multipleUpsells/setSection",{...s}),this.$proxy.publish("MultipleRepresentation",s)},async clickAddButton(t){this.editMode&&(this.$proxy.publish("buybox:close"),await this.$nextTick(),this.$proxy.publish("change:tab","buttons"),t.stopPropagation())}}},T=(0,l.Z)(M,function(){var t=this,e=t._self._c;return e("div",{staticClass:"ocu-upsell__quantity",class:{"ocu-upsell__quantity-mobile":t.isMobileView}},[e("div",{staticClass:"ocu-quantity-range",class:t.quantityClasses,attrs:{"data-testid":"quantity"}},[e("button",{staticClass:"ocu-quantity-range__minus",attrs:{disabled:t.isPredefinedQuantityEnabled,"data-testid":"button-minus"},on:{mousedown:function(e){return t.changePriority(e,"decrement")},keydown:function(e){return t.changePriority(e,"decrement")},mouseout:t.clearTimers,mouseup:t.clearTimers,keyup:t.clearTimers}},[e("div",{staticClass:"ocu-button-horizontal--icon",style:t.inputButtonStyles})]),t._v(" "),e("input",{staticClass:"ocu-quantity-range__input",style:t.inputStyles,attrs:{type:"text",disabled:t.isPredefinedQuantityEnabled,"data-testid":"quantity-input"},domProps:{value:t.quantity},on:{input:t.checkPriority}}),t._v(" "),e("button",{staticClass:"ocu-quantity-range__plus",attrs:{disabled:t.isPredefinedQuantityEnabled,"data-testid":"button-plus"},on:{mousedown:function(e){return t.changePriority(e,"increment")},keydown:function(e){return t.changePriority(e,"increment")},mouseout:t.clearTimers,mouseup:t.clearTimers,keyup:t.clearTimers}},[e("div",{staticClass:"ocu-button-horizontal--icon",style:t.inputButtonStyles}),t._v(" "),e("div",{staticClass:"ocu-button-vertical--icon",style:t.inputButtonStyles})])]),t._v(" "),e("button",{directives:[{name:"show",rawName:"v-show",value:!t.isSelected,expression:"!isSelected"}],ref:t.buttonNotSelected,staticClass:"ocu-order-button ocu-order-button__buy",class:{"ocu-order-button-mobile":t.isMobileView,"ocu-order-button__legacy":t.isInlineTextEditorEligible},style:t.isInlineTextEditorEligible?t.buttonStyles:t.inlineButtonStyles,attrs:{disabled:t.isDisabledButton,"data-testid":"not-selected-button"},on:{mouseenter:t.changeBtnState,mouseleave:t.changeBtnState,mousedown:t.changeBtnState,mouseup:t.changeBtnState,keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"]))return null;t.isAnyEditorOpened||t.setFocusButtonOrder},click:function(e){return t.setSelected(!0)}}},[t.isInlineTextEditorEligible?e("span",{class:t.highlightable,attrs:{"data-testid":"text-border"}},[e("span",{class:t.editableClasses,style:t.buttonTitleStyles,attrs:{"data-testid":"button-text"},on:{click:t.onClick}},[t._v("\n "+t._s(t.buttonTitle)+"\n ")])]):e("span",{on:{click:t.clickAddButton}},[e("Wysiwyg",{staticClass:"ocu-label--width",attrs:{"data-testid":"buy-span",content:t.addButtonContent,limit:25,editable:t.editMode,offerIndex:t.index,isEmptyValidation:!0,type:"pre",hasPortal:!0,toolbarWidth:"ocu-toolbar--wide ocu-toolbar--price",layoutType:"DECORATOR_3",fieldName:"buttons",position:"centered"},on:{"save:content":t.saveWysiwyg}})],1)]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isSelected,expression:"isSelected"}],staticClass:"ocu-order-button ocu-order-button__selected",class:{"ocu-order-button-mobile":t.isMobileView},style:t.bgColorPressed,attrs:{"data-testid":"selected-button"}},[e("button",{ref:t.buttonOrder,staticClass:"ocu-order-button__selected-text"},[t.isInlineTextEditorEligible?e("span",{class:t.highlightable,attrs:{"data-testid":"text-border"}},[e("span",{class:t.editableClasses,style:t.buttonTitleStyles,attrs:{"data-testid":"button-text"},on:{click:t.onClick}},[t._v("\n "+t._s(t.buttonTitle)+"\n ")])]):e("span",{on:{click:t=>t.stopPropagation()}},[e("Wysiwyg",{staticClass:"ocu-label--width",attrs:{"data-testid":"buy-span",content:t.addButtonContent,limit:25,editable:t.editMode,type:"pre",hasPortal:!0,offerIndex:t.index,isEmptyValidation:!0,toolbarWidth:"ocu-toolbar--wide ocu-toolbar--price",layoutType:"DECORATOR_3",fieldName:"buttons",position:"centered"},on:{"save:content":t.saveWysiwyg}})],1),t._v(" "),e("span",{staticClass:"ocu-order-button__selected-counter",style:t.buttonTitleStyles,attrs:{"data-testid":"quantity-selected-button"}},[t._v("("+t._s(t.quantity)+")")])]),t._v(" "),e("button",{staticClass:"ocu-order-button__selected-remove",attrs:{type:"button","aria-label":"Remove from order","data-testid":"selected-button-order"},on:{keydown:function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"]))return null;t.isAnyEditorOpened||t.setFocusButtonOrder},click:function(e){return e.stopPropagation(),t.setSelected(!1)}}},[e("svg",{style:t.crossButtonColor,attrs:{"data-testid":"selected-button-icon"}},[e("use",{attrs:{"xlink:href":"#close","xmlns:xlink":"http://www.w3.org/1999/xlink"}})])])])])},[],!1,null,"1cab1c37",null).exports,I={name:"HeroUspText",components:{Wysiwyg:()=>Promise.all([i.e("572"),i.e("309"),i.e("473")]).then(i.bind(i,36621))},props:{index:Number,product:Object,isInlineTextEditorEligible:Boolean},data:()=>({blockHeight:0}),computed:{...(0,s.Se)({offers:`${o.Fm}/offers`,offerData:`${o.Fm}/offerProducts`,editableClasses:`${o.Fm}/editableClasses`,highlightable:`${o.Fm}/highlightable`,editMode:`${o.Fm}/editMode`,isMobileView:`${o.Fm}/isMobileView`}),offer(){return this.offers[this.index]},uspText(){var t;return null==(t=this.offer)?void 0:t.usp.text.content},isUspTextEnabled(){var t;return null==(t=this.offer)?void 0:t.usp.enabled},id(){return Object.keys(this.product)[0]},offerId(){return this.offerData[this.index].offer_id},uspContent(){var t,e,i;return this.editMode&&this.isAnyEditorOpened?(null==(i=this.offer)||null==(e=i.usp)||null==(t=e.text)?void 0:t.inline_content)||this.uspText:this.uspWithOutVariables},uspWithOutVariables(){var t,e,i,s,o,n;return(null==(i=this.offer)||null==(e=i.usp)||null==(t=e.text)?void 0:t.inline_content)?this.replaceText(null==(n=this.offer)||null==(o=n.usp)||null==(s=o.text)?void 0:s.inline_content):this.uspText}},methods:{onClick(){if(!this.editMode)return;let t={tab:"offers",type:"usp",index:this.index,id:this.offerId};this.$proxy.publish("buybox:render",this.index),this.$proxy.publish("wysiwyg",t)},saveWysiwyg(t){var e,i,s,o;let{key:n,content:r}=t;this.blockHeight=(null==(e=this.$refs.usp)?void 0:e.$el.offsetHeight)||0;let l={section:"offers",data:{key:"usp",value:{...null==(i=this.offer)?void 0:i.usp,text:{...null==(o=this.offer)||null==(s=o.usp)?void 0:s.text,[n]:r}},index:this.index,id:this.offerId}};this.$store.commit("multipleUpsells/setSection",{...l}),this.$proxy.publish("data",l)},replaceText(t){return this.$utils.editorVariableFinder(t,"text",n.Z,this.$store.state.multipleUpsellsModule,this.offerId)}}},k=(0,l.Z)(I,function(){var t=this._self._c;return this.isUspTextEnabled?t("div",{staticClass:"ocu-usptext-highlight",class:[{highlightable:this.isInlineTextEditorEligible}],attrs:{"data-testid":"usp-text-wrapper"}},[t("div",{staticClass:"ocu-usptext-editable",class:this.editableClasses,attrs:{"data-testid":"usp-text-editable"}}),this._v(" "),this.isInlineTextEditorEligible?t("div",{class:["ocu-usptext-upsell",{"ocu-usptext-upsell__mobile":this.isMobileView}],attrs:{tabindex:"0","data-testid":"usp-text-upsell"}},[t("p",{directives:[{name:"dompurify-html",rawName:"v-dompurify-html",value:this.uspText,expression:"uspText"}],attrs:{"data-testid":"usp-text-content"},on:{click:this.onClick}})]):t("Wysiwyg",{ref:"usp",class:[this.editableClasses,{"ocu-usptext-upsell__mobile":this.isMobileView}],attrs:{tabindex:"0",offerIndex:this.index,content:this.uspContent,contentWithoutVariables:this.uspWithOutVariables,editable:this.editMode,isEmptyValidation:!0,hasOverflow:this.blockHeight>110,toolbarWidth:"ocu-toolbar--wide",type:"pre",hasPortal:!0,layoutType:"HEADLINE_USP",position:"centered",fieldName:"headline"},on:{"save:content":this.saveWysiwyg}})],1):this._e()},[],!1,null,"b2ee61d0",null).exports,E={name:"HeroUspImage",props:{index:Number,product:Object},computed:{...(0,s.Se)({offers:`${o.Fm}/offers`,offerData:`${o.Fm}/offerProducts`,editableClasses:`${o.Fm}/editableClasses`,highlightable:`${o.Fm}/highlightable`,editMode:`${o.Fm}/editMode`,isMobileView:`${o.Fm}/isMobileView`,offerProducts:`${o.Fm}/offerProducts`}),offer(){return this.offers[this.index]},variant(){var t;return null==(t=this.offerProducts[this.index])?void 0:t.variant},isUspImageEnabled(){var t;return null==(t=this.offer)?void 0:t.usp.image.enabled},id(){return Object.keys(this.product)[0]},imageSrc(){var t,e,i;let s=null==(t=this.offers[this.index].images)?void 0:t.find(t=>"usp"===t.kind);return!s||(null==s?void 0:s.delete)?(null==(e=this.offer)?void 0:e.usp.image.src)?null==(i=this.offer)?void 0:i.usp.image.src:`${o.G3}/usp_placeholder.svg`:s.src},imageText(){var t,e,i;let s=null==(t=this.offers[this.index].images)?void 0:t.find(t=>"usp"===t.kind);return!s||(null==s?void 0:s.delete)?(null==(e=this.offer)?void 0:e.usp.image.src)?null==(i=this.offer)?void 0:i.usp.image.title:"usp-image-title":s.title}},methods:{onClick(){this.editMode&&this.$proxy.publish("buybox:render",this.index)}}},O={name:"Offer",components:{HeroSection:C,HeroImage:w,HeroQuantity:T,HeroUspText:k,HeroUspImage:(0,l.Z)(E,function(){var t=this._self._c;return this.isUspImageEnabled?t("div",{staticClass:"ocu-upsell__usp-wrapper",attrs:{"data-testid":"usp-image-wrapper"}},[t("img",{staticClass:"ocu-upsell__usp-img",attrs:{"data-testid":"usp-image",alt:this.imageText,src:this.imageSrc},on:{click:this.onClick}})]):this._e()},[],!1,null,"506e6206",null).exports},props:{product:Object,index:Number,opacity:Boolean,isInlineTextEditorEligible:Boolean},computed:{...(0,s.Se)({isMobileView:`${o.Fm}/isMobileView`,offerReferenceIds:`${o.Fm}/offerReferenceIds`,tracking:`${o.Fm}/tracking`,editMode:`${o.Fm}/editMode`,editableClasses:`${o.Fm}/editableClasses`,generalSettings:"multipleUpsellsModule/general"}),sectionClasses(){return["offer-section__container",this.opacity?this.editableClasses:""]},offerClasses(){return[this.isMobileView?"ocu-upsell__item-mobile":"ocu-upsell__item",{opacity:this.opacity}]},offerStyles(){var t,e;let i=null!=(e=null==(t=this.generalSettings)?void 0:t.elements_color)?e:"#d7d9db";return{borderBottomColor:`${i}`}}},mounted(){this.$store.commit(`${o.Fm}/trackingOffer`,{index:this.index,id:this.offerReferenceIds[this.index],height:this.$el.offsetHeight,top:this.$el.offsetTop,isInViewport:!1,tracked:!1})},methods:{onClick(){this.editMode&&this.$proxy.publish("buybox:render",this.index)}}},F=(0,l.Z)(O,function(){var t=this._self._c;return t("section",{class:this.sectionClasses,on:{click:this.onClick}},[t("div",{staticClass:"ocu-upsell__item-wrap ocu-upsell-flex",class:this.offerClasses,style:this.offerStyles,attrs:{"data-testid":"wrapper_offer"}},[t("div",{staticClass:"ocu-upsell__item-info ocu-upsell-flex"},[t("HeroImage",{attrs:{index:this.index}}),this._v(" "),t("HeroSection",{attrs:{index:this.index,product:this.product,isInlineTextEditorEligible:this.isInlineTextEditorEligible}})],1),this._v(" "),t("div",{staticClass:"ocu-upsell-flex ocu-upsell-column ocu-upsell-align-center"},[t("HeroQuantity",{attrs:{isInlineTextEditorEligible:this.isInlineTextEditorEligible,index:this.index}}),this._v(" "),t("HeroUspText",{attrs:{index:this.index,product:this.product,isInlineTextEditorEligible:this.isInlineTextEditorEligible}}),this._v(" "),t("HeroUspImage",{attrs:{index:this.index,product:this.product}})],1)])])},[],!1,null,null,null).exports}}]);