PageSourceSearch

https://cogi-suite.de/theme/fe1228ba7926470b5657d52fe3445773/js/co…ogi-affiliate-best-selling.plugin.990b2c.js

js cogi-suite.de collected 2026-10-07 16:44:27 UTC 9,844 bytes, 9 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[59629],{156:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function n(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function i(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c,u,d=Array.isArray(r);return d!==Array.isArray(e)?s(r,l):d?l.arrayMerge(e,r,l):(u={},(c=l).isMergeableObject(e)&&i(e).forEach(function(t){u[t]=s(e[t],c)}),i(r).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(r[t])?u[t]=(function(e,t){if(!t.customMerge)return o;var r=t.customMerge(e);return"function"==typeof r?r:o})(t,c)(e[t],r[t],c):u[t]=s(r[t],c))}),u)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return o(e,r,t)},{})},e.exports=o},629:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(373),n=r(68);let i="loader",a={BEFORE:"before",INNER:"inner"};class o{constructor(e,t=a.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===a.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=o.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),o.getTemplate())}}remove(){if(this.position===a.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${i}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${i}`).length>0}_getPosition(){return this.position===a.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${i}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return i}}let l="element-loader-backdrop";class c extends o{static create(e){e.classList.add("has-element-loader"),c.exists(e)||(c.appendLoader(e),setTimeout(()=>{let t=e.querySelector(`.${l}`);t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(`.${l}`);t&&t.remove()}static exists(e){return e.querySelectorAll(`.${l}`).length>0}static getTemplate(){return`
4        <div class="${l}">
5            <div class="loader" role="status">
6                <span class="visually-hidden">Loading...</span>
7            </div>
8        </div>
9        `}static appendLoader(e){e.insertAdjacentHTML("beforeend",c.getTemplate())}}class u extends s.A{init(){this.httpClient=new n.A;let e=document.querySelector("#cogi-affiliate-best-selling-range");e.addEventListener("change",t=>{this.setRange(e.value)})}setRange(e){let t=document.querySelector("#cogi-affiliate-best-selling-products");t.classList.remove("d-none"),c.create(t);let r=document.querySelector("#cogi-affiliate-best-selling-range");r.disabled=!0;let s=document.querySelector("#cogi-affiliate-best-selling-products-items");s.innerHTML="";let n=document.querySelector("#cogi-affiliate-best-selling-products-error"),i=n.querySelector("#cogi-affiliate-best-selling-products-error .alert-content-container");i.innerHTML="",n.classList.add("d-none");let a=document.querySelector("#cogi-affiliate-best-selling-no-data");a.classList.add("d-none"),this.httpClient.post(this.options.bestSellingPath,JSON.stringify({range:e}),e=>{c.remove(t),r.disabled=!1;let o=JSON.parse(e);if(!o.success){t.classList.add("d-none"),i.innerHTML=this.options.translated["cogi-affiliate.error.unknown_error"],o.message&&(i.innerHTML=o.message),n.classList.remove("d-none");return}let l=o.bestSellingProducts;if(!l.length){t.classList.add("d-none"),a.classList.remove("d-none");return}l.forEach(function(e){let t=document.createElement("div");t.classList.add("row"),t.classList.add("pb-3");let r=document.createElement("div");r.classList.add("col-5"),r.appendChild(document.createTextNode(e.productNumber)),t.appendChild(r);let n=document.createElement("div");n.classList.add("col-5"),n.appendChild(document.createTextNode(e.name)),t.appendChild(n);let i=document.createElement("div");i.classList.add("col-2"),i.appendChild(document.createTextNode(e.amount)),t.appendChild(i),s.appendChild(t),s.appendChild(document.createElement("hr"))})})}}},373:(e,t,r)=>{r.d(t,{A:()=>
9o});var s=r(156),n=r.n(s);class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let r=i.toUpperCamelCase(e,t);return i.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class a{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(s),s}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=e.split("."),i=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=i;i=function(r){s.unsubscribe(e),t(r)}}return this.el.addEventListener(n[0],i),this.listeners.push({splitEventName:n,opts:r,cb:i}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class o{constructor(e,t={},r=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${r}".`);return}this.el=e,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),n().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=i.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${t}-config`);return r?window.PluginConfigManager.get(this._pluginName,r):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=i.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${t}-options`);if(r)try{return JSON.parse(r)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}},68:(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 n=this._createPreparedRequest("POST",e,s);return this._sendRequest(n,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 n=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(n,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 n=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(n,t,r)}
9abort(){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}}}}]);

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.