"use strict";(self.blocksyJsonP=self.blocksyJsonP||[]).push([[68],{68:function(e,t,n){n.r(t),n.d(t,{getCacheFor:function(){return d},mount:function(){return p}});var r=n(601),i=n.n(r);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=function(e){return[...e.querySelectorAll("[data-items] > [data-id]")].filter((function(e){return-1===e.dataset.id.indexOf("menu")})).reduce((function(e,t){let n=window.getComputedStyle(t);return e+t.getBoundingClientRect().width+parseInt(n.getPropertyValue("margin-left"))+parseInt(n.getPropertyValue("margin-right"))}),0)},c=function(e){let t=window.getComputedStyle(e);return d(e.__id).itemsWidth.reduce((function(e,t){return e+t}),0)+(parseInt(t.getPropertyValue("margin-left"))+parseInt(t.getPropertyValue("margin-right")))},l=function(e){let t=function(e){let t=e.closest('[class*="ct-container"]'),n=t.getBoundingClientRect().width,r=e.closest("[data-column]").dataset.column,i="start"===r||"end"===r?"side":"middle"===r?"middle":"secondary",o=t.querySelector('[data-column="middle"]');if("side"===i&&!o){let r=t.querySelectorAll('[data-id*="menu"]');const i=[...r].reduce((function(e,t){return e+c(t)}),0),o=c(e);let u=n-a(t);return r.length>1&&(u*=100*o/i/100),u}return"middle"===i?n-2*Math.max(t.querySelector('[data-column="start"]')?a(t.querySelector('[data-column="start"]')):0,t.querySelector('[data-column="end"]')?a(t.querySelector('[data-column="end"]')):0):(n-(t.querySelector('[data-column="middle"]')?a(t.querySelector('[data-column="middle"]')):0))/2-a(e.closest("[data-column]"))}(e),n=e.closest('[class*="ct-container"]'),r=window.getComputedStyle(e);if(!(c(e)>t))return{fit:d(e.__id).children,notFit:[]};let i=n.querySelectorAll('[data-id*="menu"]');return d(e.__id).children.reduce((function(n,a,c){let{fit:l,notFit:s}=n;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},d(e.__id).itemsWidth.slice(0,c+1).reduce((function(e,t){return e+t}),0)<t-100/i.length-(parseInt(r.getPropertyValue("margin-left"))+parseInt(r.getPropertyValue("margin-right")))?{fit:[...l,a],notFit:s}:{notFit:[...s,a],fit:l})}),{fit:[],notFit:[]})};let s={};const d=function(e){return s[e]},m=function(e){return Array.from(e.children).filter((function(e){return!e.matches("link")}))[0]},f=function(e){return Array.from(m(e).children).filter((function(e){return!e.classList.contains(".more-items-container")&&e.firstElementChild})).map((function(e,t){if(e.firstElementChild.matches("a")&&!e.querySelector("svg")){const t=e.firstElementChild;t.innerHTML=`<span>${t.innerHTML}</span>`;const n=window.getComputedStyle(t,null);let r=t.firstElementChild.getBoundingClientRect().width+parseInt(n.getPropertyValue("padding-left"),10)+parseInt(n.getPropertyValue("padding-right"),10)+(t.querySelector(".ct-toggle-dropdown-desktop")?13:0);return t.innerHTML=t.firstElementChild.innerHTML,r}return e.firstElementChild.getBoundingClientRect().width}))};new ResizeObserver((function(){[...document.querySelectorAll('header [data-device="desktop"] [data-id^="menu"][data-responsive]')].map((function(e){return p(e)}))})).observe(document.body);const p=function(e){if(!m(e))return;if(function(e){[...e.closest('[class*="ct-container"]').querySelectorAll('[data-id*="menu"]')].map((function(e){e.__id||(e.__id=Math.random()),s[e.__id]||m(e)&&(s[e.__id]={el:e,previousRenderedWidth:null,children:[...Array.from(m(e).children).filter((function(e){return!e.classList.contains("more-items-container")})),...m(e).querySelector(".more-items-container")?[...m(e).querySelector(".more-items-container .sub-menu").children]:[]],itemsWidth:f(e)},e.dataset.responsive="yes")}))}(e),s[e.__id].previousRenderedWidth&&s[e.__id].previousRenderedWidth===window.innerWidth)return;s[e.__id].previousRenderedWidth=window.innerWidth;let{fit:t,notFit:n}=l(e);if(0===n.length)return e.querySelector(".more-items-container")&&(t.map((function(t){m(e).insertBefore(t,e.querySelector(".more-items-container")),Array.from(t.querySelectorAll(".menu-item-has-children, .page_item_has_children")).filter((function(e){return!!e.closest('[class*="ct-mega-menu"]')})).map((function(e){return e.classList.remove("animated-submenu")}))})),e.querySelector(".more-items-container").remove()),h(),void i().trigger("ct:header:init-popper");document.querySelector('header [data-device="desktop"]')&&function(e,t){if(e.querySelector(".more-items-container"))return void t();const n=document.createElement("li");n.classList.add("menu-item-has-children"),n.classList.add("more-items-container"),n.classList.add("animated-submenu"),n.classList.add("menu-item"),n.role="none",n.insertAdjacentHTML("afterbegin",`<a href="#" class="ct-menu-link" role="menuitem">\n      ${ct_localizations.more_text}\n      <span class="ct-toggle-dropdown-desktop">\n        <svg class="ct-icon" width="8" height="8" viewBox="0 0 15 15">\n            <path d="M2.1,3.2l5.4,5.4l5.4-5.4L15,4.3l-7.5,7.5L0,4.3L2.1,3.2z"></path>\n        </svg>\n      </span>\n    </a>\n    <button class="ct-toggle-dropdown-desktop-ghost" aria-expanded="false" aria-label="${ct_localizations.expand_submenu}" role="menuitem"></button>\n    <ul class="sub-menu" role="menu"></ul>`),m(e).appendChild(n),t&&t()}(e,(function(){n.map((function(t){e.querySelector(".more-items-container .sub-menu").appendChild(t),t.classList.add("animated-submenu"),Array.from(t.querySelectorAll(".menu-item-has-children, .page_item_has_children")).map((function(e){return e.classList.add("animated-submenu")}))})),t.map((function(t){m(e).insertBefore(t,e.querySelector(".more-items-container")),Array.from(t.querySelectorAll(".menu-item-has-children, .page_item_has_children")).filter((function(e){return!!e.closest('[class*="ct-mega-menu"]')})).map((function(e){return e.classList.remove("animated-submenu")}))})),h(),i().trigger("ct:header:init-popper")}))},h=function(){[...document.querySelectorAll('header [data-device="desktop"] [data-id*="menu"] > .menu')].map((function(e){[...e.children].filter((function(e){return e.querySelector(".sub-menu")})).filter((function(e){return function(e){return e.classList.contains("animated-submenu")&&(!e.parentNode.classList.contains("menu")||-1===e.className.indexOf("ct-mega-menu")&&e.parentNode.classList.contains("menu"))}(e)})).map((function(e){return e.querySelector(".sub-menu")})).map((function(e){[...e.querySelectorAll("[data-submenu]")].map((function(e){e.removeAttribute("data-submenu")})),e._popper&&(e._popper.destroy(),e._popper=null)}))}))}}}]);