((i,g)=>{var t=i.gtmkitConsentGating||{},a=Array.isArray(t.requiredCategories)&&t.requiredCategories.length?t.requiredCategories:["analytics_storage","ad_storage"],o="string"==typeof t.containerId&&t.containerId?t.containerId:"",d=!1;function r(){if(!(d||(t=i.google_tag_manager)&&o&&t[o])){var t,e=g.querySelector('script[data-gtmkit-gated="1"]');if(e&&"1"!==e.getAttribute("data-gtmkit-unblocked")){for(var a=g.createElement("script"),r=0;r<e.attributes.length;r++){var n=e.attributes[r];"type"!==n.name&&"data-gtmkit-gated"!==n.name&&a.setAttribute(n.name,n.value)}a.type="text/javascript",a.text=e.text,e.setAttribute("data-gtmkit-unblocked","1"),e.parentNode&&e.parentNode.insertBefore(a,e.nextSibling),d=!0}}}function e(t){var e=i.gtmkit&&i.gtmkit.consent;(t=>{if(t){for(var e=0;e<a.length;e++)if("granted"!==t[a[e]])return;return 1}})(e&&e.state?e.state:t)&&r()}i.addEventListener("gtmkit:consent:updated",function(t){e(t&&t.detail)}),e(null)})(window,document);