whatmore-react-assets 1.0.635 → 1.0.637

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[554],{9085:function(t,e,o){o.r(e),o.d(e,{default:function(){return E}});var n=o(7313),r=(o(3439),o(6090)),i=o(9039),l=o(7616),s=(o(6143),o(7850),o(4444),o(7244),o(123),o(5892),o(1811),o(9302)),a=o(2575),c=o(9821),d=o(8866),p=o(2279),h=o.n(p),u=o(7753),x=o(7129),y=o(1855),m=o(9854),f=o(7376),v=o(778),g=o(4892),w=o(5945),j=o(9219),M=o(6805),P=o(8984),C=o(6417);var S=function(t){var e,o,r,l,s,a,d,p,h,y;const[f,v,S,b,k]=(0,c.Z)(),O=(0,u.MO)("whatmoreShopId"),I="portrait"===k[M.YP],E=(I?1.076*v*(0,m.pEd)(O):v*(0,m.H4g)(O))+"px",N=(I?1.076*v*(0,m.pEd)(O):v*(0,m.H4g)(O))+"px",z=(I?.965*v*(0,m.pEd)(O):.859*v*(0,m.H4g)(O))+"px",[Z,R]=(0,n.useState)(t.event),T=(0,u.MO)("whatmoreSecondaryColor");var W=(0,n.useContext)(x.V);const F=null===(e=t.isOnFocus)||void 0===e||e,Y=null!==(o=t.playOnUnfocus)&&void 0!==o&&o,D=t.onClick,{whatmoreUITheme:_}=(0,n.useContext)(i.I),U=null!==(r=t.animateOnFocus&&(0,m.iWI)(O))&&void 0!==r&&r,[A,H]=(0,n.useState)(!(0,m.N8M)(O)),L=(0,u.MO)("whatmorePrimaryFont"),V=Math.round(+(null===(l=Z.products[0])||void 0===l?void 0:l.price)),X=Math.round(+(null===(s=Z.products[0])||void 0===s?void 0:s.compare_price)),B=X&&0!=X&&X>V?Math.ceil((X-V)/X*100):NaN,[G,K]=(0,n.useState)(B);return(0,n.useEffect)((()=>{(0,m.N8M)(O)&&(0,j.p_)(Z,(0,m.Ipo)(O),O).then((t=>{var e,o,n;R(t),(null===t||void 0===t||null===(e=t.products)||void 0===e||null===(o=e[0])||void 0===o?void 0:o.discount)&&K(null===t||void 0===t||null===(n=t.products[0])||void 0===n?void 0:n.discount),H(!0)}))}),[]),(0,C.jsxs)("div",{ref:t=>{t&&(t.style.setProperty("margin-top",W.tileTopMargin+"px","important"),t.style.setProperty("margin-bottom",W.tileBottomMMargin+"px","important"))},className:U&&!I?F?"whatmore-event-tile-scale-out-animation":"whatmore-event-tile-scale-in-animation":"none",style:{margin:"0 auto",cursor:"pointer",width:v},onClick:()=>{D(Z)},children:[(0,C.jsx)("div",{style:{borderRadius:"round"==_?"5%":"0px",boxShadow:"round"==_?"0px 0px 5px 0px #B0B0B0":null,height:f,borderWidth:(0,m.alU)(O),borderColor:(0,m.qPe)(O),overflow:"hidden"},children:(0,C.jsx)(g.Z,{height:"100%",width:"100%",url:Z.thumbnail_image,isPlaying:F||Y||(0,P.gE)(),event:Z})}),(0,C.jsxs)("div",{style:{display:"flex",flexDirection:"column",padding:"12px 4px",gap:"5px"},children:[(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-size",E,"important"),t.style.setProperty("line-height","120%","important"),t.style.setProperty("font-family",L,"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,w.s)(null===(a=Z.products[0])||void 0===a?void 0:a.title)}),A&&(0,C.jsxs)("div",{style:{display:"flex",gap:"12px",flexDirection:(0,m.$zZ)(O)?"row":"row-reverse",justifyContent:(0,m.$zZ)(O)?"flex-start":"flex-end"},children:[(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,m.Uyp)(O),"important"),t.style.setProperty("font-size",N,"important"),t.style.setProperty("font-family",L,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textAlign:"left",fontWeight:"9238315068"==O?"normal":"bold"},children:(0,j.jx)(parseFloat(null===(d=Z.products[0])||void 0===d?void 0:d.price)," ",O,null===(p=Z.products[0])||void 0===p?void 0:p.currency)}),!isNaN(X)&&X>V&&(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,m.kPs)(O),"important"),t.style.setProperty("font-size",N,"important"),t.style.setProperty("font-family",L,"important"),t.style.setProperty("overflow","hidden","important"))},style:{textDecoration:"line-through"},children:(0,j.jx)(parseFloat(null===(h=Z.products[0])||void 0===h?void 0:h.compare_price)," ",O,null===(y=Z.products[0])||void 0===y?void 0:y.currency)})]}),!isNaN(G)&&0!=G&&A&&(0,C.jsx)("div",{style:{display:"flex",backgroundColor:"green"==(0,m.ZJm)(O)?"#343434"==T?(0,m.ZJm)(O):T:(0,m.ZJm)(O),alignItems:"center",borderRadius:"84084818211"==O?"4rem":"4px",width:"fit-content",padding:(0,m.Spx)(O)?"3px 6px":"0px"},children:(0,m.Spx)(O)?(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,m.mso)(O),"important"),t.style.setProperty("font-size",z,"important"),t.style.setProperty("font-family",L,"important"))},children:"".concat(G,"% Off")}):(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("color",(0,m.aUT)(O),"important"),t.style.setProperty("font-size",z,"important"),t.style.setProperty("font-family",(0,m.V3Y)(O),"important"))},children:(0,m.sG7)(O)})})]})]})},b=o(7381);const k=(0,a.Z)({key:"whatmore-css-hv"});function O(t){const[e,o,r]=(0,c.Z)(),l=(0,u.MO)("whatmoreShopId"),s=t.events,a=t.onClick,{whatmoreWidgetSourceDetails:d}=(0,n.useContext)(i.I),p=Math.ceil(r),h=2*p,[x,g]=(0,n.useState)(h),[w,j]=(0,n.useState)(2*p),M=0===(0,m.WGf)(l)?24:(0,m.WGf)(l),[P,b]=(0,n.useState)({touchX:0,touchY:0}),k=()=>(0,C.jsx)("div",{style:{width:"50px",borderRadius:"50%",height:"50px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,C.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right-portrait"})}),O=()=>(0,C.jsx)("div",{style:{width:"50px",borderRadius:"50%",height:"50px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,C.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-left-portrait"})}),I=t=>{if("next"===t){const t=2;j((t=>Math.min(t+Math.floor(r),s.length+p+1))),g((e=>Math.min(e+t,s.length+p+1)))}else j((t=>Math.max(t-Math.floor(r),h)));(0,f.y4)({userInteractionType:v.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:d})};return(0,C.jsxs)("div",{className:"whatmore-events-carousel-portrait",style:{display:"flex",justifyContent:"flex-start",paddingLeft:"12px",overflow:"hidden",position:"relative"},onTouchStart:t=>{b({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)-P.touchX,l=(null===(n=t.changedTouches)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.clientY)-P.touchY;Math.sqrt(i**2+l**2)>10&&Math.abs(i)>Math.abs(l)&&I(i>0?"prev":"next")},children:[(0,m.Yxs)(l)&&(0,C.jsxs)(C.Fragment,{children:[w<=s.length+p&&(0,C.jsx)("div",{onClick:()=>I("next"),style:{position:"absolute",zIndex:1,top:"50%",right:"0",transform:"translateY(-100%)"},children:(0,C.jsx)(k,{})}),w>2*p&&(0,C.jsx)("div",{onClick:()=>I("prev"),style:{position:"absolute",left:"0",zIndex:1,top:"50%",transform:"translateY(-100%)"},children:(0,C.jsx)(O,{})})]}),(0,C.jsx)("div",{style:{display:"flex",gap:M,transform:"translateX(-".concat((w-h)*(o+M),"px)"),transition:"transform 0.4s ease-in-out"},children:s.map(((t,e)=>e<x?(0,C.jsx)("div",{children:(0,C.jsx)(S,{isOnFocus:e<=w-p-1&&e>=Math.max(0,w-h),playOnUnfocus:!1,animateOnFocus:!0,event:t,onClick:()=>a(t)})},"whatmore-carousel-tile-".concat(e)):(0,C.jsx)(y.Z,{})))})]})}function I(t){const[e,o,r,l]=(0,c.Z)(),[s,a]=(0,n.useState)(-1),d=(0,u.MO)("whatmoreShopId"),[p,x]=(0,n.useState)("next"),y=t.onClick,g=t.events,{whatmoreWidgetSourceDetails:w}=(0,n.useContext)(i.I),j=Math.min(Math.ceil(r),g.length),[M,P]=(0,n.useState)(0),b=0===(0,m.WGf)(d)?24:(0,m.WGf)(d),k=()=>(0,C.jsx)("div",{children:(0,C.jsx)("button",{onClick:N,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,C.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-right"})})}),O=()=>(0,C.jsx)("div",{children:(0,C.jsx)("button",{onClick:E,style:{width:"50px",borderRadius:"6px",height:"100px",backgroundColor:"rgba(0, 0, 0, 0.3)"},children:(0,C.jsx)("div",{style:{display:"flex"},className:"whatmore-arrow-left"})})});(0,n.useEffect)((()=>{M<=j&&P((t=>t+j))}),[j]);const I=()=>{a(-1)},E=()=>{M!==j&&(x("prev"),P((t=>Math.max(Math.ceil(t-r),j))),(0,f.y4)({userInteractionType:v.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},N=()=>{M>g.length+r||(x("next"),P((t=>Math.floor(t+r))),(0,f.y4)({userInteractionType:v.K.HOMEPAGE_CAROUSEL_SWIPED,widgetSourceDetails:w}))},z=M>g.length?g.length-j+1:M-j,Z=M>=g.length?g.length:z+j,R=g.slice(z,Z);return(0,C.jsxs)("div",{className:"whatmore-events-carousel-landscape",style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",paddingLeft:"".concat(l,"px"),paddingRight:"".concat(l,"px")},children:[g.length>=r-1&&(0,C.jsx)("div",{style:{position:"absolute",left:"0",zIndex:1,top:"50%",transform:"translateX(50%) translateY(-65%)"},children:M!==j&&(0,C.jsx)(O,{})}),(0,C.jsx)("div",{style:{display:"flex",gap:b+"px",width:"".concat(o*r*(0,m.Su5)(d),"px"),paddingLeft:"8px",justifyContent:g.length<=r-1?"center":"flex-start",overflow:"hidden"},children:R.map(((t,e)=>{const o="whatmore-event-tile-landscape-".concat(t.index).concat(e===j-1?"-last":""),n=e===s;return(0,C.jsx)("div",{className:"whatmore-event-tile-horizontal-swipe-animation-".concat("next"===p?"next":"prev"),onMouseEnter:()=>(t=>{const e=h()((()=>a(t)),300);return e(),e.cancel})(e),onMouseLeave:I,children:(0,C.jsx)(S,{isOnFocus:n,playOnUnfocus:!0,animateOnFocus:!0,event:t,onClick:()=>(t=>{y(t)})(t)})},o)}))}),g.length>=r-1&&(0,C.jsx)("div",{style:{position:"absolute",zIndex:1,top:"50%",right:l+"px",transform:"translateY(-65%)"},children:M<=g.length&&(0,C.jsx)(k,{})})]})}var E=function(t){var e;const[o,a,c]=(0,d.Z)(),[p]=(0,u.j1)("whatmoreShopId"),[h]=(0,u.j1)("whatmorePrimaryColor"),[y]=(0,u.j1)("whatmoreSecondaryColor"),[f]=(0,u.j1)("whatmoreTitleFont"),v="portrait"==o?(0,u.MO)("whatmoreTitleFontSizePortrait"):(0,u.MO)("whatmoreTitleFontSize"),{whatmoreRootId:g}=(0,n.useContext)(i.I),w=(0,u.MO)("isInDesignMode"),j=t.events,M=t.onClick,P=null!==(e=(0,m.aRS)(p))&&void 0!==e?e:f;function S(t){M(t)}return(0,n.useEffect)((()=>{(0,b.Oo)("Video shopping powered by Whatmore!")}),[]),(0,n.useEffect)((()=>{i.$.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,C.jsx)(s.C,{value:k,children:(0,C.jsx)("div",{children:(0,C.jsx)(r.x,{theme:l.ZP,cssVarsRoot:g,resetCSS:!1,children:(0,C.jsxs)(x.V.Provider,{value:{tileTopMargin:25,tileBottomMMargin:25,tileLeftMargin:4,tileRightMargin:4,showPlayButton:!0},children:[t.heading.trim().length>0?(0,C.jsxs)("div",{className:"whatmore-events-carousel",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",P,"important"),t.style.setProperty("font-size",v+"px","important"))},style:{color:h,backgroundClip:"text",textAlign:"center",fontWeight:(0,m.wOV)(p),lineHeight:(0,m.vY4)(p),letterSpacing:(0,m.X2K)(p)},children:t.heading}),w&&(0,C.jsx)("p",{ref:t=>{t&&(t.style.setProperty("font-family",P,"important"),t.style.setProperty("font-size",.7*v+"px","important"))},style:{color:h,backgroundClip:"text",textAlign:"center",fontWeight:(0,m.wOV)(p),lineHeight:(0,m.vY4)(p),letterSpacing:(0,m.X2K)(p)},children:"(Sample videos)"})]}):(0,C.jsx)(C.Fragment,{}),"landscape"===o?(0,C.jsx)(I,{events:j,onClick:S}):(0,C.jsx)(O,{events:j,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),l=o(6417);e.Z=function(t){var[e,o]=(0,r.Z)();return(0,n.useContext)(i.V),t.event,(0,l.jsx)("div",{style:{margin:"0 auto",width:o,height:e,overflow:"hidden"}})}},3439:function(){},5892:function(){},4444:function(){},1811:function(){},7850:function(){}}]);