@letscooee/web-sdk 14.2.3 → 14.2.4
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/dist/{debugger.component-f4r_AGlF-Bzhbfrtf.js → debugger.component-BPUPrXVH-BebqKEvo.js} +1 -1
- package/dist/main.min.js +19 -19
- package/dist/{renderer-CPG_uW1d-BEtrIfjE.js → renderer-BEuag36y-BHXHkvk0.js} +2 -2
- package/dist/{share-dialog.component-Hqd1r1i5-vgYzk-7x.js → share-dialog.component-M0XF3VLY-c72566UI.js} +2 -2
- package/dist/{video-detail-dialog.component-LxhnmfX6-DWRv7oCM.js → video-detail-dialog.component-Bv2Mhvsg-BuJ85JuU.js} +4 -4
- package/dist/{widgets-DKSCYY7I-DPj-3zy4.js → widgets-YcHQyo19-COQy2ham.js} +4 -4
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { q, b as H, N as Ne, M, P as P$1, d as ke, m as mt$1, e as Be, j as jr, Y, X, I as Ir, f as Ot, L as Lt, U as Ue, g as kt, y as ye, z as ze, R as Rt, A as At, h as A, i as Oe, r, n as s, o as x, p as In, u as On, S as Sn, Q as Qt, v as S, w as dt, C as
|
|
1
|
+
import { q, b as H, N as Ne, M, P as P$1, d as ke, m as mt$1, e as Be, j as jr, Y, X, I as Ir, f as Ot, L as Lt, U as Ue, g as kt, y as ye, z as ze, R as Rt, A as At, h as A, i as Oe, r, n as s, o as x, p as In, u as On, S as Sn, Q as Qt, v as S, w as dt, C as me, D as j, E as Xt, F as pe, G as Sn$1, x as xn, $ as $e } from './main.min.js';
|
|
2
2
|
|
|
3
|
-
var w=class{loadedFonts=[];async loadAllFonts(t){t.elems?.forEach(e=>{e instanceof ce&&this.loadFamily(e.typography?.fam);});}async loadFamily(t){if(!t?.fonts||this.loadedFonts.indexOf(t.name)>-1)return;let e=[];t.fonts.forEach(n=>{if(n.url){let c=new FontFace(`cooee`+t.name,n.getURL(),n.getFontDescriptor());e.push(c.load());}}),this.loadedFonts.push(t.name),(await Promise.all(e)).forEach(n=>{document.fonts.add(n);});}};var b=class{static updateIdentity(t){if(!this.isInstalled())return;let e={};t.email&&(e.email=t.email),t.mobile&&(e.phone_number=t.mobile),Y.verbose(`Sending email/mobile to Klaviyo`),window.klaviyo.push([`identify`,e]);}static isInstalled(){return window.klaviyo&&typeof window.klaviyo==`object`}};var R=class{action;triggerContext;constructor(t,e){this.action=t,this.triggerContext=e;}async execute(){let t=this.containsCTA()?`CE Trigger Clicked`:`CE Trigger Closed`;switch(this.action.at!==pe.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(t),this.action.at){case pe.ACCEPT_POPUP:break;case pe.GO_TO_URL:this.gotoURLAction();break;case pe.SHARE:this.shareAction();break;case pe.SUBMIT_FORM:await this.collectFormData();break;case void 0:case pe.OPEN_CART:break;default:Y.error(`Received an invalid ClickActionType: `,this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,`_blank`)?.focus();}gotoURLAction(){if(this.action.gu?.u){let t=this.action.gu.u;Sn$1(t)||(t=`//${t}`),window.open(t,`_self`);}}async closeTriggerAndSendEvent(t,e){this.triggerContext.closeInApp(t,e),await this.dispatchEvent();}shareAction(){if(!this.action.share)return;if(!navigator.share){Y.warn(`Navigator.share is not compatible with this browser`);return}navigator.share({text:this.action.share.text,title:`Share`}).then(e=>console.log(e)).catch(e=>console.error(e));}containsCTA(){return this.action.at&&this.action.at!==pe.REJECT_POPUP?true:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(t){return t?Object.keys(t).length===0:true}async collectFormData(){let t={};for(let e of this.triggerContext.inputs){if(!e.isValid)return;let n=document.getElementById(e.id).value;e.type===51?t.email=n:e.type===52&&(t.mobile=n);}await this.closeTriggerAndSendEvent(`CE Form Submitted`,{form:t}),this.action.applyDiscount&&xn(`Coupon applied on cart`),b.updateIdentity(t);}async dispatchEvent(){let t=this.triggerContext.triggerData,e={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??t.embeddedItems??t.items,collections:t.collections,triggerData:t};await new $e().process(e);let r={action:this.containsCTA()?`CLICKED`:`CLOSED`};document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:r}));}};var a=class{renderer=D.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;scalingFactor;constructor(t,e,r){this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=r,this.scalingFactor=this.renderer.getScalingFactor();}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl);}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let t=s(r(r(r(r({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:`border-box`,outline:`none`});S(this.inappHTMLEl,t);}getDisplayStyles(){return {display:`block`}}processWidthAndHeight(){this.inappElement.w&&H(this.inappHTMLEl,`width`,x(this.inappElement.w,this.scalingFactor)),this.inappElement.h&&H(this.inappHTMLEl,`height`,x(this.inappElement.h,this.scalingFactor));}processPositionBlock(){let t={position:`absolute`,left:x(this.inappElement.x,this.scalingFactor),top:x(this.inappElement.y,this.scalingFactor)};S(this.inappHTMLEl,t);}getBorderStyles(){return Sn(this.inappElement.br,this.scalingFactor)}getSpaceStyles(){return In(this.inappElement.spc,this.scalingFactor)}processTransparency(){let t=this.inappElement.alpha;if(!isNaN(t)){let e=(t/100).toFixed(2);H(this.inappHTMLEl,`opacity`,e);}}processShadow(){let t=this.inappElement.shd;t?H(this.inappHTMLEl,`box-shadow`,t.getStyle(this.scalingFactor)):H(this.inappHTMLEl,`box-shadow`,`unset`);}processTransformBlock(){let t=new j(this.inappElement.trf);t&&t.rotate&&H(this.inappHTMLEl,`transform`,`rotate(${t.rotate}deg)`);}registerAction(){let t=this.inappElement.clc;!t||Object.keys(t).length===0||(this.inappHTMLEl.addEventListener(`click`,e=>{e.stopPropagation(),new R(t,this.triggerContext).execute();}),H(this.inappHTMLEl,`cursor`,`pointer`));}getBackgroundStyles(){return On(this.inappElement.bg)}};var l=class extends a{constructor(t,e,r){super(t,e,r);}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment();}processFontBlock(){let t={},e=this.inappElement.typography;return e&&(t.fontSize=x(e.fs,this.scalingFactor),t.fontFamily=`cooee`+e.fam?.name,t.lineHeight=`${e.lh}`,t.letterSpacing=e.letterSpacing),Qt(this.inappElement.color,`color`,t),S(this.inappHTMLEl,t),t}processPart(t,e){let r=[];e.u&&r.push(`underline`),e.st&&r.push(`line-through`),r.length||r.push(`normal`),H(t,`font-weight`,e.b?`bold`:`normal`),H(t,`font-style`,e.i?`italic`:`normal`),H(t,`text-decoration`,r.join(` `)),H(t,`color`,e.c??`inherit`),H(t,`font-family`,`inherit`);}processAlignment(){let t=this.inappElement.typography.ta,e=t?Xt[t]?.toLowerCase():this.inappElement.typography.alignment;e||(e=`start`),H(this.inappHTMLEl,`text-align`,e);}};var f=class extends l{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.inappElement.parts?.forEach(t=>{let e=document.createElement(`span`);e.innerHTML=t.txt?.toString()?.replace(/\n/g,`<br />`),this.processPart(e,t),this.inappHTMLEl.appendChild(e);}),this.processCommonBlocks();}};var v=class extends a{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.processCommonBlocks();}};var T=class extends a{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`img`),this.insertElement();}render(){this.inappHTMLEl.setAttribute(`src`,this.inappElement.src),H(this.inappHTMLEl,`max-width`,`none`),H(this.inappHTMLEl,`max-height`,`none`),H(this.inappHTMLEl,`margin`,`0 auto`),this.processCommonBlocks();}};var y=class o extends a{constructor(e,r,n){super(e,r,n);this.parent=e;this.inappHTMLEl=document.createElement(`div`);}static MAX_Z_INDEX=`2147483647`;render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(`cooee-wrapper`),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),H(this.inappHTMLEl,`z-index`,o.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let e=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(H(this.inappHTMLEl,`width`,`100%`),H(this.inappHTMLEl,`height`,`100%`)):(H(this.inappHTMLEl,`width`,`100vw`),H(this.inappHTMLEl,`height`,`100vh`)),H(this.inappHTMLEl,`top`,`0`),H(this.inappHTMLEl,`left`,`0`);else {let r=this.inappElement.spc,n=Oe(e.w,this.scalingFactor)+r.getHorizontal(),c=Oe(e.h,this.scalingFactor)+r.getVertical();H(this.inappHTMLEl,`width`,n+`px`),H(this.inappHTMLEl,`height`,c+`px`);}}getSpaceStyles(){return {padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return r(r({display:`flex`},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?H(this.inappHTMLEl,`position`,`absolute`):H(this.inappHTMLEl,`position`,`fixed`);}getBorderStyles(){return {}}processTransparency(){}processTransformBlock(){}processShadow(){}};var mt=`cooee-container`,P=class extends a{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){return this.processCommonBlocks(),H(this.inappHTMLEl,`position`,`relative`),H(this.inappHTMLEl,`overflow`,`hidden`),this.inappHTMLEl.classList.add(mt),this}};var k=class o extends l{static DAYS=`Days`;static HOURS=`Hours`;static MINUTES=`Minutes`;static SECONDS=`Seconds`;elements;spans=[];constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let t=s(r(r(r({flex:`1 1 0`},On(this.inappElement.bg)),Sn(this.inappElement.br,this.scalingFactor)),In(this.inappElement.spc,this.scalingFactor)),{marginLeft:x(this.inappElement.gap,this.scalingFactor),marginRight:x(this.inappElement.gap,this.scalingFactor)});this.addStylesToTimer(t);}getBackgroundStyles(){return {}}processFontBlock(){let t=super.processFontBlock();return Qt(this.inappElement.color,`color`,t),this.addStylesToTimer(t),t}getSpaceStyles(){return {}}getBorderStyles(){return {}}getDisplayStyles(){return {display:`flex`,flexWrap:`nowrap`,justifyContent:`center`}}addStylesToTimer(t){this.elements.forEach(e=>S(e,t));}addTimerChildren(){let t=this.inappElement.show;this.elements=[],t.day&&this.elements.push(this.getChild(o.DAYS)),t.hour&&this.elements.push(this.getChild(o.HOURS)),t.minute&&this.elements.push(this.getChild(o.MINUTES)),t.second&&this.elements.push(this.getChild(o.SECONDS)),this.elements.forEach(e=>this.inappHTMLEl.appendChild(e));}getChild(t){let e=document.createElement(`div`),r=document.createElement(`span`),n=document.createElement(`span`);return n.innerText=t,r.innerText=`00`,r.id=`lc-${t}`,H(n,`font-size`,`0.5em`),H(n,`text-align`,`center`),H(n,`font-family`,`inherit`),H(r,`text-align`,`center`),H(r,`font-family`,`inherit`),this.inappElement.lblPos===`start`?(e.appendChild(n),e.appendChild(r)):(e.appendChild(r),e.appendChild(n)),H(e,`display`,`flex`),H(e,`flex-direction`,this.inappElement.horizontal?``:`column`),H(e,`justify-content`,`center`),H(e,`align-items`,`center`),H(e,`gap`,`5px`),this.spans.push(r),e}processAndStartTimer(){let t=this.inappElement.timer.start(this.inappElement.timerType,e=>{this.spans.forEach(r=>{r.id===`lc-${o.DAYS}`?r.innerText=String(e.days).padStart(2,`0`):r.id===`lc-${o.HOURS}`?r.innerText=String(e.hours).padStart(2,`0`):r.id===`lc-${o.MINUTES}`?r.innerText=String(e.minutes).padStart(2,`0`):r.id===`lc-${o.SECONDS}`&&(r.innerText=String(e.seconds).padStart(2,`0`));});});this.triggerContext.intervals.push(t);}};var B=class extends l{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`select`),this.insertElement();}render(){H(this.inappHTMLEl,`background`,`#ffffff00`),H(this.inappHTMLEl,`outline`,`none`),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions();}addListener(t){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),t.addEventListener(`click`,e=>{e.stopPropagation();}),t.addEventListener(`change`,()=>{let e=new dt(JSON.parse(t.value));this.updateItems(e);});}updateItems(t){let e=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[e.toEmbed(t)];let r=this.parentHTMLEl.querySelector(`#coo-13`);if(!r)return;let n=t.imgs[0]??e.imgs?.at(0);n?.url&&r.setAttribute(`src`,n.url);}addOptions(){let t=this.triggerContext.triggerData.items,e=this.inappHTMLEl;if(!t?.length){e.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);t[0].vars.forEach(n=>{e.add(this.createOption(n.name??`Default`,n,n.mID===r?.vID));});}createOption(t,e,r){let n=document.createElement(`option`);return n.text=t,n.value=JSON.stringify(e),r&&(n.selected=true),e||(n.disabled=true),n}};var u=class extends l{borderColor=``;constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`input`),this.insertElement();}render(){let t=this.setInputType();this.inappHTMLEl.setAttribute(`placeholder`,this.inappElement.placeholderText),H(this.inappHTMLEl,`background`,`#ffffff00`),H(this.inappHTMLEl,`outline`,`none`),this.inappHTMLEl.addEventListener(`click`,e=>{e.stopPropagation();}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,t),this.triggerContext.addInputField(t,this.inappElement.t);}};var F=class o extends u{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(t,e,r){super(t,e,r);}setInputType(){let t=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`email`),this.inappHTMLEl.setAttribute(`id`,t),t}addListener(t,e){t.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(o.EMAIL_REGEX)?(H(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(e,true)):(H(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(e,false)),r.stopPropagation();});}};var O=class o extends u{static MOBILE_REGEX=/^\d+$/;constructor(t,e,r){super(t,e,r);}setInputType(){let t=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`tel`),this.inappHTMLEl.setAttribute(`id`,t),t}addListener(t,e){t.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(o.MOBILE_REGEX)?(H(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(e,true)):(H(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(e,false)),r.stopPropagation();});}};var N=class extends T{constructor(t,e,r){super(t,e,r);}render(){super.render(),this.inappHTMLEl.setAttribute(`id`,`coo-${this.inappElement.type}`);}};var D=class o{static DOCUMENT_STANDARD_MODE=`CSS1Compat`;static ACTIVE_TRIGGER_DATA;static _instance;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(t){this.resizeListener=()=>this.screenResized(),this.setParentContainer(t);}static get(){return o._instance}render(t){this.renderEngagement(new q(t));}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(t){let e=t.max,r=t.cont.w,n=t.cont.h,c=t.spc,m=this.getWidth(),h=this.getHeight();e&&(m=m?Math.min(m,e):e,h=h?Math.min(h,e):e),h&&(m-=c.getHorizontal(),h-=c.getVertical(),m/h<r/n?this.scalingFactor=m/r:this.scalingFactor=h/n,this.scalingFactor=Math.min(this.scalingFactor,1));}setParentContainer(t){this.parent=t||document.body,this.isParentNotBody()&&H(this.parent,`position`,`relative`);}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(t){this.triggerContext=new Ne(new Date,t),this.triggerContext.onClose(e=>{this.closeInApp(e);}),this.ian=t.ian,(M()||t.previewType===`mobile`)&&this.ian.overrideForMobileView(),await this.preloadImages(t),t.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed();},t.getDelaySeconds()):this.withCartDrawerClosed();}withCartDrawerClosed(){if(!P$1.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:e})=>{!e&&this.startRenderingOnce();});}startRenderingOnce(){if(!this.shouldSkipCampaign()){o.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,o._instance=this;try{this.startRendering();}catch(t){ke(t,`render-popup`,{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),M()||window.addEventListener(`resize`,this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe();}}shouldSkipCampaign(){let t=this.triggerContext.triggerData;if(!t.previewType&&o.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mt$1(o.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(t,r),true}if(Be().isGoKwikPopupOpen)return this.skipTrigger(t,{reason:`GoKwik popup is open`}),true;let e=jr.find(r=>!!document.querySelector(r.identifier));return e?(this.skipTrigger(t,{reason:`${e.gateway} modal is open`}),true):false}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new y(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext);}catch(t){throw Y.error(t),t}}sendTriggerDisplayed(){let t={};this.triggerContext.triggerData.items?.length&&(t.promotedMIDs=this.triggerContext.triggerData.items?.map(n=>n.mID));X(new Ir(`CE Trigger Displayed`,t,this.triggerContext.triggerData));document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:{action:`DISPLAYED`}}));}sendTriggerClosed(t){let e=t.eventName;delete t.eventName;let r=new Ir(e,t,this.triggerContext.triggerData);r.name===`CE Trigger Clicked`&&(r.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(n=>n.toEmbed())),X(r);}addEnterAnimation(t){this.containerHTMLElement.animate(t.getEnterAnimation(),{duration:500});}renderElement(t,e,r){e instanceof Ot?new F(t,e,r).render():e instanceof Lt?new O(t,e,r).render():e instanceof Ue?new f(t,e,r).render():e instanceof kt?new N(t,e,r).render():e instanceof ye?new T(t,e,r).render():e instanceof ze?new v(t,e,r).render():e instanceof Rt?new k(t,e,r).render():e instanceof At?new B(t,e,r).render():Y.error(`Unsupported element type- `+e.type);}renderContainer(t){let e=this.ian?.cont;e&&(this.containerHTMLElement=new P(this.rootContainer,e,t).render().getHTMLElement(),new w().loadAllFonts(this.ian),this.ian.elems?.forEach(async r=>{await this.renderElement(this.containerHTMLElement,r,t);}),this.addEnterAnimation(this.ian.anim));}closeInApp(t){let e=this.ian.anim.getExitAnimation();this.sendTriggerClosed(t),o.ACTIVE_TRIGGER_DATA=void 0;let r=this.containerHTMLElement.animate(e,{duration:500,easing:`ease-in-out`});r.onfinish=()=>{this.removeInApp(),window.removeEventListener(`resize`,this.resizeListener);};}screenResized(){this.removeInApp(),this.startRendering();}removeInApp(){let t=document.querySelector(`.${this.triggerContext.rootClassName}`);t&&t.parentElement.removeChild(t);}skipTrigger(t,e){X(new Ir(`CE Campaign Rejected`,e,t));}async preloadImages(t){let e=t.ian;if(!e)return;let r=[];e.elems.forEach(n=>{let c=n.bg?.img?.src;if(c&&r.push(c),n.t===1){let m=n.src;if(!m)return;r.push(m);}}),e.bg?.img?.src&&r.push(e.bg.img.src),e.cont.bg?.img?.src&&r.push(e.cont.bg.img.src),await Promise.all(r.map(n=>A(n)));}};
|
|
3
|
+
var w=class{loadedFonts=[];async loadAllFonts(t){t.elems?.forEach(e=>{e instanceof me&&this.loadFamily(e.typography?.fam);});}async loadFamily(t){if(!t?.fonts||this.loadedFonts.indexOf(t.name)>-1)return;let e=[];t.fonts.forEach(n=>{if(n.url){let c=new FontFace(`cooee`+t.name,n.getURL(),n.getFontDescriptor());e.push(c.load());}}),this.loadedFonts.push(t.name),(await Promise.all(e)).forEach(n=>{document.fonts.add(n);});}};var b=class{static updateIdentity(t){if(!this.isInstalled())return;let e={};t.email&&(e.email=t.email),t.mobile&&(e.phone_number=t.mobile),Y.verbose(`Sending email/mobile to Klaviyo`),window.klaviyo.push([`identify`,e]);}static isInstalled(){return window.klaviyo&&typeof window.klaviyo==`object`}};var R=class{action;triggerContext;constructor(t,e){this.action=t,this.triggerContext=e;}async execute(){let t=this.containsCTA()?`CE Trigger Clicked`:`CE Trigger Closed`;switch(this.action.at!==pe.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(t),this.action.at){case pe.ACCEPT_POPUP:break;case pe.GO_TO_URL:this.gotoURLAction();break;case pe.SHARE:this.shareAction();break;case pe.SUBMIT_FORM:await this.collectFormData();break;case void 0:case pe.OPEN_CART:break;default:Y.error(`Received an invalid ClickActionType: `,this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,`_blank`)?.focus();}gotoURLAction(){if(this.action.gu?.u){let t=this.action.gu.u;Sn$1(t)||(t=`//${t}`),window.open(t,`_self`);}}async closeTriggerAndSendEvent(t,e){this.triggerContext.closeInApp(t,e),await this.dispatchEvent();}shareAction(){if(!this.action.share)return;if(!navigator.share){Y.warn(`Navigator.share is not compatible with this browser`);return}navigator.share({text:this.action.share.text,title:`Share`}).then(e=>console.log(e)).catch(e=>console.error(e));}containsCTA(){return this.action.at&&this.action.at!==pe.REJECT_POPUP?true:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(t){return t?Object.keys(t).length===0:true}async collectFormData(){let t={};for(let e of this.triggerContext.inputs){if(!e.isValid)return;let n=document.getElementById(e.id).value;e.type===51?t.email=n:e.type===52&&(t.mobile=n);}await this.closeTriggerAndSendEvent(`CE Form Submitted`,{form:t}),this.action.applyDiscount&&xn(`Coupon applied on cart`),b.updateIdentity(t);}async dispatchEvent(){let t=this.triggerContext.triggerData,e={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??t.embeddedItems??t.items,collections:t.collections,triggerData:t};await new $e().process(e);let r={action:this.containsCTA()?`CLICKED`:`CLOSED`};document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:r}));}};var a=class{renderer=D.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;scalingFactor;constructor(t,e,r){this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=r,this.scalingFactor=this.renderer.getScalingFactor();}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl);}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let t=s(r(r(r(r({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:`border-box`,outline:`none`});S(this.inappHTMLEl,t);}getDisplayStyles(){return {display:`block`}}processWidthAndHeight(){this.inappElement.w&&H(this.inappHTMLEl,`width`,x(this.inappElement.w,this.scalingFactor)),this.inappElement.h&&H(this.inappHTMLEl,`height`,x(this.inappElement.h,this.scalingFactor));}processPositionBlock(){let t={position:`absolute`,left:x(this.inappElement.x,this.scalingFactor),top:x(this.inappElement.y,this.scalingFactor)};S(this.inappHTMLEl,t);}getBorderStyles(){return Sn(this.inappElement.br,this.scalingFactor)}getSpaceStyles(){return In(this.inappElement.spc,this.scalingFactor)}processTransparency(){let t=this.inappElement.alpha;if(!isNaN(t)){let e=(t/100).toFixed(2);H(this.inappHTMLEl,`opacity`,e);}}processShadow(){let t=this.inappElement.shd;t?H(this.inappHTMLEl,`box-shadow`,t.getStyle(this.scalingFactor)):H(this.inappHTMLEl,`box-shadow`,`unset`);}processTransformBlock(){let t=new j(this.inappElement.trf);t&&t.rotate&&H(this.inappHTMLEl,`transform`,`rotate(${t.rotate}deg)`);}registerAction(){let t=this.inappElement.clc;!t||Object.keys(t).length===0||(this.inappHTMLEl.addEventListener(`click`,e=>{e.stopPropagation(),new R(t,this.triggerContext).execute();}),H(this.inappHTMLEl,`cursor`,`pointer`));}getBackgroundStyles(){return On(this.inappElement.bg)}};var l=class extends a{constructor(t,e,r){super(t,e,r);}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment();}processFontBlock(){let t={},e=this.inappElement.typography;return e&&(t.fontSize=x(e.fs,this.scalingFactor),t.fontFamily=`cooee`+e.fam?.name,t.lineHeight=`${e.lh}`,t.letterSpacing=e.letterSpacing),Qt(this.inappElement.color,`color`,t),S(this.inappHTMLEl,t),t}processPart(t,e){let r=[];e.u&&r.push(`underline`),e.st&&r.push(`line-through`),r.length||r.push(`normal`),H(t,`font-weight`,e.b?`bold`:`normal`),H(t,`font-style`,e.i?`italic`:`normal`),H(t,`text-decoration`,r.join(` `)),H(t,`color`,e.c??`inherit`),H(t,`font-family`,`inherit`);}processAlignment(){let t=this.inappElement.typography.ta,e=t?Xt[t]?.toLowerCase():this.inappElement.typography.alignment;e||(e=`start`),H(this.inappHTMLEl,`text-align`,e);}};var f=class extends l{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.inappElement.parts?.forEach(t=>{let e=document.createElement(`span`);e.innerHTML=t.txt?.toString()?.replace(/\n/g,`<br />`),this.processPart(e,t),this.inappHTMLEl.appendChild(e);}),this.processCommonBlocks();}};var v=class extends a{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.processCommonBlocks();}};var T=class extends a{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`img`),this.insertElement();}render(){this.inappHTMLEl.setAttribute(`src`,this.inappElement.src),H(this.inappHTMLEl,`max-width`,`none`),H(this.inappHTMLEl,`max-height`,`none`),H(this.inappHTMLEl,`margin`,`0 auto`),this.processCommonBlocks();}};var y=class o extends a{constructor(e,r,n){super(e,r,n);this.parent=e;this.inappHTMLEl=document.createElement(`div`);}static MAX_Z_INDEX=`2147483647`;render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(`cooee-wrapper`),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),H(this.inappHTMLEl,`z-index`,o.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let e=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(H(this.inappHTMLEl,`width`,`100%`),H(this.inappHTMLEl,`height`,`100%`)):(H(this.inappHTMLEl,`width`,`100vw`),H(this.inappHTMLEl,`height`,`100vh`)),H(this.inappHTMLEl,`top`,`0`),H(this.inappHTMLEl,`left`,`0`);else {let r=this.inappElement.spc,n=Oe(e.w,this.scalingFactor)+r.getHorizontal(),c=Oe(e.h,this.scalingFactor)+r.getVertical();H(this.inappHTMLEl,`width`,n+`px`),H(this.inappHTMLEl,`height`,c+`px`);}}getSpaceStyles(){return {padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return r(r({display:`flex`},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?H(this.inappHTMLEl,`position`,`absolute`):H(this.inappHTMLEl,`position`,`fixed`);}getBorderStyles(){return {}}processTransparency(){}processTransformBlock(){}processShadow(){}};var mt=`cooee-container`,P=class extends a{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){return this.processCommonBlocks(),H(this.inappHTMLEl,`position`,`relative`),H(this.inappHTMLEl,`overflow`,`hidden`),this.inappHTMLEl.classList.add(mt),this}};var k=class o extends l{static DAYS=`Days`;static HOURS=`Hours`;static MINUTES=`Minutes`;static SECONDS=`Seconds`;elements;spans=[];constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let t=s(r(r(r({flex:`1 1 0`},On(this.inappElement.bg)),Sn(this.inappElement.br,this.scalingFactor)),In(this.inappElement.spc,this.scalingFactor)),{marginLeft:x(this.inappElement.gap,this.scalingFactor),marginRight:x(this.inappElement.gap,this.scalingFactor)});this.addStylesToTimer(t);}getBackgroundStyles(){return {}}processFontBlock(){let t=super.processFontBlock();return Qt(this.inappElement.color,`color`,t),this.addStylesToTimer(t),t}getSpaceStyles(){return {}}getBorderStyles(){return {}}getDisplayStyles(){return {display:`flex`,flexWrap:`nowrap`,justifyContent:`center`}}addStylesToTimer(t){this.elements.forEach(e=>S(e,t));}addTimerChildren(){let t=this.inappElement.show;this.elements=[],t.day&&this.elements.push(this.getChild(o.DAYS)),t.hour&&this.elements.push(this.getChild(o.HOURS)),t.minute&&this.elements.push(this.getChild(o.MINUTES)),t.second&&this.elements.push(this.getChild(o.SECONDS)),this.elements.forEach(e=>this.inappHTMLEl.appendChild(e));}getChild(t){let e=document.createElement(`div`),r=document.createElement(`span`),n=document.createElement(`span`);return n.innerText=t,r.innerText=`00`,r.id=`lc-${t}`,H(n,`font-size`,`0.5em`),H(n,`text-align`,`center`),H(n,`font-family`,`inherit`),H(r,`text-align`,`center`),H(r,`font-family`,`inherit`),this.inappElement.lblPos===`start`?(e.appendChild(n),e.appendChild(r)):(e.appendChild(r),e.appendChild(n)),H(e,`display`,`flex`),H(e,`flex-direction`,this.inappElement.horizontal?``:`column`),H(e,`justify-content`,`center`),H(e,`align-items`,`center`),H(e,`gap`,`5px`),this.spans.push(r),e}processAndStartTimer(){let t=this.inappElement.timer.start(this.inappElement.timerType,e=>{this.spans.forEach(r=>{r.id===`lc-${o.DAYS}`?r.innerText=String(e.days).padStart(2,`0`):r.id===`lc-${o.HOURS}`?r.innerText=String(e.hours).padStart(2,`0`):r.id===`lc-${o.MINUTES}`?r.innerText=String(e.minutes).padStart(2,`0`):r.id===`lc-${o.SECONDS}`&&(r.innerText=String(e.seconds).padStart(2,`0`));});});this.triggerContext.intervals.push(t);}};var B=class extends l{constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`select`),this.insertElement();}render(){H(this.inappHTMLEl,`background`,`#ffffff00`),H(this.inappHTMLEl,`outline`,`none`),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions();}addListener(t){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),t.addEventListener(`click`,e=>{e.stopPropagation();}),t.addEventListener(`change`,()=>{let e=new dt(JSON.parse(t.value));this.updateItems(e);});}updateItems(t){let e=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[e.toEmbed(t)];let r=this.parentHTMLEl.querySelector(`#coo-13`);if(!r)return;let n=t.imgs[0]??e.imgs?.at(0);n?.url&&r.setAttribute(`src`,n.url);}addOptions(){let t=this.triggerContext.triggerData.items,e=this.inappHTMLEl;if(!t?.length){e.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);t[0].vars.forEach(n=>{e.add(this.createOption(n.name??`Default`,n,n.mID===r?.vID));});}createOption(t,e,r){let n=document.createElement(`option`);return n.text=t,n.value=JSON.stringify(e),r&&(n.selected=true),e||(n.disabled=true),n}};var u=class extends l{borderColor=``;constructor(t,e,r){super(t,e,r),this.inappHTMLEl=document.createElement(`input`),this.insertElement();}render(){let t=this.setInputType();this.inappHTMLEl.setAttribute(`placeholder`,this.inappElement.placeholderText),H(this.inappHTMLEl,`background`,`#ffffff00`),H(this.inappHTMLEl,`outline`,`none`),this.inappHTMLEl.addEventListener(`click`,e=>{e.stopPropagation();}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,t),this.triggerContext.addInputField(t,this.inappElement.t);}};var F=class o extends u{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(t,e,r){super(t,e,r);}setInputType(){let t=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`email`),this.inappHTMLEl.setAttribute(`id`,t),t}addListener(t,e){t.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(o.EMAIL_REGEX)?(H(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(e,true)):(H(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(e,false)),r.stopPropagation();});}};var O=class o extends u{static MOBILE_REGEX=/^\d+$/;constructor(t,e,r){super(t,e,r);}setInputType(){let t=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`tel`),this.inappHTMLEl.setAttribute(`id`,t),t}addListener(t,e){t.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),t.value.match(o.MOBILE_REGEX)?(H(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(e,true)):(H(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(e,false)),r.stopPropagation();});}};var N=class extends T{constructor(t,e,r){super(t,e,r);}render(){super.render(),this.inappHTMLEl.setAttribute(`id`,`coo-${this.inappElement.type}`);}};var D=class o{static DOCUMENT_STANDARD_MODE=`CSS1Compat`;static ACTIVE_TRIGGER_DATA;static _instance;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(t){this.resizeListener=()=>this.screenResized(),this.setParentContainer(t);}static get(){return o._instance}render(t){this.renderEngagement(new q(t));}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(t){let e=t.max,r=t.cont.w,n=t.cont.h,c=t.spc,m=this.getWidth(),h=this.getHeight();e&&(m=m?Math.min(m,e):e,h=h?Math.min(h,e):e),h&&(m-=c.getHorizontal(),h-=c.getVertical(),m/h<r/n?this.scalingFactor=m/r:this.scalingFactor=h/n,this.scalingFactor=Math.min(this.scalingFactor,1));}setParentContainer(t){this.parent=t||document.body,this.isParentNotBody()&&H(this.parent,`position`,`relative`);}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(t){this.triggerContext=new Ne(new Date,t),this.triggerContext.onClose(e=>{this.closeInApp(e);}),this.ian=t.ian,(M()||t.previewType===`mobile`)&&this.ian.overrideForMobileView(),await this.preloadImages(t),t.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed();},t.getDelaySeconds()):this.withCartDrawerClosed();}withCartDrawerClosed(){if(!P$1.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:e})=>{!e&&this.startRenderingOnce();});}startRenderingOnce(){if(!this.shouldSkipCampaign()){o.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,o._instance=this;try{this.startRendering();}catch(t){ke(t,`render-popup`,{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),M()||window.addEventListener(`resize`,this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe();}}shouldSkipCampaign(){let t=this.triggerContext.triggerData;if(!t.previewType&&o.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mt$1(o.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(t,r),true}if(Be().isGoKwikPopupOpen)return this.skipTrigger(t,{reason:`GoKwik popup is open`}),true;let e=jr.find(r=>!!document.querySelector(r.identifier));return e?(this.skipTrigger(t,{reason:`${e.gateway} modal is open`}),true):false}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new y(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext);}catch(t){throw Y.error(t),t}}sendTriggerDisplayed(){let t={};this.triggerContext.triggerData.items?.length&&(t.promotedMIDs=this.triggerContext.triggerData.items?.map(n=>n.mID));X(new Ir(`CE Trigger Displayed`,t,this.triggerContext.triggerData));document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:{action:`DISPLAYED`}}));}sendTriggerClosed(t){let e=t.eventName;delete t.eventName;let r=new Ir(e,t,this.triggerContext.triggerData);r.name===`CE Trigger Clicked`&&(r.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(n=>n.toEmbed())),X(r);}addEnterAnimation(t){this.containerHTMLElement.animate(t.getEnterAnimation(),{duration:500});}renderElement(t,e,r){e instanceof Ot?new F(t,e,r).render():e instanceof Lt?new O(t,e,r).render():e instanceof Ue?new f(t,e,r).render():e instanceof kt?new N(t,e,r).render():e instanceof ye?new T(t,e,r).render():e instanceof ze?new v(t,e,r).render():e instanceof Rt?new k(t,e,r).render():e instanceof At?new B(t,e,r).render():Y.error(`Unsupported element type- `+e.type);}renderContainer(t){let e=this.ian?.cont;e&&(this.containerHTMLElement=new P(this.rootContainer,e,t).render().getHTMLElement(),new w().loadAllFonts(this.ian),this.ian.elems?.forEach(async r=>{await this.renderElement(this.containerHTMLElement,r,t);}),this.addEnterAnimation(this.ian.anim));}closeInApp(t){let e=this.ian.anim.getExitAnimation();this.sendTriggerClosed(t),o.ACTIVE_TRIGGER_DATA=void 0;let r=this.containerHTMLElement.animate(e,{duration:500,easing:`ease-in-out`});r.onfinish=()=>{this.removeInApp(),window.removeEventListener(`resize`,this.resizeListener);};}screenResized(){this.removeInApp(),this.startRendering();}removeInApp(){let t=document.querySelector(`.${this.triggerContext.rootClassName}`);t&&t.parentElement.removeChild(t);}skipTrigger(t,e){X(new Ir(`CE Campaign Rejected`,e,t));}async preloadImages(t){let e=t.ian;if(!e)return;let r=[];e.elems.forEach(n=>{let c=n.bg?.img?.src;if(c&&r.push(c),n.t===1){let m=n.src;if(!m)return;r.push(m);}}),e.bg?.img?.src&&r.push(e.bg.img.src),e.cont.bg?.img?.src&&r.push(e.cont.bg.img.src),await Promise.all(r.map(n=>A(n)));}};
|
|
4
4
|
|
|
5
5
|
export { D as FreeformRenderer };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './main.min.js';
|
|
2
|
-
import { h as g, j as W, G as Ge, K as Ke, o as of, y as ye, k as Ka, u as uv, J as Ja, S as Sf, D as Df } from './widgets-
|
|
3
|
-
import { l, f } from './video-detail-dialog.component-
|
|
2
|
+
import { h as g, j as W, G as Ge, K as Ke, o as of, y as ye, k as Ka, u as uv, J as Ja, S as Sf, D as Df } from './widgets-YcHQyo19-COQy2ham.js';
|
|
3
|
+
import { l, f } from './video-detail-dialog.component-Bv2Mhvsg-BuJ85JuU.js';
|
|
4
4
|
|
|
5
5
|
var _=class d{dialogRef=g(W);eventData=g(Ge);triggerData=g(Ke)().triggerData;onShareAndClose(p,o){p.stopPropagation();let{url:t,text:a}=l(this.triggerData,this.eventData.video,o!==`Clipboard`);switch(o){case `Whatsapp`:window.open(`https://wa.me/?text=${a}%20${t}`,`_blank`,`noopener,noreferrer`);break;case `X(Twitter)`:window.open(`https://x.com/intent/post?text=${a}&url=${t}`,`_blank`,`noopener,noreferrer`);break;case `Clipboard`:navigator.clipboard.writeText(t).catch(()=>{let e=document.createElement(`textarea`);e.value=t,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e);});break;}o&&f(this.triggerData,this.eventData.video,this.eventData.index,o),this.dialogRef.close();}static ɵfac=function(o){return new(o||d)};static ɵcmp=of({type:d,selectors:[[`cooee-share-dialog`]],decls:19,vars:0,consts:[[1,`share-dialog`],[1,`share-dialog-header`],[`type`,`button`,`aria-label`,`Close`,1,`close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`],[1,`share-options`],[`type`,`button`,`aria-label`,`Share on WhatsApp`,1,`share-option`,3,`click`],[`name`,`whatsapp`,`aria-hidden`,`true`],[`type`,`button`,`aria-label`,`Share on X`,1,`share-option`,3,`click`],[`name`,`x-twitter`,`aria-hidden`,`true`],[`type`,`button`,`aria-label`,`Copy link`,1,`share-option`,3,`click`],[`name`,`copy`,`aria-hidden`,`true`]],template:function(o,t){o&1&&(Ka(0,`div`,0)(1,`div`,1)(2,`h3`),uv(3,`Share`),Ja(),Ka(4,`button`,2),Sf(`click`,function(e){return t.onShareAndClose(e)}),Df(5,`cooee-icon`,3),Ja()(),Ka(6,`div`,4)(7,`button`,5),Sf(`click`,function(e){return t.onShareAndClose(e,`Whatsapp`)}),Df(8,`cooee-icon`,6),Ka(9,`span`),uv(10,`Whatsapp`),Ja()(),Ka(11,`button`,7),Sf(`click`,function(e){return t.onShareAndClose(e,`X(Twitter)`)}),Df(12,`cooee-icon`,8),Ka(13,`span`),uv(14,`X`),Ja()(),Ka(15,`button`,9),Sf(`click`,function(e){return t.onShareAndClose(e,`Clipboard`)}),Df(16,`cooee-icon`,10),Ka(17,`span`),uv(18,`Copy link`),Ja()()()());},dependencies:[ye],styles:[`@keyframes _ngcontent-%COMP%_slideInScale{0%{opacity:0;transform:scale(.9) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}.share-dialog[_ngcontent-%COMP%]{background:#fff;border-radius:12px;padding:20px;min-width:280px;box-shadow:0 8px 32px #00000026;color:#333;animation:_ngcontent-%COMP%_slideInScale .25s ease-out}.share-dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.share-dialog-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-family:var(--lc-heading-family),serif;margin:0;font-size:18px;font-weight:600}.share-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;font-family:var(--lc-text-family),serif}.share-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#0002;border:1px solid #e9ecef;border-radius:8px;color:#333;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease}.share-option[_ngcontent-%COMP%]:hover{background:#0004;border-color:#dee2e6;transform:translateY(-1px)}.share-option[_ngcontent-%COMP%]:active{transform:translateY(0)}.share-option[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{width:24px;height:24px}.share-option[_ngcontent-%COMP%] cooee-icon[name=whatsapp][_ngcontent-%COMP%]{color:#25d366}.share-option[_ngcontent-%COMP%] cooee-icon[name=x-twitter][_ngcontent-%COMP%], .share-option[_ngcontent-%COMP%] cooee-icon[name=copy][_ngcontent-%COMP%]{color:#000}.share-option[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;text-align:left}button.close-button[_ngcontent-%COMP%]{background-color:transparent;border:none}button.close-button[_ngcontent-%COMP%] cooee-icon[name=close][_ngcontent-%COMP%]{border-radius:100%;color:#000}`]})};
|
|
6
6
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { I as Ir, V as Ve, H as He, s as se, M, t, T as Tr, l as l$1, O, k as ki, c as ce, Y, a as V } from './main.min.js';
|
|
2
|
-
import { l as Mt, h as g, m as Ye, n as Se$1, G as Ge, j as W, o as of, L as Lt, N as Nt, B as Bt, p as TE, q as wE, r as jt, R as Rt, y as ye, k as Ka, S as Sf, s as ec, w as wD, $ as $o, J as Ja, t as lf, v as jD, x as yf, c as ud, _ as _D, z as nc, A as Rf, C as xf, E as $b, F as Ro, K as Ke, O as Ft, D as Df, U as Ub, P as Cs, V as Vo, X as Xa, H as Ho, Q as rc, Z as mf, a0 as ND, a1 as vD, a2 as fu, a3 as pu, a4 as kD, a5 as ED, a6 as Ef, a7 as gv, a8 as Zf, a9 as qf, aa as fv, ab as Sv, ac as Kg } from './widgets-
|
|
2
|
+
import { l as Mt, h as g, m as Ye, n as Se$1, G as Ge, j as W, o as of, L as Lt, N as Nt, B as Bt, p as TE, q as wE, r as jt, R as Rt, y as ye, k as Ka, S as Sf, s as ec, w as wD, $ as $o, J as Ja, t as lf, v as jD, x as yf, c as ud, _ as _D, z as nc, A as Rf, C as xf, E as $b, F as Ro, K as Ke, O as Ft, D as Df, U as Ub, P as Cs, V as Vo, X as Xa, H as Ho, Q as rc, Z as mf, a0 as ND, a1 as vD, a2 as fu, a3 as pu, a4 as kD, a5 as ED, a6 as Ef, a7 as gv, a8 as Zf, a9 as qf, aa as fv, ab as Sv, ac as Kg } from './widgets-YcHQyo19-COQy2ham.js';
|
|
3
3
|
|
|
4
4
|
var f=(t,e,o,r)=>{if(!e)return;let i=new Ir(`CE Video Shared`,{current:{videoID:e.id,videoIndex:o},platform:r},t);window.CooeeSDK.sendEvent(i);},l=(t,e,o=true)=>{let r=o?encodeURIComponent(m(t,e)):m(t,e),n=`Hey! Check out this video for an amazing product -`;return {url:r,text:o?encodeURIComponent(n):n}},m=(t,e)=>{return Ve(He(window.location.href,t),e)};
|
|
5
5
|
|
|
6
|
-
var S=class n{video=Ub.required();progress=Mt(0);constructor(){Cs(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100);};e.addEventListener(`timeupdate`,i),t(()=>{e.removeEventListener(`timeupdate`,i);});});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-progress-bar`]],inputs:{video:[1,`video`]},decls:3,vars:3,consts:[[1,`video-untracked-path`],[`role`,`progressbar`,1,`video-tracked-path`]],template:function(e,i){e&1&&(Vo(0,`div`,0)(1,`div`,1),Xa(2,`div`),Ho()()),e&2&&(ud(),rc(`width`,i.progress(),`%`),mf(`aria-valuenow`,i.progress()));},styles:[`[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media(prefers-reduced-motion:reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}`]})};var P=class n{dialogState=$b();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(Ft);async share(t){t.stopPropagation(),t.preventDefault(),M()&&V()?await this.shareNative():await this.shareWithDialog();}async shareNative(){let t=l(this.triggerData,this.eventData.video,false);await navigator.share(t),f(this.triggerData,this.eventData.video,this.eventData.index,`Native`);}async shareWithDialog(){let t=await import('./share-dialog.component-Hqd1r1i5-vgYzk-7x.js');this.dialogState.emit(true),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(false));}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-share-button`]],outputs:{dialogState:`dialogState`},decls:2,vars:0,consts:[[`type`,`button`,`aria-label`,`Share video`,3,`click`],[`name`,`share`]],template:function(e,i){e&1&&(Ka(0,`button`,0),Sf(`click`,function(r){return i.share(r)}),Df(1,`cooee-icon`,1),Ja());},dependencies:[ye],styles:[`button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}`]})};var Te=[`swiperComp`],Ie=[`videoEl`],Se=(n,t)=>t.video.id,Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Ka(0,`div`,11),Df(1,`div`,15),Ja());}function Me(n,t){if(n&1&&Df(0,`source`,13),n&2){let e=t.$implicit;yf(`type`,gv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&Ef(0);}function Ne(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,24),Sf(`cardClick`,function(o){fu(e);let r=kD(2).$implicit;return pu(kD().productCardClicked(o,r.video))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.video.items);}}function ze(n,t){if(n&1&&Df(0,`cooee-video-card`,23),n&2){let e=kD(2).$implicit;yf(`card`,e.video.card);}}function Fe(n,t){if(n&1){let e=ND();Df(0,`cooee-video-progress-bar`,16),Ka(1,`div`,17)(2,`cooee-mute-toggle`,18),Zf(`mutedChange`,function(o){fu(e);let r=kD(2);return fv(r.muted,o)||(r.muted=o),pu(o)}),Sf(`toggled`,function(){fu(e);return pu(kD(2).muteToggled())}),Ja(),lf(3,Oe,1,0,`ng-container`,8),Ja(),Ka(4,`div`,19)(5,`cooee-share-button`,20),Sf(`dialogState`,function(o){fu(e);return pu(kD(2).shareDialogOpen.set(o))}),Ja()(),Ka(6,`div`,21),vD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),Ja();}if(n&2){let e=kD().$implicit,i=jD(5),o=kD(),r=jD(9);yf(`video`,i),ud(2),qf(`muted`,o.muted),yf(`videoEl`,i),ud(),yf(`ngTemplateOutlet`,r),ud(4),ED(e.video.items.length&&o.videoConfig.showItems()?7:e.video.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-detail`,25),Sf(`closeClick`,function(){fu(e);return pu(kD(2).productModalClosed())}),Ja();}if(n&2){let e=kD(2);yf(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=ND();Ka(0,`div`,6)(1,`div`,9)(2,`div`,10),vD(3,ke,2,0,`div`,11),Ka(4,`video`,12,2),Sf(`click`,function(){let o=fu(e).$index,r=kD();return pu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){fu(e);let o=jD(5);return pu(kD().onVideoEnded(o))})(`loadstart`,function(){let o=fu(e).$index;return pu(kD().onVideoLoadStart(o))})(`canplay`,function(){let o=fu(e).$index;return pu(kD().onVideoCanPlay(o))}),wD(6,Me,1,3,`source`,13,Pe),Ja(),vD(8,Fe,9,5),Ja(),vD(9,Le,1,3,`cooee-item-detail`,14),Ja()();}if(n&2){let e=t.$implicit,i=t.$index,o=kD();ud(2),rc(`background-image`,e.video.thumbnail?`url(`+e.video.thumbnail+`)`:null),ud(),ED(o.shouldShowVideoSpinner(i)?3:-1),ud(),yf(`ngClass`,o.viewTemplateClassName)(`muted`,true),mf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.video.id)(`autoplay`,null),ud(2),_D(e.video.sources),ud(2),ED(o.currentIndex===i?8:-1),ud(),ED(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&Ef(0);}function Be(n,t){if(n&1){let e=ND();Ka(0,`button`,26),Sf(`click`,function(){fu(e);return pu(kD().close())}),Df(1,`cooee-icon`,27),Ja();}}var Ee=class n{swiperComponent;videoElements;VideoConfigFooterContent=se;currentIndex=0;muted=Mt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Mt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Mt(false);swiperOptions=Mt(null);videoEntries=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new t(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videoEntries=this.data.videoEntries,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videoEntries[this.currentIndex]?.video,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Tr,this.navigationConfig=new l$1({enabled:true,size:50,color:new O({h:`#000000`})}),this.cssLoadedPromise=ki(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await ce.get(`muted`,false)),this.videoConfig.detailPopup.template){case `PRODUCT_DETAIL_VIEW`:this.selectItemForDetailView(),this.viewTemplateClassName=`lc-product-detail-view`;break;case `VIDEO_ONLY_VIEW`:this.viewTemplateClassName=`lc-video-only-view`;break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions();}ngOnDestroy(){this.resizeDebouncer?.destroy();}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(false);}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videoEntries[this.currentIndex].video,lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime});}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1);}productModalClosed(){this.selectedItem=null;}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause());}toggleMute(){this.muted.update(t=>!t);}async muteToggled(){await ce.set(`muted`,this.muted());let e=[this.muted()?`CE Video Muted`:`CE Video Unmuted`,{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e);}playActiveVideo(t=true){t&&this.pauseAll();let e=this.getCurrentVideoElement();e&&this.playVideo(e);}playVideo(t){t.currentTime=0,t.play().catch(e=>Y.error(e));}onVideoEnded(t){if(this.currentIndex<this.videoEntries.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else {let i=[`CE Last Video Ended`,{previous:this.getPreviousVideoDataForEvent()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t);}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videoEntries[this.currentIndex].video,this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let r=new Ir(`CE Video Changed`,{previous:e,current:this.currentVideoProps()},this.engagementTrigger);r.setVideos(this.videoEntries[this.currentIndex].video),window.CooeeSDK.sendEvent(r);}productCardClicked(t,e){let o=new Ir(`CE More Item Info Clicked`,{current:{videoID:e.id,videoIndex:this.currentIndex}},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t;}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===true&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:`auto`,e=0;this.isProductDetailView()&&(t=`auto`,e=10),this.swiperOptions.set({direction:this.isMobile?`vertical`:`horizontal`,effect:this.isMobile?`slide`:`coverflow`,slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:true,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:false},on:{init:i=>{this.swiperInitialized.set(true),setTimeout(()=>{i.update();},100);}},mousewheel:{enabled:!this.isMobile,invert:false,thresholdDelta:20}});}isProductDetailView(){return this.videoConfig.detailPopup.template===`PRODUCT_DETAIL_VIEW`}currentVideoProps(){return {videoID:this.videoEntries[this.currentIndex].video.id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videoEntries[this.currentIndex].video.id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null;}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height);}calculateOptimalVideoDimensions(){let t=this.videoEntries.map(u=>u.video.sources?.[0]).filter(u=>u?.width&&u?.height).map(u=>({width:u.width,height:u.height,aspectRatio:u.width/u.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,k=o/e.height,A=Math.min(r,k);return {width:Math.floor(e.width*A),height:Math.floor(e.height*A)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty(`--video-container-width`,`${t}px`),i.style.setProperty(`--video-container-height`,`${e}px`);}onResize(){this.applyOptimalVideoDimensions();}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&nc(Te,7)(Ie,5),e&2){let o;Rf(o=xf())&&(i.swiperComponent=o.first),Rf(o=xf())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Sf(`keydown.escape`,function(r){return i.onKeyDown(r)},Kg);},decls:10,vars:4,consts:[[`swiperComp`,``],[`closeButtonTemplate`,``],[`videoEl`,``],[1,`lc-shadow-inner`,3,`ngClass`],[1,`video-swiper`,3,`slideChange`,`options`,`navigationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-slide`],[1,`lc-desktop-controls`],[4,`ngTemplateOutlet`],[1,`lc-video-modal-row`],[1,`lc-video-container`],[1,`video-loading-overlay`],[`playsinline`,``,1,`lc-video-el`,3,`click`,`ended`,`loadstart`,`canplay`,`ngClass`,`muted`],[3,`src`,`type`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`item`,`similarItems`,`template`],[1,`loading-spinner`],[3,`video`],[1,`lc-video-controls`],[3,`mutedChange`,`toggled`,`muted`,`videoEl`],[1,`share-controls`],[3,`dialogState`],[1,`lc-card-container`],[3,`items`],[3,`card`],[3,`cardClick`,`items`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`closeClick`,`item`,`similarItems`,`template`],[`type`,`button`,`aria-label`,`Close`,1,`lc-close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`]],template:function(e,i){if(e&1&&(Ka(0,`div`,3)(1,`cooee-swiper`,4,0),Sf(`slideChange`,function(r){return i.onSlideChange(r)}),ec(3,5),wD(4,Re,10,10,`div`,6,Se),$o(),Ja(),Ka(6,`div`,7),lf(7,Ae,1,0,`ng-container`,8),Ja()(),lf(8,Be,2,0,`ng-template`,null,1,Sv)),e&2){let o=jD(9);yf(`ngClass`,i.viewTemplateClassName),ud(),yf(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),ud(3),_D(i.videoEntries),ud(3),yf(`ngTemplateOutlet`,o);}},dependencies:[Lt,Nt,Bt,P,S,TE,wE,jt,Rt,ye],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media(min-width:768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media(min-width:768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media(max-width:768px){.video-swiper>.swiper-button-prev{display:none!important}}@media(max-width:768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media(min-width:768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media(max-width:768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media(min-width:768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media(min-width:768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media(max-width:768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media(min-width:768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media(min-width:768px){.lc-product-detail-view .lc-video-container{width:50%}}@media(min-width:768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media(max-width:768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media(max-width:768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
|
|
6
|
+
var S=class n{video=Ub.required();progress=Mt(0);constructor(){Cs(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100);};e.addEventListener(`timeupdate`,i),t(()=>{e.removeEventListener(`timeupdate`,i);});});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-progress-bar`]],inputs:{video:[1,`video`]},decls:3,vars:3,consts:[[1,`video-untracked-path`],[`role`,`progressbar`,1,`video-tracked-path`]],template:function(e,i){e&1&&(Vo(0,`div`,0)(1,`div`,1),Xa(2,`div`),Ho()()),e&2&&(ud(),rc(`width`,i.progress(),`%`),mf(`aria-valuenow`,i.progress()));},styles:[`[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media(prefers-reduced-motion:reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}`]})};var P=class n{dialogState=$b();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(Ft);async share(t){t.stopPropagation(),t.preventDefault(),M()&&V()?await this.shareNative():await this.shareWithDialog();}async shareNative(){let t=l(this.triggerData,this.eventData.video,false);await navigator.share(t),f(this.triggerData,this.eventData.video,this.eventData.index,`Native`);}async shareWithDialog(){let t=await import('./share-dialog.component-M0XF3VLY-c72566UI.js');this.dialogState.emit(true),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(false));}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-share-button`]],outputs:{dialogState:`dialogState`},decls:2,vars:0,consts:[[`type`,`button`,`aria-label`,`Share video`,3,`click`],[`name`,`share`]],template:function(e,i){e&1&&(Ka(0,`button`,0),Sf(`click`,function(r){return i.share(r)}),Df(1,`cooee-icon`,1),Ja());},dependencies:[ye],styles:[`button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}`]})};var Te=[`swiperComp`],Ie=[`videoEl`],Se=(n,t)=>t.video.id,Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Ka(0,`div`,11),Df(1,`div`,15),Ja());}function Me(n,t){if(n&1&&Df(0,`source`,13),n&2){let e=t.$implicit;yf(`type`,gv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&Ef(0);}function Ne(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,24),Sf(`cardClick`,function(o){fu(e);let r=kD(2).$implicit;return pu(kD().productCardClicked(o,r.video))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.video.items);}}function ze(n,t){if(n&1&&Df(0,`cooee-video-card`,23),n&2){let e=kD(2).$implicit;yf(`card`,e.video.card);}}function Fe(n,t){if(n&1){let e=ND();Df(0,`cooee-video-progress-bar`,16),Ka(1,`div`,17)(2,`cooee-mute-toggle`,18),Zf(`mutedChange`,function(o){fu(e);let r=kD(2);return fv(r.muted,o)||(r.muted=o),pu(o)}),Sf(`toggled`,function(){fu(e);return pu(kD(2).muteToggled())}),Ja(),lf(3,Oe,1,0,`ng-container`,8),Ja(),Ka(4,`div`,19)(5,`cooee-share-button`,20),Sf(`dialogState`,function(o){fu(e);return pu(kD(2).shareDialogOpen.set(o))}),Ja()(),Ka(6,`div`,21),vD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),Ja();}if(n&2){let e=kD().$implicit,i=jD(5),o=kD(),r=jD(9);yf(`video`,i),ud(2),qf(`muted`,o.muted),yf(`videoEl`,i),ud(),yf(`ngTemplateOutlet`,r),ud(4),ED(e.video.items.length&&o.videoConfig.showItems()?7:e.video.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-detail`,25),Sf(`closeClick`,function(){fu(e);return pu(kD(2).productModalClosed())}),Ja();}if(n&2){let e=kD(2);yf(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=ND();Ka(0,`div`,6)(1,`div`,9)(2,`div`,10),vD(3,ke,2,0,`div`,11),Ka(4,`video`,12,2),Sf(`click`,function(){let o=fu(e).$index,r=kD();return pu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){fu(e);let o=jD(5);return pu(kD().onVideoEnded(o))})(`loadstart`,function(){let o=fu(e).$index;return pu(kD().onVideoLoadStart(o))})(`canplay`,function(){let o=fu(e).$index;return pu(kD().onVideoCanPlay(o))}),wD(6,Me,1,3,`source`,13,Pe),Ja(),vD(8,Fe,9,5),Ja(),vD(9,Le,1,3,`cooee-item-detail`,14),Ja()();}if(n&2){let e=t.$implicit,i=t.$index,o=kD();ud(2),rc(`background-image`,e.video.thumbnail?`url(`+e.video.thumbnail+`)`:null),ud(),ED(o.shouldShowVideoSpinner(i)?3:-1),ud(),yf(`ngClass`,o.viewTemplateClassName)(`muted`,true),mf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.video.id)(`autoplay`,null),ud(2),_D(e.video.sources),ud(2),ED(o.currentIndex===i?8:-1),ud(),ED(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&Ef(0);}function Be(n,t){if(n&1){let e=ND();Ka(0,`button`,26),Sf(`click`,function(){fu(e);return pu(kD().close())}),Df(1,`cooee-icon`,27),Ja();}}var Ee=class n{swiperComponent;videoElements;VideoConfigFooterContent=se;currentIndex=0;muted=Mt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Mt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Mt(false);swiperOptions=Mt(null);videoEntries=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new t(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videoEntries=this.data.videoEntries,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videoEntries[this.currentIndex]?.video,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Tr,this.navigationConfig=new l$1({enabled:true,size:50,color:new O({h:`#000000`})}),this.cssLoadedPromise=ki(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await ce.get(`muted`,false)),this.videoConfig.detailPopup.template){case `PRODUCT_DETAIL_VIEW`:this.selectItemForDetailView(),this.viewTemplateClassName=`lc-product-detail-view`;break;case `VIDEO_ONLY_VIEW`:this.viewTemplateClassName=`lc-video-only-view`;break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions();}ngOnDestroy(){this.resizeDebouncer?.destroy();}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(false);}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videoEntries[this.currentIndex].video,lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime});}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1);}productModalClosed(){this.selectedItem=null;}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause());}toggleMute(){this.muted.update(t=>!t);}async muteToggled(){await ce.set(`muted`,this.muted());let e=[this.muted()?`CE Video Muted`:`CE Video Unmuted`,{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e);}playActiveVideo(t=true){t&&this.pauseAll();let e=this.getCurrentVideoElement();e&&this.playVideo(e);}playVideo(t){t.currentTime=0,t.play().catch(e=>Y.error(e));}onVideoEnded(t){if(this.currentIndex<this.videoEntries.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else {let i=[`CE Last Video Ended`,{previous:this.getPreviousVideoDataForEvent()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t);}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videoEntries[this.currentIndex].video,this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let r=new Ir(`CE Video Changed`,{previous:e,current:this.currentVideoProps()},this.engagementTrigger);r.setVideos(this.videoEntries[this.currentIndex].video),window.CooeeSDK.sendEvent(r);}productCardClicked(t,e){let o=new Ir(`CE More Item Info Clicked`,{current:{videoID:e.id,videoIndex:this.currentIndex}},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t;}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===true&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:`auto`,e=0;this.isProductDetailView()&&(t=`auto`,e=10),this.swiperOptions.set({direction:this.isMobile?`vertical`:`horizontal`,effect:this.isMobile?`slide`:`coverflow`,slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:true,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:false},on:{init:i=>{this.swiperInitialized.set(true),setTimeout(()=>{i.update();},100);}},mousewheel:{enabled:!this.isMobile,invert:false,thresholdDelta:20}});}isProductDetailView(){return this.videoConfig.detailPopup.template===`PRODUCT_DETAIL_VIEW`}currentVideoProps(){return {videoID:this.videoEntries[this.currentIndex].video.id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videoEntries[this.currentIndex].video.id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null;}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height);}calculateOptimalVideoDimensions(){let t=this.videoEntries.map(u=>u.video.sources?.[0]).filter(u=>u?.width&&u?.height).map(u=>({width:u.width,height:u.height,aspectRatio:u.width/u.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,k=o/e.height,A=Math.min(r,k);return {width:Math.floor(e.width*A),height:Math.floor(e.height*A)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty(`--video-container-width`,`${t}px`),i.style.setProperty(`--video-container-height`,`${e}px`);}onResize(){this.applyOptimalVideoDimensions();}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&nc(Te,7)(Ie,5),e&2){let o;Rf(o=xf())&&(i.swiperComponent=o.first),Rf(o=xf())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Sf(`keydown.escape`,function(r){return i.onKeyDown(r)},Kg);},decls:10,vars:4,consts:[[`swiperComp`,``],[`closeButtonTemplate`,``],[`videoEl`,``],[1,`lc-shadow-inner`,3,`ngClass`],[1,`video-swiper`,3,`slideChange`,`options`,`navigationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-slide`],[1,`lc-desktop-controls`],[4,`ngTemplateOutlet`],[1,`lc-video-modal-row`],[1,`lc-video-container`],[1,`video-loading-overlay`],[`playsinline`,``,1,`lc-video-el`,3,`click`,`ended`,`loadstart`,`canplay`,`ngClass`,`muted`],[3,`src`,`type`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`item`,`similarItems`,`template`],[1,`loading-spinner`],[3,`video`],[1,`lc-video-controls`],[3,`mutedChange`,`toggled`,`muted`,`videoEl`],[1,`share-controls`],[3,`dialogState`],[1,`lc-card-container`],[3,`items`],[3,`card`],[3,`cardClick`,`items`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`closeClick`,`item`,`similarItems`,`template`],[`type`,`button`,`aria-label`,`Close`,1,`lc-close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`]],template:function(e,i){if(e&1&&(Ka(0,`div`,3)(1,`cooee-swiper`,4,0),Sf(`slideChange`,function(r){return i.onSlideChange(r)}),ec(3,5),wD(4,Re,10,10,`div`,6,Se),$o(),Ja(),Ka(6,`div`,7),lf(7,Ae,1,0,`ng-container`,8),Ja()(),lf(8,Be,2,0,`ng-template`,null,1,Sv)),e&2){let o=jD(9);yf(`ngClass`,i.viewTemplateClassName),ud(),yf(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),ud(3),_D(i.videoEntries),ud(3),yf(`ngTemplateOutlet`,o);}},dependencies:[Lt,Nt,Bt,P,S,TE,wE,jt,Rt,ye],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media(min-width:768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media(min-width:768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media(max-width:768px){.video-swiper>.swiper-button-prev{display:none!important}}@media(max-width:768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media(min-width:768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media(max-width:768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media(min-width:768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media(min-width:768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media(max-width:768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media(min-width:768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media(min-width:768px){.lc-product-detail-view .lc-video-container{width:50%}}@media(min-width:768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media(max-width:768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media(max-width:768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
|
|
7
7
|
`],encapsulation:3})};
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var videoDetailDialog_componentBv2Mhvsg = /*#__PURE__*/Object.freeze({
|
|
10
10
|
__proto__: null,
|
|
11
11
|
VideoDetailDialogComponent: Ee
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
export { f, l,
|
|
14
|
+
export { f, l, videoDetailDialog_componentBv2Mhvsg as v };
|
|
@@ -31,14 +31,14 @@ var Ui={schedule(n,t){let e=setTimeout(n,t);return ()=>clearTimeout(e)}};functio
|
|
|
31
31
|
`],encapsulation:3})};var $e=class n extends Fe{item;data=g(Ye);dialogRef=g(W);ItemDetailLayout=Ie$2;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item;}close(){this.dialogRef.close();}engagementTriggerReceived(t){}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-item-quick-view`]],features:[Xf(kt()),za],decls:1,vars:2,consts:[[3,`closeClick`,`item`,`layout`]],template:function(e,i){e&1&&(Ka(0,`cooee-item-detail`,0),Sf(`closeClick`,function(){return i.close()}),Ja()),e&2&&yf(`item`,i.item)(`layout`,i.ItemDetailLayout.TWO_PANE);},dependencies:[Nt],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media(min-width:768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
|
|
32
32
|
`],encapsulation:3})};var Ue=class n{dialog=g(Ro);dialogRef;constructor(){}showItemQuickView(t,e){this.dialogRef=this.dialog.open($e,{width:`100vw`,height:`100dvh`,backdropClass:[`letscooee-backdrop`],data:{item:e,triggerContext:t}});}static ɵfac=function(e){return new(e||n)};static ɵprov=C({token:n,factory:n.ɵfac,providedIn:`root`})};var uo=(n,t)=>({enter:n,exit:t});function fo(n,t){if(n&1&&(Ka(0,`div`,7),uv(1),Ja(),Ka(2,`div`,8),uv(3),Ja()),n&2){let e=kD(2);ud(),ic(` `,e.getCurrency(e.selectedVariant().price.cmp),` `),ud(2),ic(` `,e.getDiscountPercentage(e.selectedVariant().price),`% off `);}}function go(n,t){if(n&1&&(Ka(0,`div`,6),uv(1),Ja()),n&2){let e=kD(2);ud(),ic(` `,e.stickyATCConfig.leftText,` `);}}function vo(n,t){if(n&1&&(Ka(0,`div`,1)(1,`div`,5),uv(2),Ja(),vD(3,fo,4,2),vD(4,go,2,1,`div`,6),Ja()),n&2){let e=kD();ud(2),ic(` `,e.getCurrency(e.selectedVariant().price.d),` `),ud(),ED(e.selectedVariant().price.cmp?3:-1),ud(),ED(e.stickyATCConfig.leftText?4:-1);}}function ho(n,t){if(n&1&&(Ka(0,`div`,9),uv(1),Ja()),n&2){let e=t.$implicit,i=t.$index;kD(2);let a=hv(5);yf(`ngClass`,Cv(2,uo,i===a.currentIndex,i===a.previousIndex)),ud(),ic(` `,e,` `);}}function Co(n,t){if(n&1&&(Ka(0,`div`,4),wD(1,ho,2,5,`div`,9,ID),Ja()),n&2){kD();let e=hv(5);ud(),_D(e.features);}}var Qe=class n extends Fe{currentItem;stickyATCConfig;selectedVariant=Mt$2(void 0);featureSlider=Mt$2({features:[],currentIndex:0});constructor(){super();}onVariantChange(t){this.currentItem&&(this.currentItem.setSelectedVariantByID(t.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value));}engagementTriggerReceived(t){this.stickyATCConfig=t.stickyATCConfig??{},this.currentItem=t.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation();}update(){}getCurrency(t){return Cr$1(t)}getDiscountPercentage(t){return ((t.cmp-t.d)/t.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(pe$2.ADD_TO_CART,{item:this.currentItem});}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let t=this.stickyATCConfig.rightText.split(`
|
|
33
33
|
`),e=t.length===1?null:setInterval(()=>{this.featureSlider.update(i=>s(r({},i),{previousIndex:i.currentIndex,currentIndex:(i.currentIndex+1)%i.features.length}));},3e3);this.featureSlider.set({intervalRef:e,currentIndex:0,features:t});}replaceVariables(t){return t?qe$2(t,this.currentItem.getTemplateVariables(),this.triggerContext):``}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-sticky-atc`]],hostBindings:function(e,i){e&1&&Sf(`letscooee:variant-change`,function(s){return i.onVariantChange(s)},Jg);},features:[Xf(kt()),za],decls:7,vars:3,consts:[[1,`lc-wrapper`],[1,`lc-prices`],[1,`lc-button-wrapper`],[`type`,`button`,1,`lc-button`,`lc-button-atc`,3,`click`],[1,`lc-features`],[1,`lc-sale-price`],[1,`lc-additional-text`],[1,`lc-compare-price`],[1,`lc-discount-label`],[1,`lc-feature`,3,`ngClass`]],template:function(e,i){if(e&1&&(Ka(0,`div`,0),vD(1,vo,5,3,`div`,1),Ka(2,`div`,2)(3,`button`,3),Sf(`click`,function(){return i.addToCart()}),uv(4,`Add To Cart`),Ja(),Qf(5),vD(6,Co,3,0,`div`,4),Ja()()),e&2){ud(),ED(i.selectedVariant()&&i.stickyATCConfig.showProductInfo?1:-1),ud(4);let a=pv(i.featureSlider());ud(),ED(a.features.length?6:-1);}},dependencies:[wE],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media(min-width:768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
|
|
34
|
-
`],encapsulation:3})};var yo=[`videoEl`];async function hi(){return (await import('./video-detail-dialog.component-LxhnmfX6-DWRv7oCM.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var me=class n extends Fe{videoElements;videoEntries;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),hi();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videoEntries=this.videoConfig.videoEntries;}onMuteToggled(t,e){t||this.videoElements.forEach(i=>{i.nativeElement!==e&&(i.nativeElement.muted=true,i.nativeElement.pause());});}sendTriggerClicked(t,e){this.sendEvent(`CE Trigger Clicked`,{},t,e);}async onVideoTap(t,e,i,a,s){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){a&&(a.muted=false,a.play(),this.onMuteToggled(false,a));return}await this.openDialog(e,i,s);}sendEvent(t,e,i,a){let s=new Ir$1(t,e,this.engagementTrigger);s.setVideos(i),a&&(s.items=[a.toEmbed()]),window.CooeeSDK.sendEvent(s);}onDialogClosed(){this.resumePlaylistVideos();}isVideoLoading(t){return this.videoLoadingStates.get(t)??true}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}playVideo(t){t.play().catch(e=>{Y$1.error(`Failed to play video:`,e);});}setupIntersectionObserver(t=.5,e=`50px`){this.intersectionObserver=new IntersectionObserver(i=>{i.forEach(a=>{let s=a.target,l=s.dataset.videoId;l&&(a.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(s,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(s,false)));});},{threshold:t,rootMargin:e}),setTimeout(()=>{this.videoElements.forEach(i=>{this.intersectionObserver?.observe(i.nativeElement);});},100);}handleVideoVisibilityChange(t,e){e?this.onVideoBecameVisible(t):t.pause();}onVideoBecameVisible(t){this.playVideo(t);}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(t=>{let e=t.nativeElement;e.paused||(this.pausedVideos.push(e),e.pause());});}resumePlaylistVideos(){this.pausedVideos.forEach(t=>{t.play().catch(()=>{});}),this.pausedVideos=[];}async checkAndOpenVideoFromUrl(){let t=We$3();if(!t||!this.videoEntries)return;let e=Je$1();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$2)return;let i=this.videoEntries.findIndex(a=>a.video.shortID===+t);if(i!==-1){let a=this.videoEntries[i].video;await ce$3.set(`muted`,true),await this.openDialog(a,i);}}async openDialog(t,e,i){await Hi$1();let a={videoEntries:this.videoEntries,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let s=await hi();this.dialogRef=this.dialog.open(s,{width:`100vw`,height:`100vh`,data:a,providers:Qt(this.triggerContext,{video:t,index:e}),disableClose:true});let l={videoID:t.id,videoIndex:e};this.sendEvent(`CE Video Dialog Opened`,{current:l},t),this.dialogRef.closed.subscribe(d=>{if(this.dialogRef=null,!d)return;let f=d.lastVideoDuration*1e3,A={videoID:d.lastVideo.id,videoIndex:d.lastVideoIndex,playedTillMS:f,playedTillPercent:f/d.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:A},d.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&nc(yo,5),e&2){let a;Rf(a=xf())&&(i.videoElements=a);}},features:[za],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var ue=class n{video=Ub.required({alias:`cooeeVideoSources`});prioritySource=Ub(`high`);elementRef=g(Se$1);constructor(){Cs(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(s=>s.remove()),i===`best`?(this.addSource(e.bestSource),this.addSource(e.highSource),this.addSource(e.lowSource)):i===`low`?(this.addSource(e.lowSource),this.addSource(e.highSource),this.addSource(e.bestSource)):(this.addSource(e.highSource),this.addSource(e.bestSource),this.addSource(e.lowSource)),this.addSource(e.m3u8Source),t.load();}addSource(t){if(!t)return;let e=document.createElement(`source`);e.src=t.url,e.type=t.mimeType,this.elementRef.nativeElement.appendChild(e);}static ɵfac=function(e){return new(e||n)};static ɵdir=hn$1({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var _o=(n,t)=>t.video.id;function xo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function bo(n,t){n&1&&(Ka(0,`div`,6),Df(1,`div`,12),Ja());}function wo(n,t){if(n&1){let e=ND();Ka(0,`cooee-mute-toggle`,13),Sf(`toggled`,function(a){fu(e),kD();let s=jD(7);return pu(kD().onMuteToggled(a,s))}),Ja();}if(n&2){kD();let e=jD(7);yf(`muted`,e.muted)(`videoEl`,e);}}function Vo(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,16),Sf(`cardClick`,function(a){fu(e);let s=kD(2).$index,l=jD(7),d=hv(0);return pu(kD().onItemCardClick(a,d,s,l))}),Ja();}if(n&2){kD(2);yf(`items`,hv(0).items)(`centeredSlides`,false);}}function Eo(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-card`,17),Sf(`buttonClick`,function(){fu(e);let a=kD(2).$index,s=jD(7),l=hv(0);return pu(kD().addToCartClicked(null,l,a,s))})(`click`,function(){fu(e);let a=kD(2).$index,s=jD(7),l=hv(0),d=hv(1);return pu(kD().onItemCardClick(d,l,a,s))}),Ja();}if(n&2){kD(2);yf(`item`,hv(1));}}function To(n,t){if(n&1&&vD(0,Vo,1,2,`cooee-video-promoted-items`,14)(1,Eo,1,1,`cooee-item-card`,15),n&2){kD();let e=hv(0),i=kD();ED(hv(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function So(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-card`,18),Sf(`linkClicked`,function(){fu(e),kD();let a=hv(0);return pu(kD().sendTriggerClicked(a))}),Ja();}if(n&2){kD();yf(`card`,hv(2));}}function Io(n,t){if(n&1){let e=ND();Qf(0)(1)(2),Ka(3,`div`,4)(4,`div`,5),Sf(`click`,function(a){let s=fu(e).$index,l=jD(7),d=hv(0);return pu(kD().onVideoTap(a,d,s,l))})(`keydown.enter`,function(a){let s=fu(e).$index,l=jD(7),d=hv(0);return pu(kD().onVideoTap(a,d,s,l))})(`keydown.space`,function(a){let s=fu(e).$index,l=jD(7),d=hv(0);return pu(kD().onVideoTap(a,d,s,l))}),vD(5,bo,2,0,`div`,6),Ka(6,`video`,7,0),Sf(`mouseenter`,function(){fu(e);let a=jD(7);kD();return pu(hv(1)&&a.play())})(`mouseleave`,function(){fu(e);let a=jD(7);kD();return pu(hv(1)&&a.pause())})(`loadstart`,function(){fu(e);let a=hv(0);return pu(kD().onVideoLoadStart(a.id))})(`canplay`,function(){fu(e);let a=hv(0);return pu(kD().onVideoCanPlay(a.id))}),Ja(),Ka(8,`div`,8),vD(9,wo,1,2,`cooee-mute-toggle`,9),Ja()(),Ka(10,`div`,10),vD(11,To,2,1)(12,So,1,1,`cooee-video-card`,11),Ja()();}if(n&2){let e=t.$implicit,i=kD(),a=hv(0),s=hv(2),l=pv(e.video);ud(),pv(l.items[0]),ud();let f=pv(l.card)&&s===i.VideoConfigFooterContent.CARD;ud(2),rc(`background-image`,l.thumbnail?`url(`+l.thumbnail+`)`:null),ud(),ED(i.isVideoLoading(l.id)?5:-1),ud(),yf(`cooeeVideoSources`,l)(`muted`,true),mf(`poster`,l.thumbnail)(`preload`,a?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,l.id),ud(3),ED(i.videoConfig.showMuteButton?9:-1),ud(2),ED(i.videoConfig.showItems()?11:f?12:-1);}}var Ze=class n extends me{VideoConfigFooterContent=se$2;VideoConfigAutoPlay=oe$2;swiperOptions=null;constructor(){super(),this.hasSwiper=true;}ngAfterViewInit(){super.ngAfterViewInit();let t=this.videoConfig.playlistConfig.videoSwiper,e=t?(this.isMobile?t.gapSm:t.gap)+`px`:window.cooeePlaylistGap??24,i=t?this.isMobile?t.maxInRowSm:t.maxInRow:`auto`;this.swiperOptions={direction:`horizontal`,effect:`slide`,loop:t?.loop,freeMode:true,spaceBetween:e,slidesPerView:i,mousewheel:{enabled:true,forceToAxis:true},autoplay:t?.autoplay?.enabled?{delay:t?.autoplay?.delay,disableOnInteraction:false}:false},this.setupIntersectionObserver(),this.playFirstVideo();}ngOnDestroy(){super.ngOnDestroy();}addToCartClicked(t,e,i,a){let s=e.items?.[0],l=he$4.get().website?.canChangeVariantInCart;if(e.items?.length>1||s?.hasVariants()&&!l){this.onItemCardClick(s,e,i,a);return}this.engagementService.executeCTA(pe$2.ADD_TO_CART,{item:s,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(pe$2.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,a){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,a,t):this.onVideoTap(null,e,i,a);}update(){}onVideoCanPlay(t){if(super.onVideoCanPlay(t),!this.shouldAutoPlay()||this.dialogRef||!this.visibleVideos.has(t))return;let e=this.videoElements.find(i=>i.nativeElement.dataset.videoId===t)?.nativeElement;e&&this.playVideo(e);}onVideoBecameVisible(t){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(t):this.playVideo(t));}shouldAutoPlay(){return this.videoConfig.autoPlay===`ON`||this.videoConfig.autoPlay===`ON_HOVER`&&this.isMobile}playFirstVideo(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-playlist`]],features:[Xf(kt()),za],decls:8,vars:7,consts:[[`videoEl`,``],[1,`heading-text`,3,`innerHTML`],[3,`options`,`navigationConfig`,`paginationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-card`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Play video`,`aria-haspopup`,`dialog`,1,`video-wrapper`,3,`click`,`keydown.enter`,`keydown.space`],[1,`video-loading-overlay`],[`width`,`100%`,`playsinline`,``,`loop`,``,3,`mouseenter`,`mouseleave`,`loadstart`,`canplay`,`cooeeVideoSources`,`muted`],[1,`video-controls`],[3,`muted`,`videoEl`],[`role`,`region`,`aria-label`,`Video details`,1,`video-footer`],[3,`card`],[1,`loading-spinner`],[3,`toggled`,`muted`,`videoEl`],[3,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`item`],[3,`cardClick`,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`buttonClick`,`click`,`item`],[3,`linkClicked`,`card`]],template:function(e,i){if(e&1&&(Qf(0)(1)(2),vD(3,xo,2,3,`div`,1),Ka(4,`cooee-swiper`,2),ec(5,3),wD(6,Io,13,14,`div`,4,_o),$o(),Ja()),e&2){pv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),ud(),pv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),ud(),pv(i.videoConfig.footerContent),ud(),ED(i.videoConfig.heading?3:-1);let a=i.videoConfig.playlistConfig.videoSwiper;ud(),yf(`options`,i.swiperOptions)(`navigationConfig`,a==null?null:a.navigation)(`paginationConfig`,a==null?null:a.pagination),ud(2),_D(i.videoEntries);}},dependencies:[Bt,jt,Rt,de,ue,Lt,a],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media(max-width:768px),(prefers-reduced-motion:reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
|
|
34
|
+
`],encapsulation:3})};var yo=[`videoEl`];async function hi(){return (await import('./video-detail-dialog.component-Bv2Mhvsg-BuJ85JuU.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var me=class n extends Fe{videoElements;videoEntries;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),hi();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videoEntries=this.videoConfig.videoEntries;}onMuteToggled(t,e){t||this.videoElements.forEach(i=>{i.nativeElement!==e&&(i.nativeElement.muted=true,i.nativeElement.pause());});}sendTriggerClicked(t,e){this.sendEvent(`CE Trigger Clicked`,{},t,e);}async onVideoTap(t,e,i,a,s){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){a&&(a.muted=false,a.play(),this.onMuteToggled(false,a));return}await this.openDialog(e,i,s);}sendEvent(t,e,i,a){let s=new Ir$1(t,e,this.engagementTrigger);s.setVideos(i),a&&(s.items=[a.toEmbed()]),window.CooeeSDK.sendEvent(s);}onDialogClosed(){this.resumePlaylistVideos();}isVideoLoading(t){return this.videoLoadingStates.get(t)??true}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}playVideo(t){t.play().catch(e=>{Y$1.error(`Failed to play video:`,e);});}setupIntersectionObserver(t=.5,e=`50px`){this.intersectionObserver=new IntersectionObserver(i=>{i.forEach(a=>{let s=a.target,l=s.dataset.videoId;l&&(a.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(s,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(s,false)));});},{threshold:t,rootMargin:e}),setTimeout(()=>{this.videoElements.forEach(i=>{this.intersectionObserver?.observe(i.nativeElement);});},100);}handleVideoVisibilityChange(t,e){e?this.onVideoBecameVisible(t):t.pause();}onVideoBecameVisible(t){this.playVideo(t);}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(t=>{let e=t.nativeElement;e.paused||(this.pausedVideos.push(e),e.pause());});}resumePlaylistVideos(){this.pausedVideos.forEach(t=>{t.play().catch(()=>{});}),this.pausedVideos=[];}async checkAndOpenVideoFromUrl(){let t=We$3();if(!t||!this.videoEntries)return;let e=Je$1();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$2)return;let i=this.videoEntries.findIndex(a=>a.video.shortID===+t);if(i!==-1){let a=this.videoEntries[i].video;await ce$3.set(`muted`,true),await this.openDialog(a,i);}}async openDialog(t,e,i){await Hi$1();let a={videoEntries:this.videoEntries,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let s=await hi();this.dialogRef=this.dialog.open(s,{width:`100vw`,height:`100vh`,data:a,providers:Qt(this.triggerContext,{video:t,index:e}),disableClose:true});let l={videoID:t.id,videoIndex:e};this.sendEvent(`CE Video Dialog Opened`,{current:l},t),this.dialogRef.closed.subscribe(d=>{if(this.dialogRef=null,!d)return;let f=d.lastVideoDuration*1e3,A={videoID:d.lastVideo.id,videoIndex:d.lastVideoIndex,playedTillMS:f,playedTillPercent:f/d.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:A},d.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&nc(yo,5),e&2){let a;Rf(a=xf())&&(i.videoElements=a);}},features:[za],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var ue=class n{video=Ub.required({alias:`cooeeVideoSources`});prioritySource=Ub(`high`);elementRef=g(Se$1);constructor(){Cs(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(s=>s.remove()),i===`best`?(this.addSource(e.bestSource),this.addSource(e.highSource),this.addSource(e.lowSource)):i===`low`?(this.addSource(e.lowSource),this.addSource(e.highSource),this.addSource(e.bestSource)):(this.addSource(e.highSource),this.addSource(e.bestSource),this.addSource(e.lowSource)),this.addSource(e.m3u8Source),t.load();}addSource(t){if(!t)return;let e=document.createElement(`source`);e.src=t.url,e.type=t.mimeType,this.elementRef.nativeElement.appendChild(e);}static ɵfac=function(e){return new(e||n)};static ɵdir=hn$1({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var _o=(n,t)=>t.video.id;function xo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function bo(n,t){n&1&&(Ka(0,`div`,6),Df(1,`div`,12),Ja());}function wo(n,t){if(n&1){let e=ND();Ka(0,`cooee-mute-toggle`,13),Sf(`toggled`,function(a){fu(e),kD();let s=jD(7);return pu(kD().onMuteToggled(a,s))}),Ja();}if(n&2){kD();let e=jD(7);yf(`muted`,e.muted)(`videoEl`,e);}}function Vo(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,16),Sf(`cardClick`,function(a){fu(e);let s=kD(2).$index,l=jD(7),d=hv(0);return pu(kD().onItemCardClick(a,d,s,l))}),Ja();}if(n&2){kD(2);yf(`items`,hv(0).items)(`centeredSlides`,false);}}function Eo(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-card`,17),Sf(`buttonClick`,function(){fu(e);let a=kD(2).$index,s=jD(7),l=hv(0);return pu(kD().addToCartClicked(null,l,a,s))})(`click`,function(){fu(e);let a=kD(2).$index,s=jD(7),l=hv(0),d=hv(1);return pu(kD().onItemCardClick(d,l,a,s))}),Ja();}if(n&2){kD(2);yf(`item`,hv(1));}}function To(n,t){if(n&1&&vD(0,Vo,1,2,`cooee-video-promoted-items`,14)(1,Eo,1,1,`cooee-item-card`,15),n&2){kD();let e=hv(0),i=kD();ED(hv(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function So(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-card`,18),Sf(`linkClicked`,function(){fu(e),kD();let a=hv(0);return pu(kD().sendTriggerClicked(a))}),Ja();}if(n&2){kD();yf(`card`,hv(2));}}function Io(n,t){if(n&1){let e=ND();Qf(0)(1)(2),Ka(3,`div`,4)(4,`div`,5),Sf(`click`,function(a){let s=fu(e).$index,l=jD(7),d=hv(0);return pu(kD().onVideoTap(a,d,s,l))})(`keydown.enter`,function(a){let s=fu(e).$index,l=jD(7),d=hv(0);return pu(kD().onVideoTap(a,d,s,l))})(`keydown.space`,function(a){let s=fu(e).$index,l=jD(7),d=hv(0);return pu(kD().onVideoTap(a,d,s,l))}),vD(5,bo,2,0,`div`,6),Ka(6,`video`,7,0),Sf(`mouseenter`,function(){fu(e);let a=jD(7);kD();return pu(hv(1)&&a.play())})(`mouseleave`,function(){fu(e);let a=jD(7);kD();return pu(hv(1)&&a.pause())})(`loadstart`,function(){fu(e);let a=hv(0);return pu(kD().onVideoLoadStart(a.id))})(`canplay`,function(){fu(e);let a=hv(0);return pu(kD().onVideoCanPlay(a.id))}),Ja(),Ka(8,`div`,8),vD(9,wo,1,2,`cooee-mute-toggle`,9),Ja()(),Ka(10,`div`,10),vD(11,To,2,1)(12,So,1,1,`cooee-video-card`,11),Ja()();}if(n&2){let e=t.$implicit,i=kD(),a=hv(0),s=hv(2),l=pv(e.video);ud(),pv(l.items[0]),ud();let f=pv(l.card)&&s===i.VideoConfigFooterContent.CARD;ud(2),rc(`background-image`,l.thumbnail?`url(`+l.thumbnail+`)`:null),ud(),ED(i.isVideoLoading(l.id)?5:-1),ud(),yf(`cooeeVideoSources`,l)(`muted`,true),mf(`poster`,l.thumbnail)(`preload`,a?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,l.id),ud(3),ED(i.videoConfig.showMuteButton?9:-1),ud(2),ED(i.videoConfig.showItems()?11:f?12:-1);}}var Ze=class n extends me{VideoConfigFooterContent=se$2;VideoConfigAutoPlay=oe$2;swiperOptions=null;constructor(){super(),this.hasSwiper=true;}ngAfterViewInit(){super.ngAfterViewInit();let t=this.videoConfig.playlistConfig.videoSwiper,e=t?(this.isMobile?t.gapSm:t.gap)+`px`:window.cooeePlaylistGap??24,i=t?this.isMobile?t.maxInRowSm:t.maxInRow:`auto`;this.swiperOptions={direction:`horizontal`,effect:`slide`,loop:t?.loop,freeMode:true,spaceBetween:e,slidesPerView:i,mousewheel:{enabled:true,forceToAxis:true},autoplay:t?.autoplay?.enabled?{delay:t?.autoplay?.delay,disableOnInteraction:false}:false},this.setupIntersectionObserver(),this.playFirstVideo();}ngOnDestroy(){super.ngOnDestroy();}addToCartClicked(t,e,i,a){let s=e.items?.[0],l=he$4.get().website?.canChangeVariantInCart;if(e.items?.length>1||s?.hasVariants()&&!l){this.onItemCardClick(s,e,i,a);return}this.engagementService.executeCTA(pe$2.ADD_TO_CART,{item:s,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(pe$2.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,a){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,a,t):this.onVideoTap(null,e,i,a);}update(){}onVideoCanPlay(t){if(super.onVideoCanPlay(t),!this.shouldAutoPlay()||this.dialogRef||!this.visibleVideos.has(t))return;let e=this.videoElements.find(i=>i.nativeElement.dataset.videoId===t)?.nativeElement;e&&this.playVideo(e);}onVideoBecameVisible(t){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(t):this.playVideo(t));}shouldAutoPlay(){return this.videoConfig.autoPlay===`ON`||this.videoConfig.autoPlay===`ON_HOVER`&&this.isMobile}playFirstVideo(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-playlist`]],features:[Xf(kt()),za],decls:8,vars:7,consts:[[`videoEl`,``],[1,`heading-text`,3,`innerHTML`],[3,`options`,`navigationConfig`,`paginationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-card`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Play video`,`aria-haspopup`,`dialog`,1,`video-wrapper`,3,`click`,`keydown.enter`,`keydown.space`],[1,`video-loading-overlay`],[`width`,`100%`,`playsinline`,``,`loop`,``,3,`mouseenter`,`mouseleave`,`loadstart`,`canplay`,`cooeeVideoSources`,`muted`],[1,`video-controls`],[3,`muted`,`videoEl`],[`role`,`region`,`aria-label`,`Video details`,1,`video-footer`],[3,`card`],[1,`loading-spinner`],[3,`toggled`,`muted`,`videoEl`],[3,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`item`],[3,`cardClick`,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`buttonClick`,`click`,`item`],[3,`linkClicked`,`card`]],template:function(e,i){if(e&1&&(Qf(0)(1)(2),vD(3,xo,2,3,`div`,1),Ka(4,`cooee-swiper`,2),ec(5,3),wD(6,Io,13,14,`div`,4,_o),$o(),Ja()),e&2){pv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),ud(),pv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),ud(),pv(i.videoConfig.footerContent),ud(),ED(i.videoConfig.heading?3:-1);let a=i.videoConfig.playlistConfig.videoSwiper;ud(),yf(`options`,i.swiperOptions)(`navigationConfig`,a==null?null:a.navigation)(`paginationConfig`,a==null?null:a.pagination),ud(2),_D(i.videoEntries);}},dependencies:[Bt,jt,Rt,de,ue,Lt,a],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media(max-width:768px),(prefers-reduced-motion:reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
|
|
35
35
|
`],encapsulation:3})};var Mo=[`videoElement`],ko=n=>({"cursor-grab":n}),We=class n extends me{videoElement;video;isDragging=false;hidden=false;cdkDrag=g(ge$1,{self:true});untilDestroyed=Pt();constructor(){super();}get popupClasses(){return this.hidden?[`hidden`]:[`visible`]}onClick(t){t.stopPropagation(),t.preventDefault(),this.onVideoClick();}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.closest(`.letscooee-engagement`);t&&(t.style.zIndex=`10000`),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=true);}ngAfterViewInit(){super.ngAfterViewInit(),setTimeout(()=>{this.autoPlay();},100);}onVideoClick(){if(this.isDragging){this.isDragging=false;return}this.hidden=true,this.onVideoTap(null,this.video,0);}close(){this.hidden=true;let t=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent(`CE Trigger Closed`,{duration:t});}engagementTriggerReceived(t){super.engagementTriggerReceived(t),this.video=this.videoEntries[0].video;}update(){}onDialogClosed(){this.hidden=false;}autoPlay(){let t=this.videoElement.nativeElement;this.hidden||this.playVideo(t);}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-popup`]],viewQuery:function(e,i){if(e&1&&nc(Mo,5),e&2){let a;Rf(a=xf())&&(i.videoElement=a.first);}},hostAttrs:[`role`,`button`,`tabindex`,`0`,`aria-label`,`Open video popup `,`cdkDragBoundary`,`body`],hostVars:2,hostBindings:function(e,i){e&1&&Sf(`keydown.enter`,function(s){return i.onClick(s)})(`keydown.space`,function(s){return i.onClick(s)})(`click`,function(s){return i.onClick(s)}),e&2&&XD(i.popupClasses);},features:[Xf(kt()),iD([{directive:ge$1,inputs:[`cdkDragBoundary`,`cdkDragBoundary`]}]),za],decls:9,vars:5,consts:[[`videoElement`,``],[1,`popup-inner`,3,`ngClass`],[`type`,`button`,`aria-label`,`Close video popup`,1,`close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`],[1,`play-button`],[`name`,`unmute`,`aria-hidden`,`true`],[1,`text`],[`loop`,``,`preload`,`metadata`,`playsinline`,``,3,`muted`,`cooeeVideoSources`]],template:function(e,i){if(e&1){let a=ND();Ka(0,`div`,1)(1,`button`,2),Sf(`click`,function(l){return fu(a),l.stopPropagation(),pu(i.close())}),Df(2,`cooee-icon`,3),Ja(),Ka(3,`div`,4),Df(4,`cooee-icon`,5),Ka(5,`div`,6),uv(6,`Tap to unmute`),Ja()(),Df(7,`video`,7,0),Ja();}e&2&&(yf(`ngClass`,Ev(3,ko,i.isDragging)),ud(7),yf(`muted`,true)(`cooeeVideoSources`,i.video));},dependencies:[wE,ye,ue],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px;background-color:#fff}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
|
|
36
36
|
`],encapsulation:3})};var Po=(n,t)=>t.video.id;function Fo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function Do(n,t){n&1&&(Ka(0,`div`,9),Df(1,`div`,12),Ja());}function Ao(n,t){if(n&1&&(Ka(0,`div`,11),uv(1),Ja()),n&2){let e=kD().$implicit;ud(),Wf(e.title);}}function Lo(n,t){if(n&1){let e=ND();Ka(0,`div`,4),Sf(`click`,function(a){let s=fu(e),l=s.$implicit,d=s.$index;return pu(kD().onVideoTap(a,l.video,d))})(`keydown.enter`,function(a){let s=fu(e),l=s.$implicit,d=s.$index;return pu(kD().onVideoTap(a,l.video,d))})(`keydown.space`,function(a){let s=fu(e),l=s.$implicit,d=s.$index;return pu(kD().onVideoTap(a,l.video,d))}),_u(),Ka(1,`svg`,5),Df(2,`circle`,6)(3,`circle`,7),Ja(),Tu(),Ka(4,`div`,8),vD(5,Do,2,0,`div`,9),Ka(6,`video`,10,0),Sf(`loadstart`,function(){let a=fu(e).$implicit;return pu(kD().onVideoLoadStart(a.video.id))})(`canplay`,function(){let a=fu(e).$implicit;return pu(kD().onVideoCanPlay(a.video.id))}),Ja()(),vD(8,Ao,2,1,`div`,11),Ja();}if(n&2){let e=t.$implicit,i=t.$index,a=kD();mf(`aria-label`,`Open video story `+(i+1)),ud(5),ED(a.isVideoLoading(e.video.id)?5:-1),ud(),yf(`poster`,e.video.thumbnail)(`cooeeVideoSources`,e.video)(`prioritySource`,`low`)(`muted`,true),mf(`data-video-id`,e.video.id),ud(2),ED(e.title?8:-1);}}var qe=class n extends me{constructor(){super();}ngAfterViewInit(){super.ngAfterViewInit(),this.setupIntersectionObserver();}ngOnDestroy(){super.ngOnDestroy();}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-stories`]],features:[Xf(kt()),za],decls:4,vars:1,consts:[[`videoEl`,``],[1,`heading-text`,3,`innerHTML`],[1,`video-stories`],[`role`,`button`,`tabindex`,`0`,1,`video-story`],[`role`,`button`,`tabindex`,`0`,1,`video-story`,3,`click`,`keydown.enter`,`keydown.space`],[`viewBox`,`0 0 100 100`],[`cx`,`50`,`cy`,`50`,`r`,`48`,`fill`,`none`,`stroke-width`,`4`],[`cx`,`50`,`cy`,`50`,`r`,`48`,`fill`,`none`,`stroke-width`,`4`,`stroke-linecap`,`round`,`stroke-dasharray`,`301.6`,`stroke-dashoffset`,`301.6`,1,`video-story-circle`],[1,`video-wrapper`],[1,`video-loading-overlay`],[`loop`,``,`playsinline`,``,`preload`,`metadata`,3,`loadstart`,`canplay`,`poster`,`cooeeVideoSources`,`prioritySource`,`muted`],[1,`video-story-title`],[1,`loading-spinner`]],template:function(e,i){e&1&&(vD(0,Fo,2,3,`div`,1),Ka(1,`div`,2),wD(2,Lo,9,8,`div`,3,Po),Ja()),e&2&&(ED(i.videoConfig.heading?0:-1),ud(2),_D(i.videoEntries));},dependencies:[ue,a],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media(max-width:768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;cursor:pointer;flex-shrink:0}.video-story .video-story-title{margin-top:.25rem;font-size:.7rem;line-height:1.1;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{position:relative;width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px;position:relative;z-index:1}.video-story .video-wrapper .video-loading-overlay{border-radius:9999px}
|
|
37
|
-
`],encapsulation:3})};async function Ha(){let n=await UE(fi),t=(e,i)=>{let a=ui(e,{injector:n.injector});customElements.get(i)||customElements.define(i,a);};t(Qe,`cooee-sticky-atc`),t(ze,`cooee-savings-bar`),t(je,`cooee-progressbar`),t(Ze,`cooee-video-playlist`),t(We,`cooee-video-popup`),t(qe,`cooee-video-stories`),t(ke,`cooee-product-options-picker`),t(Be,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-
|
|
37
|
+
`],encapsulation:3})};async function Ha(){let n=await UE(fi),t=(e,i)=>{let a=ui(e,{injector:n.injector});customElements.get(i)||customElements.define(i,a);};t(Qe,`cooee-sticky-atc`),t(ze,`cooee-savings-bar`),t(je,`cooee-progressbar`),t(Ze,`cooee-video-playlist`),t(We,`cooee-video-popup`),t(qe,`cooee-video-stories`),t(ke,`cooee-product-options-picker`),t(Be,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-BPUPrXVH-BebqKEvo.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Ue).showItemQuickView(e,i);};}
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var widgetsYcHQyo19 = /*#__PURE__*/Object.freeze({
|
|
40
40
|
__proto__: null,
|
|
41
41
|
loadAngularWidgets: Ha
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
export { $o as $, Rf as A, Bt as B, xf as C, Df as D, $b as E, Ro as F, Ge as G, Ho as H, ID as I, Ja as J, Ke as K, Lt as L, Mf as M, Nt as N, Ft$2 as O, Cs as P, rc as Q, Rt as R, Sf as S, Tv as T, Ub as U, Vo$1 as V, Wf as W, Xa as X, Yg as Y, mf as Z, _D as _, a, ND as a0, vD as a1, fu as a2, pu as a3, kD as a4, ED as a5, Ef as a6, gv as a7, Zf as a8, qf as a9, fv as aa, Sv as ab, Kg as ac,
|
|
44
|
+
export { $o as $, Rf as A, Bt as B, xf as C, Df as D, $b as E, Ro as F, Ge as G, Ho as H, ID as I, Ja as J, Ke as K, Lt as L, Mf as M, Nt as N, Ft$2 as O, Cs as P, rc as Q, Rt as R, Sf as S, Tv as T, Ub as U, Vo$1 as V, Wf as W, Xa as X, Yg as Y, mf as Z, _D as _, a, ND as a0, vD as a1, fu as a2, pu as a3, kD as a4, ED as a5, Ef as a6, gv as a7, Zf as a8, qf as a9, fv as aa, Sv as ab, Kg as ac, widgetsYcHQyo19 as ad, bE as b, ud as c, Iv as d, _f as e, _v as f, ge$1 as g, g as h, iD as i, W as j, Ka as k, Mt$2 as l, Ye as m, Se$1 as n, of as o, TE as p, wE as q, jt as r, ec as s, lf as t, uv as u, jD as v, wD as w, yf as x, ye as y, nc as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letscooee/web-sdk",
|
|
3
3
|
"description": "Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent",
|
|
4
|
-
"version": "14.2.
|
|
4
|
+
"version": "14.2.4",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "bash .dev/setup.sh",
|
|
7
7
|
"lint": "ng lint",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@letscooee/url-builder": "^0.0.5",
|
|
82
82
|
"@preact/signals": "^1.2.3",
|
|
83
83
|
"@sentry/browser": "9.42.0",
|
|
84
|
-
"@tailwindcss/oxide-linux-x64-gnu": "^4.2.
|
|
84
|
+
"@tailwindcss/oxide-linux-x64-gnu": "^4.2.4",
|
|
85
85
|
"@tailwindcss/postcss": "^4.0.8",
|
|
86
86
|
"bson": "^4.6.5",
|
|
87
87
|
"canvas-confetti": "^1.9.3",
|