PageSourceSearch

https://principalsecret.com/cdn/shop/t/10/assets/sass-product.js?v=6273424130032495491771350280

js principalsecret.com collected 2026-10-02 13:20:02 UTC 2,896 bytes, 2 lines download raw bytes

1class SassProduct extends HTMLElement{constructor(el){super(el),this.setupDefaults(),this.addListeners()}setupDefaults(){this.jsonData=JSON.parse(this.querySelector("[data-product-json]").text),this.includes=this.querySelector(".includes-section li"),this.price=this.querySelector(".price-value"),this.image=this.querySelector(".product-wrap-image"),this.title=this.querySelector(".item-header"),this.swatch=this.querySelectorAll('.sass-item__option [type="radio"]'),this.paywhirl=this.querySelector(".sass-item__paywhirl"),this.options={option1:null,option2:null,option3:null},this.currentVariant=null,this.swatch.forEach(item=>item.addEventListener("change",e=>this.onOptionChanged(e))),this.jsonData.product.variants.forEach(variant=>{variant.id===this.jsonData.selected_variant_id&&(this.currentVariant=variant,this.options.option1=variant.option1,this.options.option2=variant.option2,this.options.option3=variant.option3)})}addListeners(){this.addEventListener("click",e=>this.onProductSelected(e)),this.addEventListener("keydown",e=>this.onProductKeydown(e))}onProductKeydown(e){e.target===this&&(e.key==="Enter"||e.key===" "||e.key==="Spacebar")&&(e.preventDefault(),this.dataset.keyboardSelect="true",this.click())}onProductSelected(e){const $target=e.currentTarget,$parent=$target.closest(".sass__listing"),shouldAnnounce=e.isTrusted||$target.dataset.keyboardSelect==="true";delete $target.dataset.keyboardSelect,$parent.querySelectorAll(".sass-item").forEach(element=>{element.classList.remove("checked"),element.removeAttribute("aria-current");const baseSelectionLabel=element.getAttribute("data-selection-label");baseSelectionLabel&&element.setAttribute("aria-label",baseSelectionLabel)}),$target.classList.add("checked");const selectedSelectionLabel=$target.getAttribute("data-selection-label");selectedSelectionLabel&&$target.setAttribute("aria-label",`${selectedSelectionLabel}, selected`),$target.setAttribute("aria-current","true"),window.dispatchEvent(new CustomEvent("onProductSelected",{detail:{title:$target.querySelector(".page-sass__product__header__label").innerHTML,price:$target.querySelector(".sass__product-price").innerHTML,image:this.jsonData.product.featured_image,selectedLabel:$target.getAttribute("data-product-title"),announce:shouldAnnounce}}))}onOptionChanged(e){this.options["option"+e.currentTarget.getAttribute("data-option-position")]=e.currentTarget.value,this.currentVariant=this.getCurrentVariantFromOptions(),this.dataset.productId=this.currentVariant.id}getCurrentVariantFromOptions(){var found=!1;
1return this.jsonData.product.variants.forEach(variant=>{variant.option1===this.options.option1&&variant.option2===this.options.option2&&variant.option3===this.options.option3&&(found=variant)}),found||null}}customElements.define("sass-product",SassProduct);
2//# sourceMappingURL=/cdn/shop/t/10/assets/sass-product.js.map?v=6273424130032495491771350280

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.