"use strict";(self.webpackChunkgulp_template=self.webpackChunkgulp_template||[]).push([[767],{8373:function(t,e,n){var o=n(6014),i=n(270),c=n(1641),r=n(3723),s=n(2048),a=n(50),l=n(7343),d=n(4636),u=n(4228),f=n(3109),h=n(1238),m=n(8180);function p(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function g(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var c=t.apply(e,n);function r(t){p(c,o,i,r,s,"next",t)}function s(t){p(c,o,i,r,s,"throw",t)}r(void 0)}))}}window.addEventListener("DOMContentLoaded",(function(){function t(t){const e=function(t){const e=t[0],n=t[1];let o="";const i=document.location.origin,c=document.location.pathname;let r=document.location.search,s=!1;if(r.includes("min_price")){const t=r.split("&"),n=t.findIndex((t=>t.includes("min_price")));s=t[n].includes("?"),t[n]=`min_price=${e}`,r=t.join("&")}if(r.includes("max_price")){const t=r.split("&"),e=t.findIndex((t=>t.includes("max_price")));t[e]=`max_price=${n}`,r=t.join("&")}if(s&&(r=`?${r}`),!r.includes("min_price")&&!r.includes("max_price")&&e&&n&&(r=r?`${r}&min_price=${e}&max_price=${n}`:`?min_price=${e}&max_price=${n}`),r.includes("min_price")&&!r.includes("max_price")){const t=new URLSearchParams(r);e?t.set("min_price",e):t.delete("min_price"),r=t.size>0?`?${t.toString()}`:""}if(!r.includes("min_price")&&r.includes("max_price")){const t=new URLSearchParams(r);n?t.set("max_price",n):t.delete("max_price"),r=t.size>0?`?${t.toString()}`:""}return r&&(o=`${i}${c||""}${r}`),o}(t);window.location.replace(e)}(0,c.A)(a.A),(0,c.u)(a.A,t),(0,r.A)(a.A),(0,o.A)(i.A,".catalog-collections__grid-item"),function(){const t=document.querySelector(".js-show-more-products"),e=window.collectionsList.params;t&&(t.dispatchEvent(new Event("click")),t.addEventListener("click",g((function*(){const n=document.querySelector(".js-catalog-products-grid"),o=(null==n?void 0:n.dataset.firstPage)||2;t.style.display="none",(0,s.A)("show-global");try{const i=yield BX.ajax.runComponentAction("citfact:collections.list","loadPage",{mode:"class",data:{page:o,signedParameters:e}});if("success"===i.status&&(i.data.nextPage&&(n.dataset.firstPage=i.data.nextPage,t.style.display="inline-block"),n)){n.insertAdjacentHTML("beforeend",i.data.products);const t=n.querySelectorAll(".js-product");if(t.length){const e=i.data.products.match(/data-id="\d*"/)[0].match(/\d/g).join(""),n=Array.from(t).findIndex((t=>Number(t.dataset.id)===Number(e)));-1!==n&&(0,d.F)(Array.from(t).slice(n))}}}catch(t){console.log(t)}finally{(0,s.A)("show-global")}}))))}(),(0,m.A)(),(0,h.A)(),window.matchMedia("(min-width: 996px)").matches&&((0,l.A)("catalog-collections__grid"),(0,u.g)()),setTimeout((()=>{(0,f.A)(t,!0)}),1e3)}))},4965:function(t,e,n){function o(){const t=document.querySelectorAll(".js-accordion");t.length&&t.forEach((t=>{const e=t.querySelector(".js-accordion-content"),n=t.querySelector(".js-accordion-button");n&&e&&n.addEventListener("click",(function(){t.classList.toggle("show"),t.classList.contains("show")?e.style.maxHeight=`${e.scrollHeight}px`:e.style.maxHeight=0}))}))}n.d(e,{A:function(){return o}})},3218:function(t,e,n){function o(){const t=document.body,e=window.innerWidth-t.clientWidth;if(t.style.transition="margin-right 0.3s easy-in-out",t.style.marginRight=`${e}px`,t.style.overflow="hidden",!window.matchMedia("(min-width: 996px)").matches){const e=window.pageYOffset;t.style.top=-e+"px",t.style.position="fixed",t.style.width="100%"}}function i(){const t=document.body;if(t.style.transition="margin-right 0s easy-in-out",t.style.marginRight="0",t.style.overflow="unset",!window.matchMedia("(min-width: 996px)").matches){const e=Math.abs(parseInt(t.style.top||0,10));t.style.position="static",t.style.width="auto",t.style.removeProperty("top"),window.scrollTo(0,e||0)}}n.d(e,{$:function(){return o},W:function(){return i}})},1641:function(t,e,n){n.d(e,{A:function(){return a},u:function(){return l}});var o=n(9743);function i(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var r=t.apply(e,n);function s(t){i(r,o,c,s,a,"next",t)}function a(t){i(r,o,c,s,a,"throw",t)}s(void 0)}))}}function r(t){return s.apply(this,arguments)}function s(){return s=c((function*(t){const e=document.querySelectorAll(".js-filters-container");if(e.length){const n={};localStorage.removeItem("filter"),e.forEach((t=>{const e=t.querySelectorAll(".js-dropdown");t.dataset.type&&(n.type=t.dataset.type),t.dataset.sectionId&&(n.sectionId=t.dataset.sectionId),e.length&&e.forEach((t=>{"brand"===t.getAttribute("data-property")&&t.querySelector(".js-dropdown-all").click();const e=t.querySelectorAll(".js-checkbox"),n=t.querySelector(".js-dropdown-label");n&&(n.innerText=n.dataset.placeholder),e.length&&e.forEach((t=>{t.checked=!1}))}))})),localStorage.setItem("filter",JSON.stringify(n)),yield t(),window.showMore=!0}})),s.apply(this,arguments)}function a(t){const e=document.querySelectorAll(".js-filters-container"),n=document.querySelectorAll(".js-clear-filters");if(localStorage.removeItem("filter"),n.length&&n.forEach((e=>{e.addEventListener("click",(function(){r(t)}))})),e.length){const o={};function i(){let t=!0;if(Object.keys(o).length)for(const e in o)if(Array.isArray(o[e])&&o[e].length){t=!1;break}const e=new URLSearchParams(window.location.search);(e.has("min_price")||e.has("max_price"))&&(t=!1),n.forEach((e=>{t?e.hasAttribute("disabled")||e.setAttribute("disabled",!0):e.hasAttribute("disabled")&&e.removeAttribute("disabled")}))}function s(t,e){o[e]?function(t){for(let n=0;n{t.checked&&s(t,e)}))}function l(t,e,n){let o=0;e.forEach((t=>{t.checked&&"all"!==t.value&&(0===o&&(n.innerText=""),o++,o>1&&(n.innerText+=", "),n.innerText+=t.dataset.label)})),o>0&&!t.classList.contains("selected")&&t.classList.add("selected"),0===o&&t.classList.contains("selected")&&t.classList.remove("selected")}e.forEach((e=>{const n=e.querySelectorAll(".js-dropdown"),r=e.querySelector(".js-show-more-products");let d=null;e.dataset.type&&(o.type=e.dataset.type),e.dataset.sectionId&&(o.sectionId=e.dataset.sectionId),localStorage.setItem("filter",JSON.stringify(o)),n.length&&n.forEach((e=>{const n=e.querySelectorAll(".js-checkbox"),u=e.querySelector(".js-dropdown-label"),f=e.dataset.property?e.dataset.property:"";if(n.length){const h=Array.from(n).find((t=>"all"===t.value));n.forEach((a=>{a.dispatchEvent(new Event("change")),a.addEventListener("change",(function(){if(this.classList.contains("js-checkbox-all"))this.checked?n.forEach((t=>{t.checked||t.closest("label").classList.contains("checkbox__disabled")||(t.checked=!0,s(t,f))})):(n.forEach((t=>{t.checked&&(t.checked=!1)})),o[f].splice(0,o[f].length),u.innerText=u.getAttribute("data-placeholder"));else if(this.checked)s(a,f);else{const t=o[f].findIndex((t=>t===this.value));(0===t||h&&h.checked)&&(h&&(h.checked=!1),o[f][1]||(u.innerText=u.getAttribute("data-placeholder"))),o[f].splice(t,1)}l(e,n,u),i(),localStorage.setItem("filter",JSON.stringify(o)),e.closest(".js-dialog-filters")||(d&&clearTimeout(d),d=setTimeout(c((function*(){yield t(),window.showMore||(window.showMore=!0,r&&(button.style.display="inline-block"))})),600))}))})),l(e,n,u),a(n,f),i()}}))}))}}function l(t,e){const n=document.querySelector(".js-tags"),i=document.querySelector(".js-tags-scroll");var s;n&&(n.addEventListener("click",(s=c((function*(n){const o=n.target.closest(".js-tags-remove"),i=n.target.closest(".js-tags-item"),c=n.target.closest(".js-tags-clear");if(o&&i){const n=JSON.parse(localStorage.getItem("filter")),c=o.dataset.type,r=o.dataset.value;if(n[c]&&"max_price"!==c&&"min_price"!==c&&(n[c]=n[c].filter((t=>t!==r)),localStorage.setItem("filter",JSON.stringify(n)),yield t()),("max_price"===c||"min_price"===c)&&e){const t=new URL(window.location.href),n=document.querySelector(".js-filters-container .min-price"),o=document.querySelector(".js-filters-container .max-price");t.searchParams.delete(c);const i=t.searchParams.toString(),r=i?`${t.pathname}?${i}${t.hash}`:`${t.pathname}${t.hash}`;history.replaceState(null,"",r),e(["min_price"===c?n.dataset.min:t.searchParams.get("min_price"),"max_price"===c?o.dataset.max:t.searchParams.get("max_price")])}i.remove()}else c&&r(t)})),function(t){return s.apply(this,arguments)})),i&&new o.A(i,{autoHide:!1}))}},3109:function(t,e,n){n.d(e,{A:function(){return c}});var o=n(9476);function i(t,e,n){if(t&&e&&n){const o=t.querySelector(".js-dropdown-label"),i={minValue:Number(e.dataset.min),maxValue:Number(n.dataset.max),currentMinValue:Number(e.value)||Number(e.dataset.min),currentMaxValue:Number(n.value)||Number(n.dataset.max)};i.minValue!==i.currentMinValue||i.maxValue!==i.currentMaxValue?(t.classList.contains("selected")||t.classList.add("selected"),o.innerText=`${i.currentMinValue||i.minValue} - ${i.currentMaxValue||i.maxValue}`):(t.classList.contains("selected")&&t.classList.remove("selected"),o.innerText=o.dataset.placeholder)}}function c(t,e){const n=document.querySelectorAll(".js-cost-range");n.length&&n.forEach((n=>{var c,r;const s=n.closest(".js-dropdown"),a=n.querySelector(".js-cost-range-element"),l=n.querySelectorAll(".js-cost-range-value"),d=e?Number(null===(c=n.querySelector("[data-min]"))||void 0===c?void 0:c.dataset.min):"",u=e?Number(null===(r=n.querySelector("[data-max]"))||void 0===r?void 0:r.dataset.max):"";if(a&&2===l.length){const n=[e?Number(l[0].dataset.costRangeValueMin)||d:Number(l[0].nextElementSibling.value),e?Number(l[1].dataset.costRangeValueMax)||u:Number(l[1].nextElementSibling.value)];i(s,l[0].nextElementSibling,l[1].nextElementSibling),o.Ay.create(a,{start:n,range:{min:e?d:Number(l[0].dataset.min),max:e?u:Number(l[1].dataset.max)},step:1,connect:!0}),a.noUiSlider.on("update",(function(t,e){l[e].innerText=t[e]})),a.noUiSlider.on("change",(function(e,n){l[n].nextElementSibling.value=e[n],i(s,l[0].nextElementSibling,l[1].nextElementSibling),l[n].closest(".js-dialog-filters")||l[n].nextElementSibling.dispatchEvent(new Event("change")),t&&t([...e])}))}}))}},2585:function(t,e,n){n.r(e),n.d(e,{default:function(){return i}});var o=n(3218);function i(t,e=null,n=[]){const i=document.querySelector(".js-navigation");t&&(i.classList.contains("navigation__fixed--white")||i.classList.add("navigation__fixed--white"),t.on("show",(()=>{(0,o.$)(),e&&e(...n)})),t.on("hide",(()=>{(0,o.W)(),t.destroy()})),t.show())}},3723:function(t,e,n){n.d(e,{A:function(){return s}});var o=n(7083),i=n(2585);function c(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function r(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var r=t.apply(e,n);function s(t){c(r,o,i,s,a,"next",t)}function a(t){c(r,o,i,s,a,"throw",t)}s(void 0)}))}}function s(t){const e=document.querySelector(".js-dialog-filters");if(!e)return;const n=document.querySelectorAll(".js-dialog-filters-button"),c=e.querySelector(".js-submit-filters"),s=document.querySelector(".js-show-more-products");c.addEventListener("click",r((function*(){yield t(),window.showMore||(window.showMore=!0,s&&(button.style.display="inline-block"))}))),n.forEach((t=>{t.addEventListener("click",(function(){if(e){const t=new o.default(e);(0,i.default)(t)}}))}))}},7343:function(t,e,n){function o(t){const e=document.querySelector(".js-grid-two"),n=document.querySelector(".js-grid-auto");if(n&&e){const o=document.querySelector(".js-catalog-grid");e.addEventListener("click",(function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),o.classList.add(`${t}--two-columns`),this.nextElementSibling.classList.remove("catalog-page-actions__grid-button--active"))})),n.addEventListener("click",(function(){this.classList.contains("catalog-page-actions__grid-button--active")||(this.classList.add("catalog-page-actions__grid-button--active"),o.classList.remove(`${t}--two-columns`),this.previousElementSibling.classList.remove("catalog-page-actions__grid-button--active"))}))}}n.d(e,{A:function(){return o}})},4636:function(t,e,n){n.d(e,{F:function(){return v}});var o=n(600);function i(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var r=t.apply(e,n);function s(t){i(r,o,c,s,a,"next",t)}function a(t){i(r,o,c,s,a,"throw",t)}s(void 0)}))}}const r="active",s=document.querySelectorAll(".js-favorites-button-count"),a=document.querySelectorAll(".js-compare-button-count"),l=document.querySelectorAll(".js-basket-button-count");function d(t,e){return u.apply(this,arguments)}function u(){return u=c((function*(t,e,n=!1){var i;if((null===(i=window.APP)||void 0===i?void 0:i.FAVORITES)&&window.APP.FAVORITES.includes(Number(e))&&t.classList.add(r),!n)try{const n=yield(0,o.A)({ACTION:"add2favorites",ITEM_ID:e});if("OK"===n.STATUS){if(y(t,s,n.EVENT),g(s),"REMOVE"===n.EVENT){const t=window.APP.FAVORITES.indexOf(+e);-1!==t&&window.APP.FAVORITES.splice(t,1)}else window.APP.FAVORITES.push(+e);"REMOVE"===n.EVENT&&"/favorites/"===window.location.pathname&&(t.closest(".js-product-card").remove(),0===document.querySelectorAll(".js-product-card").length&&(document.querySelector(".js-wrap-favorites").innerHTML="",document.querySelector(".js-empty-info").classList.remove("hidden")))}}catch(t){console.log(t)}})),u.apply(this,arguments)}function f(t,e){return h.apply(this,arguments)}function h(){return h=c((function*(t,e,n=!1,i=1){var c;if((null===(c=window.APP)||void 0===c?void 0:c.BASKET)&&Object.keys(window.APP.BASKET).includes(String(e))&&(t.innerText=t.dataset.incart,t.classList.add("js-added-to-cart")),!n&&t.classList.contains("js-added-to-cart"))window.location.href="/cart/";else if(!n)try{"OK"===(yield(0,o.A)({ACTION:"add2basket",ITEM_ID:e,QUANTITY:i})).STATUS&&(l.forEach((t=>{const e=t.innerText;Number(e)>98?t.innerText="99":t.innerText=Number(e)+1})),t.innerText=t.dataset.incart,t.classList.add("js-added-to-cart"),window.APP.BASKET[e]={PRODUCT_ID:Number(e),QUANTITY:i},t.classList.contains("js-reload-page")&&location.reload())}catch(t){console.log(t)}})),h.apply(this,arguments)}function m(t,e){return p.apply(this,arguments)}function p(){return p=c((function*(t,e,n=!1){var i;if((null===(i=window.APP)||void 0===i?void 0:i.COMPARE)&&window.APP.COMPARE.includes(Number(e))&&t.classList.add(r),!n)try{const n=yield(0,o.A)({ACTION:"add2compare",ITEM_ID:e});if("OK"===n.STATUS)if(y(t,a,n.EVENT),g(a),"REMOVE"===n.EVENT){const t=window.APP.COMPARE.indexOf(+e);-1!==t&&window.APP.COMPARE.splice(t,1)}else window.APP.COMPARE.push(+e)}catch(t){console.log(t)}})),p.apply(this,arguments)}function g(t){t.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;Number(e)<=0?t.classList.add("hidden"):t.classList.remove("hidden")}))}function y(t,e,n){t.classList.toggle(r),"REMOVE"===n?e.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;t.innerText=Number(e)-1})):e.forEach((t=>{const e=t.innerText.includes("+")?t.innerText.split("+")[0]:t.innerText;t.innerText=Number(e)+1}))}function v(t){t.length&&window.APP&&(t.forEach((t=>{const e=t.querySelectorAll(".js-add-to-cart"),n=t.querySelectorAll(".js-add-to-cart-obrazec"),i=t.querySelectorAll(".js-add-to-cart-catalog"),r=t.querySelectorAll(".js-add-to-favorite"),s=t.querySelectorAll(".js-add-to-compare"),a=t.querySelectorAll(".js-one-click-buy"),l=Number(t.dataset.id);e.length&&e.forEach((t=>{f(t,l,!0),t.addEventListener("click",(function(){const e=this.closest(".js-actions-container"),n=null==e?void 0:e.querySelector(".js-count-picker-input"),o=n?Number(n.value):1;f(this,t.dataset.id||l,!1,o)}))})),r.length&&r.forEach((t=>{d(t,l,!0),t.addEventListener("click",(function(e){e.stopPropagation(),d(this,t.dataset.id||l)}))})),s.length&&s.forEach((t=>{m(t,l,!0),t.addEventListener("click",(function(e){e.stopPropagation(),m(this,t.dataset.id||l)}))})),n.length&&n.forEach((t=>{const e=t.dataset.id;if(f(t,e,!0),window.APP.BASKET&&window.APP.BASKET[e]){const n=t.closest(".js-actions-container"),o=null==n?void 0:n.querySelector(".js-obrazec-checkbox");o&&(o.checked=!!window.APP.BASKET[e].NO_CUT)}t.addEventListener("click",c((function*(){const n=this.closest(".js-actions-container"),i=window.matchMedia("(min-width: 996px)").matches?t.previousElementSibling.querySelector(".js-count-picker-input"):n.querySelector(".js-count-picker-input"),c=Number(i.value);yield f(this,e,!1,c);try{yield(0,o.A)({ACTION:"setDntCut",ITEM_ID:e})}catch(t){console.log(t)}})))})),i.length&&i.forEach((t=>{const e=t.dataset.id;f(t,e,!0),t.addEventListener("click",c((function*(){f(this,e)})))})),a.length&&a.forEach((t=>{t.addEventListener("click",c((function*(){const e=document.querySelector(".js-count-picker-input"),n=e?Number(e.value):1,o=t.dataset.id||l;yield f(this,o,!1,n),window.location.replace("/order/")})))}))})),g(a),g(s))}},4228:function(t,e,n){function o(){const t=document.querySelector(".js-navigation"),e=document.querySelector(".wrapper"),n=document.querySelector(".js-header-actions");let o=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-top")),i=window.scrollY;function c(){0===o&&(o=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-top"))),i>100&&!n.classList.contains("fixed")&&(e.style.paddingTop=`${o+n.clientHeight}px`,n.classList.add("fixed")),i<=100&&n.classList.contains("fixed")&&(e.style.paddingTop=`${o}px`,n.classList.remove("fixed"))}e&&t&&n&&(n.style.top=t.clientHeight-2+"px",c(),window.addEventListener("scroll",(function(){n.style.top=t.clientHeight-2+"px",i=window.scrollY,c()}),{passive:!0}))}n.d(e,{g:function(){return o}})},2048:function(t,e,n){n.d(e,{A:function(){return i}});var o=n(3218);function i(t,e=!0){const n=document.querySelector(".js-loader");n&&(e?n.classList.add("loader-fixed"):n.classList.remove("loader-fixed"),n.classList.toggle(t),n.classList.contains("loader-fixed")&&(n.classList.contains("show-global")?(0,o.$)():(0,o.W)()))}},8180:function(t,e,n){n.d(e,{A:function(){return i}});var o=n(9889);function i(){document.querySelectorAll(".js-quick-links").forEach(c)}function c(t){const e=t.querySelector(".js-quick-links-toggle-item"),n=t.querySelector(".js-quick-links-toggle-btn"),i=Array.from(t.querySelectorAll(".js-quick-links-item"));if(!e||!n||!i.length)return;t.classList.add("init");let c=!1;function r(){a(i,!0),e.classList.add("quick-links__item--hidden");const t=function(t){const e=new Map;return t.forEach((t=>{const n=Math.round(t.getBoundingClientRect().top);e.has(n)||e.set(n,[]),e.get(n).push(t)})),Array.from(e.values())}(i);t.length<=2||(a([...s(t[1]),...t.slice(2).flat()],!1),e.classList.remove("quick-links__item--hidden"),n.textContent="Показать ещё")}function s(t){return[t[t.length-1]]}function a(t,e){t.forEach((t=>t.classList.toggle("quick-links__item--hidden",!e)))}e.classList.add("quick-links__item--hidden"),n.addEventListener("click",(function(){c=!c,c?(a(i,!0),e.classList.remove("quick-links__item--hidden"),n.textContent="Скрыть"):r()})),r(),window.addEventListener("resize",(0,o.A)((()=>{c||r()}),150))}},50:function(t,e,n){n.d(e,{A:function(){return c}});var o=n(2048);function i(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function c(){return r.apply(this,arguments)}function r(){return t=function*(){(0,o.A)("show-global");try{const t=localStorage.getItem("filter"),e=t?JSON.parse(t):{},n=window.collectionsList.params,o=yield BX.ajax.runComponentAction("citfact:collections.list","getUrl",{mode:"class",data:{filter:e,signedParameters:n}});"success"===o.status?(localStorage.setItem("lastScrollPosition",window.scrollY),localStorage.setItem("scrollToLastPosition","y"),window.location=window.location.origin+o.data.url):console.log(o.data)}catch(t){console.log(t)}finally{(0,o.A)("show-global")}},r=function(){var e=this,n=arguments;return new Promise((function(o,c){var r=t.apply(e,n);function s(t){i(r,o,c,s,a,"next",t)}function a(t){i(r,o,c,s,a,"throw",t)}s(void 0)}))},r.apply(this,arguments);var t}},270:function(t,e,n){function o(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function i(t){return c.apply(this,arguments)}function c(){return t=function*(t){const e=document.querySelector(".js-filters-on-page"),n=localStorage.getItem("filter"),o=n?JSON.parse(n):{},i=window.collectionsList.params;var c;o.type||(o.type=(null==e||null===(c=e.dataset)||void 0===c?void 0:c.type)?e.dataset.type:"false",localStorage.setItem("filter",JSON.stringify(o)));try{return yield BX.ajax.runComponentAction("citfact:collections.list","loadPage",{mode:"class",data:{page:t,signedParameters:i}})}catch(t){return console.log(t),!1}},c=function(){var e=this,n=arguments;return new Promise((function(i,c){var r=t.apply(e,n);function s(t){o(r,i,c,s,a,"next",t)}function a(t){o(r,i,c,s,a,"throw",t)}s(void 0)}))},c.apply(this,arguments);var t}n.d(e,{A:function(){return i}})},600:function(t,e,n){function o(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function i(t){return c.apply(this,arguments)}function c(){return t=function*(t){const e=new FormData;for(let n in t)e.append(n,t[n]);e.append("IS_AJAX_ACTION","Y");try{const t=yield fetch("/",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:e});return yield t.json()}catch(t){return console.log("error",t),!1}},c=function(){var e=this,n=arguments;return new Promise((function(i,c){var r=t.apply(e,n);function s(t){o(r,i,c,s,a,"next",t)}function a(t){o(r,i,c,s,a,"throw",t)}s(void 0)}))},c.apply(this,arguments);var t}n.d(e,{A:function(){return i}})},6014:function(t,e,n){n.d(e,{A:function(){return r}});var o=n(2048);function i(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var r=t.apply(e,n);function s(t){i(r,o,c,s,a,"next",t)}function a(t){i(r,o,c,s,a,"throw",t)}s(void 0)}))}}function r(t,e,n){const i=document.querySelector(".js-catalog-infinity-scroll"),r=new IntersectionObserver(((t,n)=>{t.forEach((t=>{if(t.isIntersecting&&!a){const t=document.querySelectorAll(e);t.length&&(n.unobserve(t[t.length-1]),l())}}))}),{threshold:.5});let s=i?i.dataset.firstPage:2,a=!1;window.showMore=!0;const l=function(){var e=c((function*(){""!==i.dataset.firstPage&&0===Number(i.dataset.firstPage)||(s=i.dataset.firstPage||2,a=!0,(0,o.A)("show",!1),setTimeout(c((function*(){try{const e=yield t(s);"success"===e.status?(e.data.collections.length&&(s=e.data.nextPage,i.dataset.firstPage=s,(t=>{i.insertAdjacentHTML("beforeend",t)})(e.data.collections),r.observe(i.lastElementChild)),0===Number(e.data.nextPage)&&(window.showMore=!1,r.unobserve(i.lastElementChild))):console.log("error",e)}catch(t){console.log("error",t)}finally{a=!1,(0,o.A)("show",!1),"function"==typeof n&&n()}})),500))}));return function(){return e.apply(this,arguments)}}();null!==i&&r.observe(i.lastElementChild)}},1238:function(t,e,n){n.d(e,{A:function(){return a}});var o=n(4965),i=n(600),c=n(3218);function r(t,e,n,o,i,c,r){try{var s=t[c](r),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(o,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var c=t.apply(e,n);function s(t){r(c,o,i,s,a,"next",t)}function a(t){r(c,o,i,s,a,"throw",t)}s(void 0)}))}}function a(){(0,o.A)();const t=document.querySelectorAll(".js-split-price");t.length&&t.forEach(function(){var t=s((function*(t){if(document.querySelector("[data-sum-discount-all-products]")){let t=document.querySelector("[data-sum-discount-all-products]").getAttribute("data-sum-discount-all-products");const e=yield(0,i.A)({ACTION:"getHalvaPlanHtml",PRICE:t});let n=document.querySelector(".split-price__cost"),o=document.querySelector(".js-split-price"),c=o?o.querySelector(".card-split-cost"):void 0;"success"===e.STATUS?(c&&c.remove(),n.innerHTML="Разбить на части без переплат",o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),o.appendChild((new DOMParser).parseFromString(e.html,"text/html").querySelector(".card-split-cost"))):("USER"===e.CODE?o.closest(".basket-aside__info-split").classList.add("basket-aside__info-split--without-border"):o.closest(".basket-aside__info-split").classList.remove("basket-aside__info-split--without-border"),n.innerHTML=e.MESSAGE,c&&c.classList.add("hidden"))}t.addEventListener("click",(t=>{t.preventDefault()}));const e=t.querySelectorAll('[data-modal="open"]'),n=document.querySelector('[data-modal="container"]'),o=n.querySelectorAll('[data-modal="close"]');e&&e.forEach((t=>{t&&t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),n.classList.add("active"),(0,c.$)()}))})),o&&o.forEach((t=>{t&&t.addEventListener("click",(t=>{t.stopPropagation(),n.classList.contains("active")&&(n.classList.remove("active"),(0,c.W)())}))}))}));return function(e){return t.apply(this,arguments)}}())}},9889:function(t,e,n){function o(t,e){let n;return function(){const o=this,i=arguments;clearTimeout(n),n=setTimeout((()=>{t.apply(o,i)}),e)}}n.d(e,{A:function(){return o}})}},function(t){t.O(0,[8096],(function(){return t(t.s=8373)})),t.O()}]);