!function(){"use strict";var e=window.ctFrontend;(0,e.registerDynamicChunk)("blocksy_mega_menu",{mount:function(e){const n=e.filter(function(e){return e.closest("ul")}).map(function(e){return parseFloat([...e.parentNode.classList].find(function(e){return e.match(/^menu-item-\d{1,}/)}).replace("menu-item-",""))});(function(e,n){return new Promise(function(t){const i=localStorage.getItem(blocksyMegaMenu.persistence_key+":"+e);if(i){const e=JSON.parse(i);if(e&&n.every(function(n){return e.find(function(e){return e.id===n})}))return void t(JSON.parse(i))}const r=new FormData;r.append("ids",n.join(",")),r.append("menu_id",e),fetch(`${ct_localizations.ajax_url}?action=blc_retrieve_mega_menu_content`,{method:"POST",body:r}).then(function(e){return e.json()}).then(function({success:n,data:i}){if(!n)return;if(!i)return;const[r,c,o]=blocksyMegaMenu.persistence_key.split(":"),s=[];for(let n=0;n<localStorage.length;n++){const t=localStorage.key(n);if(0!==t.indexOf([r,c].join(":")))continue;const[i,o,l,u]=t.split(":");r===i&&c===o&&u===e&&s.push(t)}s.map(function(e){localStorage.removeItem(e)}),localStorage.setItem(blocksyMegaMenu.persistence_key+":"+e,JSON.stringify(i.content)),t(i.content)})})})(e[0].closest('ul[id^="menu-"]').id.replace("menu-",""),n).then(function(n){e.filter(function(e){return e.closest("ul")}).map(function(e){const t=parseFloat([...e.parentNode.classList].find(function(e){return e.match(/^menu-item-\d{1,}/)}).replace("menu-item-","")),i=n.find(function(e){return e.id===t});if(!i)return;const r=document.createElement("div");r.innerHTML=e.innerHTML;const c=document.createElement("div");c.innerHTML=i.content,e.innerHTML=c.firstElementChild.innerHTML,e.className=c.firstElementChild.className,[...e.querySelectorAll(".menu-item")].map(function(e){const n=r.querySelector(`#${e.id}`);n&&(e.firstElementChild&&n.firstElementChild&&n.matches(".ct-menu-link")&&(e.firstElementChild.innerHTML=n.firstElementChild.innerHTML),e.firstElementChild&&n.firstElementChild&&n.firstElementChild.matches(".ct-menu-link")&&(e.firstElementChild.outerHTML=n.firstElementChild.outerHTML),e.className=n.className)})}),ctEvents.trigger("blocksy:frontend:init")})}})}();