1import Component,{Topic}from"component";import{ReqSection}from"constants";import{replaceContent,assert}from"utils";export const PRODUCT_TEMPLATE_ATTR="data-notifier-product-template",CLOSE_VALUE="close-notification";const DISPLAY_TIMEOUT=3e3;customElements.define("x-cart-notificator",class extends Component{constructor(){super(),this.$element.stage=this.querySelector('[data-cart-notificator-element="stage"]')}timeout;render(){assert(this.$element.stage,"Stage element is missing"),this.on(this,"change",e=>{e.target.value===CLOSE_VALUE&&(this.close(),clearTimeout(this.timeout))}),this.sub(Topic.CART_UPDATE,({data,error})=>{if(data){const{sections}=data;if(ReqSection.PRODUCT_NOTIFIER in sections){const template=sections[ReqSection.PRODUCT_NOTIFIER].querySelector(`[${PRODUCT_TEMPLATE_ATTR}]`);if(!template){console.error("Notification template is missing");return}clearTimeout(this.timeout),replaceContent(this.$element.stage,template),this.classList.add("cart-notificator--show"),this.timeout=setTimeout(this.close.bind(this),DISPLAY_TIMEOUT)}}},{global:!0})}close(){this.classList.remove("cart-notificator--show"),replaceContent(this.$element.stage,null)}}); 2//# sourceMappingURL=/cdn/shop/t/17/assets/component-cart-notificator.js.map?v=5167175492231238141748271310
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.