1async function getCurrentProductInfo(purchase){let urlData=purchase.url,url="https://"+window.location.host+urlData+".json";return new Promise(async(resolve,reject)=>{let response=await fetch(url),{product}=await response.json();resolve(product)})}async function _getSkuInvData(sku){return await fetch("http://wigscom-ims.herokuapp.com/variant-inventory-api?sku="+sku,{method:"get",headers:new Headers({Authorization:"Bearer nsO_g0TQ2JF9H6DBripCDA","Content-Type":"application/x-www-form-urlencoded"})}).then(response=>response.json()).then(data=>data).catch(error=>null)}async function getCurrentVariant(purchase){const product=await getCurrentProductInfo(purchase);return await getVariantNameCart(product,purchase)}function getVariantNameCart(product,purchase){let currentVariantName=purchase.variant_name,qtyInCart=purchase.quantity;return product.variants.filter(v=>v.option1===currentVariantName)[0]}const shipStatus={ONETHREE:1,TWOFIVE:2,TODAY:3,MONDAY:4,TOMORROW:5,PREORDERED:6,IGNORE:7};async function currentVariantData(purchase){let allMessages=[],variant=await getCurrentVariant(purchase),product=await getCurrentProductInfo(purchase),in_stock=!1,in_hours=!1,is_weekday=!1,is_weekday_tmr=!1,is_friday=!1,ship_msg,var_inv_data=await _getSkuInvData(variant.sku),qty=await var_inv_data.inventory_quantity,oversell=await var_inv_data.inventory_policy,price=await variant.price,vendor=await product.vendor,currentVariantName=purchase.variant_name,qtyInCart=purchase.quantity,productId;purchase.id?productId=purchase.id.toString():(purchase.url="/products/free-mystery-gift-gwp")&&(productId="6975420203119"),qty>0&&(in_stock=!0);let d=new Date;d.getDay()!=6&&d.getDay()!=0&&(is_weekday=!0),d.getDay()!=5&&d.getDay()!=6&&(is_weekday_tmr=!0),d.getDay()==5&&(is_friday=!0);let utc=d.getTime()+d.getTimezoneOffset()*6e4,time=new Date(utc-18e6).getHours();time>0&&time<16&&(in_hours=!0),document.querySelector(`.product-option[preordered="${variant.id}"]`)?(ship_msg=shipStatus.PREORDERED,allMessages.push(ship_msg)):variant.id=="44081111859311"?(ship_msg=shipStatus.IGNORE,allMessages.push(ship_msg)):qty<=0&&oversell=="continue"?(ship_msg=shipStatus.ONETHREE,allMessages.push(ship_msg),(vendor==="TressAllure"||vendor==="BelleTress"||vendor==="Forever Young"||vendor==="Ellen Wille"||vendor==="Vivica Fox")&&(ship_msg=shipStatus.TWOFIVE,allMessages.push(ship_msg)),productId==="1502103208047"&&(ship_msg=shipStatus.TODAY,allMessages.push(ship_msg)),productId==="7085355008111"&&(ship_msg=shipStatus.TODAY,allMessages.push(ship_msg))):qty<qtyInCart&&oversell=="continue"?(ship_msg=shipStatus.ONETHREE,allMessages.push(ship_msg),(vendor==="TressAllure"||vendor==="BelleTress"||vendor==="Forever Young"||vendor==="Ellen Wille"||vendor==="Vivica Fox")&&(ship_msg=shipStatus.TWOFIVE,allMessages.push(ship_msg))):in_stock&&is_weekday&&in_hours?(ship_msg=shipStatus.TODAY,allMessages.push(ship_msg)):in_stock&&!in_hours&&is_friday||in_stock&&!is_weekday_tmr?(ship_msg=shipStatus.MONDAY,allMessages.push(ship_msg)):(in_stock&&!in_hours||in_stock&&!is_weekday&&is_weekday_tmr)&&(ship_msg=shipStatus.TOMORROW,allMessages.push(ship_msg));let is_activevariant=purchase.variant_name;return ship_msg}function updateFinalShippingMessage(allMessages){let container=document.getElementById("ship-status"),messagePrefix="Your order";allMessages.includes(shipStatus.PREORDERED)&&(messagePrefix="Available items"),allMessages.includes(shipStatus.TWOFIVE)?(msg1=`${messagePrefix} will ship in 6-10 business days`,ship_div='<div style="padding-top: 2px;"><img src="https://cdn.shopify.com/s/files/1/1410/9094/files/fast_1.png?v=1637949500"> '+msg1+"</div>",container.style.color="#c41a49",container.innerHTML=ship_div):allMessages.includes(shipStatus.ONETHREE)?(msg2=`${messagePrefix} will ship in 1-3 days`,ship_div='<div style="padding-top: 2px"><img src="https://cdn.shopify.com/s/files/1/1410/9094/files/fast_1.png?v=1637949500"> '+msg2+"</div>",container.style.color="#c41a49",container.innerHTML=ship_div):allMessages.includes(shipStatus.TODAY)?(msg3=`${messagePrefix} will ship today`,ship_div='<div style="padding-top: 2px"><img src="https://cdn.shopify.com/s/files/1/1410/9094/files/fast_1.png?v=1637949500"> '+msg3+"</div>",container.style.color="#c41a49",container.innerHTML=ship_div):allMessages.includes(shipStatus.MONDAY)?(msg4=`${messagePrefix} will ship Monday`,ship_div='<div style="padding-top: 2px"><img src="https://cdn.shopify.com/s/files/1/1410/9094/files/fast_1.png?v=1637949500">
1 '+msg4+"</div>",container.style.color="#c41a49",container.innerHTML=ship_div):allMessages.includes(shipStatus.TOMORROW)?(msg5=`${messagePrefix} will ship tomorrow`,ship_div='<div style="padding-top: 2px"><img src="https://cdn.shopify.com/s/files/1/1410/9094/files/fast_1.png?v=1637949500"> '+msg5+"</div>",container.style.color="#c41a49",container.innerHTML=ship_div):allMessages.every(message=>message===shipStatus.PREORDERED||message===shipStatus.IGNORE)&&(msg6="Your items will ship when back in stock",ship_div='<div style="padding-top: 2px;"><img src="https://cdn.shopify.com/s/files/1/1410/9094/files/fast_1.png?v=1637949500"> '+msg6+"</div>",container.style.color="#c41a49",container.innerHTML=ship_div)}async function getCartContents(){let cart=await(await fetch("/cart.js")).json(),promisedCartProductsInformation=[],allMessages=[];for(let item of cart.items)promisedCartProductsInformation.push(new Promise(async(resolve,reject)=>{if(item.variant_title!=null){let purchase={url:item.url.split("?")[0],variant_name:item.variant_title,quantity:item.quantity,id:item.product_id},currentMessage=await currentVariantData(purchase);allMessages.push(currentMessage),resolve(currentMessage)}else{let purchase={url:item.url.split("?")[0],variant_name:item.variant_options[0],quantity:item.quantity},currentMessage=await currentVariantData(purchase);allMessages.push(currentMessage),resolve(currentMessage)}}));Promise.all(promisedCartProductsInformation).then(array=>{updateFinalShippingMessage(allMessages),allMessages.length===0?document.getElementById("ship-status").style.display="none":document.getElementById("ship-status").style.display="inline-block"})}setInterval(()=>{let shipStatusCont=document.getElementById("ship-status");if(shipStatusCont.textContent.length<1){let loading_msg=`<div class="loading__spinner" style="padding-top:3px;"> 2 <div class="loading__spinner"> 3 <svg aria-hidden="true" focusable="false" role="presentation" class="spinner" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"> 4 <circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle> 5 </svg> 6 </div> 7 </div>`;shipStatusCont.innerHTML=loading_msg+'<div style="padding-left: 17px"> Calculating...</div>',getCartContents()}},1e3); 8//# sourceMappingURL=/cdn/shop/t/134/assets/product-stock-status-cart.js.map?v=142289550570378711701781106926
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.