whatmore-react-assets 1.0.1850 → 1.0.1852
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/wht-neo-floating.2bced29a.chunk.js +1 -0
- package/static/js/{wht-neo-shopper.2cc5ffd9.chunk.js → wht-neo-shopper.9015cf62.chunk.js} +1 -1
- package/static/js/{wht-neo-stories.31537093.chunk.js → wht-neo-stories.5322743d.chunk.js} +1 -1
- package/whatmore.js +2 -2
- package/static/js/wht-neo-floating.d610d039.chunk.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[719],{1839:function(t,e,o){function n(t,e){let o=document.getElementById(t);o||(o=document.createElement("style"),o.id=t,document.head.appendChild(o)),o.textContent=e}function r(t,e){if(!t)return null;const o=t[e];if(!o||"object"!==typeof o)return Object.assign({},t,{brandCss:""});const n="string"===typeof t.customCss?t.customCss:"";return Object.assign({},o,{brandCss:n})}o.d(e,{R:function(){return r},f:function(){return n}})},5e3:function(t,e,o){o.d(e,{Au:function(){return a},YJ:function(){return d},k5:function(){return l}});const n=6,r="https://whatmore-other-assets.b-cdn.net/whatmore/dummy_for_video_pool_3s_muted_11kb.mp4",s="whatmore-video-player whatmore-main-video-player-from-pool";function i(){return"undefined"===typeof window?{}:(window.__whatmoreNeoVideoPool||(window.__whatmoreNeoVideoPool={}),window.__whatmoreNeoVideoPool)}function a(){const t=i();if(t.armed||"undefined"===typeof document)return;if(!function(){if("undefined"===typeof navigator||"undefined"===typeof document)return!1;const t=navigator.userAgent||"";return!(!/iPad|iPhone|iPod/.test(t)||window.MSStream)||/Macintosh/.test(t)&&"ontouchend"in document}())return;t.armed=!0,function(){const t=i();if(t.pool||"undefined"===typeof document)return;const e=document.createDocumentFragment();for(let o=0;o<n;o++){const t=document.createElement("video");t.setAttribute("class",s),t.setAttribute("src",r),t.muted=!0,t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("preload","auto"),t.setAttribute("loop",""),t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline",""),t.setAttribute("x-webkit-airplay","allow"),t.controls=!1,e.appendChild(t)}t.pool=e}();const e=()=>{document.removeEventListener("click",e),document.removeEventListener("touchstart",e),function(){const t=i();if(t.blessed||!t.pool)return;const e=t.pool.childNodes;for(let o=0;o<e.length;o++){const t=e[o];t.muted=!0;const n=t.play();n&&n.then&&n.then(()=>t.pause()).catch(()=>{})}t.blessed=!0}()};document.addEventListener("click",e,{passive:!0}),document.addEventListener("touchstart",e,{passive:!0})}function l(){return i().pool||null}function d(){return!!i().blessed}},6387:function(t,e,o){o.d(e,{P:function(){return r}});const n={standard:()=>o.e(508).then(o.t.bind(o,5071,17)),card:()=>o.e(545).then(o.t.bind(o,9362,17)),"mosaic-ring":()=>o.e(457).then(o.t.bind(o,8171,17)),"mosaic-plain":()=>o.e(764).then(o.t.bind(o,5635,17)),hoverplay:()=>o.e(781).then(o.t.bind(o,787,17)),"info-strip":()=>o.e(94).then(o.t.bind(o,2109,17)),"text-overlay":()=>o.e(833).then(o.t.bind(o,3930,17)),focused:()=>o.e(506).then(o.t.bind(o,1987,17)),coverflow:()=>o.e(172).then(o.t.bind(o,9033,17)),minimal:()=>o.e(244).then(o.t.bind(o,6362,17)),feed:()=>o.e(315).then(o.t.bind(o,7456,17)),circle:()=>o.e(31).then(o.t.bind(o,5112,17)),viewmore:()=>o.e(343).then(o.t.bind(o,7672,17)),overlay:()=>o.e(936).then(o.t.bind(o,75,17)),"stories-b":()=>o.e(565).then(o.t.bind(o,1958,17)),"product-broad-no-cta":()=>o.e(838).then(o.t.bind(o,5955,17)),"product-broad-atc":()=>o.e(648).then(o.t.bind(o,2699,17)),"product-narrow":()=>o.e(594).then(o.t.bind(o,4859,17)),"product-premium":()=>o.e(566).then(o.t.bind(o,2529,17)),"product-navigation":()=>o.e(45).then(o.t.bind(o,4368,17)),"product-multi-product":()=>o.e(856).then(o.t.bind(o,6084,17)),"product-thumbnail-strip":()=>o.e(620).then(o.t.bind(o,4383,17)),"product-link-only":()=>o.e(750).then(o.t.bind(o,3365,17)),"product-minimal-atc":()=>o.e(685).then(o.t.bind(o,1890,17))};async function r(t,e){const o=n["carousel"===t||"collections"===t?e:t+"-"+e];if(!o)return"";try{return(await o()).default||""}catch(r){return""}}},7983:function(t,e,o){function n(t,e=!1){if(null==t)return{events:[],all_events:[]};if(e){return{events:t.events&&t.events[0]&&t.events[0].events||[],all_events:t.all_events||[]}}return{events:t.events||[],all_events:t.all_events||[]}}function r(t,e){if(null==t||!t.eventsets||!t.eventsets[e])return{events:[],all_events:[]};return{events:(Array.isArray(t.eventsets[e])?t.eventsets[e]:[]).reduce((t,e)=>t.concat(e&&e.events||[]),[]),all_events:[]}}o.d(e,{Np:function(){return n},Po:function(){return r}})},8235:function(t,e,o){o.d(e,{renderNeoStories:function(){return x}});var n=o(7983),r=o(6287),s=o(5e3),i=o(6387),a=o(1839),l=o(9439),d='.wht-neo-stories-widget{font-family:var(--wht-neo-font,var(--wht-neo-font-auto,inherit));margin-block:var(--wht-neo-stories-pad,var(--wht-neo-stories-pad-auto,10px));width:100%}.wht-neo-stories-wrap{position:relative;width:100%}.wht-neo-stories{-webkit-overflow-scrolling:touch;display:flex;flex-flow:row nowrap;justify-content:center;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x;width:100%}.wht-neo-stories::-webkit-scrollbar{display:none}.wht-neo-stories[data-wht-overflow="1"]{justify-content:flex-start}.wht-neo-story{align-items:center;cursor:pointer;display:flex;flex-direction:column;flex-shrink:0;height:fit-content;margin:10px;width:calc(var(--wht-neo-story-size, var(--wht-neo-story-size-auto, 72px))*var(--wht-neo-story-spacing, 1))}.wht-neo-story:active .wht-neo-story-ring{transform:scale(.92)}.wht-neo-story-ring{box-shadow:var(--wht-neo-story-ring-shadow,none);transition:transform .2s ease;width:fit-content}.wht-neo-story-ring,.wht-neo-story-thumb{border-radius:var(--wht-neo-story-radius,50%);box-sizing:border-box}.wht-neo-story-thumb{background:var(--wht-neo-story-thumb-bg,var(--wht-neo-story-thumb-bg-auto,#d3d3d3));border:var(--wht-neo-story-border,3px solid #fff);height:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px));overflow:hidden;width:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px))}.wht-neo-story-img,.wht-neo-story-video{background:#fff;display:block;height:100%;object-fit:cover;width:100%}.wht-neo-story-title{color:var(--wht-neo-story-title-color,var(--wht-neo-story-title-color-auto,#000));font-family:var(--wht-neo-story-title-font,var(--wht-neo-story-title-font-auto,inherit));font-size:calc(var(--wht-neo-story-size, var(--wht-neo-story-size-auto, 72px))*.12*var(--wht-neo-story-title-factor, 1));font-weight:400;line-height:110%;margin:10px 0 0;overflow:hidden;text-align:center;text-overflow:ellipsis;width:100%}.wht-neo-stories-nav{display:none}:where([data-wht-vp=landscape]) .wht-neo-stories-wrap[data-wht-arrows="1"] .wht-neo-stories-nav{align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:var(--wht-neo-stories-nav-bg,rgba(0,0,0,.7));border:none;border-radius:50%;color:var(--wht-neo-stories-nav-color,#fff);cursor:pointer;display:flex;height:var(--wht-neo-stories-nav-size,48px);justify-content:center;padding:0;position:absolute;top:40%;transform:translateY(-50%);width:var(--wht-neo-stories-nav-size,48px);z-index:2}:where([data-wht-vp=landscape]) .wht-neo-stories-wrap[data-wht-arrows="1"] .wht-neo-stories-nav:hover{background:rgba(0,0,0,.8)}:where([data-wht-vp=landscape]) .wht-neo-stories-nav-prev{left:16px}:where([data-wht-vp=landscape]) .wht-neo-stories-nav-next{right:16px}.wht-neo-stories-nav svg{display:block;height:42%;width:42%}';const c="https://consumer.whatmore.live",u="stories",h="wht-neo-stories-css",w="wht-neo-stories-critical",p='.wht-neo-stories-widget{width:100%}.wht-neo-stories-wrap{position:relative;width:100%}.wht-neo-stories{display:flex;flex-flow:row nowrap;width:100%;overflow-x:auto;scrollbar-width:none;justify-content:center}.wht-neo-stories::-webkit-scrollbar{display:none}.wht-neo-stories[data-wht-overflow="1"]{justify-content:flex-start}.wht-neo-story{display:flex;flex-direction:column;align-items:center;flex-shrink:0;margin:10px;cursor:pointer;width:calc(var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px)) * var(--wht-neo-story-spacing,1))}.wht-neo-story-thumb{width:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px));height:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px));border-radius:50%;overflow:hidden}.wht-neo-story-img,.wht-neo-story-video{width:100%;height:100%;object-fit:cover;display:block}.wht-neo-stories-nav{display:none}';async function v(t){let e=null;try{e=new URLSearchParams(window.location.search).get("neoskin")}catch(c){}let o="";const n=e||t&&t.skin;n&&"default"!==n&&"a"!==n&&(o=await(0,i.P)(u,n));const r=n&&"default"!==n?n:"a",s=t&&t.customCss,l="string"===typeof s?s:s&&"object"===typeof s&&"string"===typeof s[r]?s[r]:"";return(0,a.f)(h,d+"\n"+o+(t&&t.brandCss?"\n"+t.brandCss:"")+(l?"\n"+l:"")),!0}const m=(t,e=null)=>{const o=function(){try{return JSON.parse(localStorage.getItem("whatmore_brand_customizations")).customizations}catch(t){return null}}(),n=t.split(".").reduce((t,e)=>null==t?void 0:t[e],o);return null==n?e:n};async function f({shopId:t,landingLocationType:e,widgetContainer:o}){if(e.startsWith("index")){const t=window.whatmore&&window.whatmore.storyEvents&&window.whatmore.storyEvents.events;if(Array.isArray(t)&&t.length)return t.slice()}let r;if(e.startsWith("product")){var s,i,a,l;const e=m("product_config.use_product_page_link_as_client_product_id")?window.location.href.split(/[?#]/)[0]:null!==(s=null!==(i=null===(a=document.querySelector("#whatmoreProductId"))||void 0===a?void 0:a.getAttribute("data-wh"))&&void 0!==i?i:null===(l=document.querySelector("#whatmoreProductId"))||void 0===l?void 0:l.getAttribute("data"))&&void 0!==s?s:"";r=`${c}/v2/brand/${t}/product-events?client_product_id=${encodeURIComponent(e)}&status=live,upcoming&event_type=video,image`}else r=`${c}/v2/events/${t}?status=live,upcoming&is_active=true&template_type=stories`;const d=await fetch(r).then(t=>t.json()),{events:u,all_events:h}=(0,n.Np)(d,!1);let w=[...u,...h];return m("oos_config.show_oos_videos")||(w=w.filter(t=>t&&!1!==t.in_stock)),w}function y(t){var e,o,n,r;const s=t.event_media_urls;let i=s?(null===(e=s.primary)||void 0===e||null===(o=e.portrait)||void 0===o?void 0:o.poster_image)||(null===(n=s.secondary)||void 0===n||null===(r=n.portrait)||void 0===r?void 0:r.poster_image)||t.poster_image||"":t.poster_image||"";return i&&i.startsWith("https://cdn.shopify.com")&&(i=i.split("?")[0]+"?width=400&height=400"),i}function b(t,e,o){var n;const r=t&&t.querySelector("#"+e),s=r&&(null!==(n=r.getAttribute("data-wh"))&&void 0!==n?n:r.getAttribute("data")),i=null!=s?parseFloat(s):NaN;return isFinite(i)?i:o}function g(t){const e=document.createElement("button");e.type="button",e.className="wht-neo-stories-nav wht-neo-stories-nav-"+t,e.dataset.role="navArrows",e.setAttribute("aria-label","prev"===t?"Previous stories":"Next stories");const o="prev"===t?"M15 5l-7 7 7 7":"M9 5l7 7-7 7";return e.innerHTML='<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="'+o+'" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>',e}function _(t,e,{navPrev:o,navNext:n}){const r=t=>{if(!t.dataset.loaded&&t.dataset.src)if(t.dataset.loaded="1","VIDEO"===t.tagName){var e;t.dataset.poster&&(t.poster=t.dataset.poster);const o=document.createElement("source");o.src=t.dataset.src,o.type="video/mp4",t.appendChild(o),null===(e=t.load)||void 0===e||e.call(t);const n=t.play&&t.play();n&&n.catch&&n.catch(()=>{})}else t.src=t.dataset.src},s=t.querySelectorAll(".wht-neo-story-img, .wht-neo-story-video");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(r(e.target),t.unobserve(e.target))})},{rootMargin:"0px 100px 0px 0px"});s.forEach(e=>t.observe(e))}else s.forEach(r);const i=()=>t.style.setProperty("--wht-neo-story-size-auto",function(t){var e;const o=(0,l.vC)(),n=o.w>o.h?o.h*(b(t,"whatmoreStoryTileSizeDesktop",40)/340):(null!==(e=(0,l.eG)(t))&&void 0!==e?e:o.w)*(b(t,"whatmoreStoryTileSize",40)/200);return Math.round(n)}(e)+"px"),a=()=>t.setAttribute("data-wht-overflow",t.scrollWidth>t.offsetWidth?"1":"0");i(),requestAnimationFrame(a);const d=e=>{const o=parseFloat(getComputedStyle(t).getPropertyValue("--wht-neo-story-size-auto"))||72;t.scrollBy({left:e*o*4,behavior:"smooth"})};o.addEventListener("click",t=>{t.stopPropagation(),d(-1)}),n.addEventListener("click",t=>{t.stopPropagation(),d(1)});let c=!1;window.addEventListener("resize",()=>{c||(c=!0,requestAnimationFrame(()=>{c=!1,(0,l.Vo)(t.closest(".wht-neo-stories-widget")),i(),a()}))},{passive:!0})}async function x(t){var e,o,n,i;const{rootElement:d,widgetContainer:c,shopId:h,landingLocationType:x="index",whatmoreRootId:k,onWidgetView:A,onOpenStories:E}=t;if(!d||!h)return!1;const C=()=>{d.removeAttribute("data-shimmer-active"),c&&(c.style.minHeight="0px");const t=c&&c.querySelector("#storiesLoader");t&&t.remove()},P=(0,l.vC)();if(P.w>P.h?!m("stories_config.show_stories_in_landscape_mode"):!m("stories_config.show_stories_in_mobile_mode"))return C(),!0;let S;(0,a.f)(w,p);try{[S]=await Promise.all([f({shopId:h,landingLocationType:x,widgetContainer:c}),v((0,a.R)(t.neoJson,u))])}catch(V){return!1}if(!S||!S.length)return C(),!0;const z=function(t){const e={};return t.forEach((t,o)=>{const n=t.storyset_id;var r;e[n]||(e[n]={id:n,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:0,start_event_index:o,storyset_dynamic_thumbnail:null!==(r=t.storyset_dynamic_thumbnail)&&void 0!==r&&r,events:[]}),e[n].total_events+=1,e[n].events.push(t)}),Object.values(e).sort((t,e)=>t.start_event_index-e.start_event_index)}(S),N={action(t,e){if("openStories"!==t)return;const o=e.storyset.events[0];(0,r.w)(y(o)),null===E||void 0===E||E({events:S,eventIndex:0,eventsStories:z,storyIndex:e.storyIndex})}},I=document.createElement("div");I.className="wht-neo-stories-widget",(0,l.Vo)(I);const L=b(c,"whatmoreStoriesTopBottomPadding",null);null!=L&&I.style.setProperty("--wht-neo-stories-pad-auto",L+"px"),function(t){const e=m("brand_theme_color","#343434"),o=m("tertiary_color","#bc2a8d");let n=m("stories_config.stories_border_colors")||[e,o,e,o,e];Array.isArray(n)||(n=Array(5).fill(n)),n.slice(0,5).forEach((e,o)=>t.style.setProperty(`--wht-neo-story-ring-c${o}`,e)),t.style.setProperty("--wht-neo-story-thumb-bg-auto","#343434"===e?"#d3d3d3":e);const r=m("stories_config.story_tiles_spacing_factor");null!=r&&isFinite(Number(r))&&t.style.setProperty("--wht-neo-story-spacing",String(r));const s=m("brand_fonts.story_title_font")||m("brand_fonts.carousel_title_font");s&&t.style.setProperty("--wht-neo-story-title-font-auto",s);const i=m("stories_config.stories_title_font_color");i&&t.style.setProperty("--wht-neo-story-title-color-auto",i);const a=m("stories_config.stories_title_font_factor");null!=a&&isFinite(Number(a))&&t.style.setProperty("--wht-neo-story-title-factor",String(a))}(I);const j=null!==(e=null===(o=document.querySelector("#whatmorePrimaryFont"))||void 0===o?void 0:o.getAttribute("data-wh"))&&void 0!==e?e:null===(n=document.querySelector("#whatmorePrimaryFont"))||void 0===n?void 0:n.getAttribute("data");j&&I.style.setProperty("--wht-neo-font-auto",j);const q=document.createElement("div");q.className="wht-neo-stories-wrap",m("stories_config.story_show_navigation_arrows")&&q.setAttribute("data-wht-arrows","1");const F=document.createElement("div");F.className="wht-neo-stories",F.setAttribute("role","listbox"),F.setAttribute("aria-label","Shoppable stories"),h&&F.setAttribute("data-wht-shop",h),F.setAttribute("data-wht-widget","wgt_stories"),z.forEach((t,e)=>F.appendChild(function(t,e,o){const n=document.createElement("div");n.className="wht-neo-story",n.dataset.role="storyTile",n.setAttribute("role","option"),n.tabIndex=0;const r=document.createElement("div");r.className="wht-neo-story-ring";const s=document.createElement("div");s.className="wht-neo-story-thumb";let i=t.thumbnail_image||t.events[0]&&t.events[0].thumbnail_image||"",a=t.events[0];if(t.storyset_dynamic_thumbnail&&t.events.length>1){const e=t.events[Math.floor(Math.random()*(t.events.length-1))];e&&(e.poster_image||e.thumbnail_image)&&(i=e.poster_image||e.thumbnail_image,a=e)}if(function(t){if(!t)return!1;if(t.includes("https://w-media.b-cdn.net/process-media"))return!1;const e=t.trim().split("?")[0];return/\.(mp4|mov|wmv|avi|flv|mkv)$/i.test(e)}(i)){const t=document.createElement("video");t.className="wht-neo-story-video",t.muted=!0,t.loop=!0,t.playsInline=!0,t.preload="none",t.setAttribute("muted",""),t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline",""),t.dataset.src=i;const e=a&&y(a);e&&(t.dataset.poster=e),s.appendChild(t)}else{const e=document.createElement("img");e.className="wht-neo-story-img",e.alt=t.title||"",e.dataset.src=function(t){return t?t.startsWith("https://cdn.shopify.com")?t.split("?")[0]+"?width=400&height=400":t:""}(i),s.appendChild(e)}r.appendChild(s),n.appendChild(r);const l=document.createElement("p");l.className="wht-neo-story-title",l.dataset.role="storyTitle",l.textContent=(t.title||"").substring(0,24),n.appendChild(l);const d=()=>o.action("openStories",{storyset:t,storyIndex:e});return n.addEventListener("click",d),n.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),d())}),n}(t,e,N)));const M=g("prev"),O=g("next");if(q.appendChild(F),q.appendChild(M),q.appendChild(O),I.appendChild(q),d.innerHTML="",d.appendChild(I),d.style.opacity="1",(0,s.Au)(),_(F,c,{navPrev:M,navNext:O}),A)if("IntersectionObserver"in window){new IntersectionObserver((t,e)=>{t.some(t=>t.isIntersecting)&&(A(),e.disconnect())},{threshold:0}).observe(F)}else A();const T=document.querySelector(`.whatmore-shimmer-container[data-widget-id="${k}"]`);return T&&T.remove(),C(),null===(i=t.onEventsReady)||void 0===i||i.call(t,S,z),!0}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[719],{1839:function(t,e,o){function n(t,e){let o=document.getElementById(t);o||(o=document.createElement("style"),o.id=t,document.head.appendChild(o)),o.textContent=e}function r(t,e){if(!t)return null;const o=t[e];if(!o||"object"!==typeof o)return Object.assign({},t,{brandCss:""});const n="string"===typeof t.customCss?t.customCss:"";return Object.assign({},o,{brandCss:n})}o.d(e,{R:function(){return r},f:function(){return n}})},5e3:function(t,e,o){o.d(e,{Au:function(){return a},YJ:function(){return d},k5:function(){return l}});const n=6,r="https://whatmore-other-assets.b-cdn.net/whatmore/dummy_for_video_pool_3s_muted_11kb.mp4",s="whatmore-video-player whatmore-main-video-player-from-pool";function i(){return"undefined"===typeof window?{}:(window.__whatmoreNeoVideoPool||(window.__whatmoreNeoVideoPool={}),window.__whatmoreNeoVideoPool)}function a(){const t=i();if(t.armed||"undefined"===typeof document)return;if(!function(){if("undefined"===typeof navigator||"undefined"===typeof document)return!1;const t=navigator.userAgent||"";return!(!/iPad|iPhone|iPod/.test(t)||window.MSStream)||/Macintosh/.test(t)&&"ontouchend"in document}())return;t.armed=!0,function(){const t=i();if(t.pool||"undefined"===typeof document)return;const e=document.createDocumentFragment();for(let o=0;o<n;o++){const t=document.createElement("video");t.setAttribute("class",s),t.setAttribute("src",r),t.muted=!0,t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("preload","auto"),t.setAttribute("loop",""),t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline",""),t.setAttribute("x-webkit-airplay","allow"),t.controls=!1,e.appendChild(t)}t.pool=e}();const e=()=>{document.removeEventListener("click",e),document.removeEventListener("touchstart",e),function(){const t=i();if(t.blessed||!t.pool)return;const e=t.pool.childNodes;for(let o=0;o<e.length;o++){const t=e[o];t.muted=!0;const n=t.play();n&&n.then&&n.then(()=>t.pause()).catch(()=>{})}t.blessed=!0}()};document.addEventListener("click",e,{passive:!0}),document.addEventListener("touchstart",e,{passive:!0})}function l(){return i().pool||null}function d(){return!!i().blessed}},6387:function(t,e,o){o.d(e,{P:function(){return r}});const n={standard:()=>o.e(508).then(o.t.bind(o,5071,17)),card:()=>o.e(545).then(o.t.bind(o,9362,17)),"mosaic-ring":()=>o.e(457).then(o.t.bind(o,8171,17)),"mosaic-plain":()=>o.e(764).then(o.t.bind(o,5635,17)),hoverplay:()=>o.e(781).then(o.t.bind(o,787,17)),"info-strip":()=>o.e(94).then(o.t.bind(o,2109,17)),"text-overlay":()=>o.e(833).then(o.t.bind(o,3930,17)),focused:()=>o.e(506).then(o.t.bind(o,1987,17)),coverflow:()=>o.e(172).then(o.t.bind(o,9033,17)),minimal:()=>o.e(244).then(o.t.bind(o,6362,17)),feed:()=>o.e(315).then(o.t.bind(o,7456,17)),circle:()=>o.e(31).then(o.t.bind(o,5112,17)),viewmore:()=>o.e(343).then(o.t.bind(o,7672,17)),overlay:()=>o.e(936).then(o.t.bind(o,75,17)),"stories-b":()=>o.e(565).then(o.t.bind(o,1958,17)),"product-broad-no-cta":()=>o.e(838).then(o.t.bind(o,5955,17)),"product-broad-atc":()=>o.e(648).then(o.t.bind(o,2699,17)),"product-narrow":()=>o.e(594).then(o.t.bind(o,4859,17)),"product-premium":()=>o.e(566).then(o.t.bind(o,2529,17)),"product-navigation":()=>o.e(45).then(o.t.bind(o,4368,17)),"product-multi-product":()=>o.e(856).then(o.t.bind(o,6084,17)),"product-thumbnail-strip":()=>o.e(620).then(o.t.bind(o,4383,17)),"product-link-only":()=>o.e(750).then(o.t.bind(o,3365,17)),"product-minimal-atc":()=>o.e(685).then(o.t.bind(o,1890,17))};async function r(t,e){const o=n["carousel"===t||"collections"===t?e:t+"-"+e];if(!o)return"";try{return(await o()).default||""}catch(r){return""}}},7983:function(t,e,o){function n(t,e=!1){if(null==t)return{events:[],all_events:[]};if(e){return{events:t.events&&t.events[0]&&t.events[0].events||[],all_events:t.all_events||[]}}return{events:t.events||[],all_events:t.all_events||[]}}function r(t,e){if(null==t||!t.eventsets||!t.eventsets[e])return{events:[],all_events:[]};return{events:(Array.isArray(t.eventsets[e])?t.eventsets[e]:[]).reduce((t,e)=>t.concat(e&&e.events||[]),[]),all_events:[]}}o.d(e,{Np:function(){return n},Po:function(){return r}})},8235:function(t,e,o){o.d(e,{renderNeoStories:function(){return A}});var n=o(7983),r=o(6287),s=o(5e3),i=o(6387),a=o(1839),l=o(9439),d='.wht-neo-stories-widget{font-family:var(--wht-neo-font,var(--wht-neo-font-auto,inherit));margin-block:var(--wht-neo-stories-pad,var(--wht-neo-stories-pad-auto,10px));width:100%}.wht-neo-stories-wrap{position:relative;width:100%}.wht-neo-stories{-webkit-overflow-scrolling:touch;display:flex;flex-flow:row nowrap;justify-content:center;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x;width:100%}.wht-neo-stories::-webkit-scrollbar{display:none}.wht-neo-stories[data-wht-overflow="1"]{justify-content:flex-start}.wht-neo-story{align-items:center;cursor:pointer;display:flex;flex-direction:column;flex-shrink:0;height:fit-content;margin:10px;width:calc(var(--wht-neo-story-size, var(--wht-neo-story-size-auto, 72px))*var(--wht-neo-story-spacing, 1))}.wht-neo-story:active .wht-neo-story-ring{transform:scale(.92)}.wht-neo-story-ring{box-shadow:var(--wht-neo-story-ring-shadow,none);transition:transform .2s ease;width:fit-content}.wht-neo-story-ring,.wht-neo-story-thumb{border-radius:var(--wht-neo-story-radius,50%);box-sizing:border-box}.wht-neo-story-thumb{background:var(--wht-neo-story-thumb-bg,var(--wht-neo-story-thumb-bg-auto,#d3d3d3));border:var(--wht-neo-story-border,3px solid #fff);height:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px));overflow:hidden;width:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px))}.wht-neo-story-img,.wht-neo-story-video{background:#fff;display:block;height:100%;object-fit:cover;width:100%}.wht-neo-story-title{color:var(--wht-neo-story-title-color,var(--wht-neo-story-title-color-auto,#000));font-family:var(--wht-neo-story-title-font,var(--wht-neo-story-title-font-auto,inherit));font-size:calc(var(--wht-neo-story-size, var(--wht-neo-story-size-auto, 72px))*.12*var(--wht-neo-story-title-factor, 1));font-weight:400;line-height:110%;margin:10px 0 0;overflow:hidden;text-align:center;text-overflow:ellipsis;width:100%}.wht-neo-stories-nav{display:none}:where([data-wht-vp=landscape]) .wht-neo-stories-wrap[data-wht-arrows="1"] .wht-neo-stories-nav{align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:var(--wht-neo-stories-nav-bg,rgba(0,0,0,.7));border:none;border-radius:50%;color:var(--wht-neo-stories-nav-color,#fff);cursor:pointer;display:flex;height:var(--wht-neo-stories-nav-size,48px);justify-content:center;padding:0;position:absolute;top:40%;transform:translateY(-50%);width:var(--wht-neo-stories-nav-size,48px);z-index:2}:where([data-wht-vp=landscape]) .wht-neo-stories-wrap[data-wht-arrows="1"] .wht-neo-stories-nav:hover{background:rgba(0,0,0,.8)}:where([data-wht-vp=landscape]) .wht-neo-stories-nav-prev{left:16px}:where([data-wht-vp=landscape]) .wht-neo-stories-nav-next{right:16px}.wht-neo-stories-nav svg{display:block;height:42%;width:42%}';const c="https://consumer.whatmore.live",u="stories",h="wht-neo-stories-css",w="wht-neo-stories-critical",p='.wht-neo-stories-widget{width:100%}.wht-neo-stories-wrap{position:relative;width:100%}.wht-neo-stories{display:flex;flex-flow:row nowrap;width:100%;overflow-x:auto;scrollbar-width:none;justify-content:center}.wht-neo-stories::-webkit-scrollbar{display:none}.wht-neo-stories[data-wht-overflow="1"]{justify-content:flex-start}.wht-neo-story{display:flex;flex-direction:column;align-items:center;flex-shrink:0;margin:10px;cursor:pointer;width:calc(var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px)) * var(--wht-neo-story-spacing,1))}.wht-neo-story-thumb{width:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px));height:var(--wht-neo-story-size,var(--wht-neo-story-size-auto,72px));border-radius:50%;overflow:hidden}.wht-neo-story-img,.wht-neo-story-video{width:100%;height:100%;object-fit:cover;display:block}.wht-neo-stories-nav{display:none}';async function v(t){let e=null;try{e=new URLSearchParams(window.location.search).get("neoskin")}catch(c){}let o="";const n=e||t&&t.skin;n&&"default"!==n&&"a"!==n&&(o=await(0,i.P)(u,n));const r=n&&"default"!==n?n:"a",s=t&&t.customCss,l="string"===typeof s?s:s&&"object"===typeof s&&"string"===typeof s[r]?s[r]:"";return(0,a.f)(h,d+"\n"+o+(t&&t.brandCss?"\n"+t.brandCss:"")+(l?"\n"+l:"")),!0}const m=(t,e=null)=>{const o=function(){try{return JSON.parse(localStorage.getItem("whatmore_brand_customizations")).customizations}catch(t){return null}}(),n=t.split(".").reduce((t,e)=>null==t?void 0:t[e],o);return null==n?e:n};async function f({shopId:t,landingLocationType:e,widgetContainer:o}){if(e.startsWith("index")){const t=window.whatmore&&window.whatmore.storyEvents&&window.whatmore.storyEvents.events;if(Array.isArray(t)&&t.length)return t.slice()}let r;if(e.startsWith("product")){var s,i,a,l;const e=m("product_config.use_product_page_link_as_client_product_id")?window.location.href.split(/[?#]/)[0]:null!==(s=null!==(i=null===(a=document.querySelector("#whatmoreProductId"))||void 0===a?void 0:a.getAttribute("data-wh"))&&void 0!==i?i:null===(l=document.querySelector("#whatmoreProductId"))||void 0===l?void 0:l.getAttribute("data"))&&void 0!==s?s:"";r=`${c}/v2/brand/${t}/product-events?client_product_id=${encodeURIComponent(e)}&status=live,upcoming&event_type=video,image`}else r=`${c}/v2/events/${t}?status=live,upcoming&is_active=true&template_type=stories`;const d=await fetch(r).then(t=>t.json()),{events:u,all_events:h}=(0,n.Np)(d,!1);let w=[...u,...h];return m("oos_config.show_oos_videos")||(w=w.filter(t=>t&&!1!==t.in_stock)),w}const y=t=>!!t&&"image"===t.event_type;function b(t){const e=t&&t.event_media_urls;if(!e)return t&&t.thumbnail_image||"";const o=t=>{var o,n,r,s;return(null===(o=e.secondary)||void 0===o||null===(n=o[t])||void 0===n?void 0:n.content_image_original)||(null===(r=e.primary)||void 0===r||null===(s=r[t])||void 0===s?void 0:s.content_image_original)||""};return o("portrait")||o("landscape")||t.thumbnail_image||""}function g(t){var e,o,n,r;const s=t.event_media_urls;let i=s?(null===(e=s.primary)||void 0===e||null===(o=e.portrait)||void 0===o?void 0:o.poster_image)||(null===(n=s.secondary)||void 0===n||null===(r=n.portrait)||void 0===r?void 0:r.poster_image)||t.poster_image||"":t.poster_image||"";return!i&&y(t)?b(t):(i&&i.startsWith("https://cdn.shopify.com")&&(i=i.split("?")[0]+"?width=400&height=400"),i)}function _(t,e,o){var n;const r=t&&t.querySelector("#"+e),s=r&&(null!==(n=r.getAttribute("data-wh"))&&void 0!==n?n:r.getAttribute("data")),i=null!=s?parseFloat(s):NaN;return isFinite(i)?i:o}function x(t){const e=document.createElement("button");e.type="button",e.className="wht-neo-stories-nav wht-neo-stories-nav-"+t,e.dataset.role="navArrows",e.setAttribute("aria-label","prev"===t?"Previous stories":"Next stories");const o="prev"===t?"M15 5l-7 7 7 7":"M9 5l7 7-7 7";return e.innerHTML='<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="'+o+'" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>',e}function k(t,e,{navPrev:o,navNext:n}){const r=t=>{if(!t.dataset.loaded&&t.dataset.src)if(t.dataset.loaded="1","VIDEO"===t.tagName){var e;t.dataset.poster&&(t.poster=t.dataset.poster);const o=document.createElement("source");o.src=t.dataset.src,o.type="video/mp4",t.appendChild(o),null===(e=t.load)||void 0===e||e.call(t);const n=t.play&&t.play();n&&n.catch&&n.catch(()=>{})}else t.src=t.dataset.src},s=t.querySelectorAll(".wht-neo-story-img, .wht-neo-story-video");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(r(e.target),t.unobserve(e.target))})},{rootMargin:"0px 100px 0px 0px"});s.forEach(e=>t.observe(e))}else s.forEach(r);const i=()=>t.style.setProperty("--wht-neo-story-size-auto",function(t){var e;const o=(0,l.vC)(),n=o.w>o.h?o.h*(_(t,"whatmoreStoryTileSizeDesktop",40)/340):(null!==(e=(0,l.eG)(t))&&void 0!==e?e:o.w)*(_(t,"whatmoreStoryTileSize",40)/200);return Math.round(n)}(e)+"px"),a=()=>t.setAttribute("data-wht-overflow",t.scrollWidth>t.offsetWidth?"1":"0");i(),requestAnimationFrame(a);const d=e=>{const o=parseFloat(getComputedStyle(t).getPropertyValue("--wht-neo-story-size-auto"))||72;t.scrollBy({left:e*o*4,behavior:"smooth"})};o.addEventListener("click",t=>{t.stopPropagation(),d(-1)}),n.addEventListener("click",t=>{t.stopPropagation(),d(1)});let c=!1;window.addEventListener("resize",()=>{c||(c=!0,requestAnimationFrame(()=>{c=!1,(0,l.Vo)(t.closest(".wht-neo-stories-widget")),i(),a()}))},{passive:!0})}async function A(t){var e,o,n,i;const{rootElement:d,widgetContainer:c,shopId:h,landingLocationType:A="index",whatmoreRootId:E,onWidgetView:C,onOpenStories:P}=t;if(!d||!h)return!1;const S=()=>{d.removeAttribute("data-shimmer-active"),c&&(c.style.minHeight="0px");const t=c&&c.querySelector("#storiesLoader");t&&t.remove()},z=(0,l.vC)();if(z.w>z.h?!m("stories_config.show_stories_in_landscape_mode"):!m("stories_config.show_stories_in_mobile_mode"))return S(),!0;let N;(0,a.f)(w,p);try{[N]=await Promise.all([f({shopId:h,landingLocationType:A,widgetContainer:c}),v((0,a.R)(t.neoJson,u))])}catch(W){return!1}if(!N||!N.length)return S(),!0;const I=function(t){const e={};return t.forEach((t,o)=>{const n=t.storyset_id;var r;e[n]||(e[n]={id:n,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:0,start_event_index:o,storyset_dynamic_thumbnail:null!==(r=t.storyset_dynamic_thumbnail)&&void 0!==r&&r,events:[]}),e[n].total_events+=1,e[n].events.push(t)}),Object.values(e).sort((t,e)=>t.start_event_index-e.start_event_index)}(N),L={action(t,e){if("openStories"!==t)return;const o=e.storyset.events[0];(0,r.w)(g(o)),null===P||void 0===P||P({events:N,eventIndex:0,eventsStories:I,storyIndex:e.storyIndex})}},j=document.createElement("div");j.className="wht-neo-stories-widget",(0,l.Vo)(j);const q=_(c,"whatmoreStoriesTopBottomPadding",null);null!=q&&j.style.setProperty("--wht-neo-stories-pad-auto",q+"px"),function(t){const e=m("brand_theme_color","#343434"),o=m("tertiary_color","#bc2a8d");let n=m("stories_config.stories_border_colors")||[e,o,e,o,e];Array.isArray(n)||(n=Array(5).fill(n)),n.slice(0,5).forEach((e,o)=>t.style.setProperty(`--wht-neo-story-ring-c${o}`,e)),t.style.setProperty("--wht-neo-story-thumb-bg-auto","#343434"===e?"#d3d3d3":e);const r=m("stories_config.story_tiles_spacing_factor");null!=r&&isFinite(Number(r))&&t.style.setProperty("--wht-neo-story-spacing",String(r));const s=m("brand_fonts.story_title_font")||m("brand_fonts.carousel_title_font");s&&t.style.setProperty("--wht-neo-story-title-font-auto",s);const i=m("stories_config.stories_title_font_color");i&&t.style.setProperty("--wht-neo-story-title-color-auto",i);const a=m("stories_config.stories_title_font_factor");null!=a&&isFinite(Number(a))&&t.style.setProperty("--wht-neo-story-title-factor",String(a))}(j);const F=null!==(e=null===(o=document.querySelector("#whatmorePrimaryFont"))||void 0===o?void 0:o.getAttribute("data-wh"))&&void 0!==e?e:null===(n=document.querySelector("#whatmorePrimaryFont"))||void 0===n?void 0:n.getAttribute("data");F&&j.style.setProperty("--wht-neo-font-auto",F);const M=document.createElement("div");M.className="wht-neo-stories-wrap",m("stories_config.story_show_navigation_arrows")&&M.setAttribute("data-wht-arrows","1");const O=document.createElement("div");O.className="wht-neo-stories",O.setAttribute("role","listbox"),O.setAttribute("aria-label","Shoppable stories"),h&&O.setAttribute("data-wht-shop",h),O.setAttribute("data-wht-widget","wgt_stories"),I.forEach((t,e)=>O.appendChild(function(t,e,o){const n=document.createElement("div");n.className="wht-neo-story",n.dataset.role="storyTile",n.setAttribute("role","option"),n.tabIndex=0;const r=document.createElement("div");r.className="wht-neo-story-ring";const s=document.createElement("div");s.className="wht-neo-story-thumb";const i=t=>t&&(t.thumbnail_image||(y(t)?b(t):""))||"";let a=t.thumbnail_image||i(t.events[0]),l=t.events[0];if(t.storyset_dynamic_thumbnail&&t.events.length>1){const e=t.events[Math.floor(Math.random()*(t.events.length-1))],o=e&&e.poster_image||i(e);o&&(a=o,l=e)}if(function(t){if(!t)return!1;if(t.includes("https://w-media.b-cdn.net/process-media"))return!1;const e=t.trim().split("?")[0];return/\.(mp4|mov|wmv|avi|flv|mkv)$/i.test(e)}(a)){const t=document.createElement("video");t.className="wht-neo-story-video",t.muted=!0,t.loop=!0,t.playsInline=!0,t.preload="none",t.setAttribute("muted",""),t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline",""),t.dataset.src=a;const e=l&&g(l);e&&(t.dataset.poster=e),s.appendChild(t)}else{const e=document.createElement("img");e.className="wht-neo-story-img",e.alt=t.title||"",e.dataset.src=function(t){return t?t.startsWith("https://cdn.shopify.com")?t.split("?")[0]+"?width=400&height=400":t:""}(a),s.appendChild(e)}r.appendChild(s),n.appendChild(r);const d=document.createElement("p");d.className="wht-neo-story-title",d.dataset.role="storyTitle",d.textContent=(t.title||"").substring(0,24),n.appendChild(d);const c=()=>o.action("openStories",{storyset:t,storyIndex:e});return n.addEventListener("click",c),n.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),c())}),n}(t,e,L)));const T=x("prev"),V=x("next");if(M.appendChild(O),M.appendChild(T),M.appendChild(V),j.appendChild(M),d.innerHTML="",d.appendChild(j),d.style.opacity="1",(0,s.Au)(),k(O,c,{navPrev:T,navNext:V}),C)if("IntersectionObserver"in window){new IntersectionObserver((t,e)=>{t.some(t=>t.isIntersecting)&&(C(),e.disconnect())},{threshold:0}).observe(O)}else C();const $=document.querySelector(`.whatmore-shimmer-container[data-widget-id="${E}"]`);return $&&$.remove(),S(),null===(i=t.onEventsReady)||void 0===i||i.call(t,N,I),!0}}}]);
|