PageSourceSearch

https://sassyclassy.com/cdn/shop/t/305/assets/product-inventory.js?v=55550192365841296271788329294

js sassyclassy.com collected 2026-10-10 00:55:59 UTC 3,353 bytes, 2 lines download raw bytes

1if(!customElements.get("product-inventory")){class ProductInventory extends HTMLElement{constructor(){super(),this.hidden?this.initLazySection():window.initLazyScript(this,this.initLazySection.bind(this))}initLazySection(){this.section=this.closest(".js-product"),this.inventoryNotice=this.querySelector(".js-inventory-notice"),this.urgencyMessage=this.querySelector(".js-inventory-urgency"),this.indicatorBar=this.querySelector(".js-inventory-indicator"),this.section.addEventListener("on:variant:change",this.handleVariantChange.bind(this)),this.updateInventory(parseInt(this.dataset.inventoryQuantity,10),this.dataset.variantAvailable==="true",this.dataset.inventoryPolicy)}getVariantInventory(){const dataEl=this.querySelector('[type="application/json"]');return JSON.parse(dataEl.textContent)}handleVariantChange(evt){if(evt.detail.variant){const inventory=this.getVariantInventory().filter(variant=>variant.id===evt.detail.variant.id)[0];this.updateInventory(inventory.inventory_quantity,inventory.available,inventory.inventory_policy)}else this.updateInventory(0,!1),this.hidden=!0}updateInventory(count,available,inventoryPolicy){if(count===0&&!available&&this.hidden)return;let inventoryLevel;if(count<=0?inventoryPolicy==="continue"?inventoryLevel="backordered":available?inventoryLevel="in_stock":inventoryLevel="none":count<=parseInt(this.dataset.thresholdVeryLow,10)?inventoryLevel="very_low":count<=parseInt(this.dataset.thresholdLow,10)?inventoryLevel="low":inventoryLevel="normal",(this.dataset.showNotice==="always"||this.dataset.showNotice==="low"&&inventoryLevel.includes("low"))&&!(inventoryLevel==="backordered"&&this.dataset.showNoStockBackordered==="false")){if(this.hidden=!1,this.setAttribute("data-inventory-level",inventoryLevel),inventoryLevel==="backordered"?this.inventoryNotice.innerText=theme.strings.backordered:inventoryLevel!=="in_stock"&&(this.dataset.showCount==="always"||this.dataset.showCount==="low"&&inventoryLevel.includes("low"))?this.inventoryNotice.innerText=theme.strings.onlyXLeft.replace("[quantity]",count):inventoryLevel==="very_low"?this.inventoryNotice.innerText=theme.strings.veryLowStock:inventoryLevel==="low"?this.inventoryNotice.innerText=theme.strings.lowStock:inventoryLevel==="normal"||inventoryLevel==="in_stock"?this.inventoryNotice.innerText=theme.strings.inStock:inventoryLevel==="none"&&(this.inventoryNotice.innerText=theme.strings.noStock),this.urgencyMessage&&(inventoryLevel==="very_low"?this.urgencyMessage.innerHTML=this.dataset.textVeryLow:inventoryLevel==="low"?this.urgencyMessage.innerHTML=this.dataset.textLow:inventoryLevel==="backordered"?this.urgencyMessage.innerHTML=this.dataset.textNoStockBackordered:inventoryLevel==="normal"||inventoryLevel==="in_stock"?this.urgencyMessage.innerHTML=this.dataset.textNormal:inventoryLevel==="none"&&(this.urgencyMessage.innerHTML=this.dataset.textNoStock)),this.indicatorBar){this.indicatorBar.hidden=!1;let newWidth;(count>=this.dataset.scale||inventoryLevel==="in_stock")&&inventoryLevel!=="backordered"?newWidth=100:newWidth=(100/parseInt(this.dataset.scale,10)*count).toFixed(1),this.indicatorBar.querySelector("span").style.width=`${newWidth}%`}}else this.hidden=!0}}customElements.define("product-inventory",ProductInventory)}
2//# sourceMappingURL=/cdn/shop/t/305/assets/product-inventory.js.map?v=55550192365841296271788329294

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.