whatmore-react-assets 1.0.1744 → 1.0.1746

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatmore-react-assets",
3
- "version": "1.0.1744",
3
+ "version": "1.0.1746",
4
4
  "description": "public repo for all whatmore js and css assets",
5
5
  "main": "whatmore.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1019:function(e,t,n){n.d(t,{B:function(){return a}});var i=n(1348),o=n(964);function a(e){return`${(0,i.jpW)(e)?o.$$:o.MT}/v2/brand/${e}/product-events/recommendation/cdn`}},1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return p},DG:function(){return d}});var i=n(1348),o=n(3330),a=n(6157);function l(e,t,n={},i){var o;const l=s[e];if(!l)return;const r=l.isActionEnabled(),c=null===i||void 0===i||null===(o=i.meta_actions)||void 0===o?void 0:o[l.customAction];(r||c)&&"function"==typeof fbq&&(async()=>{const i={id:null===t||void 0===t?void 0:t.client_product_id,product_url:null===t||void 0===t?void 0:t.product_link,...e===a.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",l.action,i),c&&setTimeout(()=>{null===c||void 0===c||c.forEach(e=>{fbq("trackCustom",e,i)})},500)})()}var r=n(7145);const s={[a.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[a.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[a.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[a.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[a.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[a.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(u=null===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:t.video_duration>0?Math.ceil(t.watch_time/t.video_duration*100):"NA",product_name:null!==(u=null===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}){var c,d,u;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}),e in s)&&(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(c=null===a||void 0===a||null===(d=a[1])||void 0===d?void 0:d.title)&&void 0!==c?c:null===a||void 0===a||null===(u=a[0])||void 0===u?void 0:u.title})}function p({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a}){(0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});var i=n(9950),o=n(964),a=n(140),l=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),p=n(2039),m=n(4833),v=n(2979),h=n(6157),_=n(8945),g=n(9821),y=n(4414);const S=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(340),n.e(571),n.e(987),n.e(411),n.e(261),n.e(665)]).then(n.bind(n,5213))),w=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(607),n.e(571),n.e(620),n.e(116)]).then(n.bind(n,7144))),I=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(423)]).then(n.bind(n,517))),E=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(412)]).then(n.bind(n,7646))),T=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(221)]).then(n.bind(n,5451))),x=i.lazy(()=>Promise.all([n.e(283),n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295))),f=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(142),n.e(620),n.e(474)]).then(n.bind(n,6945))),O=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(184),n.e(571),n.e(987),n.e(411),n.e(688),n.e(485)]).then(n.bind(n,4431))),C=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369))),j=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(142),n.e(891)]).then(n.bind(n,7178))),D=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(142),n.e(306)]).then(n.bind(n,9406))),b=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(571),n.e(987),n.e(411),n.e(497)]).then(n.bind(n,3795))),L=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(340),n.e(571),n.e(987),n.e(411),n.e(688),n.e(261),n.e(933)]).then(n.bind(n,6989))),A=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(744),n.e(571),n.e(987),n.e(411),n.e(688),n.e(806)]).then(n.bind(n,3278))),P=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596))),q=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(571),n.e(987),n.e(411),n.e(688),n.e(906)]).then(n.bind(n,4688))),W=i.lazy(()=>n.e(374).then(n.bind(n,5100)));var k=function(e){var t,k;const[G]=(0,l.QN)("isInDesignMode"),[$]=(0,l.QN)("isDemoBrand"),[N]=(0,l.QN)("whatmoreTopBottomPadding"),[V]=(0,l.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:B}=(0,i.useContext)(u.B),[M]=(0,l.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:F}=(0,i.useContext)(u.B),z=(0,l.Xd)("isLandingSharedLink"),R=(0,l.Xd)("whatmoreShareTemplateId"),H=(0,l.Xd)("whatmoreShareStoryId"),K=(0,l.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:U,whatmoreUserInfo:J}=(0,i.useContext)(u.B),Q=z&&F===(0,m.Mm)(R),[X,Y]=(0,i.useState)(Q),[Z,ee]=(0,i.useState)(-1),[te,ne]=(0,i.useState)(null);let ie=e.events;const oe=e.allEvents;var ae=null;B&&!ae&&(ae=function(e){var t=e.reduce((e,t,n)=>{var i,o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,storyset_dynamic_thumbnail:null!==(i=null===t||void 0===t?void 0:t.storyset_dynamic_thumbnail)&&void 0!==i&&i,events:[t]},e},{}),n=Object.values(t);return n.sort((e,t)=>e.start_event_index-t.start_event_index),n}(ie));const le=U.landingLocationType,re=U.templateType;function se(e,t=!1,i=null){(0,c.MN)()&&(0,g._)()&&!t&&(0,d.bo)(),G||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=ae[e].events[0],r=(0,m.Wd)(le)+(0,m.gf)(re)+(null!==l&&void 0!==l&&l.isRelatedEvent?"R":"E")+"_"+(null===l||void 0===l?void 0:l.event_id);(0,a.lB)(l),i(M,o.TB,o.OL),(0,s.Ch)(l.event_id,l.products,"homepage","stories",r,null===l||void 0===l?void 0:l.location,null===J||void 0===J?void 0:J.userType)})();var l=0;null!=i&&ae[e].events.map((e,t)=>{e.event_id==i&&(l=t)}),ee(l),ne(e)}async function ce(e,t=!1){(0,c.MN)()&&(0,g._)()&&!t&&await(0,d.bo)(),ee(e.index),((0,p.ij)(e)||(0,p.Il)(e))&&(G||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=(0,m.Wd)(le)+(0,m.gf)(re)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,a.lB)(e),i(M,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",l)})())}function de(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)(()=>{if(Q)if((0,_.H)("whatmore-video-player",()=>{Y(!1)}),null!=H&&B){const e=ae.find(e=>H==e.id);if(e)return void se(ae.indexOf(e),!0,K)}else if(null!=K){const e=ie.find(e=>K==e.event_id);if(e)return void ce(e,!0)}},[]),(0,y.jsxs)(y.Fragment,{children:[X&&(0,y.jsx)(W,{}),-1==Z||-2==Z?(0,y.jsx)(de,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.EVENT_VIEW,event:ie[Z],productList:null===(t=ie[Z])||void 0===t?void 0:t.products,cta:null===(k=ie[Z])||void 0===k?void 0:k.cta,triggerFlag:!G&&!$,children:(0,y.jsx)(q,{events:oe,index:Z,onBack:async function(){ee(-1),Y(!1)},slideDirection:B||"horizontal"===(0,r.br0)(M)?"horizontal":"vertical",eventsStories:ae,initialStoryIndex:te,template:F})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(B?V:N)+"px",marginBottom:(B?V:N)+"px"},children:"template-b"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(S,{events:ie,onClick:ce,heading:e.heading})})}):"template-a-1"===F||"template-collections-a-1"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:ie,onClick:ce,heading:e.heading})}):"template-feed-a"===F||"template-collections-feed-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(L,{events:ie,onClick:ce,heading:e.heading})}):"template-collections-a"===F||"template-c"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(I,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-b"===F||"template-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(E,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-c"===F||"template-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(T,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(S,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(f,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-stories"===F||"template-stories"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(P,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-f"===F||"template-collections-f"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(O,{events:ie,onClick:ce,heading:e.heading})})}):"template-g"===F||"template-collections-g"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(C,{events:ie,onClick:ce,heading:e.heading})})}):"template-h"===F||"template-collections-h"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(j,{events:ie,onClick:ce,heading:e.heading})})}):"template-i"===F||"template-collections-i"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(D,{index:Z,events:ie,onClick:ce,heading:e.heading})})}):"template-j"===F||"template-collections-j"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(b,{events:ie,onClick:ce,heading:e.heading})})}):"template-banner-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ie[0],triggerFlag:!G&&!$,children:(0,y.jsx)(A,{events:ie})})}):B?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(x,{eventsStories:ae,onClick:se,template:F})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(f,{events:ie,onClick:ce,heading:e.heading})})})})]})},G=n(7802),$=n(6641),N=n(1351),V=n(5873),B=n(1019);function M(e){return e.split(/[?#]/)[0]}function F(e){return e.split(/[?#]/)[0]}var z=function(e){const[t,a]=(0,i.useState)(),[p,v]=(0,i.useState)(),[_,S]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:E}=(0,i.useContext)(u.B),[T]=(0,l.QN)("whatmoreShopId"),{whatmoreCollectionId:x}=(0,i.useContext)(u.B),f=(0,l.Xd)("whatmoreLandingLocationType"),O=(0,l.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:j,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),b=(0,l.Xd)("whatmoreCollectionUrl"),[L]=(0,l.QN)("isInDesignMode"),[A]=(0,l.QN)("isDemoBrand"),P="19506115"==T?"343270603":(0,r.mJ$)(T)?(0,r.jLA)(T)?b:M(window.location.href):x||M(window.location.href),[q,W]=(0,l.QN)("productRatings"),[z,R]=(0,i.useState)(!1);var H=(0,r.SOt)(T)?o.aD+"/v2/events/":o.$$+"/v2/events/",K=(0,r.SOt)(T)?o.aD+"/v3/events/":o.$$+"/v3/events/",U=(0,r.SOt)(T)?o.aD+"/v4/events/":o.$$+"/v4/events/",J=(0,r.SOt)(T)?o.aD+"/v5/events/":o.$$+"/v5/events/",Q=((0,r.SOt)(T)?o.aD:o.$$,(0,r.SOt)(T)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),X=(0,r.SOt)(T)?o.aD+"/v2/collection":o.$$+"/v2/collection",Y=(0,r.SOt)(T)?o.aD+"/v3/collection":o.$$+"/v3/collection",Z=(0,r.SOt)(T)?o.aD+"/v4/collection":o.$$+"/v4/collection",ee=((0,r.jpW)(T)?o.$$:o.MT)+"/v2/brand/"+T+"/product-events",te=e.shopId,ne="live,upcoming",ie="true";return(0,i.useEffect)(()=>{null!=t&&0!=t.length&&!_&&(0,c.MN)()&&!(0,l.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,g._)()&&(0,d.Pc)(d.F5)},[t]),(0,i.useEffect)(()=>{var e,t,i,o;if((0,s.wm)(),f.startsWith("product")){var c=(0,l.Xd)("whatmoreProductId");if(c=(0,r.BcY)(T)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e||"STRGZ9TGDEQ"==e||"STRJ2T2QPKI"==e?F(window.location.href).split("/").pop():F(window.location.href)}(T):c,(0,r.vvU)(T))o=H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(T)){o=`${o=(0,B.B)(T)}?client_product_id=${c}&limit=10&recommended=${!(0,r.buK)(T)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else o=ee.toString()+"?client_product_id="+c.toString()+"&status="+ne.toString()+"&event_type=video"}else if(I||"invalid-url"!==b)o=(0,r.JwJ)(T)?`${Y.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:"78232846646"==T?`${Z.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:`${X.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&1==(0,r.FKG)(T).length?(0,r.FKG)(T)[0]:P}`;else if(E){const e=m.Jh,t=(0,m.t6)(f);o=Q.toString()+te.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+T}else{var d,u,p,h;if(("72201044272"==T||"2665447536"==T&&D)&&!w)o=K.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+"&latitude="+(null!==(d=null===(u=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===u?void 0:u.latitude)&&void 0!==d?d:"")+"&longitude="+(null!==(p=null===(h=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===h?void 0:h.longitude)&&void 0!==p?p:"")+"&user_type="+(null!==j&&void 0!==j&&j.userType?"olduser":"newuser");else o=(0,r.JwJ)(T)&&!w?U.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString():"78232846646"!=T||w?H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":""):J.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()}const _=null===(e=window)||void 0===e||null===(t=e.whatmore)||void 0===t||null===(i=t.storyEvents)||void 0===i?void 0:i.events;w&&f.startsWith("index")&&"object"==typeof _&&(null===_||void 0===_?void 0:_.length)>0?(a(_),v(_),R(!0)):fetch(o).then(e=>e.json()).then(e=>{var t;if(E){const t=m.Jh;return(0,G.Po)(e,t)}return(0,r.JwJ)(T)&&(null===e||void 0===e||null===(t=e.questions)||void 0===t?void 0:t.length)>0&&(null==localStorage.getItem("_whatmore_qview_index")&&localStorage.setItem("_whatmore_qview_index",0),(0,s.d3)(null===e||void 0===e?void 0:e.questions)),(0,G.Np)(e,I||"invalid-url"!==b)}).then(e=>{var t,n;O&&console.debug("initial received events size : "+e.length);let i=[...null===e||void 0===e?void 0:e.events,...null===e||void 0===e?void 0:e.all_events];i=(0,r.xku)(T)?(0,G.d8)(i):(0,G.Zf)(i),v(i);const o=null!==(t=null===e||void 0===e||null===(n=e.events)||void 0===n?void 0:n.length)&&void 0!==t?t:0;return i.slice(0,o)}).then(e=>{if((A||L)&&(null==e||e&&0==(null===e||void 0===e?void 0:e.length))){const e=async()=>{const{eventsData:e,storiesData:t,bannerData:i}=await n.e(365).then(n.bind(n,6018));a(w?t:E?i:e)};e()}else a(e);R(!0)}).catch(e=>{S(e.message),R(!0)})},[]),(0,i.useEffect)(()=>{"index"===f?t&&t.length>0&&(0,N.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===f?(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,N.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===f&&(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,N.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})},[t]),z&&(null==t||0==t.length||_)&&V.Sn.forEach(e=>{var t,n,i,o;const a=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"]'),l=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-feed-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-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-a-1"]')||e.querySelector('.whatmore-template-type[data-wh="template-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-h"]')||e.querySelector('.whatmore-template-type[data-wh="template-j"]'))&&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-stories"]')||e.querySelector('.whatmore-template-type[data="template-e"]')||e.querySelector('.whatmore-template-type[data="template-a-1"]')||e.querySelector('.whatmore-template-type[data="template-g"]')||e.querySelector('.whatmore-template-type[data="template-h"]')||e.querySelector('.whatmore-template-type[data="template-j"]'),r=null!==(i=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"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-d"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-h"]'))&&void 0!==i?i: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"]')||e.querySelector('.whatmore-template-type[data="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data="template-collections-e"]')||e.querySelector('.whatmore-template-type[data="template-collections-d"]')||e.querySelector('.whatmore-template-type[data="template-collections-f"]')||e.querySelector('.whatmore-template-type[data="template-collections-g"]')||e.querySelector('.whatmore-template-type[data="template-collections-h"]')||e.querySelector('.whatmore-template-type[data="template-collections-j"]'),s=null!==(o=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==o?o:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e;if(w){const t=e.querySelector(".whatmore-shimmer-stories");t&&(t.style.display="none")}else if(!I){const t=e.querySelector(".loading-skeleton-wrapper");t&&(t.style.display="none")}(s||r||l||a)&&(l&&c||a&&c||s&&c||r&&c)&&(c.style.minHeight="0px")}),null==t||0==t.length||_?(0,y.jsx)("div",{}):(O&&(0,$.xv)(t),O&&console.debug("final transformed events data : "+JSON.stringify(t)),O&&console.debug("valid events size : "+t.length),(0,y.jsx)(k,{heading:e.heading,events:t,allEvents:p}))}},8945:function(e,t,n){function i(e,t){let n=0;let i=new MutationObserver(function(){document.querySelector("."+e)?(t(),i.disconnect()):0==n&&(n=1,setTimeout(()=>{t(),i.disconnect()},8e3))});i.observe(document.body,{childList:!0,subtree:!0})}n.d(t,{H:function(){return i}})}}]);
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1019:function(e,t,n){n.d(t,{B:function(){return a}});var i=n(1348),o=n(964);function a(e){return`${(0,i.jpW)(e)?o.$$:o.MT}/v2/brand/${e}/product-events/recommendation/cdn`}},1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return p},DG:function(){return d}});var i=n(1348),o=n(3330),a=n(6157);function l(e,t,n={},i){var o;const l=s[e];if(!l)return;const r=l.isActionEnabled(),c=null===i||void 0===i||null===(o=i.meta_actions)||void 0===o?void 0:o[l.customAction];(r||c)&&"function"==typeof fbq&&(async()=>{const i={id:null===t||void 0===t?void 0:t.client_product_id,product_url:null===t||void 0===t?void 0:t.product_link,...e===a.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",l.action,i),c&&setTimeout(()=>{null===c||void 0===c||c.forEach(e=>{fbq("trackCustom",e,i)})},500)})()}var r=n(7145);const s={[a.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[a.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[a.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[a.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[a.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[a.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(u=null===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:t.video_duration>0?Math.ceil(t.watch_time/t.video_duration*100):"NA",product_name:null!==(u=null===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}){var c,d,u;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}),e in s)&&(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(c=null===a||void 0===a||null===(d=a[1])||void 0===d?void 0:d.title)&&void 0!==c?c:null===a||void 0===a||null===(u=a[0])||void 0===u?void 0:u.title})}function p({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a}){(0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});var i=n(9950),o=n(964),a=n(140),l=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),p=n(2039),m=n(4833),v=n(2979),h=n(6157),g=n(8945),_=n(9821),y=n(4414);const S=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(340),n.e(571),n.e(987),n.e(411),n.e(261),n.e(665)]).then(n.bind(n,5213))),w=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(607),n.e(571),n.e(620),n.e(116)]).then(n.bind(n,7144))),I=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(423)]).then(n.bind(n,517))),E=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(412)]).then(n.bind(n,7646))),T=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(221)]).then(n.bind(n,5451))),f=i.lazy(()=>Promise.all([n.e(283),n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295))),x=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(142),n.e(620),n.e(474)]).then(n.bind(n,6945))),O=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(184),n.e(571),n.e(987),n.e(411),n.e(688),n.e(485)]).then(n.bind(n,4431))),C=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369))),j=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(142),n.e(891)]).then(n.bind(n,7178))),D=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(142),n.e(306)]).then(n.bind(n,9406))),b=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(571),n.e(987),n.e(411),n.e(497)]).then(n.bind(n,3795))),L=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(340),n.e(571),n.e(987),n.e(411),n.e(688),n.e(261),n.e(933)]).then(n.bind(n,6989))),A=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(744),n.e(571),n.e(987),n.e(411),n.e(688),n.e(806)]).then(n.bind(n,3278))),P=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596))),q=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(571),n.e(987),n.e(411),n.e(688),n.e(906)]).then(n.bind(n,4688))),W=i.lazy(()=>n.e(374).then(n.bind(n,5100)));var k=function(e){var t,k;const[G]=(0,l.QN)("isInDesignMode"),[N]=(0,l.QN)("isDemoBrand"),[$]=(0,l.QN)("whatmoreTopBottomPadding"),[V]=(0,l.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:B}=(0,i.useContext)(u.B),[M]=(0,l.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:F}=(0,i.useContext)(u.B),z=(0,l.Xd)("isLandingSharedLink"),R=(0,l.Xd)("whatmoreShareTemplateId"),H=(0,l.Xd)("whatmoreShareStoryId"),K=(0,l.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:U,whatmoreUserInfo:J}=(0,i.useContext)(u.B),Q=z&&F===(0,m.Mm)(R),[X,Y]=(0,i.useState)(Q),[Z,ee]=(0,i.useState)(-1),[te,ne]=(0,i.useState)(null);let ie=e.events;const oe=e.allEvents;var ae=null;B&&!ae&&(ae=function(e){var t=e.reduce((e,t,n)=>{var i,o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,storyset_dynamic_thumbnail:null!==(i=null===t||void 0===t?void 0:t.storyset_dynamic_thumbnail)&&void 0!==i&&i,events:[t]},e},{}),n=Object.values(t);return n.sort((e,t)=>e.start_event_index-t.start_event_index),n}(ie));const le=U.landingLocationType,re=U.templateType;function se(e,t=!1,i=null){(0,c.MN)()&&(0,_._)()&&!t&&(0,d.bo)(),G||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=ae[e].events[0],r=(0,m.Wd)(le)+(0,m.gf)(re)+(null!==l&&void 0!==l&&l.isRelatedEvent?"R":"E")+"_"+(null===l||void 0===l?void 0:l.event_id);(0,a.lB)(l),i(M,o.TB,o.OL),(0,s.Ch)(l.event_id,l.products,"homepage","stories",r,null===l||void 0===l?void 0:l.location,null===J||void 0===J?void 0:J.userType)})();var l=0;null!=i&&ae[e].events.map((e,t)=>{e.event_id==i&&(l=t)}),ee(l),ne(e)}async function ce(e,t=!1){(0,c.MN)()&&(0,_._)()&&!t&&await(0,d.bo)(),ee(e.index),((0,p.ij)(e)||(0,p.Il)(e))&&(G||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=(0,m.Wd)(le)+(0,m.gf)(re)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,a.lB)(e),i(M,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",l)})())}function de(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)(()=>{if(Q)if((0,g.H)("whatmore-video-player",()=>{Y(!1)}),null!=H&&B){const e=ae.find(e=>H==e.id);if(e)return void se(ae.indexOf(e),!0,K)}else if(null!=K){const e=ie.find(e=>K==e.event_id);if(e)return void ce(e,!0)}},[]),(0,y.jsxs)(y.Fragment,{children:[X&&(0,y.jsx)(W,{}),-1==Z||-2==Z?(0,y.jsx)(de,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.EVENT_VIEW,event:ie[Z],productList:null===(t=ie[Z])||void 0===t?void 0:t.products,cta:null===(k=ie[Z])||void 0===k?void 0:k.cta,triggerFlag:!G&&!N,children:(0,y.jsx)(q,{events:oe,index:Z,onBack:async function(){ee(-1),Y(!1)},slideDirection:B||"horizontal"===(0,r.br0)(M)?"horizontal":"vertical",eventsStories:ae,initialStoryIndex:te,template:F})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(B?V:$)+"px",marginBottom:(B?V:$)+"px"},children:"template-b"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(S,{events:ie,onClick:ce,heading:e.heading})})}):"template-a-1"===F||"template-collections-a-1"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:ie,onClick:ce,heading:e.heading})}):"template-feed-a"===F||"template-collections-feed-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(L,{events:ie,onClick:ce,heading:e.heading})}):"template-collections-a"===F||"template-c"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(I,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-b"===F||"template-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(E,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-c"===F||"template-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(T,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-d"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(S,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-e"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(x,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-stories"===F||"template-stories"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(P,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-f"===F||"template-collections-f"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(O,{events:ie,onClick:ce,heading:e.heading})})}):"template-g"===F||"template-collections-g"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(C,{events:ie,onClick:ce,heading:e.heading})})}):"template-h"===F||"template-collections-h"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(j,{events:ie,onClick:ce,heading:e.heading})})}):"template-i"===F||"template-collections-i"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(D,{index:Z,events:ie,onClick:ce,heading:e.heading})})}):"template-j"===F||"template-collections-j"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(b,{events:ie,onClick:ce,heading:e.heading})})}):"template-banner-a"===F?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ie[0],triggerFlag:!G&&!N,children:(0,y.jsx)(A,{events:ie})})}):B?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(f,{eventsStories:ae,onClick:se,template:F})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(x,{events:ie,onClick:ce,heading:e.heading})})})})]})},G=n(7802),N=n(6641),$=n(1351),V=n(5873),B=n(1019);function M(e){return e.split(/[?#]/)[0]}function F(e){return e.split(/[?#]/)[0]}var z=function(e){const[t,a]=(0,i.useState)(),[p,v]=(0,i.useState)(),[g,S]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:E}=(0,i.useContext)(u.B),[T]=(0,l.QN)("whatmoreShopId"),{whatmoreCollectionId:f}=(0,i.useContext)(u.B),x=(0,l.Xd)("whatmoreLandingLocationType"),O=(0,l.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:j,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),b=(0,l.Xd)("whatmoreCollectionUrl"),[L]=(0,l.QN)("isInDesignMode"),[A]=(0,l.QN)("isDemoBrand"),P="19506115"==T?"343270603":(0,r.mJ$)(T)?(0,r.jLA)(T)?b:M(window.location.href):f||M(window.location.href),[q,W]=(0,l.QN)("productRatings"),[z,R]=(0,i.useState)(!1);var H=(0,r.SOt)(T)?o.aD+"/v2/events/":o.$$+"/v2/events/",K=(0,r.SOt)(T)?o.aD+"/v3/events/":o.$$+"/v3/events/",U=(0,r.SOt)(T)?o.aD+"/v4/events/":o.$$+"/v4/events/",J=(0,r.SOt)(T)?o.aD+"/v5/events/":o.$$+"/v5/events/",Q=((0,r.SOt)(T)?o.aD:o.$$,(0,r.SOt)(T)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),X=(0,r.SOt)(T)?o.aD+"/v2/collection":o.$$+"/v2/collection",Y=(0,r.SOt)(T)?o.aD+"/v3/collection":o.$$+"/v3/collection",Z=(0,r.SOt)(T)?o.aD+"/v4/collection":o.$$+"/v4/collection",ee=((0,r.jpW)(T)?o.$$:o.MT)+"/v2/brand/"+T+"/product-events",te=e.shopId,ne="live,upcoming",ie="true";return(0,i.useEffect)(()=>{null!=t&&0!=t.length&&!g&&(0,c.MN)()&&!(0,l.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,_._)()&&(0,d.Pc)(d.F5)},[t]),(0,i.useEffect)(()=>{var e,t,i,o;if((0,s.wm)(),x.startsWith("product")){var c=(0,l.Xd)("whatmoreProductId");if(c=(0,r.BcY)(T)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e||"STRGZ9TGDEQ"==e||"STRJ2T2QPKI"==e?F(window.location.href).split("/").pop():F(window.location.href)}(T):c,(0,r.vvU)(T))o=H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(T)){o=(0,B.B)(T);const e=(0,r.buK)(T);o=`${o}?client_product_id=${c}&limit=10&recommended=${!e}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else o=ee.toString()+"?client_product_id="+c.toString()+"&status="+ne.toString()+"&event_type=video"}else if(I||"invalid-url"!==b)o=(0,r.JwJ)(T)?`${Y.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==x&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:"78232846646"==T?`${Z.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==x&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:`${X.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==x&&1==(0,r.FKG)(T).length?(0,r.FKG)(T)[0]:P}`;else if(E){const e=m.Jh,t=(0,m.t6)(x);o=Q.toString()+te.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+T}else{var d,u,p,h;if(("72201044272"==T||"2665447536"==T&&D)&&!w)o=K.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+"&latitude="+(null!==(d=null===(u=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===u?void 0:u.latitude)&&void 0!==d?d:"")+"&longitude="+(null!==(p=null===(h=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===h?void 0:h.longitude)&&void 0!==p?p:"")+"&user_type="+(null!==j&&void 0!==j&&j.userType?"olduser":"newuser");else o=(0,r.JwJ)(T)&&!w?U.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString():"78232846646"!=T||w?H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":""):J.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()}const g=null===(e=window)||void 0===e||null===(t=e.whatmore)||void 0===t||null===(i=t.storyEvents)||void 0===i?void 0:i.events;w&&x.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(a(g),v(g),R(!0)):fetch(o).then(e=>e.json()).then(e=>{var t;if(o.includes("v2/events")&&"39893827751"===T&&e&&Array.isArray(e.events)&&e.events.sort((e,t)=>{const n=e=>{if(e&&Array.isArray(e.products)&&e.products.length>0&&e.products[0]&&void 0!==e.products[0].price){const t=parseFloat(e.products[0].price);return isNaN(t)?0:t}return 0},i=n(e);return n(t)-i}),E){const t=m.Jh;return(0,G.Po)(e,t)}return(0,r.JwJ)(T)&&(null===e||void 0===e||null===(t=e.questions)||void 0===t?void 0:t.length)>0&&(null==localStorage.getItem("_whatmore_qview_index")&&localStorage.setItem("_whatmore_qview_index",0),(0,s.d3)(null===e||void 0===e?void 0:e.questions)),(0,G.Np)(e,I||"invalid-url"!==b)}).then(e=>{var t,n;O&&console.debug("initial received events size : "+e.length);let i=[...null===e||void 0===e?void 0:e.events,...null===e||void 0===e?void 0:e.all_events];i=(0,r.xku)(T)?(0,G.d8)(i):(0,G.Zf)(i),v(i);const o=null!==(t=null===e||void 0===e||null===(n=e.events)||void 0===n?void 0:n.length)&&void 0!==t?t:0;return i.slice(0,o)}).then(e=>{if((A||L)&&(null==e||e&&0==(null===e||void 0===e?void 0:e.length))){const e=async()=>{const{eventsData:e,storiesData:t,bannerData:i}=await n.e(365).then(n.bind(n,6018));a(w?t:E?i:e)};e()}else a(e);R(!0)}).catch(e=>{S(e.message),R(!0)})},[]),(0,i.useEffect)(()=>{"index"===x?t&&t.length>0&&(0,$.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===x?(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,$.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===x&&(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,$.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})},[t]),z&&(null==t||0==t.length||g)&&V.Sn.forEach(e=>{var t,n,i,o;const a=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"]'),l=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-feed-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-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-a-1"]')||e.querySelector('.whatmore-template-type[data-wh="template-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-h"]')||e.querySelector('.whatmore-template-type[data-wh="template-j"]'))&&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-stories"]')||e.querySelector('.whatmore-template-type[data="template-e"]')||e.querySelector('.whatmore-template-type[data="template-a-1"]')||e.querySelector('.whatmore-template-type[data="template-g"]')||e.querySelector('.whatmore-template-type[data="template-h"]')||e.querySelector('.whatmore-template-type[data="template-j"]'),r=null!==(i=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"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-d"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-h"]'))&&void 0!==i?i: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"]')||e.querySelector('.whatmore-template-type[data="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data="template-collections-e"]')||e.querySelector('.whatmore-template-type[data="template-collections-d"]')||e.querySelector('.whatmore-template-type[data="template-collections-f"]')||e.querySelector('.whatmore-template-type[data="template-collections-g"]')||e.querySelector('.whatmore-template-type[data="template-collections-h"]')||e.querySelector('.whatmore-template-type[data="template-collections-j"]'),s=null!==(o=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==o?o:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e;if(w){const t=e.querySelector(".whatmore-shimmer-stories");t&&(t.style.display="none")}else if(!I){const t=e.querySelector(".loading-skeleton-wrapper");t&&(t.style.display="none")}(s||r||l||a)&&(l&&c||a&&c||s&&c||r&&c)&&(c.style.minHeight="0px")}),null==t||0==t.length||g?(0,y.jsx)("div",{}):(O&&(0,N.xv)(t),O&&console.debug("final transformed events data : "+JSON.stringify(t)),O&&console.debug("valid events size : "+t.length),(0,y.jsx)(k,{heading:e.heading,events:t,allEvents:p}))}},8945:function(e,t,n){function i(e,t){let n=0;let i=new MutationObserver(function(){document.querySelector("."+e)?(t(),i.disconnect()):0==n&&(n=1,setTimeout(()=>{t(),i.disconnect()},8e3))});i.observe(document.body,{childList:!0,subtree:!0})}n.d(t,{H:function(){return i}})}}]);