whatmore-react-assets 1.0.1268 → 1.0.1269

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([[441],{3580:function(t,e,r){r.r(e),r.d(e,{default:function(){return x}});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(4892),p=r(6417);var d=function(t){var e,r;const n=(0,i.MO)("whatmorePrimaryFont"),d=(0,i.MO)("whatmoreSecondaryColor"),u=(0,i.MO)("whatmoreShopId"),[h,f]=(0,o.useState)(!1),x=t.storyId,m=(0,a.V)(t.imageUrl),v=t.title,g=t.onClick,w=t.template,y=(0,l.f63)(u),b="template-stories-a"===w?"50%":"30%",j=Math.floor(t.tileSize),S=.12*j*(0,l.LM2)(u),k=null!==(e=(0,l.QaQ)(u))&&void 0!==e?e:n,C=null!==(r=(0,l.u2W)(u))&&void 0!==r?r:[d,y,d,y,d],F=(0,o.useRef)(0),_=(0,o.useRef)(null),R=(0,o.useRef)(null);return(0,o.useEffect)((()=>{R.current&&R.current.play()}),[]),(0,o.useEffect)((()=>{const t=_.current,e=new IntersectionObserver(((t,e)=>{t.forEach((t=>{if(t.isIntersecting){const r=t.target;r.src=r.dataset.src,e.unobserve(r)}}))}),{rootMargin:"0px 100px 0px 0px",threshold:0});return t&&e.observe(t),()=>{t&&e.unobserve(t)}}),[m]),(0,p.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",alignItems:"center",flexShrink:0,height:"fit-content",width:j*(0,l.jJ6)(u)+"px",marginLeft:"10px",marginRight:"10px",marginTop:"10px",marginBottom:"10px",cursor:"pointer"},onClick:()=>{f(!0),g(x)},className:[h?"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:b,boxShadow:"0px 2px 1px 0px "+C[0]+"50, 0px -2px 1px 0px "+C[1]+"50, 2px 0px 1px 0px "+C[2]+"50, -2px 0px 1px 0px "+C[3]+"80, 2px -2px 1px 0px "+C[4]+"80, -2px 2px 1px 0px "+C[0]+"DA, 2px 2px 1px 0px "+C[1]+"DA, -2px -2px 1px 0px "+C[2]+"DA"},children:(0,p.jsx)("div",{className:"whatmore-story-thumbnail-wrapper",style:{flexShrink:0,objectFit:"cover",height:j+"px",width:j+"px",borderRadius:b,border:"3px solid white",backgroundColor:"#343434"===d?"#d3d3d3":d,overflow:"hidden"},children:"video"==(0,s.$)(m)?(0,p.jsx)(c.Z,{height:"100%",width:"100%",url:m,isPlaying:!0,event:{event_type:"video"},borderRadius:b}):(0,p.jsx)("img",{ref:_,className:"whatmore-story-thumbnail","data-src":m.startsWith("https://cdn.shopify.com")?m.split("?")[0]+"?width=400&height=400":m,loading:"lazy",style:{objectFit:"cover",height:j+"px",width:j+"px",backgroundColor:"white"},alt:"story",onError:function(){if(F.current<3){let e=(0,a.V)(t.imageUrl);_.current.src="",_.current.src=e,F.current=F.current+1}else console.log("Failed to load image after several attempts"),_.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",S+"px","important")},style:{textAlign:"center",color:(0,l.WS3)(u),fontFamily:k,fontWeight:"normal",lineHeight:"110%",margin:0,padding:0,overflow:"hidden",textOverflow:"ellipsis",width:"auto"},children:null===v||void 0===v?void 0:v.substring(0,24)})})]})},u=r(32),h=r(9302);const f=(0,r(2575).Z)({key:"whatmore-stories-css"});var x=function(t){const[e,r,a]=(0,n.Z)(),[s]=(0,i.j1)("whatmoreStoryTileSize"),[c]=(0,i.j1)("whatmoreStoryTileSizeDesktop"),[x]=(0,i.j1)("whatmoreShopId"),[m,v]=(0,o.useState)("portrait"===e?"flex-start":"center"),g=(0,o.useRef)(null),w=t.eventsStories,y=t.onClick,b=t.template,[j,S]=(0,o.useState)([]),[k,C]=(0,o.useState)(!1);(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 t=setTimeout((()=>{S(w.map((t=>t.storyset_dynamic_thumbnail?Math.floor(Math.random()*(t.events.length-1)):0))),C(!0)}),0);return()=>clearTimeout(t)}),[w]);const F=t=>{if(g.current){const e="left"===t?4*-_:4*_;g.current.scrollBy({left:e,behavior:"smooth"})}};(0,o.useEffect)((()=>{!function(){if(g.current){const t=g.current.scrollWidth,e=g.current.offsetWidth;v(t>e?"flex-start":"center")}}()}),[m,a]);const _="landscape"===e?r*(c/100)*.3:a*(s/100)*.5;return(0,p.jsx)(h.C,{value:f,children:"landscape"===e&&!(0,l.DF0)(x)||"portrait"===e&&!(0,l.JaA)(x)?(0,p.jsx)(p.Fragment,{}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:m,height:"fit-content",width:"100%",opacity:k?1:.3,transition:"opacity 0.3s ease-in-out"},className:"whatmore-story-horizontal-flex",ref:g,children:w.map(((t,e)=>{var r,o,n,i,a;const s=t.storyset_dynamic_thumbnail?void 0!==j[e]&&null!==(r=null===(o=t.events[j[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)(x)?100:_,onClick:()=>{y(e)},template:b,imageUrl:s,fallbackUrl:t.thumbnail_image,title:t.title},"whatmore-story-"+t.id)}))}),"landscape"===e&&(0,l.sMW)(x)&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{onClick:()=>F("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:()=>F("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(){}}]);