1(()=>{var t={845:t=>{self,t.exports=(()=>{"use strict";var t={};return((t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isArmadaLoaded=void 0,e.isArmadaLoaded=t=>{var e,i;const s=!0===(null===(i=null===(e=window.eight)||void 0===e?void 0:e.armada)||void 0===i?void 0:i.loaded);if(!t)return s;s?t():document.addEventListener("ARMADA:LOADED",t)},e.default=e.isArmadaLoaded})(0,t),t})()}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var a=e[s]={exports:{}};return t[s](a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(845);class e extends HTMLElement{constructor(){super(),this.toastTemplate=this.querySelector("template").content;["handleNotifications","handleAddToCart","handleCartError"].forEach((t=>{this[t]=this[t].bind(this)}))}connectedCallback(){(0,t.isArmadaLoaded)(this.init.bind(this))}init(){this.attachEvents(),window.eight.armada.elementRegistry.register({key:"component-toast",assetPath:"/assets/component-toast.min.js"}),window.eight.eventsEngine.emit(`${eight.constants.events["ARMADA:NOTIFICATIONS:LOADED"]}`),window.Shopify.designMode&&setTimeout((()=>this.runTestMode(this.testModeSuccess,this.testModeError)),100)}attachEvents(){document.addEventListener("ARMADA:NOTIFICATIONS:EVENT",this.handleNotifications),document.addEventListener("ARMADA:CART:ADD",this.handleAddToCart),document.addEventListener("ARMADA:CART:ERROR",this.handleCartError)}handleNotifications(t){const{list:e,type:i,id:s}=t.detail;i&&(this.clearAll(i),this.clearErrors(i),s&&(this.addNotification(i,e,s,this.toastTemplate),this.removeNotification(i,s)))}addNotification(t,e,i,s){if("add"!=t)return;const r=e.filter((t=>t.id==i));this.clearAllOnMobile(),this.createNewToast(...r,s)}removeNotification(t,e){if("remove"!=t)return;const i=this.querySelector(`[data-id="${e}"]`);i&&this.removeChild(i)}clearAll(t){if("clear"!=t)return;this.querySelectorAll("toast-item").forEach((t=>{this.removeChild(t)}))}clearErrors(t){if("clear_errors"!=t)return;this.querySelectorAll('[data-armada-selector="toast-error"]').forEach((t=>{this.removeChild(t)}))}clearAllOnMobile(){"sm"==window.eight.getCurrentBreakpoint()&&window.eight.notifications.clearList()}createNewToast(t,e){const i=e.querySelector(`[data-armada-selector="toast-${t.type}"]`).cloneNode(!0);i.setAttribute("notification",JSON.stringify(t)),i.setAttribute("data-id",t.id),this.appendChild(i)}handleAddToCart(t){const{response:e,quantity:i}=t.detail,s=i>1?`${i} ${this.itemsAddedMessage}`:`1 ${this.itemAddedMessage}`,r=e.items[0],a=r.selling_plan_allocation?r.selling_plan_allocation.selling_plan.id:"",o=`${r.id}--${a}`;window.eight.notifications.addToList({type:"atc",message:s,data:{cart_item_id:o},dismissible:!0,error:!1})}handleCartError(t){const{error:e}=t.detail,i=e.data.message,s=e.data.description;window.eight.notifications.addToList({type:"error",message:i,data:{info:s},dismissible:!1,error:!0})}runTestMode(t,e){t&&window.eight.notifications.addToList({type:"form-submit",message:"Success notification",data:{info:"Notification details"},dismissible:!0,error:!1}),e&&window.eight.notifications.addToList({type:"error",message:"Error notification",data:{info:"Notification details"},dismissible:!1,error:!0})}get testModeSuccess(){return"true"===this.getAttribute("data-test-mode-success")}get testModeError(){return"true"===this.getAttribute("data-test-mode-error")}get itemAddedMessage(){return this.getAttribute("data-item-added-message")}get itemsAddedMessage(){return this.getAttribute("data-items-added-message")}detachEvents(){document.removeEventListener("ARMADA:NOTIFICATIONS:EVENT",this.handleNotifications),document.removeEventListener("ARMADA:CART:ADD",this.handleAddToCart),document.removeEventListener("ARMADA:CART:ERROR",this.handleCartError),document.removeEventListener("click",this.clicked)}disconnectedCallback(){this.detachEvents()}}customElements.define("armada-toast",e)})()})();
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.