@abtasty/search 1.14.5 → 1.14.6

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.
Files changed (2) hide show
  1. package/dist/main.js +1 -1
  2. 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),m=e=>u(e,!0),b=(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=()=>{},f=(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(()=>f(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}=b(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}=b(s,e);return n(),{selector:e,clear:r,observe:n}};function y(e,t){const s=e.parentElement||e.getRootNode().host;return t(e)||!s?e:y(s,t)}const w=(e,t)=>[...m(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="div.abtasty-search-widget-container",A=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(x)?t.match(x)[1]:""};`:t||"",T=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;`:""},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:m,searchBarInputBorderWidth:b,searchBarInputPadding:p,searchBarInputAndSearchIconMargin:f}=DATA,y=A(l,h),w=T(p);return["@container widget-container (width >= 575.98px) {",`${C} div.abtasty-search-widget-search-bar-container {`,`background-color: ${s};`,"}","}",`${C} div.abtasty-search-widget-search-bar-content {`,`max-width: ${i}${r};`,"}",`${C} div.abtasty-search-widget-search-bar {`,`background-color: ${o};`,`border-color: ${e};`,m?`border-radius: ${m}px;`:"",b?`border-width: ${b}px;`:"border: unset;",w,"}",`${C} button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon {`,`background-color: ${a};`,"}",`${C} input.abtasty-search-widget-search-input {`,`text-align: ${c};`,y,`font-size: ${d}px;`,u?`color: ${g};`:`color: ${t};`,"}",`${C} i.abtasty-search-widget-search-icon {`,`margin-right: ${f}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:m,facetTitleCustomFontColor:b,facetTitleTextColor:p,borderRadius:f,filtersButtonBackgroundColor:y,filtersButtonTextColor:w,filtersButtonBorderColor:v,filtersButtonBorderWidth:x,filtersButtonBorderRadius:S,filtersButtonPadding:E,sortButtonPadding:R,sortButtonBackgroundColor:N,sortButtonTextColor:P,sortButtonBorderColor:B,sortButtonBorderWidth:L,sortButtonBorderRadius:D}=DATA,I=A(n,c),O=A(u,m),F=l?`color: ${d};`:`color: ${a};`,j=b?`color: ${p};`:`color: ${i};`,{borderStyle:M,borderRadiusStyle:z}=k(v,x,S),{borderStyle:W,borderRadiusStyle:_}=k(B,L,D),H=w?`color: ${w};`:`color: ${a};`,U=P?`color: ${P};`:`color: ${a};`,V=T(E),q=T(R);return[`${C} details.abtasty-search-widget-search-facet summary {`,`text-align: ${r};`,I,`font-size: ${o}px;`,F,"}",`${C} label.abtasty-search-widget-search-facet-checkbox-container {`,`text-align: ${h};`,O,`font-size: ${g}px;`,j,"}",`${C} button.abtasty-search-widget-search-sort-button {`,`background-color: ${N||s};`,W,_,U,q,"}",`${C} button.abtasty-search-widget-search-filters-button.active,`,`${C} button.abtasty-search-widget-search-filters-button {`,"display: flex;",`background-color: ${y||s};`,H,M,z,V,"}",`${C} button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon,`,`${C} button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon {`,w?`background-color: ${w};`:`background-color: ${a};`,"}",`${C} button.abtasty-search-widget-search-sort-button i.abtasty-search-widget-search-sort-button-icon {`,P?`background-color: ${P};`:`background-color: ${a};`,"}",`${C} div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active {`,H,"}","@container widget-container (width <= 575.98px) {",`#${e} .${t} ${C} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} ${C} button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} ${C} button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${f}px;`,"}",`#${e} .${t} ${C} button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},R=(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:m,searchResultPriceFontStyle:b,searchResultPriceCustomFontColor:p,searchResultPriceTextColor:f,searchResultBackgroundColor:y,searchResultBorderColor:w,searchResultBorderWidth:v,searchResultBorderRadius:x,searchResultCaptionCustomFontColor:T,searchResultCaptionTextColor:S,searchResultCaptionFontName:E,searchResultCaptionFontStyle:R,searchResultCaptionFontSize:N,searchResultCtaButtonBackgroundColor:P,searchResultCtaButtonTextColor:B,searchResultCtaButtonBorderColor:L,searchResultCtaButtonBorderWidth:D,searchResultCtaButtonBorderRadius:I,searchResultCaptionUppercase:O,searchResultCtaButtonPadding:F,searchResultCtaButtonFontSize:j,searchResultCtaButtonFontName:M,searchResultCtaButtonFontStyle:z,searchResultAddToCartButtonBackgroundColor:W,searchResultAddToCartButtonTextColor:_,searchResultAddToCartButtonBorderColor:H,searchResultAddToCartButtonBorderWidth:U,searchResultAddToCartButtonBorderRadius:V,searchResultAddToCartButtonPadding:q,searchResultAddToCartButtonFontSize:G,searchResultAddToCartButtonFontName:J,searchResultAddToCartButtonFontStyle:K,searchResultAddToCartPlainText:Z}=DATA,Y=A(n,c),X=A(E,R),Q=A(g,b),ee=A(J,K),te=A(M,z),se=l?`color: ${d};`:`color: ${i};`,ae=T?`color: ${S};`:`color: ${i};`,ie=p?`color: ${f};`:`color: ${i};`,re=B?`color: ${B};`:`color: ${s};`,ne=_?`color: ${_};`:`color: ${s};`,{borderStyle:oe,borderRadiusStyle:ce}=k(H,U,V),{borderStyle:le,borderRadiusStyle:de}=k("#D8D8E2",v,x,!0),{borderStyle:he,borderRadiusStyle:ue}=k(L,D,I),ge=window.location.hostname.includes("palaisdesthes");return[`${C} div.abtasty-search-widget-search-result-card {`,`background-color: ${y};`,le,de,"}",`${C} div.abtasty-search-widget-search-result-card:hover {`,`border-color: ${w||s};`,"}",`${C} div.abtasty-search-widget-search-result-content {`,"center"===r?"align-items: center;":"","}",`${C} div.abtasty-search-widget-search-result-name {`,`text-align: ${r};`,Y,`font-size: ${o}px;`,se,"}",`${C} div.abtasty-search-widget-search-result-caption {`,`text-align: ${h};`,ae,`font-size: ${N}px;`,X,O?"text-transform: uppercase;":"","}",`${C} div.abtasty-search-widget-search-result-price {`,`text-align: ${u};`,Q,`font-size: ${m}px;`,ie,"}",`${C} div.abtasty-search-widget-search-result-price span {`,`color: ${a};`,"}",`#${e} .${t} ${C} button.abtasty-search-widget-search-result-add-to-cart {`,"display: flex;",`background-color: ${s};`,"}",`${C} button.abtasty-search-widget-search-result-cta-button {`,`background-color: ${P};`,te,re,he,ue,F&&1===F.length&&F[0]?`padding: ${F[0].top}px ${F[0].right}px ${F[0].bottom}px ${F[0].left}px;`:"",`font-size: ${j}px;`,"}",...Z?[`#${e} .${t} ${C} button.abtasty-search-widget-search-result-add-to-cart .add-to-cart-content {`,"content: none;","}"]:[],`#${e} .${t} ${C} button.abtasty-search-widget-search-result-add-to-cart {`,`background-color: ${W};`,ee,ne,oe,ce,q&&1===q.length&&q[0]?`padding: ${q[0].top}px ${q[0].right}px ${q[0].bottom}px ${q[0].left}px;`:"",`font-size: ${G}px;`,"}",...ge?["@container widget-container (width <= 575.98px) {",`${C} div.abtasty-search-widget-search-result {`,"display: flex;","flex-direction: column;","}",`${C} a.abtasty-search-widget-search-result-image-container {`,"margin-inline: auto;","margin-bottom: 12px;","}",`${C} div.abtasty-search-widget-recommended-categories-list {`,"flex-direction: row;","}",`${C} div.abtasty-search-widget-recommended-category:not(:last-child)::after {`,"content: '|';","margin-inline: 6px;","}","}"]:[]].join("")},N=()=>{const{noResultTextAlign:e,noResultFontName:t,noResultFontSize:s,noResultFontStyle:a,noResultTextColor:i}=DATA,r=A(t,a);return[`${C} div.abtasty-search-widget-search-no-result {`,`text-align: ${e};`,r,`font-size: ${s}px;`,`color: ${i}; -webkit-text-fill-color: ${i} !important;`,"}"].join("")},P=()=>{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[`${C} div.abtasty-search-widget-recommended-banner {`,`color: ${i};`,"}","@container widget-container (width <= 575.98px) {",`${C} div.abtasty-search-widget-recommended-banner {`,`background-color: ${e};`,r,n,"}","}"].join("")},B=(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};`,m=`color: ${a};`,b=void 0!==o&&o?`box-shadow: 0 5px ${l}px 0 ${c};`:"",{borderStyle:p,borderRadiusStyle:f}=k(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} ${C} button.abtasty-search-widget-close-button:hover {`,"background: transparent;","}",`${C} {`,`background-color: ${i};`,b,p,f,"}",`${C} 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;","}",`${C} button.plain {`,`background-color: ${a};`,g,`border-radius: ${r}px;`,"}",`${C} button.plain.inverted {`,m,"}",`${C} button.abtasty-search-widget-search-facet-show-more {`,m,"}",`${C} div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active,`,`${C} label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark,`,`${C} div.abtasty-search-widget-range-slider div.range-handle-value,`,`${C} div.abtasty-search-widget-range-slider div.range-progress {`,`background-color: ${a};`,"}",`#${e} .${t} ${C} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,`background-color: ${a};`,`border-color: ${a};`,g,"}",`${C} span.abtasty-search-widget-search-facet-checkbox-checkmark:after,`,`${C} div.abtasty-search-widget-range-slider div.range-handle-value {`,g,"}",...n?[`${C} div.abtasty-search-widget-search-bar-close-button-container,`,`${C} div.abtasty-search-widget-recommendations-container,`,`${C} div.abtasty-search-widget-search-result-container.abt-search-visible,`,`${C} 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} ${C} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} ${C} button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} ${C} button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${r}px;`,"}",`#${e} .${t} ${C} button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},L=(e,t)=>{const{layout:s,typeOfPositioning:a}=DATA;return[..."free"===s&&"absolute"===a?[`#${e} .${t} {`,"width: 100vw;","}",`${C} {`,"left: 50%;","transform: translateX(-50%);","width: 80vw;","}","@media (max-width: 575.98px) {",`${C} {`,"left: unset;","transform: unset;","margin-inline: auto;","width: 90vw;","}","}"]:[],`${C} div.abtasty-search-widget-recommended-categories-container,`,`${C} div.abtasty-search-widget-search-facets-list {`,`padding-top: ${"popin"===DATA.layout?"16px":"32px"};`,"}",`${C} div.abtasty-search-widget-recommended-products-container,`,`${C} div.abtasty-search-widget-search-result-list-container {`,`padding-top: ${"popin"===s?"32px":"48px"};`,"}","@container widget-container (width <= 575.98px) {",`${C} div.abtasty-search-widget-search-result-list-container {`,`padding-top: ${"popin"===s?"16px":"48px"};`,"}",`${C} div.abtasty-search-widget-recommended-products-container {`,"padding-top: 0px;","}","}"].join("")},D={searchResultMainInformationOrderName:"name",searchResultMainInformationOrderRating:"rating",searchResultMainInformationOrderCaption:"caption",searchResultMainInformationOrderPrice:"price"},I=e=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`,O=e=>{const t=DATA.language||"fr-FR";return new Intl.NumberFormat(t,{style:"currency",currency:t.includes("fr")?"EUR":"USD"}).format(e)},F=(e,t)=>{let s=null;return function(){for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];window.clearTimeout(s),s=window.setTimeout(()=>{e(...i)},t)}},j=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)};class M{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 z=new class{constructor(){this.translationKeys={}}init(){try{const e=JSON.parse(DATA.translationKeys);this.translationKeys=e}catch(e){}}getTranslation(e,t){const s=this.translationKeys[e];return s&&""!==s?s.replace("{{QUERY}}",t||""):e}};function W(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function _(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?W(Object(s),!0).forEach(function(t){H(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):W(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function H(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}z.init();const U=()=>[{value:"relevance",label:z.getTranslation("Relevance")},{value:"price:asc",label:`↑ ${z.getTranslation("Price")}`},{value:"price:desc",label:`↓ ${z.getTranslation("Price")}`}],V=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]=_(_({},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]})}):"range"===i.type?e[a]=_({},i):e[a]=_(_({},i),{},{values:{min:0,max:0}})),e},_({},t))},q="RESET",G="SET_TEXT",J="SET_TOTAL_HITS",K="SET_SORT",Z="SET_LIST_FILTERS",Y="SET_RANGE_FILTERS",X="REMOVE_RANGE_FILTERS",Q="RESET_FILTERS",ee="GET_NEXT_PAGE",te="SET_RESULTS",se="UPDATE_RESULTS",ae="ADD_RESULTS";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={results:[],facets:{},redirectTo:void 0},ce=function(){let e=re({},oe);const t=new M;return re({get state(){return e},get observable(){return t},checkAndApplyRedirection:()=>!!e.redirectTo&&(window.location.href=e.redirectTo,!0)},{logState(t){JSON.parse(JSON.stringify(e))},setResults(s,a,i){e.results=s,e.facets=a,e.redirectTo=i,t.notify({type:te}),this.logState("setResults")},updateResults(s){e.results=s,t.notify({type:se}),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:ae,payload:s}),this.logState("addResults")},updateFacets(t){const s=V(t,e.facets,!0);this.setFacets(s),this.logState("updateFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=re({},oe),this.logState("reset")}})}();class le{constructor(e){let{baseClassName:t,onInput:s,closeSearchWidget:a,resetSearch:i}=e;this.baseClassName=t,this.onInput=s,this.closeSearchWidget=a,this.resetSearch=i,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}getSearchBarContent(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-content`,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=z.getTranslation("Search..."),e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,e.addEventListener("keypress",t=>{"Enter"===t.key&&!ce.checkAndApplyRedirection()&&DATA.useRedirectionUrl&&DATA.redirectionUrl&&e.value&&(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=this.resetSearch,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.searchBarContent=document.createElement("div"),this.searchBarContent.className=`${this.baseClassName}-search-bar-content`,this.searchBarContent.appendChild(t),this.searchBarContainer.appendChild(this.searchBarContent)}}function de(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?de(Object(s),!0).forEach(function(t){ue(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):de(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function ue(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 ge={text:"",previousFilters:{},filters:{},sort:["relevance"],page:1,totalPages:0,totalHits:0},me=function(){let e=he({},ge);const t=new M;return he({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:G}),this.logState("setText")},setPage(s){e.page=s,e.page<=e.totalPages&&t.notify({type:ee}),this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(s){e.totalHits=s,t.notify({type:J}),this.logState("setTotalHits")},setSort(s){e.sort=""===s?[]:[s],t.notify({type:K}),this.logState("setSort")},updateRangeFilter(s,a,i){e.filters[s]=[{operator:">=",value:a},{operator:"<=",value:i}],t.notify({type:Y}),this.logState("updateRangeFilter")},removeRangeFilter(s){const a=he({},e.filters);delete a[s],e.filters=a,t.notify({type:X}),this.logState("removeRangeFilter")},updateFilterArray(s,a,i){const r=he({},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:Z})},setPreviousFilters(t){e.previousFilters=t,this.logState("setPreviousFilters")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},t.notify({type:Q}),this.logState("resetFilters")},resetRangeFilters(){const t=he({},e.filters);for(const[e,s]of Object.entries(t))Array.isArray(s)&&2===s.length&&"object"==typeof s[0]&&delete t[e];e.filters=t,this.logState("resetRangeFilters")},resetPagination(){e.page=1,e.totalPages=0,this.logState("resetPagination")},resetCurrentPage(){e.page=1,this.logState("resetCurrentPage")},reset(){e=he({},ge),t.notify({type:q}),this.logState("reset")}})}();class be{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=I(this.facet.title),t=z.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 pe extends be{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=(me.state.filters[this.facet.title]||[]).includes(s),o=(me.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?z.getTranslation("See less"):z.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=(me.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;me.resetPagination(),ce.clearResults(),me.resetRangeFilters(),me.updateFilterArray(this.facet.title,t,e)},r.appendChild(o),r.appendChild(n),a.appendChild(r),a}updateFacetContent(){j(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 fe{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 m=()=>{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}},b=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+"%"})(),m()},f=()=>{if(!d)return;d=!1,h=null;const{minValue:e,maxValue:t}=m();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[a,r].forEach(e=>{e.addEventListener("mousedown",b),e.addEventListener("touchstart",b,{passive:!1})}),document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",f),document.addEventListener("touchcancel",f),{rangeContainer:e,valuesContainer:o}}}class ye extends be{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 fe({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}=ce.state.facets[this.facet.title]?.values,r=!(void 0===a||void 0===i||Math.floor(a)!==Number(t)||Math.ceil(i)!==Number(s));me.resetPagination(),ce.clearResults(),r?me.removeRangeFilter(this.facet.title):me.updateRangeFilter(this.facet.title,t,s)};createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){j(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new fe({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 we{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getSortFacetElement(),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case q:case K:this.updateSortValue()}})}updateSortValue(){this.element.querySelectorAll(".active").forEach(e=>{e.classList.remove("active"),e.disabled=!1});const e=this.element.querySelector(`[data-value="${me.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=U();for(const s of t){const t=document.createElement("button");t.classList.add(`${this.baseClassName}-search-sort-option`),(""===s.value&&0===me.state.sort.length||me.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=()=>{me.resetCurrentPage(),ce.clearResults(),me.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=`${z.getTranslation("Sort By")}:`,e.appendChild(t),e.appendChild(this.getSortOptionsElements()),e}}class ve{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getInfosElement(),me.observable.subscribe(e=>{let{type:t}=e;t===J&&(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=z.getTranslation(me.state.totalHits>1?"results":"result");return`<span><b>${me.state.totalHits}</b> ${e}</span>`}}class xe{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(){j(this.sidePanelContent),this.sidePanelContent.append(...arguments)}}class Ce{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 xe({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 xe({baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,type:"sort",content:this.sortFacet.element,onPanelOpen:this.onPanelOpen.bind(this),onPanelClose:this.onPanelClose.bind(this)})),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case Z:case Y:case X:case Q: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(me.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 we({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=z.getTranslation("Clear results"),a.onclick=this.onFiltersReset;const i=document.createElement("div");i.className=`${this.baseClassName}-search-facets-list-header`,this.searchInfos=new ve({baseClassName:this.baseClassName});const r=document.createElement("button");return r.className=`plain ${this.baseClassName}-search-facets-list-bottom-close-button`,r.innerHTML=z.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;(t=this.facetsList)&&[...t.children].forEach(e=>{e.tagName.toLowerCase()==="details".toLowerCase()&&e.parentNode.removeChild(e)}),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?ye:pe)({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 ye).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof pe).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}}class Ae{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?.();const{addToCartButtonJs:t,tagIsSafeEval:s}=DATA,a=s&&DATA_JS?.addToCartButtonJs;("function"==typeof a?a:new Function("result","addToCartButton",t))(this.result,this.addToCartButton.firstElementChild)}onClick(e){return window.abtasty.send("event",{ec:"Action Tracking",ea:"searchResultClicked",el:this.isRecommendedProduct?`recommendedProduct|${this.result.id}`:`${me.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=z.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=O(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=this.result.redirect||this.result.link,t=document.createElement("div");if(t.onclick=this.onClick.bind(this),DATA.attachMetadata&&this.result.metadata)for(const[e,s]of Object.entries(this.result.metadata)){const a=e.toLowerCase().replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));s&&(t.dataset[a]=s)}t.className=`${this.baseClassName}-search-result-card`;const s=this.index<6&&this.index<window.innerHeight/200*2,a=document.createElement("div");a.className=`${this.baseClassName}-search-result result-${this.index}`;const i=document.createElement("a");i.className=`${this.baseClassName}-search-result-image-container`;const r=document.createElement("img");r.alt=this.result.name,r.className=`${this.baseClassName}-search-result-image ${s?"":"lazy"}`,s?r.src=this.result.img_link:r.dataset.src=this.result.img_link,i.appendChild(r);const n=document.createElement("div");n.className=`${this.baseClassName}-search-result-content`;const o=Object.entries(D).map(e=>{let[t,s]=e;return{key:s,order:DATA[t]}}).sort((e,t)=>e.order-t.order);if(o.forEach(t=>{if(this.result[t.key])if(t.key!==D.searchResultMainInformationOrderRating){if(t.key===D.searchResultMainInformationOrderPrice&&t.order<o.length){const e=this.getPricingElement();n.appendChild(e)}else if(t.key!==D.searchResultMainInformationOrderPrice){let s=document.createElement("div");if(s.className=`${this.baseClassName}-search-result-${t.key}`,s.textContent=this.result[t.key],"name"===t.key&&DATA.useSearchResultCtaButton){const t=document.createElement("a");t.href=e,t.style.cursor="pointer",t.appendChild(s),s=t}n.appendChild(s)}}else{const e=this.getRatingElement().outerHTML;n.appendChild(e)}}),o[o.length-1].key===D.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),n.appendChild(e)}this.addToCartButton=document.createElement("button"),this.addToCartButton.className=`${this.baseClassName}-search-result-add-to-cart ${DATA.searchResultAddToCartPlainText?"plain-text":""}`,this.addToCartButton.onclick=this.onAddToCart.bind(this),this.addToCartButton.innerHTML=`<div class="add-to-cart-content" data-label="Add to cart">\n\t\t\t${DATA.searchResultAddToCartButtonText?DATA.searchResultAddToCartButtonText:""}</div>`;let c=null;if(DATA.useSearchResultCtaButton){c=document.createElement("a"),c.href=e,c.style.cursor="pointer";const t=document.createElement("button");t.className=`plain inverted ${this.baseClassName}-search-result-cta-button`,t.innerHTML=DATA.searchResultCtaButtonText,c.appendChild(t)}else i.classList.add("no-cta");return i.href=e,i.style.cursor="pointer",a.appendChild(i),a.appendChild(n),c&&a.appendChild(c),DATA.useAddToCartButton&&a.appendChild(this.addToCartButton),t.appendChild(a),t}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>${z.getTranslation("From")}</span>`:""}${O(this.result.price)}`;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 $e="remove",Te="rebuild",ke="update";class Se{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 ve({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(),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case Z:case Y:case X:case Q:this.updateFiltersInfo();break;case K:this.updateSortValue();break;case q:this.updateFiltersInfo(),this.updateSortValue()}})}updateFiltersInfo(){let e=0;for(const t of Object.values(me.state.filters))"object"==typeof t[0]?e++:e+=t.length;e?(this.filtersButtonElement.classList.add("active"),this.filtersButtonTextElement.textContent=`${e} ${z.getTranslation("Filter")}${e>1?"s":""}`):(this.filtersButtonElement.classList.remove("active"),this.filtersButtonTextElement.textContent=DATA.filtersButtonText||z.getTranslation("Filter"))}updateSortValue(){this.sortSelectElement.value=me.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=`${z.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||z.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||z.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=U();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;me.resetCurrentPage(),ce.clearResults(),me.setSort(t)}}const Ee=575.98;class Re{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 Ce({baseContainer:this.baseContainer,baseClassName:this.baseClassName,searchResultsContainer:this.searchResultContainer,onFiltersReset:this.onFiltersReset}),this.infoAndSort=new Se({baseClassName:this.baseClassName,infos:{totalHits:me.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<=Ee,ce.observable.subscribe(e=>{let{type:t,payload:s}=e;switch(t){case te:this.onSetResults(ce.state.results,ce.state.facets);break;case se:this.onUpdateResults(ce.state.results);break;case ae: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 this.renderNoResults(this.searchResultContainer);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);j(this.searchResultList),e.length?(this.renderListItems(e),this.lazyLoadImages()):this.renderNoResults(this.searchResultList),this.resultsChanged=!0}handleResize(e){const t=(e[0].contentRect.width||window.innerWidth)<=Ee;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)j(e);e.length?(this.renderGroupedResultList(e),this.lazyLoadImages()):this.renderNoResults(this.searchResultList),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 Ae({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 Ae({result:s,index:t,baseClassName:this.baseClassName}).getSearchResultElement();window.dispatchEvent(new CustomEvent("abtasty_search_result",{detail:{resultElement:e}})),this.searchResultList.appendChild(e)}}renderNoResults(e){const t=document.createElement("div");t.className=`${this.baseClassName}-search-no-result`,t.innerHTML=z.getTranslation("No result found",me.state.text),DATA.useNoResultRedirectionButton&&DATA.noResultRedirectionButtonUrl&&t.appendChild(this.getNoResultRedirectionButtonElement()),this.searchResultContainer.classList.add("abt-search-no-results"),e.appendChild(t)}getNoResultRedirectionButtonElement(){const e=document.createElement("a");if(e.className=`${this.baseClassName}-search-no-result-redirection-button`,e.href=DATA.noResultRedirectionButtonUrl,e.textContent=DATA.noResultRedirectionButtonText,!DATA.useExpertMode){const{noResultRedirectionButtonBorderColor:t,noResultRedirectionButtonBorderWidth:s,noResultRedirectionButtonBorderRadius:a,noResultRedirectionButtonPadding:i,noResultRedirectionButtonTextColor:r,noResultRedirectionButtonFontName:n,noResultRedirectionButtonFontStyle:o,noResultRedirectionButtonFontSize:c,noResultRedirectionButtonTextAlign:l,noResultRedirectionButtonBackgroundColor:d}=DATA,h=T(i),{borderStyle:u,borderRadiusStyle:g}=k(t,s,a),m=A(n,o);e.style.cssText=[h,m,u,g,`background-color: ${d};`,`color: ${r};`,`font-size: ${c}px;`,`text-align: ${l};`].join("")}return e}clearSearchResults(){j(this.searchResultList),j(this.searchResultListContainer),j(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 Ne(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 Pe(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(s),!0).forEach(function(t){Be(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ne(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function Be(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 Le=new class{constructor(){this.defaultHitsPerPage=DATA.groupBy?1e3:50,this.categoryFacetNames=["catégorie","catégories","category","type_category","category_name","categories"],this.baseApiUrl=`https://${e()}.search.abtasty.com`}getSearchUrl(){return DATA.useCustomIndex&&DATA.meilisearchIndex?`https://search-api.abtasty.com/search?index=${DATA.meilisearchIndex}&`:`${this.baseApiUrl}/search?`}getRecoAndMerchUrlAndHeaders(e,t,s){return[`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}]}getAutocompleteUrl(e){return DATA.autocompleteId?`https://search-api.abtasty.com/autocomplete?client_id=${DATA.autocompleteId}&query=${e}&hits_per_page=5`:`${this.baseApiUrl}/autocomplete?query=${e}&hits_per_page=5`}transformHits(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),a.absearch_name&&(e=a.absearch_name),a.absearch_link&&(i=a.absearch_link),a.absearch_img_link&&(img_link=a.absearch_img_link),a.absearch_price&&(price=a.absearch_price),i&&a.img_link&&a.price){const t={name:I(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,redirect:a.redirect||null,metadata:a};DATA.groupBy&&DATA.groupByName&&(t[DATA.groupByName]=a[DATA.groupByName]),s.push(t)}}return s}async transformResponse(e){if(!e)return null;const t=await e.json();return{results:this.transformHits(t.hits),facets:t.facets,totalPages:t.totalPages,page:t.page,totalHits:t.totalHits,redirectTo:t.redirectTo}}formatFiltersParams(e){const t=[];for(const[s,a]of Object.entries(e))"string"==typeof a[0]?a.forEach(e=>t.push(`filters[${s}][]=${encodeURIComponent(e)}`)):"object"==typeof a[0]&&(t.push(`filters[${s}][0][operator]=${encodeURIComponent(a[0].operator)}`),t.push(`filters[${s}][0][value]=${encodeURIComponent(a[0].value)}`),t.push(`filters[${s}][1][operator]=${encodeURIComponent(a[1].operator)}`),t.push(`filters[${s}][1][value]=${encodeURIComponent(a[1].value)}`));return t.join("&")}getRequestParams(e){let{text:t,filters:s,sort:a,page:i,hitsPerPage:r,facets:n}=e;const o=new URLSearchParams(Pe(Pe(Pe({text:t,facets:n||"*",page:i,hitsPerPage:r||this.defaultHitsPerPage},"relevance"!==a[0]&&{sort:a[0]}),DATA.useRecoAndMerch&&DATA.siteId&&DATA.merchandisingRecoId&&{siteId:Number(DATA.siteId),recoId:DATA.merchandisingRecoId}),DATA.useSemanticSearch&&{semanticRatio:DATA.semanticRatio,rankingScoreThreshold:DATA.relevanceThreshold||0}));if(s&&Object.keys(s).length>0){const e=this.formatFiltersParams(s);return`${o.toString()}&${e}`}return o.toString()}async search(){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=this.getRequestParams(me.state),s=await fetch(`${this.getSearchUrl()}${t}`,{method:"GET",signal:e});if(e&&e.aborted)throw new Error(e.reason);const a=await this.transformResponse(s);if(e&&e.aborted)throw new Error(e.reason);return window.dispatchEvent(new CustomEvent("abtasty_search",{detail:{results:a.results}})),a}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}}async searchAndGetResultsOnly(e){try{return{results:(await this.search(e)).results}}catch(e){return"AbortError"===e.name?null:{results:[]}}}async getTopCategories(){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"}];if(window.location.hostname.includes("soeur"))return[{name:"Nouveautés",redirectTo:"https://www.soeur.fr/collections/nouveautes"},{name:"Vestes",redirectTo:"https://www.soeur.fr/collections/vestes"},{name:"Sacs",redirectTo:"https://www.soeur.fr/collections/les-sacs"}];const e=e=>this.categoryFacetNames.includes(e);try{const t=await fetch(`${this.getSearchUrl()}${new URLSearchParams({text:"",facets:"*",hitsPerPage:1}).toString()}`,{method:"GET"});if(200!==t.status)return null;const s=await t.json();for(const[t,a]of Object.entries(s.facets))if(e(t))return a.values.sort((e,t)=>t[1]-e[1]).filter(e=>"wishlist"!==e[0]).slice(0,4).map(e=>({name:z.getTranslation(e[0])}));return[]}catch(e){return null}}async getSearchSuggestions(){if(!DATA.useAutocomplete)return null;try{const e=await fetch(this.getAutocompleteUrl(me.state.text));return(await e.json()).suggestions.map(e=>e.text).filter(e=>e.localeCompare(me.state.text,"en",{sensitivity:"base"}))}catch(e){return null}}async getRecos(){if(!DATA.useRecoAndMerch)return null;const e=DATA.siteId,t=DATA.recommendationsRecoId,s=DATA.recoAndMerchApiKey;if(!e||!t||!s)return null;const[a,i]=this.getRecoAndMerchUrlAndHeaders(t,e,s);try{const e=await fetch(a,{method:"GET",headers:i});return(await e.json()).items.map(e=>({id:e.id,name:I(e.name),price:e.price,img_link:e.img_link,link:e.absolute_link}))}catch(e){return null}}},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Le.search(e)},Ie=(e,t)=>{if(!e)return;const s=`${DATA.elementReferrer} input:not([type="hidden"])`;f(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),resetSearch:this.resetSearch.bind(this)}),this.searchResultsList=new Re({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersReset:this.onFiltersReset.bind(this)}),this.getRecommendationsElement(),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case G:this.onTextChange();break;case Z:this.onFilterChange(!1);break;case X:case Y:this.onFilterChange(!0);break;case K:this.onSortChange();break;case ee:this.onSeeMore();break;case q:this.onSearchReset()}})}onTextChange(){if(me.state.text){if((Object.keys(me.state.filters).length||me.state.page>1)&&me.resetFiltersAndPagination(),this.searchBar.setResetIconVisibility(!0),me.state.text.length>1)try{DATA.useAutocomplete&&this.onAutocomplete(),this.onSearch()}catch(e){}}else this.resetSearch()}async onFilterChange(e){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const t=await De(this.ac.signal);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=me.state.previousFilters[e],s=me.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=V(a,ce.state.facets,!0);ce.updateResults(s),ce.updateFacets(o),me.setTotalPages(i),me.setTotalHits(r),e?this.searchResultsList.updateListFacets(o):this.searchResultsList.updateFacets(o),me.setPreviousFilters(me.state.filters)}async onSortChange(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const e=await function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Le.searchAndGetResultsOnly(e)}(this.ac.signal);if(!e)return;const{results:t}=e;ce.updateResults(t)}async onSeeMore(){const e=await function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Le.searchAndGetResultsOnly(e)}(this.ac.signal);if(!e)return;this.hasTriggeredSeeMore=!1;const{results:t}=e;ce.addResults(t)}onSearchReset(){if(this.suggestionsContainer&&this.suggestionsContainer.remove(),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&&me.state.page<me.state.totalPages&&(this.hasTriggeredSeeMore=!0,me.setPage(me.state.page+1))}resetSearch(){this.ac.abort("User reset"),this.ac=new AbortController,ce.reset(),me.reset(),this.scrollToTop()}scrollToTop(){window.scrollY>0&&window.scroll({top:0,behavior:"smooth"}),this.searchWidgetContainer.scrollTop=0}sendSearchEventTracking(e){window.abtasty.send("event",{ec:"Action Tracking",ea:"search",el:me.state.text,ev:e})}openSearchWidget(){return!this.searchOpen&&(document.querySelector("body").classList.add("search-open"),this.searchOpen=!0,this.searchWidgetContainer.classList.add("open"),this.parentContainer.show(),"fromQuery"===DATA.defaultDisplay&&DATA.fromQuery&&DATA.fromQuery.length>2&&me.setText(DATA.fromQuery),"noResults"===DATA.defaultDisplay&&ce.setResults([],{},void 0),!0)}closeSearchWidget(){document.querySelector("body").classList.remove("search-open"),this.searchWidgetContainer.classList.remove("open"),this.parentContainer.hide(),this.searchOpen=!1}onFiltersReset(){if(!me.isNoFiltersAndNoSort()){me.resetFiltersAndPagination();try{this.onSearch()}catch(e){}}}async onAutocomplete(){const e=await Le.getSearchSuggestions();return e&&e.length?e:[]}onInput=e=>{me.setText(e.target.value)};debouncedOnInput=(()=>F(this.onInput.bind(this),300))();debouncedEventTracking=(()=>F(this.sendSearchEventTracking.bind(this),2e3))();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,redirectTo:r}=e;this.debouncedEventTracking(i),this.recommendationsContainer?.remove(),me.setTotalPages(a),me.setTotalHits(i),ce.setResults(t,s,r)}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,[L(r,n),B(r,n),...DATA.useExpertMode?[DATA.containerCustomCss,DATA.searchBarCustomCss,DATA.filtersButtonCustomCss,DATA.sortButtonCustomCss,DATA.facetsCustomCss,DATA.searchResultCustomCss,DATA.searchResultCtaButtonCustomCss,DATA.noResultCustomCss]:[S(),P(),N(),R(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;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;-webkit-box-sizing:border-box;box-sizing:border-box;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-container *,div.abtasty-search-widget-container :after,div.abtasty-search-widget-container :before{-webkit-box-sizing:inherit;box-sizing:inherit}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;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-search-bar-content div.abtasty-search-widget-autocomplete-suggestions-container{margin:16px 0 0}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;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-content{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;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{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;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;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{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;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;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.plain-text{border-radius:4px;bottom:0;margin-top:12px;position:relative;right:0;width:auto}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-add-to-cart .add-to-cart-content.loading{-webkit-animation:l13 1s linear infinite;animation:l13 1s linear infinite;aspect-ratio:1;background:radial-gradient(farthest-side,#fff 94%,transparent) top/8px 8px no-repeat,conic-gradient(transparent 30%,#fff);border-radius:50%;content:none;-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 8px),#000 0);width:50px}@-webkit-keyframes l13{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes l13{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}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{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:has(.abtasty-search-widget-autocomplete-suggestions-container):not(:has(.abtasty-search-widget-search-bar-container)) div.abtasty-search-widget-search-result-container div.abtasty-search-widget-search-facets-list{margin-top:32px;padding-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;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 widget-container (width > 575.98px){@container result-list (width > 399.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(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-content,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-content,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-content,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-content,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 <= 575.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-content,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{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 <= 767.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{max-width:240px;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 e=document.createElement("div");e.className=`${this.baseClassName}-recommendations-container`;const t=await Le.getTopCategories();if(t&&t.length){const s=document.createElement("div");s.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=z.getTranslation("Recherches populaires"),r&&(a.style.fontFamily="Lato")):window.location.hostname.includes("lafeemaraboutee")?a.innerHTML=z.getTranslation("Découvrez nos collections"):a.innerHTML=z.getTranslation("Categories"),s.appendChild(a);const n=document.createElement("div");n.className=`${this.baseClassName}-recommended-categories-list`;for(const e of t){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?Ie(a,e=>{e.value=t,me.setText(t)}):(this.searchBar?.setInputValue(t),me.setText(t))};n.appendChild(a)}s.appendChild(n),e.appendChild(s)}let s=null;s=DATA.useMarketBanners?this.getMarketBannersElement():await this.getProductRecommendationsElement(),s&&e.appendChild(s),this.recommendationsContainer=e,"no-results"!==DATA.defaultDisplay&&this.searchWidgetContainer.appendChild(this.recommendationsContainer)}async getProductRecommendationsElement(){const e=await Le.getRecos();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=z.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 Ae({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:m}=DATA,b=document.createElement("div");b.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:m});const f=document.createElement("div");f.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");if(r.src=e.imageSrc,t.appendChild(r),t.appendChild(s),t.appendChild(a),t.appendChild(i),e.link){const s=document.createElement("a");s.href=e.link,s.style.cursor="pointer",i.href=e.link,s.appendChild(t),f.appendChild(s)}else f.appendChild(t)}return b.appendChild(f),b}getSuggestionsContainerElement(e){const t=document.createElement("div");t.className=`${this.baseClassName}-autocomplete-suggestions-container`;for(const s of e){const e=document.createElement("div");e.className=`${this.baseClassName}-autocomplete-suggestion`,e.innerHTML=s,e.title=s,e.onclick=()=>{if("free"===DATA.layout){const{elementReferrer:e}=DATA,t=g(e);Ie(t,e=>{e.value=s,me.setText(s)})}else this.searchBar?.setInputValue(s),me.setText(s)},t.appendChild(e)}return t}}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()}async onAutocomplete(){const e=await super.onAutocomplete();this.suggestionsContainer&&this.suggestionsContainer.remove(),e.length&&(this.suggestionsContainer=this.getSuggestionsContainerElement(e),this.searchBar.searchBarContent.insertAdjacentElement("beforeend",this.suggestionsContainer))}}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 _e(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){He(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 He(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 Oe{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");if(t){t.addEventListener("reset",e=>{e.preventDefault(),e.stopPropagation(),this.resetSearch()}),t.addEventListener("submit",()=>{!ce.checkAndApplyRedirection()&&DATA.useRedirectionUrl&&DATA.redirectionUrl&&(window.location.href=DATA.redirectionUrl.replace("{{query}}",e.value))},{passive:!0}),t.action=void 0;for(const e of Object.keys(t.dataset))delete t.dataset[e]}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&&this.suggestionsContainer.remove(),e.length&&(this.suggestionsContainer=this.getSuggestionsContainerElement(e),this.searchWidgetContainer.insertAdjacentElement("afterbegin",this.suggestionsContainer))}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 Ve{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"===y(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}=f(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 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}=f(this.selector,()=>{const e=new Ve;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)||w(s,this.selector))&&t(!0)},{clear:a}=f(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):w(s,this.selector))&&t(!0)},{clear:a}=f(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}=f("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}=f("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 Je="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 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!==Ze)if(t===Ke&&l!==Ze)d();else{if(t!==Je||l===Ze||l===Ke)return!1;d()}else d();return o}setDisplayRecurrence(){const e=Je;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&&ke:Te;return s?(this.clearWatcher(),this.callback(s,!e,t),this.watch(),this):this}onCampaignLaunched({detail:{campaignId:e}}){e===TEST_ID&&(this.callback(Te,!1),this.watch())}onTagRollback({target:e}){return this.clearWatcher(e),this.callback($e,!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($e,!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}=f(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}=f("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 Ge(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=f(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={[$e]:()=>s?this.remove():this.pageWatcher.watch(this.rootElement),[Te]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):s||this.insert().then(e=>e.show()).catch(this.pageWatcher.watch):a()},[ke]:()=>{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:m,textAlign:b,fontName:p,fontStyle:f,fontSize:y,isTitle:w,titleTextAlign:v,titleTextColor:x,titleFontName:C,titleFontStyle:A,titleFontSize:T,overlay:k,overlayColor:S,dropShadow:E,dropShadowColor:R,dropShadowBlur:N,containerMargin:P,containerPadding:B,closeButton:L,closeButtonPosition:D,closeButtonSize:I,closeButtonBorderRadius:O,closeButtonBorderWidth:F,closeButtonBorderColor:j,closeButtonColor:M,closeButtonBackgroundColor:z,buttonsAlign:W,buttonsBorderWidth:_,buttonsBorderColor:H,buttonsBorderRadius:U,buttonsBackgroundColor:V,buttonsTextColor:q,buttonsFontName:G,buttonsFontStyle:J,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,f),this.loadFont(C,A),this.loadFont(G,J),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;`:"",me=void 0!==m?`color: ${m}; fill: ${m}; -webkit-text-fill-color: ${m};`:"",be=void 0!==b?`text-align: ${b};`:"",pe=p&&"inherit"!==p?`font-family:${p}_${f.match(tt)?f.match(tt)[1]:""};`:f||"",fe=y?`font-size: ${y}px;`:"",ye=void 0!==E&&E?`box-shadow: 0 5px ${N}px 0 ${R};`:"",we=P instanceof Array&&1===P.length&&P[0],ve=we?`margin: ${we.top}px ${we.right}px ${we.bottom}px ${we.left}px;`:"",xe=we?`margin: calc(${we.top}px * 0.5) calc(${we.right}px * 0.5) calc(${we.bottom}px * 0.5) calc(${we.left}px * 0.5);`:"",Ce=B instanceof Array&&1===B.length&&B[0],Ae=Ce?`padding: ${Ce.top}px ${Ce.right}px ${Ce.bottom}px ${Ce.left}px;`:"",$e=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);`:"",Te=void 0!==_&&_?`border-width: ${_}px; border-style: solid;`:"",ke=[H,_].every(e=>void 0!==e)&&_?`border-color: ${H};`:"",Se=void 0!==U?`border-radius: ${U}px;`:"",Ee=void 0!==V?`background-color: ${V};`:"",Re=void 0!==q?`color: ${q}; fill: ${q}; -webkit-text-fill-color: ${q};`:"",Ne=G&&"inherit"!==G?`font-family:${G}_${J.match(tt)?J.match(tt)[1]:""};`:J||"",Pe=K?`font-size: ${K}px;`:"",Be="number"==typeof Y?`border-width: ${Y}px; border-style: solid;`:"",Le=[X,Y].every(e=>void 0!==e)&&Y?`border-color: ${X};`:"",De=void 0!==Q?`border-radius: ${Q}px;`:"",Ie=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!==k&&!0!==k?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==S?S:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),ze="number"==typeof I?I:16,We=ze/2,_e=a||void 0!==L&&L?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===D?`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(""):"",He=w&&"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}_${A.match(tt)?A.match(tt)[1]:""};`:A||"",T?`font-size: ${T}px;`:"","}"].join(""):"";let Ue="";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(),Ue={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 Ve=[`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,`margin-${"fill"===W?"top":"left"}: 8px;`,Be,Le,De,Ie,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,me,be,ye,ve,pe,fe,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,me,be,pe,fe,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",Ae,pe,fe,"}",`#${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;",Te,ke,Se,Ee,Re,Ne,Pe,"}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a *:not(.second_link span), `,`#${this.widgetContainerId} .${this.contentClassName} button:not([class*="close_button"], [class*="csatEmojiButton"]) * {`,Re,Ne,Pe,"}",...Z?Ve:[],"@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,xe,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,$e,"}","}",Me,_e,He,Ue,`${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("")}}const ut=at.prototype.onPageChange;at.prototype.onPageChange=function(e,t,s){if(e!==Te)return ut.call(this,e,t,s);ut.call(this,void 0,t,s),this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):s||this.insert().catch(this.pageWatcher.watch):this.init()},(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},{name:DATA.noResultFontName,style:DATA.noResultFontStyle},{name:DATA.noResultRedirectionButtonFontName,style:DATA.noResultRedirectionButtonFontStyle}];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 Ue(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;f(i,e=>{if("free"===DATA.layout)Ie(e,e=>{const t=e.cloneNode(!0);e.parentElement.replaceChild(t,e),a.registerInputEvents(t)});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()&&(r||a.searchOpen?r&&a.searchOpen&&a.closeSearchWidget():a.openSearchWidget())}}),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),m=e=>u(e,!0),b=(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=()=>{},f=(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(()=>f(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}=b(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}=b(s,e);return n(),{selector:e,clear:r,observe:n}};function y(e,t){const s=e.parentElement||e.getRootNode().host;return t(e)||!s?e:y(s,t)}const w=(e,t)=>[...m(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="div.abtasty-search-widget-container",A=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(x)?t.match(x)[1]:""};`:t||"",T=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;`:""},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:m,searchBarInputBorderWidth:b,searchBarInputPadding:p,searchBarInputAndSearchIconMargin:f}=DATA,y=A(l,h),w=T(p);return["@container widget-container (width >= 575.98px) {",`${C} div.abtasty-search-widget-search-bar-container {`,`background-color: ${s};`,"}","}",`${C} div.abtasty-search-widget-search-bar-content {`,`max-width: ${i}${r};`,"}",`${C} div.abtasty-search-widget-search-bar {`,`background-color: ${o};`,`border-color: ${e};`,m?`border-radius: ${m}px;`:"",b?`border-width: ${b}px;`:"border: unset;",w,"}",`${C} button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon {`,`background-color: ${a};`,"}",`${C} input.abtasty-search-widget-search-input {`,`text-align: ${c};`,y,`font-size: ${d}px;`,u?`color: ${g};`:`color: ${t};`,"}",`${C} i.abtasty-search-widget-search-icon {`,`margin-right: ${f}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:m,facetTitleCustomFontColor:b,facetTitleTextColor:p,borderRadius:f,filtersButtonBackgroundColor:y,filtersButtonTextColor:w,filtersButtonBorderColor:v,filtersButtonBorderWidth:x,filtersButtonBorderRadius:S,filtersButtonPadding:E,sortButtonPadding:R,sortButtonBackgroundColor:N,sortButtonTextColor:P,sortButtonBorderColor:B,sortButtonBorderWidth:L,sortButtonBorderRadius:D}=DATA,I=A(n,c),O=A(u,m),F=l?`color: ${d};`:`color: ${a};`,j=b?`color: ${p};`:`color: ${i};`,{borderStyle:M,borderRadiusStyle:z}=k(v,x,S),{borderStyle:W,borderRadiusStyle:_}=k(B,L,D),H=w?`color: ${w};`:`color: ${a};`,U=P?`color: ${P};`:`color: ${a};`,V=T(E),q=T(R);return[`${C} details.abtasty-search-widget-search-facet summary {`,`text-align: ${r};`,I,`font-size: ${o}px;`,F,"}",`${C} label.abtasty-search-widget-search-facet-checkbox-container {`,`text-align: ${h};`,O,`font-size: ${g}px;`,j,"}",`${C} button.abtasty-search-widget-search-sort-button {`,`background-color: ${N||s};`,W,_,U,q,"}",`${C} button.abtasty-search-widget-search-filters-button.active,`,`${C} button.abtasty-search-widget-search-filters-button {`,"display: flex;",`background-color: ${y||s};`,H,M,z,V,"}",`${C} button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon,`,`${C} button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon {`,w?`background-color: ${w};`:`background-color: ${a};`,"}",`${C} button.abtasty-search-widget-search-sort-button i.abtasty-search-widget-search-sort-button-icon {`,P?`background-color: ${P};`:`background-color: ${a};`,"}",`${C} div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active {`,H,"}","@container widget-container (width <= 575.98px) {",`#${e} .${t} ${C} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} ${C} button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} ${C} button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${f}px;`,"}",`#${e} .${t} ${C} button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},R=(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:m,searchResultPriceFontStyle:b,searchResultPriceCustomFontColor:p,searchResultPriceTextColor:f,searchResultBackgroundColor:y,searchResultBorderColor:w,searchResultBorderWidth:v,searchResultBorderRadius:x,searchResultCaptionCustomFontColor:T,searchResultCaptionTextColor:S,searchResultCaptionFontName:E,searchResultCaptionFontStyle:R,searchResultCaptionFontSize:N,searchResultCtaButtonBackgroundColor:P,searchResultCtaButtonTextColor:B,searchResultCtaButtonBorderColor:L,searchResultCtaButtonBorderWidth:D,searchResultCtaButtonBorderRadius:I,searchResultCaptionUppercase:O,searchResultCtaButtonPadding:F,searchResultCtaButtonFontSize:j,searchResultCtaButtonFontName:M,searchResultCtaButtonFontStyle:z,searchResultAddToCartButtonBackgroundColor:W,searchResultAddToCartButtonTextColor:_,searchResultAddToCartButtonBorderColor:H,searchResultAddToCartButtonBorderWidth:U,searchResultAddToCartButtonBorderRadius:V,searchResultAddToCartButtonPadding:q,searchResultAddToCartButtonFontSize:G,searchResultAddToCartButtonFontName:J,searchResultAddToCartButtonFontStyle:K,searchResultAddToCartPlainText:Z}=DATA,Y=A(n,c),X=A(E,R),Q=A(g,b),ee=A(J,K),te=A(M,z),se=l?`color: ${d};`:`color: ${i};`,ae=T?`color: ${S};`:`color: ${i};`,ie=p?`color: ${f};`:`color: ${i};`,re=B?`color: ${B};`:`color: ${s};`,ne=_?`color: ${_};`:`color: ${s};`,{borderStyle:oe,borderRadiusStyle:ce}=k(H,U,V),{borderStyle:le,borderRadiusStyle:de}=k("#D8D8E2",v,x,!0),{borderStyle:he,borderRadiusStyle:ue}=k(L,D,I),ge=window.location.hostname.includes("palaisdesthes");return[`${C} div.abtasty-search-widget-search-result-card {`,`background-color: ${y};`,le,de,"}",`${C} div.abtasty-search-widget-search-result-card:hover {`,`border-color: ${w||s};`,"}",`${C} div.abtasty-search-widget-search-result-content {`,"center"===r?"align-items: center;":"","}",`${C} div.abtasty-search-widget-search-result-name {`,`text-align: ${r};`,Y,`font-size: ${o}px;`,se,"}",`${C} div.abtasty-search-widget-search-result-caption {`,`text-align: ${h};`,ae,`font-size: ${N}px;`,X,O?"text-transform: uppercase;":"","}",`${C} div.abtasty-search-widget-search-result-price {`,`text-align: ${u};`,Q,`font-size: ${m}px;`,ie,"}",`${C} div.abtasty-search-widget-search-result-price span {`,`color: ${a};`,"}",`#${e} .${t} ${C} button.abtasty-search-widget-search-result-add-to-cart {`,"display: flex;",`background-color: ${s};`,"}",`${C} button.abtasty-search-widget-search-result-cta-button {`,`background-color: ${P};`,te,re,he,ue,F&&1===F.length&&F[0]?`padding: ${F[0].top}px ${F[0].right}px ${F[0].bottom}px ${F[0].left}px;`:"",`font-size: ${j}px;`,"}",...Z?[`#${e} .${t} ${C} button.abtasty-search-widget-search-result-add-to-cart .add-to-cart-content {`,"content: none;","}"]:[],`#${e} .${t} ${C} button.abtasty-search-widget-search-result-add-to-cart {`,`background-color: ${W};`,ee,ne,oe,ce,q&&1===q.length&&q[0]?`padding: ${q[0].top}px ${q[0].right}px ${q[0].bottom}px ${q[0].left}px;`:"",`font-size: ${G}px;`,"}",...ge?["@container widget-container (width <= 575.98px) {",`${C} div.abtasty-search-widget-search-result {`,"display: flex;","flex-direction: column;","}",`${C} a.abtasty-search-widget-search-result-image-container {`,"margin-inline: auto;","margin-bottom: 12px;","}",`${C} div.abtasty-search-widget-recommended-categories-list {`,"flex-direction: row;","}",`${C} div.abtasty-search-widget-recommended-category:not(:last-child)::after {`,"content: '|';","margin-inline: 6px;","}","}"]:[]].join("")},N=()=>{const{noResultTextAlign:e,noResultFontName:t,noResultFontSize:s,noResultFontStyle:a,noResultTextColor:i}=DATA,r=A(t,a);return[`${C} div.abtasty-search-widget-search-no-result {`,`text-align: ${e};`,r,`font-size: ${s}px;`,`color: ${i}; -webkit-text-fill-color: ${i} !important;`,"}"].join("")},P=()=>{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[`${C} div.abtasty-search-widget-recommended-banner {`,`color: ${i};`,"}","@container widget-container (width <= 575.98px) {",`${C} div.abtasty-search-widget-recommended-banner {`,`background-color: ${e};`,r,n,"}","}"].join("")},B=(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};`,m=`color: ${a};`,b=void 0!==o&&o?`box-shadow: 0 5px ${l}px 0 ${c};`:"",{borderStyle:p,borderRadiusStyle:f}=k(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} ${C} button.abtasty-search-widget-close-button:hover {`,"background: transparent;","}",`${C} {`,`background-color: ${i};`,b,p,f,"}",`${C} 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;","}",`${C} button.plain {`,`background-color: ${a};`,g,`border-radius: ${r}px;`,"}",`${C} button.plain.inverted {`,m,"}",`${C} button.abtasty-search-widget-search-facet-show-more {`,m,"}",`${C} div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active,`,`${C} label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark,`,`${C} div.abtasty-search-widget-range-slider div.range-handle-value,`,`${C} div.abtasty-search-widget-range-slider div.range-progress {`,`background-color: ${a};`,"}",`#${e} .${t} ${C} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,`background-color: ${a};`,`border-color: ${a};`,g,"}",`${C} span.abtasty-search-widget-search-facet-checkbox-checkmark:after,`,`${C} div.abtasty-search-widget-range-slider div.range-handle-value {`,g,"}",...n?[`${C} div.abtasty-search-widget-search-bar-close-button-container,`,`${C} div.abtasty-search-widget-recommendations-container,`,`${C} div.abtasty-search-widget-search-result-container.abt-search-visible,`,`${C} 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} ${C} div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {`,"display: flex;","}",`#${e} .${t} ${C} button.abtasty-search-widget-search-sort-button,`,`#${e} .${t} ${C} button.abtasty-search-widget-search-filters-button {`,"display: flex;","align-items: center;",`border-radius: ${r}px;`,"}",`#${e} .${t} ${C} button.abtasty-search-widget-filters-button {`,"display: block;","}","}"].join("")},L=(e,t)=>{const{layout:s,typeOfPositioning:a}=DATA;return[..."free"===s&&"absolute"===a?[`#${e} .${t} {`,"width: 100vw;","}",`${C} {`,"left: 50%;","transform: translateX(-50%);","width: 80vw;","}","@media (max-width: 575.98px) {",`${C} {`,"left: unset;","transform: unset;","margin-inline: auto;","width: 90vw;","}","}"]:[],`${C} div.abtasty-search-widget-recommended-categories-container,`,`${C} div.abtasty-search-widget-search-facets-list {`,`padding-top: ${"popin"===DATA.layout?"16px":"32px"};`,"}",`${C} div.abtasty-search-widget-recommended-products-container,`,`${C} div.abtasty-search-widget-search-result-list-container {`,`padding-top: ${"popin"===s?"32px":"48px"};`,"}","@container widget-container (width <= 575.98px) {",`${C} div.abtasty-search-widget-search-result-list-container {`,`padding-top: ${"popin"===s?"16px":"48px"};`,"}",`${C} div.abtasty-search-widget-recommended-products-container {`,"padding-top: 0px;","}","}"].join("")},D={searchResultMainInformationOrderName:"name",searchResultMainInformationOrderRating:"rating",searchResultMainInformationOrderCaption:"caption",searchResultMainInformationOrderPrice:"price"},I=e=>`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`,O=e=>{const t=DATA.language||"fr-FR";return new Intl.NumberFormat(t,{style:"currency",currency:t.includes("fr")?"EUR":"USD"}).format(e)},F=(e,t)=>{let s=null;return function(){for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];window.clearTimeout(s),s=window.setTimeout(()=>{e(...i)},t)}},j=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)};class M{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 z=new class{constructor(){this.translationKeys={}}init(){try{const e=JSON.parse(DATA.translationKeys);this.translationKeys=e}catch(e){}}getTranslation(e,t){const s=this.translationKeys[e];return s&&""!==s?s.replace("{{QUERY}}",t||""):e}};function W(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function _(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?W(Object(s),!0).forEach(function(t){H(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):W(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function H(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}z.init();const U=()=>[{value:"relevance",label:z.getTranslation("Relevance")},{value:"price:asc",label:`↑ ${z.getTranslation("Price")}`},{value:"price:desc",label:`↓ ${z.getTranslation("Price")}`}],V=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]=_(_({},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]})}):"range"===i.type?e[a]=_({},i):e[a]=_(_({},i),{},{values:{min:0,max:0}})),e},_({},t))},q="RESET",G="SET_TEXT",J="SET_TOTAL_HITS",K="SET_SORT",Z="SET_LIST_FILTERS",Y="SET_RANGE_FILTERS",X="REMOVE_RANGE_FILTERS",Q="RESET_FILTERS",ee="GET_NEXT_PAGE",te="SET_RESULTS",se="UPDATE_RESULTS",ae="ADD_RESULTS";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={results:[],facets:{},redirectTo:void 0},ce=function(){let e=re({},oe);const t=new M;return re({get state(){return e},get observable(){return t},checkAndApplyRedirection:()=>!!e.redirectTo&&(window.location.href=e.redirectTo,!0)},{logState(t){JSON.parse(JSON.stringify(e))},setResults(s,a,i){e.results=s,e.facets=a,e.redirectTo=i,t.notify({type:te}),this.logState("setResults")},updateResults(s){e.results=s,t.notify({type:se}),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:ae,payload:s}),this.logState("addResults")},updateFacets(t){const s=V(t,e.facets,!0);this.setFacets(s),this.logState("updateFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=re({},oe),this.logState("reset")}})}();class le{constructor(e){let{baseClassName:t,onInput:s,closeSearchWidget:a,resetSearch:i}=e;this.baseClassName=t,this.onInput=s,this.closeSearchWidget=a,this.resetSearch=i,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}getSearchBarContent(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-content`,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=z.getTranslation("Search..."),e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,e.addEventListener("keypress",t=>{"Enter"===t.key&&!ce.checkAndApplyRedirection()&&DATA.useRedirectionUrl&&DATA.redirectionUrl&&e.value&&(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=this.resetSearch,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.searchBarContent=document.createElement("div"),this.searchBarContent.className=`${this.baseClassName}-search-bar-content`,this.searchBarContent.appendChild(t),this.searchBarContainer.appendChild(this.searchBarContent)}}function de(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?de(Object(s),!0).forEach(function(t){ue(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):de(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function ue(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 ge={text:"",previousFilters:{},filters:{},sort:["relevance"],page:1,totalPages:0,totalHits:0},me=function(){let e=he({},ge);const t=new M;return he({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:G}),this.logState("setText")},setPage(s){e.page=s,e.page<=e.totalPages&&t.notify({type:ee}),this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(s){e.totalHits=s,t.notify({type:J}),this.logState("setTotalHits")},setSort(s){e.sort=""===s?[]:[s],t.notify({type:K}),this.logState("setSort")},updateRangeFilter(s,a,i){e.filters[s]=[{operator:">=",value:a},{operator:"<=",value:i}],t.notify({type:Y}),this.logState("updateRangeFilter")},removeRangeFilter(s){const a=he({},e.filters);delete a[s],e.filters=a,t.notify({type:X}),this.logState("removeRangeFilter")},updateFilterArray(s,a,i){const r=he({},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:Z})},setPreviousFilters(t){e.previousFilters=t,this.logState("setPreviousFilters")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},t.notify({type:Q}),this.logState("resetFilters")},resetRangeFilters(){const t=he({},e.filters);for(const[e,s]of Object.entries(t))Array.isArray(s)&&2===s.length&&"object"==typeof s[0]&&delete t[e];e.filters=t,this.logState("resetRangeFilters")},resetPagination(){e.page=1,e.totalPages=0,this.logState("resetPagination")},resetCurrentPage(){e.page=1,this.logState("resetCurrentPage")},reset(){e=he({},ge),t.notify({type:q}),this.logState("reset")}})}();class be{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=I(this.facet.title),t=z.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 pe extends be{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=(me.state.filters[this.facet.title]||[]).includes(s),o=(me.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?z.getTranslation("See less"):z.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=(me.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;me.resetPagination(),ce.clearResults(),me.resetRangeFilters(),me.updateFilterArray(this.facet.title,t,e)},r.appendChild(o),r.appendChild(n),a.appendChild(r),a}updateFacetContent(){j(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 fe{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 m=()=>{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}},b=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+"%"})(),m()},f=()=>{if(!d)return;d=!1,h=null;const{minValue:e,maxValue:t}=m();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[a,r].forEach(e=>{e.addEventListener("mousedown",b),e.addEventListener("touchstart",b,{passive:!1})}),document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",f),document.addEventListener("touchcancel",f),{rangeContainer:e,valuesContainer:o}}}class ye extends be{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 fe({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}=ce.state.facets[this.facet.title]?.values,r=!(void 0===a||void 0===i||Math.floor(a)!==Number(t)||Math.ceil(i)!==Number(s));me.resetPagination(),ce.clearResults(),r?me.removeRangeFilter(this.facet.title):me.updateRangeFilter(this.facet.title,t,s)};createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){j(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new fe({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 we{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getSortFacetElement(),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case q:case K:this.updateSortValue()}})}updateSortValue(){this.element.querySelectorAll(".active").forEach(e=>{e.classList.remove("active"),e.disabled=!1});const e=this.element.querySelector(`[data-value="${me.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=U();for(const s of t){const t=document.createElement("button");t.classList.add(`${this.baseClassName}-search-sort-option`),(""===s.value&&0===me.state.sort.length||me.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=()=>{me.resetCurrentPage(),ce.clearResults(),me.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=`${z.getTranslation("Sort By")}:`,e.appendChild(t),e.appendChild(this.getSortOptionsElements()),e}}class ve{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getInfosElement(),me.observable.subscribe(e=>{let{type:t}=e;t===J&&(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=z.getTranslation(me.state.totalHits>1?"results":"result");return`<span><b>${me.state.totalHits}</b> ${e}</span>`}}class xe{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(){j(this.sidePanelContent),this.sidePanelContent.append(...arguments)}}class Ce{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 xe({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 xe({baseContainer:this.searchResultsContainer,baseClassName:this.baseClassName,type:"sort",content:this.sortFacet.element,onPanelOpen:this.onPanelOpen.bind(this),onPanelClose:this.onPanelClose.bind(this)})),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case Z:case Y:case X:case Q: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(me.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 we({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=z.getTranslation("Clear results"),a.onclick=this.onFiltersReset;const i=document.createElement("div");i.className=`${this.baseClassName}-search-facets-list-header`,this.searchInfos=new ve({baseClassName:this.baseClassName});const r=document.createElement("button");return r.className=`plain ${this.baseClassName}-search-facets-list-bottom-close-button`,r.innerHTML=z.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?ye:pe)({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 ye).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof pe).forEach(t=>{e[t.id]&&t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}}class Ae{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?.();const{addToCartButtonJs:t,tagIsSafeEval:s}=DATA,a=s&&DATA_JS?.addToCartButtonJs;("function"==typeof a?a:new Function("result","addToCartButton",t))(this.result,this.addToCartButton.firstElementChild)}onClick(e){return window.abtasty.send("event",{ec:"Action Tracking",ea:"searchResultClicked",el:this.isRecommendedProduct?`recommendedProduct|${this.result.id}`:`${me.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=z.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=O(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=this.result.redirect||this.result.link,t=document.createElement("div");if(t.onclick=this.onClick.bind(this),DATA.attachMetadata&&this.result.metadata)for(const[e,s]of Object.entries(this.result.metadata)){const a=e.toLowerCase().replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));s&&(t.dataset[a]=s)}t.className=`${this.baseClassName}-search-result-card`;const s=this.index<6&&this.index<window.innerHeight/200*2,a=document.createElement("div");a.className=`${this.baseClassName}-search-result result-${this.index}`;const i=document.createElement("a");i.className=`${this.baseClassName}-search-result-image-container`;const r=document.createElement("img");r.alt=this.result.name,r.className=`${this.baseClassName}-search-result-image ${s?"":"lazy"}`,s?r.src=this.result.img_link:r.dataset.src=this.result.img_link,i.appendChild(r);const n=document.createElement("div");n.className=`${this.baseClassName}-search-result-content`;const o=Object.entries(D).map(e=>{let[t,s]=e;return{key:s,order:DATA[t]}}).sort((e,t)=>e.order-t.order);if(o.forEach(t=>{if(this.result[t.key])if(t.key!==D.searchResultMainInformationOrderRating){if(t.key===D.searchResultMainInformationOrderPrice&&t.order<o.length){const e=this.getPricingElement();n.appendChild(e)}else if(t.key!==D.searchResultMainInformationOrderPrice){let s=document.createElement("div");if(s.className=`${this.baseClassName}-search-result-${t.key}`,s.textContent=this.result[t.key],"name"===t.key&&DATA.useSearchResultCtaButton){const t=document.createElement("a");t.href=e,t.style.cursor="pointer",t.appendChild(s),s=t}n.appendChild(s)}}else{const e=this.getRatingElement().outerHTML;n.appendChild(e)}}),o[o.length-1].key===D.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),n.appendChild(e)}this.addToCartButton=document.createElement("button"),this.addToCartButton.className=`${this.baseClassName}-search-result-add-to-cart ${DATA.searchResultAddToCartPlainText?"plain-text":""}`,this.addToCartButton.onclick=this.onAddToCart.bind(this),this.addToCartButton.innerHTML=`<div class="add-to-cart-content" data-label="Add to cart">\n\t\t\t${DATA.searchResultAddToCartButtonText?DATA.searchResultAddToCartButtonText:""}</div>`;let c=null;if(DATA.useSearchResultCtaButton){c=document.createElement("a"),c.href=e,c.style.cursor="pointer";const t=document.createElement("button");t.className=`plain inverted ${this.baseClassName}-search-result-cta-button`,t.innerHTML=DATA.searchResultCtaButtonText,c.appendChild(t)}else i.classList.add("no-cta");return i.href=e,i.style.cursor="pointer",a.appendChild(i),a.appendChild(n),c&&a.appendChild(c),DATA.useAddToCartButton&&a.appendChild(this.addToCartButton),t.appendChild(a),t}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>${z.getTranslation("From")}</span>`:""}${O(this.result.price)}`;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 $e="remove",Te="rebuild",ke="update";class Se{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 ve({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(),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case Z:case Y:case X:case Q:this.updateFiltersInfo();break;case K:this.updateSortValue();break;case q:this.updateFiltersInfo(),this.updateSortValue()}})}updateFiltersInfo(){let e=0;for(const t of Object.values(me.state.filters))"object"==typeof t[0]?e++:e+=t.length;e?(this.filtersButtonElement.classList.add("active"),this.filtersButtonTextElement.textContent=`${e} ${z.getTranslation("Filter")}${e>1?"s":""}`):(this.filtersButtonElement.classList.remove("active"),this.filtersButtonTextElement.textContent=DATA.filtersButtonText||z.getTranslation("Filter"))}updateSortValue(){this.sortSelectElement.value=me.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=`${z.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||z.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||z.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=U();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;me.resetCurrentPage(),ce.clearResults(),me.setSort(t)}}const Ee=575.98;class Re{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 Ce({baseContainer:this.baseContainer,baseClassName:this.baseClassName,searchResultsContainer:this.searchResultContainer,onFiltersReset:this.onFiltersReset}),this.infoAndSort=new Se({baseClassName:this.baseClassName,infos:{totalHits:me.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<=Ee,ce.observable.subscribe(e=>{let{type:t,payload:s}=e;switch(t){case te:this.onSetResults(ce.state.results,ce.state.facets);break;case se:this.onUpdateResults(ce.state.results);break;case ae: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 this.renderNoResults(this.searchResultContainer);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);j(this.searchResultList),e.length?(this.renderListItems(e),this.lazyLoadImages()):this.renderNoResults(this.searchResultList),this.resultsChanged=!0}handleResize(e){const t=(e[0].contentRect.width||window.innerWidth)<=Ee;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)j(e);e.length?(this.renderGroupedResultList(e),this.lazyLoadImages()):this.renderNoResults(this.searchResultList),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 Ae({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 Ae({result:s,index:t,baseClassName:this.baseClassName}).getSearchResultElement();window.dispatchEvent(new CustomEvent("abtasty_search_result",{detail:{resultElement:e}})),this.searchResultList.appendChild(e)}}renderNoResults(e){const t=document.createElement("div");t.className=`${this.baseClassName}-search-no-result`,t.innerHTML=z.getTranslation("No result found",me.state.text),DATA.useNoResultRedirectionButton&&DATA.noResultRedirectionButtonUrl&&t.appendChild(this.getNoResultRedirectionButtonElement()),this.searchResultContainer.classList.add("abt-search-no-results"),e.appendChild(t)}getNoResultRedirectionButtonElement(){const e=document.createElement("a");if(e.className=`${this.baseClassName}-search-no-result-redirection-button`,e.href=DATA.noResultRedirectionButtonUrl,e.textContent=DATA.noResultRedirectionButtonText,!DATA.useExpertMode){const{noResultRedirectionButtonBorderColor:t,noResultRedirectionButtonBorderWidth:s,noResultRedirectionButtonBorderRadius:a,noResultRedirectionButtonPadding:i,noResultRedirectionButtonTextColor:r,noResultRedirectionButtonFontName:n,noResultRedirectionButtonFontStyle:o,noResultRedirectionButtonFontSize:c,noResultRedirectionButtonTextAlign:l,noResultRedirectionButtonBackgroundColor:d}=DATA,h=T(i),{borderStyle:u,borderRadiusStyle:g}=k(t,s,a),m=A(n,o);e.style.cssText=[h,m,u,g,`background-color: ${d};`,`color: ${r};`,`font-size: ${c}px;`,`text-align: ${l};`].join("")}return e}clearSearchResults(){j(this.searchResultList),j(this.searchResultListContainer),j(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 Ne(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 Pe(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(s),!0).forEach(function(t){Be(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ne(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}function Be(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 Le=new class{constructor(){this.defaultHitsPerPage=DATA.groupBy?1e3:50,this.categoryFacetNames=["catégorie","catégories","category","type_category","category_name","categories"],this.baseApiUrl=`https://${e()}.search.abtasty.com`}getSearchUrl(){return DATA.useCustomIndex&&DATA.meilisearchIndex?`https://search-api.abtasty.com/search?index=${DATA.meilisearchIndex}&`:`${this.baseApiUrl}/search?`}getRecoAndMerchUrlAndHeaders(e,t,s){return[`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}]}getAutocompleteUrl(e){return DATA.autocompleteId?`https://search-api.abtasty.com/autocomplete?client_id=${DATA.autocompleteId}&query=${e}&hits_per_page=5`:`${this.baseApiUrl}/autocomplete?query=${e}&hits_per_page=5`}transformHits(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),a.absearch_name&&(e=a.absearch_name),a.absearch_link&&(i=a.absearch_link),a.absearch_img_link&&(img_link=a.absearch_img_link),a.absearch_price&&(price=a.absearch_price),i&&a.img_link&&a.price){const t={name:I(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,redirect:a.redirect||null,metadata:a};DATA.groupBy&&DATA.groupByName&&(t[DATA.groupByName]=a[DATA.groupByName]),s.push(t)}}return s}async transformResponse(e){if(!e)return null;const t=await e.json();return{results:this.transformHits(t.hits),facets:t.facets,totalPages:t.totalPages,page:t.page,totalHits:t.totalHits,redirectTo:t.redirectTo}}formatFiltersParams(e){const t=[];for(const[s,a]of Object.entries(e))"string"==typeof a[0]?a.forEach(e=>t.push(`filters[${s}][]=${encodeURIComponent(e)}`)):"object"==typeof a[0]&&(t.push(`filters[${s}][0][operator]=${encodeURIComponent(a[0].operator)}`),t.push(`filters[${s}][0][value]=${encodeURIComponent(a[0].value)}`),t.push(`filters[${s}][1][operator]=${encodeURIComponent(a[1].operator)}`),t.push(`filters[${s}][1][value]=${encodeURIComponent(a[1].value)}`));return t.join("&")}getRequestParams(e){let{text:t,filters:s,sort:a,page:i,hitsPerPage:r,facets:n}=e;const o=new URLSearchParams(Pe(Pe(Pe({text:t,facets:n||"*",page:i,hitsPerPage:r||this.defaultHitsPerPage},"relevance"!==a[0]&&{sort:a[0]}),DATA.useRecoAndMerch&&DATA.siteId&&DATA.merchandisingRecoId&&{siteId:Number(DATA.siteId),recoId:DATA.merchandisingRecoId}),DATA.useSemanticSearch&&{semanticRatio:DATA.semanticRatio,rankingScoreThreshold:DATA.relevanceThreshold||0}));if(s&&Object.keys(s).length>0){const e=this.formatFiltersParams(s);return`${o.toString()}&${e}`}return o.toString()}async search(){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=this.getRequestParams(me.state),s=await fetch(`${this.getSearchUrl()}${t}`,{method:"GET",signal:e});if(e&&e.aborted)throw new Error(e.reason);const a=await this.transformResponse(s);if(e&&e.aborted)throw new Error(e.reason);return window.dispatchEvent(new CustomEvent("abtasty_search",{detail:{results:a.results}})),a}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}}async searchAndGetResultsOnly(e){try{return{results:(await this.search(e)).results}}catch(e){return"AbortError"===e.name?null:{results:[]}}}async getTopCategories(){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"}];if(window.location.hostname.includes("soeur"))return[{name:"Nouveautés",redirectTo:"https://www.soeur.fr/collections/nouveautes"},{name:"Vestes",redirectTo:"https://www.soeur.fr/collections/vestes"},{name:"Sacs",redirectTo:"https://www.soeur.fr/collections/les-sacs"}];const e=e=>this.categoryFacetNames.includes(e);try{const t=await fetch(`${this.getSearchUrl()}${new URLSearchParams({text:"",facets:"*",hitsPerPage:1}).toString()}`,{method:"GET"});if(200!==t.status)return null;const s=await t.json();for(const[t,a]of Object.entries(s.facets))if(e(t))return a.values.sort((e,t)=>t[1]-e[1]).filter(e=>"wishlist"!==e[0]).slice(0,4).map(e=>({name:z.getTranslation(e[0])}));return[]}catch(e){return null}}async getSearchSuggestions(){if(!DATA.useAutocomplete)return null;try{const e=await fetch(this.getAutocompleteUrl(me.state.text));return(await e.json()).suggestions.map(e=>e.text).filter(e=>e.localeCompare(me.state.text,"en",{sensitivity:"base"}))}catch(e){return null}}async getRecos(){if(!DATA.useRecoAndMerch)return null;const e=DATA.siteId,t=DATA.recommendationsRecoId,s=DATA.recoAndMerchApiKey;if(!e||!t||!s)return null;const[a,i]=this.getRecoAndMerchUrlAndHeaders(t,e,s);try{const e=await fetch(a,{method:"GET",headers:i});return(await e.json()).items.map(e=>({id:e.id,name:I(e.name),price:e.price,img_link:e.img_link,link:e.absolute_link}))}catch(e){return null}}},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Le.search(e)},Ie=(e,t)=>{if(!e)return;const s=`${DATA.elementReferrer} input:not([type="hidden"])`;f(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),resetSearch:this.resetSearch.bind(this)}),this.searchResultsList=new Re({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersReset:this.onFiltersReset.bind(this)}),this.getRecommendationsElement(),me.observable.subscribe(e=>{let{type:t}=e;switch(t){case G:this.onTextChange();break;case Z:this.onFilterChange(!1);break;case X:case Y:this.onFilterChange(!0);break;case K:this.onSortChange();break;case ee:this.onSeeMore();break;case q:this.onSearchReset()}})}onTextChange(){if(me.state.text){if((Object.keys(me.state.filters).length||me.state.page>1)&&me.resetFiltersAndPagination(),this.searchBar.setResetIconVisibility(!0),me.state.text.length>1)try{DATA.useAutocomplete&&this.onAutocomplete(),this.onSearch()}catch(e){}}else this.resetSearch()}async onFilterChange(e){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const t=await De(this.ac.signal);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=me.state.previousFilters[e],s=me.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=V(a,ce.state.facets,!0);ce.updateResults(s),ce.updateFacets(o),me.setTotalPages(i),me.setTotalHits(r),e?this.searchResultsList.updateListFacets(o):this.searchResultsList.updateFacets(o),me.setPreviousFilters(me.state.filters)}async onSortChange(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const e=await function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Le.searchAndGetResultsOnly(e)}(this.ac.signal);if(!e)return;const{results:t}=e;ce.updateResults(t)}async onSeeMore(){const e=await function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Le.searchAndGetResultsOnly(e)}(this.ac.signal);if(!e)return;this.hasTriggeredSeeMore=!1;const{results:t}=e;ce.addResults(t)}onSearchReset(){if(this.suggestionsContainer&&this.suggestionsContainer.remove(),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&&me.state.page<me.state.totalPages&&(this.hasTriggeredSeeMore=!0,me.setPage(me.state.page+1))}resetSearch(){this.ac.abort("User reset"),this.ac=new AbortController,ce.reset(),me.reset(),this.scrollToTop()}scrollToTop(){window.scrollY>0&&window.scroll({top:0,behavior:"smooth"}),this.searchWidgetContainer.scrollTop=0}sendSearchEventTracking(e){window.abtasty.send("event",{ec:"Action Tracking",ea:"search",el:me.state.text,ev:e})}openSearchWidget(){return!this.searchOpen&&(document.querySelector("body").classList.add("search-open"),this.searchOpen=!0,this.searchWidgetContainer.classList.add("open"),this.parentContainer.show(),"fromQuery"===DATA.defaultDisplay&&DATA.fromQuery&&DATA.fromQuery.length>2&&me.setText(DATA.fromQuery),"noResults"===DATA.defaultDisplay&&ce.setResults([],{},void 0),!0)}closeSearchWidget(){document.querySelector("body").classList.remove("search-open"),this.searchWidgetContainer.classList.remove("open"),this.parentContainer.hide(),this.searchOpen=!1}onFiltersReset(){if(!me.isNoFiltersAndNoSort()){me.resetFiltersAndPagination();try{this.onSearch()}catch(e){}}}async onAutocomplete(){const e=await Le.getSearchSuggestions();return e&&e.length?e:[]}onInput=e=>{me.setText(e.target.value)};debouncedOnInput=(()=>F(this.onInput.bind(this),300))();debouncedEventTracking=(()=>F(this.sendSearchEventTracking.bind(this),2e3))();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,redirectTo:r}=e;this.debouncedEventTracking(i),this.recommendationsContainer?.remove(),me.setTotalPages(a),me.setTotalHits(i),ce.setResults(t,s,r)}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,[L(r,n),B(r,n),...DATA.useExpertMode?[DATA.containerCustomCss,DATA.searchBarCustomCss,DATA.filtersButtonCustomCss,DATA.sortButtonCustomCss,DATA.facetsCustomCss,DATA.searchResultCustomCss,DATA.searchResultCtaButtonCustomCss,DATA.noResultCustomCss]:[S(),P(),N(),R(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;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;-webkit-box-sizing:border-box;box-sizing:border-box;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-container *,div.abtasty-search-widget-container :after,div.abtasty-search-widget-container :before{-webkit-box-sizing:inherit;box-sizing:inherit}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;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-search-bar-content div.abtasty-search-widget-autocomplete-suggestions-container{margin:16px 0 0}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;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-content{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;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{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;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;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{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;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;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.plain-text{border-radius:4px;bottom:0;margin-top:12px;position:relative;right:0;width:auto}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-add-to-cart .add-to-cart-content.loading{-webkit-animation:l13 1s linear infinite;animation:l13 1s linear infinite;aspect-ratio:1;background:radial-gradient(farthest-side,#fff 94%,transparent) top/8px 8px no-repeat,conic-gradient(transparent 30%,#fff);border-radius:50%;content:none;-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 8px),#000 0);width:50px}@-webkit-keyframes l13{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes l13{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}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{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:has(.abtasty-search-widget-autocomplete-suggestions-container):not(:has(.abtasty-search-widget-search-bar-container)) div.abtasty-search-widget-search-result-container div.abtasty-search-widget-search-facets-list{margin-top:32px;padding-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;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 widget-container (width > 575.98px){@container result-list (width > 399.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(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-content,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-content,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-content,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-content,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 <= 575.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-content,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{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 <= 767.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{max-width:240px;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 e=document.createElement("div");e.className=`${this.baseClassName}-recommendations-container`;const t=await Le.getTopCategories();if(t&&t.length){const s=document.createElement("div");s.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=z.getTranslation("Recherches populaires"),r&&(a.style.fontFamily="Lato")):window.location.hostname.includes("lafeemaraboutee")?a.innerHTML=z.getTranslation("Découvrez nos collections"):a.innerHTML=z.getTranslation("Categories"),s.appendChild(a);const n=document.createElement("div");n.className=`${this.baseClassName}-recommended-categories-list`;for(const e of t){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?Ie(a,e=>{e.value=t,me.setText(t)}):(this.searchBar?.setInputValue(t),me.setText(t))};n.appendChild(a)}s.appendChild(n),e.appendChild(s)}let s=null;s=DATA.useMarketBanners?this.getMarketBannersElement():await this.getProductRecommendationsElement(),s&&e.appendChild(s),this.recommendationsContainer=e,"no-results"!==DATA.defaultDisplay&&this.searchWidgetContainer.appendChild(this.recommendationsContainer)}async getProductRecommendationsElement(){const e=await Le.getRecos();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=z.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 Ae({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:m}=DATA,b=document.createElement("div");b.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:m});const f=document.createElement("div");f.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");if(r.src=e.imageSrc,t.appendChild(r),t.appendChild(s),t.appendChild(a),t.appendChild(i),e.link){const s=document.createElement("a");s.href=e.link,s.style.cursor="pointer",i.href=e.link,s.appendChild(t),f.appendChild(s)}else f.appendChild(t)}return b.appendChild(f),b}getSuggestionsContainerElement(e){const t=document.createElement("div");t.className=`${this.baseClassName}-autocomplete-suggestions-container`;for(const s of e){const e=document.createElement("div");e.className=`${this.baseClassName}-autocomplete-suggestion`,e.innerHTML=s,e.title=s,e.onclick=()=>{if("free"===DATA.layout){const{elementReferrer:e}=DATA,t=g(e);Ie(t,e=>{e.value=s,me.setText(s)})}else this.searchBar?.setInputValue(s),me.setText(s)},t.appendChild(e)}return t}}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()}async onAutocomplete(){const e=await super.onAutocomplete();this.suggestionsContainer&&this.suggestionsContainer.remove(),e.length&&(this.suggestionsContainer=this.getSuggestionsContainerElement(e),this.searchBar.searchBarContent.insertAdjacentElement("beforeend",this.suggestionsContainer))}}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 _e(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){He(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 He(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 Oe{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");if(t){t.addEventListener("reset",e=>{e.preventDefault(),e.stopPropagation(),this.resetSearch()}),t.addEventListener("submit",()=>{!ce.checkAndApplyRedirection()&&DATA.useRedirectionUrl&&DATA.redirectionUrl&&(window.location.href=DATA.redirectionUrl.replace("{{query}}",e.value))},{passive:!0}),t.action=void 0;for(const e of Object.keys(t.dataset))delete t.dataset[e]}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&&this.suggestionsContainer.remove(),e.length&&(this.suggestionsContainer=this.getSuggestionsContainerElement(e),this.searchWidgetContainer.insertAdjacentElement("afterbegin",this.suggestionsContainer))}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 Ve{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"===y(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}=f(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 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}=f(this.selector,()=>{const e=new Ve;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)||w(s,this.selector))&&t(!0)},{clear:a}=f(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):w(s,this.selector))&&t(!0)},{clear:a}=f(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}=f("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}=f("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 Je="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 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!==Ze)if(t===Ke&&l!==Ze)d();else{if(t!==Je||l===Ze||l===Ke)return!1;d()}else d();return o}setDisplayRecurrence(){const e=Je;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&&ke:Te;return s?(this.clearWatcher(),this.callback(s,!e,t),this.watch(),this):this}onCampaignLaunched({detail:{campaignId:e}}){e===TEST_ID&&(this.callback(Te,!1),this.watch())}onTagRollback({target:e}){return this.clearWatcher(e),this.callback($e,!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($e,!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}=f(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}=f("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 Ge(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=f(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={[$e]:()=>s?this.remove():this.pageWatcher.watch(this.rootElement),[Te]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):s||this.insert().then(e=>e.show()).catch(this.pageWatcher.watch):a()},[ke]:()=>{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:m,textAlign:b,fontName:p,fontStyle:f,fontSize:y,isTitle:w,titleTextAlign:v,titleTextColor:x,titleFontName:C,titleFontStyle:A,titleFontSize:T,overlay:k,overlayColor:S,dropShadow:E,dropShadowColor:R,dropShadowBlur:N,containerMargin:P,containerPadding:B,closeButton:L,closeButtonPosition:D,closeButtonSize:I,closeButtonBorderRadius:O,closeButtonBorderWidth:F,closeButtonBorderColor:j,closeButtonColor:M,closeButtonBackgroundColor:z,buttonsAlign:W,buttonsBorderWidth:_,buttonsBorderColor:H,buttonsBorderRadius:U,buttonsBackgroundColor:V,buttonsTextColor:q,buttonsFontName:G,buttonsFontStyle:J,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,f),this.loadFont(C,A),this.loadFont(G,J),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;`:"",me=void 0!==m?`color: ${m}; fill: ${m}; -webkit-text-fill-color: ${m};`:"",be=void 0!==b?`text-align: ${b};`:"",pe=p&&"inherit"!==p?`font-family:${p}_${f.match(tt)?f.match(tt)[1]:""};`:f||"",fe=y?`font-size: ${y}px;`:"",ye=void 0!==E&&E?`box-shadow: 0 5px ${N}px 0 ${R};`:"",we=P instanceof Array&&1===P.length&&P[0],ve=we?`margin: ${we.top}px ${we.right}px ${we.bottom}px ${we.left}px;`:"",xe=we?`margin: calc(${we.top}px * 0.5) calc(${we.right}px * 0.5) calc(${we.bottom}px * 0.5) calc(${we.left}px * 0.5);`:"",Ce=B instanceof Array&&1===B.length&&B[0],Ae=Ce?`padding: ${Ce.top}px ${Ce.right}px ${Ce.bottom}px ${Ce.left}px;`:"",$e=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);`:"",Te=void 0!==_&&_?`border-width: ${_}px; border-style: solid;`:"",ke=[H,_].every(e=>void 0!==e)&&_?`border-color: ${H};`:"",Se=void 0!==U?`border-radius: ${U}px;`:"",Ee=void 0!==V?`background-color: ${V};`:"",Re=void 0!==q?`color: ${q}; fill: ${q}; -webkit-text-fill-color: ${q};`:"",Ne=G&&"inherit"!==G?`font-family:${G}_${J.match(tt)?J.match(tt)[1]:""};`:J||"",Pe=K?`font-size: ${K}px;`:"",Be="number"==typeof Y?`border-width: ${Y}px; border-style: solid;`:"",Le=[X,Y].every(e=>void 0!==e)&&Y?`border-color: ${X};`:"",De=void 0!==Q?`border-radius: ${Q}px;`:"",Ie=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!==k&&!0!==k?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==S?S:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),ze="number"==typeof I?I:16,We=ze/2,_e=a||void 0!==L&&L?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===D?`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(""):"",He=w&&"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}_${A.match(tt)?A.match(tt)[1]:""};`:A||"",T?`font-size: ${T}px;`:"","}"].join(""):"";let Ue="";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(),Ue={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 Ve=[`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,`margin-${"fill"===W?"top":"left"}: 8px;`,Be,Le,De,Ie,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,me,be,ye,ve,pe,fe,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,me,be,pe,fe,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",Ae,pe,fe,"}",`#${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;",Te,ke,Se,Ee,Re,Ne,Pe,"}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a *:not(.second_link span), `,`#${this.widgetContainerId} .${this.contentClassName} button:not([class*="close_button"], [class*="csatEmojiButton"]) * {`,Re,Ne,Pe,"}",...Z?Ve:[],"@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,xe,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,$e,"}","}",Me,_e,He,Ue,`${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("")}}const ut=at.prototype.onPageChange;at.prototype.onPageChange=function(e,t,s){if(e!==Te)return ut.call(this,e,t,s);ut.call(this,void 0,t,s),this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):s||this.insert().catch(this.pageWatcher.watch):this.init()},(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},{name:DATA.noResultFontName,style:DATA.noResultFontStyle},{name:DATA.noResultRedirectionButtonFontName,style:DATA.noResultRedirectionButtonFontStyle}];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 Ue(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;f(i,e=>{if("free"===DATA.layout)Ie(e,e=>{const t=e.cloneNode(!0);e.parentElement.replaceChild(t,e),a.registerInputEvents(t)});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()&&(r||a.searchOpen?r&&a.searchOpen&&a.closeSearchWidget():a.openSearchWidget())}}),a})().then(()=>{})}();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@abtasty/search",
3
3
  "description": "Search Widget MVP",
4
- "version": "1.14.5",
4
+ "version": "1.14.6",
5
5
  "form": "dist/form.js",
6
6
  "main": "dist/main.js",
7
7
  "type": "module",