@abtasty/search 1.10.2 → 1.11.1
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 +1 -1
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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"),s=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},a=e=>new Function(`try {\n\t\t${e}\n\t} catch (error) {\n\t\treturn null;\n\t}`)(),i=()=>encodeURIComponent(DATA.spNoTrim?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),r=()=>!t()&&(s()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),n=()=>window.ABTasty&&!0===window.ABTasty.consentReady,o=()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`},c=()=>{const e=o();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")},l=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,d=e=>{const a=(()=>{if(t()||s())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),i=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(a||i){const t=c();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;")}},h=e=>{const t={promise:null,resolve:null,reject:null,name:e};return t.promise=new Promise((e,s)=>{t.resolve=e,t.reject=s}),t},u=(e,t)=>{const s=t?[]:null;if("string"!=typeof e||!e.trim().length)return s;const[a,i,r]=e.split("[]").map(e=>e.trim()),n=Boolean(r)?r:e,o=i?document.querySelector(a)?.[i]:document;return o?t?[...o.querySelectorAll(n)]:o.querySelector(n):s},g=e=>u(e,!1),b=e=>u(e,!0),m=(e,t)=>{const s={childList:!0,subtree:!0,attributes:!0},a=()=>i.disconnect(),i=new MutationObserver(()=>{const s=g(t);return s&&!a()&&e(s)});return{clear:a,observe:e=>{const t=document.querySelector("body")||document.documentElement,a=e??t;i.observe(a,s)}}},p=()=>{},y=(e,s)=>{const a=g(e),i={selector:e,clear:p,observe:p};if(a)return setTimeout(()=>s(a),0),i;if(t())return setTimeout(()=>y(e,s),1e3),i;if(e.includes("[]"))return((e,t)=>{const[s,a]=t.split("[]").map(e=>e.trim()),i=g(s),r=i?.[a],{clear:n,observe:o}=m(e,t),c=()=>{const s=g(t);return s&&!l()&&e(s)},l=()=>{n(),i?.removeEventListener("load",c)},d=()=>{o(r),"iframe"===i?.localName&&i.addEventListener("load",c)};return d(),{selector:t,clear:l,observe:d}})(s,e);const{clear:r,observe:n}=m(s,e);return n(),{selector:e,clear:r,observe:n}};function w(e,t){const s=e.parentElement||e.getRootNode().host;return t(e)||!s?e:w(s,t)}const f=(e,t)=>[...b(t)].some(s=>{const[a,,i]=t.split("[]"),r=i??a;return s===e||!!e.closest(r)});let v=!1;const x=/.+\/([^.]+)\.(otf|ttf)$/,C=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(x)?t.match(x)[1]:""};`:t||"",k=function(e,t,s){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{borderRadius:i}=DATA,r="number"==typeof t&&t>0;return!r&&a?{borderStyle:"border: unset;",borderRadiusStyle:""}:{borderStyle:`border: ${[r?`${t}px`:"",r?"solid":"",r&&"string"==typeof e&&e.length?e:""].join(" ").trim()};`,borderRadiusStyle:void 0!==s||i?`border-radius: ${s||i}px;`:""}},S=()=>{const{primaryColor:e,textColor:t,searchBarBackgroundColor:s,searchBarCloseIconColor:a,searchBarInputWidth:i,searchBarInputWidthUnit:r,searchBarInputSearchIconColor:n,searchBarInputBackgroundColor:o,searchBarInputAlign:c,searchBarInputFontName:l,searchBarInputFontSize:d,searchBarInputFontStyle:h,searchBarInputCustomFontColor:u,searchBarInputTextColor:g,searchBarInputBorderRadius:b,searchBarInputBorderWidth:m,searchBarInputPadding:p,searchBarInputAndSearchIconMargin:y}=DATA,w=C(l,h),f=p instanceof Array&&1===p.length&&p[0];return["@container widget-container (width > 576px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container {",`background-color: ${s};`,"}","}","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container {",`max-width: ${i}${r};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar {",`background-color: ${o};`,`border-color: ${e};`,b?`border-radius: ${b}px;`:"",m?`border-width: ${m}px;`:"border: unset;",f?`padding: ${f.top}px ${f.right}px ${f.bottom}px ${f.left}px;`:"","}","div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon {",`background-color: ${a};`,"}","div.abtasty-search-widget-container input.abtasty-search-widget-search-input {",`text-align: ${c};`,w,`font-size: ${d}px;`,u?`color: ${g};`:`color: ${t};`,"}","div.abtasty-search-widget-container i.abtasty-search-widget-search-icon {",`margin-right: ${y}px;`,`background-color: ${n};`,"}"].join("")},E=(e,t)=>{const{backgroundColor:s,textColor:a,secondaryTextColor:i,facetSectionTitleAlign:r,facetSectionTitleFontName:n,facetSectionTitleFontSize:o,facetSectionTitleFontStyle:c,facetSectionTitleCustomFontColor:l,facetSectionTitleTextColor:d,facetTitleAlign:h,facetTitleFontName:u,facetTitleFontSize:g,facetTitleFontStyle:b,facetTitleCustomFontColor:m,facetTitleTextColor:p,borderRadius:y,filtersButtonBackgroundColor:w,filtersButtonTextColor:f,filtersButtonBorderColor:v,filtersButtonBorderWidth:x,filtersButtonBorderRadius:S,sortButtonBackgroundColor:E,sortButtonTextColor:A,sortButtonBorderColor:T,sortButtonBorderWidth:N,sortButtonBorderRadius:R}=DATA,P=C(n,c),L=C(u,b),B=l?`color: ${d};`:`color: ${a};`,I=m?`color: ${p};`:`color: ${i};`,{borderStyle:D,borderRadiusStyle:O}=k(v,x,S),{borderStyle:F,borderRadiusStyle:j}=k(T,N,R),M=f?`color: ${f};`:`color: ${a};`;return["div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary {",`text-align: ${r};`,P,`font-size: ${o}px;`,B,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container {",`text-align: ${h};`,L,`font-size: ${g}px;`,I,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button {",`background-color: ${E||s};`,F,j,A?`color: ${A};`:`color: ${a};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active,","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button {","display: flex;",`background-color: ${w||s};`,M,D,O,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon,","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon {",f?`background-color: ${f};`:`background-color: ${a};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button i.abtasty-search-widget-search-sort-button-icon {",A?`background-color: ${A};`:`background-color: ${a};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active {",M,"}","@container widget-container (width <= 575.98px) {",`#${e} .${t} div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${y}px;`,"}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},A=(e,t)=>{const{primaryColor:s,secondaryTextColor:a,textColor:i,searchResultNameAlign:r,searchResultNameFontName:n,searchResultNameFontSize:o,searchResultNameFontStyle:c,searchResultNameCustomFontColor:l,searchResultNameTextColor:d,searchResultCaptionAlign:h,searchResultPriceAlign:u,searchResultPriceFontName:g,searchResultPriceFontSize:b,searchResultPriceFontStyle:m,searchResultPriceCustomFontColor:p,searchResultPriceTextColor:y,searchResultBackgroundColor:w,searchResultBorderColor:f,searchResultBorderWidth:v,searchResultBorderRadius:x,searchResultCaptionCustomFontColor:S,searchResultCaptionTextColor:E,searchResultCaptionFontName:A,searchResultCaptionFontStyle:T,searchResultCaptionFontSize:N,searchResultCtaButtonBackgroundColor:R,searchResultCtaButtonTextColor:P,searchResultCtaButtonBorderColor:L,searchResultCtaButtonBorderWidth:B,searchResultCtaButtonBorderRadius:I,searchResultCaptionUppercase:D,searchResultCtaButtonPadding:O,searchResultCtaButtonFontSize:F,searchResultCtaButtonFontName:j,searchResultCtaButtonFontStyle:M}=DATA,z=C(n,c),W=C(A,T),H=C(g,m),_=C(j,M),V=l?`color: ${d};`:`color: ${i};`,U=S?`color: ${E};`:`color: ${i};`,q=p?`color: ${y};`:`color: ${i};`,J=P?`color: ${P};`:`color: ${s};`,{borderStyle:G,borderRadiusStyle:K}=k("#D8D8E2",v,x,!0),{borderStyle:Z,borderRadiusStyle:Y}=k(L,B,I),X=window.location.hostname.includes("palaisdesthes");return["div.abtasty-search-widget-container div.abtasty-search-widget-search-result-card {",`background-color: ${w};`,G,K,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-card:hover {",`border-color: ${f||s};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-content {","center"===r?"align-items: center;":"","}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name {",`text-align: ${r};`,z,`font-size: ${o}px;`,V,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-caption {",`text-align: ${h};`,U,`font-size: ${N}px;`,W,D?"text-transform: uppercase;":"","}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price {",`text-align: ${u};`,H,`font-size: ${b}px;`,q,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price span {",`color: ${a};`,"}",`#${e} .${t} button.abtasty-search-widget-search-result-add-to-cart {`,"display: flex;",`background-color: ${s};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-result-cta-button {",`background-color: ${R};`,_,J,Z,Y,O&&1===O.length&&O[0]?`padding: ${O[0].top}px ${O[0].right}px ${O[0].bottom}px ${O[0].left}px;`:"",`font-size: ${F}px;`,"}",...X?["@container widget-container (width <= 575.98px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-result {","display: flex;","flex-direction: column;","}","div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container {","margin-inline: auto;","margin-bottom: 12px;","}","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-list {","flex-direction: row;","}","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:not(:last-child)::after {","content: '|';","margin-inline: 6px;","}","}"]:[]].join("")},T=()=>{if(!DATA.useMarketBanners)return"";const{marketBannerBackgroundColor:e,marketBannerBorderColor:t,marketBannerBorderWidth:s,marketBannerBorderRadius:a,marketBannerTextColor:i}=DATA,{borderStyle:r,borderRadiusStyle:n}=k(t,s,a);return["div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner {",`color: ${i};`,"}","@container widget-container (width <= 575.98px) {","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner {",`background-color: ${e};`,r,n,"}","}"].join("")},N=(e,t)=>{const{freeCustomZIndex:s,primaryColor:a,backgroundColor:i,borderRadius:r,fullWidth:n,dropShadow:o,dropShadowColor:c,dropShadowBlur:l,containerBorderColor:d,containerBorderWidth:h,containerBorderRadius:u}=DATA,g=`color: ${i};`,b=`color: ${a};`,m=void 0!==o&&o?`box-shadow: 0 5px ${l}px 0 ${c};`:"",{borderStyle:p,borderRadiusStyle:y}=k(d,h,u,!0);return[`#${e} .${t} {`,"text-align: left !important;","-webkit-text-fill-color: currentColor !important;","fill: currentColor !important;","}",`#${e} .${t} button {`,"display: block;","}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-close-button:hover {`,"background: transparent;","}","div.abtasty-search-widget-container {",`z-index: ${s};`,`background-color: ${i};`,m,p,y,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container {",DATA.useFacetsList?"":"padding-left: 0;","}",`#${e} .${t} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button,`,`#${e} .${t} button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} button.abtasty-search-widget-search-filters-button {`,"display: none;","}",`#${e} .${t} button.abtasty-search-widget-side-panel-close-button,`,`#${e} .${t} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button {`,"display: flex;","}","div.abtasty-search-widget-container button.plain {",`background-color: ${a};`,g,`border-radius: ${r}px;`,"}","div.abtasty-search-widget-container button.plain.inverted {",b,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more {",b,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active,","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress {",`background-color: ${a};`,"}",`#${e} .${t} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,`background-color: ${a};`,`border-color: ${a};`,g,"}","div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark:after,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value {",g,"}",...n?["div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,","div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible,","div.abtasty-search-widget-container div.abtasty-search-widget-search-container {","padding-inline: 16px;","margin-inline: 0 !important;","max-width: unset !important;","}"]:[],"@container widget-container (width <= 575.98px) {",`#${e} .${t} div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${r}px;`,"}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},R=(e,t)=>{const{layout:s,typeOfPositioning:a}=DATA;return[..."absolute"===a?[`#${e} .${t} {`,"width: 80vw;","}",`#${e} {`,"left: calc(50% - 40vw);","}","@media (max-width: 375.98px) {",`#${e} .${t} {`,"width: 90vw;","}",`#${e} {`,"left: unset;","}","}"]:[],"div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,","div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list {",`padding-top: ${"popin"===DATA.layout?"16px":"32px"};`,"}","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 {",`padding-top: ${"popin"===s?"32px":"48px"};`,"}","@container widget-container (width <= 575.98px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container {",`padding-top: ${"popin"===s?"16px":"48px"};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-container {","padding-top: 0px;","}","}"].join("")},P={searchResultMainInformationOrderName:"name",searchResultMainInformationOrderRating:"rating",searchResultMainInformationOrderCaption:"caption",searchResultMainInformationOrderPrice:"price"},L=e=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`,B=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)};class I{constructor(){this.observers=[]}subscribe(e){this.observers.push(e)}unsubscribe(e){this.observers=this.observers.filter(t=>t!==e)}notify(e){this.observers.forEach(t=>t(e))}}const D=new class{constructor(){this.translationKeys={}}init(){try{const e=JSON.parse(DATA.translationKeys);this.translationKeys=e}catch(e){}}getTranslation(e){const t=this.translationKeys[e];return t&&""!==t?t:e}};function O(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 F(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?O(Object(s),!0).forEach(function(t){j(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):O(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function j(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}D.init();const M=()=>[{value:"relevance",label:D.getTranslation("Relevance")},{value:"price:asc",label:`↑ ${D.getTranslation("Price")}`},{value:"price:desc",label:`↓ ${D.getTranslation("Price")}`}],z=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.entries(e).reduce((e,t)=>{let[a,i]=t;return e[a]&&(Array.isArray(e[a].values)?e[a]=F(F({},i),{},{values:e[a].values.map(e=>{let[t,a]=e;const r=i.values.find(e=>{let[s]=e;return s===t});return r?[t,r[1]]:[t,s?0:a]})}):e[a]=F(F({},i),{},{min:e[a].values.min,max:e[a].values.max})),e},F({},t))},W="RESET",H="SET_TEXT",_="SET_TOTAL_HITS",V="SET_SORT",U="SET_LIST_FILTERS",q="SET_RANGE_FILTERS",J="REMOVE_RANGE_FILTERS",G="RESET_FILTERS",K="GET_NEXT_PAGE",Z="SET_RESULTS",Y="UPDATE_RESULTS",X="ADD_RESULTS";function Q(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 ee(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(s),!0).forEach(function(t){te(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Q(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function te(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 se={results:[],facets:{}},ae=function(){let e=ee({},se);const t=new I;return ee({get state(){return e},get observable(){return t}},{logState(t){JSON.parse(JSON.stringify(e))},setResults(s,a){e.results=s,e.facets=a,t.notify({type:Z}),this.logState("setResults")},updateResults(s){e.results=s,t.notify({type:Y}),this.logState("updateResults")},setFacets(s){e.facets=s,t.notify({type:"SET_FACETS"}),this.logState("setFacets")},addResults(s){e.results=[...e.results,...s],t.notify({type:X,payload:s}),this.logState("addResults")},updateFacets(t){const s=z(t,e.facets,!0);this.setFacets(s),this.logState("updateFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=ee({},se),this.logState("reset")}})}();function ie(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 re(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(s),!0).forEach(function(t){ne(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ie(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function ne(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 oe={text:"",previousFilters:{},filters:{},sort:["relevance"],page:1,totalPages:0,totalHits:0},ce=function(){let e=re({},oe);const t=new I;return re({get state(){return e},get observable(){return t},isNoFiltersAndNoSort:()=>0===Object.keys(e.filters).length&&"relevance"===e.sort[0]},{logState(t){JSON.parse(JSON.stringify(e))},setText(s){e.text=s,t.notify({type:H}),this.logState("setText")},setPage(s){e.page=s,e.page<=e.totalPages&&t.notify({type:K}),this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(s){e.totalHits=s,t.notify({type:_}),this.logState("setTotalHits")},setSort(s){e.sort=""===s?[]:[s],t.notify({type:V}),this.logState("setSort")},updateRangeFilter(s,a,i){e.filters[s]=[{operator:">=",value:a},{operator:"<=",value:i}],t.notify({type:q}),this.logState("updateRangeFilter")},removeRangeFilter(s){const a=re({},e.filters);delete a[s],e.filters=a,t.notify({type:J}),this.logState("removeRangeFilter")},updateFilterArray(s,a,i){const r=re({},e.filters);i?r[s]=[...r[s]||[],a]:(r[s].length&&(r[s]=r[s].filter(e=>e!==a)),0===r[s].length&&delete r[s]),e.filters=r,this.logState("updateFilterArray"),t.notify({type:U})},setPreviousFilters(t){e.previousFilters=t,this.logState("setPreviousFilters")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},t.notify({type:G}),this.logState("resetFilters")},resetPagination(){e.page=1,e.totalPages=0,this.logState("resetPagination")},reset(){e=re({},oe),t.notify({type:W}),this.logState("reset")}})}();class le{constructor(e){let{baseClassName:t,onInput:s,closeSearchWidget:a}=e;this.baseClassName=t,this.onInput=s,this.closeSearchWidget=a,this.inputId=`${this.baseClassName}-search-input`,this.searchBarContainer=this.getSearchBarContainer(),this.searchBar=this.getSearchBar(),this.searchInput=this.getSearchInput(),this.buildSearchBar()}getSearchBarContainerHeight(){const{elementReferrer:e}=DATA,t=g(e),s=t?.closest("header");if(s){const e=s.getBoundingClientRect().height;return Math.max(e,150)+"px"}return"auto"}getCurrentSearchBarContainerHeight(){return this.searchBarContainer.getBoundingClientRect().height}resetSearchBarHeight(){this.searchBarContainer.style.minHeight=this.getSearchBarContainerHeight()}setInputValue(e){this.searchInput.value=e}focusInput(){setTimeout(()=>{this.searchInput.focus()},100)}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`,DATA.useSearchBarInputCustomSearchIcon&&"widget_common_defaultImgUrl"!==DATA.searchBarInputCustomSearchIcon&&(t.style.maskImage=`url(${DATA.searchBarInputCustomSearchIcon})`),e.appendChild(t),e}getSearchInput(){const e=document.createElement("input");return e.id=this.inputId,e.placeholder=D.getTranslation("Search..."),e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,DATA.useRedirectionUrl&&DATA.redirectionUrl&&e.addEventListener("keyup",t=>{e.value&&"Enter"===t.key&&(t.preventDefault(),window.location.href=DATA.redirectionUrl.replace("{{query}}",e.value))}),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`,DATA.useSearchBarCustomCloseIcon&&"widget_common_defaultImgUrl"!==DATA.searchBarCustomCloseIcon&&(t.style.maskImage=`url(${DATA.searchBarCustomCloseIcon})`),e.appendChild(t),e}buildSearchBar(){const e=document.createElement("button");if(e.className=`${this.baseClassName}-reset-search-bar`,e.onclick=()=>{ae.reset(),ce.reset()},DATA.useSearchBarInputResetPlainText)e.textContent=DATA.searchBarInputResetPlainText,e.style.textDecoration="underline";else{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 t=this.getSearchBarAndCloseButtonContainer();t.append(this.searchBar,this.getSearchCloseButton()),this.searchBarContainer.appendChild(t)}}class de{constructor(e){let{id:t,facet:s,baseClassName:a}=e;this.id=t,this.facet=s,this.baseClassName=a,this.facetContentContainers=this.createFacetContainers()}createFacetContainers(){const e=L(this.facet.title),t=D.getTranslation(e),s=document.createElement("details");s.className=`${this.baseClassName}-search-facet`,s.open=!0;const a=document.createElement("summary");a.innerHTML=`\n\t\t\t<span>${t}</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 i=document.createElement("div");return i.className=`${this.baseClassName}-search-facet-content ${this.facet.type}-facet`,s.append(a,i),{facetContainer:s,facetContent:i}}getFacetContainers(){return this.facetContentContainers}}class he extends de{constructor(e){let{id:t,facet:s,baseClassName:a}=e;super({id:t,facet:s,baseClassName:a});const{facetContent:i,facetContainer:r}=this.getFacetContainers();this.facetContent=i,this.facetContainer=r,this.facetList=this.getFacetListElement(),this.showAll=!1,this.facetContent.append(this.facetList)}createFacetContent(){const e=this.facet.values.sort((e,t)=>{let[s,a]=e,[i,r]=t;const n=(ce.state.filters[this.facet.title]||[]).includes(s),o=(ce.state.filters[this.facet.title]||[]).includes(i);return n===o?r-a:o-n}),t=this.showAll?e:e.slice(0,10),s=[];for(const[e,a]of t){const t=this.getFacetListItemElement({name:e,count:a});s.push(t)}if(this.facetList.append(...s),this.facet.values.length>10){const e=document.createElement("button");e.className=`${this.baseClassName}-search-facet-show-more`,e.innerHTML=this.showAll?D.getTranslation("See less"):D.getTranslation("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:s}=e,a=document.createElement("li");a.className=`${this.baseClassName}-search-facet-list-item`,a.id=`${this.baseClassName}-search-facet-list-item-${t.replace(" ","-").toLowerCase()}`;const i=(ce.state.filters[this.facet.title]||[]).includes(t),r=document.createElement("label");r.className=`${this.baseClassName}-search-facet-checkbox-container ${i||0!==s?"":"disabled"} ${i?"checked":""}`;try{const e=JSON.parse(t);r.innerHTML=`${Array.isArray(e)?e.join(", "):e} (${s})`}catch(e){r.innerHTML=`${t} (${s})`}const n=document.createElement("span");n.className=`${this.baseClassName}-search-facet-checkbox-checkmark`;const o=document.createElement("input");return o.disabled=!i&&0===s,o.checked=i,o.type="checkbox",o.onclick=()=>{const e=o.checked;ce.resetPagination(),ae.clearResults(),ce.updateFilterArray(this.facet.title,t,e)},r.appendChild(o),r.appendChild(n),a.appendChild(r),a}updateFacetContent(){B(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 ue{constructor(e){let{baseClassName:t,currentRange:s,min:a,max:i,onRangeChange:r}=e;this.baseClassName=t,this.currentRange=s||{min:a,max:i},this.min=a,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 s=document.createElement("div");s.className="steps-container";for(let e=0;e<20;e++){const e=document.createElement("div");e.className="step-bar",s.appendChild(e)}const a=document.createElement("div");a.className="range-handle";const i=document.createElement("div");i.className="range-handle-value",a.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 a.style.left="0%",r.style.left="100%",t.style.left="0%",t.style.width="100%",a.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(s,t,a,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;a.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(s,t,a,r);let d=!1,h=null,u=0,g=0;const b=()=>{const e=parseFloat(a.style.left),t=parseFloat(r.style.left),s=Math.floor(this.min+e/100*(this.max-this.min)),o=Math.ceil(this.min+t/100*(this.max-this.min));return i.textContent=s,n.textContent=o,{minValue:s,maxValue:o}},m=e=>{e.preventDefault(),d=!0,h=e.target.closest(".range-handle"),u=e.clientX||e.touches&&e.touches[0].clientX,g=parseFloat(h.style.left)},p=s=>{if(!d)return;s.preventDefault();const i=(s.clientX||s.touches&&s.touches[0].clientX)-u,n=e.offsetWidth;let o=g+i/n*100;o=h===a?Math.max(0,Math.min(o,parseFloat(r.style.left))):Math.max(parseFloat(a.style.left),Math.min(o,100));const c=100/19;o=Math.round(o/c)*c,h.style.left=`${o}%`,(()=>{const e=parseFloat(a.style.left),s=parseFloat(r.style.left);t.style.left=`${e}%`,t.style.width=s-e+"%"})(),b()},y=()=>{if(!d)return;d=!1,h=null;const{minValue:e,maxValue:t}=b();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[a,r].forEach(e=>{e.addEventListener("mousedown",m),e.addEventListener("touchstart",m,{passive:!1})}),document.addEventListener("mousemove",p),document.addEventListener("mouseup",y),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",y),document.addEventListener("touchcancel",y),{rangeContainer:e,valuesContainer:o}}}class ge extends de{constructor(e){let{id:t,facet:s,baseClassName:a}=e;super({id:t,facet:s,baseClassName:a});const{facetContent:i,facetContainer:r}=this.getFacetContainers();this.facetContent=i,this.facetContainer=r,this.filterRange=new ue({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:this.onRangeChange.bind(this)})}onRangeChange=e=>{const{min:t,max:s}=e,{min:a,max:i}=ae.state.facets[this.facet.title]?.values,r=!(void 0===a||void 0===i||Math.floor(a)!==Number(t)||Math.ceil(i)!==Number(s));ce.resetPagination(),ae.clearResults(),r?ce.removeRangeFilter(this.facet.title):ce.updateRangeFilter(this.facet.title,t,s)};createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){B(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new ue({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:this.onRangeChange.bind(this)}),this.createFacetContent())}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.updateFacetContent()}}class be{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getSortFacetElement(),ce.observable.subscribe(e=>{let{type:t}=e;switch(t){case W:case V:this.updateSortValue()}})}updateSortValue(){this.element.querySelectorAll(".active").forEach(e=>{e.classList.remove("active"),e.disabled=!1});const e=this.element.querySelector(`[data-value="${ce.state.sort[0]||"relevance"}"]`);e&&(e.classList.add("active"),e.disabled=!0)}getSortOptionsElements(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-options`;const t=M();for(const s of t){const t=document.createElement("button");t.classList.add(`${this.baseClassName}-search-sort-option`),(""===s.value&&0===ce.state.sort.length||ce.state.sort.includes(s.value))&&(t.classList.add("active"),t.disabled=!0);const a=document.createElement("div");a.className=`${this.baseClassName}-search-sort-option-label`,a.textContent=s.label,t.appendChild(a),t.dataset.value=s.value,t.onclick=()=>{ce.setPage(1),ae.clearResults(),ce.setSort(s.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=`${D.getTranslation("Sort By")}:`,e.appendChild(t),e.appendChild(this.getSortOptionsElements()),e}}class me{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getInfosElement(),ce.observable.subscribe(e=>{let{type:t}=e;t===_&&(this.element.innerHTML=this.getContent())})}getInfosElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-infos`,e.style.whiteSpace="nowrap",e.innerHTML=this.getContent(),e}getContent(){const e=D.getTranslation(ce.state.totalHits>1?"results":"result");return`<span><b>${ce.state.totalHits}</b> ${e}</span>`}}class pe{constructor(e){let{baseContainer:t,baseClassName:s,onPanelOpen:a,onPanelClose:i,content:r,type:n,headerContent:o}=e;this.baseContainer=t,this.baseClassName=s,this.sidePanelBaseClassName=`${s}-side-panel`,this.onPanelOpen=a,this.onPanelClose=i,this.content=r,this.type=n,this.headerContent=o,this.sidePanelClassName=`${this.sidePanelBaseClassName}-${this.type}`,this.overlayClassName=`${this.sidePanelBaseClassName}-${this.type}-overlay`,this.sidePanel=this.getSidePanelElement()}insertIn(e){this.baseContainer.insertAdjacentElement(e,this.sidePanel)}openPanel(){this.overlay=document.createElement("div"),this.overlay.className=this.overlayClassName,this.overlay.onclick=this.closePanel.bind(this),this.baseContainer.parentElement.insertAdjacentElement("afterbegin",this.overlay),this.sidePanel.classList.add("open"),this.onPanelOpen?.()}closePanel(){this.sidePanel.classList.remove("open"),this.baseContainer.parentElement.removeChild(this.overlay),this.overlay=null,this.onPanelClose?.()}getSidePanelElement(){const e=document.createElement("div");return e.className=this.sidePanelClassName,this.sidePanelContent=this.getSidePanelContentElement(),e.appendChild(this.getSidePanelHeaderElement()),e.appendChild(this.sidePanelContent),e}getSidePanelHeaderElement(){const e=document.createElement("div");e.className=`${this.sidePanelBaseClassName}-header`;const t=document.createElement("button");t.className=`${this.sidePanelBaseClassName}-close-button`;const s=document.createElement("i");return s.className=`${this.baseClassName}-close-icon`,t.appendChild(s),t.onclick=this.closePanel.bind(this),this.headerContent&&e.appendChild(this.headerContent),e.appendChild(t),e}getSidePanelContentElement(){const e=document.createElement("div");return e.className=`${this.sidePanelClassName}-content`,this.content&&e.appendChild(this.content),e}updateSidePanelContent(){B(this.sidePanelContent),this.sidePanelContent.append(...arguments)}}class ye{constructor(e){let{baseClassName:t,baseContainer:s,searchResultsContainer:a,onFiltersReset:i}=e;this.baseClassName=t,this.baseContainer=s,this.searchResultsContainer=a,this.onFiltersReset=i,this.facets=[],this.facetsListContainer=this.getFacetsListContainer(),this.filtersSidePanel=new pe({baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,type:"filters",headerContent:this.searchInfos.element,onPanelOpen:this.onPanelOpen.bind(this),onPanelClose:this.onPanelClose.bind(this)}),"2buttons"===DATA.filtersAndSort&&(this.sortSidePanel=new pe({baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,type:"sort",content:this.sortFacet.element,onPanelOpen:this.onPanelOpen.bind(this),onPanelClose:this.onPanelClose.bind(this)})),ce.observable.subscribe(e=>{let{type:t}=e;switch(t){case U:case q:case J:case G:this.setResetButtonAvailability()}}),this.isMobileLayout=window.innerWidth<=575.98,this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.resizeObserver.observe(this.baseContainer)}handleResize(e){const t=e[0],{width:s}=t.contentRect;this.isMobileLayout&&s<575.98||!this.isMobileLayout&&s>=575.98||(this.isMobileLayout=s<575.98,this.isMobileLayout?("2buttons"!==DATA.filtersAndSort&&this.facetsList.insertAdjacentElement("afterbegin",this.sortFacet.element),this.filtersSidePanel.updateSidePanelContent(this.facetsList,this.facetsListBottomButtonsContainer)):(this.filtersSidePanel.sidePanel.classList.contains("open")&&this.filtersSidePanel.closePanel(),"2buttons"===DATA.filtersAndSort&&this.sortSidePanel.sidePanel.classList.contains("open")&&this.sortSidePanel.closePanel(),this.facetsListContainer.appendChild(this.facetsListBottomButtonsContainer),this.facetsListContainer.insertBefore(this.facetsList,this.facetsListContainer.lastChild)))}setResetButtonAvailability(){const e=this.facetsListBottomButtonsContainer.querySelector(`.${this.baseClassName}-search-facets-list-reset-button`);e&&(e.disabled=!Object.keys(ce.state.filters).length)}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 s=document.createElement("i");s.className=`${this.baseClassName}-close-icon`,t.appendChild(s),this.sortFacet=new be({baseClassName:this.baseClassName}),this.facetsListBottomButtonsContainer=document.createElement("div"),this.facetsListBottomButtonsContainer.className=`${this.baseClassName}-search-facets-list-bottom-buttons-container`;const a=document.createElement("button");a.className=`plain inverted ${this.baseClassName}-search-facets-list-reset-button`,a.disabled=!0,a.innerHTML=D.getTranslation("Clear results"),a.onclick=this.onFiltersReset;const i=document.createElement("div");i.className=`${this.baseClassName}-search-facets-list-header`,this.searchInfos=new me({baseClassName:this.baseClassName});const r=document.createElement("button");return r.className=`plain ${this.baseClassName}-search-facets-list-bottom-close-button`,r.innerHTML=D.getTranslation("Show results"),r.onclick=this.closeFilters.bind(this),i.append(this.searchInfos.element,t),this.facetsListBottomButtonsContainer.append(a,r),this.facetsList=document.createElement("div"),e.append(i,this.sortFacet.element,this.facetsList,this.facetsListBottomButtonsContainer),e}renderFacets(e){var t;if((t=this.facetsList)&&[...t.children].forEach(e=>{e.tagName.toLowerCase()==="details".toLowerCase()&&e.parentNode.removeChild(e)}),DATA.customFiltersOrder){const t=DATA.customFiltersOrder.split(","),s=Object.keys(e).sort((e,s)=>t.includes(e)?t.includes(s)?t.indexOf(e)-t.indexOf(s):-1:1),a={};s.forEach(t=>{a[t]=e[t]}),e=a}this.facets=[];for(const[t,s]of Object.entries(e)){if(0===s.values.length||1===s.values.length)continue;const e=new("range"===s.type?ge:he)({id:t,facet:{title:t,values:s.values,type:s.type},baseClassName:this.baseClassName});this.facetsList.appendChild(e.facetContentContainers.facetContainer),this.facets.push(e)}this.facets.forEach(e=>{e.createFacetContent()}),this.searchResultsContainer.appendChild(this.facetsListContainer),this.filtersSidePanel.insertIn("beforeend"),this.isMobileLayout&&this.filtersSidePanel.updateSidePanelContent(this.facetsList,this.facetsListBottomButtonsContainer),this.sortSidePanel?.insertIn("beforeend")}setMaxHeight(e){if("popin"===DATA.layout)e?(this.facetsListContainer.style.maxHeight=`calc(100dvh - ${e}px)`,this.facetsListContainer.style.top=`${e}px`):(this.facetsListContainer.style.maxHeight="0px",this.facetsListContainer.style.top="0px");else{const e=`calc(100dvh - ${this.baseContainer.getBoundingClientRect().top}px)`;this.facetsListContainer.style.maxHeight=e,this.facetsListContainer.style.height=e}}openFilters(){this.filtersSidePanel.openPanel()}closeFilters(){this.filtersSidePanel.closePanel()}openSort(){this.sortSidePanel?.openPanel()}closeSort(){this.sortSidePanel?.closePanel()}onPanelOpen(){this.baseContainer.style.overflowY="hidden"}onPanelClose(){this.baseContainer.style.overflowY="auto"}updateRangeFacets(e){this.facets.filter(e=>e instanceof ge).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof he).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}}class we{constructor(e){let{result:t,index:s,baseClassName:a,isRecommendedProduct:i}=e;this.result=t,this.index=s,this.baseClassName=a,this.isRecommendedProduct=i}onAddToCart(e){e?.preventDefault?.(),e?.stopPropagation?.(),window.console.log("onAddToCart",this.result)}onClick(e){return window.abtasty.send("event",{ec:"Action Tracking",ea:"searchResultClicked",el:this.isRecommendedProduct?`recommendedProduct|${this.result.id}`:`${ce.state.text}|${this.result.id}`,ev:this.index}),!0}getRatingElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-rating`;const t=this.result.reviewsCount,s=D.getTranslation(t>1?"reviews":"review"),a=document.createElement("div");a.className="reviews-count",a.textContent=`${t} ${s}`;const i=this.result.rating,r=document.createElement("div");return r.title=i,r.className="star-rating",r.style.setProperty("--rating-width",i/5*100+"%"),e.appendChild(r),e.appendChild(a),e}getAdditionalInfoElement(){if(!this.result.strokePrice&&!this.result.recent||DATA.useCustomPricing)return null;const e=document.createElement("div");if(e.className=`${this.baseClassName}-search-result-additional-info-container`,this.result.strokePrice){const t=document.createElement("div");if(t.className=`${this.baseClassName}-search-result-stroke-price`,t.textContent=`${this.result.strokePrice}€`,e.appendChild(t),this.result.discount){const t=document.createElement("div");t.className=`${this.baseClassName}-search-result-info-tag`,t.textContent=`-${this.result.discount}%`,e.appendChild(t)}return e}if(this.result.recent){const t=document.createElement("div");t.className=`${this.baseClassName}-search-result-info-tag`,t.textContent="New",e.appendChild(t)}return e}getSearchResultElement(){const e=document.createElement("div");e.onclick=this.onClick.bind(this),e.className=`${this.baseClassName}-search-result-card`;const t=this.index<6&&this.index<window.innerHeight/200*2,s=document.createElement("div");s.className=`${this.baseClassName}-search-result result-${this.index}`;const a=document.createElement("a");a.className=`${this.baseClassName}-search-result-image-container`;const i=document.createElement("img");i.alt=this.result.name,i.className=`${this.baseClassName}-search-result-image ${t?"":"lazy"}`,t?i.src=this.result.img_link:i.dataset.src=this.result.img_link,a.appendChild(i);const r=document.createElement("div");r.className=`${this.baseClassName}-search-result-content`;const n=Object.entries(P).map(e=>{let[t,s]=e;return{key:s,order:DATA[t]}}).sort((e,t)=>e.order-t.order);if(n.forEach((e,t)=>{if(!this.result[e.key])return;if(e.key===P.searchResultMainInformationOrderRating){const e=this.getRatingElement().outerHTML;return void r.appendChild(e)}if(e.key===P.searchResultMainInformationOrderPrice&&t<n.length-1){const e=this.getPricingElement();return void r.appendChild(e)}let s=document.createElement("div");if(s.className=`${this.baseClassName}-search-result-${e.key}`,s.textContent=this.result[e.key],"name"===e.key&&DATA.useSearchResultCtaButton){const e=document.createElement("a");e.href=this.result.link,e.style.cursor="pointer",e.appendChild(s),s=e}r.appendChild(s)}),n[n.length-1].key===P.searchResultMainInformationOrderPrice){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-bottom-content`;const t=this.getAdditionalInfoElement();e.appendChild(this.getPricingElement()),t&&e.appendChild(t),r.appendChild(e)}const o=document.createElement("button");o.className=`${this.baseClassName}-search-result-add-to-cart`,o.onclick=this.onAddToCart.bind(this),o.innerHTML='<div class="add-to-cart-content" data-label="Add to cart"/>';let c=null;if(DATA.useSearchResultCtaButton){c=document.createElement("a"),c.href=this.result.link,c.style.cursor="pointer";const e=document.createElement("button");e.className=`plain inverted ${this.baseClassName}-search-result-cta-button`,e.innerHTML=DATA.searchResultCtaButtonText,c.appendChild(e)}else a.classList.add("no-cta");return a.href=this.result.link,a.style.cursor="pointer",s.appendChild(a),s.appendChild(r),c&&s.appendChild(c),e.appendChild(s),e}getPricingElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-price-container`;const t=document.createElement("div");t.className=`${this.baseClassName}-search-result-price`;const s=`${window.location.hostname.includes("palaisdesthes")?"<span>À partir de</span>":""}${this.result.price.toLocaleString(DATA.language,{minimumFractionDigits:2,maximumFractionDigits:2})} €`;if(DATA.useCustomPricing){const e=this.getCustomPricingElement();e?t.appendChild(e):t.innerHTML=s}else t.innerHTML=s;return e.appendChild(t),e}getCustomPricingElement(){const{pricingCustomJS:e,tagIsSafeEval:t}=DATA,s=t&&DATA_JS?.pricingCustomJS;return("function"==typeof s?s:new Function("result",e))(this.result)}}const fe="remove",ve="rebuild",xe="update";class Ce{constructor(e){let{baseClassName:t,infos:s,openFilters:a,openSort:i}=e;this.baseClassName=t,this.infos=s,this.openFilters=a,this.openSort=i,this.searchInfos=new me({baseClassName:t}),this.sortLabelElement=this.getSortLabelElement(),this.sortSelectElement=this.getSortSelectElement(),this.sortAndFiltersButtonElement=this.getSortAndFiltersButtonElement(),this.infosAndSortContainer=this.getInfoAndSortContainerElement(),this.infosAndSortContainer.appendChild(this.searchInfos.element),DATA.useFacetsList&&this.infosAndSortContainer.appendChild(this.sortAndFiltersButtonElement),this.setSortOptions(),ce.observable.subscribe(e=>{let{type:t}=e;switch(t){case U:case q:case J:case G:this.updateFiltersInfo();break;case V:this.updateSortValue();break;case W:this.updateFiltersInfo(),this.updateSortValue()}})}updateFiltersInfo(){let e=0;for(const t of Object.values(ce.state.filters))"object"==typeof t[0]?e++:e+=t.length;e?(this.filtersButtonElement.classList.add("active"),this.filtersButtonTextElement.textContent=`${e} ${D.getTranslation("Filter")}${e>1?"s":""}`):(this.filtersButtonElement.classList.remove("active"),this.filtersButtonTextElement.textContent=DATA.filtersButtonText||D.getTranslation("Filter"))}updateSortValue(){this.sortSelectElement.value=ce.state.sort[0]||"relevance"}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=`${D.getTranslation("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}getSortButtonElement(){const e=document.createElement("button");e.className=`${this.baseClassName}-search-sort-button`;const t=document.createElement("i");t.className=`${this.baseClassName}-search-sort-button-icon`,DATA.sortButtonIcon&&(t.style.maskImage=`url(${DATA.sortButtonIcon})`);const s=document.createElement("span");return s.className=`${this.baseClassName}-search-sort-button-text`,s.textContent=DATA.sortButtonText||D.getTranslation("Sort"),e.append(t,s),e.onclick=this.openSort,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`,DATA.filtersButtonIcon&&"https://widgets-images.abtasty.com/widgets-default-image.png"!==DATA.filtersButtonIcon&&(t.style.maskImage=`url(${DATA.filtersButtonIcon})`);const s=document.createElement("span");return s.className=`${this.baseClassName}-search-filters-button-text`,s.textContent=DATA.filtersButtonText||D.getTranslation("Filter"),e.append(t,s),e.onclick=this.openFilters,this.filtersButtonTextElement=s,e}getSortAndFiltersButtonElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-and-filters-button-container`;const t=this.getSortElement();return e.appendChild(t),this.filtersButtonElement=this.getFiltersButtonElement(),e.appendChild(this.filtersButtonElement),"2buttons"===DATA.filtersAndSort&&(this.sortButtonElement=this.getSortButtonElement(),e.appendChild(this.sortButtonElement)),e}setSortOptions(){this.sortSelectElement.childElementCount&&removeChildren(this.sortSelectElement);const e=M();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;ce.setPage(1),ae.clearResults(),ce.setSort(t)}}const ke=575.98;class Se{constructor(e){let{baseContainer:t,baseClassName:s,searchBar:a,onFiltersReset:i}=e;this.baseContainer=t,this.baseClassName=s,this.searchBar=a,this.onFiltersReset=i,this.searchResultContainer=this.getSearchResultContainerElement(),this.searchResultListContainer=this.getSearchResultListContainerElement(),this.searchResultList=this.getSearchResultListElement(),this.facetsList=new ye({baseContainer:this.baseContainer,baseClassName:this.baseClassName,searchResultsContainer:this.searchResultContainer,onFiltersReset:this.onFiltersReset}),this.infoAndSort=new Ce({baseClassName:this.baseClassName,infos:{totalHits:ce.state.totalHits},openFilters:this.facetsList.openFilters.bind(this.facetsList),openSort:this.facetsList.openSort.bind(this.facetsList)}),new MutationObserver(this.mutationCallback.bind(this)).observe(this.searchResultContainer,{childList:!0}),this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.resizeObserver.observe(this.baseContainer),this.isMobileLayout=window.innerWidth<=ke,ae.observable.subscribe(e=>{let{type:t,payload:s}=e;switch(t){case Z:this.onSetResults(ae.state.results,ae.state.facets);break;case Y:this.onUpdateResults(ae.state.results);break;case X:this.onAddResults(s)}})}onSetResults(e,t){if(this.baseContainer.classList.add("search-completed"),this.clearSearchResults(),e.length){DATA.useFacetsList&&this.facetsList.renderFacets(t),this.searchResultListContainer.appendChild(this.infoAndSort.infosAndSortContainer),DATA.groupBy&&DATA.groupByName?this.renderGroupedResultList(e):this.renderResultList(e),this.searchResultContainer.appendChild(this.searchResultListContainer),this.baseContainer.appendChild(this.searchResultContainer),this.lazyLoadImages();const s=this.baseContainer.getBoundingClientRect().top;this.baseContainer.style.height=`calc(100dvh - ${s}px)`,this.baseContainer.style.maxHeight=`calc(100dvh - ${s}px)`}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=D.getTranslation("No result found"),this.searchResultContainer.classList.add("abt-search-no-results"),this.searchResultContainer.appendChild(e)}this.searchResultContainer.classList.add("abt-search-visible"),this.baseContainer.appendChild(this.searchResultContainer),this.resultsChanged=!0}onAddResults(e){e.length&&(this.renderListItems(e),this.lazyLoadImages(),this.resultsChanged=!0)}onUpdateResults(e){if(this.searchResultContainer.classList.remove("abt-search-no-results"),DATA.groupBy&&DATA.groupByName)return this.updateGroupedSearchResults(e);B(this.searchResultList),e.length?(this.renderListItems(e),this.lazyLoadImages()):this.renderNoResults(),this.resultsChanged=!0}handleResize(e){const t=(e[0].contentRect.width||window.innerWidth)<=ke;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}lazyLoadImages(){let e=this.searchResultListContainer.querySelectorAll(".lazy");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const s=e.target;s.src=s.dataset.src,s.addEventListener("load",()=>{s.classList.remove("lazy"),t.unobserve(s)})}})},{root:this.baseContainer,rootMargin:"0px 0px 500px 0px"});e.forEach(e=>{t.observe(e)})}else{let t;const s=()=>{t&&clearTimeout(t),t=setTimeout(()=>{const t=window.scrollY;e.forEach(s=>{if(s.offsetTop<window.innerHeight+t+500){const t=s.dataset.src;s.src=t,s.classList.remove("lazy"),e=this.searchResultList.querySelectorAll(".lazy")}}),0==e.length&&(document.removeEventListener("scroll",s),window.removeEventListener("resize",s))},20)};document.addEventListener("scroll",s),window.addEventListener("resize",s)}}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}updateGroupedSearchResults(e){const t=this.searchResultListContainer.querySelectorAll(`.${this.baseClassName}-group-container`);for(const e of t)B(e);e.length?(this.renderGroupedResultList(e),this.lazyLoadImages()):this.renderNoResults(),this.resultsChanged=!0}renderGroupedResultList(e){const t=Object.groupBy(e,e=>e[DATA.groupByName]);let s=0;for(const[e,a]of Object.entries(t)){const t=document.createElement("div");t.className=`${this.baseClassName}-group-container`;const i=document.createElement("div");i.className=`${this.baseClassName}-group-name`,i.innerHTML=e,t.appendChild(i);const r=this.getSearchResultListElement();for(const e of a){const t=new we({result:e,index:s,baseClassName:this.baseClassName});r.appendChild(t.getSearchResultElement()),s++}t.appendChild(r),this.searchResultListContainer.appendChild(t)}}renderResultList(e){this.renderListItems(e),this.searchResultListContainer.appendChild(this.searchResultList)}renderListItems(e){for(const[t,s]of e.entries()){const e=new we({result:s,index:t,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}}renderNoResults(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=D.getTranslation("No result found"),this.searchResultContainer.classList.add("abt-search-no-results"),this.searchResultList.appendChild(e)}clearSearchResults(){B(this.searchResultList),B(this.searchResultListContainer),B(this.searchResultContainer),this.searchResultContainer.classList.remove("abt-search-visible","abt-search-no-results"),this.searchResultContainer.remove()}updateListFacets(e){this.facetsList.updateListFacets(e)}updateFacets(e){this.facetsList.updateFacets(e)}}function Ee(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 Ae(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(s),!0).forEach(function(t){$e(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ee(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function $e(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 Te="https://search-api.abtasty.com",Ne=DATA.groupBy?1e3:50,Re=["catégorie","catégories","category","type_category","category_name","categories"],Pe=e=>{const t=DATA.language,s=[];for(const a of e){let e=a.name,i=a.link;if(t&&(a.localized_title&&(e=JSON.parse(a.localized_title)[t]??a.name),a.localized_link&&(i=JSON.parse(a.localized_link)[t]??a.link)),a.title_front&&(e=a.title_front),i&&a.img_link&&a.price){const t={name:L(e),link:i,id:a.id,img_link:a.img_link,price:a.price,category:a.category||a.categories,rating:a.reviews_average||null,reviewsCount:a.reviews_count||null,strokePrice:a.stroke_price||null,caption:a.caption||a.brand||null,discount:a.discount_rate||null,recent:a.recency>=.9};DATA.groupBy&&DATA.groupByName&&(t[DATA.groupByName]=a[DATA.groupByName]),s.push(t)}}return s},Le=async e=>{if(!e)return null;const t=await e.json();return{results:Pe(t.hits),facets:t.facets,totalPages:t.totalPages,page:t.page,totalHits:t.totalHits}},Be=t=>{let{text:s,filters:a,sort:i,page:r,hitsPerPage:n,facets:o}=t;return Ae(Ae(Ae({index:DATA.meilisearchIndex||e(),text:s,facets:o||["*"],page:r,hitsPerPage:n||Ne,sort:"relevance"===i[0]?[]:i,limit:DATA.groupBy?1e3:void 0},Object.keys(a).length>0&&{filters:a}),DATA.useRecoAndMerch&&DATA.siteId&&DATA.merchandisingRecoId&&{siteId:Number(DATA.siteId),recoId:DATA.merchandisingRecoId}),DATA.useSemanticSearch&&{semanticRatio:DATA.semanticRatio})},Ie=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e&&e.aborted)throw new Error(e.reason);const t=()=>{};e&&e.addEventListener("abort",t,{once:!0});try{const t=await fetch(`${Te}/search`,{method:"POST",body:JSON.stringify(Be(ce.state)),signal:e});if(e&&e.aborted)throw new Error(e.reason);const s=await Le(t);if(e&&e.aborted)throw new Error(e.reason);return s}catch(e){return e.name,{results:[],facets:{},totalPages:0,page:1,totalHits:0}}finally{if(e&&e.removeEventListener("abort",t),e&&e.aborted)return null}},De=(e,t)=>{if(!e)return;const s=`${DATA.elementReferrer} input:not([type="hidden"])`;y(s,t)};class Oe{hasTriggeredSeeMore=!1;constructor(e){let{parentContainer:t}=e;this.parentContainer=t,this.baseClassName="abtasty-search-widget",this.searchOpen=!1,this.searchWidgetContainer=this.getSearchWidgetContainerElement(),this.ac=new AbortController}init(){this.searchBar=new le({baseContainer:this.searchWidgetContainer,baseClassName:this.baseClassName,onInput:this.debouncedOnInput.bind(this),closeSearchWidget:this.closeSearchWidget.bind(this)}),this.searchResultsList=new Se({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersReset:this.onFiltersReset.bind(this)}),this.getRecommendationsElement(),ce.observable.subscribe(e=>{let{type:t}=e;switch(t){case H:this.onTextChange();break;case U:this.onFilterChange(!1);break;case J:case q:this.onFilterChange(!0);break;case V:this.onSortChange();break;case K:this.onSeeMore();break;case W:this.onSearchReset()}})}onTextChange(){if(!ce.state.text)return ae.reset(),void ce.reset();(Object.keys(ce.state.filters).length||ce.state.page>1)&&ce.resetFiltersAndPagination(),this.searchBar.setResetIconVisibility(!0);try{DATA.useAutocomplete&&this.onAutocomplete(),this.onSearch()}catch(e){}}async onFilterChange(e){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const t=await(async()=>{const e=(()=>{const e=[],{text:t,filters:s,page:a,sort:i}=ce.state,r={text:t,filters:s,sort:i,page:a};return e.push(fetch(`${Te}/search`,{method:"POST",body:JSON.stringify(Be(Ae(Ae({},r),{},{hitsPerPage:Ne})))})),Object.entries(ae.state.facets).filter(e=>{let[t,s]=e;return"list"===s.type&&s.values.length>1}).filter(e=>{let[t]=e;return ce.state.filters[t]}).filter(e=>{let[t]=e;return!!ce.state.previousFilters[t]&&ce.state.previousFilters[t].length===ce.state.filters[t].length}).map(e=>{let[t]=e;return t}).forEach(t=>{const a=Ae({},s);delete a[t],e.push(fetch(`${Te}/search`,{method:"POST",body:JSON.stringify(Be(Ae(Ae({},r),{},{filters:a,facets:[t],hitsPerPage:Ne})))}))}),e})();try{const s=await Promise.all(e),a=await Promise.all(s.map(Le)),i={hits:Pe((t=a)[0].results),facets:t.reduce((e,t)=>Ae(Ae({},e),t.facets),{}),page:t[0].page,totalPages:t[0].totalPages,totalHits:t[0].totalHits};return{results:i.hits,facets:i.facets,totalPages:i.totalPages,page:i.page,totalHits:i.totalHits}}catch(e){}var t})();if(!t)return;const{results:s,facets:a,totalPages:i,totalHits:r}=t;if(e)for(const[e,t]of Object.entries(a))"range"===t.type&&delete a[e];const n=Object.keys(a).filter(e=>{const t=ce.state.previousFilters[e],s=ce.state.filters[e];return!s&&!t||!(s||!t)||!(s&&!t)&&s.length===t.length}).map(e=>e);for(const e of Object.keys(a))n.includes(e)||delete a[e];const o=z(a,ae.state.facets,!0);ae.updateResults(s),ae.updateFacets(a),ce.setTotalPages(i),ce.setTotalHits(r),e?this.searchResultsList.updateListFacets(o):this.searchResultsList.updateFacets(o),ce.setPreviousFilters(ce.state.filters)}async onSortChange(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const e=await(async()=>{try{return{results:(await Ie()).results}}catch(e){return"AbortError"===e.name?null:{results:[]}}})();if(!e)return;const{results:t}=e;ae.updateResults(t)}async onSeeMore(){const e=await(async()=>{try{const e=await Ie();return{results:e.results,totalPages:e.totalPages}}catch(e){return null}})();if(!e)return;this.hasTriggeredSeeMore=!1;const{results:t}=e;ae.addResults(t)}onSearchReset(){if(this.searchResultsList.clearSearchResults(),this.searchWidgetContainer.classList.remove("search-completed"),this.recommendationsContainer&&this.searchWidgetContainer.appendChild(this.recommendationsContainer),"absolute"===DATA.typeOfPositioning){const e=this.parentContainer.domElement.getBoundingClientRect().top;this.searchWidgetContainer.style.height="auto",this.searchWidgetContainer.style.maxHeight=`calc(100dvh - ${e+"px"})`}this.searchBar.setResetIconVisibility(!1),this.searchBar.resetInput(),this.searchBar.focusInput()}insert(e,t){return e.insertAdjacentElement(t,this.searchWidgetContainer),this}handleScroll(e){const t=e.target.scrollTop+e.target.clientHeight>=e.target.scrollHeight-500;!this.hasTriggeredSeeMore&&t&&ce.state.page<ce.state.totalPages&&(this.hasTriggeredSeeMore=!0,ce.setPage(ce.state.page+1))}resetSearch(){this.ac.abort("User reset"),this.ac=new AbortController,ae.reset(),ce.reset(),this.scrollToTop()}scrollToTop(){window.scrollY>0&&window.scroll({top:0,behavior:"smooth"}),this.searchWidgetContainer.scrollTop=0}openSearchWidget(){return!this.searchOpen&&(document.querySelector("body").classList.add("search-open"),this.searchOpen=!0,this.searchWidgetContainer.classList.add("open"),this.parentContainer.show(),!0)}closeSearchWidget(){document.querySelector("body").classList.remove("search-open"),this.searchWidgetContainer.classList.remove("open"),this.parentContainer.hide(),this.searchOpen=!1}onFiltersReset(){if(!ce.isNoFiltersAndNoSort()){ce.resetFiltersAndPagination();try{this.onSearch()}catch(e){}}}async onAutocomplete(){const e=await(async()=>{if(!DATA.autocompleteId)return null;try{const t=await fetch((e=ce.state.text,`${Te}/autocomplete?client_id=${DATA.autocompleteId}&query=${e}&hits_per_page=5`));return(await t.json()).suggestions.map(e=>e.text)}catch(e){return null}var e})();return e&&e.length?e:[]}onInput=e=>{ce.setText(e.target.value)};debouncedOnInput=(()=>(e=>{let t=null;return function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];window.clearTimeout(t),t=window.setTimeout(()=>{e(...a)},300)}})(this.onInput.bind(this)))();async onSearch(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;try{const e=await Ie(this.ac.signal);if(null===e)return;const{results:t,facets:s,totalPages:a,totalHits:i}=e;window.abtasty.send("event",{ec:"Action Tracking",ea:"search",el:ce.state.text,ev:i}),this.recommendationsContainer?.remove(),ce.setTotalPages(a),ce.setTotalHits(i),ae.setResults(t,s)}catch(e){}}getSearchWidgetContainerElement(){const e=document.createElement("div"),s=document.createElement("style"),a=document.createElement("style");t()&&(s.setAttribute("abtasty-script-added","true"),a.setAttribute("abtasty-script-added","true")),e.className=`${this.baseClassName}-container ${this.baseClassName}-container-${DATA.layout}`,!DATA.groupBy&&e.addEventListener("scroll",this.handleScroll.bind(this));const i=(r=this.parentContainer.widgetContainerId,n=this.parentContainer.contentClassName,[R(r,n),N(r,n),...DATA.useExpertMode?[DATA.containerCustomCss,DATA.searchBarCustomCss,DATA.filtersButtonCustomCss,DATA.sortButtonCustomCss,DATA.facetsCustomCss,DATA.searchResultCustomCss,DATA.searchResultCtaButtonCustomCss]:[S(),T(),A(r,n),E(r,n)]]);var r,n;const o=document.createTextNode("body.search-open{height:100vh!important;overflow:hidden!important}#algolia-autocomplete-container,.dfd-classic{display:none!important}div.abtasty-search-widget-side-panel-filters,div.abtasty-search-widget-side-panel-sort{background-color:#fff;bottom:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;overflow-x:hidden;padding:0 0 100px;position:fixed;right:-325px;top:0!important;-webkit-transition:.5s;transition:.5s;width:325px;z-index:12}div.abtasty-search-widget-side-panel-filters-overlay,div.abtasty-search-widget-side-panel-sort-overlay{background-color:rgba(0,0,0,.5);inset:0;position:fixed;z-index:11}div.abtasty-search-widget-side-panel-filters.open,div.abtasty-search-widget-side-panel-sort.open{right:0}div.abtasty-search-widget-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;container-name:widget-container;container-type:inline-size;display:none!important;-ms-flex-direction:column;flex-direction:column;font-family:inherit;line-height:1;overflow-y:auto;position:relative;z-index:102}div.abtasty-search-widget-overlay{background-color:rgba(0,0,0,.5);cursor:pointer;height:100vh;left:0;pointer-events:auto;position:absolute;width:100vw;z-index:1}div.abtasty-search-widget-container button.abtasty-search-widget-close-button{background-color:transparent;font-size:24px;margin:16px 16px -16px auto;position:absolute;right:0}div.abtasty-search-widget-container.open{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}div.abtasty-search-widget-container.abtasty-search-widget-container-popin{inset:0;position:fixed}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 button{border:none;cursor:pointer;font-size:inherit;line-height:1;min-height:unset;outline:none;padding:0;text-decoration:none;text-transform:none}div.abtasty-search-widget-container button.plain{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#3100bf;border:none;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:16px;justify-content:center;padding:8px;text-align:center;width:100%}div.abtasty-search-widget-container button.plain:not(:disabled){cursor:pointer}div.abtasty-search-widget-container button.plain.inverted{background-color:transparent;color:#3100bf}div.abtasty-search-widget-container button.plain.inverted:disabled{opacity:.5}div.abtasty-search-widget-container div.abtasty-search-widget-autocomplete-suggestions-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;margin:16px 48px -16px 16px;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-autocomplete-suggestion{background-color:transparent;border:1px solid #d8d8e2;border-radius:999px;cursor:pointer;font-size:13px;padding:4px 8px}div.abtasty-search-widget-container div.abtasty-search-widget-autocomplete-suggestion:hover{opacity:.5}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:1168px;padding-inline:32px;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{background-color:transparent;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;text-align:center;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:transparent!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;margin-inline:auto;-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:240px;min-width:240px;padding:16px 16px 50px 0}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;text-align:left}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:transparent;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;padding-bottom:20px;text-align:center}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner p{font-size:20.8px!important;font-size:1.3rem!important;font-weight:700!important;margin:0 16px}div.abtasty-search-widget-container h4.abtasty-search-widget-recommended-banner-title{font-family:Lato;margin:12px 16px 10px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner a.abtasty-search-widget-recommended-banner-cta{margin-top:16px;text-decoration:underline;text-decoration-thickness:0;text-underline-offset:4px}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!important}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-products-title{margin-bottom:24px;margin-top:0}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category{color:#2a2a3c;cursor:pointer;font-size:14px;font-weight:400;line-height:20px;text-transform:capitalize;white-space:nowrap}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.abt-search-visible{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:space-between;margin-inline:auto;max-width:1168px;padding-inline:32px;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;container-name:result-list;container-type:inline-size;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-list-container div.abtasty-search-widget-group-name{border-bottom:1px solid #d8d8e2;color:#2a2a3c;font-size:24px;font-weight:700;margin:16px 0;padding-bottom:4px;text-transform:uppercase}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container div.abtasty-search-widget-group-container div.abtasty-search-widget-search-result-list{margin-bottom: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:71.5px}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-decoration-thickness:0;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;background:unset;border:none;-webkit-box-shadow:none;box-shadow:none;color:#2a2a3c;cursor:pointer;font-size:13px;height:auto;line-height:1;outline:none;padding:0 24px 0 0;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:after{background-color:#2a2a3c;bottom:-10%;content:\"\";height:10px;-webkit-mask-image: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\");mask-image: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\");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute;right:10px;width: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,div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-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,div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button i.abtasty-search-widget-search-sort-button-icon{background-color:#2a2a3c;margin-right:8px;min-height:19px;min-width:19px}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon{-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\")}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-recommended-products-list{margin-top:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-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 div.abtasty-search-widget-search-result-card{border:1px solid #d8d8e2;border-radius:4px;color:inherit;display:block;position:relative;text-decoration:none!important}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-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;height:100%;padding:18px;width:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-card:hover{border-color:#a18cde}div.abtasty-search-widget-container a.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 a.abtasty-search-widget-search-result-image-container.no-cta:after{content:\"\";inset:0;position:absolute}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(+.abtasty-search-widget-search-result-caption),div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name:has(+.abtasty-search-widget-search-result-rating){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-caption{color:#2a2a3c;font-size:12px;font-weight:400;margin-bottom:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-caption:has(+div.abtasty-search-widget-search-result-rating){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-bottom-content{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-bottom-content,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{-webkit-box-orient:vertical;-webkit-box-direction:normal;color:#2a2a3c;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:18px;font-weight:700;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price span{font-size:14px;margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-additional-info-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin-left:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-stroke-price{color:#2a2a3c;font-size:14px;font-weight:400;text-decoration:line-through}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-stroke-price:has(+div.abtasty-search-widget-search-result-info-tag){margin-right:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-info-tag{background-color:#c0e505;border-radius:4px;color:#2a2a3c;font-size:14px;font-weight:400;padding:4px 8px}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-add-to-cart{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#3100bf;border:none;border-radius:4px;bottom:18px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:40px;outline:none;padding:0;position:absolute;right:18px;width:40px}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-add-to-cart .add-to-cart-content{content:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.799 1.651c0-.472.383-.855.855-.855h2.531A1.651 1.651 0 0 1 5.798 2.09l.496 1.89h15.265a1.651 1.651 0 0 1 1.618 1.949l-.004.017-1.302 6.356a1.635 1.635 0 0 1-1.626 1.35H8.27l.454 2.27h9.648a.855.855 0 0 1 0 1.71H8.675a1.651 1.651 0 0 1-1.618-1.321v-.004L4.8 5.027l-.662-2.52H1.654a.855.855 0 0 1-.855-.856Zm5.878 4.04 1.25 6.25H20.2l1.281-6.25H6.677Zm2.938 15.92a.059.059 0 1 0 0-.117.059.059 0 0 0 0 .118Zm-1.651-.058a1.651 1.651 0 1 1 3.302 0 1.651 1.651 0 0 1-3.302 0Zm9.611.059a.059.059 0 1 0 0-.118.059.059 0 0 0 0 .118Zm-1.65-.06a1.651 1.651 0 1 1 3.302 0 1.651 1.651 0 0 1-3.303 0Z' fill='%23FCFCFD'/%3E%3C/svg%3E\");margin-inline:auto}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-cta-button{margin-top:12px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:300px;min-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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet{background-color:transparent}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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet label.abtasty-search-widget-search-sort-label{text-align:center}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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet div.abtasty-search-widget-search-sort-options{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:20px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option:hover{background:revert}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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet div.abtasty-search-widget-search-sort-options button.abtasty-search-widget-search-sort-option{border-radius:4px;padding:18px 10px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active{background-color:#3100bf;opacity:1}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active .abtasty-search-widget-search-sort-option-label{color:#fff;mix-blend-mode:difference}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-header,div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-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 button.abtasty-search-widget-side-panel-close-button,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 button.abtasty-search-widget-side-panel-close-button i.abtasty-search-widget-close-icon{background-color:#2a2a3c}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{display:-webkit-box;display:-ms-flexbox;display:flex;gap:8px;padding:16px;-webkit-transition:.5s;transition:.5s}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{color:#2a2a3c;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{color:#fff;content:\"\\2713\";display:none;font-size:10px;inset:2.5px;position:absolute}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;text-transform:uppercase}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:#d8d8e2;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}@container result-list (width > 399.98px){@container widget-container (width > 576px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(2,minmax(0,1fr))}}}@container result-list (width > 749.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@container result-list (width > 1199.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(4,minmax(0,1fr))}}@container result-list (width > 1499.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(5,minmax(0,1fr))}}@container widget-container (width > 575.98px){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.abt-search-visible{max-width:704px}}@container widget-container (width > 767.98px){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.abt-search-visible{max-width:784px}}@container widget-container (width > 991.98px){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.abt-search-visible{max-width:1024px}}@container widget-container (width > 1199.98px){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.abt-search-visible{max-width:1168px}}@container widget-container (width <= 375px){div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-filters.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container,div.abtasty-search-widget-side-panel-filters.open,div.abtasty-search-widget-side-panel-sort.open{width:100%}}@container widget-container (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.abt-search-visible{max-width:100vw;padding-inline:16px}div.abtasty-search-widget-container{overflow-x:hidden}div.abtasty-search-widget-side-panel-filters,div.abtasty-search-widget-side-panel-sort{display:block}div.abtasty-search-widget-container button.abtasty-search-widget-close-button{margin-bottom:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{padding-bottom:16px;padding-top: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.abt-search-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}div.abtasty-search-widget-container a.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-bottom-content{margin-top:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-bottom-content:has(.abtasty-search-widget-search-result-info-tag){margin-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:column;flex-direction:column}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price span{margin-bottom:0;margin-right:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-additional-info-container{margin-left:0;margin-top:8px}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-add-to-cart{bottom:12px;right:12px}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,div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-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-side-panel-filters div.abtasty-search-widget-search-facets-list-bottom-buttons-container{background-color:#fff;border-top:1px solid #d8d8e2;bottom:0;position:fixed;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{display:none}div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-filters div.abtasty-search-widget-search-facets-list-bottom-buttons-container{-webkit-box-sizing:border-box;box-sizing:border-box;right:-325px;-webkit-transition:.5s;transition:.5s;width:325px}div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-filters.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container{right:0}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet{margin:0 16px}div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-header{display:-webkit-box;display:-ms-flexbox;display:flex}}@container widget-container (width <= 768px){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;min-width:240px}div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container{max-height:200px;max-width:200px;min-height:200px;min-width:200px}}@container widget-container (width <= 992px){div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container{max-height:147px;max-width:147px;min-height:147px;min-width:147px}}@container widget-container (width <= 375px){div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container{max-height:100px;max-width:100px;min-height:100px;min-width:100px}}");return s.appendChild(o),a.textContent=[...i,`.${this.parentContainer.hideClassName} {`,"display: none;","}"].join("").replaceAll("{{UNIQUE_ID}}",this.parentContainer.uniqueId),this.parentContainer.domElement.lastElementChild.after(s),this.parentContainer.domElement.lastElementChild.after(a),e}async getRecommendationsElement(){const t=document.createElement("div");t.className=`${this.baseClassName}-recommendations-container`;const s=await(async()=>{if(window.location.hostname.includes("palaisdesthes"))return[{name:"Matcha",redirectTo:"https://www.palaisdesthes.com/fr/thes/matcha/"},{name:"Jasmin",redirectTo:"https://www.palaisdesthes.com/fr/thes/parfumes/fleurs/jasmin/"},{name:"Menthe",redirectTo:"https://www.palaisdesthes.com/fr/thes/parfumes/menthe/"},{name:"Infusion",redirectTo:"https://www.palaisdesthes.com/fr/rooibos-infusions/"},{name:"Thé vert",redirectTo:"https://www.palaisdesthes.com/fr/thes/the-vert/"}];if(window.location.hostname.includes("mademoiselle-bio"))return[{name:"centifolia"},{name:"les secrets de loly"},{name:"madara"},{name:"cut by fred"},{name:"marlay"}];if(window.location.hostname.includes("lafeemaraboutee"))return[{name:"Best sellers",redirectTo:"https://lafeemaraboutee.fr/collections/best-sellers"},{name:"Nouveautés",redirectTo:"https://lafeemaraboutee.fr/collections/nouveautes"},{name:"Nouvelle collection",redirectTo:"https://lafeemaraboutee.fr/collections/nouvelle-collection"},{name:"Robes & Combinaisons",redirectTo:"https://lafeemaraboutee.fr/collections/robes-combinaisons"},{name:"Sélection engagée",redirectTo:"https://lafeemaraboutee.fr/collections/un-nouveau-souffle"}];const t={index:DATA.meilisearchIndex||e(),text:"",facets:["*"],hitsPerPage:1},s=e=>Re.includes(e);try{const e=await fetch(`${Te}/search`,{method:"POST",body:JSON.stringify(t)});if(200!==e.status)return null;const a=await e.json();for(const[e,t]of Object.entries(a.facets))if(s(e))return t.values.sort((e,t)=>t[1]-e[1]).filter(e=>"wishlist"!==e[0]).slice(0,4).map(e=>({name:D.getTranslation(e[0])}));return[]}catch(e){return null}})();if(s&&s.length){const e=document.createElement("div");e.className=`${this.baseClassName}-recommended-categories-container`;const a=document.createElement("h3");a.className=`${this.baseClassName}-recommended-categories-title`;const i=window.location.hostname.includes("mademoiselle-bio"),r=window.location.hostname.includes("palaisdesthes");i||r?(a.innerHTML=D.getTranslation("Recherches populaires"),r&&(a.style.fontFamily="Lato")):window.location.hostname.includes("lafeemaraboutee")?a.innerHTML=D.getTranslation("Découvrez nos collections"):a.innerHTML=D.getTranslation("Categories"),e.appendChild(a);const n=document.createElement("div");n.className=`${this.baseClassName}-recommended-categories-list`;for(const e of s){const{name:t,redirectTo:s}=e,a=document.createElement("div");if(a.className=`${this.baseClassName}-recommended-category`,a.innerHTML=t,s){const e=document.createElement("a");a.style.position="relative",e.style.position="absolute",e.style.inset="0",e.style.width="100%",e.style.height="100%",e.href=s,a.appendChild(e)}else a.onclick=()=>{const{layout:e,elementReferrer:s}=DATA,a=g(s);"free"===e?De(a,e=>{e.value=t,ce.setText(t)}):(this.searchBar?.setInputValue(t),ce.setText(t))};n.appendChild(a)}e.appendChild(n),t.appendChild(e)}let a=null;a=DATA.useMarketBanners?this.getMarketBannersElement():await this.getProductRecommendationsElement(),a&&t.appendChild(a),this.recommendationsContainer=t,this.searchWidgetContainer.appendChild(this.recommendationsContainer)}async getProductRecommendationsElement(){const e=await(async()=>{if(!DATA.useRecoAndMerch)return null;const e=DATA.siteId,t=DATA.recommendationsRecoId,s=DATA.recoAndMerchApiKey;if(!e||!t||!s)return null;const[a,i]=((e,t,s)=>[`https://uc-info.eu.abtasty.com/v1/reco/${t}/recos/${e}?fields=%5B%22id%22,%22absolute_link%22,%22name%22,%22img_link%22,%22price%22%5D`,{Authorization:"Bearer "+s}])(t,e,s);try{const e=await fetch(a,{method:"GET",headers:i});return(await e.json()).items.map(e=>({id:e.id,name:L(e.name),price:e.price,img_link:e.img_link,link:e.absolute_link}))}catch(e){return null}})();if(e&&e.length){const t=document.createElement("div");t.className=`${this.baseClassName}-recommended-products-container`;const s=document.createElement("h3");s.className=`${this.baseClassName}-recommended-products-title`,s.innerHTML=D.getTranslation("Recommended Products");const a=document.createElement("div");a.className=`${this.baseClassName}-recommended-products-list`;for(const[t,s]of e.entries()){const e=new we({isRecommendedProduct:!0,result:s,index:t,baseClassName:this.baseClassName});a.appendChild(e.getSearchResultElement())}return t.appendChild(s),t.appendChild(a),t}return null}getMarketBannersElement(){const{marketBanner1Banner:e,marketBanner2Banner:t,marketBanner3Banner:s,marketBanner1Title:a,marketBanner2Title:i,marketBanner3Title:r,marketBanner1Subtitle:n,marketBanner2Subtitle:o,marketBanner3Subtitle:c,marketBanner1Link:l,marketBanner2Link:d,marketBanner3Link:h,marketBanner1CtaText:u,marketBanner2CtaText:g,marketBanner3CtaText:b}=DATA,m=document.createElement("div");m.className=`${this.baseClassName}-recommended-products-container`;const p=[];e&&p.push({title:a,subtitle:n,imageSrc:e,link:l,ctaText:u}),t&&p.push({title:i,subtitle:o,imageSrc:t,link:d,ctaText:g}),s&&p.push({title:r,subtitle:c,imageSrc:s,link:h,ctaText:b});const y=document.createElement("div");y.className=`${this.baseClassName}-recommended-products-list`;for(const e of p){const t=document.createElement("div");t.className=`${this.baseClassName}-recommended-banner`;const s=document.createElement("h4");s.className=`${this.baseClassName}-recommended-banner-title`,s.innerHTML=e.title;const a=document.createElement("p");a.className=`${this.baseClassName}-recommended-banner-subtitle`,a.innerHTML=e.subtitle;const i=document.createElement("a");i.className=`${this.baseClassName}-recommended-banner-cta`,i.innerHTML=e.ctaText;const r=document.createElement("img");r.src=e.imageSrc,e.link&&(i.href=e.link,t.onclick=()=>{window.location.href=e.link},t.style.cursor="pointer"),t.appendChild(r),t.appendChild(s),t.appendChild(a),t.appendChild(i),y.appendChild(t)}return m.appendChild(y),m}}function Fe(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 je(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(s),!0).forEach(function(t){Me(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Fe(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function Me(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}class ze extends Oe{constructor(e){super(je(je({},e),{},{layout:"popin"})),this.target=g(DATA.elementReferrer)}init(){super.init(),this.searchWidgetContainer.appendChild(this.searchBar.searchBarContainer);const e=document.querySelector(`#${this.parentContainer.widgetContainerId} .${this.parentContainer.overlayClassName}`);e&&(e.style.backgroundColor=DATA.overlayColor,e.style.pointerEvents="all",e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.closeSearchWidget()}))}openSearchWidget(){super.openSearchWidget(),t()||this.searchBar.focusInput()}}function We(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 He(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?We(Object(s),!0).forEach(function(t){_e(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):We(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function _e(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}class Ve extends Oe{constructor(e){super(He(He({},e),{},{layout:"free"}))}initResizeObserver(){this.resizeObserver=new ResizeObserver(()=>{this.correctWidgetPosition()});const{elementReferrer:e}=DATA,t=g(e);t&&this.resizeObserver.observe(t)}init(){super.init();const e=document.createElement("button");e.className=`${this.baseClassName}-close-button`,e.innerHTML="✕",e.onclick=()=>{this.closeSearchWidget()},this.searchWidgetContainer.insertAdjacentElement("afterbegin",e),this.initResizeObserver()}registerInputEvents(e){const t=e.closest("form");t&&(t.addEventListener("reset",e=>{e.preventDefault(),e.stopPropagation(),this.resetSearch()}),t.action=void 0,t.dataset=void 0),e.addEventListener("click",e=>{e.target.value,e.preventDefault(),e.stopPropagation()},{capture:!0}),e.addEventListener("focusin",e=>{e.target.value,e.preventDefault(),e.stopPropagation(),e.target.value=e.target.value.trim(),e.target.value||(this.openSearchWidget(),setTimeout(()=>{this.resetSearch(),this.scrollToTop()},50))},{capture:!0}),e.addEventListener("input",e=>{e.target.value,e.target.value?(this.searchOpen||this.openSearchWidget(),this.debouncedOnInput(e)):this.resetSearch()},{passive:!0}),e.addEventListener("change",e=>{e.preventDefault(),e.stopPropagation()},{capture:!0})}correctWidgetPosition(){const{elementReferrer:e}=DATA,t=g(e),s=g(`#${this.parentContainer.widgetContainerId}`);if(!t||!s)return;const{bottom:a}=t.getBoundingClientRect(),{top:i}=s.getBoundingClientRect();a!==i&&("absolute"!==DATA.typeOfPositioning?(s.style.position="relative",s.style.top=`${a}px`,this.searchWidgetContainer.style.height=`calc(100dvh - ${a}px)`,this.searchWidgetContainer.style.maxHeight=`calc(100dvh - ${a}px)`,this.searchResultsList.facetsList.setMaxHeight(a)):s.style.position="absolute")}handleClickOutside(e){const{target:t}=e;this.searchBar.searchBarContainer.contains(t)||this.searchWidgetContainer.contains(t)||this.closeSearchWidget()}openSearchWidget(){if(!super.openSearchWidget())return!1;document.addEventListener("click",this.handleClickOutside.bind(this)),DATA.useOverlay&&(this.searchWidgetOverlay=this.getSearchWidgetOverlayElement(),this.searchWidgetContainer.insertAdjacentElement("afterend",this.searchWidgetOverlay))}closeSearchWidget(){this.searchWidgetOverlay?.remove(),document.removeEventListener("click",this.handleClickOutside.bind(this)),super.closeSearchWidget()}async onAutocomplete(){const e=await super.onAutocomplete();this.suggestionsContainer?B(this.suggestionsContainer):(this.suggestionsContainer=document.createElement("div"),this.suggestionsContainer.className=`${this.baseClassName}-autocomplete-suggestions-container`);for(const t of e){const e=document.createElement("div");e.className=`${this.baseClassName}-autocomplete-suggestion`,e.innerHTML=t,e.title=t,e.onclick=()=>{const{elementReferrer:e}=DATA,s=g(e);De(s,e=>{e.value=t,ce.setText(t)})},this.suggestionsContainer.appendChild(e)}this.searchWidgetContainer.insertAdjacentElement("afterbegin",this.suggestionsContainer)}resetSearch(){this.suggestionsContainer&&this.suggestionsContainer.remove(),super.resetSearch()}getSearchWidgetOverlayElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-overlay`,e.style.top=this.searchWidgetContainer.getBoundingClientRect().top+"px",e.style.backgroundColor=DATA.overlayColor,e.onclick=e=>{e.preventDefault(),e.stopPropagation(),this.closeSearchWidget()},e}}class Ue{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=null,this.mutationObserver=null,this.mouseOverEvent=null,this.scrollEvent=null,this.onTransitionEnd=null,this.onIframeLoad=null}transitionOverHandler(e){const t=[e,"transitionend",this.checkElements.bind(this),!0];return this.getEvents(...t)}intersectionHandler(e){e.forEach(e=>{e.isIntersecting?(this.existingTargets.forEach(t=>{t.element.isSameNode(e.target)&&(this.inViewportTargets.push(t),this.mouseOverEvent.start(),this.scrollEvent.start(),this.onTransitionEnd.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(t=>!t.element.isSameNode(e.target)||(this.mouseOverEvent.clear(),this.scrollEvent.clear(),this.onTransitionEnd.clear(),!1))})}startVisibilityObserver(e){const t={root:e,rootMargin:"0px",threshold:.01};return this.visibilityObserver??=new IntersectionObserver(this.intersectionHandler.bind(this),t),this.visibilityObserver}startMutationObserver(e){return this.mutationObserver??=new MutationObserver(this.checkElements.bind(this)),this.mutationObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}),this.mutationObserver}onMouseOver({target:e,path:t}){const s=this.inViewportTargets.find(({element:s,selector:a})=>{if(s.isSameNode(e))return!0;const[i,,r]=a.split("[]"),n=r??i,o=[...e.querySelectorAll(n)];if(o.length&&o.includes(s))return!0;if(t.includes(s))return!0;if(!e.parentElement?.children?.length)return;const c=[...e.parentElement.children],l=c.findIndex(t=>t.isSameNode(e)),d=c.filter((e,t)=>t>l);if(d.length){if(d.includes(s))return!0;if(d.some(e=>[...e.querySelectorAll(n)].includes(s)))return!0}return!1});if(s&&this.isElementVisible(s.element)){const{selector:e,element:t,uniqueId:a}=s,i=this.targets.find(t=>t.selector===e&&t.uniqueId===a);i&&i.resolve(t),this.clear(e,a)}}getEvents(e,...t){return{start:()=>e?.addEventListener(...t),clear:()=>e?.removeEventListener(...t)}}mouseOverHandler(e){const t=[e,"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?"touchmove":"mouseover",e=>{const t=e.composedPath(),{target:s}=e;setTimeout(()=>this.onMouseOver({target:s,path:t}),50)},!0];return this.getEvents(...t)}scrollEventHandler(e){const t=[e,"scroll",(s=this.checkElements.bind(this),()=>{v||(v=!0,setTimeout(()=>{s(),v=!1},100))}),{passive:!0}];var s;return this.getEvents(...t)}isElementVisible(e){return this.isElementOpaque(e)&&this.isElementTopmost(e)}isElementOpaque(e){return"HTML"===w(e,e=>"0"===window.getComputedStyle(e).opacity).nodeName}isElementTopmost(e){const t=e.getBoundingClientRect(),s=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom],[t.left+t.width/2,t.top],[t.left+t.width/2,t.bottom],[t.left,t.height/2],[t.right,t.height/2],[t.left+t.left/2,t.height/2]];let a=!1,i=0;for(;!a&&i<s.length;){const t=e.getRootNode()?.elementFromPoint(...s[i]);a=e===t||t?.contains(e)||e.contains(t),i+=1}return a}checkElements(){this.targets.forEach(({selector:e,uniqueId:t})=>{const s=g(e),[a,,i]=e.split("[]"),r=i??a;s&&!this.existingTargets.find(e=>e.element.matches(r)&&e.uniqueId===t)&&(this.existingTargets.push({element:s,selector:e,uniqueId:t}),this.visibilityObserver.observe(s))}),this.existingTargets=this.existingTargets.filter(({selector:e,element:t})=>!(!g(e)||!t.isConnected)||(t&&this.visibilityObserver.unobserve(t),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:e,element:t,uniqueId:s})=>{const[a,,i]=e.split("[]"),r=i??a;if(t.matches(r)&&this.isElementVisible(t)){const a=this.targets.find(t=>t.selector===e&&t.uniqueId===s);return a&&a.resolve(t),this.clear(e,s),!1}return!0})}onLoadIframe(e){const t=[e.defaultView.frameElement,"load",()=>this.watch(selector,resolve,uniqueId).bind(this),{passive:!0}];return this.getEvents(...t)}watch(e,t,s){this.targets.push({selector:e,resolve:t,uniqueId:s});const{clear:a}=y(e,e=>{a();const t=e.getRootNode({composed:!0}),s="body"in t?t.body:document;this.mouseOverEvent=this.mouseOverHandler(t),this.scrollEvent=this.scrollEventHandler(t),this.onTransitionEnd=this.transitionOverHandler(t),t.defaultView?.frameElement&&(this.onIframeLoad=this.onLoadIframe(t),this.onIframeLoad.start()),this.startVisibilityObserver(t),this.startMutationObserver(s),this.checkElements()})}clear(e,t){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(s=>s.filter(({selector:s,uniqueId:a})=>s!==e&&a!==t));const s=g(e);s&&this.visibilityObserver?.unobserve(s),0===this.targets.length&&(this.mutationObserver?.disconnect(),this.onIframeLoad?.clear()),0===this.inViewportTargets.length&&(this.mouseOverEvent?.clear(),this.scrollEvent?.clear(),this.onTransitionEnd?.clear())}}const qe="ABTastyData";class Je{constructor({triggerEvent:e,triggerSelector:t,triggerDelay:s,triggerTarget:a}){this.event=e,this.selector=Boolean(t)?t:"body",this.target="string"==typeof a?g(t):a,this.delay=1e3*s,this.triggerElements=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.promises=[],this.visibilityObservers=[],this.socialProofStore={},this.elementWaiters=[]}async onElementVisible({promise:e,resolve:t}){const s=h(`${this.event}DomReady`);this.promises.push(s);const{clear:a}=y(this.selector,()=>{const e=new Ue;this.visibilityObservers.push(e),e.watch(this.selector,t,l())});return this.elementWaiters.push(a),e}onPageLoad({promise:e,resolve:t}){const s=()=>"complete"===document.readyState;if(!s()){const a=["readystatechange",()=>s()&&t(!0),{passive:!0}];return this.eventsListeners.push([document,...a]),document.addEventListener(...a),e}return t(!0),e}onClick({promise:e,resolve:t}){const s=({isTrusted:e,target:s})=>{if(e)return(s.isEqualNode(this.target)||f(s,this.selector))&&t(!0)},{clear:a}=y(this.selector,e=>{a();const t=document.createElement("style");t.id=`Click_${l()}`;const[i,,r]=this.selector.split("[]"),n=r??i;t.innerHTML=`${n} {\n\t\t\t\tcursor: pointer !important;\n\t\t\t\tpointer-events: all !important;\n\t\t\t}`;const o=e.getRootNode();("head"in o?o.head:o).appendChild(t),this.triggerElements.push(t);const c=["click",s,{passive:!0,capture:!0}];this.eventsListeners.push([o,...c]),o.addEventListener(...c)});return this.elementWaiters.push(a),e}onHover({promise:e,resolve:t}){const s=({isTrusted:e,target:s})=>{if(e)return(this.target?s.isEqualNode(this.target):f(s,this.selector))&&t(!0)},{clear:a}=y(this.selector,e=>{const t=e.getRootNode(),a="body"in t?t.body:[...t.childNodes].find(t=>t.contains(e)),i=["mouseenter",s,{passive:!0,capture:!0}];this.eventsListeners.push([a,...i]),a.addEventListener(...i)});return this.elementWaiters.push(a),e}onExitIntent({promise:e,resolve:t}){const s=["mouseleave",({isTrusted:e,clientY:s})=>{e&&s<=0&&t(!0)},{passive:!0}],{clear:a}=y("html",e=>{a(),this.eventsListeners.push([e,...s]),e.addEventListener(...s)});return e}onReengage({promise:e,resolve:t}){const s=this.delay;let a=s;const i=[...document.querySelectorAll("*:empty")].map(e=>e.contentDocument||e.shadowRoot).filter(e=>e),r=[({isTrusted:e})=>{e&&(a=s)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(e=>{[document,...i].forEach(t=>{this.eventsListeners.push([t,e,...r]),t.addEventListener(e,...r)})});const n=setInterval(()=>{a<=0?t(!0):a-=100},100);return this.intervals.push(n),e}onCustomTrigger({promise:e,resolve:t}){const{triggerEventCustomScript:s,tagIsSafeEval:a}=DATA,i=a&&DATA_JS?.triggerEventCustomScript,r="function"==typeof i?()=>new Promise(e=>i(e)):new Function(`return new Promise(async resolve => {${s}})`);return r().then(e=>e&&t(!0)),e}onScrollUp({promise:e,resolve:t}){let s=0;const a=["scroll",({isTrusted:e})=>{e&&(window.scrollY<s?t(!0):s=window.scrollY)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...a]),document.addEventListener(...a),e}onScrollPercentReached({promise:e,resolve:t}){const{triggerEventScrollPercent:s}=DATA,a=["scroll",({isTrusted:e})=>{if(!e)return;const a=(()=>{const{documentElement:e,body:t}=document,s=e.scrollTop||t.scrollTop,a=e.scrollHeight||t.scrollHeight;return Math.trunc(s/(a-e.clientHeight)*100,10)})();s<a&&t(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...a]),document.addEventListener(...a),e}checkSocialProofConditions(t,s,a,i){const r=e(),{viewInterval:n,spNoTrim:o}=DATA;if(this.socialProofStore.hasOwnProperty(t))a(this.socialProofStore[t])?i(`${this.socialProofStore[t][n]}`):i(!1);else if(t&&r){const e=e=>(this.socialProofStore[t]=e,i(!!a(e)&&`${e[n]}`));fetch(`https://api-social-proof.abtasty.com/clients/${r}/metrics/${s}?key=${t}${o?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e).catch(()=>d("Failed to fetch datas from server."))}else i(!1)}getSocialProofDatas({promise:e,resolve:t},s,r=!1){const{productKey:n,keyType:o}=(()=>{const{socialProofContentType:e,productKeyProvider:t,pathToProductKey:s,customJSProductKey:r,productSKU:n,tagIsSafeEval:o}=DATA,{pathToProductKey:c,customJSProductKey:l}=o&&DATA_JS||{};if(2===e)return{productKey:i(),keyType:"url"};{let o=null,d="sku";switch(t){case"ABTastyProductKey":o=window.ABTastyProductKey;break;case"pathToProductKey":o="function"==typeof c?c():a(`return ${s};`);break;case"customJSProductKey":o="function"==typeof l?l():a(r);break;case"productSKU":o=n}return o||3!==e||(o=i(),d="url"),{productKey:o,keyType:d}}})(),{viewInterval:c,triggerSocialProofMinVisitors:l,triggerSocialProofMinPurchases:h,triggerSocialProofMinPageViews:u}=DATA,g={pv:u,i:h,"v-pv":l}[s];return[typeof c,typeof g].includes("undefined")&&t(!1),r&&!n&&(d("Not able to find ABTastyProductKey, impossible to call the API, read documentation for more informations:\n\t\t\t\thttps://support.abtasty.com/hc/en-us/articles/4710919241628-Widgets-List#h_84c04344-c655-4e5e-b9ab-d26a798ad9b0"),t(!1)),this.checkSocialProofConditions(n,"v-pv"===s&&"sku"===o?"v-i":s,e=>{const t=void 0!==e[c]&&e[c]>=g;return t||d(`Widget will not be shown, Social Proof API returned ${e[c]} while ${g} are required`),t},t),e}onConsent({promise:e,resolve:t}){if(!n()){const s=["abtasty_consentValid",()=>t(!0)];return this.eventsListeners.push(s),window.addEventListener(...s),e}return t(!0),e}onTrackingSent({promise:e,resolve:t}){const{triggerEventTrackingSent:s}=DATA;let a=localStorage.getItem(qe);const i=()=>JSON.parse(a)?.ActionTracking?.some(({name:e})=>e===s),r=["storage",({key:e,newValue:s})=>{e===qe&&(a=s,i()&&t(!0))},{passive:!0,capture:!0}];return a&&i()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onMinPagesViewed({promise:e,resolve:t}){const{triggerEventMinPagesViewed:s}=DATA;let a=localStorage.getItem(qe);const i=()=>s<=(a?JSON.parse(a)?.VisitedPages?.length:0),r=["storage",({key:e,newValue:s})=>{e===qe&&(a=s,i()&&t(!0))},{passive:!0,capture:!0}];return a&&i()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onRageClick({promise:e,resolve:t}){const{triggerEventRageClickQuantity:s,triggerEventRageClickDelay:a}=DATA;let i=0,r=!1;const n=["click",({isTrusted:e})=>{if(e&&(i+=1,i>=s&&t(!0),!r)){r=!0;const e=setTimeout(()=>{i=0,r=!1},a);this.timeouts.push(e)}},{passive:!0,capture:!0}],o=e=>{this.eventsListeners.push([e,...n]),e.addEventListener(...n)},{clear:c}=y("iframe []contentDocument[] body > *",()=>{const e=document.getElementsByTagName("iframe");for(const t of e){"contentDocument"in t&&"body"in t.contentDocument&&o(t.contentDocument);const e=()=>o(t.contentDocument);t.addEventListener("load",e),this.eventsListeners.push([t,"onIframeLoad",e])}});return this.elementWaiters.push(c),o(document),e}clear(){this.triggerElements=this.triggerElements.filter(e=>(e.remove(),!1)),this.eventsListeners=this.eventsListeners.filter(e=>{const[t,...s]=e;return t&&s.length>1&&t.removeEventListener(...s),!1}),this.timeouts=this.timeouts.filter(e=>(clearTimeout(e),!1)),this.intervals=this.intervals.filter(e=>(clearInterval(e),!1));const e=l();return this.visibilityObservers=this.visibilityObservers.filter(t=>(t.clear(this.selector,e),!1)),this.promises=this.promises.filter(e=>(e.resolve(!1),!1)),this.elementWaiters=this.elementWaiters.filter(e=>(e(),!1)),this}async isTriggered(){this.clear();const e=h(this.event);this.promises.push(e);const t={consent:()=>this.onConsent(e),direct:()=>!0,pageLoad:()=>this.onPageLoad(e),click:()=>this.onClick(e),exitIntent:()=>this.onExitIntent(e),reengage:()=>this.onReengage(e),elementVisible:()=>this.onElementVisible(e),script:()=>this.onCustomTrigger(e),hover:()=>this.onHover(e),scrollUp:()=>this.onScrollUp(e),scrollPercent:()=>this.onScrollPercentReached(e),rageClick:()=>this.onRageClick(e),minPagesViewed:()=>this.onMinPagesViewed(e),trackingSent:()=>this.onTrackingSent(e),socialProofPurchases:()=>this.getSocialProofDatas(e,"i",!0),socialProofPageViews:()=>this.getSocialProofDatas(e,"pv"),socialProofVisitors:()=>this.getSocialProofDatas(e,"v-pv")},s=!Object.prototype.hasOwnProperty.call(t,this.event)||await t[this.event]();return s&&this.clear(),"reengage"!==this.event&&this.delay?s&&await(async()=>{const e=h(`${this.event}Delay`);this.promises.push(e);const t=setTimeout(()=>{e.resolve(!0),this.clear()},this.delay);return this.timeouts.push(t),e.promise})():s}}const Ge="display",Ke="closing",Ze="validation",Ye="ABTastyWidgets",Xe=`${Ye}Temporary`;class Qe{constructor({displayRecurrence:e,closingRecurrence:t,validationRecurrence:s},a){this.displayRecurrence=parseFloat(e),this.closingRecurrence=parseFloat(t),this.validationRecurrence=parseFloat(s),this.onSetCallback=a,this.widgetName=o(),this.uniqueId=l(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:e}){const t=localStorage.getItem(Xe),s=sessionStorage.getItem(Ye);"ABTastyData"===e&&!t&&s&&localStorage.setItem(Xe,s)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(e){try{const t=e.getItem(Ye);return JSON.parse(t)}catch(t){return e.removeItem(Ye),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(e,t){const{[this.recurrenceKey]:s,...a}=t;return Object.entries(a).length?(e.setItem(Ye,JSON.stringify(a)),a):(e.removeItem(Ye),!1)}removeSessionRecurrenceStorage(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}removeLocalRecurrenceStorage(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}getSessionRecurrence(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getLocalRecurrence(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}isOver(){const e=localStorage.getItem(Xe),t=!(!e||!e.includes(this.recurrenceKey))||this.getSessionRecurrence();e&&(sessionStorage.setItem(Ye,e),localStorage.removeItem(Xe));const s=this.getLocalRecurrence(),a=(s?parseFloat(s.stamp):0)<(new Date).getTime();return a&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&a&&!this.getLocalRecurrence()&&!t}setRecurrence(e,t){0!==e&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const a=this.getTypeOfStorage(e);if(s()||!a&&"object"!=typeof a)return!1;const{storageString:i,storageMethod:r}=a,o=this.getStamp(e),c={type:t,stamp:o},{type:l}=this.getCurrentRecurrence(),d=async()=>{if(!n()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=c;const e=new Je({triggerEvent:"consent"});await e.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();let s;"session"===i?e?s=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),s=this.getSessionRecurrenceStorageParsed()):"local"===i&&(t?s=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),s=this.getLocalRecurrenceStorageParsed()));const a=s?{[this.recurrenceKey]:c,...s}:{[this.recurrenceKey]:c};r.setItem(Ye,JSON.stringify(a)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!r)return!1;if(l&&t!==Ze)if(t===Ke&&l!==Ze)d();else{if(t!==Ge||l===Ze||l===Ke)return!1;d()}else d();return o}setDisplayRecurrence(){const e=Ge;this.setRecurrence(this.displayRecurrence,e)}setClosingRecurrence(){const e=Ke;this.setRecurrence(this.closingRecurrence,e)}setValidationRecurrence(){const e=Ze;this.setRecurrence(this.validationRecurrence,e)}getStamp(e){return(new Date).getTime()+864e5*e}getTypeOfStorage(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}class et{constructor(e,t,s){this.isWidgetApplied=e,this.callback=t,this.shouldUpdate=s,this.triggerIframeTarget=null,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.tagRollbackEventParams=["abtasty_resetActionTracking",this.onTagRollback.bind(this)],this.onCampaignLaunchedEventParams=["abtasty_executedCampaign",this.onCampaignLaunched.bind(this)]}decisionHandler(e){const t=!e&&this.isWidgetApplied(),s=t?this.shouldUpdate&&xe:ve;return s?(this.clearWatcher(),this.callback(s,!e,t),this.watch(),this):this}onCampaignLaunched({detail:{campaignId:e}}){e===TEST_ID&&(this.callback(ve,!1),this.watch())}onTagRollback({target:e}){return this.clearWatcher(e),this.callback(fe,!1,!0),window.addEventListener(...this.onCampaignLaunchedEventParams),this}observerHandler(e){return r()?e.some(e=>["removedNodes","addedNodes"].some(t=>e[t]&&e[t].length))?this.decisionHandler():this:this.callback(fe,!1)}watch(e,s){if(t())return this;if(this.clearWatcher(e),window.removeEventListener(...this.onCampaignLaunchedEventParams),document.addEventListener(...this.tagRollbackEventParams),s?.includes("[]contentDocument[]")){const e=s.split("[]")[0].trim(),{clear:t}=y(e,e=>{t(),this.triggerIframeTarget=e,e.addEventListener("load",this.decisionHandler.bind(this))})}const a=e?.defaultView?.frameElement;a&&this.triggerIframeTarget!==a&&a.addEventListener("load",this.decisionHandler.bind(this));const{clear:i}=y("body",t=>{i();const s=e?.body||e||t;this.observer.observe(s,{childList:!0,subtree:!0})});return this}clearTriggerElementWatcher(){this.triggerIframeTarget?.removeEventListener("load",this.decisionHandler.bind(this))}clearWatcher(e){return document.removeEventListener(...this.tagRollbackEventParams),this.observer.disconnect(),this.clearTriggerElementWatcher(),e?.defaultView?.frameElement?.removeEventListener("load",this.decisionHandler.bind(this)),this}}const tt=/.+\/([^.]+)\.(otf|ttf)$/,st=["socialProofPurchases","socialProofPageViews","socialProofVisitors"];class at{constructor(e,s){this.children=void 0,this.uniqueId=`${l()}${s?`_${s}`:""}`,this.widgetName=o(),this.prettyName=c(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:s,validationRecurrence:a}=DATA,i=!e&&!s&&!a;if(t()||i)return!1;const r={everytime:()=>-1,session:()=>0,once:()=>395,day:e=>DATA[`${e}_day`],week:e=>7*DATA[`${e}_week`],month:e=>30.5*DATA[`${e}_month`]},n={};return e&&(n.displayRecurrence=r[e]("displayRecurrence")),s&&(n.closingRecurrence=r[s]("closingRecurrence")),a&&(n.validationRecurrence=r[a]("validationRecurrence")),n})(),this.triggerParams=(e=>{let{triggerEvent:s}=DATA;const{triggerEventClick:a,triggerEventHover:i,triggerEventReengageDelay:r,socialProofContentType:n,triggerEventElementVisible:o,triggerEventDelay:c}=DATA;if(t()||!s&&!n)return!1;const l={click:()=>a,hover:()=>i,elementVisible:()=>o},d=Object.prototype.hasOwnProperty.call(l,s)?l[s]():"body",h="reengage"===s?r:c;return n&&(s=[,"socialProofPurchases","socialProofPageViews","socialProofVisitors"][n]),{triggerEvent:s,triggerSelector:d,triggerDelay:h,triggerTarget:e}})(e),this.recurrence=!!this.recurrenceParams&&new Qe(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new Je(this.triggerParams),this.shouldUpdate=!!this.triggerParams&&st.includes(this.triggerParams.triggerEvent),this.pageWatcher=new et(this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:e,triggerEvent:t}=DATA;return!t||!["click","hover","scrollUp","script"].includes(t)||e})(),this.basicClassName=`ab_widget_container_${this.widgetName}`,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=`${this.basicClassName}_content`,this.overlayClassName=`${this.basicClassName}_overlay`,this.closeButtonClassName=`${this.basicClassName}_close_button`,this.hideClassName=`ab_hide_${this.uniqueId}`,this.rootElement=null,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.elementsWaiters=[]}clearGivenClearables(){for(const e of this.elementsWaiters)e.clear();this.elementsWaiters=[]}isWidgetApplied(){return this.domElement?.isConnected&&this.domElement.ownerDocument?.defaultView}removeOldDomElement(){const e=this.rootElement?.getElementById(this.widgetContainerId);return e?.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const e=["free"];"drawer"===DATA.layout&&DATA.customTarget&&e.push("drawer");const t=e.includes(DATA.layout);return new Promise(e=>{const{elementReferrer:s="body",referrerInsertType:a="beforeend"}=t?DATA:{},i=y(s,t=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e.selector!==s),this.rootElement=t.getRootNode(),this.removeOldDomElement(),this.domElement.appendChild(this.styleElement),e(t.insertAdjacentElement(a,this.domElement))});this.elementsWaiters.push(i)}).then(()=>this)}remove(){this.trigger&&this.trigger.clear(),this.pageWatcher.clearWatcher(this.rootElement);for(const e of this.elementsWaiters)[DATA.elementReferrer,"body"].includes(e.selector)&&e.clear();return this.domElement?.isConnected&&this.domElement.remove(),this.hasOncePerPageTrigger?this.pageWatcher.watch(this.rootElement):t()||this.init().then(({response:e})=>e?this.show():this),this}show(){return t()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,setTimeout(()=>this.domElement.classList.remove(this.hideClassName),50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(this.rootElement),this}hide(e=!0){return!t()&&this.hasBeenShown&&e&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),e&&(this.pageWatcher.clearWatcher(this.rootElement),this.closedByUser=!0),this.domElement.classList.add(this.hideClassName),this}async init(e){const s=t(),a=r(),i=this.trigger?.promises?.length,n=!this.recurrence||this.recurrence.isOver();if(!s&&!a||i||!n)return{container:this,response:!1};this.pageWatcher.watch(this.rootElement||document,this.triggerParams.triggerSelector);const o=s||!this.trigger||this.trigger&&await this.trigger.isTriggered();this.pageWatcher.clearTriggerElementWatcher();const c={container:this,response:o};return o?(await this.insert(),this.addCloseEvent(),s||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(o),c):c}onPageChange(e,t,s){const a=()=>this.init().then(({response:e})=>{e?this.show():this.hide(!1)});t||(this.hasBeenShown=!1,s&&this.domElement.remove(),this.trigger&&this.trigger.clear());const i={[fe]:()=>s?this.remove():this.pageWatcher.watch(this.rootElement),[ve]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):s||this.insert().then(e=>e.show()).catch(this.pageWatcher.watch):a()},[xe]:()=>{this.hasBeenShown?this.pageWatcher.watch():a()}};"function"==typeof i[e]&&i[e]()}addCloseEvent(...e){const{closeButton:s,overlay:a,overlayClickable:i,layout:r,animationDuration:n=1e3}=DATA,o=[];if(void 0!==a&&!0!==a||!0!==i||"popin"!==r||o.push(`.${this.overlayClassName}`),void 0!==s&&s&&o.push(`.${this.closeButtonClassName}`),!o.length)return this;const c=this.domElement.querySelectorAll(o.join(", "));if(!c.length)return this;const l=["click",e=>{(e=>{t()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())})(e),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(!0),setTimeout(()=>this.remove(),1.05*n)},{once:!0,capture:!0}];e.push(...c);for(const s of e)t()&&(s.dataset.abtastyActionnable="true"),s.removeEventListener(...l),s.addEventListener(...l);return this}getDom(){const{closeButton:e,layout:t,overlayClickable:s,overlay:a=!0}=DATA,i=document.createElement("div");return i.className=`${this.basicClassName} ${this.hideClassName}`,i.id=this.widgetContainerId,["popin","bannerTop","bannerBottom"].includes(t)&&(i.role="dialog"),i.innerHTML=`\n\t\t\t${"popin"===t&&!0===a?`<div ${s?'aria-label="Close dialog"':""} class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${e?`<button class="${this.closeButtonClassName}" aria-label="Close dialog"><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,i}loadFont(e,t){if(!e||"inherit"===e||!/otf|ttf/g.test(t))return;const s=document.createElement("style"),a=t.match(tt)?t.match(tt)[1]:"";s.innerHTML=`@font-face { font-family: '${e}_${a}'; src: url('${t}'); font-display: swap; }`;const i=this.rootElement?.head||document.head;i?.appendChild(s)}getStyleTag(e="",s=DATA){const{noStyles:a,layout:i}=s,{backgroundColor:r,isBackgroundImage:n,backgroundImage:o,backgroundSize:c,backgroundPosition:l,backgroundRepeat:d,borderColor:h,borderRadius:u,borderWidth:g,textColor:b,textAlign:m,fontName:p,fontStyle:y,fontSize:w,isTitle:f,titleTextAlign:v,titleTextColor:x,titleFontName:C,titleFontStyle:k,titleFontSize:S,overlay:E,overlayColor:A,dropShadow:T,dropShadowColor:N,dropShadowBlur:R,containerMargin:P,containerPadding:L,closeButton:B,closeButtonPosition:I,closeButtonSize:D,closeButtonBorderRadius:O,closeButtonBorderWidth:F,closeButtonBorderColor:j,closeButtonColor:M,closeButtonBackgroundColor:z,buttonsAlign:W,buttonsBorderWidth:H,buttonsBorderColor:_,buttonsBorderRadius:V,buttonsBackgroundColor:U,buttonsTextColor:q,buttonsFontName:J,buttonsFontStyle:G,buttonsFontSize:K,secondLink:Z,secondLinkBorderWidth:Y,secondLinkBorderColor:X,secondLinkBorderRadius:Q,secondLinkBackgroundColor:ee,secondLinkTextColor:te,secondLinkFontName:se,secondLinkFontStyle:ae,secondLinkFontSize:ie,animation:re,animationDuration:ne,animationBehaviour:oe,animationSlideDirection:ce}=a?{}:s,le=document.createElement("style");t()&&le.setAttribute("abtasty-script-added","true"),this.loadFont(p,y),this.loadFont(C,k),this.loadFont(J,G),this.loadFont(se,ae);const de=`background: ${["string"==typeof r?r:"rgba(255, 255, 255, 1)",n&&"string"==typeof o&&o.length?`url(${o})`:"",n&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",n&&"string"==typeof c?`/ ${c}`:"/ auto",n&&d&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,he="number"==typeof g&&g>0,ue=`border: ${[he?`${g}px`:"unset",he?"solid":"",he&&"string"==typeof h&&h.length?h:""].join(" ").trim()};`,ge=void 0!==u?`border-radius: ${u}px;`:"",be=void 0!==b?`color: ${b}; fill: ${b}; -webkit-text-fill-color: ${b};`:"",me=void 0!==m?`text-align: ${m};`:"",pe=p&&"inherit"!==p?`font-family:${p}_${y.match(tt)?y.match(tt)[1]:""};`:y||"",ye=w?`font-size: ${w}px;`:"",we=void 0!==T&&T?`box-shadow: 0 5px ${R}px 0 ${N};`:"",fe=P instanceof Array&&1===P.length&&P[0],ve=fe?`margin: ${fe.top}px ${fe.right}px ${fe.bottom}px ${fe.left}px;`:"",xe=fe?`margin: calc(${fe.top}px * 0.5) calc(${fe.right}px * 0.5) calc(${fe.bottom}px * 0.5) calc(${fe.left}px * 0.5);`:"",Ce=L instanceof Array&&1===L.length&&L[0],ke=Ce?`padding: ${Ce.top}px ${Ce.right}px ${Ce.bottom}px ${Ce.left}px;`:"",Se=Ce?`padding: calc(${Ce.top}px * 0.5) calc(${Ce.right}px * 0.5) calc(${Ce.bottom}px * 0.5) calc(${Ce.left}px * 0.5);`:"",Ee=void 0!==H&&H?`border-width: ${H}px; border-style: solid;`:"",Ae=[_,H].every(e=>void 0!==e)&&H?`border-color: ${_};`:"",$e=void 0!==V?`border-radius: ${V}px;`:"",Te=void 0!==U?`background-color: ${U};`:"",Ne=void 0!==q?`color: ${q}; fill: ${q}; -webkit-text-fill-color: ${q};`:"",Re=J&&"inherit"!==J?`font-family:${J}_${G.match(tt)?G.match(tt)[1]:""};`:G||"",Pe=K?`font-size: ${K}px;`:"",Le="number"==typeof Y?`border-width: ${Y}px; border-style: solid;`:"",Be=[X,Y].every(e=>void 0!==e)&&Y?`border-color: ${X};`:"",Ie=void 0!==Q?`border-radius: ${Q}px;`:"",De=void 0!==ee?`background-color: ${ee};`:"",Oe=void 0!==te?`color: ${te}; fill: ${te}; -webkit-text-fill-color: ${te};`:"",Fe=se&&"inherit"!==se?`font-family:${se}_${ae.match(tt)?ae.match(tt)[1]:""};`:ae||"",je=ie?`font-size: ${ie}px;`:"",Me="popin"!==i||void 0!==E&&!0!==E?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==A?A:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),ze="number"==typeof D?D:16,We=ze/2,He=a||void 0!==B&&B?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===I?`bottom: calc(100% + ${We}px)`:`top: ${We}px`)+";",`right: ${We}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof O?`border-radius: ${O}px;`:"","number"==typeof F&&F>0?`border: ${F}px solid ${void 0!==j?j:"rgba(57, 57, 57, 1)"};`:"","string"==typeof z?`background-color: ${z};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${ze}px;`,`height: ${ze}px;`,"string"==typeof M?`fill: ${M};`:"","}"].join(""):"",_e=f&&"string"==typeof x?[`#${this.widgetContainerId} .${this.contentClassName} > * h1, `,`#${this.widgetContainerId} .${this.contentClassName} > * h2, `,`#${this.widgetContainerId} .${this.contentClassName} > * h3, `,`#${this.widgetContainerId} .${this.contentClassName} > * h4, `,`#${this.widgetContainerId} .${this.contentClassName} > * h5, `,`#${this.widgetContainerId} .${this.contentClassName} > * h6 {`,`color: ${x}; fill: ${x}; -webkit-text-fill-color: ${x};`,void 0!==v?`text-align: ${v};`:"",C&&"inherit"!==C?`font-family:${C}_${k.match(tt)?k.match(tt)[1]:""};`:k||"",S?`font-size: ${S}px;`:"","}"].join(""):"";let Ve="";if("string"==typeof re){const e=(ne/1e3).toFixed(2),s=["top","bottom"].includes(ce),a=Number(s),i=[(["top","left"].includes(ce)?"-":"")+"100vmax",this.translateValues?this.translateValues[a]:"0"];s&&i.reverse(),Ve={none:[`.${this.hideClassName} {`,"opacity: 0 !important;","}"],fade:[`.${this.hideClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} {`,`transition: opacity ${e}s ${oe};`,"}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${e}s ${oe};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${i.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${e}s ${oe};`,"}"]}[t()&&!ABTASTY_S.WIDGETS.animationChanged?"none":re].join("")}const Ue=[`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,`margin-${"fill"===W?"top":"left"}: 8px;`,Le,Be,Ie,De,Oe,Fe,je,"}",`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,Oe,Fe,je,"}"];return le.textContent=[`#${this.widgetContainerId} style { display: none; }`,`.${this.hideClassName} {`,"pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,de,ge,ue,be,me,we,ve,pe,ye,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,be,me,pe,ye,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",ke,pe,ye,"}",`#${this.widgetContainerId} .${this.contentClassName} a {`,"text-decoration: underline;","}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a, `,`#${this.widgetContainerId} .${this.contentClassName} button {`,"text-decoration: none;","box-sizing: border-box;","display: inline-block;",Ee,Ae,$e,Te,Ne,Re,Pe,"}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a *:not(.second_link span), `,`#${this.widgetContainerId} .${this.contentClassName} button:not([class*="close_button"], [class*="csatEmojiButton"]) * {`,Ne,Re,Pe,"}",...Z?Ue:[],"@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,xe,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,Se,"}","}",Me,He,_e,Ve,`${e}`].join(""),le}}class it extends at{constructor(e,t){super(e,t),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const rt=["top: 0;","top: 50%;","bottom: 0;"],nt=["left: 0;","left: 50%;","right: 0;"],ot=e=>1===e?"-50%":0,ct=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:e,y:t}]}=DATA,s=`translate(${ot(t)}, ${ot(e)});`;return`${rt[e]}${nt[t]}transform: ${s}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},lt=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,dt=()=>{if(lt())return"width: auto; height: auto; min-width: fit-content;";const{popinPercentWidth:e,popinPixelsWidth:t,widthUnit:s,autoHeight:a,popinPercentHeight:i,popinPixelsHeight:r,heightUnit:n}=DATA;return`width: ${"px"===s?t:e}${s};height: ${a?"auto":`${"px"===n?r:i}${n}`};`};class ht extends at{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(e=>ot(e)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:e,zindexCustom:t,widthUnit:s}=DATA,a="string"!=typeof DATA.overlay&&DATA.overlay;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===e?t:e};`,"background: none;","pointer-events: "+(a?"all":"none"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",ct(),dt(),"pointer-events: all","}",`${lt()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${!lt()&&["px","em"].includes(s)?["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join(""):""}`].join("")}}(async()=>{d("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:s}of e){if(!t||"inherit"===t||!/otf|ttf/g.test(s))continue;const e=document.createElement("style"),a=s.match(x)?s.match(x)[1]:"";e.innerHTML=`@font-face { font-family: '${t}_${a}'; src: url('${s}'); font-display: swap; }`,document.head.appendChild(e)}})(),void 0===DATA.layout&&Object.assign(DATA,{layout:"popin",popinPosition:[{x:0,y:0}],popinPercentWidth:100,popinPercentHeight:100,widthUnit:"vw",heightUnit:"vh",zindex:9999,autoWidth:!1,autoHeight:!1});const e="free"===DATA.layout?new it:new ht,s={parentContainer:e},a="free"===DATA.layout?new Ve(s):new ze(s);return e.init(!0).then(s=>{let{response:i}=s;if(i){const s=e.domElement.querySelector(`.${e.contentClassName}`);a.init(),a.insert(s,"beforeend");const{elementReferrer:i}=DATA;y(i,e=>{if("free"===DATA.layout)De(e,e=>{const t=e.cloneNode(!0);a.registerInputEvents(t),e.parentElement.replaceChild(t,e)});else{if(!e)return;"static"===getComputedStyle(e).position&&(e.style.position="relative");const t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.backgroundColor="transparent",t.style.cursor="pointer",t.style.zIndex="10",t.style.display="block",t.onclick=e=>{e?.preventDefault?.(),e?.stopPropagation?.(),a.openSearchWidget()},e.appendChild(t)}});const r=!!document.querySelector(".abtasty-search-widget-container")?.classList.contains("open");t()&&t()&&top.document.documentElement.classList.contains("widget-react-form-opened")&&!r?a.openSearchWidget():t()&&r&&a.closeSearchWidget()}}),a})().then(()=>{})}();
|
|
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"),s=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},a=e=>new Function(`try {\n\t\t${e}\n\t} catch (error) {\n\t\treturn null;\n\t}`)(),i=()=>encodeURIComponent(DATA.spNoTrim?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),r=()=>!t()&&(s()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),n=()=>window.ABTasty&&!0===window.ABTasty.consentReady,o=()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`},c=()=>{const e=o();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")},l=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,d=e=>{const a=(()=>{if(t()||s())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),i=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(a||i){const t=c();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;")}},h=e=>{const t={promise:null,resolve:null,reject:null,name:e};return t.promise=new Promise((e,s)=>{t.resolve=e,t.reject=s}),t},u=(e,t)=>{const s=t?[]:null;if("string"!=typeof e||!e.trim().length)return s;const[a,i,r]=e.split("[]").map(e=>e.trim()),n=Boolean(r)?r:e,o=i?document.querySelector(a)?.[i]:document;return o?t?[...o.querySelectorAll(n)]:o.querySelector(n):s},g=e=>u(e,!1),b=e=>u(e,!0),m=(e,t)=>{const s={childList:!0,subtree:!0,attributes:!0},a=()=>i.disconnect(),i=new MutationObserver(()=>{const s=g(t);return s&&!a()&&e(s)});return{clear:a,observe:e=>{const t=document.querySelector("body")||document.documentElement,a=e??t;i.observe(a,s)}}},p=()=>{},y=(e,s)=>{const a=g(e),i={selector:e,clear:p,observe:p};if(a)return setTimeout(()=>s(a),0),i;if(t())return setTimeout(()=>y(e,s),1e3),i;if(e.includes("[]"))return((e,t)=>{const[s,a]=t.split("[]").map(e=>e.trim()),i=g(s),r=i?.[a],{clear:n,observe:o}=m(e,t),c=()=>{const s=g(t);return s&&!l()&&e(s)},l=()=>{n(),i?.removeEventListener("load",c)},d=()=>{o(r),"iframe"===i?.localName&&i.addEventListener("load",c)};return d(),{selector:t,clear:l,observe:d}})(s,e);const{clear:r,observe:n}=m(s,e);return n(),{selector:e,clear:r,observe:n}};function w(e,t){const s=e.parentElement||e.getRootNode().host;return t(e)||!s?e:w(s,t)}const f=(e,t)=>[...b(t)].some(s=>{const[a,,i]=t.split("[]"),r=i??a;return s===e||!!e.closest(r)});let v=!1;const x=/.+\/([^.]+)\.(otf|ttf)$/,C=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(x)?t.match(x)[1]:""};`:t||"",k=e=>{const t=e instanceof Array&&1===e.length&&e[0];return t?`padding: ${t.top}px ${t.right}px ${t.bottom}px ${t.left}px;`:""},S=function(e,t,s){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{borderRadius:i}=DATA,r="number"==typeof t&&t>0;return!r&&a?{borderStyle:"border: unset;",borderRadiusStyle:""}:{borderStyle:`border: ${[r?`${t}px`:"",r?"solid":"",r&&"string"==typeof e&&e.length?e:""].join(" ").trim()};`,borderRadiusStyle:void 0!==s||i?`border-radius: ${s||i}px;`:""}},E=()=>{const{primaryColor:e,textColor:t,searchBarBackgroundColor:s,searchBarCloseIconColor:a,searchBarInputWidth:i,searchBarInputWidthUnit:r,searchBarInputSearchIconColor:n,searchBarInputBackgroundColor:o,searchBarInputAlign:c,searchBarInputFontName:l,searchBarInputFontSize:d,searchBarInputFontStyle:h,searchBarInputCustomFontColor:u,searchBarInputTextColor:g,searchBarInputBorderRadius:b,searchBarInputBorderWidth:m,searchBarInputPadding:p,searchBarInputAndSearchIconMargin:y}=DATA,w=C(l,h);return["@container widget-container (width > 576px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container {",`background-color: ${s};`,"}","}","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container {",`max-width: ${i}${r};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar {",`background-color: ${o};`,`border-color: ${e};`,b?`border-radius: ${b}px;`:"",m?`border-width: ${m}px;`:"border: unset;",k(p),"}","div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon {",`background-color: ${a};`,"}","div.abtasty-search-widget-container input.abtasty-search-widget-search-input {",`text-align: ${c};`,w,`font-size: ${d}px;`,u?`color: ${g};`:`color: ${t};`,"}","div.abtasty-search-widget-container i.abtasty-search-widget-search-icon {",`margin-right: ${y}px;`,`background-color: ${n};`,"}"].join("")},A=(e,t)=>{const{backgroundColor:s,textColor:a,secondaryTextColor:i,facetSectionTitleAlign:r,facetSectionTitleFontName:n,facetSectionTitleFontSize:o,facetSectionTitleFontStyle:c,facetSectionTitleCustomFontColor:l,facetSectionTitleTextColor:d,facetTitleAlign:h,facetTitleFontName:u,facetTitleFontSize:g,facetTitleFontStyle:b,facetTitleCustomFontColor:m,facetTitleTextColor:p,borderRadius:y,filtersButtonBackgroundColor:w,filtersButtonTextColor:f,filtersButtonBorderColor:v,filtersButtonBorderWidth:x,filtersButtonBorderRadius:E,filtersButtonPadding:A,sortButtonPadding:T,sortButtonBackgroundColor:N,sortButtonTextColor:R,sortButtonBorderColor:P,sortButtonBorderWidth:L,sortButtonBorderRadius:B}=DATA,I=C(n,c),D=C(u,b),O=l?`color: ${d};`:`color: ${a};`,F=m?`color: ${p};`:`color: ${i};`,{borderStyle:j,borderRadiusStyle:M}=S(v,x,E),{borderStyle:z,borderRadiusStyle:W}=S(P,L,B),H=f?`color: ${f};`:`color: ${a};`,_=R?`color: ${R};`:`color: ${a};`,V=k(A);return["div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary {",`text-align: ${r};`,I,`font-size: ${o}px;`,O,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container {",`text-align: ${h};`,D,`font-size: ${g}px;`,F,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button {",`background-color: ${N||s};`,z,W,_,k(T),"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active,","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button {","display: flex;",`background-color: ${w||s};`,H,j,M,V,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon,","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon {",f?`background-color: ${f};`:`background-color: ${a};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button i.abtasty-search-widget-search-sort-button-icon {",R?`background-color: ${R};`:`background-color: ${a};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active {",H,"}","@container widget-container (width <= 575.98px) {",`#${e} .${t} div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${y}px;`,"}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},T=(e,t)=>{const{primaryColor:s,secondaryTextColor:a,textColor:i,searchResultNameAlign:r,searchResultNameFontName:n,searchResultNameFontSize:o,searchResultNameFontStyle:c,searchResultNameCustomFontColor:l,searchResultNameTextColor:d,searchResultCaptionAlign:h,searchResultPriceAlign:u,searchResultPriceFontName:g,searchResultPriceFontSize:b,searchResultPriceFontStyle:m,searchResultPriceCustomFontColor:p,searchResultPriceTextColor:y,searchResultBackgroundColor:w,searchResultBorderColor:f,searchResultBorderWidth:v,searchResultBorderRadius:x,searchResultCaptionCustomFontColor:k,searchResultCaptionTextColor:E,searchResultCaptionFontName:A,searchResultCaptionFontStyle:T,searchResultCaptionFontSize:N,searchResultCtaButtonBackgroundColor:R,searchResultCtaButtonTextColor:P,searchResultCtaButtonBorderColor:L,searchResultCtaButtonBorderWidth:B,searchResultCtaButtonBorderRadius:I,searchResultCaptionUppercase:D,searchResultCtaButtonPadding:O,searchResultCtaButtonFontSize:F,searchResultCtaButtonFontName:j,searchResultCtaButtonFontStyle:M}=DATA,z=C(n,c),W=C(A,T),H=C(g,m),_=C(j,M),V=l?`color: ${d};`:`color: ${i};`,U=k?`color: ${E};`:`color: ${i};`,q=p?`color: ${y};`:`color: ${i};`,J=P?`color: ${P};`:`color: ${s};`,{borderStyle:G,borderRadiusStyle:K}=S("#D8D8E2",v,x,!0),{borderStyle:Z,borderRadiusStyle:X}=S(L,B,I),Y=window.location.hostname.includes("palaisdesthes");return["div.abtasty-search-widget-container div.abtasty-search-widget-search-result-card {",`background-color: ${w};`,G,K,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-card:hover {",`border-color: ${f||s};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-content {","center"===r?"align-items: center;":"","}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name {",`text-align: ${r};`,z,`font-size: ${o}px;`,V,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-caption {",`text-align: ${h};`,U,`font-size: ${N}px;`,W,D?"text-transform: uppercase;":"","}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price {",`text-align: ${u};`,H,`font-size: ${b}px;`,q,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price span {",`color: ${a};`,"}",`#${e} .${t} button.abtasty-search-widget-search-result-add-to-cart {`,"display: flex;",`background-color: ${s};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-result-cta-button {",`background-color: ${R};`,_,J,Z,X,O&&1===O.length&&O[0]?`padding: ${O[0].top}px ${O[0].right}px ${O[0].bottom}px ${O[0].left}px;`:"",`font-size: ${F}px;`,"}",...Y?["@container widget-container (width <= 575.98px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-result {","display: flex;","flex-direction: column;","}","div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container {","margin-inline: auto;","margin-bottom: 12px;","}","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-list {","flex-direction: row;","}","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:not(:last-child)::after {","content: '|';","margin-inline: 6px;","}","}"]:[]].join("")},N=()=>{if(!DATA.useMarketBanners)return"";const{marketBannerBackgroundColor:e,marketBannerBorderColor:t,marketBannerBorderWidth:s,marketBannerBorderRadius:a,marketBannerTextColor:i}=DATA,{borderStyle:r,borderRadiusStyle:n}=S(t,s,a);return["div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner {",`color: ${i};`,"}","@container widget-container (width <= 575.98px) {","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner {",`background-color: ${e};`,r,n,"}","}"].join("")},R=(e,t)=>{const{freeCustomZIndex:s,primaryColor:a,backgroundColor:i,borderRadius:r,fullWidth:n,dropShadow:o,dropShadowColor:c,dropShadowBlur:l,containerBorderColor:d,containerBorderWidth:h,containerBorderRadius:u}=DATA,g=`color: ${i};`,b=`color: ${a};`,m=void 0!==o&&o?`box-shadow: 0 5px ${l}px 0 ${c};`:"",{borderStyle:p,borderRadiusStyle:y}=S(d,h,u,!0);return[`#${e} {`,`z-index: ${s};`,"}",`#${e} .${t} {`,"text-align: left !important;","-webkit-text-fill-color: currentColor !important;","fill: currentColor !important;","}",`#${e} .${t} button {`,"display: block;","}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-close-button:hover {`,"background: transparent;","}","div.abtasty-search-widget-container {",`background-color: ${i};`,m,p,y,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container {",DATA.useFacetsList?"":"padding-left: 0;","}",`#${e} .${t} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button,`,`#${e} .${t} button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} button.abtasty-search-widget-search-filters-button {`,"display: none;","}",`#${e} .${t} button.abtasty-search-widget-side-panel-close-button,`,`#${e} .${t} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button {`,"display: flex;","}","div.abtasty-search-widget-container button.plain {",`background-color: ${a};`,g,`border-radius: ${r}px;`,"}","div.abtasty-search-widget-container button.plain.inverted {",b,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more {",b,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active,","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress {",`background-color: ${a};`,"}",`#${e} .${t} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,`background-color: ${a};`,`border-color: ${a};`,g,"}","div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark:after,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value {",g,"}",...n?["div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,","div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible,","div.abtasty-search-widget-container div.abtasty-search-widget-search-container {","padding-inline: 16px;","margin-inline: 0 !important;","max-width: unset !important;","}"]:[],"@container widget-container (width <= 575.98px) {",`#${e} .${t} div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${r}px;`,"}",`#${e} .${t} div.abtasty-search-widget-container button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},P=(e,t)=>{const{layout:s,typeOfPositioning:a}=DATA;return[..."free"===s&&"absolute"===a?[`#${e} .${t} {`,"width: 100vw;","}","div.abtasty-search-widget-container {","left: 50%;","transform: translateX(-50%);","width: 80vw;","}","@media (max-width: 375.98px) {","div.abtasty-search-widget-container {","width: 90vw;","left: unset;","}","}"]:[],"div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,","div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list {",`padding-top: ${"popin"===DATA.layout?"16px":"32px"};`,"}","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 {",`padding-top: ${"popin"===s?"32px":"48px"};`,"}","@container widget-container (width <= 575.98px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container {",`padding-top: ${"popin"===s?"16px":"48px"};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-container {","padding-top: 0px;","}","}"].join("")},L={searchResultMainInformationOrderName:"name",searchResultMainInformationOrderRating:"rating",searchResultMainInformationOrderCaption:"caption",searchResultMainInformationOrderPrice:"price"},B=e=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`,I=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)};class D{constructor(){this.observers=[]}subscribe(e){this.observers.push(e)}unsubscribe(e){this.observers=this.observers.filter(t=>t!==e)}notify(e){this.observers.forEach(t=>t(e))}}const O=new class{constructor(){this.translationKeys={}}init(){try{const e=JSON.parse(DATA.translationKeys);this.translationKeys=e}catch(e){}}getTranslation(e){const t=this.translationKeys[e];return t&&""!==t?t:e}};function F(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 j(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?F(Object(s),!0).forEach(function(t){M(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):F(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function M(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}O.init();const z=()=>[{value:"relevance",label:O.getTranslation("Relevance")},{value:"price:asc",label:`↑ ${O.getTranslation("Price")}`},{value:"price:desc",label:`↓ ${O.getTranslation("Price")}`}],W=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.entries(e).reduce((e,t)=>{let[a,i]=t;return e[a]&&(Array.isArray(e[a].values)?e[a]=j(j({},i),{},{values:e[a].values.map(e=>{let[t,a]=e;const r=i.values.find(e=>{let[s]=e;return s===t});return r?[t,r[1]]:[t,s?0:a]})}):e[a]=j(j({},i),{},{min:e[a].values.min,max:e[a].values.max})),e},j({},t))},H="RESET",_="SET_TEXT",V="SET_TOTAL_HITS",U="SET_SORT",q="SET_LIST_FILTERS",J="SET_RANGE_FILTERS",G="REMOVE_RANGE_FILTERS",K="RESET_FILTERS",Z="GET_NEXT_PAGE",X="SET_RESULTS",Y="UPDATE_RESULTS",Q="ADD_RESULTS";function ee(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 te(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(s),!0).forEach(function(t){se(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ee(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function se(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 ae={results:[],facets:{}},ie=function(){let e=te({},ae);const t=new D;return te({get state(){return e},get observable(){return t}},{logState(t){JSON.parse(JSON.stringify(e))},setResults(s,a){e.results=s,e.facets=a,t.notify({type:X}),this.logState("setResults")},updateResults(s){e.results=s,t.notify({type:Y}),this.logState("updateResults")},setFacets(s){e.facets=s,t.notify({type:"SET_FACETS"}),this.logState("setFacets")},addResults(s){e.results=[...e.results,...s],t.notify({type:Q,payload:s}),this.logState("addResults")},updateFacets(t){const s=W(t,e.facets,!0);this.setFacets(s),this.logState("updateFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=te({},ae),this.logState("reset")}})}();function re(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 ne(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?re(Object(s),!0).forEach(function(t){oe(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):re(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function oe(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 ce={text:"",previousFilters:{},filters:{},sort:["relevance"],page:1,totalPages:0,totalHits:0},le=function(){let e=ne({},ce);const t=new D;return ne({get state(){return e},get observable(){return t},isNoFiltersAndNoSort:()=>0===Object.keys(e.filters).length&&"relevance"===e.sort[0]},{logState(t){JSON.parse(JSON.stringify(e))},setText(s){e.text=s,t.notify({type:_}),this.logState("setText")},setPage(s){e.page=s,e.page<=e.totalPages&&t.notify({type:Z}),this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(s){e.totalHits=s,t.notify({type:V}),this.logState("setTotalHits")},setSort(s){e.sort=""===s?[]:[s],t.notify({type:U}),this.logState("setSort")},updateRangeFilter(s,a,i){e.filters[s]=[{operator:">=",value:a},{operator:"<=",value:i}],t.notify({type:J}),this.logState("updateRangeFilter")},removeRangeFilter(s){const a=ne({},e.filters);delete a[s],e.filters=a,t.notify({type:G}),this.logState("removeRangeFilter")},updateFilterArray(s,a,i){const r=ne({},e.filters);i?r[s]=[...r[s]||[],a]:(r[s].length&&(r[s]=r[s].filter(e=>e!==a)),0===r[s].length&&delete r[s]),e.filters=r,this.logState("updateFilterArray"),t.notify({type:q})},setPreviousFilters(t){e.previousFilters=t,this.logState("setPreviousFilters")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},t.notify({type:K}),this.logState("resetFilters")},resetPagination(){e.page=1,e.totalPages=0,this.logState("resetPagination")},reset(){e=ne({},ce),t.notify({type:H}),this.logState("reset")}})}();class de{constructor(e){let{baseClassName:t,onInput:s,closeSearchWidget:a}=e;this.baseClassName=t,this.onInput=s,this.closeSearchWidget=a,this.inputId=`${this.baseClassName}-search-input`,this.searchBarContainer=this.getSearchBarContainer(),this.searchBar=this.getSearchBar(),this.searchInput=this.getSearchInput(),this.buildSearchBar()}getSearchBarContainerHeight(){const{elementReferrer:e}=DATA,t=g(e),s=t?.closest("header");if(s){const e=s.getBoundingClientRect().height;return Math.max(e,150)+"px"}return"auto"}getCurrentSearchBarContainerHeight(){return this.searchBarContainer.getBoundingClientRect().height}resetSearchBarHeight(){this.searchBarContainer.style.minHeight=this.getSearchBarContainerHeight()}setInputValue(e){this.searchInput.value=e}focusInput(){setTimeout(()=>{this.searchInput.focus()},100)}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`,DATA.useSearchBarInputCustomSearchIcon&&"widget_common_defaultImgUrl"!==DATA.searchBarInputCustomSearchIcon&&(t.style.maskImage=`url(${DATA.searchBarInputCustomSearchIcon})`),e.appendChild(t),e}getSearchInput(){const e=document.createElement("input");return e.id=this.inputId,e.placeholder=O.getTranslation("Search..."),e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,DATA.useRedirectionUrl&&DATA.redirectionUrl&&e.addEventListener("keyup",t=>{e.value&&"Enter"===t.key&&(t.preventDefault(),window.location.href=DATA.redirectionUrl.replace("{{query}}",e.value))}),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`,DATA.useSearchBarCustomCloseIcon&&"widget_common_defaultImgUrl"!==DATA.searchBarCustomCloseIcon&&(t.style.maskImage=`url(${DATA.searchBarCustomCloseIcon})`),e.appendChild(t),e}buildSearchBar(){const e=document.createElement("button");if(e.className=`${this.baseClassName}-reset-search-bar`,e.onclick=()=>{ie.reset(),le.reset()},DATA.useSearchBarInputResetPlainText)e.textContent=DATA.searchBarInputResetPlainText,e.style.textDecoration="underline";else{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 t=this.getSearchBarAndCloseButtonContainer();t.append(this.searchBar,this.getSearchCloseButton()),this.searchBarContainer.appendChild(t)}}class he{constructor(e){let{id:t,facet:s,baseClassName:a}=e;this.id=t,this.facet=s,this.baseClassName=a,this.facetContentContainers=this.createFacetContainers()}createFacetContainers(){const e=B(this.facet.title),t=O.getTranslation(e),s=document.createElement("details");s.className=`${this.baseClassName}-search-facet`,s.open=!0;const a=document.createElement("summary");a.innerHTML=`\n\t\t\t<span>${t}</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 i=document.createElement("div");return i.className=`${this.baseClassName}-search-facet-content ${this.facet.type}-facet`,s.append(a,i),{facetContainer:s,facetContent:i}}getFacetContainers(){return this.facetContentContainers}}class ue extends he{constructor(e){let{id:t,facet:s,baseClassName:a}=e;super({id:t,facet:s,baseClassName:a});const{facetContent:i,facetContainer:r}=this.getFacetContainers();this.facetContent=i,this.facetContainer=r,this.facetList=this.getFacetListElement(),this.showAll=!1,this.facetContent.append(this.facetList)}createFacetContent(){const e=this.facet.values.sort((e,t)=>{let[s,a]=e,[i,r]=t;const n=(le.state.filters[this.facet.title]||[]).includes(s),o=(le.state.filters[this.facet.title]||[]).includes(i);return n===o?r-a:o-n}),t=this.showAll?e:e.slice(0,10),s=[];for(const[e,a]of t){const t=this.getFacetListItemElement({name:e,count:a});s.push(t)}if(this.facetList.append(...s),this.facet.values.length>10){const e=document.createElement("button");e.className=`${this.baseClassName}-search-facet-show-more`,e.innerHTML=this.showAll?O.getTranslation("See less"):O.getTranslation("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:s}=e,a=document.createElement("li");a.className=`${this.baseClassName}-search-facet-list-item`,a.id=`${this.baseClassName}-search-facet-list-item-${t.replace(" ","-").toLowerCase()}`;const i=(le.state.filters[this.facet.title]||[]).includes(t),r=document.createElement("label");r.className=`${this.baseClassName}-search-facet-checkbox-container ${i||0!==s?"":"disabled"} ${i?"checked":""}`;try{const e=JSON.parse(t);r.innerHTML=`${Array.isArray(e)?e.join(", "):e} (${s})`}catch(e){r.innerHTML=`${t} (${s})`}const n=document.createElement("span");n.className=`${this.baseClassName}-search-facet-checkbox-checkmark`;const o=document.createElement("input");return o.disabled=!i&&0===s,o.checked=i,o.type="checkbox",o.onclick=()=>{const e=o.checked;le.resetPagination(),ie.clearResults(),le.updateFilterArray(this.facet.title,t,e)},r.appendChild(o),r.appendChild(n),a.appendChild(r),a}updateFacetContent(){I(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 ge{constructor(e){let{baseClassName:t,currentRange:s,min:a,max:i,onRangeChange:r}=e;this.baseClassName=t,this.currentRange=s||{min:a,max:i},this.min=a,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 s=document.createElement("div");s.className="steps-container";for(let e=0;e<20;e++){const e=document.createElement("div");e.className="step-bar",s.appendChild(e)}const a=document.createElement("div");a.className="range-handle";const i=document.createElement("div");i.className="range-handle-value",a.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 a.style.left="0%",r.style.left="100%",t.style.left="0%",t.style.width="100%",a.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(s,t,a,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;a.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(s,t,a,r);let d=!1,h=null,u=0,g=0;const b=()=>{const e=parseFloat(a.style.left),t=parseFloat(r.style.left),s=Math.floor(this.min+e/100*(this.max-this.min)),o=Math.ceil(this.min+t/100*(this.max-this.min));return i.textContent=s,n.textContent=o,{minValue:s,maxValue:o}},m=e=>{e.preventDefault(),d=!0,h=e.target.closest(".range-handle"),u=e.clientX||e.touches&&e.touches[0].clientX,g=parseFloat(h.style.left)},p=s=>{if(!d)return;s.preventDefault();const i=(s.clientX||s.touches&&s.touches[0].clientX)-u,n=e.offsetWidth;let o=g+i/n*100;o=h===a?Math.max(0,Math.min(o,parseFloat(r.style.left))):Math.max(parseFloat(a.style.left),Math.min(o,100));const c=100/19;o=Math.round(o/c)*c,h.style.left=`${o}%`,(()=>{const e=parseFloat(a.style.left),s=parseFloat(r.style.left);t.style.left=`${e}%`,t.style.width=s-e+"%"})(),b()},y=()=>{if(!d)return;d=!1,h=null;const{minValue:e,maxValue:t}=b();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[a,r].forEach(e=>{e.addEventListener("mousedown",m),e.addEventListener("touchstart",m,{passive:!1})}),document.addEventListener("mousemove",p),document.addEventListener("mouseup",y),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",y),document.addEventListener("touchcancel",y),{rangeContainer:e,valuesContainer:o}}}class be extends he{constructor(e){let{id:t,facet:s,baseClassName:a}=e;super({id:t,facet:s,baseClassName:a});const{facetContent:i,facetContainer:r}=this.getFacetContainers();this.facetContent=i,this.facetContainer=r,this.filterRange=new ge({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:this.onRangeChange.bind(this)})}onRangeChange=e=>{const{min:t,max:s}=e,{min:a,max:i}=ie.state.facets[this.facet.title]?.values,r=!(void 0===a||void 0===i||Math.floor(a)!==Number(t)||Math.ceil(i)!==Number(s));le.resetPagination(),ie.clearResults(),r?le.removeRangeFilter(this.facet.title):le.updateRangeFilter(this.facet.title,t,s)};createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){I(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new ge({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:this.onRangeChange.bind(this)}),this.createFacetContent())}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.updateFacetContent()}}class me{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getSortFacetElement(),le.observable.subscribe(e=>{let{type:t}=e;switch(t){case H:case U:this.updateSortValue()}})}updateSortValue(){this.element.querySelectorAll(".active").forEach(e=>{e.classList.remove("active"),e.disabled=!1});const e=this.element.querySelector(`[data-value="${le.state.sort[0]||"relevance"}"]`);e&&(e.classList.add("active"),e.disabled=!0)}getSortOptionsElements(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-options`;const t=z();for(const s of t){const t=document.createElement("button");t.classList.add(`${this.baseClassName}-search-sort-option`),(""===s.value&&0===le.state.sort.length||le.state.sort.includes(s.value))&&(t.classList.add("active"),t.disabled=!0);const a=document.createElement("div");a.className=`${this.baseClassName}-search-sort-option-label`,a.textContent=s.label,t.appendChild(a),t.dataset.value=s.value,t.onclick=()=>{le.setPage(1),ie.clearResults(),le.setSort(s.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=`${O.getTranslation("Sort By")}:`,e.appendChild(t),e.appendChild(this.getSortOptionsElements()),e}}class pe{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getInfosElement(),le.observable.subscribe(e=>{let{type:t}=e;t===V&&(this.element.innerHTML=this.getContent())})}getInfosElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-infos`,e.style.whiteSpace="nowrap",e.innerHTML=this.getContent(),e}getContent(){const e=O.getTranslation(le.state.totalHits>1?"results":"result");return`<span><b>${le.state.totalHits}</b> ${e}</span>`}}class ye{constructor(e){let{baseContainer:t,baseClassName:s,onPanelOpen:a,onPanelClose:i,content:r,type:n,headerContent:o}=e;this.baseContainer=t,this.baseClassName=s,this.sidePanelBaseClassName=`${s}-side-panel`,this.onPanelOpen=a,this.onPanelClose=i,this.content=r,this.type=n,this.headerContent=o,this.sidePanelClassName=`${this.sidePanelBaseClassName}-${this.type}`,this.overlayClassName=`${this.sidePanelBaseClassName}-${this.type}-overlay`,this.sidePanel=this.getSidePanelElement()}insertIn(e){this.baseContainer.insertAdjacentElement(e,this.sidePanel)}openPanel(){this.overlay=document.createElement("div"),this.overlay.className=this.overlayClassName,this.overlay.onclick=this.closePanel.bind(this),this.baseContainer.parentElement.insertAdjacentElement("afterbegin",this.overlay),this.sidePanel.classList.add("open"),this.onPanelOpen?.()}closePanel(){this.sidePanel.classList.remove("open"),this.baseContainer.parentElement.removeChild(this.overlay),this.overlay=null,this.onPanelClose?.()}getSidePanelElement(){const e=document.createElement("div");return e.className=this.sidePanelClassName,this.sidePanelContent=this.getSidePanelContentElement(),e.appendChild(this.getSidePanelHeaderElement()),e.appendChild(this.sidePanelContent),e}getSidePanelHeaderElement(){const e=document.createElement("div");e.className=`${this.sidePanelBaseClassName}-header`;const t=document.createElement("button");t.className=`${this.sidePanelBaseClassName}-close-button`;const s=document.createElement("i");return s.className=`${this.baseClassName}-close-icon`,t.appendChild(s),t.onclick=this.closePanel.bind(this),this.headerContent&&e.appendChild(this.headerContent),e.appendChild(t),e}getSidePanelContentElement(){const e=document.createElement("div");return e.className=`${this.sidePanelClassName}-content`,this.content&&e.appendChild(this.content),e}updateSidePanelContent(){I(this.sidePanelContent),this.sidePanelContent.append(...arguments)}}class we{constructor(e){let{baseClassName:t,baseContainer:s,searchResultsContainer:a,onFiltersReset:i}=e;this.baseClassName=t,this.baseContainer=s,this.searchResultsContainer=a,this.onFiltersReset=i,this.facets=[],this.facetsListContainer=this.getFacetsListContainer(),this.filtersSidePanel=new ye({baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,type:"filters",headerContent:this.searchInfos.element,onPanelOpen:this.onPanelOpen.bind(this),onPanelClose:this.onPanelClose.bind(this)}),"2buttons"===DATA.filtersAndSort&&(this.sortSidePanel=new ye({baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,type:"sort",content:this.sortFacet.element,onPanelOpen:this.onPanelOpen.bind(this),onPanelClose:this.onPanelClose.bind(this)})),le.observable.subscribe(e=>{let{type:t}=e;switch(t){case q:case J:case G:case K:this.setResetButtonAvailability()}}),this.isMobileLayout=window.innerWidth<=575.98,this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.resizeObserver.observe(this.baseContainer)}handleResize(e){const t=e[0],{width:s}=t.contentRect;this.isMobileLayout&&s<575.98||!this.isMobileLayout&&s>=575.98||(this.isMobileLayout=s<575.98,this.isMobileLayout?("2buttons"!==DATA.filtersAndSort&&this.facetsList.insertAdjacentElement("afterbegin",this.sortFacet.element),this.filtersSidePanel.updateSidePanelContent(this.facetsList,this.facetsListBottomButtonsContainer)):(this.filtersSidePanel.sidePanel.classList.contains("open")&&this.filtersSidePanel.closePanel(),"2buttons"===DATA.filtersAndSort&&this.sortSidePanel.sidePanel.classList.contains("open")&&this.sortSidePanel.closePanel(),this.facetsListContainer.appendChild(this.facetsListBottomButtonsContainer),this.facetsListContainer.insertBefore(this.facetsList,this.facetsListContainer.lastChild)))}setResetButtonAvailability(){const e=this.facetsListBottomButtonsContainer.querySelector(`.${this.baseClassName}-search-facets-list-reset-button`);e&&(e.disabled=!Object.keys(le.state.filters).length)}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 s=document.createElement("i");s.className=`${this.baseClassName}-close-icon`,t.appendChild(s),this.sortFacet=new me({baseClassName:this.baseClassName}),this.facetsListBottomButtonsContainer=document.createElement("div"),this.facetsListBottomButtonsContainer.className=`${this.baseClassName}-search-facets-list-bottom-buttons-container`;const a=document.createElement("button");a.className=`plain inverted ${this.baseClassName}-search-facets-list-reset-button`,a.disabled=!0,a.innerHTML=O.getTranslation("Clear results"),a.onclick=this.onFiltersReset;const i=document.createElement("div");i.className=`${this.baseClassName}-search-facets-list-header`,this.searchInfos=new pe({baseClassName:this.baseClassName});const r=document.createElement("button");return r.className=`plain ${this.baseClassName}-search-facets-list-bottom-close-button`,r.innerHTML=O.getTranslation("Show results"),r.onclick=this.closeFilters.bind(this),i.append(this.searchInfos.element,t),this.facetsListBottomButtonsContainer.append(a,r),this.facetsList=document.createElement("div"),e.append(i,this.sortFacet.element,this.facetsList,this.facetsListBottomButtonsContainer),e}renderFacets(e){var t;if((t=this.facetsList)&&[...t.children].forEach(e=>{e.tagName.toLowerCase()==="details".toLowerCase()&&e.parentNode.removeChild(e)}),DATA.customFiltersOrder){const t=DATA.customFiltersOrder.split(","),s=Object.keys(e).sort((e,s)=>t.includes(e)?t.includes(s)?t.indexOf(e)-t.indexOf(s):-1:1),a={};s.forEach(t=>{a[t]=e[t]}),e=a}this.facets=[];for(const[t,s]of Object.entries(e)){if(0===s.values.length||1===s.values.length)continue;const e=new("range"===s.type?be:ue)({id:t,facet:{title:t,values:s.values,type:s.type},baseClassName:this.baseClassName});this.facetsList.appendChild(e.facetContentContainers.facetContainer),this.facets.push(e)}this.facets.forEach(e=>{e.createFacetContent()}),this.searchResultsContainer.appendChild(this.facetsListContainer),this.filtersSidePanel.insertIn("beforeend"),this.isMobileLayout&&this.filtersSidePanel.updateSidePanelContent(this.facetsList,this.facetsListBottomButtonsContainer),this.sortSidePanel?.insertIn("beforeend")}setMaxHeight(e){if("popin"===DATA.layout)e?(this.facetsListContainer.style.maxHeight=`calc(100dvh - ${e}px)`,this.facetsListContainer.style.top=`${e}px`):(this.facetsListContainer.style.maxHeight="0px",this.facetsListContainer.style.top="0px");else{const e=`calc(100dvh - ${this.baseContainer.getBoundingClientRect().top}px)`;this.facetsListContainer.style.maxHeight=e,this.facetsListContainer.style.height=e}}openFilters(){this.filtersSidePanel.openPanel()}closeFilters(){this.filtersSidePanel.closePanel()}openSort(){this.sortSidePanel?.openPanel()}closeSort(){this.sortSidePanel?.closePanel()}onPanelOpen(){this.baseContainer.style.overflowY="hidden"}onPanelClose(){this.baseContainer.style.overflowY="auto"}updateRangeFacets(e){this.facets.filter(e=>e instanceof be).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof ue).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}}class fe{constructor(e){let{result:t,index:s,baseClassName:a,isRecommendedProduct:i}=e;this.result=t,this.index=s,this.baseClassName=a,this.isRecommendedProduct=i}onAddToCart(e){e?.preventDefault?.(),e?.stopPropagation?.(),window.console.log("onAddToCart",this.result)}onClick(e){return window.abtasty.send("event",{ec:"Action Tracking",ea:"searchResultClicked",el:this.isRecommendedProduct?`recommendedProduct|${this.result.id}`:`${le.state.text}|${this.result.id}`,ev:this.index}),!0}getRatingElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-rating`;const t=this.result.reviewsCount,s=O.getTranslation(t>1?"reviews":"review"),a=document.createElement("div");a.className="reviews-count",a.textContent=`${t} ${s}`;const i=this.result.rating,r=document.createElement("div");return r.title=i,r.className="star-rating",r.style.setProperty("--rating-width",i/5*100+"%"),e.appendChild(r),e.appendChild(a),e}getAdditionalInfoElement(){if(!this.result.strokePrice&&!this.result.recent||DATA.useCustomPricing)return null;const e=document.createElement("div");if(e.className=`${this.baseClassName}-search-result-additional-info-container`,this.result.strokePrice){const t=document.createElement("div");if(t.className=`${this.baseClassName}-search-result-stroke-price`,t.textContent=`${this.result.strokePrice}€`,e.appendChild(t),this.result.discount){const t=document.createElement("div");t.className=`${this.baseClassName}-search-result-info-tag`,t.textContent=`-${this.result.discount}%`,e.appendChild(t)}return e}if(this.result.recent){const t=document.createElement("div");t.className=`${this.baseClassName}-search-result-info-tag`,t.textContent="New",e.appendChild(t)}return e}getSearchResultElement(){const e=document.createElement("div");e.onclick=this.onClick.bind(this),e.className=`${this.baseClassName}-search-result-card`;const t=this.index<6&&this.index<window.innerHeight/200*2,s=document.createElement("div");s.className=`${this.baseClassName}-search-result result-${this.index}`;const a=document.createElement("a");a.className=`${this.baseClassName}-search-result-image-container`;const i=document.createElement("img");i.alt=this.result.name,i.className=`${this.baseClassName}-search-result-image ${t?"":"lazy"}`,t?i.src=this.result.img_link:i.dataset.src=this.result.img_link,a.appendChild(i);const r=document.createElement("div");r.className=`${this.baseClassName}-search-result-content`;const n=Object.entries(L).map(e=>{let[t,s]=e;return{key:s,order:DATA[t]}}).sort((e,t)=>e.order-t.order);if(n.forEach(e=>{if(this.result[e.key])if(e.key!==L.searchResultMainInformationOrderRating){if(console.log(e.key,e.order,n.length),e.key===L.searchResultMainInformationOrderPrice&&e.order<n.length){console.log("price");const e=this.getPricingElement();r.appendChild(e)}else if(e.key!==L.searchResultMainInformationOrderPrice){let t=document.createElement("div");if(t.className=`${this.baseClassName}-search-result-${e.key}`,t.textContent=this.result[e.key],"name"===e.key&&DATA.useSearchResultCtaButton){const e=document.createElement("a");e.href=this.result.link,e.style.cursor="pointer",e.appendChild(t),t=e}r.appendChild(t)}}else{const e=this.getRatingElement().outerHTML;r.appendChild(e)}}),n[n.length-1].key===L.searchResultMainInformationOrderPrice){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-bottom-content`;const t=this.getAdditionalInfoElement();e.appendChild(this.getPricingElement()),t&&e.appendChild(t),r.appendChild(e)}const o=document.createElement("button");o.className=`${this.baseClassName}-search-result-add-to-cart`,o.onclick=this.onAddToCart.bind(this),o.innerHTML='<div class="add-to-cart-content" data-label="Add to cart"/>';let c=null;if(DATA.useSearchResultCtaButton){c=document.createElement("a"),c.href=this.result.link,c.style.cursor="pointer";const e=document.createElement("button");e.className=`plain inverted ${this.baseClassName}-search-result-cta-button`,e.innerHTML=DATA.searchResultCtaButtonText,c.appendChild(e)}else a.classList.add("no-cta");return a.href=this.result.link,a.style.cursor="pointer",s.appendChild(a),s.appendChild(r),c&&s.appendChild(c),e.appendChild(s),e}getPricingElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-price-container`;const t=document.createElement("div");t.className=`${this.baseClassName}-search-result-price`;const s=`${window.location.hostname.includes("palaisdesthes")?"<span>À partir de</span>":""}${this.result.price.toLocaleString(DATA.language,{minimumFractionDigits:2,maximumFractionDigits:2})} €`;if(DATA.useCustomPricing){const e=this.getCustomPricingElement();e?t.appendChild(e):t.innerHTML=s}else t.innerHTML=s;return e.appendChild(t),e}getCustomPricingElement(){const{pricingCustomJS:e,tagIsSafeEval:t}=DATA,s=t&&DATA_JS?.pricingCustomJS;return("function"==typeof s?s:new Function("result",e))(this.result)}}const ve="remove",xe="rebuild",Ce="update";class ke{constructor(e){let{baseClassName:t,infos:s,openFilters:a,openSort:i}=e;this.baseClassName=t,this.infos=s,this.openFilters=a,this.openSort=i,this.searchInfos=new pe({baseClassName:t}),this.sortLabelElement=this.getSortLabelElement(),this.sortSelectElement=this.getSortSelectElement(),this.sortAndFiltersButtonElement=this.getSortAndFiltersButtonElement(),this.infosAndSortContainer=this.getInfoAndSortContainerElement(),this.infosAndSortContainer.appendChild(this.searchInfos.element),DATA.useFacetsList&&this.infosAndSortContainer.appendChild(this.sortAndFiltersButtonElement),this.setSortOptions(),le.observable.subscribe(e=>{let{type:t}=e;switch(t){case q:case J:case G:case K:this.updateFiltersInfo();break;case U:this.updateSortValue();break;case H:this.updateFiltersInfo(),this.updateSortValue()}})}updateFiltersInfo(){let e=0;for(const t of Object.values(le.state.filters))"object"==typeof t[0]?e++:e+=t.length;e?(this.filtersButtonElement.classList.add("active"),this.filtersButtonTextElement.textContent=`${e} ${O.getTranslation("Filter")}${e>1?"s":""}`):(this.filtersButtonElement.classList.remove("active"),this.filtersButtonTextElement.textContent=DATA.filtersButtonText||O.getTranslation("Filter"))}updateSortValue(){this.sortSelectElement.value=le.state.sort[0]||"relevance"}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=`${O.getTranslation("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}getSortButtonElement(){const e=document.createElement("button");e.className=`${this.baseClassName}-search-sort-button`;const t=document.createElement("i");t.className=`${this.baseClassName}-search-sort-button-icon`,DATA.sortButtonIcon&&(t.style.maskImage=`url(${DATA.sortButtonIcon})`);const s=document.createElement("span");return s.className=`${this.baseClassName}-search-sort-button-text`,s.textContent=DATA.sortButtonText||O.getTranslation("Sort"),e.append(t,s),e.onclick=this.openSort,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`,DATA.filtersButtonIcon&&"https://widgets-images.abtasty.com/widgets-default-image.png"!==DATA.filtersButtonIcon&&(t.style.maskImage=`url(${DATA.filtersButtonIcon})`);const s=document.createElement("span");return s.className=`${this.baseClassName}-search-filters-button-text`,s.textContent=DATA.filtersButtonText||O.getTranslation("Filter"),e.append(t,s),e.onclick=this.openFilters,this.filtersButtonTextElement=s,e}getSortAndFiltersButtonElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-and-filters-button-container`;const t=this.getSortElement();return e.appendChild(t),this.filtersButtonElement=this.getFiltersButtonElement(),e.appendChild(this.filtersButtonElement),"2buttons"===DATA.filtersAndSort&&(this.sortButtonElement=this.getSortButtonElement(),e.appendChild(this.sortButtonElement)),e}setSortOptions(){this.sortSelectElement.childElementCount&&removeChildren(this.sortSelectElement);const e=z();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;le.setPage(1),ie.clearResults(),le.setSort(t)}}const Se=575.98;class Ee{constructor(e){let{baseContainer:t,baseClassName:s,searchBar:a,onFiltersReset:i}=e;this.baseContainer=t,this.baseClassName=s,this.searchBar=a,this.onFiltersReset=i,this.searchResultContainer=this.getSearchResultContainerElement(),this.searchResultListContainer=this.getSearchResultListContainerElement(),this.searchResultList=this.getSearchResultListElement(),this.facetsList=new we({baseContainer:this.baseContainer,baseClassName:this.baseClassName,searchResultsContainer:this.searchResultContainer,onFiltersReset:this.onFiltersReset}),this.infoAndSort=new ke({baseClassName:this.baseClassName,infos:{totalHits:le.state.totalHits},openFilters:this.facetsList.openFilters.bind(this.facetsList),openSort:this.facetsList.openSort.bind(this.facetsList)}),new MutationObserver(this.mutationCallback.bind(this)).observe(this.searchResultContainer,{childList:!0}),this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.resizeObserver.observe(this.baseContainer),this.isMobileLayout=window.innerWidth<=Se,ie.observable.subscribe(e=>{let{type:t,payload:s}=e;switch(t){case X:this.onSetResults(ie.state.results,ie.state.facets);break;case Y:this.onUpdateResults(ie.state.results);break;case Q:this.onAddResults(s)}})}onSetResults(e,t){if(this.baseContainer.classList.add("search-completed"),this.clearSearchResults(),e.length){DATA.useFacetsList&&this.facetsList.renderFacets(t),this.searchResultListContainer.appendChild(this.infoAndSort.infosAndSortContainer),DATA.groupBy&&DATA.groupByName?this.renderGroupedResultList(e):this.renderResultList(e),this.searchResultContainer.appendChild(this.searchResultListContainer),this.baseContainer.appendChild(this.searchResultContainer),this.lazyLoadImages();const s=this.baseContainer.getBoundingClientRect().top;this.baseContainer.style.height=`calc(100dvh - ${s}px)`,this.baseContainer.style.maxHeight=`calc(100dvh - ${s}px)`}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=O.getTranslation("No result found"),this.searchResultContainer.classList.add("abt-search-no-results"),this.searchResultContainer.appendChild(e)}this.searchResultContainer.classList.add("abt-search-visible"),this.baseContainer.appendChild(this.searchResultContainer),this.resultsChanged=!0}onAddResults(e){e.length&&(this.renderListItems(e),this.lazyLoadImages(),this.resultsChanged=!0)}onUpdateResults(e){if(this.searchResultContainer.classList.remove("abt-search-no-results"),DATA.groupBy&&DATA.groupByName)return this.updateGroupedSearchResults(e);I(this.searchResultList),e.length?(this.renderListItems(e),this.lazyLoadImages()):this.renderNoResults(),this.resultsChanged=!0}handleResize(e){const t=(e[0].contentRect.width||window.innerWidth)<=Se;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}lazyLoadImages(){let e=this.searchResultListContainer.querySelectorAll(".lazy");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const s=e.target;s.src=s.dataset.src,s.addEventListener("load",()=>{s.classList.remove("lazy"),t.unobserve(s)})}})},{root:this.baseContainer,rootMargin:"0px 0px 500px 0px"});e.forEach(e=>{t.observe(e)})}else{let t;const s=()=>{t&&clearTimeout(t),t=setTimeout(()=>{const t=window.scrollY;e.forEach(s=>{if(s.offsetTop<window.innerHeight+t+500){const t=s.dataset.src;s.src=t,s.classList.remove("lazy"),e=this.searchResultList.querySelectorAll(".lazy")}}),0==e.length&&(document.removeEventListener("scroll",s),window.removeEventListener("resize",s))},20)};document.addEventListener("scroll",s),window.addEventListener("resize",s)}}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}updateGroupedSearchResults(e){const t=this.searchResultListContainer.querySelectorAll(`.${this.baseClassName}-group-container`);for(const e of t)I(e);e.length?(this.renderGroupedResultList(e),this.lazyLoadImages()):this.renderNoResults(),this.resultsChanged=!0}renderGroupedResultList(e){const t=Object.groupBy(e,e=>e[DATA.groupByName]);let s=0;for(const[e,a]of Object.entries(t)){const t=document.createElement("div");t.className=`${this.baseClassName}-group-container`;const i=document.createElement("div");i.className=`${this.baseClassName}-group-name`,i.innerHTML=e,t.appendChild(i);const r=this.getSearchResultListElement();for(const e of a){const t=new fe({result:e,index:s,baseClassName:this.baseClassName});r.appendChild(t.getSearchResultElement()),s++}t.appendChild(r),this.searchResultListContainer.appendChild(t)}}renderResultList(e){this.renderListItems(e),this.searchResultListContainer.appendChild(this.searchResultList)}renderListItems(e){for(const[t,s]of e.entries()){const e=new fe({result:s,index:t,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}}renderNoResults(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=O.getTranslation("No result found"),this.searchResultContainer.classList.add("abt-search-no-results"),this.searchResultList.appendChild(e)}clearSearchResults(){I(this.searchResultList),I(this.searchResultListContainer),I(this.searchResultContainer),this.searchResultContainer.classList.remove("abt-search-visible","abt-search-no-results"),this.searchResultContainer.remove()}updateListFacets(e){this.facetsList.updateListFacets(e)}updateFacets(e){this.facetsList.updateFacets(e)}}function Ae(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 $e(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(s),!0).forEach(function(t){Te(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ae(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function Te(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 Ne="https://search-api.abtasty.com",Re=DATA.groupBy?1e3:50,Pe=["catégorie","catégories","category","type_category","category_name","categories"],Le=e=>{const t=DATA.language,s=[];for(const a of e){let e=a.name,i=a.link;if(t&&(a.localized_title&&(e=JSON.parse(a.localized_title)[t]??a.name),a.localized_link&&(i=JSON.parse(a.localized_link)[t]??a.link)),a.title_front&&(e=a.title_front),i&&a.img_link&&a.price){const t={name:B(e),link:i,id:a.id,img_link:a.img_link,price:a.price,category:a.category||a.categories,rating:a.reviews_average||null,reviewsCount:a.reviews_count||null,strokePrice:a.stroke_price||null,caption:a.caption||a.brand||null,discount:a.discount_rate||null,recent:a.recency>=.9};DATA.groupBy&&DATA.groupByName&&(t[DATA.groupByName]=a[DATA.groupByName]),s.push(t)}}return s},Be=async e=>{if(!e)return null;const t=await e.json();return{results:Le(t.hits),facets:t.facets,totalPages:t.totalPages,page:t.page,totalHits:t.totalHits}},Ie=t=>{let{text:s,filters:a,sort:i,page:r,hitsPerPage:n,facets:o}=t;return $e($e($e({index:DATA.meilisearchIndex||e(),text:s,facets:o||["*"],page:r,hitsPerPage:n||Re,sort:"relevance"===i[0]?[]:i,limit:DATA.groupBy?1e3:void 0},Object.keys(a).length>0&&{filters:a}),DATA.useRecoAndMerch&&DATA.siteId&&DATA.merchandisingRecoId&&{siteId:Number(DATA.siteId),recoId:DATA.merchandisingRecoId}),DATA.useSemanticSearch&&{semanticRatio:DATA.semanticRatio})},De=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e&&e.aborted)throw new Error(e.reason);const t=()=>{};e&&e.addEventListener("abort",t,{once:!0});try{const t=await fetch(`${Ne}/search`,{method:"POST",body:JSON.stringify(Ie(le.state)),signal:e});if(e&&e.aborted)throw new Error(e.reason);const s=await Be(t);if(e&&e.aborted)throw new Error(e.reason);return s}catch(e){return e.name,{results:[],facets:{},totalPages:0,page:1,totalHits:0}}finally{if(e&&e.removeEventListener("abort",t),e&&e.aborted)return null}},Oe=(e,t)=>{if(!e)return;const s=`${DATA.elementReferrer} input:not([type="hidden"])`;y(s,t)};class Fe{hasTriggeredSeeMore=!1;constructor(e){let{parentContainer:t}=e;this.parentContainer=t,this.baseClassName="abtasty-search-widget",this.searchOpen=!1,this.searchWidgetContainer=this.getSearchWidgetContainerElement(),this.ac=new AbortController}init(){this.searchBar=new de({baseContainer:this.searchWidgetContainer,baseClassName:this.baseClassName,onInput:this.debouncedOnInput.bind(this),closeSearchWidget:this.closeSearchWidget.bind(this)}),this.searchResultsList=new Ee({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersReset:this.onFiltersReset.bind(this)}),this.getRecommendationsElement(),le.observable.subscribe(e=>{let{type:t}=e;switch(t){case _:this.onTextChange();break;case q:this.onFilterChange(!1);break;case G:case J:this.onFilterChange(!0);break;case U:this.onSortChange();break;case Z:this.onSeeMore();break;case H:this.onSearchReset()}})}onTextChange(){if(!le.state.text)return ie.reset(),void le.reset();(Object.keys(le.state.filters).length||le.state.page>1)&&le.resetFiltersAndPagination(),this.searchBar.setResetIconVisibility(!0);try{DATA.useAutocomplete&&this.onAutocomplete(),this.onSearch()}catch(e){}}async onFilterChange(e){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const t=await(async()=>{const e=(()=>{const e=[],{text:t,filters:s,page:a,sort:i}=le.state,r={text:t,filters:s,sort:i,page:a};return e.push(fetch(`${Ne}/search`,{method:"POST",body:JSON.stringify(Ie($e($e({},r),{},{hitsPerPage:Re})))})),Object.entries(ie.state.facets).filter(e=>{let[t,s]=e;return"list"===s.type&&s.values.length>1}).filter(e=>{let[t]=e;return le.state.filters[t]}).filter(e=>{let[t]=e;return!!le.state.previousFilters[t]&&le.state.previousFilters[t].length===le.state.filters[t].length}).map(e=>{let[t]=e;return t}).forEach(t=>{const a=$e({},s);delete a[t],e.push(fetch(`${Ne}/search`,{method:"POST",body:JSON.stringify(Ie($e($e({},r),{},{filters:a,facets:[t],hitsPerPage:Re})))}))}),e})();try{const s=await Promise.all(e),a=await Promise.all(s.map(Be)),i={hits:Le((t=a)[0].results),facets:t.reduce((e,t)=>$e($e({},e),t.facets),{}),page:t[0].page,totalPages:t[0].totalPages,totalHits:t[0].totalHits};return{results:i.hits,facets:i.facets,totalPages:i.totalPages,page:i.page,totalHits:i.totalHits}}catch(e){}var t})();if(!t)return;const{results:s,facets:a,totalPages:i,totalHits:r}=t;if(e)for(const[e,t]of Object.entries(a))"range"===t.type&&delete a[e];const n=Object.keys(a).filter(e=>{const t=le.state.previousFilters[e],s=le.state.filters[e];return!s&&!t||!(s||!t)||!(s&&!t)&&s.length===t.length}).map(e=>e);for(const e of Object.keys(a))n.includes(e)||delete a[e];const o=W(a,ie.state.facets,!0);ie.updateResults(s),ie.updateFacets(a),le.setTotalPages(i),le.setTotalHits(r),e?this.searchResultsList.updateListFacets(o):this.searchResultsList.updateFacets(o),le.setPreviousFilters(le.state.filters)}async onSortChange(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const e=await(async()=>{try{return{results:(await De()).results}}catch(e){return"AbortError"===e.name?null:{results:[]}}})();if(!e)return;const{results:t}=e;ie.updateResults(t)}async onSeeMore(){const e=await(async()=>{try{const e=await De();return{results:e.results,totalPages:e.totalPages}}catch(e){return null}})();if(!e)return;this.hasTriggeredSeeMore=!1;const{results:t}=e;ie.addResults(t)}onSearchReset(){if(this.searchResultsList.clearSearchResults(),this.searchWidgetContainer.classList.remove("search-completed"),this.recommendationsContainer&&this.searchWidgetContainer.appendChild(this.recommendationsContainer),"absolute"===DATA.typeOfPositioning){const e=this.parentContainer.domElement.getBoundingClientRect().top;this.searchWidgetContainer.style.height="auto",this.searchWidgetContainer.style.maxHeight=`calc(100dvh - ${e+"px"})`}this.searchBar.setResetIconVisibility(!1),this.searchBar.resetInput(),this.searchBar.focusInput()}insert(e,t){return e.insertAdjacentElement(t,this.searchWidgetContainer),this}handleScroll(e){const t=e.target.scrollTop+e.target.clientHeight>=e.target.scrollHeight-500;!this.hasTriggeredSeeMore&&t&&le.state.page<le.state.totalPages&&(this.hasTriggeredSeeMore=!0,le.setPage(le.state.page+1))}resetSearch(){this.ac.abort("User reset"),this.ac=new AbortController,ie.reset(),le.reset(),this.scrollToTop()}scrollToTop(){window.scrollY>0&&window.scroll({top:0,behavior:"smooth"}),this.searchWidgetContainer.scrollTop=0}openSearchWidget(){return!this.searchOpen&&(document.querySelector("body").classList.add("search-open"),this.searchOpen=!0,this.searchWidgetContainer.classList.add("open"),this.parentContainer.show(),!0)}closeSearchWidget(){document.querySelector("body").classList.remove("search-open"),this.searchWidgetContainer.classList.remove("open"),this.parentContainer.hide(),this.searchOpen=!1}onFiltersReset(){if(!le.isNoFiltersAndNoSort()){le.resetFiltersAndPagination();try{this.onSearch()}catch(e){}}}async onAutocomplete(){const e=await(async()=>{if(!DATA.autocompleteId)return null;try{const t=await fetch((e=le.state.text,`${Ne}/autocomplete?client_id=${DATA.autocompleteId}&query=${e}&hits_per_page=5`));return(await t.json()).suggestions.map(e=>e.text)}catch(e){return null}var e})();return e&&e.length?e:[]}onInput=e=>{le.setText(e.target.value)};debouncedOnInput=(()=>(e=>{let t=null;return function(){for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];window.clearTimeout(t),t=window.setTimeout(()=>{e(...a)},300)}})(this.onInput.bind(this)))();async onSearch(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;try{const e=await De(this.ac.signal);if(null===e)return;const{results:t,facets:s,totalPages:a,totalHits:i}=e;window.abtasty.send("event",{ec:"Action Tracking",ea:"search",el:le.state.text,ev:i}),this.recommendationsContainer?.remove(),le.setTotalPages(a),le.setTotalHits(i),ie.setResults(t,s)}catch(e){}}getSearchWidgetContainerElement(){const e=document.createElement("div"),s=document.createElement("style"),a=document.createElement("style");t()&&(s.setAttribute("abtasty-script-added","true"),a.setAttribute("abtasty-script-added","true")),e.className=`${this.baseClassName}-container ${this.baseClassName}-container-${DATA.layout}`,!DATA.groupBy&&e.addEventListener("scroll",this.handleScroll.bind(this));const i=(r=this.parentContainer.widgetContainerId,n=this.parentContainer.contentClassName,[P(r,n),R(r,n),...DATA.useExpertMode?[DATA.containerCustomCss,DATA.searchBarCustomCss,DATA.filtersButtonCustomCss,DATA.sortButtonCustomCss,DATA.facetsCustomCss,DATA.searchResultCustomCss,DATA.searchResultCtaButtonCustomCss]:[E(),N(),T(r,n),A(r,n)]]);var r,n;const o=document.createTextNode("body.search-open{height:100vh!important;overflow:hidden!important}#algolia-autocomplete-container,.dfd-classic{display:none!important}div.abtasty-search-widget-side-panel-filters,div.abtasty-search-widget-side-panel-sort{background-color:#fff;bottom:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;overflow-x:hidden;padding:0 0 100px;position:fixed;right:-325px;top:0!important;-webkit-transition:.5s;transition:.5s;width:325px;z-index:12}div.abtasty-search-widget-side-panel-filters-overlay,div.abtasty-search-widget-side-panel-sort-overlay{background-color:rgba(0,0,0,.5);inset:0;position:fixed;z-index:11}div.abtasty-search-widget-side-panel-filters.open,div.abtasty-search-widget-side-panel-sort.open{right:0}div.abtasty-search-widget-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;container-name:widget-container;container-type:inline-size;display:none!important;-ms-flex-direction:column;flex-direction:column;font-family:inherit;line-height:1;overflow-y:auto;position:relative;z-index:102}div.abtasty-search-widget-overlay{background-color:rgba(0,0,0,.5);cursor:pointer;height:100vh;left:0;pointer-events:auto;position:absolute;width:100vw;z-index:1}div.abtasty-search-widget-container button.abtasty-search-widget-close-button{background-color:transparent;font-size:24px;margin:16px 16px -16px auto;position:absolute;right:0}div.abtasty-search-widget-container.open{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}div.abtasty-search-widget-container.abtasty-search-widget-container-popin{inset:0;position:fixed}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 button{border:none;cursor:pointer;font-size:inherit;line-height:1;min-height:unset;outline:none;padding:0;text-decoration:none;text-transform:none}div.abtasty-search-widget-container button.plain{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#3100bf;border:none;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:16px;justify-content:center;padding:8px;text-align:center;width:100%}div.abtasty-search-widget-container button.plain:not(:disabled){cursor:pointer}div.abtasty-search-widget-container button.plain.inverted{background-color:transparent;color:#3100bf}div.abtasty-search-widget-container button.plain.inverted:disabled{opacity:.5}div.abtasty-search-widget-container div.abtasty-search-widget-autocomplete-suggestions-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;margin:16px 48px -16px 16px;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-autocomplete-suggestion{background-color:transparent;border:1px solid #d8d8e2;border-radius:999px;cursor:pointer;font-size:13px;padding:4px 8px}div.abtasty-search-widget-container div.abtasty-search-widget-autocomplete-suggestion:hover{opacity:.5}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:1168px;padding-inline:32px;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{background-color:transparent;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;text-align:center;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:transparent!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;margin-inline:auto;-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:240px;min-width:240px;padding:16px 16px 50px 0}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;text-align:left}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:transparent;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;padding-bottom:20px;text-align:center}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner p{font-size:20.8px!important;font-size:1.3rem!important;font-weight:700!important;margin:0 16px}div.abtasty-search-widget-container h4.abtasty-search-widget-recommended-banner-title{font-family:Lato;margin:12px 16px 10px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-banner a.abtasty-search-widget-recommended-banner-cta{margin-top:16px;text-decoration:underline;text-decoration-thickness:0;text-underline-offset:4px}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!important}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-products-title{margin-bottom:24px;margin-top:0}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category{color:#2a2a3c;cursor:pointer;font-size:14px;font-weight:400;line-height:20px;text-transform:capitalize;white-space:nowrap}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.abt-search-visible{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:space-between;margin-inline:auto;max-width:1168px;padding-inline:32px;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;container-name:result-list;container-type:inline-size;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-list-container div.abtasty-search-widget-group-name{border-bottom:1px solid #d8d8e2;color:#2a2a3c;font-size:24px;font-weight:700;margin:16px 0;padding-bottom:4px;text-transform:uppercase}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container div.abtasty-search-widget-group-container div.abtasty-search-widget-search-result-list{margin-bottom: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:71.5px}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-decoration-thickness:0;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;background:unset;border:none;-webkit-box-shadow:none;box-shadow:none;color:#2a2a3c;cursor:pointer;font-size:13px;height:auto;line-height:1;outline:none;padding:0 24px 0 0;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:after{background-color:#2a2a3c;bottom:-10%;content:\"\";height:10px;-webkit-mask-image: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\");mask-image: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\");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute;right:10px;width: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,div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-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,div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-button i.abtasty-search-widget-search-sort-button-icon{background-color:#2a2a3c;margin-right:8px;min-height:19px;min-width:19px}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon{-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\")}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-recommended-products-list{margin-top:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-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 div.abtasty-search-widget-search-result-card{border:1px solid #d8d8e2;border-radius:4px;color:inherit;display:block;position:relative;text-decoration:none!important}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-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;height:100%;padding:18px;width:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-card:hover{border-color:#a18cde}div.abtasty-search-widget-container a.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 a.abtasty-search-widget-search-result-image-container.no-cta:after{content:\"\";inset:0;position:absolute}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(+.abtasty-search-widget-search-result-caption),div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name:has(+.abtasty-search-widget-search-result-rating){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-caption{color:#2a2a3c;font-size:12px;font-weight:400;margin-bottom:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-caption:has(+div.abtasty-search-widget-search-result-rating){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-bottom-content{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-bottom-content,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{-webkit-box-orient:vertical;-webkit-box-direction:normal;color:#2a2a3c;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:18px;font-weight:700;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price span{font-size:14px;margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-additional-info-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin-left:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-stroke-price{color:#2a2a3c;font-size:14px;font-weight:400;text-decoration:line-through}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-stroke-price:has(+div.abtasty-search-widget-search-result-info-tag){margin-right:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-info-tag{background-color:#c0e505;border-radius:4px;color:#2a2a3c;font-size:14px;font-weight:400;padding:4px 8px}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-add-to-cart{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#3100bf;border:none;border-radius:4px;bottom:18px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:40px;outline:none;padding:0;position:absolute;right:18px;width:40px}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-add-to-cart .add-to-cart-content{content:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.799 1.651c0-.472.383-.855.855-.855h2.531A1.651 1.651 0 0 1 5.798 2.09l.496 1.89h15.265a1.651 1.651 0 0 1 1.618 1.949l-.004.017-1.302 6.356a1.635 1.635 0 0 1-1.626 1.35H8.27l.454 2.27h9.648a.855.855 0 0 1 0 1.71H8.675a1.651 1.651 0 0 1-1.618-1.321v-.004L4.8 5.027l-.662-2.52H1.654a.855.855 0 0 1-.855-.856Zm5.878 4.04 1.25 6.25H20.2l1.281-6.25H6.677Zm2.938 15.92a.059.059 0 1 0 0-.117.059.059 0 0 0 0 .118Zm-1.651-.058a1.651 1.651 0 1 1 3.302 0 1.651 1.651 0 0 1-3.302 0Zm9.611.059a.059.059 0 1 0 0-.118.059.059 0 0 0 0 .118Zm-1.65-.06a1.651 1.651 0 1 1 3.302 0 1.651 1.651 0 0 1-3.303 0Z' fill='%23FCFCFD'/%3E%3C/svg%3E\");margin-inline:auto}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-cta-button{margin-top:12px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:300px;min-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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet{background-color:transparent}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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet label.abtasty-search-widget-search-sort-label{text-align:center}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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet div.abtasty-search-widget-search-sort-options{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:20px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option:hover{background:revert}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-side-panel-sort-content div.abtasty-search-widget-search-sort-facet div.abtasty-search-widget-search-sort-options button.abtasty-search-widget-search-sort-option{border-radius:4px;padding:18px 10px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active{background-color:#3100bf;opacity:1}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active .abtasty-search-widget-search-sort-option-label{color:#fff;mix-blend-mode:difference}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-header,div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-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 button.abtasty-search-widget-side-panel-close-button,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 button.abtasty-search-widget-side-panel-close-button i.abtasty-search-widget-close-icon{background-color:#2a2a3c}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{display:-webkit-box;display:-ms-flexbox;display:flex;gap:8px;padding:16px;-webkit-transition:.5s;transition:.5s}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{color:#2a2a3c;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{color:#fff;content:\"\\2713\";display:none;font-size:10px;inset:2.5px;position:absolute}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;text-transform:uppercase}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:#d8d8e2;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}@container result-list (width > 399.98px){@container widget-container (width > 576px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(2,minmax(0,1fr))}}}@container result-list (width > 749.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@container result-list (width > 1199.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(4,minmax(0,1fr))}}@container result-list (width > 1499.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.abt-search-visible:not(.abt-search-no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(5,minmax(0,1fr))}}@container widget-container (width > 575.98px){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.abt-search-visible{max-width:704px}}@container widget-container (width > 767.98px){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.abt-search-visible{max-width:784px}}@container widget-container (width > 991.98px){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.abt-search-visible{max-width:1024px}}@container widget-container (width > 1199.98px){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.abt-search-visible{max-width:1168px}}@container widget-container (width <= 375px){div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-filters.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container,div.abtasty-search-widget-side-panel-filters.open,div.abtasty-search-widget-side-panel-sort.open{width:100%}}@container widget-container (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.abt-search-visible{max-width:100vw;padding-inline:16px}div.abtasty-search-widget-container{overflow-x:hidden}div.abtasty-search-widget-side-panel-filters,div.abtasty-search-widget-side-panel-sort{display:block}div.abtasty-search-widget-container button.abtasty-search-widget-close-button{margin-bottom:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{padding-bottom:16px;padding-top: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.abt-search-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}div.abtasty-search-widget-container a.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-bottom-content{margin-top:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-bottom-content:has(.abtasty-search-widget-search-result-info-tag){margin-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-direction:column;flex-direction:column}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price span{margin-bottom:0;margin-right:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-additional-info-container{margin-left:0;margin-top:8px}div.abtasty-search-widget-container button.abtasty-search-widget-search-result-add-to-cart{bottom:12px;right:12px}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,div.abtasty-search-widget-container button.abtasty-search-widget-search-sort-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-side-panel-filters div.abtasty-search-widget-search-facets-list-bottom-buttons-container{background-color:#fff;border-top:1px solid #d8d8e2;bottom:0;position:fixed;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{display:none}div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-filters div.abtasty-search-widget-search-facets-list-bottom-buttons-container{-webkit-box-sizing:border-box;box-sizing:border-box;right:-325px;-webkit-transition:.5s;transition:.5s;width:325px}div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-filters.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container{right:0}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet{margin:0 16px}div.abtasty-search-widget-container div.abtasty-search-widget-side-panel-header{display:-webkit-box;display:-ms-flexbox;display:flex}}@container widget-container (width <= 768px){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;min-width:240px}div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container{max-height:200px;max-width:200px;min-height:200px;min-width:200px}}@container widget-container (width <= 992px){div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container{max-height:147px;max-width:147px;min-height:147px;min-width:147px}}@container widget-container (width <= 375px){div.abtasty-search-widget-container a.abtasty-search-widget-search-result-image-container{max-height:100px;max-width:100px;min-height:100px;min-width:100px}}");return s.appendChild(o),a.textContent=[...i,`.${this.parentContainer.hideClassName} {`,"display: none;","}"].join("").replaceAll("{{UNIQUE_ID}}",this.parentContainer.uniqueId),this.parentContainer.domElement.lastElementChild.after(s),this.parentContainer.domElement.lastElementChild.after(a),e}async getRecommendationsElement(){const t=document.createElement("div");t.className=`${this.baseClassName}-recommendations-container`;const s=await(async()=>{if(window.location.hostname.includes("palaisdesthes"))return[{name:"Matcha",redirectTo:"https://www.palaisdesthes.com/fr/thes/matcha/"},{name:"Jasmin",redirectTo:"https://www.palaisdesthes.com/fr/thes/parfumes/fleurs/jasmin/"},{name:"Menthe",redirectTo:"https://www.palaisdesthes.com/fr/thes/parfumes/menthe/"},{name:"Infusion",redirectTo:"https://www.palaisdesthes.com/fr/rooibos-infusions/"},{name:"Thé vert",redirectTo:"https://www.palaisdesthes.com/fr/thes/the-vert/"}];if(window.location.hostname.includes("mademoiselle-bio"))return[{name:"centifolia"},{name:"les secrets de loly"},{name:"madara"},{name:"cut by fred"},{name:"marlay"}];if(window.location.hostname.includes("lafeemaraboutee"))return[{name:"Best sellers",redirectTo:"https://lafeemaraboutee.fr/collections/best-sellers"},{name:"Nouveautés",redirectTo:"https://lafeemaraboutee.fr/collections/nouveautes"},{name:"Nouvelle collection",redirectTo:"https://lafeemaraboutee.fr/collections/nouvelle-collection"},{name:"Robes & Combinaisons",redirectTo:"https://lafeemaraboutee.fr/collections/robes-combinaisons"},{name:"Sélection engagée",redirectTo:"https://lafeemaraboutee.fr/collections/un-nouveau-souffle"}];const t={index:DATA.meilisearchIndex||e(),text:"",facets:["*"],hitsPerPage:1},s=e=>Pe.includes(e);try{const e=await fetch(`${Ne}/search`,{method:"POST",body:JSON.stringify(t)});if(200!==e.status)return null;const a=await e.json();for(const[e,t]of Object.entries(a.facets))if(s(e))return t.values.sort((e,t)=>t[1]-e[1]).filter(e=>"wishlist"!==e[0]).slice(0,4).map(e=>({name:O.getTranslation(e[0])}));return[]}catch(e){return null}})();if(s&&s.length){const e=document.createElement("div");e.className=`${this.baseClassName}-recommended-categories-container`;const a=document.createElement("h3");a.className=`${this.baseClassName}-recommended-categories-title`;const i=window.location.hostname.includes("mademoiselle-bio"),r=window.location.hostname.includes("palaisdesthes");i||r?(a.innerHTML=O.getTranslation("Recherches populaires"),r&&(a.style.fontFamily="Lato")):window.location.hostname.includes("lafeemaraboutee")?a.innerHTML=O.getTranslation("Découvrez nos collections"):a.innerHTML=O.getTranslation("Categories"),e.appendChild(a);const n=document.createElement("div");n.className=`${this.baseClassName}-recommended-categories-list`;for(const e of s){const{name:t,redirectTo:s}=e,a=document.createElement("div");if(a.className=`${this.baseClassName}-recommended-category`,a.innerHTML=t,s){const e=document.createElement("a");a.style.position="relative",e.style.position="absolute",e.style.inset="0",e.style.width="100%",e.style.height="100%",e.href=s,a.appendChild(e)}else a.onclick=()=>{const{layout:e,elementReferrer:s}=DATA,a=g(s);"free"===e?Oe(a,e=>{e.value=t,le.setText(t)}):(this.searchBar?.setInputValue(t),le.setText(t))};n.appendChild(a)}e.appendChild(n),t.appendChild(e)}let a=null;a=DATA.useMarketBanners?this.getMarketBannersElement():await this.getProductRecommendationsElement(),a&&t.appendChild(a),this.recommendationsContainer=t,this.searchWidgetContainer.appendChild(this.recommendationsContainer)}async getProductRecommendationsElement(){const e=await(async()=>{if(!DATA.useRecoAndMerch)return null;const e=DATA.siteId,t=DATA.recommendationsRecoId,s=DATA.recoAndMerchApiKey;if(!e||!t||!s)return null;const[a,i]=((e,t,s)=>[`https://uc-info.eu.abtasty.com/v1/reco/${t}/recos/${e}?fields=%5B%22id%22,%22absolute_link%22,%22name%22,%22img_link%22,%22price%22%5D`,{Authorization:"Bearer "+s}])(t,e,s);try{const e=await fetch(a,{method:"GET",headers:i});return(await e.json()).items.map(e=>({id:e.id,name:B(e.name),price:e.price,img_link:e.img_link,link:e.absolute_link}))}catch(e){return null}})();if(e&&e.length){const t=document.createElement("div");t.className=`${this.baseClassName}-recommended-products-container`;const s=document.createElement("h3");s.className=`${this.baseClassName}-recommended-products-title`,s.innerHTML=O.getTranslation("Recommended Products");const a=document.createElement("div");a.className=`${this.baseClassName}-recommended-products-list`;for(const[t,s]of e.entries()){const e=new fe({isRecommendedProduct:!0,result:s,index:t,baseClassName:this.baseClassName});a.appendChild(e.getSearchResultElement())}return t.appendChild(s),t.appendChild(a),t}return null}getMarketBannersElement(){const{marketBanner1Banner:e,marketBanner2Banner:t,marketBanner3Banner:s,marketBanner1Title:a,marketBanner2Title:i,marketBanner3Title:r,marketBanner1Subtitle:n,marketBanner2Subtitle:o,marketBanner3Subtitle:c,marketBanner1Link:l,marketBanner2Link:d,marketBanner3Link:h,marketBanner1CtaText:u,marketBanner2CtaText:g,marketBanner3CtaText:b}=DATA,m=document.createElement("div");m.className=`${this.baseClassName}-recommended-products-container`;const p=[];e&&p.push({title:a,subtitle:n,imageSrc:e,link:l,ctaText:u}),t&&p.push({title:i,subtitle:o,imageSrc:t,link:d,ctaText:g}),s&&p.push({title:r,subtitle:c,imageSrc:s,link:h,ctaText:b});const y=document.createElement("div");y.className=`${this.baseClassName}-recommended-products-list`;for(const e of p){const t=document.createElement("div");t.className=`${this.baseClassName}-recommended-banner`;const s=document.createElement("h4");s.className=`${this.baseClassName}-recommended-banner-title`,s.innerHTML=e.title;const a=document.createElement("p");a.className=`${this.baseClassName}-recommended-banner-subtitle`,a.innerHTML=e.subtitle;const i=document.createElement("a");i.className=`${this.baseClassName}-recommended-banner-cta`,i.innerHTML=e.ctaText;const r=document.createElement("img");r.src=e.imageSrc,e.link&&(i.href=e.link,t.onclick=()=>{window.location.href=e.link},t.style.cursor="pointer"),t.appendChild(r),t.appendChild(s),t.appendChild(a),t.appendChild(i),y.appendChild(t)}return m.appendChild(y),m}}function je(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 Me(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?je(Object(s),!0).forEach(function(t){ze(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):je(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function ze(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}class We extends Fe{constructor(e){super(Me(Me({},e),{},{layout:"popin"})),this.target=g(DATA.elementReferrer)}init(){super.init(),this.searchWidgetContainer.appendChild(this.searchBar.searchBarContainer);const e=document.querySelector(`#${this.parentContainer.widgetContainerId} .${this.parentContainer.overlayClassName}`);e&&(e.style.backgroundColor=DATA.overlayColor,e.style.pointerEvents="all",e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.closeSearchWidget()}))}openSearchWidget(){super.openSearchWidget(),t()||this.searchBar.focusInput()}}function He(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 _e(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?He(Object(s),!0).forEach(function(t){Ve(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):He(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function Ve(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}class Ue extends Fe{constructor(e){super(_e(_e({},e),{},{layout:"free"}))}initResizeObserver(){this.resizeObserver=new ResizeObserver(()=>{this.correctWidgetPosition()});const{elementReferrer:e}=DATA,t=g(e);t&&this.resizeObserver.observe(t)}init(){super.init();const e=document.createElement("button");e.className=`${this.baseClassName}-close-button`,e.innerHTML="✕",e.onclick=()=>{this.closeSearchWidget()},this.searchWidgetContainer.insertAdjacentElement("afterbegin",e),this.initResizeObserver()}registerInputEvents(e){const t=e.closest("form");t&&(t.addEventListener("reset",e=>{e.preventDefault(),e.stopPropagation(),this.resetSearch()}),t.action=void 0,t.dataset=void 0),e.addEventListener("click",e=>{e.target.value,e.preventDefault(),e.stopPropagation()},{capture:!0}),e.addEventListener("focusin",e=>{e.target.value,e.preventDefault(),e.stopPropagation(),e.target.value=e.target.value.trim(),e.target.value||(this.openSearchWidget(),setTimeout(()=>{this.resetSearch(),this.scrollToTop()},50))},{capture:!0}),e.addEventListener("input",e=>{e.target.value,e.target.value?(this.searchOpen||this.openSearchWidget(),this.debouncedOnInput(e)):this.resetSearch()},{passive:!0}),e.addEventListener("change",e=>{e.preventDefault(),e.stopPropagation()},{capture:!0})}correctWidgetPosition(){const{elementReferrer:e}=DATA,t=g(e),s=g(`#${this.parentContainer.widgetContainerId}`);if(!t||!s)return;const{bottom:a}=t.getBoundingClientRect(),{top:i}=s.getBoundingClientRect();a!==i&&("absolute"!==DATA.typeOfPositioning?(s.style.position="relative",s.style.top=`${a}px`,this.searchWidgetContainer.style.height=`calc(100dvh - ${a}px)`,this.searchWidgetContainer.style.maxHeight=`calc(100dvh - ${a}px)`,this.searchResultsList.facetsList.setMaxHeight(a)):(s.style.position="absolute",s.style.left=0))}handleClickOutside(e){(e.composedPath?e.composedPath():e.path).includes(this.searchWidgetContainer)||this.closeSearchWidget()}openSearchWidget(){if(!super.openSearchWidget())return!1;document.addEventListener("click",this.handleClickOutside.bind(this)),DATA.useOverlay&&(this.searchWidgetOverlay=this.getSearchWidgetOverlayElement(),this.searchWidgetContainer.insertAdjacentElement("beforebegin",this.searchWidgetOverlay))}closeSearchWidget(){this.searchWidgetOverlay?.remove(),document.removeEventListener("click",this.handleClickOutside.bind(this)),super.closeSearchWidget()}async onAutocomplete(){const e=await super.onAutocomplete();this.suggestionsContainer?I(this.suggestionsContainer):(this.suggestionsContainer=document.createElement("div"),this.suggestionsContainer.className=`${this.baseClassName}-autocomplete-suggestions-container`);for(const t of e){const e=document.createElement("div");e.className=`${this.baseClassName}-autocomplete-suggestion`,e.innerHTML=t,e.title=t,e.onclick=()=>{const{elementReferrer:e}=DATA,s=g(e);Oe(s,e=>{e.value=t,le.setText(t)})},this.suggestionsContainer.appendChild(e)}this.searchWidgetContainer.insertAdjacentElement("afterbegin",this.suggestionsContainer)}resetSearch(){this.suggestionsContainer&&this.suggestionsContainer.remove(),super.resetSearch()}getSearchWidgetOverlayElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-overlay`,e.style.top=this.searchWidgetContainer.getBoundingClientRect().top+"px",e.style.backgroundColor=DATA.overlayColor,e.onclick=e=>{e.preventDefault(),e.stopPropagation(),this.closeSearchWidget()},e}}class qe{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=null,this.mutationObserver=null,this.mouseOverEvent=null,this.scrollEvent=null,this.onTransitionEnd=null,this.onIframeLoad=null}transitionOverHandler(e){const t=[e,"transitionend",this.checkElements.bind(this),!0];return this.getEvents(...t)}intersectionHandler(e){e.forEach(e=>{e.isIntersecting?(this.existingTargets.forEach(t=>{t.element.isSameNode(e.target)&&(this.inViewportTargets.push(t),this.mouseOverEvent.start(),this.scrollEvent.start(),this.onTransitionEnd.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(t=>!t.element.isSameNode(e.target)||(this.mouseOverEvent.clear(),this.scrollEvent.clear(),this.onTransitionEnd.clear(),!1))})}startVisibilityObserver(e){const t={root:e,rootMargin:"0px",threshold:.01};return this.visibilityObserver??=new IntersectionObserver(this.intersectionHandler.bind(this),t),this.visibilityObserver}startMutationObserver(e){return this.mutationObserver??=new MutationObserver(this.checkElements.bind(this)),this.mutationObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}),this.mutationObserver}onMouseOver({target:e,path:t}){const s=this.inViewportTargets.find(({element:s,selector:a})=>{if(s.isSameNode(e))return!0;const[i,,r]=a.split("[]"),n=r??i,o=[...e.querySelectorAll(n)];if(o.length&&o.includes(s))return!0;if(t.includes(s))return!0;if(!e.parentElement?.children?.length)return;const c=[...e.parentElement.children],l=c.findIndex(t=>t.isSameNode(e)),d=c.filter((e,t)=>t>l);if(d.length){if(d.includes(s))return!0;if(d.some(e=>[...e.querySelectorAll(n)].includes(s)))return!0}return!1});if(s&&this.isElementVisible(s.element)){const{selector:e,element:t,uniqueId:a}=s,i=this.targets.find(t=>t.selector===e&&t.uniqueId===a);i&&i.resolve(t),this.clear(e,a)}}getEvents(e,...t){return{start:()=>e?.addEventListener(...t),clear:()=>e?.removeEventListener(...t)}}mouseOverHandler(e){const t=[e,"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?"touchmove":"mouseover",e=>{const t=e.composedPath(),{target:s}=e;setTimeout(()=>this.onMouseOver({target:s,path:t}),50)},!0];return this.getEvents(...t)}scrollEventHandler(e){const t=[e,"scroll",(s=this.checkElements.bind(this),()=>{v||(v=!0,setTimeout(()=>{s(),v=!1},100))}),{passive:!0}];var s;return this.getEvents(...t)}isElementVisible(e){return this.isElementOpaque(e)&&this.isElementTopmost(e)}isElementOpaque(e){return"HTML"===w(e,e=>"0"===window.getComputedStyle(e).opacity).nodeName}isElementTopmost(e){const t=e.getBoundingClientRect(),s=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom],[t.left+t.width/2,t.top],[t.left+t.width/2,t.bottom],[t.left,t.height/2],[t.right,t.height/2],[t.left+t.left/2,t.height/2]];let a=!1,i=0;for(;!a&&i<s.length;){const t=e.getRootNode()?.elementFromPoint(...s[i]);a=e===t||t?.contains(e)||e.contains(t),i+=1}return a}checkElements(){this.targets.forEach(({selector:e,uniqueId:t})=>{const s=g(e),[a,,i]=e.split("[]"),r=i??a;s&&!this.existingTargets.find(e=>e.element.matches(r)&&e.uniqueId===t)&&(this.existingTargets.push({element:s,selector:e,uniqueId:t}),this.visibilityObserver.observe(s))}),this.existingTargets=this.existingTargets.filter(({selector:e,element:t})=>!(!g(e)||!t.isConnected)||(t&&this.visibilityObserver.unobserve(t),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:e,element:t,uniqueId:s})=>{const[a,,i]=e.split("[]"),r=i??a;if(t.matches(r)&&this.isElementVisible(t)){const a=this.targets.find(t=>t.selector===e&&t.uniqueId===s);return a&&a.resolve(t),this.clear(e,s),!1}return!0})}onLoadIframe(e){const t=[e.defaultView.frameElement,"load",()=>this.watch(selector,resolve,uniqueId).bind(this),{passive:!0}];return this.getEvents(...t)}watch(e,t,s){this.targets.push({selector:e,resolve:t,uniqueId:s});const{clear:a}=y(e,e=>{a();const t=e.getRootNode({composed:!0}),s="body"in t?t.body:document;this.mouseOverEvent=this.mouseOverHandler(t),this.scrollEvent=this.scrollEventHandler(t),this.onTransitionEnd=this.transitionOverHandler(t),t.defaultView?.frameElement&&(this.onIframeLoad=this.onLoadIframe(t),this.onIframeLoad.start()),this.startVisibilityObserver(t),this.startMutationObserver(s),this.checkElements()})}clear(e,t){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(s=>s.filter(({selector:s,uniqueId:a})=>s!==e&&a!==t));const s=g(e);s&&this.visibilityObserver?.unobserve(s),0===this.targets.length&&(this.mutationObserver?.disconnect(),this.onIframeLoad?.clear()),0===this.inViewportTargets.length&&(this.mouseOverEvent?.clear(),this.scrollEvent?.clear(),this.onTransitionEnd?.clear())}}const Je="ABTastyData";class Ge{constructor({triggerEvent:e,triggerSelector:t,triggerDelay:s,triggerTarget:a}){this.event=e,this.selector=Boolean(t)?t:"body",this.target="string"==typeof a?g(t):a,this.delay=1e3*s,this.triggerElements=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.promises=[],this.visibilityObservers=[],this.socialProofStore={},this.elementWaiters=[]}async onElementVisible({promise:e,resolve:t}){const s=h(`${this.event}DomReady`);this.promises.push(s);const{clear:a}=y(this.selector,()=>{const e=new qe;this.visibilityObservers.push(e),e.watch(this.selector,t,l())});return this.elementWaiters.push(a),e}onPageLoad({promise:e,resolve:t}){const s=()=>"complete"===document.readyState;if(!s()){const a=["readystatechange",()=>s()&&t(!0),{passive:!0}];return this.eventsListeners.push([document,...a]),document.addEventListener(...a),e}return t(!0),e}onClick({promise:e,resolve:t}){const s=({isTrusted:e,target:s})=>{if(e)return(s.isEqualNode(this.target)||f(s,this.selector))&&t(!0)},{clear:a}=y(this.selector,e=>{a();const t=document.createElement("style");t.id=`Click_${l()}`;const[i,,r]=this.selector.split("[]"),n=r??i;t.innerHTML=`${n} {\n\t\t\t\tcursor: pointer !important;\n\t\t\t\tpointer-events: all !important;\n\t\t\t}`;const o=e.getRootNode();("head"in o?o.head:o).appendChild(t),this.triggerElements.push(t);const c=["click",s,{passive:!0,capture:!0}];this.eventsListeners.push([o,...c]),o.addEventListener(...c)});return this.elementWaiters.push(a),e}onHover({promise:e,resolve:t}){const s=({isTrusted:e,target:s})=>{if(e)return(this.target?s.isEqualNode(this.target):f(s,this.selector))&&t(!0)},{clear:a}=y(this.selector,e=>{const t=e.getRootNode(),a="body"in t?t.body:[...t.childNodes].find(t=>t.contains(e)),i=["mouseenter",s,{passive:!0,capture:!0}];this.eventsListeners.push([a,...i]),a.addEventListener(...i)});return this.elementWaiters.push(a),e}onExitIntent({promise:e,resolve:t}){const s=["mouseleave",({isTrusted:e,clientY:s})=>{e&&s<=0&&t(!0)},{passive:!0}],{clear:a}=y("html",e=>{a(),this.eventsListeners.push([e,...s]),e.addEventListener(...s)});return e}onReengage({promise:e,resolve:t}){const s=this.delay;let a=s;const i=[...document.querySelectorAll("*:empty")].map(e=>e.contentDocument||e.shadowRoot).filter(e=>e),r=[({isTrusted:e})=>{e&&(a=s)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(e=>{[document,...i].forEach(t=>{this.eventsListeners.push([t,e,...r]),t.addEventListener(e,...r)})});const n=setInterval(()=>{a<=0?t(!0):a-=100},100);return this.intervals.push(n),e}onCustomTrigger({promise:e,resolve:t}){const{triggerEventCustomScript:s,tagIsSafeEval:a}=DATA,i=a&&DATA_JS?.triggerEventCustomScript,r="function"==typeof i?()=>new Promise(e=>i(e)):new Function(`return new Promise(async resolve => {${s}})`);return r().then(e=>e&&t(!0)),e}onScrollUp({promise:e,resolve:t}){let s=0;const a=["scroll",({isTrusted:e})=>{e&&(window.scrollY<s?t(!0):s=window.scrollY)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...a]),document.addEventListener(...a),e}onScrollPercentReached({promise:e,resolve:t}){const{triggerEventScrollPercent:s}=DATA,a=["scroll",({isTrusted:e})=>{if(!e)return;const a=(()=>{const{documentElement:e,body:t}=document,s=e.scrollTop||t.scrollTop,a=e.scrollHeight||t.scrollHeight;return Math.trunc(s/(a-e.clientHeight)*100,10)})();s<a&&t(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...a]),document.addEventListener(...a),e}checkSocialProofConditions(t,s,a,i){const r=e(),{viewInterval:n,spNoTrim:o}=DATA;if(this.socialProofStore.hasOwnProperty(t))a(this.socialProofStore[t])?i(`${this.socialProofStore[t][n]}`):i(!1);else if(t&&r){const e=e=>(this.socialProofStore[t]=e,i(!!a(e)&&`${e[n]}`));fetch(`https://api-social-proof.abtasty.com/clients/${r}/metrics/${s}?key=${t}${o?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e).catch(()=>d("Failed to fetch datas from server."))}else i(!1)}getSocialProofDatas({promise:e,resolve:t},s,r=!1){const{productKey:n,keyType:o}=(()=>{const{socialProofContentType:e,productKeyProvider:t,pathToProductKey:s,customJSProductKey:r,productSKU:n,tagIsSafeEval:o}=DATA,{pathToProductKey:c,customJSProductKey:l}=o&&DATA_JS||{};if(2===e)return{productKey:i(),keyType:"url"};{let o=null,d="sku";switch(t){case"ABTastyProductKey":o=window.ABTastyProductKey;break;case"pathToProductKey":o="function"==typeof c?c():a(`return ${s};`);break;case"customJSProductKey":o="function"==typeof l?l():a(r);break;case"productSKU":o=n}return o||3!==e||(o=i(),d="url"),{productKey:o,keyType:d}}})(),{viewInterval:c,triggerSocialProofMinVisitors:l,triggerSocialProofMinPurchases:h,triggerSocialProofMinPageViews:u}=DATA,g={pv:u,i:h,"v-pv":l}[s];return[typeof c,typeof g].includes("undefined")&&t(!1),r&&!n&&(d("Not able to find ABTastyProductKey, impossible to call the API, read documentation for more informations:\n\t\t\t\thttps://support.abtasty.com/hc/en-us/articles/4710919241628-Widgets-List#h_84c04344-c655-4e5e-b9ab-d26a798ad9b0"),t(!1)),this.checkSocialProofConditions(n,"v-pv"===s&&"sku"===o?"v-i":s,e=>{const t=void 0!==e[c]&&e[c]>=g;return t||d(`Widget will not be shown, Social Proof API returned ${e[c]} while ${g} are required`),t},t),e}onConsent({promise:e,resolve:t}){if(!n()){const s=["abtasty_consentValid",()=>t(!0)];return this.eventsListeners.push(s),window.addEventListener(...s),e}return t(!0),e}onTrackingSent({promise:e,resolve:t}){const{triggerEventTrackingSent:s}=DATA;let a=localStorage.getItem(Je);const i=()=>JSON.parse(a)?.ActionTracking?.some(({name:e})=>e===s),r=["storage",({key:e,newValue:s})=>{e===Je&&(a=s,i()&&t(!0))},{passive:!0,capture:!0}];return a&&i()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onMinPagesViewed({promise:e,resolve:t}){const{triggerEventMinPagesViewed:s}=DATA;let a=localStorage.getItem(Je);const i=()=>s<=(a?JSON.parse(a)?.VisitedPages?.length:0),r=["storage",({key:e,newValue:s})=>{e===Je&&(a=s,i()&&t(!0))},{passive:!0,capture:!0}];return a&&i()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onRageClick({promise:e,resolve:t}){const{triggerEventRageClickQuantity:s,triggerEventRageClickDelay:a}=DATA;let i=0,r=!1;const n=["click",({isTrusted:e})=>{if(e&&(i+=1,i>=s&&t(!0),!r)){r=!0;const e=setTimeout(()=>{i=0,r=!1},a);this.timeouts.push(e)}},{passive:!0,capture:!0}],o=e=>{this.eventsListeners.push([e,...n]),e.addEventListener(...n)},{clear:c}=y("iframe []contentDocument[] body > *",()=>{const e=document.getElementsByTagName("iframe");for(const t of e){"contentDocument"in t&&"body"in t.contentDocument&&o(t.contentDocument);const e=()=>o(t.contentDocument);t.addEventListener("load",e),this.eventsListeners.push([t,"onIframeLoad",e])}});return this.elementWaiters.push(c),o(document),e}clear(){this.triggerElements=this.triggerElements.filter(e=>(e.remove(),!1)),this.eventsListeners=this.eventsListeners.filter(e=>{const[t,...s]=e;return t&&s.length>1&&t.removeEventListener(...s),!1}),this.timeouts=this.timeouts.filter(e=>(clearTimeout(e),!1)),this.intervals=this.intervals.filter(e=>(clearInterval(e),!1));const e=l();return this.visibilityObservers=this.visibilityObservers.filter(t=>(t.clear(this.selector,e),!1)),this.promises=this.promises.filter(e=>(e.resolve(!1),!1)),this.elementWaiters=this.elementWaiters.filter(e=>(e(),!1)),this}async isTriggered(){this.clear();const e=h(this.event);this.promises.push(e);const t={consent:()=>this.onConsent(e),direct:()=>!0,pageLoad:()=>this.onPageLoad(e),click:()=>this.onClick(e),exitIntent:()=>this.onExitIntent(e),reengage:()=>this.onReengage(e),elementVisible:()=>this.onElementVisible(e),script:()=>this.onCustomTrigger(e),hover:()=>this.onHover(e),scrollUp:()=>this.onScrollUp(e),scrollPercent:()=>this.onScrollPercentReached(e),rageClick:()=>this.onRageClick(e),minPagesViewed:()=>this.onMinPagesViewed(e),trackingSent:()=>this.onTrackingSent(e),socialProofPurchases:()=>this.getSocialProofDatas(e,"i",!0),socialProofPageViews:()=>this.getSocialProofDatas(e,"pv"),socialProofVisitors:()=>this.getSocialProofDatas(e,"v-pv")},s=!Object.prototype.hasOwnProperty.call(t,this.event)||await t[this.event]();return s&&this.clear(),"reengage"!==this.event&&this.delay?s&&await(async()=>{const e=h(`${this.event}Delay`);this.promises.push(e);const t=setTimeout(()=>{e.resolve(!0),this.clear()},this.delay);return this.timeouts.push(t),e.promise})():s}}const Ke="display",Ze="closing",Xe="validation",Ye="ABTastyWidgets",Qe=`${Ye}Temporary`;class et{constructor({displayRecurrence:e,closingRecurrence:t,validationRecurrence:s},a){this.displayRecurrence=parseFloat(e),this.closingRecurrence=parseFloat(t),this.validationRecurrence=parseFloat(s),this.onSetCallback=a,this.widgetName=o(),this.uniqueId=l(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:e}){const t=localStorage.getItem(Qe),s=sessionStorage.getItem(Ye);"ABTastyData"===e&&!t&&s&&localStorage.setItem(Qe,s)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(e){try{const t=e.getItem(Ye);return JSON.parse(t)}catch(t){return e.removeItem(Ye),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(e,t){const{[this.recurrenceKey]:s,...a}=t;return Object.entries(a).length?(e.setItem(Ye,JSON.stringify(a)),a):(e.removeItem(Ye),!1)}removeSessionRecurrenceStorage(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}removeLocalRecurrenceStorage(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}getSessionRecurrence(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getLocalRecurrence(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}isOver(){const e=localStorage.getItem(Qe),t=!(!e||!e.includes(this.recurrenceKey))||this.getSessionRecurrence();e&&(sessionStorage.setItem(Ye,e),localStorage.removeItem(Qe));const s=this.getLocalRecurrence(),a=(s?parseFloat(s.stamp):0)<(new Date).getTime();return a&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&a&&!this.getLocalRecurrence()&&!t}setRecurrence(e,t){0!==e&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const a=this.getTypeOfStorage(e);if(s()||!a&&"object"!=typeof a)return!1;const{storageString:i,storageMethod:r}=a,o=this.getStamp(e),c={type:t,stamp:o},{type:l}=this.getCurrentRecurrence(),d=async()=>{if(!n()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=c;const e=new Ge({triggerEvent:"consent"});await e.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();let s;"session"===i?e?s=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),s=this.getSessionRecurrenceStorageParsed()):"local"===i&&(t?s=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),s=this.getLocalRecurrenceStorageParsed()));const a=s?{[this.recurrenceKey]:c,...s}:{[this.recurrenceKey]:c};r.setItem(Ye,JSON.stringify(a)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!r)return!1;if(l&&t!==Xe)if(t===Ze&&l!==Xe)d();else{if(t!==Ke||l===Xe||l===Ze)return!1;d()}else d();return o}setDisplayRecurrence(){const e=Ke;this.setRecurrence(this.displayRecurrence,e)}setClosingRecurrence(){const e=Ze;this.setRecurrence(this.closingRecurrence,e)}setValidationRecurrence(){const e=Xe;this.setRecurrence(this.validationRecurrence,e)}getStamp(e){return(new Date).getTime()+864e5*e}getTypeOfStorage(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}class tt{constructor(e,t,s){this.isWidgetApplied=e,this.callback=t,this.shouldUpdate=s,this.triggerIframeTarget=null,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.tagRollbackEventParams=["abtasty_resetActionTracking",this.onTagRollback.bind(this)],this.onCampaignLaunchedEventParams=["abtasty_executedCampaign",this.onCampaignLaunched.bind(this)]}decisionHandler(e){const t=!e&&this.isWidgetApplied(),s=t?this.shouldUpdate&&Ce:xe;return s?(this.clearWatcher(),this.callback(s,!e,t),this.watch(),this):this}onCampaignLaunched({detail:{campaignId:e}}){e===TEST_ID&&(this.callback(xe,!1),this.watch())}onTagRollback({target:e}){return this.clearWatcher(e),this.callback(ve,!1,!0),window.addEventListener(...this.onCampaignLaunchedEventParams),this}observerHandler(e){return r()?e.some(e=>["removedNodes","addedNodes"].some(t=>e[t]&&e[t].length))?this.decisionHandler():this:this.callback(ve,!1)}watch(e,s){if(t())return this;if(this.clearWatcher(e),window.removeEventListener(...this.onCampaignLaunchedEventParams),document.addEventListener(...this.tagRollbackEventParams),s?.includes("[]contentDocument[]")){const e=s.split("[]")[0].trim(),{clear:t}=y(e,e=>{t(),this.triggerIframeTarget=e,e.addEventListener("load",this.decisionHandler.bind(this))})}const a=e?.defaultView?.frameElement;a&&this.triggerIframeTarget!==a&&a.addEventListener("load",this.decisionHandler.bind(this));const{clear:i}=y("body",t=>{i();const s=e?.body||e||t;this.observer.observe(s,{childList:!0,subtree:!0})});return this}clearTriggerElementWatcher(){this.triggerIframeTarget?.removeEventListener("load",this.decisionHandler.bind(this))}clearWatcher(e){return document.removeEventListener(...this.tagRollbackEventParams),this.observer.disconnect(),this.clearTriggerElementWatcher(),e?.defaultView?.frameElement?.removeEventListener("load",this.decisionHandler.bind(this)),this}}const st=/.+\/([^.]+)\.(otf|ttf)$/,at=["socialProofPurchases","socialProofPageViews","socialProofVisitors"];class it{constructor(e,s){this.children=void 0,this.uniqueId=`${l()}${s?`_${s}`:""}`,this.widgetName=o(),this.prettyName=c(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:s,validationRecurrence:a}=DATA,i=!e&&!s&&!a;if(t()||i)return!1;const r={everytime:()=>-1,session:()=>0,once:()=>395,day:e=>DATA[`${e}_day`],week:e=>7*DATA[`${e}_week`],month:e=>30.5*DATA[`${e}_month`]},n={};return e&&(n.displayRecurrence=r[e]("displayRecurrence")),s&&(n.closingRecurrence=r[s]("closingRecurrence")),a&&(n.validationRecurrence=r[a]("validationRecurrence")),n})(),this.triggerParams=(e=>{let{triggerEvent:s}=DATA;const{triggerEventClick:a,triggerEventHover:i,triggerEventReengageDelay:r,socialProofContentType:n,triggerEventElementVisible:o,triggerEventDelay:c}=DATA;if(t()||!s&&!n)return!1;const l={click:()=>a,hover:()=>i,elementVisible:()=>o},d=Object.prototype.hasOwnProperty.call(l,s)?l[s]():"body",h="reengage"===s?r:c;return n&&(s=[,"socialProofPurchases","socialProofPageViews","socialProofVisitors"][n]),{triggerEvent:s,triggerSelector:d,triggerDelay:h,triggerTarget:e}})(e),this.recurrence=!!this.recurrenceParams&&new et(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new Ge(this.triggerParams),this.shouldUpdate=!!this.triggerParams&&at.includes(this.triggerParams.triggerEvent),this.pageWatcher=new tt(this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:e,triggerEvent:t}=DATA;return!t||!["click","hover","scrollUp","script"].includes(t)||e})(),this.basicClassName=`ab_widget_container_${this.widgetName}`,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=`${this.basicClassName}_content`,this.overlayClassName=`${this.basicClassName}_overlay`,this.closeButtonClassName=`${this.basicClassName}_close_button`,this.hideClassName=`ab_hide_${this.uniqueId}`,this.rootElement=null,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.elementsWaiters=[]}clearGivenClearables(){for(const e of this.elementsWaiters)e.clear();this.elementsWaiters=[]}isWidgetApplied(){return this.domElement?.isConnected&&this.domElement.ownerDocument?.defaultView}removeOldDomElement(){const e=this.rootElement?.getElementById(this.widgetContainerId);return e?.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const e=["free"];"drawer"===DATA.layout&&DATA.customTarget&&e.push("drawer");const t=e.includes(DATA.layout);return new Promise(e=>{const{elementReferrer:s="body",referrerInsertType:a="beforeend"}=t?DATA:{},i=y(s,t=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e.selector!==s),this.rootElement=t.getRootNode(),this.removeOldDomElement(),this.domElement.appendChild(this.styleElement),e(t.insertAdjacentElement(a,this.domElement))});this.elementsWaiters.push(i)}).then(()=>this)}remove(){this.trigger&&this.trigger.clear(),this.pageWatcher.clearWatcher(this.rootElement);for(const e of this.elementsWaiters)[DATA.elementReferrer,"body"].includes(e.selector)&&e.clear();return this.domElement?.isConnected&&this.domElement.remove(),this.hasOncePerPageTrigger?this.pageWatcher.watch(this.rootElement):t()||this.init().then(({response:e})=>e?this.show():this),this}show(){return t()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,setTimeout(()=>this.domElement.classList.remove(this.hideClassName),50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(this.rootElement),this}hide(e=!0){return!t()&&this.hasBeenShown&&e&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),e&&(this.pageWatcher.clearWatcher(this.rootElement),this.closedByUser=!0),this.domElement.classList.add(this.hideClassName),this}async init(e){const s=t(),a=r(),i=this.trigger?.promises?.length,n=!this.recurrence||this.recurrence.isOver();if(!s&&!a||i||!n)return{container:this,response:!1};this.pageWatcher.watch(this.rootElement||document,this.triggerParams.triggerSelector);const o=s||!this.trigger||this.trigger&&await this.trigger.isTriggered();this.pageWatcher.clearTriggerElementWatcher();const c={container:this,response:o};return o?(await this.insert(),this.addCloseEvent(),s||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(o),c):c}onPageChange(e,t,s){const a=()=>this.init().then(({response:e})=>{e?this.show():this.hide(!1)});t||(this.hasBeenShown=!1,s&&this.domElement.remove(),this.trigger&&this.trigger.clear());const i={[ve]:()=>s?this.remove():this.pageWatcher.watch(this.rootElement),[xe]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):s||this.insert().then(e=>e.show()).catch(this.pageWatcher.watch):a()},[Ce]:()=>{this.hasBeenShown?this.pageWatcher.watch():a()}};"function"==typeof i[e]&&i[e]()}addCloseEvent(...e){const{closeButton:s,overlay:a,overlayClickable:i,layout:r,animationDuration:n=1e3}=DATA,o=[];if(void 0!==a&&!0!==a||!0!==i||"popin"!==r||o.push(`.${this.overlayClassName}`),void 0!==s&&s&&o.push(`.${this.closeButtonClassName}`),!o.length)return this;const c=this.domElement.querySelectorAll(o.join(", "));if(!c.length)return this;const l=["click",e=>{(e=>{t()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())})(e),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(!0),setTimeout(()=>this.remove(),1.05*n)},{once:!0,capture:!0}];e.push(...c);for(const s of e)t()&&(s.dataset.abtastyActionnable="true"),s.removeEventListener(...l),s.addEventListener(...l);return this}getDom(){const{closeButton:e,layout:t,overlayClickable:s,overlay:a=!0}=DATA,i=document.createElement("div");return i.className=`${this.basicClassName} ${this.hideClassName}`,i.id=this.widgetContainerId,["popin","bannerTop","bannerBottom"].includes(t)&&(i.role="dialog"),i.innerHTML=`\n\t\t\t${"popin"===t&&!0===a?`<div ${s?'aria-label="Close dialog"':""} class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${e?`<button class="${this.closeButtonClassName}" aria-label="Close dialog"><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,i}loadFont(e,t){if(!e||"inherit"===e||!/otf|ttf/g.test(t))return;const s=document.createElement("style"),a=t.match(st)?t.match(st)[1]:"";s.innerHTML=`@font-face { font-family: '${e}_${a}'; src: url('${t}'); font-display: swap; }`;const i=this.rootElement?.head||document.head;i?.appendChild(s)}getStyleTag(e="",s=DATA){const{noStyles:a,layout:i}=s,{backgroundColor:r,isBackgroundImage:n,backgroundImage:o,backgroundSize:c,backgroundPosition:l,backgroundRepeat:d,borderColor:h,borderRadius:u,borderWidth:g,textColor:b,textAlign:m,fontName:p,fontStyle:y,fontSize:w,isTitle:f,titleTextAlign:v,titleTextColor:x,titleFontName:C,titleFontStyle:k,titleFontSize:S,overlay:E,overlayColor:A,dropShadow:T,dropShadowColor:N,dropShadowBlur:R,containerMargin:P,containerPadding:L,closeButton:B,closeButtonPosition:I,closeButtonSize:D,closeButtonBorderRadius:O,closeButtonBorderWidth:F,closeButtonBorderColor:j,closeButtonColor:M,closeButtonBackgroundColor:z,buttonsAlign:W,buttonsBorderWidth:H,buttonsBorderColor:_,buttonsBorderRadius:V,buttonsBackgroundColor:U,buttonsTextColor:q,buttonsFontName:J,buttonsFontStyle:G,buttonsFontSize:K,secondLink:Z,secondLinkBorderWidth:X,secondLinkBorderColor:Y,secondLinkBorderRadius:Q,secondLinkBackgroundColor:ee,secondLinkTextColor:te,secondLinkFontName:se,secondLinkFontStyle:ae,secondLinkFontSize:ie,animation:re,animationDuration:ne,animationBehaviour:oe,animationSlideDirection:ce}=a?{}:s,le=document.createElement("style");t()&&le.setAttribute("abtasty-script-added","true"),this.loadFont(p,y),this.loadFont(C,k),this.loadFont(J,G),this.loadFont(se,ae);const de=`background: ${["string"==typeof r?r:"rgba(255, 255, 255, 1)",n&&"string"==typeof o&&o.length?`url(${o})`:"",n&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",n&&"string"==typeof c?`/ ${c}`:"/ auto",n&&d&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,he="number"==typeof g&&g>0,ue=`border: ${[he?`${g}px`:"unset",he?"solid":"",he&&"string"==typeof h&&h.length?h:""].join(" ").trim()};`,ge=void 0!==u?`border-radius: ${u}px;`:"",be=void 0!==b?`color: ${b}; fill: ${b}; -webkit-text-fill-color: ${b};`:"",me=void 0!==m?`text-align: ${m};`:"",pe=p&&"inherit"!==p?`font-family:${p}_${y.match(st)?y.match(st)[1]:""};`:y||"",ye=w?`font-size: ${w}px;`:"",we=void 0!==T&&T?`box-shadow: 0 5px ${R}px 0 ${N};`:"",fe=P instanceof Array&&1===P.length&&P[0],ve=fe?`margin: ${fe.top}px ${fe.right}px ${fe.bottom}px ${fe.left}px;`:"",xe=fe?`margin: calc(${fe.top}px * 0.5) calc(${fe.right}px * 0.5) calc(${fe.bottom}px * 0.5) calc(${fe.left}px * 0.5);`:"",Ce=L instanceof Array&&1===L.length&&L[0],ke=Ce?`padding: ${Ce.top}px ${Ce.right}px ${Ce.bottom}px ${Ce.left}px;`:"",Se=Ce?`padding: calc(${Ce.top}px * 0.5) calc(${Ce.right}px * 0.5) calc(${Ce.bottom}px * 0.5) calc(${Ce.left}px * 0.5);`:"",Ee=void 0!==H&&H?`border-width: ${H}px; border-style: solid;`:"",Ae=[_,H].every(e=>void 0!==e)&&H?`border-color: ${_};`:"",$e=void 0!==V?`border-radius: ${V}px;`:"",Te=void 0!==U?`background-color: ${U};`:"",Ne=void 0!==q?`color: ${q}; fill: ${q}; -webkit-text-fill-color: ${q};`:"",Re=J&&"inherit"!==J?`font-family:${J}_${G.match(st)?G.match(st)[1]:""};`:G||"",Pe=K?`font-size: ${K}px;`:"",Le="number"==typeof X?`border-width: ${X}px; border-style: solid;`:"",Be=[Y,X].every(e=>void 0!==e)&&X?`border-color: ${Y};`:"",Ie=void 0!==Q?`border-radius: ${Q}px;`:"",De=void 0!==ee?`background-color: ${ee};`:"",Oe=void 0!==te?`color: ${te}; fill: ${te}; -webkit-text-fill-color: ${te};`:"",Fe=se&&"inherit"!==se?`font-family:${se}_${ae.match(st)?ae.match(st)[1]:""};`:ae||"",je=ie?`font-size: ${ie}px;`:"",Me="popin"!==i||void 0!==E&&!0!==E?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==A?A:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),ze="number"==typeof D?D:16,We=ze/2,He=a||void 0!==B&&B?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===I?`bottom: calc(100% + ${We}px)`:`top: ${We}px`)+";",`right: ${We}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof O?`border-radius: ${O}px;`:"","number"==typeof F&&F>0?`border: ${F}px solid ${void 0!==j?j:"rgba(57, 57, 57, 1)"};`:"","string"==typeof z?`background-color: ${z};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${ze}px;`,`height: ${ze}px;`,"string"==typeof M?`fill: ${M};`:"","}"].join(""):"",_e=f&&"string"==typeof x?[`#${this.widgetContainerId} .${this.contentClassName} > * h1, `,`#${this.widgetContainerId} .${this.contentClassName} > * h2, `,`#${this.widgetContainerId} .${this.contentClassName} > * h3, `,`#${this.widgetContainerId} .${this.contentClassName} > * h4, `,`#${this.widgetContainerId} .${this.contentClassName} > * h5, `,`#${this.widgetContainerId} .${this.contentClassName} > * h6 {`,`color: ${x}; fill: ${x}; -webkit-text-fill-color: ${x};`,void 0!==v?`text-align: ${v};`:"",C&&"inherit"!==C?`font-family:${C}_${k.match(st)?k.match(st)[1]:""};`:k||"",S?`font-size: ${S}px;`:"","}"].join(""):"";let Ve="";if("string"==typeof re){const e=(ne/1e3).toFixed(2),s=["top","bottom"].includes(ce),a=Number(s),i=[(["top","left"].includes(ce)?"-":"")+"100vmax",this.translateValues?this.translateValues[a]:"0"];s&&i.reverse(),Ve={none:[`.${this.hideClassName} {`,"opacity: 0 !important;","}"],fade:[`.${this.hideClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} {`,`transition: opacity ${e}s ${oe};`,"}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${e}s ${oe};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${i.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${e}s ${oe};`,"}"]}[t()&&!ABTASTY_S.WIDGETS.animationChanged?"none":re].join("")}const Ue=[`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,`margin-${"fill"===W?"top":"left"}: 8px;`,Le,Be,Ie,De,Oe,Fe,je,"}",`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,Oe,Fe,je,"}"];return le.textContent=[`#${this.widgetContainerId} style { display: none; }`,`.${this.hideClassName} {`,"pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,de,ge,ue,be,me,we,ve,pe,ye,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,be,me,pe,ye,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",ke,pe,ye,"}",`#${this.widgetContainerId} .${this.contentClassName} a {`,"text-decoration: underline;","}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a, `,`#${this.widgetContainerId} .${this.contentClassName} button {`,"text-decoration: none;","box-sizing: border-box;","display: inline-block;",Ee,Ae,$e,Te,Ne,Re,Pe,"}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a *:not(.second_link span), `,`#${this.widgetContainerId} .${this.contentClassName} button:not([class*="close_button"], [class*="csatEmojiButton"]) * {`,Ne,Re,Pe,"}",...Z?Ue:[],"@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,xe,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,Se,"}","}",Me,He,_e,Ve,`${e}`].join(""),le}}class rt extends it{constructor(e,t){super(e,t),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const nt=["top: 0;","top: 50%;","bottom: 0;"],ot=["left: 0;","left: 50%;","right: 0;"],ct=e=>1===e?"-50%":0,lt=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:e,y:t}]}=DATA,s=`translate(${ct(t)}, ${ct(e)});`;return`${nt[e]}${ot[t]}transform: ${s}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},dt=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,ht=()=>{if(dt())return"width: auto; height: auto; min-width: fit-content;";const{popinPercentWidth:e,popinPixelsWidth:t,widthUnit:s,autoHeight:a,popinPercentHeight:i,popinPixelsHeight:r,heightUnit:n}=DATA;return`width: ${"px"===s?t:e}${s};height: ${a?"auto":`${"px"===n?r:i}${n}`};`};class ut extends it{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(e=>ct(e)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:e,zindexCustom:t,widthUnit:s}=DATA,a="string"!=typeof DATA.overlay&&DATA.overlay;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===e?t:e};`,"background: none;","pointer-events: "+(a?"all":"none"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",lt(),ht(),"pointer-events: all","}",`${dt()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${!dt()&&["px","em"].includes(s)?["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join(""):""}`].join("")}}(async()=>{d("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:s}of e){if(!t||"inherit"===t||!/otf|ttf/g.test(s))continue;const e=document.createElement("style"),a=s.match(x)?s.match(x)[1]:"";e.innerHTML=`@font-face { font-family: '${t}_${a}'; src: url('${s}'); font-display: swap; }`,document.head.appendChild(e)}})(),void 0===DATA.layout&&Object.assign(DATA,{layout:"popin",popinPosition:[{x:0,y:0}],popinPercentWidth:100,popinPercentHeight:100,widthUnit:"vw",heightUnit:"vh",zindex:9999,autoWidth:!1,autoHeight:!1});const e="free"===DATA.layout?new rt:new ut,s={parentContainer:e},a="free"===DATA.layout?new Ue(s):new We(s);return e.init(!0).then(s=>{let{response:i}=s;if(i){const s=e.domElement.querySelector(`.${e.contentClassName}`);a.init(),a.insert(s,"beforeend");const{elementReferrer:i}=DATA;y(i,e=>{if("free"===DATA.layout)Oe(e,e=>{const t=e.cloneNode(!0);a.registerInputEvents(t),e.parentElement.replaceChild(t,e)});else{if(!e)return;"static"===getComputedStyle(e).position&&(e.style.position="relative");const t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.backgroundColor="transparent",t.style.cursor="pointer",t.style.zIndex="10",t.style.display="block",t.onclick=e=>{e?.preventDefault?.(),e?.stopPropagation?.(),a.openSearchWidget()},e.appendChild(t)}});const r=!!document.querySelector(".abtasty-search-widget-container")?.classList.contains("open");t()&&t()&&top.document.documentElement.classList.contains("widget-react-form-opened")&&!r?a.openSearchWidget():t()&&r&&a.closeSearchWidget()}}),a})().then(()=>{})}();
|