File: /var/www/html/insiders/wp-load/wp-content/plugins/breadly/build/script.js
!function(){"use strict";function e(e,t){e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)}const t="gtm-reveal--active",o=()=>{c(),n(),r(),a(),d()},c=()=>{((e,o={})=>{const c={activeClass:t};o=Object.assign({},c,o),document.querySelectorAll(e).forEach((e=>{const t=e.dataset.revealPosition??.8,c=()=>{(window.pageYOffset||document.documentElement.scrollTop)/(document.documentElement.scrollHeight-window.innerHeight)>t?function(e,t){e.classList.contains(t)||e.classList.add(t)}(e,o.activeClass):function(e,t){e.classList.contains(t)&&e.classList.remove(t)}(e,o.activeClass)};window.addEventListener("scroll",c,{passive:!0}),c()}))})(".wp-block-gtm-floating-box.gtm-reveal-condition--scroll-position"),document.body?.addEventListener("onasdblockdetected",(e=>{document.querySelectorAll(".wp-block-gtm-floating-box.gtm-reveal-condition--asd-block-detected").forEach((e=>{e.classList.add(t)}))})),document.querySelectorAll(".wp-block-gtm-floating-box.gtm-reveal-condition--id-link").forEach((e=>{e.id&&document.querySelectorAll('[href="#'+e.id+'"]').forEach((o=>{o.addEventListener("click",(o=>{e.classList.add(t)}))}))})),document.querySelectorAll(".wp-block-gtm-floating-box").forEach((e=>{e.querySelectorAll('[href="#close"]').forEach((o=>{o.addEventListener("click",(o=>{e.classList.remove(t)}))}))}))},n=()=>{document.querySelectorAll(".wp-block-gtm-sliding-panel").forEach((o=>{if(o.id){const c=o.querySelector(".wp-block-gtm-sliding-panel__wrapper"),n=o.querySelector(".wp-block-gtm-sliding-panel__container"),l=c=>{e(n,t),e(o,"wp-block-gtm-sliding-panel--is-active"),c?.stopPropagation(),c?.preventDefault()};document.querySelectorAll(`[href="#${o.id}"]`).forEach((e=>{e.addEventListener("click",l)})),o.querySelectorAll('[href="#close"]').forEach((e=>{e.addEventListener("click",l)})),c?.addEventListener("click",(e=>{e.target==c&&l()}))}}))};const l="gtm-is-hover";function i(e){e.classList.remove(l),e.querySelectorAll(".gtm-is-hover").forEach((e=>{e.classList.remove(l)}))}function s(e,t){for(;(e=e.parentNode)&&e!==t;);return!!e}const r=()=>{document.querySelectorAll(".wp-block-gtm-mega-menu-link").forEach((e=>{(function(e,t){if(t){const e=e=>{!function(e,t){if(t){const e="--gtm-mega-menu-link-submenu-offset-x";t.style.removeProperty(e);const o=t.getBoundingClientRect(),c=document.body.getBoundingClientRect(),n=10,l=500,i=o.x+l+o.width,s=c.width-n;let r="0px";i>s&&(r=s-i+"px"),t.style.setProperty(e,`calc( ${l}px + ${r} )`)}}(0,t)};["mouseenter","touchend"].forEach((e=>{})),window.addEventListener("resize",e),e()}})(0,e.querySelector(":scope > .wp-block-gtm-mega-menu-link__submenu-container")),function(e,t){["mouseenter","touchend"].forEach((t=>{e.addEventListener(t,(o=>{e.closest(".wp-block-gtm-mega-menu").querySelectorAll(".gtm-is-hover").forEach((t=>{e==t||s(e,t)||t.classList.remove(l)})),e.classList.contains(l)?("touchend"==t||i(e),o.stopPropagation()):(e.classList.add(l),o.stopPropagation(),o.preventDefault())}))})),["mouseleave"].forEach((t=>{e.addEventListener(t,(t=>{i(e)}))}))}(e),function(e){document.body.addEventListener("touchend",(t=>{s(t.target,e)||i(e)}))}(e)})),document.querySelectorAll(".wp-block-gtm-mega-menu").forEach((e=>{e.classList.add("wp-block-gtm-mega-menu--initialized")}))},a=()=>{document.querySelectorAll(".wp-block-gtm-direction").forEach((e=>{e.querySelector(":scope .wp-block-gtm-direction__mark-as-done-container").addEventListener("click",(t=>{e.classList.toggle("wp-block-gtm-direction--done")}))}))},d=()=>{document.querySelectorAll(".wp-block-gtm-ingredient__item").forEach((e=>{e.querySelector(":scope .wp-block-gtm-ingredient__mark-as-done-container").addEventListener("click",(t=>{e.classList.toggle("wp-block-gtm-ingredient__item--done")}))}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o()}();