1class dT_WhistList{constructor(){this.wishListData=[],this.LOCAL_STORAGE_WISHLIST_KEY="shopify-wishlist",this.LOCAL_STORAGE_DELIMITER=","}setListLocalStorageKey(LOCAL_STORAGE_WISHLIST_KEY,LOCAL_STORAGE_DELIMITER){this.LOCAL_STORAGE_WISHLIST_KEY=LOCAL_STORAGE_WISHLIST_KEY,this.LOCAL_STORAGE_DELIMITER=LOCAL_STORAGE_DELIMITER}setupGrid(listType){var wishlist=this.getWishlist(),requests=wishlist.map(function(handle){var productTileTemplateUrl="/products/"+handle+"?view=json",getProductsList=this.getProductResponse(productTileTemplateUrl);return getProductsList}.bind(this));return Promise.all(requests).then(function(responses){var wishlistProductCards=responses.join("%$$%"),wishlistProductCards=wishlistProductCards,a_wishlistRecords=wishlistProductCards.split("%$$%");let recordsObj=[];if(Array.isArray(a_wishlistRecords)&&a_wishlistRecords.length){var index=0;a_wishlistRecords.forEach(record=>{var a_record=record.split("~~"),recordObj={id:a_record[0],product_title:a_record[1],product_handle:a_record[2],product_image:a_record[3],vendor:a_record[4],type:a_record[5],money_price:a_record[6],price_min:a_record[7],price_max:a_record[8],available:a_record[9],price_varies:a_record[10],variant_id:a_record[11],variant_title:a_record[12],sku:a_record[13],description:a_record[14],quantity:"1",product_url:"/products/"+a_record[2]};recordsObj[index]=recordObj,index=index+1})}return recordsObj}).then(function(data){return this.wishListData=data,data}.bind(this))}getWishListRecords(){return this.wishListData}getProductResponse(url){var responseResult=fetch(url).then(response=>response.text()).then(data=>data.replace(/^\s*[\r\n]/gm,""));return responseResult}getTotalCount(){return this.getWishlist().length}getWishlist(){var wishlist=localStorage.getItem(this.LOCAL_STORAGE_WISHLIST_KEY)||!1;return wishlist?wishlist.split(this.LOCAL_STORAGE_DELIMITER):[]}setWishlist(array){var wishlist=array.join(this.LOCAL_STORAGE_DELIMITER);return array.length?localStorage.setItem(this.LOCAL_STORAGE_WISHLIST_KEY,wishlist):localStorage.removeItem(this.LOCAL_STORAGE_WISHLIST_KEY),wishlist}updateWishlist(handle){var wishlist=this.getWishlist(),indexInWishlist=wishlist.indexOf(handle);return indexInWishlist===-1?wishlist.push(handle):wishlist.splice(indexInWishlist,1),this.setWishlist(wishlist)}removeWhishlist(handle){var wishlist=this.getWishlist();return wishlist=this.remove(wishlist,handle),this.setWishlist(wishlist)}resetWishlist(){return this.setWishlist([])}isAddedIntoList(handle){var wishlist=this.getWishlist();return wishlist.includes(handle)}remove(arr){for(var what,a=arguments,L=a.length,ax;L>1&&arr.length;)for(what=a[--L];(ax=arr.indexOf(what))!==-1;)arr.splice(ax,1);return arr}}async function getDTProduct(url){try{return(await fetch(url)).text().then(function(text){return text})}catch(error){console.log(error)}}class dTXWhishList extends HTMLElement{constructor(){super(),this.dTWhistList=new dT_WhistList,this.debouncedOnSubmit=debounce(event=>{this.onSubmitHandler(event)},500),this.addWishList=this.querySelector(".add-wishlist"),this.productHandle=this.addWishList.getAttribute("data-product_handle"),this.addWishList.addEventListener("click",this.debouncedOnSubmit.bind(this)),this.initLoad()}onSubmitHandler(event){event.preventDefault(),this.dTWhistList.isAddedIntoList(this.productHandle)?window.location="/pages/wishlist":(this.addWishList.classList.add("adding"),this.dTWhistList.updateWishlist(this.productHandle),setTimeout(this.postAdd.bind(this),1e3))}postAdd(){var dtxwishCount=document.getElementsByClassName("dtxc-wishlist-count");dtxwishCount.length>0&&document.querySelector(".dtxc-wishlist-count").setAttribute("count",this.dTWhistList.getTotalCount()),this.addWishList.classList.remove("adding"),this.addWishList.classList.add("added")}initLoad(){this.dTWhistList.isAddedIntoList(this.productHandle)&&this.addWishList.classList.add("added")}}customElements.define("dtx-wishlist",dTXWhishList);class dTXWhishListGrid extends HTMLElement{constructor(){super(),this.gridTemplate=this.querySelector(".grid_template"),this.dtxTable=this.querySelector(".dtx-table"),this.dtxNoRecord=this.querySelector(".dtx-grid-empty"),this.grid_type=this.getAttribute("grid_type")}initLoad(){var dTWhistList=new dT_WhistList;
1dTWhistList.setupGrid().then(function(data){return this.generateGrid(data),data}.bind(this))}generateGrid(a_records){var data=this.gridTemplate.innerHTML;typeof a_records[0].product_handle<"u"?a_records.length>0&&(a_records.forEach(function(record){var newRow=this.dtxTable.insertRow(this.dtxTable.rows.length);newRow.id="row_"+record.id,newRow.innerHTML=this.buidRow(record)}.bind(this)),this.dtxNoRecord.classList.add("dtx-grid-hide"),this.dtxTable.classList.add("dtx-grid-show")):(this.dtxTable.classList.add("dtx-grid-hide"),this.dtxNoRecord.classList.add("dtx-grid-show"))}buidRow(record){var templateData=this.gridTemplate.innerHTML;return templateData=templateData.replace(/{item.product_handle}/gi,record.product_handle),templateData=templateData.replace(/{item.product_url}/gi,record.product_url),templateData=templateData.replace(/{item.product_image}/gi,record.product_image),templateData=templateData.replace(/{item.product_title}/gi,record.product_title),templateData=templateData.replace(/{item.money_price}/gi,record.money_price),templateData=templateData.replace(/{item.variant_id}/gi,record.variant_id),templateData=templateData.replace(/{item.product_vendor}/gi,record.vendor),templateData=templateData.replace(/{item.product_type}/gi,record.type),templateData=templateData.replace(/{item.product_sku}/gi,record.sku),templateData=templateData.replace(/{item.product_description}/gi,record.description),record.available=="true"?templateData=templateData.replace(/{item.available}/gi,"In Stock"):templateData=templateData.replace(/{item.available}/gi,"Sold Out"),templateData}connectedCallback(){this.initLoad()}}customElements.define("dtx-wishlist-grid",dTXWhishListGrid);class dTXRemoveWishItem extends HTMLElement{constructor(){super(),this.removeItem=this.querySelector(".remove-item"),this.debouncedOnSubmit=debounce(event=>{this.removeListItem(event)},500),this.grid_type=this.getAttribute("grid_type"),this.productHandle=this.removeItem.getAttribute("data-product_handle"),this.removeItem.addEventListener("click",this.debouncedOnSubmit.bind(this))}removeListItem(event){event.preventDefault();var dTWishList=new dT_WhistList;dTWishList.removeWhishlist(this.productHandle),window.location.reload()}}customElements.define("dtx-remove-wish-item",dTXRemoveWishItem);class dTXWishCount extends HTMLElement{static get observedAttributes(){return["count"]}constructor(){super(),this.gridCountBubble=this.querySelector(".grid-count-bubble"),this.grid_type=this.getAttribute("grid_type"),this.initLoad()}initLoad(){var dTWishList=new dT_WhistList,totalCount=dTWishList.getTotalCount();this.gridCountBubble.querySelector("span").innerHTML=totalCount}attributeChangedCallback(name,oldValue,newValue){this.initLoad()}}customElements.define("dtx-wish-count",dTXWishCount);function makeTimer(){$(".product-deal-count").each(function(){var endTime=new Date($(this).attr("data-end-time"));endTime=Date.parse(endTime)/1e3;var now=new Date;now=Date.parse(now)/1e3;var timeLeft=endTime-now;if(timeLeft>0){var days=Math.floor(timeLeft/86400),hours=Math.floor((timeLeft-days*86400)/3600),minutes=Math.floor((timeLeft-days*86400-hours*3600)/60),seconds=Math.floor(timeLeft-days*86400-hours*3600-minutes*60);hours<"10"&&(hours="0"+hours),minutes<"10"&&(minutes="0"+minutes),seconds<"10"&&(seconds="0"+seconds),$(this).find(".days").html(days+"<span>Days</span>"),$(this).find(".hours").html(hours+"<span>Hrs</span>
1"),$(this).find(".minutes").html(minutes+"<span>Mins</span>"),$(this).find(".seconds").html(seconds+"<span>Secs</span>")}else $(this).find(".deal-lable").hide(),$(this).find(".deal-clock").hide()})}setInterval(function(){makeTimer()},1e3);var swiper=new Swiper("#swiper-sidebar-carousel",{slidesPerView:1,navigation:{nextEl:"#swiper-sidebar-next",prevEl:"#swiper-sidebar-prev"}}); 2//# sourceMappingURL=/cdn/shop/t/5/assets/dt_wishlist.js.map?v=110664790996410221121707056453
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.