PageSourceSearch

https://laylasleep.com/_next/static/chunks/6166-0e71b7b4f11e5c96.js

js laylasleep.com collected 2026-10-02 06:21:00 UTC 29,073 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6166],{26166:(e,t,i)=>{i.d(t,{default:()=>_});var a=i(8106),n=i(4319),r=i(33843),o=i(83576),d=i(27196),c=i(85865),l=i(38248),u=i(15037);let s={open:!1,firstLoad:!0,syncing:!0,loading:!0,list:[]},p=(0,a.v)((0,n.lt)((0,n.kg)(s,(e,t)=>{let a=e=>e.filter(e=>981921!==e),n=async t=>{let{id:a,prop:n,value:r,updateCartState:o=!0}=t,{SecureCart:d}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),c=new d;c.update(a,n,r),o&&e(e=>({...e,list:c.list()}))},r=async n=>{let{product:r,variation:s,clicked_from:p="buy_box"}=n;try{var _,m,y,g,v,w;let{SecureCart:n}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),k=new n,f=[];if(s.quantity=Math.ceil(s.quantity),s.quantity>100&&(s.quantity=100),14023===s.parent_id&&[1399,1400].includes(s.id)){let e=t().list.find(e=>e.id===s.id),i=s.quantity+(e?e.quantity:0),a=Math.floor(i/2),n=i%2;if(e)k.setQuantity(e.id,n),0==n&&[].push(e);else if(n){let e={id:s.id,parent_id:s.parent_id,sku:s.sku,name:r.title,is_accidennt_protectable:r.is_accident_protectable||!1,is_protection_added:(null==(_=t().list.find(e=>e.id===s.id))?void 0:_.is_protection_added)||!1,line_tax:0,line_total:0,price:s.sale_price,regu_price:s.regu_price,size:s.size,color:s.color,dimensions:s.dimensions,thumbnail:s.thumbnail,cart_item_thumb:s.cart_item_thumb,klaviyoimg:s.klaviyoimg,category:r.category.join(", "),clicked_from:p,product_type:r.product_type||"PRODUCT",slug:r.slug};f.push({...e,quantity:n}),k.add(e,n)}if(a>0){let e=(null==(m=s.size)?void 0:m.includes("King"))?920425:920424,i={id:(s={...r.variations.find(t=>t.id===e),quantity:a}).id,parent_id:s.parent_id,sku:s.sku,name:r.title,is_accidennt_protectable:r.is_accident_protectable||!1,is_protection_added:(null==(y=t().list.find(e=>e.id===s.id))?void 0:y.is_protection_added)||!1,line_tax:0,line_total:0,price:s.sale_price,regu_price:s.regu_price,size:s.size,color:s.color,dimensions:s.dimensions,thumbnail:s.thumbnail,cart_item_thumb:s.cart_item_thumb,klaviyoimg:s.klaviyoimg,category:r.category.join(", "),clicked_from:p,product_type:r.product_type||"PRODUCT",slug:r.slug};f.push({...i,quantity:s.quantity}),k.add(i,s.quantity)}}else{let e={id:s.id,parent_id:s.parent_id,sku:s.sku,name:r.title,is_accidennt_protectable:r.is_accident_protectable||!1,is_protection_added:(null==(g=t().list.find(e=>e.id===s.id))?void 0:g.is_protection_added)||!1,line_tax:0,line_total:0,price:s.sale_price,regu_price:s.regu_price,size:s.size,color:s.color,dimensions:s.dimensions,thumbnail:s.thumbnail,cart_item_thumb:s.cart_item_thumb,klaviyoimg:s.klaviyoimg,category:r.category.join(", "),clicked_from:p,product_type:r.product_type||"PRODUCT",slug:r.slug};f.push({...e,quantity:s.quantity}),k.add(e,s.quantity);let{MATTRESS_IDS:n}=await Promise.resolve().then(i.bind(i,75308));if(a(n).includes(e.parent_id))if(null==(v=e.size)?void 0:v.includes("King")){let e=2*s.quantity,t={id:832132,parent_id:632713,sku:"SMF01K-FR",product_type:"PRODUCT",name:"Layla Memory Foam Pillow - Free",is_accidennt_protectable:!1,is_protection_added:!1,line_tax:0,line_total:0,price:0,regu_price:114,size:"King",color:void 0,dimensions:void 0,thumbnail:"/cdn-assets/images/slide-cart/memory-foam-pillow-incart.png",cart_item_thumb:"/cdn-assets/images/slide-cart/v2/memory-foam-pillow-incart.png",klaviyoimg:"/cdn-assets/images/klaviyo-images/layla-mf-pillow-free.jpg",category:"Comp Pillow",clicked_from:p,slug:r.slug};f.push({...t,quantity:e}),k.add({...t},e)}else{let e=2*s.quantity,t={id:832131,parent_id:632713,sku:"SMF01Q-FR",product_type:"PRODUCT",name:"Layla Memory Foam Pillow - Free",is_accidennt_protectable:!1,is_protection_added:!1,line_tax:0,line_total:0,price:0,regu_price:94,size:"Queen",color:void 0,dimensions:void 0,thumbnail:"/cdn-assets/images/slide-cart/memory-foam-pillow-incart.png",cart_item_thumb:"/cdn-assets/images/slide-cart/v2/memory-foam-pillow-incart.png",klaviyoimg:"/cdn-assets/images/klaviyo-images/layla-mf-pillow-free.jpg",category:"Comp Pillow",clicked_from:p,slug:r.slug};f.push({...t,quantity:e}),k.add({...t},e)}if("PRODUCT"===e.product_type&&e.is_accidennt_protectable&&e.is_protection_added){let t=k.list().find(t=>{var i;return"ACCIDENTAL_PROTECTION"===t.product_type&&!t.leadToken&&"string"==typeof t.id&&(null==(i=t.id.split("_"))?void 0:i[0])==e.id});t&&(k.setQuantity(t.id,t.quantity+s.quantity),f.push({...t,quantity:s.quantity}))}}
1{(0,o.k)({type:"dataLayer",event:"add_to_cart",ecommerce:{currency:"USD",value:f.reduce((e,t)=>e+t.price*t.quantity,0),items:f.map(e=>({item_id:e.id.toString(),item_name:"".concat(null==e?void 0:e.name).concat((null==e?void 0:e.size)?" - ".concat(null==e?void 0:e.size):"").concat((null==e?void 0:e.color)?" - ".concat(null==e?void 0:e.color):"").replace("2 Pack Queen","2 Pack - Queen").replace("2 Pack King","2 Pack - King"),item_category:e.category,price:e.price,quantity:e.quantity,clicked_from:p}))}}),null==(w=window)||w.gtag("event","conversion",{send_to:"AW-878903666/i3HrCPbW6dsBEPKCjKMD",event_callback:()=>{}});let{getUrlWithCdn:e,delay:t}=await Promise.resolve().then(i.bind(i,27196));(async a=>{let{KlaviyoRequests:n}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let i of a){var r;await n.track({properties:{$value:(i.price*i.quantity).toFixed(2),AddedItemCategories:null==(r=i.category)?void 0:r.split(","),AddedItemPrice:i.price,AddedItemQuantity:i.quantity,AddedItemProductID:i.parent_id,AddedItemProductName:(0,c.UV)({title:["PILL01S2PK","PILL01K2PK"].includes(i.sku)?"".concat(i.name," - 2 Pack"):i.name,regex:RegExp("")}),AddedItemSKU:i.sku,AddedItemImageURL:e(i.klaviyoimg),AddedItemURL:"".concat(window.location.origin,"/product/").concat(i.slug)},metric:{data:{type:"metric",attributes:{name:"Added to Cart"}}}}),await t(1e3)}})(f),(async e=>{let t=new Date,a="AddToCart"+t.getFullYear()+"_"+t.getTime(),n=await (0,l.getCookie)(u.o0.FB_EXTERNAL_ID),{ServerSideTracking:r}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let t of e){var o,d;null==(o=window)||o.fbq("track","AddToCart",{content_name:t.name,content_ids:[t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id)],content_type:"product",value:t.price,currency:"USD"},{eventID:a,external_id:n}),await r.fbPixelTrackAddToCart({proid:t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id),varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}),632713!=t.parent_id&&(null==(d=window)||d.pintrk("track","AddToCart",{value:t.price*t.quantity,currency:"USD",event_id:a,line_items:[{product_name:t.name,product_id:t.parent_id,product_category:t.category,product_variant_id:t.id,product_variant:t.size,product_price:t.price}]}),await r.pinterestTrackAddToCart({value:t.price*t.quantity,product_name:t.name,product_category:t.category||"",product_price:t.price,product_variant:t.size||"",proid:t.parent_id,varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}))}})(f),(async e=>{var t,a,n,r;let{TiktokRequests:o}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217)),c=await (0,d.getKlaviyoCookie)(),s=null==c||null==(t=c.properties)?void 0:t.$email,p=null==c||null==(a=c.properties)?void 0:a.$phone_number,_=await (0,l.getCookie)(u.o0.TIKTOK_CLICK_ID),m=(0,d.generateRandomId)(),y=0,g=[];for(let t of e)y+=t.price*t.quantity,g.push({price:t.price,quantity:t.quantity,content_id:"".concat(t.id,"_").concat(t.sku),content_category:t.category,content_name:t.name,brand:"Layla"});let v={contents:g,value:y,currency:"USD",content_type:"product"},w={};s&&(w.email=await (0,d.sha256Universal)((0,d.normalizeEmail)(s))),p&&(w.phone_number=await (0,d.sha256Universal)((0,d.normalizePhone)(p))),Object.entries(w).length>0&&(null==(r=window.ttq)||r.identify(w)),null==(n=window.ttq)||n.track("AddToCart",v,{event_id:m}),await o.addtocart({event_id:m,contents:g,currency:"USD",total:+y.toFixed(2),content_type:"product",page_url:window.location.href,email:s,phone:p,ttclid:_})})(f)}let P=k.list();e(e=>({...e,list:P}));let h=document.getElementById("cart-announcement");void 0!=h&&(h.textContent="",setTimeout(()=>{let e="";for(let t of f)e=""!=e?e+", "+t.name:t.name;h.textContent=e+" added to cart"},80))}catch(e){}},p=async(e,t)=>{for await(let i of e)await r({...i,clicked_from:t})},_=async t=>{let{item:n,quantity:s=1,clicked_from:p="buy_box"}=t;try{var _,m;let t=[];if(14023===n.parent_id&&"number"==typeof n.id&&[1399,1400].includes(n.id)){let{ProductRequests:e}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217)),t=await e.getProductDataById(n.parent_id);if(t&&t.data){let e=t.data,i=e.variations.find(e=>e.id===n.id);await r({product:e,variation:{...i,quantity:s}})}return}let{SecureCart:y}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),g=new y,{MATTRESS_IDS:v}=await Promise.resolve().then(i.bind(i,75308));if(a(v).includes(n.parent_id))if(null==(_=n.size)?void 0:_.includes("King")){let e=g.get(832132);t.push({...e,quantity:2*s});for(let e=0;e<2*s;e++)g.quantity(832132,1)}else{let e=g.get(832131);t.push({...e,quantity:2*s});for(let e=0;e<2*s;
1e++)g.quantity(832131,1)}if("PRODUCT"===n.product_type&&n.is_accidennt_protectable&&n.is_protection_added){let e=g.list().find(e=>{var t;return"ACCIDENTAL_PROTECTION"===e.product_type&&!e.leadToken&&"string"==typeof e.id&&(null==(t=e.id.split("_"))?void 0:t[0])==n.id});e&&(g.setQuantity(e.id,e.quantity+s),t.push({...e,quantity:s}))}t.push({...n,quantity:s});for(let e=0;e<s;e++)g.quantity(n.id,1);{(0,o.k)({type:"dataLayer",event:"add_to_cart",ecommerce:{currency:"USD",value:t.reduce((e,t)=>e+t.price*t.quantity,0),items:t.map(e=>({item_id:e.id.toString(),item_name:"ACCIDENTAL_PROTECTION"===n.product_type?e.name:"".concat(null==e?void 0:e.name).concat((null==e?void 0:e.size)?" - ".concat(null==e?void 0:e.size):"").concat((null==e?void 0:e.color)?" - ".concat(null==e?void 0:e.color):"").replace("2 Pack Queen","2 Pack - Queen").replace("2 Pack King","2 Pack - King"),item_category:e.category,price:e.price,quantity:e.quantity,clicked_from:e.clicked_from||p}))}}),null==(m=window)||m.gtag("event","conversion",{send_to:"AW-878903666/i3HrCPbW6dsBEPKCjKMD",event_callback:()=>{}});let{getUrlWithCdn:e,delay:a}=await Promise.resolve().then(i.bind(i,27196));(async t=>{let{KlaviyoRequests:n}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let i of t){var r;await n.track({properties:{$value:(i.price*i.quantity).toFixed(2),AddedItemCategories:null==(r=i.category)?void 0:r.split(","),AddedItemPrice:i.price,AddedItemQuantity:i.quantity,AddedItemProductID:i.parent_id,AddedItemProductName:(0,c.UV)({title:["PILL01S2PK","PILL01K2PK"].includes(i.sku)?"".concat(i.name," - 2 Pack"):i.name,regex:RegExp("")}),AddedItemSKU:i.sku,AddedItemImageURL:e(i.klaviyoimg),AddedItemURL:"".concat(window.location.origin,"/product/").concat(i.slug)},metric:{data:{type:"metric",attributes:{name:"Added to Cart"}}}}),await a(1e3)}})(t),(async e=>{let t=new Date,a="AddToCart"+t.getFullYear()+"_"+t.getTime(),n=await (0,l.getCookie)(u.o0.FB_EXTERNAL_ID),{ServerSideTracking:r}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let t of e){var o,d;null==(o=window)||o.fbq("track","AddToCart",{content_name:t.name,content_ids:[t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id)],content_type:"product",value:t.price,currency:"USD"},{eventID:a,external_id:n}),await r.fbPixelTrackAddToCart({proid:t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id),varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}),632713!=t.parent_id&&(null==(d=window)||d.pintrk("track","AddToCart",{value:t.price*t.quantity,currency:"USD",event_id:a,line_items:[{product_name:t.name,product_id:t.parent_id,product_category:t.category,product_variant_id:t.id,product_variant:t.size,product_price:t.price}]}),await r.pinterestTrackAddToCart({value:t.price*t.quantity,product_name:t.name,product_category:t.category||"",product_price:t.price,product_variant:t.size||"",proid:t.parent_id,varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}))}})(t),(async e=>{var t,a,n,r;let{TiktokRequests:o}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217)),c=await (0,d.getKlaviyoCookie)(),s=null==c||null==(t=c.properties)?void 0:t.$email,p=null==c||null==(a=c.properties)?void 0:a.$phone_number,_=await (0,l.getCookie)(u.o0.TIKTOK_CLICK_ID),m=(0,d.generateRandomId)(),y=0,g=[];for(let t of e)y+=t.price*t.quantity,g.push({price:t.price,quantity:t.quantity,content_id:"".concat(t.id,"_").concat(t.sku),content_category:t.category,content_name:t.name,brand:"Layla"});let v={contents:g,value:y,currency:"USD",content_type:"product"},w={};s&&(w.email=await (0,d.sha256Universal)((0,d.normalizeEmail)(s))),p&&(w.phone_number=await (0,d.sha256Universal)((0,d.normalizePhone)(p))),Object.entries(w).length>0&&(null==(r=window.ttq)||r.identify(w)),null==(n=window.ttq)||n.track("AddToCart",v,{event_id:m}),await o.addtocart({event_id:m,contents:g,currency:"USD",total:+y.toFixed(2),content_type:"product",page_url:window.location.href,email:s,phone:p,ttclid:_})})(t)}let w=g.list();e(e=>({...e,list:w}))}catch(e){}};return{setCartLoading:t=>e(e=>({...e,loading:t})),toggleCart:()=>e(e=>({...e,open:!e.open})),openCart:()=>e(e=>({...e,open:!0})),closeCart:()=>e(e=>({...e,open:!1})),reset:()=>e(s),getCart:async()=>{let{isServer:e}=await Promise.resolve().then(i.bind(i,27196));if(e())return[];let{SecureCart:t}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423));return new t().list()},syncCart:async()=>{try{e(e=>({...e,loading:!0,syncing:!0}));let{isServer:t}=await Promise.resolve().then(i.bind(i,27196));if(t())e(e=>({...e,list:[]}));else{let{SecureCart:t}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),a=new t;
1a.list().forEach(e=>{if("GIFT_CARD"===e.product_type){let t=new Date(e.wc_gc_giftcard_delivery),i=new Date,a=new Date;if(a.setDate(a.getDate()+30),t<i||t>a){i.setDate(i.getDate());let[t]=i.toISOString().split("T");n({id:e.id,prop:"wc_gc_giftcard_delivery",value:t})}}}),e(e=>({...e,list:a.list()}))}}catch(e){}finally{e(e=>({...e,loading:!1,syncing:!1,firstLoad:!1}))}},recalculate:async()=>{},updateItemProp:n,addItemToCart:r,addBulkItemToCart:p,increaseCartItemQuantity:_,decreaseCartItemQuantity:async t=>{let{item:n,quantity:r=1,clicked_from:d}=t;try{let t=[],{SecureCart:d}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),l=new d,{MATTRESS_IDS:u}=await Promise.resolve().then(i.bind(i,75308));if(a(u).includes(n.parent_id)){var c;if(null==(c=n.size)?void 0:c.includes("King")){let e=l.get(832132);t.push({...e,quantity:2*r});for(let e=0;e<2*r;e++)l.quantity(832132,-1)}else{let e=l.get(832131);t.push({...e,quantity:2*r});for(let e=0;e<2*r;e++)l.quantity(832131,-1)}}if("PRODUCT"===n.product_type&&n.is_accidennt_protectable&&n.is_protection_added){let e=l.list().find(e=>{var t;return"ACCIDENTAL_PROTECTION"===e.product_type&&!e.leadToken&&"string"==typeof e.id&&(null==(t=e.id.split("_"))?void 0:t[0])==n.id});if(e){for(let t=0;t<r;t++)l.quantity(e.id,-1);t.push({...e,quantity:r})}}t.push({...n,quantity:r});for(let e=0;e<r;e++)l.quantity(n.id,-1);(0,o.k)({type:"dataLayer",event:"remove_from_cart",ecommerce:{currency:"USD",value:t.reduce((e,t)=>e+t.price*t.quantity,0),items:t.map(e=>({item_id:e.id.toString(),item_name:"ACCIDENTAL_PROTECTION"===e.product_type?e.name:"".concat(e.name).concat(e.size?" - ".concat(e.size):"").concat(e.color?" - ".concat(e.color):"").replace("2 Pack Queen","2 Pack - Queen").replace("2 Pack King","2 Pack - King"),item_category:e.category,price:e.price,quantity:e.quantity}))}});let s=l.list();e(e=>({...e,list:s}))}catch(e){}},removeItemFromCart:async t=>{try{var n,r;let d=t.quantity,c=[],{SecureCart:l}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),u=new l,{MATTRESS_IDS:s}=await Promise.resolve().then(i.bind(i,75308));if(a(s).includes(t.parent_id))if(null==(n=t.size)?void 0:n.includes("King")){let e=u.get(832132);c.push({...e,quantity:2*d});for(let e=0;e<2*d;e++)u.quantity(832132,-1)}else{let e=u.get(832131);c.push({...e,quantity:2*d});for(let e=0;e<2*d;e++)u.quantity(832131,-1)}if("PRODUCT"===t.product_type&&t.is_accidennt_protectable&&t.is_protection_added){let e=u.list().find(e=>{var i;return"ACCIDENTAL_PROTECTION"===e.product_type&&!e.leadToken&&"string"==typeof e.id&&(null==(i=e.id.split("_"))?void 0:i[0])==t.id});if(e){for(let t=0;t<d;t++)u.quantity(e.id,-1);c.push({...e,quantity:d})}}if("ACCIDENTAL_PROTECTION"===t.product_type&&"string"==typeof t.id&&!t.leadToken){let e=Number(null==(r=t.id.split("_"))?void 0:r[0]);e&&u.update(e,"is_protection_added",!1)}c.push({...t,quantity:d}),u.remove(t.id),(0,o.k)({type:"dataLayer",event:"remove_from_cart",ecommerce:{currency:"USD",value:c.reduce((e,t)=>e+t.price*t.quantity,0),items:c.map(e=>({item_id:e.id.toString(),item_name:"ACCIDENTAL_PROTECTION"===e.product_type?e.name:"".concat(e.name).concat(e.size?" - ".concat(e.size):"").concat(e.color?" - ".concat(e.color):"").replace("2 Pack Queen","2 Pack - Queen").replace("2 Pack King","2 Pack - King"),item_category:e.category,price:e.price,quantity:e.quantity}))}});let p=u.list();e(e=>({...e,list:p}))}catch(e){}},addProtectionItemToCart:async t=>{let{protection_item:a,variation_id_to_protect:n,variation_qty_to_protect:r,send_events_to_klaviyo:s=!0,tracking:p=!0}=t;try{let{SecureCart:t}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),m=new t,y=[],g=m.list().find(e=>e.id===n&&e.is_accidennt_protectable);if(!g)return void e(e=>({...e,list:m.list()}));let v=m.list().find(e=>e.id===a.id&&!e.leadToken);v?(m.setQuantity(v.id,g.quantity),y.push({...v,quantity:r})):(m.add(a,g.quantity),y.push({...a,quantity:g.quantity})),m.update(g.id,"is_protection_added",!0);let w=m.list();if(e(e=>({...e,list:w})),p&&1){var _;if((0,o.k)({type:"dataLayer",event:"add_to_cart",ecommerce:{currency:"USD",value:y.reduce((e,t)=>
1e+t.price*t.quantity,0),items:y.map(e=>({item_id:e.id.toString(),item_name:"ACCIDENTAL_PROTECTION"===e.product_type?e.name:"".concat(null==e?void 0:e.name).concat((null==e?void 0:e.size)?" - ".concat(null==e?void 0:e.size):"").concat((null==e?void 0:e.color)?" - ".concat(null==e?void 0:e.color):"").replace("2 Pack Queen","2 Pack - Queen").replace("2 Pack King","2 Pack - King"),item_category:e.category,price:e.price,quantity:e.quantity,clicked_from:e.clicked_from||"buy_box"}))}}),null==(_=window)||_.gtag("event","conversion",{send_to:"AW-878903666/i3HrCPbW6dsBEPKCjKMD",event_callback:()=>{}}),s){let{getUrlWithCdn:e,delay:t}=await Promise.resolve().then(i.bind(i,27196));(async a=>{let{KlaviyoRequests:n}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let i of a){var r;await n.track({properties:{$value:(i.price*i.quantity).toFixed(2),AddedItemCategories:null==(r=i.category)?void 0:r.split(","),AddedItemPrice:i.price,AddedItemQuantity:i.quantity,AddedItemProductID:i.parent_id,AddedItemProductName:(0,c.UV)({title:["PILL01S2PK","PILL01K2PK"].includes(i.sku)?"".concat(i.name," - 2 Pack"):i.name,regex:RegExp("")}),AddedItemSKU:i.sku,AddedItemImageURL:e(i.klaviyoimg),AddedItemURL:"".concat(window.location.origin,"/product/").concat(i.slug)},metric:{data:{type:"metric",attributes:{name:"Added to Cart"}}}}),await t(1e3)}})(y)}(async e=>{let t=new Date,a="AddToCart"+t.getFullYear()+"_"+t.getTime(),n=await (0,l.getCookie)(u.o0.FB_EXTERNAL_ID),{ServerSideTracking:r}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let t of e){var o,d;null==(o=window)||o.fbq("track","AddToCart",{content_name:t.name,content_ids:[t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id)],content_type:"product",value:t.price,currency:"USD"},{eventID:a,external_id:n}),await r.fbPixelTrackAddToCart({proid:t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id),varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}),632713!=t.parent_id&&(null==(d=window)||d.pintrk("track","AddToCart",{value:t.price*t.quantity,currency:"USD",event_id:a,line_items:[{product_name:t.name,product_id:t.parent_id,product_category:t.category,product_variant_id:t.id,product_variant:t.size,product_price:t.price}]}),await r.pinterestTrackAddToCart({value:t.price*t.quantity,product_name:t.name,product_category:t.category||"",product_price:t.price,product_variant:t.size||"",proid:t.parent_id,varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}))}})(y),(async e=>{var t,a,n,r;let{TiktokRequests:o}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217)),c=await (0,d.getKlaviyoCookie)(),s=null==c||null==(t=c.properties)?void 0:t.$email,p=null==c||null==(a=c.properties)?void 0:a.$phone_number,_=await (0,l.getCookie)(u.o0.TIKTOK_CLICK_ID),m=(0,d.generateRandomId)(),y=0,g=[];for(let t of e)y+=t.price*t.quantity,g.push({price:t.price,quantity:t.quantity,content_id:"".concat(t.id,"_").concat(t.sku),content_category:t.category,content_name:t.name,brand:"Layla"});let v={contents:g,value:y,currency:"USD",content_type:"product"},w={};s&&(w.email=await (0,d.sha256Universal)((0,d.normalizeEmail)(s))),p&&(w.phone_number=await (0,d.sha256Universal)((0,d.normalizePhone)(p))),Object.entries(w).length>0&&(null==(r=window.ttq)||r.identify(w)),null==(n=window.ttq)||n.track("AddToCart",v,{event_id:m}),await o.addtocart({event_id:m,contents:g,currency:"USD",total:+y.toFixed(2),content_type:"product",page_url:window.location.href,email:s,phone:p,ttclid:_})})(y)}}catch(e){}},addProtectionForOlderOrderItem:async t=>{let{protection_item:a,quantity:n,send_events_to_klaviyo:r=!0,tracking:s=!0}=t;try{let{SecureCart:t}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),_=new t,m=[];_.add(a,n),m.push({...a,quantity:n});let y=_.list();if(e(e=>({...e,list:y})),s&&1){var p;if((0,o.k)({type:"dataLayer",event:"add_to_cart",ecommerce:{currency:"USD",value:m.reduce((e,t)=>e+t.price*t.quantity,0),items:m.map(e=>({item_id:e.id.toString(),item_name:"ACCIDENTAL_PROTECTION"===e.product_type?e.name:"".concat(null==e?void 0:e.name).concat((null==e?void 0:e.size)?" - ".concat(null==e?void 0:e.size):"").concat((null==e?void 0:e.color)?" - ".concat(null==e?void 0:e.color):"").replace("2 Pack Queen","2 Pack - Queen").replace("2 Pack King","2 Pack - King"),item_category:e.category,price:e.price,quantity:e.quantity,clicked_from:e.clicked_from||"buy_box"}))}}),null==(p=window)||p.gtag("event","conversion",{send_to:"AW-878903666/i3HrCPbW6dsBEPKCjKMD",event_callback:()=>{}}),r){let{getUrlWithCdn:e,delay:t}=await Promise.resolve().then(i.bind(i,27196));(async a=>{let{KlaviyoRequests:n}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let i of a){var r;await n.track({properties:{$value:(i.price*i.quantity).toFixed(2),AddedItemCategories:null==(r=i.category)?void 0:r.split(","),AddedItemPrice:i.price,AddedItemQuantity:i.quantity,AddedItemProductID:i.parent_id,AddedItemProductName:(0,c.UV)({title:["PILL01S2PK","PILL01K2PK"].includes(i.sku)?"".concat(i.name," - 2 Pack"):i.name,regex:RegExp("")}),AddedItemSKU:i.sku,AddedItemImageURL:e(i.klaviyoimg),AddedItemURL:"".concat(window.location.origin,"/product/").concat(i.slug)},metric:{data:{type:"metric",attributes:{name:"Added to Cart"}}}}),await t(1e3)}})(m)}(async e=>{let t=new Date,a="AddToCart"+t.getFullYear()+"_"+t.getTime(),n=await (0,l.getCookie)(u.o0.FB_EXTERNAL_ID),{ServerSideTracking:r}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));for(let t of e){var o,d;null==(o=window)||o.fbq("track","AddToCart",{content_name:t.name,content_ids:[t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id)],content_type:"product",value:t.price,currency:"USD"},{eventID:a,external_id:n}
1),await r.fbPixelTrackAddToCart({proid:t.sku+"_"+("GIFTCARD01"===t.sku?t.parent_id:t.id),varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}),632713!=t.parent_id&&(null==(d=window)||d.pintrk("track","AddToCart",{value:t.price*t.quantity,currency:"USD",event_id:a,line_items:[{product_name:t.name,product_id:t.parent_id,product_category:t.category,product_variant_id:t.id,product_variant:t.size,product_price:t.price}]}),await r.pinterestTrackAddToCart({value:t.price*t.quantity,product_name:t.name,product_category:t.category||"",product_price:t.price,product_variant:t.size||"",proid:t.parent_id,varid:t.id,qty:t.quantity,sourceurl:window.location.href,event_id:a}))}})(m),(async e=>{var t,a,n,r;let{TiktokRequests:o}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217)),c=await (0,d.getKlaviyoCookie)(),s=null==c||null==(t=c.properties)?void 0:t.$email,p=null==c||null==(a=c.properties)?void 0:a.$phone_number,_=await (0,l.getCookie)(u.o0.TIKTOK_CLICK_ID),m=(0,d.generateRandomId)(),y=0,g=[];for(let t of e)y+=t.price*t.quantity,g.push({price:t.price,quantity:t.quantity,content_id:"".concat(t.id,"_").concat(t.sku),content_category:t.category,content_name:t.name,brand:"Layla"});let v={contents:g,value:y,currency:"USD",content_type:"product"},w={};s&&(w.email=await (0,d.sha256Universal)((0,d.normalizeEmail)(s))),p&&(w.phone_number=await (0,d.sha256Universal)((0,d.normalizePhone)(p))),Object.entries(w).length>0&&(null==(r=window.ttq)||r.identify(w)),null==(n=window.ttq)||n.track("AddToCart",v,{event_id:m}),await o.addtocart({event_id:m,contents:g,currency:"USD",total:+y.toFixed(2),content_type:"product",page_url:window.location.href,email:s,phone:p,ttclid:_})})(m)}}catch(e){}},addGiftCardItemToCart:async t=>{let{item:a,quantity:n,send_events_to_klaviyo:r=!0,tracking:s=!0}=t;try{let{SecureCart:t}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423)),_=new t;_.add(a,n);let m=_.list();if(e(e=>({...e,list:m})),s&&1){var p;if((0,o.k)({type:"dataLayer",event:"add_to_cart",ecommerce:{currency:"USD",value:a.price*n,items:[{item_id:a.id.toString(),item_name:a.name,item_category:a.category,price:a.price,quantity:n,clicked_from:"buy_box"}]}}),null==(p=window)||p.gtag("event","conversion",{send_to:"AW-878903666/i3HrCPbW6dsBEPKCjKMD",event_callback:()=>{}}),r){let{getUrlWithCdn:e}=await Promise.resolve().then(i.bind(i,27196));(async(t,a)=>{var n;let{KlaviyoRequests:r}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));await r.track({properties:{$value:(t.price*a).toFixed(2),AddedItemCategories:null==(n=t.category)?void 0:n.split(","),AddedItemPrice:t.price,AddedItemQuantity:a,AddedItemProductID:t.parent_id,AddedItemProductName:(0,c.UV)({title:["PILL01S2PK","PILL01K2PK"].includes(t.sku)?"".concat(t.name," - 2 Pack"):t.name,regex:RegExp("")}),AddedItemSKU:t.sku,AddedItemImageURL:e(t.klaviyoimg),AddedItemURL:"".concat(window.location.origin,"/product/").concat(t.slug)},metric:{data:{type:"metric",attributes:{name:"Added to Cart"}}}})})(a,n)}(async(e,t)=>{var a,n;let r=new Date,o="AddToCart"+r.getFullYear()+"_"+r.getTime(),d=await (0,l.getCookie)(u.o0.FB_EXTERNAL_ID),{ServerSideTracking:c}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217));null==(a=window)||a.fbq("track","AddToCart",{content_name:e.name,content_ids:[e.sku+"_"+("GIFTCARD01"===e.sku?e.parent_id:e.id)],content_type:"product",value:e.price,currency:"USD"},{eventID:o,external_id:d}),await c.fbPixelTrackAddToCart({proid:e.sku+"_"+("GIFTCARD01"===e.sku?e.parent_id:e.id),varid:e.id,qty:t,sourceurl:window.location.href,event_id:o}),632713!=e.parent_id&&(null==(n=window)||n.pintrk("track","AddToCart",{value:e.price*t,currency:"USD",event_id:o,line_items:[{product_name:e.name,product_id:e.parent_id,product_category:e.category,product_variant_id:e.id,product_variant:e.size,product_price:e.price}]}),await c.pinterestTrackAddToCart({value:e.price*t,product_name:e.name,product_category:e.category||"",product_price:e.price,product_variant:e.size||"",proid:e.parent_id,varid:e.id,qty:t,sourceurl:window.location.href,event_id:o}))})(a,n),(async(e,t)=>{var a,n,r,o;let{TiktokRequests:c}=await Promise.all([i.e(8217),i.e(8793)]).then(i.bind(i,58217)),s=await (0,d.getKlaviyoCookie)(),p=null==s||null==(a=s.properties)?void 0:a.$email,_=null==s||null==(n=s.properties)?void 0:n.$phone_number,m=await (0,l.getCookie)(u.o0.TIKTOK_CLICK_ID),y=(0,d.generateRandomId)(),g=0,v=[];g+=e.price*t,v.push({price:e.price,quantity:t,content_id:"".concat(e.id,"_").concat(e.sku),content_category:e.category,content_name:e.name,brand:"Layla"});let w={contents:v,value:g,currency:"USD",content_type:"product"},k={};p&&(k.email=await (0,d.sha256Universal)((0,d.normalizeEmail)(p))),_&&(k.phone_number=await (0,d.sha256Universal)((0,d.normalizePhone)(_))),Object.entries(k).length>0&&(null==(o=window.ttq)||o.identify(k)),null==(r=window.ttq)||r.track("AddToCart",w,{event_id:y}),await c.addtocart({event_id:y,contents:v,currency:"USD",total:+g.toFixed(2),content_type:"product",page_url:window.location.href,email:p,phone:_,ttclid:m})})(a,n)}}catch(e){}},destroyCart:async()=>{let{SecureCart:t}=await Promise.all([i.e(3968),i.e(5423)]).then(i.bind(i,25423));new t().save([]),e(e=>({...e,list:[]}))}}}),{enabled:!1})),_=(0,r.L)(p)},83576:(e,t,i)=>{i.d(t,{k:()=>a});let a=e=>{let{type:t="dataLayer",event:i,ecommerce:a}=e;switch(t){case"dataLayer":window&&void 0!==window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:i,ecommerce:a}));break;case"gtag":window&&void 0!==window.gtag&&window.gtag("event",i,a)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.