((n,r)=>{var t=n.gtmkitEngagementEvents||{};let i="string"==typeof t.cookieName&&t.cookieName?t.cookieName:"gtmkit_engagement_event",s="string"==typeof t.cookiePath&&t.cookiePath?t.cookiePath:"/";function a(){var t=n.gtmkit_settings;return t&&"string"==typeof t.datalayer_name&&t.datalayer_name?t.datalayer_name:"dataLayer"}function c(t){var e=n.gtmkit&&n.gtmkit.events;e&&"function"==typeof e.push?e.push(t,a()):(e=a(),n[e]=n[e]||[],n[e].push(t))}function e(){var e=(t=>{var e=t+"=",a=r.cookie?r.cookie.split(";"):[];for(let t=0;t<a.length;t++){var o=a[t].replace(/^\s+/,"");if(0===o.indexOf(e))return o.substring(e.length)}return null})(i);if(null!==e){{var a=i;var o=s;let t="=; Max-Age=0; Path="+o+"; SameSite=Lax";"https:"===n.location.protocol&&(t+="; Secure"),r.cookie=a+t}let t;try{t=JSON.parse(decodeURIComponent(e.replace(/\+/g,"%20")))}catch(t){return}t&&"object"==typeof t&&"string"==typeof t.event&&c(t)}}function o(){if(e(),r.body&&r.body.classList&&r.body.classList.contains("gtmkit-search-results")){let t=r.body.dataset?r.body.dataset.gtmkitSearchTerm:r.body.getAttribute("data-gtmkit-search-term");"string"==typeof t&&""!==(t=t.replace(/^\s+|\s+$/g,""))&&c({event:"search",search_term:t})}}"loading"===r.readyState?r.addEventListener("DOMContentLoaded",o):o()})(window,document);