1class AlgoliaBadgeSale extends HTMLElement{constructor(){super(),this.connectedCallback=this.connectedCallback.bind(this),this.getSaleLabel=this.getSaleLabel.bind(this),this.getStyle=this.getStyle.bind(this),this.render=this.render.bind(this)}connectedCallback(){this.settings={saleBadgeAllCaps:this.getAttribute("sale-badge-all-caps").toLowerCase()==="true",saleBadgeBorderColor:this.getAttribute("sale-badge-border-color"),saleBadgeBorderRadius:this.getAttribute("sale-badge-border-radius"),saleBadgeBorderWidth:this.getAttribute("sale-badge-border-width"),saleBadgeFillColor:this.getAttribute("sale-badge-fill-color"),saleBadgeFontSize:this.getAttribute("sale-badge-font-size"),saleBadgePaddingX:this.getAttribute("sale-badge-padding-x"),saleBadgePaddingY:this.getAttribute("sale-badge-padding-y"),saleBadgeTextColor:this.getAttribute("sale-badge-text-color"),yAdjustedMap:this.getAttribute("y-adjusted-map")}}getSaleLabel(item){try{const markdownReason=item?.meta["trove-facets"]?.markdownReason||[],matchedMap=JSON.parse(this.settings.yAdjustedMap).find(adjustedMap=>markdownReason.includes(adjustedMap.yadjusted_code));return matchedMap?matchedMap.display_name:""}catch{return""}}getStyle(){const style=document.createElement("style"),css=` 2 .badge--sale { 3 background-color: ${this.settings.saleBadgeFillColor}; 4 border-color: ${this.settings.saleBadgeBorderColor}; 5 border-radius:${this.settings.saleBadgeBorderRadius}px; 6 border-style: solid; 7 border-width: ${this.settings.saleBadgeBorderWidth}px; 8 color: ${this.settings.saleBadgeTextColor}; 9 display: inline-block; 10 padding-block: ${this.settings.saleBadgePaddingY}px; 11 padding-inline: ${this.settings.saleBadgePaddingX}px; 12 } 13 `;return style.appendChild(document.createTextNode(css)),style}render(item){const saleLabel=this.getSaleLabel(item);if(!saleLabel)return[];const style=this.getStyle(),div=document.createElement("div");div.classList.add("badge--sale",this.settings.saleBadgeFontSize),this.settings.saleBadgeAllCaps&&div.classList.add("p-all-caps");const span=document.createElement("span");return span.textContent=saleLabel,div.appendChild(span),[style,div]}}customElements.define("algolia-badge-sale",AlgoliaBadgeSale); 14//# sourceMappingURL=/cdn/shop/t/223/assets/algolia-badge-sale.js.map?v=130208731478406191791789498254
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.