whatmore-react-assets 1.0.1240 → 1.0.1242

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[116],{9085:function(t,e,o){o.r(e),o.d(e,{default:function(){return Z}});var n=o(7313),r=(o(3439),o(6090)),i=o(32),a=o(7616),l=(o(6143),o(4444),o(7244),o(123),o(5892),o(9302)),s=o(2575),c=o(9821),d=o(8866),p=o(2279),u=o.n(p),h=o(7753),m=o(7129),x=o(1855),v=o(9854),f=o(364),y=o(4522),g=o(778),w=o(4892),j=o(5945),P=o(9219),M=o(6805),C=o(8984),S=o(7053),b=o(5416),I=o(6417);var O=function(t){var e,o,r,i,a,l,s,d,p,u,x,f;const[y,g,O,E,k]=(0,c.Z)(),Y=(0,h.MO)("whatmoreShopId"),N="portrait"===k[M.YP],Z=(N?1.076*g*(0,v.pEd)(Y):g*(0,v.H4g)(Y))+"px",T=(N?1.076*g*(0,v.pEd)(Y):g*(0,v.H4g)(Y))+"px",z=(N?.965*g*(0,v.pEd)(Y):.859*g*(0,v.H4g)(Y))+"px",[F,_]=(0,n.useState)(t.event),W=(0,h.MO)("whatmoreSecondaryColor");var R=(0,n.useContext)(m.V);const A=null===(e=t.isOnFocus)||void 0===e||e,D=null!==(o=t.playOnUnfocus)&&void 0!==o&&o,B=t.onClick,L=(0,h.MO)("whatmoreUITheme"),U=null!==(r=t.animateOnFocus&&(0,v.iWI)(Y))&&void 0!==r&&r,[V,X]=(0,n.useState)(!1),G=(0,h.MO)("whatmorePrimaryFont"),H=Math.round(+(null===(i=F.products[0])||void 0===i?void 0:i.price)),K=Math.round(+(null===(a=F.products[0])||void 0===a?void 0:a.compare_price)),$=K&&0!=K&&K>H?Math.round((K-H)/K*100):NaN,[q,J]=(0,n.useState)($),[Q,tt]=(0,n.useState)(),et="55143268394"===Y;return(0,n.useEffect)((()=>{(0,v.N8M)(Y)&&(0,P.p_)(F,(0,v.Ipo)(Y),Y).then((t=>{var e,o,n;_(t),(null===t||void 0===t||null===(e=t.products)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.discount)&&J(null===t||void 0===t||null===(n=t.products[0])||void 0===n?void 0:n.discount),X(!0)}));(async()=>{var t;const e=await(0,S.p)(null===F||void 0===F||null===(t=F.products)||void 0===t?void 0:t[0],(0,v.Ipo)(Y),Y);tt(e),X(!0)})()}),[]),(0,I.jsxs)("div",{ref:t=>{t&&(t.style.setProperty("margin-top",R.tileTopMargin+"px"),t.style.setProperty("margin-bottom",R.tileBottomMMargin+"px"))},className:U&&!N?A?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",style:{margin:"0 auto",cursor:"pointer",width:g},onClick:()=>{B(F)},children:[(0,I.jsx)("div",{style:{borderRadius:"round"==L?"5%":"0px",boxShadow:"round"==L?"0px 0px 5px 0px #B0B0B0":null,height:y,borderWidth:(0,v.alU)(Y),borderColor:(0,v.qPe)(Y),overflow:"hidden"},children:(0,I.jsx)(w.Z,{height:(0,v.dXm)(Y)+" !important",width:"100%",url:F.thumbnail_image,isPlaying:A||D||(0,C.gE)(),event:F})}),(0,I.jsxs)("div",{className:"wht-prod-info",style:{display:(0,v.pvY)(Y)?"flex":"none",flexDirection:"column",padding:"12px 4px",gap:et?"8px":"5px",alignItems:et?"center":"flex-start"},children:[(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-size","62636458233"==Y?"14px":Z,"important"),t.style.setProperty("line-height","120%"),t.style.setProperty("font-family",G,"important"),t.style.setProperty("-webkit-line-clamp",1,"important"),t.style.setProperty("line-clamp",1,"important"),t.style.setProperty("-webkit-box-orient","vertical","important"),t.style.setProperty("display","-webkit-box","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("text-overflow","ellipsis","important"))},children:(0,j.s)(null===(l=F.products[0])||void 0===l?void 0:l.title)}),V&&(0,v.QaY)(Y)&&(0,I.jsxs)("div",{style:{display:"flex",gap:"12px",flexDirection:(0,v.$zZ)(Y)?"row":"row-reverse",justifyContent:et?"center":(0,v.$zZ)(Y)?"flex-start":"flex-end"},children:[(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,v.Uyp)(Y),"important"),t.style.setProperty("font-size","62636458233"==Y?"14px":T,"important"),t.style.setProperty("font-family",G,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"normal"==(0,v.rPP)(Y)?"normal":"bold"},children:(0,P.jx)(parseFloat((0,b.G)()?null===Q||void 0===Q?void 0:Q.price:null===F||void 0===F||null===(s=F.products)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.price)," ",Y,null===(p=F.products[0])||void 0===p?void 0:p.currency)}),!isNaN(K)&&K>H&&(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,v.kPs)(Y),"important"),t.style.setProperty("font-size","62636458233"==Y?"14px":T,"important"),t.style.setProperty("font-family",G,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through",alignItems:et?"center":void 0},children:(0,P.jx)(parseFloat((0,b.G)()?null===Q||void 0===Q?void 0:Q.compare_at_price:null===F||void 0===F||null===(u=F.products)||void 0===u||null===(x=u[0])||void 0===x?void 0:x.compare_price)," ",Y,null===(f=F.products[0])||void 0===f?void 0:f.currency)})]}),((0,v.QaY)(Y)&&!isNaN(q)&&0!=q&&V||et)&&(0,I.jsx)("div",{style:{display:(0,v.aKo)(Y)?"flex":"none",backgroundColor:et?W:"green"===(0,v.ZJm)(Y)?"#343434"===W?(0,v.ZJm)(Y):W:(0,v.ZJm)(Y),alignItems:"center",justifyContent:et?"center":void 0,borderRadius:et?"25px":(0,v.CF_)(Y)+"px",width:et?.5*g:"fit-content",padding:(0,v.Spx)(Y)?et?"12px 12px":"3px 6px":"0px",margin:et?"0 auto":void 0,textAlign:et?"center":void 0,height:et?"7%":void 0},children:(0,v.Spx)(Y)?(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,v.mso)(Y),"important"),t.style.setProperty("font-size",z,"important"),t.style.setProperty("font-family",G,"important"),t.style.setProperty("font-weight",et?"600":"normal","important"))},children:et?"BUY NOW":"".concat(q,"% Off")}):(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,v.aUT)(Y),"important"),t.style.setProperty("font-size",z,"important"),t.style.setProperty("font-family",(0,v.V3Y)(Y),"important"))},children:(0,v.sG7)(Y)})})]})]})},E=o(7381);const k=(0,s.Z)({key:"whatmore-css-hv"});function Y(t){const[e,o,r]=(0,c.Z)(),i=(0,h.MO)("whatmoreShopId"),a=t.events,l=t.onClick,{whatmoreWidgetSourceDetails:s}=(0,n.useContext)(f.I),d=Math.ceil(r),p=2*d,[u,m]=(0,n.useState)(p),[w,j]=(0,n.useState)(2*d),P=0===(0,v.WGf)(i)?24:(0,v.WGf)(i),[M,C]=(0,n.useState)({touchX:0,touchY:0}),S=()=>(0,I.jsx)("div",{style:{width:"50px",borderRadius:"50%",height:"50px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right-portrait"})}),b=()=>(0,I.jsx)("div",{style:{width:"50px",borderRadius:"50%",height:"50px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-left-portrait"})}),E=t=>{if("next"===t){const t=2;j((t=>Math.min(t+Math.floor(r),a.length+d+1))),m((e=>Math.min(e+t,a.length+d+1)))}else j((t=>Math.max(t-Math.floor(r),p)));(0,y.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:s})};return(0,I.jsxs)("div",{className:"whatmore-events-carousel-portrait",style:{display:"flex",justifyContent:"flex-start",paddingLeft:"12px",overflow:"hidden",position:"relative"},onTouchStart:t=>{C({touchX:t.touches[0].clientX,touchY:t.touches[0].clientY})},onTouchEnd:t=>{var e,o,n,r;const i=(null===(e=t.changedTouches)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.clientX)-M.touchX,a=(null===(n=t.changedTouches)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.clientY)-M.touchY;Math.sqrt(i**2+a**2)>10&&Math.abs(i)>Math.abs(a)&&E(i>0?"prev":"next")},children:[(0,v.Yxs)(i)&&(0,I.jsxs)(I.Fragment,{children:[w<=a.length+d&&(0,I.jsx)("div",{onClick:()=>E("next"),style:{position:"absolute",zIndex:1,top:"50%",right:"0",transform:"translateY(-100%)"},children:(0,I.jsx)(S,{})}),w>2*d&&(0,I.jsx)("div",{onClick:()=>E("prev"),style:{position:"absolute",left:"0",zIndex:1,top:"50%",transform:"translateY(-100%)"},children:(0,I.jsx)(b,{})})]}),(0,I.jsx)("div",{style:{display:"flex",gap:P,transform:"translateX(-".concat((w-p)*(o+P),"px)"),transition:"transform 0.4s ease-in-out"},children:a.map(((t,e)=>e<u?(0,I.jsx)("div",{children:(0,I.jsx)(O,{isOnFocus:e<=w-d-1&&e>=Math.max(0,w-p),playOnUnfocus:!1,animateOnFocus:!0,event:t,onClick:()=>l(t)})},"whatmore-carousel-tile-".concat(e)):(0,I.jsx)(x.Z,{})))})]})}function N(t){const[e,o,r,i]=(0,c.Z)(),[a,l]=(0,n.useState)(-1),s=(0,h.MO)("whatmoreShopId"),[d,p]=(0,n.useState)("next"),m=t.onClick,x=t.events,{whatmoreWidgetSourceDetails:w}=(0,n.useContext)(f.I),j=Math.min(Math.ceil(r),x.length),P=0===(0,v.WGf)(s)?24:(0,v.WGf)(s),M=t=>{const e=u()((()=>l(t)),300);return e(),e.cancel},C=()=>{l(-1)},S=t=>{m(t)};if("83584942374"===s)return(0,I.jsx)("div",{className:"whatmore-events-carousel-landscape",style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"".concat(i,"px"),paddingRight:"".concat(i,"px")},children:(0,I.jsx)("div",{style:{display:"flex",gap:"".concat(P,"px"),overflowX:"auto",scrollBehavior:"smooth",whiteSpace:"nowrap",paddingBottom:"10px",width:"100%"},children:x.map(((t,e)=>{const n="whatmore-event-tile-landscape-".concat(t.index).concat(e===j-1?"-last":""),r=e===a;return(0,I.jsx)("div",{className:"whatmore-event-tile",onMouseEnter:()=>M(e),onMouseLeave:C,style:{minWidth:"".concat(o,"px")},children:(0,I.jsx)(O,{isOnFocus:r,playOnUnfocus:!0,animateOnFocus:!0,event:t,onClick:()=>S(t)})},n)}))})});{const[t,e]=(0,n.useState)(0),l=()=>(0,I.jsx)("div",{children:(0,I.jsx)("button",{onClick:c,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,I.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right"})})});(0,n.useEffect)((()=>{t<=j&&e((t=>t+j))}),[j]);const c=()=>{t>x.length+r||(p("next"),e((t=>Math.floor(t+r))),(0,y.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},u=t>x.length?x.length-j+1:t-j,h=t>=x.length?x.length:u+j,m=x.slice(u,h);return(0,I.jsxs)("div",{className:"whatmore-events-carousel-landscape",style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"".concat(i,"px"),paddingRight:"".concat(i,"px")},children:[(0,I.jsx)("div",{style:{position:"absolute",left:"".concat(i,"px"),zIndex:1,top:"50%",transform:"translateY(-65%)"}}),(0,I.jsx)("div",{style:{display:"flex",gap:"".concat(P,"px"),overflowX:"auto",scrollBehavior:"smooth",whiteSpace:"nowrap",paddingBottom:"10px",width:"".concat(o*j,"px"),justifyContent:"center"},children:m.map(((t,e)=>{const o="whatmore-event-tile-landscape-".concat(t.index).concat(e===j-1?"-last":""),n=e===a;return(0,I.jsx)("div",{className:"whatmore-event-tile-horizontal-swipe-animation-".concat("next"===d?"next":"prev"),onMouseEnter:()=>M(e),onMouseLeave:C,children:(0,I.jsx)(O,{isOnFocus:n,playOnUnfocus:!0,animateOnFocus:!0,event:t,onClick:()=>S(t)})},o)}))}),("56783601836"===s?x.length>j&&t>j:x.length>=r-1&&x.length>4)&&(0,I.jsx)("div",{style:{position:"absolute",zIndex:1,top:"50%",right:i+"px",transform:"translateY(-65%)"},children:t<=x.length&&(0,I.jsx)(l,{})})]})}}var Z=function(t){const[e,o,s]=(0,d.Z)(),[c]=(0,h.j1)("whatmoreShopId"),[p]=(0,h.j1)("whatmorePrimaryColor"),[u]=(0,h.j1)("whatmoreSecondaryColor"),[x]=(0,h.j1)("whatmoreTitleFont"),y="portrait"==e?(0,h.MO)("whatmoreTitleFontSizePortrait"):(0,h.MO)("whatmoreTitleFontSize"),{whatmoreRootId:g}=(0,n.useContext)(f.I),w=((0,h.MO)("isInDesignMode"),(0,h.MO)("whatmoreCollectionHeading")),{whatmoreIsCollectionsTemplate:j}=(0,n.useContext)(f.I),P=t.events,M=t.onClick,C=x;function S(t){M(t)}return(0,n.useEffect)((()=>{(0,E.Oo)("Video shopping powered by Whatmore!")}),[]),(0,n.useEffect)((()=>{i.IR.forEach((t=>{var e;const o=null!==(e=t.querySelector('.whatmore-template-type[data-wh="template-f"]'))&&void 0!==e?e:t.querySelector('.whatmore-template-type[data="template-f"]');if(!o)return;o&&t&&(t.style.minHeight="0px")}))}),[]),delete a.ZP.styles.global,(0,I.jsx)(l.C,{value:k,children:(0,I.jsx)("div",{className:"whatmore-carousel-events",children:(0,I.jsx)(r.x,{theme:a.ZP,cssVarsRoot:g,resetCSS:!1,children:(0,I.jsxs)(m.V.Provider,{value:{tileTopMargin:25,tileBottomMMargin:25,tileLeftMargin:4,tileRightMargin:4,showPlayButton:!0},children:[t.heading.trim().length>0||j?(0,I.jsx)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"62636458233"==c?"flex-start":"center"},children:(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",C,"important"),t.style.setProperty("font-size",y+"px","important"))},style:{color:p,backgroundClip:"text",textAlign:"center",fontWeight:(0,v.wOV)(c),lineHeight:(0,v.vY4)(c),letterSpacing:(0,v.X2K)(c)},children:j?"W"!==w?w:"":t.heading})}):(0,I.jsx)(I.Fragment,{}),"landscape"===e?(0,I.jsx)(N,{events:P,onClick:S}):(0,I.jsx)(Y,{events:P,onClick:S})]})})})})}},7129:function(t,e,o){o.d(e,{V:function(){return n}});const n=(0,o(7313).createContext)({tileTopMargin:10,tileBottomMMargin:10,tileLeftMargin:10,tileRightMargin:10,showPlayButton:!0})},1855:function(t,e,o){var n=o(7313),r=o(9821),i=o(7129),a=o(7753),l=o(6417);e.Z=function(t){var[e,o]=(0,r.Z)();(0,n.useContext)(i.V);const s=(0,a.MO)("whatmoreShopId");return t.event,(0,l.jsx)("div",{style:{margin:"0 auto",width:"8968077397"==s?void 0:o,aspectRatio:"8968077397"==s?9/16:void 0,height:"8968077397"==s?"100%":e,overflow:"hidden"}})}},6805:function(t,e,o){o.d(e,{$I:function(){return l},$w:function(){return c},AK:function(){return i},AL:function(){return a},YP:function(){return r},me:function(){return n},rE:function(){return s}});const n="device_type",r="device_mode",i="mobile",a="tablet",l="desktop",s="portrait",c="landscape"},9821:function(t,e,o){var n=o(7753),r=o(8866),i=o(6805),a=o(9854);e.Z=function(t){const[e,o,l]=(0,r.Z)(),[s]=(0,n.j1)("whatmoreLandscapePadding"),[c]=(0,n.j1)("whatmoreShopId"),[d]=(0,n.j1)("whatmoreVideoTileSize"),[p]=(0,n.j1)("whatmoreVideoTileSizePortrait"),u=l>=1025,h="portrait"==e?p:d,m=!("portrait"!=e||!(l>=481)),x=h/100*1.3*.5,v=h/100;var f=Math.min(l,o),[y,g,w,j]=[.6*f*(16/9),.6*f,1.4,0];function P(t){return Math.round(10*t)/10}var M={DEVICE_TYPE:i.AK,DEVICE_MODE:i.rE};if(u){const t=g*x,e=y*x;[y,g,w,j]=[e,t,(l-2*s-2*(0,a.mZU)(c))/(1.1*t),s],M[i.me]=i.$I,M[i.YP]=i.$w}else if(m){var C=.8*g,S=.8*y;"portrait"==e?(C*=v,S*=v,[y,g,w,j]=[S,C,P(l/(1.2*C)),0],M[i.me]=i.AL,M[i.YP]=i.rE):([y,g,w,j]=[S,C,(l-2*s)/(1.1*C),s],M[i.me]=i.AL,M[i.YP]=i.$w)}else{C=g,S=y;"portrait"==e?(C=C*v*.9,S=S*v*.9,[y,g,w,j]=[S,C,P(l/(1.15*C)),0],M[i.me]=i.AK,M[i.YP]=i.rE):(C=.7*g,S=.7*y,[y,g,w,j]=[S,C,(l-2*s)/(1.1*C),s],M[i.me]=i.AK,M[i.YP]=i.$w)}return[y,g,w,j,M]}},3439:function(){},7244:function(){},5892:function(){},4444:function(){}}]);