{"version":3,"sources":["../../../../dev/j/v2/components/singleDL-primary.js"],"names":["window","sdl","undefined","test","document","cookie","push","client","cmpId","match","consentGroups","replace","session","countryCode","sdlObj","secChUa","navigator","userAgentData","brands","length","platform","avastGlobals","detect","os","name","mobile","server","provider","env","location","host","startsWith","dataCenter","sdlVersion","URLParams","URLSearchParams","search","event","screen","url","unwantedParams","i","pathname","toString","woParams","protocol","path","locale","hostname","hash","params","Object","fromEntries","screenCategory","title","type","fileName","includes","lineOfBusiness","screenId","error","console","system","message"],"mappings":"CASA,WACC,YACA,IAAIA,OAAOC,MAAQC,UAClB,IACK,2CAA2CC,KAAKC,SAASC,SAC5DJ,IAAIK,MACHC,QACCC,MAAOJ,SAASC,OAAOI,MAAM,4CAA4C,MAMxE,iDAAiDN,KAAKC,SAASC,SAClEJ,IAAIK,MAGHI,cAAeN,SAASC,OAAOI,MAAM,kDAAkD,GAAGE,QAAQ,iCAAkC,IAAIA,QAAQ,OAAQ,KAAKA,QAAQ,KAAM,KAAKA,QAAQ,MAAO,OAIjMV,IAAIK,MACHM,SACCC,YAAaC,OAAOF,QAAQC,YAC5BE,QAAS,WAER,MAAIC,WAAUC,gBAAkBf,WAAac,UAAUC,cAAcC,OAAOC,OAAS,EAC7EH,UAAUC,cAAcC,aAKjCE,SAAUpB,OAAOqB,aAAaC,OAAOC,GAAGC,KACxCC,OAAQ,WAEP,MAAIT,WAAUC,gBAAkBf,WAAac,UAAUC,cAAcC,OAAOC,OAAS,EAC7EH,UAAUC,cAAcQ,OAExB,QAIVC,QACCC,SAAU,MACVP,SAAU,MACVQ,IAAK5B,OAAO6B,SAASC,KAAKC,WAAW,eAAiB,MAAQ,OAC9DC,WAAY,IACZC,WAAY,kBAId,IAAIC,GAAY,GAAIC,iBAAgBnC,OAAO6B,SAASO,OAYpDnC,KAAIK,MACH+B,MAAO,SACPC,QACCT,UACCU,IAAKvC,OAAO6B,SAASO,OAbxB,SAAqCF,GAEpC,IAAK,GADDM,IAAkB,WAAY,WAAY,OACrCC,EAAI,EAAGA,EAAID,EAAerB,OAAQsB,IAC1CP,EAAAA,UAAiBM,EAAeC,GAGjC,OADgCzC,QAAO6B,SAASC,KAAO9B,OAAO6B,SAASa,SAAW,IAAMR,EAAUS,YAQtCT,GAAalC,OAAO6B,SAASC,KAAO9B,OAAO6B,SAASa,SAC9GE,SAAU5C,OAAO6B,SAASC,KAAO9B,OAAO6B,SAASa,SACjDG,SAAU7C,OAAO6B,SAASgB,SAASlC,QAAQ,IAAK,IAChDmC,KAAM,IAAMhC,OAAOwB,OAAOS,OAAS,IAAMjC,OAAOwB,OAAOQ,KACvDE,SAAUlC,OAAOwB,OAAOU,SACxBC,KAAMjD,OAAO6B,SAASoB,KACtBC,OAAQlD,OAAO6B,SAASO,OAASe,OAAOC,YAAYlB,GAAa,IAElEa,OAAQjC,OAAOwB,OAAOS,OACtBM,eAAgBvC,OAAOwB,OAAOe,eAC9BC,MAAOlD,SAASkD,MAChBC,KAAMzC,OAAOwB,OAAOkB,SAASC,SAAS,kBAAoB,QAAU3C,OAAOwB,OAAOiB,KAClF/B,KAAMV,OAAOwB,OAAOd,KACpBkC,eAAgB5C,OAAOwB,OAAOoB,eAC9BC,SAAU7C,OAAOwB,OAAOqB,YAIzB,MAAOC,GACRC,QAAQD,MAAMA,GACd3D,IAAIK,MACHwD,QACCF,OACCL,KAAMK,EAAMpC,KACZuC,QAASH,EAAMG,UAGjB1B,MAAO","file":"singleDL-primary.js","sourcesContent":["/**\n * Single DataLayer - Primary part\n * Placed in the , pushes data to sdl object\n * Secondary part (singleDL-secondary.js) is placed in footer\n * @version 1.0.0\n * @author Vendula Frýzlová , Jaroslav Slaby \n * @copyright Avast Software s.r.o ©2022\n */\n\n(function () {\n\t'use strict';\n\tif (window.sdl !== undefined) {\n\t\ttry {\n\t\t\tif (/OptanonConsent=.*?(consentId=(.*?)(?=&))/.test(document.cookie)) {\n\t\t\t\tsdl.push({\n\t\t\t\t\tclient: {\n\t\t\t\t\t\tcmpId: document.cookie.match(/OptanonConsent=.*?(consentId=(.*?)(?=&))/)[2]\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t//if (/(?<=NotLandingPage&groups=|groups=).*?(?=&|;|$)/.test(document.cookie)) {\n\t\t\tif (/(?:NotLandingPage&groups=|groups=).*?(?=&|;|$)/.test(document.cookie)) { // safari fix\n\t\t\t\tsdl.push({\n\t\t\t\t\t// uncomment and remove fix when apple develops a working browser and not that shit safari (safari doesn't support ?<=, also they don't know what try-catch is)\n\t\t\t\t\t//consentGroups: document.cookie.match(/(?<=NotLandingPage&groups=|groups=).*?(?=&|;|$)/)[0].replace(/%3A/g, ':').replace(/%/g, ',').replace(/2C/g, ' ')\n\t\t\t\t\tconsentGroups: document.cookie.match(/(?:NotLandingPage&groups=|groups=).*?(?=&|;|$)/)[0].replace(/NotLandingPage&groups=|groups=/, '').replace(/%3A/g, ':').replace(/%/g, ',').replace(/2C/g, ' ') // safari fix\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tsdl.push({\n\t\t\t\tsession: {\n\t\t\t\t\tcountryCode: sdlObj.session.countryCode,\n\t\t\t\t\tsecChUa: (function () {\n\t\t\t\t\t\t// Check Client Hints support. For now only by chromium based browsers (July 2022)\n\t\t\t\t\t\tif (navigator.userAgentData !== undefined && navigator.userAgentData.brands.length > 0) {\n\t\t\t\t\t\t\treturn navigator.userAgentData.brands\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t})(),\n\t\t\t\t\tplatform: window.avastGlobals.detect.os.name,\n\t\t\t\t\tmobile: (function () {\n\t\t\t\t\t\t// Check Client Hints support. For now only by chromium based browsers (July 2022)\n\t\t\t\t\t\tif (navigator.userAgentData !== undefined && navigator.userAgentData.brands.length > 0) {\n\t\t\t\t\t\t\treturn navigator.userAgentData.mobile\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn '-';\n\t\t\t\t\t\t}\n\t\t\t\t\t})()\n\t\t\t\t},\n\t\t\t\tserver: {\n\t\t\t\t\tprovider: 'CMS',\n\t\t\t\t\tplatform: 'WEB',\n\t\t\t\t\tenv: window.location.host.startsWith('web-preview') ? 'dev' : 'prod',\n\t\t\t\t\tdataCenter: '-',\n\t\t\t\t\tsdlVersion: '2021-05-05/v1'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar URLParams = new URLSearchParams(window.location.search);\n\n\t\t\t// Remove unwanted URL parameters\n\t\t\tfunction removeUnwantedParamsFromUrl(URLParams) {\n\t\t\t\tvar unwantedParams = ['ASWPARAM', 'aswparam', '_ga']\n\t\t\t\tfor (var i = 0; i < unwantedParams.length; i++) {\n\t\t\t\t\tURLParams.delete(unwantedParams[i])\n\t\t\t\t}\n\t\t\t\tvar URLWithoutUnwantedParams = window.location.host + window.location.pathname + '?' + URLParams.toString()\n\t\t\t\treturn URLWithoutUnwantedParams\n\t\t\t}\n\n\t\t\tsdl.push({\n\t\t\t\tevent: 'screen',\n\t\t\t\tscreen: {\n\t\t\t\t\tlocation: {\n\t\t\t\t\t\turl: window.location.search ? removeUnwantedParamsFromUrl(URLParams) : window.location.host + window.location.pathname,\n\t\t\t\t\t\twoParams: window.location.host + window.location.pathname,\n\t\t\t\t\t\tprotocol: window.location.protocol.replace(':', ''),\n\t\t\t\t\t\tpath: '/' + sdlObj.screen.locale + '/' + sdlObj.screen.path,\n\t\t\t\t\t\thostname: sdlObj.screen.hostname,\n\t\t\t\t\t\thash: window.location.hash,\n\t\t\t\t\t\tparams: window.location.search ? Object.fromEntries(URLParams) : ''\n\t\t\t\t\t},\n\t\t\t\t\tlocale: sdlObj.screen.locale,\n\t\t\t\t\tscreenCategory: sdlObj.screen.screenCategory,\n\t\t\t\t\ttitle: document.title,\n\t\t\t\t\ttype: sdlObj.screen.fileName.includes('error-page.php') ? 'error' : sdlObj.screen.type,\n\t\t\t\t\tname: sdlObj.screen.name,\n\t\t\t\t\tlineOfBusiness: sdlObj.screen.lineOfBusiness,\n\t\t\t\t\tscreenId: sdlObj.screen.screenId\n\t\t\t\t}\n\t\t\t});\n\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\tsdl.push({\n\t\t\t\tsystem: {\n\t\t\t\t\terror: {\n\t\t\t\t\t\ttype: error.name,\n\t\t\t\t\t\tmessage: error.message,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tevent: 'system.error'\n\t\t\t})\n\t\t}\n\t}\n})();\n"]}