PageSourceSearch

https://www.beiersdorfusa.com/dist/bdfcw/modules/PublicationsFilter.2b5a6cad.js

js beiersdorfusa.com collected 2026-09-29 06:53:40 UTC 20,656 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1820,2738,3699,5131,8174],{26577(t,e,i){i.d(e,{_:()=>n});var n=function(){function t(){}return t.all=function(t){return t.match(/[^&\?]*=[^&]*/gi)||[]},t.addWithoutDecode=function(t,e){var i=this.all(t);for(var n in e){var r=encodeURIComponent(n),o=encodeURIComponent(e[n]);-1===t.search(new RegExp(n+"=","i"))?i.push(r+"="+o):t=this.updateWithoutDecode(t,{k:o})}return[t.split("?")[0],i.join("&")].join("?")},t.removeWithoutDecode=function(t,e){for(var i=0;i<e.length;i++)t=t.replace(new RegExp(e[i]+"=.*?&|&?"+e[i]+"=[^&]*","i"),"");return t},t.updateWithoutDecode=function(t,e){for(var i in e)t=t.replace(new RegExp("("+i+")(=)([^&]*)","i"),"$1$2"+e[i]);return t},t.getWithoutDecode=function(t,e){var i={};if(void 0!==e)for(var n=0;n<e.length;n++){var r=new RegExp(e[n]+"=([^&]*)").exec(t);null!=r&&void 0!==r[1]&&(i[e[n]]=r[1])}else{var o=this.all(t);for(n=0;n<o.length;n++){var s=/([^&\?]*)=([^&]*)/i.exec(o[n]);void 0!==s[1]&&void 0!==s[2]&&(i[s[1]]=s[2])}}return i},t}()},17098(t,e,i){var n=i(20017);const r=function(){function t(t,e){void 0===e&&(e={}),this.container=t,this.options=e,this.active=this.container.className.includes("active"),this.options=(0,n.$E)(this.container,Object.assign(this.getDefaultOptions(),this.options)),this.init()}return t.prototype.init=function(){return this.saveInitialHeight().setElementHeight(this.container,this.getSuitableHeight()),this},t.prototype.saveInitialHeight=function(){return this.height=this.options.maxHeight||this.getElementHeight(this.container),this.width=this.getElementWidth(this.container),this.container.dataset.elementHeight=null!=this.height?this.height.toString():"",this.container.dataset.elementWidth=null!=this.height?this.width.toString():"",this},t.prototype.getElementHeight=function(t){return t.offsetHeight},t.prototype.getElementWidth=function(t){return t.offsetWidth},t.prototype.getSuitableHeight=function(){return this.active?this.height:this.options.collapsedHeight},t.prototype.setElementHeight=function(t,e){return t.style.maxHeight=null!=e?e+"px":"",this},t.prototype.toggleState=function(){return this.active=!this.active,this},t.prototype.getDefaultOptions=function(){return{collapsedHeight:115}},t.prototype.setCollapsedHeight=function(t){return this.options.collapsedHeight=t,this},t.prototype.toggle=function(){return this.toggleState().setElementHeight(this.container,this.getSuitableHeight()),this},t.prototype.isActive=function(){return this.active},t.prototype.needToBeShown=function(){return this.height>1.25*this.options.collapsedHeight},t.prototype.clear=function(){return this.setElementHeight(this.container).saveInitialHeight(),this},t.prototype.render=function(){return this.setElementHeight(this.container,this.getSuitableHeight()),this},t.prototype.getContainer=function(){return this.container},t}();i.d(e,["default",0,r])},57389(t,e,i){var n=i(17098),r=i(20017),o='[data-module="Expander"]',s=function(){function t(t,e){void 0===e&&(e={}),this.element=t,this.options=e,this.options=(0,r.$E)(this.element,Object.assign(this.getDefaultOptions(),this.options)),this.container=this.element.querySelector(".".concat(this.options.contaiterSelector))||this.element,this.button=this.element.querySelector(".".concat(this.options.buttonSelector)),this.expandable=new n.default(this.container,this.options.expandableOptions),this.init()}return t.setup=function(e){void 0===e&&(e=o),Array.from(document.querySelectorAll(e)).filter(function(t){return!t.dataset.moduleInitialized}).forEach(function(e){new t(e),e.dataset.moduleInitialized="true"})},t.prototype.init=function(){return this.showExpanderButton().setButtonEventHandler().adjustAppearance().applyActiveFromOptions(),this},t.prototype.showExpanderButton=function(){return this.button.hidden=!1,this},t.prototype.setButtonEventHandler=function(){return this.button.addEventListener("click",this.toggleExpander.bind(this)),this},t.prototype.toggleActiveModifier=function(t){return t?this.element.classList.add("".concat(this.options.elementSelector,"--active")):this.element.classList.remove("".concat(this.options.elementSelector,"--active")),this},t.prototype.showFade=function(t){return t?this.options.hasFade&&this.container.classList.add("".concat(this.options.contaiterSelector,"--with-fade")):this.options.hasFade&&this.container.classList.remove("".concat(this.options.contaiterSelector,"--with-fade")),this},t.prototype.toggleExpander=function(t){void 0===t&&(t=!0),this.expandable.toggle(
1),this.toggleActiveModifier(this.expandable.isActive())},t.prototype.applyActiveFromOptions=function(){return this.options.isActive&&this.toggleExpander(!1),this},t.prototype.setupExpander=function(){return this.expandable.render(),this.showFade(!0).hideButton(!1),this},t.prototype.destroyExpander=function(){return this.expandable.clear(),this.showFade(!1).hideButton(!0),this},t.prototype.hideButton=function(t){return this.button.hidden=t,this},t.prototype.getDefaultOptions=function(){return{elementSelector:"cw-expander",contaiterSelector:"cw-expander__content",buttonSelector:"cw-expander__button",hasFade:!0,beforeResize:function(){}}},t.prototype.adjustAppearance=function(){return this.expandable.clear(),this.expandable.needToBeShown()?this.setupExpander():this.destroyExpander(),this},t.prototype.setCollapsedHeight=function(t){return this.expandable.setCollapsedHeight(t),this},t.prototype.setBeforResizeCB=function(t){return this.options.beforeResize=t,this},t.prototype.isActive=function(){return this.expandable.isActive()},t.prototype.toggle=function(){return this.toggleExpander(),this},t}();const a=s;new s.setup(o),i.d(e,["default",0,a])},63278(t,e,i){var n=i(57389),r=i(20017);const o=function(){function t(t){this.element=t,this.expander=this.getExpander(),this.checkBoxes=this.getCheckBoxes(),this.selectedContainer=this.getContainerForSelectedFilters(),this.init()}return t.prototype.init=function(){return this.addHandlerOnCheckBoxChange(),this},t.prototype.getExpander=function(){return new n.default(this.element,{elementSelector:"cw-tag-filter__item",contaiterSelector:"cw-filters",buttonSelector:"cw-tag-filter__title",hasFade:!1})},t.prototype.getCheckBoxes=function(){return Array.from(this.element.querySelectorAll(".cw-cat-item__tag-value"))},t.prototype.getContainerForSelectedFilters=function(){return this.element.querySelector(".cw-title__selected-filters")},t.prototype.addHandlerOnCheckBoxChange=function(){var t=this;return this.element.addEventListener("change",function(e){var i=e.target;i&&requestAnimationFrame(function(){t.setTimeStamp(i).showSelectedFilters().adjustAppearance()})}),this},t.prototype.getSelectedCheckBoxes=function(t){return t.filter(function(t){return t.checked})},t.prototype.showSelectedFilters=function(){var t=this.getSelectedCheckBoxes(this.checkBoxes).length,e=this.element.dataset.selectedTitle,i=parseInt(this.element.dataset.showSelected);if(this.getSelectedCheckBoxes(this.checkBoxes).length<i){var n=(0,r.jL)(this.getSelectedCheckBoxes(this.checkBoxes)).join(", ");this.selectedContainer.innerHTML=n}else this.selectedContainer.innerHTML="".concat(t," ").concat(e);return this},t.prototype.setTimeStamp=function(t){return t.timeStamp=Date.now(),this},t.prototype.adjustAppearance=function(){return this.expander.adjustAppearance(),this},t.prototype.refreshFilters=function(){return this.showSelectedFilters(),this},t.prototype.closeExpander=function(){return this.expander.isActive()&&this.expander.toggle(),this},t.prototype.getCheckedFilters=function(){return this.getSelectedCheckBoxes(this.checkBoxes)},t}();i.d(e,["default",0,o])},85787(t,e,i){var n=i(63278),r=i(78753),o=i(20017),s=i(5440),a='[data-module="PublicationsFilter"]',c=function(){function t(t,e){void 0===e&&(e={}),this.element=t,this.options=e,this.suppressEvents=!1,this.options=(0,o.$E)(this.element,Object.assign(this.getDefaultOptions(),this.options)),this.init(),document.addEventListener("click",function(t){var e=t.target.closest(".cw-publications-items");if(e){var i=e.closest(".cw-publications-accordion");i&&i.classList.toggle("publications-expanded")}})}return t.setup=function(e){void 0===e&&(e=a),Array.from(document.querySelectorAll(e)).filter(function(t){return!t.dataset.moduleInitialized}).forEach(function(e){new t(e),e.dataset.moduleInitialized="true"})},t.prototype.initFields=function(){return this.resetBtn=this.element.querySelector(this.options.resetBtnSelector),this.filterNode=this.element.querySelector(this.options.filterSelector),this.searchField=this.element.querySelector(this.options.searchFieldSelector),this.searchIcon=this.element.querySelector(this.options.searchIconSelector),this.filterButton=this.element.querySelector(this.options.filterButton),this.resultsContainer=this.element.querySelector(this.options.resultsContainerSelector),this.loadingSpinner=null,this.suppressEvents=!1,this},t.prototype.init=function(){return this.initFields().showLoadingSpinner().initFilterItems(this.filterNode).initFilterAction(this.element).initSearchField().initFilterActivated().addHandlerOnFilterChange().addHandlerOnResetBtn().addHandlerOnFilterClick().synchronize().shouldShowResults().hideLoadingSpinner(),this.suppressEvents=!1,this},t.prototype.showLoadingSpinner=function(){return null==this.element.querySelector(this.options.filterLoadingSpinnerSelector)||null==this.loadingSpinner?(this.loadingSpinner=document.createElement("div"),this.loadingSpinner.innerHTML='<div class="'.concat(this.options.filterLoadingSpinnerSelector,' cw-spinner cw-spinner__loading cw-spinner--overlay cw-spinner--align-middle"><div class="cw-spinner__container "><div class="cw-spinner__wheel"></div></div></div>'),this.element.appendChild(this.loadingSpinner)):this.loadingSpinner.hidden=!1,this},t.prototype.hideLoadingSpinner=function(){var t=this;return setTimeout(function(){t.loadingSpinner.hidden=!0,(0,s.vy)(t.filterNode,"loading")},1e3),this},t.prototype.initSearchField=function(){var t=this;return this.searchField.addEventListener("keyup",function(e){13===e.keyCode&&t.searchFieldChanged()}),this.searchIcon.addEventListener("click",function(){t.searchFieldChanged()}),this},t.prototype.initFilterActivated=function(){var t=this;return this.filterButton.addEventListener("click",function(){t.filterFieldsChecked()}),this},t.prototype.filterFieldsChecked=function(){return this.suppressEvents||this.reloadFilter(),this},t.prototype.searchFieldChanged=function(){return this.suppressEvents||this.reloadFilter(),this},t.prototype.reloadFilter=function(){return this.filterAction.updateUrl(),this.executeReloadFilterAjax(this.filterAction.getFilterAjaxUrl(
1)),this},t.prototype.executeReloadFilterAjax=function(t){var e=this;fetch(t,{}).then(function(t){return t.text()}).then(function(t){var i=(0,s.Uo)("<div>"+t+"</div>").querySelector(e.options.publicationsFilterContainerSelector);e.element.querySelector(e.options.containerSelector).innerHTML=i.innerHTML,e.init()})},t.prototype.initFilterAction=function(t){return this.filterAction=new r.default(t,{}),this},t.prototype.initFilterItems=function(t){return this.filterItems=Array.from(t.querySelectorAll(this.options.filterItemSelector)).map(function(t){return new n.default(t)}),this},t.prototype.addHandlerOnResetBtn=function(){var t=this;return this.resetBtn.addEventListener("click",function(){return t.reset()}),this},t.prototype.reset=function(){return this.suppressEvents=!0,this.resetSearchField(),this.filterAction.resetState(),this.filterItems.forEach(function(t){t.refreshFilters()}),this.reloadFilter(),this.suppressEvents=!1,this},t.prototype.resetSearchField=function(){return this.searchField.value="",this},t.prototype.updateAllFilterItems=function(){return this.filterItems.forEach(function(t){return t.refreshFilters()}),this},t.prototype.updateFilterAction=function(){return this.filterAction.update(),this.filterAction.updateUrl(),this},t.prototype.onFilterChange=function(){var t=event.target;this.suppressEvents||t.closest(this.options.checkboxSelector)&&this.updateFilterAction()},t.prototype.addHandlerOnFilterChange=function(){var t=this;return this.filterNode.addEventListener("change",function(){return t.onFilterChange()}),this},t.prototype.onDocumentClick=function(t){var e=t.target,i=e.closest(this.options.filterItemSelector+"--active")||e;this.filterItems.forEach(function(t){return t.element!==i&&t.closeExpander()})},t.prototype.addHandlerOnFilterClick=function(){return document.addEventListener("click",this.onDocumentClick.bind(this)),this},t.prototype.synchronize=function(){return this.updateAllFilterItems(),this},t.prototype.shouldShowResults=function(){return this.shouldshowResultsContainer(),this},t.prototype.shouldshowResultsContainer=function(){return"0"===this.filterNode.dataset.resultCount||"0"===this.filterNode.dataset.teaserCount?this.hideResultsContainer():this.showResultsContainer(),this},t.prototype.showResultsContainer=function(){return(0,s.vy)(this.resultsContainer,"cw-hidden"),this},t.prototype.hideResultsContainer=function(){return(0,s.iQ)(this.resultsContainer,"cw-hidden"),this},t.prototype.getDefaultOptions=function(){return{filterSelector:".cw-tag-filter",checkboxSelector:".cw-cat-item__tag-value",searchFieldSelector:".cw-search",filterItemSelector:".cw-tag-filter__item",resetBtnSelector:".cw-sort-filters__reset-btn",listNodeSelector:".cw-publications-list",searchIconSelector:".cw-search__wrapper .search-icon",filterButton:".cw-publication-button",loadMoreSelector:".cw-show-more",filterLoadingSpinnerSelector:".cw-newsfilter-loading-spinner",ajaxSpinnerSelector:".cw-newsfilter-ajax-spinner",publicationsFilterContainerSelector:".cw-publications-filter .cw-container",containerSelector:".cw-container",resultsContainerSelector:".cw-publications-results",loadedTitleSelector:".loaded-title"}},t}();const l=c;new c.setup(a),i.d(e,["default",0,l])},78753(t,e,i){var n=i(20017),r=i(5440),o=i(26577),s=function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s};const a=function(){function t(t,e){void 0===e&&(e={}),this.element=t,this.options=e,this.options=(0,n.$E)(this.element,Object.assign(this.getDefaultOptions(),this.options)),this.filterTag=this.element.querySelector(this.options.filterTagSelector),this.ajaxUrl=this.filterTag.dataset.ajaxUrl,this.baseContextUrl=this.getBaseUrl(),this.filterAjaxUrl=this.filterTag.dataset.filterAjaxUrl,this.tagsMap={tagsStr:window.atob(this.filterTag.getAttribute(this.options.tagsMapAttrs.tagsStrAttr)),tagCount:parseInt(this.filterTag.getAttribute(this.options.tagsMapAttrs.tagCountAttr)),itemsCount:parseInt(this.filterTag.getAttribute(this.options.tagsMapAttrs.itemsCountAttr))},this.init()}return t.prototype.init=function(){return this.update(),this},t.prototype.getFilters=function(){var t=this,e=[];return Array.from(this.element.querySelectorAll(this.options.filterItemSelector)).forEac
1h(function(i){var n=i.dataset.key,r="True"===i.dataset.isAnd,o=Array.from(i.querySelectorAll(t.options.checkboxSelector)),s=[];o.forEach(function(t){s.push({node:t,key:t.value,checked:t.checked,index:parseInt(t.dataset.index)})});var a={node:i,key:n,values:s,isAnd:r,cache:[]};e.push(a)}),e},t.prototype.isItemTagged=function(t,e){var i=t*this.tagsMap.tagCount+e;return!!(this.tagsMap.tagsStr.charCodeAt(Math.floor(i/8))&1<<i%8)},t.prototype.isItemIncludedInFilter=function(t,e){for(var i=e.values,n=e.isAnd,r=!1,o=0;o<i.length;o++){var s=i[o];if(s.checked)if(r=!0,this.isItemTagged(t,s.index)){if(!n)return!0}else if(n)return!1}return!!n||!r},t.prototype.isItemVisible=function(t){for(var e=0;e<this.filters.length;e++){var i=this.filters[e],n=i.cache[t];if(!0!==n){if(!1===n)return!1;var r=this.isItemIncludedInFilter(t,i);if(i.cache[t]=r,!r)return!1}}return!0},t.prototype.getSearchFieldValue=function(){var t=this.element.querySelector(this.options.searchFieldSelector);return void 0!==t&&null!=t?t.value:""},t.prototype.countResults=function(){for(var t=0,e=0;e<this.tagsMap.itemsCount;e++)this.isItemVisible(e)&&t++;return t},t.prototype.countSimulateChecked=function(t,e,i){var n=this.filters[t],r=n.cache;n.cache=[];var o=n.values[e],s=o.checked;o.checked=i;var a=this.countResults();return o.checked=s,n.cache=r,a},t.prototype.countSimulateOnlyThisChecked=function(t,e){var i=this.filters[t];this.filters[t]={cache:[],values:[{index:i.values[e].index,checked:!0}]};var n=this.countResults();return this.filters[t]=i,n},t.prototype.setCount=function(t,e,i){var n;return n=(0,r.rQ)(t.node,this.options.countNodeSelector)||t.node.nextSibling.nextSibling,t.node.disabled=i,n.innerText=e,this},t.prototype.anyValueChecked=function(t){for(var e=t.values,i=0;i<e.length;i++)if(e[i].checked)return!0;return!1},t.prototype.getReloadUrl=function(){var t=this.encodeParams(this.getParams());return this.ajaxUrl+"&"+t},t.prototype.getFilterAjaxUrl=function(){var t=this.encodeParams(this.getParams());return this.filterAjaxUrl+"&"+t},t.prototype.getPublicationFilterRedirectUrl=function(){var t=this.encodeParams(this.getParams());return this.ajaxUrl+"?"+t},t.prototype.getParams=function(t){var e=this.getFilters(),i=this.getSearchFieldValue(),n={};return e.forEach(function(t){var e=[];t.values.forEach(function(t){t.checked&&e.push(t.key)}),e.length>0&&(n[t.key]=e)}),null!=i&&""!==i&&(n.query=[i]),null!=t&&t>0&&(n.offset=[t]),n},t.prototype.getBaseUrl=function(){var t=location.href,e=this.getParamKeys();return o._.removeWithoutDecode(t,e)},t.prototype.getParamKeys=function(){var t=this.getFilters(),e=[];return t.forEach(function(t){e.push(t.key)}),e.push("query"),e.push("offset"),e},t.prototype.encodeParams=function(t){return Object.entries(t).map(function(t){var e=s(t,2),i=e[0],n=e[1];return"".concat(encodeURIComponent(i),"=").concat(n.map(function(t){return encodeURIComponent(t)}).join(","))}).join("&")},t.prototype.update=function(){var t=this;return this.filters=this.getFilters(),this.filters.forEach(function(e,i){e.values.forEach(function(n,r){var o;if(n.checked)o="";else{var s=t.countSimulateChecked(i,r,!0);o=t.anyValueChecked(e)?0===t.countSimulateOnlyThisChecked(i,r)?"0":"+".concat(t.countSimulateOnlyThisChecked(i,r)):s.toString()}var a=document.querySelector(".cw-reset-filter"),c=t.getSearchFieldValue();t.anyValueChecked(e)||""!==c.trim()?a.classList.remove("disabled-class"):a.classList.add("disabled-class"),t.setCount(n,o,!1)})}),this},t.prototype.updateUrl=function(){var t=this.getParams(),e=this.baseContextUrl;return e=o._.addWithoutDecode(e,t),history.pushState("","",e),this},t.prototype.reload=function(){var t=this.getReloadUrl();return this.executeAjax(t),this},t.prototype.scrollToResultNode=function(){-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>-1?(location.href="#",location.href="#result"):this.element.querySelector(this.options.resultNodeSelector).scrollIntoView(!0);return this},t.prototype.executeAjax=function(t){var e=this;this.options.callbacks.loadMoreTriggered();var i=document.querySelector(this.options.gridNodeSelector),n=t,o=new XMLHttpRequest;return o.onload=function(){if(o.status>=200&&o.status<300){var t=(0,r.Uo)(o.responseText),n=t.querySelector(e.options.gridNodeSelector)||t,s=n.dataset.resultCount,a=n.dataset.offset,c=e.element.querySelector(e.options.resultNodeSelector),l=e.element.querySelector(e.options.filterTagSelector);null!=s&&(c.innerHTML=s,i.dataset.resultCount=s,l.dataset.resultCount=s),null!=a&&(l.dataset.offset=a,i.dataset.offset=a),""!==n.innerHTML&&(i.innerHTML=n.innerHTML)}else console.log("The request failed!");e.options.callbacks.loadMoreLoaded()},o.open("GET",n),o.send(),this},t.prototype.resetState=function(){return Array.from(this.filterTag.querySelectorAll(this.options.checkboxSelector+":checked")).forEac
1h(function(t){return t.checked=!1}),this.update(),this},t.prototype.getDefaultOptions=function(){return{tagsMapAttrs:{tagsStrAttr:"data-atob",tagCountAttr:"data-tab-count",itemsCountAttr:"data-teaser-count"},filterTagSelector:".cw-tag-filter",filterItemSelector:".cw-tag-filter__item",dateSelector:".cw-tag-filter__date",loadMoreSelector:".cw-show-more",searchFieldSelector:".cw-search",checkboxSelector:".cw-cat-item__tag-value",countNodeSelector:".cw-cat-item__count",resultNodeSelector:".cw-publications-results span",gridNodeSelector:".cw-publications-list",callbacks:{loadMoreLoaded:function(){},loadMoreTriggered:function(){}}}},t}();i.d(e,["default",0,a])}}]);
2//# sourceMappingURL=/dist/bdfcw/./modules/PublicationsFilter.2b5a6cad.js.a1b6bb3b.map

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.