1import{j as m,d as y}from"./index.Ce1os6Eb.js";import"./jsonParse.DmCFq1Ah.js";const g="localeSuggestionDismissed_V6",h=30,E=1e4,L=500,p="(max-width: 1024px)",v="Locale Suggestion";function w(e,t,n){const o={event:"elysiumEvent",event_name:e,eventData:{eventCategory:v,eventAction:t,eventLabel:n?.locale||"",eventLabelValue:n?.country||"",eventPage:window.location.pathname}};typeof window.Tracker?.push=="function"?window.Tracker.push(o):Array.isArray(window.dataLayer)&&window.dataLayer.push(o)}function f(e){w("locale_suggestion_shown","Shown",e)}function i(e,t){w("locale_suggestion_clicked",e,t)}function S(e){const t=e?.querySelector("[data-locale-suggestion-country]");return{country:t?.dataset.localeSuggestionCountry||"",locale:t?.dataset.localeSuggestionLocale||""}}function D(e,t){const n=new URLSearchParams;e&&n.set("variant",e),t&&n.set("forceCountry",t);const o=n.toString();return`/fragments/localeSuggestionFragment${o?`?${o}`:""}`}function c(){const e=new Date;e.setDate(e.getDate()+h),document.cookie=`${g}=1; path=/; expires=${e.toUTCString()}; SameSite=Lax`}function d(){const e=document.getElementById("onetrust-banner-sdk");return!!e&&e.offsetParent!==null}function k(){return new Promise(e=>{if(!d()){e();return}const t=Date.now(),n=setInterval(()=>{(!d()||Date.now()-t>=E)&&(clearInterval(n),e())},L)})}async function u(){const e=document.getElementById("locale-suggestion");if(!e||e.dataset.bound==="1")return;e.dataset.bound="1";const t=new URLSearchParams(window.location.search),n=t.get("forceCountry");if(!n&&m(g))return;if(t.get("countrySelected")==="Y"){c();return}await k();const o=window.matchMedia(p).matches,r=D(o?"drawer":"",n);let a="";try{const s=await fetch(r,{credentials:"same-origin"});if(!s.ok||s.status===204)return;a=await s.text()}catch(s){console.error("Locale suggestion fetch failed",s);return}a.trim()&&(o?await C(r):A(e,a))}async function C(e){const t=document.getElementById("drawer-container");let n={},o=!1;const r=()=>{c(),o||i("Stay",n)};t?.addEventListener("close",r,{once:!0});try{await y(e,null,"locale-suggestion")}catch(l){t?.removeEventListener("close",r),console.error("Locale suggestion drawer failed",l);return}const a=document.getElementById("drawer-content");n=S(a),f(n);const s=a?.querySelector("#modal-title")?.textContent?.trim();s&&t?.setAttribute("aria-label",s),a?.querySelectorAll("[data-locale-suggestion-dismiss]").forEach(l=>l.addEventListener("click",()=>t?.querySelector(".a11y-closeBtn")?.click())),a?.querySelector("[data-locale-suggestion-switch]")?.addEventListener("click",()=>{o=!0,c(),i("Switch",n)})}function A(e,t){e.innerHTML=t;const n=S(e);f(n);let o=!1;const r=()=>{c(),o||i("Stay",n),o=!0,e.innerHTML=""};e.querySelectorAll("[data-locale-suggestion-dismiss]").forEach(a=>a.addEventListener("click",r)),e.querySelector("[data-locale-suggestion-switch]")?.addEventListener("click",()=>{c(),o||i("Switch",n),o=!0}),e.addEventListener("keydown",a=>{a.key==="Escape"&&r()})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u();
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.