{"version":3,"sources":["../../../dev/j/vendor/one-trust.js"],"names":["OptanonWrapper","gpcEnabled","navigator","globalPrivacyControl","cookieBannerContainer","document","getElementById","body","prepend","classList","toggle","OneTrust","IsAlertBoxClosed","otPcExpandButton","querySelectorAll","otPcRejectAllButton","otPcAcceptAllButton","i","length","setAttribute","parentNode","insertBefore","nextSibling","oneTrustCookieGroups","GetDomainData","Groups","isGpcEnabledInOneTrustAdmin","IsGpcEnabled","countryCode","getGeolocationData","country","toLowerCase","stateCode","state","locale","otBannerDescription","isMinimalisticBannerUsed","shouldDisplayBanner","isGroup1","isGroup2","isGroup3","otConditionGroup","otDebugData","isGpcSignalDetected","debug","console","log","table","otMini","bannerExpandedClass","bannerHiddenClass","homepageAttr","getAttribute","isAcademyPage","includes","isGpcMinimalisticRejectAllTemplate","BannerShowRejectAllButton","otDomainData","otData","text","textContent","cookiePolicyLink","querySelector","title","url","AboutLink","buttons","accept","AlertAllowCookiesText","reject","BannerRejectAllButtonText","manage","AlertMoreInfoText","createElement","id","tabIndex","addEventListener","e","contains","preventDefault","add","cookieIcon","appendChild","contentContainer","policyText","span","link","href","target","buttonsDiv","acceptButton","AllowAll","secondaryButton","RejectAll","ToggleInfoDisplay","otPcConfirmSelectionButton","window","scrollY","documentElement","scrollTop","remove","adjustCookieConsentBannerMargin","stickyBar","isVisible","height","offsetHeight","style","marginBottom","checkMobileStickyBarVisibility","mobileStickyBar","getComputedStyle","display","checkDesktopStickyBarVisibility","desktopStickyBar","position","checkToolPageStickyBarVisibility","toolPageStickyBar","bottom","checkStickyBarVisibility","innerWidth","bodyClasses","className","split","platformClass","classes","startsWith","gpcOKButton","buttonContainer","Close"],"mappings":"AAiBA,QAASA,kBAER,KAAMC,GAAaC,UAAUC,qBACvBC,EAAwBC,SAASC,eAAe,uBAGtDD,UAASE,KAAKC,QAAQJ,GAGlBH,GAMHG,EAAsBK,UAAUC,OAAO,gBAWxC,WAEC,IAAKC,SAASC,mBAAoB,CAGjC,KAAMC,GAAm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,EAAkBV,IAGnD,QAASY,KACR,GAAKC,EAAL,CACA,KAAMV,GAAQV,OAAOc,iBAAiBM,GAEhCb,EAA8B,UAAlBG,EAAMK,SAAwC,QAAjBL,EAAMW,MACrDhB,GAAgCe,EAAmBb,IAIpD,QAASe,KACctB,OAAOuB,WAET,MACnBX,IACAO,KAEAH,IAlEF,KAAMQ,GAAcnH,SAASE,KAAKkH,UAAUC,MAAM,KAY5CC,EATN,SAA0BC,GACzB,IAAK,GAAI3G,GAAI,EAAGA,EAAI2G,EAAQ1G,OAAQD,IACnC,GAAI2G,EAAQ3G,GAAG4G,WAAW,OACzB,MAAOD,GAAQ3G,EAGjB,OAAO,OAG+BuG,GAWjCX,EAAkBxG,SAASyD,cAAc,uBAEzCmD,EAAmBU,EAAgBtH,SAASyD,cAAc,cAAgB6D,EAAgB,kCAAoC,KAC9HP,EAAoBO,EAAgBtH,SAASyD,cAAc,cAAgB6D,EAAgB,mBAAqB,IA6CtHL,KAGAtB,OAAOpB,iBAAiB,SAAU0C,GAClCtB,OAAOpB,iBAAiB,SAAU0C,cAmBvC,WACC,GAAIQ,GAAczH,SAASC,eAAe,0BACzCyH,EAAkB1H,SAASyD,cAAc,4BAEtCgE,KAEHC,EAAgB7C,YAAY4C,GAGxB7H,EACH6H,EAAYlD,iBAAiB,QAAS,WACrCjE,SAASqH,QAGT3H,SAASE,KAAKE,UAAU2F,OAAO,wBAKhC0B,EAAYlD,iBAAiB,QAAS,WACrCjE,SAASgF,WAGTtF,SAASE,KAAKE,UAAU2F,OAAO","file":"one-trust.js","sourcesContent":["/*\n\n\t-----------------------\n\tOneTrust Cookie Consent\n\t-----------------------\n\n\tDOCS: \n\t\t- Banner SDK JavaScript API: https://developer.onetrust.com/onetrust/docs/javascript-api\n\n\n\tCustom functionality\n\t--------------------\n\t- the OptanonWrapper() fires once all files related to the Cookie consent finished download\n\t- see SDK reference to see what files are downloaded:\n\t- https://developer.onetrust.com/onetrust/docs/performance-availability-cookie-script\n\n*/\nfunction OptanonWrapper() {\n\n\tconst gpcEnabled = navigator.globalPrivacyControl;\t// Detect if the browser transmits a GPC (Global Privacy Control) signal\n\tconst cookieBannerContainer = document.getElementById('onetrust-consent-sdk');\t// Top level OneTrust container\n\n\t// Append the Cookie consent container to the DOM\n\tdocument.body.prepend(cookieBannerContainer);\n\n\t// Display appropriate text based on GPS signal\n\tif (gpcEnabled) {\n\t\t/*\n\t\t\tIn the Banner and Privacy Preference Center are two versions of text:\n\t\t\t1. scenario – no GPS signal is detected: display text in the container with the \"gpc-off\" class\n\t\t\t2. scenario – GPS signal detected: display text in the container with the \"gpc-on\" class\n\t\t*/\n\t\tcookieBannerContainer.classList.toggle(\"gpc-detected\");\n\t}\n\n\n\t//\n\t//\tPrivacy Preference Center (
)\n\t//\n\t/*\n\t\t1. Expands all category descriptions\n\t\t2. Relocate \"Reject all\" button from bottom to the top\n\t*/\n\tfunction setupPrivacyPreferenceCenter() {\n\t\t// No previous interaction with Cookie Consent Banner\n\t\tif (!OneTrust.IsAlertBoxClosed()) {\n\n\t\t\t// Preference Center buttons\n\t\t\tconst otPcExpandButton = document.querySelectorAll('.ot-accordion-layout button');\t// Expand Category description button\n\t\t\tconst otPcRejectAllButton = document.querySelectorAll('.ot-pc-footer .ot-pc-refuse-all-handler');\t// \"Reject all\" button\n\t\t\tconst otPcAcceptAllButton = document.getElementById('accept-recommended-btn-handler');\t// \"Accept all\" button\n\t\n\t\t\t// 1. Expand all Categories description\n\t\t\tfor (var i = 0; i < otPcExpandButton.length; i++) {\n\t\t\t\totPcExpandButton[i].setAttribute('aria-expanded', 'true');\n\t\t\t}\n\t\n\t\t\t// 2. Relocate \"Reject all\" button from bottom to the top (after the \"Accept all\" button)\n\t\t\tif (otPcRejectAllButton.length > 0 && otPcAcceptAllButton) {\n\t\t\t\totPcAcceptAllButton.parentNode.insertBefore(otPcRejectAllButton[0], otPcAcceptAllButton.nextSibling);\n\t\t\t}\n\t\t}\n\t}\n\tsetupPrivacyPreferenceCenter();\n\n\n\n\t//\n\t//\tMininalistic Banner Template\n\t//\n\t/*\n\t\tThe function oneTrustMiniBanner() handles following templates\n\t\t- Avast – MINIMALISTIC (+ Reject)\n\t\t- Avast – MINIMALISTIC (+ Manage)\n\n\t\tDEV notes\n\t\t–––––––––\n\t\t- The function oneTrustMiniBanner() creates a new HTML template on-the-fly via JavaScript.\n\t\t- Text used in the new template extracted from the original OneTrust banner template (
).\n\t\t- The original OneTrust banner template is hidden via custom CSS (defined in OneTrust admin)\n\t\t\t- if you need to adjust the custom CSS, open one of the following links, click the \"Banner\" tab, open \"Styling\" accordion and locate \"Custom CSS\" textarea\n\n\t\t\t\t1. Template\n\t\t\t\tName: Avast – MINIMALISTIC (+ Reject)\n\t\t\t\tLink: https://app-de.onetrust.com/cookies/templates/edit/019204a0-3b96-757b-934f-70890d53f323\n\n\t\t\t\t2. Template\n\t\t\t\tName: Avast – MINIMALISTIC (+ Manage)\n\t\t\t\tLink: https://app-de.onetrust.com/cookies/templates/edit/01948389-38e6-78cc-b1a5-8f16e7028090\n\n\t\t- the \"otBannerDescription\" element\n\t\t\t- exists only in the \"Avast – MINIMALISTIC (...)\" templates\n\n\t*/\n\n\n\t// Get default Cookie Preferences\n\t// - to see the settings, go to: OneTrust Admin > \"Geolocation Rules\" > \"Avast Consent Policy\"\n\tconst oneTrustCookieGroups = OneTrust.GetDomainData().Groups;\n\n\t// Default to false\n\tvar isGpcEnabledInOneTrustAdmin = false;\n\n\t// Check if current OneTrust template has GPC enabled\n\tfor (var i = 0; i < oneTrustCookieGroups.length; i++) {\n\t\tif (oneTrustCookieGroups[i].IsGpcEnabled) {\n\t\t\tisGpcEnabledInOneTrustAdmin = true; // Set to true if at least one group has IsGpcEnabled as true\n\t\t\tbreak; // Exit the loop early since we found a true value\n\t\t}\n\t}\n\n\n\t// Get country and state code (and convert it to lowercase – on Preview it returns lowercase, on Production uppercase)\n\tconst countryCode = OneTrust.getGeolocationData().country.toLowerCase();\t// Example: 'us' (United States)\n\tconst stateCode = OneTrust.getGeolocationData().state.toLowerCase();\t\t// Example: 'ca' (California)\n\tconst locale = countryCode + '-' + stateCode;\t\t\t\t\t\t\t\t// Example: 'us-ca'\n\n\t// Get text \"This site uses\"\n\t// - this text is defined in OneTrust admin (tab \"Banner\" > \"Content\" accordion > \"Title & Description\" > \"Notice description\" textarea)\n\tconst otBannerDescription = document.getElementById('oneTrust__minimalisticBanner--text');\n\tconst isMinimalisticBannerUsed = !!otBannerDescription; // Convert otBannerDescription to a boolean: true if the element exists, false if not\n\n\n\t/*\n\n\t\tSpecific conditions must be met in order to show the minibanner\n\t\t===============================================================\n\n\t\tCommon conditions\n\t\t-----------------\n\t\t\t- !OneTrust.IsAlertBoxClosed() = Visitor hasn't interacted with the banner\n\t\t\t- isMinimalisticBannerUsed = Minimalistic template is set in OneTrust Admin\n\n\t\tGeolocation & GPC support conditions\n\t\t------------------------------------\n\t\t\t- isGroup1 = 🇺🇸 US 🟢 GPC-supported states (or any other country/states which supports GPC)\n\t\t\t\t- GPC is supported by law in these states…\n\t\t\t\t- nevertheless, the Banner will be shown only if the browser doesn't transmit the GPC signal (if the browser transmit the GPC signal, no banner is needed)\n\t\t\t- isGroup2 = 🇺🇸 US 🔴 GPC-not-supported state\n\t\t\t- isGroup3 = 🇦🇺 Australia 🔴 GPC-not-supported state\n\n\t*/\n\tconst shouldDisplayBanner = !OneTrust.IsAlertBoxClosed() && isMinimalisticBannerUsed;\n\tconst isGroup1 = isGpcEnabledInOneTrustAdmin && !gpcEnabled && shouldDisplayBanner;\n\tconst isGroup2 = !isGpcEnabledInOneTrustAdmin && countryCode === 'us' && shouldDisplayBanner;\n\tconst isGroup3 = countryCode === 'au' && shouldDisplayBanner;\n\n\n\t//\n\t//\tCondition Group\n\t//\n\tconst otConditionGroup = \n\t\tisGroup1 ? 'Group 1.: 🇺🇸 US 🟢 GPC-supported state' :\n\t\tisGroup2 ? 'Group 2.: 🇺🇸 US 🔴 GPC-not-supported state' :\n\t\tisGroup3 ? 'Group 3.: 🇦🇺 Australia 🔴 GPC-not-supported state' :\n\t\t(isGpcEnabledInOneTrustAdmin && gpcEnabled && shouldDisplayBanner) ? 'Group 4.: 🇺🇸 US 🟢 GPC-supported state && 🟢 GPC signal detected = ❌ Don\\'t show the Banner' :\n\t\t'Group 5.: Default OneTrust Banner';\n\n\n\t//\n\t//\tDEV only: Debug data\n\t//\n\tconst otDebugData = {\n\t\t'otConditionGroup': otConditionGroup,\n\t\t'countryCode': countryCode,\n\t\t'stateCode': stateCode,\n\t\t'locale': locale,\n\t\t'isGpcEnabledInOneTrustAdmin': isGpcEnabledInOneTrustAdmin,\n\t\t'isGpcSignalDetected': !!gpcEnabled,\t// Does the browser transmit the GPC signal?\n\t\t'isMinimalisticBannerUsed': isMinimalisticBannerUsed,\n\t\t'IsAlertBoxClosed': OneTrust.IsAlertBoxClosed()\n\t};\n\n\t// Attach the debug method to the OneTrust object\n\tOneTrust.debug = function () {\n\t\t// Version number – to help us track which version is in production\n\t\tconsole.log(\n\t\t\t'%cOneTrustMini Banner - v1.0.5',\n\t\t\t'background: #FF7800; color: #071d2b; padding: 4px 8px; border-radius: 4px; font-size: 14px; font-weight: bold;'\n\t\t);\n\t\tconsole.table(otDebugData);\n\t};\n\n\t//\n\t//\tCreate the MiniBanner\n\t//\n\tfunction oneTrustMiniBanner() {\n\t\tif ( isGroup1 || isGroup2 || isGroup3 ) {\n\t\t\tconsole.log('OneTrustMini Banner - v1.0.5'); // Please retain the version number to help us track which version is in production.\n\t\n\t\t\t// The new HTML template for the Cookie Consent Banner will be stored here.\n\t\t\tvar otMini;\n\n\t\t\t// Helper classes\n\t\t\tconst bannerExpandedClass = 'js-expanded';\n\t\t\tconst bannerHiddenClass = 'js-hidden';\n\t\n\t\t\t// Checks if the page is an Academy page (URL starts with www.avast.com/c-)\n\t\t\tconst homepageAttr = document.body.getAttribute('data-homepage');\n\t\t\tconst isAcademyPage = homepageAttr ? homepageAttr.includes('/c-academy') : false; // Only the Academy pages have \n\n\t\t\t// Checks if template with the \"Reject\" button is used\n\t\t\tconst isGpcMinimalisticRejectAllTemplate = OneTrust.GetDomainData().BannerShowRejectAllButton; // Returns true when the \"Reject\" button is shown\n\n\n\t\t\t//\n\t\t\t//\t1. Retrieve data from the OneTrust object\n\t\t\t//\n\t\t\tconst otDomainData = OneTrust.GetDomainData();\n\n\t\t\tconst otData = {\n\t\t\t\t// The text is defined in OneTrust admin (tab \"Banner\" > \"Content\" accordion > \"Title & Description\" > \"Notice description\" textarea)\n\t\t\t\ttext: otBannerDescription.textContent || \"This site uses\",\n\t\t\t\n\t\t\t\tcookiePolicyLink: {\n\t\t\t\t\t// The text is defined in OneTrust admin (tab \"Banner\" > \"Content\" accordion > \"Cookie Policy Link\" > \"Cookie Policy Link\" input)\n\t\t\t\t\ttext: document.querySelector(\".ot-cookie-policy-link\").textContent || \"cookies\",\n\t\t\t\t\ttitle: document.querySelector(\".ot-cookie-policy-link\").getAttribute(\"aria-label\") || \"More information about your privacy\",\n\t\t\t\t\turl: otDomainData.AboutLink || \"https://www.avast.com/cookies-policy\"\n\t\t\t\t},\n\t\t\t\n\t\t\t\tbuttons: {\n\t\t\t\t\t// The text is defined in OneTrust admin (tab \"Banner\" > \"Content\" accordion > \"Button set\")\n\t\t\t\t\taccept: otDomainData.AlertAllowCookiesText || \"Accept\",\n\t\t\t\t\treject: otDomainData.BannerRejectAllButtonText || \"Reject\",\n\t\t\t\t\tmanage: otDomainData.AlertMoreInfoText || \"Manage\"\n\t\t\t\t}\n\t\t\t};\n\n\n\t\t\t// Test: Data Validation\n\t\t\t/*\n\t\t\tif (otData) {\n\t\t\t\tconsole.log(\"Testing otData values...\");\n\t\t\t\n\t\t\t\t// Create an array of objects to represent the table\n\t\t\t\tconst dataValidationTable = [\n\t\t\t\t\t{ Name: \"Text\", Value: otData.text, Expected: \"This site uses\" },\n\t\t\t\t\t{ Name: \"Cookie Policy Link Text\", Value: otData.cookiePolicyLink.text, Expected: \"cookies\" },\n\t\t\t\t\t{ Name: \"Cookie Policy Link Title\", Value: otData.cookiePolicyLink.title, Expected: \"More information about your privacy\" },\n\t\t\t\t\t{ Name: \"Cookie Policy Link URL\", Value: otData.cookiePolicyLink.url, Expected: \"https://www.avast.com/cookies-policy\" },\n\t\t\t\t\t{ Name: \"Accept Button Text\", Value: otData.buttons.accept, Expected: \"Accept\" },\n\t\t\t\t\t{ Name: \"Reject Button Text\", Value: otData.buttons.reject, Expected: \"Reject\" },\n\t\t\t\t\t{ Name: \"Manage Button Text\", Value: otData.buttons.manage, Expected: \"Manage\" }\n\t\t\t\t];\n\t\t\t\n\t\t\t\t// Log the table\n\t\t\t\tconsole.table(dataValidationTable);\n\t\t\t} else {\n\t\t\t\tconsole.error(\"otData is not defined or is null.\");\n\t\t\t}\n\t\t\t*/\n\n\n\t\t\t//\n\t\t\t// 2. Create OneTrust Mini Banner\n\t\t\t//\n\t\t\tfunction createOneTrustMiniBanner() {\n\t\t\t\t//\n\t\t\t\t// 2.1 Create main container\n\t\t\t\t//\n\t\t\t\totMini = document.createElement('div');\n\t\t\t\totMini.id = 'oneTrustMini';\n\t\t\t\totMini.tabIndex = 0; // Makes the Banner accessible via keyboard\n\t\t\t\t\n\t\t\t\t// Mobile – handle tap on the Cookie icon (Expands the banner)\n\t\t\t\totMini.addEventListener('touchend', function (e) {\n\t\t\t\t\t// Check if the 'bannerExpandedClass' is already applied\n\t\t\t\t\tif (!otMini.classList.contains(bannerExpandedClass)) {\n\t\t\t\t\t\te.preventDefault(); // Prevent default only if the banner is not expanded (without this, the 'Reject'/'Manage' button was activated when the banner expanded)\n\t\t\t\t\t\totMini.classList.add(bannerExpandedClass); // Expand the banner\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//\n\t\t\t\t// 2.2 Create Cookie icon\n\t\t\t\t//\n\t\t\t\tconst cookieIcon = document.createElement('div');\n\t\t\t\tcookieIcon.id = 'oneTrustMini__cookie-icon';\n\t\t\t\totMini.appendChild(cookieIcon);\n\t\n\t\t\t\t//\n\t\t\t\t// 2.3 Create Content container\n\t\t\t\t//\n\t\t\t\tconst contentContainer = document.createElement('div');\n\t\t\t\tcontentContainer.id = 'oneTrustMini__content';\n\t\t\t\totMini.appendChild(contentContainer);\n\t\n\t\t\t\t//\n\t\t\t\t// 2.3.1 Create Policy Text container\n\t\t\t\t//\n\t\t\t\tconst policyText = document.createElement('div');\n\t\t\t\tpolicyText.id = 'oneTrustMini__text';\n\t\n\t\t\t\t// Create the span element for the text\n\t\t\t\tconst span = document.createElement('span');\n\t\t\t\tspan.textContent = otData.text + ' '; // text \"This site uses\" + add space character after the text\n\t\n\t\t\t\t// Create Cookies policy link\n\t\t\t\tconst link = document.createElement('a');\n\t\t\t\tlink.id = 'oneTrustMini__policy-link';\n\t\t\t\tlink.href = otData.cookiePolicyLink.url;\n\t\t\t\tlink.target = '_blank';\n\t\t\t\tlink.title = otData.cookiePolicyLink.title;\n\t\t\t\tlink.textContent = otData.cookiePolicyLink.text;\n\t\n\t\t\t\t// Append content to the Text container\n\t\t\t\tpolicyText.appendChild(span);\n\t\t\t\tpolicyText.appendChild(link);\n\t\n\t\t\t\t//\n\t\t\t\t// 2.3.2 Create Buttons container\n\t\t\t\t//\n\t\t\t\tconst buttonsDiv = document.createElement('div');\n\t\t\t\tbuttonsDiv.id = 'oneTrustMini__buttons';\n\t\n\t\t\t\t// Create Accept button\n\t\t\t\tconst acceptButton = document.createElement('button');\n\t\t\t\tacceptButton.id = 'oneTrustMini--accept';\n\t\t\t\tacceptButton.textContent = otData.buttons.accept;\n\t\n\t\t\t\t// Handle click on Accept button\n\t\t\t\tacceptButton.addEventListener('click', function(){\n\t\t\t\t\tOneTrust.AllowAll(); // Call OneTrust SDK function\n\t\t\t\t\totMini.classList.add(bannerHiddenClass); // Hide the Banner\n\t\t\t\t});\n\n\n\t\t\t\t// Create secondary button (Reject / Manage)\n\t\t\t\tconst secondaryButton = document.createElement('button');\n\n\t\t\t\tif(isGpcMinimalisticRejectAllTemplate) {\n\t\t\t\t\t// Create the \"Reject\" button (California only)\n\t\t\t\t\tsecondaryButton.textContent = otData.buttons.reject;\n\n\t\t\t\t\t// Handle click on the Reject button\n\t\t\t\t\tsecondaryButton.addEventListener('click', function(){\n\t\t\t\t\t\tOneTrust.RejectAll(); // Call OneTrust SDK function\n\t\t\t\t\t\totMini.classList.add(bannerHiddenClass); // Hide the Banner\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Create the \"Manage\" button for rest of the US states\n\t\t\t\t\tsecondaryButton.textContent = otData.buttons.manage;\n\t\t\t\t\t\t\n\t\t\t\t\t// Handle click on the Manage button\n\t\t\t\t\tsecondaryButton.addEventListener('click', function(){\n\t\t\t\t\t\tOneTrust.ToggleInfoDisplay(); // Opens the OneTrust Preference Center\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Append buttons to the Buttons container\n\t\t\t\tbuttonsDiv.appendChild(acceptButton);\n\t\t\t\tbuttonsDiv.appendChild(secondaryButton);\n\t\n\t\t\t\t//\n\t\t\t\t// 2.3 Append content to the Content container\n\t\t\t\t//\n\t\t\t\tcontentContainer.appendChild(policyText);\n\t\t\t\tcontentContainer.appendChild(buttonsDiv);\n\t\n\t\t\t\t//\n\t\t\t\t// 2.4 Append the whole Banner to the body\n\t\t\t\t//\n\t\t\t\tdocument.body.appendChild(otMini);\n\n\t\t\t\t//\n\t\t\t\t// 2.5 Preference center – hide the Banner when \"Accept all\" or \"Confirm selection\" button is clicked in the Preference center\n\t\t\t\t//\n\t\t\t\tconst otPcAcceptAllButton = document.getElementById('accept-recommended-btn-handler');\t// \"Accept all\" button\n\t\t\t\tconst otPcConfirmSelectionButton = document.querySelector('.save-preference-btn-handler');\t// \"Confirm selection\" button\n\n\t\t\t\t// Handle click on \"Accept all\" button\n\t\t\t\totPcAcceptAllButton.addEventListener('click', function() {\n\t\t\t\t\totMini.classList.add(bannerHiddenClass); // Hide the Banner\n\t\t\t\t});\n\n\t\t\t\t// Handle click on \"Confirm selection\" button\n\t\t\t\totPcConfirmSelectionButton.addEventListener('click', function() {\n\t\t\t\t\totMini.classList.add(bannerHiddenClass); // Hide the Banner\n\t\t\t\t});\n\t\t\t}\n\t\t\tcreateOneTrustMiniBanner();\n\t\n\t\n\t\t\t//\n\t\t\t//\t3. Expand/Collapse OneTrust Mini banner on scroll\n\t\t\t//\n\t\t\tfunction toggleBannerOnScroll() {\n\t\t\t\twindow.addEventListener('scroll', function () {\n\t\t\t\t\t// Get the scroll position\n\t\t\t\t\tconst scrollPosition = window.scrollY || document.documentElement.scrollTop;\n\t\n\t\t\t\t\t// Expand/Collapse the Banner when scrolled more then 200px from the top\n\t\t\t\t\tif (scrollPosition > 200) {\n\t\t\t\t\t\tif (isAcademyPage) {\n\t\t\t\t\t\t\t// Collapse Banner on Academy pages\n\t\t\t\t\t\t\totMini.classList.remove(bannerExpandedClass);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Expand Banner on all other pages\n\t\t\t\t\t\t\totMini.classList.add(bannerExpandedClass);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\ttoggleBannerOnScroll();\n\n\n\t\t\t//\n\t\t\t//\t4. Academy pages\n\t\t\t//\n\t\t\tfunction academyPagesBanner() {\n\t\t\t\tif (isAcademyPage) {\n\t\t\t\t\t// Banner is open by default (and collapsed on scroll)\n\t\t\t\t\totMini.classList.add(bannerExpandedClass);\t// expand the Banner\n\n\t\t\t\t\t// Academy pages have a Sticky Bar. Move Cookie Consent Banner above the Sticky Bar\n\t\t\t\t\tfunction adjustCookieConsentBannerPositionOnAcademyPages() {\n\t\t\t\t\t\tconst bodyClasses = document.body.className.split(' ');\n\t\t\t\t\t\n\t\t\t\t\t\t// Extract platform class from (for example \"os-android\")\n\t\t\t\t\t\tfunction getPlatformClass(classes) {\n\t\t\t\t\t\t\tfor (var i = 0; i < classes.length; i++) {\n\t\t\t\t\t\t\t\tif (classes[i].startsWith('os-')) {\n\t\t\t\t\t\t\t\t\treturn classes[i];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tconst platformClass = getPlatformClass(bodyClasses);\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t//\tGet reference to Sticky bars\n\t\t\t\t\t\t//\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tAcademy pages are using 3 different sticky bars:\n\t\t\t\t\t\t\t1. mobileStickyBar – used on Article detail template (example: https://www.avast.com/c-spear-phishing)\n\t\t\t\t\t\t\t2. desktopStickyBar - used on Article detail template\n\t\t\t\t\t\t\t3. toolPageStickyBar - used on Tool page template (example: https://www.avast.com/c-virus-removal-tool)\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tconst mobileStickyBar = document.querySelector('.sticky-post-widget');\n\t\t\t\t\t\t// Get the Sticky bar currently in use (a bar exists for each platform; retrieve the appropriate one)\n\t\t\t\t\t\tconst desktopStickyBar = platformClass ? document.querySelector('.os-detect.' + platformClass + ' .sidebar-widget-transformable') : null;\n\t\t\t\t\t\tconst toolPageStickyBar = platformClass ? document.querySelector('.os-detect.' + platformClass + ' .sticky-widget') : null;\n\n\t\t\t\t\t\t// Adjust position of the Cookie Consent Banner\n\t\t\t\t\t\tfunction adjustCookieConsentBannerMargin(stickyBar, isVisible) {\n\t\t\t\t\t\t\t// when the Sticky Bar is visible, get its height and set it as margin to the Cookie Consent Banner.\n\t\t\t\t\t\t\t// when the Sticky Bar NOT visible, reset margin to 0px\n\t\t\t\t\t\t\tconst height = isVisible ? stickyBar.offsetHeight : 0;\n\t\t\t\t\t\t\totMini.style.marginBottom = height + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tfunction checkMobileStickyBarVisibility() {\n\t\t\t\t\t\t\t// check if the stickyBar exists and it's not hidden via CSS\n\t\t\t\t\t\t\tconst isVisible = mobileStickyBar && window.getComputedStyle(mobileStickyBar).display !== 'none';\n\t\t\t\t\t\t\tadjustCookieConsentBannerMargin(mobileStickyBar, isVisible);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tfunction checkDesktopStickyBarVisibility() {\n\t\t\t\t\t\t\tif (!desktopStickyBar) return;\t// check if the stickyBar exists\n\t\t\t\t\t\t\tconst style = window.getComputedStyle(desktopStickyBar);\n\t\t\t\t\t\t\t// this unique combinations indicates that the stickyBar is sticked to the bottom of the screen and is visible\n\t\t\t\t\t\t\tconst isVisible = style.display === 'flex' && style.position === 'fixed';\n\t\t\t\t\t\t\tadjustCookieConsentBannerMargin(desktopStickyBar, isVisible);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction checkToolPageStickyBarVisibility() {\n\t\t\t\t\t\t\tif (!toolPageStickyBar) return;\t// check if the stickyBar exists\n\t\t\t\t\t\t\tconst style = window.getComputedStyle(toolPageStickyBar);\n\t\t\t\t\t\t\t// this unique combinations indicates that the stickyBar is sticked to the bottom of the screen and is visible\n\t\t\t\t\t\t\tconst isVisible = style.display === 'block' && style.bottom === '0px';\n\t\t\t\t\t\t\tadjustCookieConsentBannerMargin(toolPageStickyBar, isVisible);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Only one Sticky Bar is visible at a time. Call the appropriate function.\n\t\t\t\t\t\tfunction checkStickyBarVisibility() {\n\t\t\t\t\t\t\tconst viewportWidth = window.innerWidth;\n\t\t\t\t\t\n\t\t\t\t\t\t\tif (viewportWidth < 1056) {\n\t\t\t\t\t\t\t\tcheckMobileStickyBarVisibility();\n\t\t\t\t\t\t\t\tcheckToolPageStickyBarVisibility();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcheckDesktopStickyBarVisibility();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t// Initial visibility check\n\t\t\t\t\t\tcheckStickyBarVisibility();\n\t\t\t\t\t\n\t\t\t\t\t\t// Re-check visibility on scroll and window resize\n\t\t\t\t\t\twindow.addEventListener('scroll', checkStickyBarVisibility);\n\t\t\t\t\t\twindow.addEventListener('resize', checkStickyBarVisibility);\n\t\t\t\t\t}\n\t\t\t\t\tadjustCookieConsentBannerPositionOnAcademyPages();\n\t\t\t\t}\n\t\t\t}\n\t\t\tacademyPagesBanner();\n\t\t}\n\t}\n\toneTrustMiniBanner();\n\n\n\t//\n\t//\tRelocate \"OK\" button to the buttons container\n\t//\n\t/*\n\t\tThe function relocateOKButton() handles following templates:\n\t\t- Avast – GPC UNOBTRUSIVE (+ Reject All) (MVP – California)\n\t\t- Avast – GPC UNOBTRUSIVE (MVP)\n\t*/\n\tfunction relocateOKButton() {\n\t\tvar gpcOKButton = document.getElementById(\"cookieGPCControlButton\"), // \"OK\" button (in fact, this is an element). It is stored in

