"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[4418],{600:function(t,n,e){function r(t,n,e,r,o,i,c){try{var d=t[i](c),a=d.value}catch(t){return void e(t)}d.done?n(a):Promise.resolve(a).then(r,o)}function o(t){return function(){var n=this,e=arguments;return new Promise(function(o,i){var c=t.apply(n,e);function d(t){r(c,o,i,d,a,"next",t)}function a(t){r(c,o,i,d,a,"throw",t)}d(void 0)})}}function i(t){return o(function*(){const n=new FormData;for(let e in t)n.append(e,t[e]);n.append("IS_AJAX_ACTION","Y");try{const t=yield fetch("/",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:n});return yield t.json()}catch(t){return console.log("error",t),!1}})()}e.d(n,{A:function(){return i}})},5711:function(t,n,e){var r=e(600);function o(t,n,e,r,o,i,c){try{var d=t[i](c),a=d.value}catch(t){return void e(t)}d.done?n(a):Promise.resolve(a).then(r,o)}function i(t){return function(){var n=this,e=arguments;return new Promise(function(r,i){var c=t.apply(n,e);function d(t){o(c,r,i,d,a,"next",t)}function a(t){o(c,r,i,d,a,"throw",t)}d(void 0)})}}let c=!1;const d=(t,n,e)=>{const r=document.createElement(n);r.textContent=t,e.appendChild(r)},a=(t,n)=>{if(t){const{noscriptContent:e,scriptContent:r}=(t=>{const n=(new DOMParser).parseFromString(t,"text/html");return{scriptContent:n.querySelector("script").textContent,noscriptContent:n.body.firstChild}})(t);d(r,"script",n),d(e,"noscript",n)}},u=()=>i(function*(){if(!c)try{const t=yield i(function*(){try{const t=yield fetch("/api/thirdParty/thirdParty.php");if(t.ok)return yield t.json()}catch(t){console.error("Error fetching data:",t)}})();t&&t.isSuccess&&!t.isDev&&((t=>{const{ruTarget:n,topMail:e,googleAnalytics:r,yandex:o,jivosite:i}=t;[n,e].forEach(t=>{a(t,document.head)}),[r,o,i].forEach(t=>{a(t,document.body)})})(t),c=!0)}catch(t){console.error("Error adding third-party content:",t)}})(),s=()=>{var t;window.digiLayer=null!==(t=window.digiLayer)&&void 0!==t?t:{},window.digiLayer.cartState=function(){var t;if(null===(t=window.APP)||void 0===t?void 0:t.BASKET)return Object.fromEntries(Object.entries(window.APP.BASKET).map(([t,n])=>[t,n.QUANTITY]))},window.digiLayer.addToCart=function(t,n){return i(function*(){if(!t)return!1;const e=document.querySelectorAll(".js-basket-button-count");let o=yield(0,r.A)({ACTION:"add2basket",ITEM_ID:t||"",QUANTITY:n||1});return"OK"===o.STATUS&&(window.APP.BASKET[t]={PRODUCT_ID:t,QUANTITY:n||1},e.forEach(t=>{o.BASKET_QUANTITY>98?t.innerText="99":t.innerText=o.BASKET_QUANTITY}),!0)})()},window.digiLayer.removeFromCart=function(t){return i(function*(){if(!t)return!1;const n=document.querySelectorAll(".js-basket-button-count");let e=yield(0,r.A)({ACTION:"removeFromBasketIdCard",ITEM_ID:t||""});return"SUCCESS"===e.STATUS&&(n.forEach(t=>{e.AMOUNT>98?t.innerText="99":t.innerText=e.AMOUNT}),delete window.APP.BASKET[t],!0)})()}};"loading"===document.readyState?window.addEventListener("DOMContentLoaded",()=>{s()},{once:!0}):s(),window.addEventListener("click",u,{once:!0}),window.addEventListener("scroll",u,{once:!0})}},function(t){t(t.s=5711)}]);