(()=>{function $parcel$export(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}function $parcel$resolve(e){if(e=parcelRequire.i?.[e]||e,!$parcel$bundleURL)try{throw Error()}catch(n){var t=(""+n.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^)\n]+/g);if(!t)return $parcel$distDir+e;$parcel$bundleURL=t[0]}return new URL($parcel$distDir+e,$parcel$bundleURL).toString()}function $parcel$extendImportMap(e){Object.assign(parcelRequire.i??={},e)}var $parcel$bundleURL,$parcel$global=globalThis,$parcel$distDir="./",$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequiref191;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var t=$parcel$inits[e];delete $parcel$inits[e];var n={id:e,exports:{}};return $parcel$modules[e]=n,t.call(n.exports,n,n.exports),n.exports}var r=Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){$parcel$inits[e]=t},$parcel$global.parcelRequiref191=parcelRequire);var parcelRegister=parcelRequire.register;parcelRegister("hYfMQ",function(module,exports){$parcel$export(module.exports,"NinjaAnalitics",()=>NinjaAnalitics);var $dDaXw=parcelRequire("dDaXw"),$9DEso=parcelRequire("9DEso"),$5wkSn=parcelRequire("5wkSn"),$f4Cyr=parcelRequire("f4Cyr"),$csgz7=parcelRequire("csgz7"),$8uoRB=parcelRequire("8uoRB");class NinjaAnalitics{StorageRecorder=new(0,$5wkSn.StorageRecorder);EventRecorder=new(0,$dDaXw.EventRecorder);FetchRecorder=new(0,$9DEso.FetchRecorder);isTriggered=!1;system=(0,$f4Cyr.getUserAgentInfo)();utm=(0,$f4Cyr.getAllUtmParams)();startTime=performance.now();lastActivityTime=Date.now();firstActionTime=null;inject(){this.FetchRecorder.inject(),this.setupGlobalActivityTracker(),this.startPeriodicProcessing(),this.initBfCache()}async prepareAnaliticObject(){let e=await this.StorageRecorder.getStorageSlice(),t=this.EventRecorder.getEventsSlice(),n=this.FetchRecorder.getFetchSlice();if(0===t.length&&0===n.length)return null;let r=Date.now();return{sliceTime:Date.now(),storage:e,eventList:t,fetchList:n,location:window.location.pathname,system:this.system,referrer:""===document.referrer?null:document.referrer,utm:this.utm,metrics:{clickedImageCount:$8uoRB.Metrics.imageClickedCount,timeToFirstAction:this.firstActionTime,idleTime:r-this.lastActivityTime},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio||null,scrollY:window.scrollY}}}initBfCache(){window.addEventListener("pageshow",e=>{e.persisted&&(this.startTime=performance.now(),this.firstActionTime=null)})}setupGlobalActivityTracker(){let e=()=>{null===this.firstActionTime&&(this.firstActionTime=Math.round(performance.now()-this.startTime)),this.lastActivityTime=Date.now()};["click","scroll","keydown","mousemove"].forEach(t=>{window.addEventListener(t,e,{passive:!0})})}startPeriodicProcessing(){setInterval(async()=>{let slice=await this.prepareAnaliticObject();if(null===slice)return;let{data,detail,map}=await (0,$csgz7.postSession)(slice);if(window?.counterIds===void 0||void 0===data||this.isTriggered)return;if(data.success_ml&&!data.success)for(let id of(this.isTriggered=!0,window.counterIds))eval((0,$f4Cyr.stringBuilderDefault)(id));if(void 0===detail)return;let mlKeys=Object.keys(detail);for(let id of window.counterIds)for(let key of mlKeys)for(let mapKey of Object.keys(map[key]))!1===(0,$f4Cyr.isStoredMapKey)(mapKey)&&eval((0,$f4Cyr.stringBuilderScore)(id,key,Number(mapKey)))},1e3)}}}),parcelRegister("dDaXw",function(e,t){$parcel$export(e.exports,"EventRecorder",()=>r);var n=parcelRequire("lF80F");class r{DomEventManager=new(0,n.DomEventManager);eventState=[];constructor(){this.DomEventManager.inject(this.pushEvent.bind(this))}getEventsSlice(){let e=this.eventState.slice();return this.eventState.length=0,e}pushEvent(e,t){let n=JSON.stringify(t);this.eventState.push({event:e,value:n})}}}),parcelRegister("lF80F",function(e,t){$parcel$export(e.exports,"DomEventManager",()=>o);var n=parcelRequire("c34Va"),r=parcelRequire("8uoRB"),i=parcelRequire("f4Cyr");class o{static BLOCK_SELECTOR="section, header, footer, nav, form, [class*='popup'], [class*='modal'], [class*='gallery'], [class*='header'], [class*='footer'], [data-block]";static YANDEX_MAP_SELECTOR="ymaps, [class*='map'], iframe[src*='yandex']";static PII_FIELD_KEY=/^(name|fio|phone|tel|email)$/i;collectFunction=(e,t)=>{};_dwellMap=new Map;_lastClass=null;_lastT=null;_dwellInterval=null;inject(e){this.collectFunction=e,this.inputBinding(),this.mouseClickBinding(),this.mouseMoveBinding(),this.formSubmitBinding(),this.formSubmitClickBinding(),this.scrollBinding()}getBlockClass(e){let t=e.closest?.(o.BLOCK_SELECTOR);return t instanceof HTMLElement&&t.className||null}inputBinding(){document.addEventListener("input",(0,i.debounce)(e=>e.target.matches("input")?this.collectFunction(n.Ninja.EventEnum["input/text"],{value:e.target.value,placeholder:e.placeholder}):e.target.matches("select")?this.collectFunction(n.Ninja.EventEnum["input/select"],{value:e.target.value,placeholder:e.textContent}):e.target.matches("textarea")?this.collectFunction(n.Ninja.EventEnum["input/textarea"],{value:e.target.value,placeholder:e.placeholder}):void this.collectFunction(n.Ninja.EventEnum["input/unknown"],{value:e.target.value,placeholder:e.placeholder}),250))}mouseClickBinding(){document.addEventListener("click",e=>{if(!(e.target instanceof Element))return;let t=e.target,i=t.closest("a"),s=t.closest("img"),a=t.closest(o.YANDEX_MAP_SELECTOR),l=this.getBlockClass(t),c="mouse/click";if(i){let e=i.getAttribute("href")||"";return c="link/internal",e.startsWith("tel:")&&(c="click/phone"),e.startsWith("http")&&(c="link/external"),this.collectFunction(n.Ninja.EventEnum[c],{href:e,text:i.innerText,isTargetClick:!0,placeholder:t.textContent,block_class:l})}s&&(c="click/image",r.Metrics.imageClickedCount+=1),a&&(c="map/yandex");let u=t.matches("button, a, input, select, textarea")||"pointer"===window.getComputedStyle(t).cursor;this.collectFunction(n.Ninja.EventEnum[c],{isTargetClick:u,x:e.clientX,y:e.clientY,placeholder:t.textContent,block_class:l})})}mouseMoveBinding(){this._dwellInterval&&clearInterval(this._dwellInterval),this._dwellMap.clear(),this._lastClass=null,this._lastT=null,document.addEventListener("mousemove",(0,i.throttle)(e=>{if(!(e.target instanceof Element))return;let t=performance.now(),n=this.getBlockClass(e.target);if(this._lastClass&&null!=this._lastT){let e=t-this._lastT;e<5e3&&this._dwellMap.set(this._lastClass,(this._dwellMap.get(this._lastClass)||0)+e)}this._lastClass=n,this._lastT=t},50)),document.addEventListener("visibilitychange",()=>{document.hidden&&(this._lastT=null,this._lastClass=null)}),this._dwellInterval=setInterval(()=>{for(let[e,t]of this._dwellMap.entries())e&&!(t<100)&&this.collectFunction(n.Ninja.EventEnum["block/dwell"],{class:e,ms:Math.round(t)});this._dwellMap.clear()},1e3)}scrollBinding(){document.addEventListener("scroll",(0,i.throttle)(()=>{let e=Math.round((window.scrollY+window.innerHeight)/document.documentElement.scrollHeight*100);this.collectFunction(n.Ninja.EventEnum["scroll/depth"],{depth:e,sy:window.scrollY})},200));let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&this.collectFunction(n.Ninja.EventEnum["block/view"],{id:e.target.id,class:e.target.className})})},{threshold:.2,rootMargin:"0px"}),t=t=>{t.querySelectorAll(o.BLOCK_SELECTOR).forEach(t=>e.observe(t))};t(document),new MutationObserver(n=>{n.forEach(n=>{n.addedNodes.forEach(n=>{n instanceof HTMLElement&&(n.matches(o.BLOCK_SELECTOR)&&e.observe(n),t(n))})})}).observe(document.body,{childList:!0,subtree:!0})}async sha256Hex(e){return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))),e=>e.toString(16).padStart(2,"0")).join("")}async collectFormSubmit(e){let t=null;try{t=[];let n=[];for(let{key:r,value:i}of(new FormData(e).forEach((e,t)=>n.push({key:t,value:e})),n))i instanceof File?t.push({key:r,value:`[File:${i.name}]`}):o.PII_FIELD_KEY.test(r)?t.push({key:r,value:await this.sha256Hex(String(i))}):t.push({key:r,value:String(i)})}catch{t=null}this.collectFunction(n.Ninja.EventEnum["form/submit"],{block_class:this.getBlockClass(e),value:t})}formSubmitBinding(){document.addEventListener("submit",e=>{e.target instanceof HTMLFormElement&&this.collectFormSubmit(e.target)},!0),document.addEventListener("blur",async e=>{if(e.target instanceof HTMLInputElement){let t=!e.target.checkValidity();this.collectFunction(n.Ninja.EventEnum["form/field_blur"],{name:e.target.name,valid:!t,error:e.target.validationMessage})}},!0)}formSubmitClickBinding(){document.addEventListener("click",e=>{if(!(e.target instanceof Element))return;let t=e.target.closest("form [data-track-submit], form button[type='button'], form input[type='button']");if(!t)return;let n=t.closest("form");n instanceof HTMLFormElement&&(t.matches("button[type='submit'], input[type='submit']")||this.collectFormSubmit(n))},!0)}}}),parcelRegister("c34Va",function(e,t){var n;$parcel$export(e.exports,"Ninja",()=>n),function(e){!function(e){e.cookie="cookie",e.localStorage="localStorage",e.sessionStorage="sessionStorage"}(e.StorageEnum||(e.StorageEnum={})),function(e){e["input/text"]="input/text",e["input/textarea"]="input/textarea",e["input/select"]="input/select",e["input/unknown"]="input/unknown",e["mouse/click"]="mouse/click",e["mouse/move"]="mouse/move",e["form/submit"]="form/submit",e["scroll/depth"]="scroll/depth",e["block/view"]="block/view",e["block/dwell"]="block/dwell",e["click/phone"]="click/phone",e["click/external"]="click/external",e["click/image"]="click/image",e["form/field_blur"]="form/field_blur",e["link/internal"]="link/internal",e["link/external"]="link/external",e["map/yandex"]="map/yandex"}(e.EventEnum||(e.EventEnum={}))}(n||(n={}))}),parcelRegister("8uoRB",function(e,t){$parcel$export(e.exports,"AppConfig",()=>n),$parcel$export(e.exports,"Metrics",()=>r);let n=Object.freeze({__BACKEND__URL__:"https://met.vitmp.ru/intake"}),r={imageClickedCount:0}}),parcelRegister("f4Cyr",function(e,t){function n(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}function r(e,t){let n=null,r=null,i=null,o=()=>{r?(e.apply(i,r),r=null,i=null,n=setTimeout(o,t)):n=null};return function(...s){r=s,i=this,n||(e.apply(i,r),r=null,i=null,n=setTimeout(o,t))}}function i(){let e=navigator.userAgent,t=navigator.platform,n=navigator.language||null,r=null;/Chrome/.test(e)&&/Google Inc/.test(navigator.vendor)&&(r="Chrome"),/Safari/.test(e)&&/Apple Computer/.test(navigator.vendor)&&(r="Safari"),/Firefox/.test(e)&&(r="Firefox"),/MSIE|Trident/.test(e)&&(r="Internet Explorer"),/Edge/.test(e)&&(r="Edge");let i="desktop";return/Mobi|Android|iPhone|iPad|iPod/.test(e)&&(i="mobile"),{browser:r,platform:t,device:i,language:n}}function o(e){let t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");if(!t)return null;let n=t.pop();return void 0===n?null:n}function s(){let e=new URLSearchParams(window.location.search),t=[];for(let[n,r]of e.entries())n.toLowerCase().startsWith("utm_")&&t.push({utm_key:n,utm_value:r});return t}$parcel$export(e.exports,"debounce",()=>n),$parcel$export(e.exports,"throttle",()=>r),$parcel$export(e.exports,"getUserAgentInfo",()=>i),$parcel$export(e.exports,"getCookieValue",()=>o),$parcel$export(e.exports,"getAllUtmParams",()=>s),$parcel$export(e.exports,"isStoredMapKey",()=>l),$parcel$export(e.exports,"stringBuilderScore",()=>c),$parcel$export(e.exports,"stringBuilderDefault",()=>u);let a="storedMapValues",l=e=>{let t=localStorage.getItem(a);if(null===t)return localStorage.setItem(a,JSON.stringify([e])),!1;let n=JSON.parse(t);return!!n.includes(e)||(localStorage.setItem(a,JSON.stringify([...n,e])),!1)},c=(e,t,n)=>"yaCounter"+e+".reachGoal('potential_lead_"+t+"_"+n+"')",u=e=>"yaCounter"+e+".reachGoal('potential_lead_ml')"}),parcelRegister("9DEso",function(e,t){$parcel$export(e.exports,"FetchRecorder",()=>r);var n=parcelRequire("8uoRB");class r{fetchState=[];originalFetch=null;inject(){null===this.originalFetch&&(this.originalFetch=window.fetch.bind(window),window.fetch=async(e,t)=>{if(this.isOwnRequest(e,t))return this.originalFetch(e,t);let n=await this.captureRequest(e,t),r=await this.originalFetch(e,t);try{await this.captureResponse(n,r.clone())}catch{this.fetchState.push({...n,status:r.status,statusText:r.statusText,responseHeaders:this.headersToRecord(r.headers),responseBody:null})}return r})}getFetchSlice(){let e=this.fetchState.slice();return this.fetchState.length=0,e}isOwnRequest(e,t){return this.resolveRequestUrl(e,t).startsWith(n.AppConfig.__BACKEND__URL__)}resolveRequestUrl(e,t){return e instanceof Request?e.url:e instanceof URL?e.href:String(e)}async captureRequest(e,t){let n=this.resolveRequestUrl(e,t),r=t?.method??"GET",i=this.headersToRecord(t?.headers),o=null;return e instanceof Request?(r=t?.method??e.method,i=this.mergeHeaders(e.headers,t?.headers),o=await this.readRequestBody(e,t?.body)):o=await this.serializeBody(t?.body??null),{url:n,method:r,requestHeaders:i,requestBody:o,timestamp:Date.now()}}async captureResponse(e,t){let n=null;try{n=await t.text()}catch{n=null}this.fetchState.push({...e,status:t.status,statusText:t.statusText,responseHeaders:this.headersToRecord(t.headers),responseBody:n})}mergeHeaders(e,t){let n=new Headers(e);return void 0!==t&&new Headers(t).forEach((e,t)=>n.set(t,e)),this.headersToRecord(n)}headersToRecord(e){let t={};return void 0===e||new Headers(e).forEach((e,n)=>{t[n]=e}),t}async readRequestBody(e,t){if(null!=t)return this.serializeBody(t);if(null===e.body)return null;try{return await e.clone().text()}catch{return null}}async serializeBody(e){if(null===e)return null;if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){let t={};return e.forEach((e,n)=>{t[n]=e instanceof File?`[File:${e.name}]`:String(e)}),JSON.stringify(t)}if(e instanceof Blob)try{return await e.text()}catch{return`[Blob:${e.size}]`}return e instanceof ArrayBuffer?`[ArrayBuffer:${e.byteLength}]`:"[unsupported body]"}}}),parcelRegister("5wkSn",function(e,t){$parcel$export(e.exports,"StorageRecorder",()=>r);var n=parcelRequire("c34Va");class r{async getStorageSlice(){return[this.getCookie(),this.getLocalStorage(),this.getSessionStorage()]}getCookie(){return{type:n.Ninja.StorageEnum.cookie,value:document.cookie}}getLocalStorage(){return{type:n.Ninja.StorageEnum.localStorage,value:this.prepareStorage(localStorage)}}getSessionStorage(){return{type:n.Ninja.StorageEnum.sessionStorage,value:this.prepareStorage(sessionStorage)}}prepareStorage(e){let t=[];for(let n=0;n<e.length;n++){let r=e.key(n);null!==r&&t.push({key:r,value:e.getItem(r)})}return JSON.stringify(t)}}}),parcelRegister("csgz7",function(e,t){$parcel$export(e.exports,"postSession",()=>a);var n=parcelRequire("8uoRB"),r=parcelRequire("4gPn4"),i=parcelRequire("f4Cyr");let o=new(0,r.CryptoWorkerService),s={"Content-Type":"application/json"},a=async e=>{let t=await fetch(n.AppConfig.__BACKEND__URL__,{method:"POST",headers:s,body:JSON.stringify(await o.encrypt({yclid_v:(0,i.getCookieValue)("yclid_v"),session_v:(0,i.getCookieValue)("session_v"),cid_v:(0,i.getCookieValue)("cid_v"),domain:window.location.origin,data:e}))});return await t.json()}}),parcelRegister("4gPn4",function(e,t){$parcel$export(e.exports,"CryptoWorkerService",()=>n);class n{worker;constructor(){this.worker=new Worker(parcelRequire("2UlsV"))}async encrypt(e){return new Promise(t=>{this.worker.onmessage=e=>{t(e.data)},this.worker.postMessage(e)})}}}),parcelRegister("2UlsV",function(e,t){var n=parcelRequire("8YGt8");let r=new URL($parcel$resolve("kLQL1"));e.exports=n(r.toString(),r.origin,!1)}),parcelRegister("8YGt8",function(e,t){"use strict";e.exports=function(e,t,n){if(t===self.location.origin)return e;var r=n?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([r],{type:"application/javascript"}))}});var $f9dc0eae6c29978c$exports={};$parcel$extendImportMap({kLQL1:"crypto.worker.f3f2e246.js"});var $hYfMQ=parcelRequire("hYfMQ");document.addEventListener("DOMContentLoaded",()=>{(()=>{try{new(0,$hYfMQ.NinjaAnalitics)().inject()}catch(e){console.error(e)}})()})})();