@abtasty/search 0.0.2-2 → 0.0.2-20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";const e=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),t=e=>(e=>{if("string"!=typeof e||!e.trim().length)return null;const[t,s,a]=e.split("[]").map(e=>e.trim()),r=Boolean(a)?a:e,n=s?document.querySelector(t)?.[s]:document;return n?n.querySelector(r):null})(e),s=(e,s)=>{const a=document.querySelector("body")||document.documentElement,r={childList:!0,subtree:!0,attributes:!0},n=()=>i.disconnect(),i=new MutationObserver(()=>{const a=t(s);return a&&!n()&&e(a)});return{clear:n,observe:(e=a)=>i.observe(e,r)}},a=()=>{},r=(n,i)=>{const c=t(n),o={selector:n,clear:a,observe:a};if(c)return setTimeout(()=>i(c),0),o;if(e())return setTimeout(()=>r(n,i),1e3),o;if(n.includes("[]"))return((e,a)=>{const[r,n]=a.split("[]").map(e=>e.trim()),i=t(r),c=i?.[n],{clear:o,observe:l}=s(e,a),h=()=>{const s=t(a);return s&&!d()&&e(s)},d=()=>{o(),i?.removeEventListener("load",h)},u=()=>{l(c),"iframe"===i?.localName&&i.addEventListener("load",h)};return u(),{selector:a,clear:d,observe:u}})(i,n);const{clear:l,observe:h}=s(i,n);return h(),{selector:n,clear:l,observe:h}},n=["hasbro","lego","mattel"],i={"Content-Type":"application/json",Authorization:"Bearer 1b3d6acfb9eac2780cd20a30ce8728a565960d213b0729b01d9b5e9fdcd3f77b"},c=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)};class o{constructor(e){let{baseContainer:t,baseClassName:s,target:a,onInput:r,onSearchClose:n}=e;this.baseContainer=t,this.baseClassName=s,this.target=a,this.onInput=r,this.onSearchClose=n,this.inputId=`${this.baseClassName}-search-input`,this.searchBarContainer=this.getSearchBarContainer(),this.searchBarLabel=this.getSearchBarLabel(),this.searchBar=this.getSearchBar(),this.searchInput=this.getSearchInput(),this.renderSearchBar()}getSearchBarContainerHeight(){const e=this.target.closest("header");return e?e.getBoundingClientRect().height+"px":"auto"}getCurrentSearchBarContainerHeight(){return this.searchBarContainer.getBoundingClientRect().height}resetSearchBarHeight(){this.searchBarContainer.style.minHeight=this.getSearchBarContainerHeight()}focusInput(){this.searchInput.focus()}getSearchBarContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-container`,e.style.minHeight=this.getSearchBarContainerHeight(),e}getSearchBarLabel(){const{searchLabel:e}=DATA,t=document.createElement("label");return t.className=`${this.baseClassName}-search-input-label`,t.innerHTML=e,t.htmlFor=this.inputId,t}getSearchBarAndCloseButtonContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-close-button-container`,e}getSearchBar(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar`,e}getSearchInput(){const e=document.createElement("input");return e.id=this.inputId,e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,e}getSearchCloseButton(){const e=document.createElement("button");e.className=`${this.baseClassName}-close-icon-container`,e.onclick=this.onSearchClose;const t=document.createElement("i");return t.className=`${this.baseClassName}-close-icon`,e.appendChild(t),e}renderSearchBar(){this.searchBar.appendChild(this.searchInput);const e=this.getSearchBarAndCloseButtonContainer();e.append(this.searchBar,this.getSearchCloseButton()),this.searchBarContainer.appendChild(this.searchBarLabel),this.searchBarContainer.appendChild(e),this.baseContainer.appendChild(this.searchBarContainer)}}class l{constructor(e){let{baseClassName:t,currentRange:s,min:a,max:r,onRangeChange:n}=e;this.baseClassName=t,this.currentRange=s||{min:a,max:r},this.min=a,this.max=r,this.onRangeChange=n}render(){const e=document.createElement("div");e.className=`${this.baseClassName}-range-slider`;const t=document.createElement("div");t.className="range-progress";const s=document.createElement("div");s.className="range-handle";const a=document.createElement("div");a.className="range-handle";const r=document.createElement("div");r.className=`${this.baseClassName}-range-values`;const n=(this.currentRange.min-this.min)/(this.max-this.min)*100,i=(this.currentRange.max-this.min)/(this.max-this.min)*100;s.style.left=`${n}%`,a.style.left=`${i}%`,t.style.left=`${n}%`,t.style.width=i-n+"%",r.innerHTML=`\n\t\t\t<span>${this.currentRange.min}</span>\n\t\t\t<span>${this.currentRange.max}</span>\n\t\t`,e.append(t,s,a);let c=!1,o=null,l=0,h=0;const d=()=>{const e=parseFloat(s.style.left),t=parseFloat(a.style.left),n=(this.min+e/100*(this.max-this.min)).toFixed(2),i=(this.min+t/100*(this.max-this.min)).toFixed(2);return r.innerHTML=`\n\t\t\t\t<span>${n}</span>\n\t\t\t\t<span>${i}</span>\n\t\t\t`,{minValue:n,maxValue:i}},u=e=>{e.preventDefault(),c=!0,o=e.target,l=e.clientX,h=parseFloat(o.style.left)},m=r=>{if(!c)return;r.preventDefault();const n=r.clientX-l,i=e.offsetWidth;let u=h+n/i*100;u=o===s?Math.max(0,Math.min(u,parseFloat(a.style.left))):Math.max(parseFloat(s.style.left),Math.min(u,100)),u=.8*Math.round(u/.8),o.style.left=`${u}%`,(()=>{const e=parseFloat(s.style.left),r=parseFloat(a.style.left);t.style.left=`${e}%`,t.style.width=r-e+"%"})(),d()},g=()=>{if(!c)return;c=!1,o=null;const{minValue:e,maxValue:t}=d();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[s,a].forEach(e=>{e.addEventListener("mousedown",u),document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)}),{rangeContainer:e,valuesContainer:r}}}function h(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function d(e,t,s){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const u=function(){const e={text:"",filters:{},page:0};return function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?h(Object(s),!0).forEach(function(t){d(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):h(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({get state(){return e}},{setText(t){e.text=t},setPage(t){e.page=t},onFilterChange(t,s,a){e.page=0,void 0!==a.checked?this.updateFilterArray(t,s,a.checked):this.updateRangeFilter(t,a.min,a.max)},updateRangeFilter(t,s,a){e.filters[t]=[{operator:">",value:s},{operator:"<",value:a}]},updateFilterArray(t,s,a){a?e.filters[t]=[...e.filters[t]||[],s]:(e.filters[t].length&&(e.filters[t]=e.filters[t].filter(e=>e!==s)),0===e.filters[t].length&&delete e.filters[t])},resetFiltersAndPagination(){e.filters={},e.page=0}})}();class m{constructor(e){let{id:t,facet:s,baseClassName:a,facetsListContainer:r,onFiltersChange:n}=e;this.id=t,this.facet=s,this.baseClassName=a,this.facetsListContainer=r,this.onFiltersChange=n,this.facetContentContainers=this.createFacetContainers(),this.facetsListContainer.appendChild(this.facetContentContainers.facetContainer)}createFacetContainers(){const e=document.createElement("details");e.className=`${this.baseClassName}-search-facet`,e.open=!0;const t=document.createElement("summary");var s;t.innerHTML=`\n\t\t\t<span>${s=this.facet.title,`${s.charAt(0).toUpperCase()}${s.slice(1)}`}</span>\n\t\t\t<div class="${this.baseClassName}-search-facet-arrow">▼</div>\n\t\t`;const a=document.createElement("div");return a.className=`${this.baseClassName}-search-facet-content ${this.facet.type}-facet`,e.append(t,a),{facetContainer:e,facetContent:a}}getFacetContainers(){return this.facetContentContainers}}class g extends m{constructor(e){let{id:t,facet:s,baseClassName:a,facetsListContainer:r,onFiltersChange:n}=e;super({id:t,facet:s,baseClassName:a,facetsListContainer:r,onFiltersChange:n}),this.filterRange=new l({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:e=>{n(this.facet.title,null,e)}})}createFacetContent(){const{facetContent:e}=this.getFacetContainers(),{rangeContainer:t,valuesContainer:s}=this.filterRange.render();e.append(t,s)}updateFacetContent(){c(this.facetContent),this.createFacetContent()}}class p extends m{constructor(e){let{id:t,facet:s,baseClassName:a,facetsListContainer:r,onFiltersChange:n}=e;super({id:t,facet:s,baseClassName:a,facetsListContainer:r,onFiltersChange:n});const{facetContent:i,facetContainer:c}=this.getFacetContainers();this.facetContent=i,this.facetContainer=c,this.onFiltersChange=n}createFacetContent(){const e=document.createElement("ul");e.style.padding="0";for(const[t,s]of this.facet.values){const a=document.createElement("li");a.className=`${this.baseClassName}-search-facet-list-item`,a.id=`${this.baseClassName}-search-facet-list-item-${t.replace(" ","-").toLowerCase()}`;const r=document.createElement("label");r.className=`${this.baseClassName}-search-facet-list-item-container`,r.innerHTML=`${t} (${s})`;const n=document.createElement("span"),i=document.createElement("input"),c=(u.state.filters[this.facet.title]||[]).includes(t);i.checked=c,i.type="checkbox",i.onclick=()=>{const e=i.checked;this.onFiltersChange(this.facet.title,t,{checked:e})},n.appendChild(i),r.appendChild(n),a.appendChild(r),e.appendChild(a)}this.facetContent.appendChild(e)}updateFacetContent(){c(this.facetContent),this.createFacetContent()}}class b{constructor(e){let{baseClassName:t,baseContainer:s,searchBar:a,onFiltersChange:r}=e;this.baseClassName=t,this.baseContainer=s,this.searchBar=a,this.onFiltersChange=r,this.facets=[],this.facetsListContainer=this.getFacetsListContainer()}getFacetsListContainer(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-facets-list`;const t=this.searchBar.getCurrentSearchBarContainerHeight();return e.style.maxHeight=`calc(100vh - ${t||0}px)`,e}renderFacets(e){c(this.facetsListContainer),this.facets=[];for(const[t,s]of Object.entries(e)){const e={id:t,facet:{title:t,values:s.values,type:s.type},baseClassName:this.baseClassName,facetsListContainer:this.facetsListContainer,onFiltersChange:this.onFiltersChange},a=new("range"===s.type?g:p)(e);this.facets.push(a)}this.facets.forEach(e=>{e.createFacetContent()}),this.baseContainer.appendChild(this.facetsListContainer)}updateFacets(){this.facets.forEach(e=>{e instanceof p&&e.updateFacetContent()})}}class f{constructor(e){let{result:t,index:s,baseClassName:a}=e;this.result=t,this.index=s,this.baseClassName=a}getSearchResultElement(){const e=document.createElement("a");return e.href=this.result.link,e.target="_blank",e.rel="noreferrer",e.innerHTML=`\n <div class="${this.baseClassName}-search-result result-${this.index}">\n <img src="${this.result.img_link}" />\n <div class="${this.baseClassName}-search-result-name">${this.result.name}</div>\n <div class="${this.baseClassName}-search-result-price">${this.result.price}€</div>\n </div\n\t\t`,e}}class C{constructor(e){let{baseContainer:t,baseClassName:s,searchBar:a,onFiltersChange:r,onSeeMore:n}=e;this.baseContainer=t,this.baseClassName=s,this.searchBar=a,this.onFiltersChange=r,this.onSeeMore=n,this.searchResultsContainer=this.getSearchResultsContainerElement(),this.searchResultsList=this.getSearchResultsListElement(),this.facetsList=new b({searchBar:this.searchBar,baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,onFiltersChange:this.onFiltersChange}),this.searchResultsContainer.appendChild(this.searchResultsList)}clearSearchResults(){c(this.searchResultsList),c(this.searchResultsContainer),this.searchResultsContainer.classList.remove("visible","no-results")}getSearchResultsContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-results-container`,e}getSearchResultsListElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-results`;const t=this.searchBar.getCurrentSearchBarContainerHeight();return e.style.maxHeight=`calc(100vh - ${t||0}px)`,e}getSeeMoreButtonElement(e){if(!e)return null;const t=document.createElement("button");return t.className=`${this.baseClassName}-search-see-more`,t.innerHTML="See more",t.onclick=this.onSeeMore,t}updateSearchResults(e,t){if(c(this.searchResultsList),this.searchResultsList.classList.remove("no-results"),e.length){for(const[t,s]of e.entries()){const e=new f({result:s,index:t,searchResultsContainer:this.searchResultsList,baseClassName:this.baseClassName});this.searchResultsList.appendChild(e.getSearchResultElement())}const s=this.getSeeMoreButtonElement(t);s&&this.searchResultsList.appendChild(s),this.facetsList.updateFacets()}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML="No results found",this.searchResultsList.classList.add("no-results"),this.searchResultsList.appendChild(e)}}renderSearchResults(e,t,s){if(this.baseContainer.classList.add("search-completed"),this.clearSearchResults(),e.length){this.facetsList.renderFacets(t);for(const[t,s]of e.entries()){const e=new f({result:s,index:t,searchResultsContainer:this.searchResultsList,baseClassName:this.baseClassName});this.searchResultsList.appendChild(e.getSearchResultElement())}this.searchResultsContainer.appendChild(this.searchResultsList);const a=this.getSeeMoreButtonElement(s);a&&this.searchResultsList.appendChild(a)}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML="No results found",this.searchResultsContainer.classList.add("no-results"),this.searchResultsContainer.appendChild(e)}this.searchResultsContainer.classList.add("visible"),this.baseContainer.appendChild(this.searchResultsContainer)}}function w(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function x(e,t,s){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const y=(()=>{const e={results:[],facets:{}};return function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?w(Object(s),!0).forEach(function(t){x(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):w(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({get state(){return e}},{addResults(t){e.results=[...e.results,...t.sort((e,t)=>((e,t)=>{const s=e.toLowerCase(),a=t.toLowerCase();return n.some(e=>s.includes(e))&&!n.some(e=>a.includes(e))?-1:n.some(e=>a.includes(e))&&!n.some(e=>s.includes(e))?1:0})(e.name,t.name)).filter(e=>e.link&&e.img_link&&e.price)]},setFacets(t){e.facets=t},clearResults(){e.results=[]}})})(),v=function(e){let t=[];for(const s in e){const a=e[s];if(Array.isArray(a))if("object"==typeof a[0]){const e=a.map(e=>`${s} ${e.operator} ${e.value}`);t.push(`(${e.join(" AND ")})`)}else{const e=a.map(e=>`${s} = "${e}"`);t.push(`(${e.join(" OR ")})`)}}return t.join(" AND ")},k=e=>{let{search:t,filters:s,maxPerPage:a,page:r}=e;return JSON.stringify({q:t,filter:v(s),facets:["*"],hitsPerPage:a,page:r+1})},N=e=>({hits:e.hits.map(e=>({name:e.title,img_link:e.img_link,link:e.link,price:e.price,category:e.category,brand:e.brand})),facets:function(e){const{facetDistribution:t,facetStats:s}=e;let a={};for(const e in t)s&&s[e]?a[e]={type:"range",values:{min:s[e].min,max:s[e].max}}:a[e]={type:"list",values:Object.entries(t[e])};return a}(e),page:e.page,totalPages:e.totalPages}),S=e=>fetch("https://ms-839f1388554f-19719.fra.meilisearch.io/indexes/products_with_description/search",{method:"POST",headers:i,body:k(e)});class E{constructor(e){let{target:t,rootElement:s}=e;this.baseClassName="abtasty-search-widget",this.target=t,this.rootElement=s,this.searchWidgetContainer=this.getSearchWidgetContainerElement(),this.searchBar=new o({baseContainer:this.searchWidgetContainer,baseClassName:this.baseClassName,target:this.target,onInput:this.onInput.bind(this),onSearchClose:this.onSearchClose.bind(this)}),this.searchResultsList=new C({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersChange:this.onFiltersChange.bind(this),onSeeMore:this.onSeeMore.bind(this)})}insertIn(e,t){e.insertAdjacentElement(t,this.searchWidgetContainer)}remove(){this.rootElement.querySelector("body").removeChild(this.searchWidgetContainer)}onSearchOpen(){const e=this.rootElement.querySelector("body");this.insertIn(e,"afterbegin"),this.searchBar.focusInput(),e.style.overflow="hidden"}onSearchClose(){this.remove(),this.rootElement.querySelector("body").style.overflow="initial"}onFiltersChange=(e,t,s)=>{u.onFilterChange(e,t,s),y.clearResults(),this.onSearchWithFilters()};onInput=e=>{u.setText(e.target.value),y.clearResults(),e.target.value.length?((Object.keys(u.state.filters).length||u.state.page>0)&&u.resetFiltersAndPagination(),this.debouncedSearch()):(this.searchWidgetContainer.classList.remove("search-completed"),this.searchResultsList.clearSearchResults())};onSeeMore=()=>{u.setPage(u.state.page+1),this.onSearchWithFilters()};async onSearchWithFilters(){const{siteId:e,apiKey:t}=DATA,{text:s,filters:a,page:r}=u.state;t&&e&&s?S({search:s,filters:a,maxPerPage:50,page:r}).then(e=>e.json()).then(e=>N(e)).then(e=>{y.addResults(e.hits),y.setFacets(e.facets),this.searchResultsList.updateSearchResults(y.state.results,e.totalPages>r+1)}).catch(e=>{window.console.error(e)}):this.searchWidgetContainer.classList.remove("search-completed")}onSearch=()=>{const{siteId:e,apiKey:t}=DATA,{text:s,page:a}=u.state;t&&e&&s?S({search:s,maxPerPage:50,page:a}).then(e=>e.json()).then(e=>N(e)).then(e=>{y.addResults(e.hits),y.setFacets(e.facets),this.searchResultsList.renderSearchResults(y.state.results,e.facets,e.totalPages>a+1)}).catch(e=>{window.console.error(e)}):this.searchWidgetContainer.classList.remove("search-completed")};debouncedSearch=(()=>(e=>{let t=null;return function(){for(var s=arguments.length,a=new Array(s),r=0;r<s;r++)a[r]=arguments[r];window.clearTimeout(t),t=window.setTimeout(()=>{e(...a)},150)}})(this.onSearch.bind(this)))();getSearchWidgetContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-container`,document.head.insertAdjacentElement("afterbegin",(e=>{const t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),t})(".abtasty-search-widget-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:hsla(0,0%,100%,.5);bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:Lato,sans-serif;height:100vh;left:0;position:fixed;right:0;top:0;width:100vw;z-index:9999}.abtasty-search-widget-container i{display:inline-block;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.abtasty-search-widget-container.search-completed{background-color:#fff}.abtasty-search-widget-search-bar-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#0c4884;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:22.5px 100px;position:sticky;top:0}.abtasty-search-widget-search-bar{background-color:#fff;border-radius:12px;padding:12px;width:100%}.abtasty-search-widget-search-input-label{color:#fff;font-size:12px;font-weight:400;line-height:17px;margin-left:auto;margin-right:auto;margin-top:auto}.abtasty-search-widget-search-bar-close-button-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;line-height:unset}.abtasty-search-widget-search-input{border:unset;font-size:1.6em;font-weight:700;outline:0;padding:unset;width:100%}.abtasty-search-widget-close-icon-container{border:none;border-radius:100%;padding:8px;-webkit-transform:translateX(150%);transform:translateX(150%);vertical-align:middle}.abtasty-search-widget-close-icon{background-color:#0c4884;height:28px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' fill='rgba(0, 0, 0, 0.999)'%3E%3Cpath d='M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25-6.2 6.25-14.4 9.35-22.6 9.35s-16.38-3.125-22.62-9.375L160 301.3 54.63 406.6C48.38 412.9 40.19 416 32 416s-16.37-3.1-22.625-9.4c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' fill='rgba(0, 0, 0, 0.999)'%3E%3Cpath d='M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25-6.2 6.25-14.4 9.35-22.6 9.35s-16.38-3.125-22.62-9.375L160 301.3 54.63 406.6C48.38 412.9 40.19 416 32 416s-16.37-3.1-22.625-9.4c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z'/%3E%3C/svg%3E\");vertical-align:middle;width:28px}.abtasty-search-widget-search-icon{background-color:#fff;height:12.5px;margin-right:6px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='rgba(74, 76, 83, 0.999)'%3E%3Cpath d='M500.3 443.7 380.6 324c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723 99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9 53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0 15.606-15.64 15.606-41.04.006-56.64zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128-57.42 128-128 128-128-57.4-128-128z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='rgba(74, 76, 83, 0.999)'%3E%3Cpath d='M500.3 443.7 380.6 324c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723 99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9 53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0 15.606-15.64 15.606-41.04.006-56.64zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128-57.42 128-128 128-128-57.4-128-128z'/%3E%3C/svg%3E\");width:12.5px}.abtasty-search-widget-search-results-container{display:none}.abtasty-search-widget-search-results-container.visible{display:grid;grid-template-columns:240px 1fr}.abtasty-search-widget-search-results-container.visible.no-results{grid-template-columns:1fr}.abtasty-search-widget-search-results{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;display:grid;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:24px;justify-content:center;overflow-y:auto;padding:16px 16px 350px 8px}.abtasty-search-widget-search-results.no-results{display:-webkit-box;display:-ms-flexbox;display:flex}.abtasty-search-widget-search-results-container.visible .abtasty-search-widget-search-results{grid-template-columns:1fr 1fr 1fr 1fr 1fr}.abtasty-search-widget-search-no-result{font-size:38px;font-weight:700;margin-left:auto;margin-right:auto;margin-top:82px}.abtasty-search-widget-search-result{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-radius:12px;-webkit-box-shadow:0 2px 8px 0 rgba(0,0,0,.11);box-shadow:0 2px 8px 0 rgba(0,0,0,.11);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:400px;padding:18px;width:100%}.abtasty-search-widget-search-result img{aspect-ratio:400/450;height:100%;margin-left:auto;margin-right:auto;-o-object-fit:contain;object-fit:contain;width:100%}.abtasty-search-widget-search-result-name{color:#0d4884;display:block;font-size:1.167em;font-weight:900;height:50px;line-height:1.43;margin-top:16px;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase}.abtasty-search-widget-search-result-price{color:#404040;font-size:1.833em;font-weight:900}.abtasty-search-widget-search-facets-list{overflow-y:auto;padding-bottom:350px;padding-right:10px}.abtasty-search-widget-search-facet-content{padding-left:18px}.abtasty-search-widget-search-facet-content.range-facet{padding-right:18px}.abtasty-search-widget-search-facet summary,.abtasty-search-widget-search-facet-list-item-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:space-between}.abtasty-search-widget-search-facet summary{background-color:rgba(0,0,0,.067);cursor:pointer;font-family:Lato;font-size:16px;font-weight:700;padding:13.5px 18px}.abtasty-search-widget-search-facet summary .abtasty-search-widget-search-facet-arrow{font-size:14px}.abtasty-search-widget-search-facet[open] summary .abtasty-search-widget-search-facet-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transform-origin:center;transform-origin:center}.abtasty-search-widget-search-facet-content ul{list-style:none}@media (max-width:1199.98px){.abtasty-search-widget-search-results-container.visible .abtasty-search-widget-search-results{grid-template-columns:1fr 1fr 1fr 1fr}}@media (max-width:991.98px){.abtasty-search-widget-search-results-container.visible .abtasty-search-widget-search-results{grid-template-columns:1fr 1fr 1fr}}@media (max-width:767.98px){.abtasty-search-widget-search-results-container.visible .abtasty-search-widget-search-results{grid-template-columns:1fr 1fr}}@media (max-width:575.98px){.abtasty-search-widget-search-bar-container{padding:22.5px}.abtasty-search-widget-close-icon-container{-webkit-transform:translateX(15%);transform:translateX(15%)}.abtasty-search-widget-search-results-container.visible .abtasty-search-widget-search-results{grid-template-columns:1fr}}.abtasty-search-widget-range-slider{background:#e0e0e0;border-radius:5px;height:5px;margin:20px 0;padding-right:18px;position:relative;width:100%}.abtasty-search-widget-range-slider .range-progress{background:#0c4884;border-radius:5px;height:100%;position:absolute;z-index:1}.abtasty-search-widget-range-slider .range-handle{background:#0c4884;border:2px solid #fff;border-radius:50%;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2);cursor:pointer;height:20px;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:20px;z-index:2}.abtasty-search-widget-range-values{-webkit-box-pack:justify;-ms-flex-pack:justify;color:#404040;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;justify-content:space-between;margin-top:10px}.abtasty-search-widget-range-values span{font-weight:600}")),e}}(()=>{const{elementReferrer:t}=DATA;(t=>{const s=(()=>{if(e()||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const t=ABTasty.getTestsOnPage()[TEST_ID];return!!t&&Object.keys(t.targetings.qaParameters).length>0})(),a=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(s||a){const e=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${e} - ${s?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${t}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}})("Widget launch"),new Promise(e=>{r(t,t=>{const s=t.getRootNode();t.onclick=e=>{const a=new E({target:t,rootElement:s});e.preventDefault(),e.stopPropagation(),a.onSearchOpen()},e()})})})()}();
|
|
1
|
+
!function(){"use strict";const e=()=>{let e;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S?.USER?.accountIdentifier?.length?e=window.ABTASTY_S.USER.accountIdentifier:"function"==typeof window.ABTasty?.getAccountSettings?e=window.ABTasty.getAccountSettings().identifier:window.ABTasty?.accountSettings&&(e=window.ABTasty.accountSettings.identifier),e):e},t=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),a=e=>(e=>{if("string"!=typeof e||!e.trim().length)return null;const[t,a,s]=e.split("[]").map(e=>e.trim()),i=Boolean(s)?s:e,r=a?document.querySelector(t)?.[a]:document;return r?r.querySelector(i):null})(e),s=(e,t)=>{const s=document.querySelector("body")||document.documentElement,i={childList:!0,subtree:!0,attributes:!0},r=()=>n.disconnect(),n=new MutationObserver(()=>{const s=a(t);return s&&!r()&&e(s)});return{clear:r,observe:(e=s)=>n.observe(e,i)}},i=()=>{},r=(e,n)=>{const o=a(e),c={selector:e,clear:i,observe:i};if(o)return setTimeout(()=>n(o),0),c;if(t())return setTimeout(()=>r(e,n),1e3),c;if(e.includes("[]"))return((e,t)=>{const[i,r]=t.split("[]").map(e=>e.trim()),n=a(i),o=n?.[r],{clear:c,observe:l}=s(e,t),d=()=>{const s=a(t);return s&&!h()&&e(s)},h=()=>{c(),n?.removeEventListener("load",d)},b=()=>{l(o),"iframe"===n?.localName&&n.addEventListener("load",d)};return b(),{selector:t,clear:h,observe:b}})(n,e);const{clear:l,observe:d}=s(n,e);return d(),{selector:e,clear:l,observe:d}},n="https://ms-839f1388554f-19719.fra.meilisearch.io",o=`${n}/indexes/${DATA.meilisearchIndex||e()}/search`,c=`${n}/multi-search`,l=["hasbro","lego","mattel"],d={"Content-Type":"application/json",Authorization:"Bearer 1b3d6acfb9eac2780cd20a30ce8728a565960d213b0729b01d9b5e9fdcd3f77b"},h=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)},b=e=>{const{translationKeys:t}=DATA;if(!t)return e;try{const a=JSON.parse(t);return a?.[e]||e}catch(t){return e}};class g{constructor(e){let{baseClassName:t,target:a,onInput:s,closeSearchWidget:i,resetSearch:r}=e;this.baseClassName=t,this.target=a,this.onInput=s,this.closeSearchWidget=i,this.resetSearch=r,this.inputId=`${this.baseClassName}-search-input`,this.searchBarContainer=this.getSearchBarContainer(),this.searchBar=this.getSearchBar(),this.searchInput=this.getSearchInput(),this.buildSearchBar()}getSearchBarContainerHeight(){const e=this.target.closest("header");if(e){const t=e.getBoundingClientRect().height;return Math.max(t,150)+"px"}return"auto"}getCurrentSearchBarContainerHeight(){return this.searchBarContainer.getBoundingClientRect().height}resetSearchBarHeight(){this.searchBarContainer.style.minHeight=this.getSearchBarContainerHeight()}focusInput(){this.searchInput.focus()}resetInput(){this.searchInput.value=""}setResetIconVisibility(e){this.resetSearchBarButton.style.visibility=e?"visible":"hidden"}getSearchBarContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-container`,e}getSearchBarAndCloseButtonContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-close-button-container`,e}getSearchBar(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-bar`;const t=document.createElement("i");return t.className=`${this.baseClassName}-search-icon`,e.appendChild(t),e}getSearchInput(){const e=document.createElement("input");return e.id=this.inputId,e.placeholder=b("Search..."),e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,e}getSearchCloseButton(){const e=document.createElement("button");e.className=`${this.baseClassName}-close-icon-container`,e.onclick=this.closeSearchWidget;const t=document.createElement("i");return t.className=`${this.baseClassName}-close-icon`,e.appendChild(t),e}buildSearchBar(){const e=document.createElement("button");e.className=`${this.baseClassName}-reset-search-bar`,e.onclick=this.resetSearch;const t=document.createElement("i");t.className=`${this.baseClassName}-close-icon`,e.appendChild(t),this.resetSearchBarButton=e,this.searchBar.appendChild(this.searchInput),this.searchBar.appendChild(this.resetSearchBarButton);const a=this.getSearchBarAndCloseButtonContainer();a.append(this.searchBar,this.getSearchCloseButton()),this.searchBarContainer.appendChild(a)}}function m(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?m(Object(a),!0).forEach(function(t){p(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):m(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function p(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const f={text:"",filters:{},sort:["relevance"],page:0,totalPages:0,totalHits:0},w=function(){let e=u({},f);return u({get state(){return e},isNoFiltersAndNoSort:()=>0===Object.keys(e.filters).length&&"relevance"===e.sort[0]},{logState(t){JSON.parse(JSON.stringify(e))},setText(t){e.text=t,this.logState("setText")},setPage(t){e.page=t,this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(t){e.totalHits=t,this.logState("setTotalHits")},setSort(t){e.sort=""===t?[]:[t],this.logState("setSort")},onFilterChange(t,a,s){e.page=0,void 0!==s.checked?this.updateFilterArray(t,a,s.checked):this.updateRangeFilter(t,s.min,s.max),this.logState("onFilterChange")},updateRangeFilter(t,a,s){e.filters[t]=[{operator:">=",value:a},{operator:"<=",value:s}],this.logState("updateRangeFilter")},removeRangeFilter(t){delete e.filters[t],this.logState("removeRangeFilter")},updateFilterArray(t,a,s){s?e.filters[t]=[...e.filters[t]||[],a]:(e.filters[t].length&&(e.filters[t]=e.filters[t].filter(e=>e!==a)),0===e.filters[t].length&&delete e.filters[t]),this.logState("updateFilterArray")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},this.logState("resetFilters")},resetPagination(){e.page=0,e.totalPages=0,this.logState("resetPagination")},resetSort(){e.sort=["relevance"],this.logState("resetSort")},reset(){e=u({},f),this.logState("reset")}})}();class y{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r}=e;this.id=t,this.facet=a,this.baseClassName=s,this.facetsListContainer=i,this.onFiltersChange=r,this.facetContentContainers=this.createFacetContainers(),this.facetsListContainer.insertBefore(this.facetContentContainers.facetContainer,this.facetsListContainer.lastChild)}createFacetContainers(){const e=`${(t=this.facet.title).charAt(0).toUpperCase()}${t.slice(1)}`;var t;const a=b(e),s=document.createElement("details");s.className=`${this.baseClassName}-search-facet`,s.open=!0;const i=document.createElement("summary");i.innerHTML=`\n\t\t\t<span>${a}</span>\n\t\t\t<div class="${this.baseClassName}-search-facet-arrow">\n <svg width="14" height="8" viewBox="0 0 14 8" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.04951 7.55342C0.837905 7.44427 0.664506 7.23215 0.599514 7.00293C0.581178 6.93825 0.572874 6.8248 0.579306 6.72657C0.601746 6.38349 0.419705 6.58327 3.63323 3.37487C6.89349 0.119802 6.61624 0.367433 7.00022 0.367433C7.38419 0.367433 7.10695 0.119802 10.3672 3.37487C13.6501 6.65253 13.4202 6.39573 13.4202 6.78523C13.4202 6.96849 13.4118 7.00722 13.3413 7.15046C13.1287 7.58246 12.6239 7.75732 12.1892 7.54958C12.1021 7.50794 11.4956 6.91619 9.53822 4.96288L7.00022 2.43019L4.46222 4.96288C2.50749 6.91353 1.8983 7.50796 1.81149 7.54946C1.57821 7.66094 1.26117 7.66257 1.04951 7.55342Z" fill="%232A2A3C"/>\n </svg>\n </div>\n\t\t`;const r=document.createElement("div");return r.className=`${this.baseClassName}-search-facet-content ${this.facet.type}-facet`,s.append(i,r),{facetContainer:s,facetContent:r}}getFacetContainers(){return this.facetContentContainers}}class v extends y{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r}=e;super({id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r});const{facetContent:n,facetContainer:o}=this.getFacetContainers();this.facetContent=n,this.facetContainer=o,this.facetList=this.getFacetListElement(),this.onFiltersChange=r,this.showAll=!1,this.facetContent.append(this.facetList)}createFacetContent(){const e=this.facet.values.sort((e,t)=>{let[a,s]=e,[i,r]=t;const n=(w.state.filters[this.facet.title]||[]).includes(a),o=(w.state.filters[this.facet.title]||[]).includes(i);return n===o?r-s:o-n}),t=this.showAll?e:e.slice(0,10),a=[];for(const[e,s]of t){const t=this.getFacetListItemElement({name:e,count:s});a.push(t)}if(this.facetList.append(...a),this.facet.values.length>10){const e=document.createElement("button");e.className=`${this.baseClassName}-search-facet-show-more`,e.innerHTML=this.showAll?b("See less"):b("See more"),e.onclick=()=>{this.showAll=!this.showAll,this.updateFacetContent()},this.facetList.append(e)}}getFacetListElement(){return document.createElement("ul")}getFacetListItemElement(e){const{name:t,count:a}=e,s=document.createElement("li");s.className=`${this.baseClassName}-search-facet-list-item`,s.id=`${this.baseClassName}-search-facet-list-item-${t.replace(" ","-").toLowerCase()}`;const i=(w.state.filters[this.facet.title]||[]).includes(t),r=document.createElement("label");r.className=`${this.baseClassName}-search-facet-checkbox-container ${i||0!==a?"":"disabled"} ${i?"checked":""}`,r.innerHTML=`${t} (${a})`;const n=document.createElement("span");n.className=`${this.baseClassName}-search-facet-checkbox-checkmark`;const o=document.createElement("input");return o.disabled=!i&&0===a,o.checked=i,o.type="checkbox",o.onclick=()=>{const e=o.checked;this.onFiltersChange({facetType:"list",facetKey:this.facet.title,facetValue:t,options:{checked:e}})},r.appendChild(o),r.appendChild(n),s.appendChild(r),s}updateFacetContent(){h(this.facetList),0!==this.facet.values.length&&this.createFacetContent()}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.showAll=!1,this.updateFacetContent()}}class x{constructor(e){let{baseClassName:t,currentRange:a,min:s,max:i,onRangeChange:r}=e;this.baseClassName=t,this.currentRange=a||{min:s,max:i},this.min=s,this.max=i,this.onRangeChange=r}render(){const e=document.createElement("div");e.className=`${this.baseClassName}-range-slider`;const t=document.createElement("div");t.className="range-progress";const a=document.createElement("div");a.className="steps-container";for(let e=0;e<20;e++){const e=document.createElement("div");e.className="step-bar",a.appendChild(e)}const s=document.createElement("div");s.className="range-handle";const i=document.createElement("div");i.className="range-handle-value",s.appendChild(i);const r=document.createElement("div");r.className="range-handle";const n=document.createElement("div");n.className="range-handle-value",r.appendChild(n);const o=document.createElement("div");if(o.className=`${this.baseClassName}-range-values`,this.min===this.max)return s.style.left="0%",r.style.left="100%",t.style.left="0%",t.style.width="100%",s.style.pointerEvents="none",r.style.pointerEvents="none",i.textContent=Math.floor(this.min),n.textContent=Math.ceil(this.max),o.innerHTML=`\n\t\t\t\t<span>${Math.floor(this.min)}</span>\n\t\t\t\t<span>${Math.ceil(this.max)}</span>\n\t\t\t`,e.append(a,t,s,r),{rangeContainer:e,valuesContainer:o};const c=(this.currentRange.min-this.min)/(this.max-this.min)*100,l=(this.currentRange.max-this.min)/(this.max-this.min)*100;s.style.left=`${c}%`,r.style.left=`${l}%`,t.style.left=`${c}%`,t.style.width=l-c+"%",i.textContent=Math.floor(this.currentRange.min),n.textContent=Math.ceil(this.currentRange.max),o.innerHTML=`\n\t\t\t<span>${Math.floor(this.currentRange.min)}</span>\n\t\t\t<span>${Math.ceil(this.currentRange.max)}</span>\n\t\t`,e.append(a,t,s,r);let d=!1,h=null,b=0,g=0;const m=()=>{const e=parseFloat(s.style.left),t=parseFloat(r.style.left),a=Math.floor(this.min+e/100*(this.max-this.min)),o=Math.ceil(this.min+t/100*(this.max-this.min));return i.textContent=a,n.textContent=o,{minValue:a,maxValue:o}},u=e=>{e.preventDefault(),d=!0,h=e.target.closest(".range-handle"),b=e.clientX||e.touches&&e.touches[0].clientX,g=parseFloat(h.style.left)},p=a=>{if(!d)return;a.preventDefault();const i=(a.clientX||a.touches&&a.touches[0].clientX)-b,n=e.offsetWidth;let o=g+i/n*100;o=h===s?Math.max(0,Math.min(o,parseFloat(r.style.left))):Math.max(parseFloat(s.style.left),Math.min(o,100));const c=100/19;o=Math.round(o/c)*c,h.style.left=`${o}%`,(()=>{const e=parseFloat(s.style.left),a=parseFloat(r.style.left);t.style.left=`${e}%`,t.style.width=a-e+"%"})(),m()},f=()=>{if(!d)return;d=!1,h=null;const{minValue:e,maxValue:t}=m();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[s,r].forEach(e=>{e.addEventListener("mousedown",u),e.addEventListener("touchstart",u,{passive:!1})}),document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",f),document.addEventListener("touchcancel",f),{rangeContainer:e,valuesContainer:o}}}class C extends y{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r}=e;super({id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r});const{facetContent:n,facetContainer:o}=this.getFacetContainers();this.facetContent=n,this.facetContainer=o,this.onFiltersChange=r,this.filterRange=new x({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:e=>{this.onFiltersChange({facetType:"range",facetKey:this.facet.title,options:e})}})}createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){h(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new x({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:e=>{this.onFiltersChange({facetType:"range",facetKey:this.facet.title,options:e})}}),this.createFacetContent())}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.updateFacetContent()}}function S(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function k(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?S(Object(a),!0).forEach(function(t){N(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function N(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const E=()=>[{value:"relevance",label:b("Relevance")},{value:"price:asc",label:`↑ ${b("Price")}`},{value:"price:desc",label:`↓ ${b("Price")}`}],F=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.entries(e).reduce((e,t)=>{let[s,i]=t;return e[s]&&(Array.isArray(e[s].values)?e[s]=k(k({},i),{},{values:e[s].values.map(e=>{let[t,s]=e;const r=i.values.find(e=>{let[a]=e;return a===t});return r?[t,r[1]]:[t,a?0:s]})}):e[s]=k(k({},i),{},{min:e[s].values.min,max:e[s].values.max})),e},k({},t))};class A{constructor(e){let{baseClassName:t,onSortChange:a}=e;this.baseClassName=t,this.onSortChange=a,this.element=this.getSortFacetElement()}getSortOptionsElements(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-options`;const t=E();for(const a of t){const t=document.createElement("button");t.classList.add(`${this.baseClassName}-search-sort-option`),(""===a.value&&0===w.state.sort.length||w.state.sort.includes(a.value))&&(t.classList.add("active"),t.disabled=!0),t.innerHTML=a.label,t.dataset.value=a.value,t.onclick=()=>this.onSortChange(a.value),e.appendChild(t)}return e}getSortFacetElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-facet`;const t=document.createElement("label");return t.className=`${this.baseClassName}-search-sort-label`,t.textContent=`${b("Sort By")}:`,e.appendChild(t),e.appendChild(this.getSortOptionsElements()),e}update(e){this.element.querySelectorAll(".active").forEach(e=>{e.classList.remove("active"),e.disabled=!1});const t=this.element.querySelector(`[data-value="${e[0]||"relevance"}"]`);t&&(t.classList.add("active"),t.disabled=!0)}}class L{constructor(e){let{baseClassName:t,infos:a}=e;this.baseClassName=t,this.infos=a,this.element=this.getInfosElement()}getInfosElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-infos`,e.style.whiteSpace="nowrap";const t=`${b("result")}${this.infos.totalHits>1?"s":""}`;return e.innerHTML=`\n\t\t\t<span><strong>${this.infos.totalHits}</strong> ${t}</span>\n\t\t`,e}updateInfos(e){this.infos=e;const t=`${b("result")}${this.infos.totalHits>1?"s":""}`;this.element.innerHTML=`\n\t\t\t<span><strong>${this.infos.totalHits}</strong> ${t}</span>\n\t\t`}}class R{constructor(e){let{baseClassName:t,baseContainer:a,searchBar:s,onFiltersChange:i,onFiltersReset:r,onSortChange:n}=e;this.baseClassName=t,this.baseContainer=a,this.searchBar=s,this.onFiltersChange=i,this.onFiltersReset=r,this.onSortChange=n,this.facets=[],this.facetsListContainer=this.getFacetsListContainer()}setMaxHeight(e){e?(this.facetsListContainer.style.maxHeight=`calc(100vh - ${e}px)`,this.facetsListContainer.style.top=`${e}px`):(this.facetsListContainer.style.maxHeight="0px",this.facetsListContainer.style.top="0px")}getFacetsListContainer(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-facets-list`;const t=document.createElement("button");t.className=`${this.baseClassName}-search-facets-list-close-button`,t.onclick=this.closeFilters.bind(this);const a=document.createElement("i");a.className=`${this.baseClassName}-close-icon`,t.appendChild(a),this.sortFacet=new A({baseClassName:this.baseClassName,onSortChange:this.onSortChange});const s=document.createElement("div");s.className=`${this.baseClassName}-search-facets-list-bottom-buttons-container`;const i=document.createElement("button");i.className=`${this.baseClassName}-search-facets-list-reset-button`,i.innerHTML=b("Clear results"),i.onclick=this.onFiltersReset.bind(this);const r=document.createElement("div");r.className=`${this.baseClassName}-search-facets-list-header`,this.searchInfos=new L({baseClassName:this.baseClassName,infos:{totalHits:w.state.totalHits}});const n=document.createElement("button");return n.className=`${this.baseClassName}-search-facets-list-bottom-close-button`,n.innerHTML=b("Show results"),n.onclick=this.closeFilters.bind(this),r.append(this.searchInfos.element,t),s.append(i,n),e.append(r,this.sortFacet.element,s),e}renderFacets(e){[...this.facetsListContainer.children].forEach(e=>{e.tagName.toLowerCase()==="details".toLowerCase()&&e.parentNode.removeChild(e)}),this.facets=[];for(const[t,a]of Object.entries(e)){if(0===a.values.length||1===a.values.length)continue;const e={id:t,facet:{title:t,values:a.values,type:a.type},baseClassName:this.baseClassName,facetsListContainer:this.facetsListContainer,onFiltersChange:this.onFiltersChange},s=new("range"===a.type?C:v)(e);this.facets.push(s)}this.facets.forEach(e=>{e.createFacetContent()}),this.baseContainer.appendChild(this.facetsListContainer)}updateRangeFacets(e){this.facets.filter(e=>e instanceof C).forEach(t=>{t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof v).forEach(t=>{t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}openFilters(){const e=this.baseContainer.parentElement,t=document.createElement("div");t.className=`${this.baseClassName}-search-facets-list-overlay`,t.onclick=this.closeFilters.bind(this),e.insertAdjacentElement("afterbegin",t),e.style.overflowY="hidden",this.facetsListContainer.classList.add("open")}closeFilters(){this.facetsListContainer.classList.remove("open");const e=this.baseContainer.parentElement,t=e.firstChild;e.removeChild(t),e.style.overflowY="auto",setTimeout(()=>{this.facetsListContainer.scrollTop=0},500)}}class T{constructor(e){let{result:t,index:a,baseClassName:s}=e;this.result=t,this.index=a,this.baseClassName=s}getRatingElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-rating`;const t=document.createElement("div");t.className="reviews-count",t.textContent=`197 ${b("reviews")}`;const a=document.createElement("div");return a.className="star-rating",a.style.setProperty("--rating-width","83.6%"),e.appendChild(a),e.appendChild(t),e}getSearchResultElement(){const e=document.createElement("a");e.className=`${this.baseClassName}-search-result-container`,e.href=this.result.link,e.target="_blank",e.rel="noreferrer";const t=this.index<6&&this.index<window.innerHeight/200*2;return e.innerHTML=[`<div class="${this.baseClassName}-search-result result-${this.index}">`,`<div class="${this.baseClassName}-search-result-image-container">`,`<img ${t?`src="${this.result.img_link}"`:`data-src="${this.result.img_link}" class="lazy"`} />`,"</div>",`<div class="${this.baseClassName}-search-result-content">`,`<div class="${this.baseClassName}-search-result-name">${this.result.name}</div>`,this.result.brand?`<div class="${this.baseClassName}-search-result-brand">${this.result.brand}</div>`:"",`<div class="${this.baseClassName}-search-result-price">${this.result.price}€</div>`,"</div>","</div>"].join("\n"),e}}class ${constructor(e){let{baseClassName:t,infos:a,onSortChange:s,openFilters:i}=e;this.baseClassName=t,this.onSortChange=s,this.infos=a,this.openFilters=i,this.searchInfos=new L({baseClassName:t,infos:a}),this.sortLabelElement=this.getSortLabelElement(),this.sortSelectElement=this.getSortSelectElement(),this.sortAndFiltersButtonElement=this.getSortAndFiltersButtonElement(),this.infosAndSortContainer=this.getInfoAndSortContainerElement(),this.infosAndSortContainer.appendChild(this.searchInfos.element),this.infosAndSortContainer.appendChild(this.sortAndFiltersButtonElement),this.setSortOptions()}getInfoAndSortContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-info-and-sort`,e}getSortLabelElement(){const e=document.createElement("label");return e.className=`${this.baseClassName}-search-sort-label`,e.textContent=`${b("Sort By")}:`,e.htmlFor=`${this.baseClassName}-search-sort-select`,e}getSortSelectElement(){const e=document.createElement("select");return e.className=`${this.baseClassName}-search-sort-select`,e.id=`${this.baseClassName}-search-sort-select`,e.name=`${this.baseClassName}-search-sort-select`,e.onchange=this.handleSortChange.bind(this),e}getSortElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-sort`,e.appendChild(this.sortLabelElement),e.appendChild(this.sortSelectElement),e}getFiltersButtonElement(){const e=document.createElement("button");e.className=`${this.baseClassName}-search-filters-button`;const t=document.createElement("i");t.className=`${this.baseClassName}-search-filters-button-icon`;const a=document.createElement("span");return a.className=`${this.baseClassName}-search-filters-button-text`,a.textContent=b("Filter"),e.append(t,a),e.onclick=this.openFilters.bind(this),this.filtersButtonTextElement=a,e}getSortAndFiltersButtonElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-and-filters-button-container`;const t=this.getSortElement();return this.filtersButtonElement=this.getFiltersButtonElement(),e.appendChild(t),e.appendChild(this.filtersButtonElement),e}setSortOptions(){this.sortSelectElement.childElementCount&&removeChildren(this.sortSelectElement);const e=E();for(const t of e){const e=document.createElement("option");e.value=t.value,e.textContent=t.label,this.sortSelectElement.appendChild(e)}}handleSortChange(e){const t=e.target.value;this.onSortChange(t)}updateSort(e){this.sortSelectElement.value=e[0]||"relevance"}updateFiltersInfo(e){let t=0;for(const a of Object.values(e))"object"==typeof a[0]?t++:t+=a.length;t?(this.filtersButtonElement.classList.add("active"),this.filtersButtonTextElement.textContent=`${t} ${b("Filter")}${t>1?"s":""}`):(this.filtersButtonElement.classList.remove("active"),this.filtersButtonTextElement.textContent=b("Filter"))}}function I(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function j(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?I(Object(a),!0).forEach(function(t){O(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):I(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function O(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const P={results:[],facets:{},selectedFacets:{}},M=(()=>{let e=j({},P);return j({get state(){return e}},{logState(t){JSON.parse(JSON.stringify(e))},addResults(t){e.results=[...e.results,...t.sort((e,t)=>((e,t)=>{const a=e.toLowerCase(),s=t.toLowerCase();return l.some(e=>a.includes(e))&&!l.some(e=>s.includes(e))?-1:l.some(e=>s.includes(e))&&!l.some(e=>a.includes(e))?1:0})(e.name,t.name))],this.logState("addResults")},setFacets(t){e.facets=t,this.logState("setFacets")},addRangeToSelectedFacets(t,a){e.selectedFacets[t]={type:a.type,values:a.values},this.logState("addRangeToSelectedFacets")},addListToSelectedFacets(t,a){if(a){const s=a.values[0],i=a.values[1],r=e.selectedFacets[t];if(r){const e=r.values.findIndex(e=>{let[t]=e;return t===s});e>-1?r.values[e]=[s,r.values[e][1]+i]:r.values.push([s,i])}else e.selectedFacets[t]={type:a.type,values:[[s,i]]}}this.logState("addListToSelectedFacets")},removeSelectedFacet(t,a){const s=e.selectedFacets[t];s&&(Array.isArray(s.values)?s.values=s.values.filter(e=>{let[t]=e;return t!==a}):s.values=[]),0===s.values.length&&delete e.selectedFacets[t],this.logState("removeSelectedFacet")},updateSelectedFacets(t){const a=F(t,e.selectedFacets,!0);e.selectedFacets=a,this.logState("updateSelectedFacets")},updateFacets(t){e.facets=F(t,e.facets,!0),this.logState("updateFacets")},setSelectedFacets(t){e.selectedFacets=t,this.logState("setSelectedFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=j({},P),this.logState("reset")}})})(),B=575.99;class z{constructor(e){let{baseContainer:t,baseClassName:a,searchBar:s,onFiltersChange:i,onSortChange:r,onSeeMore:n,onFiltersReset:o}=e;this.baseContainer=t,this.baseClassName=a,this.searchBar=s,this.onFiltersChange=i,this.onSortChange=r,this.onSeeMore=n,this.onFiltersReset=o,this.searchResultContainer=this.getSearchResultContainerElement(),this.searchResultListContainer=this.getSearchResultListContainerElement(),this.searchResultList=this.getSearchResultListElement(),this.facetsList=new R({searchBar:this.searchBar,baseContainer:this.searchResultContainer,baseClassName:this.baseClassName,onFiltersChange:this.onFiltersChange,onFiltersReset:this.onFiltersReset,onSortChange:this.onSortChange}),this.infoAndSort=new $({baseClassName:this.baseClassName,infos:{totalHits:w.state.totalHits},onSortChange:this.onSortChange,openFilters:this.openFilters.bind(this)}),new MutationObserver(this.mutationCallback.bind(this)).observe(this.searchResultContainer,{childList:!0}),this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.resizeObserver.observe(document.body),this.isMobileLayout=window.innerWidth<=B}handleResize(e){const t=(e[0].contentRect.width||window.innerWidth)<=B;if(t!==this.isMobileLayout&&(this.isMobileLayout=t,this.searchResultContainer.childNodes.length)){const e=this.searchBar.getCurrentSearchBarContainerHeight();this.facetsList.setMaxHeight(this.isMobileLayout?0:e),!this.isMobileLayout&&this.facetsList.facetsListContainer.classList.contains("open")&&this.facetsList.closeFilters()}}mutationCallback(e){for(const t of e)if("childList"===t.type&&this.resultsChanged)if(t.target.childNodes.length){const e=this.searchBar.getCurrentSearchBarContainerHeight();this.facetsList.setMaxHeight(e)}else 0===t.target.childNodes.length&&this.facetsList.setMaxHeight(0);this.resultsChanged=!1}scrollToTop(){this.searchResultList.scrollTop=0}openFilters(){this.facetsList.openFilters()}clearSearchResults(){h(this.searchResultList),h(this.searchResultListContainer),h(this.searchResultContainer),this.searchResultContainer.classList.remove("visible","no-results"),this.searchResultContainer.remove()}getSearchResultContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-container`,e}getSearchResultListContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-list-container`,e}getSearchResultListElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-list`,e}lazyLoadImages(){let e=this.searchResultList.querySelectorAll(".lazy");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const a=e.target;a.src=a.dataset.src,a.addEventListener("load",()=>{a.classList.remove("lazy"),t.unobserve(a)})}})},{root:this.baseContainer,rootMargin:"0px 0px 500px 0px"});e.forEach(e=>{t.observe(e)})}else{let t;const a=()=>{t&&clearTimeout(t),t=setTimeout(()=>{const t=window.scrollY;e.forEach(a=>{if(a.offsetTop<window.innerHeight+t+500){const t=a.dataset.src;a.src=t,a.classList.remove("lazy"),e=this.searchResultList.querySelectorAll(".lazy")}}),0==e.length&&(document.removeEventListener("scroll",a),window.removeEventListener("resize",a))},20)};document.addEventListener("scroll",a),window.addEventListener("resize",a)}}updateSearchResults(e){if(h(this.searchResultList),this.searchResultContainer.classList.remove("no-results"),this.infoAndSort.searchInfos.updateInfos({totalHits:w.state.totalHits}),this.facetsList.searchInfos.updateInfos({totalHits:w.state.totalHits}),e.length){for(const[t,a]of e.entries()){const e=new T({result:a,index:t,searchResultContainer:this.searchResultList,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}this.lazyLoadImages()}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=b("No result found"),this.searchResultContainer.classList.add("no-results"),this.searchResultList.appendChild(e)}this.resultsChanged=!0}addSearchResults(e){if(e.length){for(const[t,a]of e.entries()){const s=new T({result:a,index:M.state.results.length-e.length+t,searchResultContainer:this.searchResultList,baseClassName:this.baseClassName});this.searchResultList.appendChild(s.getSearchResultElement())}this.lazyLoadImages(),this.resultsChanged=!0}}renderSearchResults(e,t){if(this.baseContainer.classList.add("search-completed"),this.clearSearchResults(),this.infoAndSort.searchInfos.updateInfos({totalHits:w.state.totalHits}),this.facetsList.searchInfos.updateInfos({totalHits:w.state.totalHits}),e.length){this.facetsList.renderFacets(t);for(const[t,a]of e.entries()){const e=new T({result:a,index:t,searchResultContainer:this.searchResultList,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}this.searchResultListContainer.appendChild(this.infoAndSort.infosAndSortContainer),this.searchResultListContainer.appendChild(this.searchResultList),this.searchResultContainer.appendChild(this.searchResultListContainer),this.baseContainer.appendChild(this.searchResultContainer),this.lazyLoadImages()}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=b("No result found"),this.searchResultContainer.classList.add("no-results"),this.searchResultContainer.appendChild(e)}this.searchResultContainer.classList.add("visible"),this.baseContainer.appendChild(this.searchResultContainer),this.resultsChanged=!0}}function D(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function H(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(Object(a),!0).forEach(function(t){W(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function W(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const _=function(e){let t=[];for(const a in e){const s=e[a];if(Array.isArray(s))if("object"==typeof s[0]){const e=s.map(e=>`${a} ${e.operator} ${e.value}`);t.push(`(${e.join(" AND ")})`)}else{const e=s.map(e=>`"${a}" = "${e}"`);t.push(`(${e.join(" OR ")})`)}}return t.join(" AND ")},Z=function(e){const{facetDistribution:t,facetStats:a}=e;let s={};for(const e in t)a&&a[e]?s[e]={type:"range",values:{min:a[e].min,max:a[e].max}}:s[e]={type:"list",values:Object.entries(t[e])};return s},q=e=>{const t=DATA.language,a=[];for(const s of e){let e=s.title,i=s.link;t&&(s.localized_title&&(e=JSON.parse(s.localized_title)[t]??s.title),s.localized_link&&(i=JSON.parse(s.localized_link)[t]??s.link)),i&&s.img_link&&s.price&&a.push({name:e,link:i,img_link:s.img_link,price:s.price,category:s.category,brand:s.brand})}return a},J=e=>{let{text:t,filters:a,sort:s,page:i}=e;return JSON.stringify({q:t,filter:_(a),facets:["*"],hitsPerPage:50,page:i+1,sort:"relevance"===s[0]?[]:s})},X=e=>({hits:q(e.hits),facets:Z(e),page:e.page,totalPages:e.totalPages,totalHits:e.totalHits}),V=/.+\/([^.]+)\.(otf|ttf)$/,Y=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(V)?t.match(V)[1]:""};`:t||"";class U{hasTriggeredSeeMore=!1;constructor(e){let{target:t,rootElement:a}=e;this.baseClassName="abtasty-search-widget",this.target=t,this.rootElement=a,this.searchOpen=!1,this.searchWidgetContainer=this.getSearchWidgetContainerElement(),this.recommendationsContainer=this.getRecommendationsElement(),this.searchBar=new g({baseContainer:this.searchWidgetContainer,baseClassName:this.baseClassName,target:this.target,onInput:this.debouncedOnInput.bind(this),closeSearchWidget:this.closeSearchWidget.bind(this),resetSearch:this.onSearchReset.bind(this)}),this.searchResultsList=new z({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersChange:this.onFiltersChange.bind(this),onSeeMore:this.onSeeMore.bind(this),onSortChange:this.onSortChange.bind(this),onFiltersReset:this.onFiltersReset.bind(this)}),this.searchWidgetContainer.appendChild(this.searchBar.searchBarContainer)}insertIn(e,t){e.insertAdjacentElement(t,this.searchWidgetContainer)}remove(){this.rootElement.querySelector("body").removeChild(this.searchWidgetContainer)}handleScroll=e=>{const t=e.target.scrollTop+e.target.clientHeight>=e.target.scrollHeight-500;!this.hasTriggeredSeeMore&&t&&w.state.page+1<w.state.totalPages&&(this.hasTriggeredSeeMore=!0,this.onSeeMore())};openSearchWidget(){if(this.searchOpen)return;const e=this.rootElement.querySelector("body");this.rootElement.querySelector("html").classList.add("search-open"),this.insertIn(e,"afterbegin"),this.searchBar.focusInput(),this.searchOpen=!0}closeSearchWidget(){this.rootElement.querySelector("html").classList.remove("search-open"),this.searchOpen=!1,this.remove()}onSearchReset=()=>{w.reset(),M.reset(),this.searchResultsList.clearSearchResults(),this.searchWidgetContainer.classList.remove("search-completed"),this.searchBar.resetInput(),this.searchBar.setResetIconVisibility(!1),this.searchBar.focusInput()};onFiltersReset=()=>{w.isNoFiltersAndNoSort()||(w.resetFiltersAndPagination(),w.resetSort(),this.searchResultsList.infoAndSort.updateFiltersInfo({}),this.onSearch())};onFiltersChange=e=>{let{facetType:t,facetKey:a,facetValue:s,options:i}=e;"range"===t?this.onRangeChange(a,i.min,i.max):this.onListCheckboxChange(a,s,i.checked)};onSortChange=async e=>{w.setPage(0),M.clearResults(),w.setSort(e),this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const t=await(async()=>{try{const e=await fetch(o,{method:"POST",headers:d,body:J(w.state)}),t=await e.json();return{results:X(t).hits}}catch(e){return window.console.error(e),{results:[]}}})();if(!t)return;const{results:a}=t;M.addResults(a),this.searchResultsList.updateSearchResults(M.state.results),this.searchResultsList.facetsList.sortFacet.update(w.state.sort),this.searchResultsList.infoAndSort.updateSort(w.state.sort)};onRangeChange=async(e,t,a)=>{w.resetPagination(),M.clearResults();const{min:s,max:i}=M.state.facets[e]?.values,r=s&&i&&Math.floor(s)===Number(t)&&Math.ceil(i)===Number(a);r?w.removeRangeFilter(e):w.updateRangeFilter(e,t,a);const n=await this.onSearchWithFilters();if(!n)return;const{results:o,facets:c,totalPages:l,totalHits:d}=n;M.addResults(o),c[e]&&delete c[e],M.updateFacets(c),r?M.removeSelectedFacet(e):M.addRangeToSelectedFacets(e,{type:"range",values:{min:t,max:a}}),w.setTotalPages(l),w.setTotalHits(d),this.searchResultsList.updateSearchResults(M.state.results),this.searchResultsList.facetsList.updateListFacets(M.state.facets),this.searchResultsList.infoAndSort.updateFiltersInfo(w.state.filters)};onListCheckboxChange=async(e,t,a)=>{w.resetPagination(),M.clearResults(),w.updateFilterArray(e,t,a);const s=await this.onSearchWithFilters();if(!s)return;const{results:i,facets:r,totalPages:n,totalHits:o}=s;if(M.addResults(i),M.updateFacets(r),a){const a=r[e]?.values.find(e=>{let[a]=e;return a===t});M.addListToSelectedFacets(e,{type:"list",values:a||[t,0]})}else M.removeSelectedFacet(e,t);w.setTotalPages(n),w.setTotalHits(o),this.searchResultsList.updateSearchResults(M.state.results),this.searchResultsList.facetsList.updateFacets(M.state.facets),this.searchResultsList.infoAndSort.updateFiltersInfo(w.state.filters)};onInput=e=>{w.setText(e.target.value),e.target.value.length?(this.searchBar.setResetIconVisibility(!0),(Object.keys(w.state.filters).length||w.state.page>0)&&w.resetFiltersAndPagination(),this.onSearch()):(this.searchWidgetContainer.classList.remove("search-completed"),this.searchResultsList.clearSearchResults(),this.searchBar.setResetIconVisibility(!1))};onSeeMore=async()=>{w.setPage(w.state.page+1);const e=await(async()=>{try{const e=await fetch(o,{method:"POST",headers:d,body:J(w.state)}),t=await e.json(),a=X(t);return{results:a.hits,totalPages:a.totalPages}}catch(e){return window.console.error(e),null}})();if(!e)return;this.hasTriggeredSeeMore=!1;const{results:t,totalPages:a}=e;M.addResults(t),w.setTotalPages(a),this.searchResultsList.addSearchResults(t)};async onSearchWithFilters(){const{text:t}=w.state;return this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1,t?await(async()=>{const t=(e=>{const t=[],{text:a,filters:s,page:i,sort:r}=w.state;return t.push({indexUid:e,q:a,filter:_(s),hitsPerPage:50,page:i+1,sort:"relevance"===r[0]?[]:r}),Object.entries(M.state.facets).forEach(i=>{let[r]=i;const n=H({},s);delete n[r],t.push({indexUid:e,q:a,filter:_(n),facets:[r],hitsPerPage:0})}),JSON.stringify({queries:t})})(DATA.meilisearchIndex||e());try{const e=await fetch(c,{method:"POST",headers:d,body:t}),a=(e=>{const{results:t}=e,a=t.slice(1).reduce((e,t)=>{const a=Z(t);return H(H({},e),a)},{});return{hits:q(t[0].hits),facets:a,page:t[0].page,totalPages:t[0].totalPages,totalHits:t[0].totalHits}})(await e.json());return{results:a.hits,facets:a.facets,totalPages:a.totalPages,page:a.page,totalHits:a.totalHits}}catch(e){return window.console.error(e),null}})():(this.searchWidgetContainer.classList.remove("search-completed"),null)}onSearch=async()=>{const{text:e}=w.state;if(M.clearResults(),this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1,e)try{const e=await(async()=>{try{const e=await fetch(o,{method:"POST",headers:d,body:J(w.state)}),t=await e.json(),a=X(t);return{results:a.hits,facets:a.facets,totalPages:a.totalPages,page:a.page,totalHits:a.totalHits}}catch(e){return window.console.error(e),{results:[],facets:{},totalPages:0,page:0,totalHits:0}}})(),{results:t,facets:a,totalPages:s,totalHits:i}=e;M.addResults(t),M.setFacets(a),w.setTotalPages(s),w.setTotalHits(i),this.searchResultsList.renderSearchResults(t,a)}catch(e){window.console.error(e)}else this.searchWidgetContainer.classList.remove("search-completed")};debouncedOnInput=(()=>(e=>{let t=null;return function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];window.clearTimeout(t),t=window.setTimeout(()=>{e(...s)},150)}})(this.onInput.bind(this)))();getSearchWidgetContainerElement(){const e=document.createElement("div"),t=document.createElement("style");t.setAttribute("abtasty-script-added","true"),e.className=`${this.baseClassName}-container`,e.addEventListener("scroll",this.handleScroll.bind(this)),(()=>{const{primaryColor:e,secondaryColor:t,tertiaryColor:a,searchBarTitleAlign:s,searchBarTitleFontName:i,searchBarTitleFontSize:r,searchBarTitleFontStyle:n,searchBarTitleCustomFontColor:o,searchBarTitleTextColor:c,searchBarInputAlign:l,searchBarInputFontName:d,searchBarInputFontSize:h,searchBarInputFontStyle:b,searchBarInputCustomFontColor:g,searchBarInputTextColor:m}=DATA;["div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container {",`border-bottom-color: ${e};`,"}","div.abtasty-search-widget-container i.abtasty-search-widget-close-icon {",`background-color: ${e};`,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-input-label {",`text-align: ${s};`,Y(i,n),`font-size: ${r}px;`,`color: ${o?c:t};`,"}","div.abtasty-search-widget-container input.abtasty-search-widget-search-input {",`text-align: ${l};`,Y(d,b),`font-size: ${h}px;`,`color: ${g?m:a};`,"}"].join("")})(),(()=>{const{primaryColor:e,tertiaryColor:t,searchResultNameAlign:a,searchResultNameFontName:s,searchResultNameFontSize:i,searchResultNameFontStyle:r,searchResultNameCustomFontColor:n,searchResultNameTextColor:o,searchResultPriceAlign:c,searchResultPriceFontName:l,searchResultPriceFontSize:d,searchResultPriceFontStyle:h,searchResultPriceCustomFontColor:b,searchResultPriceTextColor:g}=DATA;["div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name {",`text-align: ${a};`,Y(s,r),`font-size: ${i}px;`,`color: ${n?o:e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price {",`text-align: ${c};`,Y(l,h),`font-size: ${d}px;`,`color: ${b?g:t};`,"}"].join("")})(),(()=>{const{primaryColor:e,secondaryColor:t,tertiaryColor:a,facetSectionTitleAlign:s,facetSectionTitleFontName:i,facetSectionTitleFontSize:r,facetSectionTitleFontStyle:n,facetSectionTitleCustomFontColor:o,facetSectionTitleTextColor:c,facetTitleAlign:l,facetTitleFontName:d,facetTitleFontSize:h,facetTitleFontStyle:b,facetTitleCustomFontColor:g,facetTitleTextColor:m}=DATA;["div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary {",`text-align: ${s};`,Y(i,n),`font-size: ${r}px;`,`color: ${o?c:e};`,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container {",`text-align: ${l};`,Y(d,b),`font-size: ${h}px;`,`color: ${g?m:a};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more {",`color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider {",`background-color: ${t};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress {",`background-color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {",`background-color: ${e};`,`color: ${t};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-values {",`color: ${a};`,"}"].join("")})();const a=document.createTextNode("html.search-open{height:100vh;overflow:hidden}div.abtasty-search-widget-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:inherit;inset:0;overflow-y:auto;position:fixed;z-index:9999}div.abtasty-search-widget-container button:not(:disabled):hover{opacity:.5}div.abtasty-search-widget-container i{display:inline-block;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}div.abtasty-search-widget-container.search-completed{background-color:#fff}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;border-bottom:1px solid #d8d8e2;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:24px 0;position:sticky;top:0;z-index:10}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin-inline:auto;max-width:1104px;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#fff;border:1px solid #a18cde;border-radius:4px;display:-webkit-box;display:-ms-flexbox;display:flex;margin-right:24px;padding:12px;width:100%}div.abtasty-search-widget-container input.abtasty-search-widget-search-input{border:none;font-size:13px;font-weight:400;outline:0;padding:0;width:100%}div.abtasty-search-widget-container button.abtasty-search-widget-reset-search-bar{background-color:#fff;border:none;cursor:pointer;min-height:24px;min-width:24px;padding:0;visibility:hidden}div.abtasty-search-widget-container button.abtasty-search-widget-reset-search-bar i.abtasty-search-widget-close-icon{background-color:#2a2a3c;min-height:12.19px;min-width:12.19px}div.abtasty-search-widget-container button.abtasty-search-widget-reset-search-bar svg{fill:#000;min-height:12.19px;min-width:12.19px}div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container{background-color:#fff!important;border:none;border-radius:100%;cursor:pointer!important;min-height:32px;min-width:32px;vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-close-icon{background-color:#d8d8e2;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.21 1.209a1.133 1.133 0 0 1 1.602 0l6.19 6.188L15.19 1.21a1.133 1.133 0 0 1 1.603 1.602l-6.189 6.19 6.189 6.188a1.133 1.133 0 0 1-1.603 1.603L9 10.602l-6.189 6.19a1.133 1.133 0 1 1-1.602-1.603L7.398 9 1.21 2.811a1.133 1.133 0 0 1 0-1.602Z' fill='%23787888'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.21 1.209a1.133 1.133 0 0 1 1.602 0l6.19 6.188L15.19 1.21a1.133 1.133 0 0 1 1.603 1.602l-6.189 6.19 6.189 6.188a1.133 1.133 0 0 1-1.603 1.603L9 10.602l-6.189 6.19a1.133 1.133 0 1 1-1.602-1.603L7.398 9 1.21 2.811a1.133 1.133 0 0 1 0-1.602Z' fill='%23787888'/%3E%3C/svg%3E\");min-height:16.25px;min-width:16.25px;vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-search-icon{background-color:#2a2a3c;margin-right:6px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.48.545a6.397 6.397 0 0 0-2.315.615A6.463 6.463 0 0 0 1.16 4.165a6.41 6.41 0 0 0 4.28 9.005 6.668 6.668 0 0 0 2.392.116 6.434 6.434 0 0 0 3.096-1.332l.12-.095 1.768 1.764c1.932 1.927 1.815 1.82 2.028 1.843a.575.575 0 0 0 .622-.631c-.024-.206.074-.098-1.843-2.019l-1.765-1.768.072-.088a6.73 6.73 0 0 0 .791-1.255 6.23 6.23 0 0 0 .618-2.929 6.213 6.213 0 0 0-.749-2.86A6.407 6.407 0 0 0 6.48.546Zm.016 1.146A5.266 5.266 0 0 0 1.72 6.236a7.775 7.775 0 0 0-.024 1.174 5.267 5.267 0 0 0 8.2 3.885 5.296 5.296 0 0 0 2.154-3.087c.106-.426.148-.789.148-1.272 0-.5-.043-.854-.158-1.302a5.259 5.259 0 0 0-1.227-2.258 5.254 5.254 0 0 0-3.318-1.672c-.2-.021-.79-.029-.998-.013Z' fill='%232A2A3C'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.48.545a6.397 6.397 0 0 0-2.315.615A6.463 6.463 0 0 0 1.16 4.165a6.41 6.41 0 0 0 4.28 9.005 6.668 6.668 0 0 0 2.392.116 6.434 6.434 0 0 0 3.096-1.332l.12-.095 1.768 1.764c1.932 1.927 1.815 1.82 2.028 1.843a.575.575 0 0 0 .622-.631c-.024-.206.074-.098-1.843-2.019l-1.765-1.768.072-.088a6.73 6.73 0 0 0 .791-1.255 6.23 6.23 0 0 0 .618-2.929 6.213 6.213 0 0 0-.749-2.86A6.407 6.407 0 0 0 6.48.546Zm.016 1.146A5.266 5.266 0 0 0 1.72 6.236a7.775 7.775 0 0 0-.024 1.174 5.267 5.267 0 0 0 8.2 3.885 5.296 5.296 0 0 0 2.154-3.087c.106-.426.148-.789.148-1.272 0-.5-.043-.854-.158-1.302a5.259 5.259 0 0 0-1.227-2.258 5.254 5.254 0 0 0-3.318-1.672c-.2-.021-.79-.029-.998-.013Z' fill='%232A2A3C'/%3E%3C/svg%3E\");min-height:15px;min-width:15px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-width:300px;padding:16px 16px 50px 0}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-categories-title,div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-products-title{color:#2a2a3c;font-size:16px;font-weight:700}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-categories-title{margin:16px 0 24px}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-products-title{margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category{color:#2a2a3c;cursor:pointer;font-size:14px;font-weight:400;line-height:20px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:not(:first-child),div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:not(:last-child){margin-bottom:16px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:hover{color:#3100bf}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container{-webkit-box-sizing:border-box;box-sizing:border-box;display:none}div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:space-between;margin-inline:auto;max-width:1104px;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1;padding:32px 0 50px 32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .star-rating{display:inline-block;font-size:12px;height:12px;margin-right:16px;position:relative;width:74px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .star-rating:before{color:#5e5e6e;content:\"★ ★ ★ ★ ★\";inset:0;position:absolute}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .star-rating:after{color:#fac438;content:\"★ ★ ★ ★ ★\";inset:0;overflow:hidden;position:absolute;white-space:nowrap;width:var(--rating-width)}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .reviews-count{color:#5e5e6e;font-size:12px;text-decoration:underline;text-underline-offset:4px}div.abtasty-search-widget-container div.abtasty-search-widget-search-infos{font-size:14px}div.abtasty-search-widget-container div.abtasty-search-widget-search-info-and-sort{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort{-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:13px;position:relative}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort label.abtasty-search-widget-search-sort-label{color:#2a2a3c;font-size:13px;font-weight:400;margin-bottom:0;margin-right:8px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;color:#2a2a3c;cursor:pointer;outline:none;padding-right:24px;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:after{bottom:5%;content:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' fill='%232A2A3C' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.967.631a.617.617 0 0 1 .3.367.627.627 0 0 1 .014.184c-.015.229.106.096-2.036 2.235C5.07 5.587 5.256 5.422 5 5.422s-.071.165-2.244-2.005C.566 1.232.72 1.403.72 1.143A.41.41 0 0 1 .773.9.573.573 0 0 1 1.54.634c.058.027.462.422 1.767 1.724L5 4.047l1.692-1.689C7.995 1.058 8.402.661 8.46.634A.612.612 0 0 1 8.967.63Z'/%3E%3C/svg%3E\");pointer-events:none;position:absolute;right:10px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-and-filters-button-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:end;-ms-flex-pack:end;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:end;width:100%}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button{background-color:#fff;border:1px solid #d8d8e2;border-radius:4px;color:#2a2a3c;cursor:pointer;display:none;font-size:14px;font-weight:700;margin-left:12px;outline:none;padding:8px}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active{color:#3100bf}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon{background-color:#2a2a3c;margin-right:8px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.19.688a.715.715 0 0 0-.473.96c.022.05 1.512 2.15 3.31 4.67l3.273 4.58.005 3.956.005 3.956.051.11a.86.86 0 0 0 .316.338.76.76 0 0 0 .59.032c.124-.052 4.2-2.78 4.26-2.85.03-.036.08-.112.109-.168l.054-.102.005-2.636.005-2.637 3.272-4.58c1.8-2.519 3.29-4.622 3.314-4.673a.6.6 0 0 0 .043-.264.5.5 0 0 0-.061-.3.7.7 0 0 0-.449-.388c-.096-.029-.923-.032-8.818-.03C3.188.663 1.268.669 1.19.688m1.603 1.437c.008.014 1.319 1.85 2.912 4.08s2.921 4.103 2.95 4.16l.055.105.005 3.407c.003 1.974.013 3.403.023 3.4s.585-.385 1.279-.847l1.261-.84.006-2.56.006-2.56.054-.105a407 407 0 0 1 2.95-4.16l2.913-4.08c.012-.02-1.434-.025-7.207-.025s-7.22.005-7.207.025' fill='%232A2A3C'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.19.688a.715.715 0 0 0-.473.96c.022.05 1.512 2.15 3.31 4.67l3.273 4.58.005 3.956.005 3.956.051.11a.86.86 0 0 0 .316.338.76.76 0 0 0 .59.032c.124-.052 4.2-2.78 4.26-2.85.03-.036.08-.112.109-.168l.054-.102.005-2.636.005-2.637 3.272-4.58c1.8-2.519 3.29-4.622 3.314-4.673a.6.6 0 0 0 .043-.264.5.5 0 0 0-.061-.3.7.7 0 0 0-.449-.388c-.096-.029-.923-.032-8.818-.03C3.188.663 1.268.669 1.19.688m1.603 1.437c.008.014 1.319 1.85 2.912 4.08s2.921 4.103 2.95 4.16l.055.105.005 3.407c.003 1.974.013 3.403.023 3.4s.585-.385 1.279-.847l1.261-.84.006-2.56.006-2.56.054-.105a407 407 0 0 1 2.95-4.16l2.913-4.08c.012-.02-1.434-.025-7.207-.025s-7.22.005-7.207.025' fill='%232A2A3C'/%3E%3C/svg%3E\");min-height:19px;min-width:19px}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon{background-color:#3100bf}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list{display:grid;gap:24px;grid-auto-rows:1fr;margin-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible:not(.no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(1,minmax(0,1fr))}div.abtasty-search-widget-container div.abtasty-search-widget-search-no-result{font-size:38px;font-weight:700;margin:82px auto 0;text-align:center}div.abtasty-search-widget-container a.abtasty-search-widget-search-result-container{color:inherit;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-webkit-box-orient:vertical;-webkit-box-direction:normal;border:1px solid #d8d8e2;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;padding:18px;width:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result:hover{border-color:#a18cde}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{margin-inline:auto;margin-bottom:16px;max-height:200px;max-width:200px;min-height:200px;min-width:200px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result img{aspect-ratio:200/200;max-height:100%;max-width:100%;min-height:100%;min-width:100%;-o-object-fit:contain;object-fit:contain}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-flex:1;-ms-flex-positive:1;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name{-webkit-line-clamp:3;-webkit-box-orient:vertical;color:#2a2a3c;display:-webkit-box;font-size:16px;font-weight:400;line-height:20px;margin-bottom:auto;max-height:60px;overflow:hidden;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name:has(+:not(.abtasty-search-widget-search-result-price)){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-brand{color:#2a2a3c;font-size:12px;font-weight:400;margin-bottom:auto;text-transform:uppercase}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-brand:has(+div.abtasty-search-widget-search-result-rating){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{color:#2a2a3c;font-size:18px;font-weight:700;line-height:normal;margin-top:16px;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:300px;overflow-y:auto;overscroll-behavior:auto;padding:16px 16px 50px 0;position:sticky;top:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-overlay{background-color:rgba(0,0,0,.5);display:none;inset:0;position:absolute;z-index:11}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#f3f3f7;display:none;-ms-flex-direction:column;flex-direction:column}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet label.abtasty-search-widget-search-sort-label{font-size:16px;font-weight:700;margin:16px 0 0 16px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet div.abtasty-search-widget-search-sort-options{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option{border:1px solid #d8d8e2;border-radius:50rem;font-size:13px;font-weight:700;padding:6px 12px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active{background-color:#3100bf;color:#fff}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-header{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;border-bottom:1px solid #d8d8e2;display:none;justify-content:space-between;padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;border:none;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;margin-left:auto;width:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;gap:8px;padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-reset-button{-webkit-box-pack:center;-ms-flex-pack:center;border:2px solid #3100bf;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;justify-content:center;padding:8px;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-reset-button{background-color:transparent;border:2px solid transparent;color:#d8d8e2;display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button{background-color:#3100bf;color:#fff;display:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button i.abtasty-search-widget-close-icon{background-color:#2a2a3c;min-height:14px;min-width:14px}div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more{background-color:transparent;border:none;color:#3100bf;cursor:pointer;font-size:14px;margin-bottom:16px;padding:0;text-decoration:underline}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content.range-facet{margin-bottom:16px;padding:20px 20px 0}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-list-item-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-list-item-container div.checkbox{margin:0}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container{cursor:pointer;display:block;font-size:13px;padding-left:24px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.checked,div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container:hover:not(.disabled){font-weight:700}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.disabled{cursor:not-allowed}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input{cursor:pointer;height:0;opacity:0;position:absolute;width:0}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.disabled input{cursor:not-allowed}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input[type=checkbox]:before{content:none}div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark{background-color:transparent;border:1px solid #000;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;height:16px;inset:0;position:absolute;width:16px}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark{background-color:#3100bf;font-weight:700}div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark:after{border:solid #fff;border-width:0 2px 2px 0;content:\"\";display:none;height:6px;inset:2.25px 4.75px;position:absolute;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:2px}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark:after{display:block}div.abtasty-search-widget-container ul li.abtasty-search-widget-search-facet-list-item{margin:16px 0}div.abtasty-search-widget-container ul li.abtasty-search-widget-search-facet-list-item:first-of-type{margin-top:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list details.abtasty-search-widget-search-facet:not(:last-of-type){border-bottom:1px solid #d8d8e2}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:16px;font-weight:700;justify-content:space-between;margin:0;padding:16px 2px 16px 0}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary:before{content:none}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary div.abtasty-search-widget-search-facet-arrow svg{fill:#2a2a3c}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary div.abtasty-search-widget-search-facet-arrow{-webkit-transform-origin:center;transform-origin:center}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet[open] summary div.abtasty-search-widget-search-facet-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content ul{list-style:none;margin:0;padding:0}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider{background-color:#e0e0e0;border-radius:5px;height:5px;margin:20px 0;position:relative;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress{background-color:#3100bf;border-radius:5px;height:100%;position:absolute;z-index:1}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle{background-color:#fff;border:1px solid #d8d8e2;border-radius:50%;cursor:pointer;height:24px;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:24px;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value{background-color:#3100bf;border-radius:4px;color:#fff;font-size:12px;font-weight:700;left:50%;padding:4px;position:absolute;text-align:center;top:-34px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container{-webkit-box-pack:justify;-ms-flex-pack:justify;bottom:-14px;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;left:0;padding:0;position:absolute;right:0}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar{background-color:#d8d8e2;width:2px}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar:first-child,div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar:last-child{height:8px}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar:not(:first-child):not(:last-child){height:6px}div.abtasty-search-widget-container div.abtasty-search-widget-range-values{-webkit-box-pack:justify;-ms-flex-pack:justify;color:#2a2a3c;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;justify-content:space-between;margin-top:10px}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span{font-size:12px;font-weight:400}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span:first-child{margin-right:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span:last-child{margin-left:-50%;-webkit-transform:translateX(50%);transform:translateX(50%)}div.abtasty-search-widget-container button.abtasty-search-widget-filters-button{background-color:#fff!important;border:none;border-radius:100%;cursor:pointer!important;display:none;margin-top:12px;padding:11px;-webkit-transform:translateX(-15%);transform:translateX(-15%);vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-filters-icon{background-color:#2a2a3c;-webkit-mask-image:url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDE4IDE4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiM0OTRjNGUiIGQ9Ik0xNyA1SDFhMSAxIDAgMCAxIDAtMmgxNmExIDEgMCAwIDEgMCAyem0wIDVIMWExIDEgMCAwIDEgMC0yaDE2YTEgMSAwIDAgMSAwIDJ6bTAgNUgxYTEgMSAwIDAgMSAwLTJoMTZhMSAxIDAgMCAxIDAgMnoiLz48L3N2Zz4=\");mask-image:url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDE4IDE4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiM0OTRjNGUiIGQ9Ik0xNyA1SDFhMSAxIDAgMCAxIDAtMmgxNmExIDEgMCAwIDEgMCAyem0wIDVIMWExIDEgMCAwIDEgMC0yaDE2YTEgMSAwIDAgMSAwIDJ6bTAgNUgxYTEgMSAwIDAgMSAwLTJoMTZhMSAxIDAgMCAxIDAgMnoiLz48L3N2Zz4=\");min-height:22px;min-width:22px;vertical-align:middle}@media (min-width:576px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:540px}}@media (min-width:768px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:720px}}@media (min-width:992px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:960px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible:not(.no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1200px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:1104px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible:not(.no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (max-width:991.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{max-height:147px;max-width:147px;min-height:147px;min-width:147px}}@media (max-width:767.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{max-width:240px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{max-height:200px;max-width:200px;min-height:200px;min-width:200px}}@media (max-width:575.98px){div.abtasty-search-widget-container{overflow-x:hidden}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container{padding:0 16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}div.abtasty-search-widget-container i.abtasty-search-widget-search-icon{display:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container button.abtasty-search-widget-close-icon-container{min-height:24px;min-width:24px;padding:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon{background-color:#2a2a3c;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.833 7.254c.017.054.058.14.091.192.034.052 1.36 1.39 2.949 2.976 3.247 3.241 2.972 2.995 3.356 2.996.171 0 .226-.01.34-.063.45-.209.636-.72.426-1.168-.04-.085-.54-.599-2.155-2.217L3.738 7.864h9.313c6.6 0 9.355-.008 9.456-.026a.86.86 0 0 0 .63-.498c.053-.113.063-.17.063-.34s-.01-.227-.063-.34a.86.86 0 0 0-.63-.498c-.101-.019-2.856-.026-9.456-.026H3.738L5.84 4.03c1.615-1.618 2.114-2.132 2.155-2.217A.865.865 0 0 0 7.569.644C7.455.591 7.4.581 7.23.581 6.845.583 7.12.337 3.873 3.578 2.285 5.163.958 6.502.925 6.552a.897.897 0 0 0-.092.702Z' fill='%232A2A3C'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.833 7.254c.017.054.058.14.091.192.034.052 1.36 1.39 2.949 2.976 3.247 3.241 2.972 2.995 3.356 2.996.171 0 .226-.01.34-.063.45-.209.636-.72.426-1.168-.04-.085-.54-.599-2.155-2.217L3.738 7.864h9.313c6.6 0 9.355-.008 9.456-.026a.86.86 0 0 0 .63-.498c.053-.113.063-.17.063-.34s-.01-.227-.063-.34a.86.86 0 0 0-.63-.498c-.101-.019-2.856-.026-9.456-.026H3.738L5.84 4.03c1.615-1.618 2.114-2.132 2.155-2.217A.865.865 0 0 0 7.569.644C7.455.591 7.4.581 7.23.581 6.845.583 7.12.337 3.873 3.578 2.285 5.163.958 6.502.925 6.552a.897.897 0 0 0-.092.702Z' fill='%232A2A3C'/%3E%3C/svg%3E\");min-height:24px;min-width:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar{border:none;margin-right:0;padding:0}div.abtasty-search-widget-container input.abtasty-search-widget-search-input{font-size:14px;margin-left:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container{padding-left:0;padding-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list-container{width:100vw}div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-container{margin-bottom:32px;padding:0 16px}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-categories-title{margin-top:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{margin:auto 12px auto 0;max-height:92px;max-width:92px;min-height:92px;min-width:92px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:start;-ms-flex-pack:start;-ms-flex-direction:row;flex-direction:row;justify-content:flex-start;padding:12px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name{font-size:13px;line-height:16px;max-height:32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name:has(+.abtasty-search-widget-search-result-price){margin-bottom:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet{display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort{display:none}div.abtasty-search-widget-container button.abtasty-search-widget-filters-button{display:block}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{border-top:1px solid #d8d8e2;bottom:0;position:fixed;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:unset!important;max-width:unset;overflow-x:hidden;right:-325px;-webkit-transition:.5s;transition:.5s;width:325px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{background-color:#fff;bottom:0;overflow-x:hidden;padding:0 0 100px;position:absolute;right:-325px;top:0!important;z-index:1}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet{margin:0 16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list div.abtasty-search-widget-search-facets-list-header{display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-overlay{display:block}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container{right:0;z-index:100}}@media (max-width:374.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container{width:100%}}");return t.appendChild(a),e.insertAdjacentElement("afterbegin",t),e}getRecommendationsElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-recommendations-container`;const t=document.createElement("div");t.className=`${this.baseClassName}-recommended-categories-container`;const a=document.createElement("h3");a.className=`${this.baseClassName}-recommended-categories-title`,a.innerHTML=b("Categories"),t.appendChild(a);const s=["T-Shirt","Jeans","Shoes","Accessories"];for(const e of s){const a=document.createElement("div");a.className=`${this.baseClassName}-recommended-category`,a.innerHTML=e,t.appendChild(a)}const i=document.createElement("div");i.className=`${this.baseClassName}-recommended-products-container`;const r=document.createElement("h3");r.className=`${this.baseClassName}-recommended-products-title`,r.innerHTML=b("Recommended Products");const n=document.createElement("div");n.className=`${this.baseClassName}-recommended-products-list`;const o=[{name:"Product Name",price:100,img_link:"https://prd.place/400"},{name:"Product Name",price:200,img_link:"https://prd.place/400"},{name:"Product Name",price:300,img_link:"https://prd.place/400"}];for(const[e,t]of o.entries()){const a=new T({result:t,index:e,baseClassName:this.baseClassName});n.appendChild(a.getSearchResultElement())}return i.appendChild(r),i.appendChild(n),e.appendChild(t),e.appendChild(i),e}}(()=>{const{elementReferrer:e}=DATA;return(e=>{const a=(()=>{if(t()||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),s=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(a||s){const t=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${t} - ${a?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${e}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}})("Widget launch"),(()=>{const e=[{name:DATA.facetTitleFontName,style:DATA.facetTitleFontStyle},{name:DATA.searchBarTitleFontName,style:DATA.searchBarTitleFontStyle},{name:DATA.searchBarInputFontName,style:DATA.searchBarInputFontStyle},{name:DATA.facetSectionTitleFontName,style:DATA.facetSectionTitleFontStyle},{name:DATA.searchResultNameFontName,style:DATA.searchResultNameFontStyle},{name:DATA.searchResultPriceFontName,style:DATA.searchResultPriceFontStyle}];for(const{name:t,style:a}of e){if(!t||"inherit"===t||!/otf|ttf/g.test(a))continue;const e=document.createElement("style"),s=a.match(V)?a.match(V)[1]:"";e.innerHTML=`@font-face { font-family: '${t}_${s}'; src: url('${a}'); font-display: swap; }`,document.head.appendChild(e)}})(),new Promise(s=>{r(e,()=>{const i=a(e),r=i.getRootNode();i.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.right="0",n.style.bottom="0",n.style.backgroundColor="transparent",n.style.cursor="pointer",n.style.zIndex="10",n.onclick=e=>{e?.preventDefault?.(),e?.stopPropagation?.(),new U({target:i,rootElement:r}).openSearchWidget()},i.appendChild(n);const o=!!document.querySelector(".abtasty-search-widget-container");t()&&!o&&n.onclick(),s()})})})().then(()=>{})}();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtasty/search",
|
|
3
3
|
"description": "Search Widget MVP",
|
|
4
|
-
"version": "0.0.2-
|
|
4
|
+
"version": "0.0.2-20",
|
|
5
5
|
"form": "dist/form.js",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"type": "module",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"rollup": "^4.12.0",
|
|
45
45
|
"rollup-plugin-postcss": "^4.0.2"
|
|
46
46
|
},
|
|
47
|
-
"stableVersion": "0.0.2-
|
|
47
|
+
"stableVersion": "0.0.2-19"
|
|
48
48
|
}
|