PageSourceSearch

https://rasch.de/theme/e2a39899ea91df829d56423b5775db01/js/tanmar-…olling.filter-multi-select.plugin.692f50.js

js rasch.de collected 2026-09-25 07:16:39 UTC 9,508 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[68990],{156(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function l(t,e){try{return e in t}catch(t){return!1}}function o(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=s;var c,h,u=Array.isArray(i);return u!==Array.isArray(t)?s(i,a):u?a.arrayMerge(t,i,a):(h={},(c=a).isMergeableObject(t)&&n(t).forEach(function(e){h[e]=s(t[e],c)}),n(i).forEach(function(e){(!l(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(l(t,e)&&c.isMergeableObject(i[e])?h[e]=(function(t,e){if(!e.customMerge)return o;var i=e.customMerge(t);return"function"==typeof i?i:o})(e,c)(t[e],i[e],c):h[e]=s(i[e],c))}),h)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return o(t,i,e)},{})},t.exports=o},373(t,e,i){i.d(e,{A:()=>o});var s=i(156),r=i.n(s);class n{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=n.toUpperCamelCase(t,e);return n.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class l{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,r=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:i,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class o{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new l(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),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(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),r().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}
1,701(t,e,i){i.d(e,{A:()=>r});var s=i(373);class r extends s.A{static #t=this.options={parentFilterPanelSelector:".cms-element-product-listing-wrapper",dropdownSelector:".filter-panel-item-dropdown"};_init(){super._init(),this._validateMethods();let t=document.querySelector(this.options.parentFilterPanelSelector);this.listing=window.PluginManager.getPluginInstanceFromElement(t,"Listing"),this.listing.registerFilter(this),this._preventDropdownClose()}_preventDropdownClose(){let t=this.el.querySelector(this.options.dropdownSelector);t&&t.addEventListener("click",t=>{t.stopPropagation()})}_validateMethods(){if("function"!=typeof this.getValues)throw Error(`[${this._pluginName}] Needs the method "getValues"'`);if("function"!=typeof this.getLabels)throw Error(`[${this._pluginName}] Needs the method "getLabels"'`);if("function"!=typeof this.reset)throw Error(`[${this._pluginName}] Needs the method "reset"'`);if("function"!=typeof this.resetAll)throw Error(`[${this._pluginName}] Needs the method "resetAll"'`)}}},970(t,e,i){i.d(e,{A:()=>l});var s=i(701),r=i(156),n=i.n(r);class l extends s.A{static #t=this.options=n()(s.A.options,{checkboxSelector:".filter-multi-select-checkbox",countSelector:".filter-multi-select-count",listItemSelector:".filter-multi-select-list-item",snippets:{disabledFilterText:"Filter not active",ariaLabel:"",ariaLabelCount:""},mainFilterButtonSelector:".filter-panel-item-toggle"});init(){this.selection=[],this.counter=this.el.querySelector(this.options.countSelector),this.mainFilterButton=this.el.querySelector(this.options.mainFilterButtonSelector),this._registerEvents()}_registerEvents(){this.el.querySelectorAll(this.options.checkboxSelector).forEach(t=>{t.addEventListener("change",this._onChangeFilter.bind(this))})}getValues(){let t=this.el.querySelectorAll(`${this.options.checkboxSelector}:checked`),e=[];t?t.forEach(t=>{e.push(t.id)}):e=[],this.selection=e,this._updateCount();let i={};return i[this.options.name]=e,i}getLabels(){let t=this.el.querySelectorAll(`${this.options.checkboxSelector}:checked`),e=[];return t?t.forEach(t=>{e.push({label:t.dataset.label,id:t.id})}):e=[],e}setValuesFromUrl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!1,i=t[this.options.name],s=i?i.split("|"):[],r=this.selection.filter(t=>!s.includes(t)),n=s.filter(t=>!this.selection.includes(t));return(r.length>0||n.length>0)&&(e=!0),n.forEach(t=>{let e=this.el.querySelector(`[id="${t}"]`);e&&(e.checked=!0,this.selection.push(e.id))}),r.forEach(t=>{this.reset(t),this.selection=this.selection.filter(e=>e!==t)}),this._updateCount(),e}_onChangeFilter(){this.listing.changeListing(!0,{p:1})}reset(t){let e=this.el.querySelector(`[id="${t}"]`);e&&(e.checked=!1)}resetAll(){this.selection.filter=[];let t=this.el.querySelectorAll(`${this.options.checkboxSelector}:checked`);t&&t.forEach(t=>{t.checked=!1})}refreshDisabledState(t){let e=t[this.options.name];if(!e.entities||e.entities.length<1){this.disableFilter();return}this.enableFilter(),this._disableInactiveFilterOptions(e.entities.map(t=>t.id))}_disableInactiveFilterOptions(t){this.el.querySelectorAll(this.options.checkboxSelector).forEach(e=>{!0!==e.checked&&(t.includes(e.id)?this.enableOption(e):this.disableOption(e))})}disableOption(t){let e=t.closest(this.options.listItemSelector);e.classList.add("disabled"),e.setAttribute("title",this.options.snippets.disabledFilterText),t.disabled=!0}enableOption(t){let e=t.closest(this.options.listItemSelector);e.removeAttribute("title"),e.classList.remove("disabled"),t.disabled=!1}enableAllOptions(){this.el.querySelectorAll(this.options.checkboxSelector).forEach(t=>{this.enableOption(t)})}disableFilter(){let t=this.el.querySelector(this.options.mainFilterButtonSelector);t.classList.add("disabled"),t.setAttribute("disabled","disabled"),t.setAttribute("title",this.options.snippets.disabledFilterText)}enableFilter(){let t=this.el.querySelector(this.options.mainFilterButtonSelector);t.classList.remove("disabled"),t.removeAttribute("disabled"),t.removeAttribute("title")}_updateCount(){this.counter.textContent=this.selection.length?`(${this.selection.length})`:"",this._updateAriaLabel()}_updateAriaLabel(){if(this.options.snippets.ariaLabel){if(0===this.selection.length){this.mainFilterButton.setAttribute("aria-label",this.options.snippets.ariaLabel);return}this.mainFilterButton.setAttribute("aria-label",`${this.options.snippets.ariaLabel} (${this.options.snippets.ariaLabelCount.replace("%count%",this.selection.length.toString())})`)}}}},990(t,e,i){i.r(e),i.d(e,{default:()=>r});var s=i(970);class r extends s.A{_onChangeFilter(){var t=this.listing;t._tmisActive?(t._tmisListingOption="override",t._visitedPagesClear(),t._tmisNewPageRequestCounter=0,t._tmisIsLoading=!0,t._tmisLog("  reset _onChangeFilter"),t.changeListing(
1)):super._onChangeFilter()}}}}]);

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.