PageSourceSearch

https://olyra.ai/js/consent.js?v=2

js olyra.ai collected 2026-10-05 15:11:53 UTC 2,582 bytes, 55 lines download raw bytes

1/**
2 * Olyra consent module (opt-out model, LGPD/CCPA-oriented).
3 * Loads BEFORE tracking.js. Sets window.__olyraConsent:
4 *   'accepted' | 'declined' | 'unset'
5 * tracking.js only initializes when consent !== 'declined'.
6 * Declining also sets GA4 consent-mode style flag for good measure.
7 */
8(function () {
9  var KEY = "olyra_consent";
10  var state;
11  try { state = localStorage.getItem(KEY) || "unset"; } catch (e) { state = "unset"; }
12  window.__olyraConsent = state;
13
14  var STRINGS = {
15    "en": { t: "We use analytics cookies to understand how the site is used and improve it. No personal profiles are sold.", a: "Accept", d: "Decline", m: "Cookie policy" },
16    "pt-BR": { t: "Usamos cookies de análise para entender como o site é usado e melhorá-lo. Nenhum perfil pessoal é vendido.", a: "Aceitar", d: "Recusar", m: "Política de cookies" },
17    "es": { t: "Usamos cookies de análisis para entender cómo se usa el sitio y mejorarlo. No se venden perfiles personales.", a: "Aceptar", d: "Rechazar", m: "Política de cookies" }
18  };
19
20  function set(v) {
21    try { localStorage.setItem(KEY, v); } catch (e) {}
22    window.__olyraConsent = v;
23    var el = document.getElementById("olyra-consent");
24    if (el) el.remove();
25    if (v === "accepted" && window.__olyraInitTracking) window.__olyraInitTracking();
26    if (v === "declined") {
27      window["ga-disable-G-CZ34LSNZFE"] = true;
28    }
29  }
30  window.olyraConsentSet = set; /* re-openable from cookie policy page */
31
32  function banner() {
33    var lang = document.documentElement.lang || "en";
34    var s = STRINGS[lang] || STRINGS[lang.split("-")[0]] || STRINGS.en;
35    var div = document.createElement("div");
36    div.id = "olyra-consent";
37    div.setAttribute("role", "region");
38    div.setAttribute("aria-label", "Cookie consent");
39    div.innerHTML = '<p>' + s.t + ' <a href="/cookie-policy">' + s.m + '</a></p>' +
40      '<div class="h"><button type="button" class="oc-accept">' + s.a + '</button>' +
41      '<button type="button" class="oc-decline">' + s.d + "</button></div>";
42    document.body.appendChild(div);
43    div.querySelector(".oc-accept").addEventListener("click", function () { set("accepted"); });
44    div.querySelector(".oc-decline").addEventListener("click", function () { set("declined"); });
45  }
46
47  if (state === "unset") {
48    if (document.readyState === "loading") {
49      document.addEventListener("DOMContentLoaded", banner);
50    } else { banner(); }
51  }
52  if (state === "declined") {
53    window["ga-disable-G-CZ34LSNZFE"] = true;
54  }
55})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.