PageSourceSearch

https://rasch.de/theme/e2a39899ea91df829d56423b5775db01/js/storefront/storefront.cart-widget.plugin.7fa32f.js

js rasch.de collected 2026-09-25 07:15:11 UTC 4,191 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[19937],{1369(e,t,r){r.d(t,{A:()=>i});var s=r(1452);class o{constructor(){this._storage={}}setItem(e,t){return this._storage[e]=t}getItem(e){return Object.prototype.hasOwnProperty.call(this._storage,e)?this._storage[e]:null}removeItem(e){return delete this._storage[e]}key(e){return Object.values(this._storage)[e]||null}clear(){return this._storage={}}}class n{constructor(){this._storage=null,this._chooseStorage(),this._validateStorage()}_chooseStorage(){return n._isSupported("localStorage")?this._storage=window.localStorage:n._isSupported("sessionStorage")?this._storage=window.sessionStorage:s.A.isSupported()?this._storage=s.A:this._storage=new o}static _isSupported(e){try{let t="__storage_test";return window[e].setItem(t,"1"),window[e].removeItem(t),!0}catch(e){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}}let i=Object.freeze(new n).getStorage()},9068(e,t,r){r.d(t,{A:()=>s});class s{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,r);return this._sendRequest(s,null,t)}post(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let o=this._createPreparedRequest("POST",e,s);return this._sendRequest(o,t,r)}delete(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let o=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(o,t,r)}patch(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let o=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(o,t,r)}
1abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,r){return this._registerOnLoaded(e,r),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,r){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}}},9937(e,t,r){r.r(t),r.d(t,{default:()=>i});var s=r(4335),o=r(9068),n=r(1369);class i extends s.A{static #e=this.options={cartWidgetStorageKey:"cart-widget-template",emptyCartWidgetStorageKey:"empty-cart-widget"};init(){this._client=new o.A,this.insertStoredContent(),this.fetch()}insertStoredContent(){n.A.setItem(this.options.emptyCartWidgetStorageKey,this.el.innerHTML);let e=n.A.getItem(this.options.cartWidgetStorageKey);e&&(this.el.innerHTML=e),this.$emitter.publish("insertStoredContent")}fetch(){fetch(window.router["frontend.checkout.info"],{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>{if(!(e.status>
1=500)){if(204===e.status){n.A.removeItem(this.options.cartWidgetStorageKey);let e=n.A.getItem(this.options.emptyCartWidgetStorageKey);e&&(this.el.innerHTML=e)}return e.text()}}).then(e=>{n.A.setItem(this.options.cartWidgetStorageKey,e),e.length&&(this.el.innerHTML=e),this.$emitter.publish("fetch",{content: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.