/*! For license information please see ti.cfc8c0f533577b3be6de.js.LICENSE.txt */ (()=>{var e={41026:e=>{window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return g});function i(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?setTimeout(function(){t.setTransitionCSS(),t.elementContainer.classList.add("simple-parallax-initialized")},10):this.elementContainer.classList.add("simple-parallax-initialized"),this.isInit=!0))}},{key:"wrapElement",value:function(){var e=this.element.closest("picture")||this.element,t=this.customWrapper||document.createElement("div");t.classList.add("simpleParallax"),t.style.overflow="hidden",this.customWrapper||(e.parentNode.insertBefore(t,e),t.appendChild(e)),this.elementContainer=t}},{key:"unWrapElement",value:function(){var e=this.elementContainer;this.customWrapper?(e.classList.remove("simpleParallax"),e.style.overflow=""):e.replaceWith.apply(e,function(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.childNodes))}},{key:"setTransformCSS",value:function(){!1===this.settings.overflow&&(this.element.style[r]="scale(".concat(this.settings.scale,")")),this.element.style.willChange="transform"}},{key:"setTransitionCSS",value:function(){this.element.style.transition="transform ".concat(this.settings.delay,"s ").concat(this.settings.transition)}},{key:"unSetStyle",value:function(){this.element.style.willChange="",this.element.style[r]="",this.element.style.transition=""}},{key:"getElementOffset",value:function(){var e=this.elementContainer.getBoundingClientRect();if(this.elementHeight=e.height,this.elementTop=e.top+s.positions.top,this.settings.customContainer){var t=this.settings.customContainer.getBoundingClientRect();this.elementTop=e.top-t.top+s.positions.top}this.elementBottom=this.elementHeight+this.elementTop}},{key:"buildThresholdList",value:function(){for(var e=[],t=1;t<=this.elementHeight;t++){var n=t/this.elementHeight;e.push(n)}return e}},{key:"intersectionObserver",value:function(){var e={root:null,threshold:this.buildThresholdList()};this.observer=new IntersectionObserver(this.intersectionObserverCallback.bind(this),e),this.observer.observe(this.element)}},{key:"intersectionObserverCallback",value:function(e){var t=this;e.forEach(function(e){e.isIntersecting?t.isVisible=!0:t.isVisible=!1})}},{key:"checkIfVisible",value:function(){return this.elementBottom>s.positions.top&&this.elementTopthis.settings.maxTransition&&(e=this.settings.maxTransition),this.oldPercentage!==e&&(this.rangeMax||this.getRangeMax(),this.translateValue=(e/100*this.rangeMax-this.rangeMax/2).toFixed(0),this.oldTranslateValue!==this.translateValue&&(this.oldPercentage=e,this.oldTranslateValue=this.translateValue,!0))}},{key:"animate",value:function(){var e,t=0,n=0;(this.settings.orientation.includes("left")||this.settings.orientation.includes("right"))&&(n="".concat(this.settings.orientation.includes("left")?-1*this.translateValue:this.translateValue,"px")),(this.settings.orientation.includes("up")||this.settings.orientation.includes("down"))&&(t="".concat(this.settings.orientation.includes("up")?-1*this.translateValue:this.translateValue,"px")),e=!1===this.settings.overflow?"translate3d(".concat(n,", ").concat(t,", 0) scale(").concat(this.settings.scale,")"):"translate3d(".concat(n,", ").concat(t,", 0)"),this.element.style[r]=e}}])&&l(t.prototype,n),e}();function u(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(41026),t=n.n(e);class i{constructor(e,t){this._modal=document.querySelector(e),this._buttonClose=this._modal.querySelector(".popup-button-close"),this._closeButtonSelector=".popup-button-close",this._openedClass="popup_opened",this._handleEscButton=e=>{"Escape"===e.key&&this.close()},this._handleOverlayClick=e=>{e.target.classList.contains("popup_opened")&&this.close()},this._isOpened=!1}open(){this._modal.classList.add(this._openedClass),this._isOpened=!0,this._isEscHandleEnabled&&document.addEventListener("keydown",this._handleEscButton),this._isOverlayEnabled&&this._modal.addEventListener("mousedown",this._handleOverlayClick),this._isBodyFixWhenOpen&&document.querySelector("body").classList.add("body-fixed")}close(){this._modal.classList.remove(this._openedClass),this._isOpened=!1,this._isEscHandleEnabled&&document.removeEventListener("keydown",this._handleEscButton),this._isOverlayEnabled&&this._modal.removeEventListener("mousedown",this._handleOverlayClick),this._isBodyFixWhenOpen&&document.querySelector("body").classList.remove("body-fixed")}setEventListeners({overlay:e=!0,esc:t=!0,bodyfix:n=!0}={}){this._isOverlayEnabled=e,this._isEscHandleEnabled=t,this._isBodyFixWhenOpen=n,this._buttonClose.addEventListener("mousedown",()=>{this.close()})}}const s=new class extends i{constructor({popupImageSelector:e,popupImageDescSelector:t,buttonCloseSelector:n},i){super(i),this._popupImage=this._modal.querySelector(e),this._popupImageDesc=this._modal.querySelector(t),this._preloader=this._modal.querySelector(".popup-preloader"),n&&(this._buttonClose=this._modal.querySelector(n)),this._temporaryCloseHandler=null}setTemporaryHandleClose(e){this._temporaryCloseHandler=e}_clearTemporaryHandler(){this._temporaryCloseHandler=null}_setPreloader(){this._preloader&&(this._preloader.hidden=!1,this._popupImage.src="",this._popupImageDesc.textContent="Картинка загружается")}_unsetPreloader(){this._preloader&&(this._preloader.hidden=!0)}_loadImage(e){return new Promise((t,n)=>{const i=new Image;i.onload=()=>t(i),i.onerror=()=>n(new Error(`Не удалось загрузить по ${e}`)),i.src=e})}async open({link:e,desc:t}){this._setPreloader();try{super.open(),await this._loadImage(e),this._popupImage.src=e,this._popupImage.alt=t,this._popupImageDesc.textContent=t,requestAnimationFrame(()=>{this._popupImage.classList.remove("opacity-0","scale-90"),this._popupImageDesc.classList.remove("opacity-0","scale-90")})}catch(e){console.log(e),this._popupImageDesc.textContent="Что то пошло не так"}finally{console.log("сюда не заходим почему то"),this._unsetPreloader()}}close(){this._temporaryCloseHandler&&(this._temporaryCloseHandler(),this._clearTemporaryHandler()),setTimeout(()=>{this._popupImage.src=""},500),this._popupImage.alt="",this._popupImage.classList.add("opacity-0","scale-90"),this._popupImageDesc.classList.add("opacity-0","scale-90"),super.close()}}({popupImageSelector:".popup__image",popupImageDescSelector:".popup__image-description",buttonCloseSelector:".popup__button-close"},".popup-viewport");s.setEventListeners();const o=document.querySelector(".khan__book-pic_page_heatex");document.querySelector(".khan__buy-link").addEventListener("mousedown",()=>{s.open({link:o.src,desc:o.alt})}),s.setEventListeners(),new(t())(o,{delay:.6,transition:"cubic-bezier(0,0,0,1)"})})()})();