var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var Lithium25; (function (Lithium25) { Lithium25.currentConsent = { analytics: true, ads: true }; var isModifying = false; var isPopup = false; var consent = localStorage.getItem("Lithium25.consent"); if (consent) Lithium25.currentConsent = JSON.parse(consent); window["lithiumSettings"] = window["lithiumSettings"] || {}; function getSetting(name) { return window["lithiumSettings"][name]; } function init() { return __awaiter(this, void 0, void 0, function () { var consentButton, consentDIV; return __generator(this, function (_a) { console.log('Lithium25: Plugin loaded'); consentButton = "
".concat(stringDictionary[getSetting("language")]["consent_edit"], "
"); consentDIV = document.getElementById("Lithium25_Consent"); if (consentDIV) { consentDIV.innerHTML = consentButton; } else { try { document.body.insertAdjacentHTML('beforeend', consentButton); } catch (_b) { } } if (consent || getURLVar("skip25")) return [2, clickAccept()]; showPopup(false); return [2]; }); }); } Lithium25.init = init; function showPopup(modifying) { return __awaiter(this, void 0, void 0, function () { var response, html, name_1, element, error_1; return __generator(this, function (_a) { switch (_a.label) { case 0: isModifying = modifying; if (isPopup) { try { document.getElementById("Lithium25_Container").style.display = "flex"; return [2]; } catch (_b) { } } _a.label = 1; case 1: _a.trys.push([1, 4, , 5]); return [4, fetch('https://lithium25.pmrd.net/popup.htm?ver=' + new Date())]; case 2: response = _a.sent(); if (!response.ok) { console.error('Lithium25: Unable to fetch popup.htm'); return [2]; } return [4, response.text()]; case 3: html = _a.sent(); if (getSetting("font")) html = replaceAll(html, "$font", "font-family:" + getSetting("font")); else html = replaceAll(html, "$font", ""); html = replaceAll(html, "$color", getSetting("theme")); html = replaceStrings(html, getSetting("language")); document.body.insertAdjacentHTML('beforeend', html); for (name_1 in Lithium25.currentConsent) { element = document.getElementById("Lithium25_Settings_" + name_1); if (Lithium25.currentConsent[name_1]) element.className = "Lithium25_SettingsRadio selected"; else element.className = "Lithium25_SettingsRadio"; } isPopup = true; return [3, 5]; case 4: error_1 = _a.sent(); console.error('Lithium25: There was a problem with the fetch operation:', error_1); return [3, 5]; case 5: return [2]; } }); }); } Lithium25.showPopup = showPopup; function showPolicy() { return __awaiter(this, void 0, void 0, function () { var lang, url, response, html; return __generator(this, function (_a) { switch (_a.label) { case 0: if (getSetting("urlPolicy")) { window.open(getSetting("urlPolicy"), "_blank"); return [2]; } lang = getSetting("language") || "french"; url = 'https://lithium25.pmrd.net/policy_' + lang + '.htm'; if (window.location.hostname === "mjlsystemes.com") url = 'https://lithium25.pmrd.net/policy_' + lang + '_mjl.htm'; return [4, fetch(url + '?ver=' + new Date())]; case 1: response = _a.sent(); if (!response.ok) { console.error('Lithium25: Network response was not ok'); return [2]; } return [4, response.text()]; case 2: html = _a.sent(); if (getSetting("notes")) { html = getSetting("notes")[getSetting("language")] + "

" + html; } html = html.replace("$email", getSetting("email")); html = html.replace("$email", getSetting("email")); html = html.replace("$email", getSetting("email")); html = html.replace("$email", getSetting("email")); document.getElementById("Lithium25_PolicyText").innerHTML = html; try { document.getElementById("Lithium25_Policy").style.display = "block"; } catch (_b) { } return [2]; } }); }); } Lithium25.showPolicy = showPolicy; function clickAccept() { localStorage.setItem("Lithium25.consent", JSON.stringify(Lithium25.currentConsent)); if (isModifying) { location.reload(); return; } if (Lithium25.currentConsent["analytics"]) { injectGoogleTag(); injectFacebookPixel(); } setTimeout(function () { if (getSetting("callback")) getSetting("callback")(); }, 3000); try { document.getElementById("Lithium25_Container").style.display = "none"; } catch (_a) { } } Lithium25.clickAccept = clickAccept; function clickSettings() { document.getElementById("Lithium25_Settings").style.display = "block"; document.getElementById("Lithium25_SettingsButton").style.backgroundColor = getSetting("theme"); document.getElementById("Lithium25_SettingsButton").style.display = "none"; document.getElementById("Lithium25_RefuseButton").style.display = "none"; document.getElementById("Lithium25_Main").scrollTop = 1000; } Lithium25.clickSettings = clickSettings; function clickCancel() { Lithium25.currentConsent.ads = false; Lithium25.currentConsent.analytics = false; localStorage.setItem("Lithium25.consent", JSON.stringify(Lithium25.currentConsent)); if (isModifying) { location.reload(); return; } document.getElementById("Lithium25_Container").style.display = "none"; } Lithium25.clickCancel = clickCancel; function setConsent(name, value) { Lithium25.currentConsent[name] = value; var element = document.getElementById("Lithium25_Settings_" + name); if (value) element.className = "Lithium25_SettingsRadio selected"; else element.className = "Lithium25_SettingsRadio"; } Lithium25.setConsent = setConsent; function toggleConsent(name) { Lithium25.currentConsent[name] = !Lithium25.currentConsent[name]; setConsent(name, Lithium25.currentConsent[name]); } Lithium25.toggleConsent = toggleConsent; function injectGoogleTag() { var e_1, _a, e_2, _b; if (!getSetting("codeGoogleTag")) return; var tags = getSetting("codeGoogleTag").split(","); try { for (var tags_1 = __values(tags), tags_1_1 = tags_1.next(); !tags_1_1.done; tags_1_1 = tags_1.next()) { var tag = tags_1_1.value; var script = document.createElement('script'); script.setAttribute('src', "https://www.googletagmanager.com/gtag/js?id=".concat(tag)); document.head.appendChild(script); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (tags_1_1 && !tags_1_1.done && (_a = tags_1.return)) _a.call(tags_1); } finally { if (e_1) throw e_1.error; } } var scriptGoogle = document.createElement('script'); scriptGoogle.innerText = "window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments)} gtag('js', new Date());"; try { for (var tags_2 = __values(tags), tags_2_1 = tags_2.next(); !tags_2_1.done; tags_2_1 = tags_2.next()) { var tag = tags_2_1.value; scriptGoogle.innerText += "gtag('config', '".concat(tag.trim(), "');"); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (tags_2_1 && !tags_2_1.done && (_b = tags_2.return)) _b.call(tags_2); } finally { if (e_2) throw e_2.error; } } document.body.appendChild(scriptGoogle); } function injectFacebookPixel() { var e_3, _a; if (!getSetting("codeFacebookPixel")) return; var tags = getSetting("codeFacebookPixel").split(","); try { for (var tags_3 = __values(tags), tags_3_1 = tags_3.next(); !tags_3_1.done; tags_3_1 = tags_3.next()) { var tag = tags_3_1.value; eval("!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '".concat(tag.trim(), "');\n fbq('track', 'PageView');")); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (tags_3_1 && !tags_3_1.done && (_a = tags_3.return)) _a.call(tags_3); } finally { if (e_3) throw e_3.error; } } } function getURLVar(name) { return new URLSearchParams(window.location.search).get(name); } function replaceAll(str, find, replace) { while (str.indexOf(find) > -1) str = str.replace(find, replace); return str; } function replaceStrings(text, language) { for (var key in stringDictionary[language]) { switch (key) { case "content": { if (getSetting("textBanner")) text = text.replace("$" + key, getSetting("textBanner")[language]); else text = text.replace("$" + key, stringDictionary[language][key]); break; } default: { text = text.replace("$" + key, stringDictionary[language][key]); break; } } } return text; } var stringDictionary = { "english": { title: "Welcome", content: "This website collects personal information in order to provide you with a personalized browsing experience and to offer you targeted advertisements. The information we collect may include your IP address and other similar data.
By using this website, you agree that we may collect and use your personal information in accordance with this privacy policy.", accept: "Agree", refuse: "Continue without accepting", settings_button: "Settings", settings_title: "Manage my preferences", cookies_mandatory: "Necessary Cookies", cookies_mandatory_desc: "Essential cookies required for the website to function properly", cookies_analytics: "Performance and Analytics", cookies_analytics_desc: "Anonymous data on site usage to improve its operation", cookies_ads: "Advertising and Marketing", cookies_ads_desc: "Data used to display relevant advertisements and measure the effectiveness of advertising campaigns.", consent_edit: "Consent choices" }, "french": { title: "Bienvenue", content: "Ce site web collecte des informations personnelles afin de vous fournir une expérience de navigation personnalisée et de vous proposer des publicités ciblées. Les informations que nous collectons peuvent inclure votre adresse IP et d'autres données similaires.

En utilisant ce site web, vous acceptez que nous puissions collecter et utiliser vos informations personnelles conformément à cette politique de confidentialité.", accept: "Accepter", refuse: "Continuer sans accepter", settings_button: "Paramètres", settings_title: "Gérer mes préférences", cookies_mandatory: "Cookies nécessaires", cookies_mandatory_desc: "Cookies obligatoire pour le bon fonctionement du site", cookies_analytics: "Performance et analyse des visites", cookies_analytics_desc: "Données anonymes sur l'utilisation du site pour améliorer son fonctionnement", cookies_ads: "Publicité et marketing", cookies_ads_desc: "Données qui servent à afficher des publicités pertinentes et mesurer l'efficacité des campagnes publicitaires.", consent_edit: "Choix de consentement" }, "spanish": { title: "Bienvenido", content: "Este sitio web recopila información personal para proporcionarle una experiencia de navegación personalizada y ofrecerle anuncios dirigidos. La información que recopilamos puede incluir su dirección IP y otros datos similares.
Al usar este sitio web, usted acepta que podemos recopilar y usar su información personal de acuerdo con esta política de privacidad.", accept: "Aceptar", refuse: "Continuar sin aceptar", settings_button: "Configuración", settings_title: "Gestionar mis preferencias", cookies_mandatory: "Cookies necesarios", cookies_mandatory_desc: "Cookies necesarios para el correcto funcionamiento del sitio", cookies_analytics: "Rendimiento y análisis de visitas", cookies_analytics_desc: "Datos anónimos sobre el uso del sitio para mejorar su funcionamiento", cookies_ads: "Publicidad y marketing", cookies_ads_desc: "Datos que se utilizan para mostrar publicidad relevante y medir la eficacia de las campañas publicitarias.", consent_edit: "Elección del consentimiento" } }; setTimeout(function () { try { init(); } catch (_a) { } }, 4000); })(Lithium25 || (Lithium25 = {}));