{"version":3,"sources":["../../../dev/j/lp/windows-10-vpn.js"],"names":["$question","$","window","mediaQuery","getComputedStyle","document","body","getPropertyValue","on","removeClass","this","addClass","locale","avastGlobals","web","substring","customLocales","url","RootPath","$global","$local","$additional","$users","thMil","number","value","users","toString","separator","numberThousandSeparator","arr","usersLength","length","str","i","Math","ceil","unshift","j","margin","top","right","bottom","left","width","height","x","d3","scale","ordinal","rangeRoundBands","y","linear","range","xAxis","svg","axis","orient","yAxis","select","append","attr","indexOf","hide","toUpperCase","get","data","processedData","name","push","week","splice","html","domain","map","d","max","call","selectAll","insert","style","ready","browserRefs","$build","$anchors","getReferrer","referrer","path","split","filter","val","trim","validateReferrer","isValid","each","key","el","hasUTMs","location","href","build","oldBuild","replace","avm","require","$faq_holder","jsonInjection","contextType","content","createElement","jsonIntro","@context","@type","json","Object","assign","type","text","JSON","stringify","querySelector","appendChild","$items","find","contentJson","innerText","acceptedAnswer","innerHTML"],"mappings":"CAAA,WACC,YACA,IACCA,IADaC,EAAEC,QACHD,EAAE,iBACdE,EAAa,WAEZ,MADcD,QAAuB,iBAAIA,OAAOE,iBAAiBC,SAASC,KAAM,UAAUC,iBAAiB,WAAa,KAKvG,WACI,cAAjBJ,KAAmD,cAAjBA,KAAmD,YAAjBA,MAI5C,aAAjBA,KAAkD,aAAjBA,KAAkD,WAAjBA,MAIjD,aAAjBA,KAAkD,aAAjBA,KAAiCA,SAe/EH,EAAUQ,GAAG,QAAS,WACrBR,EAAUS,YAAY,UACtBR,EAAES,MAAMC,SAAS,WAOlB,IACCC,GAASV,OAAOW,aAAaC,IAAIF,OAAOG,UAAU,GAClDC,GAAiB,KAAM,KAAM,KAAM,MACnCC,EAAMJ,aAAaC,IAAII,SAAW,oDAElCC,GADUlB,EAAE,WACFA,EAAE,eACZmB,EAASnB,EAAE,aACXoB,EAAcpB,EAAE,kBAChBqB,EAASrB,EAAE,aACXsB,EAAQ,SAAUC,GAQjB,IAAK,GAFJC,GALGC,EAAQF,EAAOG,WACl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GAAWD,aAEf,IAAIO,iBAAiBN,KAAcW,WAC9Bb,EAASpD,OAAS,GAAKmD,EAAOnD,OAAS,EAAG,CAC7C,GAAIoE,GAAQjB,EAAOjB,KAAK,YAExBkB,GAASU,KAAK,SAASC,EAAKC,GAC3B,GAAIK,GAAWpG,EAAE+F,GAAI9B,KAAK,oBACtBiC,EAAOlG,EAAE+F,GAAInC,KAAK,QAAQyC,QAAQD,EAAUD,EAEhDnG,GAAE+F,GAAInC,KAAK,OAAQsC,GACnBlG,EAAE+F,GAAInC,KAAK,wBAAyBuC,QASxC,WACC,YACA,IAAInG,GAAIsG,IAAIC,QAAQ,UACnBC,EAAcxG,EAAE,gCAEhByG,EAAgB,SAASC,EAAaC,GACrC,GAAIZ,GAAK3F,SAASwG,cAAc,UAC5BC,GACFC,WAAY,oBACZC,QAASL,GAEVM,EAAOC,OAAOC,OAAOL,EAAWF,EAEjCZ,GAAGoB,KAAO,sBACVpB,EAAGqB,KAAOC,KAAKC,UAAUN,GACzB5G,SAASmH,cAAc,QAAQC,YAAYzB,GAG7C/F,GAAEI,UAAU4E,MAAM,WAEbwB,GACHA,EAAYX,KAAK,WAChB,GACC4B,GAASzH,EAAES,MAAMiH,KAAK,mBACtBf,KACAgB,IAEDF,GAAO5B,KAAK,WACX8B,EAAYvD,MACX2C,QAAS,WACT5C,KAAQ1D,KAAK8G,cAAc,uBAAuBK,UAAUvB,QAAQ,MAAM,IAAIA,QAAQ,MAAM,IAC5FwB,gBACCd,QAAS,SACTK,KAAQ3G,KAAK8G,cAAc,sBAAsBO,UAAUzB,QAAQ,MAAM,IAAIA,QAAQ,MAAM,SAI9FM,EAAoB,WAAIgB,EAExBlB,EAjBkB,UAiBSE","file":"windows-10-vpn.js","sourcesContent":["(function () {\n\t'use strict';\n\tvar $window = $(window),\n\t\t$question = $('.js-question'),\n\t\tmediaQuery = function () {\n\t\t\tvar screen = (window.getComputedStyle) ? window.getComputedStyle(document.body, ':after').getPropertyValue('content') : '';\n\t\t\treturn screen;\n\t\t},\n\t\t// function serves different settings for different resolutions\n\t\t// Get number of displayed reviews by screen size\n\t\tmediaQueryLogic = function () {\n\t\t\tif (mediaQuery() === '\\'desktop\\'' || mediaQuery() === \"\\\"desktop\\\"\" || mediaQuery() === \"desktop\") {\n\t\t\t\treturn {\n\t\t\t\t\tgraphWidth: 950\n\t\t\t\t};\n\t\t\t} else if (mediaQuery() === '\\'custom\\'' || mediaQuery() === \"\\\"custom\\\"\" || mediaQuery() === \"custom\") {\n\t\t\t\treturn {\n\t\t\t\t\tgraphWidth: 950\n\t\t\t\t};\n\t\t\t} else if (mediaQuery() === '\\'tablet\\'' || mediaQuery() === \"\\\"tablet\\\"\" || mediaQuery() === \"tablet\") {\n\t\t\t\treturn {\n\t\t\t\t\tgraphWidth: 600\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tgraphWidth: 300\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t// init functions\n\tmediaQueryLogic();\n\n\t// FAQ section accordion\n\t$question.on('click', function () {\n\t\t$question.removeClass('active');\n\t\t$(this).addClass('active');\n\t});\n\n\n\t/* ----------------------------------\n\t\tDynamic section - D3 graph\n\t\t---------------------------------- */\n\tvar data,\n\t\tlocale = window.avastGlobals.web.locale.substring(3),\n\t\tcustomLocales = ['us', 'fr', 'br', 'ru'],\n\t\turl = avastGlobals.web.RootPath + 'api/v1/threat-stats?from=2015-01-01&to=2050-07-07',\n\t\t$around = $('#around'),\n\t\t$global = $('.js-global'),\n\t\t$local = $('.js-local'),\n\t\t$additional = $('.js-additional'),\n\t\t$users = $('.js-users'),\n\t\tthMil = function (number) {\n\t\t\tvar users = number.toString(),\n\t\t\t\tseparator = avastGlobals.web.numberThousandSeparator,\n\t\t\t\tarr = [],\n\t\t\t\tusersLength = users.length,\n\t\t\t\tstr = '',\n\t\t\t\tvalue;\n\n\t\t\tfor (var i = Math.ceil(usersLength / 3); i > 0; i--) {\n\t\t\t\tvalue = users.substring(usersLength - 3, usersLength);\n\t\t\t\tusersLength = usersLength - 3;\n\t\t\t\tarr.unshift(value);\n\t\t\t}\n\t\t\tfor (var j = 0; j < arr.length; j++) {\n\t\t\t\tstr += arr[j] + separator;\n\t\t\t}\n\t\t\tif (separator === '') {\n\t\t\t\treturn str.substring(0, str.length + 1);\n\t\t\t} else {\n\t\t\t\treturn str.substring(0, str.length - 1);\n\t\t\t}\n\t\t},\n\t\t// Graph\n\t\t//margin = {top: 20, right: 20, bottom: 30, left: 40},\n\t\tmargin = {top: 20, right: 0, bottom: 80, left: 150},\n\t\twidth = 900 - margin.left - margin.right,\n\t\theight = 500 - margin.top - margin.bottom,\n\t\tx = d3.scale.ordinal().rangeRoundBands([0, width], .1),\n\t\ty = d3.scale.linear().range([height, 0]),\n\t\txAxis = d3.svg.axis().scale(x).orient('bottom'),\n\t\tyAxis = d3.svg.axis().scale(y).orient('left'),\n\t\tsvg = d3.select('#around .AVsizer').append('svg')\n\t.attr('class', 'js-graph')\n\t.attr('width', width + margin.left + margin.right)\n\t.attr('height', height + margin.top + margin.bottom)\n\t.append('g')\n\t.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'),\n\t\trevealStats = function (processedData) {\n\t\t\tsvg.selectAll('.bar')\n\t\t\t\t.data(processedData)\n\t\t\t\t.enter()\n\t\t\t\t.append('rect')\n\t\t\t\t.attr('class', 'bar')\n\t\t\t\t.attr('x', function(d) { return x(d.week); })\n\t\t\t\t.attr('width', x.rangeBand() - 7)\n\t\t\t\t.attr('y', function(d) { return height - .5; })\n\t\t\t\t.attr('height', 0)\n\t\t\t\t.transition().delay(function (d,i){ return i * 50;}).duration(1500)\n\t\t\t\t.ease('bounce')\n\t\t\t\t.attr('y', function(d) { return y(d.users); })\n\t\t\t\t.attr('height', function(d) { return height - y(d.users) - .5; });\n\t\t};\n\n\n\n\n\n\t// execution according to locale\n\tif (customLocales.indexOf(locale) === -1) {\n\t\t// do for all other locales\n\t\tlocale = 'XX'; // worldwide statistic\n\t\t$additional.hide();\n\t\t$local.hide();\n\t} else {\n\t\t// do for custom locales\n\t\tlocale = locale.toUpperCase();\n\t\t$global.hide();\n\t}\n\n\t// get data for graph and render it\n\t$.get(url, function (data) {\n\t\t// create array from data object for current country\n\t\tvar processedData = [],\n\t\t\t$graph = $('.js-graph');\n\t\tfor(var name in data) {\n\t\t\tprocessedData.push({week: name, users: data[name][locale].users});\n\t\t}\n\n\t\t// leave only last 30 items in array\n\t\tif (processedData.length > 30) {\n\t\t\tprocessedData = processedData.splice(processedData.length - 30);\n\t\t}\n\n\t\t// add data to sentences above graph with proper thousand milestones\n\t\t$users.html(thMil(processedData[processedData.length - 1].users));\n\n\t\t// Add graph\n\t\tx.domain(processedData.map(function(d) { return d.week; }));\n\t\t//y.domain([0, d3.max(processedData, function(d) { return d.users; })]);\n\t\ty.domain([0, d3.max(processedData, function(d) { return d.users / 6 + d.users; })]);\n\n\t\tsvg.append('g')\n\t\t\t.attr('class', 'x axis')\n\t\t//.attr('transform', 'translate(0,' + height + ')')\n\t\t\t.attr('transform', 'translate(-3, 420)')\n\t\t// .attr('transform', 'translate(-3, 460)')\n\t\t\t.call(xAxis);\n\n\t\tsvg.append('g')\n\t\t\t.attr('class', 'y axis')\n\t\t\t.attr('transform', 'translate(0, 0)')\n\t\t\t.call(yAxis);\n\n\t\t// add circles to x axis\n\t\td3.select('.x.axis')\n\t\t\t.selectAll('g.tick')\n\t\t\t.insert('circle', ':first-child')\n\t\t\t.attr('r', 5).style('fill', '#d2d3de');\n\n\t\td3.selectAll('.x.axis g.tick text')\n\t\t\t.attr('y', 25);\n\n\t\t// Scroll to graph\n\t\t/*$window.on('scroll', function () {\n\t\t\tif ($around.offset().top + $around.height() - 300 < $window.scrollTop() + $window.height()) {\n\t\t\t\trevealStats(processedData);\n\t\t\t}\n\t\t});*/\n\n\t\t// Responsive graph\n\t\t// $window.on('resize', function () {\n\t\t// $graph.attr('width', mediaQueryLogic().graphWidth);\n\t\t// });\n\t\t// $graph.attr('width', mediaQueryLogic().graphWidth);\n\n\t\t// on page load in viewport\n\t\t/*if ($around.offset().top + $around.height() - 300 < $window.scrollTop() + $window.height()) {\n\t\t\trevealStats(processedData);\n\t\t}*/\n\t});\n})();\n\n$(document).ready(function() {\n\tvar browserRefs = ['google', 'bing'],\n\t\t$build = $('[data-alt-build]'),\n\t\t$anchors = $('[data-bi-download-name]');\n\t\tgetReferrer = function () {\n\t\t\tvar referrer = document.referrer;\n\t\t\tvar path = referrer.split('/').filter(function (val) {\n\t\t\t\treturn val.trim();\n\t\t\t});\n\n\t\t\tif (path.length > 1) {\n\t\t\t\treferrer = path[1];\n\t\t\t}\n\n\t\t\tif (referrer.length === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn referrer;\n\t\t},\n\t\tvalidateReferrer = function (referrer) {\n\t\t\tvar isValid = false;\n\n\t\t\tif (referrer) {\n\t\t\t\t$.each(browserRefs, function(key, el){\n\t\t\t\t\tif (referrer.indexOf(el) > -1) {\n\t\t\t\t\t\tisValid = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn isValid;\n\t\t},\n\t\thasUTMs = function () {\n\t\t\tvar url = window.location.href;\n\t\t\tif (url.indexOf('utm_campaign') > -1 || url.indexOf('gclid') > -1) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\tvar referrer = getReferrer();\n\n\tif (validateReferrer(referrer) && !hasUTMs()) {\n\t\tif ($anchors.length > 0 && $build.length > 0) {\n\t\t\tvar build = $build.data('alt-build');\n\n\t\t\t$anchors.each(function(key, el){\n\t\t\t\tvar oldBuild = $(el).data('bi-download-name');\n\t\t\t\tvar href = $(el).attr('href').replace(oldBuild, build);\n\n\t\t\t\t$(el).attr('href', href);\n\t\t\t\t$(el).attr('data-bi-download-name', build);\n\t\t\t});\n\t\t}\n\t}\n\n});\n\n\n// FAQ structured data for Google search results\n(function() {\n\t'use strict';\n\tvar $ = avm.require('jquery'),\n\t\t$faq_holder = $('[data-structured-type=\"faq\"]'),\n\t\t/* Function for JSON stringify and Script injection */\n\t\tjsonInjection = function(contextType, content){\n\t\t\tvar el = document.createElement('script');\n\t\t\tvar jsonIntro = {\n\t\t\t\t\t\"@context\": \"http://schema.org\",\n\t\t\t\t\t\"@type\": contextType\n\t\t\t\t},\n\t\t\t\tjson = Object.assign(jsonIntro, content);\n\n\t\t\tel.type = 'application/ld+json';\n\t\t\tel.text = JSON.stringify(json);\n\t\t\tdocument.querySelector('head').appendChild(el);\n\t\t};\n\n\t$(document).ready(function(){\n\t\t//FAQ\n\t\tif ($faq_holder) {\n\t\t\t$faq_holder.each(function(){\n\t\t\t\tvar contextType = 'FAQPage',\n\t\t\t\t\t$items = $(this).find('.accordion-item'),\n\t\t\t\t\tcontent = {},\n\t\t\t\t\tcontentJson = [];\n\n\t\t\t\t$items.each(function() {\n\t\t\t\t\tcontentJson.push({\n\t\t\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\t\t\"name\": this.querySelector('.accordion-title h4').innerText.replace(/\\n/g,'').replace(/\\t/g,''),\n\t\t\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\t\t\"text\": this.querySelector('.accordion-content').innerHTML.replace(/\\n/g,'').replace(/\\t/g,'')\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t\tcontent['mainEntity'] = contentJson;\n\n\t\t\t\tjsonInjection(contextType, content);\n\t\t\t});\n\t\t}\n\t});\n})();\n"]}