(text and HTML is defined in OneTrust admin).\n\t\t\tbuttonContainer = document.querySelector(\".banner-actions-container\") // Button container (for the \"Reject all\", \"Manage...\")\n\n\t\tif (gpcOKButton) {\n\t\t\t// Relocate the \"OK\" button (move it to the buttonContainer)\n\t\t\tbuttonContainer.appendChild(gpcOKButton);\n\n\t\t\t// GPC signal is ON\n\t\t\tif (gpcEnabled) {\n\t\t\t\tgpcOKButton.addEventListener('click', function() {\n\t\t\t\t\tOneTrust.Close(); // This will \"Confirm\" default settings set by the GPS signal (user can predefine his default settings in his browser. GPS signal then \"shares\" this settings with the Cookie Consent).\n\n\t\t\t\t\t// Cookie consent was closed. Re-enable scroll on the page (used on V2 pages)\n\t\t\t\t\tdocument.body.classList.remove('ot-overflow-hidden');\n\t\t\t\t});\n\t\t\t}\n\t\t\t// GPC signal is OFF (user's browser doesn't support GPS signal)\n\t\t\telse {\n\t\t\t\tgpcOKButton.addEventListener('click', function() {\n\t\t\t\t\tOneTrust.AllowAll(); // Accept cookies and hides the OneTrust banner and overlay\n\n\t\t\t\t\t// Cookie consent was closed. Re-enable scroll on the page (used on V2 pages)\n\t\t\t\t\tdocument.body.classList.remove('ot-overflow-hidden');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\trelocateOKButton();\n}\n"]}