whatmore-react-assets 1.0.564 → 1.0.565
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.
- package/package.json +1 -1
- package/static/js/607.deac725c.chunk.js +1 -0
- package/static/js/708.8a10bee2.chunk.js +1 -0
- package/static/js/{972.d52d5375.chunk.js → 972.20ea9070.chunk.js} +1 -1
- package/whatmore.js +2 -2
- package/static/js/607.64350891.chunk.js +0 -1
- package/static/js/708.da13f965.chunk.js +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[607],{6071:function(e,t,n){n.r(t);var o=n(7313),r=n(6090),i=n(7616),l=(n(6143),n(7850),n(4444),n(7244),n(123),n(5892),n(1811),n(9302)),a=n(2575),s=(n(8984),n(8866)),d=n(7753),p=n(7129),c=n(9039),x=n(8631),h=n(6066),u=n(8782),m=n(9821),f=(n(4862),n(7381)),v=n(6417);const g=(0,a.Z)({key:"whatmore-css-cv"});t.default=function(e){const t=e.events,[n,a,w]=(0,s.Z)(),[y,j]=(0,o.useState)(Array(t.length).fill(0).map((()=>Math.random()))),[b,C,S,E,k]=(0,m.Z)(),L=(0,d.MO)("whatmoreCollectionsTileSize"),R="portrait"==n?0:(0,d.MO)("whatmoreLandscapePadding"),M=(0,d.MO)("whatmoreCollectionsTilesSpacing"),{whatmoreRootId:Z}=(0,o.useContext)(c.I),B=e.onClick;function A(e){B(e)}delete i.ZP.styles.global;var P=[];for(let o=0,r=!1;o<t.length;)r&&o!=t.length-1&&y[o]>.2?(P.push((0,v.jsx)(h.Z,{event1:t[o],event2:t[o+1],onClick:()=>{A(t[o-1])},removeBorders:!0},"collections-tile-"+o)),o+=2,r=!r):(P.push((0,v.jsx)(x.Z,{event:t[o],onClick:()=>{A(t[o-1])},removeBorders:!0,borderRadius:"0%"},"collections-tile-"+o)),o+=1,r=!r);return(0,o.useEffect)((()=>{(0,f.Oo)("Video shopping powered by Whatmore!")}),[]),(0,o.useEffect)((()=>{c.$.forEach((e=>{var t;if(!(null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-d"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-d"]')))return;const n=e.querySelector(".whatmore-render-root");n&&(n.style.minHeight="0px")}))}),[]),(0,v.jsx)(l.C,{value:g,children:(0,v.jsx)("div",{children:(0,v.jsx)(r.x,{theme:i.ZP,cssVarsRoot:Z,resetCSS:!1,children:(0,v.jsx)(p.V.Provider,{value:{tileTopMargin:0,tileBottomMMargin:0,tileLeftMargin:0,tileRightMargin:0,showPlayButton:!1},children:(0,v.jsx)("div",{style:{marginLeft:R+"px",marginRight:R+"px"},children:(0,v.jsx)(u.P,{renderElement:e=>(0,v.jsx)(v.Fragment,{children:e.eventData}),dataList:P,spacing:M,defaultHeight:b*L*.01+"px",defaultWidth:C*L*.01+"px",retainAlreadyRenderedElements:!0})})})})})})}},7129:function(e,t,n){n.d(t,{V:function(){return o}});const o=(0,n(7313).createContext)({tileTopMargin:10,tileBottomMMargin:10,tileLeftMargin:10,tileRightMargin:10,showPlayButton:!0})},8631:function(e,t,n){var o=n(7313),r=n(9854),i=n(7753),l=(n(9111),n(123),n(9778),n(4892)),a=n(7129),s=n(9821),d=n(6417);t.Z=function(e){var t;const[n,p,c,x,h]=(0,s.Z)(),[u]=(0,i.j1)("whatmoreSecondaryColor"),[m]=(0,i.j1)("whatmoreShopId"),[f]=(0,i.j1)("whatmoreCollectionsTileSize"),[v,g]=(0,o.useState)(!1),w=(0,r.f63)(m);(0,o.useContext)(a.V);const y=e.event,j=e.onClick,b=e.removeBorders,C=n*f*.01,S=p*f*.01,E=null!==(t=e.borderRadius)&&void 0!==t?t:"0%";return(0,d.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:S+"px",marginLeft:b?"2px":"5px",marginRight:b?"2px":"5px",marginTop:b?"2px":"5px",marginBottom:b?"2px":"5px",cursor:"pointer"},onClick:()=>{g(!0),j(y)},className:[v?"whatmore-scale-on-tap":""].join(" "),children:(0,d.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"fit-content",borderRadius:E,overflow:"hidden",boxShadow:b?"":"0px 1px 1px 0px "+u+"50, 0px -1px 1px 0px "+w+"50, 1px 0px 1px 0px "+u+"50, -1px 0px 1px 0px "+w+"80, 1px -1px 1px 0px "+u+"80, -1px 1px 1px 0px "+w+"DA, 1px 1px 1px 0px "+u+"DA, -1px -1px 1px 0px "+w+"DA"},children:(0,d.jsx)("div",{style:{flexShrink:0,objectFit:"cover",height:C+"px",width:S+"px",borderRadius:E,backgroundColor:"gray",overflow:"hidden"},children:(0,d.jsx)(l.Z,{height:"100%",width:"100%",url:y.thumbnail_image,isPlaying:!0,event:y})})})})}},6066:function(e,t,n){var o=n(7313),r=n(9854),i=n(7753),l=(n(9111),n(123),n(9778),n(4892)),a=n(7129),s=n(9821),d=n(6417);t.Z=function(e){var t;const[n,p,c,x,h]=(0,s.Z)(),[u]=(0,i.j1)("whatmoreSecondaryColor"),[m]=(0,i.j1)("whatmoreShopId"),[f]=(0,i.j1)("whatmoreCollectionsTileSize"),[v,g]=(0,o.useState)(!1),w=(0,r.f63)(m);(0,o.useContext)(a.V);const y=e.event1,j=e.event2,b=e.onClick,C=.01*f,S=n*C,E=n*C*.5,k=p*C,L=null!==(t=e.borderRadius)&&void 0!==t?t:"10%",R="15%",M=e.removeBorders;return(0,d.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",flexShrink:0,height:S+"px",width:k+"px",marginLeft:M?"2px":"5px",marginRight:M?"2px":"5px",marginTop:M?"2px":"5px",marginBottom:M?"2px":"5px",cursor:"pointer"},children:(0,d.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"fit-content",borderRadius:M?"0px":L,boxShadow:M?"":"0px 1px 1px 0px "+u+"50, 0px -1px 1px 0px "+w+"50, 1px 0px 1px 0px "+u+"50, -1px 0px 1px 0px "+w+"80, 1px -1px 1px 0px "+u+"80, -1px 1px 1px 0px "+w+"DA, 1px 1px 1px 0px "+u+"DA, -1px -1px 1px 0px "+w+"DA"},onClick:()=>{g(!0),b(y)},className:[v?"whatmore-scale-on-tap":""].join(" "),children:[(0,d.jsx)("div",{style:{flexShrink:0,objectFit:"cover",height:E+"px",width:k+"px",borderTopLeftRadius:M?"0px":R,borderTopRightRadius:M?"0px":R,borderBottom:"2px solid transparent",backgroundColor:"transparent",overflow:"hidden"},children:(0,d.jsx)(l.Z,{height:"100%",width:"100%",url:y.thumbnail_image,isPlaying:!0,event:y})}),(0,d.jsx)("div",{style:{flexShrink:0,objectFit:"cover",height:E+"px",width:k+"px",borderBottomLeftRadius:M?"0px":R,borderBottomRightRadius:M?"0px":R,borderTop:"2px solid transparent",backgroundColor:"transparent",overflow:"hidden"},children:(0,d.jsx)(l.Z,{height:"100%",width:"100%",url:j.thumbnail_image,isPlaying:!0,event:j})})]})})}},8782:function(e,t,n){n.d(t,{P:function(){return a}});var o=n(3933),r=n(7313),i=(n(123),n(6417));function l(e){const{ref:t,inView:n,entry:r}=(0,o.YD)({triggerOnce:e.retainAlreadyRenderedElements});return(0,i.jsx)("div",{ref:t,children:n?e.renderElement({eventData:e.data}):(0,i.jsx)("div",{style:{minWidth:e.defaultHeight,minHeight:e.defaultWidth}})})}function a(e){var t;return(0,r.useEffect)((()=>{const e=document.querySelector(".whatmore-carousel-horizontal-flex");let t,n=!1;function o(e){e.touches&&(null===e||void 0===e?void 0:e.touches.length)>0?(n=!0,t=e.touches[0].clientX):(n=!0,t=e.clientX)}function r(o){if(!n)return;const r=o.touches?o.touches[0].clientX:o.clientX;e.style.pointerEvents="none";const i=2*(t-r);e.scrollLeft+=i,t=r}function i(t){e.style.pointerEvents="auto",n=!1}return e&&("ontouchstart"in window&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",r),e.addEventListener("touchend",i)),e.addEventListener("mousedown",o),document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)),()=>{e&&("ontouchstart"in window&&(e.removeEventListener("touchstart",o),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",i)),e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i))}}),[]),(0,i.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",height:"fit-content",width:"100%",gap:null!==(t=e.spacing)&&void 0!==t?t:3},className:"whatmore-carousel-horizontal-flex",children:e.dataList.map(((t,n)=>(0,i.jsx)(l,{renderElement:e.renderElement,data:t,defaultHeight:e.defaultHeight,defaultWidth:e.defaultWidth,retainAlreadyRenderedElements:e.retainAlreadyRenderedElements},"key-"+n)))})}},9111:function(){},5892:function(){},4444:function(){},1811:function(){},6143:function(){},7850:function(){},9778:function(){}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[708],{1291:function(e,t,n){n.r(t);var o=n(7313),r=n(6090),i=n(7616),a=n(9039),l=(n(6143),n(7850),n(4444),n(7244),n(123),n(5892),n(1811),n(9302)),s=n(2575),c=n(8866),d=n(7753),h=n(7129),u=n(8631),p=n(9821),m=n(8782),x=n(7381),f=n(9854),v=n(6417);const g=(0,s.Z)({key:"whatmore-css-cv"});t.default=function(e){var t;const[n,s,w]=(0,c.Z)(),[y,j,E,S,C]=(0,p.Z)(),L=(0,d.MO)("whatmoreCollectionsTileSize"),M="portrait"==n?0:(0,d.MO)("whatmoreLandscapePadding"),k=(0,d.MO)("whatmoreCollectionsTilesSpacing"),R=(0,d.MO)("whatmoreShopId"),[b]=(0,d.MO)("whatmorePrimaryColor"),{whatmoreRootId:P}=(0,o.useContext)(a.I),O=e.events,F=e.onClick,T=(0,d.MO)("whatmoreTitleFont"),Z="portrait"==n?(0,d.MO)("whatmoreTitleFontSizePortrait"):(0,d.MO)("whatmoreTitleFontSize"),A=null!==(t=(0,f.aRS)(R))&&void 0!==t?t:T;delete i.ZP.styles.global;var z=[];for(let o=0;o<O.length;)z.push((0,v.jsx)(u.Z,{event:O[o],onClick:()=>{var e;e=O[o-1],F(e)},removeBorders:!0,borderRadius:"5%"},"collections-tile-"+o)),o+=1;return(0,o.useEffect)((()=>{(0,x.Oo)("Video shopping powered by Whatmore!")}),[]),(0,o.useEffect)((()=>{a.$.forEach((e=>{var t;const n=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-collections-c"]')||e.querySelector('.whatmore-template-type[data="template-e"]');if(!n)return;const o=e.querySelector(".whatmore-render-root");n&&o&&(o.style.minHeight="0px")}))}),[]),(0,v.jsx)(l.C,{value:g,children:(0,v.jsx)("div",{children:(0,v.jsx)(r.x,{theme:i.ZP,cssVarsRoot:P,resetCSS:!1,children:(0,v.jsxs)(h.V.Provider,{value:{tileTopMargin:0,tileBottomMMargin:0,tileLeftMargin:0,tileRightMargin:0,showPlayButton:!1},children:[e.heading.trim().length>0?(0,v.jsx)("div",{className:"whatmore-events-carousel",style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,v.jsx)("p",{ref:e=>{e&&(e.style.setProperty("font-family",A,"important"),e.style.setProperty("font-size",Z+"px","important"))},style:{color:b,backgroundClip:"text",textAlign:"center",fontWeight:(0,f.wOV)(R),lineHeight:(0,f.vY4)(R),letterSpacing:(0,f.X2K)(R)},children:e.heading})}):(0,v.jsx)(v.Fragment,{}),(0,v.jsx)("div",{style:{marginLeft:M+"px",marginRight:M+"px"},children:(0,v.jsx)(m.P,{renderElement:e=>(0,v.jsx)(v.Fragment,{children:e.eventData}),dataList:z,spacing:k,defaultHeight:y*L*.01+"px",defaultWidth:j*L*.01+"px",retainAlreadyRenderedElements:!0})})]})})})})}},7129:function(e,t,n){n.d(t,{V:function(){return o}});const o=(0,n(7313).createContext)({tileTopMargin:10,tileBottomMMargin:10,tileLeftMargin:10,tileRightMargin:10,showPlayButton:!0})},8631:function(e,t,n){var o=n(7313),r=n(9854),i=n(7753),a=(n(9111),n(123),n(9778),n(4892)),l=n(7129),s=n(9821),c=n(6417);t.Z=function(e){var t;const[n,d,h,u,p]=(0,s.Z)(),[m]=(0,i.j1)("whatmoreSecondaryColor"),[x]=(0,i.j1)("whatmoreShopId"),[f]=(0,i.j1)("whatmoreCollectionsTileSize"),[v,g]=(0,o.useState)(!1),w=(0,r.f63)(x);(0,o.useContext)(l.V);const y=e.event,j=e.onClick,E=e.removeBorders,S=n*f*.01,C=d*f*.01,L=null!==(t=e.borderRadius)&&void 0!==t?t:"0%";return(0,c.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:C+"px",marginLeft:E?"2px":"5px",marginRight:E?"2px":"5px",marginTop:E?"2px":"5px",marginBottom:E?"2px":"5px",cursor:"pointer"},onClick:()=>{g(!0),j(y)},className:[v?"whatmore-scale-on-tap":""].join(" "),children:(0,c.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"fit-content",borderRadius:L,overflow:"hidden",boxShadow:E?"":"0px 1px 1px 0px "+m+"50, 0px -1px 1px 0px "+w+"50, 1px 0px 1px 0px "+m+"50, -1px 0px 1px 0px "+w+"80, 1px -1px 1px 0px "+m+"80, -1px 1px 1px 0px "+w+"DA, 1px 1px 1px 0px "+m+"DA, -1px -1px 1px 0px "+w+"DA"},children:(0,c.jsx)("div",{style:{flexShrink:0,objectFit:"cover",height:S+"px",width:C+"px",borderRadius:L,backgroundColor:"gray",overflow:"hidden"},children:(0,c.jsx)(a.Z,{height:"100%",width:"100%",url:y.thumbnail_image,isPlaying:!0,event:y})})})})}},8782:function(e,t,n){n.d(t,{P:function(){return l}});var o=n(3933),r=n(7313),i=(n(123),n(6417));function a(e){const{ref:t,inView:n,entry:r}=(0,o.YD)({triggerOnce:e.retainAlreadyRenderedElements});return(0,i.jsx)("div",{ref:t,children:n?e.renderElement({eventData:e.data}):(0,i.jsx)("div",{style:{minWidth:e.defaultHeight,minHeight:e.defaultWidth}})})}function l(e){var t;return(0,r.useEffect)((()=>{const e=document.querySelector(".whatmore-carousel-horizontal-flex");let t,n=!1;function o(e){e.touches&&(null===e||void 0===e?void 0:e.touches.length)>0?(n=!0,t=e.touches[0].clientX):(n=!0,t=e.clientX)}function r(o){if(!n)return;const r=o.touches?o.touches[0].clientX:o.clientX;e.style.pointerEvents="none";const i=2*(t-r);e.scrollLeft+=i,t=r}function i(t){e.style.pointerEvents="auto",n=!1}return e&&("ontouchstart"in window&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",r),e.addEventListener("touchend",i)),e.addEventListener("mousedown",o),document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)),()=>{e&&("ontouchstart"in window&&(e.removeEventListener("touchstart",o),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",i)),e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i))}}),[]),(0,i.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",height:"fit-content",width:"100%",gap:null!==(t=e.spacing)&&void 0!==t?t:3},className:"whatmore-carousel-horizontal-flex",children:e.dataList.map(((t,n)=>(0,i.jsx)(a,{renderElement:e.renderElement,data:t,defaultHeight:e.defaultHeight,defaultWidth:e.defaultWidth,retainAlreadyRenderedElements:e.retainAlreadyRenderedElements},"key-"+n)))})}},9111:function(){},5892:function(){},4444:function(){},1811:function(){},6143:function(){},7850:function(){},9778:function(){}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[972],{3972:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var a=n(7753),r=n(7313),i=n(2860),o=n(499),s=n(4897),l=n(5160),c=n(9854),u=n(6967),d=n(8984),h=n(58),m=n(4669),p=n(941),v=n(9039),g=n(7300),f=n(6524),I=n(7643),S=n(778),y=n(6417);const w=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(303),n.e(891)]).then(n.bind(n,4095)))),E=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(364),n.e(530)]).then(n.bind(n,5523)))),T=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(358)]).then(n.bind(n,3827)))),x=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(607)]).then(n.bind(n,6071)))),_=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(708)]).then(n.bind(n,1291)))),j=r.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),M=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(790)]).then(n.bind(n,4209)))),L=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(959)]).then(n.bind(n,4048)))),O=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(303),n.e(554)]).then(n.bind(n,9085)))),C=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(303),n.e(364),n.e(67)]).then(n.bind(n,4362)))),b=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(196)]).then(n.bind(n,4658))));var D=function(e){const[t]=(0,a.j1)("isInDesignMode"),[n]=(0,a.j1)("isDemoBrand"),[D]=(0,a.j1)("whatmoreTopBottomPadding"),[P]=(0,a.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:G}=(0,r.useContext)(v.I),[W]=(0,a.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:V}=(0,r.useContext)(v.I),k=(0,a.MO)("isLandingSharedLink"),z=(0,a.MO)("whatmoreShareTemplateId"),N=(0,a.MO)("whatmoreShareStoryId"),R=(0,a.MO)("whatmoreShareEventId"),[U,Z]=(0,r.useState)(-1),[q,F]=(0,r.useState)(null);let A=e.events,K=[];if("template-banner-a"!==V){let e=0;for(let t=0;t<(null===A||void 0===A?void 0:A.length);t++){var B,H,Y,J;const n=(null===A||void 0===A||null===(B=A[t])||void 0===B||null===(H=B.products)||void 0===H?void 0:H.length)>0&&(null===A||void 0===A||null===(Y=A[t])||void 0===Y||null===(J=Y.products)||void 0===J?void 0:J.every((e=>"oos"===(null===e||void 0===e?void 0:e.product_status))));if(!(0,g.B6)(A[t])&&!(0,g.WJ)(A[t])||n){if((0,g.yC)(null===A||void 0===A?void 0:A[t])){var{status:X,bannerText:Q,timeToStartInMins:$}=s.Z.getEventStatus(A[t]);X.name===o.Z.LIVE.name&&(K.push({...null===A||void 0===A?void 0:A[t],index:e}),e++)}}else K.push({...null===A||void 0===A?void 0:A[t],index:e}),e++}}var ee=null;function te(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,d.KE)()&&!a&&(0,h.QV)(),t||n||(async()=>{const t=ee[e].events[0];(0,l.wh)(t),(0,m.Tc)(W,i.Xh,i.OW),(0,u.H4)(t.event_id,t.products,"homepage","stories")})();var o=0;null!=r&&ee[e].events.map(((e,t)=>{e.event_id==r&&(o=t)})),Z(o),F(e)}function ne(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,d.KE)()&&!a&&(0,h.QV)(),(0,g.B6)(e)||(0,g.WJ)(e))return t||n||(async()=>{(0,l.wh)(e),(0,m.Tc)(W,i.Xh,i.pR),(0,u.H4)(e.event_id,e.products,"homepage","carousel")})(),void Z(e.index);const r=20;var{status:c,bannerText:p,timeToStartInMins:v}=s.Z.getEventStatus(e);v<=r&&c.name!==o.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):Z(e.index)}function ae(e){return(0,y.jsx)(y.Fragment,{})}return G&&!ee&&(ee=function(e){var t=e.reduce(((e,t,n)=>{var a=t.storyset_id;return a in e?(e[a].total_events=e[a].total_events+1,e[a].events.push(t)):e[a]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(K)),(0,r.useEffect)((()=>{k&&V==(0,f.zv)(z)&&(null!=N&&G?ee.forEach(((e,t)=>{N==e.id&&te(t,!0,R)})):null!=R&&A.forEach(((e,t)=>{R==e.event_id&&ne(e,!0)})))}),[]),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{style:{marginTop:(G?P:D)+"px",marginBottom:(G?P:D)+"px"},children:"template-b"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(w,{events:K,onClick:ne,heading:e.heading})}):"template-a-1"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(E,{events:K,onClick:ne,heading:e.heading})}):"template-feed-a"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(C,{events:K,onClick:ne,heading:e.heading})}):"template-collections-a"===V||"template-c"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(T,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-b"===V||"template-d"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(x,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-c"===V||"template-e"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(_,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-d"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(w,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-e"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(L,{events:K,onClick:ne,heading:e.heading})})}):"template-f"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(O,{events:K,onClick:ne,heading:e.heading})})}):"template-banner-a"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.BANNER_WIDGET_VIEW,event:A[0],triggerFlag:!t&&!n,children:(0,y.jsx)(b,{events:A})})}):G?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.STORIES_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(j,{eventsStories:ee,onClick:te,template:V})})}):(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(L,{events:K,onClick:ne,heading:e.heading})})})}),-1==U?(0,y.jsx)(ae,{}):(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.EVENT_VIEW,event:A[U],productList:A[U].products,cta:A[U].cta,triggerFlag:!t&&!n,children:(0,y.jsx)(M,{events:K,index:U,onBack:function(e){(0,c.n2L)(W)&&(0,a.MO)("whatmoreAddedToCart")&&(0,p.D)(W,(()=>{}),100,window.location.hostname),Z(-1)},slideDirection:G||"horizontal"===(0,c.e8z)(W)?"horizontal":"vertical",eventsStories:ee,initialStoryIndex:q,template:V})})})]})};const P=function(e,t,n){const r=(0,a.MO)("whatmoreShopId");var i=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),o=Object.keys(i);if("60960964855"==r&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var s={};fera.getRatings(o,(e=>{new Promise(((t,n)=>{e.forEach((e=>{s[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(s)})).then((e=>n(e)))}))}if("23114481744"==r){const e="1e6MQXxzYR19mpw9Km6Dcm86";s={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+o.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{s[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),s))).then((e=>n(e))).catch((e=>console.error(e)))}};var G=n(3388),W=n(7381),V=n(7376),k=n(7008);var z=function(e){const[t,n]=(0,r.useState)(),[o,s]=(0,r.useState)(),{whatmoreIsStoriesTemplate:l}=(0,r.useContext)(v.I),{whatmoreIsCollectionsTemplate:m}=(0,r.useContext)(v.I),{whatmoreIsBannerTemplate:p}=(0,r.useContext)(v.I),[g]=(0,a.j1)("whatmoreShopId"),[I]=(0,a.j1)("whatmoreCollectionId"),w=(0,a.MO)("whatmoreLandingLocationType"),E=(0,a.MO)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:T}=(0,r.useContext)(v.I),{whatmoreCollectionUrl:x}=(0,r.useContext)(v.I),_=(0,c.cZT)(g)?(0,c._uv)(g)?x:window.location.href.split(/[?#]/)[0]:I,[j,M]=(0,a.j1)("productRatings"),[L,O]=(0,r.useState)(!1);var C=(0,c.efR)(g)?i.Dm+"/v2/events/":i.Gc+"/v2/events/",b=(0,c.efR)(g)?i.Dm+"/get_eventset/":i.Gc+"/get_eventset/",z=(0,c.efR)(g)?i.Dm+"/v2/collection":i.Gc+"/v2/collection",N=(0,c.efR)(g)?i.Dm+"/v2/brand/"+g+"/product-events":i.Gc+"/v2/brand/"+g+"/product-events",R=e.shopId,U="live,upcoming";return(0,r.useEffect)((()=>{(0,u.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,k.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,r.useEffect)((()=>{null==t||0==t.length||o||!(0,d.KE)()||(0,a.MO)("whatmoreVideoPlayerPoolInitiated")||(0,h.b5)(h.UD)}),[t]),(0,r.useEffect)((()=>{var e;if(w.startsWith("product")){var t=(0,a.MO)("whatmoreProductId");t=(0,c.iXA)(g)?function(e){return e.split(/[?#]/)[0]}(window.location.href):t,e=N.toString()+"?client_product_id="+t.toString()+"&status="+U.toString()+"&event_type=video"}else if(m||"invalid-url"!==x)e=z.toString()+"?store_id="+R.toString()+"&client_collection_id="+_;else if(p){const t=f.ls,n=(0,f.H1)(w);e=b.toString()+R.toString()+"?eventset_type="+t+"&source="+n+"&source_id="+g}else e=C.toString()+R.toString()+"?status="+U.toString()+"&is_active="+"true".toString()+(l?"&template_type=stories":"");fetch(e).then((e=>e.json())).then((e=>{if(p){const t=f.ls;return(0,G.OC)(e,t)}return(0,G.kW)(e,m||"invalid-url"!==x)})).then((e=>(E&&console.debug("initial received events size : "+e.length),l||p?e:(0,G.e8)(e,R)))).then((e=>(null!=e&&0!=e.length&&(0,c.LUY)(g)&&function(e,t,n){const r=setInterval((()=>{null===(0,a.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(r)}),1e4)}(g,e,(e=>{M(e)})),e))).then((e=>{null==e||0==e.length||l||p||(0,c.NOv)(R,e),n(e),O(!0)})).catch((e=>{s(e.message)}))}),[]),(0,r.useEffect)((()=>{"index"===w?t&&t.length>0&&(0,V.PB)({userInteractionType:S.K.HOMEPAGE_VISITED,widgetSourceDetails:T}):"collection"===w&&(t&&t.length>0||(0,c.miB)(g))&&(0,V.PB)({userInteractionType:S.K.COLLECTION_PAGE_VISITED,widgetSourceDetails:T})}),[t]),(L&&(null==t||0==t.length)||o)&&v.$.forEach((e=>{var t,n,a,r;const i=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-stories-a"]'),o=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-b"]'),s=null!==(a=e.querySelector('.whatmore-template-type[data-wh="template-collections-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]'))&&void 0!==a?a:e.querySelector('.whatmore-template-type[data="template-collections-a"]')||e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-collections-c"]'),l=null!==(r=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==r?r:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e.querySelector(".whatmore-render-root");(l||s||o||i)&&(o&&c||i&&c||l&&c||s&&c)&&(c.style.minHeight="0px")})),null==t||0==t.length||o?(0,y.jsx)("div",{}):(E&&(0,W.EI)(t),function(e){if(null!=e){var t=0;e.forEach((e=>{e.index=t++}))}}(t),E&&console.debug("final transformed events data : "+JSON.stringify(t)),E&&console.debug("valid events size : "+t.length),(0,y.jsx)("div",{children:(0,y.jsx)(D,{heading:e.heading,events:t})},"whatmore-main-coponent"))},N=n(3933);var R=function(e){const[t]=(0,a.j1)("isInDesignMode"),[n]=(0,a.j1)("isDemoBrand"),[o]=(0,a.j1)("whatmoreShopId"),[s]=(0,a.j1)("whatmoreHeading"),[l,u]=(0,r.useState)(["initial",window.pageYOffset]),[d,h]=(0,r.useState)(!1),p=(0,a.MO)("isLandingSharedLink");(0,r.useEffect)((()=>{if((0,m.ll)(o),!(0,c.wc0)(o))return;let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;var a,r;Math.abs(n-e)<100?t=!1:(r=!0,u(a=[n>e?"scrolled-down":"scrolled-up",n]),a[1]>100&&h(r),e=n>0?n:0,t=!1)},a=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)}),[]);const[v,g,f]=(0,N.YD)({triggerOnce:!0});return(0,y.jsx)("div",{ref:v,children:d||g||p||!(0,c.wc0)(o)?(0,y.jsx)("div",{children:t||n?(0,y.jsx)("div",{children:(0,y.jsx)(z,{heading:s,shopId:i.aA})}):(0,y.jsx)("div",{children:(0,y.jsx)(z,{heading:s,shopId:o})})}):(0,y.jsx)(y.Fragment,{})})}},499:function(e,t){t.Z={LIVE:{name:"LIVE",color:"gray.600"},UPCOMING:{name:"UPCOMING",color:"gray.600"},DEFAULT:{name:"LIVE EVENT",color:"gray.600"},COMPLETED:{name:"ENDED",color:"gray.600"}}},4897:function(e,t,n){var a=n(499);t.Z=class{static getEventStatus(e){e.time_zone="GMT+5:30";var t=e.start_time+":00",n=e.end_time,r=e.scheduled_date,i=e.status,o=e.time_zone;if(i.toUpperCase()==a.Z.LIVE.name)return{status:a.Z.LIVE,bannerText:" "+a.Z.LIVE.name+" ",timeToStartInMins:0};if(i.toUpperCase()==a.Z.UPCOMING.name){var s=new Date(r+" "+t+" "+o),l=(new Date(r+" "+n+" "+o),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,r=n/60,i=r/60,o=i/24;return n<=0?{status:a.Z.COMPLETED,bannerText:" "+a.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:a.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:r<60?{status:a.Z.UPCOMING,bannerText:"Starts in "+Math.round(r)+" min ",timeToStartInMins:r}:i<24?{status:a.Z.UPCOMING,bannerText:"Starts in "+Math.round(i)+" hr ",timeToStartInMins:60*i}:o<7?{status:a.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*o*24}:{status:a.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(s));return{status:l.status,bannerText:l.bannerText,timeToStartInMins:l.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:a.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},3388:function(e,t,n){n.d(t,{OC:function(){return s},e8:function(){return i},kT:function(){return a},kW:function(){return o},xg:function(){return r}});const a=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},r=function(e,t){return!(void 0==e.products||0==e.products.length)},i=function(e,t){if(null!=e)return e.filter((e=>1==a(e)))},o=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 s=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const a=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return a?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(a):[]}},7376:function(e,t,n){n.d(t,{GF:function(){return r},PB:function(){return s},Z2:function(){return i},y4:function(){return o}});var a=n(733);function r(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}function i(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[972],{3972:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var a=n(7753),r=n(7313),i=n(2860),o=n(499),s=n(4897),l=n(5160),c=n(9854),u=n(6967),d=n(8984),h=n(58),m=n(4669),p=n(941),v=n(9039),g=n(7300),f=n(6524),I=n(7643),S=n(778),y=n(6417);const w=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(303),n.e(891)]).then(n.bind(n,4095)))),E=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(364),n.e(530)]).then(n.bind(n,5523)))),T=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(358)]).then(n.bind(n,3827)))),x=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(607)]).then(n.bind(n,6071)))),_=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(708)]).then(n.bind(n,1291)))),j=r.lazy((()=>Promise.all([n.e(302),n.e(580)]).then(n.bind(n,3580)))),M=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(790)]).then(n.bind(n,4209)))),L=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(210),n.e(926),n.e(950),n.e(959)]).then(n.bind(n,4048)))),O=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(926),n.e(950),n.e(303),n.e(554)]).then(n.bind(n,9085)))),C=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(367),n.e(240),n.e(576),n.e(950),n.e(303),n.e(364),n.e(67)]).then(n.bind(n,4362)))),b=r.lazy((()=>Promise.all([n.e(302),n.e(819),n.e(13),n.e(240),n.e(576),n.e(210),n.e(955),n.e(926),n.e(303),n.e(209),n.e(196)]).then(n.bind(n,4658))));var D=function(e){const[t]=(0,a.j1)("isInDesignMode"),[n]=(0,a.j1)("isDemoBrand"),[D]=(0,a.j1)("whatmoreTopBottomPadding"),[P]=(0,a.j1)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:G}=(0,r.useContext)(v.I),[W]=(0,a.j1)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:V}=(0,r.useContext)(v.I),k=(0,a.MO)("isLandingSharedLink"),q=(0,a.MO)("whatmoreShareTemplateId"),z=(0,a.MO)("whatmoreShareStoryId"),N=(0,a.MO)("whatmoreShareEventId"),[R,U]=(0,r.useState)(-1),[Z,F]=(0,r.useState)(null);let A=e.events,K=[];if("template-banner-a"!==V){let e=0;for(let t=0;t<(null===A||void 0===A?void 0:A.length);t++){var B,H,Y,J;const n=(null===A||void 0===A||null===(B=A[t])||void 0===B||null===(H=B.products)||void 0===H?void 0:H.length)>0&&(null===A||void 0===A||null===(Y=A[t])||void 0===Y||null===(J=Y.products)||void 0===J?void 0:J.every((e=>"oos"===(null===e||void 0===e?void 0:e.product_status))));if(!(0,g.B6)(A[t])&&!(0,g.WJ)(A[t])||n){if((0,g.yC)(null===A||void 0===A?void 0:A[t])){var{status:X,bannerText:Q,timeToStartInMins:$}=s.Z.getEventStatus(A[t]);X.name===o.Z.LIVE.name&&(K.push({...null===A||void 0===A?void 0:A[t],index:e}),e++)}}else K.push({...null===A||void 0===A?void 0:A[t],index:e}),e++}}var ee=null;function te(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,d.KE)()&&!a&&(0,h.QV)(),t||n||(async()=>{const t=ee[e].events[0];(0,l.wh)(t),(0,m.Tc)(W,i.Xh,i.OW),(0,u.H4)(t.event_id,t.products,"homepage","stories")})();var o=0;null!=r&&ee[e].events.map(((e,t)=>{e.event_id==r&&(o=t)})),U(o),F(e)}function ne(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,d.KE)()&&!a&&(0,h.QV)(),(0,g.B6)(e)||(0,g.WJ)(e))return t||n||(async()=>{(0,l.wh)(e),(0,m.Tc)(W,i.Xh,i.pR),(0,u.H4)(e.event_id,e.products,"homepage","carousel")})(),void U(e.index);const r=20;var{status:c,bannerText:p,timeToStartInMins:v}=s.Z.getEventStatus(e);v<=r&&c.name!==o.Z.LIVE.name?console.debug(" TODO : show toast on upcoming live event."):U(e.index)}function ae(e){return(0,y.jsx)(y.Fragment,{})}return G&&!ee&&(ee=function(e){var t=e.reduce(((e,t,n)=>{var a=t.storyset_id;return a in e?(e[a].total_events=e[a].total_events+1,e[a].events.push(t)):e[a]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,events:[t]},e}),{}),n=Object.values(t);return n.sort(((e,t)=>e.start_event_index-t.start_event_index)),n}(K)),(0,r.useEffect)((()=>{k&&V==(0,f.zv)(q)&&(null!=z&&G?ee.forEach(((e,t)=>{z==e.id&&te(t,!0,N)})):null!=N&&A.forEach(((e,t)=>{N==e.event_id&&ne(e,!0)})))}),[]),(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{style:{marginTop:(G?P:D)+"px",marginBottom:(G?P:D)+"px"},children:"template-b"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(w,{events:K,onClick:ne,heading:e.heading})}):"template-a-1"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(E,{events:K,onClick:ne,heading:e.heading})}):"template-feed-a"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(C,{events:K,onClick:ne,heading:e.heading})}):"template-collections-a"===V||"template-c"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(T,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-b"===V||"template-d"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(x,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-c"===V||"template-e"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.COLLECTION_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(_,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-d"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(w,{events:K,onClick:ne,heading:e.heading})})}):"template-collections-e"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(L,{events:K,onClick:ne,heading:e.heading})})}):"template-f"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(O,{events:K,onClick:ne,heading:e.heading})})}):"template-banner-a"===V?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.BANNER_WIDGET_VIEW,event:A[0],triggerFlag:!t&&!n,children:(0,y.jsx)(b,{events:A})})}):G?(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.STORIES_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(j,{eventsStories:ee,onClick:te,template:V})})}):(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!t&&!n,children:(0,y.jsx)(L,{events:K,onClick:ne,heading:e.heading})})})}),-1==R?(0,y.jsx)(ae,{}):(0,y.jsx)(r.Suspense,{children:(0,y.jsx)(I.u,{userInteractionType:S.K.EVENT_VIEW,event:A[R],productList:A[R].products,cta:A[R].cta,triggerFlag:!t&&!n,children:(0,y.jsx)(M,{events:K,index:R,onBack:function(e){(0,c.n2L)(W)&&(0,a.MO)("whatmoreAddedToCart")&&(0,p.D)(W,(()=>{}),100,window.location.hostname),U(-1)},slideDirection:G||"horizontal"===(0,c.e8z)(W)?"horizontal":"vertical",eventsStories:ee,initialStoryIndex:Z,template:V})})})]})};const P=function(e,t,n){const r=(0,a.MO)("whatmoreShopId");var i=t.reduce(((e,t,n)=>(t.products.map((e=>e.client_product_id)).forEach((t=>{t in e||(e[t]=!0)})),e)),{}),o=Object.keys(i);if("60960964855"==r&&"undefined"!=typeof fera&&"function"===typeof fera.getRatings){var s={};fera.getRatings(o,(e=>{new Promise(((t,n)=>{e.forEach((e=>{s[e.external_product_id]={avgRating:e.average,totalRatings:e.count}})),t(s)})).then((e=>n(e)))}))}if("23114481744"==r){const e="1e6MQXxzYR19mpw9Km6Dcm86";s={};fetch("https://api.juniphq.com/v1/products?filter[remote_ids]="+o.toString(),{headers:{"Junip-Store-Key":e}}).then((e=>e.json())).then((e=>(e.products.forEach((e=>{s[e.remote_id]={avgRating:parseFloat(e.rating_average).toFixed(1),totalRatings:e.rating_count}})),s))).then((e=>n(e))).catch((e=>console.error(e)))}};var G=n(3388),W=n(7381),V=n(7376),k=n(7008);var q=function(e){const[t,n]=(0,r.useState)(),[o,s]=(0,r.useState)(),{whatmoreIsStoriesTemplate:l}=(0,r.useContext)(v.I),{whatmoreIsCollectionsTemplate:m}=(0,r.useContext)(v.I),{whatmoreIsBannerTemplate:p}=(0,r.useContext)(v.I),[g]=(0,a.j1)("whatmoreShopId"),[I]=(0,a.j1)("whatmoreCollectionId"),w=(0,a.MO)("whatmoreLandingLocationType"),E=(0,a.MO)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:T}=(0,r.useContext)(v.I),{whatmoreCollectionUrl:x}=(0,r.useContext)(v.I),_=(0,c.cZT)(g)?(0,c._uv)(g)?x:window.location.href.split(/[?#]/)[0]:I,[j,M]=(0,a.j1)("productRatings"),[L,O]=(0,r.useState)(!1);var C=(0,c.efR)(g)?i.Dm+"/v2/events/":i.Gc+"/v2/events/",b=(0,c.efR)(g)?i.Dm+"/get_eventset/":i.Gc+"/get_eventset/",q=(0,c.efR)(g)?i.Dm+"/v2/collection":i.Gc+"/v2/collection",z=(0,c.efR)(g)?i.Dm+"/v2/brand/"+g+"/product-events":i.Gc+"/v2/brand/"+g+"/product-events",N=e.shopId,R="live,upcoming";return(0,r.useEffect)((()=>{(0,u.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,k.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,r.useEffect)((()=>{null==t||0==t.length||o||!(0,d.KE)()||(0,a.MO)("whatmoreVideoPlayerPoolInitiated")||(0,h.b5)(h.UD)}),[t]),(0,r.useEffect)((()=>{var e;if(w.startsWith("product")){var t=(0,a.MO)("whatmoreProductId");t=(0,c.iXA)(g)?function(e){return e.split(/[?#]/)[0]}(window.location.href):t,e=z.toString()+"?client_product_id="+t.toString()+"&status="+R.toString()+"&event_type=video"}else if(m||"invalid-url"!==x)e=q.toString()+"?store_id="+N.toString()+"&client_collection_id="+_;else if(p){const t=f.ls,n=(0,f.H1)(w);e=b.toString()+N.toString()+"?eventset_type="+t+"&source="+n+"&source_id="+g}else e=C.toString()+N.toString()+"?status="+R.toString()+"&is_active="+"true".toString()+(l?"&template_type=stories":"");fetch(e).then((e=>e.json())).then((e=>{if(p){const t=f.ls;return(0,G.OC)(e,t)}return(0,G.kW)(e,m||"invalid-url"!==x)})).then((e=>(E&&console.debug("initial received events size : "+e.length),l||p?e:(0,G.e8)(e,N)))).then((e=>(null!=e&&0!=e.length&&(0,c.LUY)(g)&&function(e,t,n){const r=setInterval((()=>{null===(0,a.MO)("productRatings")&&P(e,t,n)}),1e3);setTimeout((()=>{clearInterval(r)}),1e4)}(g,e,(e=>{M(e)})),e))).then((e=>{null==e||0==e.length||l||p||(0,c.NOv)(N,e),n(e),O(!0)})).catch((e=>{s(e.message)}))}),[]),(0,r.useEffect)((()=>{"index"===w?t&&t.length>0&&(0,V.PB)({userInteractionType:S.K.HOMEPAGE_VISITED,widgetSourceDetails:T}):"collection"===w&&(t&&t.length>0||(0,c.miB)(g))&&(0,V.PB)({userInteractionType:S.K.COLLECTION_PAGE_VISITED,widgetSourceDetails:T})}),[t]),(L&&(null==t||0==t.length)||o)&&v.$.forEach((e=>{var t,n,a,r;const i=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-stories-a"]'),o=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-b"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-e"]'),s=null!==(a=e.querySelector('.whatmore-template-type[data-wh="template-collections-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]'))&&void 0!==a?a:e.querySelector('.whatmore-template-type[data="template-collections-a"]')||e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-collections-c"]'),l=null!==(r=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==r?r:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e.querySelector(".whatmore-render-root");(l||s||o||i)&&(o&&c||i&&c||l&&c||s&&c)&&(c.style.minHeight="0px")})),null==t||0==t.length||o?(0,y.jsx)("div",{}):(E&&(0,W.EI)(t),function(e){if(null!=e){var t=0;e.forEach((e=>{e.index=t++}))}}(t),E&&console.debug("final transformed events data : "+JSON.stringify(t)),E&&console.debug("valid events size : "+t.length),(0,y.jsx)("div",{children:(0,y.jsx)(D,{heading:e.heading,events:t})},"whatmore-main-coponent"))},z=n(3933);var N=function(e){const[t]=(0,a.j1)("isInDesignMode"),[n]=(0,a.j1)("isDemoBrand"),[o]=(0,a.j1)("whatmoreShopId"),[s]=(0,a.j1)("whatmoreHeading"),[l,u]=(0,r.useState)(["initial",window.pageYOffset]),[d,h]=(0,r.useState)(!1),p=(0,a.MO)("isLandingSharedLink");(0,r.useEffect)((()=>{if((0,m.ll)(o),!(0,c.wc0)(o))return;let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;var a,r;Math.abs(n-e)<100?t=!1:(r=!0,u(a=[n>e?"scrolled-down":"scrolled-up",n]),a[1]>100&&h(r),e=n>0?n:0,t=!1)},a=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)}),[]);const[v,g,f]=(0,z.YD)({triggerOnce:!0});return(0,y.jsx)("div",{ref:v,children:d||g||p||!(0,c.wc0)(o)?(0,y.jsx)("div",{children:t||n?(0,y.jsx)("div",{children:(0,y.jsx)(q,{heading:s,shopId:i.aA})}):(0,y.jsx)("div",{children:(0,y.jsx)(q,{heading:s,shopId:o})})}):(0,y.jsx)(y.Fragment,{})})}},499:function(e,t){t.Z={LIVE:{name:"LIVE",color:"gray.600"},UPCOMING:{name:"UPCOMING",color:"gray.600"},DEFAULT:{name:"LIVE EVENT",color:"gray.600"},COMPLETED:{name:"ENDED",color:"gray.600"}}},4897:function(e,t,n){var a=n(499);t.Z=class{static getEventStatus(e){e.time_zone="GMT+5:30";var t=e.start_time+":00",n=e.end_time,r=e.scheduled_date,i=e.status,o=e.time_zone;if(i.toUpperCase()==a.Z.LIVE.name)return{status:a.Z.LIVE,bannerText:" "+a.Z.LIVE.name+" ",timeToStartInMins:0};if(i.toUpperCase()==a.Z.UPCOMING.name){var s=new Date(r+" "+t+" "+o),l=(new Date(r+" "+n+" "+o),function(e){var t=new Date,n=(e.getTime()-t.getTime())/1e3,r=n/60,i=r/60,o=i/24;return n<=0?{status:a.Z.COMPLETED,bannerText:" "+a.Z.COMPLETED.name+" ",timeToStartInMins:0}:n>=1&&n<=30?{status:a.Z.UPCOMING,bannerText:"Starts in "+Math.round(n)+" sec ",timeToStartInMins:n/60}:r<60?{status:a.Z.UPCOMING,bannerText:"Starts in "+Math.round(r)+" min ",timeToStartInMins:r}:i<24?{status:a.Z.UPCOMING,bannerText:"Starts in "+Math.round(i)+" hr ",timeToStartInMins:60*i}:o<7?{status:a.Z.UPCOMING,bannerText:" "+["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()]+" ",timeToStartInMins:60*o*24}:{status:a.Z.UPCOMING,bannerText:"Upcoming",timeToStartInMins:2880}}(s));return{status:l.status,bannerText:l.bannerText,timeToStartInMins:l.timeToStartInMins}}return console.error("invalid status for event :: id : "+e.event_id+", status : "+e.status),{status:a.Z.DEFAULT,bannerText:"live event",timeToStartInMins:2880}}}},3388:function(e,t,n){n.d(t,{OC:function(){return s},e8:function(){return i},kT:function(){return a},kW:function(){return o},xg:function(){return r}});const a=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},r=function(e,t){return!(void 0==e.products||0==e.products.length)},i=function(e,t){if(null!=e)return e.filter((e=>1==a(e)))},o=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 s=function(e,t){var n;if(null==e)return[];if(!("eventsets"in e))return[];const a=null!==(n=e.eventsets[t])&&void 0!==n?n:null;return a?function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach((e=>{e.events.forEach((e=>{t.push(e)}))})),t}(a):[]}},7376:function(e,t,n){n.d(t,{GF:function(){return r},PB:function(){return s},Z2:function(){return i},y4:function(){return o}});var a=n(733);function r(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}function i(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s}=e;(0,a.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:r,event:i,productList:o,ctaList:s})}}}]);
|