var cart;class CartManager{constructor(t){return Storage.prototype.getObject=function(t){t=this.getItem(t);return t?JSON.parse(t):null},Storage.prototype.setObject=function(t,a){this.setItem(t,JSON.stringify(a))},this.cartName=t||"nfCart",this.cartItems=localStorage.getObject(this.cartName),this.events={cartUpdated:new CustomEvent("cart-updated",{bubbles:!0})},this.cartItems?(this.cartItems=this.cartItems.map(t=>({...t,price:parseFloat(t.price),discount:parseFloat(t.discount),quantity:parseInt(t.quantity,10)})),this.updateCart()):(this.cartItems=[],localStorage.setObject(this.cartName,this.cartItems)),this}get cartAmount(){return this.cartItems.reduce(function(t,a){return t+(a.price-a.discount)*a.quantity},0)}updateCart(){var a=$(".cart > a");if(localStorage.setObject(this.cartName,this.cartItems),a.find(".cart-count").remove(),0').text(t);a.append(e)}this.events.cartUpdated.cart={total:this.cartAmount,items:this.cartItems},window.dispatchEvent(this.events.cartUpdated)}updateItemQuantity(a,r){for(let t=0;tt.ProductOrOfferId!=a),this.updateCart()}isItemInCart(a){for(let t=0;t