SkinPhoniqa Moscow, Russia Poleansky
"use strict";angular.module(initialState.APP_NAME,["ngRoute","pascalprecht.translate"]).constant("INITIAL_STATE",initialState).config(function($translateProvider,$routeProvider,$locationProvider){$routeProvider.when("/mobile",{controller:"MobileController",templateUrl:"views/mobile/mobile.html"}).when("/index",{templateUrl:Wix.Utils.getDeviceType()=="mobile"?"views/mobile/mobile.html":"views/home/home.html",controller:Wix.Utils.getDeviceType()=="mobile"?"MobileController":"HomeController",controllerAs:"main"}).otherwise({redirectTo:"/index"});function getLocale(defaultLocale){var locale=Wix.Utils.getLocale()||defaultLocale;locale=locale.toLowerCase().replace(/[^a-zA-Z]+/g,"");return locale.length==2?locale:defaultLocale}var locale=getLocale(initialState.DEFAULT_LANGUAGE);$translateProvider.translations("cs",{"app.description":"Přidejte si aplikaci Hit Counter na své stránky a pochlubte se počtem návštěv. Vyberte si styl jaký se vám líbí a přizpůsobte si nastavení a vzhled tak, aby vyhovoval vašim potřebám.","widget.aria.label":"Jste návštěvníkem číslo %s na tomto webu","app.title":"Hit Counter"});$translateProvider.translations("da",{"app.description":"Tilføj en visningstæller på din hjemmeside, og vis hvor mange besøgende du har. Vælg den stil, du kan lide, og tilpas indstillingerne og designet, så det passer til dit behov.","widget.aria.label":"Du er besøgende nummer %s på denne hjemmeside","app.title":"Visningstæller"});$translateProvider.translations("de",{"app.description":"Fügen Sie Ihrer Website einen Besucherzähler hinzu. Wählen Sie Ihren Lieblingsstil und passen Sie das Design und die Einstellungen ganz nach Ihren Wünschen an.","widget.aria.label":"Sie sind Besucher Nr. %s auf dieser Website","app.title":"Hit Counter"});$translateProvider.translations("en",{"app.title":"Hit Counter","app.description":"Add Hit Counter to your site and show off your number of visitors. Choose the style you like and customize the settings and design to fit your needs.","widget.aria.label":"You are visitor number %s of this website"});$translateProvider.translations("es",{"app.description":"Agrega Hit Counter a tu página web, y muestra tu número de visitantes. Elige el estilo que más te guste, y personaliza la configuración y diseño acorde a tus necesidades.","widget.aria.label":"Eres el visitante número %s de esta página web","app.title":"Hit Counter"});$translateProvider.translations("fi",{"app.description":"Add hit counter to your site and show off your number of visitors. Choose the style you like and customize the settings and design to fit your needs.","widget.aria.label":"You are visitor number %s of this website","app.title":"Hit Counter"});$translateProvider.translations("fr",{"app.description":"Ajoutez Hit Counter à votre site et exposez votre nombre de visiteurs. Choisissez le style que vous aimez et personnalisez les paramètres et le design.","widget.aria.label":"Vous êtes le %s visiteurs du site","app.title":"Hit Counter"});$translateProvider.translations("hi",{"app.description":"अपनी साइट पर हिट काउंटर शामिल करें और अपने विजिटर्स की संख्या दिखाएँ। अपनी पसंद की शैली चुनें और अपनी आवश्यकताओ के उपयुक्त सेटिंग तथा डिज़ाइन को अनुकूलित करें।","widget.aria.label":"आप इस साइट के %s विज़िटर हैं","app.title":"हिट काउंटर"});$translateProvider.translations("it",{"app.description":"Aggiungi Hit Counter al tuo sito e mostra quanti utenti hanno visitato il tuo sito. Personalizzane le impostazioni e il design così che si adatti allo stile del tuo sito.","widget.aria.label":"Sei il visitatore numero %s di questo sito","app.title":"Hit Counter"});$translateProvider.translations("ja",{"app.description":"サイトの訪問数またはユニークユーザー数を表示するカウンターです。スタイルを選択するか、カウンターの設定、デザインをお好みの仕様に変更しましょう。","widget.aria.label":"あなたはこのホームページへの%s人目の訪問者です。","app.title":"アクセスカウンター"});$translateProvider.translations("ko",{"app.description":"Hit Counter를 추가해 사이트 방문자 수를 확인하세요. 내 필요에 따라 스타일을 선택하고 설정 및 디자인을 사용자 지정할 수 있습니다.","widget.aria.label":"해당 사이트의 %s번째 방문자가 되셨습니다.","app.title":"Hit Counter"});$translateProvider.translations("nl",{"app.description":"Voeg Hit Counter toe aan uw site en laat het aantal bezoekers zien. Kies de stijl die u leuk vindt, pas het ontwerp aan en stel alles naar wens in.","widget.aria.label":"U bent de %se bezoeker van deze website","app.title":"Hit Counter"});$translateProvider.translations("no",{"app.description":"Legg til Wix Hit Counter på nettstedet og vis antall besøkende. Velg stilen du liker og tilpass innstillinger og design for å passe dine behov.","widget.aria.label":"Du er besøkende nr %s på dette nettstedet","app.title":"Hit Counter"});$translateProvider.translations("pl",{"app.description":"Dodaj Hit Counter do swojej witryny i pochwal się ilością odwiedzających. Wybierz styl, który Ci się podoba i dostosuj ustawienia oraz projekt.","widget.aria.label":"Jesteś gościem numer %s na tej witrynie","app.title":"Hit Counter"});$translateProvider.translations("pt",{"app.description":"Adicione o Hit Counter ao seu site e mostre o número de visitantes. Escolha o estilo que você gosta e personalize as configurações e o design que atenda às suas necessidades.","widget.aria.label":"Você é o visitante número %s deste site","app.title":"Hit Counter"});$translateProvider.translations("ru",{"app.description":"Добавьте на сайт счетчик и демонстрируйте количество посетителей. Выберите подходящий стиль и настройте дизайн и параметры счетчика.","widget.aria.label":"Вы %s-й посетитель сайта","app.title":"Счетчик посещений"});$translateProvider.translations("sv",{"app.description":"Lägg till Hit Counter till hemsidan och visa upp antalet besökare. Välj den stil du gillar och anpassa inställningarna och designen för att passa dina behov.","widget.aria.label":"Du är besökare nummer %s på denna hemsida","app.title":"Hit Counter"});$translateProvider.translations("th",{"app.description":"เพิ่ม Hit Counter ลงในเว็บไซต์ของคุณเพื่ออวดจำนวนผู้เข้าชม เลือกสไตล์ที่คุณชอบและปรับแต่งการตั้งค่าและดีไซน์ให้เหมาะกับความต้องการ","widget.aria.label":"คุณเป็นผู้เข้าชมรายที่ %s ของเว็บไซต์","app.title":"Hit Counter"});$translateProvider.translations("tr",{"app.description":"Sitenize Hit Counter'ı ekleyin ve ziyaretçi sayınızı herkesle paylaşın. Beğendiğiniz bir tarzı seçin ve ayarlarını & tasarımını istediğiniz gibi özelleştirin.","widget.aria.label":"Bu sitenin %s numaralı ziyaretçisisiniz","app.title":"Hit Counter"});$translateProvider.translations("zh",{"app.description":"新增計數器至你的網站,炫一下訪客數。選擇你喜歡的風格並自訂設定和設計以符合需求。","widget.aria.label":"你是本網站的第number %s位訪客","app.title":"計數器"});$translateProvider.preferredLanguage(locale).fallbackLanguage(initialState.DEFAULT_LANGUAGE).useSanitizeValueStrategy("escaped")}).config(function($routeProvider,$locationProvider){var version="1.2.2";var cacheKiller="?_="+version;$routeProvider.when("/type0",{templateUrl:"views/counter/type0.html"+cacheKiller}).when("/type1",{templateUrl:"views/counter/type1.html"+cacheKiller}).when("/type2",{templateUrl:"views/counter/type2.html"+cacheKiller}).when("/type3",{templateUrl:"views/counter/type3.html"+cacheKiller}).when("/type4",{templateUrl:"views/counter/type4.html"+cacheKiller}).when("/type5",{templateUrl:"views/counter/type5.html"+cacheKiller}).otherwise({redirectTo:"/type0"})});"use strict";angular.module(initialState.APP_NAME).service("biService",function(){var srcNum=63,siteId="",self=this;var events=[["selectCounter",13,["selector_group_name","selector_type"]],["selectAnimation",13,["selector_group_name","selector_type"]],["savePublish",214,["wixlabs_int_1","wixlabs_int_2","wixlabs_bool_1","wixlabs_bool_2","event_trigger"]]];var superProperties={Uid:Wix.Utils.getUid(),InstanceId:Wix.Utils.getInstanceId(),CompId:Wix.Utils.getCompId(),OrigCompId:Wix.Utils.getOrigCompId()};(function(){var parser=document.createElement("a");parser.href=document.referrer||"";var arr=parser.pathname.split("/");siteId=arr[arr.length-1];if(siteId==="new"){var objURL={};parser.href.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function($0,$1,$2,$3){objURL[$1]=$3});siteId=objURL.siteId||siteId}})();var frogSuperProperties={biToken:Wix.Utils.getInstanceValue("biToken")||"00000000-0000-0000-0000-000000000000",market:"editor",origin:initialState.ORIGIN||"app_settings",app_id:initialState.APP_ID,app_site_id:superProperties.InstanceId,instance_id:superProperties.OrigCompId||superProperties.CompId,tab_name:"",site_id:siteId};var onSuccessDef=function onSuccessDef(){};var onErrorDef=function onErrorDef(){};var report=function report(params,bUserEvent,onSuccess,onError){var url=bUserEvent?"//frog.wix.com/wixlabs-ugc?":"//frog.wix.com/wixlabs-users?",cacheKiller="_="+(new Date).getTime(),bi=new Image;if(params.evid===214||bUserEvent){delete params.origin;delete params.market}if(bUserEvent){delete params.app_site_id;delete params.tab_name;delete params.site_id}bi.onload=onSuccess||onSuccessDef;bi.onerror=onError||onErrorDef;var BIURL=url+cacheKiller+"&src="+srcNum+"&"+Object.keys(params).map(function(key){return[encodeURIComponent(key),"=",encodeURIComponent(params[key])].join("")}).join("&");bi.src=BIURL};var eventClosure=function eventClosure(eventParams,paramsOrder,sUserEvent){return function(){var bUserEvent=!!sUserEvent&&sUserEvent=="user";var onSuccess=arguments[1]||angular.noop;var onError=arguments[2]||angular.noop;var params=arguments[0]||[];angular.forEach(paramsOrder,function(paramName,order){eventParams[paramName]=params[order]});report(eventParams,bUserEvent,onSuccess,onError)}};angular.forEach(events,function(val,key){var event=val,eventParams=angular.extend({evid:event[1]},frogSuperProperties);angular.forEach(event[2],function(paramName,order){eventParams[paramName]=""});self[event[0]]=eventClosure(eventParams,event[2],event[3])});this.mixpanel=function(eventName,params){params=params||{};mixpanel.track(eventName,angular.extend(params,superProperties))}});"use strict";angular.module(initialState.APP_NAME).service("styleService",["INITIAL_STATE","$timeout","$log","wixService",function(INITIAL_STATE,$timeout,$log,wixService){var design=INITIAL_STATE.design,settings,styleParams,css;function initParams(aSettings,aStyleParams){try{settings=aSettings,styleParams=angular.extend({colors:[],fonts:[]},aStyleParams);css=""}catch(e){$log.info(e)}}function getValue(obj){if(angular.isObject(obj)&&obj.hasOwnProperty("value"))return obj.value;return obj}function jointCSS(){var css=[];var corner=settings.corner+"px";var borderWidth=settings.border+"px";var separatorColor=angular.isObject(styleParams.colors[design.separator.color.name])?getValue(styleParams.colors[design.separator.color.name]):design.separator.color.value.indexOf("#")>-1?design.separator.color.value:getValue(wixService.Styles.getColorByreference(design.separator.color.value));var bgColorColor4=angular.isObject(styleParams.colors[design.bgColor.color.name])?getValue(styleParams.colors[design.bgColor.color.name]):getValue(wixService.Styles.getColorByreference("color-4"));var bgColorColor5=angular.isObject(styleParams.colors[design.bgColor.color.name])?getValue(styleParams.colors[design.bgColor.color.name]):getValue(wixService.Styles.getColorByreference("color-5"));separatorColor=tinycolor(separatorColor);separatorColor=separatorColor.clone().toRgb();var rgb=separatorColor.r+","+separatorColor.g+","+separatorColor.b;var separatorColorType5="background: -moz-linear-gradient(top,  rgba("+rgb+",0) 1%, rgba("+rgb+",0.4) 24%, rgba("+rgb+",0.4) 46%, rgba("+rgb+",0.4) 47%, rgba("+rgb+",0) 96%, rgba("+rgb+",0) 100%);"+"background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgba("+rgb+",0)), color-stop(24%,rgba("+rgb+",0.4)), color-stop(46%,rgba("+rgb+",0.4)), color-stop(47%,rgba("+rgb+",0.4)), color-stop(96%,rgba("+rgb+",0)), color-stop(100%,rgba("+rgb+",0))); "+"background: -webkit-linear-gradient(top,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);"+"background: -o-linear-gradient(top,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);"+"background: -ms-linear-gradient(top,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);"+"background: linear-gradient(to bottom,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);";var separatorColorType3="background: -moz-linear-gradient(top,  rgba("+rgb+",0) 1%, rgba("+rgb+",0.4) 24%, rgba("+rgb+",0.4) 46%, rgba("+rgb+",0.4) 47%, rgba("+rgb+",0) 96%, rgba("+rgb+",0) 100%);"+"background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgba("+rgb+",0)), color-stop(24%,rgba("+rgb+",0.4)), color-stop(46%,rgba("+rgb+",0.4)), color-stop(47%,rgba("+rgb+",0.4)), color-stop(96%,rgba("+rgb+",0)), color-stop(100%,rgba("+rgb+",0)));"+"background: -webkit-linear-gradient(top,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);"+"background: -o-linear-gradient(top,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);"+"background: -ms-linear-gradient(top,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);"+"background: linear-gradient(to bottom,  rgba("+rgb+",0) 1%,rgba("+rgb+",0.4) 24%,rgba("+rgb+",0.4) 46%,rgba("+rgb+",0.4) 47%,rgba("+rgb+",0) 96%,rgba("+rgb+",0) 100%);";var rgb2=rgb;var separatorColorType2="background: -moz-linear-gradient(top,  "+bgColorColor4+" 0%, "+bgColorColor4+" 49%, rgba("+rgb+", 0.9) 50%, rgba("+rgb2+",0.9) 51%, "+bgColorColor5+" 52%, "+bgColorColor4+" 100%) !important;"+"background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,"+bgColorColor4+"), color-stop(49%,"+bgColorColor4+"), color-stop(50%,rgba("+rgb+", 0.9)), color-stop(51%,rgba("+rgb2+",0.9)), color-stop(52%,"+bgColorColor4+"), color-stop(100%,"+bgColorColor5+")) !important;"+"background: -webkit-linear-gradient(top,  "+bgColorColor4+" 0%,"+bgColorColor4+" 49%,rgba("+rgb+", 0.9) 50%,rgba("+rgb2+",0.9) 51%,"+bgColorColor4+" 52%,"+bgColorColor4+" 100%) !important;"+"background: -o-linear-gradient(top,  "+bgColorColor4+" 0%,"+bgColorColor4+" 49%,rgba("+rgb+", 0.9) 50%,rgba("+rgb2+",0.9) 51%,"+bgColorColor4+") 52%,"+bgColorColor4+" 100%) !important;"+"background: -ms-linear-gradient(top,  "+bgColorColor4+" 0%,"+bgColorColor4+" 49%,rgba("+rgb+", 0.9) 50%,rgba("+rgb2+",0.9) 51%,"+bgColorColor4+" 52%,"+bgColorColor5+" 100%) !important;"+"background: linear-gradient(to bottom,  "+bgColorColor4+" 0%,"+bgColorColor4+" 49%,rgba("+rgb+", 0.9) 50%,rgba("+rgb2+",0.9) 51%,"+bgColorColor4+" 52%,"+bgColorColor4+" 100%) !important;";var wixCounter0LeftBorder="-moz-border-top-left-radius:"+corner+";\n"+"-webkit-border-top-left-radius:"+corner+";\n"+"border-top-left-radius:"+corner+";"+"-moz-border-bottom-left-radius:"+corner+";\n"+"-webkit-border-bottom-left-radius:"+corner+";\n"+"border-bottom-left-radius:"+corner+";\n";var wixCounter0RightBorder="-moz-border-top-right-radius:"+corner+";\n"+"-webkit-border-top-right-radius:"+corner+";\n"+"border-top-right-radius:"+corner+";\n"+"-moz-border-bottom-right-radius:"+corner+";\n"+"-webkit-border-bottom-right-radius:"+corner+";\n"+"border-bottom-right-radius:"+corner+";\n";var wixCounter1Border="-webkit-border-radius:"+corner+";\n"+"-moz-border-radius:"+corner+";\n"+"border-radius:"+corner+";\n";var wixBorderWidth3="border-top-width:"+borderWidth+" !important ;\n"+"border-bottom-width:"+borderWidth+" !important;\n";var wixBorderWidth3Right="border-right-width:"+borderWidth+" !important;\n";var wixBorderWidth3Left="border-left-width:"+borderWidth+" !important;\n";css.push(".leftBorder, #countdown-5.counter div.first, #countdown-6.counter div.first","{",wixCounter0LeftBorder,"}\n");css.push(".rightBorder,#countdown-5.counter div.last,  #countdown-6.counter div.last","{",wixCounter0RightBorder,"}");css.push("#countdown-2.counter div","{",wixCounter1Border,"}");css.push("#countdown-3.counter div,#countdown-4.counter div","{",wixBorderWidth3,"}");css.push("#countdown-3.counter div.last,#countdown-4.counter div.last","{",wixBorderWidth3Right,"}");css.push("#countdown-3.counter div.first,#countdown-4.counter div.first","{",wixBorderWidth3Left,"}");css.push("#countdown-3.counter div .custom_border","{",separatorColorType3,"}");css.push("#countdown-5.counter div .custom_border","{",separatorColorType5,"}");css.push("#countdown-2 .bg-color","{",separatorColorType2,"}");borderWidth=settings.border*2+"px";css.push("#countdown-1.counter div","{width: calc(100%/7 - 0.2px) !important; max-width:  calc(100%/7 - 0.2px) !important; }");css.push("#countdown-2.counter div","{width: calc(100%/7 - 2.3px) !important; max-width:  calc(100%/7 - 2.3px) !important; }");css.push("#countdown-3.counter div","{width: calc((100% - "+borderWidth+")/7 - 1.5px) !important; max-width:  calc((100% - "+borderWidth+")/7 - 1.5px) !important; }");css.push("#countdown-4.counter div","{width: calc((100% - "+borderWidth+")/7 - 1.5px) !important; max-width:  calc((100% - "+borderWidth+")/7 - 1.5px) !important; }");css.push("#countdown-5.counter div","{width: calc(100%/7 - 0.2px) !important; max-width:  calc(100%/7 - 0.2px) !important; }");css.push("#countdown-6.counter div","{width: calc(100%/7 - 2.0px) !important; max-width:  calc(100%/7 - 2.0px) !important; }");return css}function styleMobile(){var css=jointCSS();var finalCSS=css.join("");return finalCSS}function styleWidget(){var css=jointCSS();var finalCSS=css.join("");return finalCSS}this.applyLayoutStyle=function(aSettings,aStyleParams){initParams(aSettings,aStyleParams);var styleCSS="",styleId="myStyleInject";styleCSS=wixService.isMobile()?styleMobile():styleWidget();angular.element("#"+styleId).remove();angular.element('<style type="text/css" id="'+styleId+'">'+styleCSS+"</style>").appendTo("head")}}]);"use strict";(function(){function http($http){this.post=function(url,params){return $http.post(url+initialState.locationParams,params)};this.delete=function(url){return $http.delete(url+initialState.locationParams)};this.addCount=function(isNewVisitor,isMobile){return $http.post("/api/addu"+initialState.locationParams,{isNewVisitor:isNewVisitor,isMobile:isMobile})};this.resetCount=function(){return $http.post("/api/resetCount"+initialState.locationParams)};this.publishSettings=function(settings){return $http.post("/publish"+initialState.locationParams,{settings:JSON.stringify(settings)})}}http.$inject=["$http"];angular.module(initialState.APP_NAME).service("httpService",http)})();"use strict";(function(){function Wix($window,$location,$timeout){var wix=$window.Wix;var url=$location.absUrl();wix.Utils.getInstance=function(){var instanceRegexp=/.*instance=([\[\]a-zA-Z0-9\.\-_]*?)(&|$|#).*/g;var instance=instanceRegexp.exec(url);return instance&&instance[1]?instance[1]:undefined};wix.isMobile=function(){return wix.Utils.getDeviceType()=="mobile"};wix.isEditorMode=function(){return wix.Utils.getViewMode()=="editor"};wix.isSiteMode=function(){return wix.Utils.getViewMode()=="site"};wix.isPreviewMode=function(){return wix.Utils.getViewMode()=="preview"};var myKey="mobileResize2";wix.getDataValue=function(cbOK,cbError){wix.Data.Public.get(myKey,{scope:"COMPONENT"},cbOK,cbError)};wix.setDataValue=function(data,cbOK,cbError){if(!wix.isEditorMode()){return}wix.Data.Public.set(myKey,data,{scope:"COMPONENT"},cbOK,cbError)};wix.isIOS=function(){var userAgent=navigator.userAgent.toLowerCase(),isIPhone=userAgent.indexOf("iphone")>=0,isIPod=userAgent.indexOf("ipod")>=0,isIPad=userAgent.indexOf("ipad")>=0;return isIPhone||isIPod||isIPad};wix.isIPhone=function(){var userAgent=navigator.userAgent.toLowerCase(),isIPhone=userAgent.indexOf("iphone")>=0;return isIPhone};wix.isIpad=function(){var userAgent=navigator.userAgent.toLowerCase(),isIPad=userAgent.indexOf("ipad")>=0;return isIPad};wix.getCookieKey=function(keyName){var compId=wix.Utils.getOrigCompId()||wix.Utils.getCompId();var cookieKey=[keyName,wix.Utils.getInstanceId(),compId].join("_");return cookieKey};return wix}Wix.$inject=["$window","$location","$timeout"];angular.module(initialState.APP_NAME).service("wixService",Wix)})();"use strict";angular.module(initialState.APP_NAME).service("commonsService",function(httpService,$translate,wixService){this.g_allSettings=null;this.postTimer=null;this.gXHR=null;var that=this;this.log=function log(text){if(window.console&&window.console.log){window.console.log(text)}};this.getTranslateByKey=function(key){return $translate.instant(key,{},{},wixService.Utils.getLocale())};this.getLocale=function(defaultLocale){var locale=wixService.Utils.getLocale()||defaultLocale;locale=locale.toLowerCase().replace(/[^a-zA-Z]+/g,"");return locale.length==2?locale:defaultLocale};this.checkURL=function(str){var options={};return validator.isURL(str,options)};this.isIE=function(){var userAgent=window.navigator.userAgent.toLowerCase();return/(msie|trident)/i.test(userAgent||"")};this.isSafari=function(){var userAgent=window.navigator.userAgent.toLowerCase();return/(safari)/i.test(userAgent||"")};this.openPopup=function(url,width,height,title,scroller){var w=width,h=height,left=window.screen.width/2-w/2,top=window.screen.height/2-h/2;var resizable=scroller=scroller?"yes":"no";var win=window.open(url,"settingspopup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+scroller+", resizable="+resizable+", copyhistory=no, width="+w+", height="+h+", top="+top+", left="+left);try{if(win!=null&&win.moveTo)win.moveTo(left,top);if(win!=null)win.focus()}catch(e){}};this.supports_html5_storage=function(){try{return"localStorage"in window&&window["localStorage"]!==null}catch(e){return false}};this.getHitsKey=function(){return"newVistor_"+this.getCookieKey()};this.removeLocalStorage=function(){if(that.supports_html5_storage()){localStorage.removeItem(that.getHitsKey())}};this.wixHandlers=function(){try{wixService.Performance.applicationLoaded()}catch(err){console.log("Wix.Performance: ",err)}if(wixService.Utils.getDemoMode())return;wixService.addEventListener(wixService.Events.COMPONENT_DELETED,function(params){that.removeLocalStorage();httpService.delete("/api/delete").then(function(data){})})};this.getWinHeight=function(){return angular.element($window).height()};this.adjustHeight=function(){$(window).ready(function(){setTimeout(function(){var height=that.getWinHeight();if(height){wixService.setHeight(height)}},0)})};this.getCookieKey=function(){var compId=wixService.Utils.getOrigCompId()||wixService.Utils.getCompId();return[wixService.Utils.getInstanceId(),compId].join("_")};this.postHive=function(description){if(wixService.Utils.getViewMode()!=="site"){log("Error: Invalid view mode. This function cannot be called in editor/preview mode. Supported view mode is: [site]");return false}try{var activity={type:wixService.Activities.Type.CONVERSION_COMPLETE,info:{conversionType:"CTA_CLICK",messageId:getCookieKey(),metadata:[{name:"FAQ App",value:description}]}};var onSuccess=function onSuccess(d){log("Success: Activity ID: "+d.activityId+", Contact ID: "+d.contactId)};var onFailure=function onFailure(d){log("Failure message:"+d)};wixService.Activities.postActivity(activity,onSuccess,onFailure)}catch(err){log("PostHive Error: ",err)}};if(!String.prototype.endsWith){String.prototype.endsWith=function(searchString,position){var subjectString=this.toString();if(typeof position!=="number"||!isFinite(position)||Math.floor(position)!==position||position>subjectString.length){position=subjectString.length}position-=searchString.length;var lastIndex=subjectString.indexOf(searchString,position);return lastIndex!==-1&&lastIndex===position}}this.strip_tags=function(input,allowed){allowed=(((allowed||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;var commentsAndPhpTags=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return input.replace(commentsAndPhpTags,"").replace(tags,function($0,$1){return allowed.indexOf("<"+$1.toLowerCase()+">")>-1?$0:""})}});"use strict";var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}(function(){var HomeController=function(){function HomeController($scope,$log,$interval,$timeout,$window,wixService,httpService,commonsService,styleService,$route,$location,$routeParams,biService,INITIAL_STATE){_classCallCheck(this,HomeController);this.$scope=$scope;this.$log=$log;this.$interval=$interval;this.$timeout=$timeout;this.$window=$window;this.wixService=wixService;this.httpService=httpService;this.commonsService=commonsService;this.styleService=styleService;this.$route=$route;this.$location=$location;this.$routeParams=$routeParams;this.biService=biService;this.initialState=INITIAL_STATE;this.settings=this.initialState.data.settings;this.design=this.initialState.design;this.digits=[0,0,0,0];this.fullArray=[0,0,0,0,0,0,0];this.styleParams={colors:{}};this.fontParams="";this.counterClass="";this.emptyCells=[];this.inited=false;this.animations=["","hatch","slideUp","slideExpandUp","fadeIn","rotateIn","bounce"];this.animationClasses=[];this.eventsListeners={};this.fontSizeMobile=this.wixService.isMobile()?"font-family-mobile":""}_createClass(HomeController,[{key:"applyChangesToScope",value:function applyChangesToScope(fn){this.$timeout(fn)}},{key:"getTranslateByKey",value:function getTranslateByKey(key){return this.commonsService.getTranslateByKey(key)}},{key:"showPreloader",value:function showPreloader(){var that=this;this.$timeout(function(){that.inited=false},1)}},{key:"applyWixStyles",value:function applyWixStyles(styleParams){styleParams=styleParams||this.styleParams;this.styleParams=styleParams;this.styleParams.colors=styleParams.colors||{};this.styleService.applyLayoutStyle(this.settings,this.styleParams)}},{key:"biOnSavePublish",value:function biOnSavePublish(eventTrigger){var settings=this.settings;var nSelectedLayout=parseInt(this.settings.layoutType),nSetStartNumber=this.getStartCounterAt(),bCountType=this.isAllHits()?"true":"false",bAnimation=this.getAnimationClass()==""?"true":"false";this.biService.savePublish([nSelectedLayout,nSetStartNumber,bCountType,bAnimation,eventTrigger])}},{key:"handleEventListeners",value:function handleEventListeners(){var that=this;var evid=that.eventsListeners.SPC||"-1";if(evid==="-1"){that.eventsListeners.SPC=that.wixService.addEventListener(that.wixService.Events.STYLE_PARAMS_CHANGE,function(styleParams){that.applyWixStyles(styleParams);if(that.fontParams!=JSON.stringify(styleParams.fonts)){that.applyChangesToScope(function(){that.fontParams=JSON.stringify(styleParams.fonts)});that.showPreloader();that.initApp()}});that.wixService.addEventListener(that.wixService.Events.SETTINGS_UPDATED,function(params){that.applyChangesToScope(function(){var newSettings=params.settings;that.settings=newSettings;that.applyWixStyles();if(params.dorefresh){that.showPreloader();that.initApp()}})});angular.element(window).resize(function(){clearTimeout(window.resizedFinished);window.resizedFinished=setTimeout(function(){that.resizeCounter()},500)});that.wixService.addEventListener(that.wixService.Events.SITE_PUBLISHED,function(){that.$timeout(function(){that.publishSettings()},5500)});that.wixService.addEventListener(that.wixService.Events.EDIT_MODE_CHANGE,function(event){if(that.wixService.isPreviewMode()){that.showCounter(true)}});that.commonsService.wixHandlers()}that.wixService.Styles.getStyleParams(function(styleParams){that.applyChangesToScope(function(){that.fontParams=JSON.stringify(styleParams.fonts)});that.showPreloader();that.initApp();that.applyWixStyles(styleParams)});that.wixService.addEventListener(that.wixService.Events.SITE_SAVED,function(){that.biOnSavePublish("save")});that.wixService.addEventListener(that.wixService.Events.SITE_PUBLISHED,function(){that.biOnSavePublish("publish")})}},{key:"getStartCounterAt",value:function getStartCounterAt(){return this.settings.startCounterAt?parseInt(this.settings.startCounterAt):0}},{key:"getCounterDigits",value:function getCounterDigits(){var counter=this.isAllHits()?this.settings.allHits:this.settings.uniqueHits;counter=this.getStartCounterAt()+counter;counter=this.wixService.isSiteMode()&&this.isAllHits()?counter+1:counter;return counter}},{key:"getCounter",value:function getCounter(){var counter=this.getCounterDigits();var cntZeroDigits=7-counter.toString().length,arrZerros=new Array(Math.max(1-cntZeroDigits,0)),zeroDigits=arrZerros.join("0"),jointString=zeroDigits+counter,emptyCells=7-jointString.length;this.digits=jointString.split("");this.emptyCells=new Array(Math.max(emptyCells+1,0)).join("0").split("");this.fullArray=[].concat(this.emptyCells,this.digits)}},{key:"getAnimationClass",value:function getAnimationClass(){return this.animations[this.settings.animation]}},{key:"getDigitByIndex",value:function getDigitByIndex(idx){return this.fullArray[idx]}},{key:"isAllDigits",value:function isAllDigits(){return this.settings.animationMode==this.initialState.ANIMATION_MODE_ALL_DIGITS}},{key:"isAllHits",value:function isAllHits(){return this.settings.countingMethod==this.initialState.COUNTING_METHOD_ALL_HITS}},{key:"getAriaLable",value:function getAriaLable(){var str=this.getTranslateByKey("widget.aria.label");return str.replace("%s",this.getCounterDigits())}},{key:"documentReady",value:function documentReady(){return this.inited}},{key:"setRoute",value:function setRoute(layout){var path=this.settings.layoutType||this.initialState.COUNTER_TYPE_0;this.getCounter();if(!!layout)path=layout;this.path="type"+path;this.$location.path("/"+this.path);this.$scope.$routeParams=this.$routeParams;this.$scope.counterClass="counter-"+this.path}},{key:"resizeCounter",value:function resizeCounter(){var that=this;var wrapperWidth=$(window).width();var borderWidth=that.settings.border;if(this.wixService.isEditorMode()&&wrapperWidth<111){wrapperWidth=111;this.wixService.resizeComponent({width:111})}var wrapperHeight=$(window).height();this.$timeout(function(){var windowHeight=wrapperWidth*.2;that.wixService.setHeight(windowHeight);var divHeight=that.wixService.isIOS()?windowHeight:wrapperHeight;if(that.settings.layoutType==that.initialState.COUNTER_TYPE_0){divHeight=divHeight-borderWidth*2}else if(that.settings.layoutType==that.initialState.COUNTER_TYPE_3){divHeight=divHeight-borderWidth*2-4}angular.element(".counter div").css("height",divHeight+"px");angular.element(".counter div.clear").attr("style","width:0px !important;");angular.element("#countdown-3.counter div").css("height",divHeight+"px");angular.element("#countdown-3.counter div.clear").attr("style","width:0px !important;");angular.element("#countdown-4.counter div").css("height",divHeight+"px");var FontPercentage=wrapperWidth/300;var newFontSize=Math.floor(25*FontPercentage)+1;for(var i=1;i<=6;i++){var id="#countdown-"+i+".counter div span";var elm=angular.element("#countdown-"+i+".counter div span");var height="-"+Math.floor($(id).height()/2)+"px";elm.css("margin-top",height)}if(wrapperWidth<250){angular.element("#countdown-3.counter div .custom_border").css("top","0px")}},10)}},{key:"showCounter",value:function showCounter(noResize){var that=this;var stop;this.$timeout(function(){that.applyChangesToScope(function(){that.animationClasses=[]});stop=that.$interval(function(){var animationDelay=that.isAllDigits()?0:that.settings.animationTimeout;for(var index=0;index<=6;index++){var timerr=that.$timeout(function(){that.applyChangesToScope(function(){that.animationClasses.push("visible")})},animationDelay*index)}if(!noResize)that.resizeCounter();that.$interval.cancel(stop);stop=undefined},500)},500)}},{key:"addVisitor",value:function addVisitor(){if(this.wixService.isSiteMode()){var that=this;var cookieKey=this.commonsService.getHitsKey();var isNewVisitor=0;if(this.commonsService.supports_html5_storage()){if(!localStorage[cookieKey]){localStorage.setItem(cookieKey,JSON.stringify(true));that.settings.uniqueHits+=1;isNewVisitor=1}}this.httpService.addCount(isNewVisitor,this.wixService.isMobile()).success(function(data,status,headers,config){}).error(function(data,status,headers,config){})}}},{key:"publishSettings",value:function publishSettings(){return;this.httpService.publishSettings(this.settings).success(function(data,status,headers,config){}).error(function(data,status,headers,config){})}},{key:"initApp",value:function initApp(){var that=this;this.setRoute();this.showCounter();this.$timeout(function(){that.inited=true},1e3)}},{key:"$onInit",value:function $onInit(){this.addVisitor();this.initApp();this.handleEventListeners()}}]);return HomeController}();angular.module(initialState.APP_NAME).controller("HomeController",HomeController)})();