whatmore-react-assets 1.0.1180 → 1.0.1182
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/static/css/926.a9bfc3e2.chunk.css +1 -0
- package/static/css/atc-with-form.1c72edff.chunk.css +1 -0
- package/static/css/banner-template-a.4e431eee.chunk.css +2 -0
- package/static/css/carousel-template-a.59976cb2.chunk.css +2 -0
- package/static/css/carousel-template-b.1672d707.chunk.css +2 -0
- package/static/css/carousel-template-f.599c1ca5.chunk.css +2 -0
- package/static/css/carousel-template-feed.e2240c87.chunk.css +2 -0
- package/static/css/carousel-template-g.59976cb2.chunk.css +2 -0
- package/static/css/carousel-template-h.59976cb2.chunk.css +2 -0
- package/static/css/carousel-template-view-more.e2240c87.chunk.css +2 -0
- package/static/css/collections-template-a.dc868ab3.chunk.css +2 -0
- package/static/css/collections-template-b.dc868ab3.chunk.css +2 -0
- package/static/css/collections-template-c.dc868ab3.chunk.css +2 -0
- package/static/css/collections-template-stories.dc868ab3.chunk.css +2 -0
- package/static/css/event-click-main.3373f4ca.chunk.css +2 -0
- package/static/css/event-click-product.1c72edff.chunk.css +1 -0
- package/static/css/event-click-spotlight.1c72edff.chunk.css +1 -0
- package/static/css/product-page-view.87a3bb51.chunk.css +2 -0
- package/static/css/spotlight-view.87a3bb51.chunk.css +2 -0
- package/static/css/stories-template-a.ff6f5f73.chunk.css +2 -0
- package/static/js/13.b216da25.chunk.js +1 -0
- package/static/js/145.3a1ea5cb.chunk.js +1 -0
- package/static/js/240.9c510ae9.chunk.js +2 -0
- package/static/js/249.8d06733c.chunk.js +1 -0
- package/static/js/351.3d3ea3c1.chunk.js +2 -0
- package/static/js/{548.fd822b0d.chunk.js → 548.835e0a00.chunk.js} +1 -1
- package/static/js/577.646fa55d.chunk.js +1 -0
- package/static/js/745.107e7775.chunk.js +2 -0
- package/static/js/766.c37f46b9.chunk.js +1 -0
- package/static/js/818.f38c152f.chunk.js +117 -0
- package/static/js/819.c2077f1e.chunk.js +2 -0
- package/static/js/824.4e7624f9.chunk.js +1 -0
- package/static/js/920.45e31f21.chunk.js +1 -0
- package/static/js/app-main.544edb71.chunk.js +1 -0
- package/static/js/banner-template-a.16af4071.chunk.js +1 -0
- package/static/js/carousel-template-a.ee32e4be.chunk.js +1 -0
- package/static/js/carousel-template-b.e363afe0.chunk.js +1 -0
- package/static/js/carousel-template-f.2d8e07e4.chunk.js +2 -0
- package/static/js/carousel-template-feed.2a46447b.chunk.js +16 -0
- package/static/js/{carousel-template-g.83982812.chunk.js → carousel-template-g.490f70d6.chunk.js} +1 -1
- package/static/js/carousel-template-h.4ec81ba7.chunk.js +1 -0
- package/static/js/carousel-template-view-more.6fee8817.chunk.js +45 -0
- package/static/js/collections-template-a.a32aa9b7.chunk.js +1 -0
- package/static/js/collections-template-b.fe4cdbbf.chunk.js +1 -0
- package/static/js/collections-template-c.660b920a.chunk.js +1 -0
- package/static/js/collections-template-stories.407b3524.chunk.js +1 -0
- package/static/js/event-click-main.b2fd1c5f.chunk.js +1 -0
- package/static/js/homepage-carousel-view.16a2bf47.chunk.js +1 -0
- package/static/js/product-page-view.ea8dd19e.chunk.js +1 -0
- package/static/js/recommended-carousel.9a69fdec.chunk.js +2 -0
- package/static/js/spotlight-view.ca45bae3.chunk.js +1 -0
- package/static/js/stories-template-a.15d8f805.chunk.js +1 -0
- package/whatmore.js +2 -2
- package/static/css/926.36fbef9a.chunk.css +0 -1
- package/static/css/atc-with-form.4dd2fc0f.chunk.css +0 -1
- package/static/css/banner-template-a.646138cd.chunk.css +0 -2
- package/static/css/carousel-template-a.1471d6e3.chunk.css +0 -2
- package/static/css/carousel-template-b.42b647f6.chunk.css +0 -2
- package/static/css/carousel-template-f.740de75c.chunk.css +0 -2
- package/static/css/carousel-template-feed.e325bb93.chunk.css +0 -2
- package/static/css/carousel-template-g.1471d6e3.chunk.css +0 -2
- package/static/css/carousel-template-h.1471d6e3.chunk.css +0 -2
- package/static/css/carousel-template-view-more.e325bb93.chunk.css +0 -2
- package/static/css/collections-template-a.55d08668.chunk.css +0 -2
- package/static/css/collections-template-b.55d08668.chunk.css +0 -2
- package/static/css/collections-template-c.55d08668.chunk.css +0 -2
- package/static/css/collections-template-stories.55d08668.chunk.css +0 -2
- package/static/css/event-click-main.35f97ebb.chunk.css +0 -2
- package/static/css/event-click-product.4dd2fc0f.chunk.css +0 -1
- package/static/css/event-click-spotlight.4dd2fc0f.chunk.css +0 -1
- package/static/css/product-page-view.4c845eb0.chunk.css +0 -2
- package/static/css/spotlight-view.4c845eb0.chunk.css +0 -2
- package/static/css/stories-template-a.6f769dad.chunk.css +0 -2
- package/static/js/13.f1f86e40.chunk.js +0 -1
- package/static/js/240.b51848e0.chunk.js +0 -2
- package/static/js/305.f81af841.chunk.js +0 -1
- package/static/js/351.62a14617.chunk.js +0 -2
- package/static/js/576.4ab6f670.chunk.js +0 -1
- package/static/js/731.c7e92797.chunk.js +0 -1
- package/static/js/745.ffffc6ff.chunk.js +0 -2
- package/static/js/751.372dd214.chunk.js +0 -1
- package/static/js/766.3331538a.chunk.js +0 -1
- package/static/js/818.d1218a10.chunk.js +0 -1
- package/static/js/819.0610382e.chunk.js +0 -2
- package/static/js/824.927b399c.chunk.js +0 -1
- package/static/js/app-main.a38f4d20.chunk.js +0 -1
- package/static/js/banner-template-a.115cfc83.chunk.js +0 -1
- package/static/js/carousel-template-a.f3f8795e.chunk.js +0 -1
- package/static/js/carousel-template-b.dacdb486.chunk.js +0 -1
- package/static/js/carousel-template-f.106fd7fb.chunk.js +0 -2
- package/static/js/carousel-template-feed.3cbb9f37.chunk.js +0 -2
- package/static/js/carousel-template-h.91f21c5d.chunk.js +0 -1
- package/static/js/carousel-template-view-more.b121cf14.chunk.js +0 -1
- package/static/js/collections-template-a.d50a7319.chunk.js +0 -1
- package/static/js/collections-template-b.78ffdc93.chunk.js +0 -1
- package/static/js/collections-template-c.a1678c8a.chunk.js +0 -1
- package/static/js/collections-template-stories.1493da9e.chunk.js +0 -1
- package/static/js/event-click-main.e9e26fc2.chunk.js +0 -1
- package/static/js/homepage-carousel-view.18fcfddd.chunk.js +0 -1
- package/static/js/product-page-view.3e327935.chunk.js +0 -1
- package/static/js/recommended-carousel.dc3caff3.chunk.js +0 -2
- package/static/js/spotlight-view.d1456f56.chunk.js +0 -1
- package/static/js/stories-template-a.5581a88a.chunk.js +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[312],{3388:function(e,t,n){n.d(t,{OC:function(){return l},e8:function(){return r},kT:function(){return i},kW:function(){return a},xg:function(){return o}});const i=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},o=function(e,t){return!(void 0==e.products||0==e.products.length)},r=function(e,t){if(null!=e)return e},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=e)return t?e.events[0].events:e.events};const l=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const i=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return i?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(i):[]}},5380:function(e,t,n){n.d(t,{Z:function(){return g}});var i=n(4959),o=n(7313),r=n(4892),a=n(6805),l=n(7753),s=n(9821);var d=function(e){const[t,n,i,o,r]=(0,s.Z)(),[d]=(0,l.j1)("whatmoreEmbedAppVideoPlayerSizePortrait"),[c]=(0,l.j1)("whatmoreEmbedAppVideoPlayerSizeLandscape"),h=r[a.YP]===a.$w?c/100:d/100*1.2;return[t*h,n*h,r]},c=n(9723),h=n(9461),u=n.n(h),p=n(1195),f=n(7108),m=(n(7244),n(123),n(9854)),x=n(6417);var g=function(e){var t;const n=o.useRef(null);var[s,h,g]=d();const v=(0,l.MO)("whatmoreUITheme"),[w]=(0,l.j1)("whatmoreEmbedAppVideoTitle"),[j]=(0,l.j1)("whatmoreEmbedAppPositionPortrait"),[b]=(0,l.j1)("whatmoreEmbedAppHorizontalPaddingPortrait"),[y]=(0,l.j1)("whatmoreEmbedAppVerticalPaddingPortrait"),[E]=(0,l.j1)("whatmoreEmbedAppPositionLandscape"),[S]=(0,l.j1)("whatmoreEmbedAppHorizontalPaddingLandscape"),[I]=(0,l.j1)("whatmoreEmbedAppVerticalPaddingLandscape"),P=(0,l.MO)("whatmoreShopId");var z=j,_=b,L=y;g[a.YP]===a.$w&&(z=E,_=S,L=I);const[A,C]=(0,o.useState)(["initial",window.pageYOffset]),[k,M]=(0,o.useState)(!1),O=null!==(t=e.isSpotlight)&&void 0!==t&&t,T=g[a.YP]===a.$w?.7*(0,m.zGA)(P):(0,m.zGA)(P),V=O?T:1;s*=V,h*=V;const Y=O?(0,m.G0o)(P):z,Z=O?(0,m.X8j)(P):(0,m.lVn)(P),[D,$]=(0,o.useState)(!O&&(0,m.eXi)(P));function F(e,t){C(e),e[1]<=100?M(!1):t!=k&&(M(t),$(!1))}(0,o.useEffect)((()=>{let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;Math.abs(n-e)<100||(F([n>e?"scrolled-down":"scrolled-up",n],!0),e=n>0?n:0),t=!1},i=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",i),()=>window.removeEventListener("scroll",i)}),[A]),(0,i.O3)({ref:n,handler:()=>{F(["scrolled-up",A[1]],!0)}});const R=e.event,N=e.inVideoClick,K=e.closeClick,W=.3*h,B=.6*h,G=.1*h,H=.1*(.5*h),U="round"==v?"10px":"0px",q=(0,m.Z$A)(P);var Q=!1,X=0,J=0;function ee(e){Q=e}return(0,x.jsx)("div",{children:D&&!Z?(0,x.jsx)(x.Fragment,{}):k&&Z?(0,x.jsx)("div",{style:"left"===Y?{left:"1px",bottom:O?(0,m.vnu)(P)+"px":L+"px",position:"fixed",zIndex:q}:{right:"5px",bottom:O?(0,m.vnu)(P)+"px":L+"px",position:"fixed",zIndex:q},children:(0,x.jsxs)("div",{onClick:()=>{F(["initial",A[1]],!1)},style:{margin:"1px",width:h+"px",height:s+"px"},className:"left"===Y?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,x.jsx)("div",{style:{overflow:"hidden"},children:(0,x.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,x.jsx)(r.Z,{url:R.thumbnail_image,isPlaying:!1,event:R})})}),(0,x.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,x.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,x.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,x.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",children:(0,x.jsx)(p.Z,{sx:{filter:"drop-shadow(0 0 2px black);",color:"white",fontSize:W+"px"},style:{position:"relative",zIndex:1,left:H+"px",bottom:H+"px"},onClick:K})})}),(0,x.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,x.jsx)(f.Z,{sx:{color:"white",fontSize:2*W+"px",filter:"drop-shadow(0 0 2px black);"}})})]})})]})}):(0,x.jsx)(u(),{nodeRef:n,cancel:".activate-button,.close-btn",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",bounds:"html",onStart:(e,t)=>{var n,i;n=t.x,i=t.y,X=n,J=i},onDrag:(e,t)=>{ee(!0)},onStop:(e,t)=>{Q&&(Math.abs(t.x-X)>5||Math.abs(t.y-J)>5)?ee(!1):N(R)},children:(0,x.jsx)("div",{ref:n,style:"left"===Y?{left:O?(0,m.$II)(P)+"px":_+"px",bottom:O?(0,m.vnu)(P)+"px":L+"px",position:"fixed",zIndex:q}:{right:O?(0,m.$II)(P)+"px":_+"px",bottom:O?(0,m.vnu)(P)+"px":L+"px",position:"fixed",zIndex:q},children:(0,x.jsxs)("div",{style:Object.assign({},{boxSizing:"border-box",margin:"1px",width:e.isSpotlight&&"60122562760"==P?s+"px":h+"px",height:e.isSpotlight&&"60122562760"==P?h+"px":s+"px"}),className:"left"===Y?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,x.jsx)("div",{style:{overflow:"hidden",position:"relative"},children:(0,x.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:e.isSpotlight&&"60122562760"==P?16/9:9/16},children:(0,x.jsx)(r.Z,{url:R.thumbnail_image,isMuted:!0,isPlaying:!0,event:R})})}),(0,x.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,x.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%"},children:[(0,x.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,x.jsx)(p.Z,{className:"close-btn",sx:{filter:"drop-shadow(0 0 2px black);",color:"white",fontSize:W+"px"},onClick:K,style:{position:"relative",zIndex:1,left:G+"px",bottom:G+"px"}})}),(0,x.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto"},children:(0,x.jsx)(c.Z,{sx:{color:(0,m.Ya_)(P),fontSize:B+"px",filter:"drop-shadow(0 0 2px black);"}})}),(0,x.jsx)("div",{style:{paddingLeft:"2px",paddingRight:"2px",borderBottomLeftRadius:U,borderBottomRightRadius:U,backgroundImage:w?"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0.6))":""},children:(0,x.jsxs)("p",{style:{textAlign:"center",color:"white",fontFamily:"Sans-serif",fontWeight:"semi-bold",fontSize:.4*W+"px",margin:0,padding:0,lineHeight:"110%"},children:["\xa0",w]})})]})})]})})})})}},2209:function(e,t,n){n.r(t);var i=n(7313),o=n(9854),r=n(2860),a=n(7753),l=n(5160),s=n(6967),d=n(5380),c=n(58),h=n(8984),u=n(4669),p=n(513),f=n(9302),m=n(7381),x=n(2575),g=n(7300),v=n(6524),w=n(3388),j=n(7643),b=n(778),y=n(364),E=n(6417);const S=(0,x.Z)({key:"whatmore-css-wsv"}),I=i.lazy((()=>Promise.all([n.e(819),n.e(351),n.e(576),n.e(745),n.e(926),n.e(824),n.e(818),n.e(311)]).then(n.bind(n,3818))));t.default=function(e){const[t,n]=(0,i.useState)(),[x,P]=(0,i.useState)(),[z]=(0,a.j1)("isInDesignMode"),[_]=(0,a.j1)("isDemoBrand"),[L,A]=(0,i.useState)(-2),[C]=(0,a.j1)("whatmoreShopId"),k=(0,a.MO)("isLandingSharedLink"),M=(0,a.MO)("whatmoreShareTemplateId"),O=((0,a.MO)("whatmoreShareStoryId"),(0,a.MO)("whatmoreShareEventId")),T=(0,a.MO)("whatmoreLandingLocationType"),V=(0,a.MO)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:Y}=(0,i.useContext)(y.I);var Z=(0,o.efR)(C)?r.Dm+"/get_eventset/":r.Gc+"/get_eventset/";(0,i.useEffect)((()=>{(0,s.hb)()}),[]),(0,i.useEffect)((()=>{(0,u.ll)(C)}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||x||!(0,h.KE)()||(0,a.MO)("whatmoreVideoPlayerPoolInitiated")||(0,c.b5)(c.UD)}),[t]),(0,i.useEffect)((()=>{A(-1);const e=v.NX,t=(0,v.H1)(T),i=Z.toString()+C.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+C;fetch(i).then((e=>e.json())).then((t=>(0,w.OC)(t,e))).then((e=>(n(e),e))).catch((e=>{P(e.message)}))}),[]),(0,i.useEffect)((()=>{A(-2)}),[t]),(0,i.useEffect)((()=>{null==t||0==t.length||x||k&&"template-embed"==(0,v.zv)(M)&&null!=O&&t.forEach(((e,t)=>{O==e.event_id&&F(e,!0,t)}))}),[t]);const D=Y.landingLocationType,$=Y.templateType,F=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,h.KE)()&&!t&&(0,c.QV)(),(0,g.B6)(e)||(0,g.WJ)(e))return z||_||(async()=>{const t=(0,v.NY)(D)+(0,v.dS)($)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,l.wh)(e),(0,u.Tc)(C,r.h7,r.dU),(0,s.H4)(e.event_id,e.products,"spotlight","video_popup",t)})(),void A(n)};function R(){return(0,E.jsx)(E.Fragment,{})}return null==t||0==t.length||x?(0,E.jsx)("div",{}):(V&&(0,m.EI)(t),(0,o.B$L)(C)&&L<0&&null!==localStorage.getItem("_whatmore_spotlight_viewed")?(0,E.jsx)(E.Fragment,{}):(localStorage.setItem("_whatmore_spotlight_viewed",!0),(0,E.jsx)(f.C,{value:S,children:-1===L||0===t.length?(0,E.jsx)(R,{}):-2===L&&t.length>0?(0,E.jsx)("div",{children:(0,E.jsx)(j.u,{userInteractionType:b.K.SPOTLIGHT_WIDGET_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!z&&!_,children:(0,E.jsx)(d.Z,{event:t[0],inVideoClick:F,closeClick:e=>{e.stopPropagation(),A(-1)},isSpotlight:!0})})}):(0,E.jsx)("div",{children:(0,E.jsx)(i.Suspense,{children:(0,E.jsx)(j.u,{userInteractionType:b.K.EVENT_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!z&&!_,children:(0,E.jsx)(I,{events:t,index:L,onBack:function(){(0,o.n2L)(C)&&(0,a.MO)("whatmoreAddedToCart")&&(0,p.D)(C,(()=>{}),100,window.location.hostname),A(-2)},template:"template-embed"})})})})})))}},6805:function(e,t,n){n.d(t,{$I:function(){return l},$w:function(){return d},AK:function(){return r},AL:function(){return a},YP:function(){return o},me:function(){return i},rE:function(){return s}});const i="device_type",o="device_mode",r="mobile",a="tablet",l="desktop",s="portrait",d="landscape"},9821:function(e,t,n){var i=n(6367),o=n(7753),r=n(8866),a=n(6805),l=n(9854);t.Z=function(e){const[t,n,s]=(0,r.Z)(),[d]=(0,o.j1)("whatmoreLandscapePadding"),[c]=(0,o.j1)("whatmoreShopId"),[h]=(0,o.j1)("whatmoreVideoTileSize"),[u]=(0,o.j1)("whatmoreVideoTileSizePortrait"),p=(0,i.useMediaQuery)({query:"(min-width: 1025px)"}),f=(0,i.useMediaQuery)({query:"(min-width: 481px)"}),m="portrait"==t?u:h,x=!("portrait"!=t||!f),g=m/100*1.3*.5,v=m/100;var w=Math.min(s,n),[j,b,y,E]=[.6*w*(16/9),.6*w,1.4,0];function S(e){return Math.round(10*e)/10}var I={DEVICE_TYPE:a.AK,DEVICE_MODE:a.rE};if(p){const e=b*g,t=j*g;[j,b,y,E]=[t,e,(s-2*d-2*(0,l.mZU)(c))/(1.1*e),d],I[a.me]=a.$I,I[a.YP]=a.$w}else if(x){var P=.8*b,z=.8*j;"portrait"==t?(P*=v,z*=v,[j,b,y,E]=[z,P,S(s/(1.2*P)),0],I[a.me]=a.AL,I[a.YP]=a.rE):([j,b,y,E]=[z,P,(s-2*d)/(1.1*P),d],I[a.me]=a.AL,I[a.YP]=a.$w)}else{P=b,z=j;"portrait"==t?(P=P*v*.9,z=z*v*.9,[j,b,y,E]=[z,P,S(s/(1.15*P)),0],I[a.me]=a.AK,I[a.YP]=a.rE):(P=.7*b,z=.7*j,[j,b,y,E]=[z,P,(s-2*d)/(1.1*P),d],I[a.me]=a.AK,I[a.YP]=a.$w)}return[j,b,y,E,I]}},7244:function(){}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[441],{3580:function(t,e,r){r.r(e),r.d(e,{default:function(){return m}});var o=r(7313),n=r(8866),i=r(7753),l=(r(9111),r(123),r(9778),r(9854)),a=r(868),s=r(9363),c=(r(8984),r(4892)),p=r(6417);var d=function(t){var e,r;const[d,u,h]=(0,n.Z)(),f=(0,i.MO)("whatmorePrimaryFont"),m=(0,i.MO)("whatmoreSecondaryColor"),x=(0,i.MO)("whatmoreShopId"),[g,v]=(0,o.useState)(!1),w=t.storyId,y=(0,a.V)(t.imageUrl),b=t.title,j=t.onClick,S=t.template,k=(0,l.f63)(x),C="template-stories-a"===S?"50%":"30%",F="portrait"==d?1:(0,l.Zyc)(x),_=Math.floor(t.tileSize*F),R=.12*_*(0,l.LM2)(x),M=null!==(e=(0,l.QaQ)(x))&&void 0!==e?e:f,z=null!==(r=(0,l.u2W)(x))&&void 0!==r?r:[m,k,m,k,m],I=(0,o.useRef)(0),E=(0,o.useRef)(null),O=(0,o.useRef)(null);return(0,o.useEffect)((()=>{O.current&&O.current.play()}),[]),(0,p.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",alignItems:"center",flexShrink:0,height:"fit-content",width:_*(0,l.jJ6)(x)+"px",marginLeft:"10px",marginRight:"10px",marginTop:"10px",marginBottom:"10px",cursor:"pointer"},onClick:()=>{v(!0),j(w)},className:[g?"whatmore-scale-on-tap":""].join(" "),children:[(0,p.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"fit-content",borderRadius:C,boxShadow:"0px 2px 1px 0px "+z[0]+"50, 0px -2px 1px 0px "+z[1]+"50, 2px 0px 1px 0px "+z[2]+"50, -2px 0px 1px 0px "+z[3]+"80, 2px -2px 1px 0px "+z[4]+"80, -2px 2px 1px 0px "+z[0]+"DA, 2px 2px 1px 0px "+z[1]+"DA, -2px -2px 1px 0px "+z[2]+"DA"},children:(0,p.jsx)("div",{className:"whatmore-story-thumbnail-wrapper",style:{flexShrink:0,objectFit:"cover",height:_+"px",width:_+"px",borderRadius:C,border:"3px solid white",backgroundColor:"#343434"===m?"#d3d3d3":m,overflow:"hidden"},children:"video"==(0,s.$)(y)?(0,p.jsx)(c.Z,{height:"100%",width:"100%",url:y,isPlaying:!0,event:{event_type:"video"},borderRadius:C}):(0,p.jsx)("img",{ref:E,className:"whatmore-story-thumbnail",src:y,loading:"lazy",style:{objectFit:"cover",height:_+"px",width:_+"px",backgroundColor:"white"},alt:"story image",onError:function(){if(I.current<3){let e=(0,a.V)(t.imageUrl);E.current.src="",E.current.src=e,I.current=I.current+1}else console.log("Failed to load image after several attempts"),E.current.src="https://d2oouab8j9eigo.cloudfront.net/background_white.png"}})})}),(0,p.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"100%",marginTop:"10px"},children:(0,p.jsx)("p",{ref:t=>{t&&t.style.setProperty("font-size",R+"px","important")},style:{textAlign:"center",color:(0,l.WS3)(x),fontFamily:M,fontWeight:"normal",lineHeight:"110%",margin:0,padding:0,overflow:"hidden",textOverflow:"ellipsis",width:"auto"},children:null===b||void 0===b?void 0:b.substring(0,24)})})]})},u=r(32),h=r(9302);const f=(0,r(2575).Z)({key:"whatmore-stories-css"});var m=function(t){const[e,r,a]=(0,n.Z)(),[s]=(0,i.j1)("whatmoreStoryTileSize"),[c]=(0,i.j1)("whatmoreStoryTileSizeDesktop"),[m]=(0,i.j1)("whatmoreShopId"),[x,g]=(0,o.useState)("portrait"===e?"flex-start":"center"),v=(0,o.useRef)(null);var w=t.eventsStories;const y=t.onClick,b=t.template;(0,o.useEffect)((()=>{u.IR.forEach((t=>{var e;if(!(null!==(e=t.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==e?e:t.querySelector('.whatmore-template-type[data="template-stories-a"]')))return;t&&(t.style.minHeight="0px")}))}),[]);const j=t=>{if(v.current){const e="left"===t?4*-C:4*C;v.current.scrollBy({left:e,behavior:"smooth"})}};(0,o.useEffect)((()=>{!function(){if(v.current){const t=v.current.scrollWidth,e=v.current.offsetWidth;g(t>e?"flex-start":"center")}}()}),[x,a]);const[S,k]=(0,o.useState)([]);(0,o.useEffect)((()=>{k(w.map((t=>t.storyset_dynamic_thumbnail?Math.floor(Math.random()*(t.events.length-1)):0)))}),[]);const C="landscape"===e?r*(c/100)*.3:a*(s/100)*.5;return(0,p.jsx)(h.C,{value:f,children:"landscape"==e&&!(0,l.DF0)(m)||"portrait"==e&&!(0,l.JaA)(m)?(0,p.jsx)(p.Fragment,{}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:x,height:"fit-content",width:"100%"},className:"whatmore-story-horizontal-flex",ref:v,children:w.map(((t,e)=>{var r,o,n,i,a;const s=t.storyset_dynamic_thumbnail?null!==(r=null===(o=t.events[S[e]])||void 0===o?void 0:o.poster_image)&&void 0!==r?r:t.thumbnail_image:null!==(n=t.thumbnail_image)&&void 0!==n?n:null===t||void 0===t||null===(i=t.events)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.thumbnail_image;return(0,p.jsx)(d,{storyId:t.id,tileSize:(0,l.OFP)(m)?100:C,onClick:t=>{y(e)},template:b,imageUrl:s,fallbackUrl:t.thumbnail_image,title:t.title},"whatmore-story-"+t.id)}))}),"landscape"===e&&(0,l.sMW)(m)&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{onClick:()=>j("left"),style:{borderRadius:"4px",backgroundColor:"rgba(0, 0, 0, 0.4)",position:"absolute",top:"40%",transform:"translateY(-50%)",left:0},children:(0,p.jsx)("p",{style:{fontSize:"22px",color:"white",padding:"8px"},children:"<"})}),(0,p.jsx)("button",{onClick:()=>j("right"),style:{borderRadius:"4px",backgroundColor:"rgba(0, 0, 0, 0.4)",position:"absolute",top:"40%",transform:"translateY(-50%)",right:0},children:(0,p.jsx)("p",{style:{fontSize:"22px",color:"white",padding:"8px"},children:">"})})]})]})})}},9363:function(t,e,r){r.d(e,{$:function(){return l},s:function(){return i}});var o=r(9854),n=r(7753);function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=(0,n.MO)("whatmoreShopId");return"shopify"!=(0,o.Ipo)(r)?"STRNV8MHJTF"==r?t+"?format=webp":t:t+e}function l(t){var e;if(null!==t&&void 0!==t&&t.includes("https://w-media.b-cdn.net/process-media"))return"image";const r=null===t||void 0===t||null===(e=t.trim())||void 0===e?void 0:e.split("?")[0],o=/\.(jpeg|jpg|gif|png|svg|webp)$/i,n=/\.(mp4|mov|wmv|avi|flv|mkv)$/i;return null!==o&&void 0!==o&&o.test(r)?"image":null!==n&&void 0!==n&&n.test(r)?"video":void 0}},9111:function(){},9778:function(){}}]);
|