!function(a,E,o){"use strict";a.Mango.sbjs=function s(r,n,a){function o(i,e){if(!n[i]){if(!r[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);e=new Error("Cannot find module '"+i+"'");throw e.code="MODULE_NOT_FOUND",e}t=n[i]={exports:{}};r[i][0].call(t.exports,function(e){var t=r[i][1][e];return o(t||e)},t,t.exports,s,r,n,a)}return n[i].exports}for(var c="function"==typeof require&&require,e=0;ee.json())}post(e,t){return fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-type":"application/json;charset=utf-8"},body:JSON.stringify(t)})}jsonp(o){let c=1{const s=String(Math.floor(Math.random()*Date.now())),r="mgo"+s;c.callback=r,l[r]=function(e){delete l[r],delete c.callback;var t=d.getElementById(s);t.parentNode.removeChild(t),i(e)};var t=this._getUrlParamsString(c)?o+"?"+this._getUrlParamsString(c):o,n=d.createElement("script"),a=d.getElementsByTagName("head")[0]||d.body||d.documentElement;n.src=t,n.id=s,n.addEventListener("error",e),a.appendChild(n)})}handleResponse(e,i,s){return e.then(e=>{var{data:e,error:t}=e;return i(t?s:e)},e=>i(s))}_getUrlParamsObject(e,r){let n=2{var t,i=r[e],s=Array.isArray(r);return"object"==typeof i?this._getUrlParamsObject(e,i,[...n,e]):(t=n.map((e,t)=>0===t?e:"["+e+"]").join(""),this._encodeScalar(t+"["+(s?"":e)+"]",i))}).join("&")}_getUrlParamsArray(t,e){return e.map(e=>this._encodePair(t+" + '[]'",e))}_encodeScalar(e,t){return encodeURIComponent(e)+"="+encodeURIComponent(t)}_encodePair(e,t){return null!==t&&"object"==typeof t?this._getUrlParamsObject(e,t,[e]):Array.isArray(t)?this._getUrlParamsArray(e,t):this._encodeScalar(e,t)}_getUrlParamsString(t){return Object.keys(t).filter(e=>!this._isEmpty(t[e])).map(e=>this._encodePair(e,t[e])).join("&")}_isEmpty(e){return null==e}sendGet(e,t){return this.get(e,t)}}}(window,document,window.Mango=window.Mango||{}),function(t,r){"use strict";r.Common=r.Common||{};const i="mgo_uid",s="mgo_sid",n="mgo_cnt",a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,c=parseInt("x00",36);function l(e,t,i){for(var s=2this.incrementSessionCount()});return r.Cookies.set(s,e,{expires:1800,domain:this._getDomain()}),e}refreshSession(e){var t=this.getSessionId(),e=e||1800;r.Cookies.set(s,t,{expires:e,domain:this._getDomain()})}_getDomain(){return this.domain.replace(/^www\./,"")}_validateDomain(e){return/^[a-zA-Z0-9]+([-.][a-zA-Z0-9]{2,})+$/.test(e)&&-1{return t=parseInt(l("1",e,"0"),36),e=parseInt(l("",e,"z"),36),(Math.floor(Math.random()*(e-t))+t).toString(36);var t}}((window,document),window.Mango=window.Mango||{}),function(x,e){"use strict";e.Utils=e.Utils||{},e.Utils.Dom={MAIL_PREFIX:"mailto:",PHONE_PREFIX:"tel:",stringEquals(e,t,i){return i?"string"==typeof e&&"string"==typeof t&&e.length===t.length&&e.toLowerCase()===t.toLowerCase():e===t},findAndReplaceContent(t,e){var i=2this.stringEquals(String(e.textContent).trim(),t,s))).length)&&(this._replaceContent(i,e),!0)},findAndReplaceMultiple(e){var t,i,s,r=1{var[t,i,s]=t;return e[t]||(e[t]=[[],s]),e[t][0].push(i),e},{});for(const f of Object.values(e))this._replaceContent(...f);return!0},_replaceContent(){var e=0{e.hasAttribute("href")&&this._replaceAttributes(e,t),!e.firstElementChild&&e.firstChild&&(e.textContent=t)})},_replaceAttributes(e,t){var i=this._getHrefPrefix(e);i&&e.setAttribute("href",""+i+t)},_getHrefPrefix(e){return this._isEmailLink(e)?this.MAIL_PREFIX:this._isPhoneLink(e)?this.PHONE_PREFIX:""},_isEmailLink(e){return-1e(t))}}}((window,document,window.Mango=window.Mango||{})),function(e){"use strict";e.Utils=e.Utils||{};const i=new Map,t={LOAD_SCRIPT_TIME:"loadScript",BEFORE_LOAD_SCRIPT_TIME:"beforeLoadScript",BEFORE_LOAD_NUMBER_TIME:"beforeLoadNumber",LOAD_NUMBER_TIME:"loadNumber",SHOW_NUMBER_TIME:"showNumber"},s={MARKS:{MAIN_START:"main:start",GET_NUMBER:"getNumber",GOT_NUMBER:"gotNumber",SHOWED_NUMBER:"showedNumber"},MEASURES:t},r={INITIAL:"initial"};e.Utils.PF_REPORTS=r,e.Utils.PF_METRICS=s,e.Utils.Performance={mark(e){this._hasPerformanceSupport()&&performance.mark(e)},measure(e,t,i){this._hasPerformanceSupport()&&performance.measure(e,t,i)},getMeasure(e){return this._hasPerformanceSupport()&&(e=this.getByName(e,"measure"))?e.pop():null},getMeasures(){return this._hasPerformanceSupport()?performance.getEntriesByType("measure"):[]},getMark(e){return this._hasPerformanceSupport()&&(e=this.getByName(e,"mark"))?e.pop():null},getMarks(){return this._hasPerformanceSupport()?performance.getEntriesByType("mark"):[]},getResources(){return this._hasPerformanceSupport()?performance.getEntries().filter(e=>"resource"===e.entryType):[]},getByName(e,t){return this._hasPerformanceSupport()?performance.getEntriesByName(e,t):[]},_getMainScript(){var e=this.getResources();return 0!==e.length&&e.find(e=>e.name.includes("widgets/mango.js"))||{}},_calcMeasure(e,t,i){return this.measure(e,t,i),this.getMeasure(e)||{}},saveReport(e){var t;return!this._hasPerformanceSupport()||i.has(e)?null:((t=this._calculateReport(e))&&i.set(e,t),t)},getReport(e){return this._hasPerformanceSupport()?e?i.has(e)?i.get(e):null:Object.fromEntries(i):null},_calculateReport(e){return e!==r.INITIAL?null:(e=this._getMainScript(),{[t.BEFORE_LOAD_SCRIPT_TIME]:e.startTime,[t.LOAD_SCRIPT_TIME]:e.duration,[t.BEFORE_LOAD_NUMBER_TIME]:this._calcMeasure(t.BEFORE_LOAD_NUMBER_TIME,s.MARKS.MAIN_START,s.MARKS.GET_NUMBER).duration,[t.LOAD_NUMBER_TIME]:this._calcMeasure(t.LOAD_NUMBER_TIME,s.MARKS.GET_NUMBER,s.MARKS.GOT_NUMBER).duration,[t.SHOW_NUMBER_TIME]:this._calcMeasure(t.SHOW_NUMBER_TIME,s.MARKS.GOT_NUMBER,s.MARKS.SHOWED_NUMBER).duration})},_hasPerformanceSupport(){return Boolean(performance&&performance.mark&&performance.measure&&performance.getEntries&&performance.getEntriesByName)}}}((window,document,window.Mango=window.Mango||{})),function(e,t){"use strict";t.Analytics=t.Analytics||{};t.Analytics.ActivitySpy=class extends t.EventEmitter{constructor(e){super(),this.isActive=!1,this.isSpying=!1,this.startTime=e,this._updateActivity=this._updateActivity.bind(this)}start(){this.isSpying&&this.stop(),this.isSpying=!0,e.addEventListener("mousemove",this._updateActivity),e.addEventListener("scroll",this._updateActivity),e.addEventListener("keydown",this._updateActivity),this._intervalId=setInterval(t.Helpers.bind(this._onInterval,this),1e3),this.startTime=this.startTime||this._getCurrentTime(),this.activeTimeArray=[],this._activate()}stop(){this.isActive=!1,e.removeEventListener("mousemove",this._updateActivity),e.removeEventListener("scroll",this._updateActivity),e.removeEventListener("keydown",this._updateActivity),clearInterval(this._intervalId),this.isSpying=!1}_activate(){this.isActive=!0,this.startActivityTime=this._getCurrentTime(),this.emit("activity:on")}_deactivate(){this.isActive=!1,this.activeTimeArray.push({start:this.startActivityTime,end:this._getCurrentTime()}),this.emit("activity:off")}_updateActivity(){this.lastActivityTime=this._getCurrentTime()}_onInterval(){var e=this._getCurrentTime()-this.lastActivityTime;this.isActive&&3e4<=e&&this._deactivate(),!this.isActive&&e<3e4&&this._activate(),this.emit("tick",()=>{this.getTotalTime(),this.getActiveTime()})}getTotalTime(){return this._getCurrentTime()-this.startTime}getActiveTime(){var t=0;return _(this.activeTimeArray).forEach(function(e){t+=e.end-e.start}),this.isActive&&(t+=this._getCurrentTime()-this.startActivityTime),t}getTimeSinceLastActive(){var e;return this.isActive?0:this._getCurrentTime()-(null==(e=this.activeTimeArray[this.activeTimeArray.length-1])?void 0:e.end)}_getCurrentTime(){return(new Date).getTime()}}}((window,document),window.Mango=window.Mango||{}),function(e,t,i){"use strict";i.Analytics=i.Analytics||{};i.Analytics.CursorSpy=class extends i.EventEmitter{constructor(e,t,i){super(),this.isSpying=!1,this.pageY=0,this.oldPageY=0,this.diffPageY=0,this.scrollTopArea=0,this._intervalId="",this.speed=e||100,this.top=t||200,this.interval=i||100}start(){this.isSpying&&this.stop(),this.isSpying=!0,this._mouseMoveHandler=this._onMouseSpy.bind(this),t.addEventListener("mousemove",this._mouseMoveHandler),this._intervalId=setInterval(i.Helpers.bind(this._onInterval,this),this.interval)}stop(){this._mouseMoveHandler&&(t.removeEventListener("mousemove",this._mouseMoveHandler),this._mouseMoveHandler=null),clearInterval(this._intervalId),this.isSpying=!1}_onInterval(){this.diffPageY=this.oldPageY>this.pageY?this.oldPageY-this.pageY:0,this.scrollTopArea=e.scrollY+this.top,0this.speed&&this.pageYthis.currentScroll&&this.scrollTopStep>this.currentScrollTopStep&&this._getScrollPercent(!0)}_getScrollParams(){this.scrollTop=i.scrollY+this.clientHeight,this.scrollTopStep=Math.floor(this.scrollTop/this.scrollStep)}_getScrollPercent(e){e&&(this.currentScroll=this.scrollTop,this.currentScrollTopStep=this.scrollTopStep),this.currentScrollPercent=this.scrollPercent,this.scrollPercent=Math.floor(this.scrollTop/(this.scrollHeight/100)),this.scrollPercent=this.scrollPercent-this.scrollPercent%10,this.currentScrollPercent!=this.scrollPercent&&this.emit("scroll",this.scrollPercent)}}}(window,document,window.Mango=window.Mango||{}),function(e,t){"use strict";t.Analytics=t.Analytics||{};var i=[".mango-call-site > button",".mango-call-site > a"].join(","),s=[".mango-callback > button.button-widget-open",".mango-callback > a.button-widget-open",".mango-callback > .selected-label button.button-widget-open"].join(",");t.Analytics.WidgetSpy=class extends t.EventEmitter{constructor(){super(),this.isSpying=!1,this._callSiteHandler=this._callSiteHandler.bind(this),this._callBackHandler=this._callBackHandler.bind(this)}start(){this.isSpying&&this.stop(),this.isSpying=!0,e.addEventListener("click",this._callSiteHandler),e.addEventListener("click",this._callBackHandler)}stop(){this.isSpying=!1,e.removeEventListener("click",this._callSiteHandler),e.removeEventListener("click",this._callBackHandler)}_callSiteHandler(e){null!=(e=e.target)&&e.matches(i)&&this.emit("callsite:open")}_callBackHandler(t){var e;null!=(e=t.target)&&e.matches(s)&&setTimeout(()=>{var e=t.target.parentElement.classList.contains(".selected-label")||t.target.parentElement;(1==e.length&&e.hasClass("widget-show")||0==e.length)&&this.emit("callback:open")},10)}}}((window,document),window.Mango=window.Mango||{}),function(e,t){"use strict";t.Analytics=t.Analytics||{},t.Analytics.Information=class{getPageTitle(){return e.title||""}}}((window,document),window.Mango=window.Mango||{}),function(e,t,r){"use strict";r.Analytics=r.Analytics||{},r.Analytics.Tracker=class{constructor(){this.session=r.session,this.httpClient=r.httpClient}track(e,t){var e=r.Helpers.extend(e,{sid:this.session.getSessionId(),uid:this.session.getUserId(),title:this._getPageTitle(),referrer:this._getReferrerUrl()}),i=(this.session.isNewUser&&(e.nu=Number(this.session.isNewUser)),this.session.getUserIp()),i=(i&&(e.uip=i),r.Helpers.isEmpty(e.url)&&(e.url=this._getPageUrl()),t?r.Urls.times():r.Urls.track());this.httpClient.jsonp(i,e)}hit(e){e=r.Helpers.extend(e,{type:"hit"});this.track(e)}times(e){this.track(e,!0)}form(e){e=r.Helpers.extend(e,{type:"form"});this.track(e)}pageview(e){var t={type:"pageview"};e&&(t.url=e),this.track(t)}event(e,t,i){var s={type:"event",event:e};r.Helpers.isNumber(t)&&(s.value=t),i&&r.Helpers.forEach(i,function(e,t){s["p_"+t]=e}),this.track(s)}_getPageUrl(){return e.location.href}_getPageTitle(){return t.title||""}_getPageDomain(){return e.location.hostname}_getPagePath(){return e.location.pathname}_getReferrerUrl(){return t.referrer}}}(window,document,window.Mango=window.Mango||{}),function(t){"use strict";t.Analytics=t.Analytics||{};t.Analytics.Module=class{start(){this._initTracker(),this._initActivitySpy(),this._initScrollSpy(),this._initCursorSpy(),this._initWidgetSpy(),this.tracker.pageview()}_initTracker(){this.tracker=new t.Analytics.Tracker}_initScrollSpy(){var e=new t.Analytics.ScrollSpy;e.on("scroll",e=>{e=e.detail;100===Number(e)&&this.tracker.event("scroll",e)}),e.start()}_initCursorSpy(){var e=new t.Analytics.CursorSpy;e.on("cursor:up",()=>{this.tracker.hit()}),e.start()}_initActivitySpy(){var e=new t.Analytics.ActivitySpy(t.startTime);e.on("activity:on",()=>{this._startLifecycle()}),e.on("activity:off",()=>{this._clearLifecycle()}),e.start()}_initWidgetSpy(){var e=new t.Analytics.WidgetSpy;e.on("callsite:open",()=>{this.tracker.event("callsite")}),e.on("callback:open",()=>{this.tracker.event("callback")}),e.start()}_startLifecycle(){this.lifecycleId&&this._clearLifecycle(),this.lifecycleId=setInterval(t.Helpers.bind(this._onLifecycle,this),3e4)}_clearLifecycle(){clearInterval(this.lifecycleId)}_onLifecycle(){this.tracker.hit()}getTracker(){return this.tracker||this._initTracker(),this.tracker}}}((window,document,window.Mango=window.Mango||{})),function(i,s){"use strict";s.CallTracking=s.CallTracking||{},s.CallTracking.CalltouchProvider=class{constructor(){this.cId=null}check(){return Boolean(i.ct)}updateClientId(t){s.Helpers.safeExec(()=>{var e=i.ct("calltracking_params"),e=e&&e.find(e=>e.siteId===t);e&&e.sessionId&&this.updateCid(e.sessionId)},()=>{})}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,s.Utils.EventBus.publish(s.Utils.EventChannels.UPDATE_CID,{ctCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(t){"use strict";t.CallTracking=t.CallTracking||{};const e=15e3;t.CallTracking.clientIdsProvider=class{constructor(e){this.widgetId=e,this.ga=new t.CallTracking.GAProvider,this.metrika=new t.CallTracking.MetrikaProvider,this.roistat=new t.CallTracking.RoiStatProvider,this.jivo=new t.CallTracking.JivoProvider,this.fbpixel=new t.CallTracking.FbpixelProvider,this.calltouch=new t.CallTracking.CalltouchProvider,this._collectClientIds()}getAll(){return{gaCid:this.ga.cId,yaCid:this.metrika.cId,rsCid:this.roistat.cId,jsCid:this.jivo.cId,gaUid:this.ga.uId,fbBid:this.fbpixel.fbBid,fbCid:this.fbpixel.fbCid,ctSid:this.calltouch.cId}}_collectClientIds(){t.Helpers.wait(e,this.ga.check).then(e=>this.ga.ready(e,300)).then(()=>this.ga.updateClientId()),t.Helpers.wait(e,this.metrika.check).then(()=>this.metrika.updateClientId()),t.Helpers.wait(e,this.roistat.check).then(()=>this.roistat.updateClientId()),t.Helpers.wait(e,this.jivo.check).then(()=>this.jivo.updateClientId()),t.Helpers.wait(e,this.fbpixel.check).then(()=>this.fbpixel.updateClientId()),t.Helpers.wait(e,this.calltouch.check).then(()=>t.httpClient.jsonp(t.Urls.calltouch(this.widgetId))).then(e=>this.calltouch.updateClientId(e))}}}((window,document,window.Mango=window.Mango||{})),function(i,s){"use strict";s.CallTracking=s.CallTracking||{};s.CallTracking.FbpixelProvider=class{constructor(){this.fbBid=null,this.fbCid=null}check(){var e=s.Cookies.get("_fbp"),t=s.Cookies.get("_fbc");return Boolean(i.fbq)||e||t}updateClientId(){var e=s.Cookies.get("_fbp"),t=s.Cookies.get("_fbc");e&&this.updateIdByName(e,"fbBid"),t&&this.updateIdByName(t,"fbCid")}updateIdByName(e,t){if(this[t]&&this[t]===e)return this[t];this[t]=e,s.Utils.EventBus.publish(s.Utils.EventChannels.UPDATE_CID,{[t]:this[e]})}}}(window,(document,window.Mango=window.Mango||{})),function(n,a){"use strict";a.CallTracking=a.CallTracking||{};a.CallTracking.GAProvider=class{get uId(){var e=this.getTrackers()[0];return e&&e.get?e.get("userId"):null}constructor(){this.cId=null}check(){var e=n.GoogleAnalyticsObject;return n[e]||n._gaq}ready(s,r){return new Promise(i=>{if(!s)return i();var e=n.GoogleAnalyticsObject;let t=n[e];if(t){let e=setTimeout(i,r);void a.Helpers.safeExec(()=>{t(()=>{clearTimeout(e),i()})},()=>i())}else{let t=n._gaq;if(t){let e=setTimeout(i,r);void a.Helpers.safeExec(()=>{t.push(()=>{clearTimeout(e),i()})},()=>i())}else i()}})}getTracker(){var e=n.GoogleAnalyticsObject;return n[e]}getTrackers(){var e=this.getTracker();return e&&e.getAll?e.getAll():[]}updateClientId(){const e=a.Cookies.get("_ga");if(e){var t=a.Helpers.safeExec(()=>e.split("."),()=>[]);if(3{e.getVisitorNumber((e,t)=>{this.updateCid(t)})},()=>{})}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,i.Utils.EventBus.publish(i.Utils.EventChannels.UPDATE_CID,{jsCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(s,r){"use strict";r.CallTracking=r.CallTracking||{};const n="_ym_uid";r.CallTracking.MetrikaProvider=class{constructor(){this.cId=null}check(){var e=r.Cookies.get(n);return Boolean(s.Ya)||e}updateClientId(){var e=r.Cookies.get(n);if(e)this.updateCid(e);else{let e={};s.Ya&&s.Ya._metrika&&s.Ya._metrika.counters&&(e=s.Ya._metrika.counters);var t=Object.keys(e);if(t.length)for(var i in t)if(e[t[i]].getClientID())return void this.updateCid(e[t[i]].getClientID())}}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,r.Utils.EventBus.publish(r.Utils.EventChannels.UPDATE_CID,{yaCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(e){"use strict";e.CallTracking=e.CallTracking||{};const h=["8 (xxx) xxx-xxxx","8 (xxx) xxx-xx-xx","8 (xxx) xxx xxxx","8 (xxx) xxx xx xx","8 (xxxx) xx-xx-xx","8 (xxxx) xx xx xx","8 xxx xxx xxxx","8 xxx xxx xx xx","+7 (xxx) xxx-xxxx","+7 (xxx) xxx-xx-xx","+7 (xxx) xxx xxxx","+7 (xxx) xxx xx xx","+7 (xxxx) xx-xx-xx","+7 (xxxx) xx xx xx","+7 xxx xxx xxxx","+7 xxx xxx xx xx","7 (xxx) xxx-xxxx","7 (xxx) xxx-xx-xx","7 (xxx) xxx xxxx","7 (xxx) xxx xx xx","7 (xxxx) xx-xx-xx","7 (xxxx) xx xx xx","7 xxx xxx xxxx","7 xxx xxx xx xx"];e.CallTracking.NumberFormatter=class{format(e,t){if(!e)return"";h.indexOf(t)<0&&(t=h[0]);let i=e.replace(/[^0-9]/g,"");if(i.length<10)return e;var s=i.substr(0,i.length-10),r=(i=i.substr(i.length-10,10)).substr(0,3),n=i.substr(3,3),a=i.substr(6,2),o=i.substr(8,2),c=i.substr(0,4),l=i.substr(4,2),d=i.substr(6,2),u=i.substr(8,2);switch(t){case"8 (xxx) xxx-xxxx":return`8 (${r}) ${n}-`+a+o;case"8 (xxx) xxx-xx-xx":return`8 (${r}) ${n}-${a}-`+o;case"8 (xxx) xxx xxxx":return`8 (${r}) ${n} `+a+o;case"8 (xxx) xxx xx xx":return`8 (${r}) ${n} ${a} `+o;case"8 (xxxx) xx-xx-xx":return`8 (${c}) ${l}-${d}-`+u;case"8 (xxxx) xx xx xx":return`8 (${c}) ${l} ${d} `+u;case"8 xxx xxx xxxx":return`8 ${r} ${n} `+a+o;case"8 xxx xxx xx xx":return`8 ${r} ${n} ${a} `+o;case"+7 (xxx) xxx-xxxx":return`+${s} (${r}) ${n}-`+a+o;case"+7 (xxx) xxx-xx-xx":return`+${s} (${r}) ${n}-${a}-`+o;case"+7 (xxx) xxx xxxx":return`+${s} (${r}) ${n} `+a+o;case"+7 (xxx) xxx xx xx":return`+${s} (${r}) ${n} ${a} `+o;case"+7 (xxxx) xx-xx-xx":return`+${s} (${c}) ${l}-${d}-`+u;case"+7 (xxxx) xx xx xx":return`+${s} (${c}) ${l} ${d} `+u;case"+7 xxx xxx xxxx":return`+${s} ${r} ${n} `+a+o;case"+7 xxx xxx xx xx":return`+${s} ${r} ${n} ${a} `+o;case"7 (xxx) xxx-xxxx":return s+` (${r}) ${n}-`+a+o;case"7 (xxx) xxx-xx-xx":return s+` (${r}) ${n}-${a}-`+o;case"7 (xxx) xxx xxxx":return s+` (${r}) ${n} `+a+o;case"7 (xxx) xxx xx xx":return s+` (${r}) ${n} ${a} `+o;case"7 (xxxx) xx-xx-xx":return s+` (${c}) ${l}-${d}-`+u;case"7 (xxxx) xx xx xx":return s+` (${c}) ${l} ${d} `+u;case"7 xxx xxx xxxx":return s+` ${r} ${n} `+a+o;case"7 xxx xxx xx xx":return s+` ${r} ${n} ${a} `+o;default:return e}}}}((window,document,window.Mango=window.Mango||{})),function(t,i){"use strict";i.CallTracking=i.CallTracking||{};const s="roistat_visit";i.CallTracking.RoiStatProvider=class{constructor(){this.cId=null}check(){var e=i.Cookies.get(s);return Boolean(t.roistat)||e}updateClientId(){var e=i.Cookies.get(s);e?this.updateCid(e):t.roistat&&this.updateCid(t.roistat.getVisit())}updateCid(e){return this.cId&&this.cId===e||(this.cId=e,i.Utils.EventBus.publish(i.Utils.EventChannels.UPDATE_CID,{rsCid:this.cId})),this.cId}}}(window,(document,window.Mango=window.Mango||{})),function(i){"use strict";i.CallTracking=i.CallTracking||{},i.CallTracking.UtmProvider=class{constructor(e){this.params=e||{},this.session=i.session,this.sb=i.sbjs,this.sb.init(this._getSourceBusterConfig())}getCurrent(){var e,t=i.Helpers.pick(this.sb.get.current,["src","mdm","cmp","cnt","trm","mango"]);try{t.trm="undefined"!==decodeURIComponent(t.trm)?decodeURIComponent(t.trm):"(none)"}catch(e){}return this.session.getSessionId(),!1===this.session.isNewUser&&t.src===this.session.domain&&"referral"===t.mdm&&(e=this.sb.get.first,t.src="referral"!==e.mdm&&e.src!==this.session.domain?e.src:"(direct)",t.mdm="referral"!==e.mdm?e.mdm:"(none)"),t}_getSourceBusterConfig(){var e={lifetime:6,session_length:30,timezone_offset:3};return e.domain={host:this.session.domain},e}}}((window,document,window.Mango=window.Mango||{})),function(u,h){"use strict";h.CallTracking=h.CallTracking||{};h.CallTracking.Widget=class extends h.EventEmitter{constructor(e){super(),this.params=e=e||{},this.id=e.id,this.ctRequestOptions={},this.params.domain&&h.session.setDomain(this.params.domain),h.Utils.EventBus.subscribe(h.Utils.EventChannels.UPDATE_CID,h.Helpers.debounce(this._updateCid.bind(this),3e3)),this.cookies=h.Cookies,this.ids=new h.CallTracking.clientIdsProvider(this.id),this.utm=new h.CallTracking.UtmProvider,this.activitySpy=new h.Analytics.ActivitySpy,this.hashSpy=new h.Analytics.HashSpy,this.intervalId=null,this.tracking=h.Analytics.Module.prototype.getTracker(),this.numbers=[],this.activitySpy.on("activity:on",()=>{this._requestSettings({noct:!this._isAutoLoad()})}),this.hashSpy.on("change",()=>this.activitySpy.start()),this.previousPhoneTextReplace={},this.sessionLength=null,this.sessionTimestamp=null,this.settingsStorageName="mgo_request_settings"}start(){this.activitySpy.start(),this.hashSpy.start()}_isAutoLoad(){return!(!this.params.elements&&!this.params.onReady)}postForm(i){let s={};["name","number","email","subject","comment"].forEach(function(e){var t;i.hasOwnProperty(e)&&(t="form"+e.substring(0,1).toUpperCase()+e.substring(1),s[t]=i[e])}),i.fid&&(s.fid=i.fid),i.customParam&&(s.customParam=i.customParam),i.number&&(s.formNumber=this._convertPhoneToE164(i.number)),s.subType=i.subType||null,s=h.Helpers.extend(s,{wid:this.id,url:u.location.href},this.utm.getCurrent(),this.ids.getAll()),this.tracking.form(s)}getNumber(e,t){return e?"function"==typeof e?(t=e,e={}):"string"==typeof e&&(e={hash:e}):e={},"string"!=typeof e.hash&&(e.hash=""),e.regionCode&&(e.region=e.regionCode,delete e.regionCode),e.countryCode&&(e.country=e.countryCode,delete e.countryCode),this._requestSettings(e,t)}getNumberByRegion(e,t,i){return"function"==typeof t&&(i=t,t=""),this._requestSettings({hash:t,region:e},i)}getNumberWithRedirect(e,t,i){return"function"==typeof t&&(i=t,t=""),this._requestSettings({hash:t,redirectNumber:e},i)}getExistsNumbers(e){this._executeCallback(this.numbers,e)}trackTime(){var e;h.session.isNew&&(e=h.Utils.Performance.saveReport(h.Utils.PF_REPORTS.INITIAL))&&this.tracking.times(h.Helpers.extend({wid:this.id},e))}getUtm(){return this.utm.getCurrent()}_collectRequestParams(e){var t=this.ids.getAll(),e=h.Helpers.extend({uid:h.session.getUserId(),sid:h.session.getSessionId(),url:u.location.href,title:u.title||"",is_cookies:this.cookies.enabled},this._ensureOptions(e)),i=(h.session.isNewUser&&(e.nu=Number(h.session.isNewUser)),h.session.getUserIp());return i&&(e.uip=i),this.params.customParam&&(e.custom=this.params.customParam),h.Helpers.extend(e,this.utm.getCurrent(),t)}_requestSettings(){let a=0{if(h.Utils.Performance.mark(h.Utils.PF_METRICS.MARKS.GOT_NUMBER),this._onSettingsLoad(e,this._ensureOptions(a),o,["formtracking","messengertracking","ecomanalytics"]),this.sessionLength=6e5,!h.Helpers.isEmpty(e)&&!this.sessionTimestamp){this._setSessionTimestamp();var t=h.Urls.settings(this.id),i=Date.now()-Number(this.sessionTimestamp)>this.sessionLength;const r=this._getSessionSettings();var s=["ecomSettings","formtracking","messengers"].every(e=>Object.keys(r).includes(e));const n={id:e.widget.widget_id,widget:e.widget,session:e.session};i||!s?(this._setSessionTimestamp(!0),h.httpClient.jsonp(t).then(e=>{this._setSessionSettings(e),this._initExcludedModules(["formtracking","ecomanalytics"],n,e)}),this._addMessengerTrackingModule({...n,loadFromStorage:!1})):(this._initExcludedModules(["formtracking","ecomanalytics"],n,r),this._addMessengerTrackingModule({...n,loadFromStorage:!0}))}})}_initExcludedModules(e,t,i){var s,r=[{name:"formtracking",shouldActivate:(null==i||null==(s=i.formtracking)?void 0:s.length)&&(null==i||null==(s=i.formtracking)?void 0:s.some(e=>e.active)),params:{...t,initialForms:null==i?void 0:i.formtracking}},{name:"ecomanalytics",shouldActivate:Boolean(null==i?void 0:i.ecomSettings),params:{...t,settings:null==i?void 0:i.ecomSettings}}];for(const a of e){var n=r.find(e=>e.name===a);n.shouldActivate&&(h.modules.add(n.name,n.params),h.modules.start(a))}}_ensureOptions(e){var t={};return(e=e||{}).hash&&(t.hash=e.hash),(e.region||this.params.region)&&(t.region=e.region||this.params.region,t.country="RU"),e.redirectNumber&&(t.redirect_number=e.redirectNumber),e.noct&&(t.noct=e.noct),t}_onSettingsLoad(i,s,r){let t=3!t.includes(e))||[],a={id:i.widget.widget_id,widget:i.widget,session:i.session};for(let e=0;ee;h.Helpers.isFunction(this.params.formatNumber)&&(r=this.params.formatNumber),h.Helpers.forEach(this.params.elements,e=>{let t=r(s,this.settings.number_template);var i;e.selector?(i=u.querySelectorAll(e.selector),this._tagType(i,s),i.forEach(e=>{e.innerHTML=t})):e.numberText&&(i=this.previousPhoneTextReplace[e.numberText]||e.numberText,this._replacePhoneText(e.selector||u.body.firstChild,i,t),this.previousPhoneTextReplace[e.numberText]=t&&t.replace(/[ \(\)-]/g,""))})}_saveNumber(e,t,i,s){s=s||"";var r=this.numbers.find(e=>e.hash===s);r?(r.number=e,r.formattedNumber=t,r.type=i):this.numbers.push({hash:s,number:e,formattedNumber:t,type:i})}_executeCallback(e,t){if(h.Helpers.isFunction(t))try{t(e)}catch(e){h.Log.error("[mango.js] Failed to execute callback.",e)}}_getPhoneInfo(e){if(!e||!e.length)return[];for(var t,i=[],s=/(\([+0-9][\) 0-9\-]{3,19}[0-9])|([+0-9][\(\) 0-9\-]{3,19}[0-9])/g;t=s.exec(e);)i.push({phone:this._cleanPhone(t[0]),startPosition:t.index,endPosition:t[0].length+t.index});return i}_cleanPhone(e){var t=1{this._onSettingsLoad(e.data)}).catch(console.error)}_onSettingsLoad(e){e&&0!==e.length&&this._replaceEmails(e)}_replaceEmails(e){var t,i,s,e=e.map(e=>{var{email:e,subEmail:t,substitution:i}=e;return{find:e,content:t,selector:i.classNames?i.classNames.join(", "):void 0}});e.length&&(1===e.length?({find:t,content:i,selector:s}=e[0],r.Utils.Dom.findAndReplaceContent(t,i,s,!0)):r.Utils.Dom.findAndReplaceMultiple(e,!0))}}}((window,document,window.Mango=window.Mango||{})),function(s){"use strict";s.EMT=s.EMT||{},s.EMT.Module=class{constructor(t){const i=this._widgets={};s.Helpers.forEach(t,function(e){i[t.id]=new s.EMT.Widget(e)})}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}exec(e,t){e=e?this._widgets[e]:Object.values(this._widgets)[0];if(e&&"function"==typeof e[t]){for(var i=arguments.length,s=new Array(2Object.assign(e,{[t.id]:s.Helpers.pick(t,["id","selector","params"])}),{});this._onSettingsLoaded(e)}_onSettingsLoaded(e){if(this._isSettingsChanged(e)){this._formsParams=e;for(const t of Object.values(this._formsParams))this._startForm(t);this._waitingInterval=setInterval(()=>{for(const e of Object.values(this._forms))e.setButton()},1e3),this._destroyOldForms()}}_isSettingsChanged(e){return!s.Helpers.deepEqual(this._formsParams,e)}_startForm(e){var t=e["id"],i=this._forms[t];i?i.setParams(e):Object.assign(this._forms,{[t]:new s.FormTracking.Form(e,e=>s.modules.getModule("calltracking").exec(this._id,"postForm",e))})}_destroyOldForms(){Object.keys(this._forms).filter(t=>!Object.keys(this._formsParams).find(e=>e===t)).map(e=>{this._forms[e].destroy(),delete this._forms[e]})}}}((window,document,window.Mango=window.Mango||{})),function(r,n,e){"use strict";e.FormTracking=e.FormTracking||{};const i={submit:"submit",click:"click"};e.FormTracking.Form=class{constructor(e,t){this.setParams(e,t),this.listener=()=>this._submit(),this.setButton(),this.styles={boldStyle:"font-weight: bold;",positiveStyle:"font-weight: bold; color: green;",negativeStyle:"font-weight: bold; color: red;",default:"font-weight: normal; color: inherit;"}}setButton(){var e=n.querySelector(this.form.selector);e?e&&this.submitBtn===e||(this.submitBtn=e,this.eventType=this._formEventType(),this.domElem=this._elemByEventType(this.eventType),this.domElem.addEventListener(this.eventType,this.listener)):this.destroy()}setParams(e,t){try{this.form=e,this.onEvent=t,this.submitted=0,this.error=null}catch(e){this._processError(e)}}invalid(){return!!this.error}report(){return`Form: ${this.form.id}, eventType: ${this.eventType}, submitted: ${this.submitted}, error: `+this.error}destroy(){this.domElem&&(this.domElem.removeEventListener(this.eventType,this.listener),this.domElem=null),this.submitBtn=null}getFormInfo(){r.console.info("%cИнформация по форме: %c"+this.form.selector,this.styles.boldStyle,this.styles.positiveStyle),this.form.params.forEach(e=>{this._checkSelector(e)})}_checkSelector(e){r.console.info("%cИнформация по селектору: %c"+e.field,this.styles.boldStyle,this.styles.positiveStyle);var t=n.querySelector(e.selector),i=!!t,t=null==t?void 0:t.form;let s=!1;i||(this._checkDynamicSelector(e)?(s=!0,r.console.info(`Селектор %c${e.field} %cне найден. %cВероятно, данный селектор является динамическим.`,this.styles.boldStyle,this.styles.negativeStyle,this.styles.boldStyle)):(s=!1,r.console.info(`Селектор %c${e.field} %cне найден.`,this.styles.boldStyle,this.styles.negativeStyle))),this.error||!t||s||!i?t||r.console.info(`Селектор %c${e.field} %cне находится %cв форме.`,this.styles.boldStyle,this.styles.negativeStyle,this.styles.default):i&&!s&&r.console.info(`Ошибок при работе с селектором %c${e.field} %cне найдено. %cЕсли селектор не отрабатывает, вероятно, проблема с обработчиком событий.`,this.styles.boldStyle,this.styles.positiveStyle,this.styles.default)}_checkDynamicSelector(e){const t=new RegExp(e.selector);return Array.from(n.querySelectorAll("*")).filter(e=>t.test(e.id)||t.test(e.className)).length}_isDOMForm(){return this.submitBtn.hasAttribute("type")&&"submit"===this.submitBtn.getAttribute("type")&&Boolean(this.submitBtn.form)}_formEventType(){if(this._isDOMForm()&&this.submitBtn.form)return i.submit;return i.click}_processError(e){this.error=e,this.destroy()}_elemByEventType(e){let t;switch(e){case i.submit:t=this.submitBtn.form;break;case i.click:t=this.submitBtn;break;default:return void this._processError("undefined event type")}return t}_formValues(){return this.form.params.reduce((e,t)=>{var{field:t,selector:i}=t,i=n.querySelector(i);return i&&i.value?Object.assign(e,{[t]:i.value}):e},{})}_submit(){var e=this._formValues();Object.keys(e).length?(this.onEvent&&this.onEvent({...e,fid:this.form.id}),this.submitted++):this.error="no fields found, form could not be processed"}}}(window,document,window.Mango=window.Mango||{}),function(t,s){"use strict";s.FormTracking=s.FormTracking||{},s.FormTracking.Module=class{constructor(e){const i=this._widgets={};s.Helpers.forEach(e,function(e){var t=e["id"];Object.assign(i,{[t]:new s.FormTracking.Widget(e)})}),t.FT=this}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}}}(window,(document,window.Mango=window.Mango||{})),function(m,g,p){"use strict";p.MessengerTracking=p.MessengerTracking||{};p.MessengerTracking.Widget=class{constructor(e){this._id=e.id,this._forms=null,this.rootNode=g.createElement("div"),this.rootNode.id="mango-messengers-"+p.Helpers.makeId(6),g.body.append(this.rootNode),this.activeTarget=null,this.activeItem=null,this.timeoutResizeId=null,this.timeoutScrollId=null,this.resizeListener=null,this.scrollListener=null,this.settingsStorageName="mgo_request_settings",this.loadFromStorage=e.loadFromStorage,this._appendStaticStyles()}start(){this._requestSettings()}_requestSettings(){var e=p.Urls.messengers(this._id),t=sessionStorage.getItem(this.settingsStorageName),t=Boolean(t)&&JSON.parse(t);this.loadFromStorage&&Boolean(null==t?void 0:t.messengers)?this._onSettingsLoaded(t.messengers):p.httpClient.jsonp(e).then(e=>{var t=sessionStorage.getItem(this.settingsStorageName),t=Boolean(t)&&JSON.parse(t);sessionStorage.setItem(this.settingsStorageName,JSON.stringify({...t,messengers:e})),this._onSettingsLoaded(e)})}_onSettingsLoaded(e){this._isSettingsChanged(e)&&(this._clearListeners(),this._forms=e,this._bindListeners(e))}_isSettingsChanged(e){var t=null===this._forms?[]:this._forms;return!p.Helpers.deepEqual(t.map(e=>{var{account:e,formName:t,message:i,selector:s,type:r}=e;return{account:e,formName:t,message:i,selector:s,type:r}}),e)}_startForm(e){var t=e["id"],t=this._forms[t];t&&t.setParams(e)}_getElementPosition(){let e=this.activeTarget;for(;e&&"body"!==e.nodeName.toLowerCase();){var t=m.getComputedStyle(e).getPropertyValue("position");if(t.match(/fixed|sticky/i))return t;e=e.parentNode}return"absolute"}_clearMessengersWindow(){this.rootNode.innerHTML="",this.activeTarget=null,this.activeItem=null}_getCoordinates(e){e=e.getBoundingClientRect();return{top:e.top+m.scrollY,right:e.right+m.scrollX,bottom:e.bottom+m.scrollY,left:e.left+m.scrollX}}_getMessengerWindowParams(){var e=this.activeTarget,t=this._getCoordinates(e),i=this._getElementPosition(),s=("fixed"===i||"sticky"===i?e.getBoundingClientRect():t).left,t=("fixed"===i||"sticky"===i?e.getBoundingClientRect():t).top,r=e.getBoundingClientRect().width,n=e.getBoundingClientRect().height,a=m.innerWidth<=740,o=m.innerWidth<=440,c=e.getBoundingClientRect().right-r/2>m.innerWidth/2;return{x:a?c&&!o?m.innerWidth-366-8:8:s>m.innerWidth-366?s-366+r:s,y:m.innerHeight-e.getBoundingClientRect().bottom<148?t-140-8:t+n+8,isMobile:a,isSmallMobile:o,formWidth:366,formHeight:140,position:i}}_updateMessengerWindowCoordinates(){var e,t,i,s,r,n;(this.activeTarget||this.activeItem)&&(e=this.rootNode.querySelector("form"))&&({x:t,y:i,isMobile:s,isSmallMobile:r,formWidth:n}=this._getMessengerWindowParams(),e.style.top=i+"px",e.style.left=t+"px",e.style.width=s?"calc(100vw - 16px)":n+"px",e.style.maxWidth=s&&r?"424px":"366px")}_appendMessengerWindow(){var e,t,i,s,r,n,a,o;(this.activeTarget||this.activeItem)&&(o=this.activeItem,{x:e,y:t,isMobile:i,isSmallMobile:s,position:r,formWidth:n,formHeight:a}=this._getMessengerWindowParams(),this.rootNode.innerHTML="",o=this._createMessengerWindow(o.type,o.account,o.message,o.formName,{x:e,y:t,position:r,formWidth:n,formHeight:a,isMobile:i,isSmallMobile:s}),this.rootNode.append(o))}_createMessengerWindow(t,e,i,s,r){const n={whatsapp:{name:"WhatsApp",color:"#25D366",link:`https://wa.me/${e}?text=`+encodeURIComponent(i)},telegram:{name:"Telegram",color:"#229ED9",link:"https://t.me/"+e}};var i=g.createElement("form"),e="sticky"===r.position?"fixed":r.position,a=r.isMobile?"calc(100vw - 16px)":r.formWidth+"px",o=r.isMobile&&r.isSmallMobile?"424px":"366px";const c=g.createElement("input");var l=g.createElement("span"),d=g.createElement("button"),u=g.createElement("p");i.style.cssText=`position: ${e}; width: ${a}; height: ${r.formHeight}px; border-color: ${n[t].color}; top:${r.y}px; left: ${r.x}px; max-width: ${o};`,l.innerHTML=` `,l.addEventListener("click",()=>this._clearMessengersWindow()),c.setAttribute("type","tel"),c.setAttribute("placeholder","+7xxxxxxxxxx"),c.setAttribute("pattern","[0-9+]{12,16}"),c.setAttribute("minlength",12),c.setAttribute("maxlength",16),c.setAttribute("required",!0),c.addEventListener("input",e=>{e=e.target;1===e.value.length&&"+"!==e.value&&e.value.match(/\d/)&&(e.value="+"+e.value),e.value=e.value.replace(/[^\d+]/g,""),c.validity.patternMismatch?c.setCustomValidity("Пожалуйста, введите номер телефона в международном формате: +7xxxxxxxxxx"):c.validity.valueMissing?c.setCustomValidity("Пожалуйста, заполните это поле"):c.setCustomValidity("")}),d.setAttribute("type","submit"),d.style.cssText+=`background: ${n[t].color};`,d.innerText="Связаться",u.innerText="Введите свой номер телефона, чтобы начать общение в "+n[t].name;const h=()=>{p.modules.getModule("calltracking").exec(this._id,"postForm",{number:c.value,subType:t,fid:s}),this._clearMessengersWindow(),g.removeEventListener("visibilitychange",h)};return i.addEventListener("submit",e=>{e.preventDefault(),g.addEventListener("visibilitychange",h),m.open(n[t].link),setTimeout(()=>{g.removeEventListener("visibilitychange",h)},6e3)}),i.append(c),i.append(d),i.append(u),i.append(l),i}_appendStaticStyles(){var e=g.createElement("style");e.textContent=` #${this.rootNode.id} *:not(path) { all: unset; box-sizing: border-box; } #${this.rootNode.id} form { box-sizing: border-box; z-index: 999999; font-family: Roboto, Helvetica, Arial, sans-serif; font-style: normal; font-weight: 400; line-height: 16px; gap: 10px; display: flex; flex-wrap: wrap; border-radius: 4px; background-color: #ffffff; box-shadow: 0px 3px 14px 0px rgba(55, 71, 79, 0.30); padding: 32px 24px 24px 24px; min-width: 272px; color: #37474F; border: 1px solid; font-size: 14px; } #${this.rootNode.id} span { display: block; position: absolute; top: 8px; right: 8px; cursor: pointer; } #${this.rootNode.id} input { flex: 1; padding: 12px 16px; border-radius: 4px; border: 1px solid #CFD8DC; background: #FFF; height: 40px; width: 100%; } #${this.rootNode.id} button { display: inline-flex; height: 40px; padding: 8px 16px; border-radius: 4px; border:none; margin: 0; color: white; align-items:center; justify-content: center; cursor: pointer; font-size: 14px; } #${this.rootNode.id} p { margin: 0; width: 100%; font-size: 14px; font-weight: normal; line-height: normal; } `,g.head.append(e)}_bindListeners(){this.resizeListener=()=>{clearTimeout(this.timeoutResizeId),this.timeoutResizeId=setTimeout(this._updateMessengerWindowCoordinates.bind(this),100)},this.scrollListener=()=>{"sticky"===this._getElementPosition()&&(clearTimeout(this.timeoutScrollId),this.timeoutScrollId=setTimeout(this._updateMessengerWindowCoordinates.bind(this),100))},m.addEventListener("resize",this.resizeListener),m.addEventListener("scroll",this.scrollListener);for(let t of this._forms)t.clickListener=e=>{e.preventDefault(),this.activeTarget=e.target,this.activeItem=t,this._appendMessengerWindow()},g.querySelectorAll(t.selector[0]).forEach(e=>{e.addEventListener("click",t.clickListener)})}_clearListeners(){if(this.resizeListener&&this.scrollListener&&(m.removeEventListener("resize",this.resizeListener),m.removeEventListener("scroll",this.scrollListener)),this._forms)for(let t of this._forms)g.querySelectorAll(t.selector[0]).forEach(e=>{e.removeEventListener("click",t.clickListener)})}}}(window,document,window.Mango=window.Mango||{}),function(t,s){"use strict";s.MessengerTracking=s.MessengerTracking||{},s.MessengerTracking.Module=class{constructor(e){const i=this._widgets={};s.Helpers.forEach(e,function(e){var t=e["id"];Object.assign(i,{[t]:new s.MessengerTracking.Widget(e)})}),t.FT=this}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}}}(window,(document,window.Mango=window.Mango||{})),function(a,o,i){"use strict";const r={PRODUCT_ID:"productId",PRODUCT_NAME:"productName",CATEGORY_ID:"categoryId",CATEGORY_NAME:"categoryName",BRAND:"brand",PRICE:"price",AMOUNT:"amount"},n={TRANSACTION_ID:"transactionId",ITEMS:"items"};i.EcomAnalytics=i.EcomAnalytics||{},i.EcomAnalytics.Widget=class{constructor(e){this.clientId=e.id,this.settings=e.settings,this.clientEvents=[],this.allEvents=[],this.allowedProductVariables=[],this.allowedTransactionVariables=[],a.dataLayer||(a.dataLayer=[]),this.dataLayer=a.dataLayer,this.previousDataLayer=this.getPreviousDataLayer()}getCookie(e){e=o.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));if(e)return e[2]}getPreviousDataLayer(){var e=localStorage.getItem("savedDataLayer");return e?JSON.parse(e):[]}saveCurrentDataLayer(e){localStorage.setItem("savedDataLayer",JSON.stringify(e))}async start(){try{this.modifyDataLayerPushMethod(),await this.fetchSettings(this.clientId,this.settings),this.monitorAndCompareDataLayers()}catch(e){}}monitorAndCompareDataLayers(){a.addEventListener("dataLayer.push",e=>{var e=e.detail.currentDataLayer,t=e.filter(t=>!this.previousDataLayer.some(e=>JSON.stringify(t)===JSON.stringify(e)));t.length&&(this.processData(t),this.previousDataLayer=[...this.previousDataLayer,...t],this.saveCurrentDataLayer(e))})}processData(e){e.forEach(i=>{var e,t;i instanceof Object&&("callee"in i?Array.from(i).forEach(e=>{var t;"string"==typeof e&&this.clientEvents.includes(e)&&(e===(null==(t=this.allEvents.find(e=>"transaction"===e.service_event))?void 0:t.client_event)?this.sendTransactionToServer(this.extractTransactionData(i)):this.sendDataToServer(this.extractProductData(i),e))}):"string"==typeof(e=i.event||i.callee)&&this.clientEvents.includes(e)&&(e===(null==(t=this.allEvents.find(e=>"transaction"===e.service_event))?void 0:t.client_event)?this.sendTransactionToServer(this.extractTransactionData(i)):this.sendDataToServer(this.extractProductData(i),e)))})}extractProductData(e){var t={};return this.recursiveExtract(e,t,this.allowedProductVariables),t}extractTransactionData(e){var t={};return this.recursiveExtract(e,t,this.allowedTransactionVariables),t}recursiveExtract(t,i,s){Array.isArray(t)?t.forEach(e=>this.recursiveExtract(e,i,s)):t instanceof Object&&Object.keys(t).forEach(e=>{this.checkKeyIncluding(s,e)?i[e]=t[e]:t[e]instanceof Object&&this.recursiveExtract(t[e],i,s)})}checkKeyIncluding(e,t){return e.some(e=>t.includes(e))}sendDataToServer(e,t){t={event:this.getEventName(t),timestamp:(new Date).toISOString(),data:JSON.stringify(this.getVariablesData(e)),mgoSid:this.getCookie("mgo_sid")};this.jsonpRequest(i.Urls.addEvent(this.clientId),t).then(e=>{}).catch(e=>{})}sendTransactionToServer(e){e={data:JSON.stringify(this.getVariablesData(e)),mgoSid:this.getCookie("mgo_sid")};this.jsonpRequest(i.Urls.addTransaction(this.clientId),e).then(e=>{}).catch(e=>{})}getEventName(t){return this.allEvents.filter(e=>e.client_event===t)[0].service_event}getVariablesData(i){let s={},r={};return Object.keys(i).forEach(t=>{var e=this.allVariables.find(e=>e.client_variable===t);e?i[t]&&"object"==typeof i[t]?Array.isArray(i[t])?s[e.service_variable]=i[t].map(e=>this.getVariablesData(e)):s[e.service_variable]=this.getVariablesData(i[t]):s[e.service_variable]=i[t]:r[t]=i[t]}),0{i.push({service_event:e[0],client_event:e[1]})}),Object.entries(t.fieldTypes).forEach(e=>{s.push({service_variable:e[0],client_variable:e[1]})}),this.allEvents=i,this.allVariables=s,this.clientEvents=this.allEvents.map(e=>e.client_event),this.allowedProductVariables=this.allVariables.filter(e=>Object.values(r).includes(e.service_variable)).map(e=>e.client_variable),this.allowedTransactionVariables=this.allVariables.filter(e=>Object.values(n).includes(e.service_variable)).map(e=>e.client_variable)}catch(e){}}jsonpRequest(r,n){return new Promise((t,e)=>{const i="jsonpCallback_"+Math.random().toString(36).substr(2),s=(a[i]=e=>{o.body.removeChild(s),delete a[i],t(e)},n.callback=i,o.createElement("script"));s.src=r+"?"+new URLSearchParams(n),s.onerror=()=>{o.body.removeChild(s),delete a[i],e(new Error("JSONP request failed"))},o.body.appendChild(s)})}modifyDataLayerPushMethod(){const t=a.dataLayer.push.bind(this.dataLayer);this.dataLayer.push=function(e){t(e),a.dispatchEvent(new CustomEvent("dataLayer.push",{detail:{changes:e,currentDataLayer:this}}))}}}}(window,document,window.Mango=window.Mango||{}),function(s){"use strict";s.EcomAnalytics=s.EcomAnalytics||{},s.EcomAnalytics.Module=class{constructor(e){const i=this._widgets={};s.Helpers.forEach(e,function(e){var t=e["id"];Object.assign(i,{[t]:new s.EcomAnalytics.Widget(e)})})}start(){s.Helpers.forEach(this._widgets,function(e){e.start()})}}}((window,document,window.Mango=window.Mango||{})),function(s,r){"use strict";var n="debug info warn error".split(" ");r.Log={enabled:!0,level:"info"},n.forEach(function(i){r.Log[i]=function(){var e,t;e=i,t=arguments,r.Log.enabled&&s.console&&n.indexOf(e)>=n.indexOf(r.Log.level)&&s.console[e].apply(s.console,t)}})}(window,(document,window.Mango=window.Mango||{})),function(n){"use strict";n.Urls={track:function(){return this.url(n.ClientConfig.calltrackingHost,"track")},times(){return this.url(n.ClientConfig.calltrackingHost,"track","times")},module:function(e){return this.url("widgets",e+".js")},umaModule(e){return this.url(n.ClientConfig.umaHost,"js",e+".js")},mcwModule(e){return this.url(n.ClientConfig.multichannelStaticHost,"widgets",e+".js")},calltracking(e){return this.url(n.ClientConfig.calltrackingHost,"calltracking",e)},settings(e){return this.url(n.ClientConfig.calltrackingHost,e,"settings")},addEvent(e){return this.url(n.ClientConfig.calltrackingHost,e,"ecom","addEvent")},addTransaction(e){return this.url(n.ClientConfig.calltrackingHost,e,"ecom","addTransaction")},calltouch(e){return this.url(n.ClientConfig.calltrackingHost,"widgetparam",e,"ctsite")},emt(e){return this.url(n.ClientConfig.emtHost,"api","emailtracking",e)},formtracking(e){return this.url(n.ClientConfig.calltrackingHost,"formtracking",e)},messengers(e){return this.url(n.ClientConfig.calltrackingHost,"messengers",e)},url:function(){for(var e=0{const i=()=>{var e=r();e?t(e):(s-=100)<0?t(null):setTimeout(i,100)};setTimeout(i,100)})},debounce:function(s,r,n){let a;return function(){const e=this,t=arguments;var i=n&&!a;clearTimeout(a),a=setTimeout(()=>{a=null,n||s.apply(e,t)},r),i&&s.apply(e,t)}},safeExec:function(e){var t=1{};try{return e()}catch(e){return t()}},isEmpty:function(e){return[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length},isObject:function(e){return e instanceof Object},isFunction:function(e){return"function"==typeof e},forEach:function(e,n){return Array.isArray(e)?e.forEach(n):e instanceof Object?Object.entries(e).forEach(function(e){for(var[e,t]=e,i=arguments.length,s=new Array(1(i&&i.hasOwnProperty(t)&&(e[t]=i[t]),e),{})},deepEqual:function(e,t){if(e!==t){if(null===e||null===t||"object"!=typeof e||"object"!=typeof t)return!1;var i,s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(i of s)if(!r.includes(i)||!this.deepEqual(e[i],t[i]))return!1}return!0}}}(window,document),function(n,o){"use strict";var c={calltracking:{namespace:"CallTracking",filename:"mango.calltracking"},multichannel:{namespace:"MultiChannel",from:"mcwModule",filename:"mango.multichannel",dependsOn:[]},uma:{namespace:"UMA",from:"umaModule",filename:"mango-uma",dependsOn:["calltracking","popup"],passParams:["id"]},popup:{namespace:"Popup",from:"umaModule",filename:"mango-popup",dependsOn:[]},emt:{namespace:"EMT",dependsOn:["calltracking"],passParams:["id"]},formtracking:{namespace:"FormTracking",dependsOn:["calltracking"],passParams:["id"]},messengertracking:{namespace:"MessengerTracking",dependsOn:["calltracking"],passParams:["id"]},ecomanalytics:{namespace:"EcomAnalytics",dependsOn:["calltracking"],passParams:["id"]}},l={};o.Modules=class extends o.EventEmitter{constructor(){super(),this._loading=!1,this._modules={}}add(e,t){var i=c[e];return i?(this._modules[e]?this._modules[e].params.push(t):this._modules[e]=o.Helpers.extend({},i,{name:e,params:[t],instance:null}),i):null}start(e){e?this._modules[e]&&this._loadModule(this._modules[e]):o.Helpers.isEmpty(this._modules)||o.Helpers.forEach(this._modules,this._loadModule.bind(this))}getModule(e){return this._modules[e]?this._modules[e].instance:null}getFormsInfo(e){const t=this.getModule("formtracking")._widgets[e]._forms;Object.keys(t).forEach(e=>{t[e].getFormInfo()})}_loadModule(a){if(2===l[a.name])return this._initializeModule(a);if(3<=l[a.name])return this._startModule(a);var e=!0;if(((c[a.name]||{}).dependsOn||[]).forEach(t=>{if(e=e&&4===l[t],!l[t]){var i=a.params||[];for(let e=0;e{t.removeEventListener("load",r),l[a.name]=2,this._initializeModule(a)};t.addEventListener("load",r)}}}_initializeModule(e){var t;2===l[e.name]&&(t=o[e.namespace]?o[e.namespace].Module:null)&&(this._modules[e.name].instance=new t(e.params),l[e.name]=3,this._startModule(e))}_startModule(e){this._modules[e.name].instance.start(),l[e.name]=4,this._tryToStartDependingModules(e.name);var t=Object.keys(l);for(let e=0;ee===t)&&this._loadModule(r)}}}}((window,document),window.Mango=window.Mango||{}),function(r){"use strict";const t="productId",n=["calltracking","multichannel","uma","emt"];r.Starter=class extends r.EventEmitter{constructor(){super(),this.init()}init(){r.session=new r.Common.Session,r.httpClient=new r.Common.HttpClient,r.http=r.httpClient,r.modules=new r.Modules,r.modules.once("started",()=>{this._onModulesReady()})}load(t){for(let e=0;e{var t;c.Helpers.isEmpty(r)||(clearInterval(n),t=c.starter,c.Helpers.forEach(r,function(e){c.Helpers.forEach(e,function(e){c.Helpers.isObject(e)&&t.load(e)})}),c.starter.start())},50));c.starter.once("started",()=>{c.api.isReady=!0,l(r,e)})},"loading"!==o.readyState?e():o.addEventListener("DOMContentLoaded",e)}(window,document,window.Mango=window.Mango||{});