whatmore-react-assets 1.0.1358 → 1.0.1359
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),l=o(7616),a=(o(6143),o(4444),o(7244),o(123),o(5892),o(9302)),s=o(2575),d=o(9821),c=o(8866),p=o(2279),h=o.n(p),u=o(7753),m=o(7129),x=o(1855),v=o(9854),y=o(364),f=o(4522),g=o(778),w=o(4892),j=o(5945),P=o(9219),M=o(6805),C=o(8984),b=o(7053),S=o(5416),I=o(6417);var E=function(t){var e,o,r,i,l,a,s,c,p,h,x,y;const[f,g,E,O,k]=(0,d.Z)(),Y=(0,u.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",[_,A]=(0,n.useState)(t.event),D=(0,u.MO)("whatmoreSecondaryColor");var R=(0,n.useContext)(m.V);const W=null===(e=t.isOnFocus)||void 0===e||e,F=null!==(o=t.playOnUnfocus)&&void 0!==o&&o,$=t.onClick,L=(0,u.MO)("whatmoreUITheme"),V=null!==(r=t.animateOnFocus&&(0,v.iWI)(Y))&&void 0!==r&&r,[U,G]=(0,n.useState)(!1),B=(0,u.MO)("whatmorePrimaryFont"),H=Math.round(+(null===(i=_.products[0])||void 0===i?void 0:i.price)),K=Math.round(+(null===(l=_.products[0])||void 0===l?void 0:l.compare_price)),X=K&&0!=K&&K>H?Math.round((K-H)/K*100):NaN,[q,J]=(0,n.useState)(X),[Q,tt]=(0,n.useState)(),et="55143268394"===Y;return(0,n.useEffect)((()=>{(0,v.N8M)(Y)&&(0,P.p_)(_,(0,v.Ipo)(Y),Y).then((t=>{var e,o,n;A(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),G(!0)}));(async()=>{var t;const e=await(0,b.p)(null===_||void 0===_||null===(t=_.products)||void 0===t?void 0:t[0],(0,v.Ipo)(Y),Y);tt(e),G(!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:V&&!N?W?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",style:{margin:"0 auto",cursor:"pointer",width:g},onClick:()=>{$(_)},children:[(0,I.jsx)("div",{style:{borderRadius:"round"==L?"5%":"0px",boxShadow:"round"==L?"0px 0px 5px 0px #B0B0B0":null,height:f,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:_.thumbnail_image,isPlaying:W||F||(0,C.gE)(),event:_})}),(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("color",(0,v.anz)(Y),"important"),t.style.setProperty("font-size",z),t.style.setProperty("line-height","120%"),t.style.setProperty("font-family",B,"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===(a=_.products[0])||void 0===a?void 0:a.title)}),U&&(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.anz)(Y),"important"),t.style.setProperty("font-size",T),t.style.setProperty("font-family",B,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"normal"==(0,v.rPP)(Y)?"normal":"bold"},children:(0,P.jx)(parseFloat((0,S.G)()?null===Q||void 0===Q?void 0:Q.price:null===_||void 0===_||null===(s=_.products)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.price)," ",Y,null===(p=_.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",T),t.style.setProperty("font-family",B,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through",alignItems:et?"center":void 0},children:(0,P.jx)(parseFloat((0,S.G)()?null===Q||void 0===Q?void 0:Q.compare_at_price:null===_||void 0===_||null===(h=_.products)||void 0===h||null===(x=h[0])||void 0===x?void 0:x.compare_price)," ",Y,null===(y=_.products[0])||void 0===y?void 0:y.currency)})]}),((0,v.QaY)(Y)&&!isNaN(q)&&0!=q&&U||et)&&(0,I.jsx)("div",{style:{display:(0,v.aKo)(Y)?"flex":"none",backgroundColor:et?D:"green"===(0,v.ZJm)(Y)?"#343434"===D?(0,v.ZJm)(Y):D:(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",B,"important"),t.style.setProperty("font-weight",et?"600":"normal","important"))},children:et?"BUY NOW":`${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)})})]})]})},O=o(7381);const k=(0,s.Z)({key:"whatmore-css-hv"});function Y(t){const[e,o,r]=(0,d.Z)(),i=(0,u.MO)("whatmoreShopId"),l=t.events,a=t.onClick,{whatmoreWidgetSourceDetails:s}=(0,n.useContext)(y.I),c=Math.ceil(r),p=2*c,[h,m]=(0,n.useState)(p),[w,j]=(0,n.useState)(2*c),P=0===(0,v.WGf)(i)?24:(0,v.WGf)(i),[M,C]=(0,n.useState)({touchX:0,touchY:0}),b=()=>(0,I.jsx)("div",{className:"navigation-button-next-container",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"})}),S=()=>(0,I.jsx)("div",{className:"navigation-button-prev-container",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"})}),O=t=>{if("next"===t){const t=2;j((t=>Math.min(t+Math.floor(r),l.length+c+1))),m((e=>Math.min(e+t,l.length+c+1)))}else j((t=>Math.max(t-Math.floor(r),p)));(0,f.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,l=(null===(n=t.changedTouches)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.clientY)-M.touchY;Math.sqrt(i**2+l**2)>10&&Math.abs(i)>Math.abs(l)&&O(i>0?"prev":"next")},children:[(0,v.Yxs)(i)&&(0,I.jsxs)(I.Fragment,{children:[w<=l.length+c&&(0,I.jsx)("div",{onClick:()=>O("next"),style:{position:"absolute",zIndex:1,top:"50%",right:"0",transform:"translateY(-100%)"},children:(0,I.jsx)(b,{})}),w>2*c&&(0,I.jsx)("div",{onClick:()=>O("prev"),style:{position:"absolute",left:"0",zIndex:1,top:"50%",transform:"translateY(-100%)"},children:(0,I.jsx)(S,{})})]}),(0,I.jsx)("div",{style:{display:"flex",gap:P,transform:`translateX(-${(w-p)*(o+P)}px)`,transition:"transform 0.4s ease-in-out"},children:l.map(((t,e)=>e<h?(0,I.jsx)("div",{children:(0,I.jsx)(E,{isOnFocus:e<=w-c-1&&e>=Math.max(0,w-p),playOnUnfocus:!1,animateOnFocus:!0,event:t,onClick:()=>a(t)})},`whatmore-carousel-tile-${e}`):(0,I.jsx)(x.Z,{})))})]})}function N(t){const[e,o,r,i]=(0,d.Z)(),[l,a]=(0,n.useState)(-1),s=(0,u.MO)("whatmoreShopId"),[c,p]=(0,n.useState)("next"),m=t.onClick,x=t.events,{whatmoreWidgetSourceDetails:w}=(0,n.useContext)(y.I),j=Math.min(Math.ceil(r),x.length),[P,M]=(0,n.useState)(0),C=0===(0,v.WGf)(s)?24:(0,v.WGf)(s),b=()=>(0,I.jsx)("div",{children:(0,I.jsx)("button",{onClick:Y,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"})})}),S=()=>(0,I.jsx)("div",{children:(0,I.jsx)("button",{onClick:k,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-left"})})});(0,n.useEffect)((()=>{P<=j&&M((t=>t+j))}),[j]);const O=()=>{a(-1)},k=()=>{P!==j&&(p("prev"),M((t=>Math.max(Math.ceil(t-r),j))),(0,f.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},Y=()=>{P>x.length+r||(p("next"),M((t=>Math.floor(t+r))),(0,f.y4)({userInteractionType:g.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},N=P>x.length?x.length-j+1:P-j,z=P>=x.length?x.length:N+j,T=x.slice(N,z);return(0,I.jsxs)("div",{className:"whatmore-events-carousel-landscape",style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:`${i}px`,paddingRight:`${i}px`},children:[("83584942374"===s||"56783601836"===s?x.length>j&&P>j:x.length>=r-1&&x.length>4)&&(0,I.jsx)("div",{style:{position:"absolute",left:i+"px",zIndex:1,top:"50%",transform:"translateY(-65%)"},children:P!==j&&(0,I.jsx)(S,{})}),(0,I.jsx)("div",{className:"wht-hide-scrollbar",style:{display:"flex",gap:C+"px",width:o*r*(0,v.Su5)(s)+"px",justifyContent:"83584942374"===s||"56783601836"===s||x.length<=r-1||x.length<5?"center":"flex-start",overflow:"auto"},children:T.map(((t,e)=>{const o=`whatmore-event-tile-landscape-${t.index}${e===j-1?"-last":""}`,n=e===l;return(0,I.jsx)("div",{className:"whatmore-event-tile-horizontal-swipe-animation-"+("next"===c?"next":"prev"),onMouseEnter:()=>(t=>{const e=h()((()=>a(t)),300);return e(),e.cancel})(e),onMouseLeave:O,children:(0,I.jsx)(E,{isOnFocus:n,playOnUnfocus:!0,animateOnFocus:!0,event:t,onClick:()=>(t=>{m(t)})(t)})},o)}))}),("83584942374"===s||"56783601836"===s?x.length>j&&P>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:P<=x.length&&(0,I.jsx)(b,{})})]})}var z=function(t){const[e,o,s]=(0,c.Z)(),[d]=(0,u.j1)("whatmoreShopId"),[p]=(0,u.j1)("whatmorePrimaryColor"),[h]=(0,u.j1)("whatmoreSecondaryColor"),[x]=(0,u.j1)("whatmoreTitleFont"),f="portrait"==e?(0,u.MO)("whatmoreTitleFontSizePortrait"):(0,u.MO)("whatmoreTitleFontSize"),{whatmoreRootId:g}=(0,n.useContext)(y.I),w=((0,u.MO)("isInDesignMode"),(0,u.MO)("whatmoreCollectionHeading")),{whatmoreIsCollectionsTemplate:j}=(0,n.useContext)(y.I),P=t.events,M=t.onClick,C=x;function b(t){M(t)}return(0,n.useEffect)((()=>{(0,O.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 l.ZP.styles.global,(0,I.jsx)(a.C,{value:k,children:(0,I.jsx)("div",{className:"whatmore-carousel-events",children:(0,I.jsx)(r.x,{theme:l.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"==d?"flex-start":"center"},children:(0,I.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",C,"important"),t.style.setProperty("font-size",f+"px","important"))},style:{color:p,backgroundClip:"text",textAlign:"center",fontWeight:(0,v.wOV)(d),lineHeight:(0,v.vY4)(d),letterSpacing:(0,v.X2K)(d)},children:j?"W"!==w?w:"":t.heading})}):(0,I.jsx)(I.Fragment,{}),"landscape"===e?(0,I.jsx)(N,{events:P,onClick:b}):(0,I.jsx)(Y,{events:P,onClick:b})]})})})})}},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),l=o(7753),a=o(6417);e.Z=function(t){var[e,o]=(0,r.Z)();(0,n.useContext)(i.V);const s=(0,l.MO)("whatmoreShopId");return t.event,(0,a.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 a},$w:function(){return d},AK:function(){return i},AL:function(){return l},YP:function(){return r},me:function(){return n},rE:function(){return s}});const n="device_type",r="device_mode",i="mobile",l="tablet",a="desktop",s="portrait",d="landscape"},9821:function(t,e,o){var n=o(7753),r=o(8866),i=o(6805),l=o(9854);e.Z=function(t){const[e,o,a]=(0,r.Z)(),[s]=(0,n.j1)("whatmoreLandscapePadding"),[d]=(0,n.j1)("whatmoreShopId"),[c]=(0,n.j1)("whatmoreVideoTileSize"),[p]=(0,n.j1)("whatmoreVideoTileSizePortrait"),h=a>=1025,u="portrait"==e?p:c,m=!("portrait"!=e||!(a>=481)),x=u/100*1.3*.5,v=u/100;var y=Math.min(a,o),[f,g,w,j]=[.6*y*(16/9),.6*y,1.4,0];function P(t){return Math.round(10*t)/10}var M={DEVICE_TYPE:i.AK,DEVICE_MODE:i.rE};if(h){const t=g*x,e=f*x;[f,g,w,j]=[e,t,(a-2*s-2*(0,l.mZU)(d))/(1.1*t),s],M[i.me]=i.$I,M[i.YP]=i.$w}else if(m){var C=.8*g,b=.8*f;"portrait"==e?(C*=v,b*=v,[f,g,w,j]=[b,C,P(a/(1.2*C)),0],M[i.me]=i.AL,M[i.YP]=i.rE):([f,g,w,j]=[b,C,(a-2*s)/(1.1*C),s],M[i.me]=i.AL,M[i.YP]=i.$w)}else{C=g,b=f;"portrait"==e?(C=C*v*.9,b=b*v*.9,[f,g,w,j]=[b,C,P(a/(1.15*C)),0],M[i.me]=i.AK,M[i.YP]=i.rE):(C=.7*g,b=.7*f,[f,g,w,j]=[b,C,(a-2*s)/(1.1*C),s],M[i.me]=i.AK,M[i.YP]=i.$w)}return[f,g,w,j,M]}},3439:function(){},7244:function(){},5892:function(){},4444:function(){}}]);
|