1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[33122],{7642:(t,e,s)=>{s.d(e,{Z:()=>a});var r=s(1374);class o{setItem(t,e){return this._storage[t]=e}getItem(t){return Object.prototype.hasOwnProperty.call(this._storage,t)?this._storage[t]:null}removeItem(t){return delete this._storage[t]}key(t){return Object.values(this._storage)[t]||null}clear(){return this._storage={}}constructor(){this._storage={}}}class i{_chooseStorage(){return i._isSupported("localStorage")?this._storage=window.localStorage:i._isSupported("sessionStorage")?this._storage=window.sessionStorage:r.Z.isSupported()?this._storage=r.Z:this._storage=new o}static _isSupported(t){try{let e="__storage_test";return window[t].setItem(e,"1"),window[t].removeItem(e),!0}catch(t){return!1}}_validateStorage(){if("function"!=typeof this._storage.setItem)throw Error('The storage must have a "setItem" function');if("function"!=typeof this._storage.getItem)throw Error('The storage must have a "getItem" function');if("function"!=typeof this._storage.removeItem)throw Error('The storage must have a "removeItem" function');if("function"!=typeof this._storage.key)throw Error('The storage must have a "key" function');if("function"!=typeof this._storage.clear)throw Error('The storage must have a "clear" function')}getStorage(){return this._storage}constructor(){this._storage=null,this._chooseStorage(),this._validateStorage()}}let a=Object.freeze(new i).getStorage()},609:(t,e,s)=>{s.d(e,{Z:()=>o});var r=s(9568);class o extends r.Z{init(){this.products={}}load(){this.$emitter.publish("Wishlist/onProductsLoaded",{products:this.products})}has(t){return!!this.products[t]}add(t){this.products[t]=new Date().toISOString(),this.$emitter.publish("Wishlist/onProductAdded",{products:this.products,productId:t})}remove(t){delete this.products[t],this.$emitter.publish("Wishlist/onProductRemoved",{products:this.products,productId:t})}getCurrentCounter(){return this.products?Object.keys(this.products).length:0}getProducts(){return this.products}}},3122:(t,e,s)=>{s.r(e),s.d(e,{default:()=>a});var r=s(7642),o=s(609),i=s(1374);class a extends o.Z{init(){this.cookieEnabledName="wishlist-enabled",this.storage=r.Z,super.init(),this._registerEvents()}load(){this.products=this._fetch(),super.load()}add(t,e){if(window.useDefaultCookieConsent&&!i.Z.getItem(this.cookieEnabledName)){window.location.href=e.afterLoginPath,this.$emitter.publish("Wishlist/onLoginRedirect");return}super.add(t),this._save()}remove(t){super.remove(t),this._save()}_fetch(){if(window.useDefaultCookieConsent&&!i.Z.getItem(this.cookieEnabledName)&&this.storage.removeItem(this._getStorageKey()),this.getCurrentCounter()>0)return this.products;let t=this.storage.getItem(this._getStorageKey());if(!t)return{};try{let e=JSON.parse(t);return e instanceof Object?e:{}}catch(t){return{}}}_save(){null===this.products||0===this.getCurrentCounter()?this.storage.removeItem(this._getStorageKey()):this.storage.setItem(this._getStorageKey(),JSON.stringify(this.products))}_getStorageKey(){return"wishlist-"+(window.salesChannelId||"")}_registerEvents(){let t=window.PluginManager.getPluginInstances("AccountGuestAbortButton");t&&t.forEach(t=>{t.$emitter.subscribe("guest-logout",()=>{this.storage.removeItem(this._getStorageKey())})})}}}}]);
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.